Skip to content

Commit e6c1603

Browse files
committed
feat: enhance proxy verification to include RPC URL and constructor arguments
1 parent 770b798 commit e6c1603

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

tools/verification.mk

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,20 @@ ARBITRUM_SEPOLIA_CHAIN_ID := 421614
1414
# ========================================================================
1515

1616
# Verify ERC1967 proxy contracts
17-
# Parameters: CONTRACT_NAME, NETWORK, CONFIG_KEY, CHAIN_ID, DISPLAY_NAME
17+
# Parameters: CONTRACT_NAME, NETWORK, CONFIG_KEY, CHAIN_ID, DISPLAY_NAME, RPC_URL
1818
define verify-proxy
1919
@echo "Verifying $(1) Proxy on $(5)..."
20+
@proxy_address=$$(forge script script/GetConfigInfo.s.sol --sig "getConfigField(string)" ".chains.$(2).$(3)" 2>/dev/null | grep "0x" | tail -n1); \
21+
impl_address=$$(forge script script/GetConfigInfo.s.sol --sig "getImplementationAddress(string)" ".chains.$(2).$(3)" --rpc-url $(6) 2>/dev/null | grep "0x" | tail -n1); \
22+
echo "Proxy address: $$proxy_address"; \
23+
echo "Implementation address: $$impl_address"; \
24+
constructor_args=$$(cast abi-encode "constructor(address,bytes)" $$impl_address "0x"); \
2025
forge verify-contract \
2126
--chain-id $(4) \
2227
--watch \
28+
--constructor-args $$constructor_args \
2329
--etherscan-api-key $(ETHERSCAN_API_KEY) \
24-
$$(forge script script/GetConfigInfo.s.sol --sig "getConfigField(string)" ".chains.$(2).$(3)" 2>/dev/null | grep "0x" | tail -n1) \
30+
$$proxy_address \
2531
lib/openzeppelin-contracts/contracts/proxy/ERC1967/ERC1967Proxy.sol:ERC1967Proxy
2632
@echo "Proxy verification completed for $(1) on $(5)"
2733
endef
@@ -53,10 +59,10 @@ endef
5359
# Parameters: NETWORK, CHAIN_ID, DISPLAY_NAME
5460
define verify-ethereum-type-proxies
5561
verify-rlc-liquidity-unifier-proxy-$(1):
56-
$$(call verify-proxy,RLCLiquidityUnifier,$(1),rlcLiquidityUnifierAddress,$(2),$(3))
62+
$$(call verify-proxy,RLCLiquidityUnifier,$(1),rlcLiquidityUnifierAddress,$(2),$(3),$$(RPC_URL))
5763

5864
verify-layerzero-bridge-proxy-$(1):
59-
$$(call verify-proxy,IexecLayerZeroBridge,$(1),iexecLayerZeroBridgeAddress,$(2),$(3))
65+
$$(call verify-proxy,IexecLayerZeroBridge,$(1),iexecLayerZeroBridgeAddress,$(2),$(3),$$(RPC_URL))
6066
endef
6167

6268
define verify-ethereum-type-implementations
@@ -87,10 +93,10 @@ endef
8793
# Parameters: NETWORK, CHAIN_ID, DISPLAY_NAME
8894
define verify-arbitrum-type-proxies
8995
verify-rlc-crosschain-token-proxy-$(1):
90-
$$(call verify-proxy,RLCCrosschainToken,$(1),rlcCrosschainTokenAddress,$(2),$(3))
96+
$$(call verify-proxy,RLCCrosschainToken,$(1),rlcCrosschainTokenAddress,$(2),$(3),$$(RPC_URL))
9197

9298
verify-layerzero-bridge-proxy-$(1):
93-
$$(call verify-proxy,IexecLayerZeroBridge,$(1),iexecLayerZeroBridgeAddress,$(2),$(3))
99+
$$(call verify-proxy,IexecLayerZeroBridge,$(1),iexecLayerZeroBridgeAddress,$(2),$(3),$$(RPC_URL))
94100
endef
95101

96102
define verify-arbitrum-type-implementations

0 commit comments

Comments
 (0)