Commit 93ea5820 authored by Mark Tyneway's avatar Mark Tyneway Committed by GitHub

op-chain-ops: add more predeploys (#3384)

Every L2 predeploy that has `Semver` must be built so that it's
immutables are handled, even though they are hardcoded in the
bytecode.
Co-authored-by: default avatarMatthew Slipper <me@matthewslipper.com>
parent 6c0235a6
......@@ -20,7 +20,8 @@ bindings: l1block-bindings \
proxy-bindings \
proxy-admin-bindings \
erc20-bindings \
weth9-bindings
weth9-bindings \
deployer-whitelist-bindings
compile:
cd ../packages/contracts-bedrock/ && \
......@@ -77,6 +78,12 @@ erc20-bindings: compile
weth9-bindings: compile
./gen_bindings.sh contracts/vendor/WETH9.sol:WETH9 $(pkg)
deployer-whitelist-bindings: compile
./gen_bindings.sh contracts/legacy/DeployerWhitelist.sol:DeployerWhitelist $(pkg)
l1-blocknumber-bindings: compile
./gen_bindings.sh contracts/legacy/L1BlockNumber.sol:L1BlockNumber $(pkg)
more:
go run ./gen/main.go \
-artifacts ../packages/contracts-bedrock/artifacts,../packages/contracts-governance/artifacts \
......
This diff is collapsed.
This diff is collapsed.
......@@ -16,10 +16,8 @@ import (
// contracts so that the immutables can be set properly in the bytecode.
type DeploymentResults map[string]hexutil.Bytes
// TODO(tynes): once there are deploy time config params,
// pass in a config struct to this function that comes from
// a JSON file/cli flags and then populate the Deployment
// Args.
// BuildOptimism will deploy the L2 predeploys so that their immutables are set
// correctly.
func BuildOptimism() (DeploymentResults, error) {
deployments := []deployer.Constructor{
{
......@@ -43,6 +41,12 @@ func BuildOptimism() (DeploymentResults, error) {
{
Name: "OptimismMintableERC20Factory",
},
{
Name: "DeployerWhitelist",
},
{
Name: "L1BlockNumber",
},
}
return BuildL2(deployments)
}
......@@ -91,6 +95,10 @@ func l2Deployer(backend *backends.SimulatedBackend, opts *bind.TransactOpts, dep
addr, _, _, err = bindings.DeploySequencerFeeVault(opts, backend)
case "OptimismMintableERC20Factory":
addr, _, _, err = bindings.DeployOptimismMintableERC20Factory(opts, backend, predeploys.L2StandardBridgeAddr)
case "DeployerWhitelist":
addr, _, _, err = bindings.DeployDeployerWhitelist(opts, backend)
case "L1BlockNumber":
addr, _, _, err = bindings.DeployL1BlockNumber(opts, backend)
default:
return addr, fmt.Errorf("unknown contract: %s", deployment.Name)
}
......
......@@ -20,6 +20,8 @@ func TestBuildOptimism(t *testing.T) {
"L2ToL1MessagePasser": true,
"SequencerFeeVault": true,
"OptimismMintableERC20Factory": true,
"DeployerWhitelist": true,
"L1BlockNumber": true,
}
// Only the exact contracts that we care about are being
......
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