This section provides detailed documentation for the Filfox Contract Verification API. It includes information on how to use the API, the available endpoints, request and response formats, and example code snippets.

Please refer to the documentation for more information on how to verify contracts using the Filfox API.

API Endpoint

# mainnet
Post    <https://filfox.info/api/v1/tools/verifyContract>

# calibration
Post    <https://calibration.filfox.info/api/v1/tools/verifyContract>

Parameters

interface SourceFiles {
    [name: string]: {
        content: string
    }
}

<aside> 💡 Tips: Some of the links below only work properly on Chrome, please use Google Chrome for a better reading experience.

</aside>

Parameter Type Optional Default Value Description Example
address string No - contract address, support 0x , f0 and f4 address '0xB4C47eD546Fc31E26470a186eC2C5F19eF09BA41' or 'f02804637' or 'f410fwtch5vkg7qy6ezdqugdoylc7dhxqtosbhvnbwmq'
language string Yes 'Solidity' only support Solidity for now -
compiler string Yes 'latest' compiler version used 'v0.7.6+commit.7338295f'
optimize boolean Yes false use false for no optimization, and true if optimization was used -
optimizeRuns number Yes 200 the no. of runs if optimization was used -
optimizerDetails string Yes '' stringified JSON for switch optimizer components on or off in detail '{"constantOptimizer":true,"cse":true,"deduplicate":true,"inliner":true,"jumpdestRemover":true,"orderLiterals":true,"peephole":true,"yul":false}'
sourceFiles SourceFiles No - - -
license string Yes 'No License (None)' - 'MIT License (MIT)'
evmVersion string Yes 'default' version of the EVM to compile for 'shanghai'
viaIR boolean Yes false change compilation pipeline to go through the Yul intermediate representation true
libraries string Yes '' stringified JSON for library used in contract '{"file_1.sol":{"library_1_name":"0x123..."}}'
metadata string Yes '' stringified JSON for Metadata settings '{"bytecodeHash":"none"}'

Examples

curl --location --request POST '<https://filfox.info/api/v1/tools/verifyContract>' \\
  --header 'Content-Type: application/json' \\
  --data-raw '{
  "address": "f02835916",
  "language": "Solidity",
  "compiler": "v0.8.17+commit.8df45f5f",
  "optimize": true,
  "optimizeRuns": 200,
  "optimizerDetails": "",
  "sourceFiles": {
    "filename1.sol": {
      "content": "contract A { function f() public { } }"
    },
    "filename2.sol": {
      "content": "contract B { function g() public { } }"
    }
  },
  "license": "",
  "evmVersion": "default",
  "viaIR": false,
  "libraries": "",
  "metadata": ""
}'

Return value

{
  "success": true,
  "errorCode": 0,
  "contractName": "xxx",
  "initCode": "xxx",
  "abi": "xxx"
}

# your contract is now verified.
{
  "success": false,
  "errorCode": 1,
}

# no source file was provide.
{
  "success": false,
  "errorCode": 2,
}

# please contact us on [Telegram](<https://t.me/Filfoxofficial>) if you encounter this error.
{
  "success": false,
  "errorCode": 3,
}

# The compiler version string must be in the long format. 
# Thus, if you would like to use version v0.7.6 
# you need to include the commit hash of the release
# like this: v0.7.6+commit.7338295f
# please try again later with correct compiler version string
# if you encounter this error.