Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 5,327 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Mint | 15729031 | 803 days ago | IN | 0 ETH | 0.0012606 | ||||
Mint | 15273170 | 872 days ago | IN | 0 ETH | 0.00046499 | ||||
Mint | 15140741 | 893 days ago | IN | 0 ETH | 0.00085749 | ||||
Mint | 15140741 | 893 days ago | IN | 0 ETH | 0.00056481 | ||||
Mint | 15140740 | 893 days ago | IN | 0 ETH | 0.00053783 | ||||
Mint | 15075933 | 903 days ago | IN | 0 ETH | 0.00146533 | ||||
Mint | 15068935 | 904 days ago | IN | 0 ETH | 0.00029747 | ||||
Mint | 15068779 | 904 days ago | IN | 0 ETH | 0.00058059 | ||||
Mint | 15064197 | 905 days ago | IN | 0 ETH | 0.00106374 | ||||
Mint | 15063822 | 905 days ago | IN | 0 ETH | 0.00121934 | ||||
Mint | 15022030 | 912 days ago | IN | 0 ETH | 0.001303 | ||||
Mint | 15022030 | 912 days ago | IN | 0 ETH | 0.001303 | ||||
Mint | 15022028 | 912 days ago | IN | 0 ETH | 0.001303 | ||||
Mint | 15022028 | 912 days ago | IN | 0 ETH | 0.00127042 | ||||
Mint | 15022028 | 912 days ago | IN | 0 ETH | 0.00127042 | ||||
Mint | 15022028 | 912 days ago | IN | 0 ETH | 0.00127042 | ||||
Mint | 15022027 | 912 days ago | IN | 0 ETH | 0.00127042 | ||||
Mint | 15022027 | 912 days ago | IN | 0 ETH | 0.00127042 | ||||
Mint | 15022027 | 912 days ago | IN | 0 ETH | 0.001303 | ||||
Mint | 15022027 | 912 days ago | IN | 0 ETH | 0.00127042 | ||||
Mint | 15022027 | 912 days ago | IN | 0 ETH | 0.00127042 | ||||
Mint | 14990922 | 918 days ago | IN | 0 ETH | 0.00073209 | ||||
Mint | 14982868 | 919 days ago | IN | 0 ETH | 0.00082236 | ||||
Mint | 14982868 | 919 days ago | IN | 0 ETH | 0.00083572 | ||||
Mint | 14982868 | 919 days ago | IN | 0 ETH | 0.00083572 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Name:
ROTLMint
Compiler Version
v0.8.7+commit.e28d00a7
Contract Source Code (Solidity Multiple files format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "./SafeMath.sol"; import "./MerkleProof.sol"; import "./Ownable.sol"; import "./ROTL.sol"; import "./Pausable.sol"; contract ROTLMint is Ownable, Pausable { using SafeMath for uint256; struct Round { uint256 _price; uint256 _maxCount; uint256 _onceMaxCount; uint256 _addressMaxCount; uint256 _startBlock; bytes32 _merkleRoot; mapping (address => uint256) _minted; } event SetAddress(address nft); event SetRound(uint256 round); event SetRoundInfo( uint256 round, uint256 price, uint256 maxCount, uint256 onceMaxCount, uint256 addressMaxCount, uint256 startBlock, bytes32 merkleRoot ); ROTL private _nft; uint256 private _currentRound; mapping (uint256 => Round) private _round; function setAddress(address nft) external onlyOwner { _nft = ROTL(nft); emit SetAddress(nft); } function setRound( uint256 round ) external onlyOwner { _currentRound = round; emit SetRound(round); } function setRoundInfo( uint256 round, uint256 price, uint256 maxCount, uint256 onceMaxCount, uint256 addressMaxCount, uint256 startBlock, bytes32 merkleRoot ) external onlyOwner { Round storage v = _round[round]; v._price = price; v._maxCount = maxCount; v._onceMaxCount = onceMaxCount; v._addressMaxCount = addressMaxCount; v._startBlock = startBlock; v._merkleRoot = merkleRoot; emit SetRoundInfo(round, price, maxCount, onceMaxCount, addressMaxCount, startBlock, merkleRoot); } function pause() external onlyOwner { _pause(); } function unpause() external onlyOwner { _unpause(); } function isEnable() external view returns (bool) { return __isEnable(); } function __isEnable() internal view returns (bool) { return 0 < __getRemainCount() && !paused(); } function getRemainCount() external view returns (uint256) { return __getRemainCount(); } function __getRemainCount() internal view returns (uint256) { uint256 supply = _nft.totalSupply(); Round storage info = __getCurrentRoundInfo(); if (info._maxCount < supply) return 0; return info._maxCount.sub(supply); } function getCurrentRoundInfo() external view returns (uint256, uint256, uint256, uint256, uint256) { Round storage info = __getCurrentRoundInfo(); return (info._price, info._maxCount, info._onceMaxCount, info._addressMaxCount, info._startBlock); } function __getCurrentRoundInfo() internal view returns (Round storage) { return _round[_currentRound]; } function getCurrentRound() external view returns (uint256) { return _currentRound; } function getMintedCount(uint256 round, address target) external view returns (uint256) { return _round[round]._minted[target]; } function mint(uint256 round, uint256 count, bytes32[] calldata merkleProof) external payable whenNotPaused { // check round require (_currentRound == round, "require _currentRound == round"); Round storage info = __getCurrentRoundInfo(); // check price require (msg.value == info._price * count, "require msg.value == price * count"); // check block require (info._startBlock <= block.number, "require info._startBlock <= block.number"); // check merkle root if (info._merkleRoot != "") { bytes32 leaf = keccak256(abi.encodePacked(msg.sender)); require (MerkleProof.verify(merkleProof, info._merkleRoot, leaf), "invalid merkle proof"); } // check address max count. if (0 < info._addressMaxCount) { info._minted[msg.sender] = info._minted[msg.sender].add(count); require (info._minted[msg.sender] <= info._addressMaxCount, "over address max count"); } // mint __mint(info, count); } function __mint(Round storage info, uint256 count) internal { require (__isEnable() == true, "disable contract"); require (0 < count, "require 0 < count"); require (count <= info._onceMaxCount, "require count <= _onceMaxCount"); require (count <= __getRemainCount(), "require count <= __getRemainCount()"); _nft.mint(1, msg.sender, count); } function withdraw(address payable to, uint256 value) external onlyOwner { to.transfer(value); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (access/AccessControl.sol) pragma solidity ^0.8.0; import "./IAccessControl.sol"; import "./Context.sol"; import "./Strings.sol"; import "./ERC165.sol"; /** * @dev Contract module that allows children to implement role-based access * control mechanisms. This is a lightweight version that doesn't allow enumerating role * members except through off-chain means by accessing the contract event logs. Some * applications may benefit from on-chain enumerability, for those cases see * {AccessControlEnumerable}. * * Roles are referred to by their `bytes32` identifier. These should be exposed * in the external API and be unique. The best way to achieve this is by * using `public constant` hash digests: * * ``` * bytes32 public constant MY_ROLE = keccak256("MY_ROLE"); * ``` * * Roles can be used to represent a set of permissions. To restrict access to a * function call, use {hasRole}: * * ``` * function foo() public { * require(hasRole(MY_ROLE, msg.sender)); * ... * } * ``` * * Roles can be granted and revoked dynamically via the {grantRole} and * {revokeRole} functions. Each role has an associated admin role, and only * accounts that have a role's admin role can call {grantRole} and {revokeRole}. * * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means * that only accounts with this role will be able to grant or revoke other * roles. More complex role relationships can be created by using * {_setRoleAdmin}. * * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to * grant and revoke this role. Extra precautions should be taken to secure * accounts that have been granted it. */ abstract contract AccessControl is Context, IAccessControl, ERC165 { struct RoleData { mapping(address => bool) members; bytes32 adminRole; } mapping(bytes32 => RoleData) private _roles; bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /** * @dev Modifier that checks that an account has a specific role. Reverts * with a standardized message including the required role. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ * * _Available since v4.1._ */ modifier onlyRole(bytes32 role) { _checkRole(role); _; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) public view virtual override returns (bool) { return _roles[role].members[account]; } /** * @dev Revert with a standard message if `_msgSender()` is missing `role`. * Overriding this function changes the behavior of the {onlyRole} modifier. * * Format of the revert message is described in {_checkRole}. * * _Available since v4.6._ */ function _checkRole(bytes32 role) internal view virtual { _checkRole(role, _msgSender()); } /** * @dev Revert with a standard message if `account` is missing `role`. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ */ function _checkRole(bytes32 role, address account) internal view virtual { if (!hasRole(role, account)) { revert( string( abi.encodePacked( "AccessControl: account ", Strings.toHexString(uint160(account), 20), " is missing role ", Strings.toHexString(uint256(role), 32) ) ) ); } } /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) { return _roles[role].adminRole; } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. */ 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 revoked `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}. * ==== * * NOTE: This function is deprecated in favor of {_grantRole}. */ function _setupRole(bytes32 role, address account) internal virtual { _grantRole(role, account); } /** * @dev Sets `adminRole` as ``role``'s admin role. * * Emits a {RoleAdminChanged} event. */ function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual { bytes32 previousAdminRole = getRoleAdmin(role); _roles[role].adminRole = adminRole; emit RoleAdminChanged(role, previousAdminRole, adminRole); } /** * @dev Grants `role` to `account`. * * Internal function without access restriction. */ function _grantRole(bytes32 role, address account) internal virtual { if (!hasRole(role, account)) { _roles[role].members[account] = true; emit RoleGranted(role, account, _msgSender()); } } /** * @dev Revokes `role` from `account`. * * Internal function without access restriction. */ function _revokeRole(bytes32 role, address account) internal virtual { if (hasRole(role, account)) { _roles[role].members[account] = false; emit RoleRevoked(role, account, _msgSender()); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (access/AccessControlEnumerable.sol) pragma solidity ^0.8.0; import "./IAccessControlEnumerable.sol"; import "./AccessControl.sol"; import "./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 virtual 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 virtual override returns (uint256) { return _roleMembers[role].length(); } /** * @dev Overload {_grantRole} to track enumerable memberships */ function _grantRole(bytes32 role, address account) internal virtual override { super._grantRole(role, account); _roleMembers[role].add(account); } /** * @dev Overload {_revokeRole} to track enumerable memberships */ function _revokeRole(bytes32 role, address account) internal virtual override { super._revokeRole(role, account); _roleMembers[role].remove(account); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (utils/structs/EnumerableSet.sol) 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: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; import "./IERC165.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT // ERC721A Contracts v3.3.0 // Creator: Chiru Labs pragma solidity ^0.8.4; import './IERC721A.sol'; /** * @dev ERC721 token receiver interface. */ interface ERC721A__IERC721Receiver { function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); } /** * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including * the Metadata extension. Built to optimize for lower gas during batch mints. * * Assumes serials are sequentially minted starting at _startTokenId() (defaults to 0, e.g. 0, 1, 2, 3..). * * Assumes that an owner cannot have more than 2**64 - 1 (max value of uint64) of supply. * * Assumes that the maximum token id cannot exceed 2**256 - 1 (max value of uint256). */ contract ERC721A is IERC721A { // The tokenId of the next token to be minted. uint256 internal _currentIndex; // The number of tokens burned. uint256 internal _burnCounter; // Token name string private _name; // Token symbol string private _symbol; // Mapping from token ID to ownership details // An empty struct value does not necessarily mean the token is unowned. See _ownershipOf implementation for details. mapping(uint256 => TokenOwnership) internal _ownerships; // Mapping owner address to address data mapping(address => AddressData) private _addressData; // 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; constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; _currentIndex = _startTokenId(); } /** * To change the starting tokenId, please override this function. */ function _startTokenId() internal view virtual returns (uint256) { return 0; } /** * @dev Burned tokens are calculated here, use _totalMinted() if you want to count just minted tokens. */ function totalSupply() public view override returns (uint256) { // Counter underflow is impossible as _burnCounter cannot be incremented // more than _currentIndex - _startTokenId() times unchecked { return _currentIndex - _burnCounter - _startTokenId(); } } /** * Returns the total amount of tokens minted in the contract. */ function _totalMinted() internal view returns (uint256) { // Counter underflow is impossible as _currentIndex does not decrement, // and it is initialized to _startTokenId() unchecked { return _currentIndex - _startTokenId(); } } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { // The interface IDs are constants representing the first 4 bytes of the XOR of // all function selectors in the interface. See: https://eips.ethereum.org/EIPS/eip-165 // e.g. `bytes4(i.functionA.selector ^ i.functionB.selector ^ ...)` return interfaceId == 0x01ffc9a7 || // ERC165 interface ID for ERC165. interfaceId == 0x80ac58cd || // ERC165 interface ID for ERC721. interfaceId == 0x5b5e139f; // ERC165 interface ID for ERC721Metadata. } /** * @dev See {IERC721-balanceOf}. */ function balanceOf(address owner) public view override returns (uint256) { if (owner == address(0)) revert BalanceQueryForZeroAddress(); return uint256(_addressData[owner].balance); } /** * Returns the number of tokens minted by `owner`. */ function _numberMinted(address owner) internal view returns (uint256) { return uint256(_addressData[owner].numberMinted); } /** * Returns the number of tokens burned by or on behalf of `owner`. */ function _numberBurned(address owner) internal view returns (uint256) { return uint256(_addressData[owner].numberBurned); } /** * Returns the auxillary data for `owner`. (e.g. number of whitelist mint slots used). */ function _getAux(address owner) internal view returns (uint64) { return _addressData[owner].aux; } /** * Sets the auxillary data for `owner`. (e.g. number of whitelist mint slots used). * If there are multiple variables, please pack them into a uint64. */ function _setAux(address owner, uint64 aux) internal { _addressData[owner].aux = aux; } /** * Gas spent here starts off proportional to the maximum mint batch size. * It gradually moves to O(1) as tokens get transferred around in the collection over time. */ function _ownershipOf(uint256 tokenId) internal view returns (TokenOwnership memory) { uint256 curr = tokenId; unchecked { if (_startTokenId() <= curr) if (curr < _currentIndex) { TokenOwnership memory ownership = _ownerships[curr]; if (!ownership.burned) { if (ownership.addr != address(0)) { return ownership; } // Invariant: // There will always be an ownership that has an address and is not burned // before an ownership that does not have an address and is not burned. // Hence, curr will not underflow. while (true) { curr--; ownership = _ownerships[curr]; if (ownership.addr != address(0)) { return ownership; } } } } } revert OwnerQueryForNonexistentToken(); } /** * @dev See {IERC721-ownerOf}. */ function ownerOf(uint256 tokenId) public view override returns (address) { return _ownershipOf(tokenId).addr; } /** * @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) { if (!_exists(tokenId)) revert URIQueryForNonexistentToken(); string memory baseURI = _baseURI(); return bytes(baseURI).length != 0 ? string(abi.encodePacked(baseURI, _toString(tokenId))) : ''; } /** * @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 override { address owner = ERC721A.ownerOf(tokenId); if (to == owner) revert ApprovalToCurrentOwner(); if (_msgSenderERC721A() != owner) if(!isApprovedForAll(owner, _msgSenderERC721A())) { revert ApprovalCallerNotOwnerNorApproved(); } _tokenApprovals[tokenId] = to; emit Approval(owner, to, tokenId); } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view override returns (address) { if (!_exists(tokenId)) revert ApprovalQueryForNonexistentToken(); return _tokenApprovals[tokenId]; } /** * @dev See {IERC721-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { if (operator == _msgSenderERC721A()) revert ApproveToCaller(); _operatorApprovals[_msgSenderERC721A()][operator] = approved; emit ApprovalForAll(_msgSenderERC721A(), 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 { _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 { _transfer(from, to, tokenId); if (to.code.length != 0) if(!_checkContractOnERC721Received(from, to, tokenId, _data)) { revert TransferToNonERC721ReceiverImplementer(); } } /** * @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`), */ function _exists(uint256 tokenId) internal view returns (bool) { return _startTokenId() <= tokenId && tokenId < _currentIndex && !_ownerships[tokenId].burned; } /** * @dev Equivalent to `_safeMint(to, quantity, '')`. */ function _safeMint(address to, uint256 quantity) internal { _safeMint(to, quantity, ''); } /** * @dev Safely mints `quantity` tokens and transfers them to `to`. * * Requirements: * * - If `to` refers to a smart contract, it must implement * {IERC721Receiver-onERC721Received}, which is called for each safe transfer. * - `quantity` must be greater than 0. * * Emits a {Transfer} event. */ function _safeMint( address to, uint256 quantity, bytes memory _data ) internal { uint256 startTokenId = _currentIndex; if (to == address(0)) revert MintToZeroAddress(); if (quantity == 0) revert MintZeroQuantity(); _beforeTokenTransfers(address(0), to, startTokenId, quantity); // Overflows are incredibly unrealistic. // balance or numberMinted overflow if current value of either + quantity > 1.8e19 (2**64) - 1 // updatedIndex overflows if _currentIndex + quantity > 1.2e77 (2**256) - 1 unchecked { _addressData[to].balance += uint64(quantity); _addressData[to].numberMinted += uint64(quantity); _ownerships[startTokenId].addr = to; _ownerships[startTokenId].startTimestamp = uint64(block.timestamp); uint256 updatedIndex = startTokenId; uint256 end = updatedIndex + quantity; if (to.code.length != 0) { do { emit Transfer(address(0), to, updatedIndex); if (!_checkContractOnERC721Received(address(0), to, updatedIndex++, _data)) { revert TransferToNonERC721ReceiverImplementer(); } } while (updatedIndex < end); // Reentrancy protection if (_currentIndex != startTokenId) revert(); } else { do { emit Transfer(address(0), to, updatedIndex++); } while (updatedIndex < end); } _currentIndex = updatedIndex; } _afterTokenTransfers(address(0), to, startTokenId, quantity); } /** * @dev Mints `quantity` tokens and transfers them to `to`. * * Requirements: * * - `to` cannot be the zero address. * - `quantity` must be greater than 0. * * Emits a {Transfer} event. */ function _mint(address to, uint256 quantity) internal { uint256 startTokenId = _currentIndex; if (to == address(0)) revert MintToZeroAddress(); if (quantity == 0) revert MintZeroQuantity(); _beforeTokenTransfers(address(0), to, startTokenId, quantity); // Overflows are incredibly unrealistic. // balance or numberMinted overflow if current value of either + quantity > 1.8e19 (2**64) - 1 // updatedIndex overflows if _currentIndex + quantity > 1.2e77 (2**256) - 1 unchecked { _addressData[to].balance += uint64(quantity); _addressData[to].numberMinted += uint64(quantity); _ownerships[startTokenId].addr = to; _ownerships[startTokenId].startTimestamp = uint64(block.timestamp); uint256 updatedIndex = startTokenId; uint256 end = updatedIndex + quantity; do { emit Transfer(address(0), to, updatedIndex++); } while (updatedIndex < end); _currentIndex = updatedIndex; } _afterTokenTransfers(address(0), to, startTokenId, quantity); } /** * @dev Transfers `tokenId` from `from` to `to`. * * Requirements: * * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * * Emits a {Transfer} event. */ function _transfer( address from, address to, uint256 tokenId ) private { TokenOwnership memory prevOwnership = _ownershipOf(tokenId); if (prevOwnership.addr != from) revert TransferFromIncorrectOwner(); bool isApprovedOrOwner = (_msgSenderERC721A() == from || isApprovedForAll(from, _msgSenderERC721A()) || getApproved(tokenId) == _msgSenderERC721A()); if (!isApprovedOrOwner) revert TransferCallerNotOwnerNorApproved(); if (to == address(0)) revert TransferToZeroAddress(); _beforeTokenTransfers(from, to, tokenId, 1); // Clear approvals from the previous owner. delete _tokenApprovals[tokenId]; // Underflow of the sender's balance is impossible because we check for // ownership above and the recipient's balance can't realistically overflow. // Counter overflow is incredibly unrealistic as tokenId would have to be 2**256. unchecked { _addressData[from].balance -= 1; _addressData[to].balance += 1; TokenOwnership storage currSlot = _ownerships[tokenId]; currSlot.addr = to; currSlot.startTimestamp = uint64(block.timestamp); // If the ownership slot of tokenId+1 is not explicitly set, that means the transfer initiator owns it. // Set the slot of tokenId+1 explicitly in storage to maintain correctness for ownerOf(tokenId+1) calls. uint256 nextTokenId = tokenId + 1; TokenOwnership storage nextSlot = _ownerships[nextTokenId]; if (nextSlot.addr == address(0)) { // This will suffice for checking _exists(nextTokenId), // as a burned slot cannot contain the zero address. if (nextTokenId != _currentIndex) { nextSlot.addr = from; nextSlot.startTimestamp = prevOwnership.startTimestamp; } } } emit Transfer(from, to, tokenId); _afterTokenTransfers(from, to, tokenId, 1); } /** * @dev Equivalent to `_burn(tokenId, false)`. */ function _burn(uint256 tokenId) internal virtual { _burn(tokenId, false); } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId, bool approvalCheck) internal virtual { TokenOwnership memory prevOwnership = _ownershipOf(tokenId); address from = prevOwnership.addr; if (approvalCheck) { bool isApprovedOrOwner = (_msgSenderERC721A() == from || isApprovedForAll(from, _msgSenderERC721A()) || getApproved(tokenId) == _msgSenderERC721A()); if (!isApprovedOrOwner) revert TransferCallerNotOwnerNorApproved(); } _beforeTokenTransfers(from, address(0), tokenId, 1); // Clear approvals from the previous owner. delete _tokenApprovals[tokenId]; // Underflow of the sender's balance is impossible because we check for // ownership above and the recipient's balance can't realistically overflow. // Counter overflow is incredibly unrealistic as tokenId would have to be 2**256. unchecked { AddressData storage addressData = _addressData[from]; addressData.balance -= 1; addressData.numberBurned += 1; // Keep track of who burned the token, and the timestamp of burning. TokenOwnership storage currSlot = _ownerships[tokenId]; currSlot.addr = from; currSlot.startTimestamp = uint64(block.timestamp); currSlot.burned = true; // If the ownership slot of tokenId+1 is not explicitly set, that means the burn initiator owns it. // Set the slot of tokenId+1 explicitly in storage to maintain correctness for ownerOf(tokenId+1) calls. uint256 nextTokenId = tokenId + 1; TokenOwnership storage nextSlot = _ownerships[nextTokenId]; if (nextSlot.addr == address(0)) { // This will suffice for checking _exists(nextTokenId), // as a burned slot cannot contain the zero address. if (nextTokenId != _currentIndex) { nextSlot.addr = from; nextSlot.startTimestamp = prevOwnership.startTimestamp; } } } emit Transfer(from, address(0), tokenId); _afterTokenTransfers(from, address(0), tokenId, 1); // Overflow not possible, as _burnCounter cannot be exceed _currentIndex times. unchecked { _burnCounter++; } } /** * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target 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 _checkContractOnERC721Received( address from, address to, uint256 tokenId, bytes memory _data ) private returns (bool) { try ERC721A__IERC721Receiver(to).onERC721Received(_msgSenderERC721A(), from, tokenId, _data) returns (bytes4 retval) { return retval == ERC721A__IERC721Receiver(to).onERC721Received.selector; } catch (bytes memory reason) { if (reason.length == 0) { revert TransferToNonERC721ReceiverImplementer(); } else { assembly { revert(add(32, reason), mload(reason)) } } } } /** * @dev Hook that is called before a set of serially-ordered token ids are about to be transferred. This includes minting. * And also called before burning one token. * * startTokenId - the first token id to be transferred * quantity - the amount to be transferred * * 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, `tokenId` will be burned by `from`. * - `from` and `to` are never both zero. */ function _beforeTokenTransfers( address from, address to, uint256 startTokenId, uint256 quantity ) internal virtual {} /** * @dev Hook that is called after a set of serially-ordered token ids have been transferred. This includes * minting. * And also called after one token has been burned. * * startTokenId - the first token id to be transferred * quantity - the amount to be transferred * * Calling conditions: * * - When `from` and `to` are both non-zero, `from`'s `tokenId` has been * transferred to `to`. * - When `from` is zero, `tokenId` has been minted for `to`. * - When `to` is zero, `tokenId` has been burned by `from`. * - `from` and `to` are never both zero. */ function _afterTokenTransfers( address from, address to, uint256 startTokenId, uint256 quantity ) internal virtual {} /** * @dev Returns the message sender (defaults to `msg.sender`). * * If you are writing GSN compatible contracts, you need to override this function. */ function _msgSenderERC721A() internal view virtual returns (address) { return msg.sender; } /** * @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 unchecked { 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; buffer[digits] = bytes1(uint8(48 + uint256(value % 10))); value /= 10; } return string(buffer); } } }
// SPDX-License-Identifier: MIT // ERC721A Contracts v3.3.0 // Creator: Chiru Labs pragma solidity ^0.8.4; import './IERC721ABurnable.sol'; import './ERC721A.sol'; /** * @title ERC721A Burnable Token * @dev ERC721A Token that can be irreversibly burned (destroyed). */ abstract contract ERC721ABurnable is ERC721A, IERC721ABurnable { /** * @dev Burns `tokenId`. See {ERC721A-_burn}. * * Requirements: * * - The caller must own `tokenId` or be an approved operator. */ function burn(uint256 tokenId) public virtual override { _burn(tokenId, true); } }
// SPDX-License-Identifier: MIT // ERC721A Contracts v3.3.0 // Creator: Chiru Labs pragma solidity ^0.8.4; import './IERC721AQueryable.sol'; import './ERC721A.sol'; /** * @title ERC721A Queryable * @dev ERC721A subclass with convenience query functions. */ abstract contract ERC721AQueryable is ERC721A, IERC721AQueryable { /** * @dev Returns the `TokenOwnership` struct at `tokenId` without reverting. * * If the `tokenId` is out of bounds: * - `addr` = `address(0)` * - `startTimestamp` = `0` * - `burned` = `false` * * If the `tokenId` is burned: * - `addr` = `<Address of owner before token was burned>` * - `startTimestamp` = `<Timestamp when token was burned>` * - `burned = `true` * * Otherwise: * - `addr` = `<Address of owner>` * - `startTimestamp` = `<Timestamp of start of ownership>` * - `burned = `false` */ function explicitOwnershipOf(uint256 tokenId) public view override returns (TokenOwnership memory) { TokenOwnership memory ownership; if (tokenId < _startTokenId() || tokenId >= _currentIndex) { return ownership; } ownership = _ownerships[tokenId]; if (ownership.burned) { return ownership; } return _ownershipOf(tokenId); } /** * @dev Returns an array of `TokenOwnership` structs at `tokenIds` in order. * See {ERC721AQueryable-explicitOwnershipOf} */ function explicitOwnershipsOf(uint256[] memory tokenIds) external view override returns (TokenOwnership[] memory) { unchecked { uint256 tokenIdsLength = tokenIds.length; TokenOwnership[] memory ownerships = new TokenOwnership[](tokenIdsLength); for (uint256 i; i != tokenIdsLength; ++i) { ownerships[i] = explicitOwnershipOf(tokenIds[i]); } return ownerships; } } /** * @dev Returns an array of token IDs owned by `owner`, * in the range [`start`, `stop`) * (i.e. `start <= tokenId < stop`). * * This function allows for tokens to be queried if the collection * grows too big for a single call of {ERC721AQueryable-tokensOfOwner}. * * Requirements: * * - `start` < `stop` */ function tokensOfOwnerIn( address owner, uint256 start, uint256 stop ) external view override returns (uint256[] memory) { unchecked { if (start >= stop) revert InvalidQueryRange(); uint256 tokenIdsIdx; uint256 stopLimit = _currentIndex; // Set `start = max(start, _startTokenId())`. if (start < _startTokenId()) { start = _startTokenId(); } // Set `stop = min(stop, _currentIndex)`. if (stop > stopLimit) { stop = stopLimit; } uint256 tokenIdsMaxLength = balanceOf(owner); // Set `tokenIdsMaxLength = min(balanceOf(owner), stop - start)`, // to cater for cases where `balanceOf(owner)` is too big. if (start < stop) { uint256 rangeLength = stop - start; if (rangeLength < tokenIdsMaxLength) { tokenIdsMaxLength = rangeLength; } } else { tokenIdsMaxLength = 0; } uint256[] memory tokenIds = new uint256[](tokenIdsMaxLength); if (tokenIdsMaxLength == 0) { return tokenIds; } // We need to call `explicitOwnershipOf(start)`, // because the slot at `start` may not be initialized. TokenOwnership memory ownership = explicitOwnershipOf(start); address currOwnershipAddr; // If the starting slot exists (i.e. not burned), initialize `currOwnershipAddr`. // `ownership.address` will not be zero, as `start` is clamped to the valid token ID range. if (!ownership.burned) { currOwnershipAddr = ownership.addr; } for (uint256 i = start; i != stop && tokenIdsIdx != tokenIdsMaxLength; ++i) { ownership = _ownerships[i]; if (ownership.burned) { continue; } if (ownership.addr != address(0)) { currOwnershipAddr = ownership.addr; } if (currOwnershipAddr == owner) { tokenIds[tokenIdsIdx++] = i; } } // Downsize the array to fit. assembly { mstore(tokenIds, tokenIdsIdx) } return tokenIds; } } /** * @dev Returns an array of token IDs owned by `owner`. * * This function scans the ownership mapping and is O(totalSupply) in complexity. * It is meant to be called off-chain. * * See {ERC721AQueryable-tokensOfOwnerIn} for splitting the scan into * multiple smaller scans if the collection is large enough to cause * an out-of-gas error (10K pfp collections should be fine). */ function tokensOfOwner(address owner) external view override returns (uint256[] memory) { unchecked { uint256 tokenIdsIdx; address currOwnershipAddr; uint256 tokenIdsLength = balanceOf(owner); uint256[] memory tokenIds = new uint256[](tokenIdsLength); TokenOwnership memory ownership; for (uint256 i = _startTokenId(); tokenIdsIdx != tokenIdsLength; ++i) { ownership = _ownerships[i]; if (ownership.burned) { continue; } if (ownership.addr != address(0)) { currOwnershipAddr = ownership.addr; } if (currOwnershipAddr == owner) { tokenIds[tokenIdsIdx++] = i; } } return tokenIds; } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol) pragma solidity ^0.8.0; /** * @dev External interface of AccessControl declared to support ERC165 detection. */ interface IAccessControl { /** * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` * * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite * {RoleAdminChanged} not being emitted signaling this. * * _Available since v3.1._ */ event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole); /** * @dev Emitted when `account` is granted `role`. * * `sender` is the account that originated the contract call, an admin role * bearer except when using {AccessControl-_setupRole}. */ event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Emitted when `account` is revoked `role`. * * `sender` is the account that originated the contract call: * - if using `revokeRole`, it is the admin role bearer * - if using `renounceRole`, it is the role bearer (i.e. `account`) */ event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) external view returns (bool); /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {AccessControl-_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) external view returns (bytes32); /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function grantRole(bytes32 role, address account) external; /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function revokeRole(bytes32 role, address account) external; /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been granted `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. */ function renounceRole(bytes32 role, address account) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/IAccessControlEnumerable.sol) 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 // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT // ERC721A Contracts v3.3.0 // Creator: Chiru Labs pragma solidity ^0.8.4; /** * @dev Interface of an ERC721A compliant contract. */ interface IERC721A { /** * The caller must own the token or be an approved operator. */ error ApprovalCallerNotOwnerNorApproved(); /** * The token does not exist. */ error ApprovalQueryForNonexistentToken(); /** * The caller cannot approve to their own address. */ error ApproveToCaller(); /** * The caller cannot approve to the current owner. */ error ApprovalToCurrentOwner(); /** * Cannot query the balance for the zero address. */ error BalanceQueryForZeroAddress(); /** * Cannot mint to the zero address. */ error MintToZeroAddress(); /** * The quantity of tokens minted must be more than zero. */ error MintZeroQuantity(); /** * The token does not exist. */ error OwnerQueryForNonexistentToken(); /** * The caller must own the token or be an approved operator. */ error TransferCallerNotOwnerNorApproved(); /** * The token must be owned by `from`. */ error TransferFromIncorrectOwner(); /** * Cannot safely transfer to a contract that does not implement the ERC721Receiver interface. */ error TransferToNonERC721ReceiverImplementer(); /** * Cannot transfer to the zero address. */ error TransferToZeroAddress(); /** * The token does not exist. */ error URIQueryForNonexistentToken(); // Compiler will pack this into a single 256bit word. struct TokenOwnership { // The address of the owner. address addr; // Keeps track of the start time of ownership with minimal overhead for tokenomics. uint64 startTimestamp; // Whether the token has been burned. bool burned; } // Compiler will pack this into a single 256bit word. struct AddressData { // Realistically, 2**64-1 is more than enough. uint64 balance; // Keeps track of mint count with minimal overhead for tokenomics. uint64 numberMinted; // Keeps track of burn count with minimal overhead for tokenomics. uint64 numberBurned; // For miscellaneous variable(s) pertaining to the address // (e.g. number of whitelist mint slots used). // If there are multiple variables, please pack them into a uint64. uint64 aux; } /** * @dev Returns the total amount of tokens stored by the contract. * * Burned tokens are calculated here, use `_totalMinted()` if you want to count just minted tokens. */ function totalSupply() external view returns (uint256); // ============================== // 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); // ============================== // IERC721 // ============================== /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes calldata data ) external; /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must 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 Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool _approved) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view returns (bool); // ============================== // IERC721Metadata // ============================== /** * @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 // ERC721A Contracts v3.3.0 // Creator: Chiru Labs pragma solidity ^0.8.4; import './IERC721A.sol'; /** * @dev Interface of an ERC721ABurnable compliant contract. */ interface IERC721ABurnable is IERC721A { /** * @dev Burns `tokenId`. See {ERC721A-_burn}. * * Requirements: * * - The caller must own `tokenId` or be an approved operator. */ function burn(uint256 tokenId) external; }
// SPDX-License-Identifier: MIT // ERC721A Contracts v3.3.0 // Creator: Chiru Labs pragma solidity ^0.8.4; import './IERC721A.sol'; /** * @dev Interface of an ERC721AQueryable compliant contract. */ interface IERC721AQueryable is IERC721A { /** * Invalid query range (`start` >= `stop`). */ error InvalidQueryRange(); /** * @dev Returns the `TokenOwnership` struct at `tokenId` without reverting. * * If the `tokenId` is out of bounds: * - `addr` = `address(0)` * - `startTimestamp` = `0` * - `burned` = `false` * * If the `tokenId` is burned: * - `addr` = `<Address of owner before token was burned>` * - `startTimestamp` = `<Timestamp when token was burned>` * - `burned = `true` * * Otherwise: * - `addr` = `<Address of owner>` * - `startTimestamp` = `<Timestamp of start of ownership>` * - `burned = `false` */ function explicitOwnershipOf(uint256 tokenId) external view returns (TokenOwnership memory); /** * @dev Returns an array of `TokenOwnership` structs at `tokenIds` in order. * See {ERC721AQueryable-explicitOwnershipOf} */ function explicitOwnershipsOf(uint256[] memory tokenIds) external view returns (TokenOwnership[] memory); /** * @dev Returns an array of token IDs owned by `owner`, * in the range [`start`, `stop`) * (i.e. `start <= tokenId < stop`). * * This function allows for tokens to be queried if the collection * grows too big for a single call of {ERC721AQueryable-tokensOfOwner}. * * Requirements: * * - `start` < `stop` */ function tokensOfOwnerIn( address owner, uint256 start, uint256 stop ) external view returns (uint256[] memory); /** * @dev Returns an array of token IDs owned by `owner`. * * This function scans the ownership mapping and is O(totalSupply) in complexity. * It is meant to be called off-chain. * * See {ERC721AQueryable-tokensOfOwnerIn} for splitting the scan into * multiple smaller scans if the collection is large enough to cause * an out-of-gas error (10K pfp collections should be fine). */ function tokensOfOwner(address owner) external view returns (uint256[] memory); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (utils/cryptography/MerkleProof.sol) pragma solidity ^0.8.0; /** * @dev These functions deal with verification of Merkle Trees proofs. * * The proofs can be generated using the JavaScript library * https://github.com/miguelmota/merkletreejs[merkletreejs]. * Note: the hashing algorithm should be keccak256 and pair sorting should be enabled. * * See `test/utils/cryptography/MerkleProof.test.js` for some examples. * * WARNING: You should avoid using leaf values that are 64 bytes long prior to * hashing, or use a hash function other than keccak256 for hashing leaves. * This is because the concatenation of a sorted pair of internal nodes in * the merkle tree could be reinterpreted as a leaf value. */ library MerkleProof { /** * @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree * defined by `root`. For this, a `proof` must be provided, containing * sibling hashes on the branch from the leaf to the root of the tree. Each * pair of leaves and each pair of pre-images are assumed to be sorted. */ function verify( bytes32[] memory proof, bytes32 root, bytes32 leaf ) internal pure returns (bool) { return processProof(proof, leaf) == root; } /** * @dev Returns the rebuilt hash obtained by traversing a Merkle tree up * from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt * hash matches the root of the tree. When processing the proof, the pairs * of leafs & pre-images are assumed to be sorted. * * _Available since v4.4._ */ function processProof(bytes32[] memory proof, bytes32 leaf) internal pure returns (bytes32) { bytes32 computedHash = leaf; for (uint256 i = 0; i < proof.length; i++) { bytes32 proofElement = proof[i]; if (computedHash <= proofElement) { // Hash(current computed hash + current element of the proof) computedHash = _efficientHash(computedHash, proofElement); } else { // Hash(current element of the proof + current computed hash) computedHash = _efficientHash(proofElement, computedHash); } } return computedHash; } function _efficientHash(bytes32 a, bytes32 b) private pure returns (bytes32 value) { /// @solidity memory-safe-assembly assembly { mstore(0x00, a) mstore(0x20, b) value := keccak256(0x00, 0x40) } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/Ownable.sol) pragma solidity ^0.8.0; import "./Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _transferOwnership(_msgSender()); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (security/Pausable.sol) pragma solidity ^0.8.0; import "./Context.sol"; /** * @dev Contract module which allows children to implement an emergency stop * mechanism that can be triggered by an authorized account. * * This module is used through inheritance. It will make available the * modifiers `whenNotPaused` and `whenPaused`, which can be applied to * the functions of your contract. Note that they will not be pausable by * simply including this module, only once the modifiers are put in place. */ abstract contract Pausable is Context { /** * @dev Emitted when the pause is triggered by `account`. */ event Paused(address account); /** * @dev Emitted when the pause is lifted by `account`. */ event Unpaused(address account); bool private _paused; /** * @dev Initializes the contract in unpaused state. */ constructor() { _paused = false; } /** * @dev Returns true if the contract is paused, and false otherwise. */ function paused() public view virtual returns (bool) { return _paused; } /** * @dev Modifier to make a function callable only when the contract is not paused. * * Requirements: * * - The contract must not be paused. */ modifier whenNotPaused() { require(!paused(), "Pausable: paused"); _; } /** * @dev Modifier to make a function callable only when the contract is paused. * * Requirements: * * - The contract must be paused. */ modifier whenPaused() { require(paused(), "Pausable: not paused"); _; } /** * @dev Triggers stopped state. * * Requirements: * * - The contract must not be paused. */ function _pause() internal virtual whenNotPaused { _paused = true; emit Paused(_msgSender()); } /** * @dev Returns to normal state. * * Requirements: * * - The contract must be paused. */ function _unpause() internal virtual whenPaused { _paused = false; emit Unpaused(_msgSender()); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "./ERC721A.sol"; import "./ERC721ABurnable.sol"; import "./ERC721AQueryable.sol"; import "./AccessControlEnumerable.sol"; import "./SafeMath.sol"; contract ROTL is AccessControlEnumerable, ERC721A, ERC721ABurnable, ERC721AQueryable { using SafeMath for uint256; event SetBaseTokenURI(string uri); string private _baseTokenURI; bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE"); constructor() ERC721A("Ruler of the Land", "ROTL") { _setupRole(DEFAULT_ADMIN_ROLE, _msgSender()); } function getFaction(uint256 id) external pure returns (uint256) { if (id < 5000) { return 1; } else if (id < 10000) { return 2; } else if (id < 15000) { return 3; } else if (id < 25000) { return 4; } else if (id < 35000) { return 5; } return 0; } function mint(uint256 faction, address to, uint256 quantity) external onlyRole(MINTER_ROLE) { if (faction == 1) { // darkstorm bringers require (totalSupply().add(quantity) <= 5000, "totalSupply().add(quantity) <= 5000"); } else if (faction == 2) { // righteous faction require (totalSupply().add(quantity) <= 10000, "totalSupply().add(quantity) <= 10000"); } else if (faction == 3) { // cult faction require (totalSupply().add(quantity) <= 15000, "totalSupply().add(quantity) <= 15000"); } else if (faction == 4) { // the four outworld Hordes require (totalSupply().add(quantity) <= 25000, "totalSupply().add(quantity) <= 25000"); } else { // sanctuary of the sword require (totalSupply().add(quantity) <= 35000, "totalSupply().add(quantity) <= 35000"); } // _safeMint's second argument now takes in a quantity, not a tokenId. _safeMint(to, quantity); } function addMinter(address minter) external onlyRole(DEFAULT_ADMIN_ROLE) { _setupRole(MINTER_ROLE, minter); } function setBaseTokenURI(string memory uri) external onlyRole(DEFAULT_ADMIN_ROLE) { _baseTokenURI = uri; emit SetBaseTokenURI(uri); } function _baseURI() internal view override returns (string memory) { return _baseTokenURI; } function supportsInterface(bytes4 interfaceId) public view virtual override(AccessControlEnumerable, ERC721A) returns (bool) { return super.supportsInterface(interfaceId); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (utils/math/SafeMath.sol) pragma solidity ^0.8.0; // CAUTION // This version of SafeMath should only be used with Solidity 0.8 or later, // because it relies on the compiler's built in overflow checks. /** * @dev Wrappers over Solidity's arithmetic operations. * * NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler * now has built in overflow checking. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } } /** * @dev Returns the subtraction of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b > a) return (false, 0); return (true, a - b); } } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } } /** * @dev Returns the division of two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a / b); } } /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a % b); } } /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { return a + b; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return a - b; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { return a * b; } /** * @dev Returns the integer division of two unsigned integers, reverting on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return a % b; } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {trySub}. * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b <= a, errorMessage); return a - b; } } /** * @dev Returns the integer division of two unsigned integers, reverting with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a / b; } } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting with custom message when dividing by zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryMod}. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a % b; } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Strings.sol) pragma solidity ^0.8.0; /** * @dev String operations. */ library Strings { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; uint8 private constant _ADDRESS_LENGTH = 20; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { // Inspired by OraclizeAPI's implementation - MIT licence // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol if (value == 0) { return "0"; } uint256 temp = value; uint256 digits; while (temp != 0) { digits++; temp /= 10; } bytes memory buffer = new bytes(digits); while (value != 0) { digits -= 1; buffer[digits] = bytes1(uint8(48 + uint256(value % 10))); value /= 10; } return string(buffer); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { if (value == 0) { return "0x00"; } uint256 temp = value; uint256 length = 0; while (temp != 0) { length++; temp >>= 8; } return toHexString(value, length); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _HEX_SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH); } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"nft","type":"address"}],"name":"SetAddress","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"round","type":"uint256"}],"name":"SetRound","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"round","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"price","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"maxCount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"onceMaxCount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"addressMaxCount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"startBlock","type":"uint256"},{"indexed":false,"internalType":"bytes32","name":"merkleRoot","type":"bytes32"}],"name":"SetRoundInfo","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"getCurrentRound","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getCurrentRoundInfo","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"round","type":"uint256"},{"internalType":"address","name":"target","type":"address"}],"name":"getMintedCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getRemainCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isEnable","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"round","type":"uint256"},{"internalType":"uint256","name":"count","type":"uint256"},{"internalType":"bytes32[]","name":"merkleProof","type":"bytes32[]"}],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"nft","type":"address"}],"name":"setAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"round","type":"uint256"}],"name":"setRound","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"round","type":"uint256"},{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint256","name":"maxCount","type":"uint256"},{"internalType":"uint256","name":"onceMaxCount","type":"uint256"},{"internalType":"uint256","name":"addressMaxCount","type":"uint256"},{"internalType":"uint256","name":"startBlock","type":"uint256"},{"internalType":"bytes32","name":"merkleRoot","type":"bytes32"}],"name":"setRoundInfo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
608060405234801561001057600080fd5b5061001a3361002c565b6000805460ff60a01b1916905561007c565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6110f68061008b6000396000f3fe6080604052600436106100f35760003560e01c80638da5cb5b1161008a578063e6d37b8811610059578063e6d37b88146102a6578063f2fde38b146102b9578063f3fef3a3146102d9578063f7379656146102f957600080fd5b80638da5cb5b146102295780639b624e7b14610251578063a32bf59714610271578063e30081a01461028657600080fd5b80635c975abb116100c65780635c975abb146101a3578063715018a6146101c2578063747dff42146101d75780638456cb591461021457600080fd5b80633f4ba83a146100f85780634562ad411461010f5780634bb77d681461013757806357c492771461015c575b600080fd5b34801561010457600080fd5b5061010d610319565b005b34801561011b57600080fd5b50610124610356565b6040519081526020015b60405180910390f35b34801561014357600080fd5b5061014c610365565b604051901515815260200161012e565b34801561016857600080fd5b50610124610177366004610ee2565b60008281526003602090815260408083206001600160a01b038516845260060190915290205492915050565b3480156101af57600080fd5b50600054600160a01b900460ff1661014c565b3480156101ce57600080fd5b5061010d61036f565b3480156101e357600080fd5b506101ec6103a3565b604080519586526020860194909452928401919091526060830152608082015260a00161012e565b34801561022057600080fd5b5061010d6103eb565b34801561023557600080fd5b506000546040516001600160a01b03909116815260200161012e565b34801561025d57600080fd5b5061010d61026c366004610eb0565b61041d565b34801561027d57600080fd5b50600254610124565b34801561029257600080fd5b5061010d6102a1366004610e67565b610483565b61010d6102b4366004610f12565b6104fb565b3480156102c557600080fd5b5061010d6102d4366004610e67565b6107d5565b3480156102e557600080fd5b5061010d6102f4366004610e84565b610870565b34801561030557600080fd5b5061010d610314366004610f95565b6108d5565b6000546001600160a01b0316331461034c5760405162461bcd60e51b815260040161034390610fe1565b60405180910390fd5b61035461099b565b565b6000610360610a38565b905090565b6000610360610b09565b6000546001600160a01b031633146103995760405162461bcd60e51b815260040161034390610fe1565b6103546000610b30565b6000806000806000806103c3600254600090815260036020526040902090565b8054600182015460028301546003840154600490940154929a91995097509195509350915050565b6000546001600160a01b031633146104155760405162461bcd60e51b815260040161034390610fe1565b610354610b80565b6000546001600160a01b031633146104475760405162461bcd60e51b815260040161034390610fe1565b60028190556040518181527f4c3a2e3c24303809c2e670266ce02c1d40143a65e67064a1e45c7f92cba7b8c1906020015b60405180910390a150565b6000546001600160a01b031633146104ad5760405162461bcd60e51b815260040161034390610fe1565b600180546001600160a01b0319166001600160a01b0383169081179091556040519081527f32f56b2a4d53f6243e918426194265055bd88ec7003f73f82d94f4217907faaf90602001610478565b600054600160a01b900460ff16156105485760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610343565b83600254146105995760405162461bcd60e51b815260206004820152601e60248201527f72657175697265205f63757272656e74526f756e64203d3d20726f756e6400006044820152606401610343565b600254600090815260036020526040902080546105b790859061102e565b34146106105760405162461bcd60e51b815260206004820152602260248201527f72657175697265206d73672e76616c7565203d3d207072696365202a20636f756044820152611b9d60f21b6064820152608401610343565b43816004015411156106755760405162461bcd60e51b815260206004820152602860248201527f7265717569726520696e666f2e5f7374617274426c6f636b203c3d20626c6f636044820152673597373ab6b132b960c11b6064820152608401610343565b60058101541561073e576040516bffffffffffffffffffffffff193360601b1660208201526000906034016040516020818303038152906040528051906020012090506106f9848480806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250505050600584015483610c08565b61073c5760405162461bcd60e51b815260206004820152601460248201527334b73b30b634b21036b2b935b63290383937b7b360611b6044820152606401610343565b505b6003810154156107c4573360009081526006820160205260409020546107649085610c1e565b3360009081526006830160205260409020819055600382015410156107c45760405162461bcd60e51b81526020600482015260166024820152751bdd995c881859191c995cdcc81b585e0818dbdd5b9d60521b6044820152606401610343565b6107ce8185610c31565b5050505050565b6000546001600160a01b031633146107ff5760405162461bcd60e51b815260040161034390610fe1565b6001600160a01b0381166108645760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610343565b61086d81610b30565b50565b6000546001600160a01b0316331461089a5760405162461bcd60e51b815260040161034390610fe1565b6040516001600160a01b0383169082156108fc029083906000818181858888f193505050501580156108d0573d6000803e3d6000fd5b505050565b6000546001600160a01b031633146108ff5760405162461bcd60e51b815260040161034390610fe1565b6000878152600360208181526040928390208981556001810189905560028101889055918201869055600482018590556005820184905582518a8152908101899052918201879052606082018690526080820185905260a0820184905260c08201839052907f5bdb2a3e3c6d3fecd2a1b08aef7ebd1577bf17d99ac1b04458ca3895059456819060e00160405180910390a15050505050505050565b600054600160a01b900460ff166109eb5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610343565b6000805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b600080600160009054906101000a90046001600160a01b03166001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b158015610a8957600080fd5b505afa158015610a9d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ac19190610ec9565b90506000610adc600254600090815260036020526040902090565b90508181600101541015610af35760009250505090565b6001810154610b029083610de7565b9250505090565b6000610b13610a38565b60001080156103605750600054600160a01b900460ff1615905090565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600054600160a01b900460ff1615610bcd5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610343565b6000805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258610a1b3390565b600082610c158584610df3565b14949350505050565b6000610c2a8284611016565b9392505050565b610c39610b09565b1515600114610c7d5760405162461bcd60e51b815260206004820152601060248201526f191a5cd8589b194818dbdb9d1c9858dd60821b6044820152606401610343565b80600010610cc15760405162461bcd60e51b81526020600482015260116024820152701c995c5d5a5c99480c080f0818dbdd5b9d607a1b6044820152606401610343565b8160020154811115610d155760405162461bcd60e51b815260206004820152601e60248201527f7265717569726520636f756e74203c3d205f6f6e63654d6178436f756e7400006044820152606401610343565b610d1d610a38565b811115610d785760405162461bcd60e51b815260206004820152602360248201527f7265717569726520636f756e74203c3d205f5f67657452656d61696e436f756e60448201526274282960e81b6064820152608401610343565b6001805460405163020da84160e61b81526004810192909252336024830152604482018390526001600160a01b03169063836a104090606401600060405180830381600087803b158015610dcb57600080fd5b505af1158015610ddf573d6000803e3d6000fd5b505050505050565b6000610c2a828461104d565b600081815b8451811015610e5f576000858281518110610e1557610e15611095565b60200260200101519050808311610e3b5760008381526020829052604090209250610e4c565b600081815260208490526040902092505b5080610e5781611064565b915050610df8565b509392505050565b600060208284031215610e7957600080fd5b8135610c2a816110ab565b60008060408385031215610e9757600080fd5b8235610ea2816110ab565b946020939093013593505050565b600060208284031215610ec257600080fd5b5035919050565b600060208284031215610edb57600080fd5b5051919050565b60008060408385031215610ef557600080fd5b823591506020830135610f07816110ab565b809150509250929050565b60008060008060608587031215610f2857600080fd5b8435935060208501359250604085013567ffffffffffffffff80821115610f4e57600080fd5b818701915087601f830112610f6257600080fd5b813581811115610f7157600080fd5b8860208260051b8501011115610f8657600080fd5b95989497505060200194505050565b600080600080600080600060e0888a031215610fb057600080fd5b505085359760208701359750604087013596606081013596506080810135955060a0810135945060c0013592509050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600082198211156110295761102961107f565b500190565b60008160001904831182151516156110485761104861107f565b500290565b60008282101561105f5761105f61107f565b500390565b60006000198214156110785761107861107f565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6001600160a01b038116811461086d57600080fdfea26469706673582212207226da893fd921ebe0eb4064431eb796f1035755b7f1a9dd4f3eef1d9d5dd9ef64736f6c63430008070033
Deployed Bytecode
0x6080604052600436106100f35760003560e01c80638da5cb5b1161008a578063e6d37b8811610059578063e6d37b88146102a6578063f2fde38b146102b9578063f3fef3a3146102d9578063f7379656146102f957600080fd5b80638da5cb5b146102295780639b624e7b14610251578063a32bf59714610271578063e30081a01461028657600080fd5b80635c975abb116100c65780635c975abb146101a3578063715018a6146101c2578063747dff42146101d75780638456cb591461021457600080fd5b80633f4ba83a146100f85780634562ad411461010f5780634bb77d681461013757806357c492771461015c575b600080fd5b34801561010457600080fd5b5061010d610319565b005b34801561011b57600080fd5b50610124610356565b6040519081526020015b60405180910390f35b34801561014357600080fd5b5061014c610365565b604051901515815260200161012e565b34801561016857600080fd5b50610124610177366004610ee2565b60008281526003602090815260408083206001600160a01b038516845260060190915290205492915050565b3480156101af57600080fd5b50600054600160a01b900460ff1661014c565b3480156101ce57600080fd5b5061010d61036f565b3480156101e357600080fd5b506101ec6103a3565b604080519586526020860194909452928401919091526060830152608082015260a00161012e565b34801561022057600080fd5b5061010d6103eb565b34801561023557600080fd5b506000546040516001600160a01b03909116815260200161012e565b34801561025d57600080fd5b5061010d61026c366004610eb0565b61041d565b34801561027d57600080fd5b50600254610124565b34801561029257600080fd5b5061010d6102a1366004610e67565b610483565b61010d6102b4366004610f12565b6104fb565b3480156102c557600080fd5b5061010d6102d4366004610e67565b6107d5565b3480156102e557600080fd5b5061010d6102f4366004610e84565b610870565b34801561030557600080fd5b5061010d610314366004610f95565b6108d5565b6000546001600160a01b0316331461034c5760405162461bcd60e51b815260040161034390610fe1565b60405180910390fd5b61035461099b565b565b6000610360610a38565b905090565b6000610360610b09565b6000546001600160a01b031633146103995760405162461bcd60e51b815260040161034390610fe1565b6103546000610b30565b6000806000806000806103c3600254600090815260036020526040902090565b8054600182015460028301546003840154600490940154929a91995097509195509350915050565b6000546001600160a01b031633146104155760405162461bcd60e51b815260040161034390610fe1565b610354610b80565b6000546001600160a01b031633146104475760405162461bcd60e51b815260040161034390610fe1565b60028190556040518181527f4c3a2e3c24303809c2e670266ce02c1d40143a65e67064a1e45c7f92cba7b8c1906020015b60405180910390a150565b6000546001600160a01b031633146104ad5760405162461bcd60e51b815260040161034390610fe1565b600180546001600160a01b0319166001600160a01b0383169081179091556040519081527f32f56b2a4d53f6243e918426194265055bd88ec7003f73f82d94f4217907faaf90602001610478565b600054600160a01b900460ff16156105485760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610343565b83600254146105995760405162461bcd60e51b815260206004820152601e60248201527f72657175697265205f63757272656e74526f756e64203d3d20726f756e6400006044820152606401610343565b600254600090815260036020526040902080546105b790859061102e565b34146106105760405162461bcd60e51b815260206004820152602260248201527f72657175697265206d73672e76616c7565203d3d207072696365202a20636f756044820152611b9d60f21b6064820152608401610343565b43816004015411156106755760405162461bcd60e51b815260206004820152602860248201527f7265717569726520696e666f2e5f7374617274426c6f636b203c3d20626c6f636044820152673597373ab6b132b960c11b6064820152608401610343565b60058101541561073e576040516bffffffffffffffffffffffff193360601b1660208201526000906034016040516020818303038152906040528051906020012090506106f9848480806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250505050600584015483610c08565b61073c5760405162461bcd60e51b815260206004820152601460248201527334b73b30b634b21036b2b935b63290383937b7b360611b6044820152606401610343565b505b6003810154156107c4573360009081526006820160205260409020546107649085610c1e565b3360009081526006830160205260409020819055600382015410156107c45760405162461bcd60e51b81526020600482015260166024820152751bdd995c881859191c995cdcc81b585e0818dbdd5b9d60521b6044820152606401610343565b6107ce8185610c31565b5050505050565b6000546001600160a01b031633146107ff5760405162461bcd60e51b815260040161034390610fe1565b6001600160a01b0381166108645760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610343565b61086d81610b30565b50565b6000546001600160a01b0316331461089a5760405162461bcd60e51b815260040161034390610fe1565b6040516001600160a01b0383169082156108fc029083906000818181858888f193505050501580156108d0573d6000803e3d6000fd5b505050565b6000546001600160a01b031633146108ff5760405162461bcd60e51b815260040161034390610fe1565b6000878152600360208181526040928390208981556001810189905560028101889055918201869055600482018590556005820184905582518a8152908101899052918201879052606082018690526080820185905260a0820184905260c08201839052907f5bdb2a3e3c6d3fecd2a1b08aef7ebd1577bf17d99ac1b04458ca3895059456819060e00160405180910390a15050505050505050565b600054600160a01b900460ff166109eb5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610343565b6000805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b600080600160009054906101000a90046001600160a01b03166001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b158015610a8957600080fd5b505afa158015610a9d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ac19190610ec9565b90506000610adc600254600090815260036020526040902090565b90508181600101541015610af35760009250505090565b6001810154610b029083610de7565b9250505090565b6000610b13610a38565b60001080156103605750600054600160a01b900460ff1615905090565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600054600160a01b900460ff1615610bcd5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610343565b6000805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258610a1b3390565b600082610c158584610df3565b14949350505050565b6000610c2a8284611016565b9392505050565b610c39610b09565b1515600114610c7d5760405162461bcd60e51b815260206004820152601060248201526f191a5cd8589b194818dbdb9d1c9858dd60821b6044820152606401610343565b80600010610cc15760405162461bcd60e51b81526020600482015260116024820152701c995c5d5a5c99480c080f0818dbdd5b9d607a1b6044820152606401610343565b8160020154811115610d155760405162461bcd60e51b815260206004820152601e60248201527f7265717569726520636f756e74203c3d205f6f6e63654d6178436f756e7400006044820152606401610343565b610d1d610a38565b811115610d785760405162461bcd60e51b815260206004820152602360248201527f7265717569726520636f756e74203c3d205f5f67657452656d61696e436f756e60448201526274282960e81b6064820152608401610343565b6001805460405163020da84160e61b81526004810192909252336024830152604482018390526001600160a01b03169063836a104090606401600060405180830381600087803b158015610dcb57600080fd5b505af1158015610ddf573d6000803e3d6000fd5b505050505050565b6000610c2a828461104d565b600081815b8451811015610e5f576000858281518110610e1557610e15611095565b60200260200101519050808311610e3b5760008381526020829052604090209250610e4c565b600081815260208490526040902092505b5080610e5781611064565b915050610df8565b509392505050565b600060208284031215610e7957600080fd5b8135610c2a816110ab565b60008060408385031215610e9757600080fd5b8235610ea2816110ab565b946020939093013593505050565b600060208284031215610ec257600080fd5b5035919050565b600060208284031215610edb57600080fd5b5051919050565b60008060408385031215610ef557600080fd5b823591506020830135610f07816110ab565b809150509250929050565b60008060008060608587031215610f2857600080fd5b8435935060208501359250604085013567ffffffffffffffff80821115610f4e57600080fd5b818701915087601f830112610f6257600080fd5b813581811115610f7157600080fd5b8860208260051b8501011115610f8657600080fd5b95989497505060200194505050565b600080600080600080600060e0888a031215610fb057600080fd5b505085359760208701359750604087013596606081013596506080810135955060a0810135945060c0013592509050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600082198211156110295761102961107f565b500190565b60008160001904831182151516156110485761104861107f565b500290565b60008282101561105f5761105f61107f565b500390565b60006000198214156110785761107861107f565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6001600160a01b038116811461086d57600080fdfea26469706673582212207226da893fd921ebe0eb4064431eb796f1035755b7f1a9dd4f3eef1d9d5dd9ef64736f6c63430008070033
Deployed Bytecode Sourcemap
192:4685:18:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1940:67;;;;;;;;;;;;;:::i;:::-;;2230:102;;;;;;;;;;;;;:::i;:::-;;;8566:25:21;;;8554:2;8539:18;2230:102:18;;;;;;;;2015:87;;;;;;;;;;;;;:::i;:::-;;;3248:14:21;;3241:22;3223:41;;3211:2;3196:18;2015:87:18;3083:187:21;3132:142:18;;;;;;;;;;-1:-1:-1;3132:142:18;;;;;:::i;:::-;3210:7;3237:13;;;:6;:13;;;;;;;;-1:-1:-1;;;;;3237:29:18;;;;:21;;:29;;;;;;3132:142;;;;;1130:86:16;;;;;;;;;;-1:-1:-1;1177:4:16;1201:7;-1:-1:-1;;;1201:7:16;;;;1130:86;;1661:101:15;;;;;;;;;;;;;:::i;2622:270:18:-;;;;;;;;;;;;;:::i;:::-;;;;8861:25:21;;;8917:2;8902:18;;8895:34;;;;8945:18;;;8938:34;;;;9003:2;8988:18;;8981:34;9046:3;9031:19;;9024:35;8848:3;8833:19;2622:270:18;8602:463:21;1869:63:18;;;;;;;;;;;;;:::i;1029:85:15:-;;;;;;;;;;-1:-1:-1;1075:7:15;1101:6;1029:85;;-1:-1:-1;;;;;1101:6:15;;;3021:51:21;;3009:2;2994:18;1029:85:15;2875:203:21;1076:139:18;;;;;;;;;;-1:-1:-1;1076:139:18;;;;;:::i;:::-;;:::i;3026:98::-;;;;;;;;;;-1:-1:-1;3103:13:18;;3026:98;;950:118;;;;;;;;;;-1:-1:-1;950:118:18;;;;;:::i;:::-;;:::i;3282:1076::-;;;;;;:::i;:::-;;:::i;1911:198:15:-;;;;;;;;;;-1:-1:-1;1911:198:15;;;;;:::i;:::-;;:::i;4765:109:18:-;;;;;;;;;;-1:-1:-1;4765:109:18;;;;;:::i;:::-;;:::i;1223:638::-;;;;;;;;;;-1:-1:-1;1223:638:18;;;;;:::i;:::-;;:::i;1940:67::-;1075:7:15;1101:6;-1:-1:-1;;;;;1101:6:15;736:10:2;1241:23:15;1233:68;;;;-1:-1:-1;;;1233:68:15;;;;;;;:::i;:::-;;;;;;;;;1989:10:18::1;:8;:10::i;:::-;1940:67::o:0;2230:102::-;2279:7;2306:18;:16;:18::i;:::-;2299:25;;2230:102;:::o;2015:87::-;2058:4;2082:12;:10;:12::i;1661:101:15:-;1075:7;1101:6;-1:-1:-1;;;;;1101:6:15;736:10:2;1241:23:15;1233:68;;;;-1:-1:-1;;;1233:68:15;;;;;;;:::i;:::-;1725:30:::1;1752:1;1725:18;:30::i;2622:270:18:-:0;2676:7;2685;2694;2703;2712;2732:18;2753:23;2996:13;;2956;2989:21;;;:6;:21;;;;;;2900:118;2753:23;2795:11;;2808:14;;;;2824:18;;;;2844:21;;;;2867:16;;;;;2795:11;;2808:14;;-1:-1:-1;2824:18:18;-1:-1:-1;2844:21:18;;-1:-1:-1;2867:16:18;-1:-1:-1;2622:270:18;-1:-1:-1;;2622:270:18:o;1869:63::-;1075:7:15;1101:6;-1:-1:-1;;;;;1101:6:15;736:10:2;1241:23:15;1233:68;;;;-1:-1:-1;;;1233:68:15;;;;;;;:::i;:::-;1916:8:18::1;:6;:8::i;1076:139::-:0;1075:7:15;1101:6;-1:-1:-1;;;;;1101:6:15;736:10:2;1241:23:15;1233:68;;;;-1:-1:-1;;;1233:68:15;;;;;;;:::i;:::-;1155:13:18::1;:21:::0;;;1192:15:::1;::::0;8566:25:21;;;1192:15:18::1;::::0;8554:2:21;8539:18;1192:15:18::1;;;;;;;;1076:139:::0;:::o;950:118::-;1075:7:15;1101:6;-1:-1:-1;;;;;1101:6:15;736:10:2;1241:23:15;1233:68;;;;-1:-1:-1;;;1233:68:15;;;;;;;:::i;:::-;1013:4:18::1;:16:::0;;-1:-1:-1;;;;;;1013:16:18::1;-1:-1:-1::0;;;;;1013:16:18;::::1;::::0;;::::1;::::0;;;1045:15:::1;::::0;3021:51:21;;;1045:15:18::1;::::0;3009:2:21;2994:18;1045:15:18::1;2875:203:21::0;3282:1076:18;1177:4:16;1201:7;-1:-1:-1;;;1201:7:16;;;;1455:9;1447:38;;;;-1:-1:-1;;;1447:38:16;;6049:2:21;1447:38:16;;;6031:21:21;6088:2;6068:18;;;6061:30;-1:-1:-1;;;6107:18:21;;;6100:46;6163:18;;1447:38:16;5847:340:21;1447:38:16;3450:5:18::1;3433:13;;:22;3424:66;;;::::0;-1:-1:-1;;;3424:66:18;;5690:2:21;3424:66:18::1;::::0;::::1;5672:21:21::0;5729:2;5709:18;;;5702:30;5768:32;5748:18;;;5741:60;5818:18;;3424:66:18::1;5488:354:21::0;3424:66:18::1;2996:13:::0;;3501:18:::1;2989:21:::0;;;:6;:21;;;;;3602:11;;:19:::1;::::0;3616:5;;3602:19:::1;:::i;:::-;3589:9;:32;3580:80;;;::::0;-1:-1:-1;;;3580:80:18;;7465:2:21;3580:80:18::1;::::0;::::1;7447:21:21::0;7504:2;7484:18;;;7477:30;7543:34;7523:18;;;7516:62;-1:-1:-1;;;7594:18:21;;;7587:32;7636:19;;3580:80:18::1;7263:398:21::0;3580:80:18::1;3724:12;3704:4;:16;;;:32;;3695:86;;;::::0;-1:-1:-1;;;3695:86:18;;7868:2:21;3695:86:18::1;::::0;::::1;7850:21:21::0;7907:2;7887:18;;;7880:30;7946:34;7926:18;;;7919:62;-1:-1:-1;;;7997:18:21;;;7990:38;8045:19;;3695:86:18::1;7666:404:21::0;3695:86:18::1;3826:16;::::0;::::1;::::0;:22;3822:213:::1;;3890:28;::::0;-1:-1:-1;;3907:10:18::1;2790:2:21::0;2786:15;2782:53;3890:28:18::1;::::0;::::1;2770:66:21::0;3865:12:18::1;::::0;2852::21;;3890:28:18::1;;;;;;;;;;;;3880:39;;;;;;3865:54;;3943:55;3962:11;;3943:55;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;::::0;::::1;::::0;;;;-1:-1:-1;;;;3975:16:18::1;::::0;::::1;::::0;3993:4;3943:18:::1;:55::i;:::-;3934:89;;;::::0;-1:-1:-1;;;3934:89:18;;4591:2:21;3934:89:18::1;::::0;::::1;4573:21:21::0;4630:2;4610:18;;;4603:30;-1:-1:-1;;;4649:18:21;;;4642:50;4709:18;;3934:89:18::1;4389:344:21::0;3934:89:18::1;3850:185;3822:213;4092:21;::::0;::::1;::::0;4088:25;4084:220:::1;;4170:10;4157:24;::::0;;;:12:::1;::::0;::::1;:24;::::0;;;;;:35:::1;::::0;4186:5;4157:28:::1;:35::i;:::-;4143:10;4130:24;::::0;;;:12:::1;::::0;::::1;:24;::::0;;;;:62;;;4244:21:::1;::::0;::::1;::::0;-1:-1:-1;4216:49:18::1;4207:85;;;::::0;-1:-1:-1;;;4207:85:18;;7114:2:21;4207:85:18::1;::::0;::::1;7096:21:21::0;7153:2;7133:18;;;7126:30;-1:-1:-1;;;7172:18:21;;;7165:52;7234:18;;4207:85:18::1;6912:346:21::0;4207:85:18::1;4331:19;4338:4;4344:5;4331:6;:19::i;:::-;3389:969;3282:1076:::0;;;;:::o;1911:198:15:-;1075:7;1101:6;-1:-1:-1;;;;;1101:6:15;736:10:2;1241:23:15;1233:68;;;;-1:-1:-1;;;1233:68:15;;;;;;;:::i;:::-;-1:-1:-1;;;;;1999:22:15;::::1;1991:73;;;::::0;-1:-1:-1;;;1991:73:15;;4184:2:21;1991:73:15::1;::::0;::::1;4166:21:21::0;4223:2;4203:18;;;4196:30;4262:34;4242:18;;;4235:62;-1:-1:-1;;;4313:18:21;;;4306:36;4359:19;;1991:73:15::1;3982:402:21::0;1991:73:15::1;2074:28;2093:8;2074:18;:28::i;:::-;1911:198:::0;:::o;4765:109:18:-;1075:7:15;1101:6;-1:-1:-1;;;;;1101:6:15;736:10:2;1241:23:15;1233:68;;;;-1:-1:-1;;;1233:68:15;;;;;;;:::i;:::-;4848:18:18::1;::::0;-1:-1:-1;;;;;4848:11:18;::::1;::::0;:18;::::1;;;::::0;4860:5;;4848:18:::1;::::0;;;4860:5;4848:11;:18;::::1;;;;;;;;;;;;;::::0;::::1;;;;;;4765:109:::0;;:::o;1223:638::-;1075:7:15;1101:6;-1:-1:-1;;;;;1101:6:15;736:10:2;1241:23:15;1233:68;;;;-1:-1:-1;;;1233:68:15;;;;;;;:::i;:::-;1483:15:18::1;1501:13:::0;;;:6:::1;:13;::::0;;;;;;;;1525:16;;;1552:11:::1;::::0;::::1;:22:::0;;;1585:15:::1;::::0;::::1;:30:::0;;;1626:18;;::::1;:36:::0;;;1673:13:::1;::::0;::::1;:26:::0;;;1710:13:::1;::::0;::::1;:26:::0;;;1762:91;;9385:25:21;;;9426:18;;;9419:34;;;9469:18;;;9462:34;;;9527:2;9512:18;;9505:34;;;9570:3;9555:19;;9548:35;;;9614:3;9599:19;;9592:35;;;9658:3;9643:19;;9636:35;;;1501:13:18;1762:91:::1;::::0;9372:3:21;9357:19;1762:91:18::1;;;;;;;1472:389;1223:638:::0;;;;;;;:::o;2189:120:16:-;1177:4;1201:7;-1:-1:-1;;;1201:7:16;;;;1725:41;;;;-1:-1:-1;;;1725:41:16;;3835:2:21;1725:41:16;;;3817:21:21;3874:2;3854:18;;;3847:30;-1:-1:-1;;;3893:18:21;;;3886:50;3953:18;;1725:41:16;3633:344:21;1725:41:16;2258:5:::1;2248:15:::0;;-1:-1:-1;;;;2248:15:16::1;::::0;;2279:22:::1;736:10:2::0;2288:12:16::1;2279:22;::::0;-1:-1:-1;;;;;3039:32:21;;;3021:51;;3009:2;2994:18;2279:22:16::1;;;;;;;2189:120::o:0;2340:274:18:-;2391:7;2411:14;2428:4;;;;;;;;;-1:-1:-1;;;;;2428:4:18;-1:-1:-1;;;;;2428:16:18;;:18;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;2411:35;;2457:18;2478:23;2996:13;;2956;2989:21;;;:6;:21;;;;;;2900:118;2478:23;2457:44;;2533:6;2516:4;:14;;;:23;2512:50;;;2561:1;2554:8;;;;2340:274;:::o;2512:50::-;2580:14;;;;:26;;2599:6;2580:18;:26::i;:::-;2573:33;;;;2340:274;:::o;2110:112::-;2155:4;2183:18;:16;:18::i;:::-;2179:1;:22;:35;;;;-1:-1:-1;1177:4:16;1201:7;-1:-1:-1;;;1201:7:16;;;;2205:9:18;2172:42;;2110:112;:::o;2263:187:15:-;2336:16;2355:6;;-1:-1:-1;;;;;2371:17:15;;;-1:-1:-1;;;;;;2371:17:15;;;;;;2403:40;;2355:6;;;;;;;2403:40;;2336:16;2403:40;2326:124;2263:187;:::o;1930:118:16:-;1177:4;1201:7;-1:-1:-1;;;1201:7:16;;;;1455:9;1447:38;;;;-1:-1:-1;;;1447:38:16;;6049:2:21;1447:38:16;;;6031:21:21;6088:2;6068:18;;;6061:30;-1:-1:-1;;;6107:18:21;;;6100:46;6163:18;;1447:38:16;5847:340:21;1447:38:16;1990:7:::1;:14:::0;;-1:-1:-1;;;;1990:14:16::1;-1:-1:-1::0;;;1990:14:16::1;::::0;;2020:20:::1;2027:12;736:10:2::0;;656:98;1154:184:14;1275:4;1327;1298:25;1311:5;1318:4;1298:12;:25::i;:::-;:33;;1154:184;-1:-1:-1;;;;1154:184:14:o;2755:96:19:-;2813:7;2839:5;2843:1;2839;:5;:::i;:::-;2832:12;2755:96;-1:-1:-1;;;2755:96:19:o;4366:391:18:-;4446:12;:10;:12::i;:::-;:20;;4462:4;4446:20;4437:50;;;;-1:-1:-1;;;4437:50:18;;8277:2:21;4437:50:18;;;8259:21:21;8316:2;8296:18;;;8289:30;-1:-1:-1;;;8335:18:21;;;8328:46;8391:18;;4437:50:18;8075:340:21;4437:50:18;4511:5;4507:1;:9;4498:40;;;;-1:-1:-1;;;4498:40:18;;4940:2:21;4498:40:18;;;4922:21:21;4979:2;4959:18;;;4952:30;-1:-1:-1;;;4998:18:21;;;4991:47;5055:18;;4498:40:18;4738:341:21;4498:40:18;4567:4;:18;;;4558:5;:27;;4549:71;;;;-1:-1:-1;;;4549:71:18;;6394:2:21;4549:71:18;;;6376:21:21;6433:2;6413:18;;;6406:30;6472:32;6452:18;;;6445:60;6522:18;;4549:71:18;6192:354:21;4549:71:18;4649:18;:16;:18::i;:::-;4640:5;:27;;4631:76;;;;-1:-1:-1;;;4631:76:18;;5286:2:21;4631:76:18;;;5268:21:21;5325:2;5305:18;;;5298:30;5364:34;5344:18;;;5337:62;-1:-1:-1;;;5415:18:21;;;5408:33;5458:19;;4631:76:18;5084:399:21;4631:76:18;4718:4;;;:31;;-1:-1:-1;;;4718:31:18;;;;;3485:25:21;;;;4731:10:18;3526:18:21;;;3519:60;3595:18;;;3588:34;;;-1:-1:-1;;;;;4718:4:18;;:9;;3458:18:21;;4718:31:18;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4366:391;;:::o;3122:96:19:-;3180:7;3206:5;3210:1;3206;:5;:::i;1689:662:14:-;1772:7;1814:4;1772:7;1828:488;1852:5;:12;1848:1;:16;1828:488;;;1885:20;1908:5;1914:1;1908:8;;;;;;;;:::i;:::-;;;;;;;1885:31;;1950:12;1934;:28;1930:376;;2425:13;2516:15;;;2551:4;2544:15;;;2597:4;2581:21;;2060:57;;1930:376;;;2425:13;2516:15;;;2551:4;2544:15;;;2597:4;2581:21;;2234:57;;1930:376;-1:-1:-1;1866:3:14;;;;:::i;:::-;;;;1828:488;;;-1:-1:-1;2332:12:14;1689:662;-1:-1:-1;;;1689:662:14:o;14:247:21:-;73:6;126:2;114:9;105:7;101:23;97:32;94:52;;;142:1;139;132:12;94:52;181:9;168:23;200:31;225:5;200:31;:::i;266:323::-;342:6;350;403:2;391:9;382:7;378:23;374:32;371:52;;;419:1;416;409:12;371:52;458:9;445:23;477:31;502:5;477:31;:::i;:::-;527:5;579:2;564:18;;;;551:32;;-1:-1:-1;;;266:323:21:o;594:180::-;653:6;706:2;694:9;685:7;681:23;677:32;674:52;;;722:1;719;712:12;674:52;-1:-1:-1;745:23:21;;594:180;-1:-1:-1;594:180:21:o;779:184::-;849:6;902:2;890:9;881:7;877:23;873:32;870:52;;;918:1;915;908:12;870:52;-1:-1:-1;941:16:21;;779:184;-1:-1:-1;779:184:21:o;968:315::-;1036:6;1044;1097:2;1085:9;1076:7;1072:23;1068:32;1065:52;;;1113:1;1110;1103:12;1065:52;1149:9;1136:23;1126:33;;1209:2;1198:9;1194:18;1181:32;1222:31;1247:5;1222:31;:::i;:::-;1272:5;1262:15;;;968:315;;;;;:::o;1288:751::-;1392:6;1400;1408;1416;1469:2;1457:9;1448:7;1444:23;1440:32;1437:52;;;1485:1;1482;1475:12;1437:52;1521:9;1508:23;1498:33;;1578:2;1567:9;1563:18;1550:32;1540:42;;1633:2;1622:9;1618:18;1605:32;1656:18;1697:2;1689:6;1686:14;1683:34;;;1713:1;1710;1703:12;1683:34;1751:6;1740:9;1736:22;1726:32;;1796:7;1789:4;1785:2;1781:13;1777:27;1767:55;;1818:1;1815;1808:12;1767:55;1858:2;1845:16;1884:2;1876:6;1873:14;1870:34;;;1900:1;1897;1890:12;1870:34;1953:7;1948:2;1938:6;1935:1;1931:14;1927:2;1923:23;1919:32;1916:45;1913:65;;;1974:1;1971;1964:12;1913:65;1288:751;;;;-1:-1:-1;;2005:2:21;1997:11;;-1:-1:-1;;;1288:751:21:o;2044:592::-;2157:6;2165;2173;2181;2189;2197;2205;2258:3;2246:9;2237:7;2233:23;2229:33;2226:53;;;2275:1;2272;2265:12;2226:53;-1:-1:-1;;2298:23:21;;;2368:2;2353:18;;2340:32;;-1:-1:-1;2419:2:21;2404:18;;2391:32;;2470:2;2455:18;;2442:32;;-1:-1:-1;2521:3:21;2506:19;;2493:33;;-1:-1:-1;2573:3:21;2558:19;;2545:33;;-1:-1:-1;2625:3:21;2610:19;2597:33;;-1:-1:-1;2044:592:21;-1:-1:-1;2044:592:21:o;6551:356::-;6753:2;6735:21;;;6772:18;;;6765:30;6831:34;6826:2;6811:18;;6804:62;6898:2;6883:18;;6551:356::o;9682:128::-;9722:3;9753:1;9749:6;9746:1;9743:13;9740:39;;;9759:18;;:::i;:::-;-1:-1:-1;9795:9:21;;9682:128::o;9815:168::-;9855:7;9921:1;9917;9913:6;9909:14;9906:1;9903:21;9898:1;9891:9;9884:17;9880:45;9877:71;;;9928:18;;:::i;:::-;-1:-1:-1;9968:9:21;;9815:168::o;9988:125::-;10028:4;10056:1;10053;10050:8;10047:34;;;10061:18;;:::i;:::-;-1:-1:-1;10098:9:21;;9988:125::o;10118:135::-;10157:3;-1:-1:-1;;10178:17:21;;10175:43;;;10198:18;;:::i;:::-;-1:-1:-1;10245:1:21;10234:13;;10118:135::o;10258:127::-;10319:10;10314:3;10310:20;10307:1;10300:31;10350:4;10347:1;10340:15;10374:4;10371:1;10364:15;10390:127;10451:10;10446:3;10442:20;10439:1;10432:31;10482:4;10479:1;10472:15;10506:4;10503:1;10496:15;10522:131;-1:-1:-1;;;;;10597:31:21;;10587:42;;10577:70;;10643:1;10640;10633:12
Swarm Source
ipfs://7226da893fd921ebe0eb4064431eb796f1035755b7f1a9dd4f3eef1d9d5dd9ef
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.