Token
DOUDOCOINNFT (DOUDO)
ERC-721
Overview
Max Total Supply
15 DOUDO
Holders
11
Market
Onchain Market Cap
$0.00
Circulating Supply Market Cap
-
Other Info
Token Contract
Balance
1 DOUDOLoading...
Loading
Loading...
Loading
Loading...
Loading
Contract Name:
DOUDOCOINNFT
Compiler Version
v0.8.20+commit.a1b79de6
Optimization Enabled:
Yes with 200 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT // Compatible with OpenZeppelin Contracts ^5.0.0 pragma solidity ^0.8.20; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol"; import "@openzeppelin/contracts/access/AccessControl.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; // 首先,確保您的 rewardToken 合約有一個 mint 函數 interface IDOUDOCOIN is IERC20 { function mint(address to, uint256 amount) external returns (bool); } contract DOUDOCOINNFT is ERC721, ERC721Enumerable, ERC721Burnable, AccessControl { using Counters for Counters.Counter; Counters.Counter private _tokenIds; struct VoucherType { uint256 amount; // The value of this voucher type in tokens uint256 maxPerUser; // Maximum number of this type a user can purchase string tokenURI; // The token URI for this voucher type } struct UserInfo { uint256 totalRedeemed; // Total amount of tokens redeemed uint256 currentRoundRedeemed; // Amount of tokens redeemed in the current round uint256 membershipLevel; // Current membership level of the user (index) uint256 membershipNFT; // ID of the membership NFT the user owns uint256 lastActiveTimestamp; // Last active timestamp (last time user redeemed) } struct MembershipLevel { string name; // Membership level name uint256 threshold; // Cumulative consumption threshold to reach this level string membershipTokenURI; // URI for the membership NFT uint256 rewardBasisPoints; // Additional reward percentage when burning vouchers } // Membership expiration period (e.g., 6 months = 180 days * 24 hours * 60 minutes * 60 seconds) uint256 public membershipExpirationPeriod = 180 days; // Mapping of token ID to voucher type ID mapping(uint256 => uint256) public voucherTypeIds; // Mapping of token ID to membership status (only for membership NFTs) mapping(uint256 => bool) public isMembershipNFT; // Mapping of user address to their voucher purchases and redemption history mapping(address => UserInfo) public userInfo; // Mapping of voucher type ID to VoucherType details mapping(uint256 => VoucherType) public voucherTypes; // Token contract for rewards (ERC20) IDOUDOCOIN public rewardToken; // List of membership levels and their thresholds MembershipLevel[] public membershipLevels; uint256 public nextVoucherTypeId = 0; // Roles bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE"); event VoucherTypeCreated( uint256 voucherTypeId, uint256 amount, uint256 maxPerUser, string tokenURI ); event VoucherTypeUpdated( uint256 voucherTypeId, uint256 amount, uint256 maxPerUser, string tokenURI ); event VoucherMinted( uint256 tokenId, address recipient, uint256 voucherTypeId ); event VoucherTotalRedeemed( uint256[] tokenIds, address redeemer, uint256 totalAmount, uint256 additionalReward ); event VoucherTransferred(address from, address to, uint256 tokenId); event MembershipLevelCreated( uint256 levelIndex, string name, uint256 threshold, string membershipTokenURI, uint256 rewardBasisPoints ); event MembershipLevelUpdated( uint256 levelIndex, uint256 threshold, string membershipTokenURI, uint256 rewardBasisPoints ); event MembershipUpgraded( address user, uint256 tokenId, uint256 level, string levelName ); event MembershipNFTBurned(address user, uint256 tokenId); event MembershipExpired(address user, uint256 tokenId); event MembershipTransferred( address from, address to, uint256 tokenId, string levelName ); event MembershipRenewed( address user, uint256 tokenId, uint256 newExpiryDate ); event VouchersIssuedFromSubscription( address indexed user, uint256[] voucherTypeIds, uint256[] amounts, uint256 totalAmount ); constructor( address rewardTokenAddress, address defaultAdmin, address minter ) ERC721("DOUDOCOINNFT", "DOUDO") { rewardToken = IDOUDOCOIN(rewardTokenAddress); _grantRole(DEFAULT_ADMIN_ROLE, defaultAdmin); _grantRole(MINTER_ROLE, minter); // Add a "No Membership" level _addMembershipLevel("NonMembership", 0, "", 0); _addMembershipLevel( "Common", 1, "https://lime-basic-thrush-351.mypinata.cloud/ipfs/QmTMMQCWK1vVXyo7NCZQawRY7wBQPrmbpgvyqehLxxKJAL/common.json", 0 ); // Now add the other levels _addMembershipLevel( "Silver", 10000 ether, "https://lime-basic-thrush-351.mypinata.cloud/ipfs/QmTMMQCWK1vVXyo7NCZQawRY7wBQPrmbpgvyqehLxxKJAL/sliver.json", 100 ); // 1% additional reward (100 basis points) _addMembershipLevel( "Gold", 50000 ether, "https://lime-basic-thrush-351.mypinata.cloud/ipfs/QmTMMQCWK1vVXyo7NCZQawRY7wBQPrmbpgvyqehLxxKJAL/gold.json", 150 ); // 1.5% additional reward (150 basis points) _addMembershipLevel( "Platinum", 100000 ether, "https://lime-basic-thrush-351.mypinata.cloud/ipfs/QmTMMQCWK1vVXyo7NCZQawRY7wBQPrmbpgvyqehLxxKJAL/Platinum.json", 300 ); // 3% additional reward (300 basis points) } // Admin function to create a new voucher type with specific amount, purchase limit, and tokenURI function createVoucherType( uint256 amount, uint256 maxPerUser, string memory _tokenURI ) external onlyRole(DEFAULT_ADMIN_ROLE) { voucherTypes[nextVoucherTypeId] = VoucherType( amount, maxPerUser, _tokenURI ); emit VoucherTypeCreated( nextVoucherTypeId, amount, maxPerUser, _tokenURI ); nextVoucherTypeId++; } function updateVoucherType( uint256 voucherTypeId, uint256 amount, uint256 maxPerUser, string memory _tokenURI ) external onlyRole(DEFAULT_ADMIN_ROLE) { voucherTypes[voucherTypeId] = VoucherType( amount, maxPerUser, _tokenURI ); emit VoucherTypeUpdated(voucherTypeId, amount, maxPerUser, _tokenURI); } // Override the tokenURI function to return the specific URI for each voucher type or membership level function tokenURI( uint256 tokenId ) public view override returns (string memory) { if (isMembershipNFT[tokenId]) { uint256 membershipLevel = userInfo[msg.sender].membershipLevel; return membershipLevels[membershipLevel].membershipTokenURI; } uint256 voucherTypeId = voucherTypeIds[tokenId]; return voucherTypes[voucherTypeId].tokenURI; } // 鑄造普通 voucher 的函數 function mintVouchers( address to, uint256[] memory _voucherTypeIds, uint256[] memory quantities ) public onlyRole(MINTER_ROLE) { require( _voucherTypeIds.length == quantities.length, "Mismatched inputs" ); for (uint256 i = 0; i < _voucherTypeIds.length; i++) { uint256 voucherTypeId = _voucherTypeIds[i]; uint256 quantity = quantities[i]; require(voucherTypeId < nextVoucherTypeId, "Invalid voucher type"); uint256 userVoucherCount = getUserVoucherCount(to, voucherTypeId); require( userVoucherCount + quantity <= voucherTypes[voucherTypeId].maxPerUser, "Exceeds max vouchers per user" ); for (uint256 j = 0; j < quantity; j++) { _tokenIds.increment(); uint256 tokenId = _tokenIds.current(); _safeMint(to, tokenId); voucherTypeIds[tokenId] = voucherTypeId; emit VoucherMinted(tokenId, to, voucherTypeId); } updateUserVoucherCount(to, voucherTypeId, quantity); } } // 鑄造會員 NFT 的函數 function mintMembershipNFT( address to, uint256 membershipLevel ) public onlyRole(MINTER_ROLE) { require( userInfo[to].membershipNFT == 0, "User already owns a membership NFT" ); require( membershipLevel < membershipLevels.length, "Invalid membership level" ); // 更新用戶的累積消費金額為該等級的門檻 uint256 requiredThreshold = membershipLevels[membershipLevel].threshold; userInfo[to].currentRoundRedeemed = requiredThreshold; userInfo[to].totalRedeemed = requiredThreshold; userInfo[to].lastActiveTimestamp = block.timestamp; // 設置最後活動時間 _tokenIds.increment(); uint256 tokenId = _tokenIds.current(); _safeMint(to, tokenId); isMembershipNFT[tokenId] = true; userInfo[to].membershipNFT = tokenId; userInfo[to].membershipLevel = membershipLevel; emit MembershipUpgraded( to, tokenId, membershipLevel, membershipLevels[membershipLevel].name ); } // 輔助函數 function getUserVoucherCount( address user, uint256 voucherTypeId ) public view returns (uint256) { return userVoucherCounts[user][voucherTypeId]; } function updateUserVoucherCount( address user, uint256 voucherTypeId, uint256 quantity ) internal { userVoucherCounts[user][voucherTypeId] += quantity; } // 新增映射來追踪用戶每種 voucher 的數量 mapping(address => mapping(uint256 => uint256)) private userVoucherCounts; // Override safeTransferFrom to handle membership or voucher transfer function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory _data ) public override(ERC721, IERC721) { super.safeTransferFrom(from, to, tokenId, _data); if (isMembershipNFT[tokenId]) { _transferMembership(from, to, tokenId); } else { emit VoucherTransferred(from, to, tokenId); } } function transferFrom( address from, address to, uint256 tokenId ) public virtual override(ERC721, IERC721) { // 保存原始的 packed ownership 數據 require( ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner" ); // 調用原始的 transferFrom 邏輯 super.transferFrom(from, to, tokenId); // 如果是會員 NFT,執行額外的會員轉移邏輯 if (isMembershipNFT[tokenId]) { _transferMembership(from, to, tokenId); } else { emit VoucherTransferred(from, to, tokenId); } } // Handle membership transfer logic function _transferMembership( address from, address to, uint256 tokenId ) internal { uint256 transferredLevel = userInfo[from].membershipLevel; uint256 transferredTotalRedeemed = userInfo[from].totalRedeemed; uint256 transferredCurrentRoundRedeemed = userInfo[from] .currentRoundRedeemed; // 檢查接收者是否已有會員 NFT uint256 recipientExistingNFT = userInfo[to].membershipNFT; bool recipientHasNFT = recipientExistingNFT != 0; if (!recipientHasNFT) { userInfo[to].membershipNFT = tokenId; userInfo[to].membershipLevel = transferredLevel; } else { if (transferredLevel > userInfo[to].membershipLevel) { // 處理接收者已有較低等級 NFT 的情況 _handleLowerLevelNFT(to, recipientExistingNFT); userInfo[to].membershipNFT = tokenId; userInfo[to].membershipLevel = transferredLevel; } else { // 處理接收到較低等級 NFT 的情況 _handleLowerLevelNFT(from, tokenId); } } // 更新接收者的兌換金額和時間戳 userInfo[to].totalRedeemed += transferredTotalRedeemed; userInfo[to].currentRoundRedeemed += transferredCurrentRoundRedeemed; userInfo[to].lastActiveTimestamp = block.timestamp; // 重置發送者的信息 userInfo[from].membershipLevel = 0; userInfo[from].membershipNFT = 0; userInfo[from].currentRoundRedeemed = 0; // 檢查並可能升級接收者的會員等級 _updateMembershipLevel(to); emit MembershipTransferred( from, to, tokenId, membershipLevels[userInfo[to].membershipLevel].name ); } // Batch burn vouchers and redeem tokens with additional rewards function burnVouchersBatch(uint256[] calldata tokenIds) external { _checkMembershipExpiration(msg.sender); // Check if membership is expired uint256 totalAmount = 0; for (uint256 i = 0; i < tokenIds.length; i++) { uint256 tokenId = tokenIds[i]; require(ownerOf(tokenId) == msg.sender, "Not the owner"); // Get the voucher type ID associated with this token uint256 voucherTypeId = voucherTypeIds[tokenId]; VoucherType memory voucherType = voucherTypes[voucherTypeId]; // Check if it's a membership NFT require(!isMembershipNFT[tokenId], "Cannot burn membership NFTs"); // Burn non-membership NFTs _burn(tokenId); delete voucherTypeIds[tokenId]; // Accumulate the total amount of tokens to redeem totalAmount += voucherType.amount; } // Calculate additional rewards based on membership level uint256 currentLevel = userInfo[msg.sender].membershipLevel; uint256 additionalReward = (totalAmount * membershipLevels[currentLevel].rewardBasisPoints) / 10000; totalAmount += additionalReward; totalAmount = totalAmount * 10 ** 18; emit VoucherTotalRedeemed( tokenIds, msg.sender, totalAmount, additionalReward ); // Mint reward tokens directly to the user require( rewardToken.mint(msg.sender, totalAmount), "Token minting failed" ); // Update the user's total redeemed amount, current round redeemed amount, and last activity timestamp userInfo[msg.sender].totalRedeemed += totalAmount; userInfo[msg.sender].currentRoundRedeemed += totalAmount; // Track current round redemption userInfo[msg.sender].lastActiveTimestamp = block.timestamp; // Check if membership level should be upgraded _updateMembershipLevel(msg.sender); } // Internal function to update membership level and handle NFT minting/burning function _updateMembershipLevel(address user) internal { uint256 currentRoundRedeemed = userInfo[user].currentRoundRedeemed; uint256 currentLevel = userInfo[user].membershipLevel; uint256 newLevel = currentLevel; // 從最高等級開始檢查 for (uint256 i = membershipLevels.length - 1; i >= 1; i--) { if (currentRoundRedeemed >= membershipLevels[i].threshold) { newLevel = i; break; } } // 只在等級真正改變時更新 if (newLevel != currentLevel) { // 處理舊的 NFT uint256 oldMembershipNFT = userInfo[user].membershipNFT; if (oldMembershipNFT != 0) { _burn(oldMembershipNFT); delete isMembershipNFT[oldMembershipNFT]; emit MembershipNFTBurned(user, oldMembershipNFT); } // 只有在新等級 >= 1 時才鑄造 NFT if (newLevel >= 1) { _tokenIds.increment(); uint256 tokenId = _tokenIds.current(); _safeMint(user, tokenId); userInfo[user].membershipNFT = tokenId; isMembershipNFT[tokenId] = true; emit MembershipUpgraded( user, tokenId, // 新的 NFT ID newLevel, // 新等級 membershipLevels[newLevel].name // 等級名稱 ); } userInfo[user].membershipLevel = newLevel; } } // Check if a user's membership has expired function _checkMembershipExpiration(address user) internal { uint256 lastActive = userInfo[user].lastActiveTimestamp; uint256 tokenId = userInfo[user].membershipNFT; // 如果是第一次活動,直接返回,不檢查過期 if (lastActive == 0) { return; } // 只有非首次用戶才檢查過期時間 if (block.timestamp > lastActive + membershipExpirationPeriod) { // Membership expired, burn the membership NFT and reset the membership level if (userInfo[user].membershipNFT != 0) { _burn(userInfo[user].membershipNFT); emit MembershipNFTBurned(user, userInfo[user].membershipNFT); userInfo[user].membershipNFT = 0; } userInfo[user].membershipLevel = 0; // Reset membership level to default userInfo[user].currentRoundRedeemed = 0; // Reset current round redeemed emit MembershipExpired(user, tokenId); } } // Admin function to update the membership expiration period function setMembershipExpirationPeriod( uint256 newExpirationPeriod ) external onlyRole(DEFAULT_ADMIN_ROLE) { membershipExpirationPeriod = newExpirationPeriod; } // Admin function to add a new membership level function addMembershipLevel( string memory name, uint256 threshold, string memory _membershipTokenURI, uint256 rewardBasisPoints ) external onlyRole(DEFAULT_ADMIN_ROLE) { _addMembershipLevel( name, threshold, _membershipTokenURI, rewardBasisPoints ); } // Admin function to update both the threshold and tokenURI of an existing membership level function updateMembershipLevel( uint256 levelIndex, uint256 newThreshold, string memory newTokenURI ) external onlyRole(DEFAULT_ADMIN_ROLE) { require( levelIndex < membershipLevels.length, "Invalid membership level" ); membershipLevels[levelIndex].threshold = newThreshold; membershipLevels[levelIndex].membershipTokenURI = newTokenURI; emit MembershipLevelUpdated( levelIndex, newThreshold, newTokenURI, membershipLevels[levelIndex].rewardBasisPoints ); } // Internal function to add a new membership level function _addMembershipLevel( string memory name, uint256 threshold, string memory _membershipTokenURI, uint256 rewardBasisPoints ) internal { membershipLevels.push( MembershipLevel( name, threshold, _membershipTokenURI, rewardBasisPoints ) ); emit MembershipLevelCreated( membershipLevels.length - 1, name, threshold, _membershipTokenURI, rewardBasisPoints ); } // Admin function to set the token reward contract function setRewardToken( address _rewardToken ) external onlyRole(DEFAULT_ADMIN_ROLE) { rewardToken = IDOUDOCOIN(_rewardToken); } // Function for subscription contract to mint multiple types of vouchers for users function mintVouchersFromSubscription( address user, uint256[] calldata _voucherTypeIds, uint256[] calldata amounts ) external onlyRole(MINTER_ROLE) { mintVouchers(user, _voucherTypeIds, amounts); uint256 totalAmount = 0; for (uint256 i = 0; i < amounts.length; i++) { uint256 voucherTypeId = _voucherTypeIds[i]; uint256 amount = amounts[i]; totalAmount += voucherTypes[voucherTypeId].amount * amount; } emit VouchersIssuedFromSubscription( user, _voucherTypeIds, amounts, totalAmount ); } function isVoucherMembershipNFT( uint256 tokenId ) public view returns (bool) { return isMembershipNFT[tokenId]; } function getVoucherTypeId(uint256 tokenId) public view returns (uint256) { return voucherTypeIds[tokenId]; } function _handleLowerLevelNFT(address owner, uint256 tokenId) internal { // 這裡可以選擇銷毀 NFT 或將其轉移到一個特定地址 // 例如: _burn(tokenId); delete isMembershipNFT[tokenId]; emit MembershipNFTBurned(owner, tokenId); } // function _update( // address to, // uint256 tokenId, // address auth // ) internal override(ERC721, ERC721Enumerable) returns (address) { // return super._update(to, tokenId, auth); // } // function _increaseBalance( // address account, // uint128 value // ) internal override(ERC721, ERC721Enumerable) { // super._increaseBalance(account, value); // } function supportsInterface( bytes4 interfaceId ) public view override(ERC721, ERC721Enumerable, AccessControl) returns (bool) { return super.supportsInterface(interfaceId); } function _beforeTokenTransfer( address from, address to, uint256 tokenId, uint256 batchSize ) internal override(ERC721, ERC721Enumerable) { super._beforeTokenTransfer(from, to, tokenId, batchSize); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (access/AccessControl.sol) pragma solidity ^0.8.0; import "./IAccessControl.sol"; import "../utils/Context.sol"; import "../utils/Strings.sol"; import "../utils/introspection/ERC165.sol"; /** * @dev Contract module that allows children to implement role-based access * control mechanisms. This is a lightweight version that doesn't allow enumerating role * members except through off-chain means by accessing the contract event logs. Some * applications may benefit from on-chain enumerability, for those cases see * {AccessControlEnumerable}. * * Roles are referred to by their `bytes32` identifier. These should be exposed * in the external API and be unique. The best way to achieve this is by * using `public constant` hash digests: * * ```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 => bool) members; bytes32 adminRole; } mapping(bytes32 => RoleData) private _roles; bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /** * @dev Modifier that checks that an account has a specific role. Reverts * with a standardized message including the required role. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ * * _Available since v4.1._ */ modifier onlyRole(bytes32 role) { _checkRole(role); _; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) public view virtual override returns (bool) { return _roles[role].members[account]; } /** * @dev Revert with a standard message if `_msgSender()` is missing `role`. * Overriding this function changes the behavior of the {onlyRole} modifier. * * Format of the revert message is described in {_checkRole}. * * _Available since v4.6._ */ function _checkRole(bytes32 role) internal view virtual { _checkRole(role, _msgSender()); } /** * @dev Revert with a standard message if `account` is missing `role`. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ */ function _checkRole(bytes32 role, address account) internal view virtual { if (!hasRole(role, account)) { revert( string( abi.encodePacked( "AccessControl: account ", Strings.toHexString(account), " is missing role ", Strings.toHexString(uint256(role), 32) ) ) ); } } /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) { return _roles[role].adminRole; } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. * * May emit a {RoleGranted} event. */ function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _grantRole(role, account); } /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. * * May emit a {RoleRevoked} event. */ function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _revokeRole(role, account); } /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been revoked `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. * * May emit a {RoleRevoked} event. */ function renounceRole(bytes32 role, address account) public virtual override { require(account == _msgSender(), "AccessControl: can only renounce roles for self"); _revokeRole(role, account); } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. Note that unlike {grantRole}, this function doesn't perform any * checks on the calling account. * * May emit a {RoleGranted} event. * * [WARNING] * ==== * This function should only be called from the constructor when setting * up the initial roles for the system. * * Using this function in any other way is effectively circumventing the admin * system imposed by {AccessControl}. * ==== * * NOTE: This function is deprecated in favor of {_grantRole}. */ function _setupRole(bytes32 role, address account) internal virtual { _grantRole(role, account); } /** * @dev Sets `adminRole` as ``role``'s admin role. * * Emits a {RoleAdminChanged} event. */ function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual { bytes32 previousAdminRole = getRoleAdmin(role); _roles[role].adminRole = adminRole; emit RoleAdminChanged(role, previousAdminRole, adminRole); } /** * @dev Grants `role` to `account`. * * Internal function without access restriction. * * May emit a {RoleGranted} event. */ function _grantRole(bytes32 role, address account) internal virtual { if (!hasRole(role, account)) { _roles[role].members[account] = true; emit RoleGranted(role, account, _msgSender()); } } /** * @dev Revokes `role` from `account`. * * Internal function without access restriction. * * May emit a {RoleRevoked} event. */ function _revokeRole(bytes32 role, address account) internal virtual { if (hasRole(role, account)) { _roles[role].members[account] = false; emit RoleRevoked(role, account, _msgSender()); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol) pragma solidity ^0.8.0; /** * @dev External interface of AccessControl declared to support ERC165 detection. */ interface IAccessControl { /** * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` * * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite * {RoleAdminChanged} not being emitted signaling this. * * _Available since v3.1._ */ event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole); /** * @dev Emitted when `account` is granted `role`. * * `sender` is the account that originated the contract call, an admin role * bearer except when using {AccessControl-_setupRole}. */ event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Emitted when `account` is revoked `role`. * * `sender` is the account that originated the contract call: * - if using `revokeRole`, it is the admin role bearer * - if using `renounceRole`, it is the role bearer (i.e. `account`) */ event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) external view returns (bool); /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {AccessControl-_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) external view returns (bytes32); /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function grantRole(bytes32 role, address account) external; /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function revokeRole(bytes32 role, address account) external; /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been granted `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. */ function renounceRole(bytes32 role, address account) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `from` to `to` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address from, address to, uint256 amount) external returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC721/ERC721.sol) pragma solidity ^0.8.0; import "./IERC721.sol"; import "./IERC721Receiver.sol"; import "./extensions/IERC721Metadata.sol"; import "../../utils/Address.sol"; import "../../utils/Context.sol"; import "../../utils/Strings.sol"; import "../../utils/introspection/ERC165.sol"; /** * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including * the Metadata extension, but not including the Enumerable extension, which is available separately as * {ERC721Enumerable}. */ contract ERC721 is Context, ERC165, IERC721, IERC721Metadata { using Address for address; using Strings for uint256; // Token name string private _name; // Token symbol string private _symbol; // Mapping from token ID to owner address mapping(uint256 => address) private _owners; // Mapping owner address to token count mapping(address => uint256) private _balances; // Mapping from token ID to approved address mapping(uint256 => address) private _tokenApprovals; // Mapping from owner to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; /** * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection. */ constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IERC721).interfaceId || interfaceId == type(IERC721Metadata).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721-balanceOf}. */ function balanceOf(address owner) public view virtual override returns (uint256) { require(owner != address(0), "ERC721: address zero is not a valid owner"); return _balances[owner]; } /** * @dev See {IERC721-ownerOf}. */ function ownerOf(uint256 tokenId) public view virtual override returns (address) { address owner = _ownerOf(tokenId); require(owner != address(0), "ERC721: invalid token ID"); return owner; } /** * @dev See {IERC721Metadata-name}. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev See {IERC721Metadata-symbol}. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { _requireMinted(tokenId); string memory baseURI = _baseURI(); return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : ""; } /** * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each * token will be the concatenation of the `baseURI` and the `tokenId`. Empty * by default, can be overridden in child contracts. */ function _baseURI() internal view virtual returns (string memory) { return ""; } /** * @dev See {IERC721-approve}. */ function approve(address to, uint256 tokenId) public virtual override { address owner = ERC721.ownerOf(tokenId); require(to != owner, "ERC721: approval to current owner"); require( _msgSender() == owner || isApprovedForAll(owner, _msgSender()), "ERC721: approve caller is not token owner or approved for all" ); _approve(to, tokenId); } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view virtual override returns (address) { _requireMinted(tokenId); return _tokenApprovals[tokenId]; } /** * @dev See {IERC721-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { _setApprovalForAll(_msgSender(), operator, approved); } /** * @dev See {IERC721-isApprovedForAll}. */ function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { return _operatorApprovals[owner][operator]; } /** * @dev See {IERC721-transferFrom}. */ function transferFrom(address from, address to, uint256 tokenId) public virtual override { //solhint-disable-next-line max-line-length require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner or approved"); _transfer(from, to, tokenId); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom(address from, address to, uint256 tokenId) public virtual override { safeTransferFrom(from, to, tokenId, ""); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public virtual override { require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner or approved"); _safeTransfer(from, to, tokenId, data); } /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * `data` is additional data, it has no specified format and it is sent in call to `to`. * * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g. * implement alternative mechanisms to perform token transfer, such as signature-based. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeTransfer(address from, address to, uint256 tokenId, bytes memory data) internal virtual { _transfer(from, to, tokenId); require(_checkOnERC721Received(from, to, tokenId, data), "ERC721: transfer to non ERC721Receiver implementer"); } /** * @dev Returns the owner of the `tokenId`. Does NOT revert if token doesn't exist */ function _ownerOf(uint256 tokenId) internal view virtual returns (address) { return _owners[tokenId]; } /** * @dev Returns whether `tokenId` exists. * * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}. * * Tokens start existing when they are minted (`_mint`), * and stop existing when they are burned (`_burn`). */ function _exists(uint256 tokenId) internal view virtual returns (bool) { return _ownerOf(tokenId) != address(0); } /** * @dev Returns whether `spender` is allowed to manage `tokenId`. * * Requirements: * * - `tokenId` must exist. */ function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) { address owner = ERC721.ownerOf(tokenId); return (spender == owner || isApprovedForAll(owner, spender) || getApproved(tokenId) == spender); } /** * @dev Safely mints `tokenId` and transfers it to `to`. * * Requirements: * * - `tokenId` must not exist. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeMint(address to, uint256 tokenId) internal virtual { _safeMint(to, tokenId, ""); } /** * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is * forwarded in {IERC721Receiver-onERC721Received} to contract recipients. */ function _safeMint(address to, uint256 tokenId, bytes memory data) internal virtual { _mint(to, tokenId); require( _checkOnERC721Received(address(0), to, tokenId, data), "ERC721: transfer to non ERC721Receiver implementer" ); } /** * @dev Mints `tokenId` and transfers it to `to`. * * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible * * Requirements: * * - `tokenId` must not exist. * - `to` cannot be the zero address. * * Emits a {Transfer} event. */ function _mint(address to, uint256 tokenId) internal virtual { require(to != address(0), "ERC721: mint to the zero address"); require(!_exists(tokenId), "ERC721: token already minted"); _beforeTokenTransfer(address(0), to, tokenId, 1); // Check that tokenId was not minted by `_beforeTokenTransfer` hook require(!_exists(tokenId), "ERC721: token already minted"); unchecked { // Will not overflow unless all 2**256 token ids are minted to the same owner. // Given that tokens are minted one by one, it is impossible in practice that // this ever happens. Might change if we allow batch minting. // The ERC fails to describe this case. _balances[to] += 1; } _owners[tokenId] = to; emit Transfer(address(0), to, tokenId); _afterTokenTransfer(address(0), to, tokenId, 1); } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * This is an internal function that does not check if the sender is authorized to operate on the token. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId) internal virtual { address owner = ERC721.ownerOf(tokenId); _beforeTokenTransfer(owner, address(0), tokenId, 1); // Update ownership in case tokenId was transferred by `_beforeTokenTransfer` hook owner = ERC721.ownerOf(tokenId); // Clear approvals delete _tokenApprovals[tokenId]; unchecked { // Cannot overflow, as that would require more tokens to be burned/transferred // out than the owner initially received through minting and transferring in. _balances[owner] -= 1; } delete _owners[tokenId]; emit Transfer(owner, address(0), tokenId); _afterTokenTransfer(owner, address(0), tokenId, 1); } /** * @dev Transfers `tokenId` from `from` to `to`. * As opposed to {transferFrom}, this imposes no restrictions on msg.sender. * * Requirements: * * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * * Emits a {Transfer} event. */ function _transfer(address from, address to, uint256 tokenId) internal virtual { require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner"); require(to != address(0), "ERC721: transfer to the zero address"); _beforeTokenTransfer(from, to, tokenId, 1); // Check that tokenId was not transferred by `_beforeTokenTransfer` hook require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner"); // Clear approvals from the previous owner delete _tokenApprovals[tokenId]; unchecked { // `_balances[from]` cannot overflow for the same reason as described in `_burn`: // `from`'s balance is the number of token held, which is at least one before the current // transfer. // `_balances[to]` could overflow in the conditions described in `_mint`. That would require // all 2**256 token ids to be minted, which in practice is impossible. _balances[from] -= 1; _balances[to] += 1; } _owners[tokenId] = to; emit Transfer(from, to, tokenId); _afterTokenTransfer(from, to, tokenId, 1); } /** * @dev Approve `to` to operate on `tokenId` * * Emits an {Approval} event. */ function _approve(address to, uint256 tokenId) internal virtual { _tokenApprovals[tokenId] = to; emit Approval(ERC721.ownerOf(tokenId), to, tokenId); } /** * @dev Approve `operator` to operate on all of `owner` tokens * * Emits an {ApprovalForAll} event. */ function _setApprovalForAll(address owner, address operator, bool approved) internal virtual { require(owner != operator, "ERC721: approve to caller"); _operatorApprovals[owner][operator] = approved; emit ApprovalForAll(owner, operator, approved); } /** * @dev Reverts if the `tokenId` has not been minted yet. */ function _requireMinted(uint256 tokenId) internal view virtual { require(_exists(tokenId), "ERC721: invalid token ID"); } /** * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address. * The call is not executed if the target address is not a contract. * * @param from address representing the previous owner of the given token ID * @param to target address that will receive the tokens * @param tokenId uint256 ID of the token to be transferred * @param data bytes optional data to send along with the call * @return bool whether the call correctly returned the expected magic value */ function _checkOnERC721Received( address from, address to, uint256 tokenId, bytes memory data ) private returns (bool) { if (to.isContract()) { try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, data) returns (bytes4 retval) { return retval == IERC721Receiver.onERC721Received.selector; } catch (bytes memory reason) { if (reason.length == 0) { revert("ERC721: transfer to non ERC721Receiver implementer"); } else { /// @solidity memory-safe-assembly assembly { revert(add(32, reason), mload(reason)) } } } } else { return true; } } /** * @dev Hook that is called before any token transfer. This includes minting and burning. If {ERC721Consecutive} is * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s tokens will be transferred to `to`. * - When `from` is zero, the tokens will be minted for `to`. * - When `to` is zero, ``from``'s tokens will be burned. * - `from` and `to` are never both zero. * - `batchSize` is non-zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer(address from, address to, uint256 firstTokenId, uint256 batchSize) internal virtual {} /** * @dev Hook that is called after any token transfer. This includes minting and burning. If {ERC721Consecutive} is * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s tokens were transferred to `to`. * - When `from` is zero, the tokens were minted for `to`. * - When `to` is zero, ``from``'s tokens were burned. * - `from` and `to` are never both zero. * - `batchSize` is non-zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _afterTokenTransfer(address from, address to, uint256 firstTokenId, uint256 batchSize) internal virtual {} /** * @dev Unsafe write access to the balances, used by extensions that "mint" tokens using an {ownerOf} override. * * WARNING: Anyone calling this MUST ensure that the balances remain consistent with the ownership. The invariant * being 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`. */ // solhint-disable-next-line func-name-mixedcase function __unsafe_increaseBalance(address account, uint256 amount) internal { _balances[account] += amount; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/extensions/ERC721Burnable.sol) pragma solidity ^0.8.0; import "../ERC721.sol"; import "../../../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 { //solhint-disable-next-line max-line-length require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner or approved"); _burn(tokenId); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/extensions/ERC721Enumerable.sol) pragma solidity ^0.8.0; import "../ERC721.sol"; import "./IERC721Enumerable.sol"; /** * @dev This implements an optional extension of {ERC721} defined in the EIP that adds * enumerability of all the token ids in the contract as well as all token ids owned by each * account. */ abstract contract ERC721Enumerable is ERC721, IERC721Enumerable { // Mapping from owner to list of owned token IDs mapping(address => mapping(uint256 => uint256)) private _ownedTokens; // Mapping from token ID to index of the owner tokens list mapping(uint256 => uint256) private _ownedTokensIndex; // Array with all token ids, used for enumeration uint256[] private _allTokens; // Mapping from token id to position in the allTokens array mapping(uint256 => uint256) private _allTokensIndex; /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721) returns (bool) { return interfaceId == type(IERC721Enumerable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}. */ function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override returns (uint256) { require(index < ERC721.balanceOf(owner), "ERC721Enumerable: owner index out of bounds"); return _ownedTokens[owner][index]; } /** * @dev See {IERC721Enumerable-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _allTokens.length; } /** * @dev See {IERC721Enumerable-tokenByIndex}. */ function tokenByIndex(uint256 index) public view virtual override returns (uint256) { require(index < ERC721Enumerable.totalSupply(), "ERC721Enumerable: global index out of bounds"); return _allTokens[index]; } /** * @dev See {ERC721-_beforeTokenTransfer}. */ function _beforeTokenTransfer( address from, address to, uint256 firstTokenId, uint256 batchSize ) internal virtual override { super._beforeTokenTransfer(from, to, firstTokenId, batchSize); if (batchSize > 1) { // Will only trigger during construction. Batch transferring (minting) is not available afterwards. revert("ERC721Enumerable: consecutive transfers not supported"); } uint256 tokenId = firstTokenId; if (from == address(0)) { _addTokenToAllTokensEnumeration(tokenId); } else if (from != to) { _removeTokenFromOwnerEnumeration(from, tokenId); } if (to == address(0)) { _removeTokenFromAllTokensEnumeration(tokenId); } else if (to != from) { _addTokenToOwnerEnumeration(to, tokenId); } } /** * @dev Private function to add a token to this extension's ownership-tracking data structures. * @param to address representing the new owner of the given token ID * @param tokenId uint256 ID of the token to be added to the tokens list of the given address */ function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private { uint256 length = ERC721.balanceOf(to); _ownedTokens[to][length] = tokenId; _ownedTokensIndex[tokenId] = length; } /** * @dev Private function to add a token to this extension's token tracking data structures. * @param tokenId uint256 ID of the token to be added to the tokens list */ function _addTokenToAllTokensEnumeration(uint256 tokenId) private { _allTokensIndex[tokenId] = _allTokens.length; _allTokens.push(tokenId); } /** * @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that * while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for * gas optimizations e.g. when performing a transfer operation (avoiding double writes). * This has O(1) time complexity, but alters the order of the _ownedTokens array. * @param from address representing the previous owner of the given token ID * @param tokenId uint256 ID of the token to be removed from the tokens list of the given address */ function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private { // To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and // then delete the last slot (swap and pop). uint256 lastTokenIndex = ERC721.balanceOf(from) - 1; uint256 tokenIndex = _ownedTokensIndex[tokenId]; // When the token to delete is the last token, the swap operation is unnecessary if (tokenIndex != lastTokenIndex) { uint256 lastTokenId = _ownedTokens[from][lastTokenIndex]; _ownedTokens[from][tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token _ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index } // This also deletes the contents at the last position of the array delete _ownedTokensIndex[tokenId]; delete _ownedTokens[from][lastTokenIndex]; } /** * @dev Private function to remove a token from this extension's token tracking data structures. * This has O(1) time complexity, but alters the order of the _allTokens array. * @param tokenId uint256 ID of the token to be removed from the tokens list */ function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private { // To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and // then delete the last slot (swap and pop). uint256 lastTokenIndex = _allTokens.length - 1; uint256 tokenIndex = _allTokensIndex[tokenId]; // When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so // rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding // an 'if' statement (like in _removeTokenFromOwnerEnumeration) uint256 lastTokenId = _allTokens[lastTokenIndex]; _allTokens[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token _allTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index // This also deletes the contents at the last position of the array delete _allTokensIndex[tokenId]; _allTokens.pop(); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/extensions/IERC721Enumerable.sol) pragma solidity ^0.8.0; import "../IERC721.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721Enumerable is IERC721 { /** * @dev Returns the total amount of tokens stored by the contract. */ function totalSupply() external view returns (uint256); /** * @dev Returns a token ID owned by `owner` at a given `index` of its token list. * Use along with {balanceOf} to enumerate all of ``owner``'s tokens. */ function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256); /** * @dev Returns a token ID at a given `index` of all the tokens stored by the contract. * Use along with {totalSupply} to enumerate all tokens. */ function tokenByIndex(uint256 index) external view returns (uint256); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol) pragma solidity ^0.8.0; import "../IERC721.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional metadata extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721Metadata is IERC721 { /** * @dev Returns the token collection name. */ function name() external view returns (string memory); /** * @dev Returns the token collection symbol. */ function symbol() external view returns (string memory); /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ function tokenURI(uint256 tokenId) external view returns (string memory); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC721/IERC721.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721 is IERC165 { /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external; /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom(address from, address to, uint256 tokenId) external; /** * @dev Transfers `tokenId` token from `from` to `to`. * * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721 * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must * understand this adds an external call which potentially creates a reentrancy vulnerability. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom(address from, address to, uint256 tokenId) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool approved) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol) pragma solidity ^0.8.0; /** * @title ERC721 token receiver interface * @dev Interface for any contract that wants to support safeTransfers * from ERC721 asset contracts. */ interface IERC721Receiver { /** * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom} * by `operator` from `from`, this function is called. * * It must return its Solidity selector to confirm the token transfer. * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted. * * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`. */ function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * * Furthermore, `isContract` will also return true if the target contract within * the same transaction is already scheduled for destruction by `SELFDESTRUCT`, * which only has an effect at the end of a transaction. * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract. * * _Available since v4.8._ */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata, string memory errorMessage ) internal view returns (bytes memory) { if (success) { if (returndata.length == 0) { // only check isContract if the call was successful and the return data is empty // otherwise we already know that it was a contract require(isContract(target), "Address: call to non-contract"); } return returndata; } else { _revert(returndata, errorMessage); } } /** * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason or using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { _revert(returndata, errorMessage); } } function _revert(bytes memory returndata, string memory errorMessage) private pure { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.4) (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } function _contextSuffixLength() internal view virtual returns (uint256) { return 0; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Counters.sol) pragma solidity ^0.8.0; /** * @title Counters * @author Matt Condon (@shrugs) * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number * of elements in a mapping, issuing ERC721 ids, or counting request ids. * * Include with `using Counters for Counters.Counter;` */ library Counters { struct Counter { // This variable should never be directly accessed by users of the library: interactions must be restricted to // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add // this feature: see https://github.com/ethereum/solidity/issues/4637 uint256 _value; // default: 0 } function current(Counter storage counter) internal view returns (uint256) { return counter._value; } function increment(Counter storage counter) internal { unchecked { counter._value += 1; } } function decrement(Counter storage counter) internal { uint256 value = counter._value; require(value > 0, "Counter: decrement overflow"); unchecked { counter._value = value - 1; } } function reset(Counter storage counter) internal { counter._value = 0; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; import "./IERC165.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol) pragma solidity ^0.8.0; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { enum Rounding { Down, // Toward negative infinity Up, // Toward infinity Zero // Toward zero } /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a > b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds up instead * of rounding down. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b - 1) / b can overflow on addition, so we distribute. return a == 0 ? 0 : (a - 1) / b + 1; } /** * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0 * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) * with further edits by Uniswap Labs also under MIT license. */ function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) { unchecked { // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256 // variables such that product = prod1 * 2^256 + prod0. uint256 prod0; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod0 := mul(x, y) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division. if (prod1 == 0) { // 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. require(denominator > prod1, "Math: mulDiv overflow"); /////////////////////////////////////////////// // 512 by 256 division. /////////////////////////////////////////////// // Make division exact by subtracting the remainder from [prod1 prod0]. uint256 remainder; assembly { // Compute remainder using mulmod. remainder := mulmod(x, y, denominator) // Subtract 256 bit number from 512 bit number. prod1 := sub(prod1, gt(remainder, prod0)) prod0 := sub(prod0, remainder) } // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1. // See https://cs.stackexchange.com/q/138556/92363. // Does not overflow because the denominator cannot be zero at this stage in the function. uint256 twos = denominator & (~denominator + 1); assembly { // Divide denominator by twos. denominator := div(denominator, twos) // Divide [prod1 prod0] by twos. prod0 := div(prod0, twos) // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one. twos := add(div(sub(0, twos), twos), 1) } // Shift in bits from prod1 into prod0. prod0 |= prod1 * twos; // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for // four bits. That is, denominator * inv = 1 mod 2^4. uint256 inverse = (3 * denominator) ^ 2; // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works // in modular arithmetic, doubling the correct bits in each step. inverse *= 2 - denominator * inverse; // inverse mod 2^8 inverse *= 2 - denominator * inverse; // inverse mod 2^16 inverse *= 2 - denominator * inverse; // inverse mod 2^32 inverse *= 2 - denominator * inverse; // inverse mod 2^64 inverse *= 2 - denominator * inverse; // inverse mod 2^128 inverse *= 2 - denominator * inverse; // inverse mod 2^256 // Because the division is now exact we can divide by multiplying with the modular inverse of denominator. // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1 // is no longer required. result = prod0 * inverse; return result; } } /** * @notice Calculates x * y / denominator with full precision, following the selected rounding direction. */ function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) { uint256 result = mulDiv(x, y, denominator); if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) { result += 1; } return result; } /** * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down. * * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11). */ function sqrt(uint256 a) internal pure returns (uint256) { if (a == 0) { return 0; } // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target. // // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`. // // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)` // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))` // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)` // // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit. uint256 result = 1 << (log2(a) >> 1); // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128, // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision // into the expected uint128 result. unchecked { result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; return min(result, a / result); } } /** * @notice Calculates sqrt(a), following the selected rounding direction. */ function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = sqrt(a); return result + (rounding == Rounding.Up && result * result < a ? 1 : 0); } } /** * @dev Return the log in base 2, rounded down, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 128; } if (value >> 64 > 0) { value >>= 64; result += 64; } if (value >> 32 > 0) { value >>= 32; result += 32; } if (value >> 16 > 0) { value >>= 16; result += 16; } if (value >> 8 > 0) { value >>= 8; result += 8; } if (value >> 4 > 0) { value >>= 4; result += 4; } if (value >> 2 > 0) { value >>= 2; result += 2; } if (value >> 1 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 2, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log2(value); return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0); } } /** * @dev Return the log in base 10, rounded down, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >= 10 ** 64) { value /= 10 ** 64; result += 64; } if (value >= 10 ** 32) { value /= 10 ** 32; result += 32; } if (value >= 10 ** 16) { value /= 10 ** 16; result += 16; } if (value >= 10 ** 8) { value /= 10 ** 8; result += 8; } if (value >= 10 ** 4) { value /= 10 ** 4; result += 4; } if (value >= 10 ** 2) { value /= 10 ** 2; result += 2; } if (value >= 10 ** 1) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log10(value); return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0); } } /** * @dev Return the log in base 256, rounded down, of a positive value. * Returns 0 if given 0. * * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string. */ function log256(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 16; } if (value >> 64 > 0) { value >>= 64; result += 8; } if (value >> 32 > 0) { value >>= 32; result += 4; } if (value >> 16 > 0) { value >>= 16; result += 2; } if (value >> 8 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 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 + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol) pragma solidity ^0.8.0; /** * @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 v4.9.0) (utils/Strings.sol) pragma solidity ^0.8.0; import "./math/Math.sol"; import "./math/SignedMath.sol"; /** * @dev String operations. */ library Strings { bytes16 private constant _SYMBOLS = "0123456789abcdef"; uint8 private constant _ADDRESS_LENGTH = 20; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { unchecked { uint256 length = Math.log10(value) + 1; string memory buffer = new string(length); uint256 ptr; /// @solidity memory-safe-assembly assembly { ptr := add(buffer, add(32, length)) } while (true) { ptr--; /// @solidity memory-safe-assembly assembly { mstore8(ptr, byte(mod(value, 10), _SYMBOLS)) } value /= 10; if (value == 0) break; } return buffer; } } /** * @dev Converts a `int256` to its ASCII `string` decimal representation. */ function toString(int256 value) internal pure returns (string memory) { return string(abi.encodePacked(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) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH); } /** * @dev Returns true if the two strings are equal. */ function equal(string memory a, string memory b) internal pure returns (bool) { return keccak256(bytes(a)) == keccak256(bytes(b)); } }
{ "optimizer": { "enabled": true, "runs": 200 }, "viaIR": true, "evmVersion": "paris", "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract ABI
API[{"inputs":[{"internalType":"address","name":"rewardTokenAddress","type":"address"},{"internalType":"address","name":"defaultAdmin","type":"address"},{"internalType":"address","name":"minter","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"MembershipExpired","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"levelIndex","type":"uint256"},{"indexed":false,"internalType":"string","name":"name","type":"string"},{"indexed":false,"internalType":"uint256","name":"threshold","type":"uint256"},{"indexed":false,"internalType":"string","name":"membershipTokenURI","type":"string"},{"indexed":false,"internalType":"uint256","name":"rewardBasisPoints","type":"uint256"}],"name":"MembershipLevelCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"levelIndex","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"threshold","type":"uint256"},{"indexed":false,"internalType":"string","name":"membershipTokenURI","type":"string"},{"indexed":false,"internalType":"uint256","name":"rewardBasisPoints","type":"uint256"}],"name":"MembershipLevelUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"MembershipNFTBurned","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newExpiryDate","type":"uint256"}],"name":"MembershipRenewed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"string","name":"levelName","type":"string"}],"name":"MembershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"level","type":"uint256"},{"indexed":false,"internalType":"string","name":"levelName","type":"string"}],"name":"MembershipUpgraded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"voucherTypeId","type":"uint256"}],"name":"VoucherMinted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"indexed":false,"internalType":"address","name":"redeemer","type":"address"},{"indexed":false,"internalType":"uint256","name":"totalAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"additionalReward","type":"uint256"}],"name":"VoucherTotalRedeemed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"VoucherTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"voucherTypeId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"maxPerUser","type":"uint256"},{"indexed":false,"internalType":"string","name":"tokenURI","type":"string"}],"name":"VoucherTypeCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"voucherTypeId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"maxPerUser","type":"uint256"},{"indexed":false,"internalType":"string","name":"tokenURI","type":"string"}],"name":"VoucherTypeUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"voucherTypeIds","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"indexed":false,"internalType":"uint256","name":"totalAmount","type":"uint256"}],"name":"VouchersIssuedFromSubscription","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MINTER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"name","type":"string"},{"internalType":"uint256","name":"threshold","type":"uint256"},{"internalType":"string","name":"_membershipTokenURI","type":"string"},{"internalType":"uint256","name":"rewardBasisPoints","type":"uint256"}],"name":"addMembershipLevel","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"burnVouchersBatch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"maxPerUser","type":"uint256"},{"internalType":"string","name":"_tokenURI","type":"string"}],"name":"createVoucherType","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"voucherTypeId","type":"uint256"}],"name":"getUserVoucherCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getVoucherTypeId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"isMembershipNFT","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"isVoucherMembershipNFT","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"membershipExpirationPeriod","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"membershipLevels","outputs":[{"internalType":"string","name":"name","type":"string"},{"internalType":"uint256","name":"threshold","type":"uint256"},{"internalType":"string","name":"membershipTokenURI","type":"string"},{"internalType":"uint256","name":"rewardBasisPoints","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"membershipLevel","type":"uint256"}],"name":"mintMembershipNFT","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256[]","name":"_voucherTypeIds","type":"uint256[]"},{"internalType":"uint256[]","name":"quantities","type":"uint256[]"}],"name":"mintVouchers","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256[]","name":"_voucherTypeIds","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"name":"mintVouchersFromSubscription","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nextVoucherTypeId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rewardToken","outputs":[{"internalType":"contract IDOUDOCOIN","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newExpirationPeriod","type":"uint256"}],"name":"setMembershipExpirationPeriod","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_rewardToken","type":"address"}],"name":"setRewardToken","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":[{"internalType":"uint256","name":"levelIndex","type":"uint256"},{"internalType":"uint256","name":"newThreshold","type":"uint256"},{"internalType":"string","name":"newTokenURI","type":"string"}],"name":"updateMembershipLevel","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"voucherTypeId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"maxPerUser","type":"uint256"},{"internalType":"string","name":"_tokenURI","type":"string"}],"name":"updateVoucherType","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"userInfo","outputs":[{"internalType":"uint256","name":"totalRedeemed","type":"uint256"},{"internalType":"uint256","name":"currentRoundRedeemed","type":"uint256"},{"internalType":"uint256","name":"membershipLevel","type":"uint256"},{"internalType":"uint256","name":"membershipNFT","type":"uint256"},{"internalType":"uint256","name":"lastActiveTimestamp","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"voucherTypeIds","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"voucherTypes","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"maxPerUser","type":"uint256"},{"internalType":"string","name":"tokenURI","type":"string"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
608034620019db57601f620058eb38819003918201601f19168301916001600160401b0383118484101762000ef357808492606094604052833981010312620019db576200004d8162001a40565b620000696040620000616020850162001a40565b930162001a40565b6200007362001a00565b92600c84526b1113d55113d0d3d25393919560a21b60208501526200009762001a00565b6005815264444f55444f60d81b6020820152845190946001600160401b03821162000ef35760005490600182811c92168015620019d0575b602083101462000ed25781601f8493116200196d575b50602090601f8311600114620018f157600092620018e5575b50508160011b916000199060031b1c1916176000555b83516001600160401b03811162000ef357600154600181811c91168015620018da575b602082101462000ed257601f811162001870575b50602094601f82116001146200180357948192939495600092620017f7575b50508160011b916000199060031b1c1916176001555b62ed4e00600c5560006013819055601180546001600160a01b0319166001600160a01b039586161790559083168082527f13da86008ba1c6922daee3e07db95305ef49ebced9f5467a0b8613fcc6b343e360205260409091205460ff1615620017a2575b501660008181527faa1d7351356c4ddc11907b1ee0660f579cfdf507235af2ae01ecd22a4b7ceaae60205260409020547f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6919060ff16156200175f575b50506200024d62001a00565b600d81526c04e6f6e4d656d6265727368697609c1b6020820152604051906020820182811060018060401b0382111762000ef3576040526000825262000292620019e0565b8181526000602082015282604082015260006060820152601254906801000000000000000082101562000ef357600182018060125582101562000ff5576012600052805180516000805160206200582b83398151915292916001600160401b03821162000ef3578460021b84015490600182811c9216801562001754575b602083101462000ed25781601f849311620016fa575b50602090601f83116001146200167f5760009262001673575b50508160011b916000199060031b1c1916178360021b8301555b6020810151600284901b83016001015560408101518051906001600160401b03821162000ef357600285811b85010154600181811c9116801562001668575b602082101462000ed257601f811162001618575b50602090601f83116001146200159657918060039594926060946000926200158a575b50508160011b9160001990871b1c191617600286811b850101555b01519260021b010155601254918260001981011162000dde57600080516020620058ab83398151915291620004526200043c926040519384936000198801855260a0602086015260a085019062001a55565b9060006040850152838203606085015262001a55565b600060808301520390a16200046662001a00565b600681526521b7b6b6b7b760d11b60208201526200048362001a20565b91606c83526000805160206200586b8339815191526020840152600080516020620058cb83398151915260408401526000805160206200588b83398151915260608401526b17b1b7b6b6b7b7173539b7b760a11b6080840152620004e6620019e0565b82815260016020820152836040820152600060608201526801000000000000000082101562000ef357600182018060125582101562000ff5576012600052805180516000805160206200582b83398151915292916001600160401b03821162000ef3578460021b84015490600182811c921680156200157f575b602083101462000ed25781601f84931162001525575b50602090601f8311600114620014aa576000926200149e575b50508160011b916000199060031b1c1916178360021b8301555b6020810151600284901b83016001015560408101518051906001600160401b03821162000ef357600285811b85010154600181811c9116801562001493575b602082101462000ed257601f811162001443575b50602090601f8311600114620013c15791806003959492606094600092620013b5575b50508160011b9160001990871b1c191617600286811b850101555b01519260021b010155601254918260001981011162000dde57600080516020620058ab83398151915291620006a26200068c926040519384936000198801855260a0602086015260a085019062001a55565b9060016040850152838203606085015262001a55565b600060808301520390a1620006b662001a00565b600681526529b4b63b32b960d11b6020820152620006d362001a20565b91606c83526000805160206200586b8339815191526020840152600080516020620058cb83398151915260408401526000805160206200588b83398151915260608401526b17b9b634bb32b9173539b7b760a11b608084015262000736620019e0565b82815269021e19e0c9bab24000006020820152836040820152606460608201526801000000000000000082101562000ef357600182018060125582101562000ff5576012600052805180516000805160206200582b83398151915292916001600160401b03821162000ef3578460021b84015490600182811c92168015620013aa575b602083101462000ed25781601f84931162001350575b50602090601f8311600114620012d557600092620012c9575b50508160011b916000199060031b1c1916178360021b8301555b6020810151600284901b83016001015560408101518051906001600160401b03821162000ef357600285811b85010154600181811c91168015620012be575b602082101462000ed257601f81116200126e575b50602090601f8311600114620011ec5791806003959492606094600092620011e0575b50508160011b9160001990871b1c191617600286811b850101555b01519260021b010155601254918260001981011162000dde57600080516020620058ab8339815191529162000904620008e5926040519384936000198801855260a0602086015260a085019062001a55565b9069021e19e0c9bab24000006040850152838203606085015262001a55565b606460808301520390a16200091862001a00565b600481526311dbdb1960e21b60208201526200093362001a20565b91606a83526000805160206200586b8339815191526020840152600080516020620058cb83398151915260408401526000805160206200588b83398151915260608401526917b3b7b632173539b7b760b11b608084015262000994620019e0565b828152690a968163f0a57b4000006020820152836040820152609660608201526801000000000000000082101562000ef357600182018060125582101562000ff5576012600052805180516000805160206200582b83398151915292916001600160401b03821162000ef3578460021b84015490600182811c92168015620011d5575b602083101462000ed25781601f8493116200117b575b50602090601f83116001146200110057600092620010f4575b50508160011b916000199060031b1c1916178360021b8301555b6020810151600284901b83016001015560408101518051906001600160401b03821162000ef357600285811b85010154600181811c91168015620010e9575b602082101462000ed257601f811162001099575b50602090601f83116001146200101757918060039594926060946000926200100b575b50508160011b9160001990871b1c191617600286811b850101555b01519260021b010155601254918260001981011162000dde57600080516020620058ab8339815191529162000b6262000b43926040519384936000198801855260a0602086015260a085019062001a55565b90690a968163f0a57b4000006040850152838203606085015262001a55565b609660808301520390a162000b7662001a00565b6008815267506c6174696e756d60c01b602082015262000b9562001a20565b91606e83526000805160206200586b8339815191526020840152600080516020620058cb83398151915260408401526000805160206200588b83398151915260608401526d17a83630ba34b73ab6973539b7b760911b608084015262000bfa620019e0565b82815269152d02c7e14af6800000602082015283604082015261012c60608201526801000000000000000082101562000ef357600182018060125582101562000ff5576012600052805180516000805160206200582b83398151915292916001600160401b03821162000ef3578460021b84015490600182811c9216801562000fea575b602083101462000ed25781601f84931162000f90575b50602090601f831160011462000f155760009262000f09575b50508160011b916000199060031b1c1916178360021b8301555b6020810151600284901b83016001015560408101518051906001600160401b03821162000ef357600285811b85010154600181811c9116801562000ee8575b602082101462000ed257601f811162000e82575b50602090601f831160011462000e00579180600395949260609460009262000df4575b50508160011b9160001990871b1c191617600286811b850101555b01519260021b010155601254600019810190811162000dde5762000dc3600080516020620058ab8339815191529362000da4604051948594855260a0602086015260a085019062001a55565b9069152d02c7e14af68000006040850152838203606085015262001a55565b61012c60808301520390a1604051613d73908162001a988239f35b634e487b7160e01b600052601160045260246000fd5b01519050388062000d3d565b90600286811b86010160005260206000209160005b601f198516811062000e69575092600395949260019260609583601f1981161062000e50575b505050811b01600286811b8501015562000d58565b015160001983891b60f8161c1916905538808062000e3b565b9192602060018192868501518155019401920162000e15565b600286811b8601016000526020600020601f840160051c81016020851062000eca575b601f830160051c8201811062000ebd57505062000d1a565b6000815560010162000ea5565b508062000ea5565b634e487b7160e01b600052602260045260246000fd5b90607f169062000d06565b634e487b7160e01b600052604160045260246000fd5b01519050388062000cad565b92508560021b85016000526020600020906000935b601f198416851062000f74576001945083601f1981161062000f5a575b505050811b018360021b83015562000cc7565b015160001960f88460031b161c1916905538808062000f47565b8181015183556020948501946001909301929091019062000f2a565b9091508560021b85016000526020600020601f840160051c81016020851062000fe2575b90849392915b601f830160051c8201811062000fd257505062000c94565b6000815585945060010162000fba565b508062000fb4565b91607f169162000c7e565b634e487b7160e01b600052603260045260246000fd5b01519050388062000ad6565b90600286811b86010160005260206000209160005b601f198516811062001080575092600395949260019260609583601f1981161062001067575b505050811b01600286811b8501015562000af1565b015160001983891b60f8161c1916905538808062001052565b919260206001819286850151815501940192016200102c565b600286811b8601016000526020600020601f840160051c810160208510620010e1575b601f830160051c82018110620010d457505062000ab3565b60008155600101620010bc565b5080620010bc565b90607f169062000a9f565b01519050388062000a46565b92508560021b85016000526020600020906000935b601f19841685106200115f576001945083601f1981161062001145575b505050811b018360021b83015562000a60565b015160001960f88460031b161c1916905538808062001132565b8181015183556020948501946001909301929091019062001115565b9091508560021b85016000526020600020601f840160051c810160208510620011cd575b90849392915b601f830160051c82018110620011bd57505062000a2d565b60008155859450600101620011a5565b50806200119f565b91607f169162000a17565b01519050388062000878565b90600286811b86010160005260206000209160005b601f198516811062001255575092600395949260019260609583601f198116106200123c575b505050811b01600286811b8501015562000893565b015160001983891b60f8161c1916905538808062001227565b9192602060018192868501518155019401920162001201565b600286811b8601016000526020600020601f840160051c810160208510620012b6575b601f830160051c82018110620012a957505062000855565b6000815560010162001291565b508062001291565b90607f169062000841565b015190503880620007e8565b92508560021b85016000526020600020906000935b601f198416851062001334576001945083601f198116106200131a575b505050811b018360021b83015562000802565b015160001960f88460031b161c1916905538808062001307565b81810151835560209485019460019093019290910190620012ea565b9091508560021b85016000526020600020601f840160051c810160208510620013a2575b90849392915b601f830160051c8201811062001392575050620007cf565b600081558594506001016200137a565b508062001374565b91607f1691620007b9565b0151905038806200061f565b90600286811b86010160005260206000209160005b601f19851681106200142a575092600395949260019260609583601f1981161062001411575b505050811b01600286811b850101556200063a565b015160001983891b60f8161c19169055388080620013fc565b91926020600181928685015181550194019201620013d6565b600286811b8601016000526020600020601f840160051c8101602085106200148b575b601f830160051c820181106200147e575050620005fc565b6000815560010162001466565b508062001466565b90607f1690620005e8565b0151905038806200058f565b92508560021b85016000526020600020906000935b601f198416851062001509576001945083601f19811610620014ef575b505050811b018360021b830155620005a9565b015160001960f88460031b161c19169055388080620014dc565b81810151835560209485019460019093019290910190620014bf565b9091508560021b85016000526020600020601f840160051c81016020851062001577575b90849392915b601f830160051c820181106200156757505062000576565b600081558594506001016200154f565b508062001549565b91607f169162000560565b015190503880620003cf565b90600286811b86010160005260206000209160005b601f1985168110620015ff575092600395949260019260609583601f19811610620015e6575b505050811b01600286811b85010155620003ea565b015160001983891b60f8161c19169055388080620015d1565b91926020600181928685015181550194019201620015ab565b600286811b8601016000526020600020601f840160051c81016020851062001660575b601f830160051c8201811062001653575050620003ac565b600081556001016200163b565b50806200163b565b90607f169062000398565b0151905038806200033f565b92508560021b85016000526020600020906000935b601f1984168510620016de576001945083601f19811610620016c4575b505050811b018360021b83015562000359565b015160001960f88460031b161c19169055388080620016b1565b8181015183556020948501946001909301929091019062001694565b9091508560021b85016000526020600020601f840160051c8101602085106200174c575b90849392915b601f830160051c820181106200173c57505062000326565b6000815585945060010162001724565b50806200171e565b91607f169162000310565b81600052600a6020526040600020816000526020526040600020600160ff1982541617905533916000805160206200580b833981519152600080a4388062000241565b60008181527f13da86008ba1c6922daee3e07db95305ef49ebced9f5467a0b8613fcc6b343e360205260408120805460ff191660011790553391906000805160206200580b8339815191528180a438620001e4565b0151905038806200016a565b601f19821695600160005260206000209160005b88811062001857575083600195969798106200183d575b505050811b0160015562000180565b015160001960f88460031b161c191690553880806200182e565b9192602060018192868501518155019401920162001817565b60016000527fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf6601f830160051c81019160208410620018cf575b601f0160051c01905b818110620018c257506200014b565b60008155600101620018b3565b9091508190620018aa565b90607f169062000137565b015190503880620000fe565b600080805293506000805160206200584b83398151915291905b601f198416851062001951576001945083601f1981161062001937575b505050811b0160005562000114565b015160001960f88460031b161c1916905538808062001928565b818101518355602094850194600190930192909101906200190b565b600080529091506000805160206200584b833981519152601f840160051c81019160208510620019c5575b90601f859493920160051c01905b818110620019b55750620000e5565b60008155849350600101620019a6565b909150819062001998565b91607f1691620000cf565b600080fd5b60405190608082016001600160401b0381118382101762000ef357604052565b60408051919082016001600160401b0381118382101762000ef357604052565b6040519060a082016001600160401b0381118382101762000ef357604052565b51906001600160a01b0382168203620019db57565b919082519283825260005b84811062001a82575050826000602080949584010152601f8019910116010190565b60208183018101518483018201520162001a6056fe608080604052600436101561001357600080fd5b60003560e01c90816301ffc9a7146121f45750806306fdde0314612151578063081812fc14612133578063095ea7b314611fb957806318160ddd14611f9b5780631959a00214611f3557806323b872dd14611e7f578063248a9ca314611e505780632c142e8c14611c2d5780632f2ff15d14611d9d5780632f745c5914611ceb57806336568abe14611c5957806341144e5d14611c2d57806342842e0e14611c0557806342966c6814611bd75780634b528a75146119a15780634dbc0583146119425780634f6ccce7146118b15780635eae9812146118905780635fe2a70f146115015780636352211e146114d15780636ef8304b146112eb57806370a08231146112c05780637f0b210c1461116957806381a5463f14610e1957806382acd08b146103ee57806386ada54914610c405780638aee812714610bfd57806391d1485414610bb057806395d89b4114610ae55780639e7c971a14610a47578063a217fddf14610a2b578063a22cb46514610959578063b88d4fde146108fa578063bbaedf9b146105d5578063c87b56dd1461059e578063d539139314610563578063d547741f14610522578063e487c346146104da578063e985e9c514610484578063f49fe11b14610466578063f7c618c11461043d578063f88bb8a41461041f578063f8bd5568146103ee5763fd6aa5af1461020e57600080fd5b346103e95761021c3661258f565b9161022561282b565b610232601254821061349e565b61023b816125c1565b509282600180950155600261024f836125c1565b500181516001600160401b0381116103d35761026b8254612422565b601f8111610388575b50602095601f8211600114610307578180917f71db52a17043d5aad33cd23bd11bf4e637be462df97ac15106354e2e84a084dd986000936102fc575b501b916000199060031b1c19161790555b6102f160036102cf846125c1565b50015491604051948594855260208501526080604085015260808401906122b6565b9060608301520390a1005b8601519250386102b0565b90601f1981169683600052806000209760005b818110610372575090827f71db52a17043d5aad33cd23bd11bf4e637be462df97ac15106354e2e84a084dd999210610359575b5050811b0190556102c1565b85015160001960f88460031b161c19169055388061034d565b868301518a55988401986020928301920161031a565b826000526020600020601f830160051c810191602084106103c9575b601f0160051c019087905b8281106103bd575050610274565b600081550187906103af565b90915081906103a4565b634e487b7160e01b600052604160045260246000fd5b600080fd5b346103e95760203660031901126103e957600435600052600e602052602060ff604060002054166040519015158152f35b346103e95760003660031901126103e9576020601354604051908152f35b346103e95760003660031901126103e9576011546040516001600160a01b039091168152602090f35b346103e95760003660031901126103e9576020600c54604051908152f35b346103e95760403660031901126103e95761049d6122db565b6104a56122f1565b9060018060a01b03809116600052600560205260406000209116600052602052602060ff604060002054166040519015158152f35b346103e95760403660031901126103e9576001600160a01b036104fb6122db565b16600052601460205260406000206024356000526020526020604060002054604051908152f35b346103e95760403660031901126103e9576105616004356105416122f1565b9080600052600a60205261055c600160406000200154612944565b612a44565b005b346103e95760003660031901126103e95760206040517f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a68152f35b346103e95760203660031901126103e9576105d16105bd60043561302e565b6040519182916020835260208301906122b6565b0390f35b346103e95760603660031901126103e9576105ee6122db565b6001600160401b036024358181116103e95761060e90369060040161255f565b919060449182359081116103e95761062a90369060040161255f565b610632612611565b61063d3686856123ae565b916106493683836123ae565b93610652612611565b83518551036108c25760005b845181101561080657610671818661309e565b5161067c828861309e565b51906013548110156107cb5760018060a01b038b1660005260146020526040600020816000526020526106b482604060002054612ee8565b816000526010602052600160406000200154106107875760005b8b8382106107165750506001600160a01b038b166000908152601460209081526040808320938352929052208054610711939261070a91612ee8565b905561301f565b61065e565b907faaf4e8c2bf95f40479722ae0838ec3e38cf5f906d4ee0652ee9755020fb7dc10606061078293600b90600182540180925561075382826130b2565b81600052600d6020528660406000205560405191825260018060a01b03166020820152856040820152a161301f565b6106ce565b60405162461bcd60e51b815260206004820152601d60248201527f45786365656473206d617820766f756368657273207065722075736572000000818b0152606490fd5b60405162461bcd60e51b8152602060048201526014602482015273496e76616c696420766f7563686572207479706560601b818b0152606490fd5b50868860009360005b86811061087a5750610863907ff6c1cfdacf540e29cdf91d6c1f074b89b4087ac7148ba987de29add89549628d95966108556040519687966060885260608801916139ce565b9185830360208701526139ce565b60408301959095526001600160a01b0316930390a2005b946108b76108bd916108b161089089888a6139be565b3561089c8a8c886139be565b35906000526010602052604060002054612ed5565b90612ee8565b9561301f565b61080f565b60405162461bcd60e51b81526020600482015260116024820152704d69736d61746368656420696e7075747360781b81880152606490fd5b346103e95760803660031901126103e9576109136122db565b61091b6122f1565b606435916001600160401b0383116103e957366023840112156103e95761094f61056193369060248160040135910161250d565b9160443591613515565b346103e95760403660031901126103e9576109726122db565b602435908115158092036103e9576001600160a01b0316903382146109e657336000526005602052604060002082600052602052604060002060ff1981541660ff83161790556040519081527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3160203392a3005b60405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606490fd5b346103e95760003660031901126103e957602060405160008152f35b346103e95760203660031901126103e9576004356012548110156103e957610a71610ac8916125c1565b5060405190610a8b82610a84818461245c565b038361238d565b610adb6001820154600360405193610ab185610aaa816002850161245c565b038661238d565b0154926040519586956080875260808701906122b6565b91602086015284820360408601526122b6565b9060608301520390f35b346103e95760003660031901126103e95760405160006001805490610b0982612422565b80855291818116908115610b895750600114610b30575b6105d1846105bd8186038261238d565b600081815292507fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf65b828410610b715750505081016020016105bd82610b20565b80546020858701810191909152909301928101610b59565b60ff191660208087019190915292151560051b850190920192506105bd9150839050610b20565b346103e95760403660031901126103e957610bc96122f1565b600435600052600a60205260406000209060018060a01b0316600052602052602060ff604060002054166040519015158152f35b346103e95760203660031901126103e957610c166122db565b610c1e61282b565b601180546001600160a01b0319166001600160a01b0392909216919091179055005b346103e957610c4e3661258f565b9091610c5861282b565b604051610c648161233c565b8181526020808201918583526002604082019386855260135460005260108452604060002092518355519160019283820155019251918251926001600160401b0384116103d357610cb58554612422565b601f8111610dd0575b5081601f8511600114610d3f57509280610d2f98959381937fd4a1cb1fcad59675f73877b7905683ba49d1151a852ec6b907a6d831c98cc2d19896600094610d34575b50501b916000199060031b1c19161790555b610d27601354946040519384938785612ffc565b0390a161301f565b601355005b015192508a80610d01565b9190601f9493941984168660005283600020936000905b828210610db9575050917fd4a1cb1fcad59675f73877b7905683ba49d1151a852ec6b907a6d831c98cc2d19795939185610d2f9b98969410610da0575b505050811b019055610d13565b015160001960f88460031b161c19169055888080610d93565b808886978294978701518155019601940190610d56565b8560005282600020601f860160051c810191848710610e0f575b601f0160051c019084905b828110610e03575050610cbe565b60008155018490610df5565b9091508190610dea565b346103e9576020806003193601126103e9576004356001600160401b0381116103e957610e4a90369060040161255f565b9190610e5533613ba6565b60009060005b84811061102d575033600052600f8352610e98612710610e906003610e876002604060002001546125c1565b50015485612ed5565b048093612ee8565b93670de0b6b3a764000094858102958187041490151715611017577f39206fab36231a8c0a4a66153f54bd9212a924a2eb4373bf3702862285b59b7092610eec6040519384936080855260808501916139ce565b90338684015286604084015260608301520390a16011546040516340c10f1960e01b815233600482015260248101849052908290829060449082906000906001600160a01b03165af190811561100b57600091610fd5575b5015610f9a57600f91336000528282526040600020610f64828254612ee8565b905533600052828252610f806001604060002001918254612ee8565b9055336000525242600460406000200155610561336139f2565b6064906040519062461bcd60e51b825260048201526014602482015273151bdad95b881b5a5b9d1a5b99c819985a5b195960621b6044820152fd5b90508181813d8311611004575b610fec818361238d565b810103126103e9575180151581036103e95783610f44565b503d610fe2565b6040513d6000823e3d90fd5b634e487b7160e01b600052601160045260246000fd5b916110398386846139be565b35336001600160a01b0361104c83612b7d565b16036111345780600052600d8086526040600020546000526010865260406000209160026110a4604051946110808661233c565b8054865260018101548a87015261109d604051809481930161245c565b038261238d565b604084015280600052600e875260ff604060002054166110ef57916110ea9391836110d16110e495612cae565b6000528752600060408120555190612ee8565b9261301f565b610e5b565b60405162461bcd60e51b815260048101889052601b60248201527f43616e6e6f74206275726e206d656d62657273686970204e46547300000000006044820152606490fd5b60405162461bcd60e51b815260048101869052600d60248201526c2737ba103a34329037bbb732b960991b6044820152606490fd5b346103e95760403660031901126103e9576111826122db565b6024359061118e612611565b6001600160a01b0381166000818152600f60205260409020600301549091906112705761126b7f32f52e867cc6cf04fce2ec303e8cb36857807be1c4b0604d6894683ab2639db3936111e3601254821061349e565b60016111ee826125c1565b50015484600052600f60205260406000209080600183015581556004429101556001600b54019384600b5561122385856130b2565b84600052600e6020526040600020600160ff19825416179055600052600f6020528060026040600020866003820155015561125d816125c1565b5090604051948594856134ea565b0390a1005b60405162461bcd60e51b815260206004820152602260248201527f5573657220616c7265616479206f776e732061206d656d62657273686970204e604482015261119560f21b6064820152608490fd5b346103e95760203660031901126103e95760206112e36112de6122db565b612aba565b604051908152f35b346103e95760803660031901126103e9576001600160401b036024356004356044356064358481116103e957611325903690600401612544565b9361132e61282b565b6040519061133b8261233c565b8482526020918281019284845260026040830194898652876000526010835260406000209351845551926001938482015501935180519384116103d3576113828554612422565b601f8111611488575b5081601f85116001146113f7575092807f59fd7ad3ee3ee3ca14c9749db5b6c7f69fd7a529c55a7fc9e9ea968b307b5a6c999593819361126b98966000946113ec575b50501b916000199060031b1c19161790555b60405194859485612ffc565b015192508b806113ce565b9190601f9493941984168660005283600020936000905b8282106114715750509161126b97959391857f59fd7ad3ee3ee3ca14c9749db5b6c7f69fd7a529c55a7fc9e9ea968b307b5a6c9c98969410611458575b505050811b0190556113e0565b015160001960f88460031b161c1916905589808061144b565b80888697829497870151815501960194019061140e565b8560005282600020601f860160051c8101918487106114c7575b601f0160051c019084905b8281106114bb57505061138b565b600081550184906114ad565b90915081906114a2565b346103e95760203660031901126103e95760206114ef600435612b7d565b6040516001600160a01b039091168152f35b346103e95760803660031901126103e9576004356001600160401b0381116103e957611531903690600401612544565b6044356001600160401b0381116103e957611550903690600401612544565b9061155961282b565b604051608081018181106001600160401b038211176103d35760405281815260243560208201528260408201526064356060820152601254600160401b8110156103d3578060016115ad92016012556125c1565b91909161187a5780518051906001600160401b0382116103d35781906115d38554612422565b601f811161182a575b50602090601f83116001146117be576000926117b3575b50508160011b916000199060031b1c19161782555b6020810151600183015560408101518051906001600160401b0382116103d3576116356002850154612422565b601f811161176c575b50602090601f83116001146116f8579180600394926060946000926116ed575b50508160011b9160001990861b1c19161760028501555b01519101556012546000198101908111611017576116e07f1545cb54bccc2e874d36b93084ec607936cd118914f91e559dc8521e848551f0936116ca604051948594855260a0602086015260a08501906122b6565b90602435604085015283820360608501526122b6565b60643560808301520390a1005b01519050888061165e565b906002850160005260206000209160005b601f19851681106117545750926003949260019260609583601f1981161061173c575b505050811b016002850155611675565b015160001983881b60f8161c1916905588808061172c565b91926020600181928685015181550194019201611709565b600285016000526020600020601f840160051c8101602085106117ac575b601f830160051c820181106117a057505061163e565b6000815560010161178a565b508061178a565b0151905086806115f3565b9250846000526020600020906000935b601f198416851061180f576001945083601f198116106117f6575b505050811b018255611608565b015160001960f88460031b161c191690558680806117e9565b818101518355602094850194600190930192909101906117ce565b909150846000526020600020601f840160051c810160208510611873575b90849392915b601f830160051c820181106118645750506115dc565b6000815585945060010161184e565b5080611848565b634e487b7160e01b600052600060045260246000fd5b346103e95760203660031901126103e9576118a961282b565b600435600c55005b346103e95760203660031901126103e9576004356008548110156118e8576118da602091612e9e565b90546040519160031b1c8152f35b60405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b6064820152608490fd5b346103e95760203660031901126103e9576004356000526010602052604060002080546105d1600261198360018501549461109d604051809481930161245c565b604051938493845260208401526060604084015260608301906122b6565b346103e9576060806003193601126103e9576119bb6122db565b6024916001600160401b03919083358381116103e9576119df903690600401612404565b9260449081359081116103e9576119fa903690600401612404565b91611a03612611565b8451835103611ba0576001600160a01b03841660005b865181101561056157611a2c818861309e565b51611a37828761309e565b5190601354811015611b66578360005260146020908082526040600020836000528252611a6984604060002054612ee8565b8360005260108352600190816040600020015410611b235760005b888c878310611abe575050505090611ab9949392918660005281526040600020916000525261070a6040600020918254612ee8565b611a19565b611b1e92917faaf4e8c2bf95f40479722ae0838ec3e38cf5f906d4ee0652ee9755020fb7dc1091611af8600b8781540192838092556130b2565b80600052600d8852886040600020556040519081528b88820152886040820152a161301f565b611a84565b60405162461bcd60e51b815260048101849052601d818f01527f45786365656473206d617820766f756368657273207065722075736572000000818b0152606490fd5b60405162461bcd60e51b8152602060048201526014818c015273496e76616c696420766f7563686572207479706560601b81880152606490fd5b60405162461bcd60e51b815260206004820152601181880152704d69736d61746368656420696e7075747360781b81840152606490fd5b346103e95760203660031901126103e957610561600435611c00611bfb8233612c40565b612bde565b612cae565b346103e957610561611c1636612307565b9060405192611c2484612357565b60008452613515565b346103e95760203660031901126103e957600435600052600d6020526020604060002054604051908152f35b346103e95760403660031901126103e957611c726122f1565b336001600160a01b03821603611c8e5761056190600435612a44565b60405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608490fd5b346103e95760403660031901126103e957611d046122db565b60243590611d1181612aba565b821015611d445760018060a01b031660005260066020526040600020906000526020526020604060002054604051908152f35b60405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b6064820152608490fd5b346103e95760403660031901126103e957600435611db96122f1565b81600052600a602052611dd3600160406000200154612944565b81600052600a60205260406000209060018060a01b0316908160005260205260ff6040600020541615611e0257005b81600052600a6020526040600020816000526020526040600020600160ff1982541617905533917f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d600080a4005b346103e95760203660031901126103e957600435600052600a6020526020600160406000200154604051908152f35b346103e957611e8d36612307565b91611ead611e9a84612b7d565b6001600160a01b038381169116146135b0565b611eba611bfb8433612c40565b611ec583838361360a565b82600052600e60205260ff60406000205416600014611ee95790610561929161383b565b604080516001600160a01b0392831681529290911660208301528101919091527fce98ad71a481f07ab41287f2afce07581888c654dfd62100a2b52b819ca2291690806060810161126b565b346103e95760203660031901126103e9576001600160a01b03611f566122db565b16600052600f60205260a06040600020805490600181015490600281015460046003830154920154926040519485526020850152604084015260608301526080820152f35b346103e95760003660031901126103e9576020600854604051908152f35b346103e95760403660031901126103e957611fd26122db565b602435906001600160a01b038080611fe985612b7d565b169216918083146120e4578033149081156120bf575b501561205457600083815260046020526040902080546001600160a01b0319168317905561202c83612b7d565b167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600080a4005b60405162461bcd60e51b815260206004820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c0000006064820152608490fd5b9050600052600560205260406000203360005260205260ff6040600020541684611fff565b60405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608490fd5b346103e95760203660031901126103e95760206114ef600435612ba0565b346103e95760003660031901126103e9576040516000805461217281612422565b80845290600190818116908115610b89575060011461219b576105d1846105bd8186038261238d565b600080805292507f290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e5635b8284106121dc5750505081016020016105bd82610b20565b805460208587018101919091529093019281016121c4565b346103e95760203660031901126103e9576004359063ffffffff60e01b82168092036103e957602091637965db0b60e01b8114908115612236575b5015158152f35b63780e9d6360e01b811491508115612250575b508361222f565b6380ac58cd60e01b811491508115612282575b8115612271575b5083612249565b6301ffc9a760e01b1490508361226a565b635b5e139f60e01b81149150612263565b60005b8381106122a65750506000910152565b8181015183820152602001612296565b906020916122cf81518092818552858086019101612293565b601f01601f1916010190565b600435906001600160a01b03821682036103e957565b602435906001600160a01b03821682036103e957565b60609060031901126103e9576001600160a01b039060043582811681036103e9579160243590811681036103e9579060443590565b606081019081106001600160401b038211176103d357604052565b602081019081106001600160401b038211176103d357604052565b608081019081106001600160401b038211176103d357604052565b90601f801991011681019081106001600160401b038211176103d357604052565b9092916001600160401b0384116103d3578360051b60405192602080946123d78285018261238d565b80978152019181019283116103e957905b8282106123f55750505050565b813581529083019083016123e8565b9080601f830112156103e95781602061241f933591016123ae565b90565b90600182811c92168015612452575b602083101461243c57565b634e487b7160e01b600052602260045260246000fd5b91607f1691612431565b906000929180549161246d83612422565b9182825260019384811690816000146124cf575060011461248f575b50505050565b90919394506000526020928360002092846000945b8386106124bb575050505001019038808080612489565b8054858701830152940193859082016124a4565b9294505050602093945060ff191683830152151560051b01019038808080612489565b6001600160401b0381116103d357601f01601f191660200190565b929192612519826124f2565b91612527604051938461238d565b8294818452818301116103e9578281602093846000960137010152565b9080601f830112156103e95781602061241f9335910161250d565b9181601f840112156103e9578235916001600160401b0383116103e9576020808501948460051b0101116103e957565b60606003198201126103e9576004359160243591604435906001600160401b0382116103e95761241f91600401612544565b6012548110156125fb57601260005260021b7fbb8a6a4669ba250d26cd7a459eca9d215f8307e33aebe50379bc5a3617ec34440190600090565b634e487b7160e01b600052603260045260246000fd5b3360009081527faa1d7351356c4ddc11907b1ee0660f579cfdf507235af2ae01ecd22a4b7ceaae602090815260408083205490927f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a69160ff16156126755750505050565b61267e33612f13565b9184519061268b82612372565b60428252848201926060368537825115612817576030845382516001908110156128035790607860218501536041915b8083116127a95750505061276757604861276393869361274793612738985198899376020b1b1b2b9b9a1b7b73a3937b61d1030b1b1b7bab73a1604d1b8a86015261270f815180928c603789019101612293565b8401917001034b99036b4b9b9b4b733903937b6329607d1b603784015251809386840190612293565b0103602881018752018561238d565b5192839262461bcd60e51b8452600484015260248301906122b6565b0390fd5b60648486519062461bcd60e51b825280600483015260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152fd5b909192600f811660108110156127ef576127e891906f181899199a1a9b1b9c1cb0b131b232b360811b901a6127de8688612ef5565b5360041c93612f06565b91906126bb565b634e487b7160e01b84526032600452602484fd5b634e487b7160e01b82526032600452602482fd5b634e487b7160e01b81526032600452602490fd5b3360009081527f13da86008ba1c6922daee3e07db95305ef49ebced9f5467a0b8613fcc6b343e3602090815260408083205490929060ff161561286d57505050565b61287633612f13565b908084519061288482612372565b60428252848201926060368537825115612817576030845382516001908110156128035790607860218501536041915b8083116129085750505061276757604861276393869361274793612738985198899376020b1b1b2b9b9a1b7b73a3937b61d1030b1b1b7bab73a1604d1b8a86015261270f815180928c603789019101612293565b909192600f811660108110156127ef5761293d91906f181899199a1a9b1b9c1cb0b131b232b360811b901a6127de8688612ef5565b91906128b4565b600090808252602090600a8252604092838120338252835260ff84822054161561296e5750505050565b61297733612f13565b9184519061298482612372565b60428252848201926060368537825115612817576030845382516001908110156128035790607860218501536041915b808311612a085750505061276757604861276393869361274793612738985198899376020b1b1b2b9b9a1b7b73a3937b61d1030b1b1b7bab73a1604d1b8a86015261270f815180928c603789019101612293565b909192600f811660108110156127ef57612a3d91906f181899199a1a9b1b9c1cb0b131b232b360811b901a6127de8688612ef5565b91906129b4565b90600091808352600a602052604083209160018060a01b03169182845260205260ff604084205416612a7557505050565b808352600a602052604083208284526020526040832060ff1981541690557ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b339380a4565b6001600160a01b03168015612ada57600052600360205260406000205490565b60405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b6064820152608490fd5b15612b3857565b60405162461bcd60e51b815260206004820152601860248201527f4552433732313a20696e76616c696420746f6b656e20494400000000000000006044820152606490fd5b6000908152600260205260409020546001600160a01b031661241f811515612b31565b600081815260026020526040902054612bc3906001600160a01b03161515612b31565b6000908152600460205260409020546001600160a01b031690565b15612be557565b60405162461bcd60e51b815260206004820152602d60248201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560448201526c1c881bdc88185c1c1c9bdd9959609a1b6064820152608490fd5b906001600160a01b038080612c5484612b7d565b16931691838314938415612c87575b508315612c71575b50505090565b612c7d91929350612ba0565b1614388080612c6b565b909350600052600560205260406000208260005260205260ff604060002054169238612c63565b612cb781612b7d565b6001600160a01b03908082169081612e1857505060085482600052600960205280604060002055600160401b8110156103d35782612cfe826001612d179401600855612e9e565b90919082549060031b91821b91600019901b1916179055565b6008546000198082019290918311611017576000928484526009602052604090612d448286205491612e9e565b90549060031b1c612d5881612cfe84612e9e565b855260096020528185205584845283818120556008548015612e04578301612d7f81612e9e565b8582549160031b1b19169055600855612d9785612b7d565b918585526004602052818520926bffffffffffffffffffffffff60a01b9384815416905516928385526003602052818520908154019055848452600260205283209081541690557fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8280a4565b634e487b7160e01b85526031600452602485fd5b612e2190612aba565b6000198101919082116110175760009184835260206007815260409283852054838103612e67575b50868552848481205584526006815282842091845252812055612d17565b8186526006835284862084875283528486205482875260068452858720828852845280868820558652600783528486205538612e49565b6008548110156125fb5760086000527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30190600090565b8181029291811591840414171561101757565b9190820180921161101757565b9081518110156125fb570160200190565b8015611017576000190190565b60405190612f208261233c565b602a82526020820160403682378251156125fb576030905381516001908110156125fb57607860218401536029905b808211612fa3575050612f5f5790565b606460405162461bcd60e51b815260206004820152602060248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152fd5b9091600f8116906010821015612fe757612fe1916f181899199a1a9b1b9c1cb0b131b232b360811b901a612fd78587612ef5565b5360041c92612f06565b90612f4f565b60246000634e487b7160e01b81526032600452fd5b909260809261241f959483526020830152604082015281606082015201906122b6565b60001981146110175760010190565b6000818152600e60205260409160ff838320541661307157916002818361109d9561241f9552600d6020528181205481526010602052200190519283809261245c565b508161109d6130916002809561241f95338152600f6020522001546125c1565b509151809481930161245c565b80518210156125fb5760209160051b010190565b906040918251926130c284612357565b60008085526001600160a01b0383169182156131f7576000858152600260205260409020546130fd906001600160a01b031615155b156132ad565b600854858352602090600982528083852055600160401b8110156131e3579286949192600286946131406131dc9a612cfe8960016131e19f9d9b01600855612e9e565b61314987612aba565b858552600682528385208186528252838520879055868552600782528385205560008681526002602052604090205461318c906001600160a01b031615156130f7565b848452600381528284208054600101905585845252812080546001600160a01b031916831790557fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8180a46132f9565b61328d565b565b634e487b7160e01b84526041600452602484fd5b5162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606490fd5b60809060208152603260208201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b60608201520190565b1561329457565b60405162461bcd60e51b8152806127636004820161323a565b156132b457565b60405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606490fd5b91929091803b1561340e57613346936040519081630a85bd0160e11b9384825233600483015260009687602484015260448301526080606483015281878160209a8b9660848301906122b6565b03926001600160a01b03165af18491816133ca575b506133b9575050503d6000146133b1573d613375816124f2565b90613383604051928361238d565b81528091833d92013e5b805191826133ae5760405162461bcd60e51b8152806127636004820161323a565b01fd5b50606061338d565b6001600160e01b0319161492509050565b9091508581813d8311613407575b6133e2818361238d565b8101031261340357516001600160e01b03198116810361340357903861335b565b8480fd5b503d6133d8565b50915050600190565b92939190803b1561349457613469946040518092630a85bd0160e11b9485835233600484015260018060a01b03809816602484015260448301526080606483015281806020998a9560848301906122b6565b03916000988991165af18491816133ca57506133b9575050503d6000146133b1573d613375816124f2565b5050915050600190565b156134a557565b60405162461bcd60e51b815260206004820152601860248201527f496e76616c6964206d656d62657273686970206c6576656c00000000000000006044820152606490fd5b909260809261241f959460018060a01b0316835260208301526040820152816060820152019061245c565b9091926131dc61353f9161352c611bfb8733612c40565b61353786868661360a565b858585613417565b82600052600e60205260ff6040600020541660001461356357906131e1929161383b565b604080516001600160a01b0392831681529290911660208301528101919091527fce98ad71a481f07ab41287f2afce07581888c654dfd62100a2b52b819ca229169080606081015b0390a1565b156135b757565b60405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201526437bbb732b960d91b6064820152608490fd5b61362e9161361784612b7d565b6001600160a01b03938484169391851684146135b0565b8382169384156137ea57839182613747575090506008549085600052600960205281604060002055600160401b8210156103d3576136949261367b87612cfe856001899701600855612e9e565b828603613714575b5061368d86612b7d565b16146135b0565b7fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60008481526004602052604081206bffffffffffffffffffffffff60a01b9081815416905583825260036020526040822060001981540190558482526040822060018154019055858252600260205284604083209182541617905580a4565b61371d90612aba565b60406000878152600660205281812083825260205288828220558881526007602052205538613683565b858303613759575b506136949261367b565b613764919250612aba565b6000198101919082116110175761369492849260009088825260209060078252604091828420548281036137b3575b508a8452838381205586845260068152828420918452528120559261374f565b8785526006825283852083865282528385205488865260068352848620828752835280858720558552600782528385205538613793565b60405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608490fd5b6135ab7f64d5482277762ebe683295a2f828dbfd7e27d4eec62d2cb919cfb73e4ead27bc939260018060a01b0393848416600052600f6020526040600020600281015490600181549101549187851660005260406000206003810154908115600014613979575050878516600052600f6020526002604060002085600382015501555b868416600052600f6020526138d96040600020918254612ee8565b9055858316600052600f6020526138f96001604060002001918254612ee8565b9055848216600052600f6020524260046040600020015584841660005260006001604082208260028201558260038201550155613935826139f2565b848216600052600f602052846139526002604060002001546125c1565b5092604051968796168652166020850152604084015260806060840152608083019061245c565b600201548211156139ad5761398e9086613cd8565b878516600052600f6020526002604060002085600382015501556138be565b50506139b98387613cd8565b6138be565b91908110156125fb5760051b0190565b81835290916001600160fb1b0383116103e95760209260051b809284830137010190565b60018060a01b03811690600091808352602092600f8452604091828220946001916002838801549701549687906012546000198101908111613b92575b85811015613b65575b50508703613a4a575b50505050505050565b600295600f938286528484526003878720015480613afc575b5080891015613a81575b505083525220015538808080808080613a41565b7f32f52e867cc6cf04fce2ec303e8cb36857807be1c4b0604d6894683ab2639db39181600b54019182600b55613ab783836130b2565b8488528686528260038a8a200155828852600e86528888209060ff19825416179055613af2613ae58b6125c1565b508b8a51948594856134ea565b0390a13880613a6d565b613b5c81613b2a7fbba21a94bc5a76739aac854eb9126ba1b6799643d19ab81a6876d71d60382b4293612cae565b808952600e8752898920805460ff1916905589516001600160a01b038616815260208101919091529081906040820190565b0390a138613a63565b85613b6f826125c1565b500154821015613b8757613b8290612f06565b613a2f565b985038905080613a38565b634e487b7160e01b87526011600452602487fd5b6001600160a01b0381166000818152600f602052604080822060048101546003909101549294929391908015613cd057600c54613be291612ee8565b4211613bf0575b5050505050565b8482613c5b937f9f2e3cedd5ba5d07a8eb40b9ce1708d39a08d88e1df4ec40531135cbcee3ba969752600f6020526003838320015480613c68575b50508181206002810182905560010155516001600160a01b03909216825260208201929092529081906040820190565b0390a13880808080613be9565b613c7190612cae565b808252600f60209081528383206003015484516001600160a01b0388168152918201527fbba21a94bc5a76739aac854eb9126ba1b6799643d19ab81a6876d71d60382b4290604090a18152600f60205280600383822001553880613c2b565b505050505050565b907fbba21a94bc5a76739aac854eb9126ba1b6799643d19ab81a6876d71d60382b4291613d0482612cae565b6000828152600e6020908152604091829020805460ff1916905581516001600160a01b03909316835282019290925290819081016135ab56fea2646970667358221220d90a7ebd1d9adf289f77c5e707de4cf41103ad0166816c5e1b52bf57e19e779064736f6c634300081400332f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0dbb8a6a4669ba250d26cd7a459eca9d215f8307e33aebe50379bc5a3617ec3444290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e56368747470733a2f2f6c696d652d62617369632d7468727573682d3335312e6d796f374e435a51617752593777425150726d62706776797165684c78784b4a414c1545cb54bccc2e874d36b93084ec607936cd118914f91e559dc8521e848551f070696e6174612e636c6f75642f697066732f516d544d4d5143574b31765658790000000000000000000000002162ce70513413b6dfe2c34ffa992b1e70e462930000000000000000000000002f758de9c4b83ed1a3b777b5f905d46fa1c2c7250000000000000000000000002f758de9c4b83ed1a3b777b5f905d46fa1c2c725
Deployed Bytecode
0x608080604052600436101561001357600080fd5b60003560e01c90816301ffc9a7146121f45750806306fdde0314612151578063081812fc14612133578063095ea7b314611fb957806318160ddd14611f9b5780631959a00214611f3557806323b872dd14611e7f578063248a9ca314611e505780632c142e8c14611c2d5780632f2ff15d14611d9d5780632f745c5914611ceb57806336568abe14611c5957806341144e5d14611c2d57806342842e0e14611c0557806342966c6814611bd75780634b528a75146119a15780634dbc0583146119425780634f6ccce7146118b15780635eae9812146118905780635fe2a70f146115015780636352211e146114d15780636ef8304b146112eb57806370a08231146112c05780637f0b210c1461116957806381a5463f14610e1957806382acd08b146103ee57806386ada54914610c405780638aee812714610bfd57806391d1485414610bb057806395d89b4114610ae55780639e7c971a14610a47578063a217fddf14610a2b578063a22cb46514610959578063b88d4fde146108fa578063bbaedf9b146105d5578063c87b56dd1461059e578063d539139314610563578063d547741f14610522578063e487c346146104da578063e985e9c514610484578063f49fe11b14610466578063f7c618c11461043d578063f88bb8a41461041f578063f8bd5568146103ee5763fd6aa5af1461020e57600080fd5b346103e95761021c3661258f565b9161022561282b565b610232601254821061349e565b61023b816125c1565b509282600180950155600261024f836125c1565b500181516001600160401b0381116103d35761026b8254612422565b601f8111610388575b50602095601f8211600114610307578180917f71db52a17043d5aad33cd23bd11bf4e637be462df97ac15106354e2e84a084dd986000936102fc575b501b916000199060031b1c19161790555b6102f160036102cf846125c1565b50015491604051948594855260208501526080604085015260808401906122b6565b9060608301520390a1005b8601519250386102b0565b90601f1981169683600052806000209760005b818110610372575090827f71db52a17043d5aad33cd23bd11bf4e637be462df97ac15106354e2e84a084dd999210610359575b5050811b0190556102c1565b85015160001960f88460031b161c19169055388061034d565b868301518a55988401986020928301920161031a565b826000526020600020601f830160051c810191602084106103c9575b601f0160051c019087905b8281106103bd575050610274565b600081550187906103af565b90915081906103a4565b634e487b7160e01b600052604160045260246000fd5b600080fd5b346103e95760203660031901126103e957600435600052600e602052602060ff604060002054166040519015158152f35b346103e95760003660031901126103e9576020601354604051908152f35b346103e95760003660031901126103e9576011546040516001600160a01b039091168152602090f35b346103e95760003660031901126103e9576020600c54604051908152f35b346103e95760403660031901126103e95761049d6122db565b6104a56122f1565b9060018060a01b03809116600052600560205260406000209116600052602052602060ff604060002054166040519015158152f35b346103e95760403660031901126103e9576001600160a01b036104fb6122db565b16600052601460205260406000206024356000526020526020604060002054604051908152f35b346103e95760403660031901126103e9576105616004356105416122f1565b9080600052600a60205261055c600160406000200154612944565b612a44565b005b346103e95760003660031901126103e95760206040517f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a68152f35b346103e95760203660031901126103e9576105d16105bd60043561302e565b6040519182916020835260208301906122b6565b0390f35b346103e95760603660031901126103e9576105ee6122db565b6001600160401b036024358181116103e95761060e90369060040161255f565b919060449182359081116103e95761062a90369060040161255f565b610632612611565b61063d3686856123ae565b916106493683836123ae565b93610652612611565b83518551036108c25760005b845181101561080657610671818661309e565b5161067c828861309e565b51906013548110156107cb5760018060a01b038b1660005260146020526040600020816000526020526106b482604060002054612ee8565b816000526010602052600160406000200154106107875760005b8b8382106107165750506001600160a01b038b166000908152601460209081526040808320938352929052208054610711939261070a91612ee8565b905561301f565b61065e565b907faaf4e8c2bf95f40479722ae0838ec3e38cf5f906d4ee0652ee9755020fb7dc10606061078293600b90600182540180925561075382826130b2565b81600052600d6020528660406000205560405191825260018060a01b03166020820152856040820152a161301f565b6106ce565b60405162461bcd60e51b815260206004820152601d60248201527f45786365656473206d617820766f756368657273207065722075736572000000818b0152606490fd5b60405162461bcd60e51b8152602060048201526014602482015273496e76616c696420766f7563686572207479706560601b818b0152606490fd5b50868860009360005b86811061087a5750610863907ff6c1cfdacf540e29cdf91d6c1f074b89b4087ac7148ba987de29add89549628d95966108556040519687966060885260608801916139ce565b9185830360208701526139ce565b60408301959095526001600160a01b0316930390a2005b946108b76108bd916108b161089089888a6139be565b3561089c8a8c886139be565b35906000526010602052604060002054612ed5565b90612ee8565b9561301f565b61080f565b60405162461bcd60e51b81526020600482015260116024820152704d69736d61746368656420696e7075747360781b81880152606490fd5b346103e95760803660031901126103e9576109136122db565b61091b6122f1565b606435916001600160401b0383116103e957366023840112156103e95761094f61056193369060248160040135910161250d565b9160443591613515565b346103e95760403660031901126103e9576109726122db565b602435908115158092036103e9576001600160a01b0316903382146109e657336000526005602052604060002082600052602052604060002060ff1981541660ff83161790556040519081527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3160203392a3005b60405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606490fd5b346103e95760003660031901126103e957602060405160008152f35b346103e95760203660031901126103e9576004356012548110156103e957610a71610ac8916125c1565b5060405190610a8b82610a84818461245c565b038361238d565b610adb6001820154600360405193610ab185610aaa816002850161245c565b038661238d565b0154926040519586956080875260808701906122b6565b91602086015284820360408601526122b6565b9060608301520390f35b346103e95760003660031901126103e95760405160006001805490610b0982612422565b80855291818116908115610b895750600114610b30575b6105d1846105bd8186038261238d565b600081815292507fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf65b828410610b715750505081016020016105bd82610b20565b80546020858701810191909152909301928101610b59565b60ff191660208087019190915292151560051b850190920192506105bd9150839050610b20565b346103e95760403660031901126103e957610bc96122f1565b600435600052600a60205260406000209060018060a01b0316600052602052602060ff604060002054166040519015158152f35b346103e95760203660031901126103e957610c166122db565b610c1e61282b565b601180546001600160a01b0319166001600160a01b0392909216919091179055005b346103e957610c4e3661258f565b9091610c5861282b565b604051610c648161233c565b8181526020808201918583526002604082019386855260135460005260108452604060002092518355519160019283820155019251918251926001600160401b0384116103d357610cb58554612422565b601f8111610dd0575b5081601f8511600114610d3f57509280610d2f98959381937fd4a1cb1fcad59675f73877b7905683ba49d1151a852ec6b907a6d831c98cc2d19896600094610d34575b50501b916000199060031b1c19161790555b610d27601354946040519384938785612ffc565b0390a161301f565b601355005b015192508a80610d01565b9190601f9493941984168660005283600020936000905b828210610db9575050917fd4a1cb1fcad59675f73877b7905683ba49d1151a852ec6b907a6d831c98cc2d19795939185610d2f9b98969410610da0575b505050811b019055610d13565b015160001960f88460031b161c19169055888080610d93565b808886978294978701518155019601940190610d56565b8560005282600020601f860160051c810191848710610e0f575b601f0160051c019084905b828110610e03575050610cbe565b60008155018490610df5565b9091508190610dea565b346103e9576020806003193601126103e9576004356001600160401b0381116103e957610e4a90369060040161255f565b9190610e5533613ba6565b60009060005b84811061102d575033600052600f8352610e98612710610e906003610e876002604060002001546125c1565b50015485612ed5565b048093612ee8565b93670de0b6b3a764000094858102958187041490151715611017577f39206fab36231a8c0a4a66153f54bd9212a924a2eb4373bf3702862285b59b7092610eec6040519384936080855260808501916139ce565b90338684015286604084015260608301520390a16011546040516340c10f1960e01b815233600482015260248101849052908290829060449082906000906001600160a01b03165af190811561100b57600091610fd5575b5015610f9a57600f91336000528282526040600020610f64828254612ee8565b905533600052828252610f806001604060002001918254612ee8565b9055336000525242600460406000200155610561336139f2565b6064906040519062461bcd60e51b825260048201526014602482015273151bdad95b881b5a5b9d1a5b99c819985a5b195960621b6044820152fd5b90508181813d8311611004575b610fec818361238d565b810103126103e9575180151581036103e95783610f44565b503d610fe2565b6040513d6000823e3d90fd5b634e487b7160e01b600052601160045260246000fd5b916110398386846139be565b35336001600160a01b0361104c83612b7d565b16036111345780600052600d8086526040600020546000526010865260406000209160026110a4604051946110808661233c565b8054865260018101548a87015261109d604051809481930161245c565b038261238d565b604084015280600052600e875260ff604060002054166110ef57916110ea9391836110d16110e495612cae565b6000528752600060408120555190612ee8565b9261301f565b610e5b565b60405162461bcd60e51b815260048101889052601b60248201527f43616e6e6f74206275726e206d656d62657273686970204e46547300000000006044820152606490fd5b60405162461bcd60e51b815260048101869052600d60248201526c2737ba103a34329037bbb732b960991b6044820152606490fd5b346103e95760403660031901126103e9576111826122db565b6024359061118e612611565b6001600160a01b0381166000818152600f60205260409020600301549091906112705761126b7f32f52e867cc6cf04fce2ec303e8cb36857807be1c4b0604d6894683ab2639db3936111e3601254821061349e565b60016111ee826125c1565b50015484600052600f60205260406000209080600183015581556004429101556001600b54019384600b5561122385856130b2565b84600052600e6020526040600020600160ff19825416179055600052600f6020528060026040600020866003820155015561125d816125c1565b5090604051948594856134ea565b0390a1005b60405162461bcd60e51b815260206004820152602260248201527f5573657220616c7265616479206f776e732061206d656d62657273686970204e604482015261119560f21b6064820152608490fd5b346103e95760203660031901126103e95760206112e36112de6122db565b612aba565b604051908152f35b346103e95760803660031901126103e9576001600160401b036024356004356044356064358481116103e957611325903690600401612544565b9361132e61282b565b6040519061133b8261233c565b8482526020918281019284845260026040830194898652876000526010835260406000209351845551926001938482015501935180519384116103d3576113828554612422565b601f8111611488575b5081601f85116001146113f7575092807f59fd7ad3ee3ee3ca14c9749db5b6c7f69fd7a529c55a7fc9e9ea968b307b5a6c999593819361126b98966000946113ec575b50501b916000199060031b1c19161790555b60405194859485612ffc565b015192508b806113ce565b9190601f9493941984168660005283600020936000905b8282106114715750509161126b97959391857f59fd7ad3ee3ee3ca14c9749db5b6c7f69fd7a529c55a7fc9e9ea968b307b5a6c9c98969410611458575b505050811b0190556113e0565b015160001960f88460031b161c1916905589808061144b565b80888697829497870151815501960194019061140e565b8560005282600020601f860160051c8101918487106114c7575b601f0160051c019084905b8281106114bb57505061138b565b600081550184906114ad565b90915081906114a2565b346103e95760203660031901126103e95760206114ef600435612b7d565b6040516001600160a01b039091168152f35b346103e95760803660031901126103e9576004356001600160401b0381116103e957611531903690600401612544565b6044356001600160401b0381116103e957611550903690600401612544565b9061155961282b565b604051608081018181106001600160401b038211176103d35760405281815260243560208201528260408201526064356060820152601254600160401b8110156103d3578060016115ad92016012556125c1565b91909161187a5780518051906001600160401b0382116103d35781906115d38554612422565b601f811161182a575b50602090601f83116001146117be576000926117b3575b50508160011b916000199060031b1c19161782555b6020810151600183015560408101518051906001600160401b0382116103d3576116356002850154612422565b601f811161176c575b50602090601f83116001146116f8579180600394926060946000926116ed575b50508160011b9160001990861b1c19161760028501555b01519101556012546000198101908111611017576116e07f1545cb54bccc2e874d36b93084ec607936cd118914f91e559dc8521e848551f0936116ca604051948594855260a0602086015260a08501906122b6565b90602435604085015283820360608501526122b6565b60643560808301520390a1005b01519050888061165e565b906002850160005260206000209160005b601f19851681106117545750926003949260019260609583601f1981161061173c575b505050811b016002850155611675565b015160001983881b60f8161c1916905588808061172c565b91926020600181928685015181550194019201611709565b600285016000526020600020601f840160051c8101602085106117ac575b601f830160051c820181106117a057505061163e565b6000815560010161178a565b508061178a565b0151905086806115f3565b9250846000526020600020906000935b601f198416851061180f576001945083601f198116106117f6575b505050811b018255611608565b015160001960f88460031b161c191690558680806117e9565b818101518355602094850194600190930192909101906117ce565b909150846000526020600020601f840160051c810160208510611873575b90849392915b601f830160051c820181106118645750506115dc565b6000815585945060010161184e565b5080611848565b634e487b7160e01b600052600060045260246000fd5b346103e95760203660031901126103e9576118a961282b565b600435600c55005b346103e95760203660031901126103e9576004356008548110156118e8576118da602091612e9e565b90546040519160031b1c8152f35b60405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b6064820152608490fd5b346103e95760203660031901126103e9576004356000526010602052604060002080546105d1600261198360018501549461109d604051809481930161245c565b604051938493845260208401526060604084015260608301906122b6565b346103e9576060806003193601126103e9576119bb6122db565b6024916001600160401b03919083358381116103e9576119df903690600401612404565b9260449081359081116103e9576119fa903690600401612404565b91611a03612611565b8451835103611ba0576001600160a01b03841660005b865181101561056157611a2c818861309e565b51611a37828761309e565b5190601354811015611b66578360005260146020908082526040600020836000528252611a6984604060002054612ee8565b8360005260108352600190816040600020015410611b235760005b888c878310611abe575050505090611ab9949392918660005281526040600020916000525261070a6040600020918254612ee8565b611a19565b611b1e92917faaf4e8c2bf95f40479722ae0838ec3e38cf5f906d4ee0652ee9755020fb7dc1091611af8600b8781540192838092556130b2565b80600052600d8852886040600020556040519081528b88820152886040820152a161301f565b611a84565b60405162461bcd60e51b815260048101849052601d818f01527f45786365656473206d617820766f756368657273207065722075736572000000818b0152606490fd5b60405162461bcd60e51b8152602060048201526014818c015273496e76616c696420766f7563686572207479706560601b81880152606490fd5b60405162461bcd60e51b815260206004820152601181880152704d69736d61746368656420696e7075747360781b81840152606490fd5b346103e95760203660031901126103e957610561600435611c00611bfb8233612c40565b612bde565b612cae565b346103e957610561611c1636612307565b9060405192611c2484612357565b60008452613515565b346103e95760203660031901126103e957600435600052600d6020526020604060002054604051908152f35b346103e95760403660031901126103e957611c726122f1565b336001600160a01b03821603611c8e5761056190600435612a44565b60405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608490fd5b346103e95760403660031901126103e957611d046122db565b60243590611d1181612aba565b821015611d445760018060a01b031660005260066020526040600020906000526020526020604060002054604051908152f35b60405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b6064820152608490fd5b346103e95760403660031901126103e957600435611db96122f1565b81600052600a602052611dd3600160406000200154612944565b81600052600a60205260406000209060018060a01b0316908160005260205260ff6040600020541615611e0257005b81600052600a6020526040600020816000526020526040600020600160ff1982541617905533917f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d600080a4005b346103e95760203660031901126103e957600435600052600a6020526020600160406000200154604051908152f35b346103e957611e8d36612307565b91611ead611e9a84612b7d565b6001600160a01b038381169116146135b0565b611eba611bfb8433612c40565b611ec583838361360a565b82600052600e60205260ff60406000205416600014611ee95790610561929161383b565b604080516001600160a01b0392831681529290911660208301528101919091527fce98ad71a481f07ab41287f2afce07581888c654dfd62100a2b52b819ca2291690806060810161126b565b346103e95760203660031901126103e9576001600160a01b03611f566122db565b16600052600f60205260a06040600020805490600181015490600281015460046003830154920154926040519485526020850152604084015260608301526080820152f35b346103e95760003660031901126103e9576020600854604051908152f35b346103e95760403660031901126103e957611fd26122db565b602435906001600160a01b038080611fe985612b7d565b169216918083146120e4578033149081156120bf575b501561205457600083815260046020526040902080546001600160a01b0319168317905561202c83612b7d565b167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600080a4005b60405162461bcd60e51b815260206004820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c0000006064820152608490fd5b9050600052600560205260406000203360005260205260ff6040600020541684611fff565b60405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608490fd5b346103e95760203660031901126103e95760206114ef600435612ba0565b346103e95760003660031901126103e9576040516000805461217281612422565b80845290600190818116908115610b89575060011461219b576105d1846105bd8186038261238d565b600080805292507f290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e5635b8284106121dc5750505081016020016105bd82610b20565b805460208587018101919091529093019281016121c4565b346103e95760203660031901126103e9576004359063ffffffff60e01b82168092036103e957602091637965db0b60e01b8114908115612236575b5015158152f35b63780e9d6360e01b811491508115612250575b508361222f565b6380ac58cd60e01b811491508115612282575b8115612271575b5083612249565b6301ffc9a760e01b1490508361226a565b635b5e139f60e01b81149150612263565b60005b8381106122a65750506000910152565b8181015183820152602001612296565b906020916122cf81518092818552858086019101612293565b601f01601f1916010190565b600435906001600160a01b03821682036103e957565b602435906001600160a01b03821682036103e957565b60609060031901126103e9576001600160a01b039060043582811681036103e9579160243590811681036103e9579060443590565b606081019081106001600160401b038211176103d357604052565b602081019081106001600160401b038211176103d357604052565b608081019081106001600160401b038211176103d357604052565b90601f801991011681019081106001600160401b038211176103d357604052565b9092916001600160401b0384116103d3578360051b60405192602080946123d78285018261238d565b80978152019181019283116103e957905b8282106123f55750505050565b813581529083019083016123e8565b9080601f830112156103e95781602061241f933591016123ae565b90565b90600182811c92168015612452575b602083101461243c57565b634e487b7160e01b600052602260045260246000fd5b91607f1691612431565b906000929180549161246d83612422565b9182825260019384811690816000146124cf575060011461248f575b50505050565b90919394506000526020928360002092846000945b8386106124bb575050505001019038808080612489565b8054858701830152940193859082016124a4565b9294505050602093945060ff191683830152151560051b01019038808080612489565b6001600160401b0381116103d357601f01601f191660200190565b929192612519826124f2565b91612527604051938461238d565b8294818452818301116103e9578281602093846000960137010152565b9080601f830112156103e95781602061241f9335910161250d565b9181601f840112156103e9578235916001600160401b0383116103e9576020808501948460051b0101116103e957565b60606003198201126103e9576004359160243591604435906001600160401b0382116103e95761241f91600401612544565b6012548110156125fb57601260005260021b7fbb8a6a4669ba250d26cd7a459eca9d215f8307e33aebe50379bc5a3617ec34440190600090565b634e487b7160e01b600052603260045260246000fd5b3360009081527faa1d7351356c4ddc11907b1ee0660f579cfdf507235af2ae01ecd22a4b7ceaae602090815260408083205490927f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a69160ff16156126755750505050565b61267e33612f13565b9184519061268b82612372565b60428252848201926060368537825115612817576030845382516001908110156128035790607860218501536041915b8083116127a95750505061276757604861276393869361274793612738985198899376020b1b1b2b9b9a1b7b73a3937b61d1030b1b1b7bab73a1604d1b8a86015261270f815180928c603789019101612293565b8401917001034b99036b4b9b9b4b733903937b6329607d1b603784015251809386840190612293565b0103602881018752018561238d565b5192839262461bcd60e51b8452600484015260248301906122b6565b0390fd5b60648486519062461bcd60e51b825280600483015260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152fd5b909192600f811660108110156127ef576127e891906f181899199a1a9b1b9c1cb0b131b232b360811b901a6127de8688612ef5565b5360041c93612f06565b91906126bb565b634e487b7160e01b84526032600452602484fd5b634e487b7160e01b82526032600452602482fd5b634e487b7160e01b81526032600452602490fd5b3360009081527f13da86008ba1c6922daee3e07db95305ef49ebced9f5467a0b8613fcc6b343e3602090815260408083205490929060ff161561286d57505050565b61287633612f13565b908084519061288482612372565b60428252848201926060368537825115612817576030845382516001908110156128035790607860218501536041915b8083116129085750505061276757604861276393869361274793612738985198899376020b1b1b2b9b9a1b7b73a3937b61d1030b1b1b7bab73a1604d1b8a86015261270f815180928c603789019101612293565b909192600f811660108110156127ef5761293d91906f181899199a1a9b1b9c1cb0b131b232b360811b901a6127de8688612ef5565b91906128b4565b600090808252602090600a8252604092838120338252835260ff84822054161561296e5750505050565b61297733612f13565b9184519061298482612372565b60428252848201926060368537825115612817576030845382516001908110156128035790607860218501536041915b808311612a085750505061276757604861276393869361274793612738985198899376020b1b1b2b9b9a1b7b73a3937b61d1030b1b1b7bab73a1604d1b8a86015261270f815180928c603789019101612293565b909192600f811660108110156127ef57612a3d91906f181899199a1a9b1b9c1cb0b131b232b360811b901a6127de8688612ef5565b91906129b4565b90600091808352600a602052604083209160018060a01b03169182845260205260ff604084205416612a7557505050565b808352600a602052604083208284526020526040832060ff1981541690557ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b339380a4565b6001600160a01b03168015612ada57600052600360205260406000205490565b60405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b6064820152608490fd5b15612b3857565b60405162461bcd60e51b815260206004820152601860248201527f4552433732313a20696e76616c696420746f6b656e20494400000000000000006044820152606490fd5b6000908152600260205260409020546001600160a01b031661241f811515612b31565b600081815260026020526040902054612bc3906001600160a01b03161515612b31565b6000908152600460205260409020546001600160a01b031690565b15612be557565b60405162461bcd60e51b815260206004820152602d60248201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560448201526c1c881bdc88185c1c1c9bdd9959609a1b6064820152608490fd5b906001600160a01b038080612c5484612b7d565b16931691838314938415612c87575b508315612c71575b50505090565b612c7d91929350612ba0565b1614388080612c6b565b909350600052600560205260406000208260005260205260ff604060002054169238612c63565b612cb781612b7d565b6001600160a01b03908082169081612e1857505060085482600052600960205280604060002055600160401b8110156103d35782612cfe826001612d179401600855612e9e565b90919082549060031b91821b91600019901b1916179055565b6008546000198082019290918311611017576000928484526009602052604090612d448286205491612e9e565b90549060031b1c612d5881612cfe84612e9e565b855260096020528185205584845283818120556008548015612e04578301612d7f81612e9e565b8582549160031b1b19169055600855612d9785612b7d565b918585526004602052818520926bffffffffffffffffffffffff60a01b9384815416905516928385526003602052818520908154019055848452600260205283209081541690557fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8280a4565b634e487b7160e01b85526031600452602485fd5b612e2190612aba565b6000198101919082116110175760009184835260206007815260409283852054838103612e67575b50868552848481205584526006815282842091845252812055612d17565b8186526006835284862084875283528486205482875260068452858720828852845280868820558652600783528486205538612e49565b6008548110156125fb5760086000527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30190600090565b8181029291811591840414171561101757565b9190820180921161101757565b9081518110156125fb570160200190565b8015611017576000190190565b60405190612f208261233c565b602a82526020820160403682378251156125fb576030905381516001908110156125fb57607860218401536029905b808211612fa3575050612f5f5790565b606460405162461bcd60e51b815260206004820152602060248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152fd5b9091600f8116906010821015612fe757612fe1916f181899199a1a9b1b9c1cb0b131b232b360811b901a612fd78587612ef5565b5360041c92612f06565b90612f4f565b60246000634e487b7160e01b81526032600452fd5b909260809261241f959483526020830152604082015281606082015201906122b6565b60001981146110175760010190565b6000818152600e60205260409160ff838320541661307157916002818361109d9561241f9552600d6020528181205481526010602052200190519283809261245c565b508161109d6130916002809561241f95338152600f6020522001546125c1565b509151809481930161245c565b80518210156125fb5760209160051b010190565b906040918251926130c284612357565b60008085526001600160a01b0383169182156131f7576000858152600260205260409020546130fd906001600160a01b031615155b156132ad565b600854858352602090600982528083852055600160401b8110156131e3579286949192600286946131406131dc9a612cfe8960016131e19f9d9b01600855612e9e565b61314987612aba565b858552600682528385208186528252838520879055868552600782528385205560008681526002602052604090205461318c906001600160a01b031615156130f7565b848452600381528284208054600101905585845252812080546001600160a01b031916831790557fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8180a46132f9565b61328d565b565b634e487b7160e01b84526041600452602484fd5b5162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606490fd5b60809060208152603260208201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b60608201520190565b1561329457565b60405162461bcd60e51b8152806127636004820161323a565b156132b457565b60405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606490fd5b91929091803b1561340e57613346936040519081630a85bd0160e11b9384825233600483015260009687602484015260448301526080606483015281878160209a8b9660848301906122b6565b03926001600160a01b03165af18491816133ca575b506133b9575050503d6000146133b1573d613375816124f2565b90613383604051928361238d565b81528091833d92013e5b805191826133ae5760405162461bcd60e51b8152806127636004820161323a565b01fd5b50606061338d565b6001600160e01b0319161492509050565b9091508581813d8311613407575b6133e2818361238d565b8101031261340357516001600160e01b03198116810361340357903861335b565b8480fd5b503d6133d8565b50915050600190565b92939190803b1561349457613469946040518092630a85bd0160e11b9485835233600484015260018060a01b03809816602484015260448301526080606483015281806020998a9560848301906122b6565b03916000988991165af18491816133ca57506133b9575050503d6000146133b1573d613375816124f2565b5050915050600190565b156134a557565b60405162461bcd60e51b815260206004820152601860248201527f496e76616c6964206d656d62657273686970206c6576656c00000000000000006044820152606490fd5b909260809261241f959460018060a01b0316835260208301526040820152816060820152019061245c565b9091926131dc61353f9161352c611bfb8733612c40565b61353786868661360a565b858585613417565b82600052600e60205260ff6040600020541660001461356357906131e1929161383b565b604080516001600160a01b0392831681529290911660208301528101919091527fce98ad71a481f07ab41287f2afce07581888c654dfd62100a2b52b819ca229169080606081015b0390a1565b156135b757565b60405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201526437bbb732b960d91b6064820152608490fd5b61362e9161361784612b7d565b6001600160a01b03938484169391851684146135b0565b8382169384156137ea57839182613747575090506008549085600052600960205281604060002055600160401b8210156103d3576136949261367b87612cfe856001899701600855612e9e565b828603613714575b5061368d86612b7d565b16146135b0565b7fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60008481526004602052604081206bffffffffffffffffffffffff60a01b9081815416905583825260036020526040822060001981540190558482526040822060018154019055858252600260205284604083209182541617905580a4565b61371d90612aba565b60406000878152600660205281812083825260205288828220558881526007602052205538613683565b858303613759575b506136949261367b565b613764919250612aba565b6000198101919082116110175761369492849260009088825260209060078252604091828420548281036137b3575b508a8452838381205586845260068152828420918452528120559261374f565b8785526006825283852083865282528385205488865260068352848620828752835280858720558552600782528385205538613793565b60405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608490fd5b6135ab7f64d5482277762ebe683295a2f828dbfd7e27d4eec62d2cb919cfb73e4ead27bc939260018060a01b0393848416600052600f6020526040600020600281015490600181549101549187851660005260406000206003810154908115600014613979575050878516600052600f6020526002604060002085600382015501555b868416600052600f6020526138d96040600020918254612ee8565b9055858316600052600f6020526138f96001604060002001918254612ee8565b9055848216600052600f6020524260046040600020015584841660005260006001604082208260028201558260038201550155613935826139f2565b848216600052600f602052846139526002604060002001546125c1565b5092604051968796168652166020850152604084015260806060840152608083019061245c565b600201548211156139ad5761398e9086613cd8565b878516600052600f6020526002604060002085600382015501556138be565b50506139b98387613cd8565b6138be565b91908110156125fb5760051b0190565b81835290916001600160fb1b0383116103e95760209260051b809284830137010190565b60018060a01b03811690600091808352602092600f8452604091828220946001916002838801549701549687906012546000198101908111613b92575b85811015613b65575b50508703613a4a575b50505050505050565b600295600f938286528484526003878720015480613afc575b5080891015613a81575b505083525220015538808080808080613a41565b7f32f52e867cc6cf04fce2ec303e8cb36857807be1c4b0604d6894683ab2639db39181600b54019182600b55613ab783836130b2565b8488528686528260038a8a200155828852600e86528888209060ff19825416179055613af2613ae58b6125c1565b508b8a51948594856134ea565b0390a13880613a6d565b613b5c81613b2a7fbba21a94bc5a76739aac854eb9126ba1b6799643d19ab81a6876d71d60382b4293612cae565b808952600e8752898920805460ff1916905589516001600160a01b038616815260208101919091529081906040820190565b0390a138613a63565b85613b6f826125c1565b500154821015613b8757613b8290612f06565b613a2f565b985038905080613a38565b634e487b7160e01b87526011600452602487fd5b6001600160a01b0381166000818152600f602052604080822060048101546003909101549294929391908015613cd057600c54613be291612ee8565b4211613bf0575b5050505050565b8482613c5b937f9f2e3cedd5ba5d07a8eb40b9ce1708d39a08d88e1df4ec40531135cbcee3ba969752600f6020526003838320015480613c68575b50508181206002810182905560010155516001600160a01b03909216825260208201929092529081906040820190565b0390a13880808080613be9565b613c7190612cae565b808252600f60209081528383206003015484516001600160a01b0388168152918201527fbba21a94bc5a76739aac854eb9126ba1b6799643d19ab81a6876d71d60382b4290604090a18152600f60205280600383822001553880613c2b565b505050505050565b907fbba21a94bc5a76739aac854eb9126ba1b6799643d19ab81a6876d71d60382b4291613d0482612cae565b6000828152600e6020908152604091829020805460ff1916905581516001600160a01b03909316835282019290925290819081016135ab56fea2646970667358221220d90a7ebd1d9adf289f77c5e707de4cf41103ad0166816c5e1b52bf57e19e779064736f6c63430008140033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000002162ce70513413b6dfe2c34ffa992b1e70e462930000000000000000000000002f758de9c4b83ed1a3b777b5f905d46fa1c2c7250000000000000000000000002f758de9c4b83ed1a3b777b5f905d46fa1c2c725
-----Decoded View---------------
Arg [0] : rewardTokenAddress (address): 0x2162Ce70513413b6dFe2C34FfA992b1e70e46293
Arg [1] : defaultAdmin (address): 0x2f758DE9c4B83ed1a3B777b5f905d46Fa1c2C725
Arg [2] : minter (address): 0x2f758DE9c4B83ed1a3B777b5f905d46Fa1c2C725
-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 0000000000000000000000002162ce70513413b6dfe2c34ffa992b1e70e46293
Arg [1] : 0000000000000000000000002f758de9c4b83ed1a3b777b5f905d46fa1c2c725
Arg [2] : 0000000000000000000000002f758de9c4b83ed1a3b777b5f905d46fa1c2c725
[ 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.