Contracts
Get Contract ABI for Verified contract source code
Returns the contract ABI for the verified contract source code.
GET https://testnetapi.metadium.com/v1/contracts/{contract_hash}/abi
api-key: Your API KeyQuery Parameters
Parameter
Description
contract_hash
type: String
value: Address of contract
required: true
//Response Sample Result
{
"status": "200",
"message": "success",
"results": {
"data": [
{
"name": "withdraw",
"type": "function",
"inputs": [
{
"name": "value",
"type": "uint256"
}
],
"outputs": [
{
"name": "",
"type": "bool"
}
],
"payable": false,
"constant": false,
"stateMutability": "nonpayable"
},
...
]
}
}Get Contract Source Code for Verified Contract Source Code
Returns the contract source code for the verified contract source code.
GET https://testnetapi.metadium.com/v1/contracts/0x9afffe2525f25515c127c42ca18dacc5b331995a/code
api-key: Your API KeyQuery Parameters
Parameter
Description
contract_hash
type: String
value: Address of contract
required: true
//Response Sample Result
{
"status": "200",
"message": "success",
"results": {
"data": {
"address": "0x9afffe2525f25515c127c42ca18dacc5b331995a",
"logo": null,
"compiler": "v0.5.2+commit.1df8f40c",
"libraries": "[]",
"verify_date": "2019-03-19T07:39:19Z",
"contract_name": "MetaCoin",
"runs_optimizer": "200",
"optimization_enabled": "0",
"contract_code": "0x60806040526 ...,
"contract_abi": [
{
"name": "allowance",
"type": "function",
"inputs": [
{
"name": "owner",
"type": "address"
},
{
"name": "spender",
"type": "address"
}
],
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"constant": true,
"stateMutability": "view"
}
],
"contract_source": "pragma solidity ^0.5.2; ...,
"constructor_arguments": "",
"swam_source": "bzzr://cb0f24b7c4ce26be17e04ba507a83092072124a305bb7b18926e5eb7b78f73a70029",
"verify_status": "1",
"verify_message": null
}
}
}Verify Contract Source Code
Returns verification results for contract source code.
Query Parameters
Parameter
Description
contract_hash
type: String
value: Address of contract
required: true
contract_name
type: String
value: Name of contract
required: true
compiler
type: String
value: Solidity compiler version
required: true
runs_optimizer
type: Integer
value: Value of time which running optimizer
required: true
optimization_enabled
type: Integer
value: Identify if optimization is enable or not (1: enable, Other number: not)
required: true
contract_source
type: String
value: Solidity contract code(base64 encoding)
required: true
constructor_arguments
type: String
value: Arguments of constructor
required: true
evm_version
type: String
value: Evm version used when compiling
required: false
libraries
type: List<Object>
value: Library list used for the contract
required: false
Last updated