Commit fd1e0622 authored by Maurelian's avatar Maurelian Committed by GitHub

Revert "feat: Isthmus Contracts (#12746)"git (#12870)

* Revert "feat: Isthmus Contracts (#12746)"

This reverts commit dad10877.

* temporarily reduce heavy fuzz runs
parent 0ff55dde
...@@ -131,7 +131,7 @@ rules: ...@@ -131,7 +131,7 @@ rules:
- pattern-not: require($ERR); - pattern-not: require($ERR);
- focus-metavariable: $ERR - focus-metavariable: $ERR
- pattern-not-regex: \"(\w+:\s[^"]+)\" - pattern-not-regex: \"(\w+:\s[^"]+)\"
- pattern-not-regex: string\.concat\(\"(\w+:\s)\"[^)]+\) - pattern-not-regex: string\.concat\(\"(\w+:\s[^"]+)\"\,[^"]+\)
- pattern-not-regex: \"([a-zA-Z0-9\s]+-[a-zA-Z0-9\s]+)\" - pattern-not-regex: \"([a-zA-Z0-9\s]+-[a-zA-Z0-9\s]+)\"
- pattern-not-regex: \"([a-zA-Z0-9\s]+-[a-zA-Z0-9\s]+-[a-zA-Z0-9\s]+)\" - pattern-not-regex: \"([a-zA-Z0-9\s]+-[a-zA-Z0-9\s]+-[a-zA-Z0-9\s]+)\"
paths: paths:
...@@ -152,7 +152,7 @@ rules: ...@@ -152,7 +152,7 @@ rules:
- pattern-not: revert $ERR(...); - pattern-not: revert $ERR(...);
- focus-metavariable: $MSG - focus-metavariable: $MSG
- pattern-not-regex: \"(\w+:\s[^"]+)\" - pattern-not-regex: \"(\w+:\s[^"]+)\"
- pattern-not-regex: string\.concat\(\"(\w+:\s)\"[^)]+\) - pattern-not-regex: string\.concat\(\"(\w+:\s[^"]+)\"\,[^"]+\)
- pattern-not-regex: \"([a-zA-Z0-9\s]+-[a-zA-Z0-9\s]+)\" - pattern-not-regex: \"([a-zA-Z0-9\s]+-[a-zA-Z0-9\s]+)\"
- pattern-not-regex: \"([a-zA-Z0-9\s]+-[a-zA-Z0-9\s]+-[a-zA-Z0-9\s]+)\" - pattern-not-regex: \"([a-zA-Z0-9\s]+-[a-zA-Z0-9\s]+-[a-zA-Z0-9\s]+)\"
paths: paths:
......
...@@ -497,9 +497,6 @@ contract SemgrepTest__sol_style_malformed_require { ...@@ -497,9 +497,6 @@ contract SemgrepTest__sol_style_malformed_require {
) )
); );
// ok: sol-style-malformed-require
require(result.length > 0, string.concat("ForgeArtifacts: ", _contractName, "is not initializable"));
// ruleid: sol-style-malformed-require // ruleid: sol-style-malformed-require
require(cond, "MyContract: "); require(cond, "MyContract: ");
...@@ -544,9 +541,6 @@ contract SemgrepTest__sol_style_malformed_revert { ...@@ -544,9 +541,6 @@ contract SemgrepTest__sol_style_malformed_revert {
) )
); );
// ok: sol-style-malformed-revert
revert(string.concat("ForgeArtifacts: ", _contractName, "is not initializable"));
// ruleid: sol-style-malformed-revert // ruleid: sol-style-malformed-revert
revert("MyContract: "); revert("MyContract: ");
......
...@@ -24,7 +24,7 @@ parser.add_argument('--allocs', help='Only create the allocs and exit', type=boo ...@@ -24,7 +24,7 @@ parser.add_argument('--allocs', help='Only create the allocs and exit', type=boo
log = logging.getLogger() log = logging.getLogger()
# Global constants # Global constants
FORKS = ["delta", "ecotone", "fjord", "granite", "holocene", "isthmus"] FORKS = ["delta", "ecotone", "fjord", "granite", "holocene"]
# Global environment variables # Global environment variables
DEVNET_NO_BUILD = os.getenv('DEVNET_NO_BUILD') == "true" DEVNET_NO_BUILD = os.getenv('DEVNET_NO_BUILD') == "true"
......
...@@ -158,8 +158,6 @@ const ( ...@@ -158,8 +158,6 @@ const (
SequencerFeeVaultRecipientRole ChainOperatorRole = 9 SequencerFeeVaultRecipientRole ChainOperatorRole = 9
// SystemConfigOwner is the key that can make SystemConfig changes. // SystemConfigOwner is the key that can make SystemConfig changes.
SystemConfigOwner ChainOperatorRole = 10 SystemConfigOwner ChainOperatorRole = 10
// SystemConfigFeeAdmin is the key that can make SystemConfigFee changes.
SystemConfigFeeAdmin ChainOperatorRole = 11
) )
func (role ChainOperatorRole) String() string { func (role ChainOperatorRole) String() string {
...@@ -186,8 +184,6 @@ func (role ChainOperatorRole) String() string { ...@@ -186,8 +184,6 @@ func (role ChainOperatorRole) String() string {
return "sequencer-fee-vault-recipient" return "sequencer-fee-vault-recipient"
case SystemConfigOwner: case SystemConfigOwner:
return "system-config-owner" return "system-config-owner"
case SystemConfigFeeAdmin:
return "system-config-fee-admin"
default: default:
return fmt.Sprintf("unknown-operator-%d", uint64(role)) return fmt.Sprintf("unknown-operator-%d", uint64(role))
} }
......
...@@ -286,9 +286,6 @@ type OperatorDeployConfig struct { ...@@ -286,9 +286,6 @@ type OperatorDeployConfig struct {
// BatchSenderAddress represents the initial sequencer account that authorizes batches. // BatchSenderAddress represents the initial sequencer account that authorizes batches.
// Transactions sent from this account to the batch inbox address are considered valid. // Transactions sent from this account to the batch inbox address are considered valid.
BatchSenderAddress common.Address `json:"batchSenderAddress"` BatchSenderAddress common.Address `json:"batchSenderAddress"`
// SystemConfigfeeAdmin is the address of the account that has the ability to set the fee parameters.
SystemConfigfeeAdmin common.Address `json:"systemConfigFeeAdmin"`
} }
var _ ConfigChecker = (*OperatorDeployConfig)(nil) var _ ConfigChecker = (*OperatorDeployConfig)(nil)
......
...@@ -22,7 +22,6 @@ ...@@ -22,7 +22,6 @@
"l1GenesisBlockGasLimit": "0x1c9c380", "l1GenesisBlockGasLimit": "0x1c9c380",
"l1GenesisBlockDifficulty": "0x1", "l1GenesisBlockDifficulty": "0x1",
"finalSystemOwner": "0xbcd4042de499d14e55001ccbb24a551f3b954096", "finalSystemOwner": "0xbcd4042de499d14e55001ccbb24a551f3b954096",
"systemConfigFeeAdmin": "0xbcd4042de499d14e55001ccbb24a551f3b954096",
"superchainConfigGuardian": "0x0000000000000000000000000000000000000112", "superchainConfigGuardian": "0x0000000000000000000000000000000000000112",
"finalizationPeriodSeconds": 2, "finalizationPeriodSeconds": 2,
"l1GenesisBlockMixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "l1GenesisBlockMixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
......
...@@ -75,7 +75,6 @@ type L2Config struct { ...@@ -75,7 +75,6 @@ type L2Config struct {
Proposer common.Address Proposer common.Address
Challenger common.Address Challenger common.Address
SystemConfigOwner common.Address SystemConfigOwner common.Address
SystemConfigFeeAdmin common.Address
genesis.L2InitializationConfig genesis.L2InitializationConfig
Prefund map[common.Address]*big.Int Prefund map[common.Address]*big.Int
SaltMixer string SaltMixer string
......
...@@ -200,8 +200,7 @@ func DeployL2ToL1(l1Host *script.Host, superCfg *SuperchainConfig, superDeployme ...@@ -200,8 +200,7 @@ func DeployL2ToL1(l1Host *script.Host, superCfg *SuperchainConfig, superDeployme
l1Host.SetTxOrigin(cfg.Deployer) l1Host.SetTxOrigin(cfg.Deployer)
output, err := opcm.DeployOPChainIsthmus(l1Host, opcm.DeployOPChainInputIsthmus{ output, err := opcm.DeployOPChainV160(l1Host, opcm.DeployOPChainInputV160{
DeployOPChainInputV160: opcm.DeployOPChainInputV160{
OpChainProxyAdminOwner: cfg.ProxyAdminOwner, OpChainProxyAdminOwner: cfg.ProxyAdminOwner,
SystemConfigOwner: cfg.SystemConfigOwner, SystemConfigOwner: cfg.SystemConfigOwner,
Batcher: cfg.BatchSenderAddress, Batcher: cfg.BatchSenderAddress,
...@@ -219,8 +218,7 @@ func DeployL2ToL1(l1Host *script.Host, superCfg *SuperchainConfig, superDeployme ...@@ -219,8 +218,7 @@ func DeployL2ToL1(l1Host *script.Host, superCfg *SuperchainConfig, superDeployme
DisputeMaxGameDepth: cfg.DisputeMaxGameDepth, DisputeMaxGameDepth: cfg.DisputeMaxGameDepth,
DisputeSplitDepth: cfg.DisputeSplitDepth, DisputeSplitDepth: cfg.DisputeSplitDepth,
DisputeClockExtension: cfg.DisputeClockExtension, DisputeClockExtension: cfg.DisputeClockExtension,
DisputeMaxClockDuration: cfg.DisputeMaxClockDuration}, DisputeMaxClockDuration: cfg.DisputeMaxClockDuration,
SystemConfigFeeAdmin: cfg.SystemConfigFeeAdmin,
}) })
if err != nil { if err != nil {
return nil, fmt.Errorf("failed to deploy L2 OP chain: %w", err) return nil, fmt.Errorf("failed to deploy L2 OP chain: %w", err)
......
...@@ -178,17 +178,12 @@ func InteropL2DevConfig(l1ChainID, l2ChainID uint64, addrs devkeys.Addresses) (* ...@@ -178,17 +178,12 @@ func InteropL2DevConfig(l1ChainID, l2ChainID uint64, addrs devkeys.Addresses) (*
if err != nil { if err != nil {
return nil, err return nil, err
} }
systemConfigFeeAdmin, err := addrs.Address(chainOps(devkeys.SystemConfigFeeAdmin))
if err != nil {
return nil, err
}
l2Cfg := &L2Config{ l2Cfg := &L2Config{
Deployer: deployer, Deployer: deployer,
Proposer: proposer, Proposer: proposer,
Challenger: challenger, Challenger: challenger,
SystemConfigOwner: systemConfigOwner, SystemConfigOwner: systemConfigOwner,
SystemConfigFeeAdmin: systemConfigFeeAdmin,
L2InitializationConfig: genesis.L2InitializationConfig{ L2InitializationConfig: genesis.L2InitializationConfig{
DevDeployConfig: genesis.DevDeployConfig{ DevDeployConfig: genesis.DevDeployConfig{
FundDevAccounts: true, FundDevAccounts: true,
......
...@@ -12,7 +12,6 @@ import ( ...@@ -12,7 +12,6 @@ import (
"time" "time"
altda "github.com/ethereum-optimism/optimism/op-alt-da" altda "github.com/ethereum-optimism/optimism/op-alt-da"
"github.com/ethereum-optimism/optimism/op-chain-ops/foundry"
"github.com/ethereum-optimism/optimism/op-deployer/pkg/deployer/inspect" "github.com/ethereum-optimism/optimism/op-deployer/pkg/deployer/inspect"
"github.com/ethereum-optimism/optimism/op-node/rollup" "github.com/ethereum-optimism/optimism/op-node/rollup"
...@@ -126,7 +125,7 @@ func TestEndToEndApply(t *testing.T) { ...@@ -126,7 +125,7 @@ func TestEndToEndApply(t *testing.T) {
}) })
require.NoError(t, err) require.NoError(t, err)
env, bundle, _ := createEnv(t, lgr, l1Client, bcaster, deployerAddr, localArtifactsFactory, localArtifactsFactory) env, bundle, _ := createEnv(t, lgr, l1Client, bcaster, deployerAddr)
intent, st := newIntent(t, l1ChainID, dk, l2ChainID1, loc, loc) intent, st := newIntent(t, l1ChainID, dk, l2ChainID1, loc, loc)
cg := ethClientCodeGetter(ctx, l1Client) cg := ethClientCodeGetter(ctx, l1Client)
...@@ -146,7 +145,7 @@ func TestEndToEndApply(t *testing.T) { ...@@ -146,7 +145,7 @@ func TestEndToEndApply(t *testing.T) {
t.Run("subsequent chain", func(t *testing.T) { t.Run("subsequent chain", func(t *testing.T) {
// create a new environment with wiped state to ensure we can continue using the // create a new environment with wiped state to ensure we can continue using the
// state from the previous deployment // state from the previous deployment
env, bundle, _ = createEnv(t, lgr, l1Client, bcaster, deployerAddr, localArtifactsFactory, localArtifactsFactory) env, bundle, _ = createEnv(t, lgr, l1Client, bcaster, deployerAddr)
intent.Chains = append(intent.Chains, newChainIntent(t, dk, l1ChainID, l2ChainID2)) intent.Chains = append(intent.Chains, newChainIntent(t, dk, l1ChainID, l2ChainID2))
require.NoError(t, deployer.ApplyPipeline( require.NoError(t, deployer.ApplyPipeline(
...@@ -208,17 +207,7 @@ func TestApplyExistingOPCM(t *testing.T) { ...@@ -208,17 +207,7 @@ func TestApplyExistingOPCM(t *testing.T) {
}) })
require.NoError(t, err) require.NoError(t, err)
// use the l2 contracts here because the v1.7.0 contracts are compatible with the v1.6.0 env, bundle, _ := createEnv(t, lgr, l1Client, bcaster, deployerAddr)
// contracts and createEnv uses the same artifacts for both L1/L2 in the bundle.
env, bundle, _ := createEnv(
t,
lgr,
l1Client,
bcaster,
deployerAddr,
taggedArtifactsFactory(standard.DefaultL1ContractsTag),
taggedArtifactsFactory(standard.DefaultL2ContractsTag),
)
intent, st := newIntent( intent, st := newIntent(
t, t,
...@@ -390,8 +379,7 @@ func TestProofParamOverrides(t *testing.T) { ...@@ -390,8 +379,7 @@ func TestProofParamOverrides(t *testing.T) {
} }
for _, tt := range tests { for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) { t.Run(tt.name, func(t *testing.T) {
err := checkImmutable(t, allocs, tt.address, tt.caster(t, intent.GlobalDeployOverrides[tt.name])) checkImmutable(t, allocs, tt.address, tt.caster(t, intent.GlobalDeployOverrides[tt.name]))
require.NoError(t, err)
}) })
} }
} }
...@@ -415,9 +403,9 @@ func TestInteropDeployment(t *testing.T) { ...@@ -415,9 +403,9 @@ func TestInteropDeployment(t *testing.T) {
chainState := st.Chains[0] chainState := st.Chains[0]
depManagerSlot := common.HexToHash("0x1708e077affb93e89be2665fb0fb72581be66f84dc00d25fed755ae911905b1c") depManagerSlot := common.HexToHash("0x1708e077affb93e89be2665fb0fb72581be66f84dc00d25fed755ae911905b1c")
require.NoError(t, checkImmutable(t, st.L1StateDump.Data.Accounts, st.ImplementationsDeployment.SystemConfigImplAddress, depManagerSlot)) checkImmutable(t, st.L1StateDump.Data.Accounts, st.ImplementationsDeployment.SystemConfigImplAddress, depManagerSlot)
systemConfigOwnerHash := common.BytesToHash(intent.Chains[0].Roles.SystemConfigOwner.Bytes()) proxyAdminOwnerHash := common.BytesToHash(intent.Chains[0].Roles.SystemConfigOwner.Bytes())
checkStorageSlot(t, st.L1StateDump.Data.Accounts, chainState.SystemConfigProxyAddress, depManagerSlot, systemConfigOwnerHash) checkStorageSlot(t, st.L1StateDump.Data.Accounts, chainState.SystemConfigProxyAddress, depManagerSlot, proxyAdminOwnerHash)
} }
func TestAltDADeployment(t *testing.T) { func TestAltDADeployment(t *testing.T) {
...@@ -524,7 +512,7 @@ func TestInvalidL2Genesis(t *testing.T) { ...@@ -524,7 +512,7 @@ func TestInvalidL2Genesis(t *testing.T) {
} }
for _, tt := range tests { for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) { t.Run(tt.name, func(t *testing.T) {
env, bundle, _ := createEnv(t, lgr, nil, broadcaster.NoopBroadcaster(), deployerAddr, localArtifactsFactory, localArtifactsFactory) env, bundle, _ := createEnv(t, lgr, nil, broadcaster.NoopBroadcaster(), deployerAddr)
intent, st := newIntent(t, l1ChainID, dk, l2ChainID1, loc, loc) intent, st := newIntent(t, l1ChainID, dk, l2ChainID1, loc, loc)
intent.Chains = append(intent.Chains, newChainIntent(t, dk, l1ChainID, l2ChainID1)) intent.Chains = append(intent.Chains, newChainIntent(t, dk, l1ChainID, l2ChainID1))
intent.DeploymentStrategy = state.DeploymentStrategyGenesis intent.DeploymentStrategy = state.DeploymentStrategyGenesis
...@@ -558,42 +546,27 @@ func setupGenesisChain(t *testing.T) (*pipeline.Env, pipeline.ArtifactsBundle, * ...@@ -558,42 +546,27 @@ func setupGenesisChain(t *testing.T) (*pipeline.Env, pipeline.ArtifactsBundle, *
loc, _ := testutil.LocalArtifacts(t) loc, _ := testutil.LocalArtifacts(t)
env, bundle, _ := createEnv(t, lgr, nil, broadcaster.NoopBroadcaster(), deployerAddr, localArtifactsFactory, localArtifactsFactory) env, bundle, _ := createEnv(t, lgr, nil, broadcaster.NoopBroadcaster(), deployerAddr)
intent, st := newIntent(t, l1ChainID, dk, l2ChainID1, loc, loc) intent, st := newIntent(t, l1ChainID, dk, l2ChainID1, loc, loc)
intent.Chains = append(intent.Chains, newChainIntent(t, dk, l1ChainID, l2ChainID1)) intent.Chains = append(intent.Chains, newChainIntent(t, dk, l1ChainID, l2ChainID1))
intent.DeploymentStrategy = state.DeploymentStrategyGenesis intent.DeploymentStrategy = state.DeploymentStrategyGenesis
return env, bundle, intent, st return env, bundle, intent, st
} }
type artifactsFactory func(t *testing.T) (*artifacts.Locator, foundry.StatDirFs)
func localArtifactsFactory(t *testing.T) (*artifacts.Locator, foundry.StatDirFs) {
return testutil.LocalArtifacts(t)
}
func taggedArtifactsFactory(tag string) artifactsFactory {
return func(t *testing.T) (*artifacts.Locator, foundry.StatDirFs) {
return testutil.ArtifactsFromURL(t, fmt.Sprintf("tag://%s", tag))
}
}
func createEnv( func createEnv(
t *testing.T, t *testing.T,
lgr log.Logger, lgr log.Logger,
l1Client *ethclient.Client, l1Client *ethclient.Client,
bcaster broadcaster.Broadcaster, bcaster broadcaster.Broadcaster,
deployerAddr common.Address, deployerAddr common.Address,
l1Factory artifactsFactory,
l2Factory artifactsFactory,
) (*pipeline.Env, pipeline.ArtifactsBundle, *script.Host) { ) (*pipeline.Env, pipeline.ArtifactsBundle, *script.Host) {
_, l1AFS := l1Factory(t) _, artifactsFS := testutil.LocalArtifacts(t)
_, l2AFS := l2Factory(t)
host, err := env.DefaultScriptHost( host, err := env.DefaultScriptHost(
bcaster, bcaster,
lgr, lgr,
deployerAddr, deployerAddr,
l1AFS, artifactsFS,
0, 0,
) )
require.NoError(t, err) require.NoError(t, err)
...@@ -608,8 +581,8 @@ func createEnv( ...@@ -608,8 +581,8 @@ func createEnv(
} }
bundle := pipeline.ArtifactsBundle{ bundle := pipeline.ArtifactsBundle{
L1: l1AFS, L1: artifactsFS,
L2: l2AFS, L2: artifactsFS,
} }
return env, bundle, host return env, bundle, host
...@@ -662,7 +635,6 @@ func newChainIntent(t *testing.T, dk *devkeys.MnemonicDevKeys, l1ChainID *big.In ...@@ -662,7 +635,6 @@ func newChainIntent(t *testing.T, dk *devkeys.MnemonicDevKeys, l1ChainID *big.In
L1ProxyAdminOwner: addrFor(t, dk, devkeys.L2ProxyAdminOwnerRole.Key(l1ChainID)), L1ProxyAdminOwner: addrFor(t, dk, devkeys.L2ProxyAdminOwnerRole.Key(l1ChainID)),
L2ProxyAdminOwner: addrFor(t, dk, devkeys.L2ProxyAdminOwnerRole.Key(l1ChainID)), L2ProxyAdminOwner: addrFor(t, dk, devkeys.L2ProxyAdminOwnerRole.Key(l1ChainID)),
SystemConfigOwner: addrFor(t, dk, devkeys.SystemConfigOwner.Key(l1ChainID)), SystemConfigOwner: addrFor(t, dk, devkeys.SystemConfigOwner.Key(l1ChainID)),
SystemConfigFeeAdmin: addrFor(t, dk, devkeys.SystemConfigFeeAdmin.Key(l1ChainID)),
UnsafeBlockSigner: addrFor(t, dk, devkeys.SequencerP2PRole.Key(l1ChainID)), UnsafeBlockSigner: addrFor(t, dk, devkeys.SequencerP2PRole.Key(l1ChainID)),
Batcher: addrFor(t, dk, devkeys.BatcherRole.Key(l1ChainID)), Batcher: addrFor(t, dk, devkeys.BatcherRole.Key(l1ChainID)),
Proposer: addrFor(t, dk, devkeys.ProposerRole.Key(l1ChainID)), Proposer: addrFor(t, dk, devkeys.ProposerRole.Key(l1ChainID)),
...@@ -767,20 +739,17 @@ func validateOPChainDeployment(t *testing.T, cg codeGetter, st *state.State, int ...@@ -767,20 +739,17 @@ func validateOPChainDeployment(t *testing.T, cg codeGetter, st *state.State, int
alloc := chainState.Allocs.Data.Accounts alloc := chainState.Allocs.Data.Accounts
chainIntent := intent.Chains[i] chainIntent := intent.Chains[i]
checkImmutableBehindProxy(t, alloc, predeploys.BaseFeeVaultAddr, chainIntent.BaseFeeVaultRecipient)
// First try to read the owner from the bytecode, which is the situation with the checkImmutableBehindProxy(t, alloc, predeploys.L1FeeVaultAddr, chainIntent.L1FeeVaultRecipient)
// Isthmus L2ProxyAdmin (on this commit). checkImmutableBehindProxy(t, alloc, predeploys.SequencerFeeVaultAddr, chainIntent.SequencerFeeVaultRecipient)
if err := checkImmutableBehindProxy(t, alloc, predeploys.ProxyAdminAddr, common.HexToAddress("0xDeaDDEaDDeAdDeAdDEAdDEaddeAddEAdDEAd0001")); err != nil { checkImmutableBehindProxy(t, alloc, predeploys.OptimismMintableERC721FactoryAddr, common.BigToHash(new(big.Int).SetUint64(intent.L1ChainID)))
t.Logf("Warning: Failed to check immutable behind proxy for L2ProxyAdmin, falling back to <=v1.6.0 storage check")
// If the bytecode check fails, fall back to reading the owner from storage. // ownership slots
// Note however that the L2ProxyAdmin owner address here (0xe59a881b2626f948f56f509f180c32428585629a) comes from the chainIntent, var addrAsSlot common.Hash
// and does not actually match the `owner()` of the L2ProxyAdmin contract deployed on Sepolia (0x2FC3ffc903729a0f03966b917003800B145F67F3). addrAsSlot.SetBytes(chainIntent.Roles.L1ProxyAdminOwner.Bytes())
// It seems the L2 state is locally constructed rather than pulled from an L2 RPC. // slot 0
var L2ProxyAdminOwner common.Hash ownerSlot := common.Hash{}
L2ProxyAdminOwner.SetBytes(chainIntent.Roles.L2ProxyAdminOwner.Bytes()) checkStorageSlot(t, alloc, predeploys.ProxyAdminAddr, ownerSlot, addrAsSlot)
checkStorageSlot(t, alloc, predeploys.ProxyAdminAddr, common.Hash{}, L2ProxyAdminOwner)
}
var defaultGovOwner common.Hash var defaultGovOwner common.Hash
defaultGovOwner.SetBytes(common.HexToAddress("0xDeaDDEaDDeAdDeAdDEAdDEaddeAddEAdDEAdDEad").Bytes()) defaultGovOwner.SetBytes(common.HexToAddress("0xDeaDDEaDDeAdDeAdDEAdDEaddeAddEAdDEAdDEad").Bytes())
checkStorageSlot(t, alloc, predeploys.GovernanceTokenAddr, common.Hash{31: 0x0a}, defaultGovOwner) checkStorageSlot(t, alloc, predeploys.GovernanceTokenAddr, common.Hash{31: 0x0a}, defaultGovOwner)
...@@ -801,23 +770,20 @@ type bytesMarshaler interface { ...@@ -801,23 +770,20 @@ type bytesMarshaler interface {
Bytes() []byte Bytes() []byte
} }
func checkImmutableBehindProxy(t *testing.T, allocations types.GenesisAlloc, proxyContract common.Address, thing bytesMarshaler) error { func checkImmutableBehindProxy(t *testing.T, allocations types.GenesisAlloc, proxyContract common.Address, thing bytesMarshaler) {
implementationAddress := getEIP1967ImplementationAddress(t, allocations, proxyContract) implementationAddress := getEIP1967ImplementationAddress(t, allocations, proxyContract)
return checkImmutable(t, allocations, implementationAddress, thing) checkImmutable(t, allocations, implementationAddress, thing)
} }
func checkImmutable(t *testing.T, allocations types.GenesisAlloc, implementationAddress common.Address, thing bytesMarshaler) error { func checkImmutable(t *testing.T, allocations types.GenesisAlloc, implementationAddress common.Address, thing bytesMarshaler) {
account, ok := allocations[implementationAddress] account, ok := allocations[implementationAddress]
if !ok { require.True(t, ok, "%s not found in allocations", implementationAddress)
return fmt.Errorf("%s not found in allocations", implementationAddress) require.NotEmpty(t, account.Code, "%s should have code", implementationAddress)
} require.True(
if len(account.Code) == 0 { t,
return fmt.Errorf("%s should have code", implementationAddress) bytes.Contains(account.Code, thing.Bytes()),
} "%s code should contain %s immutable", implementationAddress, hex.EncodeToString(thing.Bytes()),
if !bytes.Contains(account.Code, thing.Bytes()) { )
return fmt.Errorf("%s code should contain %s immutable", implementationAddress, hex.EncodeToString(thing.Bytes()))
}
return nil
} }
func checkStorageSlot(t *testing.T, allocs types.GenesisAlloc, address common.Address, slot common.Hash, expected common.Hash) { func checkStorageSlot(t *testing.T, allocs types.GenesisAlloc, address common.Address, slot common.Hash, expected common.Hash) {
......
...@@ -59,7 +59,7 @@ type opcmDeployInputV160 struct { ...@@ -59,7 +59,7 @@ type opcmDeployInputV160 struct {
type opcmRolesIsthmus struct { type opcmRolesIsthmus struct {
opcmRolesBase opcmRolesBase
SystemConfigFeeAdmin common.Address FeeAdmin common.Address
} }
type opcmDeployInputIsthmus struct { type opcmDeployInputIsthmus struct {
...@@ -136,7 +136,7 @@ func DeployOPChainInputIsthmusDeployCalldata(input DeployOPChainInputIsthmus) an ...@@ -136,7 +136,7 @@ func DeployOPChainInputIsthmusDeployCalldata(input DeployOPChainInputIsthmus) an
return opcmDeployInputIsthmus{ return opcmDeployInputIsthmus{
Roles: opcmRolesIsthmus{ Roles: opcmRolesIsthmus{
opcmRolesBase: v160Data.Roles, opcmRolesBase: v160Data.Roles,
SystemConfigFeeAdmin: input.SystemConfigFeeAdmin, FeeAdmin: input.SystemConfigFeeAdmin,
}, },
opcmDeployInputBase: v160Data.opcmDeployInputBase, opcmDeployInputBase: v160Data.opcmDeployInputBase,
} }
......
...@@ -276,7 +276,7 @@ func makeDCIIsthmus(intent *state.Intent, thisIntent *state.ChainIntent, chainID ...@@ -276,7 +276,7 @@ func makeDCIIsthmus(intent *state.Intent, thisIntent *state.ChainIntent, chainID
return opcm.DeployOPChainInputIsthmus{ return opcm.DeployOPChainInputIsthmus{
DeployOPChainInputV160: dci, DeployOPChainInputV160: dci,
SystemConfigFeeAdmin: thisIntent.Roles.SystemConfigFeeAdmin, SystemConfigFeeAdmin: common.Address{'D', 'E', 'A', 'D'},
}, nil }, nil
} }
......
...@@ -176,8 +176,6 @@ type ChainRoles struct { ...@@ -176,8 +176,6 @@ type ChainRoles struct {
SystemConfigOwner common.Address `json:"systemConfigOwner" toml:"systemConfigOwner"` SystemConfigOwner common.Address `json:"systemConfigOwner" toml:"systemConfigOwner"`
SystemConfigFeeAdmin common.Address `json:"systemConfigFeeAdmin" toml:"systemConfigFeeAdmin"`
UnsafeBlockSigner common.Address `json:"unsafeBlockSigner" toml:"unsafeBlockSigner"` UnsafeBlockSigner common.Address `json:"unsafeBlockSigner" toml:"unsafeBlockSigner"`
Batcher common.Address `json:"batcher" toml:"batcher"` Batcher common.Address `json:"batcher" toml:"batcher"`
...@@ -201,10 +199,6 @@ func (c *ChainIntent) Check() error { ...@@ -201,10 +199,6 @@ func (c *ChainIntent) Check() error {
c.Roles.SystemConfigOwner = c.Roles.L1ProxyAdminOwner c.Roles.SystemConfigOwner = c.Roles.L1ProxyAdminOwner
} }
if c.Roles.SystemConfigFeeAdmin == emptyAddress {
return fmt.Errorf("systemConfigFeeAdmin must be set")
}
if c.Roles.L2ProxyAdminOwner == emptyAddress { if c.Roles.L2ProxyAdminOwner == emptyAddress {
return fmt.Errorf("l2ProxyAdminOwner must be set") return fmt.Errorf("l2ProxyAdminOwner must be set")
} }
......
...@@ -3,35 +3,31 @@ package testutil ...@@ -3,35 +3,31 @@ package testutil
import ( import (
"context" "context"
"fmt" "fmt"
"net/url"
"path" "path"
"runtime" "runtime"
"testing" "testing"
"github.com/ethereum-optimism/optimism/op-service/testlog" artifacts2 "github.com/ethereum-optimism/optimism/op-deployer/pkg/deployer/artifacts"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum-optimism/optimism/op-deployer/pkg/deployer/artifacts"
"github.com/ethereum-optimism/optimism/op-chain-ops/foundry" "github.com/ethereum-optimism/optimism/op-chain-ops/foundry"
op_service "github.com/ethereum-optimism/optimism/op-service" op_service "github.com/ethereum-optimism/optimism/op-service"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
) )
func LocalArtifacts(t *testing.T) (*artifacts.Locator, foundry.StatDirFs) { func LocalArtifacts(t *testing.T) (*artifacts2.Locator, foundry.StatDirFs) {
_, testFilename, _, ok := runtime.Caller(0) _, testFilename, _, ok := runtime.Caller(0)
require.Truef(t, ok, "failed to get test filename") require.Truef(t, ok, "failed to get test filename")
monorepoDir, err := op_service.FindMonorepoRoot(testFilename) monorepoDir, err := op_service.FindMonorepoRoot(testFilename)
require.NoError(t, err) require.NoError(t, err)
artifactsDir := path.Join(monorepoDir, "packages", "contracts-bedrock", "forge-artifacts") artifactsDir := path.Join(monorepoDir, "packages", "contracts-bedrock", "forge-artifacts")
return ArtifactsFromURL(t, fmt.Sprintf("file://%s", artifactsDir)) artifactsURL, err := url.Parse(fmt.Sprintf("file://%s", artifactsDir))
} require.NoError(t, err)
loc := &artifacts2.Locator{
func ArtifactsFromURL(t *testing.T, artifactsURLStr string) (*artifacts.Locator, foundry.StatDirFs) { URL: artifactsURL,
loc := new(artifacts.Locator) }
require.NoError(t, loc.UnmarshalText([]byte(artifactsURLStr)))
progressor := artifacts.LogProgressor(testlog.Logger(t, log.LevelInfo)) artifactsFS, cleanupArtifacts, err := artifacts2.Download(context.Background(), loc, artifacts2.NoopDownloadProgressor)
artifactsFS, cleanupArtifacts, err := artifacts.Download(context.Background(), loc, progressor)
require.NoError(t, err) require.NoError(t, err)
t.Cleanup(func() { t.Cleanup(func() {
_ = cleanupArtifacts() _ = cleanupArtifacts()
......
This diff is collapsed.
...@@ -159,21 +159,18 @@ func setCustomGasToken(t *testing.T, cfg e2esys.SystemConfig, sys *e2esys.System ...@@ -159,21 +159,18 @@ func setCustomGasToken(t *testing.T, cfg e2esys.SystemConfig, sys *e2esys.System
require.NoError(t, err) require.NoError(t, err)
// Get existing parameters from SystemConfigProxy contract // Get existing parameters from SystemConfigProxy contract
roles := bindings.SystemConfigRoles{} owner, err := systemConfig.Owner(&bind.CallOpts{})
roles.Owner, err = systemConfig.Owner(&bind.CallOpts{})
require.NoError(t, err)
roles.FeeAdmin, err = systemConfig.FeeAdmin(&bind.CallOpts{})
require.NoError(t, err)
roles.UnsafeBlockSigner, err = systemConfig.UnsafeBlockSigner(&bind.CallOpts{})
require.NoError(t, err)
roles.BatcherHash, err = systemConfig.BatcherHash(&bind.CallOpts{})
require.NoError(t, err) require.NoError(t, err)
basefeeScalar, err := systemConfig.BasefeeScalar(&bind.CallOpts{}) basefeeScalar, err := systemConfig.BasefeeScalar(&bind.CallOpts{})
require.NoError(t, err) require.NoError(t, err)
blobbasefeeScalar, err := systemConfig.BlobbasefeeScalar(&bind.CallOpts{}) blobbasefeeScalar, err := systemConfig.BlobbasefeeScalar(&bind.CallOpts{})
require.NoError(t, err) require.NoError(t, err)
batcherHash, err := systemConfig.BatcherHash(&bind.CallOpts{})
require.NoError(t, err)
gasLimit, err := systemConfig.GasLimit(&bind.CallOpts{}) gasLimit, err := systemConfig.GasLimit(&bind.CallOpts{})
require.NoError(t, err) require.NoError(t, err)
unsafeBlockSigner, err := systemConfig.UnsafeBlockSigner(&bind.CallOpts{})
require.NoError(t, err)
resourceConfig, err := systemConfig.ResourceConfig(&bind.CallOpts{}) resourceConfig, err := systemConfig.ResourceConfig(&bind.CallOpts{})
require.NoError(t, err) require.NoError(t, err)
batchInbox, err := systemConfig.BatchInbox(&bind.CallOpts{}) batchInbox, err := systemConfig.BatchInbox(&bind.CallOpts{})
...@@ -231,10 +228,12 @@ func setCustomGasToken(t *testing.T, cfg e2esys.SystemConfig, sys *e2esys.System ...@@ -231,10 +228,12 @@ func setCustomGasToken(t *testing.T, cfg e2esys.SystemConfig, sys *e2esys.System
waitForTx(t, tx, err, l1Client) waitForTx(t, tx, err, l1Client)
// Reinitialise with existing initializer values but with custom gas token set // Reinitialise with existing initializer values but with custom gas token set
tx, err = systemConfig.Initialize(deployerOpts, roles, tx, err = systemConfig.Initialize(deployerOpts, owner,
basefeeScalar, basefeeScalar,
blobbasefeeScalar, blobbasefeeScalar,
batcherHash,
gasLimit, gasLimit,
unsafeBlockSigner,
resourceConfig, resourceConfig,
batchInbox, batchInbox,
addresses) addresses)
......
...@@ -4,14 +4,14 @@ GasBenchMark_L1BlockInterop_SetValuesInterop:test_setL1BlockValuesInterop_benchm ...@@ -4,14 +4,14 @@ GasBenchMark_L1BlockInterop_SetValuesInterop:test_setL1BlockValuesInterop_benchm
GasBenchMark_L1BlockInterop_SetValuesInterop_Warm:test_setL1BlockValuesInterop_benchmark() (gas: 5099) GasBenchMark_L1BlockInterop_SetValuesInterop_Warm:test_setL1BlockValuesInterop_benchmark() (gas: 5099)
GasBenchMark_L1Block_SetValuesEcotone:test_setL1BlockValuesEcotone_benchmark() (gas: 158531) GasBenchMark_L1Block_SetValuesEcotone:test_setL1BlockValuesEcotone_benchmark() (gas: 158531)
GasBenchMark_L1Block_SetValuesEcotone_Warm:test_setL1BlockValuesEcotone_benchmark() (gas: 7597) GasBenchMark_L1Block_SetValuesEcotone_Warm:test_setL1BlockValuesEcotone_benchmark() (gas: 7597)
GasBenchMark_L1CrossDomainMessenger:test_sendMessage_benchmark_0() (gas: 367239) GasBenchMark_L1CrossDomainMessenger:test_sendMessage_benchmark_0() (gas: 369280)
GasBenchMark_L1CrossDomainMessenger:test_sendMessage_benchmark_1() (gas: 2965379) GasBenchMark_L1CrossDomainMessenger:test_sendMessage_benchmark_1() (gas: 2967420)
GasBenchMark_L1StandardBridge_Deposit:test_depositERC20_benchmark_0() (gas: 560245) GasBenchMark_L1StandardBridge_Deposit:test_depositERC20_benchmark_0() (gas: 564398)
GasBenchMark_L1StandardBridge_Deposit:test_depositERC20_benchmark_1() (gas: 4072288) GasBenchMark_L1StandardBridge_Deposit:test_depositERC20_benchmark_1() (gas: 4076613)
GasBenchMark_L1StandardBridge_Deposit:test_depositETH_benchmark_0() (gas: 462746) GasBenchMark_L1StandardBridge_Deposit:test_depositETH_benchmark_0() (gas: 467098)
GasBenchMark_L1StandardBridge_Deposit:test_depositETH_benchmark_1() (gas: 3508450) GasBenchMark_L1StandardBridge_Deposit:test_depositETH_benchmark_1() (gas: 3512802)
GasBenchMark_L1StandardBridge_Finalize:test_finalizeETHWithdrawal_benchmark() (gas: 70492) GasBenchMark_L1StandardBridge_Finalize:test_finalizeETHWithdrawal_benchmark() (gas: 72664)
GasBenchMark_L2OutputOracle:test_proposeL2Output_benchmark() (gas: 92973) GasBenchMark_L2OutputOracle:test_proposeL2Output_benchmark() (gas: 92973)
GasBenchMark_OptimismPortal:test_depositTransaction_benchmark() (gas: 68366) GasBenchMark_OptimismPortal:test_depositTransaction_benchmark() (gas: 68422)
GasBenchMark_OptimismPortal:test_depositTransaction_benchmark_1() (gas: 68930) GasBenchMark_OptimismPortal:test_depositTransaction_benchmark_1() (gas: 68986)
GasBenchMark_OptimismPortal:test_proveWithdrawalTransaction_benchmark() (gas: 155655) GasBenchMark_OptimismPortal:test_proveWithdrawalTransaction_benchmark() (gas: 155610)
\ No newline at end of file \ No newline at end of file
...@@ -27,7 +27,6 @@ ...@@ -27,7 +27,6 @@
"sequencerFeeVaultWithdrawalNetwork": 0, "sequencerFeeVaultWithdrawalNetwork": 0,
"proxyAdminOwner": "0xa0Ee7A142d267C1f36714E4a8F75612F20a79720", "proxyAdminOwner": "0xa0Ee7A142d267C1f36714E4a8F75612F20a79720",
"finalSystemOwner": "0xa0Ee7A142d267C1f36714E4a8F75612F20a79720", "finalSystemOwner": "0xa0Ee7A142d267C1f36714E4a8F75612F20a79720",
"systemConfigFeeAdmin": "0xa0Ee7A142d267C1f36714E4a8F75612F20a79720",
"superchainConfigGuardian": "0xa0Ee7A142d267C1f36714E4a8F75612F20a79720", "superchainConfigGuardian": "0xa0Ee7A142d267C1f36714E4a8F75612F20a79720",
"finalizationPeriodSeconds": 2, "finalizationPeriodSeconds": 2,
"fundDevAccounts": true, "fundDevAccounts": true,
......
{ {
"finalSystemOwner": "0x9965507D1a55bcC2695C58ba16FB37d819B0A4dc", "finalSystemOwner": "0x9965507D1a55bcC2695C58ba16FB37d819B0A4dc",
"systemConfigFeeAdmin": "0x976EA74026E726554dB657fA54763abd0C3a0aa9",
"superchainConfigGuardian": "0x9965507D1a55bcC2695C58ba16FB37d819B0A4dc", "superchainConfigGuardian": "0x9965507D1a55bcC2695C58ba16FB37d819B0A4dc",
"proxyAdminOwner": "0x9965507D1a55bcC2695C58ba16FB37d819B0A4dc", "proxyAdminOwner": "0x9965507D1a55bcC2695C58ba16FB37d819B0A4dc",
"l1StartingBlockTag": "earliest", "l1StartingBlockTag": "earliest",
......
...@@ -76,8 +76,8 @@ runs = 256 ...@@ -76,8 +76,8 @@ runs = 256
depth = 32 depth = 32
[profile.ciheavy] [profile.ciheavy]
# temp reduce fuzz runs for 1 pr
# fuzz = { runs = 20000 } # fuzz = { runs = 20000 }
# temporary reduce fuzz runs to unblock CI
fuzz = { runs = 200 } fuzz = { runs = 200 }
[profile.ciheavy.invariant] [profile.ciheavy.invariant]
......
...@@ -47,6 +47,7 @@ abstract contract Artifacts { ...@@ -47,6 +47,7 @@ abstract contract Artifacts {
/// @notice Setup function. The arguments here /// @notice Setup function. The arguments here
function setUp() public virtual { function setUp() public virtual {
deploymentOutfile = Config.deploymentOutfile(); deploymentOutfile = Config.deploymentOutfile();
console.log("Writing artifact to %s", deploymentOutfile);
ForgeArtifacts.ensurePath(deploymentOutfile); ForgeArtifacts.ensurePath(deploymentOutfile);
uint256 chainId = Config.chainID(); uint256 chainId = Config.chainID();
...@@ -182,6 +183,7 @@ abstract contract Artifacts { ...@@ -182,6 +183,7 @@ abstract contract Artifacts {
/// @param _name The name of the deployment. /// @param _name The name of the deployment.
/// @param _deployed The address of the deployment. /// @param _deployed The address of the deployment.
function save(string memory _name, address _deployed) public { function save(string memory _name, address _deployed) public {
console.log("Saving %s: %s", _name, _deployed);
if (bytes(_name).length == 0) { if (bytes(_name).length == 0) {
revert InvalidDeployment("EmptyName"); revert InvalidDeployment("EmptyName");
} }
......
...@@ -155,7 +155,7 @@ contract Deploy is Deployer { ...@@ -155,7 +155,7 @@ contract Deploy is Deployer {
DelayedWETH: getAddress("DelayedWETHProxy"), DelayedWETH: getAddress("DelayedWETHProxy"),
PermissionedDelayedWETH: getAddress("PermissionedDelayedWETHProxy"), PermissionedDelayedWETH: getAddress("PermissionedDelayedWETHProxy"),
AnchorStateRegistry: getAddress("AnchorStateRegistryProxy"), AnchorStateRegistry: getAddress("AnchorStateRegistryProxy"),
OptimismMintableERC20Factory: getAddress("L1OptimismMintableERC20FactoryProxy"), OptimismMintableERC20Factory: getAddress("OptimismMintableERC20FactoryProxy"),
OptimismPortal: getAddress("OptimismPortalProxy"), OptimismPortal: getAddress("OptimismPortalProxy"),
OptimismPortal2: getAddress("OptimismPortalProxy"), OptimismPortal2: getAddress("OptimismPortalProxy"),
SystemConfig: getAddress("SystemConfigProxy"), SystemConfig: getAddress("SystemConfigProxy"),
...@@ -176,7 +176,7 @@ contract Deploy is Deployer { ...@@ -176,7 +176,7 @@ contract Deploy is Deployer {
DelayedWETH: getAddress("DelayedWETH"), DelayedWETH: getAddress("DelayedWETH"),
PermissionedDelayedWETH: getAddress("PermissionedDelayedWETH"), PermissionedDelayedWETH: getAddress("PermissionedDelayedWETH"),
AnchorStateRegistry: getAddress("AnchorStateRegistry"), AnchorStateRegistry: getAddress("AnchorStateRegistry"),
OptimismMintableERC20Factory: getAddress("L1OptimismMintableERC20Factory"), OptimismMintableERC20Factory: getAddress("OptimismMintableERC20Factory"),
OptimismPortal: getAddress("OptimismPortal"), OptimismPortal: getAddress("OptimismPortal"),
OptimismPortal2: getAddress("OptimismPortal2"), OptimismPortal2: getAddress("OptimismPortal2"),
SystemConfig: getAddress("SystemConfig"), SystemConfig: getAddress("SystemConfig"),
...@@ -398,9 +398,7 @@ contract Deploy is Deployer { ...@@ -398,9 +398,7 @@ contract Deploy is Deployer {
} }
save("L1CrossDomainMessenger", address(dio.l1CrossDomainMessengerImpl())); save("L1CrossDomainMessenger", address(dio.l1CrossDomainMessengerImpl()));
// Save under both names for backwards compatibility
save("OptimismMintableERC20Factory", address(dio.optimismMintableERC20FactoryImpl())); save("OptimismMintableERC20Factory", address(dio.optimismMintableERC20FactoryImpl()));
save("L1OptimismMintableERC20Factory", address(dio.optimismMintableERC20FactoryImpl()));
save("SystemConfig", address(dio.systemConfigImpl())); save("SystemConfig", address(dio.systemConfigImpl()));
save("L1StandardBridge", address(dio.l1StandardBridgeImpl())); save("L1StandardBridge", address(dio.l1StandardBridgeImpl()));
save("L1ERC721Bridge", address(dio.l1ERC721BridgeImpl())); save("L1ERC721Bridge", address(dio.l1ERC721BridgeImpl()));
...@@ -415,7 +413,7 @@ contract Deploy is Deployer { ...@@ -415,7 +413,7 @@ contract Deploy is Deployer {
save("OPContractsManager", address(dio.opcmImpl())); save("OPContractsManager", address(dio.opcmImpl()));
Types.ContractSet memory contracts = _impls(); Types.ContractSet memory contracts = _impls();
ChainAssertions.checkL1CrossDomainMessenger({ _contracts: contracts, _isProxy: false }); ChainAssertions.checkL1CrossDomainMessenger({ _contracts: contracts, _vm: vm, _isProxy: false });
ChainAssertions.checkL1StandardBridge({ _contracts: contracts, _isProxy: false }); ChainAssertions.checkL1StandardBridge({ _contracts: contracts, _isProxy: false });
ChainAssertions.checkL1ERC721Bridge({ _contracts: contracts, _isProxy: false }); ChainAssertions.checkL1ERC721Bridge({ _contracts: contracts, _isProxy: false });
ChainAssertions.checkOptimismPortal2({ _contracts: contracts, _cfg: cfg, _isProxy: false }); ChainAssertions.checkOptimismPortal2({ _contracts: contracts, _cfg: cfg, _isProxy: false });
...@@ -458,9 +456,7 @@ contract Deploy is Deployer { ...@@ -458,9 +456,7 @@ contract Deploy is Deployer {
save("AddressManager", address(deployOutput.addressManager)); save("AddressManager", address(deployOutput.addressManager));
save("L1ERC721BridgeProxy", address(deployOutput.l1ERC721BridgeProxy)); save("L1ERC721BridgeProxy", address(deployOutput.l1ERC721BridgeProxy));
save("SystemConfigProxy", address(deployOutput.systemConfigProxy)); save("SystemConfigProxy", address(deployOutput.systemConfigProxy));
// Save under both names for backwards compatibility
save("OptimismMintableERC20FactoryProxy", address(deployOutput.optimismMintableERC20FactoryProxy)); save("OptimismMintableERC20FactoryProxy", address(deployOutput.optimismMintableERC20FactoryProxy));
save("L1OptimismMintableERC20FactoryProxy", address(deployOutput.optimismMintableERC20FactoryProxy));
save("L1StandardBridgeProxy", address(deployOutput.l1StandardBridgeProxy)); save("L1StandardBridgeProxy", address(deployOutput.l1StandardBridgeProxy));
save("L1CrossDomainMessengerProxy", address(deployOutput.l1CrossDomainMessengerProxy)); save("L1CrossDomainMessengerProxy", address(deployOutput.l1CrossDomainMessengerProxy));
...@@ -827,15 +823,12 @@ contract Deploy is Deployer { ...@@ -827,15 +823,12 @@ contract Deploy is Deployer {
_data: abi.encodeCall( _data: abi.encodeCall(
ISystemConfig.initialize, ISystemConfig.initialize,
( (
ISystemConfig.Roles({ cfg.finalSystemOwner(),
owner: cfg.finalSystemOwner(),
feeAdmin: cfg.systemConfigFeeAdmin(),
unsafeBlockSigner: cfg.p2pSequencerAddress(),
batcherHash: batcherHash
}),
cfg.basefeeScalar(), cfg.basefeeScalar(),
cfg.blobbasefeeScalar(), cfg.blobbasefeeScalar(),
batcherHash,
uint64(cfg.l2GenesisBlockGasLimit()), uint64(cfg.l2GenesisBlockGasLimit()),
cfg.p2pSequencerAddress(),
Constants.DEFAULT_RESOURCE_CONFIG(), Constants.DEFAULT_RESOURCE_CONFIG(),
cfg.batchInboxAddress(), cfg.batchInboxAddress(),
ISystemConfig.Addresses({ ISystemConfig.Addresses({
...@@ -844,7 +837,7 @@ contract Deploy is Deployer { ...@@ -844,7 +837,7 @@ contract Deploy is Deployer {
l1StandardBridge: mustGetAddress("L1StandardBridgeProxy"), l1StandardBridge: mustGetAddress("L1StandardBridgeProxy"),
disputeGameFactory: mustGetAddress("DisputeGameFactoryProxy"), disputeGameFactory: mustGetAddress("DisputeGameFactoryProxy"),
optimismPortal: mustGetAddress("OptimismPortalProxy"), optimismPortal: mustGetAddress("OptimismPortalProxy"),
optimismMintableERC20Factory: mustGetAddress("L1OptimismMintableERC20FactoryProxy"), optimismMintableERC20Factory: mustGetAddress("OptimismMintableERC20FactoryProxy"),
gasPayingToken: customGasTokenAddress gasPayingToken: customGasTokenAddress
}) })
) )
...@@ -1271,8 +1264,7 @@ contract Deploy is Deployer { ...@@ -1271,8 +1264,7 @@ contract Deploy is Deployer {
batcher: cfg.batchSenderAddress(), batcher: cfg.batchSenderAddress(),
unsafeBlockSigner: cfg.p2pSequencerAddress(), unsafeBlockSigner: cfg.p2pSequencerAddress(),
proposer: cfg.l2OutputOracleProposer(), proposer: cfg.l2OutputOracleProposer(),
challenger: cfg.l2OutputOracleChallenger(), challenger: cfg.l2OutputOracleChallenger()
systemConfigFeeAdmin: cfg.systemConfigFeeAdmin()
}), }),
basefeeScalar: cfg.basefeeScalar(), basefeeScalar: cfg.basefeeScalar(),
blobBasefeeScalar: cfg.blobbasefeeScalar(), blobBasefeeScalar: cfg.blobbasefeeScalar(),
......
...@@ -86,7 +86,6 @@ contract DeployConfig is Script { ...@@ -86,7 +86,6 @@ contract DeployConfig is Script {
uint256 public daResolveWindow; uint256 public daResolveWindow;
uint256 public daBondSize; uint256 public daBondSize;
uint256 public daResolverRefundPercentage; uint256 public daResolverRefundPercentage;
address public systemConfigFeeAdmin;
bool public useCustomGasToken; bool public useCustomGasToken;
address public customGasTokenAddress; address public customGasTokenAddress;
...@@ -102,7 +101,6 @@ contract DeployConfig is Script { ...@@ -102,7 +101,6 @@ contract DeployConfig is Script {
} }
finalSystemOwner = stdJson.readAddress(_json, "$.finalSystemOwner"); finalSystemOwner = stdJson.readAddress(_json, "$.finalSystemOwner");
systemConfigFeeAdmin = stdJson.readAddress(_json, "$.systemConfigFeeAdmin");
superchainConfigGuardian = stdJson.readAddress(_json, "$.superchainConfigGuardian"); superchainConfigGuardian = stdJson.readAddress(_json, "$.superchainConfigGuardian");
l1ChainID = stdJson.readUint(_json, "$.l1ChainID"); l1ChainID = stdJson.readUint(_json, "$.l1ChainID");
l2ChainID = stdJson.readUint(_json, "$.l2ChainID"); l2ChainID = stdJson.readUint(_json, "$.l2ChainID");
......
...@@ -29,8 +29,7 @@ import { ISystemConfig } from "src/L1/interfaces/ISystemConfig.sol"; ...@@ -29,8 +29,7 @@ import { ISystemConfig } from "src/L1/interfaces/ISystemConfig.sol";
import { IL1CrossDomainMessenger } from "src/L1/interfaces/IL1CrossDomainMessenger.sol"; import { IL1CrossDomainMessenger } from "src/L1/interfaces/IL1CrossDomainMessenger.sol";
import { IL1ERC721Bridge } from "src/L1/interfaces/IL1ERC721Bridge.sol"; import { IL1ERC721Bridge } from "src/L1/interfaces/IL1ERC721Bridge.sol";
import { IL1StandardBridge } from "src/L1/interfaces/IL1StandardBridge.sol"; import { IL1StandardBridge } from "src/L1/interfaces/IL1StandardBridge.sol";
import { IL1OptimismMintableERC20Factory as IOptimismMintableERC20Factory } from import { IOptimismMintableERC20Factory } from "src/universal/interfaces/IOptimismMintableERC20Factory.sol";
"src/L1/interfaces/IL1OptimismMintableERC20Factory.sol";
import { OPContractsManagerInterop } from "src/L1/OPContractsManagerInterop.sol"; import { OPContractsManagerInterop } from "src/L1/OPContractsManagerInterop.sol";
import { IOptimismPortalInterop } from "src/L1/interfaces/IOptimismPortalInterop.sol"; import { IOptimismPortalInterop } from "src/L1/interfaces/IOptimismPortalInterop.sol";
...@@ -371,19 +370,19 @@ contract DeployImplementationsOutput is BaseDeployIO { ...@@ -371,19 +370,19 @@ contract DeployImplementationsOutput is BaseDeployIO {
DeployUtils.assertInitialized({ _contractAddress: address(systemConfig), _slot: 0, _offset: 0 }); DeployUtils.assertInitialized({ _contractAddress: address(systemConfig), _slot: 0, _offset: 0 });
require(systemConfig.owner() == address(0), "SYSCON-10"); require(systemConfig.owner() == address(0xdead), "SYSCON-10");
require(systemConfig.overhead() == 0, "SYSCON-20"); require(systemConfig.overhead() == 0, "SYSCON-20");
require(systemConfig.scalar() == 0, "SYSCON-30"); require(systemConfig.scalar() == uint256(0x01) << 248, "SYSCON-30");
require(systemConfig.basefeeScalar() == 0, "SYSCON-40"); require(systemConfig.basefeeScalar() == 0, "SYSCON-40");
require(systemConfig.blobbasefeeScalar() == 0, "SYSCON-50"); require(systemConfig.blobbasefeeScalar() == 0, "SYSCON-50");
require(systemConfig.batcherHash() == bytes32(0), "SYSCON-60"); require(systemConfig.batcherHash() == bytes32(0), "SYSCON-60");
require(systemConfig.gasLimit() == 0, "SYSCON-70"); require(systemConfig.gasLimit() == 1, "SYSCON-70");
require(systemConfig.unsafeBlockSigner() == address(0), "SYSCON-80"); require(systemConfig.unsafeBlockSigner() == address(0), "SYSCON-80");
IResourceMetering.ResourceConfig memory resourceConfig = systemConfig.resourceConfig(); IResourceMetering.ResourceConfig memory resourceConfig = systemConfig.resourceConfig();
require(resourceConfig.maxResourceLimit == 0, "SYSCON-90"); require(resourceConfig.maxResourceLimit == 1, "SYSCON-90");
require(resourceConfig.elasticityMultiplier == 0, "SYSCON-100"); require(resourceConfig.elasticityMultiplier == 1, "SYSCON-100");
require(resourceConfig.baseFeeMaxChangeDenominator == 0, "SYSCON-110"); require(resourceConfig.baseFeeMaxChangeDenominator == 2, "SYSCON-110");
require(resourceConfig.systemTxMaxGas == 0, "SYSCON-120"); require(resourceConfig.systemTxMaxGas == 0, "SYSCON-120");
require(resourceConfig.minimumBaseFee == 0, "SYSCON-130"); require(resourceConfig.minimumBaseFee == 0, "SYSCON-130");
require(resourceConfig.maximumBaseFee == 0, "SYSCON-140"); require(resourceConfig.maximumBaseFee == 0, "SYSCON-140");
...@@ -401,7 +400,7 @@ contract DeployImplementationsOutput is BaseDeployIO { ...@@ -401,7 +400,7 @@ contract DeployImplementationsOutput is BaseDeployIO {
function assertValidL1CrossDomainMessengerImpl(DeployImplementationsInput) internal view { function assertValidL1CrossDomainMessengerImpl(DeployImplementationsInput) internal view {
IL1CrossDomainMessenger messenger = l1CrossDomainMessengerImpl(); IL1CrossDomainMessenger messenger = l1CrossDomainMessengerImpl();
DeployUtils.assertInitialized({ _contractAddress: address(messenger), _slot: 250, _offset: 0 }); DeployUtils.assertInitialized({ _contractAddress: address(messenger), _slot: 0, _offset: 20 });
require(address(messenger.OTHER_MESSENGER()) == Predeploys.L2_CROSS_DOMAIN_MESSENGER, "L1xDM-10"); require(address(messenger.OTHER_MESSENGER()) == Predeploys.L2_CROSS_DOMAIN_MESSENGER, "L1xDM-10");
require(address(messenger.otherMessenger()) == Predeploys.L2_CROSS_DOMAIN_MESSENGER, "L1xDM-20"); require(address(messenger.otherMessenger()) == Predeploys.L2_CROSS_DOMAIN_MESSENGER, "L1xDM-20");
...@@ -409,15 +408,14 @@ contract DeployImplementationsOutput is BaseDeployIO { ...@@ -409,15 +408,14 @@ contract DeployImplementationsOutput is BaseDeployIO {
require(address(messenger.portal()) == address(0), "L1xDM-40"); require(address(messenger.portal()) == address(0), "L1xDM-40");
require(address(messenger.superchainConfig()) == address(0), "L1xDM-50"); require(address(messenger.superchainConfig()) == address(0), "L1xDM-50");
// TODO: vm.expectRevert is not supported by op-chain-ops, so we can't check this yet. bytes32 xdmSenderSlot = vm.load(address(messenger), bytes32(uint256(204)));
// vm.expectRevert("CrossDomainMessenger: xDomainMessageSender is not set"); require(address(uint160(uint256(xdmSenderSlot))) == Constants.DEFAULT_L2_SENDER, "L1xDM-60");
// messenger.xDomainMessageSender();
} }
function assertValidL1ERC721BridgeImpl(DeployImplementationsInput) internal view { function assertValidL1ERC721BridgeImpl(DeployImplementationsInput) internal view {
IL1ERC721Bridge bridge = l1ERC721BridgeImpl(); IL1ERC721Bridge bridge = l1ERC721BridgeImpl();
DeployUtils.assertInitialized({ _contractAddress: address(bridge) }); DeployUtils.assertInitialized({ _contractAddress: address(bridge), _slot: 0, _offset: 0 });
require(address(bridge.OTHER_BRIDGE()) == Predeploys.L2_ERC721_BRIDGE, "L721B-10"); require(address(bridge.OTHER_BRIDGE()) == Predeploys.L2_ERC721_BRIDGE, "L721B-10");
require(address(bridge.otherBridge()) == Predeploys.L2_ERC721_BRIDGE, "L721B-20"); require(address(bridge.otherBridge()) == Predeploys.L2_ERC721_BRIDGE, "L721B-20");
...@@ -429,7 +427,7 @@ contract DeployImplementationsOutput is BaseDeployIO { ...@@ -429,7 +427,7 @@ contract DeployImplementationsOutput is BaseDeployIO {
function assertValidL1StandardBridgeImpl(DeployImplementationsInput) internal view { function assertValidL1StandardBridgeImpl(DeployImplementationsInput) internal view {
IL1StandardBridge bridge = l1StandardBridgeImpl(); IL1StandardBridge bridge = l1StandardBridgeImpl();
DeployUtils.assertInitialized({ _contractAddress: address(bridge), _slot: 49, _offset: 0 }); DeployUtils.assertInitialized({ _contractAddress: address(bridge), _slot: 0, _offset: 0 });
require(address(bridge.MESSENGER()) == address(0), "L1SB-10"); require(address(bridge.MESSENGER()) == address(0), "L1SB-10");
require(address(bridge.messenger()) == address(0), "L1SB-20"); require(address(bridge.messenger()) == address(0), "L1SB-20");
...@@ -441,7 +439,7 @@ contract DeployImplementationsOutput is BaseDeployIO { ...@@ -441,7 +439,7 @@ contract DeployImplementationsOutput is BaseDeployIO {
function assertValidOptimismMintableERC20FactoryImpl(DeployImplementationsInput) internal view { function assertValidOptimismMintableERC20FactoryImpl(DeployImplementationsInput) internal view {
IOptimismMintableERC20Factory factory = optimismMintableERC20FactoryImpl(); IOptimismMintableERC20Factory factory = optimismMintableERC20FactoryImpl();
DeployUtils.assertInitialized({ _contractAddress: address(factory), _slot: 51, _offset: 0 }); DeployUtils.assertInitialized({ _contractAddress: address(factory), _slot: 0, _offset: 0 });
require(address(factory.BRIDGE()) == address(0), "MERC20F-10"); require(address(factory.BRIDGE()) == address(0), "MERC20F-10");
require(address(factory.bridge()) == address(0), "MERC20F-20"); require(address(factory.bridge()) == address(0), "MERC20F-20");
...@@ -790,7 +788,7 @@ contract DeployImplementations is Script { ...@@ -790,7 +788,7 @@ contract DeployImplementations is Script {
vm.broadcast(msg.sender); vm.broadcast(msg.sender);
impl = IOptimismMintableERC20Factory( impl = IOptimismMintableERC20Factory(
DeployUtils.create1({ DeployUtils.create1({
_name: "L1OptimismMintableERC20Factory", _name: "OptimismMintableERC20Factory",
_args: DeployUtils.encodeConstructor(abi.encodeCall(IOptimismMintableERC20Factory.__constructor__, ())) _args: DeployUtils.encodeConstructor(abi.encodeCall(IOptimismMintableERC20Factory.__constructor__, ()))
}) })
); );
...@@ -798,7 +796,7 @@ contract DeployImplementations is Script { ...@@ -798,7 +796,7 @@ contract DeployImplementations is Script {
revert(string.concat("DeployImplementations: failed to deploy release ", release)); revert(string.concat("DeployImplementations: failed to deploy release ", release));
} }
vm.label(address(impl), "L1OptimismMintableERC20FactoryImpl"); vm.label(address(impl), "OptimismMintableERC20FactoryImpl");
_dio.set(_dio.optimismMintableERC20FactoryImpl.selector, address(impl)); _dio.set(_dio.optimismMintableERC20FactoryImpl.selector, address(impl));
} }
......
...@@ -38,7 +38,6 @@ import { IOptimismMintableERC20Factory } from "src/universal/interfaces/IOptimis ...@@ -38,7 +38,6 @@ import { IOptimismMintableERC20Factory } from "src/universal/interfaces/IOptimis
contract DeployOPChainInput is BaseDeployIO { contract DeployOPChainInput is BaseDeployIO {
address internal _opChainProxyAdminOwner; address internal _opChainProxyAdminOwner;
address internal _systemConfigOwner; address internal _systemConfigOwner;
address internal _systemConfigFeeAdmin;
address internal _batcher; address internal _batcher;
address internal _unsafeBlockSigner; address internal _unsafeBlockSigner;
address internal _proposer; address internal _proposer;
...@@ -65,7 +64,6 @@ contract DeployOPChainInput is BaseDeployIO { ...@@ -65,7 +64,6 @@ contract DeployOPChainInput is BaseDeployIO {
require(_addr != address(0), "DeployOPChainInput: cannot set zero address"); require(_addr != address(0), "DeployOPChainInput: cannot set zero address");
if (_sel == this.opChainProxyAdminOwner.selector) _opChainProxyAdminOwner = _addr; if (_sel == this.opChainProxyAdminOwner.selector) _opChainProxyAdminOwner = _addr;
else if (_sel == this.systemConfigOwner.selector) _systemConfigOwner = _addr; else if (_sel == this.systemConfigOwner.selector) _systemConfigOwner = _addr;
else if (_sel == this.systemConfigFeeAdmin.selector) _systemConfigFeeAdmin = _addr;
else if (_sel == this.batcher.selector) _batcher = _addr; else if (_sel == this.batcher.selector) _batcher = _addr;
else if (_sel == this.unsafeBlockSigner.selector) _unsafeBlockSigner = _addr; else if (_sel == this.unsafeBlockSigner.selector) _unsafeBlockSigner = _addr;
else if (_sel == this.proposer.selector) _proposer = _addr; else if (_sel == this.proposer.selector) _proposer = _addr;
...@@ -125,11 +123,6 @@ contract DeployOPChainInput is BaseDeployIO { ...@@ -125,11 +123,6 @@ contract DeployOPChainInput is BaseDeployIO {
return _systemConfigOwner; return _systemConfigOwner;
} }
function systemConfigFeeAdmin() public view returns (address) {
require(_systemConfigFeeAdmin != address(0), "DeployOPChainInput: not set");
return _systemConfigFeeAdmin;
}
function batcher() public view returns (address) { function batcher() public view returns (address) {
require(_batcher != address(0), "DeployOPChainInput: not set"); require(_batcher != address(0), "DeployOPChainInput: not set");
return _batcher; return _batcher;
...@@ -362,8 +355,7 @@ contract DeployOPChain is Script { ...@@ -362,8 +355,7 @@ contract DeployOPChain is Script {
batcher: _doi.batcher(), batcher: _doi.batcher(),
unsafeBlockSigner: _doi.unsafeBlockSigner(), unsafeBlockSigner: _doi.unsafeBlockSigner(),
proposer: _doi.proposer(), proposer: _doi.proposer(),
challenger: _doi.challenger(), challenger: _doi.challenger()
systemConfigFeeAdmin: _doi.systemConfigFeeAdmin()
}); });
OPContractsManager.DeployInput memory deployInput = OPContractsManager.DeployInput({ OPContractsManager.DeployInput memory deployInput = OPContractsManager.DeployInput({
roles: roles, roles: roles,
...@@ -580,7 +572,7 @@ contract DeployOPChain is Script { ...@@ -580,7 +572,7 @@ contract DeployOPChain is Script {
function assertValidL1CrossDomainMessenger(DeployOPChainInput _doi, DeployOPChainOutput _doo) internal { function assertValidL1CrossDomainMessenger(DeployOPChainInput _doi, DeployOPChainOutput _doo) internal {
IL1CrossDomainMessenger messenger = _doo.l1CrossDomainMessengerProxy(); IL1CrossDomainMessenger messenger = _doo.l1CrossDomainMessengerProxy();
DeployUtils.assertInitialized({ _contractAddress: address(messenger), _slot: 250, _offset: 0 }); DeployUtils.assertInitialized({ _contractAddress: address(messenger), _slot: 0, _offset: 20 });
require(address(messenger.OTHER_MESSENGER()) == Predeploys.L2_CROSS_DOMAIN_MESSENGER, "L1xDM-10"); require(address(messenger.OTHER_MESSENGER()) == Predeploys.L2_CROSS_DOMAIN_MESSENGER, "L1xDM-10");
require(address(messenger.otherMessenger()) == Predeploys.L2_CROSS_DOMAIN_MESSENGER, "L1xDM-20"); require(address(messenger.otherMessenger()) == Predeploys.L2_CROSS_DOMAIN_MESSENGER, "L1xDM-20");
...@@ -589,16 +581,15 @@ contract DeployOPChain is Script { ...@@ -589,16 +581,15 @@ contract DeployOPChain is Script {
require(address(messenger.portal()) == address(_doo.optimismPortalProxy()), "L1xDM-40"); require(address(messenger.portal()) == address(_doo.optimismPortalProxy()), "L1xDM-40");
require(address(messenger.superchainConfig()) == address(_doi.opcmProxy().superchainConfig()), "L1xDM-50"); require(address(messenger.superchainConfig()) == address(_doi.opcmProxy().superchainConfig()), "L1xDM-50");
// TODO: vm.expectRevert is not supported by op-chain-ops, so we can't check this yet. bytes32 xdmSenderSlot = vm.load(address(messenger), bytes32(uint256(204)));
// vm.expectRevert("CrossDomainMessenger: xDomainMessageSender is not set"); require(address(uint160(uint256(xdmSenderSlot))) == Constants.DEFAULT_L2_SENDER, "L1xDM-60");
// messenger.xDomainMessageSender();
} }
function assertValidL1StandardBridge(DeployOPChainInput _doi, DeployOPChainOutput _doo) internal { function assertValidL1StandardBridge(DeployOPChainInput _doi, DeployOPChainOutput _doo) internal {
IL1StandardBridge bridge = _doo.l1StandardBridgeProxy(); IL1StandardBridge bridge = _doo.l1StandardBridgeProxy();
IL1CrossDomainMessenger messenger = _doo.l1CrossDomainMessengerProxy(); IL1CrossDomainMessenger messenger = _doo.l1CrossDomainMessengerProxy();
DeployUtils.assertInitialized({ _contractAddress: address(bridge), _slot: 49, _offset: 0 }); DeployUtils.assertInitialized({ _contractAddress: address(bridge), _slot: 0, _offset: 0 });
require(address(bridge.MESSENGER()) == address(messenger), "L1SB-10"); require(address(bridge.MESSENGER()) == address(messenger), "L1SB-10");
require(address(bridge.messenger()) == address(messenger), "L1SB-20"); require(address(bridge.messenger()) == address(messenger), "L1SB-20");
...@@ -610,7 +601,7 @@ contract DeployOPChain is Script { ...@@ -610,7 +601,7 @@ contract DeployOPChain is Script {
function assertValidOptimismMintableERC20Factory(DeployOPChainInput, DeployOPChainOutput _doo) internal { function assertValidOptimismMintableERC20Factory(DeployOPChainInput, DeployOPChainOutput _doo) internal {
IOptimismMintableERC20Factory factory = _doo.optimismMintableERC20FactoryProxy(); IOptimismMintableERC20Factory factory = _doo.optimismMintableERC20FactoryProxy();
DeployUtils.assertInitialized({ _contractAddress: address(factory), _slot: 51, _offset: 0 }); DeployUtils.assertInitialized({ _contractAddress: address(factory), _slot: 0, _offset: 0 });
require(factory.BRIDGE() == address(_doo.l1StandardBridgeProxy()), "MERC20F-10"); require(factory.BRIDGE() == address(_doo.l1StandardBridgeProxy()), "MERC20F-10");
require(factory.bridge() == address(_doo.l1StandardBridgeProxy()), "MERC20F-20"); require(factory.bridge() == address(_doo.l1StandardBridgeProxy()), "MERC20F-20");
...@@ -619,7 +610,7 @@ contract DeployOPChain is Script { ...@@ -619,7 +610,7 @@ contract DeployOPChain is Script {
function assertValidL1ERC721Bridge(DeployOPChainInput _doi, DeployOPChainOutput _doo) internal { function assertValidL1ERC721Bridge(DeployOPChainInput _doi, DeployOPChainOutput _doo) internal {
IL1ERC721Bridge bridge = _doo.l1ERC721BridgeProxy(); IL1ERC721Bridge bridge = _doo.l1ERC721BridgeProxy();
DeployUtils.assertInitialized({ _contractAddress: address(bridge) }); DeployUtils.assertInitialized({ _contractAddress: address(bridge), _slot: 0, _offset: 0 });
require(address(bridge.OTHER_BRIDGE()) == Predeploys.L2_ERC721_BRIDGE, "L721B-10"); require(address(bridge.OTHER_BRIDGE()) == Predeploys.L2_ERC721_BRIDGE, "L721B-10");
require(address(bridge.otherBridge()) == Predeploys.L2_ERC721_BRIDGE, "L721B-20"); require(address(bridge.otherBridge()) == Predeploys.L2_ERC721_BRIDGE, "L721B-20");
......
...@@ -359,7 +359,6 @@ contract DeploySuperchain is Script { ...@@ -359,7 +359,6 @@ contract DeploySuperchain is Script {
function deployAndInitializeSuperchainConfig(DeploySuperchainInput _dsi, DeploySuperchainOutput _dso) public { function deployAndInitializeSuperchainConfig(DeploySuperchainInput _dsi, DeploySuperchainOutput _dso) public {
address guardian = _dsi.guardian(); address guardian = _dsi.guardian();
address upgrader = _dsi.superchainProxyAdminOwner();
bool paused = _dsi.paused(); bool paused = _dsi.paused();
IProxyAdmin superchainProxyAdmin = _dso.superchainProxyAdmin(); IProxyAdmin superchainProxyAdmin = _dso.superchainProxyAdmin();
...@@ -377,7 +376,7 @@ contract DeploySuperchain is Script { ...@@ -377,7 +376,7 @@ contract DeploySuperchain is Script {
superchainProxyAdmin.upgradeAndCall( superchainProxyAdmin.upgradeAndCall(
payable(address(superchainConfigProxy)), payable(address(superchainConfigProxy)),
address(superchainConfigImpl), address(superchainConfigImpl),
abi.encodeCall(ISuperchainConfig.initialize, (guardian, upgrader, paused)) abi.encodeCall(ISuperchainConfig.initialize, (guardian, paused))
); );
vm.stopBroadcast(); vm.stopBroadcast();
......
...@@ -34,11 +34,10 @@ enum Fork { ...@@ -34,11 +34,10 @@ enum Fork {
ECOTONE, ECOTONE,
FJORD, FJORD,
GRANITE, GRANITE,
HOLOCENE, HOLOCENE
ISTHMUS
} }
Fork constant LATEST_FORK = Fork.ISTHMUS; Fork constant LATEST_FORK = Fork.HOLOCENE;
library ForkUtils { library ForkUtils {
function toString(Fork _fork) internal pure returns (string memory) { function toString(Fork _fork) internal pure returns (string memory) {
...@@ -54,8 +53,6 @@ library ForkUtils { ...@@ -54,8 +53,6 @@ library ForkUtils {
return "granite"; return "granite";
} else if (_fork == Fork.HOLOCENE) { } else if (_fork == Fork.HOLOCENE) {
return "holocene"; return "holocene";
} else if (_fork == Fork.ISTHMUS) {
return "isthmus";
} else { } else {
return "unknown"; return "unknown";
} }
...@@ -171,8 +168,6 @@ library Config { ...@@ -171,8 +168,6 @@ library Config {
return Fork.GRANITE; return Fork.GRANITE;
} else if (forkHash == keccak256(bytes("holocene"))) { } else if (forkHash == keccak256(bytes("holocene"))) {
return Fork.HOLOCENE; return Fork.HOLOCENE;
} else if (forkHash == keccak256(bytes("isthmus"))) {
return Fork.ISTHMUS;
} else { } else {
revert(string.concat("Config: unknown fork: ", forkStr)); revert(string.concat("Config: unknown fork: ", forkStr));
} }
......
...@@ -351,11 +351,6 @@ library DeployUtils { ...@@ -351,11 +351,6 @@ library DeployUtils {
} }
} }
/// @notice The unstructured storage slot that is used for v5 openzeppelin initializable. Computed as:
/// keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.Initializable")) - 1)) &
/// ~bytes32(uint256(0xff))
bytes32 internal constant INITIALIZABLE_STORAGE = 0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00;
/// @notice Asserts that for a given contract the value of a storage slot at an offset is 1 or /// @notice Asserts that for a given contract the value of a storage slot at an offset is 1 or
/// `type(uint8).max`. The value is set to 1 when a contract is initialized, and set to /// `type(uint8).max`. The value is set to 1 when a contract is initialized, and set to
/// `type(uint8).max` when `_disableInitializers` is called. /// `type(uint8).max` when `_disableInitializers` is called.
...@@ -367,9 +362,4 @@ library DeployUtils { ...@@ -367,9 +362,4 @@ library DeployUtils {
"DeployUtils: value at the given slot and offset does not indicate initialization" "DeployUtils: value at the given slot and offset does not indicate initialization"
); );
} }
/// @notice Asserts that the contract has been initialized, assuming that it is using openzeppelin v5 initializable.
function assertInitialized(address _contractAddress) internal view {
assertInitialized({ _contractAddress: _contractAddress, _slot: uint256(INITIALIZABLE_STORAGE), _offset: 0 });
}
} }
...@@ -5,7 +5,6 @@ import { Vm } from "forge-std/Vm.sol"; ...@@ -5,7 +5,6 @@ import { Vm } from "forge-std/Vm.sol";
import { stdJson } from "forge-std/StdJson.sol"; import { stdJson } from "forge-std/StdJson.sol";
import { LibString } from "@solady/utils/LibString.sol"; import { LibString } from "@solady/utils/LibString.sol";
import { Executables } from "scripts/libraries/Executables.sol"; import { Executables } from "scripts/libraries/Executables.sol";
import { DeployUtils } from "scripts/libraries/DeployUtils.sol";
import { Process } from "scripts/libraries/Process.sol"; import { Process } from "scripts/libraries/Process.sol";
/// @notice Contains information about a storage slot. Mirrors the layout of the storage /// @notice Contains information about a storage slot. Mirrors the layout of the storage
...@@ -191,19 +190,6 @@ library ForgeArtifacts { ...@@ -191,19 +190,6 @@ library ForgeArtifacts {
function getInitializedSlot(string memory _contractName) internal returns (StorageSlot memory slot_) { function getInitializedSlot(string memory _contractName) internal returns (StorageSlot memory slot_) {
string memory storageLayout = getStorageLayout(_contractName); string memory storageLayout = getStorageLayout(_contractName);
// Contracts that use oz v5 should be here
if (LibString.eq(_contractName, "L1ERC721Bridge")) {
StorageSlot memory slot = StorageSlot({
astId: 0,
_contract: _contractName,
label: "_initialized",
offset: 0,
slot: vm.toString(DeployUtils.INITIALIZABLE_STORAGE),
_type: "bool"
});
return slot;
}
// FaultDisputeGame and PermissionedDisputeGame use a different name for the initialized storage slot. // FaultDisputeGame and PermissionedDisputeGame use a different name for the initialized storage slot.
string memory slotName = "_initialized"; string memory slotName = "_initialized";
string memory slotType = "t_uint8"; string memory slotType = "t_uint8";
...@@ -228,10 +214,7 @@ library ForgeArtifacts { ...@@ -228,10 +214,7 @@ library ForgeArtifacts {
slotType, slotType,
"\")'" "\")'"
); );
bytes memory rawSlot = vm.parseJson(string(Process.run(command)));
bytes memory result = Process.run(command);
require(result.length > 0, string.concat("ForgeArtifacts: ", _contractName, "is not initializable"));
bytes memory rawSlot = vm.parseJson(string(result));
slot_ = abi.decode(rawSlot, (StorageSlot)); slot_ = abi.decode(rawSlot, (StorageSlot));
} }
......
This diff is collapsed.
[ [
{
"inputs": [
{
"internalType": "address",
"name": "_recipient",
"type": "address"
},
{
"internalType": "uint256",
"name": "_minWithdrawalAmount",
"type": "uint256"
},
{
"internalType": "enum Types.WithdrawalNetwork",
"name": "_withdrawalNetwork",
"type": "uint8"
}
],
"stateMutability": "nonpayable",
"type": "constructor"
},
{ {
"stateMutability": "payable", "stateMutability": "payable",
"type": "receive" "type": "receive"
...@@ -35,30 +56,7 @@ ...@@ -35,30 +56,7 @@
"outputs": [ "outputs": [
{ {
"internalType": "enum Types.WithdrawalNetwork", "internalType": "enum Types.WithdrawalNetwork",
"name": "withdrawalNetwork_", "name": "",
"type": "uint8"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "config",
"outputs": [
{
"internalType": "address",
"name": "recipient_",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount_",
"type": "uint256"
},
{
"internalType": "enum Types.WithdrawalNetwork",
"name": "withdrawalNetwork_",
"type": "uint8" "type": "uint8"
} }
], ],
...@@ -130,7 +128,7 @@ ...@@ -130,7 +128,7 @@
"outputs": [ "outputs": [
{ {
"internalType": "enum Types.WithdrawalNetwork", "internalType": "enum Types.WithdrawalNetwork",
"name": "withdrawalNetwork_", "name": "network_",
"type": "uint8" "type": "uint8"
} }
], ],
......
...@@ -121,25 +121,6 @@ ...@@ -121,25 +121,6 @@
"stateMutability": "view", "stateMutability": "view",
"type": "function" "type": "function"
}, },
{
"inputs": [
{
"internalType": "enum Types.ConfigType",
"name": "_type",
"type": "uint8"
}
],
"name": "getConfig",
"outputs": [
{
"internalType": "bytes",
"name": "data_",
"type": "bytes"
}
],
"stateMutability": "view",
"type": "function"
},
{ {
"inputs": [], "inputs": [],
"name": "hash", "name": "hash",
...@@ -166,19 +147,6 @@ ...@@ -166,19 +147,6 @@
"stateMutability": "view", "stateMutability": "view",
"type": "function" "type": "function"
}, },
{
"inputs": [],
"name": "isIsthmus",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{ {
"inputs": [], "inputs": [],
"name": "l1FeeOverhead", "name": "l1FeeOverhead",
...@@ -231,24 +199,6 @@ ...@@ -231,24 +199,6 @@
"stateMutability": "view", "stateMutability": "view",
"type": "function" "type": "function"
}, },
{
"inputs": [
{
"internalType": "enum Types.ConfigType",
"name": "_type",
"type": "uint8"
},
{
"internalType": "bytes",
"name": "_value",
"type": "bytes"
}
],
"name": "setConfig",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{ {
"inputs": [ "inputs": [
{ {
...@@ -277,13 +227,6 @@ ...@@ -277,13 +227,6 @@
"stateMutability": "nonpayable", "stateMutability": "nonpayable",
"type": "function" "type": "function"
}, },
{
"inputs": [],
"name": "setIsthmus",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{ {
"inputs": [ "inputs": [
{ {
...@@ -400,10 +343,5 @@ ...@@ -400,10 +343,5 @@
"inputs": [], "inputs": [],
"name": "NotDepositor", "name": "NotDepositor",
"type": "error" "type": "error"
},
{
"inputs": [],
"name": "UnsafeCast",
"type": "error"
} }
] ]
\ No newline at end of file
...@@ -141,25 +141,6 @@ ...@@ -141,25 +141,6 @@
"stateMutability": "view", "stateMutability": "view",
"type": "function" "type": "function"
}, },
{
"inputs": [
{
"internalType": "enum Types.ConfigType",
"name": "_type",
"type": "uint8"
}
],
"name": "getConfig",
"outputs": [
{
"internalType": "bytes",
"name": "data_",
"type": "bytes"
}
],
"stateMutability": "view",
"type": "function"
},
{ {
"inputs": [], "inputs": [],
"name": "hash", "name": "hash",
...@@ -218,19 +199,6 @@ ...@@ -218,19 +199,6 @@
"stateMutability": "view", "stateMutability": "view",
"type": "function" "type": "function"
}, },
{
"inputs": [],
"name": "isIsthmus",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{ {
"inputs": [], "inputs": [],
"name": "l1FeeOverhead", "name": "l1FeeOverhead",
...@@ -286,7 +254,7 @@ ...@@ -286,7 +254,7 @@
{ {
"inputs": [ "inputs": [
{ {
"internalType": "enum Types.ConfigType", "internalType": "enum ConfigType",
"name": "_type", "name": "_type",
"type": "uint8" "type": "uint8"
}, },
...@@ -329,13 +297,6 @@ ...@@ -329,13 +297,6 @@
"stateMutability": "nonpayable", "stateMutability": "nonpayable",
"type": "function" "type": "function"
}, },
{
"inputs": [],
"name": "setIsthmus",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{ {
"inputs": [ "inputs": [
{ {
...@@ -510,10 +471,5 @@ ...@@ -510,10 +471,5 @@
"inputs": [], "inputs": [],
"name": "NotDepositor", "name": "NotDepositor",
"type": "error" "type": "error"
},
{
"inputs": [],
"name": "UnsafeCast",
"type": "error"
} }
] ]
\ No newline at end of file
...@@ -223,7 +223,7 @@ ...@@ -223,7 +223,7 @@
"type": "address" "type": "address"
} }
], ],
"stateMutability": "pure", "stateMutability": "view",
"type": "function" "type": "function"
}, },
{ {
......
...@@ -209,7 +209,7 @@ ...@@ -209,7 +209,7 @@
"type": "address" "type": "address"
} }
], ],
"stateMutability": "pure", "stateMutability": "view",
"type": "function" "type": "function"
}, },
{ {
...@@ -342,22 +342,12 @@ ...@@ -342,22 +342,12 @@
"inputs": [ "inputs": [
{ {
"indexed": false, "indexed": false,
"internalType": "uint64", "internalType": "uint8",
"name": "version", "name": "version",
"type": "uint64" "type": "uint8"
} }
], ],
"name": "Initialized", "name": "Initialized",
"type": "event" "type": "event"
},
{
"inputs": [],
"name": "InvalidInitialization",
"type": "error"
},
{
"inputs": [],
"name": "NotInitializing",
"type": "error"
} }
] ]
\ No newline at end of file
[ [
{
"inputs": [
{
"internalType": "address",
"name": "_recipient",
"type": "address"
},
{
"internalType": "uint256",
"name": "_minWithdrawalAmount",
"type": "uint256"
},
{
"internalType": "enum Types.WithdrawalNetwork",
"name": "_withdrawalNetwork",
"type": "uint8"
}
],
"stateMutability": "nonpayable",
"type": "constructor"
},
{ {
"stateMutability": "payable", "stateMutability": "payable",
"type": "receive" "type": "receive"
...@@ -35,30 +56,7 @@ ...@@ -35,30 +56,7 @@
"outputs": [ "outputs": [
{ {
"internalType": "enum Types.WithdrawalNetwork", "internalType": "enum Types.WithdrawalNetwork",
"name": "withdrawalNetwork_", "name": "",
"type": "uint8"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "config",
"outputs": [
{
"internalType": "address",
"name": "recipient_",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount_",
"type": "uint256"
},
{
"internalType": "enum Types.WithdrawalNetwork",
"name": "withdrawalNetwork_",
"type": "uint8" "type": "uint8"
} }
], ],
...@@ -130,7 +128,7 @@ ...@@ -130,7 +128,7 @@
"outputs": [ "outputs": [
{ {
"internalType": "enum Types.WithdrawalNetwork", "internalType": "enum Types.WithdrawalNetwork",
"name": "withdrawalNetwork_", "name": "network_",
"type": "uint8" "type": "uint8"
} }
], ],
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
"name": "OTHER_BRIDGE", "name": "OTHER_BRIDGE",
"outputs": [ "outputs": [
{ {
"internalType": "contract IStandardBridge", "internalType": "contract StandardBridge",
"name": "", "name": "",
"type": "address" "type": "address"
} }
...@@ -447,7 +447,7 @@ ...@@ -447,7 +447,7 @@
"type": "address" "type": "address"
} }
], ],
"stateMutability": "pure", "stateMutability": "view",
"type": "function" "type": "function"
}, },
{ {
...@@ -468,12 +468,12 @@ ...@@ -468,12 +468,12 @@
"name": "otherBridge", "name": "otherBridge",
"outputs": [ "outputs": [
{ {
"internalType": "contract IStandardBridge", "internalType": "contract StandardBridge",
"name": "", "name": "",
"type": "address" "type": "address"
} }
], ],
"stateMutability": "pure", "stateMutability": "view",
"type": "function" "type": "function"
}, },
{ {
......
[ [
{
"inputs": [],
"stateMutability": "nonpayable",
"type": "constructor"
},
{ {
"inputs": [], "inputs": [],
"name": "MESSAGE_VERSION", "name": "MESSAGE_VERSION",
...@@ -159,6 +164,19 @@ ...@@ -159,6 +164,19 @@
"stateMutability": "view", "stateMutability": "view",
"type": "function" "type": "function"
}, },
{
"inputs": [
{
"internalType": "contract CrossDomainMessenger",
"name": "_l1CrossDomainMessenger",
"type": "address"
}
],
"name": "initialize",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{ {
"inputs": [], "inputs": [],
"name": "l1CrossDomainMessenger", "name": "l1CrossDomainMessenger",
...@@ -330,6 +348,19 @@ ...@@ -330,6 +348,19 @@
"name": "FailedRelayedMessage", "name": "FailedRelayedMessage",
"type": "event" "type": "event"
}, },
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint8",
"name": "version",
"type": "uint8"
}
],
"name": "Initialized",
"type": "event"
},
{ {
"anonymous": false, "anonymous": false,
"inputs": [ "inputs": [
......
[ [
{
"inputs": [],
"stateMutability": "nonpayable",
"type": "constructor"
},
{ {
"inputs": [], "inputs": [],
"name": "MESSENGER", "name": "MESSENGER",
...@@ -134,6 +139,19 @@ ...@@ -134,6 +139,19 @@
"stateMutability": "nonpayable", "stateMutability": "nonpayable",
"type": "function" "type": "function"
}, },
{
"inputs": [
{
"internalType": "address payable",
"name": "_l1ERC721Bridge",
"type": "address"
}
],
"name": "initialize",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{ {
"inputs": [], "inputs": [],
"name": "messenger", "name": "messenger",
...@@ -144,7 +162,7 @@ ...@@ -144,7 +162,7 @@
"type": "address" "type": "address"
} }
], ],
"stateMutability": "pure", "stateMutability": "view",
"type": "function" "type": "function"
}, },
{ {
...@@ -271,5 +289,18 @@ ...@@ -271,5 +289,18 @@
], ],
"name": "ERC721BridgeInitiated", "name": "ERC721BridgeInitiated",
"type": "event" "type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint8",
"name": "version",
"type": "uint8"
}
],
"name": "Initialized",
"type": "event"
} }
] ]
\ No newline at end of file
[
{
"inputs": [],
"name": "BRIDGE",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "bridge",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_remoteToken",
"type": "address"
},
{
"internalType": "string",
"name": "_name",
"type": "string"
},
{
"internalType": "string",
"name": "_symbol",
"type": "string"
}
],
"name": "createOptimismMintableERC20",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_remoteToken",
"type": "address"
},
{
"internalType": "string",
"name": "_name",
"type": "string"
},
{
"internalType": "string",
"name": "_symbol",
"type": "string"
},
{
"internalType": "uint8",
"name": "_decimals",
"type": "uint8"
}
],
"name": "createOptimismMintableERC20WithDecimals",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_remoteToken",
"type": "address"
},
{
"internalType": "string",
"name": "_name",
"type": "string"
},
{
"internalType": "string",
"name": "_symbol",
"type": "string"
}
],
"name": "createStandardL2Token",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"name": "deployments",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "version",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "localToken",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "remoteToken",
"type": "address"
},
{
"indexed": false,
"internalType": "address",
"name": "deployer",
"type": "address"
}
],
"name": "OptimismMintableERC20Created",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "remoteToken",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "localToken",
"type": "address"
}
],
"name": "StandardL2TokenCreated",
"type": "event"
}
]
\ No newline at end of file
[
{
"inputs": [],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"inputs": [],
"name": "addressManager",
"outputs": [
{
"internalType": "contract IAddressManager",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address payable",
"name": "_proxy",
"type": "address"
},
{
"internalType": "address",
"name": "_newAdmin",
"type": "address"
}
],
"name": "changeProxyAdmin",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address payable",
"name": "_proxy",
"type": "address"
}
],
"name": "getProxyAdmin",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_proxy",
"type": "address"
}
],
"name": "getProxyImplementation",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"name": "implementationName",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "isUpgrading",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "owner",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "pure",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"name": "proxyType",
"outputs": [
{
"internalType": "enum ProxyAdmin.ProxyType",
"name": "",
"type": "uint8"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "renounceOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "string",
"name": "_name",
"type": "string"
},
{
"internalType": "address",
"name": "_address",
"type": "address"
}
],
"name": "setAddress",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "contract IAddressManager",
"name": "_address",
"type": "address"
}
],
"name": "setAddressManager",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_address",
"type": "address"
},
{
"internalType": "string",
"name": "_name",
"type": "string"
}
],
"name": "setImplementationName",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_address",
"type": "address"
},
{
"internalType": "enum ProxyAdmin.ProxyType",
"name": "_type",
"type": "uint8"
}
],
"name": "setProxyType",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "bool",
"name": "_upgrading",
"type": "bool"
}
],
"name": "setUpgrading",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "newOwner",
"type": "address"
}
],
"name": "transferOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address payable",
"name": "_proxy",
"type": "address"
},
{
"internalType": "address",
"name": "_implementation",
"type": "address"
}
],
"name": "upgrade",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address payable",
"name": "_proxy",
"type": "address"
},
{
"internalType": "address",
"name": "_implementation",
"type": "address"
},
{
"internalType": "bytes",
"name": "_data",
"type": "bytes"
}
],
"name": "upgradeAndCall",
"outputs": [],
"stateMutability": "payable",
"type": "function"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "previousOwner",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "newOwner",
"type": "address"
}
],
"name": "OwnershipTransferred",
"type": "event"
}
]
\ No newline at end of file
[ [
{
"inputs": [],
"stateMutability": "nonpayable",
"type": "constructor"
},
{ {
"stateMutability": "payable", "stateMutability": "payable",
"type": "receive" "type": "receive"
...@@ -21,7 +26,7 @@ ...@@ -21,7 +26,7 @@
"name": "OTHER_BRIDGE", "name": "OTHER_BRIDGE",
"outputs": [ "outputs": [
{ {
"internalType": "contract IStandardBridge", "internalType": "contract StandardBridge",
"name": "", "name": "",
"type": "address" "type": "address"
} }
...@@ -231,6 +236,19 @@ ...@@ -231,6 +236,19 @@
"stateMutability": "payable", "stateMutability": "payable",
"type": "function" "type": "function"
}, },
{
"inputs": [
{
"internalType": "contract StandardBridge",
"name": "_otherBridge",
"type": "address"
}
],
"name": "initialize",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{ {
"inputs": [], "inputs": [],
"name": "l1TokenBridge", "name": "l1TokenBridge",
...@@ -254,7 +272,7 @@ ...@@ -254,7 +272,7 @@
"type": "address" "type": "address"
} }
], ],
"stateMutability": "pure", "stateMutability": "view",
"type": "function" "type": "function"
}, },
{ {
...@@ -262,7 +280,7 @@ ...@@ -262,7 +280,7 @@
"name": "otherBridge", "name": "otherBridge",
"outputs": [ "outputs": [
{ {
"internalType": "contract IStandardBridge", "internalType": "contract StandardBridge",
"name": "", "name": "",
"type": "address" "type": "address"
} }
...@@ -548,6 +566,19 @@ ...@@ -548,6 +566,19 @@
"name": "ETHBridgeInitiated", "name": "ETHBridgeInitiated",
"type": "event" "type": "event"
}, },
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint8",
"name": "version",
"type": "uint8"
}
],
"name": "Initialized",
"type": "event"
},
{ {
"anonymous": false, "anonymous": false,
"inputs": [ "inputs": [
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
"name": "OTHER_BRIDGE", "name": "OTHER_BRIDGE",
"outputs": [ "outputs": [
{ {
"internalType": "contract IStandardBridge", "internalType": "contract StandardBridge",
"name": "", "name": "",
"type": "address" "type": "address"
} }
...@@ -254,6 +254,19 @@ ...@@ -254,6 +254,19 @@
"stateMutability": "payable", "stateMutability": "payable",
"type": "function" "type": "function"
}, },
{
"inputs": [
{
"internalType": "contract StandardBridge",
"name": "_otherBridge",
"type": "address"
}
],
"name": "initialize",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{ {
"inputs": [], "inputs": [],
"name": "l1TokenBridge", "name": "l1TokenBridge",
...@@ -277,7 +290,7 @@ ...@@ -277,7 +290,7 @@
"type": "address" "type": "address"
} }
], ],
"stateMutability": "pure", "stateMutability": "view",
"type": "function" "type": "function"
}, },
{ {
...@@ -285,7 +298,7 @@ ...@@ -285,7 +298,7 @@
"name": "otherBridge", "name": "otherBridge",
"outputs": [ "outputs": [
{ {
"internalType": "contract IStandardBridge", "internalType": "contract StandardBridge",
"name": "", "name": "",
"type": "address" "type": "address"
} }
...@@ -602,6 +615,19 @@ ...@@ -602,6 +615,19 @@
"name": "ETHBridgeInitiated", "name": "ETHBridgeInitiated",
"type": "event" "type": "event"
}, },
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint8",
"name": "version",
"type": "uint8"
}
],
"name": "Initialized",
"type": "event"
},
{ {
"anonymous": false, "anonymous": false,
"inputs": [ "inputs": [
......
...@@ -137,11 +137,6 @@ ...@@ -137,11 +137,6 @@
"internalType": "address", "internalType": "address",
"name": "challenger", "name": "challenger",
"type": "address" "type": "address"
},
{
"internalType": "address",
"name": "systemConfigFeeAdmin",
"type": "address"
} }
], ],
"internalType": "struct OPContractsManager.Roles", "internalType": "struct OPContractsManager.Roles",
......
...@@ -137,11 +137,6 @@ ...@@ -137,11 +137,6 @@
"internalType": "address", "internalType": "address",
"name": "challenger", "name": "challenger",
"type": "address" "type": "address"
},
{
"internalType": "address",
"name": "systemConfigFeeAdmin",
"type": "address"
} }
], ],
"internalType": "struct OPContractsManager.Roles", "internalType": "struct OPContractsManager.Roles",
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
{ {
"inputs": [ "inputs": [
{ {
"internalType": "contract IL2ERC721Bridge", "internalType": "address",
"name": "_bridge", "name": "_bridge",
"type": "address" "type": "address"
}, },
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
"name": "BRIDGE", "name": "BRIDGE",
"outputs": [ "outputs": [
{ {
"internalType": "contract IL2ERC721Bridge", "internalType": "address",
"name": "", "name": "",
"type": "address" "type": "address"
} }
...@@ -124,7 +124,7 @@ ...@@ -124,7 +124,7 @@
"name": "bridge", "name": "bridge",
"outputs": [ "outputs": [
{ {
"internalType": "contract IL2ERC721Bridge", "internalType": "address",
"name": "", "name": "",
"type": "address" "type": "address"
} }
......
[ [
{
"inputs": [
{
"internalType": "address",
"name": "_bridge",
"type": "address"
},
{
"internalType": "uint256",
"name": "_remoteChainId",
"type": "uint256"
}
],
"stateMutability": "nonpayable",
"type": "constructor"
},
{ {
"inputs": [], "inputs": [],
"name": "BRIDGE", "name": "BRIDGE",
"outputs": [ "outputs": [
{ {
"internalType": "contract IL2ERC721Bridge", "internalType": "address",
"name": "", "name": "",
"type": "address" "type": "address"
} }
], ],
"stateMutability": "pure", "stateMutability": "view",
"type": "function" "type": "function"
}, },
{ {
...@@ -30,12 +46,12 @@ ...@@ -30,12 +46,12 @@
"name": "bridge", "name": "bridge",
"outputs": [ "outputs": [
{ {
"internalType": "contract IL2ERC721Bridge", "internalType": "address",
"name": "", "name": "",
"type": "address" "type": "address"
} }
], ],
"stateMutability": "pure", "stateMutability": "view",
"type": "function" "type": "function"
}, },
{ {
...@@ -88,7 +104,7 @@ ...@@ -88,7 +104,7 @@
}, },
{ {
"inputs": [], "inputs": [],
"name": "remoteChainId", "name": "remoteChainID",
"outputs": [ "outputs": [
{ {
"internalType": "uint256", "internalType": "uint256",
......
...@@ -413,17 +413,27 @@ ...@@ -413,17 +413,27 @@
{ {
"inputs": [ "inputs": [
{ {
"internalType": "enum Types.ConfigType", "internalType": "address",
"name": "_type", "name": "_token",
"type": "address"
},
{
"internalType": "uint8",
"name": "_decimals",
"type": "uint8" "type": "uint8"
}, },
{ {
"internalType": "bytes", "internalType": "bytes32",
"name": "_value", "name": "_name",
"type": "bytes" "type": "bytes32"
},
{
"internalType": "bytes32",
"name": "_symbol",
"type": "bytes32"
} }
], ],
"name": "setConfig", "name": "setGasPayingToken",
"outputs": [], "outputs": [],
"stateMutability": "nonpayable", "stateMutability": "nonpayable",
"type": "function" "type": "function"
......
...@@ -605,17 +605,27 @@ ...@@ -605,17 +605,27 @@
{ {
"inputs": [ "inputs": [
{ {
"internalType": "enum Types.ConfigType", "internalType": "address",
"name": "_type", "name": "_token",
"type": "address"
},
{
"internalType": "uint8",
"name": "_decimals",
"type": "uint8" "type": "uint8"
}, },
{ {
"internalType": "bytes", "internalType": "bytes32",
"name": "_value", "name": "_name",
"type": "bytes" "type": "bytes32"
},
{
"internalType": "bytes32",
"name": "_symbol",
"type": "bytes32"
} }
], ],
"name": "setConfig", "name": "setGasPayingToken",
"outputs": [], "outputs": [],
"stateMutability": "nonpayable", "stateMutability": "nonpayable",
"type": "function" "type": "function"
...@@ -659,24 +669,6 @@ ...@@ -659,24 +669,6 @@
"stateMutability": "view", "stateMutability": "view",
"type": "function" "type": "function"
}, },
{
"inputs": [
{
"internalType": "uint32",
"name": "_gasLimit",
"type": "uint32"
},
{
"internalType": "bytes",
"name": "_calldata",
"type": "bytes"
}
],
"name": "upgrade",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{ {
"inputs": [], "inputs": [],
"name": "version", "name": "version",
......
...@@ -605,7 +605,7 @@ ...@@ -605,7 +605,7 @@
{ {
"inputs": [ "inputs": [
{ {
"internalType": "enum Types.ConfigType", "internalType": "enum ConfigType",
"name": "_type", "name": "_type",
"type": "uint8" "type": "uint8"
}, },
...@@ -620,6 +620,34 @@ ...@@ -620,6 +620,34 @@
"stateMutability": "nonpayable", "stateMutability": "nonpayable",
"type": "function" "type": "function"
}, },
{
"inputs": [
{
"internalType": "address",
"name": "_token",
"type": "address"
},
{
"internalType": "uint8",
"name": "_decimals",
"type": "uint8"
},
{
"internalType": "bytes32",
"name": "_name",
"type": "bytes32"
},
{
"internalType": "bytes32",
"name": "_symbol",
"type": "bytes32"
}
],
"name": "setGasPayingToken",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{ {
"inputs": [ "inputs": [
{ {
...@@ -659,24 +687,6 @@ ...@@ -659,24 +687,6 @@
"stateMutability": "view", "stateMutability": "view",
"type": "function" "type": "function"
}, },
{
"inputs": [
{
"internalType": "uint32",
"name": "_gasLimit",
"type": "uint32"
},
{
"internalType": "bytes",
"name": "_calldata",
"type": "bytes"
}
],
"name": "upgrade",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{ {
"inputs": [], "inputs": [],
"name": "version", "name": "version",
......
[ [
{
"inputs": [
{
"internalType": "address",
"name": "_recipient",
"type": "address"
},
{
"internalType": "uint256",
"name": "_minWithdrawalAmount",
"type": "uint256"
},
{
"internalType": "enum Types.WithdrawalNetwork",
"name": "_withdrawalNetwork",
"type": "uint8"
}
],
"stateMutability": "nonpayable",
"type": "constructor"
},
{ {
"stateMutability": "payable", "stateMutability": "payable",
"type": "receive" "type": "receive"
...@@ -35,30 +56,7 @@ ...@@ -35,30 +56,7 @@
"outputs": [ "outputs": [
{ {
"internalType": "enum Types.WithdrawalNetwork", "internalType": "enum Types.WithdrawalNetwork",
"name": "withdrawalNetwork_", "name": "",
"type": "uint8"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "config",
"outputs": [
{
"internalType": "address",
"name": "recipient_",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount_",
"type": "uint256"
},
{
"internalType": "enum Types.WithdrawalNetwork",
"name": "withdrawalNetwork_",
"type": "uint8" "type": "uint8"
} }
], ],
...@@ -71,7 +69,7 @@ ...@@ -71,7 +69,7 @@
"outputs": [ "outputs": [
{ {
"internalType": "address", "internalType": "address",
"name": "recipient_", "name": "",
"type": "address" "type": "address"
} }
], ],
...@@ -143,7 +141,7 @@ ...@@ -143,7 +141,7 @@
"outputs": [ "outputs": [
{ {
"internalType": "enum Types.WithdrawalNetwork", "internalType": "enum Types.WithdrawalNetwork",
"name": "withdrawalNetwork_", "name": "network_",
"type": "uint8" "type": "uint8"
} }
], ],
......
...@@ -30,19 +30,6 @@ ...@@ -30,19 +30,6 @@
"stateMutability": "view", "stateMutability": "view",
"type": "function" "type": "function"
}, },
{
"inputs": [],
"name": "UPGRADER_SLOT",
"outputs": [
{
"internalType": "bytes32",
"name": "",
"type": "bytes32"
}
],
"stateMutability": "view",
"type": "function"
},
{ {
"inputs": [], "inputs": [],
"name": "guardian", "name": "guardian",
...@@ -63,11 +50,6 @@ ...@@ -63,11 +50,6 @@
"name": "_guardian", "name": "_guardian",
"type": "address" "type": "address"
}, },
{
"internalType": "address",
"name": "_upgrader",
"type": "address"
},
{ {
"internalType": "bool", "internalType": "bool",
"name": "_paused", "name": "_paused",
...@@ -112,19 +94,6 @@ ...@@ -112,19 +94,6 @@
"stateMutability": "nonpayable", "stateMutability": "nonpayable",
"type": "function" "type": "function"
}, },
{
"inputs": [],
"name": "upgrader",
"outputs": [
{
"internalType": "address",
"name": "upgrader_",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{ {
"inputs": [], "inputs": [],
"name": "version", "name": "version",
......
...@@ -225,19 +225,6 @@ ...@@ -225,19 +225,6 @@
"stateMutability": "view", "stateMutability": "view",
"type": "function" "type": "function"
}, },
{
"inputs": [],
"name": "feeAdmin",
"outputs": [
{
"internalType": "address",
"name": "addr_",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{ {
"inputs": [], "inputs": [],
"name": "gasLimit", "name": "gasLimit",
...@@ -297,33 +284,11 @@ ...@@ -297,33 +284,11 @@
}, },
{ {
"inputs": [ "inputs": [
{
"components": [
{ {
"internalType": "address", "internalType": "address",
"name": "owner", "name": "_owner",
"type": "address" "type": "address"
}, },
{
"internalType": "address",
"name": "feeAdmin",
"type": "address"
},
{
"internalType": "address",
"name": "unsafeBlockSigner",
"type": "address"
},
{
"internalType": "bytes32",
"name": "batcherHash",
"type": "bytes32"
}
],
"internalType": "struct SystemConfig.Roles",
"name": "_roles",
"type": "tuple"
},
{ {
"internalType": "uint32", "internalType": "uint32",
"name": "_basefeeScalar", "name": "_basefeeScalar",
...@@ -334,11 +299,21 @@ ...@@ -334,11 +299,21 @@
"name": "_blobbasefeeScalar", "name": "_blobbasefeeScalar",
"type": "uint32" "type": "uint32"
}, },
{
"internalType": "bytes32",
"name": "_batcherHash",
"type": "bytes32"
},
{ {
"internalType": "uint64", "internalType": "uint64",
"name": "_gasLimit", "name": "_gasLimit",
"type": "uint64" "type": "uint64"
}, },
{
"internalType": "address",
"name": "_unsafeBlockSigner",
"type": "address"
},
{ {
"components": [ "components": [
{ {
...@@ -655,34 +630,6 @@ ...@@ -655,34 +630,6 @@
"stateMutability": "nonpayable", "stateMutability": "nonpayable",
"type": "function" "type": "function"
}, },
{
"inputs": [
{
"internalType": "enum Types.ConfigType",
"name": "_type",
"type": "uint8"
},
{
"internalType": "address",
"name": "_recipient",
"type": "address"
},
{
"internalType": "uint256",
"name": "_min",
"type": "uint256"
},
{
"internalType": "enum Types.WithdrawalNetwork",
"name": "_network",
"type": "uint8"
}
],
"name": "setFeeVaultConfig",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{ {
"inputs": [ "inputs": [
{ {
...@@ -853,10 +800,5 @@ ...@@ -853,10 +800,5 @@
], ],
"name": "OwnershipTransferred", "name": "OwnershipTransferred",
"type": "event" "type": "event"
},
{
"inputs": [],
"name": "UnsafeCast",
"type": "error"
} }
] ]
\ No newline at end of file
...@@ -246,19 +246,6 @@ ...@@ -246,19 +246,6 @@
"stateMutability": "view", "stateMutability": "view",
"type": "function" "type": "function"
}, },
{
"inputs": [],
"name": "feeAdmin",
"outputs": [
{
"internalType": "address",
"name": "addr_",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{ {
"inputs": [], "inputs": [],
"name": "gasLimit", "name": "gasLimit",
...@@ -318,33 +305,11 @@ ...@@ -318,33 +305,11 @@
}, },
{ {
"inputs": [ "inputs": [
{
"components": [
{ {
"internalType": "address", "internalType": "address",
"name": "owner", "name": "_owner",
"type": "address" "type": "address"
}, },
{
"internalType": "address",
"name": "feeAdmin",
"type": "address"
},
{
"internalType": "address",
"name": "unsafeBlockSigner",
"type": "address"
},
{
"internalType": "bytes32",
"name": "batcherHash",
"type": "bytes32"
}
],
"internalType": "struct SystemConfig.Roles",
"name": "_roles",
"type": "tuple"
},
{ {
"internalType": "uint32", "internalType": "uint32",
"name": "_basefeeScalar", "name": "_basefeeScalar",
...@@ -355,11 +320,21 @@ ...@@ -355,11 +320,21 @@
"name": "_blobbasefeeScalar", "name": "_blobbasefeeScalar",
"type": "uint32" "type": "uint32"
}, },
{
"internalType": "bytes32",
"name": "_batcherHash",
"type": "bytes32"
},
{ {
"internalType": "uint64", "internalType": "uint64",
"name": "_gasLimit", "name": "_gasLimit",
"type": "uint64" "type": "uint64"
}, },
{
"internalType": "address",
"name": "_unsafeBlockSigner",
"type": "address"
},
{ {
"components": [ "components": [
{ {
...@@ -443,6 +418,11 @@ ...@@ -443,6 +418,11 @@
"internalType": "struct SystemConfig.Addresses", "internalType": "struct SystemConfig.Addresses",
"name": "_addresses", "name": "_addresses",
"type": "tuple" "type": "tuple"
},
{
"internalType": "address",
"name": "_dependencyManager",
"type": "address"
} }
], ],
"name": "initialize", "name": "initialize",
...@@ -452,33 +432,11 @@ ...@@ -452,33 +432,11 @@
}, },
{ {
"inputs": [ "inputs": [
{
"components": [
{
"internalType": "address",
"name": "owner",
"type": "address"
},
{ {
"internalType": "address", "internalType": "address",
"name": "feeAdmin", "name": "_owner",
"type": "address" "type": "address"
}, },
{
"internalType": "address",
"name": "unsafeBlockSigner",
"type": "address"
},
{
"internalType": "bytes32",
"name": "batcherHash",
"type": "bytes32"
}
],
"internalType": "struct SystemConfig.Roles",
"name": "_roles",
"type": "tuple"
},
{ {
"internalType": "uint32", "internalType": "uint32",
"name": "_basefeeScalar", "name": "_basefeeScalar",
...@@ -489,11 +447,21 @@ ...@@ -489,11 +447,21 @@
"name": "_blobbasefeeScalar", "name": "_blobbasefeeScalar",
"type": "uint32" "type": "uint32"
}, },
{
"internalType": "bytes32",
"name": "_batcherHash",
"type": "bytes32"
},
{ {
"internalType": "uint64", "internalType": "uint64",
"name": "_gasLimit", "name": "_gasLimit",
"type": "uint64" "type": "uint64"
}, },
{
"internalType": "address",
"name": "_unsafeBlockSigner",
"type": "address"
},
{ {
"components": [ "components": [
{ {
...@@ -577,11 +545,6 @@ ...@@ -577,11 +545,6 @@
"internalType": "struct SystemConfig.Addresses", "internalType": "struct SystemConfig.Addresses",
"name": "_addresses", "name": "_addresses",
"type": "tuple" "type": "tuple"
},
{
"internalType": "address",
"name": "_dependencyManager",
"type": "address"
} }
], ],
"name": "initialize", "name": "initialize",
...@@ -828,34 +791,6 @@ ...@@ -828,34 +791,6 @@
"stateMutability": "nonpayable", "stateMutability": "nonpayable",
"type": "function" "type": "function"
}, },
{
"inputs": [
{
"internalType": "enum Types.ConfigType",
"name": "_type",
"type": "uint8"
},
{
"internalType": "address",
"name": "_recipient",
"type": "address"
},
{
"internalType": "uint256",
"name": "_min",
"type": "uint256"
},
{
"internalType": "enum Types.WithdrawalNetwork",
"name": "_network",
"type": "uint8"
}
],
"name": "setFeeVaultConfig",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{ {
"inputs": [ "inputs": [
{ {
...@@ -1026,10 +961,5 @@ ...@@ -1026,10 +961,5 @@
], ],
"name": "OwnershipTransferred", "name": "OwnershipTransferred",
"type": "event" "type": "event"
},
{
"inputs": [],
"name": "UnsafeCast",
"type": "error"
} }
] ]
\ No newline at end of file
[
{
"bytes": "20",
"label": "spacer_0_0_20",
"offset": 0,
"slot": "0",
"type": "address"
}
]
\ No newline at end of file
[
{
"bytes": "1600",
"label": "spacer_1_0_1600",
"offset": 0,
"slot": "0",
"type": "uint256[50]"
},
{
"bytes": "20",
"label": "spacer_51_0_20",
"offset": 0,
"slot": "50",
"type": "address"
},
{
"bytes": "1568",
"label": "spacer_52_0_1568",
"offset": 0,
"slot": "51",
"type": "uint256[49]"
},
{
"bytes": "1",
"label": "spacer_101_0_1",
"offset": 0,
"slot": "100",
"type": "bool"
},
{
"bytes": "1568",
"label": "spacer_102_0_1568",
"offset": 0,
"slot": "101",
"type": "uint256[49]"
},
{
"bytes": "32",
"label": "spacer_151_0_32",
"offset": 0,
"slot": "150",
"type": "uint256"
},
{
"bytes": "1568",
"label": "spacer_152_0_1568",
"offset": 0,
"slot": "151",
"type": "uint256[49]"
},
{
"bytes": "32",
"label": "spacer_201_0_32",
"offset": 0,
"slot": "200",
"type": "mapping(bytes32 => bool)"
},
{
"bytes": "32",
"label": "spacer_202_0_32",
"offset": 0,
"slot": "201",
"type": "mapping(bytes32 => bool)"
}
]
\ No newline at end of file
...@@ -75,12 +75,5 @@ ...@@ -75,12 +75,5 @@
"offset": 0, "offset": 0,
"slot": "7", "slot": "7",
"type": "uint256" "type": "uint256"
},
{
"bytes": "1",
"label": "isIsthmus",
"offset": 0,
"slot": "8",
"type": "bool"
} }
] ]
\ No newline at end of file
...@@ -76,18 +76,11 @@ ...@@ -76,18 +76,11 @@
"slot": "7", "slot": "7",
"type": "uint256" "type": "uint256"
}, },
{
"bytes": "1",
"label": "isIsthmus",
"offset": 0,
"slot": "8",
"type": "bool"
},
{ {
"bytes": "64", "bytes": "64",
"label": "dependencySet", "label": "dependencySet",
"offset": 0, "offset": 0,
"slot": "9", "slot": "8",
"type": "struct EnumerableSet.UintSet" "type": "struct EnumerableSet.UintSet"
} }
] ]
\ No newline at end of file
...@@ -7,11 +7,18 @@ ...@@ -7,11 +7,18 @@
"type": "address" "type": "address"
}, },
{ {
"bytes": "12", "bytes": "1",
"label": "spacer_0_20_12", "label": "_initialized",
"offset": 20, "offset": 20,
"slot": "0", "slot": "0",
"type": "bytes12" "type": "uint8"
},
{
"bytes": "1",
"label": "_initializing",
"offset": 21,
"slot": "0",
"type": "bool"
}, },
{ {
"bytes": "1600", "bytes": "1600",
...@@ -85,10 +92,10 @@ ...@@ -85,10 +92,10 @@
}, },
{ {
"bytes": "20", "bytes": "20",
"label": "spacer_204_0_20", "label": "xDomainMsgSender",
"offset": 0, "offset": 0,
"slot": "204", "slot": "204",
"type": "bytes20" "type": "address"
}, },
{ {
"bytes": "30", "bytes": "30",
...@@ -106,52 +113,17 @@ ...@@ -106,52 +113,17 @@
}, },
{ {
"bytes": "20", "bytes": "20",
"label": "spacer_207_0_20", "label": "otherMessenger",
"offset": 0, "offset": 0,
"slot": "207", "slot": "207",
"type": "address" "type": "contract CrossDomainMessenger"
},
{
"bytes": "20",
"label": "xDomainMsgSender",
"offset": 0,
"slot": "208",
"type": "address"
}, },
{ {
"bytes": "12", "bytes": "1376",
"label": "spacer_208_20_12",
"offset": 20,
"slot": "208",
"type": "bytes12"
},
{
"bytes": "1312",
"label": "__gap", "label": "__gap",
"offset": 0, "offset": 0,
"slot": "209", "slot": "208",
"type": "uint256[41]" "type": "uint256[43]"
},
{
"bytes": "1",
"label": "_initialized",
"offset": 0,
"slot": "250",
"type": "uint8"
},
{
"bytes": "1",
"label": "_initializing",
"offset": 1,
"slot": "250",
"type": "bool"
},
{
"bytes": "30",
"label": "spacer_250_2_30",
"offset": 2,
"slot": "250",
"type": "bytes30"
}, },
{ {
"bytes": "20", "bytes": "20",
......
[ [
{ {
"bytes": "32", "bytes": "1",
"label": "spacer_0_0_32", "label": "_initialized",
"offset": 0, "offset": 0,
"slot": "0", "slot": "0",
"type": "bytes32" "type": "uint8"
},
{
"bytes": "1",
"label": "_initializing",
"offset": 1,
"slot": "0",
"type": "bool"
},
{
"bytes": "30",
"label": "spacer_0_2_30",
"offset": 2,
"slot": "0",
"type": "bytes30"
}, },
{ {
"bytes": "20", "bytes": "20",
"label": "spacer_1_0_20", "label": "messenger",
"offset": 0, "offset": 0,
"slot": "1", "slot": "1",
"type": "address" "type": "contract ICrossDomainMessenger"
}, },
{ {
"bytes": "20", "bytes": "20",
"label": "spacer_2_0_20", "label": "otherBridge",
"offset": 0, "offset": 0,
"slot": "2", "slot": "2",
"type": "address" "type": "contract ERC721Bridge"
}, },
{ {
"bytes": "1472", "bytes": "1472",
...@@ -40,12 +54,5 @@ ...@@ -40,12 +54,5 @@
"offset": 0, "offset": 0,
"slot": "50", "slot": "50",
"type": "contract ISuperchainConfig" "type": "contract ISuperchainConfig"
},
{
"bytes": "20",
"label": "crossDomainMessenger",
"offset": 0,
"slot": "51",
"type": "contract ICrossDomainMessenger"
} }
] ]
\ No newline at end of file
[ [
{ {
"bytes": "32", "bytes": "1",
"label": "spacer_0_0_32", "label": "_initialized",
"offset": 0, "offset": 0,
"slot": "0", "slot": "0",
"type": "bytes32" "type": "uint8"
},
{
"bytes": "1",
"label": "_initializing",
"offset": 1,
"slot": "0",
"type": "bool"
},
{
"bytes": "30",
"label": "spacer_0_2_30",
"offset": 2,
"slot": "0",
"type": "bytes30"
}, },
{ {
"bytes": "20", "bytes": "20",
...@@ -22,45 +36,24 @@ ...@@ -22,45 +36,24 @@
}, },
{ {
"bytes": "20", "bytes": "20",
"label": "spacer_3_0_20", "label": "messenger",
"offset": 0, "offset": 0,
"slot": "3", "slot": "3",
"type": "address" "type": "contract ICrossDomainMessenger"
}, },
{ {
"bytes": "20", "bytes": "20",
"label": "spacer_4_0_20", "label": "otherBridge",
"offset": 0, "offset": 0,
"slot": "4", "slot": "4",
"type": "address" "type": "contract StandardBridge"
}, },
{ {
"bytes": "1408", "bytes": "1440",
"label": "__gap", "label": "__gap",
"offset": 0, "offset": 0,
"slot": "5", "slot": "5",
"type": "uint256[44]" "type": "uint256[45]"
},
{
"bytes": "1",
"label": "_initialized",
"offset": 0,
"slot": "49",
"type": "uint8"
},
{
"bytes": "1",
"label": "_initializing",
"offset": 1,
"slot": "49",
"type": "bool"
},
{
"bytes": "30",
"label": "spacer_49_2_30",
"offset": 2,
"slot": "49",
"type": "bytes30"
}, },
{ {
"bytes": "20", "bytes": "20",
...@@ -75,12 +68,5 @@ ...@@ -75,12 +68,5 @@
"offset": 0, "offset": 0,
"slot": "51", "slot": "51",
"type": "contract ISystemConfig" "type": "contract ISystemConfig"
},
{
"bytes": "20",
"label": "crossDomainMessenger",
"offset": 0,
"slot": "52",
"type": "contract ICrossDomainMessenger"
} }
] ]
\ No newline at end of file
...@@ -7,11 +7,18 @@ ...@@ -7,11 +7,18 @@
"type": "address" "type": "address"
}, },
{ {
"bytes": "12", "bytes": "1",
"label": "spacer_0_20_12", "label": "_initialized",
"offset": 20, "offset": 20,
"slot": "0", "slot": "0",
"type": "bytes12" "type": "uint8"
},
{
"bytes": "1",
"label": "_initializing",
"offset": 21,
"slot": "0",
"type": "bool"
}, },
{ {
"bytes": "1600", "bytes": "1600",
...@@ -85,10 +92,10 @@ ...@@ -85,10 +92,10 @@
}, },
{ {
"bytes": "20", "bytes": "20",
"label": "spacer_204_0_20", "label": "xDomainMsgSender",
"offset": 0, "offset": 0,
"slot": "204", "slot": "204",
"type": "bytes20" "type": "address"
}, },
{ {
"bytes": "30", "bytes": "30",
...@@ -106,30 +113,16 @@ ...@@ -106,30 +113,16 @@
}, },
{ {
"bytes": "20", "bytes": "20",
"label": "spacer_207_0_20", "label": "otherMessenger",
"offset": 0, "offset": 0,
"slot": "207", "slot": "207",
"type": "address" "type": "contract CrossDomainMessenger"
}, },
{ {
"bytes": "20", "bytes": "1376",
"label": "xDomainMsgSender",
"offset": 0,
"slot": "208",
"type": "address"
},
{
"bytes": "12",
"label": "spacer_208_20_12",
"offset": 20,
"slot": "208",
"type": "bytes12"
},
{
"bytes": "1312",
"label": "__gap", "label": "__gap",
"offset": 0, "offset": 0,
"slot": "209", "slot": "208",
"type": "uint256[41]" "type": "uint256[43]"
} }
] ]
\ No newline at end of file
[ [
{ {
"bytes": "32", "bytes": "1",
"label": "spacer_0_0_32", "label": "_initialized",
"offset": 0, "offset": 0,
"slot": "0", "slot": "0",
"type": "bytes32" "type": "uint8"
},
{
"bytes": "1",
"label": "_initializing",
"offset": 1,
"slot": "0",
"type": "bool"
},
{
"bytes": "30",
"label": "spacer_0_2_30",
"offset": 2,
"slot": "0",
"type": "bytes30"
}, },
{ {
"bytes": "20", "bytes": "20",
"label": "spacer_1_0_20", "label": "messenger",
"offset": 0, "offset": 0,
"slot": "1", "slot": "1",
"type": "address" "type": "contract ICrossDomainMessenger"
}, },
{ {
"bytes": "20", "bytes": "20",
"label": "spacer_2_0_20", "label": "otherBridge",
"offset": 0, "offset": 0,
"slot": "2", "slot": "2",
"type": "address" "type": "contract ERC721Bridge"
}, },
{ {
"bytes": "1472", "bytes": "1472",
......
[
{
"bytes": "32",
"label": "spacer_0_0_32",
"offset": 0,
"slot": "0",
"type": "bytes32"
},
{
"bytes": "32",
"label": "spacer_1_0_32",
"offset": 0,
"slot": "1",
"type": "bytes32"
},
{
"bytes": "32",
"label": "deployments",
"offset": 0,
"slot": "2",
"type": "mapping(address => address)"
},
{
"bytes": "1536",
"label": "__gap",
"offset": 0,
"slot": "3",
"type": "uint256[48]"
}
]
\ No newline at end of file
[
{
"bytes": "20",
"label": "_owner",
"offset": 0,
"slot": "0",
"type": "address"
},
{
"bytes": "32",
"label": "proxyType",
"offset": 0,
"slot": "1",
"type": "mapping(address => enum ProxyAdmin.ProxyType)"
},
{
"bytes": "32",
"label": "implementationName",
"offset": 0,
"slot": "2",
"type": "mapping(address => string)"
},
{
"bytes": "20",
"label": "addressManager",
"offset": 0,
"slot": "3",
"type": "contract IAddressManager"
},
{
"bytes": "1",
"label": "upgrading",
"offset": 20,
"slot": "3",
"type": "bool"
}
]
\ No newline at end of file
[ [
{ {
"bytes": "32", "bytes": "1",
"label": "spacer_0_0_32", "label": "_initialized",
"offset": 0, "offset": 0,
"slot": "0", "slot": "0",
"type": "bytes32" "type": "uint8"
},
{
"bytes": "1",
"label": "_initializing",
"offset": 1,
"slot": "0",
"type": "bool"
},
{
"bytes": "30",
"label": "spacer_0_2_30",
"offset": 2,
"slot": "0",
"type": "bytes30"
}, },
{ {
"bytes": "20", "bytes": "20",
...@@ -22,23 +36,23 @@ ...@@ -22,23 +36,23 @@
}, },
{ {
"bytes": "20", "bytes": "20",
"label": "spacer_3_0_20", "label": "messenger",
"offset": 0, "offset": 0,
"slot": "3", "slot": "3",
"type": "address" "type": "contract ICrossDomainMessenger"
}, },
{ {
"bytes": "20", "bytes": "20",
"label": "spacer_4_0_20", "label": "otherBridge",
"offset": 0, "offset": 0,
"slot": "4", "slot": "4",
"type": "address" "type": "contract StandardBridge"
}, },
{ {
"bytes": "1408", "bytes": "1440",
"label": "__gap", "label": "__gap",
"offset": 0, "offset": 0,
"slot": "5", "slot": "5",
"type": "uint256[44]" "type": "uint256[45]"
} }
] ]
\ No newline at end of file
[ [
{ {
"bytes": "32", "bytes": "1",
"label": "spacer_0_0_32", "label": "_initialized",
"offset": 0, "offset": 0,
"slot": "0", "slot": "0",
"type": "bytes32" "type": "uint8"
},
{
"bytes": "1",
"label": "_initializing",
"offset": 1,
"slot": "0",
"type": "bool"
},
{
"bytes": "30",
"label": "spacer_0_2_30",
"offset": 2,
"slot": "0",
"type": "bytes30"
}, },
{ {
"bytes": "20", "bytes": "20",
...@@ -22,23 +36,23 @@ ...@@ -22,23 +36,23 @@
}, },
{ {
"bytes": "20", "bytes": "20",
"label": "spacer_3_0_20", "label": "messenger",
"offset": 0, "offset": 0,
"slot": "3", "slot": "3",
"type": "address" "type": "contract ICrossDomainMessenger"
}, },
{ {
"bytes": "20", "bytes": "20",
"label": "spacer_4_0_20", "label": "otherBridge",
"offset": 0, "offset": 0,
"slot": "4", "slot": "4",
"type": "address" "type": "contract StandardBridge"
}, },
{ {
"bytes": "1408", "bytes": "1440",
"label": "__gap", "label": "__gap",
"offset": 0, "offset": 0,
"slot": "5", "slot": "5",
"type": "uint256[44]" "type": "uint256[45]"
} }
] ]
\ No newline at end of file
[ [
{
"bytes": "32",
"label": "spacer_0_0_32",
"offset": 0,
"slot": "0",
"type": "bytes32"
},
{
"bytes": "32",
"label": "spacer_1_0_32",
"offset": 0,
"slot": "1",
"type": "bytes32"
},
{
"bytes": "32",
"label": "deployments",
"offset": 0,
"slot": "2",
"type": "mapping(address => address)"
},
{
"bytes": "1536",
"label": "__gap",
"offset": 0,
"slot": "3",
"type": "uint256[48]"
},
{ {
"bytes": "1", "bytes": "1",
"label": "_initialized", "label": "_initialized",
"offset": 0, "offset": 0,
"slot": "51", "slot": "0",
"type": "uint8" "type": "uint8"
}, },
{ {
"bytes": "1", "bytes": "1",
"label": "_initializing", "label": "_initializing",
"offset": 1, "offset": 1,
"slot": "51", "slot": "0",
"type": "bool" "type": "bool"
}, },
{ {
"bytes": "30", "bytes": "30",
"label": "spacer_51_2_30", "label": "spacer_0_2_30",
"offset": 2, "offset": 2,
"slot": "51", "slot": "0",
"type": "bytes30" "type": "bytes30"
}, },
{ {
"bytes": "20", "bytes": "20",
"label": "standardBridge", "label": "bridge",
"offset": 0, "offset": 0,
"slot": "52", "slot": "1",
"type": "address" "type": "address"
},
{
"bytes": "32",
"label": "deployments",
"offset": 0,
"slot": "2",
"type": "mapping(address => address)"
},
{
"bytes": "1536",
"label": "__gap",
"offset": 0,
"slot": "3",
"type": "uint256[48]"
} }
] ]
\ No newline at end of file
...@@ -3,7 +3,6 @@ pragma solidity 0.8.15; ...@@ -3,7 +3,6 @@ pragma solidity 0.8.15;
// Contracts // Contracts
import { CrossDomainMessenger } from "src/universal/CrossDomainMessenger.sol"; import { CrossDomainMessenger } from "src/universal/CrossDomainMessenger.sol";
import { Initializable } from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
// Libraries // Libraries
import { Predeploys } from "src/libraries/Predeploys.sol"; import { Predeploys } from "src/libraries/Predeploys.sol";
...@@ -19,10 +18,7 @@ import { IOptimismPortal } from "src/L1/interfaces/IOptimismPortal.sol"; ...@@ -19,10 +18,7 @@ import { IOptimismPortal } from "src/L1/interfaces/IOptimismPortal.sol";
/// @notice The L1CrossDomainMessenger is a message passing interface between L1 and L2 responsible /// @notice The L1CrossDomainMessenger is a message passing interface between L1 and L2 responsible
/// for sending and receiving data on the L1 side. Users are encouraged to use this /// for sending and receiving data on the L1 side. Users are encouraged to use this
/// interface instead of interacting with lower-level contracts directly. /// interface instead of interacting with lower-level contracts directly.
contract L1CrossDomainMessenger is CrossDomainMessenger, ISemver, Initializable { contract L1CrossDomainMessenger is CrossDomainMessenger, ISemver {
/// @notice Spacer to give the initializer a full slot, to avoid offsetting the superchainConfig slot.
bytes30 private spacer_250_2_30;
/// @notice Contract of the SuperchainConfig. /// @notice Contract of the SuperchainConfig.
ISuperchainConfig public superchainConfig; ISuperchainConfig public superchainConfig;
...@@ -34,12 +30,16 @@ contract L1CrossDomainMessenger is CrossDomainMessenger, ISemver, Initializable ...@@ -34,12 +30,16 @@ contract L1CrossDomainMessenger is CrossDomainMessenger, ISemver, Initializable
ISystemConfig public systemConfig; ISystemConfig public systemConfig;
/// @notice Semantic version. /// @notice Semantic version.
/// @custom:semver 2.4.1-beta.3 /// @custom:semver 2.4.1-beta.2
string public constant version = "2.4.1-beta.3"; string public constant version = "2.4.1-beta.2";
/// @notice Constructs the L1CrossDomainMessenger contract. /// @notice Constructs the L1CrossDomainMessenger contract.
constructor() CrossDomainMessenger() { constructor() CrossDomainMessenger() {
_disableInitializers(); initialize({
_superchainConfig: ISuperchainConfig(address(0)),
_portal: IOptimismPortal(payable(address(0))),
_systemConfig: ISystemConfig(address(0))
});
} }
/// @notice Initializes the contract. /// @notice Initializes the contract.
...@@ -57,12 +57,7 @@ contract L1CrossDomainMessenger is CrossDomainMessenger, ISemver, Initializable ...@@ -57,12 +57,7 @@ contract L1CrossDomainMessenger is CrossDomainMessenger, ISemver, Initializable
superchainConfig = _superchainConfig; superchainConfig = _superchainConfig;
portal = _portal; portal = _portal;
systemConfig = _systemConfig; systemConfig = _systemConfig;
} __CrossDomainMessenger_init({ _otherMessenger: CrossDomainMessenger(Predeploys.L2_CROSS_DOMAIN_MESSENGER) });
/// @notice Getter function for the other messenger.
/// @return Contract of the messenger on the other network.
function otherMessenger() public pure override returns (CrossDomainMessenger) {
return CrossDomainMessenger(Predeploys.L2_CROSS_DOMAIN_MESSENGER);
} }
/// @inheritdoc CrossDomainMessenger /// @inheritdoc CrossDomainMessenger
...@@ -91,7 +86,7 @@ contract L1CrossDomainMessenger is CrossDomainMessenger, ISemver, Initializable ...@@ -91,7 +86,7 @@ contract L1CrossDomainMessenger is CrossDomainMessenger, ISemver, Initializable
/// @inheritdoc CrossDomainMessenger /// @inheritdoc CrossDomainMessenger
function _isOtherMessenger() internal view override returns (bool) { function _isOtherMessenger() internal view override returns (bool) {
return msg.sender == address(portal) && portal.l2Sender() == address(otherMessenger()); return msg.sender == address(portal) && portal.l2Sender() == address(otherMessenger);
} }
/// @inheritdoc CrossDomainMessenger /// @inheritdoc CrossDomainMessenger
......
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
pragma solidity 0.8.25; pragma solidity 0.8.15;
// Contracts // Contracts
import { ERC721Bridge } from "src/universal/ERC721Bridge.sol"; import { ERC721Bridge } from "src/universal/ERC721Bridge.sol";
import { Initializable } from "@openzeppelin/contracts-v5/proxy/utils/Initializable.sol";
// Libraries // Libraries
import { Predeploys } from "src/libraries/Predeploys.sol"; import { Predeploys } from "src/libraries/Predeploys.sol";
...@@ -20,7 +19,7 @@ import { IL2ERC721Bridge } from "src/L2/interfaces/IL2ERC721Bridge.sol"; ...@@ -20,7 +19,7 @@ import { IL2ERC721Bridge } from "src/L2/interfaces/IL2ERC721Bridge.sol";
/// @notice The L1 ERC721 bridge is a contract which works together with the L2 ERC721 bridge to /// @notice The L1 ERC721 bridge is a contract which works together with the L2 ERC721 bridge to
/// make it possible to transfer ERC721 tokens from Ethereum to Optimism. This contract /// make it possible to transfer ERC721 tokens from Ethereum to Optimism. This contract
/// acts as an escrow for ERC721 tokens deposited into L2. /// acts as an escrow for ERC721 tokens deposited into L2.
contract L1ERC721Bridge is ERC721Bridge, Initializable, ISemver { contract L1ERC721Bridge is ERC721Bridge, ISemver {
/// @notice Mapping of L1 token to L2 token to ID to boolean, indicating if the given L1 token /// @notice Mapping of L1 token to L2 token to ID to boolean, indicating if the given L1 token
/// by ID was deposited for a given L2 token. /// by ID was deposited for a given L2 token.
mapping(address => mapping(address => mapping(uint256 => bool))) public deposits; mapping(address => mapping(address => mapping(uint256 => bool))) public deposits;
...@@ -28,16 +27,13 @@ contract L1ERC721Bridge is ERC721Bridge, Initializable, ISemver { ...@@ -28,16 +27,13 @@ contract L1ERC721Bridge is ERC721Bridge, Initializable, ISemver {
/// @notice Address of the SuperchainConfig contract. /// @notice Address of the SuperchainConfig contract.
ISuperchainConfig public superchainConfig; ISuperchainConfig public superchainConfig;
/// @notice Contract of the CrossDomainMessenger on this chain.
ICrossDomainMessenger internal crossDomainMessenger;
/// @notice Semantic version. /// @notice Semantic version.
/// @custom:semver 2.1.1-beta.3 /// @custom:semver 2.2.0-beta.1
string public constant version = "2.1.1-beta.3"; string public constant version = "2.2.0-beta.1";
/// @notice Constructs the L1ERC721Bridge contract. /// @notice Constructs the L1ERC721Bridge contract.
constructor() ERC721Bridge() { constructor() ERC721Bridge() {
_disableInitializers(); initialize({ _messenger: ICrossDomainMessenger(address(0)), _superchainConfig: ISuperchainConfig(address(0)) });
} }
/// @notice Initializes the contract. /// @notice Initializes the contract.
...@@ -45,19 +41,7 @@ contract L1ERC721Bridge is ERC721Bridge, Initializable, ISemver { ...@@ -45,19 +41,7 @@ contract L1ERC721Bridge is ERC721Bridge, Initializable, ISemver {
/// @param _superchainConfig Contract of the SuperchainConfig contract on this network. /// @param _superchainConfig Contract of the SuperchainConfig contract on this network.
function initialize(ICrossDomainMessenger _messenger, ISuperchainConfig _superchainConfig) public initializer { function initialize(ICrossDomainMessenger _messenger, ISuperchainConfig _superchainConfig) public initializer {
superchainConfig = _superchainConfig; superchainConfig = _superchainConfig;
crossDomainMessenger = _messenger; __ERC721Bridge_init({ _messenger: _messenger, _otherBridge: ERC721Bridge(payable(Predeploys.L2_ERC721_BRIDGE)) });
}
/// @notice Getter function for the CrossDomainMessenger contract on this chain.
/// @return Contract of the CrossDomainMessenger on this chain.
function messenger() public view override returns (ICrossDomainMessenger) {
return ICrossDomainMessenger(crossDomainMessenger);
}
/// @notice Getter function for the other bridge.
/// @return Contract of the bridge on the other network.
function otherBridge() public pure override returns (ERC721Bridge) {
return ERC721Bridge(payable(Predeploys.L2_ERC721_BRIDGE));
} }
/// @inheritdoc ERC721Bridge /// @inheritdoc ERC721Bridge
...@@ -132,7 +116,7 @@ contract L1ERC721Bridge is ERC721Bridge, Initializable, ISemver { ...@@ -132,7 +116,7 @@ contract L1ERC721Bridge is ERC721Bridge, Initializable, ISemver {
IERC721(_localToken).transferFrom({ from: _from, to: address(this), tokenId: _tokenId }); IERC721(_localToken).transferFrom({ from: _from, to: address(this), tokenId: _tokenId });
// Send calldata into L2 // Send calldata into L2
messenger().sendMessage({ _target: address(otherBridge()), _message: message, _minGasLimit: _minGasLimit }); messenger.sendMessage({ _target: address(otherBridge), _message: message, _minGasLimit: _minGasLimit });
emit ERC721BridgeInitiated(_localToken, _remoteToken, _from, _to, _tokenId, _extraData); emit ERC721BridgeInitiated(_localToken, _remoteToken, _from, _to, _tokenId, _extraData);
} }
} }
// SPDX-License-Identifier: MIT
pragma solidity 0.8.15;
import { OptimismMintableERC20Factory } from "src/universal/OptimismMintableERC20Factory.sol";
import { Initializable } from "@openzeppelin/contracts/proxy/utils/Initializable.sol";
/// @custom:proxied true
/// @title L1OptimismMintableERC20Factory
/// @notice Allows users to create L1 tokens that represent L2 native tokens.
contract L1OptimismMintableERC20Factory is OptimismMintableERC20Factory, Initializable {
/// @custom:semver 1.3.1-beta.5
/// @notice Semantic version.
/// The semver MUST be bumped any time that there is a change in
/// the OptimismMintableERC20 token contract since this contract
/// is responsible for deploying OptimismMintableERC20 contracts.
string public constant version = "1.3.1-beta.5";
/// @custom:spacer
/// @notice Spacer to fill the remainder of the _initialized slot, preventing the standardBridge
/// address from being packed with it.
bytes30 private spacer_51_2_30;
/// @notice Address of the bridge on this domain.
address internal standardBridge;
constructor() {
_disableInitializers();
}
/// @notice Initializes the contract.
/// @param _bridge Contract of the bridge on this domain.
function initialize(address _bridge) public initializer {
standardBridge = _bridge;
}
/// @notice Getter function for the bridge contract.
/// @return Contract of the bridge on this domain.
function bridge() public view virtual override returns (address) {
return standardBridge;
}
}
...@@ -3,16 +3,15 @@ pragma solidity 0.8.15; ...@@ -3,16 +3,15 @@ pragma solidity 0.8.15;
// Contracts // Contracts
import { StandardBridge } from "src/universal/StandardBridge.sol"; import { StandardBridge } from "src/universal/StandardBridge.sol";
// Libraries // Libraries
import { Predeploys } from "src/libraries/Predeploys.sol"; import { Predeploys } from "src/libraries/Predeploys.sol";
// Interfaces // Interfaces
import { ISemver } from "src/universal/interfaces/ISemver.sol"; import { ISemver } from "src/universal/interfaces/ISemver.sol";
import { ICrossDomainMessenger } from "src/universal/interfaces/ICrossDomainMessenger.sol"; import { ICrossDomainMessenger } from "src/universal/interfaces/ICrossDomainMessenger.sol";
import { IStandardBridge } from "src/universal/interfaces/IStandardBridge.sol";
import { ISuperchainConfig } from "src/L1/interfaces/ISuperchainConfig.sol"; import { ISuperchainConfig } from "src/L1/interfaces/ISuperchainConfig.sol";
import { ISystemConfig } from "src/L1/interfaces/ISystemConfig.sol"; import { ISystemConfig } from "src/L1/interfaces/ISystemConfig.sol";
import { Initializable } from "@openzeppelin/contracts/proxy/utils/Initializable.sol";
/// @custom:proxied true /// @custom:proxied true
/// @title L1StandardBridge /// @title L1StandardBridge
...@@ -24,7 +23,7 @@ import { Initializable } from "@openzeppelin/contracts/proxy/utils/Initializable ...@@ -24,7 +23,7 @@ import { Initializable } from "@openzeppelin/contracts/proxy/utils/Initializable
/// NOTE: this contract is not intended to support all variations of ERC20 tokens. Examples /// NOTE: this contract is not intended to support all variations of ERC20 tokens. Examples
/// of some token types that may not be properly supported by this contract include, but are /// of some token types that may not be properly supported by this contract include, but are
/// not limited to: tokens with transfer fees, rebasing tokens, and tokens with blocklists. /// not limited to: tokens with transfer fees, rebasing tokens, and tokens with blocklists.
contract L1StandardBridge is StandardBridge, ISemver, Initializable { contract L1StandardBridge is StandardBridge, ISemver {
/// @custom:legacy /// @custom:legacy
/// @notice Emitted whenever a deposit of ETH from L1 into L2 is initiated. /// @notice Emitted whenever a deposit of ETH from L1 into L2 is initiated.
/// @param from Address of the depositor. /// @param from Address of the depositor.
...@@ -76,13 +75,8 @@ contract L1StandardBridge is StandardBridge, ISemver, Initializable { ...@@ -76,13 +75,8 @@ contract L1StandardBridge is StandardBridge, ISemver, Initializable {
); );
/// @notice Semantic version. /// @notice Semantic version.
/// @custom:semver 2.2.1-beta.3 /// @custom:semver 2.2.1-beta.2
string public constant version = "2.2.1-beta.3"; string public constant version = "2.2.1-beta.2";
/// @custom:spacer
/// @notice Spacer to fill the remainder of the _initialized slot, preventing the superchainConfig
/// address from being packed with it.
bytes30 private spacer_49_2_30;
/// @notice Address of the SuperchainConfig contract. /// @notice Address of the SuperchainConfig contract.
ISuperchainConfig public superchainConfig; ISuperchainConfig public superchainConfig;
...@@ -90,12 +84,13 @@ contract L1StandardBridge is StandardBridge, ISemver, Initializable { ...@@ -90,12 +84,13 @@ contract L1StandardBridge is StandardBridge, ISemver, Initializable {
/// @notice Address of the SystemConfig contract. /// @notice Address of the SystemConfig contract.
ISystemConfig public systemConfig; ISystemConfig public systemConfig;
/// @notice Contract for the CrossDomainMessenger on this network.
ICrossDomainMessenger internal crossDomainMessenger;
/// @notice Constructs the L1StandardBridge contract. /// @notice Constructs the L1StandardBridge contract.
constructor() StandardBridge() { constructor() StandardBridge() {
_disableInitializers(); initialize({
_messenger: ICrossDomainMessenger(address(0)),
_superchainConfig: ISuperchainConfig(address(0)),
_systemConfig: ISystemConfig(address(0))
});
} }
/// @notice Initializer. /// @notice Initializer.
...@@ -111,19 +106,10 @@ contract L1StandardBridge is StandardBridge, ISemver, Initializable { ...@@ -111,19 +106,10 @@ contract L1StandardBridge is StandardBridge, ISemver, Initializable {
{ {
superchainConfig = _superchainConfig; superchainConfig = _superchainConfig;
systemConfig = _systemConfig; systemConfig = _systemConfig;
crossDomainMessenger = _messenger; __StandardBridge_init({
} _messenger: _messenger,
_otherBridge: StandardBridge(payable(Predeploys.L2_STANDARD_BRIDGE))
/// @notice Returns the contract of the bridge on the other chain. });
/// @return Contract of the bridge on the other chain.
function otherBridge() public pure override returns (IStandardBridge) {
return IStandardBridge(payable(Predeploys.L2_STANDARD_BRIDGE));
}
/// @notice Getter function for the messenger contract.
/// @return Contract of the messenger on this domain.
function messenger() public view override returns (ICrossDomainMessenger) {
return ICrossDomainMessenger(crossDomainMessenger);
} }
/// @inheritdoc StandardBridge /// @inheritdoc StandardBridge
...@@ -255,8 +241,8 @@ contract L1StandardBridge is StandardBridge, ISemver, Initializable { ...@@ -255,8 +241,8 @@ contract L1StandardBridge is StandardBridge, ISemver, Initializable {
/// @custom:legacy /// @custom:legacy
/// @notice Retrieves the access of the corresponding L2 bridge contract. /// @notice Retrieves the access of the corresponding L2 bridge contract.
/// @return Address of the corresponding L2 bridge contract. /// @return Address of the corresponding L2 bridge contract.
function l2TokenBridge() external pure returns (address) { function l2TokenBridge() external view returns (address) {
return address(otherBridge()); return address(otherBridge);
} }
/// @notice Internal function for initiating an ETH deposit. /// @notice Internal function for initiating an ETH deposit.
......
...@@ -46,7 +46,6 @@ contract OPContractsManager is ISemver, Initializable { ...@@ -46,7 +46,6 @@ contract OPContractsManager is ISemver, Initializable {
address unsafeBlockSigner; address unsafeBlockSigner;
address proposer; address proposer;
address challenger; address challenger;
address systemConfigFeeAdmin;
} }
/// @notice The full set of inputs to deploy a new OP Stack chain. /// @notice The full set of inputs to deploy a new OP Stack chain.
...@@ -130,8 +129,8 @@ contract OPContractsManager is ISemver, Initializable { ...@@ -130,8 +129,8 @@ contract OPContractsManager is ISemver, Initializable {
// -------- Constants and Variables -------- // -------- Constants and Variables --------
/// @custom:semver 1.0.0-beta.21 /// @custom:semver 1.0.0-beta.20
string public constant version = "1.0.0-beta.21"; string public constant version = "1.0.0-beta.20";
/// @notice Represents the interface version so consumers know how to decode the DeployOutput struct /// @notice Represents the interface version so consumers know how to decode the DeployOutput struct
/// that's emitted in the `Deployed` event. Whenever that struct changes, a new version should be used. /// that's emitted in the `Deployed` event. Whenever that struct changes, a new version should be used.
...@@ -255,7 +254,7 @@ contract OPContractsManager is ISemver, Initializable { ...@@ -255,7 +254,7 @@ contract OPContractsManager is ISemver, Initializable {
output.systemConfigProxy = output.systemConfigProxy =
ISystemConfig(deployProxy(l2ChainId, output.opChainProxyAdmin, saltMixer, "SystemConfig")); ISystemConfig(deployProxy(l2ChainId, output.opChainProxyAdmin, saltMixer, "SystemConfig"));
output.optimismMintableERC20FactoryProxy = IOptimismMintableERC20Factory( output.optimismMintableERC20FactoryProxy = IOptimismMintableERC20Factory(
deployProxy(l2ChainId, output.opChainProxyAdmin, saltMixer, "L1OptimismMintableERC20Factory") deployProxy(l2ChainId, output.opChainProxyAdmin, saltMixer, "OptimismMintableERC20Factory")
); );
output.disputeGameFactoryProxy = output.disputeGameFactoryProxy =
IDisputeGameFactory(deployProxy(l2ChainId, output.opChainProxyAdmin, saltMixer, "DisputeGameFactory")); IDisputeGameFactory(deployProxy(l2ChainId, output.opChainProxyAdmin, saltMixer, "DisputeGameFactory"));
...@@ -469,15 +468,12 @@ contract OPContractsManager is ISemver, Initializable { ...@@ -469,15 +468,12 @@ contract OPContractsManager is ISemver, Initializable {
return abi.encodeWithSelector( return abi.encodeWithSelector(
_selector, _selector,
ISystemConfig.Roles({ _input.roles.systemConfigOwner,
owner: _input.roles.systemConfigOwner,
feeAdmin: _input.roles.systemConfigFeeAdmin,
unsafeBlockSigner: _input.roles.unsafeBlockSigner,
batcherHash: bytes32(uint256(uint160(_input.roles.batcher)))
}),
_input.basefeeScalar, _input.basefeeScalar,
_input.blobBasefeeScalar, _input.blobBasefeeScalar,
bytes32(uint256(uint160(_input.roles.batcher))), // batcherHash
_input.gasLimit, _input.gasLimit,
_input.roles.unsafeBlockSigner,
referenceResourceConfig, referenceResourceConfig,
chainIdToBatchInboxAddress(_input.l2ChainId), chainIdToBatchInboxAddress(_input.l2ChainId),
opChainAddrs opChainAddrs
...@@ -491,15 +487,12 @@ contract OPContractsManager is ISemver, Initializable { ...@@ -491,15 +487,12 @@ contract OPContractsManager is ISemver, Initializable {
return abi.encodeWithSelector( return abi.encodeWithSelector(
_selector, _selector,
ISystemConfig.Roles({ _input.roles.systemConfigOwner,
owner: _input.roles.systemConfigOwner,
feeAdmin: _input.roles.systemConfigFeeAdmin,
unsafeBlockSigner: _input.roles.unsafeBlockSigner,
batcherHash: bytes32(uint256(uint160(_input.roles.batcher)))
}),
_input.basefeeScalar, _input.basefeeScalar,
_input.blobBasefeeScalar, _input.blobBasefeeScalar,
bytes32(uint256(uint160(_input.roles.batcher))), // batcherHash
_input.gasLimit, _input.gasLimit,
_input.roles.unsafeBlockSigner,
referenceResourceConfig, referenceResourceConfig,
chainIdToBatchInboxAddress(_input.l2ChainId), chainIdToBatchInboxAddress(_input.l2ChainId),
opChainAddrs opChainAddrs
......
...@@ -41,15 +41,12 @@ contract OPContractsManagerInterop is OPContractsManager { ...@@ -41,15 +41,12 @@ contract OPContractsManagerInterop is OPContractsManager {
return abi.encodeWithSelector( return abi.encodeWithSelector(
_selector, _selector,
ISystemConfig.Roles({ _input.roles.systemConfigOwner,
owner: _input.roles.systemConfigOwner,
feeAdmin: _input.roles.systemConfigFeeAdmin,
unsafeBlockSigner: _input.roles.unsafeBlockSigner,
batcherHash: bytes32(uint256(uint160(_input.roles.batcher)))
}),
_input.basefeeScalar, _input.basefeeScalar,
_input.blobBasefeeScalar, _input.blobBasefeeScalar,
bytes32(uint256(uint160(_input.roles.batcher))), // batcherHash
_input.gasLimit, _input.gasLimit,
_input.roles.unsafeBlockSigner,
referenceResourceConfig, referenceResourceConfig,
chainIdToBatchInboxAddress(_input.l2ChainId), chainIdToBatchInboxAddress(_input.l2ChainId),
opChainAddrs, opChainAddrs,
......
...@@ -146,9 +146,9 @@ contract OptimismPortal is Initializable, ResourceMetering, ISemver { ...@@ -146,9 +146,9 @@ contract OptimismPortal is Initializable, ResourceMetering, ISemver {
} }
/// @notice Semantic version. /// @notice Semantic version.
/// @custom:semver 2.8.1-beta.5 /// @custom:semver 2.8.1-beta.4
function version() public pure virtual returns (string memory) { function version() public pure virtual returns (string memory) {
return "2.8.1-beta.5"; return "2.8.1-beta.4";
} }
/// @notice Constructs the OptimismPortal contract. /// @notice Constructs the OptimismPortal contract.
...@@ -584,17 +584,17 @@ contract OptimismPortal is Initializable, ResourceMetering, ISemver { ...@@ -584,17 +584,17 @@ contract OptimismPortal is Initializable, ResourceMetering, ISemver {
emit TransactionDeposited(from, _to, DEPOSIT_VERSION, opaqueData); emit TransactionDeposited(from, _to, DEPOSIT_VERSION, opaqueData);
} }
/// @notice Sets static configuration options for the L2 system. /// @notice Sets the gas paying token for the L2 system. This token is used as the
/// @param _type Type of configuration to set. /// L2 native asset. Only the SystemConfig contract can call this function.
/// @param _value Encoded value of the configuration. function setGasPayingToken(address _token, uint8 _decimals, bytes32 _name, bytes32 _symbol) external {
function setConfig(Types.ConfigType _type, bytes memory _value) external {
if (msg.sender != address(systemConfig)) revert Unauthorized(); if (msg.sender != address(systemConfig)) revert Unauthorized();
// Set L2 deposit gas as used without paying burning gas. Ensures that deposits cannot use too much L2 gas. // Set L2 deposit gas as used without paying burning gas. Ensures that deposits cannot use too much L2 gas.
// This value must be large enough to cover the cost of calling `L1Block.setConfig`. // This value must be large enough to cover the cost of calling `L1Block.setGasPayingToken`.
useGas(SYSTEM_DEPOSIT_GAS_LIMIT); useGas(SYSTEM_DEPOSIT_GAS_LIMIT);
// Emit the special deposit transaction directly that sets the config in the L1Block predeploy contract. // Emit the special deposit transaction directly that sets the gas paying
// token in the L1Block predeploy contract.
emit TransactionDeposited( emit TransactionDeposited(
Constants.DEPOSITOR_ACCOUNT, Constants.DEPOSITOR_ACCOUNT,
Predeploys.L1_BLOCK_ATTRIBUTES, Predeploys.L1_BLOCK_ATTRIBUTES,
...@@ -604,7 +604,7 @@ contract OptimismPortal is Initializable, ResourceMetering, ISemver { ...@@ -604,7 +604,7 @@ contract OptimismPortal is Initializable, ResourceMetering, ISemver {
uint256(0), // value uint256(0), // value
uint64(SYSTEM_DEPOSIT_GAS_LIMIT), // gasLimit uint64(SYSTEM_DEPOSIT_GAS_LIMIT), // gasLimit
false, // isCreation, false, // isCreation,
abi.encodeCall(IL1Block.setConfig, (_type, _value)) abi.encodeCall(IL1Block.setGasPayingToken, (_token, _decimals, _name, _symbol))
) )
); );
} }
......
...@@ -183,9 +183,9 @@ contract OptimismPortal2 is Initializable, ResourceMetering, ISemver { ...@@ -183,9 +183,9 @@ contract OptimismPortal2 is Initializable, ResourceMetering, ISemver {
} }
/// @notice Semantic version. /// @notice Semantic version.
/// @custom:semver 3.11.0-beta.7 /// @custom:semver 3.11.0-beta.6
function version() public pure virtual returns (string memory) { function version() public pure virtual returns (string memory) {
return "3.11.0-beta.7"; return "3.11.0-beta.6";
} }
/// @notice Constructs the OptimismPortal contract. /// @notice Constructs the OptimismPortal contract.
...@@ -605,17 +605,17 @@ contract OptimismPortal2 is Initializable, ResourceMetering, ISemver { ...@@ -605,17 +605,17 @@ contract OptimismPortal2 is Initializable, ResourceMetering, ISemver {
emit TransactionDeposited(from, _to, DEPOSIT_VERSION, opaqueData); emit TransactionDeposited(from, _to, DEPOSIT_VERSION, opaqueData);
} }
/// @notice Sets static configuration options for the L2 system. /// @notice Sets the gas paying token for the L2 system. This token is used as the
/// @param _type Type of configuration to set. /// L2 native asset. Only the SystemConfig contract can call this function.
/// @param _value Encoded value of the configuration. function setGasPayingToken(address _token, uint8 _decimals, bytes32 _name, bytes32 _symbol) external {
function setConfig(Types.ConfigType _type, bytes memory _value) external {
if (msg.sender != address(systemConfig)) revert Unauthorized(); if (msg.sender != address(systemConfig)) revert Unauthorized();
// Set L2 deposit gas as used without paying burning gas. Ensures that deposits cannot use too much L2 gas. // Set L2 deposit gas as used without paying burning gas. Ensures that deposits cannot use too much L2 gas.
// This value must be large enough to cover the cost of calling `L1Block.setConfig`. // This value must be large enough to cover the cost of calling `L1Block.setGasPayingToken`.
useGas(SYSTEM_DEPOSIT_GAS_LIMIT); useGas(SYSTEM_DEPOSIT_GAS_LIMIT);
// Emit the special deposit transaction directly that sets the config in the L1Block predeploy contract. // Emit the special deposit transaction directly that sets the gas paying
// token in the L1Block predeploy contract.
emit TransactionDeposited( emit TransactionDeposited(
Constants.DEPOSITOR_ACCOUNT, Constants.DEPOSITOR_ACCOUNT,
Predeploys.L1_BLOCK_ATTRIBUTES, Predeploys.L1_BLOCK_ATTRIBUTES,
...@@ -625,30 +625,7 @@ contract OptimismPortal2 is Initializable, ResourceMetering, ISemver { ...@@ -625,30 +625,7 @@ contract OptimismPortal2 is Initializable, ResourceMetering, ISemver {
uint256(0), // value uint256(0), // value
uint64(SYSTEM_DEPOSIT_GAS_LIMIT), // gasLimit uint64(SYSTEM_DEPOSIT_GAS_LIMIT), // gasLimit
false, // isCreation, false, // isCreation,
abi.encodeCall(IL1Block.setConfig, (_type, _value)) abi.encodeCall(IL1Block.setGasPayingToken, (_token, _decimals, _name, _symbol))
)
);
}
/// @notice Calls the L2ProxyAdmin as the DEPOSITOR_ACCOUNT. This function can be used
/// to upgrade the predeploys on L2. Only callable by the upgrader role on the
/// SuperchainConfig.
function upgrade(uint32 _gasLimit, bytes memory _calldata) external {
if (msg.sender != superchainConfig.upgrader()) revert Unauthorized();
useGas(_gasLimit);
// Emit the special deposit transaction which calls to the L2 Proxy Admin
emit TransactionDeposited(
Constants.DEPOSITOR_ACCOUNT,
Predeploys.PROXY_ADMIN,
DEPOSIT_VERSION,
abi.encodePacked(
uint256(0), // mint
uint256(0), // value
uint64(_gasLimit), // gasLimit
false, // isCreation,
_calldata // data
) )
); );
} }
......
...@@ -3,6 +3,12 @@ pragma solidity 0.8.15; ...@@ -3,6 +3,12 @@ pragma solidity 0.8.15;
// Contracts // Contracts
import { OptimismPortal2 } from "src/L1/OptimismPortal2.sol"; import { OptimismPortal2 } from "src/L1/OptimismPortal2.sol";
import { L1BlockInterop, ConfigType } from "src/L2/L1BlockInterop.sol";
// Libraries
import { Predeploys } from "src/libraries/Predeploys.sol";
import { Constants } from "src/libraries/Constants.sol";
import { Unauthorized } from "src/libraries/PortalErrors.sol";
/// @custom:proxied true /// @custom:proxied true
/// @title OptimismPortalInterop /// @title OptimismPortalInterop
...@@ -17,8 +23,33 @@ contract OptimismPortalInterop is OptimismPortal2 { ...@@ -17,8 +23,33 @@ contract OptimismPortalInterop is OptimismPortal2 {
OptimismPortal2(_proofMaturityDelaySeconds, _disputeGameFinalityDelaySeconds) OptimismPortal2(_proofMaturityDelaySeconds, _disputeGameFinalityDelaySeconds)
{ } { }
/// @custom:semver +interop-beta.3 /// @custom:semver +interop-beta.2
function version() public pure override returns (string memory) { function version() public pure override returns (string memory) {
return string.concat(super.version(), "+interop-beta.3"); return string.concat(super.version(), "+interop-beta.2");
}
/// @notice Sets static configuration options for the L2 system.
/// @param _type Type of configuration to set.
/// @param _value Encoded value of the configuration.
function setConfig(ConfigType _type, bytes memory _value) external {
if (msg.sender != address(systemConfig)) revert Unauthorized();
// Set L2 deposit gas as used without paying burning gas. Ensures that deposits cannot use too much L2 gas.
// This value must be large enough to cover the cost of calling `L1Block.setConfig`.
useGas(SYSTEM_DEPOSIT_GAS_LIMIT);
// Emit the special deposit transaction directly that sets the config in the L1Block predeploy contract.
emit TransactionDeposited(
Constants.DEPOSITOR_ACCOUNT,
Predeploys.L1_BLOCK_ATTRIBUTES,
DEPOSIT_VERSION,
abi.encodePacked(
uint256(0), // mint
uint256(0), // value
uint64(SYSTEM_DEPOSIT_GAS_LIMIT), // gasLimit
false, // isCreation,
abi.encodeCall(L1BlockInterop.setConfig, (_type, _value))
)
);
} }
} }
...@@ -12,10 +12,8 @@ import { Storage } from "src/libraries/Storage.sol"; ...@@ -12,10 +12,8 @@ import { Storage } from "src/libraries/Storage.sol";
contract SuperchainConfig is Initializable, ISemver { contract SuperchainConfig is Initializable, ISemver {
/// @notice Enum representing different types of updates. /// @notice Enum representing different types of updates.
/// @custom:value GUARDIAN Represents an update to the guardian. /// @custom:value GUARDIAN Represents an update to the guardian.
/// @custom:value UPGRADER Represents an update to the upgrader.
enum UpdateType { enum UpdateType {
GUARDIAN, GUARDIAN
UPGRADER
} }
/// @notice Whether or not the Superchain is paused. /// @notice Whether or not the Superchain is paused.
...@@ -25,10 +23,6 @@ contract SuperchainConfig is Initializable, ISemver { ...@@ -25,10 +23,6 @@ contract SuperchainConfig is Initializable, ISemver {
/// It can only be modified by an upgrade. /// It can only be modified by an upgrade.
bytes32 public constant GUARDIAN_SLOT = bytes32(uint256(keccak256("superchainConfig.guardian")) - 1); bytes32 public constant GUARDIAN_SLOT = bytes32(uint256(keccak256("superchainConfig.guardian")) - 1);
/// @notice The address of the upgrader, which can faciliate upgrades of L2 predeploys.
/// . It can only be modified by an upgrade.
bytes32 public constant UPGRADER_SLOT = bytes32(uint256(keccak256("superchainConfig.upgrader")) - 1);
/// @notice Emitted when the pause is triggered. /// @notice Emitted when the pause is triggered.
/// @param identifier A string helping to identify provenance of the pause transaction. /// @param identifier A string helping to identify provenance of the pause transaction.
event Paused(string identifier); event Paused(string identifier);
...@@ -42,20 +36,19 @@ contract SuperchainConfig is Initializable, ISemver { ...@@ -42,20 +36,19 @@ contract SuperchainConfig is Initializable, ISemver {
event ConfigUpdate(UpdateType indexed updateType, bytes data); event ConfigUpdate(UpdateType indexed updateType, bytes data);
/// @notice Semantic version. /// @notice Semantic version.
/// @custom:semver 1.1.1-beta.2 /// @custom:semver 1.1.1-beta.1
string public constant version = "1.1.1-beta.2"; string public constant version = "1.1.1-beta.1";
/// @notice Constructs the SuperchainConfig contract. /// @notice Constructs the SuperchainConfig contract.
constructor() { constructor() {
_disableInitializers(); initialize({ _guardian: address(0), _paused: false });
} }
/// @notice Initializer. /// @notice Initializer.
/// @param _guardian Address of the guardian, can pause the OptimismPortal. /// @param _guardian Address of the guardian, can pause the OptimismPortal.
/// @param _paused Initial paused status. /// @param _paused Initial paused status.
function initialize(address _guardian, address _upgrader, bool _paused) public initializer { function initialize(address _guardian, bool _paused) public initializer {
_setGuardian(_guardian); _setGuardian(_guardian);
_setUpgrader(_upgrader);
if (_paused) { if (_paused) {
_pause("Initializer paused"); _pause("Initializer paused");
} }
...@@ -66,11 +59,6 @@ contract SuperchainConfig is Initializable, ISemver { ...@@ -66,11 +59,6 @@ contract SuperchainConfig is Initializable, ISemver {
guardian_ = Storage.getAddress(GUARDIAN_SLOT); guardian_ = Storage.getAddress(GUARDIAN_SLOT);
} }
/// @notice Getter for the upgrader address.
function upgrader() public view returns (address upgrader_) {
upgrader_ = Storage.getAddress(UPGRADER_SLOT);
}
/// @notice Getter for the current paused status. /// @notice Getter for the current paused status.
function paused() public view returns (bool paused_) { function paused() public view returns (bool paused_) {
paused_ = Storage.getBool(PAUSED_SLOT); paused_ = Storage.getBool(PAUSED_SLOT);
...@@ -104,12 +92,4 @@ contract SuperchainConfig is Initializable, ISemver { ...@@ -104,12 +92,4 @@ contract SuperchainConfig is Initializable, ISemver {
Storage.setAddress(GUARDIAN_SLOT, _guardian); Storage.setAddress(GUARDIAN_SLOT, _guardian);
emit ConfigUpdate(UpdateType.GUARDIAN, abi.encode(_guardian)); emit ConfigUpdate(UpdateType.GUARDIAN, abi.encode(_guardian));
} }
/// @notice Sets the upgrader address. This is only callable during initialization, so an upgrade
/// will be required to change the upgrader.
/// @param _upgrader The new upgrader address.
function _setUpgrader(address _upgrader) internal {
Storage.setAddress(UPGRADER_SLOT, _upgrader);
emit ConfigUpdate(UpdateType.UPGRADER, abi.encode(_upgrader));
}
} }
...@@ -2,13 +2,16 @@ ...@@ -2,13 +2,16 @@
pragma solidity 0.8.15; pragma solidity 0.8.15;
// Contracts // Contracts
import { ERC20 } from "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import { IOptimismPortalInterop as IOptimismPortal } from "src/L1/interfaces/IOptimismPortalInterop.sol"; import { IOptimismPortalInterop as IOptimismPortal } from "src/L1/interfaces/IOptimismPortalInterop.sol";
import { SystemConfig } from "src/L1/SystemConfig.sol"; import { SystemConfig } from "src/L1/SystemConfig.sol";
import { ConfigType } from "src/L2/L1BlockInterop.sol";
// Libraries // Libraries
import { Constants } from "src/libraries/Constants.sol";
import { GasPayingToken } from "src/libraries/GasPayingToken.sol";
import { StaticConfig } from "src/libraries/StaticConfig.sol"; import { StaticConfig } from "src/libraries/StaticConfig.sol";
import { Storage } from "src/libraries/Storage.sol"; import { Storage } from "src/libraries/Storage.sol";
import { Types } from "src/libraries/Types.sol";
// Interfaces // Interfaces
import { IResourceMetering } from "src/L1/interfaces/IResourceMetering.sol"; import { IResourceMetering } from "src/L1/interfaces/IResourceMetering.sol";
...@@ -25,20 +28,24 @@ contract SystemConfigInterop is SystemConfig { ...@@ -25,20 +28,24 @@ contract SystemConfigInterop is SystemConfig {
0x1708e077affb93e89be2665fb0fb72581be66f84dc00d25fed755ae911905b1c; 0x1708e077affb93e89be2665fb0fb72581be66f84dc00d25fed755ae911905b1c;
/// @notice Initializer. /// @notice Initializer.
/// @param _roles Initial roles. /// @param _owner Initial owner of the contract.
/// @param _basefeeScalar Initial basefee scalar value. /// @param _basefeeScalar Initial basefee scalar value.
/// @param _blobbasefeeScalar Initial blobbasefee scalar value. /// @param _blobbasefeeScalar Initial blobbasefee scalar value.
/// @param _batcherHash Initial batcher hash.
/// @param _gasLimit Initial gas limit. /// @param _gasLimit Initial gas limit.
/// @param _unsafeBlockSigner Initial unsafe block signer address.
/// @param _config Initial ResourceConfig. /// @param _config Initial ResourceConfig.
/// @param _batchInbox Batch inbox address. An identifier for the op-node to find /// @param _batchInbox Batch inbox address. An identifier for the op-node to find
/// canonical data. /// canonical data.
/// @param _addresses Set of L1 contract addresses. These should be the proxies. /// @param _addresses Set of L1 contract addresses. These should be the proxies.
/// @param _dependencyManager The addressed allowed to add/remove from the dependency set /// @param _dependencyManager The addressed allowed to add/remove from the dependency set
function initialize( function initialize(
SystemConfig.Roles memory _roles, address _owner,
uint32 _basefeeScalar, uint32 _basefeeScalar,
uint32 _blobbasefeeScalar, uint32 _blobbasefeeScalar,
bytes32 _batcherHash,
uint64 _gasLimit, uint64 _gasLimit,
address _unsafeBlockSigner,
IResourceMetering.ResourceConfig memory _config, IResourceMetering.ResourceConfig memory _config,
address _batchInbox, address _batchInbox,
SystemConfig.Addresses memory _addresses, SystemConfig.Addresses memory _addresses,
...@@ -48,10 +55,12 @@ contract SystemConfigInterop is SystemConfig { ...@@ -48,10 +55,12 @@ contract SystemConfigInterop is SystemConfig {
{ {
// This method has an initializer modifier, and will revert if already initialized. // This method has an initializer modifier, and will revert if already initialized.
initialize({ initialize({
_roles: _roles, _owner: _owner,
_basefeeScalar: _basefeeScalar, _basefeeScalar: _basefeeScalar,
_blobbasefeeScalar: _blobbasefeeScalar, _blobbasefeeScalar: _blobbasefeeScalar,
_batcherHash: _batcherHash,
_gasLimit: _gasLimit, _gasLimit: _gasLimit,
_unsafeBlockSigner: _unsafeBlockSigner,
_config: _config, _config: _config,
_batchInbox: _batchInbox, _batchInbox: _batchInbox,
_addresses: _addresses _addresses: _addresses
...@@ -59,9 +68,38 @@ contract SystemConfigInterop is SystemConfig { ...@@ -59,9 +68,38 @@ contract SystemConfigInterop is SystemConfig {
Storage.setAddress(DEPENDENCY_MANAGER_SLOT, _dependencyManager); Storage.setAddress(DEPENDENCY_MANAGER_SLOT, _dependencyManager);
} }
/// @custom:semver +interop-beta.4 /// @custom:semver +interop-beta.3
function version() public pure override returns (string memory) { function version() public pure override returns (string memory) {
return string.concat(super.version(), "+interop-beta.4"); return string.concat(super.version(), "+interop-beta.3");
}
/// @notice Internal setter for the gas paying token address, includes validation.
/// The token must not already be set and must be non zero and not the ether address
/// to set the token address. This prevents the token address from being changed
/// and makes it explicitly opt-in to use custom gas token. Additionally,
/// OptimismPortal's address must be non zero, since otherwise the call to set the
/// config for the gas paying token to OptimismPortal will fail.
/// @param _token Address of the gas paying token.
function _setGasPayingToken(address _token) internal override {
if (_token != address(0) && _token != Constants.ETHER && !isCustomGasToken()) {
require(
ERC20(_token).decimals() == GAS_PAYING_TOKEN_DECIMALS, "SystemConfig: bad decimals of gas paying token"
);
bytes32 name = GasPayingToken.sanitize(ERC20(_token).name());
bytes32 symbol = GasPayingToken.sanitize(ERC20(_token).symbol());
// Set the gas paying token in storage and in the OptimismPortal.
GasPayingToken.set({ _token: _token, _decimals: GAS_PAYING_TOKEN_DECIMALS, _name: name, _symbol: symbol });
IOptimismPortal(payable(optimismPortal())).setConfig(
ConfigType.SET_GAS_PAYING_TOKEN,
StaticConfig.encodeSetGasPayingToken({
_token: _token,
_decimals: GAS_PAYING_TOKEN_DECIMALS,
_name: name,
_symbol: symbol
})
);
}
} }
/// @notice Adds a chain to the interop dependency set. Can only be called by the dependency manager. /// @notice Adds a chain to the interop dependency set. Can only be called by the dependency manager.
...@@ -69,7 +107,7 @@ contract SystemConfigInterop is SystemConfig { ...@@ -69,7 +107,7 @@ contract SystemConfigInterop is SystemConfig {
function addDependency(uint256 _chainId) external { function addDependency(uint256 _chainId) external {
require(msg.sender == dependencyManager(), "SystemConfig: caller is not the dependency manager"); require(msg.sender == dependencyManager(), "SystemConfig: caller is not the dependency manager");
IOptimismPortal(payable(optimismPortal())).setConfig( IOptimismPortal(payable(optimismPortal())).setConfig(
Types.ConfigType.ADD_DEPENDENCY, StaticConfig.encodeAddDependency(_chainId) ConfigType.ADD_DEPENDENCY, StaticConfig.encodeAddDependency(_chainId)
); );
} }
...@@ -78,7 +116,7 @@ contract SystemConfigInterop is SystemConfig { ...@@ -78,7 +116,7 @@ contract SystemConfigInterop is SystemConfig {
function removeDependency(uint256 _chainId) external { function removeDependency(uint256 _chainId) external {
require(msg.sender == dependencyManager(), "SystemConfig: caller is not the dependency manager"); require(msg.sender == dependencyManager(), "SystemConfig: caller is not the dependency manager");
IOptimismPortal(payable(optimismPortal())).setConfig( IOptimismPortal(payable(optimismPortal())).setConfig(
Types.ConfigType.REMOVE_DEPENDENCY, StaticConfig.encodeRemoveDependency(_chainId) ConfigType.REMOVE_DEPENDENCY, StaticConfig.encodeRemoveDependency(_chainId)
); );
} }
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment