Verify your contract with us! Click here
To verify smart contracts with API, you will need to prepare the following:
https://fvm-api.starboard.ventures
https://fvm-calibration-api.starboard.ventures
Here is an example of a cURL request:
curl --request POST '${Network}/api/v1/contract/${YourContractAddress}/verify'
--form 'metadata.json=@"path/metadata.json"'
--form 'xxx.sol=@"path/xxx.sol"'
--form 'hardhat/console.sol=@"path/console.sol"'
--form '@openzeppelin/contracts/token/ERC721/ERC721.sol=@"path/@openzeppelin/contracts/token/ERC721/ERC721.sol"'
The HTTP Form Key must include:
When you make a request, you will get a response like this:
{
"request_id": "807410cd-217e-43dc-9cef-8b2b76f5e743#5553331",
"code": 4,
"message": "missingfile:contracts/xxxxxxxxx.sol"
}
If the code is equal to 0, it means the contract was verified successfully. If not, you can get the error details and missing information from the message field.
The current system has not yet been optimized for memory usage. Please refrain from using concurrent calls to the verify API.
The metadata.json file contains information about the compiled smart contract.
Read more about metadata: https://docs.soliditylang.org/en/latest/metadata.html
Reference: https://github.com/ethereum/solc-js#low-level-api
These low-level functions remain available for compatibility reasons. However, they were superseded by the compile() function and are no longer required. Starting from version 0.5.0+commit.1d4f565a, the functions compileSingle, compileMulti, and compileCallback are always null when using newer solc binary versions. It is recommended to use the latest release of solc-js, but it should also handle all the older solc binaries down to 0.1.x.
Using the Remix Integrated Development Environment (IDE):
You can find the metadata.json file in File explorer -> contracts -> artifacts -> ${contract_name}_metadata.json.
Using the Solidity Compiler (solc):
To generate the metadata file using the solc compiler, execute the following command:
solc --metadata --bin-runtime -o ./artifacts MyContract.sol
This command compiles the 'MyContract.sol' smart contract file, producing the metadata file in the './artifacts' directory with the naming convention 'xxx.json'. Once generated, submit this metadata file to the specified interface for contract verification.
You can read more on obtaining metadata files at Sourcify Documentation.
The metadata.json file includes a list of required files to be uploaded for contract verification. To ensure a successful verification process, submit all the files referenced in the metadata.json file via the API. The number of .sol files required depends on the configuration provided in the metadata. Any missing files will show up in the return message.
If your .sol file contains imported external files, it is essential to locate and submit these files for accurate contract verification. For instance, when using Remix IDE, press and hold the 'Alt' key while clicking on the imported file to access the external file. After accessing the file, save it. Please ensure that you do not introduce any additional characters while saving, such as new lines at the end of the file, or permit the IDE to auto-format the content.