Skip to content

Commit

Permalink
Redeploy contracts (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
mdehoog authored Dec 10, 2024
1 parent 5ddeba8 commit b1b3fd6
Show file tree
Hide file tree
Showing 11 changed files with 3,244 additions and 50 deletions.
19 changes: 13 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
guard-%:
@ if [ "${${*}}" = "" ]; then echo "Environment variable $* not set" && exit 1; fi

define abigen
echo "Generating bindings for $(1)"
jq -r '.bytecode.object' out/$(1).sol/$(1).json > out/$(1).sol/$(1).bin
jq -r '.abi' out/$(1).sol/$(1).json > out/$(1).sol/$(1).abi
abigen --abi out/$(1).sol/$(1).abi --bin out/$(1).sol/$(1).bin --pkg bindings --type $(1) --out bindings/$(2).go
endef

.PHONY: bindings
bindings:
go install github.com/ethereum/go-ethereum/cmd/[email protected]
forge clean && forge build --extra-output-files abi
forge build
mkdir -p bindings
abigen --abi out/OutputOracle.sol/OutputOracle.abi.json --pkg bindings --type OutputOracle --out bindings/output_oracle.go
abigen --abi out/Portal.sol/Portal.abi.json --pkg bindings --type Portal --out bindings/portal.go
abigen --abi out/DeployChain.sol/DeployChain.abi.json --pkg bindings --type DeployChain --out bindings/deploy_chain.go
@$(call abigen,"OutputOracle","output_oracle")
@$(call abigen,"Portal","portal")
@$(call abigen,"DeployChain","deploy_chain")

.PHONY: deploy-cert-manager
deploy-cert-manager: guard-IMPL_SALT guard-DEPLOY_PRIVATE_KEY guard-RPC_URL
Expand All @@ -27,12 +34,12 @@ testnet: guard-L1_URL guard-DEPLOY_PRIVATE_KEY

.PHONY: verify
verify:
deploy=broadcast/DeploySystem.s.sol/84532/run-1727993682.json; \
deploy=broadcast/DeploySystem.s.sol/84532/run-1733867021.json; \
addresses=$$(jq -r '.transactions[] | select(.transactionType=="CREATE" or .transactionType=="CREATE2") | .contractAddress' $$deploy); \
for address in $$addresses; do \
name=$$(jq -r --arg address "$$address" '.transactions[] | select((.transactionType=="CREATE" or .transactionType=="CREATE2") and .contractAddress==$$address) | .contractName' $$deploy); \
arguments=$$(jq -r --arg address "$$address" '.transactions[] | select((.transactionType=="CREATE" or .transactionType=="CREATE2") and .contractAddress==$$address) | .arguments // [] | join(" ")' $$deploy); \
constructor=$$(jq '.[] | select(.type=="constructor")' out/$$name.sol/$$name.abi.json | jq -r '.inputs | map(.type) | join(",")'); \
constructor=$$(jq '.abi[] | select(.type=="constructor")' out/$$name.sol/$$name.json | jq -r '.inputs | map(.type) | join(",")'); \
echo "Verifying $$name @ $$address using constructor($$constructor) $$arguments"; \
constructor_args=$$(cast abi-encode "constructor($$constructor)" $$arguments); \
forge verify-contract --watch --verifier-url https://api-sepolia.basescan.org/api --constructor-args $$constructor_args $$address $$name ; \
Expand Down
76 changes: 75 additions & 1 deletion bindings/deploy_chain.go

Large diffs are not rendered by default.

22 changes: 22 additions & 0 deletions bindings/output_oracle.go

Large diffs are not rendered by default.

22 changes: 22 additions & 0 deletions bindings/portal.go

Large diffs are not rendered by default.

53 changes: 53 additions & 0 deletions broadcast/DeployCertManager.s.sol/84532/run-1733865565.json

Large diffs are not rendered by default.

3,009 changes: 3,009 additions & 0 deletions broadcast/DeploySystem.s.sol/84532/run-1733867021.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion deployments/84532-certmanager.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"CertManager": "0x6775BB4C4b0D32f07EeE370369ceED41029A5352"
"CertManager": "0x00a452e7B56052f0beC5EF863F77eDDfd81938C4"
}
52 changes: 26 additions & 26 deletions deployments/84532-deploy.json
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
{
"AddressManager": "0x42dffe88Be465d26a8858701252b7aa203bB242E",
"AddressManager": "0xdcB1Ee2F0F35F8053C1EbD700c030180f7b2C14b",
"AnchorStateRegistryProxy": "0x0000000000000000000000000000000000000001",
"CertManager": "0x00a452e7B56052f0beC5EF863F77eDDfd81938C4",
"DelayedWETHProxy": "0x0000000000000000000000000000000000000001",
"DeployChain": "0xFD6c9Bd1975749Ad0C566c2861F7Ac09296da994",
"DeployChain": "0x60331232603710208EA4F1f277b1b60a9d55AB04",
"DisputeGameFactoryProxy": "0x0000000000000000000000000000000000000001",
"L1CrossDomainMessenger": "0x4894Ad99C394cCd9a15fCB883fb46701fE228E52",
"L1CrossDomainMessengerProxy": "0x081415893317739FA0BdE509E5C13E54Aef23a0a",
"L1ERC721Bridge": "0x7452f40900BbF77105bDB7e7b02F06302Bff31c4",
"L1ERC721BridgeProxy": "0xe48337852f6081867E2AfC265b3E5d0475f9d9E5",
"L1StandardBridge": "0xae1840eC043cbdB6be8940b5358545888c09E096",
"L1StandardBridgeProxy": "0xfADd9d89fdE7ba0D6053552820A5fEF42b5Fb2Af",
"L2OutputOracle": "0xfd232ec44005Eed9287a8911cB24b491f642D344",
"L2OutputOracleProxy": "0xe3047c1cFbc2C748DA9cdc9AF973cD74c14c4122",
"NitroValidator": "0x9fAca7Ad7f3D4499335150264B5e05277b3bFcc6",
"OptimismMintableERC20Factory": "0x89ba073Ab54679d50b9660194875900171Ad1C4c",
"OptimismMintableERC20FactoryProxy": "0x1025E8ee4f74743e4DC6acA35387A50d9A1e30A7",
"OptimismPortal": "0x95a59D257723aABfe18b0C52e775ff98866a23f7",
"OptimismPortalProxy": "0x6837dEf8B12Ea8EfB7E2605B435172f6c657d859",
"OwnerConfig": "0xD4110A249FAB4f20eaa3Aba2eaa5fE196a33C9e6",
"L1CrossDomainMessenger": "0x50237F4364Dfa91EB16d1DD20ae97b40e430c1fA",
"L1CrossDomainMessengerProxy": "0x05c8428901475fae5341d24DB61529450827E5c6",
"L1ERC721Bridge": "0x56dbF85275EF25672e8b365e14864fc187c65b59",
"L1ERC721BridgeProxy": "0x8441C4A89e8C660190DB71087A1B53b46331d79D",
"L1StandardBridge": "0x084Ff70b7e51c2996bb16656F0C21B00f0C6c686",
"L1StandardBridgeProxy": "0x53724ab86e0144F071B088dc9DA4e1e77E7CFdaf",
"L2OutputOracle": "0x75E0790a8D42aaCAC537D683DB0BB8205708Ec69",
"L2OutputOracleProxy": "0x1365d46d7082551249beA16669Dfc1bc0BE3bD8C",
"OptimismMintableERC20Factory": "0xc79B822C46769b22FB96f19c672D75090950961A",
"OptimismMintableERC20FactoryProxy": "0x1f959f57eD073bab2Cf3ccBE7198c73621f723dD",
"OptimismPortal": "0xBDF39AF547E916198ba7f6076CedF4124f7546FA",
"OptimismPortalProxy": "0x22B6853e3d745201f7f9A4048B8c99Bc2D63509F",
"OwnerConfig": "0x8A518282EBb0e5C24701E576101fAF4FbC180aB3",
"PermissionedDelayedWETHProxy": "0x0000000000000000000000000000000000000001",
"ProtocolVersions": "0xA78F5256a06c1F811D3F318eCc5F61cbf9467eAD",
"ProtocolVersionsProxy": "0xc572623Fe2045A8d4A6a8065b8F985124d859B4c",
"ProxyAdmin": "0x07D583226bE1636d1b00B479F994a264E183298E",
"ProtocolVersions": "0xd4D1cB35748EbE8a6aC302Fb3a76CC3f691cB804",
"ProtocolVersionsProxy": "0x7EDd09687F7dD14Ca0bCD251b630C14A64E0787c",
"ProxyAdmin": "0x9a2F21d4759f80c83b4269e35fBe02CC04DC23CA",
"SafeProxyFactory": "0xa6B71E26C5e0845f74c812102Ca7114b6a896AB2",
"SafeSingleton": "0xd9Db270c1B5E3Bd161E8c8503c55cEABeE709552",
"SuperchainConfig": "0x3A04210D5c1f6dbDD728349994ed43613d214B8f",
"SuperchainConfigProxy": "0xC3846e5765816020F32E1C5FE6bb90330A28A2Ed",
"SystemConfig": "0x573d549541381002a325351170D74b685C92ae38",
"SystemConfigGlobal": "0x5695fCCf07aC3aBf2cB11429bB462e710fea08f5",
"SystemConfigGlobalProxy": "0xE03709F06832724b1d562a53F8498A8E4E19Cdd7",
"SystemConfigProxy": "0x8E248445a3943f5c680707dEf0AFAd8D24A29248",
"SystemOwnerSafe": "0xFfe2Ae7C40F70fEa4773F58d39A67526238c2750"
"SuperchainConfig": "0xC77dB710C47b6e294D3d544572a10187e8Ef6b2C",
"SuperchainConfigProxy": "0xCf940f9c053092d07EB62DaB59D0AFddF426dE67",
"SystemConfig": "0x8aB8559E6C661eFEB0a44C0f08E180CEe344dABE",
"SystemConfigGlobal": "0x9C9a3B1c8676c1E0A6Ebb9402E7354930Bc52A59",
"SystemConfigGlobalProxy": "0x53200eC3d6E91E7Ba1fD1087D38430F43501C9Fb",
"SystemConfigProxy": "0x57708f73fF01e8697799B38f47Fbd65bDf9138Bc",
"SystemOwnerSafe": "0xFCD4AfF397A2F9D2a435B64AdA1A70efC59310aD"
}
1 change: 0 additions & 1 deletion foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ libs = ["lib"]
optimizer = true
optimizer_runs = 999999

extra_output_files = ['abi']
bytecode_hash = 'none'
ast = true
gas_limit = 9223372036854775807
Expand Down
2 changes: 1 addition & 1 deletion script/DeploySystem.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ contract DeploySystem is Deploy {

uint256 timestamp = vm.getBlockTimestamp();
vm.warp(1732580000);
ICertManager(certManagerAddress).verifyCert(cert, false, keccak256(parent));
ICertManager(certManagerAddress).verifyCert(cert, true, keccak256(parent));
vm.warp(timestamp);
}

Expand Down
36 changes: 22 additions & 14 deletions src/DeployChain.sol
Original file line number Diff line number Diff line change
Expand Up @@ -102,16 +102,20 @@ contract DeployChain {
function deployAddresses(uint256 chainID) external view returns (DeployAddresses memory) {
bytes32 salt = keccak256(abi.encodePacked(chainID));
return DeployAddresses({
l2OutputOracle: ResolvingProxyFactory.proxyAddress(l2OutputOracle, proxyAdmin, salt),
systemConfig: ResolvingProxyFactory.proxyAddress(systemConfig, proxyAdmin, salt),
optimismPortal: ResolvingProxyFactory.proxyAddress(optimismPortal, proxyAdmin, salt),
l1CrossDomainMessenger: ResolvingProxyFactory.proxyAddress(l1CrossDomainMessenger, proxyAdmin, salt),
l1StandardBridge: ResolvingProxyFactory.proxyAddress(l1StandardBridge, proxyAdmin, salt),
l1ERC721Bridge: ResolvingProxyFactory.proxyAddress(l1ERC721Bridge, proxyAdmin, salt),
optimismMintableERC20Factory: ResolvingProxyFactory.proxyAddress(optimismMintableERC20Factory, proxyAdmin, salt)
l2OutputOracle: proxyAddress(l2OutputOracle, salt),
systemConfig: proxyAddress(systemConfig, salt),
optimismPortal: proxyAddress(optimismPortal, salt),
l1CrossDomainMessenger: proxyAddress(l1CrossDomainMessenger, salt),
l1StandardBridge: proxyAddress(l1StandardBridge, salt),
l1ERC721Bridge: proxyAddress(l1ERC721Bridge, salt),
optimismMintableERC20Factory: proxyAddress(optimismMintableERC20Factory, salt)
});
}

function proxyAddress(address proxy, bytes32 salt) public view returns (address) {
return ResolvingProxyFactory.proxyAddress(proxy, proxyAdmin, salt);
}

function deploy(
uint256 chainID,
GenesisConfiguration memory genesisConfig,
Expand Down Expand Up @@ -151,16 +155,20 @@ contract DeployChain {
function setupProxies(uint256 chainID) internal returns (DeployAddresses memory) {
bytes32 salt = keccak256(abi.encodePacked(chainID));
return DeployAddresses({
l2OutputOracle: ResolvingProxyFactory.setupProxy(l2OutputOracle, proxyAdmin, salt),
systemConfig: ResolvingProxyFactory.setupProxy(systemConfig, proxyAdmin, salt),
optimismPortal: ResolvingProxyFactory.setupProxy(optimismPortal, proxyAdmin, salt),
l1CrossDomainMessenger: ResolvingProxyFactory.setupProxy(l1CrossDomainMessenger, proxyAdmin, salt),
l1StandardBridge: ResolvingProxyFactory.setupProxy(l1StandardBridge, proxyAdmin, salt),
l1ERC721Bridge: ResolvingProxyFactory.setupProxy(l1ERC721Bridge, proxyAdmin, salt),
optimismMintableERC20Factory: ResolvingProxyFactory.setupProxy(optimismMintableERC20Factory, proxyAdmin, salt)
l2OutputOracle: deployProxy(l2OutputOracle, salt),
systemConfig: deployProxy(systemConfig, salt),
optimismPortal: deployProxy(optimismPortal, salt),
l1CrossDomainMessenger: deployProxy(l1CrossDomainMessenger, salt),
l1StandardBridge: deployProxy(l1StandardBridge, salt),
l1ERC721Bridge: deployProxy(l1ERC721Bridge, salt),
optimismMintableERC20Factory: deployProxy(optimismMintableERC20Factory, salt)
});
}

function deployProxy(address proxy, bytes32 salt) public returns (address) {
return ResolvingProxyFactory.setupProxy(proxy, proxyAdmin, salt);
}

function calculateHashes(
uint256 chainID,
GenesisConfiguration memory genesisConfig,
Expand Down

0 comments on commit b1b3fd6

Please sign in to comment.