Verify through Foundry

SocialScan supports verifying smart contracts through Foundry, please refer to https://book.getfoundry.sh/reference/forge/forge-verify-contract for more information.

You must include the following args

Example

# Compile your smart contract first
forge build

# Verify a flattened contract 
forge verify-contract <contract_address> <contract_name> \
--compiler-version <compiler_version> \
--flatten \
--verifier-url <api_host>/v1/explorer/command_api/contract \
--verifier blockscout

# Verify a contract with JSON standard input
forge verify-contract \
<contract_address> <contract_name> \
--watch \
--compiler-version <compiler_version> \
--constructor-args $(cast abi-encode "constructor(string,string)" "TEST" "ST2") \
--verifier-url <api_host>/v1/explorer/command_api/contract \
--verifier blockscout

# Verify a contract use "etherscan" verifier
forge verify-contract \
<contract_address> <contract_name> \
--chain <chain_id> \
--watch --etherscan-api-key test \
--verifier-url <api_host>/v1/explorer/command_api/contract \
--verifier etherscan

# Expected output
Start verifying contract `<contract_address>` deployed on <chain_name>

Submitting verification for [<contract_name>] <contract_address>.
Submitted contract for verification:
        Response: `Contract successfully verified`
        GUID: `a40a619266ea0d581e6373c52754e4a4ef6333bc8581b9d2a02d6174b3316f39`
        URL: <explorer_host>/address/<contract_address>
Contract verification status:
Response: `OK`
Details: `Pass - Verified`
Contract successfully verified

Last updated