Contracts

Get Contract ABI for Verified Contract Source Codes

Returns the Contract Application Binary Interface ( ABI ) of a verified smart contract.

https://api.etherscan.io/v2/api
   ?chainid=1
   &module=contract
   &action=getabi
   &address=0xBB9bc244D798123fDe783fCc1C72d3Bb8C189413
   &apikey=YourApiKeyToken

Query Parameters

Get Contract Source Code for Verified Contract Source Codes

Returns the Solidity source code of a verified smart contract.

https://api.etherscan.io/v2/api
   ?chainid=1
   &module=contract
   &action=getsourcecode
   &address=0xBB9bc244D798123fDe783fCc1C72d3Bb8C189413
   &apikey=YourApiKeyToken 

Query Parameters

Get Contract Creator and Creation Tx Hash

Returns a contract's deployer address and transaction hash it was created, up to 5 at a time.

https://api.etherscan.io/v2/api
   ?chainid=1
   &module=contract
   &action=getcontractcreation
   &contractaddresses=0xB83c27805aAcA5C7082eB45C868d955Cf04C337F,0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45,0xe4462eb568E2DFbb5b0cA2D3DbB1A35C9Aa98aad,0xdAC17F958D2ee523a2206206994597C13D831ec7,0xf5b969064b91869fBF676ecAbcCd1c5563F591d0
   &apikey=YourApiKeyToken 

Query Parameters

Verify Source Code

Submits a contract source code to an Etherscan-like explorer for verification.

https://api.etherscan.io/v2/api
   ?chainid=1
   &module=contract
   &action=verifysourcecode
   &apikey=YourApiKeyToken 

Query Parameters

Requests must be sent using HTTP POST

Check Source Code Verification Status

Returns the success or error status of a contract verification request.

https://api.etherscan.io/v2/api
   ?chainid=1
   &module=contract
   &action=checkverifystatus
   &guid=x3ryqcqr1zdknhfhkimqmizlcqpxncqc6nrvp3pgrcpfsqedqi
   &apikey=YourApiKeyToken 

Query Parameters

Verify Proxy Contract

Submits a proxy contract source code to Etherscan for verification.

  1. Requires a valid Etherscan API key, it will be rejected otherwise

  2. Current daily limit of 100 submissions per day per user (subject to change)

  3. Only supports HTTP post

  4. Upon successful submission you will receive a GUID (50 characters) as a receipt

  5. You may use this GUID to track the status of your submission

  6. Verified proxy contracts will display the "Read/Write as Proxy" of the implementation contract under the contract address's contract tab

Verifying Proxy Contract using cURL

// example with only the mandatory contract address parameter
curl -d "address=0xcbdcd3815b5f975e1a2c944a9b2cd1c985a1cb7f" "https://api.etherscan.io/v2/api?chainid=1&module=contract&action=verifyproxycontract&apikey=YourApiKeyToken"

// example using the expectedimplementation optional parameter
// the expectedimplementation enforces a check to ensure the returned implementation contract address == address picked up by the verifier
curl -d "address=0xbc46363a7669f6e12353fa95bb067aead3675c29&expectedimplementation=0xe45a5176bc0f2c1198e2451c4e4501d4ed9b65a6" "https://api.etherscan.io/v2/api?chainid=1&module=contract&action=verifyproxycontract&apikey=YourApiKeyToken"

Checking Proxy Contract Verification Submission Status using cURL

curl "https://api.etherscan.io/v2/api?chainid=1&module=contract&action=checkproxyverification&guid=gwgrrnfy56zf6vc1fljuejwg6pelnc5yns6fg6y2i6zfpgzquz&apikey=YourApiKeyToken"

Last updated