diff --git a/.gitignore b/.gitignore index 97d65ac..d7c0b03 100644 --- a/.gitignore +++ b/.gitignore @@ -6,9 +6,7 @@ out/** !out/Solver7702Delegate.sol/Solver7702Delegate.json # Ignores development broadcast logs -!/broadcast -/broadcast/*/31337/ -/broadcast/**/dry-run/ +broadcast/ # Docs docs/ diff --git a/README.md b/README.md index 9ab2ea6..b091b38 100644 --- a/README.md +++ b/README.md @@ -159,6 +159,41 @@ cast send 0x0000000000000000000000000000000000000000 \ Then verify that `cast code ` no longer points to the previous delegate, using the [same verification method as before](#verify-delegation). +### Contract verification + +Etherscan marks solver EOAs as a **Similar Match** after one matching delegate contract is verified on the same chain. Instead of verifying every solver EOA from Rust, deploy and verify one dummy delegate per chain. + +Set `APPROVED_CALLERS` to five zero addresses and set `ETHERSCAN_API_KEY`. Foundry reads the same Etherscan key from the environment for every chain. + +```shell +export ZERO_ADDRESS=0x0000000000000000000000000000000000000000 +export APPROVED_CALLERS=${ZERO_ADDRESS},${ZERO_ADDRESS},${ZERO_ADDRESS},${ZERO_ADDRESS},${ZERO_ADDRESS} +export ETHERSCAN_API_KEY= + +just build && forge script script/DeploySolver7702Delegate.s.sol:DeploySolver7702Delegate \ + --rpc-url \ + --private-key \ + --broadcast \ + --verify \ + --verifier etherscan +``` + +If the dummy delegate is already deployed and only needs verification: + +```shell +export ZERO_ADDRESS=0x0000000000000000000000000000000000000000 +export APPROVED_CALLERS=${ZERO_ADDRESS},${ZERO_ADDRESS},${ZERO_ADDRESS},${ZERO_ADDRESS},${ZERO_ADDRESS} +export ETHERSCAN_API_KEY= + +forge verify-contract src/Solver7702Delegate.sol:Solver7702Delegate \ + --chain \ + --constructor-args $(cast abi-encode "constructor(address[5])" "[${APPROVED_CALLERS}]") \ + --verifier etherscan \ + --watch +``` + +After the dummy delegate is verified, later solver EOAs with the same delegate bytecode will be verified automatically by Etherscan's "Similar Match" feature. + ## Development ### Just commands