-
Notifications
You must be signed in to change notification settings - Fork 59
Revamp verification script #469
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
foundry.toml
Outdated
| [etherscan] | ||
| mainnet = { key = "${ETHERSCAN_API_KEY}" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might need to remove this, because it's breaking CI.
Please check the implications of removing this section.
SidestreamColdMelon
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Setup
- Temporary modified
foundry.tomlto addsepolia = "${ETH_RPC_URL}"in the end - Temporary modified
DssExec.solto replacelog.getAddress("MCD_PAUSE")withaddress(0) - Temporary modified
verify.pyto add'11155111': 'sepolia.'intoETHERSCAN_SUBDOMAINS - Temporary modified
DssExecLib.addressto contain0x0496AbA1f2CD4038cC486993f5CCF97851AE26d3 - Temporary removed
librariesarray fromfoundry.toml - Cleaned up
DssSpell.sol - Exported
ETHERSCAN_API_KEYandETH_RPC_URLwith sepolia-specific url - Activated python environment (
source ~/path/to/venv/bin/activate) - Deployed spell with
forge create --no-cache --interactive src/DssSpell.sol:DssSpell --libraries ./lib/dss-exec-lib/src/DssExecLib.sol:DssExecLib:0x0496AbA1f2CD4038cC486993f5CCF97851AE26d3 --broadcast
Results
- ✅ Deployed contract is unverified
- ✅ Executing
make verify addr=0xF4cBfbf1987d3E30436c6Bee521D421cBF4f5060verified bothDssSpelland its action (DssSpellAction) - ✅ Rerunning step
9.above after modifyingoptimizer = trueandoptimzier_runs = 200deployed another unverified contract - ✅ Executing
make verify addr=0x0188B03a839Eb51675Ad6398EC3579790473e469verified bothDssSpellandDssSpellAction
Example logs
./scripts/verify.py DssSpell 0xF4cBfbf1987d3E30436c6Bee521D421cBF4f5060
Obtaining chain ID...
CHAIN_ID: 11155111
No DssExecLib configured in foundry.toml
Trying to read DssExecLib.address...
Using library DssExecLib at address 0x0496AbA1f2CD4038cC486993f5CCF97851AE26d3
Verifying DssSpell at 0xF4cBfbf1987d3E30436c6Bee521D421cBF4f5060...
Sending verification request...
Verification request submitted with GUID: 3j6t9dgwu2tutq8qiizbteb8p4dzbifmnca8uyvidgqzgcwvug
Sending verification request...
Pending in queue
Waiting for 15 seconds for Etherscan to process the request...
Sending verification request...
Contract verified successfully at https://sepolia.etherscan.io/address/0xF4cBfbf1987d3E30436c6Bee521D421cBF4f5060#code
Verifying DssSpellAction at 0x27B4e84E4496E503a46885aAE25E50947ff81aaf...
Sending verification request...
Verification request submitted with GUID: vffuksm37srh6jyt21wh4n8wb18xzrqjrhfsskzphychmhqjrp
Sending verification request...
Pending in queue
Waiting for 15 seconds for Etherscan to process the request...
Sending verification request...
Contract verified successfully at https://sepolia.etherscan.io/address/0x27B4e84E4496E503a46885aAE25E50947ff81aaf#code
Verification complete!
| libraries = [ | ||
| "./lib/dss-exec-lib/src/DssExecLib.sol:DssExecLib:0x8De6DDbCd5053d32292AAA0D2105A32d108484a6" | ||
| ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: It's technically out of scope of this PR to (partially) move DssExecLib address into foundry.toml. But fine for me to keep it, until the next PR is merged. No action required
SidestreamColdMelon
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At commit 1680435:
- ✅ After repeating steps 1-9, the contract is deployed to http://sepolia.etherscan.io/address/0xe73F3244ab9053360C272e912aD8dB38c77F3167#code and is unverified
- ✅ After executing
make verify addr=0xe73F3244ab9053360C272e912aD8dB38c77F3167, bothDssSpellandDssSpellActionare correctly verified
At commit e55b011:
- ✅
make check-deployed-spellworks as expected
oddaf
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, test run on Sepolia:
Obtaining chain ID...
CHAIN_ID: 11155111
Using library DssExecLib at address 0x0496AbA1f2CD4038cC486993f5CCF97851AE26d3
Verifying DssSpell at 0x36B072ed8AFE665E3Aa6DaBa79Decbec63752b22...
Sending verification request...
Verification request submitted with GUID: rjahmnevgrhf7ctzkddyeueheugt9pee24xebbz55qzhqxupcz
Sending verification request...
Pending in queue
Waiting for 15 seconds for Etherscan to process the request...
Sending verification request...
Contract verified successfully at https://sepolia.etherscan.io/address/0x36B072ed8AFE665E3Aa6DaBa79Decbec63752b22#code
Verifying DssSpellAction at 0xF7A3ed7721c46C7Fa2109a09CA64718B3786Ad37...
Sending verification request...
Unable to locate ContractCode at 0xF7A3ed7721c46C7Fa2109a09CA64718B3786Ad37
Waiting for 15 seconds for the network to update...
Sending verification request...
Verification request submitted with GUID: fvm47wfsts6kmrd3d3edpadztewnsh1thbajiyw1aiizyjd85n
Sending verification request...
Pending in queue
Waiting for 15 seconds for Etherscan to process the request...
Sending verification request...
Contract verified successfully at https://sepolia.etherscan.io/address/0xF7A3ed7721c46C7Fa2109a09CA64718B3786Ad37#code
Verification complete!
The script
verify.pyhas been tested on the Sepolia testnet. Unfortunately, there is neitherchainlognorDssExeclibthere.We deployed a new DssExeclib at 0x0496AbA1f2CD4038cC486993f5CCF97851AE26d3 that can be used instead.
In order to test the script you can deploy a simple Spell contract containing only a counter i.e.
uint256 internal constant NONCE = magicNumber;You can increase the counter each time you deploy a new contract for testing because etherscan will detect the bytecode and verify it automatically otherwise.
Additionally, in order to have a successfull deployment,
DssExec.solhas to be edited accordingly:line 47:
PauseAbstract /* immutable */ public pause;line 68:
// pause = PauseAbstract(log.getAddress("MCD_PAUSE"));Sepolia related rpc and api-key entries need to be added to `foundy.toml:
and in verify.py the sepolia chain-id has to be added:
In order to deploy the spell you can use the following command