Contracts

Etherscan-compatible endpoints for the Contracts module.

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.

GET
https://api.routescan.io/v2/network/mainnet/evm/1/etherscan/api?module=contract&action=getcontractcreation&contractaddresses=0xB83c27805aAcA5C7082eB45C868d955Cf04C337F%2C0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45%2C0xe4462eb568E2DFbb5b0cA2D3DbB1A35C9Aa98aad%2C0xdAC17F958D2ee523a2206206994597C13D831ec7%2C0xf5b969064b91869fBF676ecAbcCd1c5563F591d0&apikey=YourApiKeyToken
1curl 'https://api.routescan.io/v2/network/mainnet/evm/1/etherscan/api?module=contract&action=getcontractcreation&contractaddresses=0xB83c27805aAcA5C7082eB45C868d955Cf04C337F%2C0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45%2C0xe4462eb568E2DFbb5b0cA2D3DbB1A35C9Aa98aad%2C0xdAC17F958D2ee523a2206206994597C13D831ec7%2C0xf5b969064b91869fBF676ecAbcCd1c5563F591d0' \
2 -H 'apikey: YourApiKeyToken'
1{
2 status: string;
3 message: string;
4 result: {
5 contractAddress: string;
6 contractCreator: string;
7 txHash: string;
8 contractFactory: string;
9 }[];
10}

Get Contract ABI for Verified Contract Source Codes

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

GET
https://api.routescan.io/v2/network/mainnet/evm/1/etherscan/api?module=contract&action=getabi&address=0x9702230A8Ea53601f5cD2dc00fDBc13d4dF4A8c7&apikey=YourApiKeyToken
1curl 'https://api.routescan.io/v2/network/mainnet/evm/1/etherscan/api?module=contract&action=getabi&address=0x9702230A8Ea53601f5cD2dc00fDBc13d4dF4A8c7' \
2 -H 'apikey: YourApiKeyToken'
1{
2 status: string;
3 message: string;
4 result: string;
5}

Get Contract Source Code for Verified Contract Source Codes

Returns the Solidity source code of a verified smart contract.

GET
https://api.routescan.io/v2/network/mainnet/evm/1/etherscan/api?module=contract&action=getsourcecode&address=0x9702230A8Ea53601f5cD2dc00fDBc13d4dF4A8c7&apikey=YourApiKeyToken
1curl 'https://api.routescan.io/v2/network/mainnet/evm/1/etherscan/api?module=contract&action=getsourcecode&address=0x9702230A8Ea53601f5cD2dc00fDBc13d4dF4A8c7' \
2 -H 'apikey: YourApiKeyToken'
1{
2 status: string;
3 message: string;
4 result: {
5 SourceCode: string;
6 ABI: string;
7 ContractName: string;
8 CompilerVersion: string;
9 OptimizationUsed: string;
10 Runs: string;
11 ConstructorArguments: string;
12 EVMVersion: string;
13 Library: string;
14 LicenseType: string;
15 Proxy: string;
16 Implementation: string;
17 SwarmSource: string;
18 }[];
19}

Verify Source Code

POST
https://api.routescan.io/v2/network/mainnet/evm/1/etherscan/api?module=contract&action=verifysourcecode&contractaddress=0x2A1D1C87d18dd13d7a1e91A42C9fFEc486EB6433&sourceCode=%2F%2F%20SPDX-License-Identifier%3A%20MIT%0A%2F%2F%20compiler%20version%20must%20be%20greater%20than%20or%20equal%20to%200.8.10%20and%20less%20than%200.9.0%0Apragma%20solidity%20%5E0.8.10%3B%0Acontract%20HelloWorld%20%7B%0A%20%20%20%20string%20public%20greet%20%3D%20%22Hello%20World!%22%3B%0A%7D&constructorArguments=0xfce353f66162630000000000000000000000000&codeformat=solidity-single-file&contractname=HelloWorld&compilerversion=v0.8.10%2Bcommit.fc410830&evmversion=shangai&optimizationUsed=0&runs=200&licenseType=1&apikey=YourApiKeyToken
1curl -X POST 'https://api.routescan.io/v2/network/mainnet/evm/1/etherscan/api?module=contract&action=verifysourcecode&contractaddress=0x2A1D1C87d18dd13d7a1e91A42C9fFEc486EB6433&sourceCode=%2F%2F%20SPDX-License-Identifier%3A%20MIT%0A%2F%2F%20compiler%20version%20must%20be%20greater%20than%20or%20equal%20to%200.8.10%20and%20less%20than%200.9.0%0Apragma%20solidity%20%5E0.8.10%3B%0Acontract%20HelloWorld%20%7B%0A%20%20%20%20string%20public%20greet%20%3D%20%22Hello%20World!%22%3B%0A%7D&constructorArguments=0xfce353f66162630000000000000000000000000&codeformat=solidity-single-file&contractname=HelloWorld&compilerversion=v0.8.10%2Bcommit.fc410830&evmversion=shangai&optimizationUsed=0&runs=200&licenseType=1' \
2 -H 'apikey: YourApiKeyToken' \
3 -H 'content-type: application/json' \
4 -d '{}'

Check Source Code Verification Submission Status

GET
https://api.routescan.io/v2/network/mainnet/evm/1/etherscan/api?module=contract&action=checkverifystatus&guid=ezq878u486pzijkvvmerl6a9mzwhv6sefgvqi5tkwceejc7tvn&apikey=YourApiKeyToken
1curl 'https://api.routescan.io/v2/network/mainnet/evm/1/etherscan/api?module=contract&action=checkverifystatus&guid=ezq878u486pzijkvvmerl6a9mzwhv6sefgvqi5tkwceejc7tvn' \
2 -H 'apikey: YourApiKeyToken'
Questions? Contact us