Address Contract Partially Verified
Address
0x356591b71AFDf142De77870C9D8a3aEe58e33db2
Balance
0 ETH
Nonce
1
Code Size
8309 bytes
Creator
0xa61d5e82...b898 at tx 0x0ba73ab1...de563e
Indexed Transactions
0
Contract Bytecode
8309 bytes
0x608060405234801561001057600080fd5b50600436106100cf5760003560e01c806370a082311161008c57806395d89b411161006657806395d89b4114610212578063a6f9dae114610230578063c87b56dd14610260578063fe9d930314610290576100cf565b806370a08231146101a85780638da5cb5b146101d857806394d008ef146101f6576100cf565b806306fdde03146100d4578063081812fc146100f2578063095ea7b31461012257806318160ddd1461013e57806323b872dd1461015c5780636352211e14610178575b600080fd5b6100dc6102ac565b6040516100e991906119b3565b60405180910390f35b61010c60048036038101906101079190611639565b61033e565b6040516101199190611959565b60405180910390f35b61013c60048036038101906101379190611585565b6103c3565b005b6101466104bc565b6040516101539190611af5565b60405180910390f35b61017660048036038101906101719190611532565b6104c6565b005b610192600480360381019061018d9190611639565b6105d8565b60405161019f9190611959565b60405180910390f35b6101c260048036038101906101bd9190611505565b61068a565b6040516101cf9190611af5565b60405180910390f35b6101e0610742565b6040516101ed9190611959565b60405180910390f35b610210600480360381019061020b91906115c5565b61076c565b005b61021a610a0c565b60405161022791906119b3565b60405180910390f35b61024a60048036038101906102459190611505565b610a9e565b6040516102579190611974565b60405180910390f35b61027a60048036038101906102759190611639565b610c51565b60405161028791906119b3565b60405180910390f35b6102aa60048036038101906102a59190611666565b610cf8565b005b6060600080546102bb90611c8d565b80601f01602080910402602001604051908101604052809291908181526020018280546102e790611c8d565b80156103345780601f1061030957610100808354040283529160200191610334565b820191906000526020600020905b81548152906001019060200180831161031757829003601f168201915b5050505050905090565b600061034982610f1c565b610388576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161037f90611a35565b60405180910390fd5b6007600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b60006103ce826105d8565b90508073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561043f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161043690611a95565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146104ad576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104a490611a15565b60405180910390fd5b6104b78383610f88565b505050565b6000600254905090565b6104cf81610f1c565b61050e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161050590611a35565b60405180910390fd5b6000610519826105d8565b90508073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16148061058857503373ffffffffffffffffffffffffffffffffffffffff166105708361033e565b73ffffffffffffffffffffffffffffffffffffffff16145b6105c7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105be90611a55565b60405180910390fd5b6105d2848484611041565b50505050565b6000806005600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610681576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161067890611a35565b60405180910390fd5b80915050919050565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156106fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106f290611a75565b60405180910390fd5b600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610774610742565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146107e1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107d890611ab5565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415610851576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161084890611a75565b60405180910390fd5b61085a83610f1c565b1561089a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610891906119f5565b60405180910390fd5b6001600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546108ea9190611b48565b92505081905550836005600085815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001600260008282546109569190611b48565b92505081905550828473ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a46040516109c59061192f565b60405180910390207fb8ed7b1dcec9fe99007e055ff92bdea26fa8e2b943868e40eaa7d1c72d27430283836040516109fe92919061198f565b60405180910390a250505050565b606060018054610a1b90611c8d565b80601f0160208091040260200160405190810160405280929190818152602001828054610a4790611c8d565b8015610a945780601f10610a6957610100808354040283529160200191610a94565b820191906000526020600020905b815481529060010190602001808311610a7757829003601f168201915b5050505050905090565b6000610aa8610742565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610b15576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b0c90611ab5565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610b85576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b7c90611a75565b60405180910390fd5b6000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905082600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508273ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c60405160405180910390a36001915050919050565b6060610c5c82610f1c565b610c9b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c9290611a35565b60405180910390fd5b6000610ca5611292565b90506000815111610cc55760405180602001604052806000815250610cf0565b80610ccf84611324565b604051602001610ce092919061190b565b6040516020818303038152906040525b915050919050565b6000610d03846105d8565b9050610d0e84610f1c565b610d4d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d4490611a35565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610dbb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610db2906119d5565b60405180910390fd5b610dc6600085610f88565b6001600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610e169190611bcf565b925050819055506005600085815260200190815260200160002060006101000a81549073ffffffffffffffffffffffffffffffffffffffff0219169055600160026000828254610e669190611bcf565b9250508190555083600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4604051610ed590611944565b60405180910390207fb8ed7b1dcec9fe99007e055ff92bdea26fa8e2b943868e40eaa7d1c72d2743028484604051610f0e92919061198f565b60405180910390a250505050565b60008073ffffffffffffffffffffffffffffffffffffffff166005600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614159050919050565b816007600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff16610ffb836105d8565b73ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b8273ffffffffffffffffffffffffffffffffffffffff16611061826105d8565b73ffffffffffffffffffffffffffffffffffffffff16146110b7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110ae90611ad5565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611127576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161111e90611a75565b60405180910390fd5b611132600082610f88565b6001600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546111829190611bcf565b925050819055506001600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546111d99190611b48565b92505081905550816005600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4505050565b6060600380546112a190611c8d565b80601f01602080910402602001604051908101604052809291908181526020018280546112cd90611c8d565b801561131a5780601f106112ef5761010080835404028352916020019161131a565b820191906000526020600020905b8154815290600101906020018083116112fd57829003601f168201915b5050505050905090565b6060600082141561136c576040518060400160405280600181526020017f30000000000000000000000000000000000000000000000000000000000000008152509050611480565b600082905060005b6000821461139e57808061138790611cbf565b915050600a826113979190611b9e565b9150611374565b60008167ffffffffffffffff8111156113ba576113b9611df5565b5b6040519080825280601f01601f1916602001820160405280156113ec5781602001600182028036833780820191505090505b5090505b60008514611479576001826114059190611bcf565b9150600a856114149190611d08565b60306114209190611b48565b60f81b81838151811061143657611435611dc6565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600a856114729190611b9e565b94506113f0565b8093505050505b919050565b60008135905061149481612011565b92915050565b60008083601f8401126114b0576114af611e29565b5b8235905067ffffffffffffffff8111156114cd576114cc611e24565b5b6020830191508360018202830111156114e9576114e8611e2e565b5b9250929050565b6000813590506114ff81612028565b92915050565b60006020828403121561151b5761151a611e38565b5b600061152984828501611485565b91505092915050565b60008060006060848603121561154b5761154a611e38565b5b600061155986828701611485565b935050602061156a86828701611485565b925050604061157b868287016114f0565b9150509250925092565b6000806040838503121561159c5761159b611e38565b5b60006115aa85828601611485565b92505060206115bb858286016114f0565b9150509250929050565b600080600080606085870312156115df576115de611e38565b5b60006115ed87828801611485565b94505060206115fe878288016114f0565b935050604085013567ffffffffffffffff81111561161f5761161e611e33565b5b61162b8782880161149a565b925092505092959194509250565b60006020828403121561164f5761164e611e38565b5b600061165d848285016114f0565b91505092915050565b60008060006040848603121561167f5761167e611e38565b5b600061168d868287016114f0565b935050602084013567ffffffffffffffff8111156116ae576116ad611e33565b5b6116ba8682870161149a565b92509250509250925092565b6116cf81611c03565b82525050565b6116de81611c15565b82525050565b60006116f08385611b1b565b93506116fd838584611c4b565b61170683611e3d565b840190509392505050565b600061171c82611b10565b6117268185611b2c565b9350611736818560208601611c5a565b61173f81611e3d565b840191505092915050565b600061175582611b10565b61175f8185611b3d565b935061176f818560208601611c5a565b80840191505092915050565b6000611788601a83611b2c565b915061179382611e4e565b602082019050919050565b60006117ab601483611b2c565b91506117b682611e77565b602082019050919050565b60006117ce601383611b2c565b91506117d982611ea0565b602082019050919050565b60006117f1601483611b2c565b91506117fc82611ec9565b602082019050919050565b6000611814601f83611b2c565b915061181f82611ef2565b602082019050919050565b6000611837601183611b2c565b915061184282611f1b565b602082019050919050565b600061185a601183611b2c565b915061186582611f44565b602082019050919050565b600061187d600483611b3d565b915061188882611f6d565b600482019050919050565b60006118a0601883611b2c565b91506118ab82611f96565b602082019050919050565b60006118c3600483611b3d565b91506118ce82611fbf565b600482019050919050565b60006118e6601d83611b2c565b91506118f182611fe8565b602082019050919050565b61190581611c41565b82525050565b6000611917828561174a565b9150611923828461174a565b91508190509392505050565b600061193a82611870565b9150819050919050565b600061194f826118b6565b9150819050919050565b600060208201905061196e60008301846116c6565b92915050565b600060208201905061198960008301846116d5565b92915050565b600060208201905081810360008301526119aa8184866116e4565b90509392505050565b600060208201905081810360008301526119cd8184611711565b905092915050565b600060208201905081810360008301526119ee8161177b565b9050919050565b60006020820190508181036000830152611a0e8161179e565b9050919050565b60006020820190508181036000830152611a2e816117c1565b9050919050565b60006020820190508181036000830152611a4e816117e4565b9050919050565b60006020820190508181036000830152611a6e81611807565b9050919050565b60006020820190508181036000830152611a8e8161182a565b9050919050565b60006020820190508181036000830152611aae8161184d565b9050919050565b60006020820190508181036000830152611ace81611893565b9050919050565b60006020820190508181036000830152611aee816118d9565b9050919050565b6000602082019050611b0a60008301846118fc565b92915050565b600081519050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600081905092915050565b6000611b5382611c41565b9150611b5e83611c41565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115611b9357611b92611d39565b5b828201905092915050565b6000611ba982611c41565b9150611bb483611c41565b925082611bc457611bc3611d68565b5b828204905092915050565b6000611bda82611c41565b9150611be583611c41565b925082821015611bf857611bf7611d39565b5b828203905092915050565b6000611c0e82611c21565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b82818337600083830152505050565b60005b83811015611c78578082015181840152602081019050611c5d565b83811115611c87576000848401525b50505050565b60006002820490506001821680611ca557607f821691505b60208210811415611cb957611cb8611d97565b5b50919050565b6000611cca82611c41565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415611cfd57611cfc611d39565b5b600182019050919050565b6000611d1382611c41565b9150611d1e83611c41565b925082611d2e57611d2d611d68565b5b828206905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f556e617574686f726973656420746f206275726e20746f6b656e000000000000600082015250565b7f546f6b656e20616c7265616479206d696e746564000000000000000000000000600082015250565b7f43616c6c6572206973206e6f74206f776e657200000000000000000000000000600082015250565b7f546f6b656e20646f6573206e6f74206578697374000000000000000000000000600082015250565b7f43616c6c6572206973206e6f74206f776e6572206f7220617070726f76656400600082015250565b7f5a65726f20616464726573732075736564000000000000000000000000000000600082015250565b7f53616d6520616464726573732075736564000000000000000000000000000000600082015250565b7f6d696e7400000000000000000000000000000000000000000000000000000000600082015250565b7f53656e646572206d75737420626520746865206f776e65720000000000000000600082015250565b7f6275726e00000000000000000000000000000000000000000000000000000000600082015250565b7f5472616e736665722066726f6d20696e636f7272656374206f776e6572000000600082015250565b61201a81611c03565b811461202557600080fd5b50565b61203181611c41565b811461203c57600080fd5b5056fea2646970667358221220fff1aceb21548749644a0b19114f71ebbadb78f663e8ec59b7126685a5bb55f364736f6c63430008070033
Verified Source Code Partial Match
Compiler: v0.8.7+commit.e28d00a7
EVM: london
Optimization: No
ERC721.sol 342 lines
// SPDX-License-Identifier: MIT
pragma solidity 0.8.7;
/**
* @dev Implementation of the QRC721 tier 1 Non-Fungible Token Standard
*/
contract ERC721 {
// Token name
string private _name;
// Token symbol
string private _symbol;
// Token supply
uint256 private _supply;
// Base Token Uri
string private _baseTokenURI;
//the address that can mint new tokens
address private _owner;
// Mapping from token ID to owner address
mapping(uint256 => address) private _owners;
// Mapping owner address to token count
mapping(address => uint256) private _balances;
// Mapping from token ID to approved address
mapping(uint256 => address) private _tokenApprovals;
/**
* @dev Emitted when `tokenId` token is transferred from `senderAccountId` to `receiverAccountId`.
*/
event Transfer(address indexed senderAccountId, address indexed receiverAccountId, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables `spender` to manage the `tokenId` token.
*/
event Approval(address indexed ownerAccountId, address indexed collectorAccountId, uint256 indexed tokenId);
/**
* @dev Emitted when the authorised owner is changed
*/
event OwnerChanged(address indexed oldContractOwner, address indexed NewContractOwner);
/**
* @dev Emitted when tokens are minted or burned.
*/
event MetaData(string indexed functionName, bytes data);
/**
* @dev Initializes the contract by setting a `name` and a `symbol` to the token collection as well as an optional baseTokenURI.
* Additionally the contract's authorised token owner address is set.
*/
constructor(string memory name_, string memory symbol_, string memory baseTokenURI_, address owner_) {
_name = name_;
_symbol = symbol_;
_baseTokenURI = baseTokenURI_;
_owner = owner_;
}
/**
* @dev Functions using this modifier restrict the caller to only be the owner address
*/
modifier onlyOwner {
require(msg.sender == owner(), "Sender must be the owner");
_;
}
/**
* @dev Gives permission to `collectorAccountId` to transfer `tokenId` token to another account.
* The approval is cleared when the token is transferred.
*
* Only a single account can be approved at a time, so approving the zero address clears previous approvals.
*
* Requirements:
*
* - cannot approve the owner account.
* - The caller must own the token.
* - `tokenId` must exist.
*
* Emits an {Approval} event.
*/
function approve(address collectorAccountId, uint256 tokenId) external {
address thisOwner = ownerOf(tokenId);
require(collectorAccountId != thisOwner, "Same address used");
require(msg.sender == thisOwner, "Caller is not owner");
_approve(collectorAccountId, tokenId);
}
/**
* @dev Transfers `tokenId` token from `senderAccountId` to `receiverAccountId`.
*
* Requirements:
*
* - `senderAccountId` cannot be the zero address.
* - `receiverAccountId` cannot be the zero address.
* - `tokenId` token must exist and be owned by `senderAccountId`.
* - If the caller is not `senderAccountId`, the caller must be have been allowed to move this token by {approve}.
*
* Emits a {Transfer} event.
*/
function transferFrom(address senderAccountId, address receiverAccountId, uint256 tokenId) external {
require(_exists(tokenId), "Token does not exist");
address thisOwner = ERC721.ownerOf(tokenId);
require((msg.sender == thisOwner || getApproved(tokenId) == msg.sender), "Caller is not owner or approved");
_transfer(senderAccountId, receiverAccountId, tokenId);
}
/**
* @dev Mints `tokenId` and transfers it to `beneficiaryAccountId`. This minting is associated with an optional `data` parameter.
*
* Requirements:
*
* - caller must be the contract's assigned owner.
* - `tokenId` must not exist.
*
* Emits a {Transfer} event.
*/
function mint(address beneficiaryAccountId, uint256 tokenId, bytes calldata data) external onlyOwner() {
require(beneficiaryAccountId != address(0), "Zero address used");
require(!_exists(tokenId), "Token already minted");
_balances[beneficiaryAccountId] += 1;
_owners[tokenId] = beneficiaryAccountId;
_supply += 1;
emit Transfer(address(0), beneficiaryAccountId, tokenId);
emit MetaData("mint", data);
}
/**
* @dev Destroys `tokenId`. This token burn is associated with an optional `data` parameter.
* The approval is cleared when the token is burned.
*
* Requirements:
*
* - `tokenId` must exist.
* - the caller must own the token being burned.
*
* Emits a {Transfer} event.
*/
function burn(uint256 tokenId, bytes calldata data) external {
address thisOwner = ERC721.ownerOf(tokenId);
require(_exists(tokenId), "Token does not exist");
require(msg.sender == thisOwner, "Unauthorised to burn token");
// Clear approvals
_approve(address(0), tokenId);
_balances[thisOwner] -= 1;
delete _owners[tokenId];
_supply -= 1;
emit Transfer(thisOwner, address(0), tokenId);
emit MetaData("burn", data);
}
/**
* @dev Changes the address that can mint tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Requirements:
*
* - `msg.sender` must have the owner role.
*/
function changeOwner(address newContractOwnerId) external onlyOwner() returns (bool) {
require(newContractOwnerId != address(0x0), "Zero address used");
address oldOwner = _owner;
_owner = newContractOwnerId;
emit OwnerChanged(oldOwner, newContractOwnerId);
return true;
}
/**
* @dev Base URI for computing {tokenURI}. If set, the resulting URI for each
* token will be the concatenation of the `baseURI` and the `tokenId`.
*/
function _baseURI() internal view returns (string memory) {
return _baseTokenURI;
}
/**
* @dev Returns whether `tokenId` exists.
*
* Tokens start existing when they are minted (`_mint`),
* and stop existing when they are burned (`_burn`).
*/
function _exists(uint256 tokenId) internal view virtual returns (bool) {
return _owners[tokenId] != address(0);
}
/**
* @dev Transfers `tokenId` from `from` to `to`.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
*
* Emits a {Transfer} event.
*/
function _transfer(address from, address to, uint256 tokenId) internal {
require(ERC721.ownerOf(tokenId) == from, "Transfer from incorrect owner");
require(to != address(0), "Zero address used");
// Clear approvals from the previous owner
_approve(address(0), tokenId);
_balances[from] -= 1;
_balances[to] += 1;
_owners[tokenId] = to;
emit Transfer(from, to, tokenId);
}
/**
* @dev Approve `to` to operate on `tokenId`.
*
* Emits a {Approval} event.
*/
function _approve(address to, uint256 tokenId) internal {
_tokenApprovals[tokenId] = to;
emit Approval(ERC721.ownerOf(tokenId), to, tokenId);
}
/**
* @dev Returns the name of the token.
*/
function name() public view returns (string memory) {
return _name;
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the name.
*/
function symbol() public view returns (string memory) {
return _symbol;
}
/**
* @dev Returns the number of tokens currently in this NFT collection.
*/
function totalSupply() public view returns (uint256) {
return _supply;
}
/**
* @dev Returns the address with the owner role of this token contract,
* i.e. what address can mint new tokens.
* if a multi-sig operator is required, this address should
* point to a smart contract implementing this multi-sig.
*/
function owner() public view returns (address) {
return _owner;
}
/**
* @dev Returns the number of tokens in ``accountId``'s account.
*/
function balanceOf(address accountId) public view returns (uint256) {
require(accountId != address(0), "Zero address used");
return _balances[accountId];
}
/**
* @dev Returns the owner of the `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function ownerOf(uint256 tokenId) public view returns (address) {
address thisOwner = _owners[tokenId];
require(thisOwner != address(0), "Token does not exist");
return thisOwner;
}
/**
* @dev Returns the account approved for `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function getApproved(uint256 tokenId) public view returns (address) {
require(_exists(tokenId), "Token does not exist");
return _tokenApprovals[tokenId];
}
/**
* @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
*/
function tokenURI(uint256 tokenId) public view returns (string memory) {
require(_exists(tokenId), "Token does not exist");
string memory baseURI = _baseURI();
return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, toString(tokenId))) : "";
}
/**
* @dev Converts a uint256 to a string.
*/
function toString(uint256 value) internal pure returns (string memory) {
if (value == 0) {
return "0";
}
uint256 temp = value;
uint256 digits;
while (temp != 0) {
digits++;
temp /= 10;
}
bytes memory buffer = new bytes(digits);
while (value != 0) {
digits -= 1;
buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
value /= 10;
}
return string(buffer);
}
}
Read Contract
balanceOf 0x70a08231 → uint256
getApproved 0x081812fc → address
name 0x06fdde03 → string
owner 0x8da5cb5b → address
ownerOf 0x6352211e → address
symbol 0x95d89b41 → string
tokenURI 0xc87b56dd → string
totalSupply 0x18160ddd → uint256
Write Contract 5 functions
These functions modify contract state and require a wallet transaction to execute.
approve 0x095ea7b3
address collectorAccountId
uint256 tokenId
burn 0xfe9d9303
uint256 tokenId
bytes data
changeOwner 0xa6f9dae1
address newContractOwnerId
returns: bool
mint 0x94d008ef
address beneficiaryAccountId
uint256 tokenId
bytes data
transferFrom 0x23b872dd
address senderAccountId
address receiverAccountId
uint256 tokenId
Recent Transactions
No transactions found for this address