ERC-721
Overview
Max Total Supply
91 ALTAIRA
Holders
55
Market
Volume (24H)
N/A
Min Price (24H)
N/A
Max Price (24H)
N/A
Other Info
Token Contract
Balance
2 ALTAIRALoading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
Contract Name:
AltairaGuildMembership
Compiler Version
v0.8.18+commit.87f61d96
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
//SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/access/AccessControl.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/token/common/ERC2981.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; contract AltairaGuildMembership is ERC721Enumerable, ERC2981, AccessControl, ReentrancyGuard, Ownable { using Address for address payable; bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE"); bytes32 public constant ROYALTY_ADJUSTER_ROLE = keccak256("ROYALTY_ADJUSTER_ROLE"); bytes32 public constant PRICE_ADJUSTER_ROLE = keccak256("PRICE_ADJUSTER_ROLE"); bytes32 public constant BASEURI_ROLE = keccak256("BASEURI_ROLE"); bytes32 public constant MINT_ENABLE_ROLE = keccak256("MINT_ENABLE_ROLE"); bytes32 public constant BENEFICIARY_ROLE = keccak256("BENEFICIARY_ROLE"); bytes32 public constant WHITELIST_ADMIN_ROLE = keccak256("WHITELIST_ADMIN_ROLE"); enum Kingdom { Thearan, Sindarian, Elven, Kindred } enum Gender { Male, Female } uint public constant START_TOKEN_ID = 1; uint public constant MIN_TIER = 1; //can only be 1, assumptions in array iterations uint public constant MAX_TIER = 6; uint public constant NUM_GENDERS = 2; uint public constant NUM_KINGDOMS = 4; uint public immutable mint_per_gender; uint[MAX_TIER] public tierQuantities; uint[MAX_TIER] public tierOffsets; mapping(uint => uint) private _minted; mapping(Kingdom => bool) public mintingEnabled; mapping(Kingdom => bool) public whitelistMintingEnabled; mapping(address => bool) public whitelist; mapping(address => bool) public whitelistSigner; string public baseUri; uint[MAX_TIER] public pricePerTokenPerTier; event PricesUpdated(uint[MAX_TIER] prevPrices, uint[MAX_TIER] newPrices); event BaseUriUpdated(string prevUri, string newUri); event KingdomMintingUpdated(Kingdom kingdom, bool enabled, bool whitelistEnabled); constructor(string memory _baseUri, address _minter, address _admin, uint[MAX_TIER] memory _tierQuantities) ERC721("Altaira Guild Membership", "ALTAIRA") { _transferOwnership(_minter); //for easy OpenSea admin. _grantRole(DEFAULT_ADMIN_ROLE, _admin); _grantRole(MINTER_ROLE, _minter); _grantRole(ROYALTY_ADJUSTER_ROLE, _admin); _grantRole(PRICE_ADJUSTER_ROLE, _admin); _grantRole(BASEURI_ROLE, _admin); _grantRole(MINT_ENABLE_ROLE, _admin); _grantRole(WHITELIST_ADMIN_ROLE, _admin); _grantRole(BENEFICIARY_ROLE, _minter); baseUri = _baseUri; uint count = 0; for (uint i = 0; i < MAX_TIER; i++) { tierOffsets[i] = count; count += _tierQuantities[i]; tierQuantities[i] = _tierQuantities[i]; } mint_per_gender = count; whitelistSigner[_admin] = true; } function _tokenOffset(Kingdom _kingdom, Gender _gender, uint _tier) internal view returns (uint) { return (uint(_kingdom) * NUM_GENDERS + uint(_gender)) * mint_per_gender + tierOffsets[_tier - 1] + START_TOKEN_ID; } function getKingdom(uint _tokenId) public view returns (Kingdom) { require(_tokenId >= START_TOKEN_ID, "Token ID too low"); require(_tokenId <= mint_per_gender * NUM_KINGDOMS * NUM_GENDERS, "Token ID too high"); return Kingdom((_tokenId - START_TOKEN_ID) / (mint_per_gender * NUM_GENDERS)); } function getGender(uint _tokenId) public view returns (Gender) { require(_tokenId >= START_TOKEN_ID, "Token ID too low"); require(_tokenId <= mint_per_gender * NUM_KINGDOMS * NUM_GENDERS, "Token ID too high"); return Gender((_tokenId - START_TOKEN_ID) / mint_per_gender % NUM_GENDERS); } function getTier(uint _tokenId) public view returns (uint) { require(_tokenId >= START_TOKEN_ID, "Token ID too low"); require(_tokenId <= mint_per_gender * NUM_KINGDOMS * NUM_GENDERS, "Token ID too high"); uint tierOffset = (_tokenId - START_TOKEN_ID) % mint_per_gender; for (uint tier = MIN_TIER; tier < MAX_TIER; tier++) { if (tierOffset < tierOffsets[tier]) {// Offset smaller than that of NEXT tier! return tier; } } return MAX_TIER; } function minted(Kingdom _kingdom, Gender _gender, uint _tier) public view returns (uint) { return _minted[_tokenOffset(_kingdom, _gender, _tier)]; } function getMintingEnabled() public view returns (bool[NUM_KINGDOMS] memory) { bool[NUM_KINGDOMS] memory allEnabled; for (uint k = 0; k < NUM_KINGDOMS; k++) { allEnabled[k] = mintingEnabled[Kingdom(k)]; } return allEnabled; } function getWhitelistMintingEnabled() public view returns (bool[NUM_KINGDOMS] memory) { bool[NUM_KINGDOMS] memory allEnabled; for (uint k = 0; k < NUM_KINGDOMS; k++) { allEnabled[k] = whitelistMintingEnabled[Kingdom(k)]; } return allEnabled; } function pricesPerTokenPerTier() public view returns (uint[MAX_TIER] memory) { return pricePerTokenPerTier; } function remainingTokens() public view returns (uint[MAX_TIER][NUM_KINGDOMS] memory) { uint[MAX_TIER][NUM_KINGDOMS] memory remaining; for (uint k = 0; k < NUM_KINGDOMS; k++) { for (uint tier = MIN_TIER; tier <= MAX_TIER; tier++) { remaining[k][tier - 1] = tierQuantities[tier - 1] * NUM_GENDERS - minted(Kingdom(k), Gender.Male, tier) - minted(Kingdom(k), Gender.Female, tier); } } return remaining; } function mintFor(address destination, uint256 quantity, Kingdom kingdom, Gender gender, uint tier) external onlyRole(MINTER_ROLE) { uint tokenBucket = _tokenOffset(kingdom, gender, tier); require(_minted[tokenBucket] + quantity <= tierQuantities[tier - 1], "Kingdom/Gender/Tier combination is sold out"); require(tier >= MIN_TIER, "Tier too low"); require(tier <= MAX_TIER, "Tier too high"); uint startId = _minted[tokenBucket] + tokenBucket; uint maxId = quantity + startId; _minted[tokenBucket] += quantity; for (uint i = startId; i < maxId; i++) { _safeMint(destination, i); } } function withdraw(address payable destination) external onlyRole(BENEFICIARY_ROLE) { destination.sendValue(address(this).balance); } function purchase(address destination, uint256 quantity, Kingdom kingdom, uint tier) external payable nonReentrant { bool kingdomEnabled = mintingEnabled[kingdom]; if (!kingdomEnabled) { bool whitelistEnabled = whitelistMintingEnabled[kingdom]; require(whitelistEnabled, "Minting disabled for Kingdom"); bool userIsWhitelisted = whitelist[msg.sender]; require(userIsWhitelisted, "Your account is not whitelisted"); } _purchase(destination, quantity, kingdom, tier); } function purchaseSignedWhitelist(address destination, uint256 quantity, Kingdom kingdom, uint tier, bytes calldata signature) external payable nonReentrant { bool whitelistEnabled = whitelistMintingEnabled[kingdom]; require(whitelistEnabled, "Minting disabled for Kingdom"); bytes32 data = keccak256(abi.encodePacked(address(this), this.purchaseSignedWhitelist.selector, destination)); bytes32 hash = ECDSA.toEthSignedMessageHash(data); address signer = ECDSA.recover(hash, signature); bool userIsWhitelisted = whitelistSigner[signer]; require(userIsWhitelisted, "Your account is not whitelisted"); _purchase(destination, quantity, kingdom, tier); } function _purchase(address destination, uint256 quantity, Kingdom kingdom, uint tier) internal { require(quantity < 21, "You can purchase a maximum of 20 NFTs"); require(msg.value >= pricePerTokenPerTier[tier - 1] * quantity, "Ether sent is not correct"); // NOTE: Overpaying makes us just keep all payment! require(tier >= MIN_TIER, "Tier too low"); require(tier <= MAX_TIER, "Tier too high"); uint tokenBucketMale = _tokenOffset(kingdom, Gender.Male, tier); uint tokenBucketFemale = _tokenOffset(kingdom, Gender.Female, tier); uint remainingAtStart = tierQuantities[tier - 1] * NUM_GENDERS - _minted[tokenBucketMale] - _minted[tokenBucketFemale]; require(remainingAtStart >= quantity, "Not enough Tokens of selected Kingdom/Tier"); for (uint i = 0; i < quantity; i++) { Gender genderToMint = _randomGender(remainingAtStart, i, tier, tokenBucketMale); uint tokenBucket = _tokenOffset(kingdom, genderToMint, tier); uint idToMint = _minted[tokenBucket] + tokenBucket; _minted[tokenBucket] += 1; _safeMint(destination, idToMint); } } function _randomGender(uint remainingAtStart, uint i, uint tier, uint tokenBucketMale) internal view returns (Gender) { uint randomvalue = uint(keccak256(abi.encodePacked(i, blockhash(block.number - 1), block.prevrandao))); uint stillRemaining = remainingAtStart - i; uint randomIndex = randomvalue % stillRemaining; if (randomIndex < tierQuantities[tier - 1] - _minted[tokenBucketMale]) { return Gender.Male; } else { return Gender.Female; } } function _baseURI() internal view virtual override returns (string memory) { return baseUri; } function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721Enumerable, ERC2981, AccessControl) returns (bool) { return ERC721Enumerable.supportsInterface(interfaceId) || ERC2981.supportsInterface(interfaceId) || AccessControl.supportsInterface(interfaceId); } function adjustRoyalty(RoyaltyInfo calldata royalty) external onlyRole(ROYALTY_ADJUSTER_ROLE) { if (royalty.receiver == address(0)) { _deleteDefaultRoyalty(); } else { _setDefaultRoyalty(royalty.receiver, royalty.royaltyFraction); } } function adjustPrices(uint[MAX_TIER] memory tierPrices) external onlyRole(PRICE_ADJUSTER_ROLE) { emit PricesUpdated(pricePerTokenPerTier, tierPrices); pricePerTokenPerTier = tierPrices; } function adjustBaseUri(string calldata newBaseUri) external onlyRole(BASEURI_ROLE) { emit BaseUriUpdated(baseUri, newBaseUri); baseUri = newBaseUri; } function setMinting(Kingdom kingdom, bool enabled, bool whitelistEnabled) external onlyRole(MINT_ENABLE_ROLE) { emit KingdomMintingUpdated(kingdom, enabled, whitelistEnabled); mintingEnabled[kingdom] = enabled; whitelistMintingEnabled[kingdom] = whitelistEnabled; } function addToWhitelist(address[] calldata accounts) public onlyRole(WHITELIST_ADMIN_ROLE) { uint len = accounts.length; for (uint i = 0; i < len; i++) { whitelist[accounts[i]] = true; } } function setWhitelistSigner(address[] calldata accounts, bool enable) public onlyRole(WHITELIST_ADMIN_ROLE) { uint len = accounts.length; for (uint i = 0; i < len; i++) { whitelistSigner[accounts[i]] = enable; } } function removeFromWhitelist(address[] memory accounts) public onlyRole(WHITELIST_ADMIN_ROLE) { for (uint i = 0; i < accounts.length; i++) { whitelist[accounts[i]] = false; } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol) pragma solidity ^0.8.0; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { enum Rounding { Down, // Toward negative infinity Up, // Toward infinity Zero // Toward zero } /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a > b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds up instead * of rounding down. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b - 1) / b can overflow on addition, so we distribute. return a == 0 ? 0 : (a - 1) / b + 1; } /** * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0 * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) * with further edits by Uniswap Labs also under MIT license. */ function mulDiv( uint256 x, uint256 y, uint256 denominator ) internal pure returns (uint256 result) { unchecked { // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256 // variables such that product = prod1 * 2^256 + prod0. uint256 prod0; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod0 := mul(x, y) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division. if (prod1 == 0) { return prod0 / denominator; } // Make sure the result is less than 2^256. Also prevents denominator == 0. require(denominator > prod1); /////////////////////////////////////////////// // 512 by 256 division. /////////////////////////////////////////////// // Make division exact by subtracting the remainder from [prod1 prod0]. uint256 remainder; assembly { // Compute remainder using mulmod. remainder := mulmod(x, y, denominator) // Subtract 256 bit number from 512 bit number. prod1 := sub(prod1, gt(remainder, prod0)) prod0 := sub(prod0, remainder) } // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1. // See https://cs.stackexchange.com/q/138556/92363. // Does not overflow because the denominator cannot be zero at this stage in the function. uint256 twos = denominator & (~denominator + 1); assembly { // Divide denominator by twos. denominator := div(denominator, twos) // Divide [prod1 prod0] by twos. prod0 := div(prod0, twos) // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one. twos := add(div(sub(0, twos), twos), 1) } // Shift in bits from prod1 into prod0. prod0 |= prod1 * twos; // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for // four bits. That is, denominator * inv = 1 mod 2^4. uint256 inverse = (3 * denominator) ^ 2; // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works // in modular arithmetic, doubling the correct bits in each step. inverse *= 2 - denominator * inverse; // inverse mod 2^8 inverse *= 2 - denominator * inverse; // inverse mod 2^16 inverse *= 2 - denominator * inverse; // inverse mod 2^32 inverse *= 2 - denominator * inverse; // inverse mod 2^64 inverse *= 2 - denominator * inverse; // inverse mod 2^128 inverse *= 2 - denominator * inverse; // inverse mod 2^256 // Because the division is now exact we can divide by multiplying with the modular inverse of denominator. // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1 // is no longer required. result = prod0 * inverse; return result; } } /** * @notice Calculates x * y / denominator with full precision, following the selected rounding direction. */ function mulDiv( uint256 x, uint256 y, uint256 denominator, Rounding rounding ) internal pure returns (uint256) { uint256 result = mulDiv(x, y, denominator); if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) { result += 1; } return result; } /** * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down. * * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11). */ function sqrt(uint256 a) internal pure returns (uint256) { if (a == 0) { return 0; } // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target. // // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`. // // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)` // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))` // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)` // // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit. uint256 result = 1 << (log2(a) >> 1); // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128, // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision // into the expected uint128 result. unchecked { result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; return min(result, a / result); } } /** * @notice Calculates sqrt(a), following the selected rounding direction. */ function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = sqrt(a); return result + (rounding == Rounding.Up && result * result < a ? 1 : 0); } } /** * @dev Return the log in base 2, rounded down, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 128; } if (value >> 64 > 0) { value >>= 64; result += 64; } if (value >> 32 > 0) { value >>= 32; result += 32; } if (value >> 16 > 0) { value >>= 16; result += 16; } if (value >> 8 > 0) { value >>= 8; result += 8; } if (value >> 4 > 0) { value >>= 4; result += 4; } if (value >> 2 > 0) { value >>= 2; result += 2; } if (value >> 1 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 2, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log2(value); return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0); } } /** * @dev Return the log in base 10, rounded down, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >= 10**64) { value /= 10**64; result += 64; } if (value >= 10**32) { value /= 10**32; result += 32; } if (value >= 10**16) { value /= 10**16; result += 16; } if (value >= 10**8) { value /= 10**8; result += 8; } if (value >= 10**4) { value /= 10**4; result += 4; } if (value >= 10**2) { value /= 10**2; result += 2; } if (value >= 10**1) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log10(value); return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0); } } /** * @dev Return the log in base 256, rounded down, of a positive value. * Returns 0 if given 0. * * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string. */ function log256(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 16; } if (value >> 64 > 0) { value >>= 64; result += 8; } if (value >> 32 > 0) { value >>= 32; result += 4; } if (value >> 16 > 0) { value >>= 16; result += 2; } if (value >> 8 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log256(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log256(value); return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0); } } }
// 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 // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; import "./IERC165.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/ECDSA.sol) pragma solidity ^0.8.0; import "../Strings.sol"; /** * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations. * * These functions can be used to verify that a message was signed by the holder * of the private keys of a given address. */ library ECDSA { enum RecoverError { NoError, InvalidSignature, InvalidSignatureLength, InvalidSignatureS, InvalidSignatureV // Deprecated in v4.8 } function _throwError(RecoverError error) private pure { if (error == RecoverError.NoError) { return; // no error: do nothing } else if (error == RecoverError.InvalidSignature) { revert("ECDSA: invalid signature"); } else if (error == RecoverError.InvalidSignatureLength) { revert("ECDSA: invalid signature length"); } else if (error == RecoverError.InvalidSignatureS) { revert("ECDSA: invalid signature 's' value"); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature` or error string. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. * * Documentation for signature generation: * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js] * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers] * * _Available since v4.3._ */ function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) { if (signature.length == 65) { bytes32 r; bytes32 s; uint8 v; // ecrecover takes the signature parameters, and the only way to get them // currently is to use assembly. /// @solidity memory-safe-assembly assembly { r := mload(add(signature, 0x20)) s := mload(add(signature, 0x40)) v := byte(0, mload(add(signature, 0x60))) } return tryRecover(hash, v, r, s); } else { return (address(0), RecoverError.InvalidSignatureLength); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature`. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. */ function recover(bytes32 hash, bytes memory signature) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, signature); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately. * * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures] * * _Available since v4.3._ */ function tryRecover( bytes32 hash, bytes32 r, bytes32 vs ) internal pure returns (address, RecoverError) { bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff); uint8 v = uint8((uint256(vs) >> 255) + 27); return tryRecover(hash, v, r, s); } /** * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately. * * _Available since v4.2._ */ function recover( bytes32 hash, bytes32 r, bytes32 vs ) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, r, vs); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `v`, * `r` and `s` signature fields separately. * * _Available since v4.3._ */ function tryRecover( bytes32 hash, uint8 v, bytes32 r, bytes32 s ) internal pure returns (address, RecoverError) { // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most // signatures from current libraries generate a unique signature with an s-value in the lower half order. // // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept // these malleable signatures as well. if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) { return (address(0), RecoverError.InvalidSignatureS); } // If the signature is valid (and not malleable), return the signer address address signer = ecrecover(hash, v, r, s); if (signer == address(0)) { return (address(0), RecoverError.InvalidSignature); } return (signer, RecoverError.NoError); } /** * @dev Overload of {ECDSA-recover} that receives the `v`, * `r` and `s` signature fields separately. */ function recover( bytes32 hash, uint8 v, bytes32 r, bytes32 s ) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, v, r, s); _throwError(error); return recovered; } /** * @dev Returns an Ethereum Signed Message, created from a `hash`. This * produces hash corresponding to the one signed with the * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] * JSON-RPC method as part of EIP-191. * * See {recover}. */ function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) { // 32 is the length in bytes of hash, // enforced by the type signature above return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash)); } /** * @dev Returns an Ethereum Signed Message, created from `s`. This * produces hash corresponding to the one signed with the * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] * JSON-RPC method as part of EIP-191. * * See {recover}. */ function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", Strings.toString(s.length), s)); } /** * @dev Returns an Ethereum Signed Typed Data, created from a * `domainSeparator` and a `structHash`. This produces hash corresponding * to the one signed with the * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] * JSON-RPC method as part of EIP-712. * * See {recover}. */ function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol) pragma solidity ^0.8.0; import "./math/Math.sol"; /** * @dev String operations. */ library Strings { bytes16 private constant _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) { unchecked { uint256 length = Math.log10(value) + 1; string memory buffer = new string(length); uint256 ptr; /// @solidity memory-safe-assembly assembly { ptr := add(buffer, add(32, length)) } while (true) { ptr--; /// @solidity memory-safe-assembly assembly { mstore8(ptr, byte(mod(value, 10), _SYMBOLS)) } value /= 10; if (value == 0) break; } return buffer; } } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { unchecked { return toHexString(value, Math.log256(value) + 1); } } /** * @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] = _SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/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.8.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract. * * _Available since v4.8._ */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata, string memory errorMessage ) internal view returns (bytes memory) { if (success) { if (returndata.length == 0) { // only check isContract if the call was successful and the return data is empty // otherwise we already know that it was a contract require(isContract(target), "Address: call to non-contract"); } return returndata; } else { _revert(returndata, errorMessage); } } /** * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason or using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { _revert(returndata, errorMessage); } } function _revert(bytes memory returndata, string memory errorMessage) private pure { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (token/common/ERC2981.sol) pragma solidity ^0.8.0; import "../../interfaces/IERC2981.sol"; import "../../utils/introspection/ERC165.sol"; /** * @dev Implementation of the NFT Royalty Standard, a standardized way to retrieve royalty payment information. * * Royalty information can be specified globally for all token ids via {_setDefaultRoyalty}, and/or individually for * specific token ids via {_setTokenRoyalty}. The latter takes precedence over the first. * * Royalty is specified as a fraction of sale price. {_feeDenominator} is overridable but defaults to 10000, meaning the * fee is specified in basis points by default. * * IMPORTANT: ERC-2981 only specifies a way to signal royalty information and does not enforce its payment. See * https://eips.ethereum.org/EIPS/eip-2981#optional-royalty-payments[Rationale] in the EIP. Marketplaces are expected to * voluntarily pay royalties together with sales, but note that this standard is not yet widely supported. * * _Available since v4.5._ */ abstract contract ERC2981 is IERC2981, ERC165 { struct RoyaltyInfo { address receiver; uint96 royaltyFraction; } RoyaltyInfo private _defaultRoyaltyInfo; mapping(uint256 => RoyaltyInfo) private _tokenRoyaltyInfo; /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC165) returns (bool) { return interfaceId == type(IERC2981).interfaceId || super.supportsInterface(interfaceId); } /** * @inheritdoc IERC2981 */ function royaltyInfo(uint256 _tokenId, uint256 _salePrice) public view virtual override returns (address, uint256) { RoyaltyInfo memory royalty = _tokenRoyaltyInfo[_tokenId]; if (royalty.receiver == address(0)) { royalty = _defaultRoyaltyInfo; } uint256 royaltyAmount = (_salePrice * royalty.royaltyFraction) / _feeDenominator(); return (royalty.receiver, royaltyAmount); } /** * @dev The denominator with which to interpret the fee set in {_setTokenRoyalty} and {_setDefaultRoyalty} as a * fraction of the sale price. Defaults to 10000 so fees are expressed in basis points, but may be customized by an * override. */ function _feeDenominator() internal pure virtual returns (uint96) { return 10000; } /** * @dev Sets the royalty information that all ids in this contract will default to. * * Requirements: * * - `receiver` cannot be the zero address. * - `feeNumerator` cannot be greater than the fee denominator. */ function _setDefaultRoyalty(address receiver, uint96 feeNumerator) internal virtual { require(feeNumerator <= _feeDenominator(), "ERC2981: royalty fee will exceed salePrice"); require(receiver != address(0), "ERC2981: invalid receiver"); _defaultRoyaltyInfo = RoyaltyInfo(receiver, feeNumerator); } /** * @dev Removes default royalty information. */ function _deleteDefaultRoyalty() internal virtual { delete _defaultRoyaltyInfo; } /** * @dev Sets the royalty information for a specific token id, overriding the global default. * * Requirements: * * - `receiver` cannot be the zero address. * - `feeNumerator` cannot be greater than the fee denominator. */ function _setTokenRoyalty( uint256 tokenId, address receiver, uint96 feeNumerator ) internal virtual { require(feeNumerator <= _feeDenominator(), "ERC2981: royalty fee will exceed salePrice"); require(receiver != address(0), "ERC2981: Invalid parameters"); _tokenRoyaltyInfo[tokenId] = RoyaltyInfo(receiver, feeNumerator); } /** * @dev Resets royalty information for the token id back to the global default. */ function _resetTokenRoyalty(uint256 tokenId) internal virtual { delete _tokenRoyaltyInfo[tokenId]; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol) pragma solidity ^0.8.0; import "../IERC721.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional metadata extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721Metadata is IERC721 { /** * @dev Returns the token collection name. */ function name() external view returns (string memory); /** * @dev Returns the token collection symbol. */ function symbol() external view returns (string memory); /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ function tokenURI(uint256 tokenId) external view returns (string memory); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/extensions/IERC721Enumerable.sol) pragma solidity ^0.8.0; import "../IERC721.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721Enumerable is IERC721 { /** * @dev Returns the total amount of tokens stored by the contract. */ function totalSupply() external view returns (uint256); /** * @dev Returns a token ID owned by `owner` at a given `index` of its token list. * Use along with {balanceOf} to enumerate all of ``owner``'s tokens. */ function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256); /** * @dev Returns a token ID at a given `index` of all the tokens stored by the contract. * Use along with {totalSupply} to enumerate all tokens. */ function tokenByIndex(uint256 index) external view returns (uint256); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/extensions/ERC721Enumerable.sol) pragma solidity ^0.8.0; import "../ERC721.sol"; import "./IERC721Enumerable.sol"; /** * @dev This implements an optional extension of {ERC721} defined in the EIP that adds * enumerability of all the token ids in the contract as well as all token ids owned by each * account. */ abstract contract ERC721Enumerable is ERC721, IERC721Enumerable { // Mapping from owner to list of owned token IDs mapping(address => mapping(uint256 => uint256)) private _ownedTokens; // Mapping from token ID to index of the owner tokens list mapping(uint256 => uint256) private _ownedTokensIndex; // Array with all token ids, used for enumeration uint256[] private _allTokens; // Mapping from token id to position in the allTokens array mapping(uint256 => uint256) private _allTokensIndex; /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721) returns (bool) { return interfaceId == type(IERC721Enumerable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}. */ function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override returns (uint256) { require(index < ERC721.balanceOf(owner), "ERC721Enumerable: owner index out of bounds"); return _ownedTokens[owner][index]; } /** * @dev See {IERC721Enumerable-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _allTokens.length; } /** * @dev See {IERC721Enumerable-tokenByIndex}. */ function tokenByIndex(uint256 index) public view virtual override returns (uint256) { require(index < ERC721Enumerable.totalSupply(), "ERC721Enumerable: global index out of bounds"); return _allTokens[index]; } /** * @dev See {ERC721-_beforeTokenTransfer}. */ function _beforeTokenTransfer( address from, address to, uint256 firstTokenId, uint256 batchSize ) internal virtual override { super._beforeTokenTransfer(from, to, firstTokenId, batchSize); if (batchSize > 1) { // Will only trigger during construction. Batch transferring (minting) is not available afterwards. revert("ERC721Enumerable: consecutive transfers not supported"); } uint256 tokenId = firstTokenId; if (from == address(0)) { _addTokenToAllTokensEnumeration(tokenId); } else if (from != to) { _removeTokenFromOwnerEnumeration(from, tokenId); } if (to == address(0)) { _removeTokenFromAllTokensEnumeration(tokenId); } else if (to != from) { _addTokenToOwnerEnumeration(to, tokenId); } } /** * @dev Private function to add a token to this extension's ownership-tracking data structures. * @param to address representing the new owner of the given token ID * @param tokenId uint256 ID of the token to be added to the tokens list of the given address */ function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private { uint256 length = ERC721.balanceOf(to); _ownedTokens[to][length] = tokenId; _ownedTokensIndex[tokenId] = length; } /** * @dev Private function to add a token to this extension's token tracking data structures. * @param tokenId uint256 ID of the token to be added to the tokens list */ function _addTokenToAllTokensEnumeration(uint256 tokenId) private { _allTokensIndex[tokenId] = _allTokens.length; _allTokens.push(tokenId); } /** * @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that * while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for * gas optimizations e.g. when performing a transfer operation (avoiding double writes). * This has O(1) time complexity, but alters the order of the _ownedTokens array. * @param from address representing the previous owner of the given token ID * @param tokenId uint256 ID of the token to be removed from the tokens list of the given address */ function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private { // To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and // then delete the last slot (swap and pop). uint256 lastTokenIndex = ERC721.balanceOf(from) - 1; uint256 tokenIndex = _ownedTokensIndex[tokenId]; // When the token to delete is the last token, the swap operation is unnecessary if (tokenIndex != lastTokenIndex) { uint256 lastTokenId = _ownedTokens[from][lastTokenIndex]; _ownedTokens[from][tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token _ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index } // This also deletes the contents at the last position of the array delete _ownedTokensIndex[tokenId]; delete _ownedTokens[from][lastTokenIndex]; } /** * @dev Private function to remove a token from this extension's token tracking data structures. * This has O(1) time complexity, but alters the order of the _allTokens array. * @param tokenId uint256 ID of the token to be removed from the tokens list */ function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private { // To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and // then delete the last slot (swap and pop). uint256 lastTokenIndex = _allTokens.length - 1; uint256 tokenIndex = _allTokensIndex[tokenId]; // When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so // rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding // an 'if' statement (like in _removeTokenFromOwnerEnumeration) uint256 lastTokenId = _allTokens[lastTokenIndex]; _allTokens[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token _allTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index // This also deletes the contents at the last position of the array delete _allTokensIndex[tokenId]; _allTokens.pop(); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol) pragma solidity ^0.8.0; /** * @title ERC721 token receiver interface * @dev Interface for any contract that wants to support safeTransfers * from ERC721 asset contracts. */ interface IERC721Receiver { /** * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom} * by `operator` from `from`, this function is called. * * It must return its Solidity selector to confirm the token transfer. * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted. * * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`. */ function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/IERC721.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721 is IERC165 { /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes calldata data ) external; /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Transfers `tokenId` token from `from` to `to`. * * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721 * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must * understand this adds an external call which potentially creates a reentrancy vulnerability. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool _approved) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/ERC721.sol) pragma solidity ^0.8.0; import "./IERC721.sol"; import "./IERC721Receiver.sol"; import "./extensions/IERC721Metadata.sol"; import "../../utils/Address.sol"; import "../../utils/Context.sol"; import "../../utils/Strings.sol"; import "../../utils/introspection/ERC165.sol"; /** * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including * the Metadata extension, but not including the Enumerable extension, which is available separately as * {ERC721Enumerable}. */ contract ERC721 is Context, ERC165, IERC721, IERC721Metadata { using Address for address; using Strings for uint256; // Token name string private _name; // Token symbol string private _symbol; // Mapping from token ID to owner address mapping(uint256 => address) private _owners; // Mapping owner address to token count mapping(address => uint256) private _balances; // Mapping from token ID to approved address mapping(uint256 => address) private _tokenApprovals; // Mapping from owner to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; /** * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection. */ constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IERC721).interfaceId || interfaceId == type(IERC721Metadata).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721-balanceOf}. */ function balanceOf(address owner) public view virtual override returns (uint256) { require(owner != address(0), "ERC721: address zero is not a valid owner"); return _balances[owner]; } /** * @dev See {IERC721-ownerOf}. */ function ownerOf(uint256 tokenId) public view virtual override returns (address) { address owner = _ownerOf(tokenId); require(owner != address(0), "ERC721: invalid token ID"); return owner; } /** * @dev See {IERC721Metadata-name}. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev See {IERC721Metadata-symbol}. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { _requireMinted(tokenId); string memory baseURI = _baseURI(); return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : ""; } /** * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each * token will be the concatenation of the `baseURI` and the `tokenId`. Empty * by default, can be overridden in child contracts. */ function _baseURI() internal view virtual returns (string memory) { return ""; } /** * @dev See {IERC721-approve}. */ function approve(address to, uint256 tokenId) public virtual override { address owner = ERC721.ownerOf(tokenId); require(to != owner, "ERC721: approval to current owner"); require( _msgSender() == owner || isApprovedForAll(owner, _msgSender()), "ERC721: approve caller is not token owner or approved for all" ); _approve(to, tokenId); } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view virtual override returns (address) { _requireMinted(tokenId); return _tokenApprovals[tokenId]; } /** * @dev See {IERC721-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { _setApprovalForAll(_msgSender(), operator, approved); } /** * @dev See {IERC721-isApprovedForAll}. */ function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { return _operatorApprovals[owner][operator]; } /** * @dev See {IERC721-transferFrom}. */ function transferFrom( address from, address to, uint256 tokenId ) public virtual override { //solhint-disable-next-line max-line-length require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner or approved"); _transfer(from, to, tokenId); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId ) public virtual override { safeTransferFrom(from, to, tokenId, ""); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory data ) public virtual override { require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner or approved"); _safeTransfer(from, to, tokenId, data); } /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * `data` is additional data, it has no specified format and it is sent in call to `to`. * * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g. * implement alternative mechanisms to perform token transfer, such as signature-based. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeTransfer( address from, address to, uint256 tokenId, bytes memory data ) internal virtual { _transfer(from, to, tokenId); require(_checkOnERC721Received(from, to, tokenId, data), "ERC721: transfer to non ERC721Receiver implementer"); } /** * @dev Returns the owner of the `tokenId`. Does NOT revert if token doesn't exist */ function _ownerOf(uint256 tokenId) internal view virtual returns (address) { return _owners[tokenId]; } /** * @dev Returns whether `tokenId` exists. * * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}. * * Tokens start existing when they are minted (`_mint`), * and stop existing when they are burned (`_burn`). */ function _exists(uint256 tokenId) internal view virtual returns (bool) { return _ownerOf(tokenId) != address(0); } /** * @dev Returns whether `spender` is allowed to manage `tokenId`. * * Requirements: * * - `tokenId` must exist. */ function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) { address owner = ERC721.ownerOf(tokenId); return (spender == owner || isApprovedForAll(owner, spender) || getApproved(tokenId) == spender); } /** * @dev Safely mints `tokenId` and transfers it to `to`. * * Requirements: * * - `tokenId` must not exist. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeMint(address to, uint256 tokenId) internal virtual { _safeMint(to, tokenId, ""); } /** * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is * forwarded in {IERC721Receiver-onERC721Received} to contract recipients. */ function _safeMint( address to, uint256 tokenId, bytes memory data ) internal virtual { _mint(to, tokenId); require( _checkOnERC721Received(address(0), to, tokenId, data), "ERC721: transfer to non ERC721Receiver implementer" ); } /** * @dev Mints `tokenId` and transfers it to `to`. * * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible * * Requirements: * * - `tokenId` must not exist. * - `to` cannot be the zero address. * * Emits a {Transfer} event. */ function _mint(address to, uint256 tokenId) internal virtual { require(to != address(0), "ERC721: mint to the zero address"); require(!_exists(tokenId), "ERC721: token already minted"); _beforeTokenTransfer(address(0), to, tokenId, 1); // Check that tokenId was not minted by `_beforeTokenTransfer` hook require(!_exists(tokenId), "ERC721: token already minted"); unchecked { // Will not overflow unless all 2**256 token ids are minted to the same owner. // Given that tokens are minted one by one, it is impossible in practice that // this ever happens. Might change if we allow batch minting. // The ERC fails to describe this case. _balances[to] += 1; } _owners[tokenId] = to; emit Transfer(address(0), to, tokenId); _afterTokenTransfer(address(0), to, tokenId, 1); } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * This is an internal function that does not check if the sender is authorized to operate on the token. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId) internal virtual { address owner = ERC721.ownerOf(tokenId); _beforeTokenTransfer(owner, address(0), tokenId, 1); // Update ownership in case tokenId was transferred by `_beforeTokenTransfer` hook owner = ERC721.ownerOf(tokenId); // Clear approvals delete _tokenApprovals[tokenId]; unchecked { // Cannot overflow, as that would require more tokens to be burned/transferred // out than the owner initially received through minting and transferring in. _balances[owner] -= 1; } delete _owners[tokenId]; emit Transfer(owner, address(0), tokenId); _afterTokenTransfer(owner, address(0), tokenId, 1); } /** * @dev Transfers `tokenId` from `from` to `to`. * As opposed to {transferFrom}, this imposes no restrictions on msg.sender. * * Requirements: * * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * * Emits a {Transfer} event. */ function _transfer( address from, address to, uint256 tokenId ) internal virtual { require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner"); require(to != address(0), "ERC721: transfer to the zero address"); _beforeTokenTransfer(from, to, tokenId, 1); // Check that tokenId was not transferred by `_beforeTokenTransfer` hook require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner"); // Clear approvals from the previous owner delete _tokenApprovals[tokenId]; unchecked { // `_balances[from]` cannot overflow for the same reason as described in `_burn`: // `from`'s balance is the number of token held, which is at least one before the current // transfer. // `_balances[to]` could overflow in the conditions described in `_mint`. That would require // all 2**256 token ids to be minted, which in practice is impossible. _balances[from] -= 1; _balances[to] += 1; } _owners[tokenId] = to; emit Transfer(from, to, tokenId); _afterTokenTransfer(from, to, tokenId, 1); } /** * @dev Approve `to` to operate on `tokenId` * * Emits an {Approval} event. */ function _approve(address to, uint256 tokenId) internal virtual { _tokenApprovals[tokenId] = to; emit Approval(ERC721.ownerOf(tokenId), to, tokenId); } /** * @dev Approve `operator` to operate on all of `owner` tokens * * Emits an {ApprovalForAll} event. */ function _setApprovalForAll( address owner, address operator, bool approved ) internal virtual { require(owner != operator, "ERC721: approve to caller"); _operatorApprovals[owner][operator] = approved; emit ApprovalForAll(owner, operator, approved); } /** * @dev Reverts if the `tokenId` has not been minted yet. */ function _requireMinted(uint256 tokenId) internal view virtual { require(_exists(tokenId), "ERC721: invalid token ID"); } /** * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address. * The call is not executed if the target address is not a contract. * * @param from address representing the previous owner of the given token ID * @param to target address that will receive the tokens * @param tokenId uint256 ID of the token to be transferred * @param data bytes optional data to send along with the call * @return bool whether the call correctly returned the expected magic value */ function _checkOnERC721Received( address from, address to, uint256 tokenId, bytes memory data ) private returns (bool) { if (to.isContract()) { try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, data) returns (bytes4 retval) { return retval == IERC721Receiver.onERC721Received.selector; } catch (bytes memory reason) { if (reason.length == 0) { revert("ERC721: transfer to non ERC721Receiver implementer"); } else { /// @solidity memory-safe-assembly assembly { revert(add(32, reason), mload(reason)) } } } } else { return true; } } /** * @dev Hook that is called before any token transfer. This includes minting and burning. If {ERC721Consecutive} is * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s tokens will be transferred to `to`. * - When `from` is zero, the tokens will be minted for `to`. * - When `to` is zero, ``from``'s tokens will be burned. * - `from` and `to` are never both zero. * - `batchSize` is non-zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256, /* firstTokenId */ uint256 batchSize ) internal virtual { if (batchSize > 1) { if (from != address(0)) { _balances[from] -= batchSize; } if (to != address(0)) { _balances[to] += batchSize; } } } /** * @dev Hook that is called after any token transfer. This includes minting and burning. If {ERC721Consecutive} is * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s tokens were transferred to `to`. * - When `from` is zero, the tokens were minted for `to`. * - When `to` is zero, ``from``'s tokens were burned. * - `from` and `to` are never both zero. * - `batchSize` is non-zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _afterTokenTransfer( address from, address to, uint256 firstTokenId, uint256 batchSize ) internal virtual {} }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (security/ReentrancyGuard.sol) pragma solidity ^0.8.0; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; constructor() { _status = _NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { _nonReentrantBefore(); _; _nonReentrantAfter(); } function _nonReentrantBefore() private { // On the first call to nonReentrant, _status will be _NOT_ENTERED require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; } function _nonReentrantAfter() private { // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (interfaces/IERC2981.sol) pragma solidity ^0.8.0; import "../utils/introspection/IERC165.sol"; /** * @dev Interface for the NFT Royalty Standard. * * A standardized way to retrieve royalty payment information for non-fungible tokens (NFTs) to enable universal * support for royalty payments across all NFT marketplaces and ecosystem participants. * * _Available since v4.5._ */ interface IERC2981 is IERC165 { /** * @dev Returns how much royalty is owed and to whom, based on a sale price that may be denominated in any unit of * exchange. The royalty amount is denominated and should be paid in that same unit of exchange. */ function royaltyInfo(uint256 tokenId, uint256 salePrice) external view returns (address receiver, uint256 royaltyAmount); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _transferOwnership(_msgSender()); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { require(owner() == _msgSender(), "Ownable: caller is not the owner"); } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol) pragma solidity ^0.8.0; /** * @dev External interface of AccessControl declared to support ERC165 detection. */ interface IAccessControl { /** * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` * * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite * {RoleAdminChanged} not being emitted signaling this. * * _Available since v3.1._ */ event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole); /** * @dev Emitted when `account` is granted `role`. * * `sender` is the account that originated the contract call, an admin role * bearer except when using {AccessControl-_setupRole}. */ event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Emitted when `account` is revoked `role`. * * `sender` is the account that originated the contract call: * - if using `revokeRole`, it is the admin role bearer * - if using `renounceRole`, it is the role bearer (i.e. `account`) */ event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) external view returns (bool); /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {AccessControl-_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) external view returns (bytes32); /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function grantRole(bytes32 role, address account) external; /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function revokeRole(bytes32 role, address account) external; /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been granted `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. */ function renounceRole(bytes32 role, address account) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (access/AccessControl.sol) pragma solidity ^0.8.0; import "./IAccessControl.sol"; import "../utils/Context.sol"; import "../utils/Strings.sol"; import "../utils/introspection/ERC165.sol"; /** * @dev Contract module that allows children to implement role-based access * control mechanisms. This is a lightweight version that doesn't allow enumerating role * members except through off-chain means by accessing the contract event logs. Some * applications may benefit from on-chain enumerability, for those cases see * {AccessControlEnumerable}. * * Roles are referred to by their `bytes32` identifier. These should be exposed * in the external API and be unique. The best way to achieve this is by * using `public constant` hash digests: * * ``` * bytes32 public constant MY_ROLE = keccak256("MY_ROLE"); * ``` * * Roles can be used to represent a set of permissions. To restrict access to a * function call, use {hasRole}: * * ``` * function foo() public { * require(hasRole(MY_ROLE, msg.sender)); * ... * } * ``` * * Roles can be granted and revoked dynamically via the {grantRole} and * {revokeRole} functions. Each role has an associated admin role, and only * accounts that have a role's admin role can call {grantRole} and {revokeRole}. * * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means * that only accounts with this role will be able to grant or revoke other * roles. More complex role relationships can be created by using * {_setRoleAdmin}. * * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to * grant and revoke this role. Extra precautions should be taken to secure * accounts that have been granted it. */ abstract contract AccessControl is Context, IAccessControl, ERC165 { struct RoleData { mapping(address => bool) members; bytes32 adminRole; } mapping(bytes32 => RoleData) private _roles; bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /** * @dev Modifier that checks that an account has a specific role. Reverts * with a standardized message including the required role. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ * * _Available since v4.1._ */ modifier onlyRole(bytes32 role) { _checkRole(role); _; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) public view virtual override returns (bool) { return _roles[role].members[account]; } /** * @dev Revert with a standard message if `_msgSender()` is missing `role`. * Overriding this function changes the behavior of the {onlyRole} modifier. * * Format of the revert message is described in {_checkRole}. * * _Available since v4.6._ */ function _checkRole(bytes32 role) internal view virtual { _checkRole(role, _msgSender()); } /** * @dev Revert with a standard message if `account` is missing `role`. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ */ function _checkRole(bytes32 role, address account) internal view virtual { if (!hasRole(role, account)) { revert( string( abi.encodePacked( "AccessControl: account ", Strings.toHexString(account), " is missing role ", Strings.toHexString(uint256(role), 32) ) ) ); } } /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) { return _roles[role].adminRole; } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. * * May emit a {RoleGranted} event. */ function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _grantRole(role, account); } /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. * * May emit a {RoleRevoked} event. */ function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _revokeRole(role, account); } /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been revoked `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. * * May emit a {RoleRevoked} event. */ function renounceRole(bytes32 role, address account) public virtual override { require(account == _msgSender(), "AccessControl: can only renounce roles for self"); _revokeRole(role, account); } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. Note that unlike {grantRole}, this function doesn't perform any * checks on the calling account. * * May emit a {RoleGranted} event. * * [WARNING] * ==== * This function should only be called from the constructor when setting * up the initial roles for the system. * * Using this function in any other way is effectively circumventing the admin * system imposed by {AccessControl}. * ==== * * NOTE: This function is deprecated in favor of {_grantRole}. */ function _setupRole(bytes32 role, address account) internal virtual { _grantRole(role, account); } /** * @dev Sets `adminRole` as ``role``'s admin role. * * Emits a {RoleAdminChanged} event. */ function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual { bytes32 previousAdminRole = getRoleAdmin(role); _roles[role].adminRole = adminRole; emit RoleAdminChanged(role, previousAdminRole, adminRole); } /** * @dev Grants `role` to `account`. * * Internal function without access restriction. * * May emit a {RoleGranted} event. */ function _grantRole(bytes32 role, address account) internal virtual { if (!hasRole(role, account)) { _roles[role].members[account] = true; emit RoleGranted(role, account, _msgSender()); } } /** * @dev Revokes `role` from `account`. * * Internal function without access restriction. * * May emit a {RoleRevoked} event. */ function _revokeRole(bytes32 role, address account) internal virtual { if (hasRole(role, account)) { _roles[role].members[account] = false; emit RoleRevoked(role, account, _msgSender()); } } }
{ "remappings": [], "optimizer": { "enabled": true, "runs": 200 }, "evmVersion": "paris", "libraries": {}, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"string","name":"_baseUri","type":"string"},{"internalType":"address","name":"_minter","type":"address"},{"internalType":"address","name":"_admin","type":"address"},{"internalType":"uint256[6]","name":"_tierQuantities","type":"uint256[6]"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"prevUri","type":"string"},{"indexed":false,"internalType":"string","name":"newUri","type":"string"}],"name":"BaseUriUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"enum AltairaGuildMembership.Kingdom","name":"kingdom","type":"uint8"},{"indexed":false,"internalType":"bool","name":"enabled","type":"bool"},{"indexed":false,"internalType":"bool","name":"whitelistEnabled","type":"bool"}],"name":"KingdomMintingUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256[6]","name":"prevPrices","type":"uint256[6]"},{"indexed":false,"internalType":"uint256[6]","name":"newPrices","type":"uint256[6]"}],"name":"PricesUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"BASEURI_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"BENEFICIARY_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_TIER","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MINTER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MINT_ENABLE_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MIN_TIER","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"NUM_GENDERS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"NUM_KINGDOMS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PRICE_ADJUSTER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ROYALTY_ADJUSTER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"START_TOKEN_ID","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WHITELIST_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"accounts","type":"address[]"}],"name":"addToWhitelist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"newBaseUri","type":"string"}],"name":"adjustBaseUri","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[6]","name":"tierPrices","type":"uint256[6]"}],"name":"adjustPrices","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint96","name":"royaltyFraction","type":"uint96"}],"internalType":"struct ERC2981.RoyaltyInfo","name":"royalty","type":"tuple"}],"name":"adjustRoyalty","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"baseUri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"getGender","outputs":[{"internalType":"enum AltairaGuildMembership.Gender","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"getKingdom","outputs":[{"internalType":"enum AltairaGuildMembership.Kingdom","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getMintingEnabled","outputs":[{"internalType":"bool[4]","name":"","type":"bool[4]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"getTier","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getWhitelistMintingEnabled","outputs":[{"internalType":"bool[4]","name":"","type":"bool[4]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"destination","type":"address"},{"internalType":"uint256","name":"quantity","type":"uint256"},{"internalType":"enum AltairaGuildMembership.Kingdom","name":"kingdom","type":"uint8"},{"internalType":"enum AltairaGuildMembership.Gender","name":"gender","type":"uint8"},{"internalType":"uint256","name":"tier","type":"uint256"}],"name":"mintFor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"mint_per_gender","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"enum AltairaGuildMembership.Kingdom","name":"_kingdom","type":"uint8"},{"internalType":"enum AltairaGuildMembership.Gender","name":"_gender","type":"uint8"},{"internalType":"uint256","name":"_tier","type":"uint256"}],"name":"minted","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"enum AltairaGuildMembership.Kingdom","name":"","type":"uint8"}],"name":"mintingEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"pricePerTokenPerTier","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pricesPerTokenPerTier","outputs":[{"internalType":"uint256[6]","name":"","type":"uint256[6]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"destination","type":"address"},{"internalType":"uint256","name":"quantity","type":"uint256"},{"internalType":"enum AltairaGuildMembership.Kingdom","name":"kingdom","type":"uint8"},{"internalType":"uint256","name":"tier","type":"uint256"}],"name":"purchase","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"destination","type":"address"},{"internalType":"uint256","name":"quantity","type":"uint256"},{"internalType":"enum AltairaGuildMembership.Kingdom","name":"kingdom","type":"uint8"},{"internalType":"uint256","name":"tier","type":"uint256"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"purchaseSignedWhitelist","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"remainingTokens","outputs":[{"internalType":"uint256[6][4]","name":"","type":"uint256[6][4]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"accounts","type":"address[]"}],"name":"removeFromWhitelist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_salePrice","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"enum AltairaGuildMembership.Kingdom","name":"kingdom","type":"uint8"},{"internalType":"bool","name":"enabled","type":"bool"},{"internalType":"bool","name":"whitelistEnabled","type":"bool"}],"name":"setMinting","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"accounts","type":"address[]"},{"internalType":"bool","name":"enable","type":"bool"}],"name":"setWhitelistSigner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tierOffsets","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tierQuantities","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"whitelist","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"enum AltairaGuildMembership.Kingdom","name":"","type":"uint8"}],"name":"whitelistMintingEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"whitelistSigner","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address payable","name":"destination","type":"address"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60a06040523480156200001157600080fd5b506040516200532b3803806200532b8339810160408190526200003491620004c2565b6040518060400160405280601881526020017f416c7461697261204775696c64204d656d62657273686970000000000000000081525060405180604001604052806007815260200166414c544149524160c81b81525081600090816200009b919062000641565b506001620000aa828262000641565b50506001600d5550620000bd33620002de565b620000c883620002de565b620000d560008362000330565b620001017f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a68462000330565b6200012d7f42cc64ec4860a94ad09164ceae04e16d6b1dd40c82fba2b191377262fa45e2ae8362000330565b620001597f4d793ea4fc361c3665f6d9db15c38131a82a43687d22841882e4a1103dede17a8362000330565b620001857f0a1704759791c789e02e7ea2b8b48d3ffe1f2ebace5515b64b3172e6580551758362000330565b620001b17ffc548fa2cc217ad5f99b5d48f888383ed2ae6ffa77f0348309fb8334f95b8da48362000330565b620001dd7f28f5a99355973cc89255b8c4ac88405f27c78ded7608b040ee77a8bdf44d15e28362000330565b620002097fc8a41221bcd7fcf2c225f5a9265e1d4d39949d89197159d59e5f4b87b62c419e8462000330565b602062000217858262000641565b506000805b6006811015620002ae5781601582600681106200023d576200023d6200070d565b01558281600681106200025457620002546200070d565b602002015162000265908362000739565b91508281600681106200027c576200027c6200070d565b6020020151600f82600681106200029757620002976200070d565b015580620002a5816200074f565b9150506200021c565b50608052506001600160a01b03166000908152601f60205260409020805460ff19166001179055506200076b9050565b600e80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6200033c8282620003bb565b620003b7576000828152600c602090815260408083206001600160a01b03851684529091529020805460ff19166001179055620003763390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b6000828152600c602090815260408083206001600160a01b038516845290915290205460ff165b92915050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715620004295762000429620003e8565b604052919050565b80516001600160a01b03811681146200044957600080fd5b919050565b600082601f8301126200046057600080fd5b60405160c081016001600160401b0381118282101715620004855762000485620003e8565b6040528060c08401858111156200049b57600080fd5b845b81811015620004b75780518352602092830192016200049d565b509195945050505050565b6000806000806101208587031215620004da57600080fd5b84516001600160401b0380821115620004f257600080fd5b818701915087601f8301126200050757600080fd5b8151818111156200051c576200051c620003e8565b6020915062000534601f8201601f19168301620003fe565b81815289838386010111156200054957600080fd5b60005b82811015620005695784810184015182820185015283016200054c565b50600083838301015280975050506200058481880162000431565b94505050620005966040860162000431565b9150620005a786606087016200044e565b905092959194509250565b600181811c90821680620005c757607f821691505b602082108103620005e857634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200063c57600081815260208120601f850160051c81016020861015620006175750805b601f850160051c820191505b81811015620006385782815560010162000623565b5050505b505050565b81516001600160401b038111156200065d576200065d620003e8565b62000675816200066e8454620005b2565b84620005ee565b602080601f831160018114620006ad5760008415620006945750858301515b600019600386901b1c1916600185901b17855562000638565b600085815260208120601f198616915b82811015620006de57888601518255948401946001909101908401620006bd565b5085821015620006fd5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b80820180821115620003e257620003e262000723565b60006001820162000764576200076462000723565b5060010190565b608051614b73620007b8600039600081816104ad01528181610f3e01528181610f920152818161135d015281816113ae01528181611e9101528181611ee201526129de0152614b736000f3fe6080604052600436106103d95760003560e01c80636b5ebe16116101fd578063af3a19c711610118578063d5391393116100ab578063f2fde38b1161007a578063f2fde38b14610c5f578063f5951ae514610c7f578063fa3a6f5614610cb3578063fa7a540514610cd3578063fd28762714610ce657600080fd5b8063d539139314610b95578063d547741f14610bc9578063e06d2eb514610be9578063e985e9c514610c1657600080fd5b8063c0bf6205116100e7578063c0bf620514610aed578063c87b56dd14610b21578063c984877114610b41578063ced3a40314610b6157600080fd5b8063af3a19c714610a66578063af4da11214610a7b578063b88d4fde14610aab578063bf58390314610acb57600080fd5b806395d89b41116101905780639b4f8fd71161015f5780639b4f8fd7146109f1578063a217fddf14610a11578063a22cb46514610a26578063ae6969ab14610a4657600080fd5b806395d89b411461097557806396c11faa1461098a5780639abc8320146109ac5780639b19251a146109c157600080fd5b80638546b881116101cc5780638546b8811461092257806387f65c91146105685780638da5cb5b1461093757806391d148541461095557600080fd5b80636b5ebe16146108ad57806370a08231146108cd578063715018a6146108ed5780637f6497831461090257600080fd5b80632f745c59116102f857806351cff8d91161028b5780636352211e1161025a5780636352211e146107f45780636406469d14610814578063680c246e1461083457806369736a58146108645780636a9432951461087957600080fd5b806351cff8d91461077257806354202c4e14610792578063548db174146107b4578063552a0eea146107d457600080fd5b80634d18f668116102c75780634d18f668146106ce5780634f062c5a146106fe5780634f6ccce71461071e578063519c040a1461073e57600080fd5b80632f745c591461064c57806336568abe1461066c5780633ce3ca931461068c57806342842e0e146106ae57600080fd5b806318160ddd11610370578063248a9ca31161033f578063248a9ca31461059d5780632a5500fd146105cd5780632a55205a146105ed5780632f2ff15d1461062c57600080fd5b806318160ddd1461053357806319a033e0146105485780631c0906db1461056857806323b872dd1461057d57600080fd5b80630837fb24116103ac5780630837fb241461049b578063095ea7b3146104cf5780630b8d16d5146104f157806313ffccbc1461051e57600080fd5b806301f49e7e146103de57806301ffc9a71461041157806306fdde0314610441578063081812fc14610463575b600080fd5b3480156103ea57600080fd5b506103fe6103f9366004613d1c565b610cf9565b6040519081526020015b60405180910390f35b34801561041d57600080fd5b5061043161042c366004613d4b565b610d10565b6040519015158152602001610408565b34801561044d57600080fd5b50610456610d3f565b6040516104089190613db8565b34801561046f57600080fd5b5061048361047e366004613d1c565b610dd1565b6040516001600160a01b039091168152602001610408565b3480156104a757600080fd5b506103fe7f000000000000000000000000000000000000000000000000000000000000000081565b3480156104db57600080fd5b506104ef6104ea366004613de0565b610df8565b005b3480156104fd57600080fd5b5061051161050c366004613d1c565b610f12565b6040516104089190613e36565b34801561052a57600080fd5b506103fe600281565b34801561053f57600080fd5b506008546103fe565b34801561055457600080fd5b506103fe610563366004613d1c565b610fdc565b34801561057457600080fd5b506103fe600181565b34801561058957600080fd5b506104ef610598366004613e44565b610fec565b3480156105a957600080fd5b506103fe6105b8366004613d1c565b6000908152600c602052604090206001015490565b3480156105d957600080fd5b506104ef6105e8366004613e85565b61101d565b3480156105f957600080fd5b5061060d610608366004613e97565b611097565b604080516001600160a01b039093168352602083019190915201610408565b34801561063857600080fd5b506104ef610647366004613eb9565b611145565b34801561065857600080fd5b506103fe610667366004613de0565b61116a565b34801561067857600080fd5b506104ef610687366004613eb9565b611200565b34801561069857600080fd5b506106a161127a565b6040516104089190613ee9565b3480156106ba57600080fd5b506104ef6106c9366004613e44565b611316565b3480156106da57600080fd5b506104316106e9366004613f30565b601c6020526000908152604090205460ff1681565b34801561070a57600080fd5b506103fe610719366004613d1c565b611331565b34801561072a57600080fd5b506103fe610739366004613d1c565b61142f565b34801561074a57600080fd5b506103fe7f42cc64ec4860a94ad09164ceae04e16d6b1dd40c82fba2b191377262fa45e2ae81565b34801561077e57600080fd5b506104ef61078d366004613f4b565b6114c2565b34801561079e57600080fd5b506103fe600080516020614b1e83398151915281565b3480156107c057600080fd5b506104ef6107cf366004613fae565b6114ff565b3480156107e057600080fd5b506104ef6107ef36600461406f565b61157f565b34801561080057600080fd5b5061048361080f366004613d1c565b61167e565b34801561082057600080fd5b506104ef61082f3660046140b2565b6116de565b34801561084057600080fd5b5061043161084f366004613f30565b601d6020526000908152604090205460ff1681565b34801561087057600080fd5b506103fe600481565b34801561088557600080fd5b506103fe7ffc548fa2cc217ad5f99b5d48f888383ed2ae6ffa77f0348309fb8334f95b8da481565b3480156108b957600080fd5b506104ef6108c836600461413e565b61174f565b3480156108d957600080fd5b506103fe6108e8366004613f4b565b611929565b3480156108f957600080fd5b506104ef6119af565b34801561090e57600080fd5b506104ef61091d3660046141d9565b6119c3565b34801561092e57600080fd5b506106a1611a55565b34801561094357600080fd5b50600e546001600160a01b0316610483565b34801561096157600080fd5b50610431610970366004613eb9565b611aeb565b34801561098157600080fd5b50610456611b16565b34801561099657600080fd5b5061099f611b25565b604051610408919061423d565b3480156109b857600080fd5b50610456611b60565b3480156109cd57600080fd5b506104316109dc366004613f4b565b601e6020526000908152604090205460ff1681565b3480156109fd57600080fd5b506104ef610a0c36600461428c565b611bee565b348015610a1d57600080fd5b506103fe600081565b348015610a3257600080fd5b506104ef610a413660046142c1565b611c67565b348015610a5257600080fd5b506103fe610a61366004613d1c565b611c72565b348015610a7257600080fd5b506103fe600681565b348015610a8757600080fd5b50610431610a96366004613f4b565b601f6020526000908152604090205460ff1681565b348015610ab757600080fd5b506104ef610ac63660046142f6565b611c82565b348015610ad757600080fd5b50610ae0611cb4565b60405161040891906143b9565b348015610af957600080fd5b506103fe7f0a1704759791c789e02e7ea2b8b48d3ffe1f2ebace5515b64b3172e65805517581565b348015610b2d57600080fd5b50610456610b3c366004613d1c565b611db0565b348015610b4d57600080fd5b506103fe610b5c3660046143ed565b611e17565b348015610b6d57600080fd5b506103fe7fc8a41221bcd7fcf2c225f5a9265e1d4d39949d89197159d59e5f4b87b62c419e81565b348015610ba157600080fd5b506103fe7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a681565b348015610bd557600080fd5b506104ef610be4366004613eb9565b611e40565b348015610bf557600080fd5b50610c09610c04366004613d1c565b611e65565b6040516104089190614429565b348015610c2257600080fd5b50610431610c31366004614443565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b348015610c6b57600080fd5b506104ef610c7a366004613f4b565b611f31565b348015610c8b57600080fd5b506103fe7f4d793ea4fc361c3665f6d9db15c38131a82a43687d22841882e4a1103dede17a81565b348015610cbf57600080fd5b506104ef610cce366004614471565b611faa565b6104ef610ce13660046144bb565b61203c565b6104ef610cf4366004614501565b61218e565b60158160068110610d0957600080fd5b0154905081565b6000610d1b82612381565b80610d2a5750610d2a826123a6565b80610d395750610d39826123cb565b92915050565b606060008054610d4e9061457a565b80601f0160208091040260200160405190810160405280929190818152602001828054610d7a9061457a565b8015610dc75780601f10610d9c57610100808354040283529160200191610dc7565b820191906000526020600020905b815481529060010190602001808311610daa57829003601f168201915b5050505050905090565b6000610ddc826123f0565b506000908152600460205260409020546001600160a01b031690565b6000610e038261167e565b9050806001600160a01b0316836001600160a01b031603610e755760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084015b60405180910390fd5b336001600160a01b0382161480610e915750610e918133610c31565b610f035760405162461bcd60e51b815260206004820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c0000006064820152608401610e6c565b610f0d838361244f565b505050565b60006001821015610f355760405162461bcd60e51b8152600401610e6c906145ae565b6002610f6260047f00000000000000000000000000000000000000000000000000000000000000006145ee565b610f6c91906145ee565b821115610f8b5760405162461bcd60e51b8152600401610e6c90614605565b610fb660027f00000000000000000000000000000000000000000000000000000000000000006145ee565b610fc1600184614630565b610fcb9190614659565b6003811115610d3957610d39613e0c565b600f8160068110610d0957600080fd5b610ff633826124bd565b6110125760405162461bcd60e51b8152600401610e6c9061466d565b610f0d83838361253c565b7f42cc64ec4860a94ad09164ceae04e16d6b1dd40c82fba2b191377262fa45e2ae611047816126ad565b60006110566020840184613f4b565b6001600160a01b0316036110725761106e6000600a55565b5050565b61106e6110826020840184613f4b565b61109260408501602086016146ba565b6126b7565b6000828152600b602090815260408083208151808301909252546001600160a01b038116808352600160a01b9091046001600160601b031692820192909252829161110c575060408051808201909152600a546001600160a01b0381168252600160a01b90046001600160601b031660208201525b60208101516000906127109061112b906001600160601b0316876145ee565b6111359190614659565b91519350909150505b9250929050565b6000828152600c6020526040902060010154611160816126ad565b610f0d83836127b4565b600061117583611929565b82106111d75760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b6064820152608401610e6c565b506001600160a01b03919091166000908152600660209081526040808320938352929052205490565b6001600160a01b03811633146112705760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610e6c565b61106e828261283a565b611282613c60565b61128a613c60565b60005b600481101561131057601c60008260038111156112ac576112ac613e0c565b60038111156112bd576112bd613e0c565b60038111156112ce576112ce613e0c565b815260208101919091526040016000205460ff168282600481106112f4576112f46146e3565b9115156020909202015280611308816146f9565b91505061128d565b50919050565b610f0d83838360405180602001604052806000815250611c82565b600060018210156113545760405162461bcd60e51b8152600401610e6c906145ae565b600261138160047f00000000000000000000000000000000000000000000000000000000000000006145ee565b61138b91906145ee565b8211156113aa5760405162461bcd60e51b8152600401610e6c90614605565b60007f00000000000000000000000000000000000000000000000000000000000000006113d8600185614630565b6113e29190614712565b905060015b60068110156114255760158160068110611403576114036146e3565b0154821015611413579392505050565b8061141d816146f9565b9150506113e7565b5060069392505050565b600061143a60085490565b821061149d5760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b6064820152608401610e6c565b600882815481106114b0576114b06146e3565b90600052602060002001549050919050565b7fc8a41221bcd7fcf2c225f5a9265e1d4d39949d89197159d59e5f4b87b62c419e6114ec816126ad565b61106e6001600160a01b038316476128a1565b600080516020614b1e833981519152611517816126ad565b60005b8251811015610f0d576000601e600085848151811061153b5761153b6146e3565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff191691151591909117905580611577816146f9565b91505061151a565b7ffc548fa2cc217ad5f99b5d48f888383ed2ae6ffa77f0348309fb8334f95b8da46115a9816126ad565b7f5405a0b1c6280ec8f20e0c034d15bc2bc784ae3d4e09aa0fe23c6e85afbe53768484846040516115dc93929190614726565b60405180910390a182601c60008660038111156115fb576115fb613e0c565b600381111561160c5761160c613e0c565b815260200190815260200160002060006101000a81548160ff02191690831515021790555081601d600086600381111561164857611648613e0c565b600381111561165957611659613e0c565b81526020810191909152604001600020805460ff191691151591909117905550505050565b6000818152600260205260408120546001600160a01b031680610d395760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b6044820152606401610e6c565b7f4d793ea4fc361c3665f6d9db15c38131a82a43687d22841882e4a1103dede17a611708816126ad565b7ff23718e3df4e6073edccd53a47cfe39a674011b5454244b2092b6887ff1ad6ae60218360405161173a92919061474a565b60405180910390a1610f0d6021836006613c7e565b7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6611779816126ad565b60006117868585856129ba565b9050600f611795600185614630565b600681106117a5576117a56146e3565b01546000828152601b60205260409020546117c1908890614783565b11156118235760405162461bcd60e51b815260206004820152602b60248201527f4b696e67646f6d2f47656e6465722f5469657220636f6d62696e6174696f6e2060448201526a1a5cc81cdbdb19081bdd5d60aa1b6064820152608401610e6c565b60018310156118635760405162461bcd60e51b815260206004820152600c60248201526b5469657220746f6f206c6f7760a01b6044820152606401610e6c565b60068311156118a45760405162461bcd60e51b815260206004820152600d60248201526c0a8d2cae440e8dede40d0d2ced609b1b6044820152606401610e6c565b6000818152601b60205260408120546118be908390614783565b905060006118cc8289614783565b905087601b600085815260200190815260200160002060008282546118f19190614783565b909155508290505b8181101561191d5761190b8a82612a55565b80611915816146f9565b9150506118f9565b50505050505050505050565b60006001600160a01b0382166119935760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b6064820152608401610e6c565b506001600160a01b031660009081526003602052604090205490565b6119b7612a6f565b6119c16000612ac9565b565b600080516020614b1e8339815191526119db816126ad565b8160005b81811015611a4e576001601e60008787858181106119ff576119ff6146e3565b9050602002016020810190611a149190613f4b565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580611a46816146f9565b9150506119df565b5050505050565b611a5d613c60565b611a65613c60565b60005b600481101561131057601d6000826003811115611a8757611a87613e0c565b6003811115611a9857611a98613e0c565b6003811115611aa957611aa9613e0c565b815260208101919091526040016000205460ff16828260048110611acf57611acf6146e3565b9115156020909202015280611ae3816146f9565b915050611a68565b6000918252600c602090815260408084206001600160a01b0393909316845291905290205460ff1690565b606060018054610d4e9061457a565b611b2d613cbc565b6040805160c08101918290529060219060069082845b815481526020019060010190808311611b43575050505050905090565b60208054611b6d9061457a565b80601f0160208091040260200160405190810160405280929190818152602001828054611b999061457a565b8015611be65780601f10611bbb57610100808354040283529160200191611be6565b820191906000526020600020905b815481529060010190602001808311611bc957829003601f168201915b505050505081565b7f0a1704759791c789e02e7ea2b8b48d3ffe1f2ebace5515b64b3172e658055175611c18816126ad565b7f99562a81a2bc5868cd8c30b7b2964f5e52ec358ace402063ecd18a505f5d080060208484604051611c4c939291906147bf565b60405180910390a16020611c618385836148a6565b50505050565b61106e338383612b1b565b60218160068110610d0957600080fd5b611c8c33836124bd565b611ca85760405162461bcd60e51b8152600401610e6c9061466d565b611c6184848484612be9565b611cbc613cda565b611cc4613cda565b60005b60048110156113105760015b60068111611d9d57611cf8826003811115611cf057611cf0613e0c565b600183611e17565b611d15836003811115611d0d57611d0d613e0c565b600084611e17565b6002600f611d24600186614630565b60068110611d3457611d346146e3565b0154611d4091906145ee565b611d4a9190614630565b611d549190614630565b838360048110611d6657611d666146e3565b6020020151611d76600184614630565b60068110611d8657611d866146e3565b602002015280611d95816146f9565b915050611cd3565b5080611da8816146f9565b915050611cc7565b6060611dbb826123f0565b6000611dc5612c1c565b90506000815111611de55760405180602001604052806000815250611e10565b80611def84612c2b565b604051602001611e00929190614965565b6040516020818303038152906040525b9392505050565b6000601b6000611e288686866129ba565b81526020019081526020016000205490509392505050565b6000828152600c6020526040902060010154611e5b816126ad565b610f0d838361283a565b60006001821015611e885760405162461bcd60e51b8152600401610e6c906145ae565b6002611eb560047f00000000000000000000000000000000000000000000000000000000000000006145ee565b611ebf91906145ee565b821115611ede5760405162461bcd60e51b8152600401610e6c90614605565b60027f0000000000000000000000000000000000000000000000000000000000000000611f0c600185614630565b611f169190614659565b611f209190614712565b6001811115610d3957610d39613e0c565b611f39612a6f565b6001600160a01b038116611f9e5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610e6c565b611fa781612ac9565b50565b600080516020614b1e833981519152611fc2816126ad565b8260005b818110156120345783601f6000888885818110611fe557611fe56146e3565b9050602002016020810190611ffa9190613f4b565b6001600160a01b031681526020810191909152604001600020805460ff19169115159190911790558061202c816146f9565b915050611fc6565b505050505050565b612044612cbd565b6000601c600084600381111561205c5761205c613e0c565b600381111561206d5761206d613e0c565b815260208101919091526040016000205460ff16905080612177576000601d60008560038111156120a0576120a0613e0c565b60038111156120b1576120b1613e0c565b815260208101919091526040016000205460ff169050806121145760405162461bcd60e51b815260206004820152601c60248201527f4d696e74696e672064697361626c656420666f72204b696e67646f6d000000006044820152606401610e6c565b336000908152601e602052604090205460ff16806121745760405162461bcd60e51b815260206004820152601f60248201527f596f7572206163636f756e74206973206e6f742077686974656c6973746564006044820152606401610e6c565b50505b61218385858585612d16565b50611c616001600d55565b612196612cbd565b6000601d60008660038111156121ae576121ae613e0c565b60038111156121bf576121bf613e0c565b815260208101919091526040016000205460ff169050806122225760405162461bcd60e51b815260206004820152601c60248201527f4d696e74696e672064697361626c656420666f72204b696e67646f6d000000006044820152606401610e6c565b6040805130606090811b6bffffffffffffffffffffffff1990811660208085019190915263fd28762760e01b6034850152918b901b1660388301528251602c818403018152604c830184528051908201207f19457468657265756d205369676e6564204d6573736167653a0a333200000000606c84015260888084018290528451808503909101815260a8909301909352815191012060006122fa8287878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250612fe892505050565b6001600160a01b0381166000908152601f602052604090205490915060ff16806123665760405162461bcd60e51b815260206004820152601f60248201527f596f7572206163636f756e74206973206e6f742077686974656c6973746564006044820152606401610e6c565b6123728b8b8b8b612d16565b50505050506120346001600d55565b60006001600160e01b0319821663780e9d6360e01b1480610d395750610d398261300c565b60006001600160e01b0319821663152a902d60e11b1480610d395750610d3982612381565b60006001600160e01b03198216637965db0b60e01b1480610d395750610d39826123a6565b6000818152600260205260409020546001600160a01b0316611fa75760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b6044820152606401610e6c565b600081815260046020526040902080546001600160a01b0319166001600160a01b03841690811790915581906124848261167e565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000806124c98361167e565b9050806001600160a01b0316846001600160a01b0316148061251057506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff165b806125345750836001600160a01b031661252984610dd1565b6001600160a01b0316145b949350505050565b826001600160a01b031661254f8261167e565b6001600160a01b0316146125755760405162461bcd60e51b8152600401610e6c90614994565b6001600160a01b0382166125d75760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610e6c565b6125e4838383600161305c565b826001600160a01b03166125f78261167e565b6001600160a01b03161461261d5760405162461bcd60e51b8152600401610e6c90614994565b600081815260046020908152604080832080546001600160a01b03199081169091556001600160a01b0387811680865260038552838620805460001901905590871680865283862080546001019055868652600290945282852080549092168417909155905184937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b611fa78133613195565b6127106001600160601b03821611156127255760405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646044820152692073616c65507269636560b01b6064820152608401610e6c565b6001600160a01b03821661277b5760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c6964207265636569766572000000000000006044820152606401610e6c565b604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b90910217600a55565b6127be8282611aeb565b61106e576000828152600c602090815260408083206001600160a01b03851684529091529020805460ff191660011790556127f63390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6128448282611aeb565b1561106e576000828152600c602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b804710156128f15760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610e6c565b6000826001600160a01b03168260405160006040518083038185875af1925050503d806000811461293e576040519150601f19603f3d011682016040523d82523d6000602084013e612943565b606091505b5050905080610f0d5760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d617920686176652072657665727465640000000000006064820152608401610e6c565b6000600160156129ca8285614630565b600681106129da576129da6146e3565b01547f0000000000000000000000000000000000000000000000000000000000000000856001811115612a0f57612a0f613e0c565b6002886003811115612a2357612a23613e0c565b612a2d91906145ee565b612a379190614783565b612a4191906145ee565b612a4b9190614783565b6125349190614783565b61106e8282604051806020016040528060008152506131ee565b600e546001600160a01b031633146119c15760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610e6c565b600e80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b816001600160a01b0316836001600160a01b031603612b7c5760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610e6c565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b612bf484848461253c565b612c0084848484613221565b611c615760405162461bcd60e51b8152600401610e6c906149d9565b606060208054610d4e9061457a565b60606000612c3883613322565b60010190506000816001600160401b03811115612c5757612c57613f68565b6040519080825280601f01601f191660200182016040528015612c81576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a8504945084612c8b57509392505050565b6002600d5403612d0f5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610e6c565b6002600d55565b60158310612d745760405162461bcd60e51b815260206004820152602560248201527f596f752063616e2070757263686173652061206d6178696d756d206f66203230604482015264204e46547360d81b6064820152608401610e6c565b826021612d82600184614630565b60068110612d9257612d926146e3565b0154612d9e91906145ee565b341015612ded5760405162461bcd60e51b815260206004820152601960248201527f45746865722073656e74206973206e6f7420636f7272656374000000000000006044820152606401610e6c565b6001811015612e2d5760405162461bcd60e51b815260206004820152600c60248201526b5469657220746f6f206c6f7760a01b6044820152606401610e6c565b6006811115612e6e5760405162461bcd60e51b815260206004820152600d60248201526c0a8d2cae440e8dede40d0d2ced609b1b6044820152606401610e6c565b6000612e7c836000846129ba565b90506000612e8c846001856129ba565b6000818152601b6020526040808220548583529082205492935090916002600f612eb7600189614630565b60068110612ec757612ec76146e3565b0154612ed391906145ee565b612edd9190614630565b612ee79190614630565b905085811015612f4c5760405162461bcd60e51b815260206004820152602a60248201527f4e6f7420656e6f75676820546f6b656e73206f662073656c6563746564204b696044820152693733b237b697aa34b2b960b11b6064820152608401610e6c565b60005b86811015612fde576000612f65838388886133fa565b90506000612f748883896129ba565b6000818152601b602052604081205491925090612f92908390614783565b90506001601b60008481526020019081526020016000206000828254612fb89190614783565b90915550612fc890508b82612a55565b5050508080612fd6906146f9565b915050612f4f565b5050505050505050565b6000806000612ff785856134b2565b91509150613004816134f4565b509392505050565b60006001600160e01b031982166380ac58cd60e01b148061303d57506001600160e01b03198216635b5e139f60e01b145b80610d3957506301ffc9a760e01b6001600160e01b0319831614610d39565b6130688484848461363e565b60018111156130d75760405162461bcd60e51b815260206004820152603560248201527f455243373231456e756d657261626c653a20636f6e7365637574697665207472604482015274185b9cd9995c9cc81b9bdd081cdd5c1c1bdc9d1959605a1b6064820152608401610e6c565b816001600160a01b0385166131335761312e81600880546000838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b613156565b836001600160a01b0316856001600160a01b0316146131565761315685826136c6565b6001600160a01b0384166131725761316d81613763565b611a4e565b846001600160a01b0316846001600160a01b031614611a4e57611a4e8482613812565b61319f8282611aeb565b61106e576131ac81613856565b6131b7836020613868565b6040516020016131c8929190614a2b565b60408051601f198184030181529082905262461bcd60e51b8252610e6c91600401613db8565b6131f88383613a03565b6132056000848484613221565b610f0d5760405162461bcd60e51b8152600401610e6c906149d9565b60006001600160a01b0384163b1561331757604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290613265903390899088908890600401614aa0565b6020604051808303816000875af19250505080156132a0575060408051601f3d908101601f1916820190925261329d91810190614ad3565b60015b6132fd573d8080156132ce576040519150601f19603f3d011682016040523d82523d6000602084013e6132d3565b606091505b5080516000036132f55760405162461bcd60e51b8152600401610e6c906149d9565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050612534565b506001949350505050565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106133615772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef8100000000831061338d576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc1000083106133ab57662386f26fc10000830492506010015b6305f5e10083106133c3576305f5e100830492506008015b61271083106133d757612710830492506004015b606483106133e9576064830492506002015b600a8310610d395760010192915050565b60008084613409600143614630565b60408051602081019390935290409082015244606082015260800160408051601f1981840301815291905280516020909101209050600061344a8688614630565b905060006134588284614712565b6000868152601b6020526040902054909150600f613477600189614630565b60068110613487576134876146e3565b01546134939190614630565b8110156134a65760009350505050612534565b60019350505050612534565b60008082516041036134e85760208301516040840151606085015160001a6134dc87828585613b9c565b9450945050505061113e565b5060009050600261113e565b600081600481111561350857613508613e0c565b036135105750565b600181600481111561352457613524613e0c565b036135715760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610e6c565b600281600481111561358557613585613e0c565b036135d25760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610e6c565b60038160048111156135e6576135e6613e0c565b03611fa75760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610e6c565b6001811115611c61576001600160a01b03841615613684576001600160a01b0384166000908152600360205260408120805483929061367e908490614630565b90915550505b6001600160a01b03831615611c61576001600160a01b038316600090815260036020526040812080548392906136bb908490614783565b909155505050505050565b600060016136d384611929565b6136dd9190614630565b600083815260076020526040902054909150808214613730576001600160a01b03841660009081526006602090815260408083208584528252808320548484528184208190558352600790915290208190555b5060009182526007602090815260408084208490556001600160a01b039094168352600681528383209183525290812055565b60085460009061377590600190614630565b6000838152600960205260408120546008805493945090928490811061379d5761379d6146e3565b9060005260206000200154905080600883815481106137be576137be6146e3565b60009182526020808320909101929092558281526009909152604080822084905585825281205560088054806137f6576137f6614af0565b6001900381819060005260206000200160009055905550505050565b600061381d83611929565b6001600160a01b039093166000908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b6060610d396001600160a01b03831660145b606060006138778360026145ee565b613882906002614783565b6001600160401b0381111561389957613899613f68565b6040519080825280601f01601f1916602001820160405280156138c3576020820181803683370190505b509050600360fc1b816000815181106138de576138de6146e3565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061390d5761390d6146e3565b60200101906001600160f81b031916908160001a90535060006139318460026145ee565b61393c906001614783565b90505b60018111156139b4576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110613970576139706146e3565b1a60f81b828281518110613986576139866146e3565b60200101906001600160f81b031916908160001a90535060049490941c936139ad81614b06565b905061393f565b508315611e105760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610e6c565b6001600160a01b038216613a595760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610e6c565b6000818152600260205260409020546001600160a01b031615613abe5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610e6c565b613acc60008383600161305c565b6000818152600260205260409020546001600160a01b031615613b315760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610e6c565b6001600160a01b038216600081815260036020908152604080832080546001019055848352600290915280822080546001600160a01b0319168417905551839291907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115613bd35750600090506003613c57565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015613c27573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116613c5057600060019250925050613c57565b9150600090505b94509492505050565b60405180608001604052806004906020820280368337509192915050565b8260068101928215613cac579160200282015b82811115613cac578251825591602001919060010190613c91565b50613cb8929150613d07565b5090565b6040518060c001604052806006906020820280368337509192915050565b60405180608001604052806004905b613cf1613cbc565b815260200190600190039081613ce95790505090565b5b80821115613cb85760008155600101613d08565b600060208284031215613d2e57600080fd5b5035919050565b6001600160e01b031981168114611fa757600080fd5b600060208284031215613d5d57600080fd5b8135611e1081613d35565b60005b83811015613d83578181015183820152602001613d6b565b50506000910152565b60008151808452613da4816020860160208601613d68565b601f01601f19169290920160200192915050565b602081526000611e106020830184613d8c565b6001600160a01b0381168114611fa757600080fd5b60008060408385031215613df357600080fd5b8235613dfe81613dcb565b946020939093013593505050565b634e487b7160e01b600052602160045260246000fd5b60048110613e3257613e32613e0c565b9052565b60208101610d398284613e22565b600080600060608486031215613e5957600080fd5b8335613e6481613dcb565b92506020840135613e7481613dcb565b929592945050506040919091013590565b60006040828403121561131057600080fd5b60008060408385031215613eaa57600080fd5b50508035926020909101359150565b60008060408385031215613ecc57600080fd5b823591506020830135613ede81613dcb565b809150509250929050565b60808101818360005b6004811015613f135781511515835260209283019290910190600101613ef2565b50505092915050565b803560048110613f2b57600080fd5b919050565b600060208284031215613f4257600080fd5b611e1082613f1c565b600060208284031215613f5d57600080fd5b8135611e1081613dcb565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715613fa657613fa6613f68565b604052919050565b60006020808385031215613fc157600080fd5b82356001600160401b0380821115613fd857600080fd5b818501915085601f830112613fec57600080fd5b813581811115613ffe57613ffe613f68565b8060051b915061400f848301613f7e565b818152918301840191848101908884111561402957600080fd5b938501935b83851015614053578435925061404383613dcb565b828252938501939085019061402e565b98975050505050505050565b80358015158114613f2b57600080fd5b60008060006060848603121561408457600080fd5b61408d84613f1c565b925061409b6020850161405f565b91506140a96040850161405f565b90509250925092565b600060c082840312156140c457600080fd5b82601f8301126140d357600080fd5b60405160c081018181106001600160401b03821117156140f5576140f5613f68565b6040528060c084018581111561410a57600080fd5b845b8181101561412457803583526020928301920161410c565b509195945050505050565b803560028110613f2b57600080fd5b600080600080600060a0868803121561415657600080fd5b853561416181613dcb565b94506020860135935061417660408701613f1c565b92506141846060870161412f565b949793965091946080013592915050565b60008083601f8401126141a757600080fd5b5081356001600160401b038111156141be57600080fd5b6020830191508360208260051b850101111561113e57600080fd5b600080602083850312156141ec57600080fd5b82356001600160401b0381111561420257600080fd5b61420e85828601614195565b90969095509350505050565b8060005b6006811015611c6157815184526020938401939091019060010161421e565b60c08101610d39828461421a565b60008083601f84011261425d57600080fd5b5081356001600160401b0381111561427457600080fd5b60208301915083602082850101111561113e57600080fd5b6000806020838503121561429f57600080fd5b82356001600160401b038111156142b557600080fd5b61420e8582860161424b565b600080604083850312156142d457600080fd5b82356142df81613dcb565b91506142ed6020840161405f565b90509250929050565b6000806000806080858703121561430c57600080fd5b843561431781613dcb565b935060208581013561432881613dcb565b93506040860135925060608601356001600160401b038082111561434b57600080fd5b818801915088601f83011261435f57600080fd5b81358181111561437157614371613f68565b614383601f8201601f19168501613f7e565b9150808252898482850101111561439957600080fd5b808484018584013760008482840101525080935050505092959194509250565b6103008101818360005b6004811015613f13576143d783835161421a565b60c09290920191602091909101906001016143c3565b60008060006060848603121561440257600080fd5b61440b84613f1c565b92506144196020850161412f565b9150604084013590509250925092565b602081016002831061443d5761443d613e0c565b91905290565b6000806040838503121561445657600080fd5b823561446181613dcb565b91506020830135613ede81613dcb565b60008060006040848603121561448657600080fd5b83356001600160401b0381111561449c57600080fd5b6144a886828701614195565b90945092506140a990506020850161405f565b600080600080608085870312156144d157600080fd5b84356144dc81613dcb565b9350602085013592506144f160408601613f1c565b9396929550929360600135925050565b60008060008060008060a0878903121561451a57600080fd5b863561452581613dcb565b95506020870135945061453a60408801613f1c565b93506060870135925060808701356001600160401b0381111561455c57600080fd5b61456889828a0161424b565b979a9699509497509295939492505050565b600181811c9082168061458e57607f821691505b60208210810361131057634e487b7160e01b600052602260045260246000fd5b60208082526010908201526f546f6b656e20494420746f6f206c6f7760801b604082015260600190565b634e487b7160e01b600052601160045260246000fd5b8082028115828204841417610d3957610d396145d8565b6020808252601190820152700a8ded6cadc40928840e8dede40d0d2ced607b1b604082015260600190565b81810381811115610d3957610d396145d8565b634e487b7160e01b600052601260045260246000fd5b60008261466857614668614643565b500490565b6020808252602d908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526c1c881bdc88185c1c1c9bdd9959609a1b606082015260800190565b6000602082840312156146cc57600080fd5b81356001600160601b0381168114611e1057600080fd5b634e487b7160e01b600052603260045260246000fd5b60006001820161470b5761470b6145d8565b5060010190565b60008261472157614721614643565b500690565b606081016147348286613e22565b9215156020820152901515604090910152919050565b6101808101818460005b6006811015614773578154835260209092019160019182019101614754565b505050611e1060c083018461421a565b80820180821115610d3957610d396145d8565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6040815260008085546147d18161457a565b80604086015260606001808416600081146147f3576001811461480d5761483e565b60ff1985168884015283151560051b88018301955061483e565b8a60005260208060002060005b868110156148355781548b820187015290840190820161481a565b8a018501975050505b50505050508281036020840152614856818587614796565b9695505050505050565b601f821115610f0d57600081815260208120601f850160051c810160208610156148875750805b601f850160051c820191505b8181101561203457828155600101614893565b6001600160401b038311156148bd576148bd613f68565b6148d1836148cb835461457a565b83614860565b6000601f84116001811461490557600085156148ed5750838201355b600019600387901b1c1916600186901b178355611a4e565b600083815260209020601f19861690835b828110156149365786850135825560209485019460019092019101614916565b50868210156149535760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b60008351614977818460208801613d68565b83519083019061498b818360208801613d68565b01949350505050565b60208082526025908201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060408201526437bbb732b960d91b606082015260800190565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351614a63816017850160208801613d68565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351614a94816028840160208801613d68565b01602801949350505050565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061485690830184613d8c565b600060208284031215614ae557600080fd5b8151611e1081613d35565b634e487b7160e01b600052603160045260246000fd5b600081614b1557614b156145d8565b50600019019056fe28f5a99355973cc89255b8c4ac88405f27c78ded7608b040ee77a8bdf44d15e2a2646970667358221220c5fd70b8e0e5be78b483b71386a51b1df6f20c537fb666bd95366b2ad378cf2564736f6c63430008120033000000000000000000000000000000000000000000000000000000000000012000000000000000000000000007382eab8c0ca1aed1e5c6627d376e35bcc3a83a000000000000000000000000eca7ca7cacecd2a813678e24de44df8d56755d9c0000000000000000000000000000000000000000000000000000000000000177000000000000000000000000000000000000000000000000000000000000017700000000000000000000000000000000000000000000000000000000000001a90000000000000000000000000000000000000000000000000000000000000044000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000043697066733a2f2f62616679626569636f6e62726f68636661757163686b71686472643576336a6c683675336769643571733267327a34637065616e75786c327078612f0000000000000000000000000000000000000000000000000000000000
Deployed Bytecode
0x6080604052600436106103d95760003560e01c80636b5ebe16116101fd578063af3a19c711610118578063d5391393116100ab578063f2fde38b1161007a578063f2fde38b14610c5f578063f5951ae514610c7f578063fa3a6f5614610cb3578063fa7a540514610cd3578063fd28762714610ce657600080fd5b8063d539139314610b95578063d547741f14610bc9578063e06d2eb514610be9578063e985e9c514610c1657600080fd5b8063c0bf6205116100e7578063c0bf620514610aed578063c87b56dd14610b21578063c984877114610b41578063ced3a40314610b6157600080fd5b8063af3a19c714610a66578063af4da11214610a7b578063b88d4fde14610aab578063bf58390314610acb57600080fd5b806395d89b41116101905780639b4f8fd71161015f5780639b4f8fd7146109f1578063a217fddf14610a11578063a22cb46514610a26578063ae6969ab14610a4657600080fd5b806395d89b411461097557806396c11faa1461098a5780639abc8320146109ac5780639b19251a146109c157600080fd5b80638546b881116101cc5780638546b8811461092257806387f65c91146105685780638da5cb5b1461093757806391d148541461095557600080fd5b80636b5ebe16146108ad57806370a08231146108cd578063715018a6146108ed5780637f6497831461090257600080fd5b80632f745c59116102f857806351cff8d91161028b5780636352211e1161025a5780636352211e146107f45780636406469d14610814578063680c246e1461083457806369736a58146108645780636a9432951461087957600080fd5b806351cff8d91461077257806354202c4e14610792578063548db174146107b4578063552a0eea146107d457600080fd5b80634d18f668116102c75780634d18f668146106ce5780634f062c5a146106fe5780634f6ccce71461071e578063519c040a1461073e57600080fd5b80632f745c591461064c57806336568abe1461066c5780633ce3ca931461068c57806342842e0e146106ae57600080fd5b806318160ddd11610370578063248a9ca31161033f578063248a9ca31461059d5780632a5500fd146105cd5780632a55205a146105ed5780632f2ff15d1461062c57600080fd5b806318160ddd1461053357806319a033e0146105485780631c0906db1461056857806323b872dd1461057d57600080fd5b80630837fb24116103ac5780630837fb241461049b578063095ea7b3146104cf5780630b8d16d5146104f157806313ffccbc1461051e57600080fd5b806301f49e7e146103de57806301ffc9a71461041157806306fdde0314610441578063081812fc14610463575b600080fd5b3480156103ea57600080fd5b506103fe6103f9366004613d1c565b610cf9565b6040519081526020015b60405180910390f35b34801561041d57600080fd5b5061043161042c366004613d4b565b610d10565b6040519015158152602001610408565b34801561044d57600080fd5b50610456610d3f565b6040516104089190613db8565b34801561046f57600080fd5b5061048361047e366004613d1c565b610dd1565b6040516001600160a01b039091168152602001610408565b3480156104a757600080fd5b506103fe7f00000000000000000000000000000000000000000000000000000000000004e281565b3480156104db57600080fd5b506104ef6104ea366004613de0565b610df8565b005b3480156104fd57600080fd5b5061051161050c366004613d1c565b610f12565b6040516104089190613e36565b34801561052a57600080fd5b506103fe600281565b34801561053f57600080fd5b506008546103fe565b34801561055457600080fd5b506103fe610563366004613d1c565b610fdc565b34801561057457600080fd5b506103fe600181565b34801561058957600080fd5b506104ef610598366004613e44565b610fec565b3480156105a957600080fd5b506103fe6105b8366004613d1c565b6000908152600c602052604090206001015490565b3480156105d957600080fd5b506104ef6105e8366004613e85565b61101d565b3480156105f957600080fd5b5061060d610608366004613e97565b611097565b604080516001600160a01b039093168352602083019190915201610408565b34801561063857600080fd5b506104ef610647366004613eb9565b611145565b34801561065857600080fd5b506103fe610667366004613de0565b61116a565b34801561067857600080fd5b506104ef610687366004613eb9565b611200565b34801561069857600080fd5b506106a161127a565b6040516104089190613ee9565b3480156106ba57600080fd5b506104ef6106c9366004613e44565b611316565b3480156106da57600080fd5b506104316106e9366004613f30565b601c6020526000908152604090205460ff1681565b34801561070a57600080fd5b506103fe610719366004613d1c565b611331565b34801561072a57600080fd5b506103fe610739366004613d1c565b61142f565b34801561074a57600080fd5b506103fe7f42cc64ec4860a94ad09164ceae04e16d6b1dd40c82fba2b191377262fa45e2ae81565b34801561077e57600080fd5b506104ef61078d366004613f4b565b6114c2565b34801561079e57600080fd5b506103fe600080516020614b1e83398151915281565b3480156107c057600080fd5b506104ef6107cf366004613fae565b6114ff565b3480156107e057600080fd5b506104ef6107ef36600461406f565b61157f565b34801561080057600080fd5b5061048361080f366004613d1c565b61167e565b34801561082057600080fd5b506104ef61082f3660046140b2565b6116de565b34801561084057600080fd5b5061043161084f366004613f30565b601d6020526000908152604090205460ff1681565b34801561087057600080fd5b506103fe600481565b34801561088557600080fd5b506103fe7ffc548fa2cc217ad5f99b5d48f888383ed2ae6ffa77f0348309fb8334f95b8da481565b3480156108b957600080fd5b506104ef6108c836600461413e565b61174f565b3480156108d957600080fd5b506103fe6108e8366004613f4b565b611929565b3480156108f957600080fd5b506104ef6119af565b34801561090e57600080fd5b506104ef61091d3660046141d9565b6119c3565b34801561092e57600080fd5b506106a1611a55565b34801561094357600080fd5b50600e546001600160a01b0316610483565b34801561096157600080fd5b50610431610970366004613eb9565b611aeb565b34801561098157600080fd5b50610456611b16565b34801561099657600080fd5b5061099f611b25565b604051610408919061423d565b3480156109b857600080fd5b50610456611b60565b3480156109cd57600080fd5b506104316109dc366004613f4b565b601e6020526000908152604090205460ff1681565b3480156109fd57600080fd5b506104ef610a0c36600461428c565b611bee565b348015610a1d57600080fd5b506103fe600081565b348015610a3257600080fd5b506104ef610a413660046142c1565b611c67565b348015610a5257600080fd5b506103fe610a61366004613d1c565b611c72565b348015610a7257600080fd5b506103fe600681565b348015610a8757600080fd5b50610431610a96366004613f4b565b601f6020526000908152604090205460ff1681565b348015610ab757600080fd5b506104ef610ac63660046142f6565b611c82565b348015610ad757600080fd5b50610ae0611cb4565b60405161040891906143b9565b348015610af957600080fd5b506103fe7f0a1704759791c789e02e7ea2b8b48d3ffe1f2ebace5515b64b3172e65805517581565b348015610b2d57600080fd5b50610456610b3c366004613d1c565b611db0565b348015610b4d57600080fd5b506103fe610b5c3660046143ed565b611e17565b348015610b6d57600080fd5b506103fe7fc8a41221bcd7fcf2c225f5a9265e1d4d39949d89197159d59e5f4b87b62c419e81565b348015610ba157600080fd5b506103fe7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a681565b348015610bd557600080fd5b506104ef610be4366004613eb9565b611e40565b348015610bf557600080fd5b50610c09610c04366004613d1c565b611e65565b6040516104089190614429565b348015610c2257600080fd5b50610431610c31366004614443565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b348015610c6b57600080fd5b506104ef610c7a366004613f4b565b611f31565b348015610c8b57600080fd5b506103fe7f4d793ea4fc361c3665f6d9db15c38131a82a43687d22841882e4a1103dede17a81565b348015610cbf57600080fd5b506104ef610cce366004614471565b611faa565b6104ef610ce13660046144bb565b61203c565b6104ef610cf4366004614501565b61218e565b60158160068110610d0957600080fd5b0154905081565b6000610d1b82612381565b80610d2a5750610d2a826123a6565b80610d395750610d39826123cb565b92915050565b606060008054610d4e9061457a565b80601f0160208091040260200160405190810160405280929190818152602001828054610d7a9061457a565b8015610dc75780601f10610d9c57610100808354040283529160200191610dc7565b820191906000526020600020905b815481529060010190602001808311610daa57829003601f168201915b5050505050905090565b6000610ddc826123f0565b506000908152600460205260409020546001600160a01b031690565b6000610e038261167e565b9050806001600160a01b0316836001600160a01b031603610e755760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084015b60405180910390fd5b336001600160a01b0382161480610e915750610e918133610c31565b610f035760405162461bcd60e51b815260206004820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c0000006064820152608401610e6c565b610f0d838361244f565b505050565b60006001821015610f355760405162461bcd60e51b8152600401610e6c906145ae565b6002610f6260047f00000000000000000000000000000000000000000000000000000000000004e26145ee565b610f6c91906145ee565b821115610f8b5760405162461bcd60e51b8152600401610e6c90614605565b610fb660027f00000000000000000000000000000000000000000000000000000000000004e26145ee565b610fc1600184614630565b610fcb9190614659565b6003811115610d3957610d39613e0c565b600f8160068110610d0957600080fd5b610ff633826124bd565b6110125760405162461bcd60e51b8152600401610e6c9061466d565b610f0d83838361253c565b7f42cc64ec4860a94ad09164ceae04e16d6b1dd40c82fba2b191377262fa45e2ae611047816126ad565b60006110566020840184613f4b565b6001600160a01b0316036110725761106e6000600a55565b5050565b61106e6110826020840184613f4b565b61109260408501602086016146ba565b6126b7565b6000828152600b602090815260408083208151808301909252546001600160a01b038116808352600160a01b9091046001600160601b031692820192909252829161110c575060408051808201909152600a546001600160a01b0381168252600160a01b90046001600160601b031660208201525b60208101516000906127109061112b906001600160601b0316876145ee565b6111359190614659565b91519350909150505b9250929050565b6000828152600c6020526040902060010154611160816126ad565b610f0d83836127b4565b600061117583611929565b82106111d75760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b6064820152608401610e6c565b506001600160a01b03919091166000908152600660209081526040808320938352929052205490565b6001600160a01b03811633146112705760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610e6c565b61106e828261283a565b611282613c60565b61128a613c60565b60005b600481101561131057601c60008260038111156112ac576112ac613e0c565b60038111156112bd576112bd613e0c565b60038111156112ce576112ce613e0c565b815260208101919091526040016000205460ff168282600481106112f4576112f46146e3565b9115156020909202015280611308816146f9565b91505061128d565b50919050565b610f0d83838360405180602001604052806000815250611c82565b600060018210156113545760405162461bcd60e51b8152600401610e6c906145ae565b600261138160047f00000000000000000000000000000000000000000000000000000000000004e26145ee565b61138b91906145ee565b8211156113aa5760405162461bcd60e51b8152600401610e6c90614605565b60007f00000000000000000000000000000000000000000000000000000000000004e26113d8600185614630565b6113e29190614712565b905060015b60068110156114255760158160068110611403576114036146e3565b0154821015611413579392505050565b8061141d816146f9565b9150506113e7565b5060069392505050565b600061143a60085490565b821061149d5760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b6064820152608401610e6c565b600882815481106114b0576114b06146e3565b90600052602060002001549050919050565b7fc8a41221bcd7fcf2c225f5a9265e1d4d39949d89197159d59e5f4b87b62c419e6114ec816126ad565b61106e6001600160a01b038316476128a1565b600080516020614b1e833981519152611517816126ad565b60005b8251811015610f0d576000601e600085848151811061153b5761153b6146e3565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff191691151591909117905580611577816146f9565b91505061151a565b7ffc548fa2cc217ad5f99b5d48f888383ed2ae6ffa77f0348309fb8334f95b8da46115a9816126ad565b7f5405a0b1c6280ec8f20e0c034d15bc2bc784ae3d4e09aa0fe23c6e85afbe53768484846040516115dc93929190614726565b60405180910390a182601c60008660038111156115fb576115fb613e0c565b600381111561160c5761160c613e0c565b815260200190815260200160002060006101000a81548160ff02191690831515021790555081601d600086600381111561164857611648613e0c565b600381111561165957611659613e0c565b81526020810191909152604001600020805460ff191691151591909117905550505050565b6000818152600260205260408120546001600160a01b031680610d395760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b6044820152606401610e6c565b7f4d793ea4fc361c3665f6d9db15c38131a82a43687d22841882e4a1103dede17a611708816126ad565b7ff23718e3df4e6073edccd53a47cfe39a674011b5454244b2092b6887ff1ad6ae60218360405161173a92919061474a565b60405180910390a1610f0d6021836006613c7e565b7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6611779816126ad565b60006117868585856129ba565b9050600f611795600185614630565b600681106117a5576117a56146e3565b01546000828152601b60205260409020546117c1908890614783565b11156118235760405162461bcd60e51b815260206004820152602b60248201527f4b696e67646f6d2f47656e6465722f5469657220636f6d62696e6174696f6e2060448201526a1a5cc81cdbdb19081bdd5d60aa1b6064820152608401610e6c565b60018310156118635760405162461bcd60e51b815260206004820152600c60248201526b5469657220746f6f206c6f7760a01b6044820152606401610e6c565b60068311156118a45760405162461bcd60e51b815260206004820152600d60248201526c0a8d2cae440e8dede40d0d2ced609b1b6044820152606401610e6c565b6000818152601b60205260408120546118be908390614783565b905060006118cc8289614783565b905087601b600085815260200190815260200160002060008282546118f19190614783565b909155508290505b8181101561191d5761190b8a82612a55565b80611915816146f9565b9150506118f9565b50505050505050505050565b60006001600160a01b0382166119935760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b6064820152608401610e6c565b506001600160a01b031660009081526003602052604090205490565b6119b7612a6f565b6119c16000612ac9565b565b600080516020614b1e8339815191526119db816126ad565b8160005b81811015611a4e576001601e60008787858181106119ff576119ff6146e3565b9050602002016020810190611a149190613f4b565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580611a46816146f9565b9150506119df565b5050505050565b611a5d613c60565b611a65613c60565b60005b600481101561131057601d6000826003811115611a8757611a87613e0c565b6003811115611a9857611a98613e0c565b6003811115611aa957611aa9613e0c565b815260208101919091526040016000205460ff16828260048110611acf57611acf6146e3565b9115156020909202015280611ae3816146f9565b915050611a68565b6000918252600c602090815260408084206001600160a01b0393909316845291905290205460ff1690565b606060018054610d4e9061457a565b611b2d613cbc565b6040805160c08101918290529060219060069082845b815481526020019060010190808311611b43575050505050905090565b60208054611b6d9061457a565b80601f0160208091040260200160405190810160405280929190818152602001828054611b999061457a565b8015611be65780601f10611bbb57610100808354040283529160200191611be6565b820191906000526020600020905b815481529060010190602001808311611bc957829003601f168201915b505050505081565b7f0a1704759791c789e02e7ea2b8b48d3ffe1f2ebace5515b64b3172e658055175611c18816126ad565b7f99562a81a2bc5868cd8c30b7b2964f5e52ec358ace402063ecd18a505f5d080060208484604051611c4c939291906147bf565b60405180910390a16020611c618385836148a6565b50505050565b61106e338383612b1b565b60218160068110610d0957600080fd5b611c8c33836124bd565b611ca85760405162461bcd60e51b8152600401610e6c9061466d565b611c6184848484612be9565b611cbc613cda565b611cc4613cda565b60005b60048110156113105760015b60068111611d9d57611cf8826003811115611cf057611cf0613e0c565b600183611e17565b611d15836003811115611d0d57611d0d613e0c565b600084611e17565b6002600f611d24600186614630565b60068110611d3457611d346146e3565b0154611d4091906145ee565b611d4a9190614630565b611d549190614630565b838360048110611d6657611d666146e3565b6020020151611d76600184614630565b60068110611d8657611d866146e3565b602002015280611d95816146f9565b915050611cd3565b5080611da8816146f9565b915050611cc7565b6060611dbb826123f0565b6000611dc5612c1c565b90506000815111611de55760405180602001604052806000815250611e10565b80611def84612c2b565b604051602001611e00929190614965565b6040516020818303038152906040525b9392505050565b6000601b6000611e288686866129ba565b81526020019081526020016000205490509392505050565b6000828152600c6020526040902060010154611e5b816126ad565b610f0d838361283a565b60006001821015611e885760405162461bcd60e51b8152600401610e6c906145ae565b6002611eb560047f00000000000000000000000000000000000000000000000000000000000004e26145ee565b611ebf91906145ee565b821115611ede5760405162461bcd60e51b8152600401610e6c90614605565b60027f00000000000000000000000000000000000000000000000000000000000004e2611f0c600185614630565b611f169190614659565b611f209190614712565b6001811115610d3957610d39613e0c565b611f39612a6f565b6001600160a01b038116611f9e5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610e6c565b611fa781612ac9565b50565b600080516020614b1e833981519152611fc2816126ad565b8260005b818110156120345783601f6000888885818110611fe557611fe56146e3565b9050602002016020810190611ffa9190613f4b565b6001600160a01b031681526020810191909152604001600020805460ff19169115159190911790558061202c816146f9565b915050611fc6565b505050505050565b612044612cbd565b6000601c600084600381111561205c5761205c613e0c565b600381111561206d5761206d613e0c565b815260208101919091526040016000205460ff16905080612177576000601d60008560038111156120a0576120a0613e0c565b60038111156120b1576120b1613e0c565b815260208101919091526040016000205460ff169050806121145760405162461bcd60e51b815260206004820152601c60248201527f4d696e74696e672064697361626c656420666f72204b696e67646f6d000000006044820152606401610e6c565b336000908152601e602052604090205460ff16806121745760405162461bcd60e51b815260206004820152601f60248201527f596f7572206163636f756e74206973206e6f742077686974656c6973746564006044820152606401610e6c565b50505b61218385858585612d16565b50611c616001600d55565b612196612cbd565b6000601d60008660038111156121ae576121ae613e0c565b60038111156121bf576121bf613e0c565b815260208101919091526040016000205460ff169050806122225760405162461bcd60e51b815260206004820152601c60248201527f4d696e74696e672064697361626c656420666f72204b696e67646f6d000000006044820152606401610e6c565b6040805130606090811b6bffffffffffffffffffffffff1990811660208085019190915263fd28762760e01b6034850152918b901b1660388301528251602c818403018152604c830184528051908201207f19457468657265756d205369676e6564204d6573736167653a0a333200000000606c84015260888084018290528451808503909101815260a8909301909352815191012060006122fa8287878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250612fe892505050565b6001600160a01b0381166000908152601f602052604090205490915060ff16806123665760405162461bcd60e51b815260206004820152601f60248201527f596f7572206163636f756e74206973206e6f742077686974656c6973746564006044820152606401610e6c565b6123728b8b8b8b612d16565b50505050506120346001600d55565b60006001600160e01b0319821663780e9d6360e01b1480610d395750610d398261300c565b60006001600160e01b0319821663152a902d60e11b1480610d395750610d3982612381565b60006001600160e01b03198216637965db0b60e01b1480610d395750610d39826123a6565b6000818152600260205260409020546001600160a01b0316611fa75760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b6044820152606401610e6c565b600081815260046020526040902080546001600160a01b0319166001600160a01b03841690811790915581906124848261167e565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000806124c98361167e565b9050806001600160a01b0316846001600160a01b0316148061251057506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff165b806125345750836001600160a01b031661252984610dd1565b6001600160a01b0316145b949350505050565b826001600160a01b031661254f8261167e565b6001600160a01b0316146125755760405162461bcd60e51b8152600401610e6c90614994565b6001600160a01b0382166125d75760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610e6c565b6125e4838383600161305c565b826001600160a01b03166125f78261167e565b6001600160a01b03161461261d5760405162461bcd60e51b8152600401610e6c90614994565b600081815260046020908152604080832080546001600160a01b03199081169091556001600160a01b0387811680865260038552838620805460001901905590871680865283862080546001019055868652600290945282852080549092168417909155905184937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b611fa78133613195565b6127106001600160601b03821611156127255760405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646044820152692073616c65507269636560b01b6064820152608401610e6c565b6001600160a01b03821661277b5760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c6964207265636569766572000000000000006044820152606401610e6c565b604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b90910217600a55565b6127be8282611aeb565b61106e576000828152600c602090815260408083206001600160a01b03851684529091529020805460ff191660011790556127f63390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6128448282611aeb565b1561106e576000828152600c602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b804710156128f15760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610e6c565b6000826001600160a01b03168260405160006040518083038185875af1925050503d806000811461293e576040519150601f19603f3d011682016040523d82523d6000602084013e612943565b606091505b5050905080610f0d5760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d617920686176652072657665727465640000000000006064820152608401610e6c565b6000600160156129ca8285614630565b600681106129da576129da6146e3565b01547f00000000000000000000000000000000000000000000000000000000000004e2856001811115612a0f57612a0f613e0c565b6002886003811115612a2357612a23613e0c565b612a2d91906145ee565b612a379190614783565b612a4191906145ee565b612a4b9190614783565b6125349190614783565b61106e8282604051806020016040528060008152506131ee565b600e546001600160a01b031633146119c15760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610e6c565b600e80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b816001600160a01b0316836001600160a01b031603612b7c5760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610e6c565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b612bf484848461253c565b612c0084848484613221565b611c615760405162461bcd60e51b8152600401610e6c906149d9565b606060208054610d4e9061457a565b60606000612c3883613322565b60010190506000816001600160401b03811115612c5757612c57613f68565b6040519080825280601f01601f191660200182016040528015612c81576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a8504945084612c8b57509392505050565b6002600d5403612d0f5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610e6c565b6002600d55565b60158310612d745760405162461bcd60e51b815260206004820152602560248201527f596f752063616e2070757263686173652061206d6178696d756d206f66203230604482015264204e46547360d81b6064820152608401610e6c565b826021612d82600184614630565b60068110612d9257612d926146e3565b0154612d9e91906145ee565b341015612ded5760405162461bcd60e51b815260206004820152601960248201527f45746865722073656e74206973206e6f7420636f7272656374000000000000006044820152606401610e6c565b6001811015612e2d5760405162461bcd60e51b815260206004820152600c60248201526b5469657220746f6f206c6f7760a01b6044820152606401610e6c565b6006811115612e6e5760405162461bcd60e51b815260206004820152600d60248201526c0a8d2cae440e8dede40d0d2ced609b1b6044820152606401610e6c565b6000612e7c836000846129ba565b90506000612e8c846001856129ba565b6000818152601b6020526040808220548583529082205492935090916002600f612eb7600189614630565b60068110612ec757612ec76146e3565b0154612ed391906145ee565b612edd9190614630565b612ee79190614630565b905085811015612f4c5760405162461bcd60e51b815260206004820152602a60248201527f4e6f7420656e6f75676820546f6b656e73206f662073656c6563746564204b696044820152693733b237b697aa34b2b960b11b6064820152608401610e6c565b60005b86811015612fde576000612f65838388886133fa565b90506000612f748883896129ba565b6000818152601b602052604081205491925090612f92908390614783565b90506001601b60008481526020019081526020016000206000828254612fb89190614783565b90915550612fc890508b82612a55565b5050508080612fd6906146f9565b915050612f4f565b5050505050505050565b6000806000612ff785856134b2565b91509150613004816134f4565b509392505050565b60006001600160e01b031982166380ac58cd60e01b148061303d57506001600160e01b03198216635b5e139f60e01b145b80610d3957506301ffc9a760e01b6001600160e01b0319831614610d39565b6130688484848461363e565b60018111156130d75760405162461bcd60e51b815260206004820152603560248201527f455243373231456e756d657261626c653a20636f6e7365637574697665207472604482015274185b9cd9995c9cc81b9bdd081cdd5c1c1bdc9d1959605a1b6064820152608401610e6c565b816001600160a01b0385166131335761312e81600880546000838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b613156565b836001600160a01b0316856001600160a01b0316146131565761315685826136c6565b6001600160a01b0384166131725761316d81613763565b611a4e565b846001600160a01b0316846001600160a01b031614611a4e57611a4e8482613812565b61319f8282611aeb565b61106e576131ac81613856565b6131b7836020613868565b6040516020016131c8929190614a2b565b60408051601f198184030181529082905262461bcd60e51b8252610e6c91600401613db8565b6131f88383613a03565b6132056000848484613221565b610f0d5760405162461bcd60e51b8152600401610e6c906149d9565b60006001600160a01b0384163b1561331757604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290613265903390899088908890600401614aa0565b6020604051808303816000875af19250505080156132a0575060408051601f3d908101601f1916820190925261329d91810190614ad3565b60015b6132fd573d8080156132ce576040519150601f19603f3d011682016040523d82523d6000602084013e6132d3565b606091505b5080516000036132f55760405162461bcd60e51b8152600401610e6c906149d9565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050612534565b506001949350505050565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106133615772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef8100000000831061338d576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc1000083106133ab57662386f26fc10000830492506010015b6305f5e10083106133c3576305f5e100830492506008015b61271083106133d757612710830492506004015b606483106133e9576064830492506002015b600a8310610d395760010192915050565b60008084613409600143614630565b60408051602081019390935290409082015244606082015260800160408051601f1981840301815291905280516020909101209050600061344a8688614630565b905060006134588284614712565b6000868152601b6020526040902054909150600f613477600189614630565b60068110613487576134876146e3565b01546134939190614630565b8110156134a65760009350505050612534565b60019350505050612534565b60008082516041036134e85760208301516040840151606085015160001a6134dc87828585613b9c565b9450945050505061113e565b5060009050600261113e565b600081600481111561350857613508613e0c565b036135105750565b600181600481111561352457613524613e0c565b036135715760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610e6c565b600281600481111561358557613585613e0c565b036135d25760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610e6c565b60038160048111156135e6576135e6613e0c565b03611fa75760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610e6c565b6001811115611c61576001600160a01b03841615613684576001600160a01b0384166000908152600360205260408120805483929061367e908490614630565b90915550505b6001600160a01b03831615611c61576001600160a01b038316600090815260036020526040812080548392906136bb908490614783565b909155505050505050565b600060016136d384611929565b6136dd9190614630565b600083815260076020526040902054909150808214613730576001600160a01b03841660009081526006602090815260408083208584528252808320548484528184208190558352600790915290208190555b5060009182526007602090815260408084208490556001600160a01b039094168352600681528383209183525290812055565b60085460009061377590600190614630565b6000838152600960205260408120546008805493945090928490811061379d5761379d6146e3565b9060005260206000200154905080600883815481106137be576137be6146e3565b60009182526020808320909101929092558281526009909152604080822084905585825281205560088054806137f6576137f6614af0565b6001900381819060005260206000200160009055905550505050565b600061381d83611929565b6001600160a01b039093166000908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b6060610d396001600160a01b03831660145b606060006138778360026145ee565b613882906002614783565b6001600160401b0381111561389957613899613f68565b6040519080825280601f01601f1916602001820160405280156138c3576020820181803683370190505b509050600360fc1b816000815181106138de576138de6146e3565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061390d5761390d6146e3565b60200101906001600160f81b031916908160001a90535060006139318460026145ee565b61393c906001614783565b90505b60018111156139b4576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110613970576139706146e3565b1a60f81b828281518110613986576139866146e3565b60200101906001600160f81b031916908160001a90535060049490941c936139ad81614b06565b905061393f565b508315611e105760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610e6c565b6001600160a01b038216613a595760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610e6c565b6000818152600260205260409020546001600160a01b031615613abe5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610e6c565b613acc60008383600161305c565b6000818152600260205260409020546001600160a01b031615613b315760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610e6c565b6001600160a01b038216600081815260036020908152604080832080546001019055848352600290915280822080546001600160a01b0319168417905551839291907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115613bd35750600090506003613c57565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015613c27573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116613c5057600060019250925050613c57565b9150600090505b94509492505050565b60405180608001604052806004906020820280368337509192915050565b8260068101928215613cac579160200282015b82811115613cac578251825591602001919060010190613c91565b50613cb8929150613d07565b5090565b6040518060c001604052806006906020820280368337509192915050565b60405180608001604052806004905b613cf1613cbc565b815260200190600190039081613ce95790505090565b5b80821115613cb85760008155600101613d08565b600060208284031215613d2e57600080fd5b5035919050565b6001600160e01b031981168114611fa757600080fd5b600060208284031215613d5d57600080fd5b8135611e1081613d35565b60005b83811015613d83578181015183820152602001613d6b565b50506000910152565b60008151808452613da4816020860160208601613d68565b601f01601f19169290920160200192915050565b602081526000611e106020830184613d8c565b6001600160a01b0381168114611fa757600080fd5b60008060408385031215613df357600080fd5b8235613dfe81613dcb565b946020939093013593505050565b634e487b7160e01b600052602160045260246000fd5b60048110613e3257613e32613e0c565b9052565b60208101610d398284613e22565b600080600060608486031215613e5957600080fd5b8335613e6481613dcb565b92506020840135613e7481613dcb565b929592945050506040919091013590565b60006040828403121561131057600080fd5b60008060408385031215613eaa57600080fd5b50508035926020909101359150565b60008060408385031215613ecc57600080fd5b823591506020830135613ede81613dcb565b809150509250929050565b60808101818360005b6004811015613f135781511515835260209283019290910190600101613ef2565b50505092915050565b803560048110613f2b57600080fd5b919050565b600060208284031215613f4257600080fd5b611e1082613f1c565b600060208284031215613f5d57600080fd5b8135611e1081613dcb565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715613fa657613fa6613f68565b604052919050565b60006020808385031215613fc157600080fd5b82356001600160401b0380821115613fd857600080fd5b818501915085601f830112613fec57600080fd5b813581811115613ffe57613ffe613f68565b8060051b915061400f848301613f7e565b818152918301840191848101908884111561402957600080fd5b938501935b83851015614053578435925061404383613dcb565b828252938501939085019061402e565b98975050505050505050565b80358015158114613f2b57600080fd5b60008060006060848603121561408457600080fd5b61408d84613f1c565b925061409b6020850161405f565b91506140a96040850161405f565b90509250925092565b600060c082840312156140c457600080fd5b82601f8301126140d357600080fd5b60405160c081018181106001600160401b03821117156140f5576140f5613f68565b6040528060c084018581111561410a57600080fd5b845b8181101561412457803583526020928301920161410c565b509195945050505050565b803560028110613f2b57600080fd5b600080600080600060a0868803121561415657600080fd5b853561416181613dcb565b94506020860135935061417660408701613f1c565b92506141846060870161412f565b949793965091946080013592915050565b60008083601f8401126141a757600080fd5b5081356001600160401b038111156141be57600080fd5b6020830191508360208260051b850101111561113e57600080fd5b600080602083850312156141ec57600080fd5b82356001600160401b0381111561420257600080fd5b61420e85828601614195565b90969095509350505050565b8060005b6006811015611c6157815184526020938401939091019060010161421e565b60c08101610d39828461421a565b60008083601f84011261425d57600080fd5b5081356001600160401b0381111561427457600080fd5b60208301915083602082850101111561113e57600080fd5b6000806020838503121561429f57600080fd5b82356001600160401b038111156142b557600080fd5b61420e8582860161424b565b600080604083850312156142d457600080fd5b82356142df81613dcb565b91506142ed6020840161405f565b90509250929050565b6000806000806080858703121561430c57600080fd5b843561431781613dcb565b935060208581013561432881613dcb565b93506040860135925060608601356001600160401b038082111561434b57600080fd5b818801915088601f83011261435f57600080fd5b81358181111561437157614371613f68565b614383601f8201601f19168501613f7e565b9150808252898482850101111561439957600080fd5b808484018584013760008482840101525080935050505092959194509250565b6103008101818360005b6004811015613f13576143d783835161421a565b60c09290920191602091909101906001016143c3565b60008060006060848603121561440257600080fd5b61440b84613f1c565b92506144196020850161412f565b9150604084013590509250925092565b602081016002831061443d5761443d613e0c565b91905290565b6000806040838503121561445657600080fd5b823561446181613dcb565b91506020830135613ede81613dcb565b60008060006040848603121561448657600080fd5b83356001600160401b0381111561449c57600080fd5b6144a886828701614195565b90945092506140a990506020850161405f565b600080600080608085870312156144d157600080fd5b84356144dc81613dcb565b9350602085013592506144f160408601613f1c565b9396929550929360600135925050565b60008060008060008060a0878903121561451a57600080fd5b863561452581613dcb565b95506020870135945061453a60408801613f1c565b93506060870135925060808701356001600160401b0381111561455c57600080fd5b61456889828a0161424b565b979a9699509497509295939492505050565b600181811c9082168061458e57607f821691505b60208210810361131057634e487b7160e01b600052602260045260246000fd5b60208082526010908201526f546f6b656e20494420746f6f206c6f7760801b604082015260600190565b634e487b7160e01b600052601160045260246000fd5b8082028115828204841417610d3957610d396145d8565b6020808252601190820152700a8ded6cadc40928840e8dede40d0d2ced607b1b604082015260600190565b81810381811115610d3957610d396145d8565b634e487b7160e01b600052601260045260246000fd5b60008261466857614668614643565b500490565b6020808252602d908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526c1c881bdc88185c1c1c9bdd9959609a1b606082015260800190565b6000602082840312156146cc57600080fd5b81356001600160601b0381168114611e1057600080fd5b634e487b7160e01b600052603260045260246000fd5b60006001820161470b5761470b6145d8565b5060010190565b60008261472157614721614643565b500690565b606081016147348286613e22565b9215156020820152901515604090910152919050565b6101808101818460005b6006811015614773578154835260209092019160019182019101614754565b505050611e1060c083018461421a565b80820180821115610d3957610d396145d8565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6040815260008085546147d18161457a565b80604086015260606001808416600081146147f3576001811461480d5761483e565b60ff1985168884015283151560051b88018301955061483e565b8a60005260208060002060005b868110156148355781548b820187015290840190820161481a565b8a018501975050505b50505050508281036020840152614856818587614796565b9695505050505050565b601f821115610f0d57600081815260208120601f850160051c810160208610156148875750805b601f850160051c820191505b8181101561203457828155600101614893565b6001600160401b038311156148bd576148bd613f68565b6148d1836148cb835461457a565b83614860565b6000601f84116001811461490557600085156148ed5750838201355b600019600387901b1c1916600186901b178355611a4e565b600083815260209020601f19861690835b828110156149365786850135825560209485019460019092019101614916565b50868210156149535760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b60008351614977818460208801613d68565b83519083019061498b818360208801613d68565b01949350505050565b60208082526025908201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060408201526437bbb732b960d91b606082015260800190565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351614a63816017850160208801613d68565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351614a94816028840160208801613d68565b01602801949350505050565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061485690830184613d8c565b600060208284031215614ae557600080fd5b8151611e1081613d35565b634e487b7160e01b600052603160045260246000fd5b600081614b1557614b156145d8565b50600019019056fe28f5a99355973cc89255b8c4ac88405f27c78ded7608b040ee77a8bdf44d15e2a2646970667358221220c5fd70b8e0e5be78b483b71386a51b1df6f20c537fb666bd95366b2ad378cf2564736f6c63430008120033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000000000000000000000000000000000000000012000000000000000000000000007382eab8c0ca1aed1e5c6627d376e35bcc3a83a000000000000000000000000eca7ca7cacecd2a813678e24de44df8d56755d9c0000000000000000000000000000000000000000000000000000000000000177000000000000000000000000000000000000000000000000000000000000017700000000000000000000000000000000000000000000000000000000000001a90000000000000000000000000000000000000000000000000000000000000044000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000043697066733a2f2f62616679626569636f6e62726f68636661757163686b71686472643576336a6c683675336769643571733267327a34637065616e75786c327078612f0000000000000000000000000000000000000000000000000000000000
-----Decoded View---------------
Arg [0] : _baseUri (string): ipfs://bafybeiconbrohcfauqchkqhdrd5v3jlh6u3gid5qs2g2z4cpeanuxl2pxa/
Arg [1] : _minter (address): 0x07382Eab8c0cA1aEd1e5C6627d376E35BCC3A83a
Arg [2] : _admin (address): 0xEca7Ca7CACECd2a813678e24De44df8d56755d9C
Arg [3] : _tierQuantities (uint256[6]): 375,375,425,68,6,1
-----Encoded View---------------
13 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000120
Arg [1] : 00000000000000000000000007382eab8c0ca1aed1e5c6627d376e35bcc3a83a
Arg [2] : 000000000000000000000000eca7ca7cacecd2a813678e24de44df8d56755d9c
Arg [3] : 0000000000000000000000000000000000000000000000000000000000000177
Arg [4] : 0000000000000000000000000000000000000000000000000000000000000177
Arg [5] : 00000000000000000000000000000000000000000000000000000000000001a9
Arg [6] : 0000000000000000000000000000000000000000000000000000000000000044
Arg [7] : 0000000000000000000000000000000000000000000000000000000000000006
Arg [8] : 0000000000000000000000000000000000000000000000000000000000000001
Arg [9] : 0000000000000000000000000000000000000000000000000000000000000043
Arg [10] : 697066733a2f2f62616679626569636f6e62726f68636661757163686b716864
Arg [11] : 72643576336a6c683675336769643571733267327a34637065616e75786c3270
Arg [12] : 78612f0000000000000000000000000000000000000000000000000000000000
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.