Skip to content

Conversation

@gfournierPro
Copy link
Contributor

2 new scripts to :

  • extract proxy smart contract address from config.json
  • get the implementatiton address since we did not want to save them on deploy

@gfournierPro gfournierPro self-assigned this Jul 21, 2025

This comment was marked as outdated.

@codecov
Copy link

codecov bot commented Jul 21, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (main@3c7288e). Learn more about missing BASE report.

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.
📢 Have feedback on the report? Share it here.

@gfournierPro gfournierPro requested a review from Copilot July 22, 2025 08:57
Copy link
Contributor

Copilot AI left a 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
Copy link

Copilot AI Jul 22, 2025

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.

Suggested change
# COMPLETION TARGETS
# COMPLETION TARGETS

Copilot uses AI. Check for mistakes.
Comment on lines 41 to 60
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");
Copy link
Contributor

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 ?

Copy link
Contributor Author

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines 26 to 29
function getConfigField(string calldata chain, string calldata field) external view {
address value = _getConfigFieldAddress(chain, field);
console.log(value);
}
Copy link
Contributor

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 ?

Copy link
Contributor Author

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

# 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); \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
@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.

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); \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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);

Copy link
Contributor Author

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

Comment on lines 28 to 29
function getConfigField(string calldata chain, string calldata field) external view {
address value = _getConfigFieldAddress(chain, field);
Copy link
Member

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

@gfournierPro gfournierPro merged commit 9029aa7 into main Jul 23, 2025
4 checks passed
@gfournierPro gfournierPro deleted the feature/re-add-verification-script branch July 23, 2025 06:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants