-
Notifications
You must be signed in to change notification settings - Fork 0
feat: re add verification script #80
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
…xy and implementation verification
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #80 +/- ##
=======================================
Coverage ? 83.78%
=======================================
Files ? 4
Lines ? 111
Branches ? 7
=======================================
Hits ? 93
Misses ? 17
Partials ? 1 ☔ View full report in Codecov by Sentry. |
…tion extraction and proxy address retrieval
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.
Pull Request Overview
This PR adds verification functionality for smart contracts by introducing two new scripts that extract proxy contract addresses from configuration files and retrieve implementation addresses without storing them during deployment.
- Adds a comprehensive Makefile-based verification system for proxy and implementation contracts
- Introduces a Solidity script to extract configuration information and proxy implementation addresses
- Updates the main Makefile to include the new verification tools
Reviewed Changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| tools/verification.mk | Comprehensive Makefile with verification functions and targets for Sepolia and Arbitrum Sepolia networks |
| script/GetConfigInfo.s.sol | Solidity script to extract config fields and implementation addresses from proxy contracts |
| Makefile | Updated to include the new verification.mk file |
|
|
||
|
|
||
| # ======================================================================== | ||
| # COMPLETION TARGETS |
Copilot
AI
Jul 22, 2025
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.
Inconsistent tab usage in comment formatting. This line uses tabs while other comment lines use spaces for alignment.
| # COMPLETION TARGETS | |
| # COMPLETION TARGETS |
script/GetConfigInfo.s.sol
Outdated
| if (keccak256(bytes(field)) == keccak256("initialAdmin")) { | ||
| return config.initialAdmin; | ||
| } else if (keccak256(bytes(field)) == keccak256("initialPauser")) { | ||
| return config.initialPauser; | ||
| } else if (keccak256(bytes(field)) == keccak256("initialUpgrader")) { | ||
| return config.initialUpgrader; | ||
| } else if (keccak256(bytes(field)) == keccak256("createxFactory")) { | ||
| return config.createxFactory; | ||
| } else if (keccak256(bytes(field)) == keccak256("lzEndpoint")) { | ||
| return config.lzEndpoint; | ||
| } else if (keccak256(bytes(field)) == keccak256("rlcToken")) { | ||
| return config.rlcToken; | ||
| } else if (keccak256(bytes(field)) == keccak256("rlcLiquidityUnifierAddress")) { | ||
| return config.rlcLiquidityUnifierAddress; | ||
| } else if (keccak256(bytes(field)) == keccak256("rlcCrosschainTokenAddress")) { | ||
| return config.rlcCrosschainTokenAddress; | ||
| } else if (keccak256(bytes(field)) == keccak256("iexecLayerZeroBridgeAddress")) { | ||
| return config.iexecLayerZeroBridgeAddress; | ||
| } else { | ||
| revert("Unknown field"); |
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.
why we not use config.readAddress(field) here ?
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.
don't know this fct sry
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.
script/GetConfigInfo.s.sol
Outdated
| function getConfigField(string calldata chain, string calldata field) external view { | ||
| address value = _getConfigFieldAddress(chain, field); | ||
| console.log(value); | ||
| } |
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.
Is this function really necessary ?
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.
To mutualise the _getConfigFieldAddress btw getConfigField and getImplementationAddress
tools/verification.mk
Outdated
| # Parameters: CONTRACT_NAME, NETWORK, CONFIG_KEY, CHAIN_ID, DISPLAY_NAME, CONTRACT_PATH, RPC_URL, CONSTRUCTOR_ARGS | ||
| define verify-impl | ||
| @echo "Verifying $(1) Implementation on $(5)..." | ||
| @proxy_address=$$(forge script script/GetConfigInfo.s.sol --sig "getConfigField(string,string)" $(2) $(3) 2>/dev/null | grep "0x" | tail -n1); \ |
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.
| @proxy_address=$$(forge script script/GetConfigInfo.s.sol --sig "getConfigField(string,string)" $(2) $(3) 2>/dev/null | grep "0x" | tail -n1); \ | |
| @proxy_address=$$(forge script script/GetConfigInfo.s.sol --sig "getConfigField(string,string)" $(2) $(3) 2>/dev/null | grep "0x" | tail -n1); |
And all others.
tools/verification.mk
Outdated
| define verify-impl | ||
| @echo "Verifying $(1) Implementation on $(5)..." | ||
| @proxy_address=$$(forge script script/GetConfigInfo.s.sol --sig "getConfigField(string,string)" $(2) $(3) 2>/dev/null | grep "0x" | tail -n1); \ | ||
| impl_address=$$(forge script script/GetConfigInfo.s.sol --sig "getImplementationAddress(string,string)" $(2) $(3) --rpc-url $(7) 2>/dev/null | grep "0x" | tail -n1); \ |
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.
| impl_address=$$(forge script script/GetConfigInfo.s.sol --sig "getImplementationAddress(string,string)" $(2) $(3) --rpc-url $(7) 2>/dev/null | grep "0x" | tail -n1); \ | |
| @impl_address=$$(forge script script/GetConfigInfo.s.sol --sig "getImplementationAddress(string,string)" $(2) $(3) --rpc-url $(7) 2>/dev/null | grep "0x" | tail -n1); |
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.
Trying to do so but can't make it work
script/GetConfigInfo.s.sol
Outdated
| function getConfigField(string calldata chain, string calldata field) external view { | ||
| address value = _getConfigFieldAddress(chain, field); |
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.
Why not:
function getConfigField(string calldata path) external view {
string memory config = vm.readFile("config/config.json");
address value = config.readAddress(path);
...and call it with .initialAdmin and .chains.sepolia.rlcLiquidityUnifierAddress
…nd updating address retrieval logic
2 new scripts to :