0%
    Verified
  • Verified, NFT
  • Non Fungible Token
  • ERC-721

The following smart contract is called EmblemVault and it is an implementation of the ERC721 standard for non-fungible tokens (NFTs). It allows for minting, burning, and transferring of NFTs. The contract also includes functions for updating the contract URI and token URI. The contract inherits from the NFTokenEnumerableMetadata and Ownable contracts. The purpose of the contract is to provide a secure and flexible way to manage NFTs.

0x82c7a8f707110f5fbb16184a5933e9f78a34c6ab
Copied
Copied
EmblemVault Source Code
// File: browser/github/0xcert/ethereum-erc721/src/contracts/ownership/ownable.sol pragma solidity 0.6.2; /** * @dev The contract has an owner address, and provides basic authorization control whitch * simplifies the implementation of user permissions. This contract is based on the source code at: * https://github.com/OpenZeppelin/openzeppelin-solidity/blob/master/contracts/ownership/Ownable.sol */ contract Ownable { /** * @dev Error constants. */ string public constant NOT_CURRENT_OWNER = "018001"; string public constant CANNOT_TRANSFER_TO_ZERO_ADDRESS = "018002"; /** * @dev Current owner address. */ address public owner; /** * @dev An event which is triggered when the owner is changed. * @param previousOwner The address of the previous owner. * @param newOwner The address of the new owner. */ event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); /** * @dev The constructor sets the original `owner` of the contract to the sender account. */ constructor() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner, NOT_CURRENT_OWNER); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function transferOwnership( address _newOwner ) public onlyOwner { require(_newOwner != address(0), CANNOT_TRANSFER_TO_ZERO_ADDRESS); emit OwnershipTransferred(owner, _newOwner); owner = _newOwner; } } // File: browser/github/0xcert/ethereum-erc721/src/contracts/tokens/erc721-enumerable.sol pragma solidity 0.6.2; /** * @dev Optional enumeration extension for ERC-721 non-fungible token standard. * See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md. */ interface ERC721Enumerable { /** * @dev Returns a count of valid NFTs tracked by this contract, where each one of them has an * assigned and queryable owner not equal to the zero address. * @return Total supply of NFTs. */ function totalSupply() external view returns (uint256); /** * @dev Returns the token identifier for the `_index`th NFT. Sort order is not specified. * @param _index A counter less than `totalSupply()`. * @return Token id. */ function tokenByIndex( uint256 _index ) external view returns (uint256); /** * @dev Returns the token identifier for the `_index`th NFT assigned to `_owner`. Sort order is * not specified. It throws if `_index` >= `balanceOf(_owner)` or if `_owner` is the zero address, * representing invalid NFTs. * @param _owner An address where we are interested in NFTs owned by them. * @param _index A counter less than `balanceOf(_owner)`. * @return Token id. */ function tokenOfOwnerByIndex( address _owner, uint256 _index ) external view returns (uint256); } // File: browser/github/0xcert/ethereum-erc721/src/contracts/tokens/erc721-metadata.sol pragma solidity 0.6.2; /** * @dev Optional metadata extension for ERC-721 non-fungible token standard. * See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md. */ interface ERC721Metadata { /** * @dev Returns a descriptive name for a collection of NFTs in this contract. * @return _name Representing name. */ function name() external view returns (string memory _name); /** * @dev Returns a abbreviated name for a collection of NFTs in this contract. * @return _symbol Representing symbol. */ function symbol() external view returns (string memory _symbol); /** * @dev Returns a distinct Uniform Resource Identifier (URI) for a given asset. It Throws if * `_tokenId` is not a valid NFT. URIs are defined in RFC3986. The URI may point to a JSON file * that conforms to the "ERC721 Metadata JSON Schema". * @return URI of _tokenId. */ function tokenURI(uint256 _tokenId) external view returns (string memory); } // File: browser/github/0xcert/ethereum-erc721/src/contracts/utils/address-utils.sol pragma solidity 0.6.2; /** * @dev Utility library of inline functions on addresses. * @notice Based on: * https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/Address.sol * Requires EIP-1052. */ library AddressUtils { /** * @dev Returns whether the target address is a contract. * @param _addr Address to check. * @return addressCheck True if _addr is a contract, false if not. */ function isContract( address _addr ) internal view returns (bool addressCheck) { // This method relies in extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. // According to EIP-1052, 0x0 is the value returned for not-yet created accounts // and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned // for accounts without code, i.e. `keccak256('')` bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; assembly { codehash := extcodehash(_addr) } // solhint-disable-line addressCheck = (codehash != 0x0 &amp;&amp; codehash != accountHash); } } // File: browser/github/0xcert/ethereum-erc721/src/contracts/utils/erc165.sol pragma solidity 0.6.2; /** * @dev A standard for detecting smart contract interfaces. * See: https://eips.ethereum.org/EIPS/eip-165. */ interface ERC165 { /** * @dev Checks if the smart contract includes a specific interface. * @notice This function uses less than 30,000 gas. * @param _interfaceID The interface identifier, as specified in ERC-165. * @return True if _interfaceID is supported, false otherwise. */ function supportsInterface( bytes4 _interfaceID ) external view returns (bool); } // File: browser/github/0xcert/ethereum-erc721/src/contracts/utils/supports-interface.sol pragma solidity 0.6.2; /** * @dev Implementation of standard for detect smart contract interfaces. */ contract SupportsInterface is ERC165 { /** * @dev Mapping of supported intefraces. * @notice You must not set element 0xffffffff to true. */ mapping(bytes4 => bool) internal supportedInterfaces; /** * @dev Contract constructor. */ constructor() public { supportedInterfaces[0x01ffc9a7] = true; // ERC165 } /** * @dev Function to check which interfaces are suported by this contract. * @param _interfaceID Id of the interface. * @return True if _interfaceID is supported, false otherwise. */ function supportsInterface( bytes4 _interfaceID ) external override view returns (bool) { return supportedInterfaces[_interfaceID]; } } // File: browser/github/0xcert/ethereum-erc721/src/contracts/math/safe-math.sol pragma solidity 0.6.2; /** * @dev Math operations with safety checks that throw on error. This contract is based on the * source code at: * https://github.com/OpenZeppelin/openzeppelin-solidity/blob/master/contracts/math/SafeMath.sol. */ library SafeMath { /** * List of revert message codes. Implementing dApp should handle showing the correct message. * Based on 0xcert framework error codes. */ string constant OVERFLOW = "008001"; string constant SUBTRAHEND_GREATER_THEN_MINUEND = "008002"; string constant DIVISION_BY_ZERO = "008003"; /** * @dev Multiplies two numbers, reverts on overflow. * @param _factor1 Factor number. * @param _factor2 Factor number. * @return product The product of the two factors. */ function mul( uint256 _factor1, uint256 _factor2 ) internal pure returns (uint256 product) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (_factor1 == 0) { return 0; } product = _factor1 * _factor2; require(product / _factor1 == _factor2, OVERFLOW); } /** * @dev Integer division of two numbers, truncating the quotient, reverts on division by zero. * @param _dividend Dividend number. * @param _divisor Divisor number. * @return quotient The quotient. */ function div( uint256 _dividend, uint256 _divisor ) internal pure returns (uint256 quotient) { // Solidity automatically asserts when dividing by 0, using all gas. require(_divisor > 0, DIVISION_BY_ZERO); quotient = _dividend / _divisor; // assert(_dividend == _divisor * quotient + _dividend % _divisor); // There is no case in which this doesn't hold. } /** * @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). * @param _minuend Minuend number. * @param _subtrahend Subtrahend number. * @return difference Difference. */ function sub( uint256 _minuend, uint256 _subtrahend ) internal pure returns (uint256 difference) { require(_subtrahend <= _minuend, SUBTRAHEND_GREATER_THEN_MINUEND); difference = _minuend - _subtrahend; } /** * @dev Adds two numbers, reverts on overflow. * @param _addend1 Number. * @param _addend2 Number. * @return sum Sum. */ function add( uint256 _addend1, uint256 _addend2 ) internal pure returns (uint256 sum) { sum = _addend1 + _addend2; require(sum >= _addend1, OVERFLOW); } /** * @dev Divides two numbers and returns the remainder (unsigned integer modulo), reverts when * dividing by zero. * @param _dividend Number. * @param _divisor Number. * @return remainder Remainder. */ function mod( uint256 _dividend, uint256 _divisor ) internal pure returns (uint256 remainder) { require(_divisor != 0, DIVISION_BY_ZERO); remainder = _dividend % _divisor; } } // File: browser/github/0xcert/ethereum-erc721/src/contracts/tokens/erc721-token-receiver.sol pragma solidity 0.6.2; /** * @dev ERC-721 interface for accepting safe transfers. * See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md. */ interface ERC721TokenReceiver { /** * @dev Handle the receipt of a NFT. The ERC721 smart contract calls this function on the * recipient after a `transfer`. This function MAY throw to revert and reject the transfer. Return * of other than the magic value MUST result in the transaction being reverted. * Returns `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))` unless throwing. * @notice The contract address is always the message sender. A wallet/broker/auction application * MUST implement the wallet interface if it will accept safe transfers. * @param _operator The address which called `safeTransferFrom` function. * @param _from The address which previously owned the token. * @param _tokenId The NFT identifier which is being transferred. * @param _data Additional data with no specified format. * @return Returns `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`. */ function onERC721Received( address _operator, address _from, uint256 _tokenId, bytes calldata _data ) external returns(bytes4); } // File: browser/github/0xcert/ethereum-erc721/src/contracts/tokens/erc721.sol pragma solidity 0.6.2; /** * @dev ERC-721 non-fungible token standard. * See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md. */ interface ERC721 { /** * @dev Emits when ownership of any NFT changes by any mechanism. This event emits when NFTs are * created (`from` == 0) and destroyed (`to` == 0). Exception: during contract creation, any * number of NFTs may be created and assigned without emitting Transfer. At the time of any * transfer, the approved address for that NFT (if any) is reset to none. */ event Transfer( address indexed _from, address indexed _to, uint256 indexed _tokenId ); /** * @dev This emits when the approved address for an NFT is changed or reaffirmed. The zero * address indicates there is no approved address. When a Transfer event emits, this also * indicates that the approved address for that NFT (if any) is reset to none. */ event Approval( address indexed _owner, address indexed _approved, uint256 indexed _tokenId ); /** * @dev This emits when an operator is enabled or disabled for an owner. The operator can manage * all NFTs of the owner. */ event ApprovalForAll( address indexed _owner, address indexed _operator, bool _approved ); /** * @dev Transfers the ownership of an NFT from one address to another address. * @notice Throws unless `msg.sender` is the current owner, an authorized operator, or the * approved address for this NFT. Throws if `_from` is not the current owner. Throws if `_to` is * the zero address. Throws if `_tokenId` is not a valid NFT. When transfer is complete, this * function checks if `_to` is a smart contract (code size > 0). If so, it calls * `onERC721Received` on `_to` and throws if the return value is not * `bytes4(keccak256("onERC721Received(address,uint256,bytes)"))`. * @param _from The current owner of the NFT. * @param _to The new owner. * @param _tokenId The NFT to transfer. * @param _data Additional data with no specified format, sent in call to `_to`. */ function safeTransferFrom( address _from, address _to, uint256 _tokenId, bytes calldata _data ) external; /** * @dev Transfers the ownership of an NFT from one address to another address. * @notice This works identically to the other function with an extra data parameter, except this * function just sets data to "" * @param _from The current owner of the NFT. * @param _to The new owner. * @param _tokenId The NFT to transfer. */ function safeTransferFrom( address _from, address _to, uint256 _tokenId ) external; /** * @dev Throws unless `msg.sender` is the current owner, an authorized operator, or the approved * address for this NFT. Throws if `_from` is not the current owner. Throws if `_to` is the zero * address. Throws if `_tokenId` is not a valid NFT. * @notice The caller is responsible to confirm that `_to` is capable of receiving NFTs or else * they mayb be permanently lost. * @param _from The current owner of the NFT. * @param _to The new owner. * @param _tokenId The NFT to transfer. */ function transferFrom( address _from, address _to, uint256 _tokenId ) external; /** * @dev Set or reaffirm the approved address for an NFT. * @notice The zero address indicates there is no approved address. Throws unless `msg.sender` is * the current NFT owner, or an authorized operator of the current owner. * @param _approved The new approved NFT controller. * @param _tokenId The NFT to approve. */ function approve( address _approved, uint256 _tokenId ) external; /** * @dev Enables or disables approval for a third party ("operator") to manage all of * `msg.sender`'s assets. It also emits the ApprovalForAll event. * @notice The contract MUST allow multiple operators per owner. * @param _operator Address to add to the set of authorized operators. * @param _approved True if the operators is approved, false to revoke approval. */ function setApprovalForAll( address _operator, bool _approved ) external; /** * @dev Returns the number of NFTs owned by `_owner`. NFTs assigned to the zero address are * considered invalid, and this function throws for queries about the zero address. * @param _owner Address for whom to query the balance. * @return Balance of _owner. */ function balanceOf( address _owner ) external view returns (uint256); /** * @dev Returns the address of the owner of the NFT. NFTs assigned to zero address are considered * invalid, and queries about them do throw. * @param _tokenId The identifier for an NFT. * @return Address of _tokenId owner. */ function ownerOf( uint256 _tokenId ) external view returns (address); /** * @dev Get the approved address for a single NFT. * @notice Throws if `_tokenId` is not a valid NFT. * @param _tokenId The NFT to find the approved address for. * @return Address that _tokenId is approved for. */ function getApproved( uint256 _tokenId ) external view returns (address); /** * @dev Returns true if `_operator` is an approved operator for `_owner`, false otherwise. * @param _owner The address that owns the NFTs. * @param _operator The address that acts on behalf of the owner. * @return True if approved for all, false otherwise. */ function isApprovedForAll( address _owner, address _operator ) external view returns (bool); } // File: browser/github/0xcert/ethereum-erc721/src/contracts/tokens/nf-token.sol pragma solidity 0.6.2; /** * @dev Implementation of ERC-721 non-fungible token standard. */ contract NFToken is ERC721, SupportsInterface { using SafeMath for uint256; using AddressUtils for address; /** * List of revert message codes. Implementing dApp should handle showing the correct message. * Based on 0xcert framework error codes. */ string constant ZERO_ADDRESS = "003001"; string constant NOT_VALID_NFT = "003002"; string constant NOT_OWNER_OR_OPERATOR = "003003"; string constant NOT_OWNER_APPROWED_OR_OPERATOR = "003004"; string constant NOT_ABLE_TO_RECEIVE_NFT = "003005"; string constant NFT_ALREADY_EXISTS = "003006"; string constant NOT_OWNER = "003007"; string constant IS_OWNER = "003008"; /** * @dev Magic value of a smart contract that can recieve NFT. * Equal to: bytes4(keccak256("onERC721Received(address,address,uint256,bytes)")). */ bytes4 internal constant MAGIC_ON_ERC721_RECEIVED = 0x150b7a02; /** * @dev A mapping from NFT ID to the address that owns it. */ mapping (uint256 => address) internal idToOwner; /** * @dev Mapping from NFT ID to approved address. */ mapping (uint256 => address) internal idToApproval; /** * @dev Mapping from owner address to count of his tokens. */ mapping (address => uint256) private ownerToNFTokenCount; /** * @dev Mapping from owner address to mapping of operator addresses. */ mapping (address => mapping (address => bool)) internal ownerToOperators; /** * @dev Emits when ownership of any NFT changes by any mechanism. This event emits when NFTs are * created (`from` == 0) and destroyed (`to` == 0). Exception: during contract creation, any * number of NFTs may be created and assigned without emitting Transfer. At the time of any * transfer, the approved address for that NFT (if any) is reset to none. * @param _from Sender of NFT (if address is zero address it indicates token creation). * @param _to Receiver of NFT (if address is zero address it indicates token destruction). * @param _tokenId The NFT that got transfered. */ event Transfer( address indexed _from, address indexed _to, uint256 indexed _tokenId ); /** * @dev This emits when the approved address for an NFT is changed or reaffirmed. The zero * address indicates there is no approved address. When a Transfer event emits, this also * indicates that the approved address for that NFT (if any) is reset to none. * @param _owner Owner of NFT. * @param _approved Address that we are approving. * @param _tokenId NFT which we are approving. */ event Approval( address indexed _owner, address indexed _approved, uint256 indexed _tokenId ); /** * @dev This emits when an operator is enabled or disabled for an owner. The operator can manage * all NFTs of the owner. * @param _owner Owner of NFT. * @param _operator Address to which we are setting operator rights. * @param _approved Status of operator rights(true if operator rights are given and false if * revoked). */ event ApprovalForAll( address indexed _owner, address indexed _operator, bool _approved ); /** * @dev Guarantees that the msg.sender is an owner or operator of the given NFT. * @param _tokenId ID of the NFT to validate. */ modifier canOperate( uint256 _tokenId ) { address tokenOwner = idToOwner[_tokenId]; require(tokenOwner == msg.sender || ownerToOperators[tokenOwner][msg.sender], NOT_OWNER_OR_OPERATOR); _; } /** * @dev Guarantees that the msg.sender is allowed to transfer NFT. * @param _tokenId ID of the NFT to transfer. */ modifier canTransfer( uint256 _tokenId ) { address tokenOwner = idToOwner[_tokenId]; require( tokenOwner == msg.sender || idToApproval[_tokenId] == msg.sender || ownerToOperators[tokenOwner][msg.sender], NOT_OWNER_APPROWED_OR_OPERATOR ); _; } /** * @dev Guarantees that _tokenId is a valid Token. * @param _tokenId ID of the NFT to validate. */ modifier validNFToken( uint256 _tokenId ) { require(idToOwner[_tokenId] != address(0), NOT_VALID_NFT); _; } /** * @dev Contract constructor. */ constructor() public { supportedInterfaces[0x80ac58cd] = true; // ERC721 } /** * @dev Transfers the ownership of an NFT from one address to another address. This function can * be changed to payable. * @notice Throws unless `msg.sender` is the current owner, an authorized operator, or the * approved address for this NFT. Throws if `_from` is not the current owner. Throws if `_to` is * the zero address. Throws if `_tokenId` is not a valid NFT. When transfer is complete, this * function checks if `_to` is a smart contract (code size > 0). If so, it calls * `onERC721Received` on `_to` and throws if the return value is not * `bytes4(keccak256("onERC721Received(address,uint256,bytes)"))`. * @param _from The current owner of the NFT. * @param _to The new owner. * @param _tokenId The NFT to transfer. * @param _data Additional data with no specified format, sent in call to `_to`. */ function safeTransferFrom( address _from, address _to, uint256 _tokenId, bytes calldata _data ) external override { _safeTransferFrom(_from, _to, _tokenId, _data); } /** * @dev Transfers the ownership of an NFT from one address to another address. This function can * be changed to payable. * @notice This works identically to the other function with an extra data parameter, except this * function just sets data to "" * @param _from The current owner of the NFT. * @param _to The new owner. * @param _tokenId The NFT to transfer. */ function safeTransferFrom( address _from, address _to, uint256 _tokenId ) external override { _safeTransferFrom(_from, _to, _tokenId, ""); } /** * @dev Throws unless `msg.sender` is the current owner, an authorized operator, or the approved * address for this NFT. Throws if `_from` is not the current owner. Throws if `_to` is the zero * address. Throws if `_tokenId` is not a valid NFT. This function can be changed to payable. * @notice The caller is responsible to confirm that `_to` is capable of receiving NFTs or else * they maybe be permanently lost. * @param _from The current owner of the NFT. * @param _to The new owner. * @param _tokenId The NFT to transfer. */ function transferFrom( address _from, address _to, uint256 _tokenId ) external override canTransfer(_tokenId) validNFToken(_tokenId) { address tokenOwner = idToOwner[_tokenId]; require(tokenOwner == _from, NOT_OWNER); require(_to != address(0), ZERO_ADDRESS); _transfer(_to, _tokenId); } /** * @dev Set or reaffirm the approved address for an NFT. This function can be changed to payable. * @notice The zero address indicates there is no approved address. Throws unless `msg.sender` is * the current NFT owner, or an authorized operator of the current owner. * @param _approved Address to be approved for the given NFT ID. * @param _tokenId ID of the token to be approved. */ function approve( address _approved, uint256 _tokenId ) external override canOperate(_tokenId) validNFToken(_tokenId) { address tokenOwner = idToOwner[_tokenId]; require(_approved != tokenOwner, IS_OWNER); idToApproval[_tokenId] = _approved; emit Approval(tokenOwner, _approved, _tokenId); } /** * @dev Enables or disables approval for a third party ("operator") to manage all of * `msg.sender`'s assets. It also emits the ApprovalForAll event. * @notice This works even if sender doesn't own any tokens at the time. * @param _operator Address to add to the set of authorized operators. * @param _approved True if the operators is approved, false to revoke approval. */ function setApprovalForAll( address _operator, bool _approved ) external override { ownerToOperators[msg.sender][_operator] = _approved; emit ApprovalForAll(msg.sender, _operator, _approved); } /** * @dev Returns the number of NFTs owned by `_owner`. NFTs assigned to the zero address are * considered invalid, and this function throws for queries about the zero address. * @param _owner Address for whom to query the balance. * @return Balance of _owner. */ function balanceOf( address _owner ) external override view returns (uint256) { require(_owner != address(0), ZERO_ADDRESS); return _getOwnerNFTCount(_owner); } /** * @dev Returns the address of the owner of the NFT. NFTs assigned to zero address are considered * invalid, and queries about them do throw. * @param _tokenId The identifier for an NFT. * @return _owner Address of _tokenId owner. */ function ownerOf( uint256 _tokenId ) external override view returns (address _owner) { _owner = idToOwner[_tokenId]; require(_owner != address(0), NOT_VALID_NFT); } /** * @dev Get the approved address for a single NFT. * @notice Throws if `_tokenId` is not a valid NFT. * @param _tokenId ID of the NFT to query the approval of. * @return Address that _tokenId is approved for. */ function getApproved( uint256 _tokenId ) external override view validNFToken(_tokenId) returns (address) { return idToApproval[_tokenId]; } /** * @dev Checks if `_operator` is an approved operator for `_owner`. * @param _owner The address that owns the NFTs. * @param _operator The address that acts on behalf of the owner. * @return True if approved for all, false otherwise. */ function isApprovedForAll( address _owner, address _operator ) external override view returns (bool) { return ownerToOperators[_owner][_operator]; } /** * @dev Actually preforms the transfer. * @notice Does NO checks. * @param _to Address of a new owner. * @param _tokenId The NFT that is being transferred. */ function _transfer( address _to, uint256 _tokenId ) internal { address from = idToOwner[_tokenId]; _clearApproval(_tokenId); _removeNFToken(from, _tokenId); _addNFToken(_to, _tokenId); emit Transfer(from, _to, _tokenId); } /** * @dev Mints a new NFT. * @notice This is an internal function which should be called from user-implemented external * mint function. Its purpose is to show and properly initialize data structures when using this * implementation. * @param _to The address that will own the minted NFT. * @param _tokenId of the NFT to be minted by the msg.sender. */ function _mint( address _to, uint256 _tokenId ) internal virtual { require(_to != address(0), ZERO_ADDRESS); require(idToOwner[_tokenId] == address(0), NFT_ALREADY_EXISTS); _addNFToken(_to, _tokenId); emit Transfer(address(0), _to, _tokenId); } /** * @dev Burns a NFT. * @notice This is an internal function which should be called from user-implemented external burn * function. Its purpose is to show and properly initialize data structures when using this * implementation. Also, note that this burn implementation allows the minter to re-mint a burned * NFT. * @param _tokenId ID of the NFT to be burned. */ function _burn( uint256 _tokenId ) internal virtual validNFToken(_tokenId) { address tokenOwner = idToOwner[_tokenId]; _clearApproval(_tokenId); _removeNFToken(tokenOwner, _tokenId); emit Transfer(tokenOwner, address(0), _tokenId); } /** * @dev Removes a NFT from owner. * @notice Use and override this function with caution. Wrong usage can have serious consequences. * @param _from Address from wich we want to remove the NFT. * @param _tokenId Which NFT we want to remove. */ function _removeNFToken( address _from, uint256 _tokenId ) internal virtual { require(idToOwner[_tokenId] == _from, NOT_OWNER); ownerToNFTokenCount[_from] = ownerToNFTokenCount[_from] - 1; delete idToOwner[_tokenId]; } /** * @dev Assignes a new NFT to owner. * @notice Use and override this function with caution. Wrong usage can have serious consequences. * @param _to Address to wich we want to add the NFT. * @param _tokenId Which NFT we want to add. */ function _addNFToken( address _to, uint256 _tokenId ) internal virtual { require(idToOwner[_tokenId] == address(0), NFT_ALREADY_EXISTS); idToOwner[_tokenId] = _to; ownerToNFTokenCount[_to] = ownerToNFTokenCount[_to].add(1); } /** *������@dev Helper function that gets NFT count of owner. This is needed for overriding in enumerable * extension to remove double storage (gas optimization) of owner nft count. * @param _owner Address for whom to query the count. * @return Number of _owner NFTs. */ function _getOwnerNFTCount( address _owner ) internal virtual view returns (uint256) { return ownerToNFTokenCount[_owner]; } /** * @dev Actually perform the safeTransferFrom. * @param _from The current owner of the NFT. * @param _to The new owner. * @param _tokenId The NFT to transfer. * @param _data Additional data with no specified format, sent in call to `_to`. */ function _safeTransferFrom( address _from, address _to, uint256 _tokenId, bytes memory _data ) private canTransfer(_tokenId) validNFToken(_tokenId) { address tokenOwner = idToOwner[_tokenId]; require(tokenOwner == _from, NOT_OWNER); require(_to != address(0), ZERO_ADDRESS); _transfer(_to, _tokenId); if (_to.isContract()) { bytes4 retval = ERC721TokenReceiver(_to).onERC721Received(msg.sender, _from, _tokenId, _data); require(retval == MAGIC_ON_ERC721_RECEIVED, NOT_ABLE_TO_RECEIVE_NFT); } } /** * @dev Clears the current approval of a given NFT ID. * @param _tokenId ID of the NFT to be transferred. */ function _clearApproval( uint256 _tokenId ) private { if (idToApproval[_tokenId] != address(0)) { delete idToApproval[_tokenId]; } } } // File: browser/github/0xcert/ethereum-erc721/src/contracts/tokens/nf-token-enumerable-metadata.sol pragma solidity 0.6.2; /** * @dev Optional metadata implementation for ERC-721 non-fungible token standard. */ abstract contract NFTokenEnumerableMetadata is NFToken, ERC721Metadata, ERC721Enumerable { /** * @dev A descriptive name for a collection of NFTs. */ string internal nftName; /** * @dev An abbreviated name for NFTokens. */ string internal nftSymbol; /** * @dev An uri to represent the metadata for this contract. */ string internal nftContractMetadataUri; /** * @dev Mapping from NFT ID to metadata uri. */ mapping (uint256 => string) internal idToUri; /** * @dev Mapping from NFT ID to encrypted value. */ mapping (uint256 => string) internal idToPayload; /** * @dev Contract constructor. * @notice When implementing this contract don't forget to set nftName and nftSymbol. */ constructor() public { supportedInterfaces[0x5b5e139f] = true; // ERC721Metadata supportedInterfaces[0x780e9d63] = true; // ERC721Enumerable } /** * @dev Returns a descriptive name for a collection of NFTokens. * @return _name Representing name. */ function name() external override view returns (string memory _name) { _name = nftName; } /** * @dev Returns an abbreviated name for NFTokens. * @return _symbol Representing symbol. */ function symbol() external override view returns (string memory _symbol) { _symbol = nftSymbol; } /** * @dev A distinct URI (RFC 3986) for a given NFT. * @param _tokenId Id for which we want uri. * @return URI of _tokenId. */ function tokenURI( uint256 _tokenId ) external override view validNFToken(_tokenId) returns (string memory) { return idToUri[_tokenId]; } /** * @dev A distinct URI (RFC 3986) for a given NFT. * @param _tokenId Id for which we want uri. * @return URI of _tokenId. */ function tokenPayload( uint256 _tokenId ) external view validNFToken(_tokenId) returns (string memory) { return idToPayload[_tokenId]; } /** * @dev Set a distinct URI (RFC 3986) for a given NFT ID. * @notice This is an internal function which should be called from user-implemented external * function. Its purpose is to show and properly initialize data structures when using this * implementation. * @param _tokenId Id for which we want URI. * @param _uri String representing RFC 3986 URI. */ function _setTokenUri( uint256 _tokenId, string memory _uri ) internal validNFToken(_tokenId) { idToUri[_tokenId] = _uri; } function _setTokenPayload( uint256 _tokenId, string memory _uri ) internal validNFToken(_tokenId) { idToPayload[_tokenId] = _uri; } /** * List of revert message codes. Implementing dApp should handle showing the correct message. * Based on 0xcert framework error codes. */ string constant INVALID_INDEX = "005007"; /** * @dev Array of all NFT IDs. */ uint256[] internal tokens; /** * @dev Mapping from token ID to its index in global tokens array. */ mapping(uint256 => uint256) internal idToIndex; /** * @dev Mapping from owner to list of owned NFT IDs. */ mapping(address => uint256[]) internal ownerToIds; /** * @dev Mapping from NFT ID to its index in the owner tokens list. */ mapping(uint256 => uint256) internal idToOwnerIndex; /** * @dev Returns the count of all existing NFTokens. * @return Total supply of NFTs. */ function totalSupply() external override view returns (uint256) { return tokens.length; } /** * @dev Returns NFT ID by its index. * @param _index A counter less than `totalSupply()`. * @return Token id. */ function tokenByIndex( uint256 _index ) external override view returns (uint256) { require(_index < tokens.length, INVALID_INDEX); return tokens[_index]; } /** * @dev returns the n-th NFT ID from a list of owner's tokens. * @param _owner Token owner's address. * @param _index Index number representing n-th token in owner's list of tokens. * @return Token id. */ function tokenOfOwnerByIndex( address _owner, uint256 _index ) external override view returns (uint256) { require(_index < ownerToIds[_owner].length, INVALID_INDEX); return ownerToIds[_owner][_index]; } /** * @dev Mints a new NFT. * @notice This is an internal function which should be called from user-implemented external * mint function. Its purpose is to show and properly initialize data structures when using this * implementation. * @param _to The address that will own the minted NFT. * @param _tokenId of the NFT to be minted by the msg.sender. */ function _mint( address _to, uint256 _tokenId ) internal override virtual { super._mint(_to, _tokenId); tokens.push(_tokenId); idToIndex[_tokenId] = tokens.length - 1; } /** * @dev Burns a NFT. * @notice This is an internal function which should be called from user-implemented external * burn function. Its purpose is to show and properly initialize data structures when using this * implementation. Also, note that this burn implementation allows the minter to re-mint a burned * NFT. * @param _tokenId ID of the NFT to be burned. */ function _burn( uint256 _tokenId ) internal override virtual { super._burn(_tokenId); if (bytes(idToUri[_tokenId]).length != 0) { delete idToUri[_tokenId]; } if (bytes(idToPayload[_tokenId]).length != 0) { delete idToPayload[_tokenId]; } uint256 tokenIndex = idToIndex[_tokenId]; uint256 lastTokenIndex = tokens.length - 1; uint256 lastToken = tokens[lastTokenIndex]; tokens[tokenIndex] = lastToken; tokens.pop(); // This wastes gas if you are burning the last token but saves a little gas if you are not. idToIndex[lastToken] = tokenIndex; idToIndex[_tokenId] = 0; } /** * @dev Removes a NFT from an address. * @notice Use and override this function with caution. Wrong usage can have serious consequences. * @param _from Address from wich we want to remove the NFT. * @param _tokenId Which NFT we want to remove. */ function _removeNFToken( address _from, uint256 _tokenId ) internal override virtual { require(idToOwner[_tokenId] == _from, NOT_OWNER); delete idToOwner[_tokenId]; uint256 tokenToRemoveIndex = idToOwnerIndex[_tokenId]; uint256 lastTokenIndex = ownerToIds[_from].length - 1; if (lastTokenIndex != tokenToRemoveIndex) { uint256 lastToken = ownerToIds[_from][lastTokenIndex]; ownerToIds[_from][tokenToRemoveIndex] = lastToken; idToOwnerIndex[lastToken] = tokenToRemoveIndex; } ownerToIds[_from].pop(); } /** * @dev Assignes a new NFT to an address. * @notice Use and override this function with caution. Wrong usage can have serious consequences. * @param _to Address to wich we want to add the NFT. * @param _tokenId Which NFT we want to add. */ function _addNFToken( address _to, uint256 _tokenId ) internal override virtual { require(idToOwner[_tokenId] == address(0), NFT_ALREADY_EXISTS); idToOwner[_tokenId] = _to; ownerToIds[_to].push(_tokenId); idToOwnerIndex[_tokenId] = ownerToIds[_to].length - 1; } /** * @dev Helper function that gets NFT count of owner. This is needed for overriding in enumerable * extension to remove double storage(gas optimization) of owner nft count. * @param _owner Address for whom to query the count. * @return Number of _owner NFTs. */ function _getOwnerNFTCount( address _owner ) internal override virtual view returns (uint256) { return ownerToIds[_owner].length; } } // File: browser/EmblemVault_v2.sol pragma experimental ABIEncoderV2; pragma solidity 0.6.2; /** * @dev This is an example contract implementation of NFToken with metadata extension. */ contract EmblemVault is NFTokenEnumerableMetadata, Ownable { /** * @dev Contract constructor. Sets metadata extension `name` and `symbol`. */ constructor() public { nftName = "Emblem Vault V2"; nftSymbol = "Emblem.pro"; } function changeName(string calldata name, string calldata symbol) external onlyOwner { nftName = name; nftSymbol = symbol; } /** * @dev Mints a new NFT. * @param _to The address that will own the minted NFT. * @param _tokenId of the NFT to be minted by the msg.sender. * @param _uri String representing RFC 3986 URI. */ function mint( address _to, uint256 _tokenId, string calldata _uri, string calldata _payload) external onlyOwner { super._mint(_to, _tokenId); super._setTokenUri(_tokenId, _uri); super._setTokenPayload(_tokenId, _payload); } function burn(uint256 _tokenId) external canTransfer(_tokenId) { super._burn(_tokenId); } function contractURI() public view returns (string memory) { return nftContractMetadataUri; } event UpdatedContractURI(string _from, string _to); function updateContractURI(string memory uri) public onlyOwner { emit UpdatedContractURI(nftContractMetadataUri, uri); nftContractMetadataUri = uri; } function getOwnerNFTCount(address _owner) public view returns (uint256) { return NFTokenEnumerableMetadata._getOwnerNFTCount(_owner); } function updateTokenUri( uint256 _tokenId, string memory _uri ) public validNFToken(_tokenId) onlyOwner { idToUri[_tokenId] = _uri; } }
EmblemVault ABI
Copied
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_owner","type":"address"},{"indexed":true,"internalType":"address","name":"_approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_owner","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":"_from","type":"address"},{"indexed":true,"internalType":"address","name":"_to","type":"address"},{"indexed":true,"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"_from","type":"string"},{"indexed":false,"internalType":"string","name":"_to","type":"string"}],"name":"UpdatedContractURI","type":"event"},{"inputs":[],"name":"CANNOT_TRANSFER_TO_ZERO_ADDRESS","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"NOT_CURRENT_OWNER","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_approved","type":"address"},{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"}],"name":"changeName","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"contractURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"}],"name":"getOwnerNFTCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"address","name":"_operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"string","name":"_uri","type":"string"},{"internalType":"string","name":"_payload","type":"string"}],"name":"mint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"_name","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"_owner","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_from","type":"address"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_from","type":"address"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_tokenId","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":"bytes4","name":"_interfaceID","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"_symbol","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"uint256","name":"_index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"tokenPayload","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"tokenURI","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":"_from","type":"address"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"uri","type":"string"}],"name":"updateContractURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"string","name":"_uri","type":"string"}],"name":"updateTokenUri","outputs":[],"stateMutability":"nonpayable","type":"function"}]
EmblemVault Bytecode
Copied
60806040523480156200001157600080fd5b50600060208181527f67be87c3ff9960ca1e9cfac5cab2ff4747269cf9ed20c9b7306235ac35a491c5805460ff1990811660019081179092557ff7815fccbf112960a73756e185887fedcb9fc64ca0a16cc5923b7960ed78080080548216831790557f9562381dfbc2d8b8b66e765249f330164b73e329e5f01670660643571d1974df805482168317905563780e9d6360e01b9093527f77b7bbe0e49b76487c9476b5db3354cf5270619d0037ccb899c2a4c4a75b4318805490931617909155600e80546001600160a01b0319163317905560408051808201909152600f8082526e22b6b13632b6902b30bab63a102b1960891b919092019081526200011b916005919062000156565b5060408051808201909152600a80825269456d626c656d2e70726f60b01b60209092019182526200014f9160069162000156565b50620001fb565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106200019957805160ff1916838001178555620001c9565b82800160010185558215620001c9579182015b82811115620001c9578251825591602001919060010190620001ac565b50620001d7929150620001db565b5090565b620001f891905b80821115620001d75760008155600101620001e2565b90565b6122e2806200020b6000396000f3fe608060405234801561001057600080fd5b50600436106101c45760003560e01c8063860d248a116100f9578063bd7f4c8d11610097578063e8a3d48511610071578063e8a3d48514610399578063e985e9c5146103a1578063f2fde38b146103b4578063f3fe3bc3146103c7576101c4565b8063bd7f4c8d14610360578063c87b56dd14610373578063d31af48414610386576101c4565b806395d89b41116100d357806395d89b411461031f5780639ad9523214610327578063a22cb4651461033a578063b88d4fde1461034d576101c4565b8063860d248a146102fc57806386575e40146103045780638da5cb5b14610317576101c4565b80632fb102cf116101665780634f6ccce7116101405780634f6ccce7146102b05780636352211e146102c357806370a08231146102d65780637e5b1e24146102e9576101c4565b80632fb102cf1461027757806342842e0e1461028a57806342966c681461029d576101c4565b8063095ea7b3116101a2578063095ea7b31461022757806318160ddd1461023c57806323b872dd146102515780632f745c5914610264576101c4565b806301ffc9a7146101c957806306fdde03146101f2578063081812fc14610207575b600080fd5b6101dc6101d7366004611ffb565b6103cf565b6040516101e991906121c8565b60405180910390f35b6101fa6103ee565b6040516101e991906121d3565b61021a6102153660046120cf565b610484565b6040516101e99190612177565b61023a610235366004611f48565b610506565b005b6102446106a8565b6040516101e99190612278565b61023a61025f366004611e5e565b6106af565b610244610272366004611f48565b61086a565b61023a610285366004611f72565b6108fc565b61023a610298366004611e5e565b6109d8565b61023a6102ab3660046120cf565b6109f8565b6102446102be3660046120cf565b610aab565b61021a6102d13660046120cf565b610b0d565b6102446102e4366004611e08565b610b65565b61023a6102f736600461209c565b610bb6565b6101fa610c51565b61023a610312366004612033565b610c73565b61021a610cdd565b6101fa610cec565b6101fa6103353660046120cf565b610d4d565b61023a610348366004611f0d565b610e49565b61023a61035b366004611e9e565b610eb8565b61024461036e366004611e08565b610efa565b6101fa6103813660046120cf565b610f05565b61023a6103943660046120e7565b610fc9565b6101fa611092565b6101dc6103af366004611e2a565b6110f3565b61023a6103c2366004611e08565b611121565b6101fa61120c565b6001600160e01b03191660009081526020819052604090205460ff1690565b60058054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561047a5780601f1061044f5761010080835404028352916020019161047a565b820191906000526020600020905b81548152906001019060200180831161045d57829003601f168201915b5050505050905090565b6000818152600160209081526040808320548151808301909252600682526518181998181960d11b9282019290925283916001600160a01b03166104e45760405162461bcd60e51b81526004016104db91906121d3565b60405180910390fd5b506000838152600260205260409020546001600160a01b031691505b50919050565b60008181526001602052604090205481906001600160a01b03163381148061055157506001600160a01b038116600090815260046020908152604080832033845290915290205460ff165b6040518060400160405280600681526020016530303330303360d01b8152509061058e5760405162461bcd60e51b81526004016104db91906121d3565b50600083815260016020908152604091829020548251808401909352600683526518181998181960d11b918301919091528491906001600160a01b03166105e85760405162461bcd60e51b81526004016104db91906121d3565b50600084815260016020908152604091829020548251808401909352600683526506060666060760d31b918301919091526001600160a01b03908116919087168214156106485760405162461bcd60e51b81526004016104db91906121d3565b5060008581526002602052604080822080546001600160a01b0319166001600160a01b038a811691821790925591518893918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050505050565b600a545b90565b60008181526001602052604090205481906001600160a01b0316338114806106ed57506000828152600260205260409020546001600160a01b031633145b8061071b57506001600160a01b038116600090815260046020908152604080832033845290915290205460ff165b604051806040016040528060068152602001650c0c0ccc0c0d60d21b815250906107585760405162461bcd60e51b81526004016104db91906121d3565b50600083815260016020908152604091829020548251808401909352600683526518181998181960d11b918301919091528491906001600160a01b03166107b25760405162461bcd60e51b81526004016104db91906121d3565b50600084815260016020908152604091829020548251808401909352600683526530303330303760d01b918301919091526001600160a01b039081169190881682146108115760405162461bcd60e51b81526004016104db91906121d3565b5060408051808201909152600681526530303330303160d01b60208201526001600160a01b0387166108565760405162461bcd60e51b81526004016104db91906121d3565b50610861868661122e565b50505050505050565b6001600160a01b0382166000908152600c60209081526040808320548151808301909252600682526530303530303760d01b928201929092529083106108c35760405162461bcd60e51b81526004016104db91906121d3565b506001600160a01b0383166000908152600c602052604090208054839081106108e857fe5b906000526020600020015490505b92915050565b600e5460408051808201909152600681526530313830303160d01b6020820152906001600160a01b031633146109455760405162461bcd60e51b81526004016104db91906121d3565b5061095086866112a9565b6109908585858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506112fd92505050565b6109d08583838080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061135692505050565b505050505050565b6109f3838383604051806020016040528060008152506113cf565b505050565b60008181526001602052604090205481906001600160a01b031633811480610a3657506000828152600260205260409020546001600160a01b031633145b80610a6457506001600160a01b038116600090815260046020908152604080832033845290915290205460ff165b604051806040016040528060068152602001650c0c0ccc0c0d60d21b81525090610aa15760405162461bcd60e51b81526004016104db91906121d3565b506109f38361167d565b600a5460408051808201909152600681526530303530303760d01b60208201526000918310610aed5760405162461bcd60e51b81526004016104db91906121d3565b50600a8281548110610afb57fe5b90600052602060002001549050919050565b600081815260016020908152604091829020548251808401909352600683526518181998181960d11b918301919091526001600160a01b031690816105005760405162461bcd60e51b81526004016104db91906121d3565b60408051808201909152600681526530303330303160d01b60208201526000906001600160a01b038316610bac5760405162461bcd60e51b81526004016104db91906121d3565b506108f682611791565b600e5460408051808201909152600681526530313830303160d01b6020820152906001600160a01b03163314610bff5760405162461bcd60e51b81526004016104db91906121d3565b507fc4761b87ec5248fbb0deaff2d6b1651b8dd04322c6597549eefe44d799d480ce600782604051610c329291906121e6565b60405180910390a18051610c4d906007906020840190611be6565b5050565b6040518060400160405280600681526020016518189c18181960d11b81525081565b600e5460408051808201909152600681526530313830303160d01b6020820152906001600160a01b03163314610cbc5760405162461bcd60e51b81526004016104db91906121d3565b50610cc960058585611c64565b50610cd660068383611c64565b5050505050565b600e546001600160a01b031681565b60068054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561047a5780601f1061044f5761010080835404028352916020019161047a565b600081815260016020908152604091829020548251808401909352600683526518181998181960d11b9183019190915260609183916001600160a01b0316610da85760405162461bcd60e51b81526004016104db91906121d3565b5060008381526009602090815260409182902080548351601f600260001961010060018616150201909316929092049182018490048402810184019094528084529091830182828015610e3c5780601f10610e1157610100808354040283529160200191610e3c565b820191906000526020600020905b815481529060010190602001808311610e1f57829003601f168201915b5050505050915050919050565b3360008181526004602090815260408083206001600160a01b038716808552925291829020805460ff191685151517905590519091907f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3190610eac9085906121c8565b60405180910390a35050565b610cd685858585858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506113cf92505050565b60006108f682611791565b600081815260016020908152604091829020548251808401909352600683526518181998181960d11b9183019190915260609183916001600160a01b0316610f605760405162461bcd60e51b81526004016104db91906121d3565b5060008381526008602090815260409182902080548351601f600260001961010060018616150201909316929092049182018490048402810184019094528084529091830182828015610e3c5780601f10610e1157610100808354040283529160200191610e3c565b600082815260016020908152604091829020548251808401909352600683526518181998181960d11b918301919091528391906001600160a01b03166110225760405162461bcd60e51b81526004016104db91906121d3565b50600e5460408051808201909152600681526530313830303160d01b6020820152906001600160a01b0316331461106c5760405162461bcd60e51b81526004016104db91906121d3565b506000838152600860209081526040909120835161108c92850190611be6565b50505050565b60078054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561047a5780601f1061044f5761010080835404028352916020019161047a565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205460ff1690565b600e5460408051808201909152600681526530313830303160d01b6020820152906001600160a01b0316331461116a5760405162461bcd60e51b81526004016104db91906121d3565b5060408051808201909152600681526518189c18181960d11b60208201526001600160a01b0382166111af5760405162461bcd60e51b81526004016104db91906121d3565b50600e546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600e80546001600160a01b0319166001600160a01b0392909216919091179055565b6040518060400160405280600681526020016530313830303160d01b81525081565b6000818152600160205260409020546001600160a01b031661124f826117ac565b61125981836117e9565b611263838361194b565b81836001600160a01b0316826001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4505050565b6112b38282611a05565b600a80546001810182557fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a801829055546000918252600b6020526040909120600019909101905550565b600082815260016020908152604091829020548251808401909352600683526518181998181960d11b918301919091528391906001600160a01b031661106c5760405162461bcd60e51b81526004016104db91906121d3565b600082815260016020908152604091829020548251808401909352600683526518181998181960d11b918301919091528391906001600160a01b03166113af5760405162461bcd60e51b81526004016104db91906121d3565b506000838152600960209081526040909120835161108c92850190611be6565b60008281526001602052604090205482906001600160a01b03163381148061140d57506000828152600260205260409020546001600160a01b031633145b8061143b57506001600160a01b038116600090815260046020908152604080832033845290915290205460ff165b604051806040016040528060068152602001650c0c0ccc0c0d60d21b815250906114785760405162461bcd60e51b81526004016104db91906121d3565b50600084815260016020908152604091829020548251808401909352600683526518181998181960d11b918301919091528591906001600160a01b03166114d25760405162461bcd60e51b81526004016104db91906121d3565b50600085815260016020908152604091829020548251808401909352600683526530303330303760d01b918301919091526001600160a01b039081169190891682146115315760405162461bcd60e51b81526004016104db91906121d3565b5060408051808201909152600681526530303330303160d01b60208201526001600160a01b0388166115765760405162461bcd60e51b81526004016104db91906121d3565b50611581878761122e565b611593876001600160a01b0316611ae8565b1561167357604051630a85bd0160e11b81526000906001600160a01b0389169063150b7a02906115cd9033908d908c908c9060040161218b565b602060405180830381600087803b1580156115e757600080fd5b505af11580156115fb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061161f9190810190612017565b60408051808201909152600681526530303330303560d01b60208201529091506001600160e01b03198216630a85bd0160e11b146116705760405162461bcd60e51b81526004016104db91906121d3565b50505b5050505050505050565b61168681611b24565b60008181526008602052604090205460026000196101006001841615020190911604156116c45760008181526008602052604081206116c491611cd2565b600081815260096020526040902054600260001961010060018416150201909116041561170257600081815260096020526040812061170291611cd2565b6000818152600b6020526040812054600a805491926000198301929091908390811061172a57fe5b9060005260206000200154905080600a848154811061174557fe5b600091825260209091200155600a80548061175c57fe5b600082815260208082208301600019908101839055909201909255918152600b90915260408082209390935592835250812055565b6001600160a01b03166000908152600c602052604090205490565b6000818152600260205260409020546001600160a01b0316156117e657600081815260026020526040902080546001600160a01b03191690555b50565b600081815260016020908152604091829020548251808401909352600683526530303330303760d01b918301919091526001600160a01b038481169116146118445760405162461bcd60e51b81526004016104db91906121d3565b50600081815260016020908152604080832080546001600160a01b0319169055600d8252808320546001600160a01b0386168452600c909252909120546000190180821461190e576001600160a01b0384166000908152600c602052604081208054839081106118b057fe5b9060005260206000200154905080600c6000876001600160a01b03166001600160a01b0316815260200190815260200160002084815481106118ee57fe5b6000918252602080832090910192909255918252600d9052604090208290555b6001600160a01b0384166000908152600c6020526040902080548061192f57fe5b6001900381819060005260206000200160009055905550505050565b600081815260016020908152604091829020548251808401909352600683526518181998181b60d11b918301919091526001600160a01b0316156119a25760405162461bcd60e51b81526004016104db91906121d3565b50600081815260016020818152604080842080546001600160a01b0319166001600160a01b03979097169687179055948352600c8152848320805492830181558084528184209092018490559054928252600d9052919091206000199091019055565b60408051808201909152600681526530303330303160d01b60208201526001600160a01b038316611a495760405162461bcd60e51b81526004016104db91906121d3565b50600081815260016020908152604091829020548251808401909352600683526518181998181b60d11b918301919091526001600160a01b031615611aa15760405162461bcd60e51b81526004016104db91906121d3565b50611aac828261194b565b60405181906001600160a01b038416906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a4708115801590611b1c5750808214155b949350505050565b600081815260016020908152604091829020548251808401909352600683526518181998181960d11b918301919091528291906001600160a01b0316611b7d5760405162461bcd60e51b81526004016104db91906121d3565b506000828152600160205260409020546001600160a01b0316611b9f836117ac565b611ba981846117e9565b60405183906000906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a4505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10611c2757805160ff1916838001178555611c54565b82800160010185558215611c54579182015b82811115611c54578251825591602001919060010190611c39565b50611c60929150611d12565b5090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10611ca55782800160ff19823516178555611c54565b82800160010185558215611c54579182015b82811115611c54578235825591602001919060010190611cb7565b50805460018160011615610100020316600290046000825580601f10611cf857506117e6565b601f0160209004906000526020600020908101906117e691905b6106ac91905b80821115611c605760008155600101611d18565b80356001600160a01b03811681146108f657600080fd5b60008083601f840112611d54578182fd5b50813567ffffffffffffffff811115611d6b578182fd5b602083019150836020828501011115611d8357600080fd5b9250929050565b600082601f830112611d9a578081fd5b813567ffffffffffffffff80821115611db1578283fd5b604051601f8301601f191681016020018281118282101715611dd1578485fd5b604052828152925082848301602001861015611dec57600080fd5b8260208601602083013760006020848301015250505092915050565b600060208284031215611e19578081fd5b611e238383611d2c565b9392505050565b60008060408385031215611e3c578081fd5b611e468484611d2c565b9150611e558460208501611d2c565b90509250929050565b600080600060608486031215611e72578081fd5b8335611e7d81612281565b92506020840135611e8d81612281565b929592945050506040919091013590565b600080600080600060808688031215611eb5578081fd5b611ebf8787611d2c565b9450611ece8760208801611d2c565b935060408601359250606086013567ffffffffffffffff811115611ef0578182fd5b611efc88828901611d43565b969995985093965092949392505050565b60008060408385031215611f1f578182fd5b611f298484611d2c565b915060208301358015158114611f3d578182fd5b809150509250929050565b60008060408385031215611f5a578182fd5b611f648484611d2c565b946020939093013593505050565b60008060008060008060808789031215611f8a578081fd5b8635611f9581612281565b955060208701359450604087013567ffffffffffffffff80821115611fb8578283fd5b611fc48a838b01611d43565b90965094506060890135915080821115611fdc578283fd5b50611fe989828a01611d43565b979a9699509497509295939492505050565b60006020828403121561200c578081fd5b8135611e2381612296565b600060208284031215612028578081fd5b8151611e2381612296565b60008060008060408587031215612048578384fd5b843567ffffffffffffffff8082111561205f578586fd5b61206b88838901611d43565b90965094506020870135915080821115612083578384fd5b5061209087828801611d43565b95989497509550505050565b6000602082840312156120ad578081fd5b813567ffffffffffffffff8111156120c3578182fd5b611b1c84828501611d8a565b6000602082840312156120e0578081fd5b5035919050565b600080604083850312156120f9578182fd5b82359150602083013567ffffffffffffffff811115612116578182fd5b61212285828601611d8a565b9150509250929050565b60008151808452815b8181101561215157602081850181015186830182015201612135565b818111156121625782602083870101525b50601f01601f19169290920160200192915050565b6001600160a01b0391909116815260200190565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906121be9083018461212c565b9695505050505050565b901515815260200190565b600060208252611e23602083018461212c565b6000604082016040835281855460018082166000811461220d576001811461222b57612263565b60028304607f16855260ff1983166060880152608087019350612263565b600283048086528987526020808820885b838110156122585781548b82016060015290850190820161223c565b8a0160600196505050505b50505083810360208501526121be818661212c565b90815260200190565b6001600160a01b03811681146117e657600080fd5b6001600160e01b0319811681146117e657600080fdfea26469706673582212206626fd920334c84d658057cbe16dd3b47b41fc7475707238fefa241a53c0a51164736f6c63430006020033
Smart Contracts contract page background

Checkout more smart contracts

    Ethereum  logo

    Collection

    Verified

    The following smart contract is a Collection contract that implements ERC721 and IERC2981 interfaces. It allows for the creation and configuration of sequences, which are used to mint unique tokens. The contract also includes functions for minting tokens, transferring ownership, and retrieving sequence data. Additionally, the contract implements a royalty system for token sales.

    0x363c5dc3ff5a93c9ab1ec54337d211148e10f567
    Copied
    • Verified, NFT
    • Non Fungible Token
    • ERC-721
    • IERC2981
    Ethereum  logo

    EmblemVault

    Verified

    The following smart contract is called EmblemVault and it is an implementation of the ERC721 standard for non-fungible tokens (NFTs). It allows for minting, burning, and transferring of NFTs. The contract also includes functions for updating the contract URI and token URI. The contract inherits from the NFTokenEnumerableMetadata and Ownable contracts. The purpose of the contract is to provide a secure and flexible way to manage NFTs.

    0x82c7a8f707110f5fbb16184a5933e9f78a34c6ab
    Copied
    • Verified, NFT
    • Non Fungible Token
    • ERC-721
    Ethereum  logo

    ERC721SeaDrop

    Explore the source code, ABI, and bytecode for the ERC721SeaDrop smart contract.

    0xea20d8f1b027f360f8b39029d167f2679e702a86
    Copied
    • NFT
    • Non Fungible Token
    • ERC-721
Section background image

Build blockchain magic

Alchemy combines the most powerful web3 developer products and tools with resources, community and legendary support.

Get your API key