Only this pageAll pages
Powered by GitBook
1 of 10

Testnet Soniscan

Loading...

API Endpoints

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Sonicscan Testnet

An API key generated on Sonicscan can be used across all mainnet and testnet explorers.

Similarly, all endpoints and parameter formatting remain the same across testnet explorers, you are only required to change the relevant API endpoint URL as follows.

Source attribution via a backlink or a mention that your app is "Powered by Sonicscan APIs" is required except for personal/private usage.

Network
URL
Documentation

Mainnet

Testnet

https://api.sonicscan.org/api
https://docs.sonicscan.org/
https://api-testnet.sonicscan.org/api
https://docs.sonicscan.org/sonic-testnet

Blocks

Get Block And Uncle Rewards by BlockNo

Returns the block reward and 'Uncle' block rewards.

https://api-testnet.sonicscan.org/api
   ?module=block
   &action=getblockreward
   &blockno=1090932
   &apikey=YourApiKeyToken

Get Estimated Block Countdown Time by BlockNo

Returns the estimated time remaining, in seconds, until a certain block is mined.

https://api-testnet.sonicscan.org/api
   ?module=block
   &action=getblockcountdown
   &blockno=1090932
   &apikey=YourApiKeyToken

Query Parameters

Parameter
Description

blockno

the integer block number to estimate time remaining to be mined eg. 12697906

Sample Response

{
   "status":"1",
   "message":"OK",
   "result":{
      "CurrentBlock":"9548810",
      "CountdownBlock":"9588666",
      "RemainingBlock":"39856",
      "EstimateTimeInSec":"577927.0"
   }
}

Get Block Number by Timestamp

Returns the block number that was mined at a certain timestamp.

https://api-testnet.sonicscan.org/api
   ?module=block
   &action=getblocknobytime
   &timestamp=1652459409
   &closest=before
   &apikey=YourApiKeyToken

Query Parameters

Parameter
Description

timestamp

the integer representing the Unix timestamp in seconds.

closest

the closest available block to the provided timestamp, either before or after

Sample Response

{
   "status":"1",
   "message":"OK",
   "result":"1091685"
}

Try this endpoint in your

Query Parameters

Parameter
Description

blockno

the integer block number to check block rewards for eg. 12697906

Sample Response

{
   "status":"1",
   "message":"OK",
   "result":{
      "blockNumber":"1090932",
      "timeStamp":"1652449149",
      "blockMiner":"0xd87def8bbd2c4d59494611ab259a2005c154212a",
      "blockReward":"2000031500000000000",
      "uncles":[
         
      ],
      "uncleInclusionReward":"0"
   }
}

​​ Tip : The timestamp field is denoted in

Try this endpoint in your

Try this endpoint in your

Tip : Convert a regular date-time to a

🔗
browser
⏳
Unix timestamp.
🔗
browser
🔗
browser
⏳
Unix timestamp.

Transactions

Check Contract Execution Status

Returns the status code of a contract execution.

https://api-testnet.sonicscan.org/api
   ?module=transaction
   &action=getstatus
   &txhash=0x5d329954fae7d19b2fb9abf0e6862735243b1079c58e0ea307d7e933657ac083
   &apikey=YourApiKeyToken

Check Transaction Receipt Status

Returns the status code of a transaction execution.

https://api-testnet.sonicscan.org/api
   ?module=transaction
   &action=gettxreceiptstatus
   &txhash=0x13d297c02c1dd4ada29fa88e5d3dfa040c2f1d0d45802fb6b02ed95debdf2290
   &apikey=YourApiKeyToken

Query Parameters

Parameter
Description

txhash

the string representing the transaction hash to check the execution status

Sample Response

{
   "status":"1",
   "message":"OK",
   "result":{
      "status":"1"
   }
}

Try this endpoint in your

Query Parameters

Parameter
Description

txhash

the string representing the transaction hash to check the execution status

Sample Response

{
   "status":"1",
   "message":"OK",
   "result":{
      "isError":"0",
      "errDescription":""
   }
}

Tip: The isError field returns 0 for successful transactions and 1 for failed transactions.

Note: Only applicable for post transactions.

Try this endpoint in your

Tip: The status field returns 0 for failed transactions and 1 for successful transactions.

📖
📖
🔗
browser
📝
Byzantium Fork
🔗
browser

Logs

Below are the list of supported filter parameters:

  • fromBlock, toBlock, address

  • topic0, topic1, topic2, topic3 (32 Bytes per topic)

  • topic0_1_opr (and|or between topic0 & topic1), topic1_2_opr (and|or between topic1 & topic2), topic2_3_opr (and|or between topic2 & topic3), topic0_2_opr (and|or between topic0 & topic2), topic0_3_opr (and|or between topic0 & topic3), topic1_3_opr (and|or between topic1 & topic3)

  • FromBlock & ToBlock accepts the blocknumber (integer, NOT hex) or 'latest' (earliest & pending is NOT supported yet)

  • Topic Operator (opr) choices are either 'and' or 'or' and are restricted to the above choices only

  • FromBlock & ToBlock parameters are required

  • An address and/or topic(X) parameters are required, when multiple topic(X) parameters are used the topicX_X_opr (and|or operator) is also required

For performance & security considerations, only the first 1000 results are return. So please narrow down the filter parameters.

Sample Log API Queries

Get Event Logs from block number 1092029 to 'latest' , where log address = 0x639D4384b429ea4660f377B7A29dAe6d2255090f and topic[0] = 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef

https://api-testnet.sonicscan.org/api
   ?module=logs
   &action=getLogs
   &fromBlock=1092029
   &toBlock=latest
   &address=0x639D4384b429ea4660f377B7A29dAe6d2255090f
   &topic0=0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef
   &apikey=YourApiKeyToken

Get Event Logs from block number 9433622 to block 'latest', where log address = 0x5592ec0cfb4dbc12d3ab100b257153436a1f0fea, topic[0] = 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef 'AND' topic[1] = 0x0000000000000000000000008e811410ce01e0244808af95bba906b8ab77a40b

https://api-testnet.sonicscan.org/api
   ?module=logs
   &action=getLogs
   &fromBlock=1089604
   &toBlock=latest
   &address=0x64A736Aa55958a41bC1B18590AB7dfCb78444Dd1
   &topic0=0xc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62
   &topic0_1_opr=and
   &topic1=0x000000000000000000000000955866ee0bd3b8b0be4d4ea306670f34b90ef3ed
   &apikey=YourApiKeyToken

Contracts

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

A simple sample for retrieving the contractABI using Web3.js and Jquery to interact with a contract.

Returns the Solidity source code of a verified smart contract.

Query Parameters

Sample Response

Verify Source Code

Submits a contract source code to Etherscan for verification.

  1. Only supports HTTP POST due to max transfer size limitations for HTTP GET

  2. Supports up to 10 different library pairs

  3. Contracts that use "imports" will need to have the code concatenated into one file as we do not support "imports" in separate files.

  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

Source Code Submission Gist

Check Source Code Verification Submission Status

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

Checking Proxy Contract Verification Submission Status using cURL

The Event Log API was designed to provide an alternative to the native .

Some parameters to take note of

Try this endpoint in your

Try this endpoint in your

Get Contract ABI for

Find verified contracts on our page.

Try this endpoint in your

Query Parameters

Parameter
Description

Sample Response

Get Contract Source Code for

Tip : You can also download a of which the code publishers have provided a corresponding Open Source license for redistribution.

Try this endpoint in your

Parameter
Description

Note : This endpoint is limited to 100 verifications/day, regardless of API PRO tier.

Requires a valid , it will be rejected otherwise

List of , only solc version v0.4.11 and above is supported e.g. v0.4.25+commit.59dbf8f1

Verified Source Codes will be displayed at the page.

Note: Upon successful submission, a GUID is returned, which can be used to check for submission status.

📝
eth_getLogs
🔗
browser
🔗
browser
https://api-testnet.sonicscan.org/api
   ?module=contract
   &action=getabi
   &address=0x639D4384b429ea4660f377B7A29dAe6d2255090f
   &apikey=YourApiKeyToken

address

the contract address that has a verified source code

{
   "status":"1",
   "message":"OK",
   "result":"[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"subtractedValue\",\"type\":\"uint256\"}],\"name\":\"decreaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"addedValue\",\"type\":\"uint256\"}],\"name\":\"increaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"mint\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]"
}
var Web3 = require('web3');
var web3 = new Web3(new Web3.providers.HttpProvider());
var version = web3.version.api;
        
$.getJSON('https://api-testnet.sonicscan.org/api?module=contract&action=getabi&address=0x1f1727E2C83c23faE3b1CdB048146647b3B6d17d&apikey=YourApiKeyToken', function (data) {
    var contractABI = "";
    contractABI = JSON.parse(data.result);
    if (contractABI != ''){
        var MyContract = web3.eth.contract(contractABI);
        var myContractInstance = MyContract.at("0xfb6916095ca1df60bb79ce92ce3ea74c37c5d359");
        var result = myContractInstance.memberId("0xfe8ad7dd2f564a877cc23feea6c0a9cc2e783715");
        console.log("result1 : " + result);            
        var result = myContractInstance.members(1);
        console.log("result2 : " + result);
    } else {
        console.log("Error" );
    }            
});
https://api-testnet.sonicscan.org/api
   ?module=contract
   &action=getsourcecode
   &address=0x64a736aa55958a41bc1b18590ab7dfcb78444dd1
   &apikey=YourApiKeyToken 

address

the contract address that has a verified source code

{
   "status":"1",
   "message":"OK",
   "result":[
      {
         "SourceCode":"{{\r\n  \"language\": \"Solidity\",\r\n  \"sources\": {\r\n    \"@openzeppelin/contracts/access/Ownable.sol\": {\r\n      \"content\": \"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n    address private _owner;\\n\\n    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n    /**\\n     * @dev Initializes the contract setting the deployer as the initial owner.\\n     */\\n    constructor() {\\n        _transferOwnership(_msgSender());\\n    }\\n\\n    /**\\n     * @dev Returns the address of the current owner.\\n     */\\n    function owner() public view virtual returns (address) {\\n        return _owner;\\n    }\\n\\n    /**\\n     * @dev Throws if called by any account other than the owner.\\n     */\\n    modifier onlyOwner() {\\n        require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n        _;\\n    }\\n\\n    /**\\n     * @dev Leaves the contract without owner. It will not be possible to call\\n     * `onlyOwner` functions anymore. Can only be called by the current owner.\\n     *\\n     * NOTE: Renouncing ownership will leave the contract without an owner,\\n     * thereby removing any functionality that is only available to the owner.\\n     */\\n    function renounceOwnership() public virtual onlyOwner {\\n        _transferOwnership(address(0));\\n    }\\n\\n    /**\\n     * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n     * Can only be called by the current owner.\\n     */\\n    function transferOwnership(address newOwner) public virtual onlyOwner {\\n        require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n        _transferOwnership(newOwner);\\n    }\\n\\n    /**\\n     * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n     * Internal function without access restriction.\\n     */\\n    function _transferOwnership(address newOwner) internal virtual {\\n        address oldOwner = _owner;\\n        _owner = newOwner;\\n        emit OwnershipTransferred(oldOwner, newOwner);\\n    }\\n}\\n\"\r\n    },\r\n    \"@openzeppelin/contracts/token/ERC1155/ERC1155.sol\": {\r\n      \"content\": \"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC1155/ERC1155.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IERC1155.sol\\\";\\nimport \\\"./IERC1155Receiver.sol\\\";\\nimport \\\"./extensions/IERC1155MetadataURI.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/Context.sol\\\";\\nimport \\\"../../utils/introspection/ERC165.sol\\\";\\n\\n/**\\n * @dev Implementation of the basic standard multi-token.\\n * See https://eips.ethereum.org/EIPS/eip-1155\\n * Originally based on code by Enjin: https://github.com/enjin/erc-1155\\n *\\n * _Available since v3.1._\\n */\\ncontract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI {\\n    using Address for address;\\n\\n    // Mapping from token ID to account balances\\n    mapping(uint256 => mapping(address => uint256)) private _balances;\\n\\n    // Mapping from account to operator approvals\\n    mapping(address => mapping(address => bool)) private _operatorApprovals;\\n\\n    // Used as the URI for all token types by relying on ID substitution, e.g. https://token-cdn-domain/{id}.json\\n    string private _uri;\\n\\n    /**\\n     * @dev See {_setURI}.\\n     */\\n    constructor(string memory uri_) {\\n        _setURI(uri_);\\n    }\\n\\n    /**\\n     * @dev See {IERC165-supportsInterface}.\\n     */\\n    function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {\\n        return\\n            interfaceId == type(IERC1155).interfaceId ||\\n            interfaceId == type(IERC1155MetadataURI).interfaceId ||\\n            super.supportsInterface(interfaceId);\\n    }\\n\\n    /**\\n     * @dev See {IERC1155MetadataURI-uri}.\\n     *\\n     * This implementation returns the same URI for *all* token types. It relies\\n     * on the token type ID substitution mechanism\\n     * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].\\n     *\\n     * Clients calling this function must replace the `\\\\{id\\\\}` substring with the\\n     * actual token type ID.\\n     */\\n    function uri(uint256) public view virtual override returns (string memory) {\\n        return _uri;\\n    }\\n\\n    /**\\n     * @dev See {IERC1155-balanceOf}.\\n     *\\n     * Requirements:\\n     *\\n     * - `account` cannot be the zero address.\\n     */\\n    function balanceOf(address account, uint256 id) public view virtual override returns (uint256) {\\n        require(account != address(0), \\\"ERC1155: balance query for the zero address\\\");\\n        return _balances[id][account];\\n    }\\n\\n    /**\\n     * @dev See {IERC1155-balanceOfBatch}.\\n     *\\n     * Requirements:\\n     *\\n     * - `accounts` and `ids` must have the same length.\\n     */\\n    function balanceOfBatch(address[] memory accounts, uint256[] memory ids)\\n        public\\n        view\\n        virtual\\n        override\\n        returns (uint256[] memory)\\n    {\\n        require(accounts.length == ids.length, \\\"ERC1155: accounts and ids length mismatch\\\");\\n\\n        uint256[] memory batchBalances = new uint256[](accounts.length);\\n\\n        for (uint256 i = 0; i < accounts.length; ++i) {\\n            batchBalances[i] = balanceOf(accounts[i], ids[i]);\\n        }\\n\\n        return batchBalances;\\n    }\\n\\n    /**\\n     * @dev See {IERC1155-setApprovalForAll}.\\n     */\\n    function setApprovalForAll(address operator, bool approved) public virtual override {\\n        _setApprovalForAll(_msgSender(), operator, approved);\\n    }\\n\\n    /**\\n     * @dev See {IERC1155-isApprovedForAll}.\\n     */\\n    function isApprovedForAll(address account, address operator) public view virtual override returns (bool) {\\n        return _operatorApprovals[account][operator];\\n    }\\n\\n    /**\\n     * @dev See {IERC1155-safeTransferFrom}.\\n     */\\n    function safeTransferFrom(\\n        address from,\\n        address to,\\n        uint256 id,\\n        uint256 amount,\\n        bytes memory data\\n    ) public virtual override {\\n        require(\\n            from == _msgSender() || isApprovedForAll(from, _msgSender()),\\n            \\\"ERC1155: caller is not owner nor approved\\\"\\n        );\\n        _safeTransferFrom(from, to, id, amount, data);\\n    }\\n\\n    /**\\n     * @dev See {IERC1155-safeBatchTransferFrom}.\\n     */\\n    function safeBatchTransferFrom(\\n        address from,\\n        address to,\\n        uint256[] memory ids,\\n        uint256[] memory amounts,\\n        bytes memory data\\n    ) public virtual override {\\n        require(\\n            from == _msgSender() || isApprovedForAll(from, _msgSender()),\\n            \\\"ERC1155: transfer caller is not owner nor approved\\\"\\n        );\\n        _safeBatchTransferFrom(from, to, ids, amounts, data);\\n    }\\n\\n    /**\\n     * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.\\n     *\\n     * Emits a {TransferSingle} event.\\n     *\\n     * Requirements:\\n     *\\n     * - `to` cannot be the zero address.\\n     * - `from` must have a balance of tokens of type `id` of at least `amount`.\\n     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the\\n     * acceptance magic value.\\n     */\\n    function _safeTransferFrom(\\n        address from,\\n        address to,\\n        uint256 id,\\n        uint256 amount,\\n        bytes memory data\\n    ) internal virtual {\\n        require(to != address(0), \\\"ERC1155: transfer to the zero address\\\");\\n\\n        address operator = _msgSender();\\n        uint256[] memory ids = _asSingletonArray(id);\\n        uint256[] memory amounts = _asSingletonArray(amount);\\n\\n        _beforeTokenTransfer(operator, from, to, ids, amounts, data);\\n\\n        uint256 fromBalance = _balances[id][from];\\n        require(fromBalance >= amount, \\\"ERC1155: insufficient balance for transfer\\\");\\n        unchecked {\\n            _balances[id][from] = fromBalance - amount;\\n        }\\n        _balances[id][to] += amount;\\n\\n        emit TransferSingle(operator, from, to, id, amount);\\n\\n        _afterTokenTransfer(operator, from, to, ids, amounts, data);\\n\\n        _doSafeTransferAcceptanceCheck(operator, from, to, id, amount, data);\\n    }\\n\\n    /**\\n     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_safeTransferFrom}.\\n     *\\n     * Emits a {TransferBatch} event.\\n     *\\n     * Requirements:\\n     *\\n     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the\\n     * acceptance magic value.\\n     */\\n    function _safeBatchTransferFrom(\\n        address from,\\n        address to,\\n        uint256[] memory ids,\\n        uint256[] memory amounts,\\n        bytes memory data\\n    ) internal virtual {\\n        require(ids.length == amounts.length, \\\"ERC1155: ids and amounts length mismatch\\\");\\n        require(to != address(0), \\\"ERC1155: transfer to the zero address\\\");\\n\\n        address operator = _msgSender();\\n\\n        _beforeTokenTransfer(operator, from, to, ids, amounts, data);\\n\\n        for (uint256 i = 0; i < ids.length; ++i) {\\n            uint256 id = ids[i];\\n            uint256 amount = amounts[i];\\n\\n            uint256 fromBalance = _balances[id][from];\\n            require(fromBalance >= amount, \\\"ERC1155: insufficient balance for transfer\\\");\\n            unchecked {\\n                _balances[id][from] = fromBalance - amount;\\n            }\\n            _balances[id][to] += amount;\\n        }\\n\\n        emit TransferBatch(operator, from, to, ids, amounts);\\n\\n        _afterTokenTransfer(operator, from, to, ids, amounts, data);\\n\\n        _doSafeBatchTransferAcceptanceCheck(operator, from, to, ids, amounts, data);\\n    }\\n\\n    /**\\n     * @dev Sets a new URI for all token types, by relying on the token type ID\\n     * substitution mechanism\\n     * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].\\n     *\\n     * By this mechanism, any occurrence of the `\\\\{id\\\\}` substring in either the\\n     * URI or any of the amounts in the JSON file at said URI will be replaced by\\n     * clients with the token type ID.\\n     *\\n     * For example, the `https://token-cdn-domain/\\\\{id\\\\}.json` URI would be\\n     * interpreted by clients as\\n     * `https://token-cdn-domain/000000000000000000000000000000000000000000000000000000000004cce0.json`\\n     * for token type ID 0x4cce0.\\n     *\\n     * See {uri}.\\n     *\\n     * Because these URIs cannot be meaningfully represented by the {URI} event,\\n     * this function emits no events.\\n     */\\n    function _setURI(string memory newuri) internal virtual {\\n        _uri = newuri;\\n    }\\n\\n    /**\\n     * @dev Creates `amount` tokens of token type `id`, and assigns them to `to`.\\n     *\\n     * Emits a {TransferSingle} event.\\n     *\\n     * Requirements:\\n     *\\n     * - `to` cannot be the zero address.\\n     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the\\n     * acceptance magic value.\\n     */\\n    function _mint(\\n        address to,\\n        uint256 id,\\n        uint256 amount,\\n        bytes memory data\\n    ) internal virtual {\\n        require(to != address(0), \\\"ERC1155: mint to the zero address\\\");\\n\\n        address operator = _msgSender();\\n        uint256[] memory ids = _asSingletonArray(id);\\n        uint256[] memory amounts = _asSingletonArray(amount);\\n\\n        _beforeTokenTransfer(operator, address(0), to, ids, amounts, data);\\n\\n        _balances[id][to] += amount;\\n        emit TransferSingle(operator, address(0), to, id, amount);\\n\\n        _afterTokenTransfer(operator, address(0), to, ids, amounts, data);\\n\\n        _doSafeTransferAcceptanceCheck(operator, address(0), to, id, amount, data);\\n    }\\n\\n    /**\\n     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_mint}.\\n     *\\n     * Requirements:\\n     *\\n     * - `ids` and `amounts` must have the same length.\\n     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the\\n     * acceptance magic value.\\n     */\\n    function _mintBatch(\\n        address to,\\n        uint256[] memory ids,\\n        uint256[] memory amounts,\\n        bytes memory data\\n    ) internal virtual {\\n        require(to != address(0), \\\"ERC1155: mint to the zero address\\\");\\n        require(ids.length == amounts.length, \\\"ERC1155: ids and amounts length mismatch\\\");\\n\\n        address operator = _msgSender();\\n\\n        _beforeTokenTransfer(operator, address(0), to, ids, amounts, data);\\n\\n        for (uint256 i = 0; i < ids.length; i++) {\\n            _balances[ids[i]][to] += amounts[i];\\n        }\\n\\n        emit TransferBatch(operator, address(0), to, ids, amounts);\\n\\n        _afterTokenTransfer(operator, address(0), to, ids, amounts, data);\\n\\n        _doSafeBatchTransferAcceptanceCheck(operator, address(0), to, ids, amounts, data);\\n    }\\n\\n    /**\\n     * @dev Destroys `amount` tokens of token type `id` from `from`\\n     *\\n     * Requirements:\\n     *\\n     * - `from` cannot be the zero address.\\n     * - `from` must have at least `amount` tokens of token type `id`.\\n     */\\n    function _burn(\\n        address from,\\n        uint256 id,\\n        uint256 amount\\n    ) internal virtual {\\n        require(from != address(0), \\\"ERC1155: burn from the zero address\\\");\\n\\n        address operator = _msgSender();\\n        uint256[] memory ids = _asSingletonArray(id);\\n        uint256[] memory amounts = _asSingletonArray(amount);\\n\\n        _beforeTokenTransfer(operator, from, address(0), ids, amounts, \\\"\\\");\\n\\n        uint256 fromBalance = _balances[id][from];\\n        require(fromBalance >= amount, \\\"ERC1155: burn amount exceeds balance\\\");\\n        unchecked {\\n            _balances[id][from] = fromBalance - amount;\\n        }\\n\\n        emit TransferSingle(operator, from, address(0), id, amount);\\n\\n        _afterTokenTransfer(operator, from, address(0), ids, amounts, \\\"\\\");\\n    }\\n\\n    /**\\n     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_burn}.\\n     *\\n     * Requirements:\\n     *\\n     * - `ids` and `amounts` must have the same length.\\n     */\\n    function _burnBatch(\\n        address from,\\n        uint256[] memory ids,\\n        uint256[] memory amounts\\n    ) internal virtual {\\n        require(from != address(0), \\\"ERC1155: burn from the zero address\\\");\\n        require(ids.length == amounts.length, \\\"ERC1155: ids and amounts length mismatch\\\");\\n\\n        address operator = _msgSender();\\n\\n        _beforeTokenTransfer(operator, from, address(0), ids, amounts, \\\"\\\");\\n\\n        for (uint256 i = 0; i < ids.length; i++) {\\n            uint256 id = ids[i];\\n            uint256 amount = amounts[i];\\n\\n            uint256 fromBalance = _balances[id][from];\\n            require(fromBalance >= amount, \\\"ERC1155: burn amount exceeds balance\\\");\\n            unchecked {\\n                _balances[id][from] = fromBalance - amount;\\n            }\\n        }\\n\\n        emit TransferBatch(operator, from, address(0), ids, amounts);\\n\\n        _afterTokenTransfer(operator, from, address(0), ids, amounts, \\\"\\\");\\n    }\\n\\n    /**\\n     * @dev Approve `operator` to operate on all of `owner` tokens\\n     *\\n     * Emits a {ApprovalForAll} event.\\n     */\\n    function _setApprovalForAll(\\n        address owner,\\n        address operator,\\n        bool approved\\n    ) internal virtual {\\n        require(owner != operator, \\\"ERC1155: setting approval status for self\\\");\\n        _operatorApprovals[owner][operator] = approved;\\n        emit ApprovalForAll(owner, operator, approved);\\n    }\\n\\n    /**\\n     * @dev Hook that is called before any token transfer. This includes minting\\n     * and burning, as well as batched variants.\\n     *\\n     * The same hook is called on both single and batched variants. For single\\n     * transfers, the length of the `id` and `amount` arrays will be 1.\\n     *\\n     * Calling conditions (for each `id` and `amount` pair):\\n     *\\n     * - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens\\n     * of token type `id` will be  transferred to `to`.\\n     * - When `from` is zero, `amount` tokens of token type `id` will be minted\\n     * for `to`.\\n     * - when `to` is zero, `amount` of ``from``'s tokens of token type `id`\\n     * will be burned.\\n     * - `from` and `to` are never both zero.\\n     * - `ids` and `amounts` have the same, non-zero length.\\n     *\\n     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\\n     */\\n    function _beforeTokenTransfer(\\n        address operator,\\n        address from,\\n        address to,\\n        uint256[] memory ids,\\n        uint256[] memory amounts,\\n        bytes memory data\\n    ) internal virtual {}\\n\\n    /**\\n     * @dev Hook that is called after any token transfer. This includes minting\\n     * and burning, as well as batched variants.\\n     *\\n     * The same hook is called on both single and batched variants. For single\\n     * transfers, the length of the `id` and `amount` arrays will be 1.\\n     *\\n     * Calling conditions (for each `id` and `amount` pair):\\n     *\\n     * - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens\\n     * of token type `id` will be  transferred to `to`.\\n     * - When `from` is zero, `amount` tokens of token type `id` will be minted\\n     * for `to`.\\n     * - when `to` is zero, `amount` of ``from``'s tokens of token type `id`\\n     * will be burned.\\n     * - `from` and `to` are never both zero.\\n     * - `ids` and `amounts` have the same, non-zero length.\\n     *\\n     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\\n     */\\n    function _afterTokenTransfer(\\n        address operator,\\n        address from,\\n        address to,\\n        uint256[] memory ids,\\n        uint256[] memory amounts,\\n        bytes memory data\\n    ) internal virtual {}\\n\\n    function _doSafeTransferAcceptanceCheck(\\n        address operator,\\n        address from,\\n        address to,\\n        uint256 id,\\n        uint256 amount,\\n        bytes memory data\\n    ) private {\\n        if (to.isContract()) {\\n            try IERC1155Receiver(to).onERC1155Received(operator, from, id, amount, data) returns (bytes4 response) {\\n                if (response != IERC1155Receiver.onERC1155Received.selector) {\\n                    revert(\\\"ERC1155: ERC1155Receiver rejected tokens\\\");\\n                }\\n            } catch Error(string memory reason) {\\n                revert(reason);\\n            } catch {\\n                revert(\\\"ERC1155: transfer to non ERC1155Receiver implementer\\\");\\n            }\\n        }\\n    }\\n\\n    function _doSafeBatchTransferAcceptanceCheck(\\n        address operator,\\n        address from,\\n        address to,\\n        uint256[] memory ids,\\n        uint256[] memory amounts,\\n        bytes memory data\\n    ) private {\\n        if (to.isContract()) {\\n            try IERC1155Receiver(to).onERC1155BatchReceived(operator, from, ids, amounts, data) returns (\\n                bytes4 response\\n            ) {\\n                if (response != IERC1155Receiver.onERC1155BatchReceived.selector) {\\n                    revert(\\\"ERC1155: ERC1155Receiver rejected tokens\\\");\\n                }\\n            } catch Error(string memory reason) {\\n                revert(reason);\\n            } catch {\\n                revert(\\\"ERC1155: transfer to non ERC1155Receiver implementer\\\");\\n            }\\n        }\\n    }\\n\\n    function _asSingletonArray(uint256 element) private pure returns (uint256[] memory) {\\n        uint256[] memory array = new uint256[](1);\\n        array[0] = element;\\n\\n        return array;\\n    }\\n}\\n\"\r\n    },\r\n    \"@openzeppelin/contracts/token/ERC1155/IERC1155.sol\": {\r\n      \"content\": \"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC1155/IERC1155.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../utils/introspection/IERC165.sol\\\";\\n\\n/**\\n * @dev Required interface of an ERC1155 compliant contract, as defined in the\\n * https://eips.ethereum.org/EIPS/eip-1155[EIP].\\n *\\n * _Available since v3.1._\\n */\\ninterface IERC1155 is IERC165 {\\n    /**\\n     * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.\\n     */\\n    event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);\\n\\n    /**\\n     * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all\\n     * transfers.\\n     */\\n    event TransferBatch(\\n        address indexed operator,\\n        address indexed from,\\n        address indexed to,\\n        uint256[] ids,\\n        uint256[] values\\n    );\\n\\n    /**\\n     * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to\\n     * `approved`.\\n     */\\n    event ApprovalForAll(address indexed account, address indexed operator, bool approved);\\n\\n    /**\\n     * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.\\n     *\\n     * If an {URI} event was emitted for `id`, the standard\\n     * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value\\n     * returned by {IERC1155MetadataURI-uri}.\\n     */\\n    event URI(string value, uint256 indexed id);\\n\\n    /**\\n     * @dev Returns the amount of tokens of token type `id` owned by `account`.\\n     *\\n     * Requirements:\\n     *\\n     * - `account` cannot be the zero address.\\n     */\\n    function balanceOf(address account, uint256 id) external view returns (uint256);\\n\\n    /**\\n     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.\\n     *\\n     * Requirements:\\n     *\\n     * - `accounts` and `ids` must have the same length.\\n     */\\n    function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids)\\n        external\\n        view\\n        returns (uint256[] memory);\\n\\n    /**\\n     * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,\\n     *\\n     * Emits an {ApprovalForAll} event.\\n     *\\n     * Requirements:\\n     *\\n     * - `operator` cannot be the caller.\\n     */\\n    function setApprovalForAll(address operator, bool approved) external;\\n\\n    /**\\n     * @dev Returns true if `operator` is approved to transfer ``account``'s tokens.\\n     *\\n     * See {setApprovalForAll}.\\n     */\\n    function isApprovedForAll(address account, address operator) external view returns (bool);\\n\\n    /**\\n     * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.\\n     *\\n     * Emits a {TransferSingle} event.\\n     *\\n     * Requirements:\\n     *\\n     * - `to` cannot be the zero address.\\n     * - If the caller is not `from`, it must be have been approved to spend ``from``'s tokens via {setApprovalForAll}.\\n     * - `from` must have a balance of tokens of type `id` of at least `amount`.\\n     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the\\n     * acceptance magic value.\\n     */\\n    function safeTransferFrom(\\n        address from,\\n        address to,\\n        uint256 id,\\n        uint256 amount,\\n        bytes calldata data\\n    ) external;\\n\\n    /**\\n     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.\\n     *\\n     * Emits a {TransferBatch} event.\\n     *\\n     * Requirements:\\n     *\\n     * - `ids` and `amounts` must have the same length.\\n     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the\\n     * acceptance magic value.\\n     */\\n    function safeBatchTransferFrom(\\n        address from,\\n        address to,\\n        uint256[] calldata ids,\\n        uint256[] calldata amounts,\\n        bytes calldata data\\n    ) external;\\n}\\n\"\r\n    },\r\n    \"@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol\": {\r\n      \"content\": \"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/IERC1155Receiver.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../utils/introspection/IERC165.sol\\\";\\n\\n/**\\n * @dev _Available since v3.1._\\n */\\ninterface IERC1155Receiver is IERC165 {\\n    /**\\n     * @dev Handles the receipt of a single ERC1155 token type. This function is\\n     * called at the end of a `safeTransferFrom` after the balance has been updated.\\n     *\\n     * NOTE: To accept the transfer, this must return\\n     * `bytes4(keccak256(\\\"onERC1155Received(address,address,uint256,uint256,bytes)\\\"))`\\n     * (i.e. 0xf23a6e61, or its own function selector).\\n     *\\n     * @param operator The address which initiated the transfer (i.e. msg.sender)\\n     * @param from The address which previously owned the token\\n     * @param id The ID of the token being transferred\\n     * @param value The amount of tokens being transferred\\n     * @param data Additional data with no specified format\\n     * @return `bytes4(keccak256(\\\"onERC1155Received(address,address,uint256,uint256,bytes)\\\"))` if transfer is allowed\\n     */\\n    function onERC1155Received(\\n        address operator,\\n        address from,\\n        uint256 id,\\n        uint256 value,\\n        bytes calldata data\\n    ) external returns (bytes4);\\n\\n    /**\\n     * @dev Handles the receipt of a multiple ERC1155 token types. This function\\n     * is called at the end of a `safeBatchTransferFrom` after the balances have\\n     * been updated.\\n     *\\n     * NOTE: To accept the transfer(s), this must return\\n     * `bytes4(keccak256(\\\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\\\"))`\\n     * (i.e. 0xbc197c81, or its own function selector).\\n     *\\n     * @param operator The address which initiated the batch transfer (i.e. msg.sender)\\n     * @param from The address which previously owned the token\\n     * @param ids An array containing ids of each token being transferred (order and length must match values array)\\n     * @param values An array containing amounts of each token being transferred (order and length must match ids array)\\n     * @param data Additional data with no specified format\\n     * @return `bytes4(keccak256(\\\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\\\"))` if transfer is allowed\\n     */\\n    function onERC1155BatchReceived(\\n        address operator,\\n        address from,\\n        uint256[] calldata ids,\\n        uint256[] calldata values,\\n        bytes calldata data\\n    ) external returns (bytes4);\\n}\\n\"\r\n    },\r\n    \"@openzeppelin/contracts/token/ERC1155/extensions/IERC1155MetadataURI.sol\": {\r\n      \"content\": \"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/IERC1155MetadataURI.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC1155.sol\\\";\\n\\n/**\\n * @dev Interface of the optional ERC1155MetadataExtension interface, as defined\\n * in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP].\\n *\\n * _Available since v3.1._\\n */\\ninterface IERC1155MetadataURI is IERC1155 {\\n    /**\\n     * @dev Returns the URI for token type `id`.\\n     *\\n     * If the `\\\\{id\\\\}` substring is present in the URI, it must be replaced by\\n     * clients with the actual token type ID.\\n     */\\n    function uri(uint256 id) external view returns (string memory);\\n}\\n\"\r\n    },\r\n    \"@openzeppelin/contracts/utils/Address.sol\": {\r\n      \"content\": \"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n    /**\\n     * @dev Returns true if `account` is a contract.\\n     *\\n     * [IMPORTANT]\\n     * ====\\n     * It is unsafe to assume that an address for which this function returns\\n     * false is an externally-owned account (EOA) and not a contract.\\n     *\\n     * Among others, `isContract` will return false for the following\\n     * types of addresses:\\n     *\\n     *  - an externally-owned account\\n     *  - a contract in construction\\n     *  - an address where a contract will be created\\n     *  - an address where a contract lived, but was destroyed\\n     * ====\\n     *\\n     * [IMPORTANT]\\n     * ====\\n     * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n     *\\n     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n     * constructor.\\n     * ====\\n     */\\n    function isContract(address account) internal view returns (bool) {\\n        // This method relies on extcodesize/address.code.length, which returns 0\\n        // for contracts in construction, since the code is only stored at the end\\n        // of the constructor execution.\\n\\n        return account.code.length > 0;\\n    }\\n\\n    /**\\n     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n     * `recipient`, forwarding all available gas and reverting on errors.\\n     *\\n     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n     * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n     * imposed by `transfer`, making them unable to receive funds via\\n     * `transfer`. {sendValue} removes this limitation.\\n     *\\n     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n     *\\n     * IMPORTANT: because control is transferred to `recipient`, care must be\\n     * taken to not create reentrancy vulnerabilities. Consider using\\n     * {ReentrancyGuard} or the\\n     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n     */\\n    function sendValue(address payable recipient, uint256 amount) internal {\\n        require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n        (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n        require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n    }\\n\\n    /**\\n     * @dev Performs a Solidity function call using a low level `call`. A\\n     * plain `call` is an unsafe replacement for a function call: use this\\n     * function instead.\\n     *\\n     * If `target` reverts with a revert reason, it is bubbled up by this\\n     * function (like regular Solidity function calls).\\n     *\\n     * Returns the raw returned data. To convert to the expected return value,\\n     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n     *\\n     * Requirements:\\n     *\\n     * - `target` must be a contract.\\n     * - calling `target` with `data` must not revert.\\n     *\\n     * _Available since v3.1._\\n     */\\n    function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n        return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n    }\\n\\n    /**\\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n     * `errorMessage` as a fallback revert reason when `target` reverts.\\n     *\\n     * _Available since v3.1._\\n     */\\n    function functionCall(\\n        address target,\\n        bytes memory data,\\n        string memory errorMessage\\n    ) internal returns (bytes memory) {\\n        return functionCallWithValue(target, data, 0, errorMessage);\\n    }\\n\\n    /**\\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n     * but also transferring `value` wei to `target`.\\n     *\\n     * Requirements:\\n     *\\n     * - the calling contract must have an S balance of at least `value`.\\n     * - the called Solidity function must be `payable`.\\n     *\\n     * _Available since v3.1._\\n     */\\n    function functionCallWithValue(\\n        address target,\\n        bytes memory data,\\n        uint256 value\\n    ) internal returns (bytes memory) {\\n        return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n    }\\n\\n    /**\\n     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n     * with `errorMessage` as a fallback revert reason when `target` reverts.\\n     *\\n     * _Available since v3.1._\\n     */\\n    function functionCallWithValue(\\n        address target,\\n        bytes memory data,\\n        uint256 value,\\n        string memory errorMessage\\n    ) internal returns (bytes memory) {\\n        require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n        require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n        (bool success, bytes memory returndata) = target.call{value: value}(data);\\n        return verifyCallResult(success, returndata, errorMessage);\\n    }\\n\\n    /**\\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n     * but performing a static call.\\n     *\\n     * _Available since v3.3._\\n     */\\n    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n        return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n    }\\n\\n    /**\\n     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n     * but performing a static call.\\n     *\\n     * _Available since v3.3._\\n     */\\n    function functionStaticCall(\\n        address target,\\n        bytes memory data,\\n        string memory errorMessage\\n    ) internal view returns (bytes memory) {\\n        require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n        (bool success, bytes memory returndata) = target.staticcall(data);\\n        return verifyCallResult(success, returndata, errorMessage);\\n    }\\n\\n    /**\\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n     * but performing a delegate call.\\n     *\\n     * _Available since v3.4._\\n     */\\n    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n        return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n    }\\n\\n    /**\\n     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n     * but performing a delegate call.\\n     *\\n     * _Available since v3.4._\\n     */\\n    function functionDelegateCall(\\n        address target,\\n        bytes memory data,\\n        string memory errorMessage\\n    ) internal returns (bytes memory) {\\n        require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n        (bool success, bytes memory returndata) = target.delegatecall(data);\\n        return verifyCallResult(success, returndata, errorMessage);\\n    }\\n\\n    /**\\n     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n     * revert reason using the provided one.\\n     *\\n     * _Available since v4.3._\\n     */\\n    function verifyCallResult(\\n        bool success,\\n        bytes memory returndata,\\n        string memory errorMessage\\n    ) internal pure returns (bytes memory) {\\n        if (success) {\\n            return returndata;\\n        } else {\\n            // Look for revert reason and bubble it up if present\\n            if (returndata.length > 0) {\\n                // The easiest way to bubble the revert reason is using memory via assembly\\n\\n                assembly {\\n                    let returndata_size := mload(returndata)\\n                    revert(add(32, returndata), returndata_size)\\n                }\\n            } else {\\n                revert(errorMessage);\\n            }\\n        }\\n    }\\n}\\n\"\r\n    },\r\n    \"@openzeppelin/contracts/utils/Context.sol\": {\r\n      \"content\": \"// SPDX-License-Identifier: MIT\\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\"\r\n    },\r\n    \"@openzeppelin/contracts/utils/introspection/ERC165.sol\": {\r\n      \"content\": \"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IERC165.sol\\\";\\n\\n/**\\n * @dev Implementation of the {IERC165} interface.\\n *\\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\\n * for the additional interface id that will be supported. For example:\\n *\\n * ```solidity\\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n *     return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\\n * }\\n * ```\\n *\\n * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.\\n */\\nabstract contract ERC165 is IERC165 {\\n    /**\\n     * @dev See {IERC165-supportsInterface}.\\n     */\\n    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n        return interfaceId == type(IERC165).interfaceId;\\n    }\\n}\\n\"\r\n    },\r\n    \"@openzeppelin/contracts/utils/introspection/IERC165.sol\": {\r\n      \"content\": \"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC165 standard, as defined in the\\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\\n *\\n * Implementers can declare support of contract interfaces, which can then be\\n * queried by others ({ERC165Checker}).\\n *\\n * For an implementation, see {ERC165}.\\n */\\ninterface IERC165 {\\n    /**\\n     * @dev Returns true if this contract implements the interface defined by\\n     * `interfaceId`. See the corresponding\\n     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\\n     * to learn more about how these ids are created.\\n     *\\n     * This function call must use less than 30 000 gas.\\n     */\\n    function supportsInterface(bytes4 interfaceId) external view returns (bool);\\n}\\n\"\r\n    },\r\n    \"project:/contracts/mkr.sol\": {\r\n      \"content\": \"// SPDX-License-Identifier: MIT\\r\\npragma solidity ^0.8.4;\\r\\n\\r\\nimport \\\"@openzeppelin/contracts/token/ERC1155/ERC1155.sol\\\";\\r\\nimport \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\r\\n\\r\\ncontract WAGMI is ERC1155, Ownable {\\r\\n    constructor()\\r\\n        ERC1155(\\\"https://gateway.pinata.cloud/ipfs/QmZmKtPtCRLwKG3v72moDkjZ4f79KcgbLiznpNaVVH14cW\\\")\\r\\n    {}\\r\\n\\r\\n    function setURI(string memory newuri) public onlyOwner {\\r\\n        _setURI(newuri);\\r\\n    }\\r\\n\\r\\n    function mint(address account, uint256 id, uint256 amount, bytes memory data)\\r\\n        public\\r\\n        onlyOwner\\r\\n    {\\r\\n        _mint(account, id, amount, data);\\r\\n    }\\r\\n\\r\\n    function mintBatch(address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data)\\r\\n        public\\r\\n        onlyOwner\\r\\n    {\\r\\n        _mintBatch(to, ids, amounts, data);\\r\\n    }\\r\\n}\\r\\n\"\r\n    }\r\n  },\r\n  \"settings\": {\r\n    \"remappings\": [],\r\n    \"optimizer\": {\r\n      \"enabled\": true,\r\n      \"runs\": 200\r\n    },\r\n    \"evmVersion\": \"istanbul\",\r\n    \"outputSelection\": {\r\n      \"*\": {\r\n        \"*\": [\r\n          \"evm.bytecode\",\r\n          \"evm.deployedBytecode\",\r\n          \"abi\"\r\n        ]\r\n      }\r\n    }\r\n  }\r\n}}",
         "ABI":"[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"ApprovalForAll\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"ids\",\"type\":\"uint256[]\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"}],\"name\":\"TransferBatch\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"TransferSingle\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"string\",\"name\":\"value\",\"type\":\"string\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"URI\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"accounts\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"ids\",\"type\":\"uint256[]\"}],\"name\":\"balanceOfBatch\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"name\":\"isApprovedForAll\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"mint\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256[]\",\"name\":\"ids\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256[]\",\"name\":\"amounts\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"mintBatch\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256[]\",\"name\":\"ids\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256[]\",\"name\":\"amounts\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"safeBatchTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"safeTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"setApprovalForAll\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"newuri\",\"type\":\"string\"}],\"name\":\"setURI\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"uri\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]",
         "ContractName":"WAGMI",
         "CompilerVersion":"v0.8.4+commit.c7e474f2",
         "OptimizationUsed":"1",
         "Runs":"200",
         "ConstructorArguments":"",
         "EVMVersion":"istanbul",
         "Library":"",
         "LicenseType":"None",
         "Proxy":"0",
         "Implementation":"",
         "SwarmSource":"ipfs://ce01da73b6e7a7efdd6878562a016aed3e6d93f7b7039d98dc5e9e54d0c5f5e1"
      }
   ]
}
//Submit Source Code for Verification
$.ajax({
    type: "POST", //Only POST supported  
    url: "//api-sepolia.etherscan.io/api", //Set to the  correct API url for Other Networks
    data: {
        apikey: $('#apikey').val(),                     //A valid API-Key is required        
        module: 'contract',                             //Do not change
        action: 'verifysourcecode',                     //Do not change
        contractaddress: $('#contractaddress').val(),   //Contract Address starts with 0x...     
        sourceCode: $('#sourceCode').val(),             //Contract Source Code (Flattened if necessary)
        codeformat: $('#codeformat').val(),             //solidity-single-file (default) or solidity-standard-json-input (for std-input-json-format support
        contractname: $('#contractname').val(),         //ContractName (if codeformat=solidity-standard-json-input, then enter contractname as ex: erc20.sol:erc20)
        compilerversion: $('#compilerversion').val(),   // see https://testnet.sonicscan.org/solcversions for list of support versions
        optimizationUsed: $('#optimizationUsed').val(), //0 = No Optimization, 1 = Optimization used (applicable when codeformat=solidity-single-file)
        runs: 200,                                      //set to 200 as default unless otherwise  (applicable when codeformat=solidity-single-file)        
        constructorArguements: $('#constructorArguements').val(),   //if applicable
        evmversion: $('#evmVersion').val(),             //leave blank for compiler default, homestead, tangerineWhistle, spuriousDragon, byzantium, constantinople, petersburg, istanbul (applicable when codeformat=solidity-single-file)
        licenseType: $('#licenseType').val(),           //Valid codes 1-12 where 1=No License .. 12=Apache 2.0, see https://testnet.sonicscan.org/contract-license-types
        libraryname1: $('#libraryname1').val(),         //if applicable, a matching pair with libraryaddress1 required
        libraryaddress1: $('#libraryaddress1').val(),   //if applicable, a matching pair with libraryname1 required
        libraryname2: $('#libraryname2').val(),         //if applicable, matching pair required
        libraryaddress2: $('#libraryaddress2').val(),   //if applicable, matching pair required
        libraryname3: $('#libraryname3').val(),         //if applicable, matching pair required
        libraryaddress3: $('#libraryaddress3').val(),   //if applicable, matching pair required
        libraryname4: $('#libraryname4').val(),         //if applicable, matching pair required
        libraryaddress4: $('#libraryaddress4').val(),   //if applicable, matching pair required
        libraryname5: $('#libraryname5').val(),         //if applicable, matching pair required
        libraryaddress5: $('#libraryaddress5').val(),   //if applicable, matching pair required
        libraryname6: $('#libraryname6').val(),         //if applicable, matching pair required
        libraryaddress6: $('#libraryaddress6').val(),   //if applicable, matching pair required
        libraryname7: $('#libraryname7').val(),         //if applicable, matching pair required
        libraryaddress7: $('#libraryaddress7').val(),   //if applicable, matching pair required
        libraryname8: $('#libraryname8').val(),         //if applicable, matching pair required
        libraryaddress8: $('#libraryaddress8').val(),   //if applicable, matching pair required
        libraryname9: $('#libraryname9').val(),         //if applicable, matching pair required
        libraryaddress9: $('#libraryaddress9').val(),   //if applicable, matching pair required
        libraryname10: $('#libraryname10').val(),       //if applicable, matching pair required
        libraryaddress10: $('#libraryaddress10').val()  //if applicable, matching pair required
    },
    success: function (result) {
        console.log(result);
        if (result.status == "1") {
            //1 = submission success, use the guid returned (result.result) to check the status of your submission.
            // Average time of processing is 30-60 seconds
            document.getElementById("postresult").innerHTML = result.status + ";" + result.message + ";" + result.result;
            // result.result is the GUID receipt for the submission, you can use this guid for checking the verification status
        } else {
            //0 = error
            document.getElementById("postresult").innerHTML = result.status + ";" + result.message + ";" + result.result;
        }
        console.log("status : " + result.status);
        console.log("result : " + result.result);
    },
    error: function (result) {
        console.log("error!");
        document.getElementById("postresult").innerHTML = "Unexpected Error"
    }
});
//Check Source Code Verification Status
$.ajax({
    type: "GET",
    url: "//api-sepolia.etherscan.io/api",
    data: {
        apikey: $('#apikey').val(), 
        guid: 'ezq878u486pzijkvvmerl6a9mzwhv6sefgvqi5tkwceejc7tvn', //Replace with your Source Code GUID receipt above
        module: "contract",
        action: "checkverifystatus"
    },
    success: function (result) {
        console.log("status : " + result.status);   //0=Error, 1=Pass 
        console.log("message : " + result.message); //OK, NOTOK
        console.log("result : " + result.result);   //result explanation
        $('#guidstatus').html(">> " + result.result);
    },
    error: function (result) {
        alert('error');
    }
});
// example with only the mandatory contract address parameter
curl -d "address=0xcbdcd3815b5f975e1a2c944a9b2cd1c985a1cb7f" "https://api-testnet.sonicscan.org/api?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-testnet.sonicscan.org/api?module=contract&action=verifyproxycontract&apikey=YourApiKeyToken"
// OK
{"status":"1","message":"OK","result":"gwgrrnfy56zf6vc1fljuejwg6pelnc5yns6fg6y2i6zfpgzquz"}

// NOTOK
{"status":"0","message":"NOTOK","result":"Invalid API Key"}
curl "https://api-testnet.sonicscan.org/api?module=contract&action=checkproxyverification&guid=gwgrrnfy56zf6vc1fljuejwg6pelnc5yns6fg6y2i6zfpgzquz&apikey=YourApiKeyToken"
// OK
{"status":"1","message":"OK","result":"The proxy's (0xbc46363a7669f6e12353fa95bb067aead3675c29) implementation contract is found at 0xe45a5176bc0f2c1198e2451c4e4501d4ed9b65a6 and is successfully updated."}
                                    
// NOTOK
{"status":"0","message":"NOTOK","result":"A corresponding implementation contract was unfortunately not detected for the proxy address."}
📝
👇
Verified Contract Source Codes
✅
Verified Contracts Source Code
🔗
browser
Verified Contract Source Codes
📩
CSV list of verified contracts addresses
🔗
browser
Etherscan API key
supported solc versions
Verified Contracts

Tokens

Get ERC20-Token TotalSupply by ContractAddress

Returns the current amount of an ERC-20 token in circulation.

Get ERC20-Token Account Balance for TokenContractAddress

Returns the current balance of an ERC-20 token of an address.

Query Parameters

Sample Response

Eg. a token with a balance of 215.241526476136819398 and 18 decimal places will be returned as 215241526476136819398

Try this endpoint in your

Query Parameters

Parameter
Description

Sample Response

Tip : The result is returned in the token's smallest decimal representation.

Eg. a token with a balance of 215.241526476136819398 and 18 decimal places will be returned as 215241526476136819398

Try this endpoint in your

Parameter
Description

Tip : The result is returned in the token's smallest decimal representation.

https://api-testnet.sonicscan.org/api
   ?module=stats
   &action=tokensupply
   &contractaddress=0x639d4384b429ea4660f377b7a29dae6d2255090f
   &apikey=YourApiKeyToken
https://api-testnet.sonicscan.org/api
   ?module=account
   &action=tokenbalance
   &contractaddress=0x639d4384b429ea4660f377b7a29dae6d2255090f
   &address=0x955866ee0bd3b8b0be4d4ea306670f34b90ef3ed
   &tag=latest&apikey=YourApiKeyToken

contractaddress

the contract address of the ERC-20 token

address

the string representing the address to check for token balance

{
   "status":"1",
   "message":"OK",
   "result":"10000000000000000000000"
}

contractaddress

the contract address of the ERC-20 token

{
   "status":"1",
   "message":"OK",
   "result":"10000000000000000000000"
}
📈
📈
🔗
browser
🔗
browser

Accounts

Get S Balance for a Single Address

Returns the S balance of a given address.

https://api-testnet.sonicscan.org/api
   ?module=account
   &action=balance
   &address=0x382b4ca2c4a7cd28c1c400c69d81ec2b2637f7dd
   &tag=latest
   &apikey=YourApiKeyToken

Get S Balance for Multiple Addresses in a Single Call

Returns the balance of the accounts from a list of addresses.

https://api-testnet.sonicscan.org/api
   ?module=account
   &action=balancemulti
   &address=https://api-testnet.sonicscan.org/api?module=account&action=balance&address=0x382b4ca2c4a7cd28c1c400c69d81ec2b2637f7dd,0x382b4ca2c4a7cd28c1c400c69d81ec2b2637f7dd,0x8a5847fd0e592b058c026c5fdc322aee834b87f5&tag=latest&apikey=YourApiKeyToken,0x63a9dbCe75413036B2B778E670aaBd4493aAF9F3,0xd82b6aB1f20A21484fA5E28221B95425dddC5E8E
   &apikey=YourApiKeyToken

Query Parameters

Parameter
Description

address

the strings representing the addresses to check for balance, separated by , commas up to 20 addresses per call

tag

the integer pre-defined block parameter, either earliest, pending or latest

Sample Response

{
   "status":"1",
   "message":"OK",
   "result":[
      {
         "account":"0x382b4ca2c4a7cd28c1c400c69d81ec2b2637f7dd",
         "balance":"206796937658929992503000"
      },
      {
         "account":"0x382b4ca2c4a7cd28c1c400c69d81ec2b2637f7dd",
         "balance":"206796937658929992503000"
      },
      {
         "account":"0x8a5847fd0e592b058c026c5fdc322aee834b87f5",
         "balance":"16288712393992050891"
      }
   ]
}

Get a list of 'Normal' Transactions By Address

Returns the list of transactions performed by an address, with optional pagination.

https://api-testnet.sonicscan.org/api
   ?module=account
   &action=txlist
   &address=0x382b4ca2c4a7cd28c1c400c69d81ec2b2637f7dd
   &startblock=0
   &endblock=99999999
   &page=1
   &offset=10
   &sort=asc
   &apikey=YourApiKeyToken

Query Parameters

Parameter
Description

address

the string representing the addresses to check for balance

startblock

the integer block number to start searching for transactions

endblock

the integer block number to stop searching for transactions

page

the integer page number, if pagination is enabled

offset

the number of transactions displayed per page

sort

the sorting preference, use asc to sort by ascending and desc to sort by descending

Sample Response

{
   "status":"1",
   "message":"OK-Missing/Invalid API Key, rate limit of 1/5sec applied",
   "result":[
      {
         "blockNumber":"1037571",
         "timeStamp":"1651759857",
         "hash":"0x710e53707c79dd438a8bc3db2a45a123af6dba0d4a653a134035306d11f415fd",
         "nonce":"5",
         "blockHash":"0x64201f8940cee65186f64adb68a99fe3da0450bc9490617aeedd08f80cb8e29b",
         "transactionIndex":"0",
         "from":"0x10f5d45854e038071485ac9e402308cf80d2d2fe",
         "to":"0x382b4ca2c4a7cd28c1c400c69d81ec2b2637f7dd",
         "value":"50000000000000000000000",
         "gas":"21000",
         "gasPrice":"1500000007",
         "isError":"0",
         "txreceipt_status":"1",
         "input":"0x",
         "contractAddress":"",
         "cumulativeGasUsed":"21000",
         "gasUsed":"21000",
         "confirmations":"48476"
      },
      {
         "blockNumber":"1061942",
         "timeStamp":"1652077697",
         "hash":"0x7734cae034c8a7198a5988c5ae927adf30cf77d2cbb25ed996278e402c0e0032",
         "nonce":"0",
         "blockHash":"0xedc7119adb34edf5480fe52f090dedbef647948ffc91806afe7d8b0182781b40",
         "transactionIndex":"0",
         "from":"0x382b4ca2c4a7cd28c1c400c69d81ec2b2637f7dd",
         "to":"0x93e973436cd7757f21b1c947599f67082624a721",
         "value":"1000000000000000",
         "gas":"21000",
         "gasPrice":"2000000007",
         "isError":"0",
         "txreceipt_status":"1",
         "input":"0x",
         "contractAddress":"",
         "cumulativeGasUsed":"21000",
         "gasUsed":"21000",
         "confirmations":"24105"
      }
   ]
}

Get a list of 'Internal' Transactions by Address

Returns the list of internal transactions performed by an address, with optional pagination.

https://api-testnet.sonicscan.org/api
   ?module=account
   &action=txlistinternal
   &address=0xa4fadaa5e8577fee5799e2bd9615014013b45c5d
   &startblock=0
   &endblock=99999999
   &page=1
   &offset=10
   &sort=asc
   &apikey=YourApiKeyToken

Query Parameters

Parameter
Description

address

the string representing the addresses to check for balance

startblock

the integer block number to start searching for transactions

endblock

the integer block number to stop searching for transactions

page

the integer page number, if pagination is enabled

offset

the number of transactions displayed per page

sort

the sorting preference, use asc to sort by ascending and desc to sort by descending

Sample Response

{
   "status":"1",
   "message":"OK",
   "result":[
      {
         "blockNumber":"765371",
         "timeStamp":"1648218619",
         "hash":"0xcb6609b6f9133fc1bfd189fb52ed616968a5f7c56af8da3bd6724f7655fe5f78",
         "from":"0x02f11eabf51d28bb0bae795e256ce52161d65c2b",
         "to":"0xa4fadaa5e8577fee5799e2bd9615014013b45c5d",
         "value":"10000000000000000",
         "contractAddress":"",
         "input":"",
         "type":"call",
         "gas":"2300",
         "gasUsed":"0",
         "traceId":"0_1",
         "isError":"0",
         "errCode":""
      }
   ]
}

Get 'Internal Transactions' by Transaction Hash

Returns the list of internal transactions performed within a transaction.

Note : This API endpoint returns a maximum of 10000 records only.

https://api-testnet.sonicscan.org/api
   ?module=account
   &action=txlistinternal
   &txhash=0xb730ee4dc8d0274be31d1e31ed7fe9749d7a67c0e35b297f3c2d10b06c1f6f1e
   &apikey=YourApiKeyToken

Query Parameters

Parameter
Description

txhash

the string representing the transaction hash to check for internal transactions

Sample Response

{
   "status":"1",
   "message":"OK",
   "result":[
      {
         "blockNumber":"312070",
         "timeStamp":"1639592011",
         "from":"0xa234eead085ac80a4f7cc5220789e048373f0f1e",
         "to":"",
         "value":"0",
         "contractAddress":"0x63a19c2868e469ffc2c8346c93f81ff6e140ffaf",
         "input":"",
         "type":"create",
         "gas":"8504616",
         "gasUsed":"134349",
         "isError":"0",
         "errCode":""
      },
     
      {
         "blockNumber":"312070",
         "timeStamp":"1639592011",
         "from":"0xa234eead085ac80a4f7cc5220789e048373f0f1e",
         "to":"",
         "value":"0",
         "contractAddress":"0xe05ba0186f4a5a5d0eb8a5394d8413411ffd321c",
         "input":"",
         "type":"create",
         "gas":"1119086",
         "gasUsed":"134349",
         "isError":"0",
         "errCode":""
      },
      {
         "blockNumber":"312070",
         "timeStamp":"1639592011",
         "from":"0xa234eead085ac80a4f7cc5220789e048373f0f1e",
         "to":"",
         "value":"0",
         "contractAddress":"0x7b99f4f6260c3cd12984e8d2b83eaf51d44e2254",
         "input":"",
         "type":"create",
         "gas":"134349",
         "gasUsed":"134349",
         "isError":"0",
         "errCode":""
      }
   ]
}

The isError field returns 0 for successful transactions and 1 for rejected/cancelled transactions.

Get "Internal Transactions" by Block Range

Returns the list of internal transactions performed within a block range, with optional pagination.

https://api-testnet.sonicscan.org/api
   ?module=account
   &action=txlistinternal
   &startblock=484887
   &endblock=765371
   &page=1
   &offset=10
   &sort=asc
   &apikey=YourApiKeyToken

Query Parameters

Parameter
Description

startblock

the integer block number to start searching for transactions

endblock

the integer block number to stop searching for transactions

page

the integer page number, if pagination is enabled

offset

the number of transactions displayed per page

sort

the sorting preference, use asc to sort by ascending and desc to sort by descending

Sample Response

{
   "status":"1",
   "message":"OK",
   "result":[
      {
         "blockNumber":"484887",
         "timeStamp":"1644613109",
         "hash":"0xc3ff81084b157b7d695f3df8636eebcacb6ca938c62c3102492978dbe8f5879b",
         "from":"0x9bcdb32c4d0f0992bfb926a28ee2cb7b9d9750cc",
         "to":"0x105083929bf9bb22c26cb1777ec92661170d4285",
         "value":"3906875000000000000000",
         "contractAddress":"",
         "input":"",
         "type":"call",
         "gas":"2300",
         "gasUsed":"0",
         "traceId":"0_1",
         "isError":"0",
         "errCode":""
      },
      {
         "blockNumber":"498080",
         "timeStamp":"1644787132",
         "hash":"0x1ab55087625084f2e1462a49f13a36d0996bff67da3cb4e7250e110e922274bd",
         "from":"0x9bcdb32c4d0f0992bfb926a28ee2cb7b9d9750cc",
         "to":"0x84e9304fa9aafc5e70090eadda9ac2c76d93ad51",
         "value":"1491314746532500000000",
         "contractAddress":"",
         "input":"",
         "type":"call",
         "gas":"2300",
         "gasUsed":"0",
         "traceId":"0_1",
         "isError":"0",
         "errCode":""
      },
      {
         "blockNumber":"518080",
         "timeStamp":"1645046610",
         "hash":"0x1b08041082471d96bbf5362db688f447ce8c775d242998a3b190211560911d86",
         "from":"0x9bcdb32c4d0f0992bfb926a28ee2cb7b9d9750cc",
         "to":"0x105083929bf9bb22c26cb1777ec92661170d4285",
         "value":"4250625000000000000000",
         "contractAddress":"",
         "input":"",
         "type":"call",
         "gas":"2300",
         "gasUsed":"0",
         "traceId":"0_1",
         "isError":"0",
         "errCode":""
      }
   ]
}

The isError field returns 0 for successful transactions and 1 for rejected/cancelled transactions.

Get a list of 'ERC20 - Token Transfer Events' by Address

Returns the list of ERC-20 tokens transferred by an address, with optional filtering by token contract.

https://api-testnet.sonicscan.org/api
   ?module=account
   &action=tokentx
   &contractaddress=0xa808b14492AC6E33419ac16112154D40D0A4AEBA
   &address=0x105083929bf9bb22c26cb1777ec92661170d4285
   &page=1
   &offset=100
   &startblock=0
   &endblock=99999999
   &sort=asc
   &apikey=YourApiKeyToken

Usage:

  • ERC-20 transfers from an address, specify the address parameter

  • ERC-20 transfers from a contract address, specify the contract address parameter

  • ERC-20 transfers from an address filtered by a token contract, specify both address and contract address parameters.

Query Parameters

Parameter
Description

address

the string representing the address to check for balance

contractaddress

the string representing the token contract address to check for balance

page

the integer page number, if pagination is enabled

offset

the number of transactions displayed per page

startblock

the integer block number to start searching for transactions

endblock

the integer block number to stop searching for transactions

sort

the sorting preference, use asc to sort by ascending and desc to sort by descending

Sample Response

{
   "status":"1",
   "message":"OK",
   "result":[
      {
         "blockNumber":"496492",
         "timeStamp":"1644767322",
         "hash":"0x433994d50986d0c021098adadac4f4a89249c51fb4ea372e553af6ee6fc0965c",
         "nonce":"20",
         "blockHash":"0x29394a72a707d77a167a1eec53d33940b5a366a2c01cd10094c18a15517ff44b",
         "from":"0x84e9304fa9aafc5e70090eadda9ac2c76d93ad51",
         "contractAddress":"0xa808b14492ac6e33419ac16112154d40d0a4aeba",
         "to":"0x105083929bf9bb22c26cb1777ec92661170d4285",
         "value":"100000000000000000000000",
         "tokenName":"Vitcoin",
         "tokenSymbol":"VTC",
         "tokenDecimal":"18",
         "transactionIndex":"0",
         "gas":"53517",
         "gasPrice":"1000000007",
         "gasUsed":"35678",
         "cumulativeGasUsed":"35678",
         "input":"deprecated",
         "confirmations":"589603"
      },
      {
         "blockNumber":"886779",
         "timeStamp":"1649789803",
         "hash":"0x1071238546873837a9b03736a8ca26ce379e66999f6e74748dd919890232e34a",
         "nonce":"28",
         "blockHash":"0xd1a3ad751eba89ac664e691844a5a44361d8c801ce6bbfe31c03f1d7970e28f7",
         "from":"0x84e9304fa9aafc5e70090eadda9ac2c76d93ad51",
         "contractAddress":"0xa808b14492ac6e33419ac16112154d40d0a4aeba",
         "to":"0x105083929bf9bb22c26cb1777ec92661170d4285",
         "value":"999900000000000000000000000",
         "tokenName":"Vitcoin",
         "tokenSymbol":"VTC",
         "tokenDecimal":"18",
         "transactionIndex":"0",
         "gas":"53553",
         "gasPrice":"1500000007",
         "gasUsed":"30902",
         "cumulativeGasUsed":"30902",
         "input":"deprecated",
         "confirmations":"199316"
      }
   ]
}

Get a list of 'ERC721 - Token Transfer Events' by Address

Returns the list of ERC-721 ( NFT ) tokens transferred by an address, with optional filtering by token contract

https://api-testnet.sonicscan.org/api
   ?module=account
   &action=tokennfttx
   &contractaddress=0x31225ffF34ebB599D018A22d2430c2e4fdE32eCa
   &address=0x8a5847fd0e592b058c026c5fdc322aee834b87f5
   &page=1
   &offset=100
   &startblock=0
   &endblock=99999999
   &sort=asc
   &apikey=YourApiKeyToken

Usage:

  • ERC-721 transfers from an address, specify the address parameter

  • ERC-721 transfers from a contract address, specify the contract address parameter

  • ERC-721 transfers from an address filtered by a token contract, specify both address and contract address parameters.

Query Parameters

Parameter
Description

address

the string representing the address to check for balance

contractaddress

the string representing the token contract address to check for balance

page

the integer page number, if pagination is enabled

offset

the number of transactions displayed per page

startblock

the integer block number to start searching for transactions

endblock

the integer block number to stop searching for transactions

sort

the sorting preference, use asc to sort by ascending and desc to sort by descending

Sample Response

{
   "status":"1",
   "message":"OK",
   "result":[
      {
         "blockNumber":"922742",
         "timeStamp":"1650258658",
         "hash":"0xe2e18e8831556beff9e08a9f04e0fd38fe290c9b62a49021cfa6b23cbd8900a3",
         "nonce":"2",
         "blockHash":"0xd3e6974bd02372a60e60399fe71f9f3972b5cb1d409e7751abfcadb302655e19",
         "from":"0x0000000000000000000000000000000000000000",
         "contractAddress":"0x31225fff34ebb599d018a22d2430c2e4fde32eca",
         "to":"0x8a5847fd0e592b058c026c5fdc322aee834b87f5",
         "tokenID":"1",
         "tokenName":"Calcium",
         "tokenSymbol":"CALC",
         "tokenDecimal":"0",
         "transactionIndex":"0",
         "gas":"90805",
         "gasPrice":"2000000007",
         "gasUsed":"90805",
         "cumulativeGasUsed":"90805",
         "input":"deprecated",
         "confirmations":"193136"
      }
   ]
}

Get list of Blocks Mined by Address

Returns the list of blocks mined by an address.

https://api-testnet.sonicscan.org/api
   ?module=account
   &action=getminedblocks
   &address=0x3d080421c9DD5fB387d6e3124f7E1C241ADE9568
   &blocktype=blocks
   &page=1
   &offset=10
   &apikey=YourApiKeyToken

Query Parameters

Parameter
Description

address

the string representing the address to check for balance

blocktype

the string pre-defined block type, either blocks for canonical blocks or uncles for uncle blocks only

page

the integer page number, if pagination is enabled

offset

the number of transactions displayed per page

Sample Response

{
   "status":"1",
   "message":"OK",
   "result":[
      {
         "blockNumber":"1088398",
         "timeStamp":"1652415312",
         "blockReward":"2000000000000000000"
      },
      {
         "blockNumber":"1088395",
         "timeStamp":"1652415289",
         "blockReward":"2000000000000000000"
      },
      {
         "blockNumber":"1088361",
         "timeStamp":"1652414946",
         "blockReward":"2000000000000000000"
      }
   ]
}

Try this endpoint in your

Query Parameters

Parameter
Description

address

the string representing the address to check for balance

tag

the string pre-defined block parameter, either earliest, pending or latest

Sample Response

{
   "status":"1",
   "message":"OK",
   "result":"206796937658929992503000" 
}

Tip: The result is returned in

Convert Ethereum units using our

Try this endpoint in your

Tip: The result is returned in

Convert Ethereum units using our

​​ ​ Note : This API endpoint returns a maximum of 10000 records only.

Try this endpoint in your

Tip: Specify a smaller startblock and endblock range for faster search results.

Note : This API endpoint returns a maximum of 10000 records only.

Try this endpoint in your

Tip: Specify a smaller startblock and endblock range for faster search results

Try this endpoint in your

​​ Note : This API endpoint returns a maximum of 10000 records only.

Try this endpoint in your

Try this endpoint in your

Try this endpoint in your

Try this endpoint in your

Note : The timeStamp is represented in

📝
💡
📝
💡
📝
🔗
browser
📖
wei.
Unit Converter.
🔗
browser
📖
wei.
Unit Converter.
🔗
browser
🔗
browser
🔗
browser
🔗
browser
🔗
browser
🔗
browser
🔗
browser
⏳
Unix timestamp.

Stats

Get Total Supply of S

Returns the current amount of S in circulation.

https://api-testnet.sonicscan.org/api
   ?module=stats
   &action=ethsupply
   &apikey=YourApiKeyToken

Get S Last Price

Returns the latest price of 1 S.

https://api-testnet.sonicscan.org/api
   ?module=stats
   &action=ethprice
   &apikey=YourApiKeyToken

Geth/Parity Proxy

For compatibility with Parity, please prefix all hex strings with " 0x ".

eth_blockNumber

Returns the number of most recent block

https://api-testnet.sonicscan.org/api
   ?module=proxy
   &action=eth_blockNumber
   &apikey=YourApiKeyToken

No parameters required.

Sample response

{
   "jsonrpc":"2.0",
   "result":"0x10a79f",
   "id":83
}

eth_getBlockByNumber

Returns information about a block by block number.

https://api-testnet.sonicscan.org/api
   ?module=proxy
   &action=eth_getBlockByNumber
   &tag=0x91b743
   &boolean=true
   &apikey=YourApiKeyToken

Query Parameters

Parameter
Description

tag

the block number, in hex eg. 0xC36B3C

boolean

the boolean value to show full transaction objects.

when true, returns full transaction objects and their information, when false only returns a list of transactions.

Sample response

{
   "jsonrpc":"2.0",
   "id":1,
   "result":{
      "baseFeePerGas":"0x7",
      "difficulty":"0x1348c54c4",
      "extraData":"0xd883010a11846765746888676f312e31372e37856c696e7578",
      "gasLimit":"0x7a1200",
      "gasUsed":"0x0",
      "hash":"0x2cb5abe6b662c8a676df0c55a8fb01c81fdad7c1e1b7b3e7f8900439fd626c37",
      "logsBloom":"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
      "miner":"0x45ff5f8723dae09d008dae9462346fd806736390",
      "mixHash":"0x914dac73b89721483a62fb78b7fd1110b91d57752afc84e911c34eedef090519",
      "nonce":"0x6517543e5b8f467c",
      "number":"0x10a79f",
      "parentHash":"0xbccd65c8ad26b21413d4593161c7161ea612033d00dd6887673ab3eab283ff7b",
      "receiptsRoot":"0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
      "sha3Uncles":"0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
      "size":"0x21e",
      "stateRoot":"0xa01ded26f5c6b00bfff7b8e244ec361b521093d07d3ce3db9c7b05f918bc877d",
      "timestamp":"0x627e7d2c",
      "totalDifficulty":"0xbf255bf92df41",
      "transactions":[
         
      ],
      "transactionsRoot":"0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
      "uncles":[
         
      ]
   }
}

eth_getUncleByBlockNumberAndIndex

Returns information about a uncle by block number.

https://api-testnet.sonicscan.org/api
   ?module=proxy
   &action=eth_getUncleByBlockNumberAndIndex
   &tag=0x10A7A6
   &index=0x0
   &apikey=YourApiKeyToken

Query Parameters

Parameter
Description

tag

the block number, in hex eg. 0xC36B3C

index

the position of the uncle's index in the block, in hex eg. 0x5

Sample response

{
   "jsonrpc":"2.0",
   "id":1,
   "result":{
      "baseFeePerGas":"0x7",
      "difficulty":"0x133cb6ea4",
      "extraData":"0xd883010a10846765746888676f312e31372e37856c696e7578",
      "gasLimit":"0x7a1200",
      "gasUsed":"0x0",
      "hash":"0xd5aabf16a6cd972bf33b7656143d1305f24273ca44a47908e2c36d8eb69a2d80",
      "logsBloom":"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
      "miner":"0xd87def8bbd2c4d59494611ab259a2005c154212a",
      "mixHash":"0x4c2d04e4f691306fcca2f2623cdac968bc1dc90170a1c7104815cebe424c6411",
      "nonce":"0x4c0da4978732561b",
      "number":"0x10a7a5",
      "parentHash":"0xa92a3d6c31cdbed8d40067930f364291063e01946ca40db7cf4e95866bfcd7f1",
      "receiptsRoot":"0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
      "sha3Uncles":"0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
      "size":"0x21e",
      "stateRoot":"0x5c5ca1001e5f6b383a0bcab31823097146aa364158b12888de02bbff707da299",
      "timestamp":"0x627e7da6",
      "transactionsRoot":"0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
      "uncles":[
         
      ]
   }
}

eth_getBlockTransactionCountByNumber

Returns the number of transactions in a block.

https://api-testnet.sonicscan.org/api
   ?module=proxy
   &action=eth_getBlockTransactionCountByNumber
   &tag=0x10A70A
   &apikey=YourApiKeyToken

Query Parameters

Parameter
Description

tag

the block number, in hex eg. 0x10FB78

Sample response

{
   "jsonrpc":"2.0",
   "id":1,
   "result":"0x1"
}

eth_getTransactionByHash

Returns the information about a transaction requested by transaction hash.

https://api-testnet.sonicscan.org/api
   ?module=proxy
   &action=eth_getTransactionByHash
   &txhash=0x57be61afdf095899d160003f58e429d3f9b0851fd90db217fc0aa474761f9f34
   &apikey=YourApiKeyToken

Query Parameters

Parameter
Description

txhash

the string representing the hash of the transaction

Sample Response

{
   "jsonrpc":"2.0",
   "id":1,
   "result":{
      "blockHash":"0x9329b3b236fb6a60ddec501d9264e587593f7b810fff31c9a2cf1f2deb58ebe2",
      "blockNumber":"0x10a70a",
      "from":"0x382b4ca2c4a7cd28c1c400c69d81ec2b2637f7dd",
      "gas":"0x5208",
      "gasPrice":"0x77359407",
      "maxFeePerGas":"0x77359407",
      "maxPriorityFeePerGas":"0x77359400",
      "hash":"0x57be61afdf095899d160003f58e429d3f9b0851fd90db217fc0aa474761f9f34",
      "input":"0x",
      "nonce":"0x6e",
      "to":"0x97664026bf28d95330dd80174630c287a9c8e2e3",
      "transactionIndex":"0x0",
      "value":"0x35c007914225000",
      "type":"0x2",
      "accessList":[
         
      ],
      "chainId":"0xaa36a7",
      "v":"0x1",
      "r":"0x9c358c4e6ef291967775d0c50e34dbb3a0c602a3d8e616dffb5a513e4ac2018e",
      "s":"0x28dd29246d37f57a35026d315c352042f04afc0709c541a9e0d39df571aa7c67"
   }
}

eth_getTransactionByBlockNumberAndIndex

Returns information about a transaction by block number and transaction index position.

https://api-testnet.sonicscan.org/api
   ?module=proxy
   &action=eth_getTransactionByBlockNumberAndIndex
   &tag=0x10A70A
   &index=0x0
   &apikey=YourApiKeyToken

Query Parameters

Parameter
Description

tag

the block number, in hex eg. 0x10FB78

index

the position of the uncle's index in the block, in hex eg. 0x0

Sample Response

{
   "jsonrpc":"2.0",
   "id":1,
   "result":{
      "blockHash":"0x9329b3b236fb6a60ddec501d9264e587593f7b810fff31c9a2cf1f2deb58ebe2",
      "blockNumber":"0x10a70a",
      "from":"0x382b4ca2c4a7cd28c1c400c69d81ec2b2637f7dd",
      "gas":"0x5208",
      "gasPrice":"0x77359407",
      "maxFeePerGas":"0x77359407",
      "maxPriorityFeePerGas":"0x77359400",
      "hash":"0x57be61afdf095899d160003f58e429d3f9b0851fd90db217fc0aa474761f9f34",
      "input":"0x",
      "nonce":"0x6e",
      "to":"0x97664026bf28d95330dd80174630c287a9c8e2e3",
      "transactionIndex":"0x0",
      "value":"0x35c007914225000",
      "type":"0x2",
      "accessList":[
         
      ],
      "chainId":"0xaa36a7",
      "v":"0x1",
      "r":"0x9c358c4e6ef291967775d0c50e34dbb3a0c602a3d8e616dffb5a513e4ac2018e",
      "s":"0x28dd29246d37f57a35026d315c352042f04afc0709c541a9e0d39df571aa7c67"
   }
}

eth_getTransactionCount

Returns the number of transactions performed by an address.

https://api-testnet.sonicscan.org/api
   ?module=proxy
   &action=eth_getTransactionCount
   &address=0x1d41D6B1091C1a8A334096771bd1776019243d5e
   &tag=latest
   &apikey=YourApiKeyToken

Query Parameters

Parameter
Description

address

the string representing the address to get transaction count

tag

the string pre-defined block parameter, either earliest, pending or latest

Sample Response

{
   "jsonrpc":"2.0",
   "id":1,
   "result":"0x6f"
}

eth_sendRawTransaction

Submits a pre-signed transaction for broadcast to the Ethereum network.

https://api-testnet.sonicscan.org/api
   ?module=proxy
   &action=eth_sendRawTransaction
   &hex=0x02f874030185012a05f200852e90edd00082520894eeee7341f206302f2216e39d715b96d8c6901a1c880de0b6b3a764000080c001a0bf61ea5419c7856be4ea2221b721b849d50fec738d10a714e7aaa809d9ad8838a01e59353aa8e567cc0661fb58b047361998df234df6593bf424839bc5ea214a2c
   &apikey=YourApiKeyToken

Query Parameters

Parameter
Description

hex

the string representing the signed raw transaction data to broadcast.

Sample Response

{
  "id":1,
  "jsonrpc": "2.0",
  "result": "0x84c81fc1e23474e13be0114f94f99b43696830f33292fd1d642f37e87e95acd6"
}

Use eth_getTransactionReceipt to retrieve full details.

eth_getTransactionReceipt

Returns the receipt of a transaction by transaction hash.

https://api-testnet.sonicscan.org/api
   ?module=proxy
   &action=eth_getTransactionReceipt
   &txhash=0x50b43f829e0b7044decbac0dc9216de1c7bf9a271999ed978300da1f5dc90c51
   &apikey=YourApiKeyToken

Query Parameters

Parameter
Description

txhash

the string representing the hash of the transaction

Sample Response

{
   "jsonrpc":"2.0",
   "id":1,
   "result":{
      "blockHash":"0xd201810e935bed977bdb63ac5e8e7328acaefe3ec5447597f8b2493728a6c1e3",
      "blockNumber":"0x10a574",
      "contractAddress":null,
      "cumulativeGasUsed":"0x5208",
      "effectiveGasPrice":"0x59682f07",
      "from":"0x9907dd452706a9783e241d7b16e6ad0759ae051e",
      "gasUsed":"0x5208",
      "logs":[
         
      ],
      "logsBloom":"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
      "status":"0x1",
      "to":"0x105083929bf9bb22c26cb1777ec92661170d4285",
      "transactionHash":"0x50b43f829e0b7044decbac0dc9216de1c7bf9a271999ed978300da1f5dc90c51",
      "transactionIndex":"0x0",
      "type":"0x2"
   }
}

eth_call

Executes a new message call immediately without creating a transaction on the block chain.

https://api-testnet.sonicscan.org/api
   ?module=proxy
   &action=eth_call
   &to=0x272c31fc25e4e609cbcc9e7a9e6171b4b39feaca
   &data=0x60fe47b10000000000000000000000000000000000000000000000000000000000010f2c
   &tag=latest
   &apikey=YourApiKeyToken

Query Parameters

Parameter
Description

to

the string representing the address to interact with

data

the hash of the method signature and encoded parameters

tag

the string pre-defined block parameter, either earliest, pending or latest

Sample Response

{
   "jsonrpc":"2.0",
   "id":1,
   "result":"0x"
}

eth_getCode

Returns code at a given address.

https://api-testnet.sonicscan.org/api
   ?module=proxy
   &action=eth_getCode
   &address=0x272c31fc25e4e609cbcc9e7a9e6171b4b39feaca
   &tag=latest
   &apikey=YourApiKeyToken

Query Parameters

Parameter
Description

address

the string representing the address to get code

tag

the string pre-defined block parameter, either earliest, pending or latest

Sample Response

{
   "jsonrpc":"2.0",
   "id":1,
   "result":"0x608060405234801561001057600080fd5b50600436106100365760003560e01c806360fe47b11461003b5780636d4ce63c14610057575b600080fd5b6100556004803603810190610050919061009d565b610075565b005b61005f61007f565b60405161006c91906100d9565b60405180910390f35b8060008190555050565b60008054905090565b60008135905061009781610103565b92915050565b6000602082840312156100b3576100b26100fe565b5b60006100c184828501610088565b91505092915050565b6100d3816100f4565b82525050565b60006020820190506100ee60008301846100ca565b92915050565b6000819050919050565b600080fd5b61010c816100f4565b811461011757600080fd5b5056fea2646970667358221220d7dae2ccb3d6437f2a190839abef6ef723207c70463c87c2b1257d40c938e42564736f6c63430008070033"
}

eth_getStorageAt

Returns the value from a storage position at a given address.

This endpoint is still experimental and may have potential issues

https://api-testnet.sonicscan.org/api
   ?module=proxy
   &action=eth_getStorageAt
   &address=0x272c31fc25e4e609cbcc9e7a9e6171b4b39feaca
   &position=0x0
   &tag=latest
   &apikey=YourApiKeyToken

Query Parameters

Parameter
Description

address

the string representing the address to get code

position

the hex code of the position in storage, eg 0x0

tag

the string pre-defined block parameter, either earliest, pending or latest

Sample Response

{
   "jsonrpc":"2.0",
   "id":1,
   "result":"0x000000000000x0000000000000000000000000000000000000000000000000000000000010f2c00000000000000000000000000000000000000000000000000000"
}

eth_gasPrice

Returns the current price per gas in wei.

https://api-testnet.sonicscan.org/api
   ?module=proxy
   &action=eth_gasPrice
   &apikey=YourApiKeyToken

No parameters required.

Sample Response

{
   "jsonrpc":"2.0",
   "id":73,
   "result":"0x3b9aca07"
}

eth_estimateGas

Makes a call or transaction, which won't be added to the blockchain and returns the used gas.

https://api-testnet.sonicscan.org/api
   ?module=proxy
   &action=eth_estimateGas
   &data=0x60fe47b10000000000000000000000000000000000000000000000000000000000000004
   &to=0x272c31fC25E4e609CbCC9E7a9e6171b4B39feAca
   &value=0x0
   &gasPrice=0x51da038cc
   &gas=0x186A0
   &apikey=YourApiKeyToken

Query Parameters

Parameter
Description

data

the hash of the method signature and encoded parameters

to

the string representing the address to interact with

value

the value sent in this transaction, in hex eg. 0xff22

gas

the amount of gas provided for the transaction, in hex eg. 0x5f5e0ff

gasPrice

the gas price paid for each unit of gas, in wei

post EIP-1559, the gasPrice has to be higher than the block's baseFeePerGas

Sample Response

{
   "jsonrpc":"2.0",
   "id":1,
   "result":"0x67ea"
}

Try this endpoint in your

No parameters required.

Sample Response

{
   "status":"1",
   "message":"OK",
   "result":"77523186686500000000000000"
}

Tip : Easily convert Ethereum units using our

Try this endpoint in your

No parameters required.

Sample Response

{
   "status":"1",
   "message":"OK",
   "result":{
      "ethbtc":"0.06906",
      "ethbtc_timestamp":"1652444393",
      "ethusd":"2110.63",
      "ethusd_timestamp":"1652444395"
   }
}

Tip : The timestamps are represented in

For the full documentation of available parameters and descriptions, please visit the official docs.

Try this endpoint in your

Try this endpoint in your

Try this endpoint in your

Try this endpoint in your

Try this endpoint in your

Try this endpoint in your

Try this endpoint in your

Try this endpoint in your

Tip: Send a POST request if your hex string is particularly long.

For more information on creating a signed raw transaction, visit this

Note: The result represents the transaction hash of the submitted raw transaction.

Try this endpoint in your

Try this endpoint in your

Note: The gas parameter is capped at 2x the current block gas limit.

Try this endpoint in your

Try this endpoint in your

Try this endpoint in your

Tip: The result is returned in wei.

Easily convert Ethereum units using our

Try this endpoint in your

Note: The gas parameter is capped at 2x the current block gas limit.

💡
⛏️
⛽
📖
⛽
🔗
browser
📖
unit converter.
🔗
browser
⏳
Unix timestamp.
Ethereum JSON-RPC
🔗
browser
🔗
browser
🔗
browser
🔗
browser
🔗
browser
🔗
browser
🔗
browser
🔗
browser
🖋️
page.
🔗
browser
🔗
browser
🔗
browser
🔗
browser
🔗
browser
unit converter.
🔗
browser