Skip to content

Commit

Permalink
op-chain-ops: update immutables, storage config for OptimismMintableE…
Browse files Browse the repository at this point in the history
…RC20Factory
  • Loading branch information
0xfuturistic committed Dec 20, 2023
1 parent 062aa26 commit 2534763
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 31 deletions.
13 changes: 7 additions & 6 deletions op-chain-ops/genesis/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -770,12 +770,8 @@ func NewL2ImmutableConfig(config *DeployConfig, block *types.Block) (*immutables
Bridge: predeploys.L2ERC721BridgeAddr,
RemoteChainId: new(big.Int).SetUint64(config.L1ChainID),
},
OptimismMintableERC20Factory: struct {
Bridge common.Address
}{
Bridge: predeploys.L2StandardBridgeAddr,
},
ProxyAdmin: struct{}{},
OptimismMintableERC20Factory: struct{}{},
ProxyAdmin: struct{}{},
BaseFeeVault: struct {
Recipient common.Address
MinWithdrawalAmount *big.Int
Expand Down Expand Up @@ -838,6 +834,11 @@ func NewL2StorageConfig(config *DeployConfig, block *types.Block) (state.Storage
"_initialized": 1,
"_initializing": false,
}
storage["OptimismMintableERC20Factory"] = state.StorageValues{
"_initialized": 1,
"_initializing": false,
"bridge": predeploys.L2StandardBridgeAddr,
}
storage["L1Block"] = state.StorageValues{
"number": block.Number(),
"timestamp": block.Time(),
Expand Down
27 changes: 8 additions & 19 deletions op-chain-ops/immutables/immutables.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (
"github.com/ethereum/go-ethereum/core/types"

"github.com/ethereum-optimism/optimism/op-bindings/bindings"
"github.com/ethereum-optimism/optimism/op-bindings/predeploys"
"github.com/ethereum-optimism/optimism/op-chain-ops/deployer"
)

Expand All @@ -36,15 +35,13 @@ type PredeploysImmutableConfig struct {
MinWithdrawalAmount *big.Int
WithdrawalNetwork uint8
}
OptimismMintableERC20Factory struct {
Bridge common.Address
}
L1BlockNumber struct{}
GasPriceOracle struct{}
L1Block struct{}
GovernanceToken struct{}
LegacyMessagePasser struct{}
L2ERC721Bridge struct {
OptimismMintableERC20Factory struct{}
L1BlockNumber struct{}
GasPriceOracle struct{}
L1Block struct{}
GovernanceToken struct{}
LegacyMessagePasser struct{}
L2ERC721Bridge struct {
OtherBridge common.Address
Messenger common.Address
}
Expand Down Expand Up @@ -220,15 +217,7 @@ func l2ImmutableDeployer(backend *backends.SimulatedBackend, opts *bind.Transact
}
_, tx, _, err = bindings.DeployL1FeeVault(opts, backend, recipient, minimumWithdrawalAmount, withdrawalNetwork)
case "OptimismMintableERC20Factory":
bridge, ok := deployment.Args[0].(common.Address)
if !ok {
return nil, fmt.Errorf("invalid type for bridge")
}
// Sanity check that the argument is correct
if bridge != predeploys.L2StandardBridgeAddr {
return nil, fmt.Errorf("invalid bridge address")
}
_, tx, _, err = bindings.DeployOptimismMintableERC20Factory(opts, backend, bridge)
_, tx, _, err = bindings.DeployOptimismMintableERC20Factory(opts, backend)
case "L2ERC721Bridge":
otherBridge, ok := deployment.Args[0].(common.Address)
if !ok {
Expand Down
8 changes: 2 additions & 6 deletions op-chain-ops/immutables/immutables_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,8 @@ func TestBuildOptimism(t *testing.T) {
Bridge: predeploys.L2StandardBridgeAddr,
RemoteChainId: big.NewInt(1),
},
OptimismMintableERC20Factory: struct {
Bridge common.Address
}{
Bridge: predeploys.L2StandardBridgeAddr,
},
ProxyAdmin: struct{}{},
OptimismMintableERC20Factory: struct{}{},
ProxyAdmin: struct{}{},
BaseFeeVault: struct {
Recipient common.Address
MinWithdrawalAmount *big.Int
Expand Down

0 comments on commit 2534763

Please sign in to comment.