Contract APIs
Get Contract ABI for Verified contract source code
URI
network
uri
Mainnet
GET https://explorerapi.wemix.com/v1/contracts/{contract_address}/abi
Testnet
GET https://explorerapi.test.wemix.com/v1/contracts/{contract_address}/abi
REQUEST PARAMETER
HEADER
key
value
required
api-key
api-key
true
PATH VARIABLE
key
type
value
required
contract_address
String
Verified contract address
true
REQUEST SAMPLE
GET https://explorerapi.wemix.com/v1/contracts/0xB4EF146F31Bd7e680707658a9772D0cfD35c8df4/abi
api-key: 1ba5e446edf1997f67b51bf9e60b3fbba6fa1bf84301115292805d7e24f43539
RESPONSE PARAMETER
key
type
value
status
String
Status of request
message
String
Response Message of request
results
Object
Result of request
results.data
Json
Contract abi
results.data.name
String
Name of contract
results.data.type
String
Type of contract
results.data.inputs
String
Array of contract objects
results.data.inputs.name
String
Name of parameter
results.data.inputs.type
String
Type of parameter
results.data.inputs.internalType
String
Internal type of parameter
results.data.outputs
String
Array similar to inputs
results.data.stateMutability
String
Blockchain state value
RESPONSE SAMPLE
{
"status": "200",
"message": "success",
"results": {
"data": [
{
"type": "constructor",
"inputs": [
{
"name": "name",
"type": "string",
"internalType": "string"
},
{
"name": "symbol",
"type": "string",
"internalType": "string"
}
],
"stateMutability": "nonpayable"
},
{
"name": "Approval",
"type": "event",
"inputs": [
{
"name": "owner",
"type": "address",
"indexed": true,
"internalType": "address"
},
{
"name": "spender",
"type": "address",
"indexed": true,
"internalType": "address"
},
{
"name": "value",
"type": "uint256",
"indexed": false,
"internalType": "uint256"
}
],
"anonymous": false
},
{
"name": "Transfer",
"type": "event",
"inputs": [
{
"name": "from",
"type": "address",
"indexed": true,
"internalType": "address"
},
{
"name": "to",
"type": "address",
"indexed": true,
"internalType": "address"
},
{
"name": "value",
"type": "uint256",
"indexed": false,
"internalType": "uint256"
}
],
"anonymous": false
},
{
"name": "allowance",
"type": "function",
"inputs": [
{
"name": "owner",
"type": "address",
"internalType": "address"
},
{
"name": "spender",
"type": "address",
"internalType": "address"
}
],
"outputs": [
{
"name": "",
"type": "uint256",
"internalType": "uint256"
}
],
"stateMutability": "view"
},
{
"name": "approve",
"type": "function",
"inputs": [
{
"name": "spender",
"type": "address",
"internalType": "address"
},
{
"name": "amount",
"type": "uint256",
"internalType": "uint256"
}
],
"outputs": [
{
"name": "",
"type": "bool",
"internalType": "bool"
}
],
"stateMutability": "nonpayable"
},
{
"name": "balanceOf",
"type": "function",
"inputs": [
{
"name": "account",
"type": "address",
"internalType": "address"
}
],
"outputs": [
{
"name": "",
"type": "uint256",
"internalType": "uint256"
}
],
"stateMutability": "view"
},
{
"name": "burn",
"type": "function",
"inputs": [
{
"name": "account",
"type": "address",
"internalType": "address"
},
{
"name": "amount",
"type": "uint256",
"internalType": "uint256"
}
],
"outputs": [
{
"name": "",
"type": "bool",
"internalType": "bool"
}
],
"stateMutability": "nonpayable"
},
{
"name": "decimals",
"type": "function",
"inputs": [],
"outputs": [
{
"name": "",
"type": "uint8",
"internalType": "uint8"
}
],
"stateMutability": "view"
},
{
"name": "decreaseAllowance",
"type": "function",
"inputs": [
{
"name": "spender",
"type": "address",
"internalType": "address"
},
{
"name": "subtractedValue",
"type": "uint256",
"internalType": "uint256"
}
],
"outputs": [
{
"name": "",
"type": "bool",
"internalType": "bool"
}
],
"stateMutability": "nonpayable"
},
{
"name": "increaseAllowance",
"type": "function",
"inputs": [
{
"name": "spender",
"type": "address",
"internalType": "address"
},
{
"name": "addedValue",
"type": "uint256",
"internalType": "uint256"
}
],
"outputs": [
{
"name": "",
"type": "bool",
"internalType": "bool"
}
],
"stateMutability": "nonpayable"
},
{
"name": "name",
"type": "function",
"inputs": [],
"outputs": [
{
"name": "",
"type": "string",
"internalType": "string"
}
],
"stateMutability": "view"
},
{
"name": "symbol",
"type": "function",
"inputs": [],
"outputs": [
{
"name": "",
"type": "string",
"internalType": "string"
}
],
"stateMutability": "view"
},
{
"name": "totalSupply",
"type": "function",
"inputs": [],
"outputs": [
{
"name": "",
"type": "uint256",
"internalType": "uint256"
}
],
"stateMutability": "view"
},
{
"name": "transfer",
"type": "function",
"inputs": [
{
"name": "to",
"type": "address",
"internalType": "address"
},
{
"name": "amount",
"type": "uint256",
"internalType": "uint256"
}
],
"outputs": [
{
"name": "",
"type": "bool",
"internalType": "bool"
}
],
"stateMutability": "nonpayable"
},
{
"name": "transferFrom",
"type": "function",
"inputs": [
{
"name": "from",
"type": "address",
"internalType": "address"
},
{
"name": "to",
"type": "address",
"internalType": "address"
},
{
"name": "amount",
"type": "uint256",
"internalType": "uint256"
}
],
"outputs": [
{
"name": "",
"type": "bool",
"internalType": "bool"
}
],
"stateMutability": "nonpayable"
}
]
}
}
Get contract source code for verified contract source code
URI
network
uri
Mainnet
GET https://explorerapi.wemix.com/v1/contracts/{contract_address}/code
Testnet
GET https://explorerapi.test.wemix.com/v1/contracts/{contract_address}/code
REQUEST PARAMETER
HEADER
key
value
required
api-key
api-key
true
PATH VARIABLE
key
type
value
required
contract_address
String
Verified contract address
true
REQUEST SAMPLE
GET https://explorerapi.wemix.com/v1/contracts/0xB4EF146F31Bd7e680707658a9772D0cfD35c8df4/code
api-key: 1ba5e446edf1997f67b51bf9e60b3fbba6fa1bf84301115292805d7e24f43539
RESPONSE PARAMETER
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
RESPONSE SAMPLE
{
"status": "200",
"message": "success",
"results": {
"data": {
"address": "0xB4EF146F31Bd7e680707658a9772D0cfD35c8df4",
"logo": null,
"compiler": "0.8.10+commit.fc410830",
"libraries": "[]",
"verify_date": "2023-03-09T05:53:24Z",
"contract_name": "MyToken",
"runs_optimizer": "200",
"optimization_enabled": "0",
"contract_code": "0x608060405234801561001057600080fd5b50600436106100b45760003560e01c806370a082311161007157806370a08231146101a357806395d89b41146101d35780639dc29fac146101f1578063a457c2d714610221578063a9059cbb14610251578063dd62ed3e14610281576100b4565b806306fdde03146100b9578063095ea7b3146100d757806318160ddd1461010757806323b872dd14610125578063313ce567146101555780633950935114610173575b600080fd5b6100c16102b1565b6040516100ce9190610d59565b60405180910390f35b6100f160048036038101906100ec9190610e14565b610343565b6040516100fe9190610e6f565b60405180910390f35b61010f610366565b60405161011c9190610e99565b60405180910390f35b61013f600480360381019061013a9190610eb4565b610370565b60405161014c9190610e6f565b60405180910390f35b61015d61039f565b60405161016a9190610f23565b60405180910390f35b61018d60048036038101906101889190610e14565b6103a8565b60405161019a9190610e6f565b60405180910390f35b6101bd60048036038101906101b89190610f3e565b6103df565b6040516101ca9190610e99565b60405180910390f35b6101db610427565b6040516101e89190610d59565b60405180910390f35b61020b60048036038101906102069190610e14565b6104b9565b6040516102189190610e6f565b60405180910390f35b61023b60048036038101906102369190610e14565b6104f0565b6040516102489190610e6f565b60405180910390f35b61026b60048036038101906102669190610e14565b610567565b6040516102789190610e6f565b60405180910390f35b61029b60048036038101906102969190610f6b565b61058a565b6040516102a89190610e99565b60405180910390f35b6060600380546102c090610fda565b80601f01602080910402602001604051908101604052809291908181526020018280546102ec90610fda565b80156103395780601f1061030e57610100808354040283529160200191610339565b820191906000526020600020905b81548152906001019060200180831161031c57829003601f168201915b5050505050905090565b60008061034e610611565b905061035b818585610619565b600191505092915050565b6000600254905090565b60008061037b610611565b90506103888582856107e4565b610393858585610870565b60019150509392505050565b60006012905090565b6000806103b3610611565b90506103d48185856103c5858961058a565b6103cf919061103b565b610619565b600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60606004805461043690610fda565b80601f016020809104026020016040519081016040528092919081815260200182805461046290610fda565b80156104af5780601f10610484576101008083540402835291602001916104af565b820191906000526020600020905b81548152906001019060200180831161049257829003601f168201915b5050505050905090565b60006104e6836104c761039f565b60ff16600a6104d691906111c4565b846104e1919061120f565b610ae8565b6001905092915050565b6000806104fb610611565b90506000610509828661058a565b90508381101561054e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610545906112db565b60405180910390fd5b61055b8286868403610619565b60019250505092915050565b600080610572610611565b905061057f818585610870565b600191505092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610689576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106809061136d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156106f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106f0906113ff565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516107d79190610e99565b60405180910390a3505050565b60006107f0848461058a565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff811461086a578181101561085c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108539061146b565b60405180910390fd5b6108698484848403610619565b5b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156108e0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108d7906114fd565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610950576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109479061158f565b60405180910390fd5b61095b838383610cb6565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050818110156109e1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109d890611621565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610acf9190610e99565b60405180910390a3610ae2848484610cbb565b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610b58576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b4f906116b3565b60405180910390fd5b610b6482600083610cb6565b60008060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015610bea576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610be190611745565b60405180910390fd5b8181036000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081600260008282540392505081905550600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610c9d9190610e99565b60405180910390a3610cb183600084610cbb565b505050565b505050565b505050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610cfa578082015181840152602081019050610cdf565b83811115610d09576000848401525b50505050565b6000601f19601f8301169050919050565b6000610d2b82610cc0565b610d358185610ccb565b9350610d45818560208601610cdc565b610d4e81610d0f565b840191505092915050565b60006020820190508181036000830152610d738184610d20565b905092915050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000610dab82610d80565b9050919050565b610dbb81610da0565b8114610dc657600080fd5b50565b600081359050610dd881610db2565b92915050565b6000819050919050565b610df181610dde565b8114610dfc57600080fd5b50565b600081359050610e0e81610de8565b92915050565b60008060408385031215610e2b57610e2a610d7b565b5b6000610e3985828601610dc9565b9250506020610e4a85828601610dff565b9150509250929050565b60008115159050919050565b610e6981610e54565b82525050565b6000602082019050610e846000830184610e60565b92915050565b610e9381610dde565b82525050565b6000602082019050610eae6000830184610e8a565b92915050565b600080600060608486031215610ecd57610ecc610d7b565b5b6000610edb86828701610dc9565b9350506020610eec86828701610dc9565b9250506040610efd86828701610dff565b9150509250925092565b600060ff82169050919050565b610f1d81610f07565b82525050565b6000602082019050610f386000830184610f14565b92915050565b600060208284031215610f5457610f53610d7b565b5b6000610f6284828501610dc9565b91505092915050565b60008060408385031215610f8257610f81610d7b565b5b6000610f9085828601610dc9565b9250506020610fa185828601610dc9565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680610ff257607f821691505b6020821081141561100657611005610fab565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061104682610dde565b915061105183610dde565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156110865761108561100c565b5b828201905092915050565b60008160011c9050919050565b6000808291508390505b60018511156110e8578086048111156110c4576110c361100c565b5b60018516156110d35780820291505b80810290506110e185611091565b94506110a8565b94509492505050565b60008261110157600190506111bd565b8161110f57600090506111bd565b8160018114611125576002811461112f5761115e565b60019150506111bd565b60ff8411156111415761114061100c565b5b8360020a9150848211156111585761115761100c565b5b506111bd565b5060208310610133831016604e8410600b84101617156111935782820a90508381111561118e5761118d61100c565b5b6111bd565b6111a0848484600161109e565b925090508184048111156111b7576111b661100c565b5b81810290505b9392505050565b60006111cf82610dde565b91506111da83610dde565b92506112077fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff84846110f1565b905092915050565b600061121a82610dde565b915061122583610dde565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561125e5761125d61100c565b5b828202905092915050565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b60006112c5602583610ccb565b91506112d082611269565b604082019050919050565b600060208201905081810360008301526112f4816112b8565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000611357602483610ccb565b9150611362826112fb565b604082019050919050565b600060208201905081810360008301526113868161134a565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b60006113e9602283610ccb565b91506113f48261138d565b604082019050919050565b60006020820190508181036000830152611418816113dc565b9050919050565b7f45524332303a20696e73756666696369656e7420616c6c6f77616e6365000000600082015250565b6000611455601d83610ccb565b91506114608261141f565b602082019050919050565b6000602082019050818103600083015261148481611448565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b60006114e7602583610ccb565b91506114f28261148b565b604082019050919050565b60006020820190508181036000830152611516816114da565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000611579602383610ccb565b91506115848261151d565b604082019050919050565b600060208201905081810360008301526115a88161156c565b9050919050565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b600061160b602683610ccb565b9150611616826115af565b604082019050919050565b6000602082019050818103600083015261163a816115fe565b9050919050565b7f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360008201527f7300000000000000000000000000000000000000000000000000000000000000602082015250565b600061169d602183610ccb565b91506116a882611641565b604082019050919050565b600060208201905081810360008301526116cc81611690565b9050919050565b7f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60008201527f6365000000000000000000000000000000000000000000000000000000000000602082015250565b600061172f602283610ccb565b915061173a826116d3565b604082019050919050565b6000602082019050818103600083015261175e81611722565b905091905056fea26469706673582212201f76b864b2f0d48c0d35357589878ed34030d7adc560092a0758c8fe7263e26664736f6c634300080a0033",
"contract_abi": [
{
"type": "constructor",
"inputs": [
{
"name": "name",
"type": "string",
"internalType": "string"
},
{
"name": "symbol",
"type": "string",
"internalType": "string"
}
],
"stateMutability": "nonpayable"
},
{
"name": "Approval",
"type": "event",
"inputs": [
{
"name": "owner",
"type": "address",
"indexed": true,
"internalType": "address"
},
{
"name": "spender",
"type": "address",
"indexed": true,
"internalType": "address"
},
{
"name": "value",
"type": "uint256",
"indexed": false,
"internalType": "uint256"
}
],
"anonymous": false
},
{
"name": "Transfer",
"type": "event",
"inputs": [
{
"name": "from",
"type": "address",
"indexed": true,
"internalType": "address"
},
{
"name": "to",
"type": "address",
"indexed": true,
"internalType": "address"
},
{
"name": "value",
"type": "uint256",
"indexed": false,
"internalType": "uint256"
}
],
"anonymous": false
},
{
"name": "allowance",
"type": "function",
"inputs": [
{
"name": "owner",
"type": "address",
"internalType": "address"
},
{
"name": "spender",
"type": "address",
"internalType": "address"
}
],
"outputs": [
{
"name": "",
"type": "uint256",
"internalType": "uint256"
}
],
"stateMutability": "view"
},
{
"name": "approve",
"type": "function",
"inputs": [
{
"name": "spender",
"type": "address",
"internalType": "address"
},
{
"name": "amount",
"type": "uint256",
"internalType": "uint256"
}
],
"outputs": [
{
"name": "",
"type": "bool",
"internalType": "bool"
}
],
"stateMutability": "nonpayable"
},
{
"name": "balanceOf",
"type": "function",
"inputs": [
{
"name": "account",
"type": "address",
"internalType": "address"
}
],
"outputs": [
{
"name": "",
"type": "uint256",
"internalType": "uint256"
}
],
"stateMutability": "view"
},
{
"name": "burn",
"type": "function",
"inputs": [
{
"name": "account",
"type": "address",
"internalType": "address"
},
{
"name": "amount",
"type": "uint256",
"internalType": "uint256"
}
],
"outputs": [
{
"name": "",
"type": "bool",
"internalType": "bool"
}
],
"stateMutability": "nonpayable"
},
{
"name": "decimals",
"type": "function",
"inputs": [],
"outputs": [
{
"name": "",
"type": "uint8",
"internalType": "uint8"
}
],
"stateMutability": "view"
},
{
"name": "decreaseAllowance",
"type": "function",
"inputs": [
{
"name": "spender",
"type": "address",
"internalType": "address"
},
{
"name": "subtractedValue",
"type": "uint256",
"internalType": "uint256"
}
],
"outputs": [
{
"name": "",
"type": "bool",
"internalType": "bool"
}
],
"stateMutability": "nonpayable"
},
{
"name": "increaseAllowance",
"type": "function",
"inputs": [
{
"name": "spender",
"type": "address",
"internalType": "address"
},
{
"name": "addedValue",
"type": "uint256",
"internalType": "uint256"
}
],
"outputs": [
{
"name": "",
"type": "bool",
"internalType": "bool"
}
],
"stateMutability": "nonpayable"
},
{
"name": "name",
"type": "function",
"inputs": [],
"outputs": [
{
"name": "",
"type": "string",
"internalType": "string"
}
],
"stateMutability": "view"
},
{
"name": "symbol",
"type": "function",
"inputs": [],
"outputs": [
{
"name": "",
"type": "string",
"internalType": "string"
}
],
"stateMutability": "view"
},
{
"name": "totalSupply",
"type": "function",
"inputs": [],
"outputs": [
{
"name": "",
"type": "uint256",
"internalType": "uint256"
}
],
"stateMutability": "view"
},
{
"name": "transfer",
"type": "function",
"inputs": [
{
"name": "to",
"type": "address",
"internalType": "address"
},
{
"name": "amount",
"type": "uint256",
"internalType": "uint256"
}
],
"outputs": [
{
"name": "",
"type": "bool",
"internalType": "bool"
}
],
"stateMutability": "nonpayable"
},
{
"name": "transferFrom",
"type": "function",
"inputs": [
{
"name": "from",
"type": "address",
"internalType": "address"
},
{
"name": "to",
"type": "address",
"internalType": "address"
},
{
"name": "amount",
"type": "uint256",
"internalType": "uint256"
}
],
"outputs": [
{
"name": "",
"type": "bool",
"internalType": "bool"
}
],
"stateMutability": "nonpayable"
}
],
"contract_source": "\n// File: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/Context.sol\n\n\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n}\n\n// File: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/IERC20.sol\n\n\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `from` to `to` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\n}\n\n// File: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/extensions/IERC20Metadata.sol\n\n\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\n\npragma solidity ^0.8.0;\n\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20Metadata is IERC20 {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n\n// File: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/ERC20.sol\n\n\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/ERC20.sol)\n\npragma solidity ^0.8.0;\n\n\n\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n * For a generic mechanism see {ERC20PresetMinterPauser}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * The default value of {decimals} is 18. To change this, you should override\n * this function so it returns a different value.\n *\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\n * instead returning `false` on failure. This behavior is nonetheless\n * conventional and does not conflict with the expectations of ERC20\n * applications.\n *\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\n * This allows applications to reconstruct the allowance for all accounts just\n * by listening to said events. Other implementations of the EIP may not emit\n * these events, as it isn't required by the specification.\n *\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\n * functions have been added to mitigate the well-known issues around setting\n * allowances. See {IERC20-approve}.\n */\ncontract ERC20 is Context, IERC20, IERC20Metadata {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n\n /**\n * @dev Sets the values for {name} and {symbol}.\n *\n * All two of these values are immutable: they can only be set once during\n * construction.\n */\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n /**\n * @dev Returns the symbol of the token, usually a shorter version of the\n * name.\n */\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev Returns the number of decimals used to get its user representation.\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\n *\n * Tokens usually opt for a value of 18, imitating the relationship between\n * Ether and Wei. This is the default value returned by this function, unless\n * it's overridden.\n *\n * NOTE: This information is only used for _display_ purposes: it in\n * no way affects any of the arithmetic of the contract, including\n * {IERC20-balanceOf} and {IERC20-transfer}.\n */\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n /**\n * @dev See {IERC20-totalSupply}.\n */\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n /**\n * @dev See {IERC20-balanceOf}.\n */\n function balanceOf(address account) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n /**\n * @dev See {IERC20-transfer}.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - the caller must have a balance of at least `amount`.\n */\n function transfer(address to, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _transfer(owner, to, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-allowance}.\n */\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n /**\n * @dev See {IERC20-approve}.\n *\n * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on\n * `transferFrom`. This is semantically equivalent to an infinite approval.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-transferFrom}.\n *\n * Emits an {Approval} event indicating the updated allowance. This is not\n * required by the EIP. See the note at the beginning of {ERC20}.\n *\n * NOTE: Does not update the allowance if the current allowance\n * is the maximum `uint256`.\n *\n * Requirements:\n *\n * - `from` and `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n * - the caller must have allowance for ``from``'s tokens of at least\n * `amount`.\n */\n function transferFrom(address from, address to, uint256 amount) public virtual override returns (bool) {\n address spender = _msgSender();\n _spendAllowance(from, spender, amount);\n _transfer(from, to, amount);\n return true;\n }\n\n /**\n * @dev Atomically increases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, allowance(owner, spender) + addedValue);\n return true;\n }\n\n /**\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `spender` must have allowance for the caller of at least\n * `subtractedValue`.\n */\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\n address owner = _msgSender();\n uint256 currentAllowance = allowance(owner, spender);\n require(currentAllowance >= subtractedValue, \"ERC20: decreased allowance below zero\");\n unchecked {\n _approve(owner, spender, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n\n /**\n * @dev Moves `amount` of tokens from `from` to `to`.\n *\n * This internal function is equivalent to {transfer}, and can be used to\n * e.g. implement automatic token fees, slashing mechanisms, etc.\n *\n * Emits a {Transfer} event.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n */\n function _transfer(address from, address to, uint256 amount) internal virtual {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(from, to, amount);\n\n uint256 fromBalance = _balances[from];\n require(fromBalance >= amount, \"ERC20: transfer amount exceeds balance\");\n unchecked {\n _balances[from] = fromBalance - amount;\n // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by\n // decrementing then incrementing.\n _balances[to] += amount;\n }\n\n emit Transfer(from, to, amount);\n\n _afterTokenTransfer(from, to, amount);\n }\n\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\n * the total supply.\n *\n * Emits a {Transfer} event with `from` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply += amount;\n unchecked {\n // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.\n _balances[account] += amount;\n }\n emit Transfer(address(0), account, amount);\n\n _afterTokenTransfer(address(0), account, amount);\n }\n\n /**\n * @dev Destroys `amount` tokens from `account`, reducing the\n * total supply.\n *\n * Emits a {Transfer} event with `to` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n * - `account` must have at least `amount` tokens.\n */\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n unchecked {\n _balances[account] = accountBalance - amount;\n // Overflow not possible: amount <= accountBalance <= totalSupply.\n _totalSupply -= amount;\n }\n\n emit Transfer(account, address(0), amount);\n\n _afterTokenTransfer(account, address(0), amount);\n }\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\n *\n * This internal function is equivalent to `approve`, and can be used to\n * e.g. set automatic allowances for certain subsystems, etc.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `owner` cannot be the zero address.\n * - `spender` cannot be the zero address.\n */\n function _approve(address owner, address spender, uint256 amount) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n /**\n * @dev Updates `owner` s allowance for `spender` based on spent `amount`.\n *\n * Does not update the allowance amount in case of infinite allowance.\n * Revert if not enough allowance is available.\n *\n * Might emit an {Approval} event.\n */\n function _spendAllowance(address owner, address spender, uint256 amount) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n if (currentAllowance != type(uint256).max) {\n require(currentAllowance >= amount, \"ERC20: insufficient allowance\");\n unchecked {\n _approve(owner, spender, currentAllowance - amount);\n }\n }\n }\n\n /**\n * @dev Hook that is called before any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * will be transferred to `to`.\n * - when `from` is zero, `amount` tokens will be minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual {}\n\n /**\n * @dev Hook that is called after any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * has been transferred to `to`.\n * - when `from` is zero, `amount` tokens have been minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens have been burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _afterTokenTransfer(address from, address to, uint256 amount) internal virtual {}\n}\n\n// File: contracts/TToken.sol\n\n\npragma solidity ^0.8.10;\n\n\ncontract MyToken is ERC20 {\n constructor(string memory name, string memory symbol) ERC20(name, symbol) {\n // Mint 100 tokens to msg.sender\n // Similar to how\n // 1 dollar = 100 cents\n // 1 token = 1 * (10 ** decimals)\n _mint(msg.sender, 99999999 * 10**uint(decimals()));\n }\n function burn(address account, uint256 amount) public virtual returns (bool) {\n \n _burn(account, amount * 10**uint(decimals()));\n\n return true;\n }\n}",
"constructor_arguments": "",
"swam_source": "bzz-raw://12201f76b864b2f0d48c0d35357589878ed34030d7adc560092a0758c8fe7263e266",
"verify_status": "1",
"verify_message": null
}
}
}
Verify contract source code
URI
network
uri
Mainnet
POST https://explorerapi.wemix.com/v1/contracts/{contract_address}/verify
Testnet
POST https://explorerapi.test.wemix.com/v1/contracts/{contract_address}/verify
REQUEST PARAMETER
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
REQUEST SAMPLE
POST https://explorerapi.wemix.com/v1/contracts/{contract_address}/verify
api-key: 1ba5e446edf1997f67b51bf9e60b3fbba6fa1bf84301115292805d7e24f43539
Content-Type: application/json
{
"contract_name": "MyToken",
"compiler": "0.8.10",
"runs_optimizer": 200,
"optimization_enabled": 0,
"contract_source": "DQovLyBGaWxlOiBodHRwczovL2dpdGh1Yi5jb20vT3BlblplcHBlbGluL29wZW56ZXBwZWxpbi1jb250cmFjdHMvYmxvYi9tYXN0ZXIvY29udHJhY3RzL3V0aWxzL0NvbnRleHQuc29sDQoNCg0KLy8gT3BlblplcHBlbGluIENvbnRyYWN0cyB2NC40LjEgKHV0aWxzL0NvbnRleHQuc29sKQ0KDQpwcmFnbWEgc29saWRpdHkgXjAuOC4wOw0KDQovKioNCiAqIEBkZXYgUHJvdmlkZXMgaW5mb3JtYXRpb24gYWJvdXQgdGhlIGN1cnJlbnQgZXhlY3V0aW9uIGNvbnRleHQsIGluY2x1ZGluZyB0aGUNCiAqIHNlbmRlciBvZiB0aGUgdHJhbnNhY3Rpb24gYW5kIGl0cyBkYXRhLiBXaGlsZSB0aGVzZSBhcmUgZ2VuZXJhbGx5IGF2YWlsYWJsZQ0KICogdmlhIG1zZy5zZW5kZXIgYW5kIG1zZy5kYXRhLCB0aGV5IHNob3VsZCBub3QgYmUgYWNjZXNzZWQgaW4gc3VjaCBhIGRpcmVjdA0KICogbWFubmVyLCBzaW5jZSB3aGVuIGRlYWxpbmcgd2l0aCBtZXRhLXRyYW5zYWN0aW9ucyB0aGUgYWNjb3VudCBzZW5kaW5nIGFuZA0KICogcGF5aW5nIGZvciBleGVjdXRpb24gbWF5IG5vdCBiZSB0aGUgYWN0dWFsIHNlbmRlciAoYXMgZmFyIGFzIGFuIGFwcGxpY2F0aW9uDQogKiBpcyBjb25jZXJuZWQpLg0KICoNCiAqIFRoaXMgY29udHJ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0eSBeMC44LjEwOw0KDQoNCmNvbnRyYWN0IE15VG9rZW4gaXMgRVJDMjAgew0KICAgIGNvbnN0cnVjdG9yKHN0cmluZyBtZW1vcnkgbmFtZSwgc3RyaW5nIG1lbW9yeSBzeW1ib2wpIEVSQzIwKG5hbWUsIHN5bWJvbCkgew0KICAgICAgICAvLyBNaW50IDEwMCB0b2tlbnMgdG8gbXNnLnNlbmRlcg0KICAgICAgICAvLyBTaW1pbGFyIHRvIGhvdw0KICAgICAgICAvLyAxIGRvbGxhciA9IDEwMCBjZW50cw0KICAgICAgICAvLyAxIHRva2VuID0gMSAqICgxMCAqKiBkZWNpbWFscykNCiAgICAgICAgX21pbnQobXNnLnNlbmRlciwgOTk5OTk5OTkgKiAxMCoqdWludChkZWNpbWFscygpKSk7DQogICAgfQ0KICAgIGZ1bmN0aW9uIGJ1cm4oYWRkcmVzcyBhY2NvdW50LCB1aW50MjU2IGFtb3VudCkgcHVibGljIHZpcnR1YWwgcmV0dXJucyAoYm9vbCkgew0KICAgICAgICANCiAgICAgICAgX2J1cm4oYWNjb3VudCwgYW1vdW50ICogMTAqKnVpbnQoZGVjaW1hbHMoKSkpOw0KDQogICAgICAgIHJldHVybiB0cnVlOw0KICAgIH0NCn0=",
"constructor_arguments": "",
"libraries": []
}
RESPONSE PARAMETER
key
type
value
results
Json
Result of verification process - 0: Failed - 1: Success
RESPONSE SAMPLE
{
"results": 1
}