Feature Tip: Add private address tag to any address under My Name Tag !
ERC-721
Overview
Max Total Supply
5,661 TNLB
Holders
1,915
Market
Volume (24H)
N/A
Min Price (24H)
N/A
Max Price (24H)
N/A
Other Info
Token Contract
Balance
1 TNLBLoading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
Contract Name:
Bag
Compiler Version
v0.8.15+commit.e14f2714
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity 0.8.15; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Royalty.sol"; import "@openzeppelin/contracts/access/AccessControl.sol"; import "./interfaces/IBag.sol"; import "./interfaces/IUnpacker.sol"; import "./helpers/MinterManaged.sol"; /** * @dev ASM The Next Legends - Bag contract */ contract Bag is IBag, ERC721Royalty, MinterManaged { IUnpacker public unpacker_; // ASM Unpacker contract, used for opening Bags uint256 public totalSupply; string public baseURI; bool public isAllowedToOpen; event BaseURIChanged(string newBaseURI); event ContractUpgraded(uint256 timestamp, string indexed contractName, address oldAddress, address newAddress); constructor(address manager, address asm) MinterManaged(manager, asm) ERC721("TNL Bag", "TNLB") {} /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(MinterManaged, ERC721Royalty, IBag) returns (bool) { if (MinterManaged.supportsInterface(interfaceId)) { return true; } return interfaceId == type(IBag).interfaceId || interfaceId == type(IERC165).interfaceId || interfaceId == type(IERC721).interfaceId || interfaceId == type(ERC721Royalty).interfaceId || interfaceId == type(IERC721Metadata).interfaceId; } /** ---------------------------------- * ! Public functions * ----------------------------------- */ /** * @notice * @dev This function can only be called from contracts or wallets with MINTER_ROLE * @param recipient The wallet address to receive a minted token */ function mint(address recipient) external onlyRole(MINTER_ROLE) returns (uint256) { if (recipient == address(0)) revert InvalidInput(INVALID_ADDRESS); _mint(recipient, totalSupply); return totalSupply++; } /** * @notice * @param tokenId The token ID of a bag * @param recipient The wallet address to receive a content of the bag */ function open(uint256 tokenId, address recipient) external whenAllowed { if (ownerOf(tokenId) != msg.sender) revert AccessError(WRONG_TOKEN_OWNER); if (recipient == address(0)) revert InvalidInput(INVALID_ADDRESS); unpacker_.unpack(tokenId, recipient); _burn(tokenId); } /** * @notice This function is designed to burn used (opened) bags * @dev This function can only be called by MINTER_ROLE * @param tokenId ID of token to burn */ function burn(uint256 tokenId) external onlyRole(MINTER_ROLE) { _burn(tokenId); } /** ---------------------------------- * ! Manager's functions * ----------------------------------- */ /** * @notice Upgrade Unpacker contract address * @dev This function can only be called from contracts or wallets with MANAGER_ROLE * @param newContract Address of new contract */ function upgradeUnpackerContract(address newContract) external onlyRole(MANAGER_ROLE) { if (newContract == address(0)) revert InvalidInput(INVALID_ADDRESS); unpacker_ = IUnpacker(newContract); address oldContract = address(unpacker_); unpacker_ = IUnpacker(newContract); if (!unpacker_.supportsInterface(type(IUnpacker).interfaceId)) revert UpgradeError(WRONG_UNPACKER_CONTRACT); emit ContractUpgraded(block.timestamp, "Unpacker.sol", oldContract, newContract); } /** * @notice Get base URI for the tokenURI * @return address the baseURI */ function _baseURI() internal view override returns (string memory) { return baseURI; } /** * @notice Get base URI for the tokenURI * @dev emit an Event with new baseURI * @dev only MANAGER_ROLE can call this function * @param newURI new baseURI to set */ function setBaseURI(string calldata newURI) external onlyRole(MANAGER_ROLE) { baseURI = newURI; emit BaseURIChanged(newURI); } /** * @notice Set the default royalty amount * @dev only MANAGER_ROLE can call this function * @param receiver wallet to collect royalties * @param feeNumerator percent of royalties, e.g. 2550 = 25.5%, 17.01% = 1701 */ function setDefaultRoyalty(address receiver, uint96 feeNumerator) external onlyRole(MANAGER_ROLE) { _setDefaultRoyalty(receiver, feeNumerator); } /** * @notice Set the royalty amount for the specific token * @dev only MANAGER_ROLE can call this function * @param tokenId specific tokenId to setup royalty * @param receiver wallet to collect royalties * @param feeNumerator percent of royalties, e.g. 2550 = 25.5%, 17.01% = 1701 */ function setTokenRoyalty( uint256 tokenId, address receiver, uint96 feeNumerator ) external onlyRole(MANAGER_ROLE) { _setTokenRoyalty(tokenId, receiver, feeNumerator); } /** * @dev Resets royalty information for the token id back to the global default. */ function resetTokenRoyalty(uint256 tokenId) external onlyRole(MANAGER_ROLE) { _resetTokenRoyalty(tokenId); } /** * @dev Removes default royalty information. */ function deleteDefaultRoyalty() external onlyRole(MANAGER_ROLE) { _deleteDefaultRoyalty(); } /** * @notice Manager can (dis)allow users to open their bags * @dev only MANAGER_ROLE can call this function * @param _isAllowedToOpen true of false */ function allowToOpen(bool _isAllowedToOpen) external onlyRole(MANAGER_ROLE) { isAllowedToOpen = _isAllowedToOpen; } modifier whenAllowed() { if (isAllowedToOpen) _; else revert OpenError(NOT_ALLOWED); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (access/AccessControl.sol) pragma solidity ^0.8.0; import "./IAccessControl.sol"; import "../utils/Context.sol"; import "../utils/Strings.sol"; import "../utils/introspection/ERC165.sol"; /** * @dev Contract module that allows children to implement role-based access * control mechanisms. This is a lightweight version that doesn't allow enumerating role * members except through off-chain means by accessing the contract event logs. Some * applications may benefit from on-chain enumerability, for those cases see * {AccessControlEnumerable}. * * Roles are referred to by their `bytes32` identifier. These should be exposed * in the external API and be unique. The best way to achieve this is by * using `public constant` hash digests: * * ``` * bytes32 public constant MY_ROLE = keccak256("MY_ROLE"); * ``` * * Roles can be used to represent a set of permissions. To restrict access to a * function call, use {hasRole}: * * ``` * function foo() public { * require(hasRole(MY_ROLE, msg.sender)); * ... * } * ``` * * Roles can be granted and revoked dynamically via the {grantRole} and * {revokeRole} functions. Each role has an associated admin role, and only * accounts that have a role's admin role can call {grantRole} and {revokeRole}. * * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means * that only accounts with this role will be able to grant or revoke other * roles. More complex role relationships can be created by using * {_setRoleAdmin}. * * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to * grant and revoke this role. Extra precautions should be taken to secure * accounts that have been granted it. */ abstract contract AccessControl is Context, IAccessControl, ERC165 { struct RoleData { mapping(address => bool) members; bytes32 adminRole; } mapping(bytes32 => RoleData) private _roles; bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /** * @dev Modifier that checks that an account has a specific role. Reverts * with a standardized message including the required role. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ * * _Available since v4.1._ */ modifier onlyRole(bytes32 role) { _checkRole(role); _; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) public view virtual override returns (bool) { return _roles[role].members[account]; } /** * @dev Revert with a standard message if `_msgSender()` is missing `role`. * Overriding this function changes the behavior of the {onlyRole} modifier. * * Format of the revert message is described in {_checkRole}. * * _Available since v4.6._ */ function _checkRole(bytes32 role) internal view virtual { _checkRole(role, _msgSender()); } /** * @dev Revert with a standard message if `account` is missing `role`. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ */ function _checkRole(bytes32 role, address account) internal view virtual { if (!hasRole(role, account)) { revert( string( abi.encodePacked( "AccessControl: account ", Strings.toHexString(uint160(account), 20), " is missing role ", Strings.toHexString(uint256(role), 32) ) ) ); } } /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) { return _roles[role].adminRole; } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. * * May emit a {RoleGranted} event. */ function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _grantRole(role, account); } /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. * * May emit a {RoleRevoked} event. */ function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _revokeRole(role, account); } /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been revoked `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. * * May emit a {RoleRevoked} event. */ function renounceRole(bytes32 role, address account) public virtual override { require(account == _msgSender(), "AccessControl: can only renounce roles for self"); _revokeRole(role, account); } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. Note that unlike {grantRole}, this function doesn't perform any * checks on the calling account. * * May emit a {RoleGranted} event. * * [WARNING] * ==== * This function should only be called from the constructor when setting * up the initial roles for the system. * * Using this function in any other way is effectively circumventing the admin * system imposed by {AccessControl}. * ==== * * NOTE: This function is deprecated in favor of {_grantRole}. */ function _setupRole(bytes32 role, address account) internal virtual { _grantRole(role, account); } /** * @dev Sets `adminRole` as ``role``'s admin role. * * Emits a {RoleAdminChanged} event. */ function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual { bytes32 previousAdminRole = getRoleAdmin(role); _roles[role].adminRole = adminRole; emit RoleAdminChanged(role, previousAdminRole, adminRole); } /** * @dev Grants `role` to `account`. * * Internal function without access restriction. * * May emit a {RoleGranted} event. */ function _grantRole(bytes32 role, address account) internal virtual { if (!hasRole(role, account)) { _roles[role].members[account] = true; emit RoleGranted(role, account, _msgSender()); } } /** * @dev Revokes `role` from `account`. * * Internal function without access restriction. * * May emit a {RoleRevoked} event. */ function _revokeRole(bytes32 role, address account) internal virtual { if (hasRole(role, account)) { _roles[role].members[account] = false; emit RoleRevoked(role, account, _msgSender()); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol) pragma solidity ^0.8.0; /** * @dev External interface of AccessControl declared to support ERC165 detection. */ interface IAccessControl { /** * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` * * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite * {RoleAdminChanged} not being emitted signaling this. * * _Available since v3.1._ */ event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole); /** * @dev Emitted when `account` is granted `role`. * * `sender` is the account that originated the contract call, an admin role * bearer except when using {AccessControl-_setupRole}. */ event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Emitted when `account` is revoked `role`. * * `sender` is the account that originated the contract call: * - if using `revokeRole`, it is the admin role bearer * - if using `renounceRole`, it is the role bearer (i.e. `account`) */ event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) external view returns (bool); /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {AccessControl-_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) external view returns (bytes32); /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function grantRole(bytes32 role, address account) external; /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function revokeRole(bytes32 role, address account) external; /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been granted `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. */ function renounceRole(bytes32 role, address account) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _transferOwnership(_msgSender()); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { require(owner() == _msgSender(), "Ownable: caller is not the owner"); } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (interfaces/IERC2981.sol) pragma solidity ^0.8.0; import "../utils/introspection/IERC165.sol"; /** * @dev Interface for the NFT Royalty Standard. * * A standardized way to retrieve royalty payment information for non-fungible tokens (NFTs) to enable universal * support for royalty payments across all NFT marketplaces and ecosystem participants. * * _Available since v4.5._ */ interface IERC2981 is IERC165 { /** * @dev Returns how much royalty is owed and to whom, based on a sale price that may be denominated in any unit of * exchange. The royalty amount is denominated and should be paid in that same unit of exchange. */ function royaltyInfo(uint256 tokenId, uint256 salePrice) external view returns (address receiver, uint256 royaltyAmount); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (token/ERC721/ERC721.sol) pragma solidity ^0.8.0; import "./IERC721.sol"; import "./IERC721Receiver.sol"; import "./extensions/IERC721Metadata.sol"; import "../../utils/Address.sol"; import "../../utils/Context.sol"; import "../../utils/Strings.sol"; import "../../utils/introspection/ERC165.sol"; /** * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including * the Metadata extension, but not including the Enumerable extension, which is available separately as * {ERC721Enumerable}. */ contract ERC721 is Context, ERC165, IERC721, IERC721Metadata { using Address for address; using Strings for uint256; // Token name string private _name; // Token symbol string private _symbol; // 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; // Mapping from owner to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; /** * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection. */ constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IERC721).interfaceId || interfaceId == type(IERC721Metadata).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721-balanceOf}. */ function balanceOf(address owner) public view virtual override returns (uint256) { require(owner != address(0), "ERC721: address zero is not a valid owner"); return _balances[owner]; } /** * @dev See {IERC721-ownerOf}. */ function ownerOf(uint256 tokenId) public view virtual override returns (address) { address owner = _owners[tokenId]; require(owner != address(0), "ERC721: invalid token ID"); return owner; } /** * @dev See {IERC721Metadata-name}. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev See {IERC721Metadata-symbol}. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { _requireMinted(tokenId); string memory baseURI = _baseURI(); return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : ""; } /** * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each * token will be the concatenation of the `baseURI` and the `tokenId`. Empty * by default, can be overridden in child contracts. */ function _baseURI() internal view virtual returns (string memory) { return ""; } /** * @dev See {IERC721-approve}. */ function approve(address to, uint256 tokenId) public virtual override { address owner = ERC721.ownerOf(tokenId); require(to != owner, "ERC721: approval to current owner"); require( _msgSender() == owner || isApprovedForAll(owner, _msgSender()), "ERC721: approve caller is not token owner nor approved for all" ); _approve(to, tokenId); } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view virtual override returns (address) { _requireMinted(tokenId); return _tokenApprovals[tokenId]; } /** * @dev See {IERC721-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { _setApprovalForAll(_msgSender(), operator, approved); } /** * @dev See {IERC721-isApprovedForAll}. */ function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { return _operatorApprovals[owner][operator]; } /** * @dev See {IERC721-transferFrom}. */ function transferFrom( address from, address to, uint256 tokenId ) public virtual override { //solhint-disable-next-line max-line-length require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner nor approved"); _transfer(from, to, tokenId); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId ) public virtual override { safeTransferFrom(from, to, tokenId, ""); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory data ) public virtual override { require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner nor approved"); _safeTransfer(from, to, tokenId, data); } /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * `data` is additional data, it has no specified format and it is sent in call to `to`. * * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g. * implement alternative mechanisms to perform token transfer, such as signature-based. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeTransfer( address from, address to, uint256 tokenId, bytes memory data ) internal virtual { _transfer(from, to, tokenId); require(_checkOnERC721Received(from, to, tokenId, data), "ERC721: transfer to non ERC721Receiver implementer"); } /** * @dev Returns whether `tokenId` exists. * * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}. * * 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 Returns whether `spender` is allowed to manage `tokenId`. * * Requirements: * * - `tokenId` must exist. */ function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) { address owner = ERC721.ownerOf(tokenId); return (spender == owner || isApprovedForAll(owner, spender) || getApproved(tokenId) == spender); } /** * @dev Safely mints `tokenId` and transfers it to `to`. * * Requirements: * * - `tokenId` must not exist. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeMint(address to, uint256 tokenId) internal virtual { _safeMint(to, tokenId, ""); } /** * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is * forwarded in {IERC721Receiver-onERC721Received} to contract recipients. */ function _safeMint( address to, uint256 tokenId, bytes memory data ) internal virtual { _mint(to, tokenId); require( _checkOnERC721Received(address(0), to, tokenId, data), "ERC721: transfer to non ERC721Receiver implementer" ); } /** * @dev Mints `tokenId` and transfers it to `to`. * * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible * * Requirements: * * - `tokenId` must not exist. * - `to` cannot be the zero address. * * Emits a {Transfer} event. */ function _mint(address to, uint256 tokenId) internal virtual { require(to != address(0), "ERC721: mint to the zero address"); require(!_exists(tokenId), "ERC721: token already minted"); _beforeTokenTransfer(address(0), to, tokenId); _balances[to] += 1; _owners[tokenId] = to; emit Transfer(address(0), to, tokenId); _afterTokenTransfer(address(0), to, tokenId); } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId) internal virtual { address owner = ERC721.ownerOf(tokenId); _beforeTokenTransfer(owner, address(0), tokenId); // Clear approvals _approve(address(0), tokenId); _balances[owner] -= 1; delete _owners[tokenId]; emit Transfer(owner, address(0), tokenId); _afterTokenTransfer(owner, address(0), tokenId); } /** * @dev Transfers `tokenId` from `from` to `to`. * As opposed to {transferFrom}, this imposes no restrictions on msg.sender. * * 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 virtual { require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner"); require(to != address(0), "ERC721: transfer to the zero address"); _beforeTokenTransfer(from, to, tokenId); // Clear approvals from the previous owner _approve(address(0), tokenId); _balances[from] -= 1; _balances[to] += 1; _owners[tokenId] = to; emit Transfer(from, to, tokenId); _afterTokenTransfer(from, to, tokenId); } /** * @dev Approve `to` to operate on `tokenId` * * Emits an {Approval} event. */ function _approve(address to, uint256 tokenId) internal virtual { _tokenApprovals[tokenId] = to; emit Approval(ERC721.ownerOf(tokenId), to, tokenId); } /** * @dev Approve `operator` to operate on all of `owner` tokens * * Emits an {ApprovalForAll} event. */ function _setApprovalForAll( address owner, address operator, bool approved ) internal virtual { require(owner != operator, "ERC721: approve to caller"); _operatorApprovals[owner][operator] = approved; emit ApprovalForAll(owner, operator, approved); } /** * @dev Reverts if the `tokenId` has not been minted yet. */ function _requireMinted(uint256 tokenId) internal view virtual { require(_exists(tokenId), "ERC721: invalid token ID"); } /** * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address. * The call is not executed if the target address is not a contract. * * @param from address representing the previous owner of the given token ID * @param to target address that will receive the tokens * @param tokenId uint256 ID of the token to be transferred * @param data bytes optional data to send along with the call * @return bool whether the call correctly returned the expected magic value */ function _checkOnERC721Received( address from, address to, uint256 tokenId, bytes memory data ) private returns (bool) { if (to.isContract()) { try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, data) returns (bytes4 retval) { return retval == IERC721Receiver.onERC721Received.selector; } catch (bytes memory reason) { if (reason.length == 0) { revert("ERC721: transfer to non ERC721Receiver implementer"); } else { /// @solidity memory-safe-assembly assembly { revert(add(32, reason), mload(reason)) } } } } else { return true; } } /** * @dev Hook that is called before any token transfer. This includes minting * and burning. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, ``from``'s `tokenId` will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal virtual {} /** * @dev Hook that is called after any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _afterTokenTransfer( address from, address to, uint256 tokenId ) internal virtual {} }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (token/ERC721/IERC721.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721 is IERC165 { /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes calldata data ) external; /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Transfers `tokenId` token from `from` to `to`. * * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Gives permission to `to` 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: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool _approved) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol) pragma solidity ^0.8.0; /** * @title ERC721 token receiver interface * @dev Interface for any contract that wants to support safeTransfers * from ERC721 asset contracts. */ interface IERC721Receiver { /** * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom} * by `operator` from `from`, this function is called. * * It must return its Solidity selector to confirm the token transfer. * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted. * * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`. */ function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/extensions/ERC721Royalty.sol) pragma solidity ^0.8.0; import "../ERC721.sol"; import "../../common/ERC2981.sol"; import "../../../utils/introspection/ERC165.sol"; /** * @dev Extension of ERC721 with the ERC2981 NFT Royalty Standard, a standardized way to retrieve royalty payment * information. * * Royalty information can be specified globally for all token ids via {_setDefaultRoyalty}, and/or individually for * specific token ids via {_setTokenRoyalty}. The latter takes precedence over the first. * * IMPORTANT: ERC-2981 only specifies a way to signal royalty information and does not enforce its payment. See * https://eips.ethereum.org/EIPS/eip-2981#optional-royalty-payments[Rationale] in the EIP. Marketplaces are expected to * voluntarily pay royalties together with sales, but note that this standard is not yet widely supported. * * _Available since v4.5._ */ abstract contract ERC721Royalty is ERC2981, ERC721 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721, ERC2981) returns (bool) { return super.supportsInterface(interfaceId); } /** * @dev See {ERC721-_burn}. This override additionally clears the royalty information for the token. */ function _burn(uint256 tokenId) internal virtual override { super._burn(tokenId); _resetTokenRoyalty(tokenId); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol) pragma solidity ^0.8.0; import "../IERC721.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional metadata extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721Metadata is IERC721 { /** * @dev Returns the token collection name. */ function name() external view returns (string memory); /** * @dev Returns the token collection symbol. */ function symbol() external view returns (string memory); /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ function tokenURI(uint256 tokenId) external view returns (string memory); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (token/common/ERC2981.sol) pragma solidity ^0.8.0; import "../../interfaces/IERC2981.sol"; import "../../utils/introspection/ERC165.sol"; /** * @dev Implementation of the NFT Royalty Standard, a standardized way to retrieve royalty payment information. * * Royalty information can be specified globally for all token ids via {_setDefaultRoyalty}, and/or individually for * specific token ids via {_setTokenRoyalty}. The latter takes precedence over the first. * * Royalty is specified as a fraction of sale price. {_feeDenominator} is overridable but defaults to 10000, meaning the * fee is specified in basis points by default. * * IMPORTANT: ERC-2981 only specifies a way to signal royalty information and does not enforce its payment. See * https://eips.ethereum.org/EIPS/eip-2981#optional-royalty-payments[Rationale] in the EIP. Marketplaces are expected to * voluntarily pay royalties together with sales, but note that this standard is not yet widely supported. * * _Available since v4.5._ */ abstract contract ERC2981 is IERC2981, ERC165 { struct RoyaltyInfo { address receiver; uint96 royaltyFraction; } RoyaltyInfo private _defaultRoyaltyInfo; mapping(uint256 => RoyaltyInfo) private _tokenRoyaltyInfo; /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC165) returns (bool) { return interfaceId == type(IERC2981).interfaceId || super.supportsInterface(interfaceId); } /** * @inheritdoc IERC2981 */ function royaltyInfo(uint256 _tokenId, uint256 _salePrice) public view virtual override returns (address, uint256) { RoyaltyInfo memory royalty = _tokenRoyaltyInfo[_tokenId]; if (royalty.receiver == address(0)) { royalty = _defaultRoyaltyInfo; } uint256 royaltyAmount = (_salePrice * royalty.royaltyFraction) / _feeDenominator(); return (royalty.receiver, royaltyAmount); } /** * @dev The denominator with which to interpret the fee set in {_setTokenRoyalty} and {_setDefaultRoyalty} as a * fraction of the sale price. Defaults to 10000 so fees are expressed in basis points, but may be customized by an * override. */ function _feeDenominator() internal pure virtual returns (uint96) { return 10000; } /** * @dev Sets the royalty information that all ids in this contract will default to. * * Requirements: * * - `receiver` cannot be the zero address. * - `feeNumerator` cannot be greater than the fee denominator. */ function _setDefaultRoyalty(address receiver, uint96 feeNumerator) internal virtual { require(feeNumerator <= _feeDenominator(), "ERC2981: royalty fee will exceed salePrice"); require(receiver != address(0), "ERC2981: invalid receiver"); _defaultRoyaltyInfo = RoyaltyInfo(receiver, feeNumerator); } /** * @dev Removes default royalty information. */ function _deleteDefaultRoyalty() internal virtual { delete _defaultRoyaltyInfo; } /** * @dev Sets the royalty information for a specific token id, overriding the global default. * * Requirements: * * - `receiver` cannot be the zero address. * - `feeNumerator` cannot be greater than the fee denominator. */ function _setTokenRoyalty( uint256 tokenId, address receiver, uint96 feeNumerator ) internal virtual { require(feeNumerator <= _feeDenominator(), "ERC2981: royalty fee will exceed salePrice"); require(receiver != address(0), "ERC2981: Invalid parameters"); _tokenRoyaltyInfo[tokenId] = RoyaltyInfo(receiver, feeNumerator); } /** * @dev Resets royalty information for the token id back to the global default. */ function _resetTokenRoyalty(uint256 tokenId) internal virtual { delete _tokenRoyaltyInfo[tokenId]; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (utils/Strings.sol) pragma solidity ^0.8.0; /** * @dev String operations. */ library Strings { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; uint8 private constant _ADDRESS_LENGTH = 20; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { // Inspired by OraclizeAPI's implementation - MIT licence // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol 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); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { if (value == 0) { return "0x00"; } uint256 temp = value; uint256 length = 0; while (temp != 0) { length++; temp >>= 8; } return toHexString(value, length); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _HEX_SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; import "./IERC165.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT pragma solidity 0.8.15; /** * @dev ASM The Next Legends - Error definition contract */ contract Errors { error InvalidInput(string errMsg); string constant INVALID_MULTISIG = "Invalid Multisig contract"; string constant INVALID_MANAGER = "Invalid Manager contract"; string constant INVALID_SIGNER = "Invalid signer address"; string constant INVALID_MINTER = "Invalid Minter contract"; string constant INVALID_SIGNATURE = "Invalid signature"; string constant INVALID_CURRENCY = "Invalid currency"; string constant INVALID_ADDRESS = "Invalid wallet address"; string constant INVALID_AMOUNT = "Invalid amount"; error UpgradeError(string errMsg); string constant WRONG_CHARACTER_CONTRACT = "Wrong character contract"; string constant WRONG_BAG_CONTRACT = "Wrong bag contract"; string constant WRONG_UNPACKER_CONTRACT = "Wrong unpacker contract"; string constant WRONG_MINTER_CONTRACT = "Wrong minter contract"; string constant WRONG_ASSET_CONTRACT = "Wrong asset contract"; string constant WRONG_PAYMENT_CONTRACT = "Wrong payment contract"; string constant WRONG_ASTO_CONTRACT = "Wrong ASTO contract"; string constant WRONG_LP_CONTRACT = "Wrong LP contract"; error AccessError(string errMsg); string constant WRONG_TOKEN_ID = "Wrong token ID"; string constant WRONG_TOKEN_OWNER = "Wrong token owner"; string constant WRONG_HASH = "Wrong hash"; string constant NOT_ASSIGNED = "Address not assigned"; error PaymentError(string errMsg, uint256 requiredAmount, uint256 receivedAmount); string constant INSUFFICIENT_BALANCE = "Insufficient balance"; string constant NO_PAYMENT_RECEIVED = "No payment received"; string constant NO_PAYMENT_RECOGNIZED = "MintType/Currency not recognized"; string constant CURRENCY_DOES_NOT_SUIT_TYPE = "Currency doesn't suit type"; string constant MINT_TYPE_IS_NOT_SUPPORTED = "MintType isn't supported"; error MintingError(string errMsg, uint256 expiry); error OpenError(string errMsg); string constant MINT_EXPIRED = "Mint hash has expired"; string constant TOKEN_ALREADY_MINTED = "Token has already minted"; string constant NOT_ALLOWED = "Currently is not allowed"; string constant TOTAL_SUPPLY_EXCEEDED = "Total supply exceeded"; error ManagementError(string errMsg); string constant CANT_SEND = "Failed to send Ether"; }
// SPDX-License-Identifier: MIT pragma solidity 0.8.15; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/access/AccessControl.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "../interfaces/IMinterManaged.sol"; import "./Permissions.sol"; import "./Errors.sol"; /** * @dev Minter Manager * @notice Manage minter access controls */ contract MinterManaged is IMinterManaged, AccessControl, Ownable, Errors { address private _manager; constructor(address manager, address asm) { if (manager == address(0)) revert InvalidInput(INVALID_MANAGER); _grantRole(MANAGER_ROLE, manager); transferOwnership(asm); // OpenSea checks the ownership of the contract _manager = manager; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(IMinterManaged, AccessControl) returns (bool) { return interfaceId == type(IERC165).interfaceId || interfaceId == type(IMinterManaged).interfaceId || interfaceId == type(AccessControl).interfaceId; } /** ---------------------------------- * ! Manager's functions * ----------------------------------- */ /** * @notice Set manager address (contract or wallet) to manage this contract * @dev This function can only to called from contracts or wallets with MANAGER_ROLE * @dev The old manager will be removed * @param newManager The new manager address to be granted */ function setManager(address newManager) external onlyRole(MANAGER_ROLE) { if (newManager == address(0)) revert InvalidInput(INVALID_ADDRESS); _grantRole(MANAGER_ROLE, newManager); _revokeRole(MANAGER_ROLE, _manager); _manager = newManager; } /** * @notice Add minter address (contract or wallet) to manage this contract * @dev This function can only to called from contracts or wallets with MANAGER_ROLE * @dev The old manager will be retained * @param newMinter The new minter address to be granted */ function addMinter(address newMinter) external onlyRole(MANAGER_ROLE) { _grantRole(MINTER_ROLE, newMinter); } /** * @notice Revoke minter address (contract or wallet) to manage this contract * @dev This function can only to called from contracts or wallets with MANAGER_ROLE * @param oldMinter The old minter address to be revoked */ function revokeMinter(address oldMinter) external onlyRole(MANAGER_ROLE) { _revokeRole(MINTER_ROLE, oldMinter); } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.15; /** * @dev ASM The Next Legends - Roles */ bytes32 constant MULTISIG_ROLE = keccak256("MULTISIG_ROLE"); bytes32 constant MANAGER_ROLE = keccak256("MANAGER_ROLE"); bytes32 constant MINTER_ROLE = keccak256("MINTER_ROLE");
// SPDX-License-Identifier: MIT pragma solidity 0.8.15; interface IBag { function mint(address) external returns (uint256); function open(uint256, address) external; function allowToOpen(bool newState) external; function burn(uint256) external; function upgradeUnpackerContract(address) external; function setBaseURI(string calldata) external; function totalSupply() external returns (uint256); function supportsInterface(bytes4 interfaceId) external returns (bool); }
// SPDX-License-Identifier: MIT pragma solidity 0.8.15; interface IMinterManaged { function setManager(address) external; function addMinter(address) external; function revokeMinter(address) external; function supportsInterface(bytes4 interfaceId) external returns (bool); }
// SPDX-License-Identifier: MIT pragma solidity 0.8.15; interface IUnpacker { function unpack( uint256, // bag token ID address // receipient ) external; function supportsInterface(bytes4 interfaceId) external returns (bool); }
{ "evmVersion": "london", "libraries": {}, "metadata": { "bytecodeHash": "ipfs", "useLiteralContent": true }, "optimizer": { "enabled": true, "runs": 200 }, "remappings": [], "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"manager","type":"address"},{"internalType":"address","name":"asm","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"string","name":"errMsg","type":"string"}],"name":"AccessError","type":"error"},{"inputs":[{"internalType":"string","name":"errMsg","type":"string"}],"name":"InvalidInput","type":"error"},{"inputs":[{"internalType":"string","name":"errMsg","type":"string"}],"name":"ManagementError","type":"error"},{"inputs":[{"internalType":"string","name":"errMsg","type":"string"},{"internalType":"uint256","name":"expiry","type":"uint256"}],"name":"MintingError","type":"error"},{"inputs":[{"internalType":"string","name":"errMsg","type":"string"}],"name":"OpenError","type":"error"},{"inputs":[{"internalType":"string","name":"errMsg","type":"string"},{"internalType":"uint256","name":"requiredAmount","type":"uint256"},{"internalType":"uint256","name":"receivedAmount","type":"uint256"}],"name":"PaymentError","type":"error"},{"inputs":[{"internalType":"string","name":"errMsg","type":"string"}],"name":"UpgradeError","type":"error"},{"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":false,"internalType":"string","name":"newBaseURI","type":"string"}],"name":"BaseURIChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"},{"indexed":true,"internalType":"string","name":"contractName","type":"string"},{"indexed":false,"internalType":"address","name":"oldAddress","type":"address"},{"indexed":false,"internalType":"address","name":"newAddress","type":"address"}],"name":"ContractUpgraded","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":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","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"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newMinter","type":"address"}],"name":"addMinter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_isAllowedToOpen","type":"bool"}],"name":"allowToOpen","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","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":[],"name":"baseURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"deleteDefaultRoyalty","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isAllowedToOpen","outputs":[{"internalType":"bool","name":"","type":"bool"}],"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":"recipient","type":"address"}],"name":"mint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"recipient","type":"address"}],"name":"open","outputs":[],"stateMutability":"nonpayable","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":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"resetTokenRoyalty","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"oldMinter","type":"address"}],"name":"revokeMinter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_salePrice","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"","type":"address"},{"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":"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":"string","name":"newURI","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint96","name":"feeNumerator","type":"uint96"}],"name":"setDefaultRoyalty","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newManager","type":"address"}],"name":"setManager","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint96","name":"feeNumerator","type":"uint96"}],"name":"setTokenRoyalty","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":"","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":[],"name":"unpacker_","outputs":[{"internalType":"contract IUnpacker","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newContract","type":"address"}],"name":"upgradeUnpackerContract","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60806040523480156200001157600080fd5b5060405162002e9338038062002e9383398101604081905262000034916200036c565b818160405180604001604052806007815260200166544e4c2042616760c81b815250604051806040016040528060048152602001632a27262160e11b815250816002908162000084919062000449565b50600362000093828262000449565b505050620000b0620000aa6200017760201b60201c565b6200017b565b6001600160a01b0382166200011657604080518082018252601881527f496e76616c6964204d616e6167657220636f6e747261637400000000000000006020820152905163d647364f60e01b81526200010d919060040162000515565b60405180910390fd5b620001427f241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b0883620001cd565b6200014d8162000272565b50600a80546001600160a01b0319166001600160a01b0392909216919091179055506200056d9050565b3390565b600980546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60008281526008602090815260408083206001600160a01b038516845290915290205460ff166200026e5760008281526008602090815260408083206001600160a01b03851684529091529020805460ff191660011790556200022d3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b6200027c620002f1565b6001600160a01b038116620002e35760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016200010d565b620002ee816200017b565b50565b6009546001600160a01b031633146200034d5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016200010d565b565b80516001600160a01b03811681146200036757600080fd5b919050565b600080604083850312156200038057600080fd5b6200038b836200034f565b91506200039b602084016200034f565b90509250929050565b634e487b7160e01b600052604160045260246000fd5b600181811c90821680620003cf57607f821691505b602082108103620003f057634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200044457600081815260208120601f850160051c810160208610156200041f5750805b601f850160051c820191505b8181101562000440578281556001016200042b565b5050505b505050565b81516001600160401b03811115620004655762000465620003a4565b6200047d81620004768454620003ba565b84620003f6565b602080601f831160018114620004b557600084156200049c5750858301515b600019600386901b1c1916600185901b17855562000440565b600085815260208120601f198616915b82811015620004e657888601518255948401946001909101908401620004c5565b5085821015620005055787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600060208083528351808285015260005b81811015620005445785810183015185820160400152820162000526565b8181111562000557576000604083870101525b50601f01601f1916929092016040019392505050565b612916806200057d6000396000f3fe608060405234801561001057600080fd5b50600436106102485760003560e01c806370a082311161013b578063a8b9fa6a116100b8578063d0ebdbe71161007c578063d0ebdbe71461050b578063d547741f1461051e578063e985e9c514610531578063ef4f6ae41461056d578063f2fde38b1461058057600080fd5b8063a8b9fa6a146104b7578063aa1b103f146104ca578063b88d4fde146104d2578063c87b56dd146104e5578063cfbd4885146104f857600080fd5b806391d14854116100ff57806391d148541461046e57806395d89b4114610481578063983b2d5614610489578063a217fddf1461049c578063a22cb465146104a457600080fd5b806370a0823114610422578063715018a61461043557806388e99f641461043d5780638a616bc01461044a5780638da5cb5b1461045d57600080fd5b80632f2ff15d116101c957806355f804b31161018d57806355f804b3146103ce5780635944c753146103e15780636352211e146103f45780636a627842146104075780636c0360eb1461041a57600080fd5b80632f2ff15d1461036f57806336568abe1461038257806342842e0e1461039557806342966c68146103a8578063520a9456146103bb57600080fd5b806318160ddd1161021057806318160ddd146102dd57806319bd950d146102f457806323b872dd14610307578063248a9ca31461031a5780632a55205a1461033d57600080fd5b806301ffc9a71461024d57806304634d8d1461027557806306fdde031461028a578063081812fc1461029f578063095ea7b3146102ca575b600080fd5b61026061025b366004612048565b610593565b60405190151581526020015b60405180910390f35b610288610283366004612098565b610631565b005b610292610658565b60405161026c9190612123565b6102b26102ad366004612136565b6106ea565b6040516001600160a01b03909116815260200161026c565b6102886102d836600461214f565b610711565b6102e6600c5481565b60405190815260200161026c565b610288610302366004612179565b610826565b61028861031536600461219c565b61099b565b6102e6610328366004612136565b60009081526008602052604090206001015490565b61035061034b3660046121d8565b6109cc565b604080516001600160a01b03909316835260208301919091520161026c565b61028861037d366004612179565b610a78565b610288610390366004612179565b610a9d565b6102886103a336600461219c565b610b17565b6102886103b6366004612136565b610b32565b6102886103c9366004612208565b610b53565b6102886103dc366004612225565b610b7f565b6102886103ef366004612297565b610be3565b6102b2610402366004612136565b610c0c565b6102e66104153660046122d3565b610c6c565b610292610d02565b6102e66104303660046122d3565b610d90565b610288610e16565b600e546102609060ff1681565b610288610458366004612136565b610e2a565b6009546001600160a01b03166102b2565b61026061047c366004612179565b610e54565b610292610e7f565b6102886104973660046122d3565b610e8e565b6102e6600081565b6102886104b23660046122ee565b610ebe565b600b546102b2906001600160a01b031681565b610288610ec9565b6102886104e036600461233b565b610eed565b6102926104f3366004612136565b610f1f565b6102886105063660046122d3565b610f86565b6102886105193660046122d3565b610fb6565b61028861052c366004612179565b611081565b61026061053f366004612417565b6001600160a01b03918216600090815260076020908152604080832093909416825291909152205460ff1690565b61028861057b3660046122d3565b6110a6565b61028861058e3660046122d3565b611252565b600061059e826112c8565b156105ab57506001919050565b6001600160e01b031982166330076fd760e21b14806105da57506001600160e01b031982166301ffc9a760e01b145b806105f557506001600160e01b031982166380ac58cd60e01b145b8061061057506001600160e01b031982166301ffc9a760e01b145b8061062b57506001600160e01b03198216635b5e139f60e01b145b92915050565b6000805160206128a183398151915261064981611319565b6106538383611323565b505050565b60606002805461066790612441565b80601f016020809104026020016040519081016040528092919081815260200182805461069390612441565b80156106e05780601f106106b5576101008083540402835291602001916106e0565b820191906000526020600020905b8154815290600101906020018083116106c357829003601f168201915b5050505050905090565b60006106f5826113dd565b506000908152600660205260409020546001600160a01b031690565b600061071c82610c0c565b9050806001600160a01b0316836001600160a01b03160361078e5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084015b60405180910390fd5b336001600160a01b03821614806107aa57506107aa813361053f565b61081c5760405162461bcd60e51b815260206004820152603e60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206e6f7220617070726f76656420666f7220616c6c00006064820152608401610785565b610653838361143c565b600e5460ff161561094f573361083b83610c0c565b6001600160a01b0316146108895760408051808201825260118152702bb937b733903a37b5b2b71037bbb732b960791b6020820152905163048e2d4960e41b81526107859190600401612123565b6001600160a01b0381166108dc576040805180820182526016815275496e76616c69642077616c6c6574206164647265737360501b6020820152905163d647364f60e01b81526107859190600401612123565b600b546040516336616d4160e01b8152600481018490526001600160a01b038381166024830152909116906336616d4190604401600060405180830381600087803b15801561092a57600080fd5b505af115801561093e573d6000803e3d6000fd5b5050505061094b826114aa565b5050565b604080518082018252601881527f43757272656e746c79206973206e6f7420616c6c6f77656400000000000000006020820152905163038394a360e41b81526107859190600401612123565b6109a533826114c4565b6109c15760405162461bcd60e51b815260040161078590612475565b610653838383611543565b60008281526001602090815260408083208151808301909252546001600160a01b038116808352600160a01b9091046001600160601b0316928201929092528291610a415750604080518082019091526000546001600160a01b0381168252600160a01b90046001600160601b031660208201525b602081015160009061271090610a60906001600160601b0316876124d9565b610a6a919061250e565b915196919550909350505050565b600082815260086020526040902060010154610a9381611319565b61065383836116df565b6001600160a01b0381163314610b0d5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610785565b61094b8282611765565b61065383838360405180602001604052806000815250610eed565b6000805160206128c1833981519152610b4a81611319565b61094b826114aa565b6000805160206128a1833981519152610b6b81611319565b50600e805460ff1916911515919091179055565b6000805160206128a1833981519152610b9781611319565b600d610ba4838583612570565b507f5411e8ebf1636d9e83d5fc4900bf80cbac82e8790da2a4c94db4895e889eedf68383604051610bd6929190612631565b60405180910390a1505050565b6000805160206128a1833981519152610bfb81611319565b610c068484846117cc565b50505050565b6000818152600460205260408120546001600160a01b03168061062b5760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b6044820152606401610785565b60006000805160206128c1833981519152610c8681611319565b6001600160a01b038316610cd9576040805180820182526016815275496e76616c69642077616c6c6574206164647265737360501b6020820152905163d647364f60e01b81526107859190600401612123565b610ce583600c54611897565b600c8054906000610cf583612660565b9190505591505b50919050565b600d8054610d0f90612441565b80601f0160208091040260200160405190810160405280929190818152602001828054610d3b90612441565b8015610d885780601f10610d5d57610100808354040283529160200191610d88565b820191906000526020600020905b815481529060010190602001808311610d6b57829003601f168201915b505050505081565b60006001600160a01b038216610dfa5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b6064820152608401610785565b506001600160a01b031660009081526005602052604090205490565b610e1e6119d9565b610e286000611a33565b565b6000805160206128a1833981519152610e4281611319565b50600090815260016020526040812055565b60009182526008602090815260408084206001600160a01b0393909316845291905290205460ff1690565b60606003805461066790612441565b6000805160206128a1833981519152610ea681611319565b61094b6000805160206128c1833981519152836116df565b61094b338383611a85565b6000805160206128a1833981519152610ee181611319565b610eea60008055565b50565b610ef733836114c4565b610f135760405162461bcd60e51b815260040161078590612475565b610c0684848484611b53565b6060610f2a826113dd565b6000610f34611b86565b90506000815111610f545760405180602001604052806000815250610f7f565b80610f5e84611b95565b604051602001610f6f929190612679565b6040516020818303038152906040525b9392505050565b6000805160206128a1833981519152610f9e81611319565b61094b6000805160206128c183398151915283611765565b6000805160206128a1833981519152610fce81611319565b6001600160a01b038216611021576040805180820182526016815275496e76616c69642077616c6c6574206164647265737360501b6020820152905163d647364f60e01b81526107859190600401612123565b6110396000805160206128a1833981519152836116df565b600a5461105e906000805160206128a1833981519152906001600160a01b0316611765565b50600a80546001600160a01b0319166001600160a01b0392909216919091179055565b60008281526008602052604090206001015461109c81611319565b6106538383611765565b6000805160206128a18339815191526110be81611319565b6001600160a01b038216611111576040805180820182526016815275496e76616c69642077616c6c6574206164647265737360501b6020820152905163d647364f60e01b81526107859190600401612123565b600b80546001600160a01b0319166001600160a01b0384169081179091556040516301ffc9a760e01b8152631bcf527360e11b600482015281906301ffc9a7906024016020604051808303816000875af1158015611173573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061119791906126a8565b6111e757604080518082018252601781527f57726f6e6720756e7061636b657220636f6e747261637400000000000000000060208201529051632b79e12f60e11b81526107859190600401612123565b604080516b155b9c1858dad95c8b9cdbdb60a21b8152815190819003600c0181204282526001600160a01b03848116602084015286168284015291517fe4d55c707519acf60c7217a3808567f013d2f024d787d1a9ef3004196219f6809181900360600190a2505050565b61125a6119d9565b6001600160a01b0381166112bf5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610785565b610eea81611a33565b60006001600160e01b031982166301ffc9a760e01b14806112f957506001600160e01b03198216638692779360e01b145b8061062b57506001600160e01b0319821663da8def7360e01b1492915050565b610eea8133611c96565b6127106001600160601b038216111561134e5760405162461bcd60e51b8152600401610785906126c5565b6001600160a01b0382166113a45760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c6964207265636569766572000000000000006044820152606401610785565b604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b90910217600055565b6000818152600460205260409020546001600160a01b0316610eea5760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b6044820152606401610785565b600081815260066020526040902080546001600160a01b0319166001600160a01b038416908117909155819061147182610c0c565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6114b381611cfa565b600090815260016020526040812055565b6000806114d083610c0c565b9050806001600160a01b0316846001600160a01b0316148061151757506001600160a01b0380821660009081526007602090815260408083209388168352929052205460ff165b8061153b5750836001600160a01b0316611530846106ea565b6001600160a01b0316145b949350505050565b826001600160a01b031661155682610c0c565b6001600160a01b0316146115ba5760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201526437bbb732b960d91b6064820152608401610785565b6001600160a01b03821661161c5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610785565b61162760008261143c565b6001600160a01b038316600090815260056020526040812080546001929061165090849061270f565b90915550506001600160a01b038216600090815260056020526040812080546001929061167e908490612726565b909155505060008181526004602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b6116e98282610e54565b61094b5760008281526008602090815260408083206001600160a01b03851684529091529020805460ff191660011790556117213390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b61176f8282610e54565b1561094b5760008281526008602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6127106001600160601b03821611156117f75760405162461bcd60e51b8152600401610785906126c5565b6001600160a01b03821661184d5760405162461bcd60e51b815260206004820152601b60248201527f455243323938313a20496e76616c696420706172616d657465727300000000006044820152606401610785565b6040805180820182526001600160a01b0393841681526001600160601b0392831660208083019182526000968752600190529190942093519051909116600160a01b029116179055565b6001600160a01b0382166118ed5760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610785565b6000818152600460205260409020546001600160a01b0316156119525760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610785565b6001600160a01b038216600090815260056020526040812080546001929061197b908490612726565b909155505060008181526004602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6009546001600160a01b03163314610e285760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610785565b600980546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b816001600160a01b0316836001600160a01b031603611ae65760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610785565b6001600160a01b03838116600081815260076020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b611b5e848484611543565b611b6a84848484611d95565b610c065760405162461bcd60e51b81526004016107859061273e565b6060600d805461066790612441565b606081600003611bbc5750506040805180820190915260018152600360fc1b602082015290565b8160005b8115611be65780611bd081612660565b9150611bdf9050600a8361250e565b9150611bc0565b60008167ffffffffffffffff811115611c0157611c01612325565b6040519080825280601f01601f191660200182016040528015611c2b576020820181803683370190505b5090505b841561153b57611c4060018361270f565b9150611c4d600a86612790565b611c58906030612726565b60f81b818381518110611c6d57611c6d6127a4565b60200101906001600160f81b031916908160001a905350611c8f600a8661250e565b9450611c2f565b611ca08282610e54565b61094b57611cb8816001600160a01b03166014611e96565b611cc3836020611e96565b604051602001611cd49291906127ba565b60408051601f198184030181529082905262461bcd60e51b825261078591600401612123565b6000611d0582610c0c565b9050611d1260008361143c565b6001600160a01b0381166000908152600560205260408120805460019290611d3b90849061270f565b909155505060008281526004602052604080822080546001600160a01b0319169055518391906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b60006001600160a01b0384163b15611e8b57604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290611dd990339089908890889060040161282f565b6020604051808303816000875af1925050508015611e14575060408051601f3d908101601f19168201909252611e119181019061286c565b60015b611e71573d808015611e42576040519150601f19603f3d011682016040523d82523d6000602084013e611e47565b606091505b508051600003611e695760405162461bcd60e51b81526004016107859061273e565b805181602001fd5b6001600160e01b031916630a85bd0160e11b14905061153b565b506001949350505050565b60606000611ea58360026124d9565b611eb0906002612726565b67ffffffffffffffff811115611ec857611ec8612325565b6040519080825280601f01601f191660200182016040528015611ef2576020820181803683370190505b509050600360fc1b81600081518110611f0d57611f0d6127a4565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110611f3c57611f3c6127a4565b60200101906001600160f81b031916908160001a9053506000611f608460026124d9565b611f6b906001612726565b90505b6001811115611fe3576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110611f9f57611f9f6127a4565b1a60f81b828281518110611fb557611fb56127a4565b60200101906001600160f81b031916908160001a90535060049490941c93611fdc81612889565b9050611f6e565b508315610f7f5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610785565b6001600160e01b031981168114610eea57600080fd5b60006020828403121561205a57600080fd5b8135610f7f81612032565b80356001600160a01b038116811461207c57600080fd5b919050565b80356001600160601b038116811461207c57600080fd5b600080604083850312156120ab57600080fd5b6120b483612065565b91506120c260208401612081565b90509250929050565b60005b838110156120e65781810151838201526020016120ce565b83811115610c065750506000910152565b6000815180845261210f8160208601602086016120cb565b601f01601f19169290920160200192915050565b602081526000610f7f60208301846120f7565b60006020828403121561214857600080fd5b5035919050565b6000806040838503121561216257600080fd5b61216b83612065565b946020939093013593505050565b6000806040838503121561218c57600080fd5b823591506120c260208401612065565b6000806000606084860312156121b157600080fd5b6121ba84612065565b92506121c860208501612065565b9150604084013590509250925092565b600080604083850312156121eb57600080fd5b50508035926020909101359150565b8015158114610eea57600080fd5b60006020828403121561221a57600080fd5b8135610f7f816121fa565b6000806020838503121561223857600080fd5b823567ffffffffffffffff8082111561225057600080fd5b818501915085601f83011261226457600080fd5b81358181111561227357600080fd5b86602082850101111561228557600080fd5b60209290920196919550909350505050565b6000806000606084860312156122ac57600080fd5b833592506122bc60208501612065565b91506122ca60408501612081565b90509250925092565b6000602082840312156122e557600080fd5b610f7f82612065565b6000806040838503121561230157600080fd5b61230a83612065565b9150602083013561231a816121fa565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b6000806000806080858703121561235157600080fd5b61235a85612065565b935061236860208601612065565b925060408501359150606085013567ffffffffffffffff8082111561238c57600080fd5b818701915087601f8301126123a057600080fd5b8135818111156123b2576123b2612325565b604051601f8201601f19908116603f011681019083821181831017156123da576123da612325565b816040528281528a60208487010111156123f357600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b6000806040838503121561242a57600080fd5b61243383612065565b91506120c260208401612065565b600181811c9082168061245557607f821691505b602082108103610cfc57634e487b7160e01b600052602260045260246000fd5b6020808252602e908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526d1c881b9bdc88185c1c1c9bdd995960921b606082015260800190565b634e487b7160e01b600052601160045260246000fd5b60008160001904831182151516156124f3576124f36124c3565b500290565b634e487b7160e01b600052601260045260246000fd5b60008261251d5761251d6124f8565b500490565b601f82111561065357600081815260208120601f850160051c810160208610156125495750805b601f850160051c820191505b8181101561256857828155600101612555565b505050505050565b67ffffffffffffffff83111561258857612588612325565b61259c836125968354612441565b83612522565b6000601f8411600181146125d057600085156125b85750838201355b600019600387901b1c1916600186901b17835561262a565b600083815260209020601f19861690835b8281101561260157868501358255602094850194600190920191016125e1565b508682101561261e5760001960f88860031b161c19848701351681555b505060018560011b0183555b5050505050565b60208152816020820152818360408301376000818301604090810191909152601f909201601f19160101919050565b600060018201612672576126726124c3565b5060010190565b6000835161268b8184602088016120cb565b83519083019061269f8183602088016120cb565b01949350505050565b6000602082840312156126ba57600080fd5b8151610f7f816121fa565b6020808252602a908201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646040820152692073616c65507269636560b01b606082015260800190565b600082821015612721576127216124c3565b500390565b60008219821115612739576127396124c3565b500190565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b60008261279f5761279f6124f8565b500690565b634e487b7160e01b600052603260045260246000fd5b7f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008152600083516127f28160178501602088016120cb565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516128238160288401602088016120cb565b01602801949350505050565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090612862908301846120f7565b9695505050505050565b60006020828403121561287e57600080fd5b8151610f7f81612032565b600081612898576128986124c3565b50600019019056fe241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b089f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6a26469706673582212207b6b8ba46eb34c1aa25526aaadf159c8d1b33ca6df7414f7a7d89ff397afd4cf64736f6c634300080f00330000000000000000000000005f3f357194c32f9c2f1176cc39b9d6c214a1fdca0000000000000000000000006fa217b9671f96a8604b48dd70192a321d51e4b9
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106102485760003560e01c806370a082311161013b578063a8b9fa6a116100b8578063d0ebdbe71161007c578063d0ebdbe71461050b578063d547741f1461051e578063e985e9c514610531578063ef4f6ae41461056d578063f2fde38b1461058057600080fd5b8063a8b9fa6a146104b7578063aa1b103f146104ca578063b88d4fde146104d2578063c87b56dd146104e5578063cfbd4885146104f857600080fd5b806391d14854116100ff57806391d148541461046e57806395d89b4114610481578063983b2d5614610489578063a217fddf1461049c578063a22cb465146104a457600080fd5b806370a0823114610422578063715018a61461043557806388e99f641461043d5780638a616bc01461044a5780638da5cb5b1461045d57600080fd5b80632f2ff15d116101c957806355f804b31161018d57806355f804b3146103ce5780635944c753146103e15780636352211e146103f45780636a627842146104075780636c0360eb1461041a57600080fd5b80632f2ff15d1461036f57806336568abe1461038257806342842e0e1461039557806342966c68146103a8578063520a9456146103bb57600080fd5b806318160ddd1161021057806318160ddd146102dd57806319bd950d146102f457806323b872dd14610307578063248a9ca31461031a5780632a55205a1461033d57600080fd5b806301ffc9a71461024d57806304634d8d1461027557806306fdde031461028a578063081812fc1461029f578063095ea7b3146102ca575b600080fd5b61026061025b366004612048565b610593565b60405190151581526020015b60405180910390f35b610288610283366004612098565b610631565b005b610292610658565b60405161026c9190612123565b6102b26102ad366004612136565b6106ea565b6040516001600160a01b03909116815260200161026c565b6102886102d836600461214f565b610711565b6102e6600c5481565b60405190815260200161026c565b610288610302366004612179565b610826565b61028861031536600461219c565b61099b565b6102e6610328366004612136565b60009081526008602052604090206001015490565b61035061034b3660046121d8565b6109cc565b604080516001600160a01b03909316835260208301919091520161026c565b61028861037d366004612179565b610a78565b610288610390366004612179565b610a9d565b6102886103a336600461219c565b610b17565b6102886103b6366004612136565b610b32565b6102886103c9366004612208565b610b53565b6102886103dc366004612225565b610b7f565b6102886103ef366004612297565b610be3565b6102b2610402366004612136565b610c0c565b6102e66104153660046122d3565b610c6c565b610292610d02565b6102e66104303660046122d3565b610d90565b610288610e16565b600e546102609060ff1681565b610288610458366004612136565b610e2a565b6009546001600160a01b03166102b2565b61026061047c366004612179565b610e54565b610292610e7f565b6102886104973660046122d3565b610e8e565b6102e6600081565b6102886104b23660046122ee565b610ebe565b600b546102b2906001600160a01b031681565b610288610ec9565b6102886104e036600461233b565b610eed565b6102926104f3366004612136565b610f1f565b6102886105063660046122d3565b610f86565b6102886105193660046122d3565b610fb6565b61028861052c366004612179565b611081565b61026061053f366004612417565b6001600160a01b03918216600090815260076020908152604080832093909416825291909152205460ff1690565b61028861057b3660046122d3565b6110a6565b61028861058e3660046122d3565b611252565b600061059e826112c8565b156105ab57506001919050565b6001600160e01b031982166330076fd760e21b14806105da57506001600160e01b031982166301ffc9a760e01b145b806105f557506001600160e01b031982166380ac58cd60e01b145b8061061057506001600160e01b031982166301ffc9a760e01b145b8061062b57506001600160e01b03198216635b5e139f60e01b145b92915050565b6000805160206128a183398151915261064981611319565b6106538383611323565b505050565b60606002805461066790612441565b80601f016020809104026020016040519081016040528092919081815260200182805461069390612441565b80156106e05780601f106106b5576101008083540402835291602001916106e0565b820191906000526020600020905b8154815290600101906020018083116106c357829003601f168201915b5050505050905090565b60006106f5826113dd565b506000908152600660205260409020546001600160a01b031690565b600061071c82610c0c565b9050806001600160a01b0316836001600160a01b03160361078e5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084015b60405180910390fd5b336001600160a01b03821614806107aa57506107aa813361053f565b61081c5760405162461bcd60e51b815260206004820152603e60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206e6f7220617070726f76656420666f7220616c6c00006064820152608401610785565b610653838361143c565b600e5460ff161561094f573361083b83610c0c565b6001600160a01b0316146108895760408051808201825260118152702bb937b733903a37b5b2b71037bbb732b960791b6020820152905163048e2d4960e41b81526107859190600401612123565b6001600160a01b0381166108dc576040805180820182526016815275496e76616c69642077616c6c6574206164647265737360501b6020820152905163d647364f60e01b81526107859190600401612123565b600b546040516336616d4160e01b8152600481018490526001600160a01b038381166024830152909116906336616d4190604401600060405180830381600087803b15801561092a57600080fd5b505af115801561093e573d6000803e3d6000fd5b5050505061094b826114aa565b5050565b604080518082018252601881527f43757272656e746c79206973206e6f7420616c6c6f77656400000000000000006020820152905163038394a360e41b81526107859190600401612123565b6109a533826114c4565b6109c15760405162461bcd60e51b815260040161078590612475565b610653838383611543565b60008281526001602090815260408083208151808301909252546001600160a01b038116808352600160a01b9091046001600160601b0316928201929092528291610a415750604080518082019091526000546001600160a01b0381168252600160a01b90046001600160601b031660208201525b602081015160009061271090610a60906001600160601b0316876124d9565b610a6a919061250e565b915196919550909350505050565b600082815260086020526040902060010154610a9381611319565b61065383836116df565b6001600160a01b0381163314610b0d5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610785565b61094b8282611765565b61065383838360405180602001604052806000815250610eed565b6000805160206128c1833981519152610b4a81611319565b61094b826114aa565b6000805160206128a1833981519152610b6b81611319565b50600e805460ff1916911515919091179055565b6000805160206128a1833981519152610b9781611319565b600d610ba4838583612570565b507f5411e8ebf1636d9e83d5fc4900bf80cbac82e8790da2a4c94db4895e889eedf68383604051610bd6929190612631565b60405180910390a1505050565b6000805160206128a1833981519152610bfb81611319565b610c068484846117cc565b50505050565b6000818152600460205260408120546001600160a01b03168061062b5760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b6044820152606401610785565b60006000805160206128c1833981519152610c8681611319565b6001600160a01b038316610cd9576040805180820182526016815275496e76616c69642077616c6c6574206164647265737360501b6020820152905163d647364f60e01b81526107859190600401612123565b610ce583600c54611897565b600c8054906000610cf583612660565b9190505591505b50919050565b600d8054610d0f90612441565b80601f0160208091040260200160405190810160405280929190818152602001828054610d3b90612441565b8015610d885780601f10610d5d57610100808354040283529160200191610d88565b820191906000526020600020905b815481529060010190602001808311610d6b57829003601f168201915b505050505081565b60006001600160a01b038216610dfa5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b6064820152608401610785565b506001600160a01b031660009081526005602052604090205490565b610e1e6119d9565b610e286000611a33565b565b6000805160206128a1833981519152610e4281611319565b50600090815260016020526040812055565b60009182526008602090815260408084206001600160a01b0393909316845291905290205460ff1690565b60606003805461066790612441565b6000805160206128a1833981519152610ea681611319565b61094b6000805160206128c1833981519152836116df565b61094b338383611a85565b6000805160206128a1833981519152610ee181611319565b610eea60008055565b50565b610ef733836114c4565b610f135760405162461bcd60e51b815260040161078590612475565b610c0684848484611b53565b6060610f2a826113dd565b6000610f34611b86565b90506000815111610f545760405180602001604052806000815250610f7f565b80610f5e84611b95565b604051602001610f6f929190612679565b6040516020818303038152906040525b9392505050565b6000805160206128a1833981519152610f9e81611319565b61094b6000805160206128c183398151915283611765565b6000805160206128a1833981519152610fce81611319565b6001600160a01b038216611021576040805180820182526016815275496e76616c69642077616c6c6574206164647265737360501b6020820152905163d647364f60e01b81526107859190600401612123565b6110396000805160206128a1833981519152836116df565b600a5461105e906000805160206128a1833981519152906001600160a01b0316611765565b50600a80546001600160a01b0319166001600160a01b0392909216919091179055565b60008281526008602052604090206001015461109c81611319565b6106538383611765565b6000805160206128a18339815191526110be81611319565b6001600160a01b038216611111576040805180820182526016815275496e76616c69642077616c6c6574206164647265737360501b6020820152905163d647364f60e01b81526107859190600401612123565b600b80546001600160a01b0319166001600160a01b0384169081179091556040516301ffc9a760e01b8152631bcf527360e11b600482015281906301ffc9a7906024016020604051808303816000875af1158015611173573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061119791906126a8565b6111e757604080518082018252601781527f57726f6e6720756e7061636b657220636f6e747261637400000000000000000060208201529051632b79e12f60e11b81526107859190600401612123565b604080516b155b9c1858dad95c8b9cdbdb60a21b8152815190819003600c0181204282526001600160a01b03848116602084015286168284015291517fe4d55c707519acf60c7217a3808567f013d2f024d787d1a9ef3004196219f6809181900360600190a2505050565b61125a6119d9565b6001600160a01b0381166112bf5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610785565b610eea81611a33565b60006001600160e01b031982166301ffc9a760e01b14806112f957506001600160e01b03198216638692779360e01b145b8061062b57506001600160e01b0319821663da8def7360e01b1492915050565b610eea8133611c96565b6127106001600160601b038216111561134e5760405162461bcd60e51b8152600401610785906126c5565b6001600160a01b0382166113a45760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c6964207265636569766572000000000000006044820152606401610785565b604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b90910217600055565b6000818152600460205260409020546001600160a01b0316610eea5760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b6044820152606401610785565b600081815260066020526040902080546001600160a01b0319166001600160a01b038416908117909155819061147182610c0c565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6114b381611cfa565b600090815260016020526040812055565b6000806114d083610c0c565b9050806001600160a01b0316846001600160a01b0316148061151757506001600160a01b0380821660009081526007602090815260408083209388168352929052205460ff165b8061153b5750836001600160a01b0316611530846106ea565b6001600160a01b0316145b949350505050565b826001600160a01b031661155682610c0c565b6001600160a01b0316146115ba5760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201526437bbb732b960d91b6064820152608401610785565b6001600160a01b03821661161c5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610785565b61162760008261143c565b6001600160a01b038316600090815260056020526040812080546001929061165090849061270f565b90915550506001600160a01b038216600090815260056020526040812080546001929061167e908490612726565b909155505060008181526004602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b6116e98282610e54565b61094b5760008281526008602090815260408083206001600160a01b03851684529091529020805460ff191660011790556117213390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b61176f8282610e54565b1561094b5760008281526008602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6127106001600160601b03821611156117f75760405162461bcd60e51b8152600401610785906126c5565b6001600160a01b03821661184d5760405162461bcd60e51b815260206004820152601b60248201527f455243323938313a20496e76616c696420706172616d657465727300000000006044820152606401610785565b6040805180820182526001600160a01b0393841681526001600160601b0392831660208083019182526000968752600190529190942093519051909116600160a01b029116179055565b6001600160a01b0382166118ed5760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610785565b6000818152600460205260409020546001600160a01b0316156119525760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610785565b6001600160a01b038216600090815260056020526040812080546001929061197b908490612726565b909155505060008181526004602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6009546001600160a01b03163314610e285760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610785565b600980546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b816001600160a01b0316836001600160a01b031603611ae65760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610785565b6001600160a01b03838116600081815260076020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b611b5e848484611543565b611b6a84848484611d95565b610c065760405162461bcd60e51b81526004016107859061273e565b6060600d805461066790612441565b606081600003611bbc5750506040805180820190915260018152600360fc1b602082015290565b8160005b8115611be65780611bd081612660565b9150611bdf9050600a8361250e565b9150611bc0565b60008167ffffffffffffffff811115611c0157611c01612325565b6040519080825280601f01601f191660200182016040528015611c2b576020820181803683370190505b5090505b841561153b57611c4060018361270f565b9150611c4d600a86612790565b611c58906030612726565b60f81b818381518110611c6d57611c6d6127a4565b60200101906001600160f81b031916908160001a905350611c8f600a8661250e565b9450611c2f565b611ca08282610e54565b61094b57611cb8816001600160a01b03166014611e96565b611cc3836020611e96565b604051602001611cd49291906127ba565b60408051601f198184030181529082905262461bcd60e51b825261078591600401612123565b6000611d0582610c0c565b9050611d1260008361143c565b6001600160a01b0381166000908152600560205260408120805460019290611d3b90849061270f565b909155505060008281526004602052604080822080546001600160a01b0319169055518391906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b60006001600160a01b0384163b15611e8b57604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290611dd990339089908890889060040161282f565b6020604051808303816000875af1925050508015611e14575060408051601f3d908101601f19168201909252611e119181019061286c565b60015b611e71573d808015611e42576040519150601f19603f3d011682016040523d82523d6000602084013e611e47565b606091505b508051600003611e695760405162461bcd60e51b81526004016107859061273e565b805181602001fd5b6001600160e01b031916630a85bd0160e11b14905061153b565b506001949350505050565b60606000611ea58360026124d9565b611eb0906002612726565b67ffffffffffffffff811115611ec857611ec8612325565b6040519080825280601f01601f191660200182016040528015611ef2576020820181803683370190505b509050600360fc1b81600081518110611f0d57611f0d6127a4565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110611f3c57611f3c6127a4565b60200101906001600160f81b031916908160001a9053506000611f608460026124d9565b611f6b906001612726565b90505b6001811115611fe3576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110611f9f57611f9f6127a4565b1a60f81b828281518110611fb557611fb56127a4565b60200101906001600160f81b031916908160001a90535060049490941c93611fdc81612889565b9050611f6e565b508315610f7f5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610785565b6001600160e01b031981168114610eea57600080fd5b60006020828403121561205a57600080fd5b8135610f7f81612032565b80356001600160a01b038116811461207c57600080fd5b919050565b80356001600160601b038116811461207c57600080fd5b600080604083850312156120ab57600080fd5b6120b483612065565b91506120c260208401612081565b90509250929050565b60005b838110156120e65781810151838201526020016120ce565b83811115610c065750506000910152565b6000815180845261210f8160208601602086016120cb565b601f01601f19169290920160200192915050565b602081526000610f7f60208301846120f7565b60006020828403121561214857600080fd5b5035919050565b6000806040838503121561216257600080fd5b61216b83612065565b946020939093013593505050565b6000806040838503121561218c57600080fd5b823591506120c260208401612065565b6000806000606084860312156121b157600080fd5b6121ba84612065565b92506121c860208501612065565b9150604084013590509250925092565b600080604083850312156121eb57600080fd5b50508035926020909101359150565b8015158114610eea57600080fd5b60006020828403121561221a57600080fd5b8135610f7f816121fa565b6000806020838503121561223857600080fd5b823567ffffffffffffffff8082111561225057600080fd5b818501915085601f83011261226457600080fd5b81358181111561227357600080fd5b86602082850101111561228557600080fd5b60209290920196919550909350505050565b6000806000606084860312156122ac57600080fd5b833592506122bc60208501612065565b91506122ca60408501612081565b90509250925092565b6000602082840312156122e557600080fd5b610f7f82612065565b6000806040838503121561230157600080fd5b61230a83612065565b9150602083013561231a816121fa565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b6000806000806080858703121561235157600080fd5b61235a85612065565b935061236860208601612065565b925060408501359150606085013567ffffffffffffffff8082111561238c57600080fd5b818701915087601f8301126123a057600080fd5b8135818111156123b2576123b2612325565b604051601f8201601f19908116603f011681019083821181831017156123da576123da612325565b816040528281528a60208487010111156123f357600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b6000806040838503121561242a57600080fd5b61243383612065565b91506120c260208401612065565b600181811c9082168061245557607f821691505b602082108103610cfc57634e487b7160e01b600052602260045260246000fd5b6020808252602e908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526d1c881b9bdc88185c1c1c9bdd995960921b606082015260800190565b634e487b7160e01b600052601160045260246000fd5b60008160001904831182151516156124f3576124f36124c3565b500290565b634e487b7160e01b600052601260045260246000fd5b60008261251d5761251d6124f8565b500490565b601f82111561065357600081815260208120601f850160051c810160208610156125495750805b601f850160051c820191505b8181101561256857828155600101612555565b505050505050565b67ffffffffffffffff83111561258857612588612325565b61259c836125968354612441565b83612522565b6000601f8411600181146125d057600085156125b85750838201355b600019600387901b1c1916600186901b17835561262a565b600083815260209020601f19861690835b8281101561260157868501358255602094850194600190920191016125e1565b508682101561261e5760001960f88860031b161c19848701351681555b505060018560011b0183555b5050505050565b60208152816020820152818360408301376000818301604090810191909152601f909201601f19160101919050565b600060018201612672576126726124c3565b5060010190565b6000835161268b8184602088016120cb565b83519083019061269f8183602088016120cb565b01949350505050565b6000602082840312156126ba57600080fd5b8151610f7f816121fa565b6020808252602a908201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646040820152692073616c65507269636560b01b606082015260800190565b600082821015612721576127216124c3565b500390565b60008219821115612739576127396124c3565b500190565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b60008261279f5761279f6124f8565b500690565b634e487b7160e01b600052603260045260246000fd5b7f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008152600083516127f28160178501602088016120cb565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516128238160288401602088016120cb565b01602801949350505050565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090612862908301846120f7565b9695505050505050565b60006020828403121561287e57600080fd5b8151610f7f81612032565b600081612898576128986124c3565b50600019019056fe241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b089f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6a26469706673582212207b6b8ba46eb34c1aa25526aaadf159c8d1b33ca6df7414f7a7d89ff397afd4cf64736f6c634300080f0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000005f3f357194c32f9c2f1176cc39b9d6c214a1fdca0000000000000000000000006fa217b9671f96a8604b48dd70192a321d51e4b9
-----Decoded View---------------
Arg [0] : manager (address): 0x5F3F357194C32f9c2f1176CC39B9d6c214A1fDCA
Arg [1] : asm (address): 0x6FA217b9671f96A8604B48dd70192A321D51e4B9
-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 0000000000000000000000005f3f357194c32f9c2f1176cc39b9d6c214a1fdca
Arg [1] : 0000000000000000000000006fa217b9671f96a8604b48dd70192a321d51e4b9
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.