Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ out/**
!out/Solver7702Delegate.sol/Solver7702Delegate.json

# Ignores development broadcast logs
!/broadcast
/broadcast/*/31337/
/broadcast/**/dry-run/
broadcast/
Comment thread
igorroncevic marked this conversation as resolved.

# Docs
docs/
Expand Down
35 changes: 35 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,41 @@ cast send 0x0000000000000000000000000000000000000000 \

Then verify that `cast code <solver_eoa>` 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=<etherscan_api_key>

just build && forge script script/DeploySolver7702Delegate.s.sol:DeploySolver7702Delegate \
--rpc-url <your_rpc_url> \
--private-key <your_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=<etherscan_api_key>

forge verify-contract <deployed_delegate_address> src/Solver7702Delegate.sol:Solver7702Delegate \
--chain <chain_id> \
--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
Expand Down
Loading