feat: add support for blockscout in VerifyOPCM (cherry-pick)#18384
Merged
JosepBove merged 1 commit intoproposal/op-safe-contracts/v1.0.0from Nov 25, 2025
Conversation
* 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
smartcontracts
approved these changes
Nov 25, 2025
2acb807
into
proposal/op-safe-contracts/v1.0.0
24 of 48 checks passed
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'" | ||
| ); |
Contributor
There was a problem hiding this comment.
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
Is this helpful? React 👍 or 👎 to let us know.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Cherry-pick of #18373 from develop to
proposal/op-safe-contracts/v1.0.0.Original commit: 35bd6ef