Skip to content

feat: add support for blockscout in VerifyOPCM (cherry-pick)#18384

Merged
JosepBove merged 1 commit intoproposal/op-safe-contracts/v1.0.0from
cherry-pick/op-safe-contracts/blockscout-verify-opcm
Nov 25, 2025
Merged

feat: add support for blockscout in VerifyOPCM (cherry-pick)#18384
JosepBove merged 1 commit intoproposal/op-safe-contracts/v1.0.0from
cherry-pick/op-safe-contracts/blockscout-verify-opcm

Conversation

@JosepBove
Copy link
Copy Markdown
Member

Summary

Cherry-pick of #18373 from develop to proposal/op-safe-contracts/v1.0.0.

  • Adds support for blockscout verification in VerifyOPCM

Original commit: 35bd6ef

* feat: add support for blockscout in VerifyOPCM

This commit adds support for blockscout in VerifyOPCM and defaults
to blockscout. Etherscan verification can still be used but
blockscout is simpler and more reliable on all networks.

* fix: formatting
@JosepBove JosepBove requested a review from a team as a code owner November 25, 2025 22:28
@JosepBove JosepBove requested review from smartcontracts and removed request for a team November 25, 2025 22:28
@JosepBove JosepBove merged commit 2acb807 into proposal/op-safe-contracts/v1.0.0 Nov 25, 2025
24 of 48 checks passed
@JosepBove JosepBove deleted the cherry-pick/op-safe-contracts/blockscout-verify-opcm branch November 25, 2025 22:30
Comment on lines +524 to +530
cmd = string.concat(
"curl -s '",
Config.blockscoutApiUrl(),
"/api?module=contract&action=getcontractcreation&contractaddresses=",
vm.toString(_addr),
"' | jq -r '.result[0].creationBytecode'"
);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Malformed curl command when blockscoutApiUrl() returns empty string for unsupported chains. If the chain ID is not in the hardcoded list in Config.blockscoutApiUrl() and BLOCKSCOUT_API_URL environment variable is not set, the function returns an empty string. This results in an invalid curl URL like curl -s '/api?module=... which will fail.

// Add validation before using the URL:
string memory apiUrl = Config.blockscoutApiUrl();
require(bytes(apiUrl).length > 0, "Blockscout API URL not configured for this chain");
cmd = string.concat(
    "curl -s '",
    apiUrl,
    "/api?module=contract&action=getcontractcreation&contractaddresses=",
    vm.toString(_addr),
    "' | jq -r '.result[0].creationBytecode'"
);
Suggested change
cmd = string.concat(
"curl -s '",
Config.blockscoutApiUrl(),
"/api?module=contract&action=getcontractcreation&contractaddresses=",
vm.toString(_addr),
"' | jq -r '.result[0].creationBytecode'"
);
string memory apiUrl = Config.blockscoutApiUrl();
require(bytes(apiUrl).length > 0, "Blockscout API URL not configured for this chain");
cmd = string.concat(
"curl -s '",
apiUrl,
"/api?module=contract&action=getcontractcreation&contractaddresses=",
vm.toString(_addr),
"' | jq -r '.result[0].creationBytecode'"
);

Spotted by Graphite Agent

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.

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.

2 participants