WEMIX3.0
Search…
Contract APIs

GET /contracts/{address_hash}/abi

  • HEADER
key
value
required
api-key
api-key
true
  • PATH VARIABLE
key
type
value
required
address_hash
String
contract address
true

GET https://microscopeapi.test.wemix.com/contracts/0xeDe8484e396d3B4c754a579Df1Dab24f67f591CC/abi
api-key: 1ba5e446edf1997f67b51bf9e60b3fbba6fa1bf84301115292805d7e24f43539

key
type
value
status
String
Status of request
message
String
Response Message of request
results
Object
Result of request
results.data
Json
Contract abi

{
"status": "200",
"message": "success",
"results": {
"data": [
{
"name": "checkHash",
"type": "function",
"inputs": [],
"outputs": [
{
"name": "",
"type": "bool",
"internalType": "bool"
}
],
"stateMutability": "view"
},
{
"name": "expectedHash",
"type": "function",
"inputs": [],
"outputs": [
{
"name": "",
"type": "bytes20",
"internalType": "bytes20"
}
],
"stateMutability": "view"
}
]
}
}

GET /contracts/{address_hash}/code

  • HEADER
key
value
required
api-key
api-key
true

GET https://microscopeapi.test.wemix.com/contracts/0xeDe8484e396d3B4c754a579Df1Dab24f67f591CC/code
api-key: 1ba5e446edf1997f67b51bf9e60b3fbba6fa1bf84301115292805d7e24f43539

key
type
value
status
String
Status of request
message
String
Response Message of request
results
Json
Results of request
results.data
List<Object>
List of data
results.data.address
String
Contract address
results.data.logo
String
Logo set during contract code verification
results.data.compiler
String
Solidity compiler version
results.data.libraries
String
Libraries List
results.data.verify_data
String
Contract code validation date
results.data.contract_name
String
Name of contract
results.data.runs_optimizer
String
Value of time which running optimizer
results.optimization_enabled
String
Identify if optimization is enable or not - 1: enable - Other number: not
results.data.contract_code
String
Contract code deployed on the network
results.date.contract_abi
Json
Abi of contract
results.data.contract_source
String
Solidity contract code
constructor_arguments
String
Arguments of constructor
reuslts.data.swam_source
String
Address of swarm source
reuslts.data.verify_status
String
Contract code verify status
reuslts.data.verify_message
String
Message written during contract code verification

{
"status": "200",
"message": "success",
"results": {
"data": {
"address": "0xeDe8484e396d3B4c754a579Df1Dab24f67f591CC",
"logo": null,
"compiler": "0.8.10+commit.fc410830",
"libraries": "[]",
"verify_date": "2022-08-02T08:11:59Z",
"contract_name": "Ripmd160",
"runs_optimizer": "200",
"optimization_enabled": "0",
"contract_code": "0x608060405234801561001057600080fd5b5060043610610053576000357c01000000000000000000000000000000000000000000000000000000009004806319483cd114610058578063e3fcd53814610076575b600080fd5b610060610094565b60405161006d919061019f565b60405180910390f35b61007e6100dd565b60405161008b91906101f5565b60405180910390f35b60008060009054906101000a90046c01000000000000000000000000026bffffffffffffffffffffffff19166100c86100fa565b6bffffffffffffffffffffffff191614905090565b60008054906101000a90046c010000000000000000000000000281565b6000806040518060400160405280600c81526020017f48656c6c6f20576f726c6421000000000000000000000000000000000000000081525090506000600382604051610147919061028a565b602060405180830381855afa158015610164573d6000803e3d6000fd5b505050604051516c01000000000000000000000000029050809250505090565b60008115159050919050565b61019981610184565b82525050565b60006020820190506101b46000830184610190565b92915050565b60007fffffffffffffffffffffffffffffffffffffffff00000000000000000000000082169050919050565b6101ef816101ba565b82525050565b600060208201905061020a60008301846101e6565b92915050565b600081519050919050565b600081905092915050565b60005b83811015610244578082015181840152602081019050610229565b83811115610253576000848401525b50505050565b600061026482610210565b61026e818561021b565b935061027e818560208601610226565b80840191505092915050565b60006102968284610259565b91508190509291505056fea26469706673582212207b8c608c26ea447c06f769a01d49e82cac27ff2f11e62d6b46fd7c986c6645ae64736f6c634300080a0033",
"contract_abi": [
{
"name": "checkHash",
"type": "function",
"inputs": [],
"outputs": [
{
"name": "",
"type": "bool",
"internalType": "bool"
}
],
"stateMutability": "view"
},
{
"name": "expectedHash",
"type": "function",
"inputs": [],
"outputs": [
{
"name": "",
"type": "bytes20",
"internalType": "bytes20"
}
],
"stateMutability": "view"
}
],
"contract_source": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.10;\n\ncontract Ripmd160 {\n bytes20 public expectedHash = hex'8476ee4631b9b30ac2754b0ee0c47e161d3f724c';\n\n function calculateHash() internal pure returns (bytes20) {\n string memory word = 'Hello World!';\n bytes20 hash = ripemd160(bytes (word));\n\n return hash;\n }\n\n function checkHash() public view returns(bool) {\n return (calculateHash() == expectedHash);\n }\n}",
"constructor_arguments": "",
"swam_source": "bzz-raw://12207b8c608c26ea447c06f769a01d49e82cac27ff2f11e62d6b46fd7c986c6645ae",
"verify_status": "1",
"verify_message": null
}
}
}

POST /contracts/{address_hash}/verify

  • HEADER
key
value
required
api-key
api-key
true
  • BODY(application/json)
key
type
value
contract_name
String
Name of contract
compiler
String
Solidity compiler version
runs_optimizer
Integer
Value of time which running optimizer
optimization_enabled
Integer
Identify if optimization is enable or not - 1: enable - Other number: not
contract_source
String
Solidity contract code(base64 encoding)
constructor_arguments
String
Arguments of constructor
libraries
List<Object>
Library list used for the contract

POST https://microscopeapi.test.wemix.com/contracts/{address_hash}/verify
api-key: 1ba5e446edf1997f67b51bf9e60b3fbba6fa1bf84301115292805d7e24f43539
Content-Type: application/json
{
"contract_name": "VEN",
"compiler": "0.4.11",
"runs_optimizer": 200,
"optimization_enabled": 1,
"contract_source": "cHJhZ21hIHNvbGlkaXR5IF4wLjQuMTE7Cgpjb250cmFjdCBPd25lZCB7CgogICAgYWRkcmVzcyBwdWJsaWMgb3duZXI7CgogICAgZnVuY3Rpb24gT3duZWQoKSB7CiAgICAgICAgb3duZXIgPSBtc2cuc2VuZGVyOwogICAgf\nQoKICAgIG1vZGlmaWVyIG9ubHlPd25lcigpIHsKICAgICAgICByZXF1aXJlKG1zZy5zZW5kZXIgPT0gb3duZXIpOwogICAgICAgIF87CiAgICB9CgogICAgZnVuY3Rpb24gc2V0T3duZXIoYWRkcmVzcyBfbmV3T3duZXIpIG9ubHlPd25lciB7CiAgIC\nAgICAgb3duZXIgPSBfbmV3T3duZXI7CiAgICB9Cn0KCi8qKgogKiBAdGl0bGUgU2FmZU1hdGgKICogQGRldiBNYXRoIG9wZXJhdGlvbnMgd2l0aCBzYWZldHkgY2hlY2tzIHRoYXQgdGhyb3cgb24gZXJyb3IKICovCmxpYnJhcnkgU2FmZU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ZCBiYWNrIGV0aGVyIHNlbnQgdG8gbWUKICAgIGZ1bmN0aW9uICgpIHsKICAgICAgICByZXZlcnQoKTsKICAgIH0KCiAgICAvLyBJZiBzZWFsZWQsIHRyYW5zZmVyIGlzIGVuYWJsZW\nQgYW5kIG1pbnQgaXMgZGlzYWJsZWQKICAgIGZ1bmN0aW9uIGlzU2VhbGVkKCkgY29uc3RhbnQgcmV0dXJucyAoYm9vbCkgewogICAgICAgIHJldHVybiBvd25lciA9PSAwOwogICAgfQoKICAgIGZ1bmN0aW9uIGxhc3RNaW50ZWRUaW1lc3RhbXAoYWR\nkcmVzcyBfb3duZXIpIGNvbnN0YW50IHJldHVybnModWludDMyKSB7CiAgICAgICAgcmV0dXJuIGFjY291bnRzW19vd25lcl0ubGFzdE1pbnRlZFRpbWVzdGFtcDsKICAgIH0KCiAgICAvLyBDbGFpbSBib251cyBieSByYXcgdG9rZW5zCiAgICBmdW5j\ndGlvbiBjbGFpbUJvbnVzKGFkZHJlc3MgX293bmVyKSBpbnRlcm5hbHsgICAgICAKICAgICAgICByZXF1aXJlKGlzU2VhbGVkKCkpOwogICAgICAgIGlmIChhY2NvdW50c1tfb3duZXJdLnJhd1Rva2VucyAhPSAwKSB7CiAgICAgICAgICAgIHVpbnQyN\nTYgcmVhbEJhbGFuY2UgPSBiYWxhbmNlT2YoX293bmVyKTsKICAgICAgICAgICAgdWludDI1NiBib251cyA9IHJlYWxCYWxhbmNlCiAgICAgICAgICAgICAgICAuc3ViKGFjY291bnRzW19vd25lcl0uYmFsYW5jZSkKICAgICAgICAgICAgICAgIC5zdW\nIoYWNjb3VudHNbX293bmVyXS5yYXdUb2tlbnMpOwoKICAgICAgICAgICAgYWNjb3VudHNbX293bmVyXS5iYWxhbmNlID0gcmVhbEJhbGFuY2UudG9VSU5UMTEyKCk7CiAgICAgICAgICAgIGFjY291bnRzW19vd25lcl0ucmF3VG9rZW5zID0gMDsKICA\ngICAgICAgICAgaWYoYm9udXMgPiAwKXsKICAgICAgICAgICAgICAgIFRyYW5zZmVyKHRoaXMsIF9vd25lciwgYm9udXMpOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgfQoKICAgIC8vIFdoYXQgaXMgdGhlIGJhbGFuY2Ugb2YgYSBwYXJ0aWN1\nbGFyIGFjY291bnQ/CiAgICBmdW5jdGlvbiBiYWxhbmNlT2YoYWRkcmVzcyBfb3duZXIpIGNvbnN0YW50IHJldHVybnMgKHVpbnQyNTYgYmFsYW5jZSkgewogICAgICAgIGlmIChhY2NvdW50c1tfb3duZXJdLnJhd1Rva2VucyA9PSAwKQogICAgICAgI\nCAgICByZXR1cm4gYWNjb3VudHNbX293bmVyXS5iYWxhbmNlOwoKICAgICAgICBpZiAoYm9udXNPZmZlcmVkID4gMCkgewogICAgICAgICAgICB1aW50MjU2IGJvbnVzID0gYm9udXNPZmZlcmVkCiAgICAgICAgICAgICAgICAgLm11bChhY2NvdW50c1\ntfb3duZXJdLnJhd1Rva2VucykKICAgICAgICAgICAgICAgICAuZGl2KHN1cHBsaWVzLnJhd1Rva2Vucyk7CgogICAgICAgICAgICByZXR1cm4gYm9udXMuYWRkKGFjY291bnRzW19vd25lcl0uYmFsYW5jZSkKICAgICAgICAgICAgICAgICAgICAuYWR\nkKGFjY291bnRzW19vd25lcl0ucmF3VG9rZW5zKTsKICAgICAgICB9CiAgICAgICAgCiAgICAgICAgcmV0dXJuIHVpbnQyNTYoYWNjb3VudHNbX293bmVyXS5iYWxhbmNlKQogICAgICAgICAgICAuYWRkKGFjY291bnRzW19vd25lcl0ucmF3VG9rZW5z\nKTsKICAgIH0KCiAgICAvLyBUcmFuc2ZlciB0aGUgYmFsYW5jZSBmcm9tIG93bmVyJ3MgYWNjb3VudCB0byBhbm90aGVyIGFjY291bnQKICAgIGZ1bmN0aW9uIHRyYW5zZmVyKGFkZHJlc3MgX3RvLCB1aW50MjU2IF9hbW91bnQpIHJldHVybnMgKGJvb\n2wgc3VjY2VzcykgewogICAgICAgIHJlcXVpcmUoaXN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gICAgICAgcmV0dXJuIGFsbG93ZWRbX293bmVyXVtfc3BlbmRlcl07CiAgICB9CgogICAgLy8gTWludCB0b2tlbnMgYW5kIGFzc2lnbiB0byBzb21lIG9uZQogICAgZnVuY3Rpb24gbWlud\nChhZGRyZXNzIF9vd25lciwgdWludDI1NiBfYW1vdW50LCBib29sIF9pc1JhdywgdWludDMyIHRpbWVzdGFtcCkgb25seU93bmVyewogICAgICAgIGlmIChfaXNSYXcpIHsKICAgICAgICAgICAgYWNjb3VudHNbX293bmVyXS5yYXdUb2tlbnMgPSBfYW\n1vdW50LmFkZChhY2NvdW50c1tfb3duZXJdLnJhd1Rva2VucykudG9VSU5UMTEyKCk7CiAgICAgICAgICAgIHN1cHBsaWVzLnJhd1Rva2VucyA9IF9hbW91bnQuYWRkKHN1cHBsaWVzLnJhd1Rva2VucykudG9VSU5UMTI4KCk7CiAgICAgICAgfSBlbHN\nlIHsKICAgICAgICAgICAgYWNjb3VudHNbX293bmVyXS5iYWxhbmNlID0gX2Ftb3VudC5hZGQoYWNjb3VudHNbX293bmVyXS5iYWxhbmNlKS50b1VJTlQxMTIoKTsKICAgICAgICB9CgogICAgICAgIGFjY291bnRzW19vd25lcl0ubGFzdE1pbnRlZFRp\nbWVzdGFtcCA9IHRpbWVzdGFtcDsKCiAgICAgICAgc3VwcGxpZXMudG90YWwgPSBfYW1vdW50LmFkZChzdXBwbGllcy50b3RhbCkudG9VSU5UMTI4KCk7CiAgICAgICAgVHJhbnNmZXIoMCwgX293bmVyLCBfYW1vdW50KTsKICAgIH0KICAgIAogICAgL\ny8gT2ZmZXIgYm9udXMgdG8gcmF3IHRva2VucyBob2xkZXIKICAgIGZ1bmN0aW9uIG9mZmVyQm9udXModWludDI1NiBfYm9udXMpIG9ubHlPd25lciB7IAogICAgICAgIGJvbnVzT2ZmZXJlZCA9IGJvbnVzT2ZmZXJlZC5hZGQoX2JvbnVzKTsKICAgIC\nAgICBzdXBwbGllcy50b3RhbCA9IF9ib251cy5hZGQ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VSYXRlKCkgY29uc3RhbnQgcmV0dXJucyAodWludDI1Nil7CiAgICAgICAgaWYgKHN0YWdlKCkgPT0gU3RhZ2UuRWFybHkpIHsKICAgICAgIC\nAgICAgcmV0dXJuIHZlblBlckV0aEVhcmx5U3RhZ2U7CiAgICAgICAgfQogICAgICAgIGlmIChzdGFnZSgpID09IFN0YWdlLk5vcm1hbCkgewogICAgICAgICAgICByZXR1cm4gdmVuUGVyRXRoOwogICAgICAgIH0KICAgICAgICByZXR1cm4gMDsKICA\ngIH0KCiAgICAvLy8gQG5vdGljZSBmb3IgdGVzdCBwdXJwb3NlCiAgICBmdW5jdGlvbiBibG9ja1RpbWUoKSBjb25zdGFudCByZXR1cm5zICh1aW50MzIpIHsKICAgICAgICByZXR1cm4gdWludDMyKGJsb2NrLnRpbWVzdGFtcCk7CiAgICB9CgogICAg\nLy8vIEBub3RpY2UgZXN0aW1hdGUgc3RhZ2UKICAgIC8vLyBAcmV0dXJuIGN1cnJlbnQgc3RhZ2UKICAgIGZ1bmN0aW9uIHN0YWdlKCkgY29uc3RhbnQgcmV0dXJucyAoU3RhZ2UpIHsgCiAgICAgICAgaWYgKGZpbmFsaXplZCkgewogICAgICAgICAgI\nCByZXR1cm4gU3RhZ2UuRmluYWxpemVkOwogICAgICAgIH0KCiAgICAgICAgaWYgKCFpbml0aWFsaXplZCkgewogICAgICAgICAgICAvLyBkZXBsb3llZCBidXQgbm90IGluaXRpYWxpemVkCiAgICAgICAgICAgIHJldHVybiBTdGFnZS5DcmVhdGVkOw\nogICAgICAgIH0KCiAgICAgICAgaWYgKGJsb2NrVGltZSgpIDwgc3RhcnRUaW1lKSB7CiAgICAgICAgICAgIC8vIG5vdCBzdGFydGVkIHlldAogICAgICAgICAgICByZXR1cm4gU3RhZ2UuSW5pdGlhbGl6ZWQ7CiAgICAgICAgfQoKICAgICAgICBpZiA\nodWludDI1Nihzb2xkT3V0Lm9mZmljaWFsKS5hZGQoc29sZE91dC5jaGFubmVscykgPj0gcHVibGljU3VwcGx5KSB7CiAgICAgICAgICAgIC8vIGFsbCBzb2xkIG91dAogICAgICAgICAgICByZXR1cm4gU3RhZ2UuQ2xvc2VkOwogICAgICAgIH0KCiAg\nICAgICAgaWYgKGJsb2NrVGltZSgpIDwgZW5kVGltZSkgewogICAgICAgICAgICAvLyBpbiBzYWxlICAgICAgICAgICAgCiAgICAgICAgICAgIGlmIChibG9ja1RpbWUoKSA8IHN0YXJ0VGltZS5hZGQoZWFybHlTdGFnZUxhc3RzKSkgewogICAgICAgI\nCAgICAgICAgLy8gZWFybHkgYmlyZCBzdGFnZQogICAgICAgICAgICAgICAgcmV0dXJuIFN0YWdlLkVhcmx5OwogICAgICAgICAgICB9CiAgICAgICAgICAgIC8vIG5vcm1hbCBzdGFnZQogICAgICAgICAgICByZXR1cm4gU3RhZ2UuTm9ybWFsOwogIC\nAgICAgIH0KCiAgICAgICAgLy8gY2xvc2VkCiAgICAgICAgcmV0dXJuIFN0YWdlLkNsb3NlZDsKICAgIH0KCiAgICBmdW5jdGlvbiBpc0NvbnRyYWN0KGFkZHJlc3MgX2FkZHIpIGNvbnN0YW50IGludGVybmFsIHJldHVybnMoYm9vbCkgewogICAgICA\ngIHVpbnQgc2l6ZTsKICAgICAgICBpZiAoX2FkZHIgPT0gMCkgcmV0dXJuIGZhbHNlOwogICAgICAgIGFzc2VtYmx5IHsKICAgICAgICAgICAgc2l6ZSA6PSBleHRjb2Rlc2l6ZShfYWRkcikKICAgICAgICB9CiAgICAgICAgcmV0dXJuIHNpemUgPiAw\nOwogICAgfQoKICAgIC8vLyBAbm90aWNlIGVudHJ5IHRvIGJ1eSB0b2tlbnMKICAgIGZ1bmN0aW9uICgpIHBheWFibGUgeyAgICAgICAgCiAgICAgICAgYnV5KCk7CiAgICB9CgogICAgLy8vIEBub3RpY2UgZW50cnkgdG8gYnV5IHRva2VucwogICAgZ\nnVuY3Rpb24gYnV5KCkgcGF5YWJsZSB7CiAgICAgICAgLy8gcmVqZWN0IGNvbnR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=",
"constructor_arguments": "",
"libraries": [
{
"name": "VeChain",
"address": "0x42D1427DC4Dbb4D0Db4e80Db826B5D5EbEbC6bdA"
}
]
}

key
type
value
status
String
Status of request
message
String
Response Message of request
results
Json
Result of request
results.data
Json
Result of verification process - 0: Failed - 1: Success
RESPONSE SAMPLE
{
"status": "200",
"message": "success",
"results": {
"data": "1"
}
}
Copy link
On this page
Get Contract ABI for Verified contract source code
Get contract source code for verified contract source code
Verify contract source code