Smart Contract Submission
To successfully publish your smart contract souce code on Avascan, you need to take a few simple steps.
If you are deploying your token or smart contract using Remix, the compiler automatically uploads the source code to IPFS and appends its hash as metadata at the end of the code before deploying. The code includes all the comments and we can automatically verify it by pulling the code from IPFS, compiling and publish it if it's a perfect match.
However, if you do not deploy using Remix, chances are you didn't upload the source code to IPFS. We can still verify it, we won't be able to confirm if it's a perfect match, that is code and comments.
To verify a smart contract you just need to execute the following command:
1
curl -X POST -H 'Content-type: application/json' -d '$BODY' https://avascan.info/api/v1/verify-contract
Copied!
Where$BODY is:
1
{
2
// contract address that must be verified
3
"address": "0x...",
4
5
"solc": {
6
7
// version of solc compiler
8
"version": "v0.8.7+commit.e28d00a7",
9
10
// we use a subset of solc compiler options
11
// https://docs.soliditylang.org/en/v0.8.7/using-the-compiler.html#input-description
12
"options": {
13
14
"language":"Solidity",
15
16
"sources": {
17
"HelloWorld.sol": {
18
"content": "pragma solidity ^0.8.7; contract HelloWorld { ..."
19
}
20
},
21
"settings": {
22
"outputSelection": {
23
"HelloWorld.sol": {
24
"HelloWorld": [
25
"*"
26
]
27
}
28
},
29
"optimizer": {
30
"enabled": true,
31
"runs": 200
32
}
33
}
34
}
35
}
36
37
}
Copied!
We currently don't support the Vyper programming language.
Last modified 16d ago
Copy link