ERC-721
Overview
Max Total Supply
1,310 TIL
Holders
55
Total Transfers
-
Market
Volume (24H)
N/A
Min Price (24H)
N/A
Max Price (24H)
N/A
Other Info
Token Contract
Loading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
Contract Name:
Tile
Compiler Version
v0.8.0+commit.c7dfd78e
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity >=0.8.0; import "@openzeppelin/contracts/utils/Context.sol"; import "@openzeppelin/contracts/access/AccessControlEnumerable.sol"; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol"; import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol"; import "./interfaces/I1MIL.sol"; contract Tile is Context, ERC721Enumerable { address private moneybox = 0xA2eb9BfF23f5117979767bD0c51BE8E2F7Fbf52F; address private free = 0x1cc1bD553dF7f45F697a85Cac7a121c0A7E2e1C4; ERC20Burnable mil; struct TileInfo { string title; string ownerURL; uint256[100] colors; } struct Invoice { address sender; uint256 amount; uint timestamp; } mapping(uint256 => Invoice) private invoiceMap; uint256 lastInvoiceNumber = 0; // Mapping from token ID to Tile objects mapping(uint256 => TileInfo) private tiles; mapping(address => bool) private owners; mapping(uint256 => bool) usedNonces; constructor(ERC20Burnable _mil) ERC721('Tile', 'TIL') { owners[msg.sender] = true; mil = _mil; } function mint(address to, uint256 tokenId) public { require(owners[msg.sender], "Tile: must have admin role to mint"); _mint(to, tokenId); } function addOwner(address newOwner) public { require(owners[msg.sender], "Tile: Only owner can add owners"); owners[newOwner] = true; } function removeOwner(address oldOwner) public { require(owners[msg.sender], "Tile: Only owner can add owners"); require(address(msg.sender) != address(oldOwner), "Tile: Only owner can add owners"); owners[oldOwner] = false; } function baseTokenURI() public pure returns (string memory) { return "https://1mlnnfts.com/api/nft/"; } function contractURI() public pure returns (string memory) { return "https://1mlnnfts.com/api/project-info"; } function tokenURI(uint256 _tokenId) override public pure returns (string memory) { return string(abi.encodePacked(baseTokenURI(), Strings.toString(_tokenId))); } function payForInfoAndColors(uint256 totalPrice) public { if (totalPrice > 0) { mil.transferFrom(address(tx.origin), address(this), totalPrice / 2); mil.transferFrom(address(tx.origin), moneybox, totalPrice / 2); mil.burn(mil.balanceOf(address(this))); } Invoice memory invoice = Invoice(msg.sender, totalPrice, block.timestamp); uint256 invoiceId = ++lastInvoiceNumber; invoiceMap[invoiceId] = invoice; } function getInvoice(uint256 invoiceId) public view returns (address, uint256, uint256){ return (invoiceMap[invoiceId].sender, invoiceMap[invoiceId].amount, invoiceMap[invoiceId].timestamp); } function setInfo(uint256 id, string memory title, string memory ownerURL) public { require(ownerOf(id) == msg.sender, "Tile: only owner can save Info"); if (msg.sender != free) { mil.transferFrom(address(tx.origin), address(this), 500000000000000000); mil.transferFrom(address(tx.origin), moneybox, 500000000000000000); mil.burn(mil.balanceOf(address(this))); } tiles[id].title = title; tiles[id].ownerURL = ownerURL; } function setColors(uint256 id, uint256[100] memory colors) public { require(ownerOf(id) == msg.sender, "Tile: only owner can save Info"); if (msg.sender != free) { mil.transferFrom(address(tx.origin), address(this), 500000000000000000); mil.transferFrom(address(tx.origin), moneybox, 500000000000000000); mil.burn(mil.balanceOf(address(this))); } tiles[id].colors = colors; } function setMultiColors(uint256[] memory ids, uint256[100][] memory colors) public { for(uint256 i = 0; i < ids.length;i++){ setColors(ids[i],colors[i]); } } function setInfoAndColors(uint256 id, string memory title, string memory ownerURL, uint256[100] memory colors) public { require(ownerOf(id) == msg.sender, "Tile: only owner can save Info"); if (msg.sender != free) { mil.transferFrom(address(tx.origin), address(this), 1000000000000000000); mil.transferFrom(address(tx.origin), moneybox, 1000000000000000000); mil.burn(mil.balanceOf(address(this))); } tiles[id].title = title; tiles[id].ownerURL = ownerURL; tiles[id].colors = colors; } function getTileInfo(uint256 id) public view returns (string memory, string memory, uint256[100] memory){ TileInfo memory tile = tiles[id]; return (tile.title, tile.ownerURL, tile.colors); } function getOneMil() public view returns (address) { return address(mil); } function buyTile(uint256 tileId, uint256 totalPrice, uint256 nonce, uint8 v, bytes32 r, bytes32 s) public { require(!usedNonces[nonce]); usedNonces[nonce] = true; bytes32 message = prefixed(keccak256(abi.encodePacked(uint256(1), msg.sender, tileId, totalPrice, nonce, this))); require(owners[ecrecover(message, v, r, s)], "Tile: signature error"); if (totalPrice > 0) { mil.transferFrom(address(tx.origin), moneybox, totalPrice - (totalPrice / 2)); mil.burnFrom(address(tx.origin), totalPrice / 2); } _mint(msg.sender, tileId); } function buyTiles(uint256[] calldata tilesId, uint256 totalPrice, uint256 nonce, uint8 v, bytes32 r, bytes32 s) public { require(!usedNonces[nonce]); usedNonces[nonce] = true; uint256 concatId = tilesId[0]; for (uint256 i = 1; i < tilesId.length; i++) { concatId = concatId ^ tilesId[i]; } bytes32 message = prefixed(keccak256(abi.encodePacked(uint256(1), msg.sender, concatId, totalPrice, nonce, this))); require(owners[ecrecover(message, v, r, s)], "Tile: signature error"); if (totalPrice > 0) { mil.transferFrom(address(tx.origin), moneybox, totalPrice - (totalPrice / 2)); mil.burnFrom(address(tx.origin), totalPrice / 2); } for (uint256 i = 0; i < tilesId.length; i++) { _mint(msg.sender, tilesId[i]); } } function setMoneyBox(address _moneybox) public { require(owners[msg.sender], 'Only Owner can change MoneyBox'); moneybox = _moneybox; } function getMoneyBox() public view returns (address) { return moneybox; } function setFree(address _free) public { require(owners[msg.sender], 'Only Owner can change Free'); free = _free; } function getFree() public view returns (address) { return free; } /// builds a prefixed hash to mimic the behavior of eth_sign. function prefixed(bytes32 hash) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash)); } function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal virtual override(ERC721Enumerable) { super._beforeTokenTransfer(from, to, tokenId); } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721Enumerable) returns (bool) { return super.supportsInterface(interfaceId); } function checkOwner(uint256[] calldata tilesId, address _owner) public view returns (bool) { for (uint256 i = 0; i < tilesId.length; i++) { if (ownerOf(tilesId[i]) != _owner) return false; } return true; } }
// SPDX-License-Identifier: MIT 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, _msgSender()); _; } /** * @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 override returns (bool) { return _roles[role].members[account]; } /** * @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 { 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 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. */ 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. */ 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 granted `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. */ 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. * * [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}. * ==== */ 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); } function _grantRole(bytes32 role, address account) private { if (!hasRole(role, account)) { _roles[role].members[account] = true; emit RoleGranted(role, account, _msgSender()); } } function _revokeRole(bytes32 role, address account) private { if (hasRole(role, account)) { _roles[role].members[account] = false; emit RoleRevoked(role, account, _msgSender()); } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./IAccessControlEnumerable.sol"; import "./AccessControl.sol"; import "../utils/structs/EnumerableSet.sol"; /** * @dev Extension of {AccessControl} that allows enumerating the members of each role. */ abstract contract AccessControlEnumerable is IAccessControlEnumerable, AccessControl { using EnumerableSet for EnumerableSet.AddressSet; mapping(bytes32 => EnumerableSet.AddressSet) private _roleMembers; /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControlEnumerable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Returns one of the accounts that have `role`. `index` must be a * value between 0 and {getRoleMemberCount}, non-inclusive. * * Role bearers are not sorted in any particular way, and their ordering may * change at any point. * * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure * you perform all queries on the same block. See the following * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post] * for more information. */ function getRoleMember(bytes32 role, uint256 index) public view override returns (address) { return _roleMembers[role].at(index); } /** * @dev Returns the number of accounts that have `role`. Can be used * together with {getRoleMember} to enumerate all bearers of a role. */ function getRoleMemberCount(bytes32 role) public view override returns (uint256) { return _roleMembers[role].length(); } /** * @dev Overload {grantRole} to track enumerable memberships */ function grantRole(bytes32 role, address account) public virtual override(AccessControl, IAccessControl) { super.grantRole(role, account); _roleMembers[role].add(account); } /** * @dev Overload {revokeRole} to track enumerable memberships */ function revokeRole(bytes32 role, address account) public virtual override(AccessControl, IAccessControl) { super.revokeRole(role, account); _roleMembers[role].remove(account); } /** * @dev Overload {renounceRole} to track enumerable memberships */ function renounceRole(bytes32 role, address account) public virtual override(AccessControl, IAccessControl) { super.renounceRole(role, account); _roleMembers[role].remove(account); } /** * @dev Overload {_setupRole} to track enumerable memberships */ function _setupRole(bytes32 role, address account) internal virtual override { super._setupRole(role, account); _roleMembers[role].add(account); } }
// SPDX-License-Identifier: MIT 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 pragma solidity ^0.8.0; import "./IAccessControl.sol"; /** * @dev External interface of AccessControlEnumerable declared to support ERC165 detection. */ interface IAccessControlEnumerable is IAccessControl { /** * @dev Returns one of the accounts that have `role`. `index` must be a * value between 0 and {getRoleMemberCount}, non-inclusive. * * Role bearers are not sorted in any particular way, and their ordering may * change at any point. * * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure * you perform all queries on the same block. See the following * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post] * for more information. */ function getRoleMember(bytes32 role, uint256 index) external view returns (address); /** * @dev Returns the number of accounts that have `role`. Can be used * together with {getRoleMember} to enumerate all bearers of a role. */ function getRoleMemberCount(bytes32 role) external view returns (uint256); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./IERC20.sol"; import "./extensions/IERC20Metadata.sol"; import "../../utils/Context.sol"; /** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our guide * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How * to implement supply mechanisms]. * * We have followed general OpenZeppelin Contracts guidelines: functions revert * instead returning `false` on failure. This behavior is nonetheless * conventional and does not conflict with the expectations of ERC20 * applications. * * Additionally, an {Approval} event is emitted on calls to {transferFrom}. * This allows applications to reconstruct the allowance for all accounts just * by listening to said events. Other implementations of the EIP may not emit * these events, as it isn't required by the specification. * * Finally, the non-standard {decreaseAllowance} and {increaseAllowance} * functions have been added to mitigate the well-known issues around setting * allowances. See {IERC20-approve}. */ contract ERC20 is Context, IERC20, IERC20Metadata { mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values for {name} and {symbol}. * * The default value of {decimals} is 18. To select a different value for * {decimals} you should overload it. * * All two of these values are immutable: they can only be set once during * construction. */ constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } /** * @dev Returns the name of the token. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5.05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. This is the value {ERC20} uses, unless this function is * overridden; * * NOTE: This information is only used for _display_ purposes: it in * no way affects any of the arithmetic of the contract, including * {IERC20-balanceOf} and {IERC20-transfer}. */ function decimals() public view virtual override returns (uint8) { return 18; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; } /** * @dev See {IERC20-transfer}. * * Requirements: * * - `recipient` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } /** * @dev See {IERC20-approve}. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } /** * @dev See {IERC20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {ERC20}. * * Requirements: * * - `sender` and `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. * - the caller must have allowance for ``sender``'s tokens of at least * `amount`. */ function transferFrom( address sender, address recipient, uint256 amount ) public virtual override returns (bool) { _transfer(sender, recipient, amount); uint256 currentAllowance = _allowances[sender][_msgSender()]; require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance"); unchecked { _approve(sender, _msgSender(), currentAllowance - amount); } return true; } /** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. */ function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue); return true; } /** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. * - `spender` must have allowance for the caller of at least * `subtractedValue`. */ function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { uint256 currentAllowance = _allowances[_msgSender()][spender]; require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero"); unchecked { _approve(_msgSender(), spender, currentAllowance - subtractedValue); } return true; } /** * @dev Moves `amount` of tokens from `sender` to `recipient`. * * This internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * Requirements: * * - `sender` cannot be the zero address. * - `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. */ function _transfer( address sender, address recipient, uint256 amount ) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); uint256 senderBalance = _balances[sender]; require(senderBalance >= amount, "ERC20: transfer amount exceeds balance"); unchecked { _balances[sender] = senderBalance - amount; } _balances[recipient] += amount; emit Transfer(sender, recipient, amount); _afterTokenTransfer(sender, recipient, amount); } /** @dev Creates `amount` tokens and assigns them to `account`, increasing * the total supply. * * Emits a {Transfer} event with `from` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. */ function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply += amount; _balances[account] += amount; emit Transfer(address(0), account, amount); _afterTokenTransfer(address(0), account, amount); } /** * @dev Destroys `amount` tokens from `account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */ function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); uint256 accountBalance = _balances[account]; require(accountBalance >= amount, "ERC20: burn amount exceeds balance"); unchecked { _balances[account] = accountBalance - amount; } _totalSupply -= amount; emit Transfer(account, address(0), amount); _afterTokenTransfer(account, address(0), amount); } /** * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens. * * This internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. */ function _approve( address owner, address spender, uint256 amount ) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } /** * @dev Hook that is called before any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * will be transferred to `to`. * - when `from` is zero, `amount` tokens will be minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens 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 amount ) 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, `amount` of ``from``'s tokens * has been transferred to `to`. * - when `from` is zero, `amount` tokens have been minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens have been 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 _afterTokenTransfer( address from, address to, uint256 amount ) internal virtual {} }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../ERC20.sol"; import "../../../utils/Context.sol"; /** * @dev Extension of {ERC20} that allows token holders to destroy both their own * tokens and those that they have an allowance for, in a way that can be * recognized off-chain (via event analysis). */ abstract contract ERC20Burnable is Context, ERC20 { /** * @dev Destroys `amount` tokens from the caller. * * See {ERC20-_burn}. */ function burn(uint256 amount) public virtual { _burn(_msgSender(), amount); } /** * @dev Destroys `amount` tokens from `account`, deducting from the caller's * allowance. * * See {ERC20-_burn} and {ERC20-allowance}. * * Requirements: * * - the caller must have allowance for ``accounts``'s tokens of at least * `amount`. */ function burnFrom(address account, uint256 amount) public virtual { uint256 currentAllowance = allowance(account, _msgSender()); require(currentAllowance >= amount, "ERC20: burn amount exceeds allowance"); unchecked { _approve(account, _msgSender(), currentAllowance - amount); } _burn(account, amount); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../IERC20.sol"; /** * @dev Interface for the optional metadata functions from the ERC20 standard. * * _Available since v4.1._ */ interface IERC20Metadata is IERC20 { /** * @dev Returns the name of the token. */ function name() external view returns (string memory); /** * @dev Returns the symbol of the token. */ function symbol() external view returns (string memory); /** * @dev Returns the decimals places of the token. */ function decimals() external view returns (uint8); }
// SPDX-License-Identifier: MIT 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: balance query for the zero address"); 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: owner query for nonexistent token"); 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) { require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token"); 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 overriden 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 owner nor approved for all" ); _approve(to, tokenId); } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view virtual override returns (address) { require(_exists(tokenId), "ERC721: approved query for nonexistent token"); return _tokenApprovals[tokenId]; } /** * @dev See {IERC721-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { require(operator != _msgSender(), "ERC721: approve to caller"); _operatorApprovals[_msgSender()][operator] = approved; emit ApprovalForAll(_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: transfer caller is not 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: transfer caller is not 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) { require(_exists(tokenId), "ERC721: operator query for nonexistent token"); address owner = ERC721.ownerOf(tokenId); return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, 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); } /** * @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); } /** * @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 of token that is not own"); 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); } /** * @dev Approve `to` to operate on `tokenId` * * Emits a {Approval} event. */ function _approve(address to, uint256 tokenId) internal virtual { _tokenApprovals[tokenId] = to; emit Approval(ERC721.ownerOf(tokenId), to, tokenId); } /** * @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 { 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 {} }
// SPDX-License-Identifier: MIT 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`, 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 be 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 Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @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 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); /** * @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; }
// SPDX-License-Identifier: MIT 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 `IERC721.onERC721Received.selector`. */ function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../ERC721.sol"; import "../../../utils/Context.sol"; /** * @title ERC721 Burnable Token * @dev ERC721 Token that can be irreversibly burned (destroyed). */ abstract contract ERC721Burnable is Context, ERC721 { /** * @dev Burns `tokenId`. See {ERC721-_burn}. * * Requirements: * * - The caller must own `tokenId` or be an approved operator. */ function burn(uint256 tokenId) public virtual { //solhint-disable-next-line max-line-length require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721Burnable: caller is not owner nor approved"); _burn(tokenId); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../ERC721.sol"; import "./IERC721Enumerable.sol"; /** * @dev This implements an optional extension of {ERC721} defined in the EIP that adds * enumerability of all the token ids in the contract as well as all token ids owned by each * account. */ abstract contract ERC721Enumerable is ERC721, IERC721Enumerable { // Mapping from owner to list of owned token IDs mapping(address => mapping(uint256 => uint256)) private _ownedTokens; // Mapping from token ID to index of the owner tokens list mapping(uint256 => uint256) private _ownedTokensIndex; // Array with all token ids, used for enumeration uint256[] private _allTokens; // Mapping from token id to position in the allTokens array mapping(uint256 => uint256) private _allTokensIndex; /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721) returns (bool) { return interfaceId == type(IERC721Enumerable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}. */ function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override returns (uint256) { require(index < ERC721.balanceOf(owner), "ERC721Enumerable: owner index out of bounds"); return _ownedTokens[owner][index]; } /** * @dev See {IERC721Enumerable-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _allTokens.length; } /** * @dev See {IERC721Enumerable-tokenByIndex}. */ function tokenByIndex(uint256 index) public view virtual override returns (uint256) { require(index < ERC721Enumerable.totalSupply(), "ERC721Enumerable: global index out of bounds"); return _allTokens[index]; } /** * @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` cannot be the zero address. * - `to` cannot be the zero address. * * 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 override { super._beforeTokenTransfer(from, to, tokenId); if (from == address(0)) { _addTokenToAllTokensEnumeration(tokenId); } else if (from != to) { _removeTokenFromOwnerEnumeration(from, tokenId); } if (to == address(0)) { _removeTokenFromAllTokensEnumeration(tokenId); } else if (to != from) { _addTokenToOwnerEnumeration(to, tokenId); } } /** * @dev Private function to add a token to this extension's ownership-tracking data structures. * @param to address representing the new owner of the given token ID * @param tokenId uint256 ID of the token to be added to the tokens list of the given address */ function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private { uint256 length = ERC721.balanceOf(to); _ownedTokens[to][length] = tokenId; _ownedTokensIndex[tokenId] = length; } /** * @dev Private function to add a token to this extension's token tracking data structures. * @param tokenId uint256 ID of the token to be added to the tokens list */ function _addTokenToAllTokensEnumeration(uint256 tokenId) private { _allTokensIndex[tokenId] = _allTokens.length; _allTokens.push(tokenId); } /** * @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that * while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for * gas optimizations e.g. when performing a transfer operation (avoiding double writes). * This has O(1) time complexity, but alters the order of the _ownedTokens array. * @param from address representing the previous owner of the given token ID * @param tokenId uint256 ID of the token to be removed from the tokens list of the given address */ function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private { // To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and // then delete the last slot (swap and pop). uint256 lastTokenIndex = ERC721.balanceOf(from) - 1; uint256 tokenIndex = _ownedTokensIndex[tokenId]; // When the token to delete is the last token, the swap operation is unnecessary if (tokenIndex != lastTokenIndex) { uint256 lastTokenId = _ownedTokens[from][lastTokenIndex]; _ownedTokens[from][tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token _ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index } // This also deletes the contents at the last position of the array delete _ownedTokensIndex[tokenId]; delete _ownedTokens[from][lastTokenIndex]; } /** * @dev Private function to remove a token from this extension's token tracking data structures. * This has O(1) time complexity, but alters the order of the _allTokens array. * @param tokenId uint256 ID of the token to be removed from the tokens list */ function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private { // To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and // then delete the last slot (swap and pop). uint256 lastTokenIndex = _allTokens.length - 1; uint256 tokenIndex = _allTokensIndex[tokenId]; // When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so // rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding // an 'if' statement (like in _removeTokenFromOwnerEnumeration) uint256 lastTokenId = _allTokens[lastTokenIndex]; _allTokens[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token _allTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index // This also deletes the contents at the last position of the array delete _allTokensIndex[tokenId]; _allTokens.pop(); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../IERC721.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721Enumerable is IERC721 { /** * @dev Returns the total amount of tokens stored by the contract. */ function totalSupply() external view returns (uint256); /** * @dev Returns a token ID owned by `owner` at a given `index` of its token list. * Use along with {balanceOf} to enumerate all of ``owner``'s tokens. */ function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256 tokenId); /** * @dev Returns a token ID at a given `index` of all the tokens stored by the contract. * Use along with {totalSupply} to enumerate all tokens. */ function tokenByIndex(uint256 index) external view returns (uint256); }
// SPDX-License-Identifier: MIT 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 pragma solidity ^0.8.0; /** * @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 * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; assembly { size := extcodesize(account) } return size > 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 assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// SPDX-License-Identifier: MIT 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 pragma solidity ^0.8.0; /** * @dev String operations. */ library Strings { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; /** * @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); } }
// SPDX-License-Identifier: MIT 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 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.0; /** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are made on the ordering. * * ``` * contract Example { * // Add the library methods * using EnumerableSet for EnumerableSet.AddressSet; * * // Declare a set state variable * EnumerableSet.AddressSet private mySet; * } * ``` * * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`) * and `uint256` (`UintSet`) are supported. */ library EnumerableSet { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are just wrappers around the // underlying Set. // This means that we can only create new EnumerableSets for types that fit // in bytes32. struct Set { // Storage of set values bytes32[] _values; // Position of the value in the `values` array, plus 1 because index 0 // means a value is not in the set. mapping(bytes32 => uint256) _indexes; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function _add(Set storage set, bytes32 value) private returns (bool) { if (!_contains(set, value)) { set._values.push(value); // The value is stored at length-1, but we add 1 to all indexes // and use 0 as a sentinel value set._indexes[value] = set._values.length; return true; } else { return false; } } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function _remove(Set storage set, bytes32 value) private returns (bool) { // We read and store the value's index to prevent multiple reads from the same storage slot uint256 valueIndex = set._indexes[value]; if (valueIndex != 0) { // Equivalent to contains(set, value) // To delete an element from the _values array in O(1), we swap the element to delete with the last one in // the array, and then remove the last element (sometimes called as 'swap and pop'). // This modifies the order of the array, as noted in {at}. uint256 toDeleteIndex = valueIndex - 1; uint256 lastIndex = set._values.length - 1; if (lastIndex != toDeleteIndex) { bytes32 lastvalue = set._values[lastIndex]; // Move the last value to the index where the value to delete is set._values[toDeleteIndex] = lastvalue; // Update the index for the moved value set._indexes[lastvalue] = valueIndex; // Replace lastvalue's index to valueIndex } // Delete the slot where the moved value was stored set._values.pop(); // Delete the index for the deleted slot delete set._indexes[value]; return true; } else { return false; } } /** * @dev Returns true if the value is in the set. O(1). */ function _contains(Set storage set, bytes32 value) private view returns (bool) { return set._indexes[value] != 0; } /** * @dev Returns the number of values on the set. O(1). */ function _length(Set storage set) private view returns (uint256) { return set._values.length; } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function _at(Set storage set, uint256 index) private view returns (bytes32) { return set._values[index]; } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function _values(Set storage set) private view returns (bytes32[] memory) { return set._values; } // Bytes32Set struct Bytes32Set { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _add(set._inner, value); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _remove(set._inner, value); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) { return _contains(set._inner, value); } /** * @dev Returns the number of values in the set. O(1). */ function length(Bytes32Set storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) { return _at(set._inner, index); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(Bytes32Set storage set) internal view returns (bytes32[] memory) { return _values(set._inner); } // AddressSet struct AddressSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(AddressSet storage set, address value) internal returns (bool) { return _add(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(AddressSet storage set, address value) internal returns (bool) { return _remove(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(AddressSet storage set, address value) internal view returns (bool) { return _contains(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns the number of values in the set. O(1). */ function length(AddressSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(AddressSet storage set, uint256 index) internal view returns (address) { return address(uint160(uint256(_at(set._inner, index)))); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(AddressSet storage set) internal view returns (address[] memory) { bytes32[] memory store = _values(set._inner); address[] memory result; assembly { result := store } return result; } // UintSet struct UintSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(UintSet storage set, uint256 value) internal returns (bool) { return _add(set._inner, bytes32(value)); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(UintSet storage set, uint256 value) internal returns (bool) { return _remove(set._inner, bytes32(value)); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(UintSet storage set, uint256 value) internal view returns (bool) { return _contains(set._inner, bytes32(value)); } /** * @dev Returns the number of values on the set. O(1). */ function length(UintSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(UintSet storage set, uint256 index) internal view returns (uint256) { return uint256(_at(set._inner, index)); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(UintSet storage set) internal view returns (uint256[] memory) { bytes32[] memory store = _values(set._inner); uint256[] memory result; assembly { result := store } return result; } }
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity >=0.6.6; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; interface I1MIL is IERC20 { function INITIAL_SUPPLY() external view returns (uint); function MAX_SUPPLY() external view returns (uint); }
{ "remappings": [], "optimizer": { "enabled": true, "runs": 200 }, "evmVersion": "berlin", "libraries": {}, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "abi" ] } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"contract ERC20Burnable","name":"_mil","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"addOwner","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":"baseTokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"tileId","type":"uint256"},{"internalType":"uint256","name":"totalPrice","type":"uint256"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"buyTile","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tilesId","type":"uint256[]"},{"internalType":"uint256","name":"totalPrice","type":"uint256"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"buyTiles","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tilesId","type":"uint256[]"},{"internalType":"address","name":"_owner","type":"address"}],"name":"checkOwner","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"contractURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getFree","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"invoiceId","type":"uint256"}],"name":"getInvoice","outputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getMoneyBox","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getOneMil","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"getTileInfo","outputs":[{"internalType":"string","name":"","type":"string"},{"internalType":"string","name":"","type":"string"},{"internalType":"uint256[100]","name":"","type":"uint256[100]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"totalPrice","type":"uint256"}],"name":"payForInfoAndColors","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"oldOwner","type":"address"}],"name":"removeOwner","outputs":[],"stateMutability":"nonpayable","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":"uint256","name":"id","type":"uint256"},{"internalType":"uint256[100]","name":"colors","type":"uint256[100]"}],"name":"setColors","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_free","type":"address"}],"name":"setFree","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"string","name":"title","type":"string"},{"internalType":"string","name":"ownerURL","type":"string"}],"name":"setInfo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"string","name":"title","type":"string"},{"internalType":"string","name":"ownerURL","type":"string"},{"internalType":"uint256[100]","name":"colors","type":"uint256[100]"}],"name":"setInfoAndColors","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_moneybox","type":"address"}],"name":"setMoneyBox","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[100][]","name":"colors","type":"uint256[100][]"}],"name":"setMultiColors","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":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"pure","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"}]
Contract Creation Code
6080604052600a80546001600160a01b031990811673a2eb9bff23f5117979767bd0c51be8e2f7fbf52f17909155600b8054909116731cc1bd553df7f45f697a85cac7a121c0a7e2e1c41790556000600e553480156200005e57600080fd5b5060405162003952380380620039528339810160408190526200008191620001c9565b604080518082018252600481526354696c6560e01b60208083019182528351808501909452600384526215125360ea1b908401528151919291620000c89160009162000123565b508051620000de90600190602084019062000123565b5050336000908152601060205260409020805460ff1916600117905550600c80546001600160a01b03929092166001600160a01b031990921691909117905562000236565b8280546200013190620001f9565b90600052602060002090601f016020900481019282620001555760008555620001a0565b82601f106200017057805160ff1916838001178555620001a0565b82800160010185558215620001a0579182015b82811115620001a057825182559160200191906001019062000183565b50620001ae929150620001b2565b5090565b5b80821115620001ae5760008155600101620001b3565b600060208284031215620001db578081fd5b81516001600160a01b0381168114620001f2578182fd5b9392505050565b6002810460018216806200020e57607f821691505b602082108114156200023057634e487b7160e01b600052602260045260246000fd5b50919050565b61370c80620002466000396000f3fe608060405234801561001057600080fd5b506004361061021c5760003560e01c80636352211e11610125578063c1e71c2a116100ad578063d9cab2cb1161007c578063d9cab2cb14610494578063e32b0616146104a7578063e8a3d485146104af578063e985e9c5146104b7578063fd16b69a146104ca5761021c565b8063c1e71c2a14610453578063c87b56dd14610466578063d547cfb714610479578063d739f467146104815761021c565b806395d89b41116100f457806395d89b41146103ff578063a22cb46514610407578063b260c8c31461041a578063b88d4fde1461042d578063bd9f09f9146104405761021c565b80636352211e146103b35780637065cb48146103c657806370a08231146103d957806389ef69f6146103ec5761021c565b806323b872dd116101a857806340c10f191161017757806340c10f191461034557806342842e0e14610358578063482ec24a1461036b5780634f6ccce71461038d57806356824f35146103a05761021c565b806323b872dd146102f55780632be65e2a146103085780632f745c59146103105780633a23cc0a146103235761021c565b80630fa8817b116101ef5780630fa8817b14610294578063173825d9146102a757806318160ddd146102ba57806318cc8e85146102cf5780631966c218146102e25761021c565b806301ffc9a71461022157806306fdde031461024a578063081812fc1461025f578063095ea7b31461027f575b600080fd5b61023461022f366004612bbf565b6104d2565b6040516102419190612efe565b60405180910390f35b6102526104e5565b6040516102419190612f27565b61027261026d366004612bf7565b610577565b6040516102419190612e4f565b61029261028d3660046129f9565b6105c3565b005b6102926102a2366004612bf7565b61065b565b6102926102b53660046128c3565b6108e3565b6102c261095c565b6040516102419190613518565b6102926102dd366004612a74565b610962565b6102926102f0366004612d32565b610c43565b61029261030336600461290f565b610e4e565b610272610e86565b6102c261031e3660046129f9565b610e95565b610336610331366004612bf7565b610ee7565b60405161024193929190612edd565b6102926103533660046129f9565b610f10565b61029261036636600461290f565b610f4d565b61037e610379366004612bf7565b610f68565b60405161024193929190612f3a565b6102c261039b366004612bf7565b611104565b6102926103ae366004612cb5565b61115f565b6102726103c1366004612bf7565b611405565b6102926103d43660046128c3565b61143a565b6102c26103e73660046128c3565b61148d565b6102926103fa3660046128c3565b6114d1565b610252611522565b6102926104153660046129c3565b611531565b610234610428366004612a22565b6115ff565b61029261043b36600461294a565b61167b565b61029261044e366004612c27565b6116ba565b6102926104613660046128c3565b611913565b610252610474366004612bf7565b611964565b61025261199e565b61029261048f366004612c4b565b6119d5565b6102926104a2366004612aec565b611c56565b610272611ccc565b610252611cdb565b6102346104c53660046128dd565b611cfb565b610272611d29565b60006104dd82611d38565b90505b919050565b6060600080546104f4906135de565b80601f0160208091040260200160405190810160405280929190818152602001828054610520906135de565b801561056d5780601f106105425761010080835404028352916020019161056d565b820191906000526020600020905b81548152906001019060200180831161055057829003601f168201915b5050505050905090565b600061058282611d5d565b6105a75760405162461bcd60e51b815260040161059e906132f5565b60405180910390fd5b506000908152600460205260409020546001600160a01b031690565b60006105ce82611405565b9050806001600160a01b0316836001600160a01b031614156106025760405162461bcd60e51b815260040161059e9061338a565b806001600160a01b0316610614611d7a565b6001600160a01b031614806106305750610630816104c5611d7a565b61064c5760405162461bcd60e51b815260040161059e906131a1565b6106568383611d7e565b505050565b801561085e57600c546001600160a01b03166323b872dd323061067f600286613587565b6040518463ffffffff1660e01b815260040161069d93929190612e63565b602060405180830381600087803b1580156106b757600080fd5b505af11580156106cb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106ef9190612ba3565b50600c54600a546001600160a01b03918216916323b872dd91329116610716600286613587565b6040518463ffffffff1660e01b815260040161073493929190612e63565b602060405180830381600087803b15801561074e57600080fd5b505af1158015610762573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107869190612ba3565b50600c546040516370a0823160e01b81526001600160a01b03909116906342966c689082906370a08231906107bf903090600401612e4f565b60206040518083038186803b1580156107d757600080fd5b505afa1580156107eb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061080f9190612c0f565b6040518263ffffffff1660e01b815260040161082b9190613518565b600060405180830381600087803b15801561084557600080fd5b505af1158015610859573d6000803e3d6000fd5b505050505b60006040518060600160405280336001600160a01b031681526020018381526020014281525090506000600e6000815461089790613619565b91829055506000908152600d6020908152604091829020845181546001600160a01b0319166001600160a01b039091161781559084015160018201559201516002909201919091555050565b3360009081526010602052604090205460ff166109125760405162461bcd60e51b815260040161059e90613468565b336001600160a01b038216141561093b5760405162461bcd60e51b815260040161059e90613468565b6001600160a01b03166000908152601060205260409020805460ff19169055565b60085490565b60008481526011602052604090205460ff161561097e57600080fd5b6000848152601160205260408120805460ff19166001179055878782816109b557634e487b7160e01b600052603260045260246000fd5b9050602002013590506000600190505b87811015610a0b578888828181106109ed57634e487b7160e01b600052603260045260246000fd5b90506020020135821891508080610a0390613619565b9150506109c5565b506000610a48600133848a8a30604051602001610a2d96959493929190612e0e565b60405160208183030381529060405280519060200120611dec565b90506010600060018388888860405160008152602001604052604051610a719493929190612f09565b6020604051602081039080840390855afa158015610a93573d6000803e3d6000fd5b505060408051601f1901516001600160a01b03168352602083019390935250016000205460ff16610ad65760405162461bcd60e51b815260040161059e90613291565b8615610bea57600c54600a546001600160a01b03918216916323b872dd91329116610b0260028c613587565b610b0c908c61359b565b6040518463ffffffff1660e01b8152600401610b2a93929190612e63565b602060405180830381600087803b158015610b4457600080fd5b505af1158015610b58573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b7c9190612ba3565b50600c546001600160a01b03166379cc679032610b9a60028b613587565b6040518363ffffffff1660e01b8152600401610bb7929190612ec4565b600060405180830381600087803b158015610bd157600080fd5b505af1158015610be5573d6000803e3d6000fd5b505050505b60005b88811015610c3757610c25338b8b84818110610c1957634e487b7160e01b600052603260045260246000fd5b90506020020135611e1c565b80610c2f81613619565b915050610bed565b50505050505050505050565b60008481526011602052604090205460ff1615610c5f57600080fd5b6000848152601160209081526040808320805460ff191660019081179091559051610c9992610a2d929133918c918c918c91309101612e0e565b90506010600060018387878760405160008152602001604052604051610cc29493929190612f09565b6020604051602081039080840390855afa158015610ce4573d6000803e3d6000fd5b505060408051601f1901516001600160a01b03168352602083019390935250016000205460ff16610d275760405162461bcd60e51b815260040161059e90613291565b8515610e3b57600c54600a546001600160a01b03918216916323b872dd91329116610d5360028b613587565b610d5d908b61359b565b6040518463ffffffff1660e01b8152600401610d7b93929190612e63565b602060405180830381600087803b158015610d9557600080fd5b505af1158015610da9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dcd9190612ba3565b50600c546001600160a01b03166379cc679032610deb60028a613587565b6040518363ffffffff1660e01b8152600401610e08929190612ec4565b600060405180830381600087803b158015610e2257600080fd5b505af1158015610e36573d6000803e3d6000fd5b505050505b610e453388611e1c565b50505050505050565b610e5f610e59611d7a565b82611efb565b610e7b5760405162461bcd60e51b815260040161059e906133cb565b610656838383611f80565b600b546001600160a01b031690565b6000610ea08361148d565b8210610ebe5760405162461bcd60e51b815260040161059e90613006565b506001600160a01b03919091166000908152600660209081526040808320938352929052205490565b6000908152600d60205260409020805460018201546002909201546001600160a01b0390911692565b3360009081526010602052604090205460ff16610f3f5760405162461bcd60e51b815260040161059e906134d6565b610f498282611e1c565b5050565b6106568383836040518060200160405280600081525061167b565b606080610f73612607565b6000848152600f6020526040808220815160608101909252805482908290610f9a906135de565b80601f0160208091040260200160405190810160405280929190818152602001828054610fc6906135de565b80156110135780601f10610fe857610100808354040283529160200191611013565b820191906000526020600020905b815481529060010190602001808311610ff657829003601f168201915b5050505050815260200160018201805461102c906135de565b80601f0160208091040260200160405190810160405280929190818152602001828054611058906135de565b80156110a55780601f1061107a576101008083540402835291602001916110a5565b820191906000526020600020905b81548152906001019060200180831161108857829003601f168201915b505050918352505060408051610c8081019182905260209092019190600284019060649082845b8154815260200190600101908083116110cc575050509190925250508151602083015160409093015190989297509550909350505050565b600061110e61095c565b821061112c5760405162461bcd60e51b815260040161059e9061341c565b6008828154811061114d57634e487b7160e01b600052603260045260246000fd5b90600052602060002001549050919050565b3361116985611405565b6001600160a01b03161461118f5760405162461bcd60e51b815260040161059e90612f98565b600b546001600160a01b0316331461139b57600c546040516323b872dd60e01b81526001600160a01b03909116906323b872dd906111dd9032903090670de0b6b3a764000090600401612e63565b602060405180830381600087803b1580156111f757600080fd5b505af115801561120b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061122f9190612ba3565b50600c54600a546040516323b872dd60e01b81526001600160a01b03928316926323b872dd9261127192329290911690670de0b6b3a764000090600401612e63565b602060405180830381600087803b15801561128b57600080fd5b505af115801561129f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112c39190612ba3565b50600c546040516370a0823160e01b81526001600160a01b03909116906342966c689082906370a08231906112fc903090600401612e4f565b60206040518083038186803b15801561131457600080fd5b505afa158015611328573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061134c9190612c0f565b6040518263ffffffff1660e01b81526004016113689190613518565b600060405180830381600087803b15801561138257600080fd5b505af1158015611396573d6000803e3d6000fd5b505050505b6000848152600f6020908152604090912084516113ba92860190612626565b506000848152600f6020908152604090912083516113e092600190920191850190612626565b506000848152600f602052604090206113fe906002018260646126aa565b5050505050565b6000818152600260205260408120546001600160a01b0316806104dd5760405162461bcd60e51b815260040161059e90613248565b3360009081526010602052604090205460ff166114695760405162461bcd60e51b815260040161059e90613468565b6001600160a01b03166000908152601060205260409020805460ff19166001179055565b60006001600160a01b0382166114b55760405162461bcd60e51b815260040161059e906131fe565b506001600160a01b031660009081526003602052604090205490565b3360009081526010602052604090205460ff166115005760405162461bcd60e51b815260040161059e90612fcf565b600b80546001600160a01b0319166001600160a01b0392909216919091179055565b6060600180546104f4906135de565b611539611d7a565b6001600160a01b0316826001600160a01b0316141561156a5760405162461bcd60e51b815260040161059e9061311e565b8060056000611577611d7a565b6001600160a01b03908116825260208083019390935260409182016000908120918716808252919093529120805460ff1916921515929092179091556115bb611d7a565b6001600160a01b03167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31836040516115f39190612efe565b60405180910390a35050565b6000805b8381101561166e57826001600160a01b031661164486868481811061163857634e487b7160e01b600052603260045260246000fd5b90506020020135611405565b6001600160a01b03161461165c576000915050611674565b8061166681613619565b915050611603565b50600190505b9392505050565b61168c611686611d7a565b83611efb565b6116a85760405162461bcd60e51b815260040161059e906133cb565b6116b4848484846120ad565b50505050565b336116c483611405565b6001600160a01b0316146116ea5760405162461bcd60e51b815260040161059e90612f98565b600b546001600160a01b031633146118f657600c546040516323b872dd60e01b81526001600160a01b03909116906323b872dd9061173890329030906706f05b59d3b2000090600401612e63565b602060405180830381600087803b15801561175257600080fd5b505af1158015611766573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061178a9190612ba3565b50600c54600a546040516323b872dd60e01b81526001600160a01b03928316926323b872dd926117cc923292909116906706f05b59d3b2000090600401612e63565b602060405180830381600087803b1580156117e657600080fd5b505af11580156117fa573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061181e9190612ba3565b50600c546040516370a0823160e01b81526001600160a01b03909116906342966c689082906370a0823190611857903090600401612e4f565b60206040518083038186803b15801561186f57600080fd5b505afa158015611883573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118a79190612c0f565b6040518263ffffffff1660e01b81526004016118c39190613518565b600060405180830381600087803b1580156118dd57600080fd5b505af11580156118f1573d6000803e3d6000fd5b505050505b6000828152600f60205260409020610656906002018260646126aa565b3360009081526010602052604090205460ff166119425760405162461bcd60e51b815260040161059e9061349f565b600a80546001600160a01b0319166001600160a01b0392909216919091179055565b606061196e61199e565b611977836120e0565b604051602001611988929190612dae565b6040516020818303038152906040529050919050565b60408051808201909152601d81527f68747470733a2f2f316d6c6e6e6674732e636f6d2f6170692f6e66742f000000602082015290565b336119df84611405565b6001600160a01b031614611a055760405162461bcd60e51b815260040161059e90612f98565b600b546001600160a01b03163314611c1157600c546040516323b872dd60e01b81526001600160a01b03909116906323b872dd90611a5390329030906706f05b59d3b2000090600401612e63565b602060405180830381600087803b158015611a6d57600080fd5b505af1158015611a81573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611aa59190612ba3565b50600c54600a546040516323b872dd60e01b81526001600160a01b03928316926323b872dd92611ae7923292909116906706f05b59d3b2000090600401612e63565b602060405180830381600087803b158015611b0157600080fd5b505af1158015611b15573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b399190612ba3565b50600c546040516370a0823160e01b81526001600160a01b03909116906342966c689082906370a0823190611b72903090600401612e4f565b60206040518083038186803b158015611b8a57600080fd5b505afa158015611b9e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611bc29190612c0f565b6040518263ffffffff1660e01b8152600401611bde9190613518565b600060405180830381600087803b158015611bf857600080fd5b505af1158015611c0c573d6000803e3d6000fd5b505050505b6000838152600f602090815260409091208351611c3092850190612626565b506000838152600f6020908152604090912082516116b492600190920191840190612626565b60005b825181101561065657611cba838281518110611c8557634e487b7160e01b600052603260045260246000fd5b6020026020010151838381518110611cad57634e487b7160e01b600052603260045260246000fd5b60200260200101516116ba565b80611cc481613619565b915050611c59565b600c546001600160a01b031690565b60606040518060600160405280602581526020016136b260259139905090565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b600a546001600160a01b031690565b60006001600160e01b0319821663780e9d6360e01b14806104dd57506104dd826121fb565b6000908152600260205260409020546001600160a01b0316151590565b3390565b600081815260046020526040902080546001600160a01b0319166001600160a01b0384169081179091558190611db382611405565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b600081604051602001611dff9190612ddd565b604051602081830303815290604052805190602001209050919050565b6001600160a01b038216611e425760405162461bcd60e51b815260040161059e906132c0565b611e4b81611d5d565b15611e685760405162461bcd60e51b815260040161059e906130a3565b611e746000838361223b565b6001600160a01b0382166000908152600360205260408120805460019290611e9d90849061356f565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6000611f0682611d5d565b611f225760405162461bcd60e51b815260040161059e90613155565b6000611f2d83611405565b9050806001600160a01b0316846001600160a01b03161480611f685750836001600160a01b0316611f5d84610577565b6001600160a01b0316145b80611f785750611f788185611cfb565b949350505050565b826001600160a01b0316611f9382611405565b6001600160a01b031614611fb95760405162461bcd60e51b815260040161059e90613341565b6001600160a01b038216611fdf5760405162461bcd60e51b815260040161059e906130da565b611fea83838361223b565b611ff5600082611d7e565b6001600160a01b038316600090815260036020526040812080546001929061201e90849061359b565b90915550506001600160a01b038216600090815260036020526040812080546001929061204c90849061356f565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b6120b8848484611f80565b6120c484848484612246565b6116b45760405162461bcd60e51b815260040161059e90613051565b60608161210557506040805180820190915260018152600360fc1b60208201526104e0565b8160005b811561212f578061211981613619565b91506121289050600a83613587565b9150612109565b60008167ffffffffffffffff81111561215857634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015612182576020820181803683370190505b5090505b8415611f785761219760018361359b565b91506121a4600a86613634565b6121af90603061356f565b60f81b8183815181106121d257634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a9053506121f4600a86613587565b9450612186565b60006001600160e01b031982166380ac58cd60e01b148061222c57506001600160e01b03198216635b5e139f60e01b145b806104dd57506104dd82612361565b61065683838361237a565b600061225a846001600160a01b0316612403565b1561235657836001600160a01b031663150b7a02612276611d7a565b8786866040518563ffffffff1660e01b81526004016122989493929190612e87565b602060405180830381600087803b1580156122b257600080fd5b505af19250505080156122e2575060408051601f3d908101601f191682019092526122df91810190612bdb565b60015b61233c573d808015612310576040519150601f19603f3d011682016040523d82523d6000602084013e612315565b606091505b5080516123345760405162461bcd60e51b815260040161059e90613051565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050611f78565b506001949350505050565b6001600160e01b031981166301ffc9a760e01b14919050565b612385838383610656565b6001600160a01b0383166123a15761239c81612409565b6123c4565b816001600160a01b0316836001600160a01b0316146123c4576123c4838261244d565b6001600160a01b0382166123e0576123db816124ea565b610656565b826001600160a01b0316826001600160a01b0316146106565761065682826125c3565b3b151590565b600880546000838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b6000600161245a8461148d565b612464919061359b565b6000838152600760205260409020549091508082146124b7576001600160a01b03841660009081526006602090815260408083208584528252808320548484528184208190558352600790915290208190555b5060009182526007602090815260408084208490556001600160a01b039094168352600681528383209183525290812055565b6008546000906124fc9060019061359b565b6000838152600960205260408120546008805493945090928490811061253257634e487b7160e01b600052603260045260246000fd5b90600052602060002001549050806008838154811061256157634e487b7160e01b600052603260045260246000fd5b60009182526020808320909101929092558281526009909152604080822084905585825281205560088054806125a757634e487b7160e01b600052603160045260246000fd5b6001900381819060005260206000200160009055905550505050565b60006125ce8361148d565b6001600160a01b039093166000908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b60405180610c8001604052806064906020820280368337509192915050565b828054612632906135de565b90600052602060002090601f016020900481019282612654576000855561269a565b82601f1061266d57805160ff191683800117855561269a565b8280016001018555821561269a579182015b8281111561269a57825182559160200191906001019061267f565b506126a69291506126d7565b5090565b826064810192821561269a579160200282018281111561269a57825182559160200191906001019061267f565b5b808211156126a657600081556001016126d8565b600067ffffffffffffffff83111561270657612706613674565b612719601f8401601f1916602001613521565b905082815283838301111561272d57600080fd5b828260208301376000602084830101529392505050565b80356001600160a01b03811681146104e057600080fd5b600082601f83011261276b578081fd5b8135602061278061277b8361354b565b613521565b82815281810190858301610c808086028801850189101561279f578687fd5b865b868110156127c5576127b38a846127d3565b855293850193918101916001016127a1565b509198975050505050505050565b600082601f8301126127e3578081fd5b604051610c8080820182811067ffffffffffffffff8211171561280857612808613674565b604052818482810187101561281b578485fd5b8492505b606483101561283f5780358252600192909201916020918201910161281f565b509195945050505050565b60008083601f84011261285b578182fd5b50813567ffffffffffffffff811115612872578182fd5b602083019150836020808302850101111561288c57600080fd5b9250929050565b600082601f8301126128a3578081fd5b611674838335602085016126ec565b803560ff811681146104e057600080fd5b6000602082840312156128d4578081fd5b61167482612744565b600080604083850312156128ef578081fd5b6128f883612744565b915061290660208401612744565b90509250929050565b600080600060608486031215612923578081fd5b61292c84612744565b925061293a60208501612744565b9150604084013590509250925092565b6000806000806080858703121561295f578081fd5b61296885612744565b935061297660208601612744565b925060408501359150606085013567ffffffffffffffff811115612998578182fd5b8501601f810187136129a8578182fd5b6129b7878235602084016126ec565b91505092959194509250565b600080604083850312156129d5578182fd5b6129de83612744565b915060208301356129ee8161368a565b809150509250929050565b60008060408385031215612a0b578182fd5b612a1483612744565b946020939093013593505050565b600080600060408486031215612a36578081fd5b833567ffffffffffffffff811115612a4c578182fd5b612a588682870161284a565b9094509250612a6b905060208501612744565b90509250925092565b600080600080600080600060c0888a031215612a8e578485fd5b873567ffffffffffffffff811115612aa4578586fd5b612ab08a828b0161284a565b9098509650506020880135945060408801359350612ad0606089016128b2565b92506080880135915060a0880135905092959891949750929550565b60008060408385031215612afe578182fd5b823567ffffffffffffffff80821115612b15578384fd5b818501915085601f830112612b28578384fd5b81356020612b3861277b8361354b565b82815281810190858301838502870184018b1015612b54578889fd5b8896505b84871015612b76578035835260019690960195918301918301612b58565b5096505086013592505080821115612b8c578283fd5b50612b998582860161275b565b9150509250929050565b600060208284031215612bb4578081fd5b81516116748161368a565b600060208284031215612bd0578081fd5b81356116748161369b565b600060208284031215612bec578081fd5b81516116748161369b565b600060208284031215612c08578081fd5b5035919050565b600060208284031215612c20578081fd5b5051919050565b600080610ca08385031215612c3a578182fd5b8235915061290684602085016127d3565b600080600060608486031215612c5f578081fd5b83359250602084013567ffffffffffffffff80821115612c7d578283fd5b612c8987838801612893565b93506040860135915080821115612c9e578283fd5b50612cab86828701612893565b9150509250925092565b600080600080610ce08587031215612ccb578182fd5b84359350602085013567ffffffffffffffff80821115612ce9578384fd5b612cf588838901612893565b94506040870135915080821115612d0a578384fd5b50612d1787828801612893565b925050612d2786606087016127d3565b905092959194509250565b60008060008060008060c08789031215612d4a578384fd5b863595506020870135945060408701359350612d68606088016128b2565b92506080870135915060a087013590509295509295509295565b60008151808452612d9a8160208601602086016135b2565b601f01601f19169290920160200192915050565b60008351612dc08184602088016135b2565b835190830190612dd48183602088016135b2565b01949350505050565b7f19457468657265756d205369676e6564204d6573736167653a0a3332000000008152601c810191909152603c0190565b9586526bffffffffffffffffffffffff19606095861b8116602088015260348701949094526054860192909252607485015290911b16609482015260a80190565b6001600160a01b0391909116815260200190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090612eba90830184612d82565b9695505050505050565b6001600160a01b03929092168252602082015260400190565b6001600160a01b039390931683526020830191909152604082015260600190565b901515815260200190565b93845260ff9290921660208401526040830152606082015260800190565b6000602082526116746020830184612d82565b6000610cc0808352612f4e81840187612d82565b9050602083820381850152612f638287612d82565b92506040840191508460005b6064811015612f8c57815184529282019290820190600101612f6f565b50505050949350505050565b6020808252601e908201527f54696c653a206f6e6c79206f776e65722063616e207361766520496e666f0000604082015260600190565b6020808252601a908201527f4f6e6c79204f776e65722063616e206368616e67652046726565000000000000604082015260600190565b6020808252602b908201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560408201526a74206f6620626f756e647360a81b606082015260800190565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6020808252601c908201527f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000604082015260600190565b60208082526024908201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646040820152637265737360e01b606082015260800190565b60208082526019908201527f4552433732313a20617070726f766520746f2063616c6c657200000000000000604082015260600190565b6020808252602c908201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860408201526b34b9ba32b73a103a37b5b2b760a11b606082015260800190565b60208082526038908201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760408201527f6e6572206e6f7220617070726f76656420666f7220616c6c0000000000000000606082015260800190565b6020808252602a908201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604082015269726f206164647265737360b01b606082015260800190565b60208082526029908201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460408201526832b73a103a37b5b2b760b91b606082015260800190565b6020808252601590820152742a34b6329d1039b4b3b730ba3ab9329032b93937b960591b604082015260600190565b6020808252818101527f4552433732313a206d696e7420746f20746865207a65726f2061646472657373604082015260600190565b6020808252602c908201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860408201526b34b9ba32b73a103a37b5b2b760a11b606082015260800190565b60208082526029908201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960408201526839903737ba1037bbb760b91b606082015260800190565b60208082526021908201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656040820152603960f91b606082015260800190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b6020808252602c908201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60408201526b7574206f6620626f756e647360a01b606082015260800190565b6020808252601f908201527f54696c653a204f6e6c79206f776e65722063616e20616464206f776e65727300604082015260600190565b6020808252601e908201527f4f6e6c79204f776e65722063616e206368616e6765204d6f6e6579426f780000604082015260600190565b60208082526022908201527f54696c653a206d75737420686176652061646d696e20726f6c6520746f206d696040820152611b9d60f21b606082015260800190565b90815260200190565b60405181810167ffffffffffffffff8111828210171561354357613543613674565b604052919050565b600067ffffffffffffffff82111561356557613565613674565b5060209081020190565b6000821982111561358257613582613648565b500190565b6000826135965761359661365e565b500490565b6000828210156135ad576135ad613648565b500390565b60005b838110156135cd5781810151838201526020016135b5565b838111156116b45750506000910152565b6002810460018216806135f257607f821691505b6020821081141561361357634e487b7160e01b600052602260045260246000fd5b50919050565b600060001982141561362d5761362d613648565b5060010190565b6000826136435761364361365e565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b801515811461369857600080fd5b50565b6001600160e01b03198116811461369857600080fdfe68747470733a2f2f316d6c6e6e6674732e636f6d2f6170692f70726f6a6563742d696e666fa26469706673582212208e8a6917ca00ade334e3acdc406b2ebc30470cc857e716d79fd00d0ab0bc1e0664736f6c63430008000033000000000000000000000000a4ef4b0b23c1fc81d3f9ecf93510e64f58a4a016
Deployed Bytecode
0x608060405234801561001057600080fd5b506004361061021c5760003560e01c80636352211e11610125578063c1e71c2a116100ad578063d9cab2cb1161007c578063d9cab2cb14610494578063e32b0616146104a7578063e8a3d485146104af578063e985e9c5146104b7578063fd16b69a146104ca5761021c565b8063c1e71c2a14610453578063c87b56dd14610466578063d547cfb714610479578063d739f467146104815761021c565b806395d89b41116100f457806395d89b41146103ff578063a22cb46514610407578063b260c8c31461041a578063b88d4fde1461042d578063bd9f09f9146104405761021c565b80636352211e146103b35780637065cb48146103c657806370a08231146103d957806389ef69f6146103ec5761021c565b806323b872dd116101a857806340c10f191161017757806340c10f191461034557806342842e0e14610358578063482ec24a1461036b5780634f6ccce71461038d57806356824f35146103a05761021c565b806323b872dd146102f55780632be65e2a146103085780632f745c59146103105780633a23cc0a146103235761021c565b80630fa8817b116101ef5780630fa8817b14610294578063173825d9146102a757806318160ddd146102ba57806318cc8e85146102cf5780631966c218146102e25761021c565b806301ffc9a71461022157806306fdde031461024a578063081812fc1461025f578063095ea7b31461027f575b600080fd5b61023461022f366004612bbf565b6104d2565b6040516102419190612efe565b60405180910390f35b6102526104e5565b6040516102419190612f27565b61027261026d366004612bf7565b610577565b6040516102419190612e4f565b61029261028d3660046129f9565b6105c3565b005b6102926102a2366004612bf7565b61065b565b6102926102b53660046128c3565b6108e3565b6102c261095c565b6040516102419190613518565b6102926102dd366004612a74565b610962565b6102926102f0366004612d32565b610c43565b61029261030336600461290f565b610e4e565b610272610e86565b6102c261031e3660046129f9565b610e95565b610336610331366004612bf7565b610ee7565b60405161024193929190612edd565b6102926103533660046129f9565b610f10565b61029261036636600461290f565b610f4d565b61037e610379366004612bf7565b610f68565b60405161024193929190612f3a565b6102c261039b366004612bf7565b611104565b6102926103ae366004612cb5565b61115f565b6102726103c1366004612bf7565b611405565b6102926103d43660046128c3565b61143a565b6102c26103e73660046128c3565b61148d565b6102926103fa3660046128c3565b6114d1565b610252611522565b6102926104153660046129c3565b611531565b610234610428366004612a22565b6115ff565b61029261043b36600461294a565b61167b565b61029261044e366004612c27565b6116ba565b6102926104613660046128c3565b611913565b610252610474366004612bf7565b611964565b61025261199e565b61029261048f366004612c4b565b6119d5565b6102926104a2366004612aec565b611c56565b610272611ccc565b610252611cdb565b6102346104c53660046128dd565b611cfb565b610272611d29565b60006104dd82611d38565b90505b919050565b6060600080546104f4906135de565b80601f0160208091040260200160405190810160405280929190818152602001828054610520906135de565b801561056d5780601f106105425761010080835404028352916020019161056d565b820191906000526020600020905b81548152906001019060200180831161055057829003601f168201915b5050505050905090565b600061058282611d5d565b6105a75760405162461bcd60e51b815260040161059e906132f5565b60405180910390fd5b506000908152600460205260409020546001600160a01b031690565b60006105ce82611405565b9050806001600160a01b0316836001600160a01b031614156106025760405162461bcd60e51b815260040161059e9061338a565b806001600160a01b0316610614611d7a565b6001600160a01b031614806106305750610630816104c5611d7a565b61064c5760405162461bcd60e51b815260040161059e906131a1565b6106568383611d7e565b505050565b801561085e57600c546001600160a01b03166323b872dd323061067f600286613587565b6040518463ffffffff1660e01b815260040161069d93929190612e63565b602060405180830381600087803b1580156106b757600080fd5b505af11580156106cb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106ef9190612ba3565b50600c54600a546001600160a01b03918216916323b872dd91329116610716600286613587565b6040518463ffffffff1660e01b815260040161073493929190612e63565b602060405180830381600087803b15801561074e57600080fd5b505af1158015610762573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107869190612ba3565b50600c546040516370a0823160e01b81526001600160a01b03909116906342966c689082906370a08231906107bf903090600401612e4f565b60206040518083038186803b1580156107d757600080fd5b505afa1580156107eb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061080f9190612c0f565b6040518263ffffffff1660e01b815260040161082b9190613518565b600060405180830381600087803b15801561084557600080fd5b505af1158015610859573d6000803e3d6000fd5b505050505b60006040518060600160405280336001600160a01b031681526020018381526020014281525090506000600e6000815461089790613619565b91829055506000908152600d6020908152604091829020845181546001600160a01b0319166001600160a01b039091161781559084015160018201559201516002909201919091555050565b3360009081526010602052604090205460ff166109125760405162461bcd60e51b815260040161059e90613468565b336001600160a01b038216141561093b5760405162461bcd60e51b815260040161059e90613468565b6001600160a01b03166000908152601060205260409020805460ff19169055565b60085490565b60008481526011602052604090205460ff161561097e57600080fd5b6000848152601160205260408120805460ff19166001179055878782816109b557634e487b7160e01b600052603260045260246000fd5b9050602002013590506000600190505b87811015610a0b578888828181106109ed57634e487b7160e01b600052603260045260246000fd5b90506020020135821891508080610a0390613619565b9150506109c5565b506000610a48600133848a8a30604051602001610a2d96959493929190612e0e565b60405160208183030381529060405280519060200120611dec565b90506010600060018388888860405160008152602001604052604051610a719493929190612f09565b6020604051602081039080840390855afa158015610a93573d6000803e3d6000fd5b505060408051601f1901516001600160a01b03168352602083019390935250016000205460ff16610ad65760405162461bcd60e51b815260040161059e90613291565b8615610bea57600c54600a546001600160a01b03918216916323b872dd91329116610b0260028c613587565b610b0c908c61359b565b6040518463ffffffff1660e01b8152600401610b2a93929190612e63565b602060405180830381600087803b158015610b4457600080fd5b505af1158015610b58573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b7c9190612ba3565b50600c546001600160a01b03166379cc679032610b9a60028b613587565b6040518363ffffffff1660e01b8152600401610bb7929190612ec4565b600060405180830381600087803b158015610bd157600080fd5b505af1158015610be5573d6000803e3d6000fd5b505050505b60005b88811015610c3757610c25338b8b84818110610c1957634e487b7160e01b600052603260045260246000fd5b90506020020135611e1c565b80610c2f81613619565b915050610bed565b50505050505050505050565b60008481526011602052604090205460ff1615610c5f57600080fd5b6000848152601160209081526040808320805460ff191660019081179091559051610c9992610a2d929133918c918c918c91309101612e0e565b90506010600060018387878760405160008152602001604052604051610cc29493929190612f09565b6020604051602081039080840390855afa158015610ce4573d6000803e3d6000fd5b505060408051601f1901516001600160a01b03168352602083019390935250016000205460ff16610d275760405162461bcd60e51b815260040161059e90613291565b8515610e3b57600c54600a546001600160a01b03918216916323b872dd91329116610d5360028b613587565b610d5d908b61359b565b6040518463ffffffff1660e01b8152600401610d7b93929190612e63565b602060405180830381600087803b158015610d9557600080fd5b505af1158015610da9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dcd9190612ba3565b50600c546001600160a01b03166379cc679032610deb60028a613587565b6040518363ffffffff1660e01b8152600401610e08929190612ec4565b600060405180830381600087803b158015610e2257600080fd5b505af1158015610e36573d6000803e3d6000fd5b505050505b610e453388611e1c565b50505050505050565b610e5f610e59611d7a565b82611efb565b610e7b5760405162461bcd60e51b815260040161059e906133cb565b610656838383611f80565b600b546001600160a01b031690565b6000610ea08361148d565b8210610ebe5760405162461bcd60e51b815260040161059e90613006565b506001600160a01b03919091166000908152600660209081526040808320938352929052205490565b6000908152600d60205260409020805460018201546002909201546001600160a01b0390911692565b3360009081526010602052604090205460ff16610f3f5760405162461bcd60e51b815260040161059e906134d6565b610f498282611e1c565b5050565b6106568383836040518060200160405280600081525061167b565b606080610f73612607565b6000848152600f6020526040808220815160608101909252805482908290610f9a906135de565b80601f0160208091040260200160405190810160405280929190818152602001828054610fc6906135de565b80156110135780601f10610fe857610100808354040283529160200191611013565b820191906000526020600020905b815481529060010190602001808311610ff657829003601f168201915b5050505050815260200160018201805461102c906135de565b80601f0160208091040260200160405190810160405280929190818152602001828054611058906135de565b80156110a55780601f1061107a576101008083540402835291602001916110a5565b820191906000526020600020905b81548152906001019060200180831161108857829003601f168201915b505050918352505060408051610c8081019182905260209092019190600284019060649082845b8154815260200190600101908083116110cc575050509190925250508151602083015160409093015190989297509550909350505050565b600061110e61095c565b821061112c5760405162461bcd60e51b815260040161059e9061341c565b6008828154811061114d57634e487b7160e01b600052603260045260246000fd5b90600052602060002001549050919050565b3361116985611405565b6001600160a01b03161461118f5760405162461bcd60e51b815260040161059e90612f98565b600b546001600160a01b0316331461139b57600c546040516323b872dd60e01b81526001600160a01b03909116906323b872dd906111dd9032903090670de0b6b3a764000090600401612e63565b602060405180830381600087803b1580156111f757600080fd5b505af115801561120b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061122f9190612ba3565b50600c54600a546040516323b872dd60e01b81526001600160a01b03928316926323b872dd9261127192329290911690670de0b6b3a764000090600401612e63565b602060405180830381600087803b15801561128b57600080fd5b505af115801561129f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112c39190612ba3565b50600c546040516370a0823160e01b81526001600160a01b03909116906342966c689082906370a08231906112fc903090600401612e4f565b60206040518083038186803b15801561131457600080fd5b505afa158015611328573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061134c9190612c0f565b6040518263ffffffff1660e01b81526004016113689190613518565b600060405180830381600087803b15801561138257600080fd5b505af1158015611396573d6000803e3d6000fd5b505050505b6000848152600f6020908152604090912084516113ba92860190612626565b506000848152600f6020908152604090912083516113e092600190920191850190612626565b506000848152600f602052604090206113fe906002018260646126aa565b5050505050565b6000818152600260205260408120546001600160a01b0316806104dd5760405162461bcd60e51b815260040161059e90613248565b3360009081526010602052604090205460ff166114695760405162461bcd60e51b815260040161059e90613468565b6001600160a01b03166000908152601060205260409020805460ff19166001179055565b60006001600160a01b0382166114b55760405162461bcd60e51b815260040161059e906131fe565b506001600160a01b031660009081526003602052604090205490565b3360009081526010602052604090205460ff166115005760405162461bcd60e51b815260040161059e90612fcf565b600b80546001600160a01b0319166001600160a01b0392909216919091179055565b6060600180546104f4906135de565b611539611d7a565b6001600160a01b0316826001600160a01b0316141561156a5760405162461bcd60e51b815260040161059e9061311e565b8060056000611577611d7a565b6001600160a01b03908116825260208083019390935260409182016000908120918716808252919093529120805460ff1916921515929092179091556115bb611d7a565b6001600160a01b03167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31836040516115f39190612efe565b60405180910390a35050565b6000805b8381101561166e57826001600160a01b031661164486868481811061163857634e487b7160e01b600052603260045260246000fd5b90506020020135611405565b6001600160a01b03161461165c576000915050611674565b8061166681613619565b915050611603565b50600190505b9392505050565b61168c611686611d7a565b83611efb565b6116a85760405162461bcd60e51b815260040161059e906133cb565b6116b4848484846120ad565b50505050565b336116c483611405565b6001600160a01b0316146116ea5760405162461bcd60e51b815260040161059e90612f98565b600b546001600160a01b031633146118f657600c546040516323b872dd60e01b81526001600160a01b03909116906323b872dd9061173890329030906706f05b59d3b2000090600401612e63565b602060405180830381600087803b15801561175257600080fd5b505af1158015611766573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061178a9190612ba3565b50600c54600a546040516323b872dd60e01b81526001600160a01b03928316926323b872dd926117cc923292909116906706f05b59d3b2000090600401612e63565b602060405180830381600087803b1580156117e657600080fd5b505af11580156117fa573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061181e9190612ba3565b50600c546040516370a0823160e01b81526001600160a01b03909116906342966c689082906370a0823190611857903090600401612e4f565b60206040518083038186803b15801561186f57600080fd5b505afa158015611883573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118a79190612c0f565b6040518263ffffffff1660e01b81526004016118c39190613518565b600060405180830381600087803b1580156118dd57600080fd5b505af11580156118f1573d6000803e3d6000fd5b505050505b6000828152600f60205260409020610656906002018260646126aa565b3360009081526010602052604090205460ff166119425760405162461bcd60e51b815260040161059e9061349f565b600a80546001600160a01b0319166001600160a01b0392909216919091179055565b606061196e61199e565b611977836120e0565b604051602001611988929190612dae565b6040516020818303038152906040529050919050565b60408051808201909152601d81527f68747470733a2f2f316d6c6e6e6674732e636f6d2f6170692f6e66742f000000602082015290565b336119df84611405565b6001600160a01b031614611a055760405162461bcd60e51b815260040161059e90612f98565b600b546001600160a01b03163314611c1157600c546040516323b872dd60e01b81526001600160a01b03909116906323b872dd90611a5390329030906706f05b59d3b2000090600401612e63565b602060405180830381600087803b158015611a6d57600080fd5b505af1158015611a81573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611aa59190612ba3565b50600c54600a546040516323b872dd60e01b81526001600160a01b03928316926323b872dd92611ae7923292909116906706f05b59d3b2000090600401612e63565b602060405180830381600087803b158015611b0157600080fd5b505af1158015611b15573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b399190612ba3565b50600c546040516370a0823160e01b81526001600160a01b03909116906342966c689082906370a0823190611b72903090600401612e4f565b60206040518083038186803b158015611b8a57600080fd5b505afa158015611b9e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611bc29190612c0f565b6040518263ffffffff1660e01b8152600401611bde9190613518565b600060405180830381600087803b158015611bf857600080fd5b505af1158015611c0c573d6000803e3d6000fd5b505050505b6000838152600f602090815260409091208351611c3092850190612626565b506000838152600f6020908152604090912082516116b492600190920191840190612626565b60005b825181101561065657611cba838281518110611c8557634e487b7160e01b600052603260045260246000fd5b6020026020010151838381518110611cad57634e487b7160e01b600052603260045260246000fd5b60200260200101516116ba565b80611cc481613619565b915050611c59565b600c546001600160a01b031690565b60606040518060600160405280602581526020016136b260259139905090565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b600a546001600160a01b031690565b60006001600160e01b0319821663780e9d6360e01b14806104dd57506104dd826121fb565b6000908152600260205260409020546001600160a01b0316151590565b3390565b600081815260046020526040902080546001600160a01b0319166001600160a01b0384169081179091558190611db382611405565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b600081604051602001611dff9190612ddd565b604051602081830303815290604052805190602001209050919050565b6001600160a01b038216611e425760405162461bcd60e51b815260040161059e906132c0565b611e4b81611d5d565b15611e685760405162461bcd60e51b815260040161059e906130a3565b611e746000838361223b565b6001600160a01b0382166000908152600360205260408120805460019290611e9d90849061356f565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6000611f0682611d5d565b611f225760405162461bcd60e51b815260040161059e90613155565b6000611f2d83611405565b9050806001600160a01b0316846001600160a01b03161480611f685750836001600160a01b0316611f5d84610577565b6001600160a01b0316145b80611f785750611f788185611cfb565b949350505050565b826001600160a01b0316611f9382611405565b6001600160a01b031614611fb95760405162461bcd60e51b815260040161059e90613341565b6001600160a01b038216611fdf5760405162461bcd60e51b815260040161059e906130da565b611fea83838361223b565b611ff5600082611d7e565b6001600160a01b038316600090815260036020526040812080546001929061201e90849061359b565b90915550506001600160a01b038216600090815260036020526040812080546001929061204c90849061356f565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b6120b8848484611f80565b6120c484848484612246565b6116b45760405162461bcd60e51b815260040161059e90613051565b60608161210557506040805180820190915260018152600360fc1b60208201526104e0565b8160005b811561212f578061211981613619565b91506121289050600a83613587565b9150612109565b60008167ffffffffffffffff81111561215857634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015612182576020820181803683370190505b5090505b8415611f785761219760018361359b565b91506121a4600a86613634565b6121af90603061356f565b60f81b8183815181106121d257634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a9053506121f4600a86613587565b9450612186565b60006001600160e01b031982166380ac58cd60e01b148061222c57506001600160e01b03198216635b5e139f60e01b145b806104dd57506104dd82612361565b61065683838361237a565b600061225a846001600160a01b0316612403565b1561235657836001600160a01b031663150b7a02612276611d7a565b8786866040518563ffffffff1660e01b81526004016122989493929190612e87565b602060405180830381600087803b1580156122b257600080fd5b505af19250505080156122e2575060408051601f3d908101601f191682019092526122df91810190612bdb565b60015b61233c573d808015612310576040519150601f19603f3d011682016040523d82523d6000602084013e612315565b606091505b5080516123345760405162461bcd60e51b815260040161059e90613051565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050611f78565b506001949350505050565b6001600160e01b031981166301ffc9a760e01b14919050565b612385838383610656565b6001600160a01b0383166123a15761239c81612409565b6123c4565b816001600160a01b0316836001600160a01b0316146123c4576123c4838261244d565b6001600160a01b0382166123e0576123db816124ea565b610656565b826001600160a01b0316826001600160a01b0316146106565761065682826125c3565b3b151590565b600880546000838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b6000600161245a8461148d565b612464919061359b565b6000838152600760205260409020549091508082146124b7576001600160a01b03841660009081526006602090815260408083208584528252808320548484528184208190558352600790915290208190555b5060009182526007602090815260408084208490556001600160a01b039094168352600681528383209183525290812055565b6008546000906124fc9060019061359b565b6000838152600960205260408120546008805493945090928490811061253257634e487b7160e01b600052603260045260246000fd5b90600052602060002001549050806008838154811061256157634e487b7160e01b600052603260045260246000fd5b60009182526020808320909101929092558281526009909152604080822084905585825281205560088054806125a757634e487b7160e01b600052603160045260246000fd5b6001900381819060005260206000200160009055905550505050565b60006125ce8361148d565b6001600160a01b039093166000908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b60405180610c8001604052806064906020820280368337509192915050565b828054612632906135de565b90600052602060002090601f016020900481019282612654576000855561269a565b82601f1061266d57805160ff191683800117855561269a565b8280016001018555821561269a579182015b8281111561269a57825182559160200191906001019061267f565b506126a69291506126d7565b5090565b826064810192821561269a579160200282018281111561269a57825182559160200191906001019061267f565b5b808211156126a657600081556001016126d8565b600067ffffffffffffffff83111561270657612706613674565b612719601f8401601f1916602001613521565b905082815283838301111561272d57600080fd5b828260208301376000602084830101529392505050565b80356001600160a01b03811681146104e057600080fd5b600082601f83011261276b578081fd5b8135602061278061277b8361354b565b613521565b82815281810190858301610c808086028801850189101561279f578687fd5b865b868110156127c5576127b38a846127d3565b855293850193918101916001016127a1565b509198975050505050505050565b600082601f8301126127e3578081fd5b604051610c8080820182811067ffffffffffffffff8211171561280857612808613674565b604052818482810187101561281b578485fd5b8492505b606483101561283f5780358252600192909201916020918201910161281f565b509195945050505050565b60008083601f84011261285b578182fd5b50813567ffffffffffffffff811115612872578182fd5b602083019150836020808302850101111561288c57600080fd5b9250929050565b600082601f8301126128a3578081fd5b611674838335602085016126ec565b803560ff811681146104e057600080fd5b6000602082840312156128d4578081fd5b61167482612744565b600080604083850312156128ef578081fd5b6128f883612744565b915061290660208401612744565b90509250929050565b600080600060608486031215612923578081fd5b61292c84612744565b925061293a60208501612744565b9150604084013590509250925092565b6000806000806080858703121561295f578081fd5b61296885612744565b935061297660208601612744565b925060408501359150606085013567ffffffffffffffff811115612998578182fd5b8501601f810187136129a8578182fd5b6129b7878235602084016126ec565b91505092959194509250565b600080604083850312156129d5578182fd5b6129de83612744565b915060208301356129ee8161368a565b809150509250929050565b60008060408385031215612a0b578182fd5b612a1483612744565b946020939093013593505050565b600080600060408486031215612a36578081fd5b833567ffffffffffffffff811115612a4c578182fd5b612a588682870161284a565b9094509250612a6b905060208501612744565b90509250925092565b600080600080600080600060c0888a031215612a8e578485fd5b873567ffffffffffffffff811115612aa4578586fd5b612ab08a828b0161284a565b9098509650506020880135945060408801359350612ad0606089016128b2565b92506080880135915060a0880135905092959891949750929550565b60008060408385031215612afe578182fd5b823567ffffffffffffffff80821115612b15578384fd5b818501915085601f830112612b28578384fd5b81356020612b3861277b8361354b565b82815281810190858301838502870184018b1015612b54578889fd5b8896505b84871015612b76578035835260019690960195918301918301612b58565b5096505086013592505080821115612b8c578283fd5b50612b998582860161275b565b9150509250929050565b600060208284031215612bb4578081fd5b81516116748161368a565b600060208284031215612bd0578081fd5b81356116748161369b565b600060208284031215612bec578081fd5b81516116748161369b565b600060208284031215612c08578081fd5b5035919050565b600060208284031215612c20578081fd5b5051919050565b600080610ca08385031215612c3a578182fd5b8235915061290684602085016127d3565b600080600060608486031215612c5f578081fd5b83359250602084013567ffffffffffffffff80821115612c7d578283fd5b612c8987838801612893565b93506040860135915080821115612c9e578283fd5b50612cab86828701612893565b9150509250925092565b600080600080610ce08587031215612ccb578182fd5b84359350602085013567ffffffffffffffff80821115612ce9578384fd5b612cf588838901612893565b94506040870135915080821115612d0a578384fd5b50612d1787828801612893565b925050612d2786606087016127d3565b905092959194509250565b60008060008060008060c08789031215612d4a578384fd5b863595506020870135945060408701359350612d68606088016128b2565b92506080870135915060a087013590509295509295509295565b60008151808452612d9a8160208601602086016135b2565b601f01601f19169290920160200192915050565b60008351612dc08184602088016135b2565b835190830190612dd48183602088016135b2565b01949350505050565b7f19457468657265756d205369676e6564204d6573736167653a0a3332000000008152601c810191909152603c0190565b9586526bffffffffffffffffffffffff19606095861b8116602088015260348701949094526054860192909252607485015290911b16609482015260a80190565b6001600160a01b0391909116815260200190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090612eba90830184612d82565b9695505050505050565b6001600160a01b03929092168252602082015260400190565b6001600160a01b039390931683526020830191909152604082015260600190565b901515815260200190565b93845260ff9290921660208401526040830152606082015260800190565b6000602082526116746020830184612d82565b6000610cc0808352612f4e81840187612d82565b9050602083820381850152612f638287612d82565b92506040840191508460005b6064811015612f8c57815184529282019290820190600101612f6f565b50505050949350505050565b6020808252601e908201527f54696c653a206f6e6c79206f776e65722063616e207361766520496e666f0000604082015260600190565b6020808252601a908201527f4f6e6c79204f776e65722063616e206368616e67652046726565000000000000604082015260600190565b6020808252602b908201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560408201526a74206f6620626f756e647360a81b606082015260800190565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6020808252601c908201527f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000604082015260600190565b60208082526024908201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646040820152637265737360e01b606082015260800190565b60208082526019908201527f4552433732313a20617070726f766520746f2063616c6c657200000000000000604082015260600190565b6020808252602c908201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860408201526b34b9ba32b73a103a37b5b2b760a11b606082015260800190565b60208082526038908201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760408201527f6e6572206e6f7220617070726f76656420666f7220616c6c0000000000000000606082015260800190565b6020808252602a908201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604082015269726f206164647265737360b01b606082015260800190565b60208082526029908201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460408201526832b73a103a37b5b2b760b91b606082015260800190565b6020808252601590820152742a34b6329d1039b4b3b730ba3ab9329032b93937b960591b604082015260600190565b6020808252818101527f4552433732313a206d696e7420746f20746865207a65726f2061646472657373604082015260600190565b6020808252602c908201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860408201526b34b9ba32b73a103a37b5b2b760a11b606082015260800190565b60208082526029908201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960408201526839903737ba1037bbb760b91b606082015260800190565b60208082526021908201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656040820152603960f91b606082015260800190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b6020808252602c908201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60408201526b7574206f6620626f756e647360a01b606082015260800190565b6020808252601f908201527f54696c653a204f6e6c79206f776e65722063616e20616464206f776e65727300604082015260600190565b6020808252601e908201527f4f6e6c79204f776e65722063616e206368616e6765204d6f6e6579426f780000604082015260600190565b60208082526022908201527f54696c653a206d75737420686176652061646d696e20726f6c6520746f206d696040820152611b9d60f21b606082015260800190565b90815260200190565b60405181810167ffffffffffffffff8111828210171561354357613543613674565b604052919050565b600067ffffffffffffffff82111561356557613565613674565b5060209081020190565b6000821982111561358257613582613648565b500190565b6000826135965761359661365e565b500490565b6000828210156135ad576135ad613648565b500390565b60005b838110156135cd5781810151838201526020016135b5565b838111156116b45750506000910152565b6002810460018216806135f257607f821691505b6020821081141561361357634e487b7160e01b600052602260045260246000fd5b50919050565b600060001982141561362d5761362d613648565b5060010190565b6000826136435761364361365e565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b801515811461369857600080fd5b50565b6001600160e01b03198116811461369857600080fdfe68747470733a2f2f316d6c6e6e6674732e636f6d2f6170692f70726f6a6563742d696e666fa26469706673582212208e8a6917ca00ade334e3acdc406b2ebc30470cc857e716d79fd00d0ab0bc1e0664736f6c63430008000033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000a4ef4b0b23c1fc81d3f9ecf93510e64f58a4a016
-----Decoded View---------------
Arg [0] : _mil (address): 0xa4eF4b0B23C1fc81d3f9ecF93510e64f58A4A016
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000a4ef4b0b23c1fc81d3f9ecf93510e64f58a4a016
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.