ERC-721
NFT
Overview
Max Total Supply
1,154 HWC
Holders
70
Market
Volume (24H)
N/A
Min Price (24H)
N/A
Max Price (24H)
N/A
Other Info
Token Contract
Balance
1 HWCLoading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
Contract Source Code Verified (Exact Match)
Contract Name:
HytteWandererClub
Compiler Version
v0.8.25+commit.b61c2a91
Optimization Enabled:
Yes with 200 runs
Other Settings:
cancun EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
/// SPDX-License-Identifier: GPL-3.0-or-later /// /// ,--, /// ,--.'| .---. ,----.. /// ,--, | : /. ./| / / \ /// ,---.'| : ' .--'. ' ; | : : /// | | : _' | /__./ \ : | . | ;. / /// : : |.' | .--'. ' \' . . ; /--` /// | ' ' ; : /___/ \ | ' ' ; | ; /// ' | .'. | ; \ \; : | : | /// | | : | ' \ ; ` | . | '___ /// ' : | : ; . \ .\ ; ' ; : .'| /// | | ' ,/ \ \ ' \ | ' | '/ : /// ; : ;--' : ' |--" | : / /// | ,/ \ \ ; \ \ .' /// '---' '---" `---` /// /// @title HWC (Hytte Wanderer Club) /// @author Ravi ([email protected]) /// @notice A NFT crowdfunding project hosted by Whyout /// @custom:security-contact [email protected] pragma solidity ^0.8.25; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Pausable.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/access/extensions/AccessControlEnumerable.sol"; import {MerkleProof} from "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; contract HytteWandererClub is ERC721, ERC721Enumerable, ERC721Pausable, ERC721Burnable, ReentrancyGuard, AccessControlEnumerable { enum NftType { TravelerWater, CamperFire, BackpackerEarth, // Trick for counting the number of elements in this enum length } enum MintType { Team, Sale, Partners, // Trick for counting the number of elements in this enum length } enum SaleType { FirstPrivateSale, SecondPrivateSale, PublicSale, // Trick for counting the number of elements in this enum length } enum SalePaymentCurrencyType { ETH, KRW } struct SupplyInfo { uint16 max; uint16 current; } struct AmountInfoByNftType { uint16 traveler; uint16 camper; uint16 backpacker; } struct EthSalePriceInfoByNftType { uint256 traveler; uint256 camper; uint256 backpacker; } ////////////////////////////////////////////////// /// Constants ////////////////////////////////////////////////// bytes32 public constant KRW_MINTER_ROLE = keccak256("KRW_MINTER_ROLE"); uint16 public constant MAX_SUPPLY_FOR_TRAVELER = 450; uint16 public constant MAX_SUPPLY_FOR_CAMPER = 1800; uint16 public constant MAX_SUPPLY_FOR_BACKPACKER = 2250; uint16 private constant _START_TOKEN_ID_FOR_TRAVELER = 1; uint16 private constant _START_TOKEN_ID_FOR_CAMPER = _START_TOKEN_ID_FOR_TRAVELER + MAX_SUPPLY_FOR_TRAVELER; uint16 private constant _START_TOKEN_ID_FOR_BACKPACKER = _START_TOKEN_ID_FOR_CAMPER + MAX_SUPPLY_FOR_CAMPER; uint8 private constant _NUMBER_OF_NFT_TYPES = uint8(NftType.length); uint8 private constant _NUMBER_OF_MINT_TYPES = uint8(MintType.length); uint8 private constant _NUMBER_OF_SALE_TYPES = uint8(SaleType.length); ////////////////////////////////////////////////// /// Storage variables ////////////////////////////////////////////////// string private _metadataBaseURI; bool public isRevealed; bool public isTransferable; bool public isPublicSaleOpened; bool public isPrivateSaleOpened; uint16 public maxAmountCanBeMintedAtOnce; bytes32 public merkleRootForFirstWhitelist; bytes32 public merkleRootForSecondWhitelist; mapping(MintType => mapping(NftType => SupplyInfo)) private _supplyInfo; mapping(SaleType => uint16) public currentSupplyBySaleType; mapping(SalePaymentCurrencyType => uint16) public currentSupplyBySalePaymentCurrencyType; mapping(SaleType => EthSalePriceInfoByNftType) public ethSalePrices; ////////////////////////////////////////////////// /// Events ////////////////////////////////////////////////// event BaseUriChanged(string indexed newBaseUri); event RevealStatusChanged(bool indexed isRevealed); event TransferabilityChanged(bool indexed isTransferable); event FirstWhitelistChanged(bytes32 indexed newMerkleRoot); event SecondWhitelistChanged(bytes32 indexed newMerkleRoot); event PublicSaleOpenStatusChanged(bool indexed isOpened); event PrivateSaleOpenStatusChanged(bool indexed isOpened); event MaxAmountCanBeMintedAtOnceChanged( uint16 indexed maxAmountCanBeMintedAtOnce ); event MintedForTeam(address indexed to, AmountInfoByNftType mintAmountInfo); event MintedForSale( address indexed to, SaleType indexed saleType, SalePaymentCurrencyType indexed currencyType, AmountInfoByNftType mintAmountInfo ); event MintedForPartners( address indexed to, AmountInfoByNftType mintAmountInfo ); event MaxSupplyInfoChanged( uint256 indexed timestamp, AmountInfoByNftType[] newMaxSupplyInfo ); event EthSalePriceChanged( uint256 indexed timestamp, EthSalePriceInfoByNftType[] newEthSalePricesBySaleType ); ////////////////////////////////////////////////// /// Errors ////////////////////////////////////////////////// error TransferRestricted(); error PublicSaleAlreadyOpened(); error PublicSaleAlreadyClosed(); error PrivateSaleAlreadyOpened(); error PrivateSaleAlreadyClosed(); error TooSmallValue(uint256 value); error SaleNotOpened(SaleType saleType); error BroaderRestrictionAlreadyApplied(); error ArrayLengthNotMatched(uint256 invalidLength); /// @notice The MaxMintTypeSupplyExceeded error, unlike the MaxNftTypeSupplyExceeded error, does not provide information about the value that exceeded the maximum supply. /// @notice This is because the maximum supply information for some mint types is not accessible based on permissions. error MaxMintTypeSupplyExceeded(MintType mintType); error NotWhitelisted(bytes32 registeredMerkleRoot); error MaxTotalSupplyExceeded(uint16 exceededValue); error InsufficientFundsToWithdraw(uint256 currentBalance); error UnauthorizedAccessToSupplyByMintType(MintType mintType); error MaxAmountCanBeMintedAtOnceExceeded(uint16 exceededValue); error MaxNftTypeSupplyExceeded(NftType nftType, uint16 exceededValue); error NotMatchedWithSalePrice(SaleType saleType, uint256 requiredWeiAmount); error NewMaxNftTypeSupplyIsLessThanCurrentSupply( MintType mintType, NftType nftType ); /// @notice A constructor for setting initial values /// @param krwMinter Address to be given a role that can KRW mint /// @param metadataBaseURI Initial value for metadata base URI /// @param maxAmountCanBeMintedAtOnce_ Initial value for maximum supply to limit the number of NFTs that can be minted at once (one transaction) /// @param maxSupplyInfo Initial value for maximum supply by mint type /// @param ethSalePricesInWeiBySaleType Initial value for ETH sale price (wei) by sale type constructor( address krwMinter, string memory metadataBaseURI, uint16 maxAmountCanBeMintedAtOnce_, AmountInfoByNftType[] memory maxSupplyInfo, EthSalePriceInfoByNftType[] memory ethSalePricesInWeiBySaleType ) ERC721("HytteWandererClub", "HWC") { // Grant roles bytes32 krwMinterRole = KRW_MINTER_ROLE; bool isOwnerGrantedDefaultAdminRole = _grantRole( DEFAULT_ADMIN_ROLE, msg.sender ); bool isOwnerGrantedKrwMinterRole = _grantRole( krwMinterRole, msg.sender ); bool isGrantedKrwMinterRole = _grantRole(krwMinterRole, krwMinter); assert( isOwnerGrantedDefaultAdminRole && isOwnerGrantedKrwMinterRole && isGrantedKrwMinterRole ); // Set initial state values _metadataBaseURI = metadataBaseURI; setMaxAmountCanBeMintedAtOnce(maxAmountCanBeMintedAtOnce_); setMaxSupplyInfo(maxSupplyInfo); setEthSalePrices(ethSalePricesInWeiBySaleType); } ////////////////////////////////////////////////// /// Modifiers ////////////////////////////////////////////////// /// @notice A modifier for applying restriction logic when accessing current/max supply by mint type so that users can only access Team supply modifier ensureUsersCanOnlySeeTeamSupplyByMintType(MintType mintType) { if ( (!hasRole(DEFAULT_ADMIN_ROLE, msg.sender) && !hasRole(KRW_MINTER_ROLE, msg.sender)) && mintType != MintType.Team ) { revert UnauthorizedAccessToSupplyByMintType(mintType); } _; } /// @notice A modifier for applying restriction logic to only allow minting to whitelisted addresses when doing private sale minting modifier ensureWhitelistedOnly( address address_, bytes32 merkleRootForWhitelist, bytes32[] calldata merkleProof ) { bytes32 leafNode = keccak256(abi.encodePacked(address_)); if ( !MerkleProof.verify(merkleProof, merkleRootForWhitelist, leafNode) ) { revert NotWhitelisted(merkleRootForWhitelist); } _; } /// @notice A modifier to validate restrictions on sales modifier ensureForSale( address to, SaleType saleType, SalePaymentCurrencyType salePaymentCurrencyType, AmountInfoByNftType calldata mintAmountInfo ) { uint16 totalAmount = mintAmountInfo.traveler + mintAmountInfo.camper + mintAmountInfo.backpacker; // Check if sale is already opened or not if ( saleType == SaleType.FirstPrivateSale || saleType == SaleType.SecondPrivateSale ? !isPrivateSaleOpened : !isPublicSaleOpened ) { revert SaleNotOpened(saleType); } // Applying a maximum of N supply limit logic to a single mint when a user joins ETH sale mintings if (totalAmount > maxAmountCanBeMintedAtOnce) { revert MaxAmountCanBeMintedAtOnceExceeded(totalAmount); } // Validates whether the total price of Wei required for minting is different from the ETH sale price multiplied by the total minting amount if (salePaymentCurrencyType == SalePaymentCurrencyType.ETH) { uint256 requiredWeiAmount = ethSalePrices[saleType].traveler * mintAmountInfo.traveler + ethSalePrices[saleType].camper * mintAmountInfo.camper + ethSalePrices[saleType].backpacker * mintAmountInfo.backpacker; if (msg.value != requiredWeiAmount) { revert NotMatchedWithSalePrice(saleType, requiredWeiAmount); } } _; } ////////////////////////////////////////////////// /// Control the sales and transferability ////////////////////////////////////////////////// /// @notice Open both 1st/2nd private sale, public sale /// @dev Can only be called by the Contract Owner /// @dev Automatically enabled secondary trade protection feature function openAllSale() external onlyRole(DEFAULT_ADMIN_ROLE) { openPublicSale(); openPrivateSale(); } /// @notice Close both 1st/2nd private sale, public sale /// @dev Can only be called by the Contract Owner /// @dev Secondary trading protection feature is not automatically disabled (you can manually disable this at your own discretion) function closeAllSale() external onlyRole(DEFAULT_ADMIN_ROLE) { closePublicSale(); closePrivateSale(); } /// @notice Open 1st/2nd private sale /// @dev Can only be called by the Contract Owner /// @dev Automatically enabled secondary trade protection feature function openPrivateSale() public onlyRole(DEFAULT_ADMIN_ROLE) { if (isPrivateSaleOpened) { revert PrivateSaleAlreadyOpened(); } isPrivateSaleOpened = true; if (!paused()) setTransferability(false); emit PrivateSaleOpenStatusChanged(isPrivateSaleOpened); } /// @notice Close 1st/2nd private sale /// @dev Can only be called by the Contract Owner /// @dev Secondary trading protection feature is not automatically disabled (you can manually disable this at your own discretion) function closePrivateSale() public onlyRole(DEFAULT_ADMIN_ROLE) { if (!isPrivateSaleOpened) { revert PrivateSaleAlreadyClosed(); } isPrivateSaleOpened = false; emit PrivateSaleOpenStatusChanged(isPrivateSaleOpened); } /// @notice Open public sale /// @dev Can only be called by the Contract Owner /// @dev Automatically enabled secondary trade protection feature function openPublicSale() public onlyRole(DEFAULT_ADMIN_ROLE) { if (isPublicSaleOpened) { revert PublicSaleAlreadyOpened(); } isPublicSaleOpened = true; if (!paused()) setTransferability(false); emit PublicSaleOpenStatusChanged(isPublicSaleOpened); } /// @notice Close public sale /// @dev Can only be called by the Contract Owner /// @dev Secondary trading protection feature is not automatically disabled (you can manually disable this at your own discretion) function closePublicSale() public onlyRole(DEFAULT_ADMIN_ROLE) { if (!isPublicSaleOpened) { revert PublicSaleAlreadyClosed(); } isPublicSaleOpened = false; emit PublicSaleOpenStatusChanged(isPublicSaleOpened); } /// @notice Enable or disable secondary trade protection feature /// @param newIsTransferable Whether to enable secondary trade protection feature function setTransferability( bool newIsTransferable ) public onlyRole(DEFAULT_ADMIN_ROLE) { if (paused()) { revert BroaderRestrictionAlreadyApplied(); } isTransferable = newIsTransferable; emit TransferabilityChanged(newIsTransferable); } /// @notice Overriding the transferFrom() function to prevent secondary trading function transferFrom( address from, address to, uint256 tokenId ) public override(ERC721, IERC721) { if (!isTransferable) { revert TransferRestricted(); } super.transferFrom(from, to, tokenId); } ////////////////////////////////////////////////// /// NFT Type ////////////////////////////////////////////////// /// @return Returns the NFT type corresponding to a specific Token ID /// @dev Token IDs are allocated in ranges by NFT type /// @param tokenId The token ID for which you want to look up the NFT type function getNftType(uint16 tokenId) external pure returns (NftType) { if (tokenId >= _START_TOKEN_ID_FOR_BACKPACKER) return NftType.BackpackerEarth; else if (tokenId >= _START_TOKEN_ID_FOR_CAMPER) return NftType.CamperFire; else return NftType.TravelerWater; } /// @notice Set ETH sale prices for each NFT type by SaleType /// @dev Can only be called by the Contract Owner /// @param ethSalePricesInWeiBySaleType Set ETH sale price (wei) for each NFT type by SaleType function setEthSalePrices( EthSalePriceInfoByNftType[] memory ethSalePricesInWeiBySaleType ) public onlyRole(DEFAULT_ADMIN_ROLE) { uint8 cntSaleTypes = _NUMBER_OF_SALE_TYPES; if (ethSalePricesInWeiBySaleType.length != cntSaleTypes) { revert ArrayLengthNotMatched(ethSalePricesInWeiBySaleType.length); } for (uint8 i = 0; i < cntSaleTypes; ++i) { SaleType saleType = SaleType(i); EthSalePriceInfoByNftType storage ethSalePriceForSaleType = ethSalePrices[saleType]; ethSalePriceForSaleType.traveler = ethSalePricesInWeiBySaleType[i] .traveler; ethSalePriceForSaleType.camper = ethSalePricesInWeiBySaleType[i] .camper; ethSalePriceForSaleType.backpacker = ethSalePricesInWeiBySaleType[i] .backpacker; } emit EthSalePriceChanged(block.timestamp, ethSalePricesInWeiBySaleType); } ////////////////////////////////////////////////// /// White list ////////////////////////////////////////////////// /// @notice Setting up a whitelist for the 1st private sale /// @dev Can only be called by the Contract Owner /// @dev Verify whether an address is whitelisted or not using the Merkle Proof algorithm /// @param newMerkleRoot The hash value of the root node of the merkle tree generated from the 1st private sale whitelist function setFirstWhitelist( bytes32 newMerkleRoot ) external onlyRole(DEFAULT_ADMIN_ROLE) { merkleRootForFirstWhitelist = newMerkleRoot; emit FirstWhitelistChanged(newMerkleRoot); } /// @notice Setting up a whitelist for the 2nd private sale /// @dev Can only be called by the Contract Owner /// @dev Verify whether an address is whitelisted or not using the Merkle Proof algorithm /// @param newMerkleRoot The hash value of the root node of the merkle tree generated from the 2nd private sale whitelist function setSecondWhitelist( bytes32 newMerkleRoot ) external onlyRole(DEFAULT_ADMIN_ROLE) { merkleRootForSecondWhitelist = newMerkleRoot; emit SecondWhitelistChanged(newMerkleRoot); } ////////////////////////////////////////////////// /// Supply ////////////////////////////////////////////////// /// @return Returns the maximum amount of NFTs that can be minted from this collection /// @dev The reason why I return the result of the addition operation of the maximum amount for each NFT type instead of declaring a separate constant storage variable for the maximum supply is to maintain data consistency function getMaxTotalSupply() public pure returns (uint16) { return MAX_SUPPLY_FOR_TRAVELER + MAX_SUPPLY_FOR_CAMPER + MAX_SUPPLY_FOR_BACKPACKER; } /// @return Returns the maximum supply for NFT type /// @dev The maximum supply constant for each NFT type is declared with public access specifiers, so it can be accessed at any time, but the reason for implementing this function separately is that the smart contract uses it internally to improve the reusability of the code /// @param nftType The target NFT type function getMaxSupplyByNftType( NftType nftType ) public pure returns (uint16) { if (nftType == NftType.BackpackerEarth) return MAX_SUPPLY_FOR_BACKPACKER; else if (nftType == NftType.CamperFire) return MAX_SUPPLY_FOR_CAMPER; else return MAX_SUPPLY_FOR_TRAVELER; } /// @return Returns the current supply for NFT type /// @param nftType The target NFT type function getCurrentSupplyByNftType( NftType nftType ) public view returns (uint16) { uint16 sum = 0; uint8 cntMintTypes = _NUMBER_OF_MINT_TYPES; for (uint8 i = 0; i < cntMintTypes; ++i) { sum += _supplyInfo[MintType(i)][nftType].current; } return sum; } /// @return Returns the maximum supply for each mint type /// @dev Ensures that non-contract owner addresses can only access team supply by applying the ensureUsersCanOnlySeeTeamSupplyByMintType modifier. /// @param mintType The target mint type function getMaxSupplyByMintType( MintType mintType ) external view ensureUsersCanOnlySeeTeamSupplyByMintType(mintType) returns (uint16) { uint16 sum = 0; uint8 cntNftTypes = _NUMBER_OF_NFT_TYPES; for (uint8 i = 0; i < cntNftTypes; ++i) { sum += _supplyInfo[mintType][NftType(i)].max; } return sum; } /// @return Returns the current supply for each mint type /// @dev Ensures that non-contract owner addresses can only access team supply by applying the ensureUsersCanOnlySeeTeamSupplyByMintType modifier. /// @param mintType The target mint type function getCurrentSupplyByMintType( MintType mintType ) external view ensureUsersCanOnlySeeTeamSupplyByMintType(mintType) returns (uint16) { uint16 sum = 0; uint8 cntNftTypes = _NUMBER_OF_NFT_TYPES; for (uint8 i = 0; i < cntNftTypes; ++i) { sum += _supplyInfo[mintType][NftType(i)].current; } return sum; } /// @return Returns the maximum and current supply for target mint type and NFT type /// @dev Ensures that non-contract owner addresses can only access team supply by applying the ensureUsersCanOnlySeeTeamSupplyByMintType modifier. /// @param mintType The target mint type /// @param nftType The target NFT type function getSupplyInfo( MintType mintType, NftType nftType ) external view ensureUsersCanOnlySeeTeamSupplyByMintType(mintType) returns (uint16, uint16) { SupplyInfo memory supplyInfo = _supplyInfo[mintType][nftType]; return (supplyInfo.max, supplyInfo.current); } /// @notice Setting the maximum supply /// @dev Can only be called by the Contract Owner /// @param newMaxSupplyInfo Maximum supply information function setMaxSupplyInfo( AmountInfoByNftType[] memory newMaxSupplyInfo ) public onlyRole(DEFAULT_ADMIN_ROLE) { uint8 cntMintTypes = _NUMBER_OF_MINT_TYPES; if (newMaxSupplyInfo.length != cntMintTypes) { revert ArrayLengthNotMatched(newMaxSupplyInfo.length); } // Enum index constants uint8 uintTeam = uint8(MintType.Team); uint8 uintSale = uint8(MintType.Sale); uint8 uintPartners = uint8(MintType.Partners); // Check whether the maximum supply values want to set exceed current supply values uint8 cntNftTypes = _NUMBER_OF_NFT_TYPES; uint16[] memory newMaxSupplyByMintType = new uint16[](cntMintTypes); for (uint8 i = 0; i < cntMintTypes; ++i) { MintType mintType = MintType(i); for (uint8 j = 0; j < cntNftTypes; ++j) { NftType nftType = NftType(j); uint16 currentSupplyInfo = _supplyInfo[mintType][nftType] .current; uint16 newMaxSupply = nftType == NftType.TravelerWater ? newMaxSupplyInfo[i].traveler : ( nftType == NftType.CamperFire ? newMaxSupplyInfo[i].camper : newMaxSupplyInfo[i].backpacker ); // Calculate new maximum total supply by mint type newMaxSupplyByMintType[i] += newMaxSupply; // Ensure that the maximum supply values per NFT type want to set for each mint type are valid if (newMaxSupply < currentSupplyInfo) { revert NewMaxNftTypeSupplyIsLessThanCurrentSupply( mintType, nftType ); } // Set maximum supply by mint type _supplyInfo[mintType][nftType].max = newMaxSupply; } } // Ensure that the maximum total supply values want to set are valid uint16 newMaxTotalSupply = newMaxSupplyByMintType[uintTeam] + newMaxSupplyByMintType[uintSale] + newMaxSupplyByMintType[uintPartners]; if (newMaxTotalSupply > getMaxTotalSupply()) { revert MaxTotalSupplyExceeded(newMaxTotalSupply); } emit MaxSupplyInfoChanged(block.timestamp, newMaxSupplyInfo); } ////////////////////////////////////////////////// /// Mint ////////////////////////////////////////////////// /// @notice Minting for team /// @dev Can only be called by the Contract Owner /// @dev Limited total supply applied /// @dev Limited supply by NFT type applied /// @dev Limited supply by mint type applied /// @param to The recipient address /// @param mintAmountInfo Minting amount by NFT type function mintForTeam( address to, AmountInfoByNftType calldata mintAmountInfo ) external onlyRole(DEFAULT_ADMIN_ROLE) { _batchSafeMint(to, MintType.Team, mintAmountInfo); emit MintedForTeam(to, mintAmountInfo); } /// @notice Minting for 1st ETH private sale /// @dev Limited total supply applied /// @dev Limited supply by NFT type applied /// @dev Limited supply by mint type applied /// @dev Limited this function to be called by EOAs only /// @dev Validate whether a private sale is open /// @dev Validate if the total ETH sale price matches /// @dev Verify if the address is on the 1st whitelist /// @dev Validate that haven't exceeded mintable amount at once /// @param to The recipient address /// @param mintAmountInfo Minting amount by NFT type /// @param merkleProof The Merkle Proof value to verify if the address was whitelisted or not function mintForFirstEthPrivateSale( address to, AmountInfoByNftType calldata mintAmountInfo, bytes32[] calldata merkleProof ) external payable ensureWhitelistedOnly( msg.sender, merkleRootForFirstWhitelist, merkleProof ) { _mintForPrivateSale( to, SaleType.FirstPrivateSale, SalePaymentCurrencyType.ETH, mintAmountInfo ); } /// @notice Minting for 2nd ETH private sale /// @dev Limited total supply applied /// @dev Limited supply by NFT type applied /// @dev Limited supply by mint type applied /// @dev Limited this function to be called by EOAs only /// @dev Validate whether a private sale is open /// @dev Validate if the total ETH sale price matches /// @dev Verify if the address is on the 2nd whitelist /// @dev Validate that haven't exceeded mintable amount at once /// @param to The recipient address /// @param mintAmountInfo Minting amount by NFT type /// @param merkleProof The Merkle Proof value to verify if the address was whitelisted or not function mintForSecondEthPrivateSale( address to, AmountInfoByNftType calldata mintAmountInfo, bytes32[] calldata merkleProof ) external payable ensureWhitelistedOnly( msg.sender, merkleRootForSecondWhitelist, merkleProof ) { _mintForPrivateSale( to, SaleType.SecondPrivateSale, SalePaymentCurrencyType.ETH, mintAmountInfo ); } /// @notice Minting for 1st KRW private sale /// @dev Can only be called by the Contract Owner /// @dev Limited total supply applied /// @dev Limited supply by NFT type applied /// @dev Limited supply by mint type applied /// @dev Verify if the address is on the 1st whitelist /// @dev Validate that haven't exceeded mintable amount at once /// @dev Functions with a payment currency type of KRW will be executed through a KRW minter address on the backend, and only that KRW minter address will have KRW minting permission. Therefore, for flexibility in the number of mints, no logic is applied to limit the number of NFTs that can be mined at a time. /// @param to The recipient address /// @param mintAmountInfo Minting amount by NFT type /// @param merkleProof The Merkle Proof value to verify if the address was whitelisted or not function mintForFirstKrwPrivateSale( address to, AmountInfoByNftType calldata mintAmountInfo, bytes32[] calldata merkleProof ) external onlyRole(KRW_MINTER_ROLE) ensureWhitelistedOnly(to, merkleRootForFirstWhitelist, merkleProof) { _mintForPrivateSale( to, SaleType.FirstPrivateSale, SalePaymentCurrencyType.KRW, mintAmountInfo ); } /// @notice Minting for 2nd KRW private sale /// @dev Can only be called by the Contract Owner /// @dev Limited total supply applied /// @dev Limited supply by NFT type applied /// @dev Limited supply by mint type applied /// @dev Verify if the address is on the 2nd whitelist /// @dev Validate that haven't exceeded mintable amount at once /// @dev Functions with a payment currency type of KRW will be executed through a KRW minter address on the backend, and only that KRW minter address will have KRW minting permission. Therefore, for flexibility in the number of mints, no logic is applied to limit the number of NFTs that can be mined at a time. /// @param to The recipient address /// @param mintAmountInfo Minting amount by NFT type /// @param merkleProof The Merkle Proof value to verify if the address was whitelisted or not function mintForSecondKrwPrivateSale( address to, AmountInfoByNftType calldata mintAmountInfo, bytes32[] calldata merkleProof ) external onlyRole(KRW_MINTER_ROLE) ensureWhitelistedOnly(to, merkleRootForSecondWhitelist, merkleProof) { _mintForPrivateSale( to, SaleType.SecondPrivateSale, SalePaymentCurrencyType.KRW, mintAmountInfo ); } /// @notice Minting for ETH public sale /// @dev Limited total supply applied /// @dev Limited supply by NFT type applied /// @dev Limited supply by mint type applied /// @dev Limited this function to be called by EOAs only /// @dev Validate whether a public sale is open /// @dev Validate if the total ETH sale price matches /// @dev Validate that haven't exceeded mintable amount at once /// @param to The recipient address /// @param mintAmountInfo Minting amount by NFT type function mintForEthPublicSale( address to, AmountInfoByNftType calldata mintAmountInfo ) external payable { _mintForPublicSale(to, SalePaymentCurrencyType.ETH, mintAmountInfo); } /// @notice Minting for KRW public sale /// @dev Can only be called by the Contract Owner /// @dev Limited total supply applied /// @dev Limited supply by NFT type applied /// @dev Limited supply by mint type applied /// @dev Validate that haven't exceeded mintable amount at once /// @dev Functions with a payment currency type of KRW will be executed through a KRW minter address on the backend, and only that KRW minter address will have KRW minting permission. Therefore, for flexibility in the number of mints, no logic is applied to limit the number of NFTs that can be mined at a time. /// @param to The recipient address /// @param mintAmountInfo Minting amount by NFT type function mintForKrwPublicSale( address to, AmountInfoByNftType calldata mintAmountInfo ) external onlyRole(KRW_MINTER_ROLE) { _mintForPublicSale(to, SalePaymentCurrencyType.KRW, mintAmountInfo); } /// @notice Minting for partners /// @dev Can only be called by the Contract Owner /// @dev Limited total supply applied /// @dev Limited supply by NFT type applied /// @dev Limited supply by mint type applied /// @param to The recipient address /// @param mintAmountInfo Minting amount by NFT type function mintForPartners( address to, AmountInfoByNftType calldata mintAmountInfo ) external onlyRole(DEFAULT_ADMIN_ROLE) { _batchSafeMint(to, MintType.Partners, mintAmountInfo); emit MintedForPartners(to, mintAmountInfo); } /// @notice Setting the maximum supply to limit the number of NFTs that can be minted at once (one transaction) /// @dev Can only be called by the Contract Owner /// @param newMaxAmountCanBeMintedAtOnce The value for maximum supply that can be minted at once (one transaction) function setMaxAmountCanBeMintedAtOnce( uint16 newMaxAmountCanBeMintedAtOnce ) public onlyRole(DEFAULT_ADMIN_ROLE) { if (newMaxAmountCanBeMintedAtOnce <= 0) { revert TooSmallValue(newMaxAmountCanBeMintedAtOnce); } maxAmountCanBeMintedAtOnce = newMaxAmountCanBeMintedAtOnce; emit MaxAmountCanBeMintedAtOnceChanged(newMaxAmountCanBeMintedAtOnce); } /// @notice Function that implement common logic used when minting in private sale functions /// @dev Limited total supply applied /// @dev Limited supply by NFT type applied /// @dev Limited supply by mint type applied /// @dev Verify if the address is on the whitelist /// @dev Validate that haven't exceeded mintable amount at once /// @param to The recipient address /// @param saleType The target Sale type /// @param salePaymentCurrencyType The target payment currency type for sale /// @param mintAmountInfo Minting amount by NFT type function _mintForPrivateSale( address to, SaleType saleType, SalePaymentCurrencyType salePaymentCurrencyType, AmountInfoByNftType calldata mintAmountInfo ) private ensureForSale(to, saleType, salePaymentCurrencyType, mintAmountInfo) { _batchSafeMint(to, MintType.Sale, mintAmountInfo); // Refresh current supply info uint16 totalAmount = mintAmountInfo.traveler + mintAmountInfo.camper + mintAmountInfo.backpacker; currentSupplyBySaleType[saleType] += totalAmount; currentSupplyBySalePaymentCurrencyType[ salePaymentCurrencyType ] += totalAmount; emit MintedForSale( to, saleType, salePaymentCurrencyType, mintAmountInfo ); } /// @notice Function that implement common logic used when minting in public sale functions /// @dev Limited total supply applied /// @dev Limited supply by NFT type applied /// @dev Limited supply by mint type applied /// @dev Validate that haven't exceeded mintable amount at once /// @param to The recipient address /// @param salePaymentCurrencyType The target payment currency type for sale /// @param mintAmountInfo Minting amount by NFT type function _mintForPublicSale( address to, SalePaymentCurrencyType salePaymentCurrencyType, AmountInfoByNftType calldata mintAmountInfo ) private ensureForSale( to, SaleType.PublicSale, salePaymentCurrencyType, mintAmountInfo ) { _batchSafeMint(to, MintType.Sale, mintAmountInfo); // Refresh current supply info uint16 totalAmount = mintAmountInfo.traveler + mintAmountInfo.camper + mintAmountInfo.backpacker; currentSupplyBySaleType[SaleType.PublicSale] += totalAmount; currentSupplyBySalePaymentCurrencyType[ salePaymentCurrencyType ] += totalAmount; emit MintedForSale( to, SaleType.PublicSale, salePaymentCurrencyType, mintAmountInfo ); } /// @notice Function that implement common logic used in minting functions /// @dev Limited total supply applied /// @dev Limited supply by NFT type applied /// @param to The recipient address /// @param mintType The target mint type /// @param mintAmountInfo Minting amount by NFT type function _batchSafeMint( address to, MintType mintType, AmountInfoByNftType calldata mintAmountInfo ) private nonReentrant { // Local variables uint16 totalAmount = mintAmountInfo.traveler + mintAmountInfo.camper + mintAmountInfo.backpacker; mapping(NftType => SupplyInfo) storage supplyInfoForMintType = _supplyInfo[mintType]; SupplyInfo storage supplyInfoForTraveler = supplyInfoForMintType[ NftType.TravelerWater ]; SupplyInfo storage supplyInfoForCamper = supplyInfoForMintType[ NftType.CamperFire ]; SupplyInfo storage supplyInfoForBackpacker = supplyInfoForMintType[ NftType.BackpackerEarth ]; uint16 maxSupplyForMintType = supplyInfoForTraveler.max + supplyInfoForCamper.max + supplyInfoForBackpacker.max; uint16 currentSupplyForMintType = supplyInfoForTraveler.current + supplyInfoForCamper.current + supplyInfoForBackpacker.current; // Ensure minting of at least one NFT if (totalAmount <= 0) { revert TooSmallValue(totalAmount); } // Ensure that the number of mintings does not exceed the total maximum supply uint256 finalCurrentTotalSupply = totalSupply() + uint256(totalAmount); if (finalCurrentTotalSupply > getMaxTotalSupply()) { revert MaxTotalSupplyExceeded(uint16(finalCurrentTotalSupply)); } // Ensure that the number of mintings does not exceed the maximum supply by mint type if ((currentSupplyForMintType + totalAmount) > maxSupplyForMintType) { revert MaxMintTypeSupplyExceeded(mintType); } // Ensure that the number of Traveler NFT type mintings does not exceed the maximum supply _ensureMaxSupplyForNftType( NftType.TravelerWater, supplyInfoForTraveler, mintAmountInfo.traveler ); // Ensure that the number of Camper NFT type mintings does not exceed the maximum supply _ensureMaxSupplyForNftType( NftType.CamperFire, supplyInfoForCamper, mintAmountInfo.camper ); // Ensure that the number of Backpacker NFT type mintings does not exceed the maximum supply _ensureMaxSupplyForNftType( NftType.BackpackerEarth, supplyInfoForBackpacker, mintAmountInfo.backpacker ); // Batch mint for Traveler for (uint16 i = 0; i < mintAmountInfo.traveler; ++i) { _safeMint( to, _START_TOKEN_ID_FOR_TRAVELER + getCurrentSupplyByNftType(NftType.TravelerWater) + i ); } // Batch mint for Camper for (uint16 i = 0; i < mintAmountInfo.camper; ++i) { _safeMint( to, _START_TOKEN_ID_FOR_CAMPER + getCurrentSupplyByNftType(NftType.CamperFire) + i ); } // Batch mint for Backpacker for (uint16 i = 0; i < mintAmountInfo.backpacker; ++i) { _safeMint( to, _START_TOKEN_ID_FOR_BACKPACKER + getCurrentSupplyByNftType(NftType.BackpackerEarth) + i ); } // Refresh current supply supplyInfoForTraveler.current += mintAmountInfo.traveler; supplyInfoForCamper.current += mintAmountInfo.camper; supplyInfoForBackpacker.current += mintAmountInfo.backpacker; } /// @notice A function to limit the maximum supply per NFT type /// @param nftType The target NFT type /// @param supplyInfoForNftType The maximum and current supply information for specific NFT type /// @param mintAmountForNftType The minting amount want to mint for a specific NFT type function _ensureMaxSupplyForNftType( NftType nftType, SupplyInfo memory supplyInfoForNftType, uint16 mintAmountForNftType ) private pure { // Ensure that the number of NFT type mintings does not exceed the maximum supply uint16 finalCurrentSupply = supplyInfoForNftType.current + mintAmountForNftType; if ( finalCurrentSupply > supplyInfoForNftType.max || finalCurrentSupply > getMaxSupplyByNftType(nftType) ) { revert MaxNftTypeSupplyExceeded(nftType, finalCurrentSupply); } } ////////////////////////////////////////////////// /// Etc ////////////////////////////////////////////////// /// @notice Pause mint, transfer, and burn features /// @dev Can only be called by the Contract Owner function pause() external onlyRole(DEFAULT_ADMIN_ROLE) { _pause(); } /// @notice Unpause mint, transfer, and burn features /// @dev Can only be called by the Contract Owner function unpause() external onlyRole(DEFAULT_ADMIN_ROLE) { _unpause(); } /// @notice Set the metadata base URI /// @dev Can only be called by the Contract Owner /// @param newBaseUri New metadata base URI function setBaseURI( string calldata newBaseUri ) external onlyRole(DEFAULT_ADMIN_ROLE) { uint256 newBaseUriLength = bytes(newBaseUri).length; if (newBaseUriLength <= 0) { revert TooSmallValue(newBaseUriLength); } _metadataBaseURI = newBaseUri; emit BaseUriChanged(newBaseUri); } /// @notice Set the visibility of the teaser image /// @dev Can only be called by the Contract Owner /// @param newIsRevealed The value for teaser image visibility function setRevealStatus( bool newIsRevealed ) external onlyRole(DEFAULT_ADMIN_ROLE) { isRevealed = newIsRevealed; emit RevealStatusChanged(newIsRevealed); } /// @notice Withdraw ETH balances deposited in this smart contract /// @dev Can only be called by the Contract Owner /// @param to The recipient address /// @param amount The amount of ETH to withdraw function withdrawEthBalances( address payable to, uint256 amount ) external onlyRole(DEFAULT_ADMIN_ROLE) { if (amount <= 0) { revert TooSmallValue(amount); } uint256 currentBalance = address(this).balance; if (amount > currentBalance) { revert InsufficientFundsToWithdraw(currentBalance); } to.transfer(amount); } /// @return Returns the Token URI for a specific Token ID function tokenURI( uint256 tokenId ) public view override(ERC721) returns (string memory) { return !isRevealed ? string.concat(_baseURI(), "0") : super.tokenURI(tokenId); } /// @return Returns the set metadata base URI function _baseURI() internal view override(ERC721) returns (string memory) { return _metadataBaseURI; } /// @dev The following functions are overrides required by Solidity. function _update( address to, uint256 newTokenId, address auth ) internal override(ERC721, ERC721Enumerable, ERC721Pausable) returns (address) { return super._update(to, newTokenId, auth); } function _increaseBalance( address account, uint128 value ) internal override(ERC721, ERC721Enumerable) { super._increaseBalance(account, value); } function supportsInterface( bytes4 interfaceId ) public view override(ERC721, ERC721Enumerable, AccessControlEnumerable) returns (bool) { return super.supportsInterface(interfaceId); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (access/AccessControl.sol) pragma solidity ^0.8.20; import {IAccessControl} from "./IAccessControl.sol"; import {Context} from "../utils/Context.sol"; import {ERC165} from "../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: * * ```solidity * 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}: * * ```solidity * 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. We recommend using {AccessControlDefaultAdminRules} * to enforce additional security measures for this role. */ abstract contract AccessControl is Context, IAccessControl, ERC165 { struct RoleData { mapping(address account => bool) hasRole; bytes32 adminRole; } mapping(bytes32 role => RoleData) private _roles; bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /** * @dev Modifier that checks that an account has a specific role. Reverts * with an {AccessControlUnauthorizedAccount} error including the required role. */ 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 returns (bool) { return _roles[role].hasRole[account]; } /** * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `_msgSender()` * is missing `role`. Overriding this function changes the behavior of the {onlyRole} modifier. */ function _checkRole(bytes32 role) internal view virtual { _checkRole(role, _msgSender()); } /** * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `account` * is missing `role`. */ function _checkRole(bytes32 role, address account) internal view virtual { if (!hasRole(role, account)) { revert AccessControlUnauthorizedAccount(account, role); } } /** * @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 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 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 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 `callerConfirmation`. * * May emit a {RoleRevoked} event. */ function renounceRole(bytes32 role, address callerConfirmation) public virtual { if (callerConfirmation != _msgSender()) { revert AccessControlBadConfirmation(); } _revokeRole(role, callerConfirmation); } /** * @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 Attempts to grant `role` to `account` and returns a boolean indicating if `role` was granted. * * Internal function without access restriction. * * May emit a {RoleGranted} event. */ function _grantRole(bytes32 role, address account) internal virtual returns (bool) { if (!hasRole(role, account)) { _roles[role].hasRole[account] = true; emit RoleGranted(role, account, _msgSender()); return true; } else { return false; } } /** * @dev Attempts to revoke `role` to `account` and returns a boolean indicating if `role` was revoked. * * Internal function without access restriction. * * May emit a {RoleRevoked} event. */ function _revokeRole(bytes32 role, address account) internal virtual returns (bool) { if (hasRole(role, account)) { _roles[role].hasRole[account] = false; emit RoleRevoked(role, account, _msgSender()); return true; } else { return false; } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (access/extensions/AccessControlEnumerable.sol) pragma solidity ^0.8.20; import {IAccessControlEnumerable} from "./IAccessControlEnumerable.sol"; import {AccessControl} from "../AccessControl.sol"; import {EnumerableSet} from "../../utils/structs/EnumerableSet.sol"; /** * @dev Extension of {AccessControl} that allows enumerating the members of each role. */ abstract contract AccessControlEnumerable is IAccessControlEnumerable, AccessControl { using EnumerableSet for EnumerableSet.AddressSet; mapping(bytes32 role => EnumerableSet.AddressSet) private _roleMembers; /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControlEnumerable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Returns one of the accounts that have `role`. `index` must be a * value between 0 and {getRoleMemberCount}, non-inclusive. * * Role bearers are not sorted in any particular way, and their ordering may * change at any point. * * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure * you perform all queries on the same block. See the following * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post] * for more information. */ function getRoleMember(bytes32 role, uint256 index) public view virtual returns (address) { return _roleMembers[role].at(index); } /** * @dev Returns the number of accounts that have `role`. Can be used * together with {getRoleMember} to enumerate all bearers of a role. */ function getRoleMemberCount(bytes32 role) public view virtual returns (uint256) { return _roleMembers[role].length(); } /** * @dev Overload {AccessControl-_grantRole} to track enumerable memberships */ function _grantRole(bytes32 role, address account) internal virtual override returns (bool) { bool granted = super._grantRole(role, account); if (granted) { _roleMembers[role].add(account); } return granted; } /** * @dev Overload {AccessControl-_revokeRole} to track enumerable memberships */ function _revokeRole(bytes32 role, address account) internal virtual override returns (bool) { bool revoked = super._revokeRole(role, account); if (revoked) { _roleMembers[role].remove(account); } return revoked; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (access/extensions/IAccessControlEnumerable.sol) pragma solidity ^0.8.20; import {IAccessControl} from "../IAccessControl.sol"; /** * @dev External interface of AccessControlEnumerable declared to support ERC165 detection. */ interface IAccessControlEnumerable is IAccessControl { /** * @dev Returns one of the accounts that have `role`. `index` must be a * value between 0 and {getRoleMemberCount}, non-inclusive. * * Role bearers are not sorted in any particular way, and their ordering may * change at any point. * * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure * you perform all queries on the same block. See the following * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post] * for more information. */ function getRoleMember(bytes32 role, uint256 index) external view returns (address); /** * @dev Returns the number of accounts that have `role`. Can be used * together with {getRoleMember} to enumerate all bearers of a role. */ function getRoleMemberCount(bytes32 role) external view returns (uint256); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (access/IAccessControl.sol) pragma solidity ^0.8.20; /** * @dev External interface of AccessControl declared to support ERC165 detection. */ interface IAccessControl { /** * @dev The `account` is missing a role. */ error AccessControlUnauthorizedAccount(address account, bytes32 neededRole); /** * @dev The caller of a function is not the expected one. * * NOTE: Don't confuse with {AccessControlUnauthorizedAccount}. */ error AccessControlBadConfirmation(); /** * @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. */ 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 `callerConfirmation`. */ function renounceRole(bytes32 role, address callerConfirmation) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (interfaces/draft-IERC6093.sol) pragma solidity ^0.8.20; /** * @dev Standard ERC20 Errors * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC20 tokens. */ interface IERC20Errors { /** * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. * @param balance Current balance for the interacting account. * @param needed Minimum amount required to perform a transfer. */ error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed); /** * @dev Indicates a failure with the token `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. */ error ERC20InvalidSender(address sender); /** * @dev Indicates a failure with the token `receiver`. Used in transfers. * @param receiver Address to which tokens are being transferred. */ error ERC20InvalidReceiver(address receiver); /** * @dev Indicates a failure with the `spender`’s `allowance`. Used in transfers. * @param spender Address that may be allowed to operate on tokens without being their owner. * @param allowance Amount of tokens a `spender` is allowed to operate with. * @param needed Minimum amount required to perform a transfer. */ error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed); /** * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals. * @param approver Address initiating an approval operation. */ error ERC20InvalidApprover(address approver); /** * @dev Indicates a failure with the `spender` to be approved. Used in approvals. * @param spender Address that may be allowed to operate on tokens without being their owner. */ error ERC20InvalidSpender(address spender); } /** * @dev Standard ERC721 Errors * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC721 tokens. */ interface IERC721Errors { /** * @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in EIP-20. * Used in balance queries. * @param owner Address of the current owner of a token. */ error ERC721InvalidOwner(address owner); /** * @dev Indicates a `tokenId` whose `owner` is the zero address. * @param tokenId Identifier number of a token. */ error ERC721NonexistentToken(uint256 tokenId); /** * @dev Indicates an error related to the ownership over a particular token. Used in transfers. * @param sender Address whose tokens are being transferred. * @param tokenId Identifier number of a token. * @param owner Address of the current owner of a token. */ error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner); /** * @dev Indicates a failure with the token `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. */ error ERC721InvalidSender(address sender); /** * @dev Indicates a failure with the token `receiver`. Used in transfers. * @param receiver Address to which tokens are being transferred. */ error ERC721InvalidReceiver(address receiver); /** * @dev Indicates a failure with the `operator`’s approval. Used in transfers. * @param operator Address that may be allowed to operate on tokens without being their owner. * @param tokenId Identifier number of a token. */ error ERC721InsufficientApproval(address operator, uint256 tokenId); /** * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals. * @param approver Address initiating an approval operation. */ error ERC721InvalidApprover(address approver); /** * @dev Indicates a failure with the `operator` to be approved. Used in approvals. * @param operator Address that may be allowed to operate on tokens without being their owner. */ error ERC721InvalidOperator(address operator); } /** * @dev Standard ERC1155 Errors * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC1155 tokens. */ interface IERC1155Errors { /** * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. * @param balance Current balance for the interacting account. * @param needed Minimum amount required to perform a transfer. * @param tokenId Identifier number of a token. */ error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId); /** * @dev Indicates a failure with the token `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. */ error ERC1155InvalidSender(address sender); /** * @dev Indicates a failure with the token `receiver`. Used in transfers. * @param receiver Address to which tokens are being transferred. */ error ERC1155InvalidReceiver(address receiver); /** * @dev Indicates a failure with the `operator`’s approval. Used in transfers. * @param operator Address that may be allowed to operate on tokens without being their owner. * @param owner Address of the current owner of a token. */ error ERC1155MissingApprovalForAll(address operator, address owner); /** * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals. * @param approver Address initiating an approval operation. */ error ERC1155InvalidApprover(address approver); /** * @dev Indicates a failure with the `operator` to be approved. Used in approvals. * @param operator Address that may be allowed to operate on tokens without being their owner. */ error ERC1155InvalidOperator(address operator); /** * @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation. * Used in batch transfers. * @param idsLength Length of the array of token identifiers * @param valuesLength Length of the array of token amounts */ error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/ERC721.sol) pragma solidity ^0.8.20; import {IERC721} from "./IERC721.sol"; import {IERC721Receiver} from "./IERC721Receiver.sol"; import {IERC721Metadata} from "./extensions/IERC721Metadata.sol"; import {Context} from "../../utils/Context.sol"; import {Strings} from "../../utils/Strings.sol"; import {IERC165, ERC165} from "../../utils/introspection/ERC165.sol"; import {IERC721Errors} from "../../interfaces/draft-IERC6093.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}. */ abstract contract ERC721 is Context, ERC165, IERC721, IERC721Metadata, IERC721Errors { using Strings for uint256; // Token name string private _name; // Token symbol string private _symbol; mapping(uint256 tokenId => address) private _owners; mapping(address owner => uint256) private _balances; mapping(uint256 tokenId => address) private _tokenApprovals; mapping(address owner => mapping(address operator => 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 returns (uint256) { if (owner == address(0)) { revert ERC721InvalidOwner(address(0)); } return _balances[owner]; } /** * @dev See {IERC721-ownerOf}. */ function ownerOf(uint256 tokenId) public view virtual returns (address) { return _requireOwned(tokenId); } /** * @dev See {IERC721Metadata-name}. */ function name() public view virtual returns (string memory) { return _name; } /** * @dev See {IERC721Metadata-symbol}. */ function symbol() public view virtual returns (string memory) { return _symbol; } /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI(uint256 tokenId) public view virtual returns (string memory) { _requireOwned(tokenId); string memory baseURI = _baseURI(); return bytes(baseURI).length > 0 ? string.concat(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 { _approve(to, tokenId, _msgSender()); } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view virtual returns (address) { _requireOwned(tokenId); return _getApproved(tokenId); } /** * @dev See {IERC721-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual { _setApprovalForAll(_msgSender(), operator, approved); } /** * @dev See {IERC721-isApprovedForAll}. */ function isApprovedForAll(address owner, address operator) public view virtual returns (bool) { return _operatorApprovals[owner][operator]; } /** * @dev See {IERC721-transferFrom}. */ function transferFrom(address from, address to, uint256 tokenId) public virtual { if (to == address(0)) { revert ERC721InvalidReceiver(address(0)); } // Setting an "auth" arguments enables the `_isAuthorized` check which verifies that the token exists // (from != 0). Therefore, it is not needed to verify that the return value is not 0 here. address previousOwner = _update(to, tokenId, _msgSender()); if (previousOwner != from) { revert ERC721IncorrectOwner(from, tokenId, previousOwner); } } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom(address from, address to, uint256 tokenId) public { safeTransferFrom(from, to, tokenId, ""); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public virtual { transferFrom(from, to, tokenId); _checkOnERC721Received(from, to, tokenId, data); } /** * @dev Returns the owner of the `tokenId`. Does NOT revert if token doesn't exist * * IMPORTANT: Any overrides to this function that add ownership of tokens not tracked by the * core ERC721 logic MUST be matched with the use of {_increaseBalance} to keep balances * consistent with ownership. The invariant to preserve is that for any address `a` the value returned by * `balanceOf(a)` must be equal to the number of tokens such that `_ownerOf(tokenId)` is `a`. */ function _ownerOf(uint256 tokenId) internal view virtual returns (address) { return _owners[tokenId]; } /** * @dev Returns the approved address for `tokenId`. Returns 0 if `tokenId` is not minted. */ function _getApproved(uint256 tokenId) internal view virtual returns (address) { return _tokenApprovals[tokenId]; } /** * @dev Returns whether `spender` is allowed to manage `owner`'s tokens, or `tokenId` in * particular (ignoring whether it is owned by `owner`). * * WARNING: This function assumes that `owner` is the actual owner of `tokenId` and does not verify this * assumption. */ function _isAuthorized(address owner, address spender, uint256 tokenId) internal view virtual returns (bool) { return spender != address(0) && (owner == spender || isApprovedForAll(owner, spender) || _getApproved(tokenId) == spender); } /** * @dev Checks if `spender` can operate on `tokenId`, assuming the provided `owner` is the actual owner. * Reverts if `spender` does not have approval from the provided `owner` for the given token or for all its assets * the `spender` for the specific `tokenId`. * * WARNING: This function assumes that `owner` is the actual owner of `tokenId` and does not verify this * assumption. */ function _checkAuthorized(address owner, address spender, uint256 tokenId) internal view virtual { if (!_isAuthorized(owner, spender, tokenId)) { if (owner == address(0)) { revert ERC721NonexistentToken(tokenId); } else { revert ERC721InsufficientApproval(spender, tokenId); } } } /** * @dev Unsafe write access to the balances, used by extensions that "mint" tokens using an {ownerOf} override. * * NOTE: the value is limited to type(uint128).max. This protect against _balance overflow. It is unrealistic that * a uint256 would ever overflow from increments when these increments are bounded to uint128 values. * * WARNING: Increasing an account's balance using this function tends to be paired with an override of the * {_ownerOf} function to resolve the ownership of the corresponding tokens so that balances and ownership * remain consistent with one another. */ function _increaseBalance(address account, uint128 value) internal virtual { unchecked { _balances[account] += value; } } /** * @dev Transfers `tokenId` from its current owner to `to`, or alternatively mints (or burns) if the current owner * (or `to`) is the zero address. Returns the owner of the `tokenId` before the update. * * The `auth` argument is optional. If the value passed is non 0, then this function will check that * `auth` is either the owner of the token, or approved to operate on the token (by the owner). * * Emits a {Transfer} event. * * NOTE: If overriding this function in a way that tracks balances, see also {_increaseBalance}. */ function _update(address to, uint256 tokenId, address auth) internal virtual returns (address) { address from = _ownerOf(tokenId); // Perform (optional) operator check if (auth != address(0)) { _checkAuthorized(from, auth, tokenId); } // Execute the update if (from != address(0)) { // Clear approval. No need to re-authorize or emit the Approval event _approve(address(0), tokenId, address(0), false); unchecked { _balances[from] -= 1; } } if (to != address(0)) { unchecked { _balances[to] += 1; } } _owners[tokenId] = to; emit Transfer(from, to, tokenId); return from; } /** * @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 { if (to == address(0)) { revert ERC721InvalidReceiver(address(0)); } address previousOwner = _update(to, tokenId, address(0)); if (previousOwner != address(0)) { revert ERC721InvalidSender(address(0)); } } /** * @dev Mints `tokenId`, transfers it to `to` and checks for `to` acceptance. * * 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 { _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); _checkOnERC721Received(address(0), to, tokenId, data); } /** * @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 { address previousOwner = _update(address(0), tokenId, address(0)); if (previousOwner == address(0)) { revert ERC721NonexistentToken(tokenId); } } /** * @dev Transfers `tokenId` from `from` to `to`. * As opposed to {transferFrom}, this imposes no restrictions on msg.sender. * * Requirements: * * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * * Emits a {Transfer} event. */ function _transfer(address from, address to, uint256 tokenId) internal { if (to == address(0)) { revert ERC721InvalidReceiver(address(0)); } address previousOwner = _update(to, tokenId, address(0)); if (previousOwner == address(0)) { revert ERC721NonexistentToken(tokenId); } else if (previousOwner != from) { revert ERC721IncorrectOwner(from, tokenId, previousOwner); } } /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking that contract recipients * are aware of the ERC721 standard 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 like {safeTransferFrom} in the sense that it invokes * {IERC721Receiver-onERC721Received} on the receiver, and can be used to e.g. * implement alternative mechanisms to perform token transfer, such as signature-based. * * Requirements: * * - `tokenId` token must exist and be owned by `from`. * - `to` cannot be the zero address. * - `from` cannot be the zero address. * - 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) internal { _safeTransfer(from, to, tokenId, ""); } /** * @dev Same as {xref-ERC721-_safeTransfer-address-address-uint256-}[`_safeTransfer`], with an additional `data` parameter which is * forwarded in {IERC721Receiver-onERC721Received} to contract recipients. */ function _safeTransfer(address from, address to, uint256 tokenId, bytes memory data) internal virtual { _transfer(from, to, tokenId); _checkOnERC721Received(from, to, tokenId, data); } /** * @dev Approve `to` to operate on `tokenId` * * The `auth` argument is optional. If the value passed is non 0, then this function will check that `auth` is * either the owner of the token, or approved to operate on all tokens held by this owner. * * Emits an {Approval} event. * * Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument. */ function _approve(address to, uint256 tokenId, address auth) internal { _approve(to, tokenId, auth, true); } /** * @dev Variant of `_approve` with an optional flag to enable or disable the {Approval} event. The event is not * emitted in the context of transfers. */ function _approve(address to, uint256 tokenId, address auth, bool emitEvent) internal virtual { // Avoid reading the owner unless necessary if (emitEvent || auth != address(0)) { address owner = _requireOwned(tokenId); // We do not use _isAuthorized because single-token approvals should not be able to call approve if (auth != address(0) && owner != auth && !isApprovedForAll(owner, auth)) { revert ERC721InvalidApprover(auth); } if (emitEvent) { emit Approval(owner, to, tokenId); } } _tokenApprovals[tokenId] = to; } /** * @dev Approve `operator` to operate on all of `owner` tokens * * Requirements: * - operator can't be the address zero. * * Emits an {ApprovalForAll} event. */ function _setApprovalForAll(address owner, address operator, bool approved) internal virtual { if (operator == address(0)) { revert ERC721InvalidOperator(operator); } _operatorApprovals[owner][operator] = approved; emit ApprovalForAll(owner, operator, approved); } /** * @dev Reverts if the `tokenId` doesn't have a current owner (it hasn't been minted, or it has been burned). * Returns the owner. * * Overrides to ownership logic should be done to {_ownerOf}. */ function _requireOwned(uint256 tokenId) internal view returns (address) { address owner = _ownerOf(tokenId); if (owner == address(0)) { revert ERC721NonexistentToken(tokenId); } return owner; } /** * @dev Private function to invoke {IERC721Receiver-onERC721Received} on a target address. This will revert if the * recipient doesn't accept the token transfer. 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 */ function _checkOnERC721Received(address from, address to, uint256 tokenId, bytes memory data) private { if (to.code.length > 0) { try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, data) returns (bytes4 retval) { if (retval != IERC721Receiver.onERC721Received.selector) { revert ERC721InvalidReceiver(to); } } catch (bytes memory reason) { if (reason.length == 0) { revert ERC721InvalidReceiver(to); } else { /// @solidity memory-safe-assembly assembly { revert(add(32, reason), mload(reason)) } } } } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/extensions/ERC721Burnable.sol) pragma solidity ^0.8.20; import {ERC721} from "../ERC721.sol"; import {Context} from "../../../utils/Context.sol"; /** * @title ERC721 Burnable Token * @dev ERC721 Token that can be burned (destroyed). */ abstract contract ERC721Burnable is Context, ERC721 { /** * @dev Burns `tokenId`. See {ERC721-_burn}. * * Requirements: * * - The caller must own `tokenId` or be an approved operator. */ function burn(uint256 tokenId) public virtual { // Setting an "auth" arguments enables the `_isAuthorized` check which verifies that the token exists // (from != 0). Therefore, it is not needed to verify that the return value is not 0 here. _update(address(0), tokenId, _msgSender()); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/extensions/ERC721Enumerable.sol) pragma solidity ^0.8.20; import {ERC721} from "../ERC721.sol"; import {IERC721Enumerable} from "./IERC721Enumerable.sol"; import {IERC165} from "../../../utils/introspection/ERC165.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. * * CAUTION: `ERC721` extensions that implement custom `balanceOf` logic, such as `ERC721Consecutive`, * interfere with enumerability and should not be used together with `ERC721Enumerable`. */ abstract contract ERC721Enumerable is ERC721, IERC721Enumerable { mapping(address owner => mapping(uint256 index => uint256)) private _ownedTokens; mapping(uint256 tokenId => uint256) private _ownedTokensIndex; uint256[] private _allTokens; mapping(uint256 tokenId => uint256) private _allTokensIndex; /** * @dev An `owner`'s token query was out of bounds for `index`. * * NOTE: The owner being `address(0)` indicates a global out of bounds index. */ error ERC721OutOfBoundsIndex(address owner, uint256 index); /** * @dev Batch mint is not allowed. */ error ERC721EnumerableForbiddenBatchMint(); /** * @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 returns (uint256) { if (index >= balanceOf(owner)) { revert ERC721OutOfBoundsIndex(owner, index); } return _ownedTokens[owner][index]; } /** * @dev See {IERC721Enumerable-totalSupply}. */ function totalSupply() public view virtual returns (uint256) { return _allTokens.length; } /** * @dev See {IERC721Enumerable-tokenByIndex}. */ function tokenByIndex(uint256 index) public view virtual returns (uint256) { if (index >= totalSupply()) { revert ERC721OutOfBoundsIndex(address(0), index); } return _allTokens[index]; } /** * @dev See {ERC721-_update}. */ function _update(address to, uint256 tokenId, address auth) internal virtual override returns (address) { address previousOwner = super._update(to, tokenId, auth); if (previousOwner == address(0)) { _addTokenToAllTokensEnumeration(tokenId); } else if (previousOwner != to) { _removeTokenFromOwnerEnumeration(previousOwner, tokenId); } if (to == address(0)) { _removeTokenFromAllTokensEnumeration(tokenId); } else if (previousOwner != to) { _addTokenToOwnerEnumeration(to, tokenId); } return previousOwner; } /** * @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 = balanceOf(to) - 1; _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 = balanceOf(from); 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(); } /** * See {ERC721-_increaseBalance}. We need that to account tokens that were minted in batch */ function _increaseBalance(address account, uint128 amount) internal virtual override { if (amount > 0) { revert ERC721EnumerableForbiddenBatchMint(); } super._increaseBalance(account, amount); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/extensions/ERC721Pausable.sol) pragma solidity ^0.8.20; import {ERC721} from "../ERC721.sol"; import {Pausable} from "../../../utils/Pausable.sol"; /** * @dev ERC721 token with pausable token transfers, minting and burning. * * Useful for scenarios such as preventing trades until the end of an evaluation * period, or having an emergency switch for freezing all token transfers in the * event of a large bug. * * IMPORTANT: This contract does not include public pause and unpause functions. In * addition to inheriting this contract, you must define both functions, invoking the * {Pausable-_pause} and {Pausable-_unpause} internal functions, with appropriate * access control, e.g. using {AccessControl} or {Ownable}. Not doing so will * make the contract pause mechanism of the contract unreachable, and thus unusable. */ abstract contract ERC721Pausable is ERC721, Pausable { /** * @dev See {ERC721-_update}. * * Requirements: * * - the contract must not be paused. */ function _update( address to, uint256 tokenId, address auth ) internal virtual override whenNotPaused returns (address) { return super._update(to, tokenId, auth); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/extensions/IERC721Enumerable.sol) pragma solidity ^0.8.20; import {IERC721} from "../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 v5.0.0) (token/ERC721/extensions/IERC721Metadata.sol) pragma solidity ^0.8.20; import {IERC721} from "../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 v5.0.0) (token/ERC721/IERC721.sol) pragma solidity ^0.8.20; import {IERC165} from "../../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 address zero. * * 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 v5.0.0) (token/ERC721/IERC721Receiver.sol) pragma solidity ^0.8.20; /** * @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 v5.0.1) (utils/Context.sol) pragma solidity ^0.8.20; /** * @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; } function _contextSuffixLength() internal view virtual returns (uint256) { return 0; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/cryptography/MerkleProof.sol) pragma solidity ^0.8.20; /** * @dev These functions deal with verification of Merkle Tree proofs. * * The tree and the proofs can be generated using our * https://github.com/OpenZeppelin/merkle-tree[JavaScript library]. * You will find a quickstart guide in the readme. * * WARNING: You should avoid using leaf values that are 64 bytes long prior to * hashing, or use a hash function other than keccak256 for hashing leaves. * This is because the concatenation of a sorted pair of internal nodes in * the Merkle tree could be reinterpreted as a leaf value. * OpenZeppelin's JavaScript library generates Merkle trees that are safe * against this attack out of the box. */ library MerkleProof { /** *@dev The multiproof provided is not valid. */ error MerkleProofInvalidMultiproof(); /** * @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree * defined by `root`. For this, a `proof` must be provided, containing * sibling hashes on the branch from the leaf to the root of the tree. Each * pair of leaves and each pair of pre-images are assumed to be sorted. */ function verify(bytes32[] memory proof, bytes32 root, bytes32 leaf) internal pure returns (bool) { return processProof(proof, leaf) == root; } /** * @dev Calldata version of {verify} */ function verifyCalldata(bytes32[] calldata proof, bytes32 root, bytes32 leaf) internal pure returns (bool) { return processProofCalldata(proof, leaf) == root; } /** * @dev Returns the rebuilt hash obtained by traversing a Merkle tree up * from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt * hash matches the root of the tree. When processing the proof, the pairs * of leafs & pre-images are assumed to be sorted. */ function processProof(bytes32[] memory proof, bytes32 leaf) internal pure returns (bytes32) { bytes32 computedHash = leaf; for (uint256 i = 0; i < proof.length; i++) { computedHash = _hashPair(computedHash, proof[i]); } return computedHash; } /** * @dev Calldata version of {processProof} */ function processProofCalldata(bytes32[] calldata proof, bytes32 leaf) internal pure returns (bytes32) { bytes32 computedHash = leaf; for (uint256 i = 0; i < proof.length; i++) { computedHash = _hashPair(computedHash, proof[i]); } return computedHash; } /** * @dev Returns true if the `leaves` can be simultaneously proven to be a part of a Merkle tree defined by * `root`, according to `proof` and `proofFlags` as described in {processMultiProof}. * * CAUTION: Not all Merkle trees admit multiproofs. See {processMultiProof} for details. */ function multiProofVerify( bytes32[] memory proof, bool[] memory proofFlags, bytes32 root, bytes32[] memory leaves ) internal pure returns (bool) { return processMultiProof(proof, proofFlags, leaves) == root; } /** * @dev Calldata version of {multiProofVerify} * * CAUTION: Not all Merkle trees admit multiproofs. See {processMultiProof} for details. */ function multiProofVerifyCalldata( bytes32[] calldata proof, bool[] calldata proofFlags, bytes32 root, bytes32[] memory leaves ) internal pure returns (bool) { return processMultiProofCalldata(proof, proofFlags, leaves) == root; } /** * @dev Returns the root of a tree reconstructed from `leaves` and sibling nodes in `proof`. The reconstruction * proceeds by incrementally reconstructing all inner nodes by combining a leaf/inner node with either another * leaf/inner node or a proof sibling node, depending on whether each `proofFlags` item is true or false * respectively. * * CAUTION: Not all Merkle trees admit multiproofs. To use multiproofs, it is sufficient to ensure that: 1) the tree * is complete (but not necessarily perfect), 2) the leaves to be proven are in the opposite order they are in the * tree (i.e., as seen from right to left starting at the deepest layer and continuing at the next layer). */ function processMultiProof( bytes32[] memory proof, bool[] memory proofFlags, bytes32[] memory leaves ) internal pure returns (bytes32 merkleRoot) { // This function rebuilds the root hash by traversing the tree up from the leaves. The root is rebuilt by // consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the // `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of // the Merkle tree. uint256 leavesLen = leaves.length; uint256 proofLen = proof.length; uint256 totalHashes = proofFlags.length; // Check proof validity. if (leavesLen + proofLen != totalHashes + 1) { revert MerkleProofInvalidMultiproof(); } // The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using // `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop". bytes32[] memory hashes = new bytes32[](totalHashes); uint256 leafPos = 0; uint256 hashPos = 0; uint256 proofPos = 0; // At each step, we compute the next hash using two values: // - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we // get the next hash. // - depending on the flag, either another value from the "main queue" (merging branches) or an element from the // `proof` array. for (uint256 i = 0; i < totalHashes; i++) { bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++]; bytes32 b = proofFlags[i] ? (leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++]) : proof[proofPos++]; hashes[i] = _hashPair(a, b); } if (totalHashes > 0) { if (proofPos != proofLen) { revert MerkleProofInvalidMultiproof(); } unchecked { return hashes[totalHashes - 1]; } } else if (leavesLen > 0) { return leaves[0]; } else { return proof[0]; } } /** * @dev Calldata version of {processMultiProof}. * * CAUTION: Not all Merkle trees admit multiproofs. See {processMultiProof} for details. */ function processMultiProofCalldata( bytes32[] calldata proof, bool[] calldata proofFlags, bytes32[] memory leaves ) internal pure returns (bytes32 merkleRoot) { // This function rebuilds the root hash by traversing the tree up from the leaves. The root is rebuilt by // consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the // `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of // the Merkle tree. uint256 leavesLen = leaves.length; uint256 proofLen = proof.length; uint256 totalHashes = proofFlags.length; // Check proof validity. if (leavesLen + proofLen != totalHashes + 1) { revert MerkleProofInvalidMultiproof(); } // The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using // `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop". bytes32[] memory hashes = new bytes32[](totalHashes); uint256 leafPos = 0; uint256 hashPos = 0; uint256 proofPos = 0; // At each step, we compute the next hash using two values: // - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we // get the next hash. // - depending on the flag, either another value from the "main queue" (merging branches) or an element from the // `proof` array. for (uint256 i = 0; i < totalHashes; i++) { bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++]; bytes32 b = proofFlags[i] ? (leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++]) : proof[proofPos++]; hashes[i] = _hashPair(a, b); } if (totalHashes > 0) { if (proofPos != proofLen) { revert MerkleProofInvalidMultiproof(); } unchecked { return hashes[totalHashes - 1]; } } else if (leavesLen > 0) { return leaves[0]; } else { return proof[0]; } } /** * @dev Sorts the pair (a, b) and hashes the result. */ function _hashPair(bytes32 a, bytes32 b) private pure returns (bytes32) { return a < b ? _efficientHash(a, b) : _efficientHash(b, a); } /** * @dev Implementation of keccak256(abi.encode(a, b)) that doesn't allocate or expand memory. */ function _efficientHash(bytes32 a, bytes32 b) private pure returns (bytes32 value) { /// @solidity memory-safe-assembly assembly { mstore(0x00, a) mstore(0x20, b) value := keccak256(0x00, 0x40) } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165.sol) pragma solidity ^0.8.20; import {IERC165} from "./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); * } * ``` */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol) pragma solidity ^0.8.20; /** * @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 (last updated v5.0.0) (utils/math/Math.sol) pragma solidity ^0.8.20; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { /** * @dev Muldiv operation overflow. */ error MathOverflowedMulDiv(); enum Rounding { Floor, // Toward negative infinity Ceil, // Toward positive infinity Trunc, // Toward zero Expand // Away from zero } /** * @dev Returns the addition of two unsigned integers, with an overflow flag. */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } } /** * @dev Returns the subtraction of two unsigned integers, with an overflow flag. */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b > a) return (false, 0); return (true, a - b); } } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } } /** * @dev Returns the division of two unsigned integers, with a division by zero flag. */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a / b); } } /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a % b); } } /** * @dev Returns the 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 towards infinity instead * of rounding towards zero. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { if (b == 0) { // Guarantee the same behavior as in a regular Solidity division. return a / b; } // (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 = x * y; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division. if (prod1 == 0) { // Solidity will revert if denominator == 0, unlike the div opcode on its own. // The surrounding unchecked block does not change this fact. // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic. return prod0 / denominator; } // Make sure the result is less than 2^256. Also prevents denominator == 0. if (denominator <= prod1) { revert MathOverflowedMulDiv(); } /////////////////////////////////////////////// // 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. uint256 twos = denominator & (0 - denominator); 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 (unsignedRoundsUp(rounding) && 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 * towards zero. * * 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 + (unsignedRoundsUp(rounding) && result * result < a ? 1 : 0); } } /** * @dev Return the log in base 2 of a positive value rounded towards zero. * 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 + (unsignedRoundsUp(rounding) && 1 << result < value ? 1 : 0); } } /** * @dev Return the log in base 10 of a positive value rounded towards zero. * 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 + (unsignedRoundsUp(rounding) && 10 ** result < value ? 1 : 0); } } /** * @dev Return the log in base 256 of a positive value rounded towards zero. * 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 256, 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 + (unsignedRoundsUp(rounding) && 1 << (result << 3) < value ? 1 : 0); } } /** * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers. */ function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) { return uint8(rounding) % 2 == 1; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/math/SignedMath.sol) pragma solidity ^0.8.20; /** * @dev Standard signed math utilities missing in the Solidity language. */ library SignedMath { /** * @dev Returns the largest of two signed numbers. */ function max(int256 a, int256 b) internal pure returns (int256) { return a > b ? a : b; } /** * @dev Returns the smallest of two signed numbers. */ function min(int256 a, int256 b) internal pure returns (int256) { return a < b ? a : b; } /** * @dev Returns the average of two signed numbers without overflow. * The result is rounded towards zero. */ function average(int256 a, int256 b) internal pure returns (int256) { // Formula from the book "Hacker's Delight" int256 x = (a & b) + ((a ^ b) >> 1); return x + (int256(uint256(x) >> 255) & (a ^ b)); } /** * @dev Returns the absolute unsigned value of a signed value. */ function abs(int256 n) internal pure returns (uint256) { unchecked { // must be unchecked in order to support `n = type(int256).min` return uint256(n >= 0 ? n : -n); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/Pausable.sol) pragma solidity ^0.8.20; import {Context} from "../utils/Context.sol"; /** * @dev Contract module which allows children to implement an emergency stop * mechanism that can be triggered by an authorized account. * * This module is used through inheritance. It will make available the * modifiers `whenNotPaused` and `whenPaused`, which can be applied to * the functions of your contract. Note that they will not be pausable by * simply including this module, only once the modifiers are put in place. */ abstract contract Pausable is Context { bool private _paused; /** * @dev Emitted when the pause is triggered by `account`. */ event Paused(address account); /** * @dev Emitted when the pause is lifted by `account`. */ event Unpaused(address account); /** * @dev The operation failed because the contract is paused. */ error EnforcedPause(); /** * @dev The operation failed because the contract is not paused. */ error ExpectedPause(); /** * @dev Initializes the contract in unpaused state. */ constructor() { _paused = false; } /** * @dev Modifier to make a function callable only when the contract is not paused. * * Requirements: * * - The contract must not be paused. */ modifier whenNotPaused() { _requireNotPaused(); _; } /** * @dev Modifier to make a function callable only when the contract is paused. * * Requirements: * * - The contract must be paused. */ modifier whenPaused() { _requirePaused(); _; } /** * @dev Returns true if the contract is paused, and false otherwise. */ function paused() public view virtual returns (bool) { return _paused; } /** * @dev Throws if the contract is paused. */ function _requireNotPaused() internal view virtual { if (paused()) { revert EnforcedPause(); } } /** * @dev Throws if the contract is not paused. */ function _requirePaused() internal view virtual { if (!paused()) { revert ExpectedPause(); } } /** * @dev Triggers stopped state. * * Requirements: * * - The contract must not be paused. */ function _pause() internal virtual whenNotPaused { _paused = true; emit Paused(_msgSender()); } /** * @dev Returns to normal state. * * Requirements: * * - The contract must be paused. */ function _unpause() internal virtual whenPaused { _paused = false; emit Unpaused(_msgSender()); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/ReentrancyGuard.sol) pragma solidity ^0.8.20; /** * @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; /** * @dev Unauthorized reentrant call. */ error ReentrancyGuardReentrantCall(); 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 if (_status == ENTERED) { revert ReentrancyGuardReentrantCall(); } // 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; } /** * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a * `nonReentrant` function in the call stack. */ function _reentrancyGuardEntered() internal view returns (bool) { return _status == ENTERED; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/Strings.sol) pragma solidity ^0.8.20; import {Math} from "./math/Math.sol"; import {SignedMath} from "./math/SignedMath.sol"; /** * @dev String operations. */ library Strings { bytes16 private constant HEX_DIGITS = "0123456789abcdef"; uint8 private constant ADDRESS_LENGTH = 20; /** * @dev The `value` string doesn't fit in the specified `length`. */ error StringsInsufficientHexLength(uint256 value, uint256 length); /** * @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), HEX_DIGITS)) } value /= 10; if (value == 0) break; } return buffer; } } /** * @dev Converts a `int256` to its ASCII `string` decimal representation. */ function toStringSigned(int256 value) internal pure returns (string memory) { return string.concat(value < 0 ? "-" : "", toString(SignedMath.abs(value))); } /** * @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) { uint256 localValue = value; bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = HEX_DIGITS[localValue & 0xf]; localValue >>= 4; } if (localValue != 0) { revert StringsInsufficientHexLength(value, length); } 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); } /** * @dev Returns true if the two strings are equal. */ function equal(string memory a, string memory b) internal pure returns (bool) { return bytes(a).length == bytes(b).length && keccak256(bytes(a)) == keccak256(bytes(b)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/structs/EnumerableSet.sol) // This file was procedurally generated from scripts/generate/templates/EnumerableSet.js. pragma solidity ^0.8.20; /** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are made on the ordering. * * ```solidity * contract Example { * // Add the library methods * using EnumerableSet for EnumerableSet.AddressSet; * * // Declare a set state variable * EnumerableSet.AddressSet private mySet; * } * ``` * * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`) * and `uint256` (`UintSet`) are supported. * * [WARNING] * ==== * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure * unusable. * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info. * * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an * array of EnumerableSet. * ==== */ library EnumerableSet { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are just wrappers around the // underlying Set. // This means that we can only create new EnumerableSets for types that fit // in bytes32. struct Set { // Storage of set values bytes32[] _values; // Position is the index of the value in the `values` array plus 1. // Position 0 is used to mean a value is not in the set. mapping(bytes32 value => uint256) _positions; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function _add(Set storage set, bytes32 value) private returns (bool) { if (!_contains(set, value)) { set._values.push(value); // The value is stored at length-1, but we add 1 to all indexes // and use 0 as a sentinel value set._positions[value] = set._values.length; return true; } else { return false; } } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function _remove(Set storage set, bytes32 value) private returns (bool) { // We cache the value's position to prevent multiple reads from the same storage slot uint256 position = set._positions[value]; if (position != 0) { // Equivalent to contains(set, value) // To delete an element from the _values array in O(1), we swap the element to delete with the last one in // the array, and then remove the last element (sometimes called as 'swap and pop'). // This modifies the order of the array, as noted in {at}. uint256 valueIndex = position - 1; uint256 lastIndex = set._values.length - 1; if (valueIndex != lastIndex) { bytes32 lastValue = set._values[lastIndex]; // Move the lastValue to the index where the value to delete is set._values[valueIndex] = lastValue; // Update the tracked position of the lastValue (that was just moved) set._positions[lastValue] = position; } // Delete the slot where the moved value was stored set._values.pop(); // Delete the tracked position for the deleted slot delete set._positions[value]; return true; } else { return false; } } /** * @dev Returns true if the value is in the set. O(1). */ function _contains(Set storage set, bytes32 value) private view returns (bool) { return set._positions[value] != 0; } /** * @dev Returns the number of values on the set. O(1). */ function _length(Set storage set) private view returns (uint256) { return set._values.length; } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function _at(Set storage set, uint256 index) private view returns (bytes32) { return set._values[index]; } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function _values(Set storage set) private view returns (bytes32[] memory) { return set._values; } // Bytes32Set struct Bytes32Set { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _add(set._inner, value); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _remove(set._inner, value); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) { return _contains(set._inner, value); } /** * @dev Returns the number of values in the set. O(1). */ function length(Bytes32Set storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) { return _at(set._inner, index); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(Bytes32Set storage set) internal view returns (bytes32[] memory) { bytes32[] memory store = _values(set._inner); bytes32[] memory result; /// @solidity memory-safe-assembly assembly { result := store } return result; } // AddressSet struct AddressSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(AddressSet storage set, address value) internal returns (bool) { return _add(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(AddressSet storage set, address value) internal returns (bool) { return _remove(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(AddressSet storage set, address value) internal view returns (bool) { return _contains(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns the number of values in the set. O(1). */ function length(AddressSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(AddressSet storage set, uint256 index) internal view returns (address) { return address(uint160(uint256(_at(set._inner, index)))); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(AddressSet storage set) internal view returns (address[] memory) { bytes32[] memory store = _values(set._inner); address[] memory result; /// @solidity memory-safe-assembly assembly { result := store } return result; } // UintSet struct UintSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(UintSet storage set, uint256 value) internal returns (bool) { return _add(set._inner, bytes32(value)); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(UintSet storage set, uint256 value) internal returns (bool) { return _remove(set._inner, bytes32(value)); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(UintSet storage set, uint256 value) internal view returns (bool) { return _contains(set._inner, bytes32(value)); } /** * @dev Returns the number of values in the set. O(1). */ function length(UintSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(UintSet storage set, uint256 index) internal view returns (uint256) { return uint256(_at(set._inner, index)); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(UintSet storage set) internal view returns (uint256[] memory) { bytes32[] memory store = _values(set._inner); uint256[] memory result; /// @solidity memory-safe-assembly assembly { result := store } return result; } }
{ "evmVersion": "cancun", "optimizer": { "enabled": true, "runs": 200, "details": { "yul": true } }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"krwMinter","type":"address"},{"internalType":"string","name":"metadataBaseURI","type":"string"},{"internalType":"uint16","name":"maxAmountCanBeMintedAtOnce_","type":"uint16"},{"components":[{"internalType":"uint16","name":"traveler","type":"uint16"},{"internalType":"uint16","name":"camper","type":"uint16"},{"internalType":"uint16","name":"backpacker","type":"uint16"}],"internalType":"struct HytteWandererClub.AmountInfoByNftType[]","name":"maxSupplyInfo","type":"tuple[]"},{"components":[{"internalType":"uint256","name":"traveler","type":"uint256"},{"internalType":"uint256","name":"camper","type":"uint256"},{"internalType":"uint256","name":"backpacker","type":"uint256"}],"internalType":"struct HytteWandererClub.EthSalePriceInfoByNftType[]","name":"ethSalePricesInWeiBySaleType","type":"tuple[]"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AccessControlBadConfirmation","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"bytes32","name":"neededRole","type":"bytes32"}],"name":"AccessControlUnauthorizedAccount","type":"error"},{"inputs":[{"internalType":"uint256","name":"invalidLength","type":"uint256"}],"name":"ArrayLengthNotMatched","type":"error"},{"inputs":[],"name":"BroaderRestrictionAlreadyApplied","type":"error"},{"inputs":[],"name":"ERC721EnumerableForbiddenBatchMint","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"owner","type":"address"}],"name":"ERC721IncorrectOwner","type":"error"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ERC721InsufficientApproval","type":"error"},{"inputs":[{"internalType":"address","name":"approver","type":"address"}],"name":"ERC721InvalidApprover","type":"error"},{"inputs":[{"internalType":"address","name":"operator","type":"address"}],"name":"ERC721InvalidOperator","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"ERC721InvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"}],"name":"ERC721InvalidReceiver","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"}],"name":"ERC721InvalidSender","type":"error"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ERC721NonexistentToken","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"ERC721OutOfBoundsIndex","type":"error"},{"inputs":[],"name":"EnforcedPause","type":"error"},{"inputs":[],"name":"ExpectedPause","type":"error"},{"inputs":[{"internalType":"uint256","name":"currentBalance","type":"uint256"}],"name":"InsufficientFundsToWithdraw","type":"error"},{"inputs":[{"internalType":"uint16","name":"exceededValue","type":"uint16"}],"name":"MaxAmountCanBeMintedAtOnceExceeded","type":"error"},{"inputs":[{"internalType":"enum HytteWandererClub.MintType","name":"mintType","type":"uint8"}],"name":"MaxMintTypeSupplyExceeded","type":"error"},{"inputs":[{"internalType":"enum HytteWandererClub.NftType","name":"nftType","type":"uint8"},{"internalType":"uint16","name":"exceededValue","type":"uint16"}],"name":"MaxNftTypeSupplyExceeded","type":"error"},{"inputs":[{"internalType":"uint16","name":"exceededValue","type":"uint16"}],"name":"MaxTotalSupplyExceeded","type":"error"},{"inputs":[{"internalType":"enum HytteWandererClub.MintType","name":"mintType","type":"uint8"},{"internalType":"enum HytteWandererClub.NftType","name":"nftType","type":"uint8"}],"name":"NewMaxNftTypeSupplyIsLessThanCurrentSupply","type":"error"},{"inputs":[{"internalType":"enum HytteWandererClub.SaleType","name":"saleType","type":"uint8"},{"internalType":"uint256","name":"requiredWeiAmount","type":"uint256"}],"name":"NotMatchedWithSalePrice","type":"error"},{"inputs":[{"internalType":"bytes32","name":"registeredMerkleRoot","type":"bytes32"}],"name":"NotWhitelisted","type":"error"},{"inputs":[],"name":"PrivateSaleAlreadyClosed","type":"error"},{"inputs":[],"name":"PrivateSaleAlreadyOpened","type":"error"},{"inputs":[],"name":"PublicSaleAlreadyClosed","type":"error"},{"inputs":[],"name":"PublicSaleAlreadyOpened","type":"error"},{"inputs":[],"name":"ReentrancyGuardReentrantCall","type":"error"},{"inputs":[{"internalType":"enum HytteWandererClub.SaleType","name":"saleType","type":"uint8"}],"name":"SaleNotOpened","type":"error"},{"inputs":[{"internalType":"uint256","name":"value","type":"uint256"}],"name":"TooSmallValue","type":"error"},{"inputs":[],"name":"TransferRestricted","type":"error"},{"inputs":[{"internalType":"enum HytteWandererClub.MintType","name":"mintType","type":"uint8"}],"name":"UnauthorizedAccessToSupplyByMintType","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"string","name":"newBaseUri","type":"string"}],"name":"BaseUriChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"timestamp","type":"uint256"},{"components":[{"internalType":"uint256","name":"traveler","type":"uint256"},{"internalType":"uint256","name":"camper","type":"uint256"},{"internalType":"uint256","name":"backpacker","type":"uint256"}],"indexed":false,"internalType":"struct HytteWandererClub.EthSalePriceInfoByNftType[]","name":"newEthSalePricesBySaleType","type":"tuple[]"}],"name":"EthSalePriceChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"newMerkleRoot","type":"bytes32"}],"name":"FirstWhitelistChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint16","name":"maxAmountCanBeMintedAtOnce","type":"uint16"}],"name":"MaxAmountCanBeMintedAtOnceChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"timestamp","type":"uint256"},{"components":[{"internalType":"uint16","name":"traveler","type":"uint16"},{"internalType":"uint16","name":"camper","type":"uint16"},{"internalType":"uint16","name":"backpacker","type":"uint16"}],"indexed":false,"internalType":"struct HytteWandererClub.AmountInfoByNftType[]","name":"newMaxSupplyInfo","type":"tuple[]"}],"name":"MaxSupplyInfoChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"to","type":"address"},{"components":[{"internalType":"uint16","name":"traveler","type":"uint16"},{"internalType":"uint16","name":"camper","type":"uint16"},{"internalType":"uint16","name":"backpacker","type":"uint16"}],"indexed":false,"internalType":"struct HytteWandererClub.AmountInfoByNftType","name":"mintAmountInfo","type":"tuple"}],"name":"MintedForPartners","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"enum HytteWandererClub.SaleType","name":"saleType","type":"uint8"},{"indexed":true,"internalType":"enum HytteWandererClub.SalePaymentCurrencyType","name":"currencyType","type":"uint8"},{"components":[{"internalType":"uint16","name":"traveler","type":"uint16"},{"internalType":"uint16","name":"camper","type":"uint16"},{"internalType":"uint16","name":"backpacker","type":"uint16"}],"indexed":false,"internalType":"struct HytteWandererClub.AmountInfoByNftType","name":"mintAmountInfo","type":"tuple"}],"name":"MintedForSale","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"to","type":"address"},{"components":[{"internalType":"uint16","name":"traveler","type":"uint16"},{"internalType":"uint16","name":"camper","type":"uint16"},{"internalType":"uint16","name":"backpacker","type":"uint16"}],"indexed":false,"internalType":"struct HytteWandererClub.AmountInfoByNftType","name":"mintAmountInfo","type":"tuple"}],"name":"MintedForTeam","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bool","name":"isOpened","type":"bool"}],"name":"PrivateSaleOpenStatusChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bool","name":"isOpened","type":"bool"}],"name":"PublicSaleOpenStatusChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bool","name":"isRevealed","type":"bool"}],"name":"RevealStatusChanged","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":"bytes32","name":"newMerkleRoot","type":"bytes32"}],"name":"SecondWhitelistChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bool","name":"isTransferable","type":"bool"}],"name":"TransferabilityChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"KRW_MINTER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_SUPPLY_FOR_BACKPACKER","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_SUPPLY_FOR_CAMPER","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_SUPPLY_FOR_TRAVELER","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","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":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"closeAllSale","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"closePrivateSale","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"closePublicSale","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"enum HytteWandererClub.SalePaymentCurrencyType","name":"","type":"uint8"}],"name":"currentSupplyBySalePaymentCurrencyType","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"enum HytteWandererClub.SaleType","name":"","type":"uint8"}],"name":"currentSupplyBySaleType","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"enum HytteWandererClub.SaleType","name":"","type":"uint8"}],"name":"ethSalePrices","outputs":[{"internalType":"uint256","name":"traveler","type":"uint256"},{"internalType":"uint256","name":"camper","type":"uint256"},{"internalType":"uint256","name":"backpacker","type":"uint256"}],"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":"enum HytteWandererClub.MintType","name":"mintType","type":"uint8"}],"name":"getCurrentSupplyByMintType","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"enum HytteWandererClub.NftType","name":"nftType","type":"uint8"}],"name":"getCurrentSupplyByNftType","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"enum HytteWandererClub.MintType","name":"mintType","type":"uint8"}],"name":"getMaxSupplyByMintType","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"enum HytteWandererClub.NftType","name":"nftType","type":"uint8"}],"name":"getMaxSupplyByNftType","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"getMaxTotalSupply","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint16","name":"tokenId","type":"uint16"}],"name":"getNftType","outputs":[{"internalType":"enum HytteWandererClub.NftType","name":"","type":"uint8"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getRoleMember","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleMemberCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"enum HytteWandererClub.MintType","name":"mintType","type":"uint8"},{"internalType":"enum HytteWandererClub.NftType","name":"nftType","type":"uint8"}],"name":"getSupplyInfo","outputs":[{"internalType":"uint16","name":"","type":"uint16"},{"internalType":"uint16","name":"","type":"uint16"}],"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":[],"name":"isPrivateSaleOpened","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isPublicSaleOpened","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isRevealed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isTransferable","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxAmountCanBeMintedAtOnce","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"merkleRootForFirstWhitelist","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"merkleRootForSecondWhitelist","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"components":[{"internalType":"uint16","name":"traveler","type":"uint16"},{"internalType":"uint16","name":"camper","type":"uint16"},{"internalType":"uint16","name":"backpacker","type":"uint16"}],"internalType":"struct HytteWandererClub.AmountInfoByNftType","name":"mintAmountInfo","type":"tuple"}],"name":"mintForEthPublicSale","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"components":[{"internalType":"uint16","name":"traveler","type":"uint16"},{"internalType":"uint16","name":"camper","type":"uint16"},{"internalType":"uint16","name":"backpacker","type":"uint16"}],"internalType":"struct HytteWandererClub.AmountInfoByNftType","name":"mintAmountInfo","type":"tuple"},{"internalType":"bytes32[]","name":"merkleProof","type":"bytes32[]"}],"name":"mintForFirstEthPrivateSale","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"components":[{"internalType":"uint16","name":"traveler","type":"uint16"},{"internalType":"uint16","name":"camper","type":"uint16"},{"internalType":"uint16","name":"backpacker","type":"uint16"}],"internalType":"struct HytteWandererClub.AmountInfoByNftType","name":"mintAmountInfo","type":"tuple"},{"internalType":"bytes32[]","name":"merkleProof","type":"bytes32[]"}],"name":"mintForFirstKrwPrivateSale","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"components":[{"internalType":"uint16","name":"traveler","type":"uint16"},{"internalType":"uint16","name":"camper","type":"uint16"},{"internalType":"uint16","name":"backpacker","type":"uint16"}],"internalType":"struct HytteWandererClub.AmountInfoByNftType","name":"mintAmountInfo","type":"tuple"}],"name":"mintForKrwPublicSale","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"components":[{"internalType":"uint16","name":"traveler","type":"uint16"},{"internalType":"uint16","name":"camper","type":"uint16"},{"internalType":"uint16","name":"backpacker","type":"uint16"}],"internalType":"struct HytteWandererClub.AmountInfoByNftType","name":"mintAmountInfo","type":"tuple"}],"name":"mintForPartners","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"components":[{"internalType":"uint16","name":"traveler","type":"uint16"},{"internalType":"uint16","name":"camper","type":"uint16"},{"internalType":"uint16","name":"backpacker","type":"uint16"}],"internalType":"struct HytteWandererClub.AmountInfoByNftType","name":"mintAmountInfo","type":"tuple"},{"internalType":"bytes32[]","name":"merkleProof","type":"bytes32[]"}],"name":"mintForSecondEthPrivateSale","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"components":[{"internalType":"uint16","name":"traveler","type":"uint16"},{"internalType":"uint16","name":"camper","type":"uint16"},{"internalType":"uint16","name":"backpacker","type":"uint16"}],"internalType":"struct HytteWandererClub.AmountInfoByNftType","name":"mintAmountInfo","type":"tuple"},{"internalType":"bytes32[]","name":"merkleProof","type":"bytes32[]"}],"name":"mintForSecondKrwPrivateSale","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"components":[{"internalType":"uint16","name":"traveler","type":"uint16"},{"internalType":"uint16","name":"camper","type":"uint16"},{"internalType":"uint16","name":"backpacker","type":"uint16"}],"internalType":"struct HytteWandererClub.AmountInfoByNftType","name":"mintAmountInfo","type":"tuple"}],"name":"mintForTeam","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"openAllSale","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"openPrivateSale","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"openPublicSale","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"callerConfirmation","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":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"newBaseUri","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"traveler","type":"uint256"},{"internalType":"uint256","name":"camper","type":"uint256"},{"internalType":"uint256","name":"backpacker","type":"uint256"}],"internalType":"struct HytteWandererClub.EthSalePriceInfoByNftType[]","name":"ethSalePricesInWeiBySaleType","type":"tuple[]"}],"name":"setEthSalePrices","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"newMerkleRoot","type":"bytes32"}],"name":"setFirstWhitelist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"newMaxAmountCanBeMintedAtOnce","type":"uint16"}],"name":"setMaxAmountCanBeMintedAtOnce","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint16","name":"traveler","type":"uint16"},{"internalType":"uint16","name":"camper","type":"uint16"},{"internalType":"uint16","name":"backpacker","type":"uint16"}],"internalType":"struct HytteWandererClub.AmountInfoByNftType[]","name":"newMaxSupplyInfo","type":"tuple[]"}],"name":"setMaxSupplyInfo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"newIsRevealed","type":"bool"}],"name":"setRevealStatus","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"newMerkleRoot","type":"bytes32"}],"name":"setSecondWhitelist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"newIsTransferable","type":"bool"}],"name":"setTransferability","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"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":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdrawEthBalances","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
608060405234801561000f575f80fd5b506040516157c03803806157c083398101604081905261002e91610a61565b60405180604001604052806011815260200170243cba3a32abb0b73232b932b921b63ab160791b8152506040518060400160405280600381526020016248574360e81b815250815f90816100829190610be8565b50600161008f8282610be8565b5050600a805460ff19169055506001600b557ff237a3914cf3729e619b7739f6c267bba89e97613304c66915c29f71360f800e5f6100cd813361013e565b90505f6100da833361013e565b90505f6100e7848a61013e565b90508280156100f35750815b80156100fc5750805b61010857610108610ca7565b600e6101148982610be8565b5061011e87610174565b610127866101fa565b610130856105b8565b505050505050505050610e00565b5f8061014a8484610708565b9050801561016b575f848152600d6020526040902061016990846107b3565b505b90505b92915050565b5f61017e816107c7565b5f8261ffff16116101ad5760405163f81c8b6360e01b815261ffff831660048201526024015b60405180910390fd5b600f805461ffff60201b191664010000000061ffff8516908102919091179091556040517f75439a8539d65b7517b2d634403631b318295e9aea58930a84ad3c5878bc8a04905f90a25050565b5f610204816107c7565b8151600390811461022d57825160405163096fd70160e21b81526004016101a491815260200190565b5f6001600260038360ff86166001600160401b0381111561025057610250610892565b604051908082528060200260200182016040528015610279578160200160208202803683370190505b5090505f5b8660ff168160ff1610156104d0575f8160ff1660038111156102a2576102a2610cbb565b90505f5b8460ff168160ff1610156104c6575f8160ff1660038111156102ca576102ca610cbb565b90505f60125f8560038111156102e2576102e2610cbb565b60038111156102f3576102f3610cbb565b81526020019081526020015f205f83600381111561031357610313610cbb565b600381111561032457610324610cbb565b815260208101919091526040015f9081205462010000900461ffff1691508083600381111561035557610355610cbb565b146103bf57600183600381111561036e5761036e610cbb565b14610399578d8660ff168151811061038857610388610ccf565b6020026020010151604001516103e0565b8d8660ff16815181106103ae576103ae610ccf565b6020026020010151602001516103e0565b8d8660ff16815181106103d4576103d4610ccf565b60200260200101515f01515b905080878760ff16815181106103f8576103f8610ccf565b6020026020010181815161040c9190610ce3565b61ffff908116909152838116908316101590506104405784836040516380b5822d60e01b81526004016101a4929190610d2d565b8060125f87600381111561045657610456610cbb565b600381111561046757610467610cbb565b81526020019081526020015f205f85600381111561048757610487610cbb565b600381111561049857610498610cbb565b815260208101919091526040015f20805461ffff191661ffff929092169190911790555050506001016102a6565b505060010161027e565b505f818460ff16815181106104e7576104e7610ccf565b6020026020010151828660ff168151811061050457610504610ccf565b6020026020010151838860ff168151811061052157610521610ccf565b60200260200101516105339190610ce3565b61053d9190610ce3565b90506105476107d4565b61ffff168161ffff16111561057557604051637335ad8160e01b815261ffff821660048201526024016101a4565b427f7d82f2f3ee148b8386d1291af62ec9454213ba0735f70ff314c24b4249101bf58a6040516105a59190610d53565b60405180910390a2505050505050505050565b5f6105c2816107c7565b815160039081146105eb57825160405163096fd70160e21b81526004016101a491815260200190565b5f5b8160ff168160ff1610156106ca575f8160ff16600381111561061157610611610cbb565b90505f60155f83600381111561062957610629610cbb565b600381111561063a5761063a610cbb565b81526020019081526020015f209050858360ff168151811061065e5761065e610ccf565b60209081029190910101515181558551869060ff851690811061068357610683610ccf565b6020026020010151602001518160010181905550858360ff16815181106106ac576106ac610ccf565b602090810291909101015160400151600290910155506001016105ed565b50427f6449f923660b6ec3d7fd96f3b0a9966bac646624ff9f5de194cae25dcb0098d1846040516106fb9190610db5565b60405180910390a2505050565b5f828152600c602090815260408083206001600160a01b038516845290915281205460ff166107ac575f838152600c602090815260408083206001600160a01b03861684529091529020805460ff191660011790556107643390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a450600161016e565b505f61016e565b5f61016b836001600160a01b0384166107f5565b6107d1813361083a565b50565b5f6108ca6107e66107086101c2610ce3565b6107f09190610ce3565b905090565b5f8181526001830160205260408120546107ac57508154600181810184555f84815260208082209093018490558454848252828601909352604090209190915561016e565b5f828152600c602090815260408083206001600160a01b038516845290915290205460ff1661088e5760405163e2517d3f60e01b81526001600160a01b0382166004820152602481018390526044016101a4565b5050565b634e487b7160e01b5f52604160045260245ffd5b604051606081016001600160401b03811182821017156108c8576108c8610892565b60405290565b604051601f8201601f191681016001600160401b03811182821017156108f6576108f6610892565b604052919050565b805161ffff8116811461090f575f80fd5b919050565b5f6001600160401b0382111561092c5761092c610892565b5060051b60200190565b5f82601f830112610945575f80fd5b8151602061095a61095583610914565b6108ce565b82815260609283028501820192828201919087851115610978575f80fd5b8387015b858110156109d25781818a031215610992575f80fd5b61099a6108a6565b6109a3826108fe565b81526109b08683016108fe565b8682015260406109c18184016108fe565b90820152845292840192810161097c565b5090979650505050505050565b5f82601f8301126109ee575f80fd5b815160206109fe61095583610914565b82815260609283028501820192828201919087851115610a1c575f80fd5b8387015b858110156109d25781818a031215610a36575f80fd5b610a3e6108a6565b815181528582015186820152604080830151908201528452928401928101610a20565b5f805f805f60a08688031215610a75575f80fd5b85516001600160a01b0381168114610a8b575f80fd5b602087810151919650906001600160401b0380821115610aa9575f80fd5b818901915089601f830112610abc575f80fd5b815181811115610ace57610ace610892565b610ae0601f8201601f191685016108ce565b8181528b85838601011115610af3575f80fd5b818585018683015e5f8583830101528098505050610b1360408a016108fe565b95506060890151925080831115610b28575f80fd5b610b348a848b01610936565b94506080890151925080831115610b49575f80fd5b5050610b57888289016109df565b9150509295509295909350565b600181811c90821680610b7857607f821691505b602082108103610b9657634e487b7160e01b5f52602260045260245ffd5b50919050565b601f821115610be357805f5260205f20601f840160051c81016020851015610bc15750805b601f840160051c820191505b81811015610be0575f8155600101610bcd565b50505b505050565b81516001600160401b03811115610c0157610c01610892565b610c1581610c0f8454610b64565b84610b9c565b602080601f831160018114610c48575f8415610c315750858301515b5f19600386901b1c1916600185901b178555610c9f565b5f85815260208120601f198616915b82811015610c7657888601518255948401946001909101908401610c57565b5085821015610c9357878501515f19600388901b60f8161c191681555b505060018460011b0185555b505050505050565b634e487b7160e01b5f52600160045260245ffd5b634e487b7160e01b5f52602160045260245ffd5b634e487b7160e01b5f52603260045260245ffd5b61ffff818116838216019080821115610d0a57634e487b7160e01b5f52601160045260245ffd5b5092915050565b600481106107d157634e487b7160e01b5f52602160045260245ffd5b60408101610d3a84610d11565b838252610d4683610d11565b8260208301529392505050565b602080825282518282018190525f919060409081850190868401855b82811015610da8578151805161ffff90811686528782015181168887015290860151168585015260609093019290850190600101610d6f565b5091979650505050505050565b602080825282518282018190525f919060409081850190868401855b82811015610da85781518051855286810151878601528501518585015260609093019290850190600101610dd1565b6149b380610e0d5f395ff3fe60806040526004361061040b575f3560e01c80636d4351ad11610215578063a6ad4c011161011e578063ccc59932116100a8578063e35892ed11610078578063e35892ed14610c37578063e47b747214610c56578063e985e9c514610c69578063f4d83a6a14610c88578063fd2d700514610c9d575f80fd5b8063ccc5993214610bb5578063d547741f14610be1578063dd1b018514610c00578063e0a159cd14610c15575f80fd5b8063bb35e5c4116100ee578063bb35e5c414610adf578063c5e647df14610b0e578063c87b56dd14610b48578063c90027ae14610b67578063ca15c87314610b96575f80fd5b8063a6ad4c0114610a85578063b585209b14610a99578063b82fd04a14610aad578063b88d4fde14610ac0575f80fd5b80639010d07c1161019f5780639a66c95e1161016f5780639a66c95e14610a01578063a217fddf14610a15578063a22cb46514610a28578063a273747414610a47578063a577937c14610a66575f80fd5b80639010d07c1461095a57806391d148541461097957806395c74bfa1461099857806395d89b41146109ed575f80fd5b80637f318337116101e55780637f318337146108d45780638456cb59146108f357806384c99fb41461090757806385605bd414610926578063887b40fe14610945575f80fd5b80636d4351ad1461086157806370a082311461087657806375c5f2fe146108955780637db61db0146108b4575f80fd5b806336568abe1161031757806354214f69116102a15780635c975abb116102715780635c975abb146107e35780635db30bb1146107fa5780636352211e1461080e5780636a9eba2d1461082d5780636b7259ae14610842575f80fd5b806354214f691461077857806355f804b3146107915780635948ab63146107b05780635c3c711e146107cf575f80fd5b8063432f6ba6116102e7578063432f6ba6146106e857806344782bff1461070757806345120cd51461071b57806345e5c22e1461073a5780634f6ccce714610759575f80fd5b806336568abe146106775780633f4ba83a1461069657806342842e0e146106aa57806342966c68146106c9575f80fd5b80632121dc75116103985780632af89179116103685780632af89179146105d45780632f2ff15d146105e85780632f745c59146106075780633053baab1461062657806335f0c50414610658575f80fd5b80632121dc751461054a57806323b872dd14610568578063248a9ca31461058757806324a63ff7146105b5575f80fd5b8063091d36cc116103de578063091d36cc146104bc578063095ea7b3146104db578063174a4c6b146104fa57806318160ddd146105195780631b08542214610537575f80fd5b806301ffc9a71461040f57806304b7513f1461044357806306fdde0314610464578063081812fc14610485575b5f80fd5b34801561041a575f80fd5b5061042e610429366004613eca565b610cbd565b60405190151581526020015b60405180910390f35b34801561044e575f80fd5b5061046261045d366004613ef6565b610ccd565b005b34801561046f575f80fd5b50610478610d54565b60405161043a9190613f3d565b348015610490575f80fd5b506104a461049f366004613f4f565b610de3565b6040516001600160a01b03909116815260200161043a565b3480156104c7575f80fd5b506104626104d6366004613f4f565b610e0a565b3480156104e6575f80fd5b506104626104f5366004613f7a565b610e47565b348015610505575f80fd5b50610462610514366004613fb4565b610e56565b348015610524575f80fd5b506008545b60405190815260200161043a565b610462610545366004613fe8565b610eb2565b348015610555575f80fd5b50600f5461042e90610100900460ff1681565b348015610573575f80fd5b50610462610582366004614075565b610f58565b348015610592575f80fd5b506105296105a1366004613f4f565b5f908152600c602052604090206001015490565b3480156105c0575f80fd5b506104626105cf366004613f4f565b610f90565b3480156105df575f80fd5b50610462610fcd565b3480156105f3575f80fd5b506104626106023660046140b3565b611046565b348015610612575f80fd5b50610529610621366004613f7a565b611070565b348015610631575f80fd5b506106456106403660046140ed565b6110d3565b60405161ffff909116815260200161043a565b348015610663575f80fd5b506106456106723660046140ed565b611126565b348015610682575f80fd5b506104626106913660046140b3565b6111dc565b3480156106a1575f80fd5b5061046261120f565b3480156106b5575f80fd5b506104626106c4366004614075565b611224565b3480156106d4575f80fd5b506104626106e3366004613f4f565b61123e565b3480156106f3575f80fd5b50610462610702366004613f7a565b611249565b348015610712575f80fd5b506104626112d5565b348015610726575f80fd5b50610462610735366004614199565b611351565b348015610745575f80fd5b50610462610754366004614255565b611494565b348015610764575f80fd5b50610529610773366004613f4f565b611853565b348015610783575f80fd5b50600f5461042e9060ff1681565b34801561079c575f80fd5b506104626107ab366004614315565b6118a8565b3480156107bb575f80fd5b506104626107ca366004614390565b611927565b3480156107da575f80fd5b5061046261199a565b3480156107ee575f80fd5b50600a5460ff1661042e565b348015610805575f80fd5b506106456119b4565b348015610819575f80fd5b506104a4610828366004613f4f565b6119d5565b348015610838575f80fd5b506106456108ca81565b34801561084d575f80fd5b50600f5461042e9062010000900460ff1681565b34801561086c575f80fd5b506106456101c281565b348015610881575f80fd5b506105296108903660046143a9565b6119df565b3480156108a0575f80fd5b506104626108af366004613fb4565b611a24565b3480156108bf575f80fd5b50600f5461042e906301000000900460ff1681565b3480156108df575f80fd5b506104626108ee366004613fe8565b611a47565b3480156108fe575f80fd5b50610462611b06565b348015610912575f80fd5b50610462610921366004614390565b611b18565b348015610931575f80fd5b506106456109403660046140ed565b611b5f565b348015610950575f80fd5b5061052960115481565b348015610965575f80fd5b506104a46109743660046143c4565b611c7b565b348015610984575f80fd5b5061042e6109933660046140b3565b611c99565b3480156109a3575f80fd5b506109d26109b23660046140ed565b60156020525f908152604090208054600182015460029092015490919083565b6040805193845260208401929092529082015260600161043a565b3480156109f8575f80fd5b50610478611cc3565b348015610a0c575f80fd5b50610462611cd2565b348015610a20575f80fd5b506105295f81565b348015610a33575f80fd5b50610462610a423660046143e4565b611cec565b348015610a52575f80fd5b50610462610a61366004613fb4565b611cf7565b348015610a71575f80fd5b50610645610a803660046140ed565b611d45565b348015610a90575f80fd5b50610462611e5b565b348015610aa4575f80fd5b50610462611ef8565b610462610abb366004613fb4565b611f91565b348015610acb575f80fd5b50610462610ada36600461440e565b611f9c565b348015610aea575f80fd5b50610645610af93660046140ed565b60136020525f908152604090205461ffff1681565b348015610b19575f80fd5b50610b2d610b283660046144cb565b611fb3565b6040805161ffff93841681529290911660208301520161043a565b348015610b53575f80fd5b50610478610b62366004613f4f565b6120b6565b348015610b72575f80fd5b50610645610b813660046144f7565b60146020525f908152604090205461ffff1681565b348015610ba1575f80fd5b50610529610bb0366004613f4f565b6120ff565b348015610bc0575f80fd5b50610bd4610bcf366004613ef6565b612115565b60405161043a9190614545565b348015610bec575f80fd5b50610462610bfb3660046140b3565b612170565b348015610c0b575f80fd5b5061064561070881565b348015610c20575f80fd5b50600f5461064590640100000000900461ffff1681565b348015610c42575f80fd5b50610462610c51366004613fe8565b612194565b610462610c64366004613fe8565b612247565b348015610c74575f80fd5b5061042e610c83366004614558565b6122e3565b348015610c93575f80fd5b5061052960105481565b348015610ca8575f80fd5b506105295f8051602061495e83398151915281565b5f610cc782612310565b92915050565b5f610cd781612334565b5f8261ffff1611610d065760405163f81c8b6360e01b815261ffff831660048201526024015b60405180910390fd5b600f805465ffff00000000191664010000000061ffff8516908102919091179091556040517f75439a8539d65b7517b2d634403631b318295e9aea58930a84ad3c5878bc8a04905f90a25050565b60605f8054610d6290614584565b80601f0160208091040260200160405190810160405280929190818152602001828054610d8e90614584565b8015610dd95780601f10610db057610100808354040283529160200191610dd9565b820191905f5260205f20905b815481529060010190602001808311610dbc57829003601f168201915b5050505050905090565b5f610ded8261233e565b505f828152600460205260409020546001600160a01b0316610cc7565b5f610e1481612334565b601082905560405182907f590854cb6b0713c26af72d761c4897b229abdb0c2bc236cb056d41c2f7dbffa3905f90a25050565b610e52828233612376565b5050565b5f610e6081612334565b610e6c83600284612383565b826001600160a01b03167f1f348733d466ad55406cf108bf4c40ba1fb8c6d207c7f2831fd0c67532ce97c983604051610ea591906145b6565b60405180910390a2505050565b3360105483835f84604051602001610eca91906145f7565b604051602081830303815290604052805190602001209050610f218383808060200260200160405190810160405280939291908181526020018383602002808284375f920191909152508892508591506127bb9050565b610f415760405163247643e960e21b815260048101859052602401610cfd565b610f4d895f808b6127d0565b505050505050505050565b600f54610100900460ff16610f8057604051637413882f60e11b815260040160405180910390fd5b610f8b838383612ba2565b505050565b5f610f9a81612334565b601182905560405182907f96b02105f373345e4360215051612dd21caf0bfbb7ed1fd51ed27d607f94ed26905f90a25050565b5f610fd781612334565b600f5462010000900460ff166110005760405163ae29fa1160e01b815260040160405180910390fd5b600f805462ff00001916908190556040516201000090910460ff161515907f6426959a3505e131faf5c6155a33f73c033b28a04370820816b94ec035348f37905f90a250565b5f828152600c602052604090206001015461106081612334565b61106a8383612c25565b50505050565b5f61107a836119df565b82106110ab5760405163295f44f760e21b81526001600160a01b038416600482015260248101839052604401610cfd565b506001600160a01b03919091165f908152600660209081526040808320938352929052205490565b5f60028260038111156110e8576110e8614515565b036110f657506108ca919050565b600182600381111561110a5761110a614515565b036111185750610708919050565b506101c2919050565b919050565b5f806003815b8160ff168160ff1610156111d35760125f8260ff16600381111561115257611152614515565b600381111561116357611163614515565b600381111561117457611174614515565b81526020019081526020015f205f86600381111561119457611194614515565b60038111156111a5576111a5614515565b815260208101919091526040015f20546111c99062010000900461ffff1684614628565b925060010161112c565b50909392505050565b6001600160a01b03811633146112055760405163334bd91960e11b815260040160405180910390fd5b610f8b8282612c58565b5f61121981612334565b611221612c83565b50565b610f8b83838360405180602001604052805f815250611f9c565b610e525f8233612cd5565b5f61125381612334565b5f82116112765760405163f81c8b6360e01b815260048101839052602401610cfd565b478083111561129b57604051634e220d4160e11b815260048101829052602401610cfd565b6040516001600160a01b0385169084156108fc029085905f818181858888f193505050501580156112ce573d5f803e3d5ffd5b5050505050565b5f6112df81612334565b600f546301000000900460ff1661130957604051630cdd5a2560e11b815260040160405180910390fd5b600f805463ff000000191690819055604051630100000090910460ff161515907f682318da8fe12c73c5b69d39ed232e26a92bc1c7be0c5a19a0aae81eeb64fa15905f90a250565b5f61135b81612334565b8151600390811461138457825160405163096fd70160e21b8152600401610cfd91815260200190565b5f5b8160ff168160ff161015611463575f8160ff1660038111156113aa576113aa614515565b90505f60155f8360038111156113c2576113c2614515565b60038111156113d3576113d3614515565b81526020019081526020015f209050858360ff16815181106113f7576113f7614643565b60209081029190910101515181558551869060ff851690811061141c5761141c614643565b6020026020010151602001518160010181905550858360ff168151811061144557611445614643565b60209081029190910101516040015160029091015550600101611386565b50427f6449f923660b6ec3d7fd96f3b0a9966bac646624ff9f5de194cae25dcb0098d184604051610ea59190614657565b5f61149e81612334565b815160039081146114c757825160405163096fd70160e21b8152600401610cfd91815260200190565b5f6001600260038360ff861667ffffffffffffffff8111156114eb576114eb614108565b604051908082528060200260200182016040528015611514578160200160208202803683370190505b5090505f5b8660ff168160ff16101561176b575f8160ff16600381111561153d5761153d614515565b90505f5b8460ff168160ff161015611761575f8160ff16600381111561156557611565614515565b90505f60125f85600381111561157d5761157d614515565b600381111561158e5761158e614515565b81526020019081526020015f205f8360038111156115ae576115ae614515565b60038111156115bf576115bf614515565b815260208101919091526040015f9081205462010000900461ffff169150808360038111156115f0576115f0614515565b1461165a57600183600381111561160957611609614515565b14611634578d8660ff168151811061162357611623614643565b60200260200101516040015161167b565b8d8660ff168151811061164957611649614643565b60200260200101516020015161167b565b8d8660ff168151811061166f5761166f614643565b60200260200101515f01515b905080878760ff168151811061169357611693614643565b602002602001018181516116a79190614628565b61ffff908116909152838116908316101590506116db5784836040516380b5822d60e01b8152600401610cfd9291906146af565b8060125f8760038111156116f1576116f1614515565b600381111561170257611702614515565b81526020019081526020015f205f85600381111561172257611722614515565b600381111561173357611733614515565b815260208101919091526040015f20805461ffff191661ffff92909216919091179055505050600101611541565b5050600101611519565b505f818460ff168151811061178257611782614643565b6020026020010151828660ff168151811061179f5761179f614643565b6020026020010151838860ff16815181106117bc576117bc614643565b60200260200101516117ce9190614628565b6117d89190614628565b90506117e26119b4565b61ffff168161ffff16111561181057604051637335ad8160e01b815261ffff82166004820152602401610cfd565b427f7d82f2f3ee148b8386d1291af62ec9454213ba0735f70ff314c24b4249101bf58a60405161184091906146d5565b60405180910390a2505050505050505050565b5f61185d60085490565b82106118855760405163295f44f760e21b81525f600482015260248101839052604401610cfd565b6008828154811061189857611898614643565b905f5260205f2001549050919050565b5f6118b281612334565b81806118d45760405163f81c8b6360e01b815260048101829052602401610cfd565b600e6118e184868361476e565b5083836040516118f2929190614828565b604051908190038120907f87cdeaffd8e70903d6ce7cc983fac3b09ca79e83818124c98e47a1d70f8027d6905f90a250505050565b5f61193181612334565b600a5460ff1615611955576040516316dbf35b60e01b815260040160405180910390fd5b600f805461ff001916610100841515908102919091179091556040517f11da1b8c0a94a11df636c4bcd3500335a4f11ec00f56b0a425b3354171b2cd9a905f90a25050565b5f6119a481612334565b6119ac610fcd565b6112216112d5565b5f6108ca6119c66107086101c2614628565b6119d09190614628565b905090565b5f610cc78261233e565b5f6001600160a01b038216611a09576040516322718ad960e21b81525f6004820152602401610cfd565b506001600160a01b03165f9081526003602052604090205490565b5f8051602061495e833981519152611a3b81612334565b610f8b83600184612ce9565b5f8051602061495e833981519152611a5e81612334565b8460115484845f84604051602001611a7691906145f7565b604051602081830303815290604052805190602001209050611acd8383808060200260200160405190810160405280939291908181526020018383602002808284375f920191909152508892508591506127bb9050565b611aed5760405163247643e960e21b815260048101859052602401610cfd565b611afa8a6001808c6127d0565b50505050505050505050565b5f611b1081612334565b6112216130a2565b5f611b2281612334565b600f805460ff19168315159081179091556040517f4a9768f4a343b5cd5d5319e6fe71e839c384e1f67a57e74631919d50c5d4d953905f90a25050565b5f81611b6b8233611c99565b158015611b8c5750611b8a5f8051602061495e83398151915233611c99565b155b8015611ba957505f816003811115611ba657611ba6614515565b14155b15611bc95780604051630a2cd25960e41b8152600401610cfd9190614545565b5f6003815b8160ff168160ff161015611c6f5760125f876003811115611bf157611bf1614515565b6003811115611c0257611c02614515565b81526020019081526020015f205f8260ff166003811115611c2557611c25614515565b6003811115611c3657611c36614515565b6003811115611c4757611c47614515565b815260208101919091526040015f2054611c659061ffff1684614628565b9250600101611bce565b50909250505b50919050565b5f828152600d60205260408120611c9290836130df565b9392505050565b5f918252600c602090815260408084206001600160a01b0393909316845291905290205460ff1690565b606060018054610d6290614584565b5f611cdc81612334565b611ce4611ef8565b611221611e5b565b610e523383836130ea565b5f611d0181612334565b611d0c835f84612383565b826001600160a01b03167f1b444e34d17e949111d45c65bf5460a1c3e0d4c527cdc36795debaaed950f12383604051610ea591906145b6565b5f81611d518233611c99565b158015611d725750611d705f8051602061495e83398151915233611c99565b155b8015611d8f57505f816003811115611d8c57611d8c614515565b14155b15611daf5780604051630a2cd25960e41b8152600401610cfd9190614545565b5f6003815b8160ff168160ff161015611c6f5760125f876003811115611dd757611dd7614515565b6003811115611de857611de8614515565b81526020019081526020015f205f8260ff166003811115611e0b57611e0b614515565b6003811115611e1c57611e1c614515565b6003811115611e2d57611e2d614515565b815260208101919091526040015f2054611e519062010000900461ffff1684614628565b9250600101611db4565b5f611e6581612334565b600f546301000000900460ff1615611e9057604051633167ae1760e21b815260040160405180910390fd5b600f805463ff00000019166301000000179055611eaf600a5460ff1690565b611ebc57611ebc5f611927565b600f54604051630100000090910460ff161515907f682318da8fe12c73c5b69d39ed232e26a92bc1c7be0c5a19a0aae81eeb64fa15905f90a250565b5f611f0281612334565b600f5462010000900460ff1615611f2c57604051637d43dda360e01b815260040160405180910390fd5b600f805462ff0000191662010000179055611f49600a5460ff1690565b611f5657611f565f611927565b600f546040516201000090910460ff161515907f6426959a3505e131faf5c6155a33f73c033b28a04370820816b94ec035348f37905f90a250565b610e52825f83612ce9565b611fa7848484610f58565b61106a84848484613188565b5f8083611fc08233611c99565b158015611fe15750611fdf5f8051602061495e83398151915233611c99565b155b8015611ffe57505f816003811115611ffb57611ffb614515565b14155b1561201e5780604051630a2cd25960e41b8152600401610cfd9190614545565b5f60125f87600381111561203457612034614515565b600381111561204557612045614515565b81526020019081526020015f205f86600381111561206557612065614515565b600381111561207657612076614515565b815260208082019290925260409081015f2081518083019092525461ffff8082168084526201000090920416919092018190529097909650945050505050565b600f5460609060ff16156120d2576120cd826132a7565b610cc7565b6120da61330b565b6040516020016120ea919061484e565b60405160208183030381529060405292915050565b5f818152600d60205260408120610cc79061331a565b5f6107086121266101c26001614628565b6121309190614628565b61ffff168261ffff161061214657506002919050565b6121536101c26001614628565b61ffff168261ffff161061216957506001919050565b505f919050565b5f828152600c602052604090206001015461218a81612334565b61106a8383612c58565b5f8051602061495e8339815191526121ab81612334565b8460105484845f846040516020016121c391906145f7565b60405160208183030381529060405280519060200120905061221a8383808060200260200160405190810160405280939291908181526020018383602002808284375f920191909152508892508591506127bb9050565b61223a5760405163247643e960e21b815260048101859052602401610cfd565b611afa8a5f60018c6127d0565b3360115483835f8460405160200161225f91906145f7565b6040516020818303038152906040528051906020012090506122b68383808060200260200160405190810160405280939291908181526020018383602002808284375f920191909152508892508591506127bb9050565b6122d65760405163247643e960e21b815260048101859052602401610cfd565b610f4d8960015f8b6127d0565b6001600160a01b039182165f90815260056020908152604080832093909416825291909152205460ff1690565b5f6001600160e01b03198216635a05180f60e01b1480610cc75750610cc782613323565b6112218133613347565b5f818152600260205260408120546001600160a01b031680610cc757604051637e27328960e01b815260048101849052602401610cfd565b610f8b8383836001613380565b61238b613484565b5f61239c6060830160408401613ef6565b6123ac6040840160208501613ef6565b6123b96020850185613ef6565b6123c39190614628565b6123cd9190614628565b90505f60125f8560038111156123e5576123e5614515565b60038111156123f6576123f6614515565b815260208082019290925260409081015f908120818052928390528181206001825282822060028352928220805484548354969750929591939261ffff91821692612445929182169116614628565b61244f9190614628565b8254845486549293505f9261ffff6201000093849004811693612479938190048216920416614628565b6124839190614628565b90505f8761ffff16116124af5760405163f81c8b6360e01b815261ffff88166004820152602401610cfd565b5f8761ffff166124be60085490565b6124c8919061486a565b90506124d26119b4565b61ffff168111156124fc57604051637335ad8160e01b815261ffff82166004820152602401610cfd565b61ffff831661250b8984614628565b61ffff161115612530578960405163c0a8f6a760e01b8152600401610cfd9190614545565b60408051808201909152865461ffff8082168352620100009091041660208083019190915261256c915f91612567908d018d613ef6565b6134ae565b604080518082018252865461ffff808216835262010000909104166020808301919091526125a69260019291612567918e01908e01613ef6565b604080518082018252855461ffff8082168352620100009091041660208201526125de91600291906125679060608e01908e01613ef6565b5f5b6125ed60208b018b613ef6565b61ffff168161ffff161015612630576126288c8261260a5f611126565b612615906001614628565b61261f9190614628565b61ffff1661350b565b6001016125e0565b505f5b61264360408b0160208c01613ef6565b61ffff168161ffff161015612680576126788c826126616001611126565b61266e6101c26001614628565b6126159190614628565b600101612633565b505f5b61269360608b0160408c01613ef6565b61ffff168161ffff1610156126d3576126cb8c826126b16002611126565b6107086126c16101c26001614628565b61266e9190614628565b600101612683565b506126e160208a018a613ef6565b865487906002906126fd90849062010000900461ffff16614628565b92506101000a81548161ffff021916908361ffff16021790555088602001602081019061272a9190613ef6565b8554869060029061274690849062010000900461ffff16614628565b92506101000a81548161ffff021916908361ffff1602179055508860400160208101906127739190613ef6565b8454859060029061278f90849062010000900461ffff16614628565b92506101000a81548161ffff021916908361ffff1602179055505050505050505050610f8b6001600b55565b5f826127c78584613524565b14949350505050565b838383835f6127e56060830160408401613ef6565b6127f56040840160208501613ef6565b6128026020850185613ef6565b61280c9190614628565b6128169190614628565b90505f84600381111561282b5761282b614515565b14806128485750600184600381111561284657612846614515565b145b61285e57600f5462010000900460ff161561286d565b600f546301000000900460ff16155b1561288d57836040516319de26a560e31b8152600401610cfd9190614545565b600f5461ffff640100000000909104811690821611156128c557604051627e547160e21b815261ffff82166004820152602401610cfd565b5f8360018111156128d8576128d8614515565b03612a15575f6128ee6060840160408501613ef6565b61ffff1660155f87600381111561290757612907614515565b600381111561291857612918614515565b81526020019081526020015f2060020154612933919061487d565b6129436040850160208601613ef6565b61ffff1660155f88600381111561295c5761295c614515565b600381111561296d5761296d614515565b81526020019081526020015f2060010154612988919061487d565b6129956020860186613ef6565b61ffff1660155f8960038111156129ae576129ae614515565b60038111156129bf576129bf614515565b81526020019081526020015f205f01546129d9919061487d565b6129e3919061486a565b6129ed919061486a565b9050803414612a13578481604051632f82164760e21b8152600401610cfd929190614894565b505b612a2189600188612383565b5f612a326060880160408901613ef6565b612a426040890160208a01613ef6565b612a4f60208a018a613ef6565b612a599190614628565b612a639190614628565b90508060135f8b6003811115612a7b57612a7b614515565b6003811115612a8c57612a8c614515565b815260208101919091526040015f9081208054909190612ab190849061ffff16614628565b92506101000a81548161ffff021916908361ffff1602179055508060145f8a6001811115612ae157612ae1614515565b6001811115612af257612af2614515565b815260208101919091526040015f9081208054909190612b1790849061ffff16614628565b92506101000a81548161ffff021916908361ffff160217905550876001811115612b4357612b43614515565b896003811115612b5557612b55614515565b8b6001600160a01b03167f347787cc15f69c94f529b27df8daea72784a9250b3b6e1b941adf2e39f1869838a604051612b8e91906145b6565b60405180910390a450505050505050505050565b6001600160a01b038216612bcb57604051633250574960e11b81525f6004820152602401610cfd565b5f612bd7838333612cd5565b9050836001600160a01b0316816001600160a01b03161461106a576040516364283d7b60e01b81526001600160a01b0380861660048301526024820184905282166044820152606401610cfd565b5f80612c31848461355e565b90508015611c92575f848152600d60205260409020612c5090846135ef565b509392505050565b5f80612c648484613603565b90508015611c92575f848152600d60205260409020612c50908461366e565b612c8b613682565b600a805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b5f612ce18484846136a7565b949350505050565b82600283835f612cff6060830160408401613ef6565b612d0f6040840160208501613ef6565b612d1c6020850185613ef6565b612d269190614628565b612d309190614628565b90505f846003811115612d4557612d45614515565b1480612d6257506001846003811115612d6057612d60614515565b145b612d7857600f5462010000900460ff1615612d87565b600f546301000000900460ff16155b15612da757836040516319de26a560e31b8152600401610cfd9190614545565b600f5461ffff64010000000090910481169082161115612ddf57604051627e547160e21b815261ffff82166004820152602401610cfd565b5f836001811115612df257612df2614515565b03612f2f575f612e086060840160408501613ef6565b61ffff1660155f876003811115612e2157612e21614515565b6003811115612e3257612e32614515565b81526020019081526020015f2060020154612e4d919061487d565b612e5d6040850160208601613ef6565b61ffff1660155f886003811115612e7657612e76614515565b6003811115612e8757612e87614515565b81526020019081526020015f2060010154612ea2919061487d565b612eaf6020860186613ef6565b61ffff1660155f896003811115612ec857612ec8614515565b6003811115612ed957612ed9614515565b81526020019081526020015f205f0154612ef3919061487d565b612efd919061486a565b612f07919061486a565b9050803414612f2d578481604051632f82164760e21b8152600401610cfd929190614894565b505b612f3b88600188612383565b5f612f4c6060880160408901613ef6565b612f5c6040890160208a01613ef6565b612f6960208a018a613ef6565b612f739190614628565b612f7d9190614628565b60025f90815260136020527f0b9d2c0c271bb30544eb78c59bdaebdae2728e5f65814c07768a0abe90ed192380549293508392909190612fc290849061ffff16614628565b92506101000a81548161ffff021916908361ffff1602179055508060145f8a6001811115612ff257612ff2614515565b600181111561300357613003614515565b815260208101919091526040015f908120805490919061302890849061ffff16614628565b92506101000a81548161ffff021916908361ffff16021790555087600181111561305457613054614515565b60028a6001600160a01b03167f347787cc15f69c94f529b27df8daea72784a9250b3b6e1b941adf2e39f1869838a60405161308f91906145b6565b60405180910390a4505050505050505050565b6130aa6136bb565b600a805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258612cb83390565b5f611c9283836136df565b6001600160a01b03821661311c57604051630b61174360e31b81526001600160a01b0383166004820152602401610cfd565b6001600160a01b038381165f81815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6001600160a01b0383163b1561106a57604051630a85bd0160e11b81526001600160a01b0384169063150b7a02906131ca9033908890879087906004016148ab565b6020604051808303815f875af1925050508015613204575060408051601f3d908101601f19168201909252613201918101906148e7565b60015b61326b573d808015613231576040519150601f19603f3d011682016040523d82523d5f602084013e613236565b606091505b5080515f0361326357604051633250574960e11b81526001600160a01b0385166004820152602401610cfd565b805181602001fd5b6001600160e01b03198116630a85bd0160e11b146112ce57604051633250574960e11b81526001600160a01b0385166004820152602401610cfd565b60606132b28261233e565b505f6132bc61330b565b90505f8151116132da5760405180602001604052805f815250611c92565b806132e484613705565b6040516020016132f5929190614902565b6040516020818303038152906040529392505050565b6060600e8054610d6290614584565b5f610cc7825490565b5f6001600160e01b03198216637965db0b60e01b1480610cc75750610cc782613795565b6133518282611c99565b610e525760405163e2517d3f60e01b81526001600160a01b038216600482015260248101839052604401610cfd565b808061339457506001600160a01b03821615155b15613455575f6133a38461233e565b90506001600160a01b038316158015906133cf5750826001600160a01b0316816001600160a01b031614155b80156133e257506133e081846122e3565b155b1561340b5760405163a9fbf51f60e01b81526001600160a01b0384166004820152602401610cfd565b81156134535783856001600160a01b0316826001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45b505b50505f90815260046020526040902080546001600160a01b0319166001600160a01b0392909216919091179055565b6002600b54036134a757604051633ee5aeb560e01b815260040160405180910390fd5b6002600b55565b5f8183602001516134bf9190614628565b9050825f015161ffff168161ffff1611806134e957506134de846110d3565b61ffff168161ffff16115b1561106a5783816040516318a2209d60e01b8152600401610cfd929190614916565b610e52828260405180602001604052805f8152506137b9565b5f81815b8451811015612c50576135548286838151811061354757613547614643565b60200260200101516137cf565b9150600101613528565b5f6135698383611c99565b6135e8575f838152600c602090815260408083206001600160a01b03861684529091529020805460ff191660011790556135a03390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a4506001610cc7565b505f610cc7565b5f611c92836001600160a01b0384166137fb565b5f61360e8383611c99565b156135e8575f838152600c602090815260408083206001600160a01b0386168085529252808320805460ff1916905551339286917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a4506001610cc7565b5f611c92836001600160a01b038416613840565b600a5460ff166136a557604051638dfc202b60e01b815260040160405180910390fd5b565b5f6136b06136bb565b612ce184848461392a565b600a5460ff16156136a55760405163d93c066560e01b815260040160405180910390fd5b5f825f0182815481106136f4576136f4614643565b905f5260205f200154905092915050565b60605f613711836139f5565b60010190505f8167ffffffffffffffff81111561373057613730614108565b6040519080825280601f01601f19166020018201604052801561375a576020820181803683370190505b5090508181016020015b5f19016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a850494508461376457509392505050565b5f6001600160e01b0319821663780e9d6360e01b1480610cc75750610cc782613acc565b6137c38383613b1b565b610f8b5f848484613188565b5f8183106137e9575f828152602084905260409020611c92565b5f838152602083905260409020611c92565b5f8181526001830160205260408120546135e857508154600181810184555f848152602080822090930184905584548482528286019093526040902091909155610cc7565b5f818152600183016020526040812054801561391a575f613862600183614936565b85549091505f9061387590600190614936565b90508082146138d4575f865f01828154811061389357613893614643565b905f5260205f200154905080875f0184815481106138b3576138b3614643565b5f918252602080832090910192909255918252600188019052604090208390555b85548690806138e5576138e5614949565b600190038181905f5260205f20015f90559055856001015f8681526020019081526020015f205f905560019350505050610cc7565b5f915050610cc7565b5092915050565b5f80613937858585613b7c565b90506001600160a01b0381166139935761398e84600880545f838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b6139b6565b846001600160a01b0316816001600160a01b0316146139b6576139b68185613c6e565b6001600160a01b0385166139d2576139cd84613cfb565b612ce1565b846001600160a01b0316816001600160a01b031614612ce157612ce18585613da2565b5f8072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b8310613a335772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310613a5f576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc100008310613a7d57662386f26fc10000830492506010015b6305f5e1008310613a95576305f5e100830492506008015b6127108310613aa957612710830492506004015b60648310613abb576064830492506002015b600a8310610cc75760010192915050565b5f6001600160e01b031982166380ac58cd60e01b1480613afc57506001600160e01b03198216635b5e139f60e01b145b80610cc757506301ffc9a760e01b6001600160e01b0319831614610cc7565b6001600160a01b038216613b4457604051633250574960e11b81525f6004820152602401610cfd565b5f613b5083835f612cd5565b90506001600160a01b03811615610f8b576040516339e3563760e11b81525f6004820152602401610cfd565b5f828152600260205260408120546001600160a01b0390811690831615613ba857613ba8818486613df0565b6001600160a01b03811615613be257613bc35f855f80613380565b6001600160a01b0381165f90815260036020526040902080545f190190555b6001600160a01b03851615613c10576001600160a01b0385165f908152600360205260409020805460010190555b5f8481526002602052604080822080546001600160a01b0319166001600160a01b0389811691821790925591518793918516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4949350505050565b5f613c78836119df565b5f83815260076020526040902054909150808214613cc9576001600160a01b0384165f9081526006602090815260408083208584528252808320548484528184208190558352600790915290208190555b505f9182526007602090815260408084208490556001600160a01b039094168352600681528383209183525290812055565b6008545f90613d0c90600190614936565b5f8381526009602052604081205460088054939450909284908110613d3357613d33614643565b905f5260205f20015490508060088381548110613d5257613d52614643565b5f918252602080832090910192909255828152600990915260408082208490558582528120556008805480613d8957613d89614949565b600190038181905f5260205f20015f9055905550505050565b5f6001613dae846119df565b613db89190614936565b6001600160a01b039093165f908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b613dfb838383613e54565b610f8b576001600160a01b038316613e2957604051637e27328960e01b815260048101829052602401610cfd565b60405163177e802f60e01b81526001600160a01b038316600482015260248101829052604401610cfd565b5f6001600160a01b03831615801590612ce15750826001600160a01b0316846001600160a01b03161480613e8d5750613e8d84846122e3565b80612ce15750505f908152600460205260409020546001600160a01b03908116911614919050565b6001600160e01b031981168114611221575f80fd5b5f60208284031215613eda575f80fd5b8135611c9281613eb5565b803561ffff81168114611121575f80fd5b5f60208284031215613f06575f80fd5b611c9282613ee5565b5f81518084528060208401602086015e5f602082860101526020601f19601f83011685010191505092915050565b602081525f611c926020830184613f0f565b5f60208284031215613f5f575f80fd5b5035919050565b6001600160a01b0381168114611221575f80fd5b5f8060408385031215613f8b575f80fd5b8235613f9681613f66565b946020939093013593505050565b5f60608284031215611c75575f80fd5b5f8060808385031215613fc5575f80fd5b8235613fd081613f66565b9150613fdf8460208501613fa4565b90509250929050565b5f805f8060a08587031215613ffb575f80fd5b843561400681613f66565b93506140158660208701613fa4565b9250608085013567ffffffffffffffff80821115614031575f80fd5b818701915087601f830112614044575f80fd5b813581811115614052575f80fd5b8860208260051b8501011115614066575f80fd5b95989497505060200194505050565b5f805f60608486031215614087575f80fd5b833561409281613f66565b925060208401356140a281613f66565b929592945050506040919091013590565b5f80604083850312156140c4575f80fd5b8235915060208301356140d681613f66565b809150509250929050565b60048110611221575f80fd5b5f602082840312156140fd575f80fd5b8135611c92816140e1565b634e487b7160e01b5f52604160045260245ffd5b6040516060810167ffffffffffffffff8111828210171561413f5761413f614108565b60405290565b604051601f8201601f1916810167ffffffffffffffff8111828210171561416e5761416e614108565b604052919050565b5f67ffffffffffffffff82111561418f5761418f614108565b5060051b60200190565b5f60208083850312156141aa575f80fd5b823567ffffffffffffffff8111156141c0575f80fd5b8301601f810185136141d0575f80fd5b80356141e36141de82614176565b614145565b81815260609182028301840191848201919088841115614201575f80fd5b938501935b838510156142495780858a03121561421c575f80fd5b61422461411c565b8535815286860135878201526040808701359082015283529384019391850191614206565b50979650505050505050565b5f6020808385031215614266575f80fd5b823567ffffffffffffffff81111561427c575f80fd5b8301601f8101851361428c575f80fd5b803561429a6141de82614176565b818152606091820283018401918482019190888411156142b8575f80fd5b938501935b838510156142495780858a0312156142d3575f80fd5b6142db61411c565b6142e486613ee5565b81526142f1878701613ee5565b878201526040614302818801613ee5565b90820152835293840193918501916142bd565b5f8060208385031215614326575f80fd5b823567ffffffffffffffff8082111561433d575f80fd5b818501915085601f830112614350575f80fd5b81358181111561435e575f80fd5b86602082850101111561436f575f80fd5b60209290920196919550909350505050565b80358015158114611121575f80fd5b5f602082840312156143a0575f80fd5b611c9282614381565b5f602082840312156143b9575f80fd5b8135611c9281613f66565b5f80604083850312156143d5575f80fd5b50508035926020909101359150565b5f80604083850312156143f5575f80fd5b823561440081613f66565b9150613fdf60208401614381565b5f805f8060808587031215614421575f80fd5b843561442c81613f66565b935060208581013561443d81613f66565b935060408601359250606086013567ffffffffffffffff80821115614460575f80fd5b818801915088601f830112614473575f80fd5b81358181111561448557614485614108565b614497601f8201601f19168501614145565b915080825289848285010111156144ac575f80fd5b80848401858401375f8482840101525080935050505092959194509250565b5f80604083850312156144dc575f80fd5b82356144e7816140e1565b915060208301356140d6816140e1565b5f60208284031215614507575f80fd5b813560028110611c92575f80fd5b634e487b7160e01b5f52602160045260245ffd5b6004811061122157634e487b7160e01b5f52602160045260245ffd5b6020810161455283614529565b91905290565b5f8060408385031215614569575f80fd5b823561457481613f66565b915060208301356140d681613f66565b600181811c9082168061459857607f821691505b602082108103611c7557634e487b7160e01b5f52602260045260245ffd5b6060810161ffff806145c785613ee5565b168352806145d760208601613ee5565b166020840152806145ea60408601613ee5565b1660408401525092915050565b60609190911b6bffffffffffffffffffffffff1916815260140190565b634e487b7160e01b5f52601160045260245ffd5b61ffff81811683821601908082111561392357613923614614565b634e487b7160e01b5f52603260045260245ffd5b602080825282518282018190525f919060409081850190868401855b828110156146a25781518051855286810151878601528501518585015260609093019290850190600101614673565b5091979650505050505050565b604081016146bc84614529565b8382526146c883614529565b8260208301529392505050565b602080825282518282018190525f919060409081850190868401855b828110156146a2578151805161ffff908116865287820151811688870152908601511685850152606090930192908501906001016146f1565b601f821115610f8b57805f5260205f20601f840160051c8101602085101561474f5750805b601f840160051c820191505b818110156112ce575f815560010161475b565b67ffffffffffffffff83111561478657614786614108565b61479a836147948354614584565b8361472a565b5f601f8411600181146147cb575f85156147b45750838201355b5f19600387901b1c1916600186901b1783556112ce565b5f83815260208120601f198716915b828110156147fa57868501358255602094850194600190920191016147da565b5086821015614816575f1960f88860031b161c19848701351681555b505060018560011b0183555050505050565b818382375f9101908152919050565b5f81518060208401855e5f93019283525090919050565b5f6148598284614837565b600360fc1b81526001019392505050565b80820180821115610cc757610cc7614614565b8082028115828204841417610cc757610cc7614614565b604081016148a184614529565b9281526020015290565b6001600160a01b03858116825284166020820152604081018390526080606082018190525f906148dd90830184613f0f565b9695505050505050565b5f602082840312156148f7575f80fd5b8151611c9281613eb5565b5f612ce16149108386614837565b84614837565b6040810161492384614529565b92815261ffff9190911660209091015290565b81810381811115610cc757610cc7614614565b634e487b7160e01b5f52603160045260245ffdfef237a3914cf3729e619b7739f6c267bba89e97613304c66915c29f71360f800ea264697066735822122013efa660a1cecc2efcb810caefc606658bdbd6e2d492ac221614b443debc626664736f6c63430008190033000000000000000000000000e0a784c9bf2c73e53798d99a27482fd4d024ee6400000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000006400000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000220000000000000000000000000000000000000000000000000000000000000000c697066733a2f2f787878782f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000003200000000000000000000000000000000000000000000000000000000000000c800000000000000000000000000000000000000000000000000000000000000fa0000000000000000000000000000000000000000000000000000000000000190000000000000000000000000000000000000000000000000000000000000064000000000000000000000000000000000000000000000000000000000000007d0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000d529ae9e8600000000000000000000000000000000000000000000000000000098c445ad578000000000000000000000000000000000000000000000000000005c5edcbc29000000000000000000000000000000000000000000000000000000e35fa931a0000000000000000000000000000000000000000000000000000000a36cc19bab0000000000000000000000000000000000000000000000000000006379da05b6000000000000000000000000000000000000000000000000000000ee08251ff3800000000000000000000000000000000000000000000000000000aa87bee538000000000000000000000000000000000000000000000000000000670758aa7c8000
Deployed Bytecode
0x60806040526004361061040b575f3560e01c80636d4351ad11610215578063a6ad4c011161011e578063ccc59932116100a8578063e35892ed11610078578063e35892ed14610c37578063e47b747214610c56578063e985e9c514610c69578063f4d83a6a14610c88578063fd2d700514610c9d575f80fd5b8063ccc5993214610bb5578063d547741f14610be1578063dd1b018514610c00578063e0a159cd14610c15575f80fd5b8063bb35e5c4116100ee578063bb35e5c414610adf578063c5e647df14610b0e578063c87b56dd14610b48578063c90027ae14610b67578063ca15c87314610b96575f80fd5b8063a6ad4c0114610a85578063b585209b14610a99578063b82fd04a14610aad578063b88d4fde14610ac0575f80fd5b80639010d07c1161019f5780639a66c95e1161016f5780639a66c95e14610a01578063a217fddf14610a15578063a22cb46514610a28578063a273747414610a47578063a577937c14610a66575f80fd5b80639010d07c1461095a57806391d148541461097957806395c74bfa1461099857806395d89b41146109ed575f80fd5b80637f318337116101e55780637f318337146108d45780638456cb59146108f357806384c99fb41461090757806385605bd414610926578063887b40fe14610945575f80fd5b80636d4351ad1461086157806370a082311461087657806375c5f2fe146108955780637db61db0146108b4575f80fd5b806336568abe1161031757806354214f69116102a15780635c975abb116102715780635c975abb146107e35780635db30bb1146107fa5780636352211e1461080e5780636a9eba2d1461082d5780636b7259ae14610842575f80fd5b806354214f691461077857806355f804b3146107915780635948ab63146107b05780635c3c711e146107cf575f80fd5b8063432f6ba6116102e7578063432f6ba6146106e857806344782bff1461070757806345120cd51461071b57806345e5c22e1461073a5780634f6ccce714610759575f80fd5b806336568abe146106775780633f4ba83a1461069657806342842e0e146106aa57806342966c68146106c9575f80fd5b80632121dc75116103985780632af89179116103685780632af89179146105d45780632f2ff15d146105e85780632f745c59146106075780633053baab1461062657806335f0c50414610658575f80fd5b80632121dc751461054a57806323b872dd14610568578063248a9ca31461058757806324a63ff7146105b5575f80fd5b8063091d36cc116103de578063091d36cc146104bc578063095ea7b3146104db578063174a4c6b146104fa57806318160ddd146105195780631b08542214610537575f80fd5b806301ffc9a71461040f57806304b7513f1461044357806306fdde0314610464578063081812fc14610485575b5f80fd5b34801561041a575f80fd5b5061042e610429366004613eca565b610cbd565b60405190151581526020015b60405180910390f35b34801561044e575f80fd5b5061046261045d366004613ef6565b610ccd565b005b34801561046f575f80fd5b50610478610d54565b60405161043a9190613f3d565b348015610490575f80fd5b506104a461049f366004613f4f565b610de3565b6040516001600160a01b03909116815260200161043a565b3480156104c7575f80fd5b506104626104d6366004613f4f565b610e0a565b3480156104e6575f80fd5b506104626104f5366004613f7a565b610e47565b348015610505575f80fd5b50610462610514366004613fb4565b610e56565b348015610524575f80fd5b506008545b60405190815260200161043a565b610462610545366004613fe8565b610eb2565b348015610555575f80fd5b50600f5461042e90610100900460ff1681565b348015610573575f80fd5b50610462610582366004614075565b610f58565b348015610592575f80fd5b506105296105a1366004613f4f565b5f908152600c602052604090206001015490565b3480156105c0575f80fd5b506104626105cf366004613f4f565b610f90565b3480156105df575f80fd5b50610462610fcd565b3480156105f3575f80fd5b506104626106023660046140b3565b611046565b348015610612575f80fd5b50610529610621366004613f7a565b611070565b348015610631575f80fd5b506106456106403660046140ed565b6110d3565b60405161ffff909116815260200161043a565b348015610663575f80fd5b506106456106723660046140ed565b611126565b348015610682575f80fd5b506104626106913660046140b3565b6111dc565b3480156106a1575f80fd5b5061046261120f565b3480156106b5575f80fd5b506104626106c4366004614075565b611224565b3480156106d4575f80fd5b506104626106e3366004613f4f565b61123e565b3480156106f3575f80fd5b50610462610702366004613f7a565b611249565b348015610712575f80fd5b506104626112d5565b348015610726575f80fd5b50610462610735366004614199565b611351565b348015610745575f80fd5b50610462610754366004614255565b611494565b348015610764575f80fd5b50610529610773366004613f4f565b611853565b348015610783575f80fd5b50600f5461042e9060ff1681565b34801561079c575f80fd5b506104626107ab366004614315565b6118a8565b3480156107bb575f80fd5b506104626107ca366004614390565b611927565b3480156107da575f80fd5b5061046261199a565b3480156107ee575f80fd5b50600a5460ff1661042e565b348015610805575f80fd5b506106456119b4565b348015610819575f80fd5b506104a4610828366004613f4f565b6119d5565b348015610838575f80fd5b506106456108ca81565b34801561084d575f80fd5b50600f5461042e9062010000900460ff1681565b34801561086c575f80fd5b506106456101c281565b348015610881575f80fd5b506105296108903660046143a9565b6119df565b3480156108a0575f80fd5b506104626108af366004613fb4565b611a24565b3480156108bf575f80fd5b50600f5461042e906301000000900460ff1681565b3480156108df575f80fd5b506104626108ee366004613fe8565b611a47565b3480156108fe575f80fd5b50610462611b06565b348015610912575f80fd5b50610462610921366004614390565b611b18565b348015610931575f80fd5b506106456109403660046140ed565b611b5f565b348015610950575f80fd5b5061052960115481565b348015610965575f80fd5b506104a46109743660046143c4565b611c7b565b348015610984575f80fd5b5061042e6109933660046140b3565b611c99565b3480156109a3575f80fd5b506109d26109b23660046140ed565b60156020525f908152604090208054600182015460029092015490919083565b6040805193845260208401929092529082015260600161043a565b3480156109f8575f80fd5b50610478611cc3565b348015610a0c575f80fd5b50610462611cd2565b348015610a20575f80fd5b506105295f81565b348015610a33575f80fd5b50610462610a423660046143e4565b611cec565b348015610a52575f80fd5b50610462610a61366004613fb4565b611cf7565b348015610a71575f80fd5b50610645610a803660046140ed565b611d45565b348015610a90575f80fd5b50610462611e5b565b348015610aa4575f80fd5b50610462611ef8565b610462610abb366004613fb4565b611f91565b348015610acb575f80fd5b50610462610ada36600461440e565b611f9c565b348015610aea575f80fd5b50610645610af93660046140ed565b60136020525f908152604090205461ffff1681565b348015610b19575f80fd5b50610b2d610b283660046144cb565b611fb3565b6040805161ffff93841681529290911660208301520161043a565b348015610b53575f80fd5b50610478610b62366004613f4f565b6120b6565b348015610b72575f80fd5b50610645610b813660046144f7565b60146020525f908152604090205461ffff1681565b348015610ba1575f80fd5b50610529610bb0366004613f4f565b6120ff565b348015610bc0575f80fd5b50610bd4610bcf366004613ef6565b612115565b60405161043a9190614545565b348015610bec575f80fd5b50610462610bfb3660046140b3565b612170565b348015610c0b575f80fd5b5061064561070881565b348015610c20575f80fd5b50600f5461064590640100000000900461ffff1681565b348015610c42575f80fd5b50610462610c51366004613fe8565b612194565b610462610c64366004613fe8565b612247565b348015610c74575f80fd5b5061042e610c83366004614558565b6122e3565b348015610c93575f80fd5b5061052960105481565b348015610ca8575f80fd5b506105295f8051602061495e83398151915281565b5f610cc782612310565b92915050565b5f610cd781612334565b5f8261ffff1611610d065760405163f81c8b6360e01b815261ffff831660048201526024015b60405180910390fd5b600f805465ffff00000000191664010000000061ffff8516908102919091179091556040517f75439a8539d65b7517b2d634403631b318295e9aea58930a84ad3c5878bc8a04905f90a25050565b60605f8054610d6290614584565b80601f0160208091040260200160405190810160405280929190818152602001828054610d8e90614584565b8015610dd95780601f10610db057610100808354040283529160200191610dd9565b820191905f5260205f20905b815481529060010190602001808311610dbc57829003601f168201915b5050505050905090565b5f610ded8261233e565b505f828152600460205260409020546001600160a01b0316610cc7565b5f610e1481612334565b601082905560405182907f590854cb6b0713c26af72d761c4897b229abdb0c2bc236cb056d41c2f7dbffa3905f90a25050565b610e52828233612376565b5050565b5f610e6081612334565b610e6c83600284612383565b826001600160a01b03167f1f348733d466ad55406cf108bf4c40ba1fb8c6d207c7f2831fd0c67532ce97c983604051610ea591906145b6565b60405180910390a2505050565b3360105483835f84604051602001610eca91906145f7565b604051602081830303815290604052805190602001209050610f218383808060200260200160405190810160405280939291908181526020018383602002808284375f920191909152508892508591506127bb9050565b610f415760405163247643e960e21b815260048101859052602401610cfd565b610f4d895f808b6127d0565b505050505050505050565b600f54610100900460ff16610f8057604051637413882f60e11b815260040160405180910390fd5b610f8b838383612ba2565b505050565b5f610f9a81612334565b601182905560405182907f96b02105f373345e4360215051612dd21caf0bfbb7ed1fd51ed27d607f94ed26905f90a25050565b5f610fd781612334565b600f5462010000900460ff166110005760405163ae29fa1160e01b815260040160405180910390fd5b600f805462ff00001916908190556040516201000090910460ff161515907f6426959a3505e131faf5c6155a33f73c033b28a04370820816b94ec035348f37905f90a250565b5f828152600c602052604090206001015461106081612334565b61106a8383612c25565b50505050565b5f61107a836119df565b82106110ab5760405163295f44f760e21b81526001600160a01b038416600482015260248101839052604401610cfd565b506001600160a01b03919091165f908152600660209081526040808320938352929052205490565b5f60028260038111156110e8576110e8614515565b036110f657506108ca919050565b600182600381111561110a5761110a614515565b036111185750610708919050565b506101c2919050565b919050565b5f806003815b8160ff168160ff1610156111d35760125f8260ff16600381111561115257611152614515565b600381111561116357611163614515565b600381111561117457611174614515565b81526020019081526020015f205f86600381111561119457611194614515565b60038111156111a5576111a5614515565b815260208101919091526040015f20546111c99062010000900461ffff1684614628565b925060010161112c565b50909392505050565b6001600160a01b03811633146112055760405163334bd91960e11b815260040160405180910390fd5b610f8b8282612c58565b5f61121981612334565b611221612c83565b50565b610f8b83838360405180602001604052805f815250611f9c565b610e525f8233612cd5565b5f61125381612334565b5f82116112765760405163f81c8b6360e01b815260048101839052602401610cfd565b478083111561129b57604051634e220d4160e11b815260048101829052602401610cfd565b6040516001600160a01b0385169084156108fc029085905f818181858888f193505050501580156112ce573d5f803e3d5ffd5b5050505050565b5f6112df81612334565b600f546301000000900460ff1661130957604051630cdd5a2560e11b815260040160405180910390fd5b600f805463ff000000191690819055604051630100000090910460ff161515907f682318da8fe12c73c5b69d39ed232e26a92bc1c7be0c5a19a0aae81eeb64fa15905f90a250565b5f61135b81612334565b8151600390811461138457825160405163096fd70160e21b8152600401610cfd91815260200190565b5f5b8160ff168160ff161015611463575f8160ff1660038111156113aa576113aa614515565b90505f60155f8360038111156113c2576113c2614515565b60038111156113d3576113d3614515565b81526020019081526020015f209050858360ff16815181106113f7576113f7614643565b60209081029190910101515181558551869060ff851690811061141c5761141c614643565b6020026020010151602001518160010181905550858360ff168151811061144557611445614643565b60209081029190910101516040015160029091015550600101611386565b50427f6449f923660b6ec3d7fd96f3b0a9966bac646624ff9f5de194cae25dcb0098d184604051610ea59190614657565b5f61149e81612334565b815160039081146114c757825160405163096fd70160e21b8152600401610cfd91815260200190565b5f6001600260038360ff861667ffffffffffffffff8111156114eb576114eb614108565b604051908082528060200260200182016040528015611514578160200160208202803683370190505b5090505f5b8660ff168160ff16101561176b575f8160ff16600381111561153d5761153d614515565b90505f5b8460ff168160ff161015611761575f8160ff16600381111561156557611565614515565b90505f60125f85600381111561157d5761157d614515565b600381111561158e5761158e614515565b81526020019081526020015f205f8360038111156115ae576115ae614515565b60038111156115bf576115bf614515565b815260208101919091526040015f9081205462010000900461ffff169150808360038111156115f0576115f0614515565b1461165a57600183600381111561160957611609614515565b14611634578d8660ff168151811061162357611623614643565b60200260200101516040015161167b565b8d8660ff168151811061164957611649614643565b60200260200101516020015161167b565b8d8660ff168151811061166f5761166f614643565b60200260200101515f01515b905080878760ff168151811061169357611693614643565b602002602001018181516116a79190614628565b61ffff908116909152838116908316101590506116db5784836040516380b5822d60e01b8152600401610cfd9291906146af565b8060125f8760038111156116f1576116f1614515565b600381111561170257611702614515565b81526020019081526020015f205f85600381111561172257611722614515565b600381111561173357611733614515565b815260208101919091526040015f20805461ffff191661ffff92909216919091179055505050600101611541565b5050600101611519565b505f818460ff168151811061178257611782614643565b6020026020010151828660ff168151811061179f5761179f614643565b6020026020010151838860ff16815181106117bc576117bc614643565b60200260200101516117ce9190614628565b6117d89190614628565b90506117e26119b4565b61ffff168161ffff16111561181057604051637335ad8160e01b815261ffff82166004820152602401610cfd565b427f7d82f2f3ee148b8386d1291af62ec9454213ba0735f70ff314c24b4249101bf58a60405161184091906146d5565b60405180910390a2505050505050505050565b5f61185d60085490565b82106118855760405163295f44f760e21b81525f600482015260248101839052604401610cfd565b6008828154811061189857611898614643565b905f5260205f2001549050919050565b5f6118b281612334565b81806118d45760405163f81c8b6360e01b815260048101829052602401610cfd565b600e6118e184868361476e565b5083836040516118f2929190614828565b604051908190038120907f87cdeaffd8e70903d6ce7cc983fac3b09ca79e83818124c98e47a1d70f8027d6905f90a250505050565b5f61193181612334565b600a5460ff1615611955576040516316dbf35b60e01b815260040160405180910390fd5b600f805461ff001916610100841515908102919091179091556040517f11da1b8c0a94a11df636c4bcd3500335a4f11ec00f56b0a425b3354171b2cd9a905f90a25050565b5f6119a481612334565b6119ac610fcd565b6112216112d5565b5f6108ca6119c66107086101c2614628565b6119d09190614628565b905090565b5f610cc78261233e565b5f6001600160a01b038216611a09576040516322718ad960e21b81525f6004820152602401610cfd565b506001600160a01b03165f9081526003602052604090205490565b5f8051602061495e833981519152611a3b81612334565b610f8b83600184612ce9565b5f8051602061495e833981519152611a5e81612334565b8460115484845f84604051602001611a7691906145f7565b604051602081830303815290604052805190602001209050611acd8383808060200260200160405190810160405280939291908181526020018383602002808284375f920191909152508892508591506127bb9050565b611aed5760405163247643e960e21b815260048101859052602401610cfd565b611afa8a6001808c6127d0565b50505050505050505050565b5f611b1081612334565b6112216130a2565b5f611b2281612334565b600f805460ff19168315159081179091556040517f4a9768f4a343b5cd5d5319e6fe71e839c384e1f67a57e74631919d50c5d4d953905f90a25050565b5f81611b6b8233611c99565b158015611b8c5750611b8a5f8051602061495e83398151915233611c99565b155b8015611ba957505f816003811115611ba657611ba6614515565b14155b15611bc95780604051630a2cd25960e41b8152600401610cfd9190614545565b5f6003815b8160ff168160ff161015611c6f5760125f876003811115611bf157611bf1614515565b6003811115611c0257611c02614515565b81526020019081526020015f205f8260ff166003811115611c2557611c25614515565b6003811115611c3657611c36614515565b6003811115611c4757611c47614515565b815260208101919091526040015f2054611c659061ffff1684614628565b9250600101611bce565b50909250505b50919050565b5f828152600d60205260408120611c9290836130df565b9392505050565b5f918252600c602090815260408084206001600160a01b0393909316845291905290205460ff1690565b606060018054610d6290614584565b5f611cdc81612334565b611ce4611ef8565b611221611e5b565b610e523383836130ea565b5f611d0181612334565b611d0c835f84612383565b826001600160a01b03167f1b444e34d17e949111d45c65bf5460a1c3e0d4c527cdc36795debaaed950f12383604051610ea591906145b6565b5f81611d518233611c99565b158015611d725750611d705f8051602061495e83398151915233611c99565b155b8015611d8f57505f816003811115611d8c57611d8c614515565b14155b15611daf5780604051630a2cd25960e41b8152600401610cfd9190614545565b5f6003815b8160ff168160ff161015611c6f5760125f876003811115611dd757611dd7614515565b6003811115611de857611de8614515565b81526020019081526020015f205f8260ff166003811115611e0b57611e0b614515565b6003811115611e1c57611e1c614515565b6003811115611e2d57611e2d614515565b815260208101919091526040015f2054611e519062010000900461ffff1684614628565b9250600101611db4565b5f611e6581612334565b600f546301000000900460ff1615611e9057604051633167ae1760e21b815260040160405180910390fd5b600f805463ff00000019166301000000179055611eaf600a5460ff1690565b611ebc57611ebc5f611927565b600f54604051630100000090910460ff161515907f682318da8fe12c73c5b69d39ed232e26a92bc1c7be0c5a19a0aae81eeb64fa15905f90a250565b5f611f0281612334565b600f5462010000900460ff1615611f2c57604051637d43dda360e01b815260040160405180910390fd5b600f805462ff0000191662010000179055611f49600a5460ff1690565b611f5657611f565f611927565b600f546040516201000090910460ff161515907f6426959a3505e131faf5c6155a33f73c033b28a04370820816b94ec035348f37905f90a250565b610e52825f83612ce9565b611fa7848484610f58565b61106a84848484613188565b5f8083611fc08233611c99565b158015611fe15750611fdf5f8051602061495e83398151915233611c99565b155b8015611ffe57505f816003811115611ffb57611ffb614515565b14155b1561201e5780604051630a2cd25960e41b8152600401610cfd9190614545565b5f60125f87600381111561203457612034614515565b600381111561204557612045614515565b81526020019081526020015f205f86600381111561206557612065614515565b600381111561207657612076614515565b815260208082019290925260409081015f2081518083019092525461ffff8082168084526201000090920416919092018190529097909650945050505050565b600f5460609060ff16156120d2576120cd826132a7565b610cc7565b6120da61330b565b6040516020016120ea919061484e565b60405160208183030381529060405292915050565b5f818152600d60205260408120610cc79061331a565b5f6107086121266101c26001614628565b6121309190614628565b61ffff168261ffff161061214657506002919050565b6121536101c26001614628565b61ffff168261ffff161061216957506001919050565b505f919050565b5f828152600c602052604090206001015461218a81612334565b61106a8383612c58565b5f8051602061495e8339815191526121ab81612334565b8460105484845f846040516020016121c391906145f7565b60405160208183030381529060405280519060200120905061221a8383808060200260200160405190810160405280939291908181526020018383602002808284375f920191909152508892508591506127bb9050565b61223a5760405163247643e960e21b815260048101859052602401610cfd565b611afa8a5f60018c6127d0565b3360115483835f8460405160200161225f91906145f7565b6040516020818303038152906040528051906020012090506122b68383808060200260200160405190810160405280939291908181526020018383602002808284375f920191909152508892508591506127bb9050565b6122d65760405163247643e960e21b815260048101859052602401610cfd565b610f4d8960015f8b6127d0565b6001600160a01b039182165f90815260056020908152604080832093909416825291909152205460ff1690565b5f6001600160e01b03198216635a05180f60e01b1480610cc75750610cc782613323565b6112218133613347565b5f818152600260205260408120546001600160a01b031680610cc757604051637e27328960e01b815260048101849052602401610cfd565b610f8b8383836001613380565b61238b613484565b5f61239c6060830160408401613ef6565b6123ac6040840160208501613ef6565b6123b96020850185613ef6565b6123c39190614628565b6123cd9190614628565b90505f60125f8560038111156123e5576123e5614515565b60038111156123f6576123f6614515565b815260208082019290925260409081015f908120818052928390528181206001825282822060028352928220805484548354969750929591939261ffff91821692612445929182169116614628565b61244f9190614628565b8254845486549293505f9261ffff6201000093849004811693612479938190048216920416614628565b6124839190614628565b90505f8761ffff16116124af5760405163f81c8b6360e01b815261ffff88166004820152602401610cfd565b5f8761ffff166124be60085490565b6124c8919061486a565b90506124d26119b4565b61ffff168111156124fc57604051637335ad8160e01b815261ffff82166004820152602401610cfd565b61ffff831661250b8984614628565b61ffff161115612530578960405163c0a8f6a760e01b8152600401610cfd9190614545565b60408051808201909152865461ffff8082168352620100009091041660208083019190915261256c915f91612567908d018d613ef6565b6134ae565b604080518082018252865461ffff808216835262010000909104166020808301919091526125a69260019291612567918e01908e01613ef6565b604080518082018252855461ffff8082168352620100009091041660208201526125de91600291906125679060608e01908e01613ef6565b5f5b6125ed60208b018b613ef6565b61ffff168161ffff161015612630576126288c8261260a5f611126565b612615906001614628565b61261f9190614628565b61ffff1661350b565b6001016125e0565b505f5b61264360408b0160208c01613ef6565b61ffff168161ffff161015612680576126788c826126616001611126565b61266e6101c26001614628565b6126159190614628565b600101612633565b505f5b61269360608b0160408c01613ef6565b61ffff168161ffff1610156126d3576126cb8c826126b16002611126565b6107086126c16101c26001614628565b61266e9190614628565b600101612683565b506126e160208a018a613ef6565b865487906002906126fd90849062010000900461ffff16614628565b92506101000a81548161ffff021916908361ffff16021790555088602001602081019061272a9190613ef6565b8554869060029061274690849062010000900461ffff16614628565b92506101000a81548161ffff021916908361ffff1602179055508860400160208101906127739190613ef6565b8454859060029061278f90849062010000900461ffff16614628565b92506101000a81548161ffff021916908361ffff1602179055505050505050505050610f8b6001600b55565b5f826127c78584613524565b14949350505050565b838383835f6127e56060830160408401613ef6565b6127f56040840160208501613ef6565b6128026020850185613ef6565b61280c9190614628565b6128169190614628565b90505f84600381111561282b5761282b614515565b14806128485750600184600381111561284657612846614515565b145b61285e57600f5462010000900460ff161561286d565b600f546301000000900460ff16155b1561288d57836040516319de26a560e31b8152600401610cfd9190614545565b600f5461ffff640100000000909104811690821611156128c557604051627e547160e21b815261ffff82166004820152602401610cfd565b5f8360018111156128d8576128d8614515565b03612a15575f6128ee6060840160408501613ef6565b61ffff1660155f87600381111561290757612907614515565b600381111561291857612918614515565b81526020019081526020015f2060020154612933919061487d565b6129436040850160208601613ef6565b61ffff1660155f88600381111561295c5761295c614515565b600381111561296d5761296d614515565b81526020019081526020015f2060010154612988919061487d565b6129956020860186613ef6565b61ffff1660155f8960038111156129ae576129ae614515565b60038111156129bf576129bf614515565b81526020019081526020015f205f01546129d9919061487d565b6129e3919061486a565b6129ed919061486a565b9050803414612a13578481604051632f82164760e21b8152600401610cfd929190614894565b505b612a2189600188612383565b5f612a326060880160408901613ef6565b612a426040890160208a01613ef6565b612a4f60208a018a613ef6565b612a599190614628565b612a639190614628565b90508060135f8b6003811115612a7b57612a7b614515565b6003811115612a8c57612a8c614515565b815260208101919091526040015f9081208054909190612ab190849061ffff16614628565b92506101000a81548161ffff021916908361ffff1602179055508060145f8a6001811115612ae157612ae1614515565b6001811115612af257612af2614515565b815260208101919091526040015f9081208054909190612b1790849061ffff16614628565b92506101000a81548161ffff021916908361ffff160217905550876001811115612b4357612b43614515565b896003811115612b5557612b55614515565b8b6001600160a01b03167f347787cc15f69c94f529b27df8daea72784a9250b3b6e1b941adf2e39f1869838a604051612b8e91906145b6565b60405180910390a450505050505050505050565b6001600160a01b038216612bcb57604051633250574960e11b81525f6004820152602401610cfd565b5f612bd7838333612cd5565b9050836001600160a01b0316816001600160a01b03161461106a576040516364283d7b60e01b81526001600160a01b0380861660048301526024820184905282166044820152606401610cfd565b5f80612c31848461355e565b90508015611c92575f848152600d60205260409020612c5090846135ef565b509392505050565b5f80612c648484613603565b90508015611c92575f848152600d60205260409020612c50908461366e565b612c8b613682565b600a805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b5f612ce18484846136a7565b949350505050565b82600283835f612cff6060830160408401613ef6565b612d0f6040840160208501613ef6565b612d1c6020850185613ef6565b612d269190614628565b612d309190614628565b90505f846003811115612d4557612d45614515565b1480612d6257506001846003811115612d6057612d60614515565b145b612d7857600f5462010000900460ff1615612d87565b600f546301000000900460ff16155b15612da757836040516319de26a560e31b8152600401610cfd9190614545565b600f5461ffff64010000000090910481169082161115612ddf57604051627e547160e21b815261ffff82166004820152602401610cfd565b5f836001811115612df257612df2614515565b03612f2f575f612e086060840160408501613ef6565b61ffff1660155f876003811115612e2157612e21614515565b6003811115612e3257612e32614515565b81526020019081526020015f2060020154612e4d919061487d565b612e5d6040850160208601613ef6565b61ffff1660155f886003811115612e7657612e76614515565b6003811115612e8757612e87614515565b81526020019081526020015f2060010154612ea2919061487d565b612eaf6020860186613ef6565b61ffff1660155f896003811115612ec857612ec8614515565b6003811115612ed957612ed9614515565b81526020019081526020015f205f0154612ef3919061487d565b612efd919061486a565b612f07919061486a565b9050803414612f2d578481604051632f82164760e21b8152600401610cfd929190614894565b505b612f3b88600188612383565b5f612f4c6060880160408901613ef6565b612f5c6040890160208a01613ef6565b612f6960208a018a613ef6565b612f739190614628565b612f7d9190614628565b60025f90815260136020527f0b9d2c0c271bb30544eb78c59bdaebdae2728e5f65814c07768a0abe90ed192380549293508392909190612fc290849061ffff16614628565b92506101000a81548161ffff021916908361ffff1602179055508060145f8a6001811115612ff257612ff2614515565b600181111561300357613003614515565b815260208101919091526040015f908120805490919061302890849061ffff16614628565b92506101000a81548161ffff021916908361ffff16021790555087600181111561305457613054614515565b60028a6001600160a01b03167f347787cc15f69c94f529b27df8daea72784a9250b3b6e1b941adf2e39f1869838a60405161308f91906145b6565b60405180910390a4505050505050505050565b6130aa6136bb565b600a805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258612cb83390565b5f611c9283836136df565b6001600160a01b03821661311c57604051630b61174360e31b81526001600160a01b0383166004820152602401610cfd565b6001600160a01b038381165f81815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6001600160a01b0383163b1561106a57604051630a85bd0160e11b81526001600160a01b0384169063150b7a02906131ca9033908890879087906004016148ab565b6020604051808303815f875af1925050508015613204575060408051601f3d908101601f19168201909252613201918101906148e7565b60015b61326b573d808015613231576040519150601f19603f3d011682016040523d82523d5f602084013e613236565b606091505b5080515f0361326357604051633250574960e11b81526001600160a01b0385166004820152602401610cfd565b805181602001fd5b6001600160e01b03198116630a85bd0160e11b146112ce57604051633250574960e11b81526001600160a01b0385166004820152602401610cfd565b60606132b28261233e565b505f6132bc61330b565b90505f8151116132da5760405180602001604052805f815250611c92565b806132e484613705565b6040516020016132f5929190614902565b6040516020818303038152906040529392505050565b6060600e8054610d6290614584565b5f610cc7825490565b5f6001600160e01b03198216637965db0b60e01b1480610cc75750610cc782613795565b6133518282611c99565b610e525760405163e2517d3f60e01b81526001600160a01b038216600482015260248101839052604401610cfd565b808061339457506001600160a01b03821615155b15613455575f6133a38461233e565b90506001600160a01b038316158015906133cf5750826001600160a01b0316816001600160a01b031614155b80156133e257506133e081846122e3565b155b1561340b5760405163a9fbf51f60e01b81526001600160a01b0384166004820152602401610cfd565b81156134535783856001600160a01b0316826001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45b505b50505f90815260046020526040902080546001600160a01b0319166001600160a01b0392909216919091179055565b6002600b54036134a757604051633ee5aeb560e01b815260040160405180910390fd5b6002600b55565b5f8183602001516134bf9190614628565b9050825f015161ffff168161ffff1611806134e957506134de846110d3565b61ffff168161ffff16115b1561106a5783816040516318a2209d60e01b8152600401610cfd929190614916565b610e52828260405180602001604052805f8152506137b9565b5f81815b8451811015612c50576135548286838151811061354757613547614643565b60200260200101516137cf565b9150600101613528565b5f6135698383611c99565b6135e8575f838152600c602090815260408083206001600160a01b03861684529091529020805460ff191660011790556135a03390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a4506001610cc7565b505f610cc7565b5f611c92836001600160a01b0384166137fb565b5f61360e8383611c99565b156135e8575f838152600c602090815260408083206001600160a01b0386168085529252808320805460ff1916905551339286917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a4506001610cc7565b5f611c92836001600160a01b038416613840565b600a5460ff166136a557604051638dfc202b60e01b815260040160405180910390fd5b565b5f6136b06136bb565b612ce184848461392a565b600a5460ff16156136a55760405163d93c066560e01b815260040160405180910390fd5b5f825f0182815481106136f4576136f4614643565b905f5260205f200154905092915050565b60605f613711836139f5565b60010190505f8167ffffffffffffffff81111561373057613730614108565b6040519080825280601f01601f19166020018201604052801561375a576020820181803683370190505b5090508181016020015b5f19016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a850494508461376457509392505050565b5f6001600160e01b0319821663780e9d6360e01b1480610cc75750610cc782613acc565b6137c38383613b1b565b610f8b5f848484613188565b5f8183106137e9575f828152602084905260409020611c92565b5f838152602083905260409020611c92565b5f8181526001830160205260408120546135e857508154600181810184555f848152602080822090930184905584548482528286019093526040902091909155610cc7565b5f818152600183016020526040812054801561391a575f613862600183614936565b85549091505f9061387590600190614936565b90508082146138d4575f865f01828154811061389357613893614643565b905f5260205f200154905080875f0184815481106138b3576138b3614643565b5f918252602080832090910192909255918252600188019052604090208390555b85548690806138e5576138e5614949565b600190038181905f5260205f20015f90559055856001015f8681526020019081526020015f205f905560019350505050610cc7565b5f915050610cc7565b5092915050565b5f80613937858585613b7c565b90506001600160a01b0381166139935761398e84600880545f838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b6139b6565b846001600160a01b0316816001600160a01b0316146139b6576139b68185613c6e565b6001600160a01b0385166139d2576139cd84613cfb565b612ce1565b846001600160a01b0316816001600160a01b031614612ce157612ce18585613da2565b5f8072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b8310613a335772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310613a5f576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc100008310613a7d57662386f26fc10000830492506010015b6305f5e1008310613a95576305f5e100830492506008015b6127108310613aa957612710830492506004015b60648310613abb576064830492506002015b600a8310610cc75760010192915050565b5f6001600160e01b031982166380ac58cd60e01b1480613afc57506001600160e01b03198216635b5e139f60e01b145b80610cc757506301ffc9a760e01b6001600160e01b0319831614610cc7565b6001600160a01b038216613b4457604051633250574960e11b81525f6004820152602401610cfd565b5f613b5083835f612cd5565b90506001600160a01b03811615610f8b576040516339e3563760e11b81525f6004820152602401610cfd565b5f828152600260205260408120546001600160a01b0390811690831615613ba857613ba8818486613df0565b6001600160a01b03811615613be257613bc35f855f80613380565b6001600160a01b0381165f90815260036020526040902080545f190190555b6001600160a01b03851615613c10576001600160a01b0385165f908152600360205260409020805460010190555b5f8481526002602052604080822080546001600160a01b0319166001600160a01b0389811691821790925591518793918516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4949350505050565b5f613c78836119df565b5f83815260076020526040902054909150808214613cc9576001600160a01b0384165f9081526006602090815260408083208584528252808320548484528184208190558352600790915290208190555b505f9182526007602090815260408084208490556001600160a01b039094168352600681528383209183525290812055565b6008545f90613d0c90600190614936565b5f8381526009602052604081205460088054939450909284908110613d3357613d33614643565b905f5260205f20015490508060088381548110613d5257613d52614643565b5f918252602080832090910192909255828152600990915260408082208490558582528120556008805480613d8957613d89614949565b600190038181905f5260205f20015f9055905550505050565b5f6001613dae846119df565b613db89190614936565b6001600160a01b039093165f908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b613dfb838383613e54565b610f8b576001600160a01b038316613e2957604051637e27328960e01b815260048101829052602401610cfd565b60405163177e802f60e01b81526001600160a01b038316600482015260248101829052604401610cfd565b5f6001600160a01b03831615801590612ce15750826001600160a01b0316846001600160a01b03161480613e8d5750613e8d84846122e3565b80612ce15750505f908152600460205260409020546001600160a01b03908116911614919050565b6001600160e01b031981168114611221575f80fd5b5f60208284031215613eda575f80fd5b8135611c9281613eb5565b803561ffff81168114611121575f80fd5b5f60208284031215613f06575f80fd5b611c9282613ee5565b5f81518084528060208401602086015e5f602082860101526020601f19601f83011685010191505092915050565b602081525f611c926020830184613f0f565b5f60208284031215613f5f575f80fd5b5035919050565b6001600160a01b0381168114611221575f80fd5b5f8060408385031215613f8b575f80fd5b8235613f9681613f66565b946020939093013593505050565b5f60608284031215611c75575f80fd5b5f8060808385031215613fc5575f80fd5b8235613fd081613f66565b9150613fdf8460208501613fa4565b90509250929050565b5f805f8060a08587031215613ffb575f80fd5b843561400681613f66565b93506140158660208701613fa4565b9250608085013567ffffffffffffffff80821115614031575f80fd5b818701915087601f830112614044575f80fd5b813581811115614052575f80fd5b8860208260051b8501011115614066575f80fd5b95989497505060200194505050565b5f805f60608486031215614087575f80fd5b833561409281613f66565b925060208401356140a281613f66565b929592945050506040919091013590565b5f80604083850312156140c4575f80fd5b8235915060208301356140d681613f66565b809150509250929050565b60048110611221575f80fd5b5f602082840312156140fd575f80fd5b8135611c92816140e1565b634e487b7160e01b5f52604160045260245ffd5b6040516060810167ffffffffffffffff8111828210171561413f5761413f614108565b60405290565b604051601f8201601f1916810167ffffffffffffffff8111828210171561416e5761416e614108565b604052919050565b5f67ffffffffffffffff82111561418f5761418f614108565b5060051b60200190565b5f60208083850312156141aa575f80fd5b823567ffffffffffffffff8111156141c0575f80fd5b8301601f810185136141d0575f80fd5b80356141e36141de82614176565b614145565b81815260609182028301840191848201919088841115614201575f80fd5b938501935b838510156142495780858a03121561421c575f80fd5b61422461411c565b8535815286860135878201526040808701359082015283529384019391850191614206565b50979650505050505050565b5f6020808385031215614266575f80fd5b823567ffffffffffffffff81111561427c575f80fd5b8301601f8101851361428c575f80fd5b803561429a6141de82614176565b818152606091820283018401918482019190888411156142b8575f80fd5b938501935b838510156142495780858a0312156142d3575f80fd5b6142db61411c565b6142e486613ee5565b81526142f1878701613ee5565b878201526040614302818801613ee5565b90820152835293840193918501916142bd565b5f8060208385031215614326575f80fd5b823567ffffffffffffffff8082111561433d575f80fd5b818501915085601f830112614350575f80fd5b81358181111561435e575f80fd5b86602082850101111561436f575f80fd5b60209290920196919550909350505050565b80358015158114611121575f80fd5b5f602082840312156143a0575f80fd5b611c9282614381565b5f602082840312156143b9575f80fd5b8135611c9281613f66565b5f80604083850312156143d5575f80fd5b50508035926020909101359150565b5f80604083850312156143f5575f80fd5b823561440081613f66565b9150613fdf60208401614381565b5f805f8060808587031215614421575f80fd5b843561442c81613f66565b935060208581013561443d81613f66565b935060408601359250606086013567ffffffffffffffff80821115614460575f80fd5b818801915088601f830112614473575f80fd5b81358181111561448557614485614108565b614497601f8201601f19168501614145565b915080825289848285010111156144ac575f80fd5b80848401858401375f8482840101525080935050505092959194509250565b5f80604083850312156144dc575f80fd5b82356144e7816140e1565b915060208301356140d6816140e1565b5f60208284031215614507575f80fd5b813560028110611c92575f80fd5b634e487b7160e01b5f52602160045260245ffd5b6004811061122157634e487b7160e01b5f52602160045260245ffd5b6020810161455283614529565b91905290565b5f8060408385031215614569575f80fd5b823561457481613f66565b915060208301356140d681613f66565b600181811c9082168061459857607f821691505b602082108103611c7557634e487b7160e01b5f52602260045260245ffd5b6060810161ffff806145c785613ee5565b168352806145d760208601613ee5565b166020840152806145ea60408601613ee5565b1660408401525092915050565b60609190911b6bffffffffffffffffffffffff1916815260140190565b634e487b7160e01b5f52601160045260245ffd5b61ffff81811683821601908082111561392357613923614614565b634e487b7160e01b5f52603260045260245ffd5b602080825282518282018190525f919060409081850190868401855b828110156146a25781518051855286810151878601528501518585015260609093019290850190600101614673565b5091979650505050505050565b604081016146bc84614529565b8382526146c883614529565b8260208301529392505050565b602080825282518282018190525f919060409081850190868401855b828110156146a2578151805161ffff908116865287820151811688870152908601511685850152606090930192908501906001016146f1565b601f821115610f8b57805f5260205f20601f840160051c8101602085101561474f5750805b601f840160051c820191505b818110156112ce575f815560010161475b565b67ffffffffffffffff83111561478657614786614108565b61479a836147948354614584565b8361472a565b5f601f8411600181146147cb575f85156147b45750838201355b5f19600387901b1c1916600186901b1783556112ce565b5f83815260208120601f198716915b828110156147fa57868501358255602094850194600190920191016147da565b5086821015614816575f1960f88860031b161c19848701351681555b505060018560011b0183555050505050565b818382375f9101908152919050565b5f81518060208401855e5f93019283525090919050565b5f6148598284614837565b600360fc1b81526001019392505050565b80820180821115610cc757610cc7614614565b8082028115828204841417610cc757610cc7614614565b604081016148a184614529565b9281526020015290565b6001600160a01b03858116825284166020820152604081018390526080606082018190525f906148dd90830184613f0f565b9695505050505050565b5f602082840312156148f7575f80fd5b8151611c9281613eb5565b5f612ce16149108386614837565b84614837565b6040810161492384614529565b92815261ffff9190911660209091015290565b81810381811115610cc757610cc7614614565b634e487b7160e01b5f52603160045260245ffdfef237a3914cf3729e619b7739f6c267bba89e97613304c66915c29f71360f800ea264697066735822122013efa660a1cecc2efcb810caefc606658bdbd6e2d492ac221614b443debc626664736f6c63430008190033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000e0a784c9bf2c73e53798d99a27482fd4d024ee6400000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000006400000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000220000000000000000000000000000000000000000000000000000000000000000c697066733a2f2f787878782f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000003200000000000000000000000000000000000000000000000000000000000000c800000000000000000000000000000000000000000000000000000000000000fa0000000000000000000000000000000000000000000000000000000000000190000000000000000000000000000000000000000000000000000000000000064000000000000000000000000000000000000000000000000000000000000007d0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000d529ae9e8600000000000000000000000000000000000000000000000000000098c445ad578000000000000000000000000000000000000000000000000000005c5edcbc29000000000000000000000000000000000000000000000000000000e35fa931a0000000000000000000000000000000000000000000000000000000a36cc19bab0000000000000000000000000000000000000000000000000000006379da05b6000000000000000000000000000000000000000000000000000000ee08251ff3800000000000000000000000000000000000000000000000000000aa87bee538000000000000000000000000000000000000000000000000000000670758aa7c8000
-----Decoded View---------------
Arg [0] : krwMinter (address): 0xe0a784c9bF2C73e53798d99a27482FD4d024eE64
Arg [1] : metadataBaseURI (string): ipfs://xxxx/
Arg [2] : maxAmountCanBeMintedAtOnce_ (uint16): 100
Arg [3] : maxSupplyInfo (tuple[]): System.Collections.Generic.List`1[Nethereum.ABI.FunctionEncoding.ParameterOutput],System.Collections.Generic.List`1[Nethereum.ABI.FunctionEncoding.ParameterOutput],System.Collections.Generic.List`1[Nethereum.ABI.FunctionEncoding.ParameterOutput]
Arg [4] : ethSalePricesInWeiBySaleType (tuple[]): System.Collections.Generic.List`1[Nethereum.ABI.FunctionEncoding.ParameterOutput],System.Collections.Generic.List`1[Nethereum.ABI.FunctionEncoding.ParameterOutput],System.Collections.Generic.List`1[Nethereum.ABI.FunctionEncoding.ParameterOutput]
-----Encoded View---------------
27 Constructor Arguments found :
Arg [0] : 000000000000000000000000e0a784c9bf2c73e53798d99a27482fd4d024ee64
Arg [1] : 00000000000000000000000000000000000000000000000000000000000000a0
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000064
Arg [3] : 00000000000000000000000000000000000000000000000000000000000000e0
Arg [4] : 0000000000000000000000000000000000000000000000000000000000000220
Arg [5] : 000000000000000000000000000000000000000000000000000000000000000c
Arg [6] : 697066733a2f2f787878782f0000000000000000000000000000000000000000
Arg [7] : 0000000000000000000000000000000000000000000000000000000000000003
Arg [8] : 0000000000000000000000000000000000000000000000000000000000000032
Arg [9] : 00000000000000000000000000000000000000000000000000000000000000c8
Arg [10] : 00000000000000000000000000000000000000000000000000000000000000fa
Arg [11] : 0000000000000000000000000000000000000000000000000000000000000190
Arg [12] : 0000000000000000000000000000000000000000000000000000000000000640
Arg [13] : 00000000000000000000000000000000000000000000000000000000000007d0
Arg [14] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [15] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [16] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [17] : 0000000000000000000000000000000000000000000000000000000000000003
Arg [18] : 00000000000000000000000000000000000000000000000000d529ae9e860000
Arg [19] : 0000000000000000000000000000000000000000000000000098c445ad578000
Arg [20] : 000000000000000000000000000000000000000000000000005c5edcbc290000
Arg [21] : 00000000000000000000000000000000000000000000000000e35fa931a00000
Arg [22] : 00000000000000000000000000000000000000000000000000a36cc19bab0000
Arg [23] : 000000000000000000000000000000000000000000000000006379da05b60000
Arg [24] : 00000000000000000000000000000000000000000000000000ee08251ff38000
Arg [25] : 00000000000000000000000000000000000000000000000000aa87bee5380000
Arg [26] : 00000000000000000000000000000000000000000000000000670758aa7c8000
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.