Feature Tip: Add private address tag to any address under My Name Tag !
Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 1 from a total of 1 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
0x60806040 | 15885835 | 620 days ago | IN | Create: DropKitPass | 0 ETH | 0.06377321 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Name:
DropKitPass
Compiler Version
v0.8.16+commit.07a7930e
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.16; import "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC721/extensions/ERC721EnumerableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/common/ERC2981Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/math/SafeMathUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/cryptography/MerkleProofUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/structs/EnumerableSetUpgradeable.sol"; import "./MultiStage.sol"; import "./SignaturePresale.sol"; import "./interfaces/IDropKitPass.sol"; contract DropKitPass is IDropKitPass, MultiStage, SignaturePresale, OwnableUpgradeable, AccessControlUpgradeable, ERC2981Upgradeable, ERC721Upgradeable, ERC721EnumerableUpgradeable { using AddressUpgradeable for address; using SafeMathUpgradeable for uint256; using MerkleProofUpgradeable for bytes32[]; using EnumerableSetUpgradeable for EnumerableSetUpgradeable.AddressSet; uint96 private _defaultFeeRate; address private _treasury; string private _tokenBaseURI; mapping(uint256 => uint256) private _stagesByToken; mapping(uint256 => FeeEntry) private _feeRatesByToken; // passes per stage mapping(uint256 => mapping(uint96 => PricingEntry)) private _passesForSaleByStage; // activated passes mapping(uint256 => address) private _activatedOwnerByToken; mapping(address => uint256) private _activatedTokenByOwner; // assigned seats per tokenId mapping(uint256 => EnumerableSetUpgradeable.AddressSet) private _membersByToken; mapping(address => TokenEntry) private _tokenByMembers; modifier onlyPurchasable( uint256 stageId, uint64 quantity, address to ) { uint256 maxAmount = _maxAmount[stageId]; require(_saleActive[stageId], "Sale not active"); require(quantity > 0, "Quantity is 0"); require( maxAmount > 0 ? _supply[stageId].add(quantity) <= maxAmount : true, "Exceeded max supply" ); require(quantity <= _maxPerMint[stageId], "Exceeded max per mint"); require( _mintCount[stageId][to].add(quantity) <= _maxPerWallet[stageId], "Exceeded max per wallet" ); _; } /// @custom:oz-upgrades-unsafe-allow constructor constructor() { _disableInitializers(); } function initialize( string memory name_, string memory symbol_, address treasury_, address royalty_, uint96 royaltyFee_, uint96 defaultFeeRate_ ) public initializer { __ERC721_init(name_, symbol_); __ERC721Enumerable_init(); __AccessControl_init(); __Ownable_init(); __ERC2981_init(); _treasury = treasury_; _defaultFeeRate = defaultFeeRate_; _grantRole(DEFAULT_ADMIN_ROLE, _msgSender()); _setDefaultRoyalty(royalty_, royaltyFee_); } function purchasePass( uint256 stageId, uint96 feeRate, uint64 quantity, address recipient ) external payable onlyPurchasable(stageId, quantity, recipient) { require(!_presaleActive[stageId], "Presale active"); _purchasePass(stageId, feeRate, recipient, quantity); emit PassOptionPurchased(stageId, feeRate); } function presalePurchasePass( uint256 stageId, uint96 feeRate, uint64 quantity, uint64 allowed, address recipient, bytes32[] calldata proof ) external payable onlyPurchasable(stageId, quantity, recipient) { bytes32 merkleRoot = _merkleRoot[stageId]; require(_presaleActive[stageId], "Presale not active"); require(merkleRoot != "", "Presale not set"); require( MerkleProofUpgradeable.verify( proof, merkleRoot, keccak256(abi.encodePacked(recipient, allowed)) ), "Presale invalid" ); _purchasePass(stageId, feeRate, recipient, quantity); emit PassOptionPurchased(stageId, feeRate); } function redeemPass( uint256 stageId, uint96 feeRate, uint64 quantity, address recipient, uint256 expiration, bytes32 data, bytes calldata signature ) external payable onlyPurchasable(stageId, quantity, recipient) { require(_presaleActive[stageId], "Presale not active"); _verifySignature(stageId, expiration, data, signature); _purchasePass(stageId, feeRate, recipient, quantity); emit PassOptionRedeemed(stageId, feeRate, data); } function activatePass(uint256 tokenId) external { require(ownerOf(tokenId) == _msgSender(), "Not a owner"); require( _activatedOwnerByToken[tokenId] == address(0), "Token already activated" ); require( _activatedTokenByOwner[_msgSender()] == 0, "Owner already activated" ); require( !_tokenByMembers[_msgSender()].isValue, "Member of another pass" ); _activatedOwnerByToken[tokenId] = _msgSender(); _activatedTokenByOwner[_msgSender()] = tokenId; emit PassActivated(tokenId, _msgSender()); } function deactivatePass(uint256 tokenId) external { require( _activatedOwnerByToken[tokenId] == _msgSender(), "Token not activated" ); require( _activatedTokenByOwner[_msgSender()] == tokenId, "Owner not activated" ); require( _membersByToken[tokenId].length() == 0, "Members still activated" ); _activatedOwnerByToken[tokenId] = address(0); _activatedTokenByOwner[_msgSender()] = 0; emit PassDeactivated(tokenId, _msgSender()); } function switchPassActivation(uint256 oldTokenId, uint256 newTokenId) external { require(oldTokenId != newTokenId, "Cannot switch to same token"); require(ownerOf(oldTokenId) == _msgSender(), "Not a owner"); require(ownerOf(newTokenId) == _msgSender(), "Not a owner"); require( _activatedOwnerByToken[oldTokenId] == _msgSender(), "Invalid activation" ); require( _activatedOwnerByToken[newTokenId] == address(0), "Token not activated" ); require( _membersByToken[oldTokenId].length() == 0, "Members still activated" ); _activatedOwnerByToken[oldTokenId] = address(0); _activatedOwnerByToken[newTokenId] = _msgSender(); _activatedTokenByOwner[_msgSender()] = newTokenId; emit PassDeactivated(oldTokenId, _msgSender()); emit PassActivated(newTokenId, _msgSender()); } function addPassMembers(uint256 tokenId, address[] calldata members) external { uint256 membersLength = members.length; require( _activatedOwnerByToken[tokenId] == _msgSender(), "Token not activated" ); require( getMaxAllowedPassMembers(tokenId) >= _membersByToken[tokenId].length() + membersLength, "Reached Maximum Members" ); for (uint64 i = 0; i < membersLength; ) { _addPassMember(tokenId, members[i]); unchecked { i++; } } } function removePassMembers(uint256 tokenId, address[] calldata members) external { uint256 membersLength = members.length; require( _activatedOwnerByToken[tokenId] == _msgSender(), "Token not activated" ); for (uint64 i = 0; i < membersLength; ) { _removePassMember(tokenId, members[i]); unchecked { i++; } } } function disconnectPassMember(uint256 tokenId) external { require( _activatedOwnerByToken[tokenId] != address(0), "Token not activated" ); _removePassMember(tokenId, _msgSender()); } function batchAirdrop( uint256 stageId, address[] calldata recipients, uint96[] calldata feeRates ) external onlyRole(DEFAULT_ADMIN_ROLE) { require( recipients.length == feeRates.length, "Invalid number of recipients" ); uint256 length = recipients.length; for (uint256 i = 0; i < length; ) { require( _passesForSaleByStage[stageId][feeRates[i]].isValue, "Pass doesn't exist" ); _mintPass(stageId, feeRates[i], recipients[i]); unchecked { i++; } } } function createPassOption( uint256 stageId, uint96 feeRate, uint256 price ) external onlyRole(DEFAULT_ADMIN_ROLE) { require( !_passesForSaleByStage[stageId][feeRate].isValue, "Pass already exists" ); _passesForSaleByStage[stageId][feeRate] = PricingEntry({ price: price, isValue: true }); emit PassOptionCreated(stageId, feeRate, price); } function updatePassOption( uint256 stageId, uint96 feeRate, uint256 newPrice, bool active ) external onlyRole(DEFAULT_ADMIN_ROLE) { _passesForSaleByStage[stageId][feeRate].isValue = active; _passesForSaleByStage[stageId][feeRate].price = newPrice; emit PassOptionUpdated(stageId, feeRate, newPrice, active); } function startSale( uint256 stageId, uint256 newMaxAmount, uint256 newMaxPerWallet, uint256 newMaxPerMint, bool presale ) external onlyRole(DEFAULT_ADMIN_ROLE) { require(!_saleActive[stageId], "Sale already active"); _startSale( stageId, newMaxAmount, newMaxPerWallet, newMaxPerMint, presale ); emit SaleStarted( stageId, newMaxAmount, newMaxPerWallet, newMaxPerMint, presale ); } function stopSale(uint256 stageId) external onlyRole(DEFAULT_ADMIN_ROLE) { require(_saleActive[stageId], "Sale not active"); _stopSale(stageId); emit SaleStopped(stageId); } function setMerkleRoot(uint256 stageId, bytes32 newRoot) external onlyRole(DEFAULT_ADMIN_ROLE) { _setMerkleRoot(stageId, newRoot); } function withdraw() external onlyRole(DEFAULT_ADMIN_ROLE) { require(address(this).balance > 0, "0 balance"); uint256 balance = address(this).balance; AddressUpgradeable.sendValue(payable(_treasury), balance); } function setSigner(address signer) external onlyRole(DEFAULT_ADMIN_ROLE) { _setSigner(signer); } function setTreasury(address newTreasury) external onlyRole(DEFAULT_ADMIN_ROLE) { _treasury = newTreasury; } function setDefaultRoyalty(address receiver, uint96 feeNumerator) external onlyRole(DEFAULT_ADMIN_ROLE) { _setDefaultRoyalty(receiver, feeNumerator); } function setTokenRoyalty( uint256 tokenId, address receiver, uint96 feeNumerator ) external onlyRole(DEFAULT_ADMIN_ROLE) { _setTokenRoyalty(tokenId, receiver, feeNumerator); } function setDefaultFeeRate(uint96 feeRate) external onlyRole(DEFAULT_ADMIN_ROLE) { _defaultFeeRate = feeRate; } function setBaseURI(string memory newBaseURI) external onlyRole(DEFAULT_ADMIN_ROLE) { _tokenBaseURI = newBaseURI; } function treasury() external view returns (address) { return _treasury; } function isRedeemed(uint256 stageId, bytes32 data) public view returns (bool) { return _isVerified(stageId, data); } function getPrice(uint256 stageId, uint96 feeRate) public view returns (uint256) { PricingEntry memory pass = _passesForSaleByStage[stageId][feeRate]; require(pass.isValue, "Pass doesn't exist"); return pass.price; } function getStage(uint256 tokenId) public view returns (uint256) { return _stagesByToken[tokenId]; } function getFeeRate(uint256 tokenId) public view returns (uint96) { require(_feeRatesByToken[tokenId].isValue, "Invalid tokenId"); return _feeRatesByToken[tokenId].value; } function getFeeRateOf(address owner) external view returns (uint96) { uint256 tokenId = _activatedTokenByOwner[owner]; if (_feeRatesByToken[tokenId].isValue) { return _feeRatesByToken[tokenId].value; } if (_tokenByMembers[owner].isValue) { return _feeRatesByToken[_tokenByMembers[owner].tokenId].value; } return _defaultFeeRate; } function getDefaultFeeRate() external view returns (uint96) { return _defaultFeeRate; } function getActivatedOwnerByToken(uint256 tokenId) external view returns (address) { return _activatedOwnerByToken[tokenId]; } function getActivatedTokenByOwner(address owner) external view returns (uint256) { return _activatedTokenByOwner[owner]; } function getMaxAllowedPassMembers(uint256 tokenId) public view returns (uint96) { // Intentionally keeping this function simple, should not rely on memory. uint96 feeRate = getFeeRate(tokenId); // Pro Pass: 2 additional members if (feeRate == 0) { return 2; } // Advanced Pass: 1 additional member if (feeRate == 250) { return 1; } // Default: no additional members return 0; } function getPassMembersCount(uint256 tokenId) external view returns (uint256) { return _membersByToken[tokenId].length(); } function getPassMemberAt(uint256 tokenId, uint256 index) external view returns (address) { return _membersByToken[tokenId].at(index); } function getTokenByPassMember(address member) external view returns (uint256) { TokenEntry memory entry = _tokenByMembers[member]; if (!entry.isValue) { return 0; } return entry.tokenId; } function _purchasePass( uint256 stageId, uint96 feeRate, address to, uint64 quantity ) internal { PricingEntry memory pass = _passesForSaleByStage[stageId][feeRate]; require(pass.isValue, "Pass doesn't exist"); require(pass.price.mul(quantity) <= msg.value, "Value incorrect"); for (uint256 i = 0; i < quantity; ) { _mintPass(stageId, feeRate, to); unchecked { i++; } } } function _mintPass( uint256 stageId, uint96 feeRate, address to ) internal { uint256 mintIndex = totalSupply().add(1); _feeRatesByToken[mintIndex] = _feeValue(feeRate, true); _stagesByToken[mintIndex] = stageId; unchecked { _supply[stageId]++; _mintCount[stageId][to]++; } _safeMint(to, mintIndex); } function _addPassMember(uint256 tokenId, address member) internal { require( _activatedTokenByOwner[member] == 0, "Member already activated" ); require(!_tokenByMembers[member].isValue, "Member of another pass"); _membersByToken[tokenId].add(member); _tokenByMembers[member].tokenId = tokenId; _tokenByMembers[member].isValue = true; emit PassMemberAdded(tokenId, member); } function _removePassMember(uint256 tokenId, address member) internal { require( _membersByToken[tokenId].contains(member), "Member does not exist" ); _membersByToken[tokenId].remove(member); _tokenByMembers[member].isValue = false; emit PassMemberRemoved(tokenId, member); } function _feeValue(uint96 feeRate, bool isValue) internal pure returns (FeeEntry memory) { return FeeEntry(feeRate, isValue); } function _baseURI() internal view virtual override returns (string memory) { return _tokenBaseURI; } // The following functions are overrides required by Solidity. function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal virtual override(ERC721Upgradeable, ERC721EnumerableUpgradeable) { require( _activatedOwnerByToken[tokenId] == address(0), "Pass already activated" ); super._beforeTokenTransfer(from, to, tokenId); } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override( ERC721Upgradeable, ERC721EnumerableUpgradeable, ERC2981Upgradeable, AccessControlUpgradeable ) returns (bool) { return super.supportsInterface(interfaceId); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (access/AccessControl.sol) pragma solidity ^0.8.0; import "./IAccessControlUpgradeable.sol"; import "../utils/ContextUpgradeable.sol"; import "../utils/StringsUpgradeable.sol"; import "../utils/introspection/ERC165Upgradeable.sol"; import "../proxy/utils/Initializable.sol"; /** * @dev Contract module that allows children to implement role-based access * control mechanisms. This is a lightweight version that doesn't allow enumerating role * members except through off-chain means by accessing the contract event logs. Some * applications may benefit from on-chain enumerability, for those cases see * {AccessControlEnumerable}. * * Roles are referred to by their `bytes32` identifier. These should be exposed * in the external API and be unique. The best way to achieve this is by * using `public constant` hash digests: * * ``` * bytes32 public constant MY_ROLE = keccak256("MY_ROLE"); * ``` * * Roles can be used to represent a set of permissions. To restrict access to a * function call, use {hasRole}: * * ``` * function foo() public { * require(hasRole(MY_ROLE, msg.sender)); * ... * } * ``` * * Roles can be granted and revoked dynamically via the {grantRole} and * {revokeRole} functions. Each role has an associated admin role, and only * accounts that have a role's admin role can call {grantRole} and {revokeRole}. * * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means * that only accounts with this role will be able to grant or revoke other * roles. More complex role relationships can be created by using * {_setRoleAdmin}. * * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to * grant and revoke this role. Extra precautions should be taken to secure * accounts that have been granted it. */ abstract contract AccessControlUpgradeable is Initializable, ContextUpgradeable, IAccessControlUpgradeable, ERC165Upgradeable { function __AccessControl_init() internal onlyInitializing { } function __AccessControl_init_unchained() internal onlyInitializing { } 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(IAccessControlUpgradeable).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 ", StringsUpgradeable.toHexString(uint160(account), 20), " is missing role ", StringsUpgradeable.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()); } } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[49] private __gap; }
// 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 IAccessControlUpgradeable { /** * @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.7.0) (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/ContextUpgradeable.sol"; import "../proxy/utils/Initializable.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract OwnableUpgradeable is Initializable, ContextUpgradeable { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ function __Ownable_init() internal onlyInitializing { __Ownable_init_unchained(); } function __Ownable_init_unchained() internal onlyInitializing { _transferOwnership(_msgSender()); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { require(owner() == _msgSender(), "Ownable: caller is not the owner"); } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[49] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (interfaces/IERC2981.sol) pragma solidity ^0.8.0; import "../utils/introspection/IERC165Upgradeable.sol"; /** * @dev Interface for the NFT Royalty Standard. * * A standardized way to retrieve royalty payment information for non-fungible tokens (NFTs) to enable universal * support for royalty payments across all NFT marketplaces and ecosystem participants. * * _Available since v4.5._ */ interface IERC2981Upgradeable is IERC165Upgradeable { /** * @dev Returns how much royalty is owed and to whom, based on a sale price that may be denominated in any unit of * exchange. The royalty amount is denominated and should be paid in that same unit of exchange. */ function royaltyInfo(uint256 tokenId, uint256 salePrice) external view returns (address receiver, uint256 royaltyAmount); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (proxy/utils/Initializable.sol) pragma solidity ^0.8.2; import "../../utils/AddressUpgradeable.sol"; /** * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect. * * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in * case an upgrade adds a module that needs to be initialized. * * For example: * * [.hljs-theme-light.nopadding] * ``` * contract MyToken is ERC20Upgradeable { * function initialize() initializer public { * __ERC20_init("MyToken", "MTK"); * } * } * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable { * function initializeV2() reinitializer(2) public { * __ERC20Permit_init("MyToken"); * } * } * ``` * * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}. * * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity. * * [CAUTION] * ==== * Avoid leaving a contract uninitialized. * * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed: * * [.hljs-theme-light.nopadding] * ``` * /// @custom:oz-upgrades-unsafe-allow constructor * constructor() { * _disableInitializers(); * } * ``` * ==== */ abstract contract Initializable { /** * @dev Indicates that the contract has been initialized. * @custom:oz-retyped-from bool */ uint8 private _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool private _initializing; /** * @dev Triggered when the contract has been initialized or reinitialized. */ event Initialized(uint8 version); /** * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope, * `onlyInitializing` functions can be used to initialize parent contracts. Equivalent to `reinitializer(1)`. */ modifier initializer() { bool isTopLevelCall = !_initializing; require( (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1), "Initializable: contract is already initialized" ); _initialized = 1; if (isTopLevelCall) { _initializing = true; } _; if (isTopLevelCall) { _initializing = false; emit Initialized(1); } } /** * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be * used to initialize parent contracts. * * `initializer` is equivalent to `reinitializer(1)`, so a reinitializer may be used after the original * initialization step. This is essential to configure modules that are added through upgrades and that require * initialization. * * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in * a contract, executing them in the right order is up to the developer or operator. */ modifier reinitializer(uint8 version) { require(!_initializing && _initialized < version, "Initializable: contract is already initialized"); _initialized = version; _initializing = true; _; _initializing = false; emit Initialized(version); } /** * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the * {initializer} and {reinitializer} modifiers, directly or indirectly. */ modifier onlyInitializing() { require(_initializing, "Initializable: contract is not initializing"); _; } /** * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call. * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized * to any version. It is recommended to use this to lock implementation contracts that are designed to be called * through proxies. */ function _disableInitializers() internal virtual { require(!_initializing, "Initializable: contract is initializing"); if (_initialized < type(uint8).max) { _initialized = type(uint8).max; emit Initialized(type(uint8).max); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (token/common/ERC2981.sol) pragma solidity ^0.8.0; import "../../interfaces/IERC2981Upgradeable.sol"; import "../../utils/introspection/ERC165Upgradeable.sol"; import "../../proxy/utils/Initializable.sol"; /** * @dev Implementation of the NFT Royalty Standard, a standardized way to retrieve royalty payment information. * * Royalty information can be specified globally for all token ids via {_setDefaultRoyalty}, and/or individually for * specific token ids via {_setTokenRoyalty}. The latter takes precedence over the first. * * Royalty is specified as a fraction of sale price. {_feeDenominator} is overridable but defaults to 10000, meaning the * fee is specified in basis points by default. * * IMPORTANT: ERC-2981 only specifies a way to signal royalty information and does not enforce its payment. See * https://eips.ethereum.org/EIPS/eip-2981#optional-royalty-payments[Rationale] in the EIP. Marketplaces are expected to * voluntarily pay royalties together with sales, but note that this standard is not yet widely supported. * * _Available since v4.5._ */ abstract contract ERC2981Upgradeable is Initializable, IERC2981Upgradeable, ERC165Upgradeable { function __ERC2981_init() internal onlyInitializing { } function __ERC2981_init_unchained() internal onlyInitializing { } struct RoyaltyInfo { address receiver; uint96 royaltyFraction; } RoyaltyInfo private _defaultRoyaltyInfo; mapping(uint256 => RoyaltyInfo) private _tokenRoyaltyInfo; /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165Upgradeable, ERC165Upgradeable) returns (bool) { return interfaceId == type(IERC2981Upgradeable).interfaceId || super.supportsInterface(interfaceId); } /** * @inheritdoc IERC2981Upgradeable */ function royaltyInfo(uint256 _tokenId, uint256 _salePrice) public view virtual override returns (address, uint256) { RoyaltyInfo memory royalty = _tokenRoyaltyInfo[_tokenId]; if (royalty.receiver == address(0)) { royalty = _defaultRoyaltyInfo; } uint256 royaltyAmount = (_salePrice * royalty.royaltyFraction) / _feeDenominator(); return (royalty.receiver, royaltyAmount); } /** * @dev The denominator with which to interpret the fee set in {_setTokenRoyalty} and {_setDefaultRoyalty} as a * fraction of the sale price. Defaults to 10000 so fees are expressed in basis points, but may be customized by an * override. */ function _feeDenominator() internal pure virtual returns (uint96) { return 10000; } /** * @dev Sets the royalty information that all ids in this contract will default to. * * Requirements: * * - `receiver` cannot be the zero address. * - `feeNumerator` cannot be greater than the fee denominator. */ function _setDefaultRoyalty(address receiver, uint96 feeNumerator) internal virtual { require(feeNumerator <= _feeDenominator(), "ERC2981: royalty fee will exceed salePrice"); require(receiver != address(0), "ERC2981: invalid receiver"); _defaultRoyaltyInfo = RoyaltyInfo(receiver, feeNumerator); } /** * @dev Removes default royalty information. */ function _deleteDefaultRoyalty() internal virtual { delete _defaultRoyaltyInfo; } /** * @dev Sets the royalty information for a specific token id, overriding the global default. * * Requirements: * * - `receiver` cannot be the zero address. * - `feeNumerator` cannot be greater than the fee denominator. */ function _setTokenRoyalty( uint256 tokenId, address receiver, uint96 feeNumerator ) internal virtual { require(feeNumerator <= _feeDenominator(), "ERC2981: royalty fee will exceed salePrice"); require(receiver != address(0), "ERC2981: Invalid parameters"); _tokenRoyaltyInfo[tokenId] = RoyaltyInfo(receiver, feeNumerator); } /** * @dev Resets royalty information for the token id back to the global default. */ function _resetTokenRoyalty(uint256 tokenId) internal virtual { delete _tokenRoyaltyInfo[tokenId]; } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[48] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (token/ERC721/ERC721.sol) pragma solidity ^0.8.0; import "./IERC721Upgradeable.sol"; import "./IERC721ReceiverUpgradeable.sol"; import "./extensions/IERC721MetadataUpgradeable.sol"; import "../../utils/AddressUpgradeable.sol"; import "../../utils/ContextUpgradeable.sol"; import "../../utils/StringsUpgradeable.sol"; import "../../utils/introspection/ERC165Upgradeable.sol"; import "../../proxy/utils/Initializable.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 ERC721Upgradeable is Initializable, ContextUpgradeable, ERC165Upgradeable, IERC721Upgradeable, IERC721MetadataUpgradeable { using AddressUpgradeable for address; using StringsUpgradeable 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. */ function __ERC721_init(string memory name_, string memory symbol_) internal onlyInitializing { __ERC721_init_unchained(name_, symbol_); } function __ERC721_init_unchained(string memory name_, string memory symbol_) internal onlyInitializing { _name = name_; _symbol = symbol_; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165Upgradeable, IERC165Upgradeable) returns (bool) { return interfaceId == type(IERC721Upgradeable).interfaceId || interfaceId == type(IERC721MetadataUpgradeable).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 = _owners[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 = ERC721Upgradeable.ownerOf(tokenId); require(to != owner, "ERC721: approval to current owner"); require( _msgSender() == owner || isApprovedForAll(owner, _msgSender()), "ERC721: approve caller is not token owner nor 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 nor approved"); _transfer(from, to, tokenId); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId ) public virtual override { safeTransferFrom(from, to, tokenId, ""); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory data ) public virtual override { require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner nor approved"); _safeTransfer(from, to, tokenId, data); } /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * `data` is additional data, it has no specified format and it is sent in call to `to`. * * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g. * implement alternative mechanisms to perform token transfer, such as signature-based. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeTransfer( address from, address to, uint256 tokenId, bytes memory data ) internal virtual { _transfer(from, to, tokenId); require(_checkOnERC721Received(from, to, tokenId, data), "ERC721: transfer to non ERC721Receiver implementer"); } /** * @dev Returns whether `tokenId` exists. * * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}. * * Tokens start existing when they are minted (`_mint`), * and stop existing when they are burned (`_burn`). */ function _exists(uint256 tokenId) internal view virtual returns (bool) { return _owners[tokenId] != address(0); } /** * @dev Returns whether `spender` is allowed to manage `tokenId`. * * Requirements: * * - `tokenId` must exist. */ function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) { address owner = ERC721Upgradeable.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); _balances[to] += 1; _owners[tokenId] = to; emit Transfer(address(0), to, tokenId); _afterTokenTransfer(address(0), to, tokenId); } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId) internal virtual { address owner = ERC721Upgradeable.ownerOf(tokenId); _beforeTokenTransfer(owner, address(0), tokenId); // Clear approvals _approve(address(0), tokenId); _balances[owner] -= 1; delete _owners[tokenId]; emit Transfer(owner, address(0), tokenId); _afterTokenTransfer(owner, address(0), tokenId); } /** * @dev Transfers `tokenId` from `from` to `to`. * As opposed to {transferFrom}, this imposes no restrictions on msg.sender. * * Requirements: * * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * * Emits a {Transfer} event. */ function _transfer( address from, address to, uint256 tokenId ) internal virtual { require(ERC721Upgradeable.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner"); require(to != address(0), "ERC721: transfer to the zero address"); _beforeTokenTransfer(from, to, tokenId); // Clear approvals from the previous owner _approve(address(0), tokenId); _balances[from] -= 1; _balances[to] += 1; _owners[tokenId] = to; emit Transfer(from, to, tokenId); _afterTokenTransfer(from, to, tokenId); } /** * @dev Approve `to` to operate on `tokenId` * * Emits an {Approval} event. */ function _approve(address to, uint256 tokenId) internal virtual { _tokenApprovals[tokenId] = to; emit Approval(ERC721Upgradeable.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 IERC721ReceiverUpgradeable(to).onERC721Received(_msgSender(), from, tokenId, data) returns (bytes4 retval) { return retval == IERC721ReceiverUpgradeable.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. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, ``from``'s `tokenId` will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal virtual {} /** * @dev Hook that is called after any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _afterTokenTransfer( address from, address to, uint256 tokenId ) internal virtual {} /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[44] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/ERC721Enumerable.sol) pragma solidity ^0.8.0; import "../ERC721Upgradeable.sol"; import "./IERC721EnumerableUpgradeable.sol"; import "../../../proxy/utils/Initializable.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 ERC721EnumerableUpgradeable is Initializable, ERC721Upgradeable, IERC721EnumerableUpgradeable { function __ERC721Enumerable_init() internal onlyInitializing { } function __ERC721Enumerable_init_unchained() internal onlyInitializing { } // 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(IERC165Upgradeable, ERC721Upgradeable) returns (bool) { return interfaceId == type(IERC721EnumerableUpgradeable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}. */ function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override returns (uint256) { require(index < ERC721Upgradeable.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 < ERC721EnumerableUpgradeable.totalSupply(), "ERC721Enumerable: global index out of bounds"); return _allTokens[index]; } /** * @dev Hook that is called before any token transfer. This includes minting * and burning. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, ``from``'s `tokenId` will be burned. * - `from` cannot be the zero address. * - `to` cannot be the zero address. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal virtual override { super._beforeTokenTransfer(from, to, tokenId); if (from == address(0)) { _addTokenToAllTokensEnumeration(tokenId); } else if (from != to) { _removeTokenFromOwnerEnumeration(from, tokenId); } if (to == address(0)) { _removeTokenFromAllTokensEnumeration(tokenId); } else if (to != from) { _addTokenToOwnerEnumeration(to, tokenId); } } /** * @dev Private function to add a token to this extension's ownership-tracking data structures. * @param to address representing the new owner of the given token ID * @param tokenId uint256 ID of the token to be added to the tokens list of the given address */ function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private { uint256 length = ERC721Upgradeable.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 = ERC721Upgradeable.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(); } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[46] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/extensions/IERC721Enumerable.sol) pragma solidity ^0.8.0; import "../IERC721Upgradeable.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721EnumerableUpgradeable is IERC721Upgradeable { /** * @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 "../IERC721Upgradeable.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional metadata extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721MetadataUpgradeable is IERC721Upgradeable { /** * @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.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 IERC721ReceiverUpgradeable { /** * @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.7.0) (token/ERC721/IERC721.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165Upgradeable.sol"; /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721Upgradeable is IERC165Upgradeable { /** * @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: Usage of this method is discouraged, use {safeTransferFrom} whenever possible. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool _approved) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library AddressUpgradeable { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @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 v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; import "../proxy/utils/Initializable.sol"; /** * @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 ContextUpgradeable is Initializable { function __Context_init() internal onlyInitializing { } function __Context_init_unchained() internal onlyInitializing { } function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[50] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.3) (utils/cryptography/ECDSA.sol) pragma solidity ^0.8.0; import "../StringsUpgradeable.sol"; /** * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations. * * These functions can be used to verify that a message was signed by the holder * of the private keys of a given address. */ library ECDSAUpgradeable { enum RecoverError { NoError, InvalidSignature, InvalidSignatureLength, InvalidSignatureS, InvalidSignatureV } function _throwError(RecoverError error) private pure { if (error == RecoverError.NoError) { return; // no error: do nothing } else if (error == RecoverError.InvalidSignature) { revert("ECDSA: invalid signature"); } else if (error == RecoverError.InvalidSignatureLength) { revert("ECDSA: invalid signature length"); } else if (error == RecoverError.InvalidSignatureS) { revert("ECDSA: invalid signature 's' value"); } else if (error == RecoverError.InvalidSignatureV) { revert("ECDSA: invalid signature 'v' value"); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature` or error string. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. * * Documentation for signature generation: * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js] * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers] * * _Available since v4.3._ */ function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) { if (signature.length == 65) { bytes32 r; bytes32 s; uint8 v; // ecrecover takes the signature parameters, and the only way to get them // currently is to use assembly. /// @solidity memory-safe-assembly assembly { r := mload(add(signature, 0x20)) s := mload(add(signature, 0x40)) v := byte(0, mload(add(signature, 0x60))) } return tryRecover(hash, v, r, s); } else { return (address(0), RecoverError.InvalidSignatureLength); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature`. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. */ function recover(bytes32 hash, bytes memory signature) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, signature); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately. * * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures] * * _Available since v4.3._ */ function tryRecover( bytes32 hash, bytes32 r, bytes32 vs ) internal pure returns (address, RecoverError) { bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff); uint8 v = uint8((uint256(vs) >> 255) + 27); return tryRecover(hash, v, r, s); } /** * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately. * * _Available since v4.2._ */ function recover( bytes32 hash, bytes32 r, bytes32 vs ) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, r, vs); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `v`, * `r` and `s` signature fields separately. * * _Available since v4.3._ */ function tryRecover( bytes32 hash, uint8 v, bytes32 r, bytes32 s ) internal pure returns (address, RecoverError) { // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most // signatures from current libraries generate a unique signature with an s-value in the lower half order. // // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept // these malleable signatures as well. if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) { return (address(0), RecoverError.InvalidSignatureS); } if (v != 27 && v != 28) { return (address(0), RecoverError.InvalidSignatureV); } // If the signature is valid (and not malleable), return the signer address address signer = ecrecover(hash, v, r, s); if (signer == address(0)) { return (address(0), RecoverError.InvalidSignature); } return (signer, RecoverError.NoError); } /** * @dev Overload of {ECDSA-recover} that receives the `v`, * `r` and `s` signature fields separately. */ function recover( bytes32 hash, uint8 v, bytes32 r, bytes32 s ) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, v, r, s); _throwError(error); return recovered; } /** * @dev Returns an Ethereum Signed Message, created from a `hash`. This * produces hash corresponding to the one signed with the * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] * JSON-RPC method as part of EIP-191. * * See {recover}. */ function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) { // 32 is the length in bytes of hash, // enforced by the type signature above return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash)); } /** * @dev Returns an Ethereum Signed Message, created from `s`. This * produces hash corresponding to the one signed with the * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] * JSON-RPC method as part of EIP-191. * * See {recover}. */ function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", StringsUpgradeable.toString(s.length), s)); } /** * @dev Returns an Ethereum Signed Typed Data, created from a * `domainSeparator` and a `structHash`. This produces hash corresponding * to the one signed with the * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] * JSON-RPC method as part of EIP-712. * * See {recover}. */ function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (utils/cryptography/MerkleProof.sol) pragma solidity ^0.8.0; /** * @dev These functions deal with verification of Merkle Tree proofs. * * The proofs can be generated using the JavaScript library * https://github.com/miguelmota/merkletreejs[merkletreejs]. * Note: the hashing algorithm should be keccak256 and pair sorting should be enabled. * * See `test/utils/cryptography/MerkleProof.test.js` for some examples. * * WARNING: You should avoid using leaf values that are 64 bytes long prior to * hashing, or use a hash function other than keccak256 for hashing leaves. * This is because the concatenation of a sorted pair of internal nodes in * the merkle tree could be reinterpreted as a leaf value. */ library MerkleProofUpgradeable { /** * @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree * defined by `root`. For this, a `proof` must be provided, containing * sibling hashes on the branch from the leaf to the root of the tree. Each * pair of leaves and each pair of pre-images are assumed to be sorted. */ function verify( bytes32[] memory proof, bytes32 root, bytes32 leaf ) internal pure returns (bool) { return processProof(proof, leaf) == root; } /** * @dev Calldata version of {verify} * * _Available since v4.7._ */ function verifyCalldata( bytes32[] calldata proof, bytes32 root, bytes32 leaf ) internal pure returns (bool) { return processProofCalldata(proof, leaf) == root; } /** * @dev Returns the rebuilt hash obtained by traversing a Merkle tree up * from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt * hash matches the root of the tree. When processing the proof, the pairs * of leafs & pre-images are assumed to be sorted. * * _Available since v4.4._ */ function processProof(bytes32[] memory proof, bytes32 leaf) internal pure returns (bytes32) { bytes32 computedHash = leaf; for (uint256 i = 0; i < proof.length; i++) { computedHash = _hashPair(computedHash, proof[i]); } return computedHash; } /** * @dev Calldata version of {processProof} * * _Available since v4.7._ */ function processProofCalldata(bytes32[] calldata proof, bytes32 leaf) internal pure returns (bytes32) { bytes32 computedHash = leaf; for (uint256 i = 0; i < proof.length; i++) { computedHash = _hashPair(computedHash, proof[i]); } return computedHash; } /** * @dev Returns true if the `leaves` can be proved to be a part of a Merkle tree defined by * `root`, according to `proof` and `proofFlags` as described in {processMultiProof}. * * _Available since v4.7._ */ function multiProofVerify( bytes32[] memory proof, bool[] memory proofFlags, bytes32 root, bytes32[] memory leaves ) internal pure returns (bool) { return processMultiProof(proof, proofFlags, leaves) == root; } /** * @dev Calldata version of {multiProofVerify} * * _Available since v4.7._ */ function multiProofVerifyCalldata( bytes32[] calldata proof, bool[] calldata proofFlags, bytes32 root, bytes32[] memory leaves ) internal pure returns (bool) { return processMultiProofCalldata(proof, proofFlags, leaves) == root; } /** * @dev Returns the root of a tree reconstructed from `leaves` and the sibling nodes in `proof`, * consuming from one or the other at each step according to the instructions given by * `proofFlags`. * * _Available since v4.7._ */ function processMultiProof( bytes32[] memory proof, bool[] memory proofFlags, bytes32[] memory leaves ) internal pure returns (bytes32 merkleRoot) { // This function rebuild the root hash by traversing the tree up from the leaves. The root is rebuilt by // consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the // `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of // the merkle tree. uint256 leavesLen = leaves.length; uint256 totalHashes = proofFlags.length; // Check proof validity. require(leavesLen + proof.length - 1 == totalHashes, "MerkleProof: invalid multiproof"); // The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using // `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop". bytes32[] memory hashes = new bytes32[](totalHashes); uint256 leafPos = 0; uint256 hashPos = 0; uint256 proofPos = 0; // At each step, we compute the next hash using two values: // - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we // get the next hash. // - depending on the flag, either another value for the "main queue" (merging branches) or an element from the // `proof` array. for (uint256 i = 0; i < totalHashes; i++) { bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++]; bytes32 b = proofFlags[i] ? leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++] : proof[proofPos++]; hashes[i] = _hashPair(a, b); } if (totalHashes > 0) { return hashes[totalHashes - 1]; } else if (leavesLen > 0) { return leaves[0]; } else { return proof[0]; } } /** * @dev Calldata version of {processMultiProof} * * _Available since v4.7._ */ function processMultiProofCalldata( bytes32[] calldata proof, bool[] calldata proofFlags, bytes32[] memory leaves ) internal pure returns (bytes32 merkleRoot) { // This function rebuild the root hash by traversing the tree up from the leaves. The root is rebuilt by // consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the // `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of // the merkle tree. uint256 leavesLen = leaves.length; uint256 totalHashes = proofFlags.length; // Check proof validity. require(leavesLen + proof.length - 1 == totalHashes, "MerkleProof: invalid multiproof"); // The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using // `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop". bytes32[] memory hashes = new bytes32[](totalHashes); uint256 leafPos = 0; uint256 hashPos = 0; uint256 proofPos = 0; // At each step, we compute the next hash using two values: // - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we // get the next hash. // - depending on the flag, either another value for the "main queue" (merging branches) or an element from the // `proof` array. for (uint256 i = 0; i < totalHashes; i++) { bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++]; bytes32 b = proofFlags[i] ? leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++] : proof[proofPos++]; hashes[i] = _hashPair(a, b); } if (totalHashes > 0) { return hashes[totalHashes - 1]; } else if (leavesLen > 0) { return leaves[0]; } else { return proof[0]; } } function _hashPair(bytes32 a, bytes32 b) private pure returns (bytes32) { return a < b ? _efficientHash(a, b) : _efficientHash(b, a); } function _efficientHash(bytes32 a, bytes32 b) private pure returns (bytes32 value) { /// @solidity memory-safe-assembly assembly { mstore(0x00, a) mstore(0x20, b) value := keccak256(0x00, 0x40) } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; import "./IERC165Upgradeable.sol"; import "../../proxy/utils/Initializable.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 ERC165Upgradeable is Initializable, IERC165Upgradeable { function __ERC165_init() internal onlyInitializing { } function __ERC165_init_unchained() internal onlyInitializing { } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165Upgradeable).interfaceId; } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[50] private __gap; }
// 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 IERC165Upgradeable { /** * @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.6.0) (utils/math/SafeMath.sol) pragma solidity ^0.8.0; // CAUTION // This version of SafeMath should only be used with Solidity 0.8 or later, // because it relies on the compiler's built in overflow checks. /** * @dev Wrappers over Solidity's arithmetic operations. * * NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler * now has built in overflow checking. */ library SafeMathUpgradeable { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } } /** * @dev Returns the subtraction of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b > a) return (false, 0); return (true, a - b); } } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } } /** * @dev Returns the division of two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a / b); } } /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a % b); } } /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { return a + b; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return a - b; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { return a * b; } /** * @dev Returns the integer division of two unsigned integers, reverting on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return a % b; } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {trySub}. * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b <= a, errorMessage); return a - b; } } /** * @dev Returns the integer division of two unsigned integers, reverting with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a / b; } } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting with custom message when dividing by zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryMod}. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a % b; } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (utils/Strings.sol) pragma solidity ^0.8.0; /** * @dev String operations. */ library StringsUpgradeable { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; uint8 private constant _ADDRESS_LENGTH = 20; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { // Inspired by OraclizeAPI's implementation - MIT licence // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol if (value == 0) { return "0"; } uint256 temp = value; uint256 digits; while (temp != 0) { digits++; temp /= 10; } bytes memory buffer = new bytes(digits); while (value != 0) { digits -= 1; buffer[digits] = bytes1(uint8(48 + uint256(value % 10))); value /= 10; } return string(buffer); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { if (value == 0) { return "0x00"; } uint256 temp = value; uint256 length = 0; while (temp != 0) { length++; temp >>= 8; } return toHexString(value, length); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _HEX_SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (utils/structs/EnumerableSet.sol) pragma solidity ^0.8.0; /** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are made on the ordering. * * ``` * contract Example { * // Add the library methods * using EnumerableSet for EnumerableSet.AddressSet; * * // Declare a set state variable * EnumerableSet.AddressSet private mySet; * } * ``` * * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`) * and `uint256` (`UintSet`) are supported. * * [WARNING] * ==== * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure unusable. * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info. * * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an array of EnumerableSet. * ==== */ library EnumerableSetUpgradeable { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are just wrappers around the // underlying Set. // This means that we can only create new EnumerableSets for types that fit // in bytes32. struct Set { // Storage of set values bytes32[] _values; // Position of the value in the `values` array, plus 1 because index 0 // means a value is not in the set. mapping(bytes32 => uint256) _indexes; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function _add(Set storage set, bytes32 value) private returns (bool) { if (!_contains(set, value)) { set._values.push(value); // The value is stored at length-1, but we add 1 to all indexes // and use 0 as a sentinel value set._indexes[value] = set._values.length; return true; } else { return false; } } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function _remove(Set storage set, bytes32 value) private returns (bool) { // We read and store the value's index to prevent multiple reads from the same storage slot uint256 valueIndex = set._indexes[value]; if (valueIndex != 0) { // Equivalent to contains(set, value) // To delete an element from the _values array in O(1), we swap the element to delete with the last one in // the array, and then remove the last element (sometimes called as 'swap and pop'). // This modifies the order of the array, as noted in {at}. uint256 toDeleteIndex = valueIndex - 1; uint256 lastIndex = set._values.length - 1; if (lastIndex != toDeleteIndex) { bytes32 lastValue = set._values[lastIndex]; // Move the last value to the index where the value to delete is set._values[toDeleteIndex] = lastValue; // Update the index for the moved value set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex } // Delete the slot where the moved value was stored set._values.pop(); // Delete the index for the deleted slot delete set._indexes[value]; return true; } else { return false; } } /** * @dev Returns true if the value is in the set. O(1). */ function _contains(Set storage set, bytes32 value) private view returns (bool) { return set._indexes[value] != 0; } /** * @dev Returns the number of values on the set. O(1). */ function _length(Set storage set) private view returns (uint256) { return set._values.length; } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function _at(Set storage set, uint256 index) private view returns (bytes32) { return set._values[index]; } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function _values(Set storage set) private view returns (bytes32[] memory) { return set._values; } // Bytes32Set struct Bytes32Set { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _add(set._inner, value); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _remove(set._inner, value); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) { return _contains(set._inner, value); } /** * @dev Returns the number of values in the set. O(1). */ function length(Bytes32Set storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) { return _at(set._inner, index); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(Bytes32Set storage set) internal view returns (bytes32[] memory) { return _values(set._inner); } // AddressSet struct AddressSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(AddressSet storage set, address value) internal returns (bool) { return _add(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(AddressSet storage set, address value) internal returns (bool) { return _remove(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(AddressSet storage set, address value) internal view returns (bool) { return _contains(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns the number of values in the set. O(1). */ function length(AddressSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(AddressSet storage set, uint256 index) internal view returns (address) { return address(uint160(uint256(_at(set._inner, index)))); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(AddressSet storage set) internal view returns (address[] memory) { bytes32[] memory store = _values(set._inner); address[] memory result; /// @solidity memory-safe-assembly assembly { result := store } return result; } // UintSet struct UintSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(UintSet storage set, uint256 value) internal returns (bool) { return _add(set._inner, bytes32(value)); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(UintSet storage set, uint256 value) internal returns (bool) { return _remove(set._inner, bytes32(value)); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(UintSet storage set, uint256 value) internal view returns (bool) { return _contains(set._inner, bytes32(value)); } /** * @dev Returns the number of values on the set. O(1). */ function length(UintSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(UintSet storage set, uint256 index) internal view returns (uint256) { return uint256(_at(set._inner, index)); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(UintSet storage set) internal view returns (uint256[] memory) { bytes32[] memory store = _values(set._inner); uint256[] memory result; /// @solidity memory-safe-assembly assembly { result := store } return result; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.9; interface IDropKitPass { struct FeeEntry { uint96 value; bool isValue; } struct PricingEntry { uint256 price; bool isValue; } struct TokenEntry { uint256 tokenId; bool isValue; } event PassOptionCreated( uint256 indexed stageId, uint96 indexed feeRate, uint256 indexed price ); event PassOptionUpdated( uint256 indexed stageId, uint96 indexed feeRate, uint256 indexed price, bool isValue ); event PassOptionRedeemed( uint256 indexed stageId, uint96 indexed feeRate, bytes32 indexed data ); event PassOptionPurchased(uint256 indexed stageId, uint96 indexed feeRate); event PassActivated(uint256 indexed tokenId, address indexed owner); event PassDeactivated(uint256 indexed tokenId, address indexed owner); event SaleStarted( uint256 indexed stageId, uint256 maxAmount, uint256 maxPerWallet, uint256 maxPerMint, bool presale ); event SaleStopped(uint256 indexed stageId); event PassMemberAdded(uint256 indexed tokenId, address indexed member); event PassMemberRemoved(uint256 indexed tokenId, address indexed member); /** * @dev Contract upgradeable initializer */ function initialize( string memory name, string memory symbol, address treasury, address royalty, uint96 royaltyFee, uint96 defaultFeeRate ) external; /** * @dev Batch mints feeRate tokens for a given stage */ function batchAirdrop( uint256 stageId, address[] calldata recipients, uint96[] calldata feeRates ) external; /** * @dev Gets the fee rate for a given token id */ function getFeeRate(uint256 tokenId) external view returns (uint96); /** * @dev Gets the fee rate for a given address */ function getFeeRateOf(address owner) external view returns (uint96); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.16; abstract contract MultiStage { // merkle root per stage mapping(uint256 => bytes32) internal _merkleRoot; // mint count per stage mapping(uint256 => mapping(address => uint256)) internal _mintCount; // supply per stage mapping(uint256 => uint256) internal _supply; // Sales Parameters per stage mapping(uint256 => uint256) internal _maxAmount; mapping(uint256 => uint256) internal _maxPerMint; mapping(uint256 => uint256) internal _maxPerWallet; // States per stage mapping(uint256 => bool) internal _saleActive; mapping(uint256 => bool) internal _presaleActive; function maxAmount(uint256 stageId) external view returns (uint256) { return _maxAmount[stageId]; } function maxPerMint(uint256 stageId) external view returns (uint256) { return _maxPerMint[stageId]; } function maxPerWallet(uint256 stageId) external view returns (uint256) { return _maxPerWallet[stageId]; } function presaleActive(uint256 stageId) external view returns (bool) { return _presaleActive[stageId]; } function saleActive(uint256 stageId) external view returns (bool) { return _saleActive[stageId]; } function supply(uint256 stageId) external view returns (uint256) { return _supply[stageId]; } function mintCount(uint256 stageId, address account) external view returns (uint256) { return _mintCount[stageId][account]; } function _startSale( uint256 stageId, uint256 newMaxAmount, uint256 newMaxPerWallet, uint256 newMaxPerMint, bool presale ) internal { _saleActive[stageId] = true; _maxAmount[stageId] = newMaxAmount; _maxPerWallet[stageId] = newMaxPerWallet; _maxPerMint[stageId] = newMaxPerMint; _presaleActive[stageId] = presale; } function _stopSale(uint256 stageId) internal { _saleActive[stageId] = false; _presaleActive[stageId] = false; } function _setMerkleRoot(uint256 stageId, bytes32 newRoot) internal { _merkleRoot[stageId] = newRoot; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.16; import "@openzeppelin/contracts-upgradeable/utils/cryptography/ECDSAUpgradeable.sol"; abstract contract SignaturePresale { using ECDSAUpgradeable for bytes32; // verified data per stage mapping(uint256 => mapping(bytes32 => bool)) internal _verifiedData; address internal _signer; function _verifySignature( uint256 stageId, uint256 expiration, bytes32 data, bytes calldata signature ) internal { require(!_verifiedData[stageId][data], "Signature already verified"); require(expiration > block.timestamp, "Signature expired"); require( keccak256(abi.encodePacked(stageId, expiration, data)) .toEthSignedMessageHash() .recover(signature) == _signer, "Invalid signature" ); _verifiedData[stageId][data] = true; } function _setSigner(address signer) internal { _signer = signer; } function _isVerified(uint256 stageId, bytes32 data) internal view returns (bool) { return _verifiedData[stageId][data]; } }
{ "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "metadata": { "useLiteralContent": true }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[],"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":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"owner","type":"address"}],"name":"PassActivated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"owner","type":"address"}],"name":"PassDeactivated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"member","type":"address"}],"name":"PassMemberAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"member","type":"address"}],"name":"PassMemberRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"stageId","type":"uint256"},{"indexed":true,"internalType":"uint96","name":"feeRate","type":"uint96"},{"indexed":true,"internalType":"uint256","name":"price","type":"uint256"}],"name":"PassOptionCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"stageId","type":"uint256"},{"indexed":true,"internalType":"uint96","name":"feeRate","type":"uint96"}],"name":"PassOptionPurchased","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"stageId","type":"uint256"},{"indexed":true,"internalType":"uint96","name":"feeRate","type":"uint96"},{"indexed":true,"internalType":"bytes32","name":"data","type":"bytes32"}],"name":"PassOptionRedeemed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"stageId","type":"uint256"},{"indexed":true,"internalType":"uint96","name":"feeRate","type":"uint96"},{"indexed":true,"internalType":"uint256","name":"price","type":"uint256"},{"indexed":false,"internalType":"bool","name":"isValue","type":"bool"}],"name":"PassOptionUpdated","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":"uint256","name":"stageId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"maxAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"maxPerWallet","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"maxPerMint","type":"uint256"},{"indexed":false,"internalType":"bool","name":"presale","type":"bool"}],"name":"SaleStarted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"stageId","type":"uint256"}],"name":"SaleStopped","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"activatePass","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address[]","name":"members","type":"address[]"}],"name":"addPassMembers","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":"stageId","type":"uint256"},{"internalType":"address[]","name":"recipients","type":"address[]"},{"internalType":"uint96[]","name":"feeRates","type":"uint96[]"}],"name":"batchAirdrop","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"stageId","type":"uint256"},{"internalType":"uint96","name":"feeRate","type":"uint96"},{"internalType":"uint256","name":"price","type":"uint256"}],"name":"createPassOption","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"deactivatePass","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"disconnectPassMember","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getActivatedOwnerByToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"getActivatedTokenByOwner","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getDefaultFeeRate","outputs":[{"internalType":"uint96","name":"","type":"uint96"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getFeeRate","outputs":[{"internalType":"uint96","name":"","type":"uint96"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"getFeeRateOf","outputs":[{"internalType":"uint96","name":"","type":"uint96"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getMaxAllowedPassMembers","outputs":[{"internalType":"uint96","name":"","type":"uint96"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getPassMemberAt","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getPassMembersCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"stageId","type":"uint256"},{"internalType":"uint96","name":"feeRate","type":"uint96"}],"name":"getPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getStage","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"member","type":"address"}],"name":"getTokenByPassMember","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":"string","name":"name_","type":"string"},{"internalType":"string","name":"symbol_","type":"string"},{"internalType":"address","name":"treasury_","type":"address"},{"internalType":"address","name":"royalty_","type":"address"},{"internalType":"uint96","name":"royaltyFee_","type":"uint96"},{"internalType":"uint96","name":"defaultFeeRate_","type":"uint96"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","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":"stageId","type":"uint256"},{"internalType":"bytes32","name":"data","type":"bytes32"}],"name":"isRedeemed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"stageId","type":"uint256"}],"name":"maxAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"stageId","type":"uint256"}],"name":"maxPerMint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"stageId","type":"uint256"}],"name":"maxPerWallet","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"stageId","type":"uint256"},{"internalType":"address","name":"account","type":"address"}],"name":"mintCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"stageId","type":"uint256"}],"name":"presaleActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"stageId","type":"uint256"},{"internalType":"uint96","name":"feeRate","type":"uint96"},{"internalType":"uint64","name":"quantity","type":"uint64"},{"internalType":"uint64","name":"allowed","type":"uint64"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"bytes32[]","name":"proof","type":"bytes32[]"}],"name":"presalePurchasePass","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"stageId","type":"uint256"},{"internalType":"uint96","name":"feeRate","type":"uint96"},{"internalType":"uint64","name":"quantity","type":"uint64"},{"internalType":"address","name":"recipient","type":"address"}],"name":"purchasePass","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"stageId","type":"uint256"},{"internalType":"uint96","name":"feeRate","type":"uint96"},{"internalType":"uint64","name":"quantity","type":"uint64"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"expiration","type":"uint256"},{"internalType":"bytes32","name":"data","type":"bytes32"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"redeemPass","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address[]","name":"members","type":"address[]"}],"name":"removePassMembers","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_salePrice","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"stageId","type":"uint256"}],"name":"saleActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"newBaseURI","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint96","name":"feeRate","type":"uint96"}],"name":"setDefaultFeeRate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint96","name":"feeNumerator","type":"uint96"}],"name":"setDefaultRoyalty","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"stageId","type":"uint256"},{"internalType":"bytes32","name":"newRoot","type":"bytes32"}],"name":"setMerkleRoot","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"signer","type":"address"}],"name":"setSigner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint96","name":"feeNumerator","type":"uint96"}],"name":"setTokenRoyalty","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newTreasury","type":"address"}],"name":"setTreasury","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"stageId","type":"uint256"},{"internalType":"uint256","name":"newMaxAmount","type":"uint256"},{"internalType":"uint256","name":"newMaxPerWallet","type":"uint256"},{"internalType":"uint256","name":"newMaxPerMint","type":"uint256"},{"internalType":"bool","name":"presale","type":"bool"}],"name":"startSale","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"stageId","type":"uint256"}],"name":"stopSale","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"stageId","type":"uint256"}],"name":"supply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"oldTokenId","type":"uint256"},{"internalType":"uint256","name":"newTokenId","type":"uint256"}],"name":"switchPassActivation","outputs":[],"stateMutability":"nonpayable","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":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"treasury","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"stageId","type":"uint256"},{"internalType":"uint96","name":"feeRate","type":"uint96"},{"internalType":"uint256","name":"newPrice","type":"uint256"},{"internalType":"bool","name":"active","type":"bool"}],"name":"updatePassOption","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60806040523480156200001157600080fd5b506200001c62000022565b620000f1565b600954600160a81b900460ff1615620000915760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60095460ff600160a01b90910481161015620000ef576009805460ff60a01b191660ff60a01b17905560405160ff81527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b61584080620001016000396000f3fe6080604052600436106103fa5760003560e01c806361d027b3116102135780639bd2a9be11610123578063d547741f116100ab578063f0f442601161007a578063f0f4426014610d00578063f2fde38b14610d20578063f675e1b714610d40578063f8dd1f7614610d60578063f966281814610d8057600080fd5b8063d547741f14610c56578063e2c118d314610c76578063e985e9c514610c96578063ef08eaa814610ce057600080fd5b8063b8cae92c116100f2578063b8cae92c14610b6f578063c61df6a614610b9c578063c87b56dd14610bdf578063ce5d4bd814610bff578063d2aaef4e14610c3657600080fd5b80639bd2a9be14610b07578063a217fddf14610b1a578063a22cb46514610b2f578063b88d4fde14610b4f57600080fd5b8063765c8b1d116101a65780638da5cb5b116101755780638da5cb5b14610a8157806391d1485414610a9f57806391e18f4514610abf57806395d89b4114610ad25780639bcd5e0414610ae757600080fd5b8063765c8b1d14610a015780637703f6d014610a21578063789e3a5514610a415780637cf8577d14610a6157600080fd5b80636d1d16de116101e25780636d1d16de1461098c57806370a08231146109ac578063715018a6146109cc57806375741d2d146109e157600080fd5b806361d027b3146108f95780636352211e1461091f57806369ada53a1461093f5780636c19e7831461096c57600080fd5b8063354030231161030e57806347b8c003116102a15780634f6ccce7116102705780634f6ccce714610842578063536565c41461086257806355f804b314610882578063579b7a30146108a25780635944c753146108d957600080fd5b806347b8c003146107b25780634847ce65146107d25780634a5bd2fd146107f25780634e6f1c201461082257600080fd5b80633bb2a921116102dd5780633bb2a9211461073d5780633ccfd60b1461075d57806342842e0e14610772578063476f56b81461079257600080fd5b806335403023146106aa57806336568abe146106d757806339a30e76146106f75780633ba484ac1461070a57600080fd5b8063237b7733116103915780632a55205a116103605780632a55205a146105dd5780632e3250201461061c5780632f2ff15d1461064a5780632f745c591461066a57806334f52fc51461068a57600080fd5b8063237b77331461054057806323b872dd1461056d578063248a9ca31461058d5780632844f794146105bd57600080fd5b8063081812fc116103cd578063081812fc146104a8578063095ea7b3146104e057806318160ddd1461050057806318712c211461052057600080fd5b806301ffc9a7146103ff57806304634d8d1461043457806304ca27751461045657806306fdde0314610486575b600080fd5b34801561040b57600080fd5b5061041f61041a366004614a27565b610da0565b60405190151581526020015b60405180910390f35b34801561044057600080fd5b5061045461044f366004614a77565b610db1565b005b34801561046257600080fd5b5061041f610471366004614aaa565b60009081526006602052604090205460ff1690565b34801561049257600080fd5b5061049b610dcb565b60405161042b9190614b13565b3480156104b457600080fd5b506104c86104c3366004614aaa565b610e5e565b6040516001600160a01b03909116815260200161042b565b3480156104ec57600080fd5b506104546104fb366004614b26565b610e86565b34801561050c57600080fd5b50610138545b60405190815260200161042b565b34801561052c57600080fd5b5061045461053b366004614b50565b610f9b565b34801561054c57600080fd5b5061051261055b366004614aaa565b60009081526005602052604090205490565b34801561057957600080fd5b50610454610588366004614b72565b610fb9565b34801561059957600080fd5b506105126105a8366004614aaa565b600090815260a0602052604090206001015490565b3480156105c957600080fd5b506104546105d8366004614b50565b610fea565b3480156105e957600080fd5b506105fd6105f8366004614b50565b611225565b604080516001600160a01b03909316835260208301919091520161042b565b34801561062857600080fd5b50610512610637366004614aaa565b600090815261016a602052604090205490565b34801561065657600080fd5b50610454610665366004614bae565b6112d3565b34801561067657600080fd5b50610512610685366004614b26565b6112f8565b34801561069657600080fd5b506104546106a5366004614be1565b61138f565b3480156106b657600080fd5b506105126106c5366004614aaa565b60009081526002602052604090205490565b3480156106e357600080fd5b506104546106f2366004614bae565b611413565b610454610705366004614c3e565b611491565b34801561071657600080fd5b50610168546001600160601b03165b6040516001600160601b03909116815260200161042b565b34801561074957600080fd5b50610725610758366004614aaa565b611693565b34801561076957600080fd5b506104546116de565b34801561077e57600080fd5b5061045461078d366004614b72565b611745565b34801561079e57600080fd5b506105126107ad366004614aaa565b611760565b3480156107be57600080fd5b506104546107cd366004614aaa565b611778565b3480156107de57600080fd5b5061041f6107ed366004614b50565b611929565b3480156107fe57600080fd5b5061041f61080d366004614aaa565b60009081526007602052604090205460ff1690565b34801561082e57600080fd5b5061045461083d366004614d42565b61194e565b34801561084e57600080fd5b5061051261085d366004614aaa565b611a67565b34801561086e57600080fd5b5061045461087d366004614aaa565b611afc565b34801561088e57600080fd5b5061045461089d366004614e38565b611c43565b3480156108ae57600080fd5b506105126108bd366004614e6c565b6001600160a01b0316600090815261016e602052604090205490565b3480156108e557600080fd5b506104546108f4366004614e87565b611c5b565b34801561090557600080fd5b5061016854600160601b90046001600160a01b03166104c8565b34801561092b57600080fd5b506104c861093a366004614aaa565b611c77565b34801561094b57600080fd5b5061051261095a366004614aaa565b60009081526003602052604090205490565b34801561097857600080fd5b50610454610987366004614e6c565b611cd8565b34801561099857600080fd5b506104546109a7366004614ec3565b611d02565b3480156109b857600080fd5b506105126109c7366004614e6c565b611e44565b3480156109d857600080fd5b50610454611ecb565b3480156109ed57600080fd5b506104546109fc366004614f3c565b611edf565b348015610a0d57600080fd5b50610454610a1c366004614f57565b611f0e565b348015610a2d57600080fd5b50610454610a3c366004614aaa565b6120a0565b348015610a4d57600080fd5b50610454610a5c366004614ffb565b6120e7565b348015610a6d57600080fd5b50610454610a7c366004614d42565b6121ea565b348015610a8d57600080fd5b50603c546001600160a01b03166104c8565b348015610aab57600080fd5b5061041f610aba366004614bae565b612273565b610454610acd366004615044565b61229e565b348015610ade57600080fd5b5061049b61259d565b348015610af357600080fd5b50610512610b023660046150d3565b6125ad565b610454610b153660046150f6565b612610565b348015610b2657600080fd5b50610512600081565b348015610b3b57600080fd5b50610454610b4a366004615138565b6127fc565b348015610b5b57600080fd5b50610454610b6a366004615162565b612807565b348015610b7b57600080fd5b50610512610b8a366004614aaa565b60009081526004602052604090205490565b348015610ba857600080fd5b50610512610bb7366004614bae565b60009182526001602090815260408084206001600160a01b0393909316845291905290205490565b348015610beb57600080fd5b5061049b610bfa366004614aaa565b612839565b348015610c0b57600080fd5b506104c8610c1a366004614aaa565b600090815261016d60205260409020546001600160a01b031690565b348015610c4257600080fd5b50610725610c51366004614aaa565b61289f565b348015610c6257600080fd5b50610454610c71366004614bae565b612914565b348015610c8257600080fd5b50610512610c91366004614e6c565b612939565b348015610ca257600080fd5b5061041f610cb13660046151dd565b6001600160a01b0391821660009081526101096020908152604080832093909416825291909152205460ff1690565b348015610cec57600080fd5b50610454610cfb366004615207565b612985565b348015610d0c57600080fd5b50610454610d1b366004614e6c565b612a7c565b348015610d2c57600080fd5b50610454610d3b366004614e6c565b612ab1565b348015610d4c57600080fd5b50610725610d5b366004614e6c565b612b27565b348015610d6c57600080fd5b50610454610d7b366004614aaa565b612bec565b348015610d8c57600080fd5b506104c8610d9b366004614b50565b612c7b565b6000610dab82612c94565b92915050565b6000610dbc81612cb9565b610dc68383612cc3565b505050565b60606101048054610ddb9061522c565b80601f0160208091040260200160405190810160405280929190818152602001828054610e079061522c565b8015610e545780601f10610e2957610100808354040283529160200191610e54565b820191906000526020600020905b815481529060010190602001808311610e3757829003601f168201915b5050505050905090565b6000610e6982612d7d565b50600090815261010860205260409020546001600160a01b031690565b6000610e9182611c77565b9050806001600160a01b0316836001600160a01b031603610f035760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084015b60405180910390fd5b336001600160a01b0382161480610f1f5750610f1f8133610cb1565b610f915760405162461bcd60e51b815260206004820152603e60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206e6f7220617070726f76656420666f7220616c6c00006064820152608401610efa565b610dc68383612ddd565b6000610fa681612cb9565b5060009182526020829052604090912055565b610fc33382612e4c565b610fdf5760405162461bcd60e51b8152600401610efa90615266565b610dc6838383612ecc565b8082036110395760405162461bcd60e51b815260206004820152601b60248201527f43616e6e6f742073776974636820746f2073616d6520746f6b656e00000000006044820152606401610efa565b3361104383611c77565b6001600160a01b0316146110695760405162461bcd60e51b8152600401610efa906152b4565b3361107382611c77565b6001600160a01b0316146110995760405162461bcd60e51b8152600401610efa906152b4565b600082815261016d60205260409020546001600160a01b031633146110f55760405162461bcd60e51b815260206004820152601260248201527124b73b30b634b21030b1ba34bb30ba34b7b760711b6044820152606401610efa565b600081815261016d60205260409020546001600160a01b03161561112b5760405162461bcd60e51b8152600401610efa906152d9565b600082815261016f6020526040902061114390613076565b1561118a5760405162461bcd60e51b815260206004820152601760248201527613595b58995c9cc81cdd1a5b1b081858dd1a5d985d1959604a1b6044820152606401610efa565b600082815261016d6020908152604080832080546001600160a01b031990811690915584845281842080543392168217905580845261016e90925280832084905551909184917fd99429f557ca87df7ffefe25ae8de8feabeabd528cc646ff1c14534f857f6bd29190a3604051339082907fd4ae292da4c1b97c2b8a3a8a4d7788a389d5f06e6fbae5c9bfc42235964a1f0a90600090a35050565b600082815260d3602090815260408083208151808301909252546001600160a01b038116808352600160a01b9091046001600160601b031692820192909252829161129a57506040805180820190915260d2546001600160a01b0381168252600160a01b90046001600160601b031660208201525b6020810151600090612710906112b9906001600160601b03168761531c565b6112c39190615351565b91519350909150505b9250929050565b600082815260a060205260409020600101546112ee81612cb9565b610dc68383613080565b600061130383611e44565b82106113655760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b6064820152608401610efa565b506001600160a01b0391909116600090815261013660209081526040808320938352929052205490565b600061139a81612cb9565b600085815261016c602090815260408083206001600160601b0388168085529083529281902060018101805460ff191687151590811790915590879055905190815285929188917f58f305c686ebbf6d0c690803bbde56d59bd8b9d1fa4a2e92381141d46e0e8907910160405180910390a45050505050565b6001600160a01b03811633146114835760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610efa565b61148d8282613106565b5050565b6000888152600360209081526040808320546006909252909120548991889188919060ff166114d25760405162461bcd60e51b8152600401610efa90615365565b6000836001600160401b0316116114fb5760405162461bcd60e51b8152600401610efa9061538e565b6000811161150a576001611531565b600084815260026020526040902054819061152e906001600160401b03861661316d565b11155b61154d5760405162461bcd60e51b8152600401610efa906153b5565b6000848152600460205260409020546001600160401b03841611156115845760405162461bcd60e51b8152600401610efa906153e2565b600084815260056020908152604080832054600183528184206001600160a01b0387168552909252909120546115c3906001600160401b03861661316d565b11156115e15760405162461bcd60e51b8152600401610efa90615411565b60008c81526007602052604090205460ff166116345760405162461bcd60e51b815260206004820152601260248201527150726573616c65206e6f742061637469766560701b6044820152606401610efa565b6116418c89898989613179565b61164d8c8c8b8d613363565b868b6001600160601b03168d7fa8230c372eb3d29a6da2e4dbe072e3f7411066608b72ac4fd5cef851a55f561160405160405180910390a4505050505050505050505050565b60008061169f8361289f565b9050806001600160601b03166000036116bb5750600292915050565b806001600160601b031660fa036116d55750600192915050565b50600092915050565b60006116e981612cb9565b600047116117255760405162461bcd60e51b8152602060048201526009602482015268302062616c616e636560b81b6044820152606401610efa565b61016854479061148d90600160601b90046001600160a01b031682613444565b610dc683838360405180602001604052806000815250612807565b600081815261016f60205260408120610dab90613076565b3361178282611c77565b6001600160a01b0316146117a85760405162461bcd60e51b8152600401610efa906152b4565b600081815261016d60205260409020546001600160a01b03161561180e5760405162461bcd60e51b815260206004820152601760248201527f546f6b656e20616c7265616479206163746976617465640000000000000000006044820152606401610efa565b33600090815261016e60205260409020541561186c5760405162461bcd60e51b815260206004820152601760248201527f4f776e657220616c7265616479206163746976617465640000000000000000006044820152606401610efa565b336000908152610170602052604090206001015460ff16156118c95760405162461bcd60e51b81526020600482015260166024820152754d656d626572206f6620616e6f74686572207061737360501b6044820152606401610efa565b600081815261016d6020908152604080832080546001600160a01b0319163390811790915580845261016e90925280832084905551909183917fd4ae292da4c1b97c2b8a3a8a4d7788a389d5f06e6fbae5c9bfc42235964a1f0a9190a350565b600082815260086020908152604080832084845290915281205460ff165b9392505050565b600083815261016d602052604090205481906001600160a01b031633146119875760405162461bcd60e51b8152600401610efa906152d9565b600084815261016f6020526040902081906119a190613076565b6119ab9190615448565b6119b485611693565b6001600160601b03161015611a0b5760405162461bcd60e51b815260206004820152601760248201527f52656163686564204d6178696d756d204d656d626572730000000000000000006044820152606401610efa565b60005b81816001600160401b03161015611a6057611a58858585846001600160401b0316818110611a3e57611a3e61545b565b9050602002016020810190611a539190614e6c565b61355d565b600101611a0e565b5050505050565b6000611a736101385490565b8210611ad65760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b6064820152608401610efa565b6101388281548110611aea57611aea61545b565b90600052602060002001549050919050565b600081815261016d60205260409020546001600160a01b03163314611b335760405162461bcd60e51b8152600401610efa906152d9565b33600090815261016e60205260409020548114611b885760405162461bcd60e51b815260206004820152601360248201527213dddb995c881b9bdd081858dd1a5d985d1959606a1b6044820152606401610efa565b600081815261016f60205260409020611ba090613076565b15611be75760405162461bcd60e51b815260206004820152601760248201527613595b58995c9cc81cdd1a5b1b081858dd1a5d985d1959604a1b6044820152606401610efa565b600081815261016d6020908152604080832080546001600160a01b03191690553380845261016e90925280832083905551909183917fd99429f557ca87df7ffefe25ae8de8feabeabd528cc646ff1c14534f857f6bd29190a350565b6000611c4e81612cb9565b610169610dc683826154b7565b6000611c6681612cb9565b611c7184848461369b565b50505050565b600081815261010660205260408120546001600160a01b031680610dab5760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b6044820152606401610efa565b6000611ce381612cb9565b600980546001600160a01b0319166001600160a01b0384161790555050565b6000611d0d81612cb9565b838214611d5c5760405162461bcd60e51b815260206004820152601c60248201527f496e76616c6964206e756d626572206f6620726563697069656e7473000000006044820152606401610efa565b8360005b81811015611e3a57600088815261016c6020526040812090868684818110611d8a57611d8a61545b565b9050602002016020810190611d9f9190614f3c565b6001600160601b0316815260208101919091526040016000206001015460ff16611ddb5760405162461bcd60e51b8152600401610efa90615576565b611e3288868684818110611df157611df161545b565b9050602002016020810190611e069190614f3c565b898985818110611e1857611e1861545b565b9050602002016020810190611e2d9190614e6c565b613766565b600101611d60565b5050505050505050565b60006001600160a01b038216611eae5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b6064820152608401610efa565b506001600160a01b03166000908152610107602052604090205490565b611ed361382e565b611edd6000613888565b565b6000611eea81612cb9565b5061016880546001600160601b0319166001600160601b0392909216919091179055565b600954600160a81b900460ff1615808015611f3657506009546001600160a01b90910460ff16105b80611f575750303b158015611f575750600954600160a01b900460ff166001145b611fba5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610efa565b6009805460ff60a01b1916600160a01b1790558015611fe7576009805460ff60a81b1916600160a81b1790555b611ff187876138da565b611ff961390d565b61200161390d565b612009613936565b61201161390d565b6001600160601b0319600160601b6001600160a01b03871602166001600160601b0383161761016855612045600033613080565b61204f8484612cc3565b8015612097576009805460ff60a81b19169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050505050565b600081815261016d60205260409020546001600160a01b03166120d55760405162461bcd60e51b8152600401610efa906152d9565b6120e48133613967565b613967565b50565b60006120f281612cb9565b60008681526006602052604090205460ff16156121475760405162461bcd60e51b815260206004820152601360248201527253616c6520616c72656164792061637469766560681b6044820152606401610efa565b60008681526006602090815260408083208054600160ff1991821617909155600383528184208990556005835281842088905560048352818420879055600790925290912080549091168315151790556040805186815260208101869052908101849052821515606082015286907fafb595b10a1ea4e6a7767173c9c6707891e7174118bedb6bd7c28b4ecad106fa9060800160405180910390a2505050505050565b600083815261016d602052604090205481906001600160a01b031633146122235760405162461bcd60e51b8152600401610efa906152d9565b60005b81816001600160401b03161015611a605761226b858585846001600160401b03168181106122565761225661545b565b90506020020160208101906120df9190614e6c565b600101612226565b600091825260a0602090815260408084206001600160a01b0393909316845291905290205460ff1690565b6000878152600360209081526040808320546006909252909120548891879186919060ff166122df5760405162461bcd60e51b8152600401610efa90615365565b6000836001600160401b0316116123085760405162461bcd60e51b8152600401610efa9061538e565b6000811161231757600161233e565b600084815260026020526040902054819061233b906001600160401b03861661316d565b11155b61235a5760405162461bcd60e51b8152600401610efa906153b5565b6000848152600460205260409020546001600160401b03841611156123915760405162461bcd60e51b8152600401610efa906153e2565b600084815260056020908152604080832054600183528184206001600160a01b0387168552909252909120546123d0906001600160401b03861661316d565b11156123ee5760405162461bcd60e51b8152600401610efa90615411565b60008b8152602081815260408083205460079092529091205460ff1661244b5760405162461bcd60e51b815260206004820152601260248201527150726573616c65206e6f742061637469766560701b6044820152606401610efa565b8060000361248d5760405162461bcd60e51b815260206004820152600f60248201526e141c995cd85b19481b9bdd081cd95d608a1b6044820152606401610efa565b61250f878780806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250506040516001600160601b031960608e901b1660208201526001600160c01b031960c08f901b166034820152859250603c01905060405160208183030381529060405280519060200120613a2d565b61254d5760405162461bcd60e51b815260206004820152600f60248201526e141c995cd85b19481a5b9d985b1a59608a1b6044820152606401610efa565b6125598c8c8a8d613363565b6040516001600160601b038c16908d907fb9ba3cda2ca5d3d8faf8d0e09982dabba09a516299d2b54d33baa8f35434b14c90600090a3505050505050505050505050565b60606101058054610ddb9061522c565b600082815261016c602090815260408083206001600160601b038516845282528083208151808301909252805482526001015460ff161515918101829052906126085760405162461bcd60e51b8152600401610efa90615576565b519392505050565b6000848152600360209081526040808320546006909252909120548591849184919060ff166126515760405162461bcd60e51b8152600401610efa90615365565b6000836001600160401b03161161267a5760405162461bcd60e51b8152600401610efa9061538e565b600081116126895760016126b0565b60008481526002602052604090205481906126ad906001600160401b03861661316d565b11155b6126cc5760405162461bcd60e51b8152600401610efa906153b5565b6000848152600460205260409020546001600160401b03841611156127035760405162461bcd60e51b8152600401610efa906153e2565b600084815260056020908152604080832054600183528184206001600160a01b038716855290925290912054612742906001600160401b03861661316d565b11156127605760405162461bcd60e51b8152600401610efa90615411565b60008881526007602052604090205460ff16156127b05760405162461bcd60e51b815260206004820152600e60248201526d50726573616c652061637469766560901b6044820152606401610efa565b6127bc88888789613363565b6040516001600160601b0388169089907fb9ba3cda2ca5d3d8faf8d0e09982dabba09a516299d2b54d33baa8f35434b14c90600090a35050505050505050565b61148d338383613a43565b6128113383612e4c565b61282d5760405162461bcd60e51b8152600401610efa90615266565b611c7184848484613b12565b606061284482612d7d565b600061284e613b45565b9050600081511161286e5760405180602001604052806000815250611947565b8061287884613b55565b6040516020016128899291906155a2565b6040516020818303038152906040529392505050565b600081815261016b6020526040812054600160601b900460ff166128f75760405162461bcd60e51b815260206004820152600f60248201526e125b9d985b1a59081d1bdad95b9259608a1b6044820152606401610efa565b50600090815261016b60205260409020546001600160601b031690565b600082815260a0602052604090206001015461292f81612cb9565b610dc68383613106565b6001600160a01b0381166000908152610170602090815260408083208151808301909252805482526001015460ff1615159181018290529061297e5750600092915050565b5192915050565b600061299081612cb9565b600084815261016c602090815260408083206001600160601b038716845290915290206001015460ff16156129fd5760405162461bcd60e51b81526020600482015260136024820152725061737320616c72656164792065786973747360681b6044820152606401610efa565b60408051808201825283815260016020808301828152600089815261016c83528581206001600160601b038a16808352935285812094518555905193909201805460ff1916931515939093179092559151849287917fa2fd84681d7a45be68a37025dd071757e93b9b72b804ff58263b32017e0bf7839190a450505050565b6000612a8781612cb9565b5061016880546001600160a01b03909216600160601b026001600160601b03909216919091179055565b612ab961382e565b6001600160a01b038116612b1e5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610efa565b6120e481613888565b6001600160a01b038116600090815261016e602090815260408083205480845261016b909252822054600160601b900460ff1615612b7e57600090815261016b60205260409020546001600160601b031692915050565b6001600160a01b0383166000908152610170602052604090206001015460ff1615612bd85750506001600160a01b031660009081526101706020908152604080832054835261016b9091529020546001600160601b031690565b5050610168546001600160601b0316919050565b6000612bf781612cb9565b60008281526006602052604090205460ff16612c255760405162461bcd60e51b8152600401610efa90615365565b6000828152600660209081526040808320805460ff19908116909155600790925280832080549092169091555183917f47f75dd68b479a7dc904baeb75498ebb157246edcc056bb28bf42d12f1d8e36491a25050565b600082815261016f602052604081206119479083613c55565b60006001600160e01b0319821663780e9d6360e01b1480610dab5750610dab82613c61565b6120e48133613ca1565b6127106001600160601b0382161115612cee5760405162461bcd60e51b8152600401610efa906155d1565b6001600160a01b038216612d445760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c6964207265636569766572000000000000006044820152606401610efa565b604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b9091021760d255565b600081815261010660205260409020546001600160a01b03166120e45760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b6044820152606401610efa565b60008181526101086020526040902080546001600160a01b0319166001600160a01b0384169081179091558190612e1382611c77565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b600080612e5883611c77565b9050806001600160a01b0316846001600160a01b03161480612ea057506001600160a01b038082166000908152610109602090815260408083209388168352929052205460ff165b80612ec45750836001600160a01b0316612eb984610e5e565b6001600160a01b0316145b949350505050565b826001600160a01b0316612edf82611c77565b6001600160a01b031614612f435760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201526437bbb732b960d91b6064820152608401610efa565b6001600160a01b038216612fa55760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610efa565b612fb0838383613d05565b612fbb600082612ddd565b6001600160a01b038316600090815261010760205260408120805460019290612fe590849061561b565b90915550506001600160a01b038216600090815261010760205260408120805460019290613014908490615448565b90915550506000818152610106602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b6000610dab825490565b61308a8282612273565b61148d57600082815260a0602090815260408083206001600160a01b03851684529091529020805460ff191660011790556130c23390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6131108282612273565b1561148d57600082815260a0602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b60006119478284615448565b600085815260086020908152604080832086845290915290205460ff16156131e35760405162461bcd60e51b815260206004820152601a60248201527f5369676e617475726520616c72656164792076657269666965640000000000006044820152606401610efa565b4284116132265760405162461bcd60e51b815260206004820152601160248201527014da59db985d1d5c9948195e1c1a5c9959607a1b6044820152606401610efa565b600954604080516020601f85018190048102820181019092528381526001600160a01b03909216916132ef918590859081908401838280828437600092019190915250506040805160208082018d90528183018c905260608083018c9052835180840390910181526080830184528051908201207f19457468657265756d205369676e6564204d6573736167653a0a33320000000060a084015260bc808401919091528351808403909101815260dc909201909252805191012091506132e99050565b90613d6f565b6001600160a01b0316146133395760405162461bcd60e51b8152602060048201526011602482015270496e76616c6964207369676e617475726560781b6044820152606401610efa565b50506000928352600860209081526040808520928552919052909120805460ff1916600117905550565b600084815261016c602090815260408083206001600160601b03871684528252918290208251808401909352805483526001015460ff1615159082018190526133be5760405162461bcd60e51b8152600401610efa90615576565b805134906133d5906001600160401b038516613d93565b11156134155760405162461bcd60e51b815260206004820152600f60248201526e15985b1d59481a5b98dbdc9c9958dd608a1b6044820152606401610efa565b60005b826001600160401b031681101561343c57613434868686613766565b600101613418565b505050505050565b804710156134945760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610efa565b6000826001600160a01b03168260405160006040518083038185875af1925050503d80600081146134e1576040519150601f19603f3d011682016040523d82523d6000602084013e6134e6565b606091505b5050905080610dc65760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d617920686176652072657665727465640000000000006064820152608401610efa565b6001600160a01b038116600090815261016e6020526040902054156135c45760405162461bcd60e51b815260206004820152601860248201527f4d656d62657220616c72656164792061637469766174656400000000000000006044820152606401610efa565b6001600160a01b0381166000908152610170602052604090206001015460ff161561362a5760405162461bcd60e51b81526020600482015260166024820152754d656d626572206f6620616e6f74686572207061737360501b6044820152606401610efa565b600082815261016f602052604090206136439082613d9f565b506001600160a01b038116600081815261017060205260408082208581556001908101805460ff191690911790555184917feed5c42b98ff6f919c93c16be2fc3821307f9dc5435013526c11aaeb9d2a041d91a35050565b6127106001600160601b03821611156136c65760405162461bcd60e51b8152600401610efa906155d1565b6001600160a01b03821661371c5760405162461bcd60e51b815260206004820152601b60248201527f455243323938313a20496e76616c696420706172616d657465727300000000006044820152606401610efa565b6040805180820182526001600160a01b0393841681526001600160601b039283166020808301918252600096875260d390529190942093519051909116600160a01b029116179055565b600061377d60016137776101385490565b9061316d565b60408051808201825260008082526020918201819052825180840184526001600160601b038881168252600182850181815287855261016b86528685209351845491511515600160601b026cffffffffffffffffffffffffff199092169316929092179190911790915561016a8352838220899055888252600283528382208054820190558083528382206001600160a01b038816835290925291909120805490910190559050611c718282613db4565b603c546001600160a01b03163314611edd5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610efa565b603c80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600954600160a81b900460ff166139035760405162461bcd60e51b8152600401610efa9061562e565b61148d8282613dce565b600954600160a81b900460ff16611edd5760405162461bcd60e51b8152600401610efa9061562e565b600954600160a81b900460ff1661395f5760405162461bcd60e51b8152600401610efa9061562e565b611edd613e12565b600082815261016f602052604090206139809082613e44565b6139c45760405162461bcd60e51b815260206004820152601560248201527413595b58995c88191bd95cc81b9bdd08195e1a5cdd605a1b6044820152606401610efa565b600082815261016f602052604090206139dd9082613e66565b506001600160a01b03811660008181526101706020526040808220600101805460ff191690555184917f2dd1fba15a05261f4cccee50e7ab336435a45cf2c976c73a65c4d0e3e190118d91a35050565b600082613a3a8584613e7b565b14949350505050565b816001600160a01b0316836001600160a01b031603613aa45760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610efa565b6001600160a01b0383811660008181526101096020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b613b1d848484612ecc565b613b2984848484613ec0565b611c715760405162461bcd60e51b8152600401610efa90615679565b60606101698054610ddb9061522c565b606081600003613b7c5750506040805180820190915260018152600360fc1b602082015290565b8160005b8115613ba65780613b90816156cb565b9150613b9f9050600a83615351565b9150613b80565b6000816001600160401b03811115613bc057613bc0614d8d565b6040519080825280601f01601f191660200182016040528015613bea576020820181803683370190505b5090505b8415612ec457613bff60018361561b565b9150613c0c600a866156e4565b613c17906030615448565b60f81b818381518110613c2c57613c2c61545b565b60200101906001600160f81b031916908160001a905350613c4e600a86615351565b9450613bee565b60006119478383613fc1565b60006001600160e01b031982166380ac58cd60e01b1480613c9257506001600160e01b03198216635b5e139f60e01b145b80610dab5750610dab82613feb565b613cab8282612273565b61148d57613cc3816001600160a01b03166014614010565b613cce836020614010565b604051602001613cdf9291906156f8565b60408051601f198184030181529082905262461bcd60e51b8252610efa91600401614b13565b600081815261016d60205260409020546001600160a01b031615613d645760405162461bcd60e51b815260206004820152601660248201527514185cdcc8185b1c9958591e481858dd1a5d985d195960521b6044820152606401610efa565b610dc68383836141ab565b6000806000613d7e8585614265565b91509150613d8b816142a7565b509392505050565b6000611947828461531c565b6000611947836001600160a01b03841661445d565b61148d8282604051806020016040528060008152506144ac565b600954600160a81b900460ff16613df75760405162461bcd60e51b8152600401610efa9061562e565b610104613e0483826154b7565b50610105610dc682826154b7565b600954600160a81b900460ff16613e3b5760405162461bcd60e51b8152600401610efa9061562e565b611edd33613888565b6001600160a01b03811660009081526001830160205260408120541515611947565b6000611947836001600160a01b0384166144df565b600081815b8451811015613d8b57613eac82868381518110613e9f57613e9f61545b565b60200260200101516145d2565b915080613eb8816156cb565b915050613e80565b60006001600160a01b0384163b15613fb657604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290613f0490339089908890889060040161576d565b6020604051808303816000875af1925050508015613f3f575060408051601f3d908101601f19168201909252613f3c918101906157aa565b60015b613f9c573d808015613f6d576040519150601f19603f3d011682016040523d82523d6000602084013e613f72565b606091505b508051600003613f945760405162461bcd60e51b8152600401610efa90615679565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050612ec4565b506001949350505050565b6000826000018281548110613fd857613fd861545b565b9060005260206000200154905092915050565b60006001600160e01b0319821663152a902d60e11b1480610dab5750610dab82614601565b6060600061401f83600261531c565b61402a906002615448565b6001600160401b0381111561404157614041614d8d565b6040519080825280601f01601f19166020018201604052801561406b576020820181803683370190505b509050600360fc1b816000815181106140865761408661545b565b60200101906001600160f81b031916908160001a905350600f60fb1b816001815181106140b5576140b561545b565b60200101906001600160f81b031916908160001a90535060006140d984600261531c565b6140e4906001615448565b90505b600181111561415c576f181899199a1a9b1b9c1cb0b131b232b360811b85600f16601081106141185761411861545b565b1a60f81b82828151811061412e5761412e61545b565b60200101906001600160f81b031916908160001a90535060049490941c93614155816157c7565b90506140e7565b5083156119475760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610efa565b6001600160a01b03831661420857614203816101388054600083815261013960205260408120829055600182018355919091527ff79a63dcec80ed75c82f36161f17b9c2f407860160383a7be0a0ee7962c527ae0155565b61422b565b816001600160a01b0316836001600160a01b03161461422b5761422b8382614636565b6001600160a01b03821661424257610dc6816146d8565b826001600160a01b0316826001600160a01b031614610dc657610dc6828261478d565b600080825160410361429b5760208301516040840151606085015160001a61428f878285856147d3565b945094505050506112cc565b506000905060026112cc565b60008160048111156142bb576142bb6157de565b036142c35750565b60018160048111156142d7576142d76157de565b036143245760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610efa565b6002816004811115614338576143386157de565b036143855760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610efa565b6003816004811115614399576143996157de565b036143f15760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610efa565b6004816004811115614405576144056157de565b036120e45760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b6064820152608401610efa565b60008181526001830160205260408120546144a457508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610dab565b506000610dab565b6144b683836148c0565b6144c36000848484613ec0565b610dc65760405162461bcd60e51b8152600401610efa90615679565b600081815260018301602052604081205480156145c857600061450360018361561b565b85549091506000906145179060019061561b565b905081811461457c5760008660000182815481106145375761453761545b565b906000526020600020015490508087600001848154811061455a5761455a61545b565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061458d5761458d6157f4565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610dab565b6000915050610dab565b60008183106145ee576000828152602084905260409020611947565b6000838152602083905260409020611947565b60006001600160e01b03198216637965db0b60e01b1480610dab57506301ffc9a760e01b6001600160e01b0319831614610dab565b6000600161464384611e44565b61464d919061561b565b600083815261013760205260409020549091508082146146a3576001600160a01b038416600090815261013660209081526040808320858452825280832054848452818420819055835261013790915290208190555b506000918252610137602090815260408084208490556001600160a01b03909416835261013681528383209183525290812055565b610138546000906146eb9060019061561b565b6000838152610139602052604081205461013880549394509092849081106147155761471561545b565b906000526020600020015490508061013883815481106147375761473761545b565b60009182526020808320909101929092558281526101399091526040808220849055858252812055610138805480614771576147716157f4565b6001900381819060005260206000200160009055905550505050565b600061479883611e44565b6001600160a01b0390931660009081526101366020908152604080832086845282528083208590559382526101379052919091209190915550565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561480a57506000905060036148b7565b8460ff16601b1415801561482257508460ff16601c14155b1561483357506000905060046148b7565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015614887573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166148b0576000600192509250506148b7565b9150600090505b94509492505050565b6001600160a01b0382166149165760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610efa565b600081815261010660205260409020546001600160a01b03161561497c5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610efa565b61498860008383613d05565b6001600160a01b0382166000908152610107602052604081208054600192906149b2908490615448565b90915550506000818152610106602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6001600160e01b0319811681146120e457600080fd5b600060208284031215614a3957600080fd5b813561194781614a11565b80356001600160a01b0381168114614a5b57600080fd5b919050565b80356001600160601b0381168114614a5b57600080fd5b60008060408385031215614a8a57600080fd5b614a9383614a44565b9150614aa160208401614a60565b90509250929050565b600060208284031215614abc57600080fd5b5035919050565b60005b83811015614ade578181015183820152602001614ac6565b50506000910152565b60008151808452614aff816020860160208601614ac3565b601f01601f19169290920160200192915050565b6020815260006119476020830184614ae7565b60008060408385031215614b3957600080fd5b614b4283614a44565b946020939093013593505050565b60008060408385031215614b6357600080fd5b50508035926020909101359150565b600080600060608486031215614b8757600080fd5b614b9084614a44565b9250614b9e60208501614a44565b9150604084013590509250925092565b60008060408385031215614bc157600080fd5b82359150614aa160208401614a44565b80358015158114614a5b57600080fd5b60008060008060808587031215614bf757600080fd5b84359350614c0760208601614a60565b925060408501359150614c1c60608601614bd1565b905092959194509250565b80356001600160401b0381168114614a5b57600080fd5b60008060008060008060008060e0898b031215614c5a57600080fd5b88359750614c6a60208a01614a60565b9650614c7860408a01614c27565b9550614c8660608a01614a44565b94506080890135935060a0890135925060c08901356001600160401b0380821115614cb057600080fd5b818b0191508b601f830112614cc457600080fd5b813581811115614cd357600080fd5b8c6020828501011115614ce557600080fd5b6020830194508093505050509295985092959890939650565b60008083601f840112614d1057600080fd5b5081356001600160401b03811115614d2757600080fd5b6020830191508360208260051b85010111156112cc57600080fd5b600080600060408486031215614d5757600080fd5b8335925060208401356001600160401b03811115614d7457600080fd5b614d8086828701614cfe565b9497909650939450505050565b634e487b7160e01b600052604160045260246000fd5b60006001600160401b0380841115614dbd57614dbd614d8d565b604051601f8501601f19908116603f01168101908282118183101715614de557614de5614d8d565b81604052809350858152868686011115614dfe57600080fd5b858560208301376000602087830101525050509392505050565b600082601f830112614e2957600080fd5b61194783833560208501614da3565b600060208284031215614e4a57600080fd5b81356001600160401b03811115614e6057600080fd5b612ec484828501614e18565b600060208284031215614e7e57600080fd5b61194782614a44565b600080600060608486031215614e9c57600080fd5b83359250614eac60208501614a44565b9150614eba60408501614a60565b90509250925092565b600080600080600060608688031215614edb57600080fd5b8535945060208601356001600160401b0380821115614ef957600080fd5b614f0589838a01614cfe565b90965094506040880135915080821115614f1e57600080fd5b50614f2b88828901614cfe565b969995985093965092949392505050565b600060208284031215614f4e57600080fd5b61194782614a60565b60008060008060008060c08789031215614f7057600080fd5b86356001600160401b0380821115614f8757600080fd5b614f938a838b01614e18565b97506020890135915080821115614fa957600080fd5b50614fb689828a01614e18565b955050614fc560408801614a44565b9350614fd360608801614a44565b9250614fe160808801614a60565b9150614fef60a08801614a60565b90509295509295509295565b600080600080600060a0868803121561501357600080fd5b8535945060208601359350604086013592506060860135915061503860808701614bd1565b90509295509295909350565b600080600080600080600060c0888a03121561505f57600080fd5b8735965061506f60208901614a60565b955061507d60408901614c27565b945061508b60608901614c27565b935061509960808901614a44565b925060a08801356001600160401b038111156150b457600080fd5b6150c08a828b01614cfe565b989b979a50959850939692959293505050565b600080604083850312156150e657600080fd5b82359150614aa160208401614a60565b6000806000806080858703121561510c57600080fd5b8435935061511c60208601614a60565b925061512a60408601614c27565b9150614c1c60608601614a44565b6000806040838503121561514b57600080fd5b61515483614a44565b9150614aa160208401614bd1565b6000806000806080858703121561517857600080fd5b61518185614a44565b935061518f60208601614a44565b92506040850135915060608501356001600160401b038111156151b157600080fd5b8501601f810187136151c257600080fd5b6151d187823560208401614da3565b91505092959194509250565b600080604083850312156151f057600080fd5b6151f983614a44565b9150614aa160208401614a44565b60008060006060848603121561521c57600080fd5b83359250614b9e60208501614a60565b600181811c9082168061524057607f821691505b60208210810361526057634e487b7160e01b600052602260045260246000fd5b50919050565b6020808252602e908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526d1c881b9bdc88185c1c1c9bdd995960921b606082015260800190565b6020808252600b908201526a2737ba10309037bbb732b960a91b604082015260600190565b602080825260139082015272151bdad95b881b9bdd081858dd1a5d985d1959606a1b604082015260600190565b634e487b7160e01b600052601160045260246000fd5b600081600019048311821515161561533657615336615306565b500290565b634e487b7160e01b600052601260045260246000fd5b6000826153605761536061533b565b500490565b6020808252600f908201526e53616c65206e6f742061637469766560881b604082015260600190565b6020808252600d908201526c05175616e74697479206973203609c1b604082015260600190565b6020808252601390820152724578636565646564206d617820737570706c7960681b604082015260600190565b602080825260159082015274115e18d959591959081b585e081c195c881b5a5b9d605a1b604082015260600190565b60208082526017908201527f4578636565646564206d6178207065722077616c6c6574000000000000000000604082015260600190565b80820180821115610dab57610dab615306565b634e487b7160e01b600052603260045260246000fd5b601f821115610dc657600081815260208120601f850160051c810160208610156154985750805b601f850160051c820191505b8181101561343c578281556001016154a4565b81516001600160401b038111156154d0576154d0614d8d565b6154e4816154de845461522c565b84615471565b602080601f83116001811461551957600084156155015750858301515b600019600386901b1c1916600185901b17855561343c565b600085815260208120601f198616915b8281101561554857888601518255948401946001909101908401615529565b50858210156155665787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60208082526012908201527114185cdcc8191bd95cdb89dd08195e1a5cdd60721b604082015260600190565b600083516155b4818460208801614ac3565b8351908301906155c8818360208801614ac3565b01949350505050565b6020808252602a908201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646040820152692073616c65507269636560b01b606082015260800190565b81810381811115610dab57610dab615306565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6000600182016156dd576156dd615306565b5060010190565b6000826156f3576156f361533b565b500690565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351615730816017850160208801614ac3565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351615761816028840160208801614ac3565b01602801949350505050565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906157a090830184614ae7565b9695505050505050565b6000602082840312156157bc57600080fd5b815161194781614a11565b6000816157d6576157d6615306565b506000190190565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052603160045260246000fdfea2646970667358221220af48ac41d6f60ba7d358b2b499fd77f358943ab43fb191914c379d59cbe4cf8064736f6c63430008100033
Deployed Bytecode
0x6080604052600436106103fa5760003560e01c806361d027b3116102135780639bd2a9be11610123578063d547741f116100ab578063f0f442601161007a578063f0f4426014610d00578063f2fde38b14610d20578063f675e1b714610d40578063f8dd1f7614610d60578063f966281814610d8057600080fd5b8063d547741f14610c56578063e2c118d314610c76578063e985e9c514610c96578063ef08eaa814610ce057600080fd5b8063b8cae92c116100f2578063b8cae92c14610b6f578063c61df6a614610b9c578063c87b56dd14610bdf578063ce5d4bd814610bff578063d2aaef4e14610c3657600080fd5b80639bd2a9be14610b07578063a217fddf14610b1a578063a22cb46514610b2f578063b88d4fde14610b4f57600080fd5b8063765c8b1d116101a65780638da5cb5b116101755780638da5cb5b14610a8157806391d1485414610a9f57806391e18f4514610abf57806395d89b4114610ad25780639bcd5e0414610ae757600080fd5b8063765c8b1d14610a015780637703f6d014610a21578063789e3a5514610a415780637cf8577d14610a6157600080fd5b80636d1d16de116101e25780636d1d16de1461098c57806370a08231146109ac578063715018a6146109cc57806375741d2d146109e157600080fd5b806361d027b3146108f95780636352211e1461091f57806369ada53a1461093f5780636c19e7831461096c57600080fd5b8063354030231161030e57806347b8c003116102a15780634f6ccce7116102705780634f6ccce714610842578063536565c41461086257806355f804b314610882578063579b7a30146108a25780635944c753146108d957600080fd5b806347b8c003146107b25780634847ce65146107d25780634a5bd2fd146107f25780634e6f1c201461082257600080fd5b80633bb2a921116102dd5780633bb2a9211461073d5780633ccfd60b1461075d57806342842e0e14610772578063476f56b81461079257600080fd5b806335403023146106aa57806336568abe146106d757806339a30e76146106f75780633ba484ac1461070a57600080fd5b8063237b7733116103915780632a55205a116103605780632a55205a146105dd5780632e3250201461061c5780632f2ff15d1461064a5780632f745c591461066a57806334f52fc51461068a57600080fd5b8063237b77331461054057806323b872dd1461056d578063248a9ca31461058d5780632844f794146105bd57600080fd5b8063081812fc116103cd578063081812fc146104a8578063095ea7b3146104e057806318160ddd1461050057806318712c211461052057600080fd5b806301ffc9a7146103ff57806304634d8d1461043457806304ca27751461045657806306fdde0314610486575b600080fd5b34801561040b57600080fd5b5061041f61041a366004614a27565b610da0565b60405190151581526020015b60405180910390f35b34801561044057600080fd5b5061045461044f366004614a77565b610db1565b005b34801561046257600080fd5b5061041f610471366004614aaa565b60009081526006602052604090205460ff1690565b34801561049257600080fd5b5061049b610dcb565b60405161042b9190614b13565b3480156104b457600080fd5b506104c86104c3366004614aaa565b610e5e565b6040516001600160a01b03909116815260200161042b565b3480156104ec57600080fd5b506104546104fb366004614b26565b610e86565b34801561050c57600080fd5b50610138545b60405190815260200161042b565b34801561052c57600080fd5b5061045461053b366004614b50565b610f9b565b34801561054c57600080fd5b5061051261055b366004614aaa565b60009081526005602052604090205490565b34801561057957600080fd5b50610454610588366004614b72565b610fb9565b34801561059957600080fd5b506105126105a8366004614aaa565b600090815260a0602052604090206001015490565b3480156105c957600080fd5b506104546105d8366004614b50565b610fea565b3480156105e957600080fd5b506105fd6105f8366004614b50565b611225565b604080516001600160a01b03909316835260208301919091520161042b565b34801561062857600080fd5b50610512610637366004614aaa565b600090815261016a602052604090205490565b34801561065657600080fd5b50610454610665366004614bae565b6112d3565b34801561067657600080fd5b50610512610685366004614b26565b6112f8565b34801561069657600080fd5b506104546106a5366004614be1565b61138f565b3480156106b657600080fd5b506105126106c5366004614aaa565b60009081526002602052604090205490565b3480156106e357600080fd5b506104546106f2366004614bae565b611413565b610454610705366004614c3e565b611491565b34801561071657600080fd5b50610168546001600160601b03165b6040516001600160601b03909116815260200161042b565b34801561074957600080fd5b50610725610758366004614aaa565b611693565b34801561076957600080fd5b506104546116de565b34801561077e57600080fd5b5061045461078d366004614b72565b611745565b34801561079e57600080fd5b506105126107ad366004614aaa565b611760565b3480156107be57600080fd5b506104546107cd366004614aaa565b611778565b3480156107de57600080fd5b5061041f6107ed366004614b50565b611929565b3480156107fe57600080fd5b5061041f61080d366004614aaa565b60009081526007602052604090205460ff1690565b34801561082e57600080fd5b5061045461083d366004614d42565b61194e565b34801561084e57600080fd5b5061051261085d366004614aaa565b611a67565b34801561086e57600080fd5b5061045461087d366004614aaa565b611afc565b34801561088e57600080fd5b5061045461089d366004614e38565b611c43565b3480156108ae57600080fd5b506105126108bd366004614e6c565b6001600160a01b0316600090815261016e602052604090205490565b3480156108e557600080fd5b506104546108f4366004614e87565b611c5b565b34801561090557600080fd5b5061016854600160601b90046001600160a01b03166104c8565b34801561092b57600080fd5b506104c861093a366004614aaa565b611c77565b34801561094b57600080fd5b5061051261095a366004614aaa565b60009081526003602052604090205490565b34801561097857600080fd5b50610454610987366004614e6c565b611cd8565b34801561099857600080fd5b506104546109a7366004614ec3565b611d02565b3480156109b857600080fd5b506105126109c7366004614e6c565b611e44565b3480156109d857600080fd5b50610454611ecb565b3480156109ed57600080fd5b506104546109fc366004614f3c565b611edf565b348015610a0d57600080fd5b50610454610a1c366004614f57565b611f0e565b348015610a2d57600080fd5b50610454610a3c366004614aaa565b6120a0565b348015610a4d57600080fd5b50610454610a5c366004614ffb565b6120e7565b348015610a6d57600080fd5b50610454610a7c366004614d42565b6121ea565b348015610a8d57600080fd5b50603c546001600160a01b03166104c8565b348015610aab57600080fd5b5061041f610aba366004614bae565b612273565b610454610acd366004615044565b61229e565b348015610ade57600080fd5b5061049b61259d565b348015610af357600080fd5b50610512610b023660046150d3565b6125ad565b610454610b153660046150f6565b612610565b348015610b2657600080fd5b50610512600081565b348015610b3b57600080fd5b50610454610b4a366004615138565b6127fc565b348015610b5b57600080fd5b50610454610b6a366004615162565b612807565b348015610b7b57600080fd5b50610512610b8a366004614aaa565b60009081526004602052604090205490565b348015610ba857600080fd5b50610512610bb7366004614bae565b60009182526001602090815260408084206001600160a01b0393909316845291905290205490565b348015610beb57600080fd5b5061049b610bfa366004614aaa565b612839565b348015610c0b57600080fd5b506104c8610c1a366004614aaa565b600090815261016d60205260409020546001600160a01b031690565b348015610c4257600080fd5b50610725610c51366004614aaa565b61289f565b348015610c6257600080fd5b50610454610c71366004614bae565b612914565b348015610c8257600080fd5b50610512610c91366004614e6c565b612939565b348015610ca257600080fd5b5061041f610cb13660046151dd565b6001600160a01b0391821660009081526101096020908152604080832093909416825291909152205460ff1690565b348015610cec57600080fd5b50610454610cfb366004615207565b612985565b348015610d0c57600080fd5b50610454610d1b366004614e6c565b612a7c565b348015610d2c57600080fd5b50610454610d3b366004614e6c565b612ab1565b348015610d4c57600080fd5b50610725610d5b366004614e6c565b612b27565b348015610d6c57600080fd5b50610454610d7b366004614aaa565b612bec565b348015610d8c57600080fd5b506104c8610d9b366004614b50565b612c7b565b6000610dab82612c94565b92915050565b6000610dbc81612cb9565b610dc68383612cc3565b505050565b60606101048054610ddb9061522c565b80601f0160208091040260200160405190810160405280929190818152602001828054610e079061522c565b8015610e545780601f10610e2957610100808354040283529160200191610e54565b820191906000526020600020905b815481529060010190602001808311610e3757829003601f168201915b5050505050905090565b6000610e6982612d7d565b50600090815261010860205260409020546001600160a01b031690565b6000610e9182611c77565b9050806001600160a01b0316836001600160a01b031603610f035760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084015b60405180910390fd5b336001600160a01b0382161480610f1f5750610f1f8133610cb1565b610f915760405162461bcd60e51b815260206004820152603e60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206e6f7220617070726f76656420666f7220616c6c00006064820152608401610efa565b610dc68383612ddd565b6000610fa681612cb9565b5060009182526020829052604090912055565b610fc33382612e4c565b610fdf5760405162461bcd60e51b8152600401610efa90615266565b610dc6838383612ecc565b8082036110395760405162461bcd60e51b815260206004820152601b60248201527f43616e6e6f742073776974636820746f2073616d6520746f6b656e00000000006044820152606401610efa565b3361104383611c77565b6001600160a01b0316146110695760405162461bcd60e51b8152600401610efa906152b4565b3361107382611c77565b6001600160a01b0316146110995760405162461bcd60e51b8152600401610efa906152b4565b600082815261016d60205260409020546001600160a01b031633146110f55760405162461bcd60e51b815260206004820152601260248201527124b73b30b634b21030b1ba34bb30ba34b7b760711b6044820152606401610efa565b600081815261016d60205260409020546001600160a01b03161561112b5760405162461bcd60e51b8152600401610efa906152d9565b600082815261016f6020526040902061114390613076565b1561118a5760405162461bcd60e51b815260206004820152601760248201527613595b58995c9cc81cdd1a5b1b081858dd1a5d985d1959604a1b6044820152606401610efa565b600082815261016d6020908152604080832080546001600160a01b031990811690915584845281842080543392168217905580845261016e90925280832084905551909184917fd99429f557ca87df7ffefe25ae8de8feabeabd528cc646ff1c14534f857f6bd29190a3604051339082907fd4ae292da4c1b97c2b8a3a8a4d7788a389d5f06e6fbae5c9bfc42235964a1f0a90600090a35050565b600082815260d3602090815260408083208151808301909252546001600160a01b038116808352600160a01b9091046001600160601b031692820192909252829161129a57506040805180820190915260d2546001600160a01b0381168252600160a01b90046001600160601b031660208201525b6020810151600090612710906112b9906001600160601b03168761531c565b6112c39190615351565b91519350909150505b9250929050565b600082815260a060205260409020600101546112ee81612cb9565b610dc68383613080565b600061130383611e44565b82106113655760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b6064820152608401610efa565b506001600160a01b0391909116600090815261013660209081526040808320938352929052205490565b600061139a81612cb9565b600085815261016c602090815260408083206001600160601b0388168085529083529281902060018101805460ff191687151590811790915590879055905190815285929188917f58f305c686ebbf6d0c690803bbde56d59bd8b9d1fa4a2e92381141d46e0e8907910160405180910390a45050505050565b6001600160a01b03811633146114835760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610efa565b61148d8282613106565b5050565b6000888152600360209081526040808320546006909252909120548991889188919060ff166114d25760405162461bcd60e51b8152600401610efa90615365565b6000836001600160401b0316116114fb5760405162461bcd60e51b8152600401610efa9061538e565b6000811161150a576001611531565b600084815260026020526040902054819061152e906001600160401b03861661316d565b11155b61154d5760405162461bcd60e51b8152600401610efa906153b5565b6000848152600460205260409020546001600160401b03841611156115845760405162461bcd60e51b8152600401610efa906153e2565b600084815260056020908152604080832054600183528184206001600160a01b0387168552909252909120546115c3906001600160401b03861661316d565b11156115e15760405162461bcd60e51b8152600401610efa90615411565b60008c81526007602052604090205460ff166116345760405162461bcd60e51b815260206004820152601260248201527150726573616c65206e6f742061637469766560701b6044820152606401610efa565b6116418c89898989613179565b61164d8c8c8b8d613363565b868b6001600160601b03168d7fa8230c372eb3d29a6da2e4dbe072e3f7411066608b72ac4fd5cef851a55f561160405160405180910390a4505050505050505050505050565b60008061169f8361289f565b9050806001600160601b03166000036116bb5750600292915050565b806001600160601b031660fa036116d55750600192915050565b50600092915050565b60006116e981612cb9565b600047116117255760405162461bcd60e51b8152602060048201526009602482015268302062616c616e636560b81b6044820152606401610efa565b61016854479061148d90600160601b90046001600160a01b031682613444565b610dc683838360405180602001604052806000815250612807565b600081815261016f60205260408120610dab90613076565b3361178282611c77565b6001600160a01b0316146117a85760405162461bcd60e51b8152600401610efa906152b4565b600081815261016d60205260409020546001600160a01b03161561180e5760405162461bcd60e51b815260206004820152601760248201527f546f6b656e20616c7265616479206163746976617465640000000000000000006044820152606401610efa565b33600090815261016e60205260409020541561186c5760405162461bcd60e51b815260206004820152601760248201527f4f776e657220616c7265616479206163746976617465640000000000000000006044820152606401610efa565b336000908152610170602052604090206001015460ff16156118c95760405162461bcd60e51b81526020600482015260166024820152754d656d626572206f6620616e6f74686572207061737360501b6044820152606401610efa565b600081815261016d6020908152604080832080546001600160a01b0319163390811790915580845261016e90925280832084905551909183917fd4ae292da4c1b97c2b8a3a8a4d7788a389d5f06e6fbae5c9bfc42235964a1f0a9190a350565b600082815260086020908152604080832084845290915281205460ff165b9392505050565b600083815261016d602052604090205481906001600160a01b031633146119875760405162461bcd60e51b8152600401610efa906152d9565b600084815261016f6020526040902081906119a190613076565b6119ab9190615448565b6119b485611693565b6001600160601b03161015611a0b5760405162461bcd60e51b815260206004820152601760248201527f52656163686564204d6178696d756d204d656d626572730000000000000000006044820152606401610efa565b60005b81816001600160401b03161015611a6057611a58858585846001600160401b0316818110611a3e57611a3e61545b565b9050602002016020810190611a539190614e6c565b61355d565b600101611a0e565b5050505050565b6000611a736101385490565b8210611ad65760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b6064820152608401610efa565b6101388281548110611aea57611aea61545b565b90600052602060002001549050919050565b600081815261016d60205260409020546001600160a01b03163314611b335760405162461bcd60e51b8152600401610efa906152d9565b33600090815261016e60205260409020548114611b885760405162461bcd60e51b815260206004820152601360248201527213dddb995c881b9bdd081858dd1a5d985d1959606a1b6044820152606401610efa565b600081815261016f60205260409020611ba090613076565b15611be75760405162461bcd60e51b815260206004820152601760248201527613595b58995c9cc81cdd1a5b1b081858dd1a5d985d1959604a1b6044820152606401610efa565b600081815261016d6020908152604080832080546001600160a01b03191690553380845261016e90925280832083905551909183917fd99429f557ca87df7ffefe25ae8de8feabeabd528cc646ff1c14534f857f6bd29190a350565b6000611c4e81612cb9565b610169610dc683826154b7565b6000611c6681612cb9565b611c7184848461369b565b50505050565b600081815261010660205260408120546001600160a01b031680610dab5760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b6044820152606401610efa565b6000611ce381612cb9565b600980546001600160a01b0319166001600160a01b0384161790555050565b6000611d0d81612cb9565b838214611d5c5760405162461bcd60e51b815260206004820152601c60248201527f496e76616c6964206e756d626572206f6620726563697069656e7473000000006044820152606401610efa565b8360005b81811015611e3a57600088815261016c6020526040812090868684818110611d8a57611d8a61545b565b9050602002016020810190611d9f9190614f3c565b6001600160601b0316815260208101919091526040016000206001015460ff16611ddb5760405162461bcd60e51b8152600401610efa90615576565b611e3288868684818110611df157611df161545b565b9050602002016020810190611e069190614f3c565b898985818110611e1857611e1861545b565b9050602002016020810190611e2d9190614e6c565b613766565b600101611d60565b5050505050505050565b60006001600160a01b038216611eae5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b6064820152608401610efa565b506001600160a01b03166000908152610107602052604090205490565b611ed361382e565b611edd6000613888565b565b6000611eea81612cb9565b5061016880546001600160601b0319166001600160601b0392909216919091179055565b600954600160a81b900460ff1615808015611f3657506009546001600160a01b90910460ff16105b80611f575750303b158015611f575750600954600160a01b900460ff166001145b611fba5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610efa565b6009805460ff60a01b1916600160a01b1790558015611fe7576009805460ff60a81b1916600160a81b1790555b611ff187876138da565b611ff961390d565b61200161390d565b612009613936565b61201161390d565b6001600160601b0319600160601b6001600160a01b03871602166001600160601b0383161761016855612045600033613080565b61204f8484612cc3565b8015612097576009805460ff60a81b19169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050505050565b600081815261016d60205260409020546001600160a01b03166120d55760405162461bcd60e51b8152600401610efa906152d9565b6120e48133613967565b613967565b50565b60006120f281612cb9565b60008681526006602052604090205460ff16156121475760405162461bcd60e51b815260206004820152601360248201527253616c6520616c72656164792061637469766560681b6044820152606401610efa565b60008681526006602090815260408083208054600160ff1991821617909155600383528184208990556005835281842088905560048352818420879055600790925290912080549091168315151790556040805186815260208101869052908101849052821515606082015286907fafb595b10a1ea4e6a7767173c9c6707891e7174118bedb6bd7c28b4ecad106fa9060800160405180910390a2505050505050565b600083815261016d602052604090205481906001600160a01b031633146122235760405162461bcd60e51b8152600401610efa906152d9565b60005b81816001600160401b03161015611a605761226b858585846001600160401b03168181106122565761225661545b565b90506020020160208101906120df9190614e6c565b600101612226565b600091825260a0602090815260408084206001600160a01b0393909316845291905290205460ff1690565b6000878152600360209081526040808320546006909252909120548891879186919060ff166122df5760405162461bcd60e51b8152600401610efa90615365565b6000836001600160401b0316116123085760405162461bcd60e51b8152600401610efa9061538e565b6000811161231757600161233e565b600084815260026020526040902054819061233b906001600160401b03861661316d565b11155b61235a5760405162461bcd60e51b8152600401610efa906153b5565b6000848152600460205260409020546001600160401b03841611156123915760405162461bcd60e51b8152600401610efa906153e2565b600084815260056020908152604080832054600183528184206001600160a01b0387168552909252909120546123d0906001600160401b03861661316d565b11156123ee5760405162461bcd60e51b8152600401610efa90615411565b60008b8152602081815260408083205460079092529091205460ff1661244b5760405162461bcd60e51b815260206004820152601260248201527150726573616c65206e6f742061637469766560701b6044820152606401610efa565b8060000361248d5760405162461bcd60e51b815260206004820152600f60248201526e141c995cd85b19481b9bdd081cd95d608a1b6044820152606401610efa565b61250f878780806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250506040516001600160601b031960608e901b1660208201526001600160c01b031960c08f901b166034820152859250603c01905060405160208183030381529060405280519060200120613a2d565b61254d5760405162461bcd60e51b815260206004820152600f60248201526e141c995cd85b19481a5b9d985b1a59608a1b6044820152606401610efa565b6125598c8c8a8d613363565b6040516001600160601b038c16908d907fb9ba3cda2ca5d3d8faf8d0e09982dabba09a516299d2b54d33baa8f35434b14c90600090a3505050505050505050505050565b60606101058054610ddb9061522c565b600082815261016c602090815260408083206001600160601b038516845282528083208151808301909252805482526001015460ff161515918101829052906126085760405162461bcd60e51b8152600401610efa90615576565b519392505050565b6000848152600360209081526040808320546006909252909120548591849184919060ff166126515760405162461bcd60e51b8152600401610efa90615365565b6000836001600160401b03161161267a5760405162461bcd60e51b8152600401610efa9061538e565b600081116126895760016126b0565b60008481526002602052604090205481906126ad906001600160401b03861661316d565b11155b6126cc5760405162461bcd60e51b8152600401610efa906153b5565b6000848152600460205260409020546001600160401b03841611156127035760405162461bcd60e51b8152600401610efa906153e2565b600084815260056020908152604080832054600183528184206001600160a01b038716855290925290912054612742906001600160401b03861661316d565b11156127605760405162461bcd60e51b8152600401610efa90615411565b60008881526007602052604090205460ff16156127b05760405162461bcd60e51b815260206004820152600e60248201526d50726573616c652061637469766560901b6044820152606401610efa565b6127bc88888789613363565b6040516001600160601b0388169089907fb9ba3cda2ca5d3d8faf8d0e09982dabba09a516299d2b54d33baa8f35434b14c90600090a35050505050505050565b61148d338383613a43565b6128113383612e4c565b61282d5760405162461bcd60e51b8152600401610efa90615266565b611c7184848484613b12565b606061284482612d7d565b600061284e613b45565b9050600081511161286e5760405180602001604052806000815250611947565b8061287884613b55565b6040516020016128899291906155a2565b6040516020818303038152906040529392505050565b600081815261016b6020526040812054600160601b900460ff166128f75760405162461bcd60e51b815260206004820152600f60248201526e125b9d985b1a59081d1bdad95b9259608a1b6044820152606401610efa565b50600090815261016b60205260409020546001600160601b031690565b600082815260a0602052604090206001015461292f81612cb9565b610dc68383613106565b6001600160a01b0381166000908152610170602090815260408083208151808301909252805482526001015460ff1615159181018290529061297e5750600092915050565b5192915050565b600061299081612cb9565b600084815261016c602090815260408083206001600160601b038716845290915290206001015460ff16156129fd5760405162461bcd60e51b81526020600482015260136024820152725061737320616c72656164792065786973747360681b6044820152606401610efa565b60408051808201825283815260016020808301828152600089815261016c83528581206001600160601b038a16808352935285812094518555905193909201805460ff1916931515939093179092559151849287917fa2fd84681d7a45be68a37025dd071757e93b9b72b804ff58263b32017e0bf7839190a450505050565b6000612a8781612cb9565b5061016880546001600160a01b03909216600160601b026001600160601b03909216919091179055565b612ab961382e565b6001600160a01b038116612b1e5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610efa565b6120e481613888565b6001600160a01b038116600090815261016e602090815260408083205480845261016b909252822054600160601b900460ff1615612b7e57600090815261016b60205260409020546001600160601b031692915050565b6001600160a01b0383166000908152610170602052604090206001015460ff1615612bd85750506001600160a01b031660009081526101706020908152604080832054835261016b9091529020546001600160601b031690565b5050610168546001600160601b0316919050565b6000612bf781612cb9565b60008281526006602052604090205460ff16612c255760405162461bcd60e51b8152600401610efa90615365565b6000828152600660209081526040808320805460ff19908116909155600790925280832080549092169091555183917f47f75dd68b479a7dc904baeb75498ebb157246edcc056bb28bf42d12f1d8e36491a25050565b600082815261016f602052604081206119479083613c55565b60006001600160e01b0319821663780e9d6360e01b1480610dab5750610dab82613c61565b6120e48133613ca1565b6127106001600160601b0382161115612cee5760405162461bcd60e51b8152600401610efa906155d1565b6001600160a01b038216612d445760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c6964207265636569766572000000000000006044820152606401610efa565b604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b9091021760d255565b600081815261010660205260409020546001600160a01b03166120e45760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b6044820152606401610efa565b60008181526101086020526040902080546001600160a01b0319166001600160a01b0384169081179091558190612e1382611c77565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b600080612e5883611c77565b9050806001600160a01b0316846001600160a01b03161480612ea057506001600160a01b038082166000908152610109602090815260408083209388168352929052205460ff165b80612ec45750836001600160a01b0316612eb984610e5e565b6001600160a01b0316145b949350505050565b826001600160a01b0316612edf82611c77565b6001600160a01b031614612f435760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201526437bbb732b960d91b6064820152608401610efa565b6001600160a01b038216612fa55760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610efa565b612fb0838383613d05565b612fbb600082612ddd565b6001600160a01b038316600090815261010760205260408120805460019290612fe590849061561b565b90915550506001600160a01b038216600090815261010760205260408120805460019290613014908490615448565b90915550506000818152610106602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b6000610dab825490565b61308a8282612273565b61148d57600082815260a0602090815260408083206001600160a01b03851684529091529020805460ff191660011790556130c23390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6131108282612273565b1561148d57600082815260a0602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b60006119478284615448565b600085815260086020908152604080832086845290915290205460ff16156131e35760405162461bcd60e51b815260206004820152601a60248201527f5369676e617475726520616c72656164792076657269666965640000000000006044820152606401610efa565b4284116132265760405162461bcd60e51b815260206004820152601160248201527014da59db985d1d5c9948195e1c1a5c9959607a1b6044820152606401610efa565b600954604080516020601f85018190048102820181019092528381526001600160a01b03909216916132ef918590859081908401838280828437600092019190915250506040805160208082018d90528183018c905260608083018c9052835180840390910181526080830184528051908201207f19457468657265756d205369676e6564204d6573736167653a0a33320000000060a084015260bc808401919091528351808403909101815260dc909201909252805191012091506132e99050565b90613d6f565b6001600160a01b0316146133395760405162461bcd60e51b8152602060048201526011602482015270496e76616c6964207369676e617475726560781b6044820152606401610efa565b50506000928352600860209081526040808520928552919052909120805460ff1916600117905550565b600084815261016c602090815260408083206001600160601b03871684528252918290208251808401909352805483526001015460ff1615159082018190526133be5760405162461bcd60e51b8152600401610efa90615576565b805134906133d5906001600160401b038516613d93565b11156134155760405162461bcd60e51b815260206004820152600f60248201526e15985b1d59481a5b98dbdc9c9958dd608a1b6044820152606401610efa565b60005b826001600160401b031681101561343c57613434868686613766565b600101613418565b505050505050565b804710156134945760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610efa565b6000826001600160a01b03168260405160006040518083038185875af1925050503d80600081146134e1576040519150601f19603f3d011682016040523d82523d6000602084013e6134e6565b606091505b5050905080610dc65760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d617920686176652072657665727465640000000000006064820152608401610efa565b6001600160a01b038116600090815261016e6020526040902054156135c45760405162461bcd60e51b815260206004820152601860248201527f4d656d62657220616c72656164792061637469766174656400000000000000006044820152606401610efa565b6001600160a01b0381166000908152610170602052604090206001015460ff161561362a5760405162461bcd60e51b81526020600482015260166024820152754d656d626572206f6620616e6f74686572207061737360501b6044820152606401610efa565b600082815261016f602052604090206136439082613d9f565b506001600160a01b038116600081815261017060205260408082208581556001908101805460ff191690911790555184917feed5c42b98ff6f919c93c16be2fc3821307f9dc5435013526c11aaeb9d2a041d91a35050565b6127106001600160601b03821611156136c65760405162461bcd60e51b8152600401610efa906155d1565b6001600160a01b03821661371c5760405162461bcd60e51b815260206004820152601b60248201527f455243323938313a20496e76616c696420706172616d657465727300000000006044820152606401610efa565b6040805180820182526001600160a01b0393841681526001600160601b039283166020808301918252600096875260d390529190942093519051909116600160a01b029116179055565b600061377d60016137776101385490565b9061316d565b60408051808201825260008082526020918201819052825180840184526001600160601b038881168252600182850181815287855261016b86528685209351845491511515600160601b026cffffffffffffffffffffffffff199092169316929092179190911790915561016a8352838220899055888252600283528382208054820190558083528382206001600160a01b038816835290925291909120805490910190559050611c718282613db4565b603c546001600160a01b03163314611edd5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610efa565b603c80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600954600160a81b900460ff166139035760405162461bcd60e51b8152600401610efa9061562e565b61148d8282613dce565b600954600160a81b900460ff16611edd5760405162461bcd60e51b8152600401610efa9061562e565b600954600160a81b900460ff1661395f5760405162461bcd60e51b8152600401610efa9061562e565b611edd613e12565b600082815261016f602052604090206139809082613e44565b6139c45760405162461bcd60e51b815260206004820152601560248201527413595b58995c88191bd95cc81b9bdd08195e1a5cdd605a1b6044820152606401610efa565b600082815261016f602052604090206139dd9082613e66565b506001600160a01b03811660008181526101706020526040808220600101805460ff191690555184917f2dd1fba15a05261f4cccee50e7ab336435a45cf2c976c73a65c4d0e3e190118d91a35050565b600082613a3a8584613e7b565b14949350505050565b816001600160a01b0316836001600160a01b031603613aa45760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610efa565b6001600160a01b0383811660008181526101096020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b613b1d848484612ecc565b613b2984848484613ec0565b611c715760405162461bcd60e51b8152600401610efa90615679565b60606101698054610ddb9061522c565b606081600003613b7c5750506040805180820190915260018152600360fc1b602082015290565b8160005b8115613ba65780613b90816156cb565b9150613b9f9050600a83615351565b9150613b80565b6000816001600160401b03811115613bc057613bc0614d8d565b6040519080825280601f01601f191660200182016040528015613bea576020820181803683370190505b5090505b8415612ec457613bff60018361561b565b9150613c0c600a866156e4565b613c17906030615448565b60f81b818381518110613c2c57613c2c61545b565b60200101906001600160f81b031916908160001a905350613c4e600a86615351565b9450613bee565b60006119478383613fc1565b60006001600160e01b031982166380ac58cd60e01b1480613c9257506001600160e01b03198216635b5e139f60e01b145b80610dab5750610dab82613feb565b613cab8282612273565b61148d57613cc3816001600160a01b03166014614010565b613cce836020614010565b604051602001613cdf9291906156f8565b60408051601f198184030181529082905262461bcd60e51b8252610efa91600401614b13565b600081815261016d60205260409020546001600160a01b031615613d645760405162461bcd60e51b815260206004820152601660248201527514185cdcc8185b1c9958591e481858dd1a5d985d195960521b6044820152606401610efa565b610dc68383836141ab565b6000806000613d7e8585614265565b91509150613d8b816142a7565b509392505050565b6000611947828461531c565b6000611947836001600160a01b03841661445d565b61148d8282604051806020016040528060008152506144ac565b600954600160a81b900460ff16613df75760405162461bcd60e51b8152600401610efa9061562e565b610104613e0483826154b7565b50610105610dc682826154b7565b600954600160a81b900460ff16613e3b5760405162461bcd60e51b8152600401610efa9061562e565b611edd33613888565b6001600160a01b03811660009081526001830160205260408120541515611947565b6000611947836001600160a01b0384166144df565b600081815b8451811015613d8b57613eac82868381518110613e9f57613e9f61545b565b60200260200101516145d2565b915080613eb8816156cb565b915050613e80565b60006001600160a01b0384163b15613fb657604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290613f0490339089908890889060040161576d565b6020604051808303816000875af1925050508015613f3f575060408051601f3d908101601f19168201909252613f3c918101906157aa565b60015b613f9c573d808015613f6d576040519150601f19603f3d011682016040523d82523d6000602084013e613f72565b606091505b508051600003613f945760405162461bcd60e51b8152600401610efa90615679565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050612ec4565b506001949350505050565b6000826000018281548110613fd857613fd861545b565b9060005260206000200154905092915050565b60006001600160e01b0319821663152a902d60e11b1480610dab5750610dab82614601565b6060600061401f83600261531c565b61402a906002615448565b6001600160401b0381111561404157614041614d8d565b6040519080825280601f01601f19166020018201604052801561406b576020820181803683370190505b509050600360fc1b816000815181106140865761408661545b565b60200101906001600160f81b031916908160001a905350600f60fb1b816001815181106140b5576140b561545b565b60200101906001600160f81b031916908160001a90535060006140d984600261531c565b6140e4906001615448565b90505b600181111561415c576f181899199a1a9b1b9c1cb0b131b232b360811b85600f16601081106141185761411861545b565b1a60f81b82828151811061412e5761412e61545b565b60200101906001600160f81b031916908160001a90535060049490941c93614155816157c7565b90506140e7565b5083156119475760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610efa565b6001600160a01b03831661420857614203816101388054600083815261013960205260408120829055600182018355919091527ff79a63dcec80ed75c82f36161f17b9c2f407860160383a7be0a0ee7962c527ae0155565b61422b565b816001600160a01b0316836001600160a01b03161461422b5761422b8382614636565b6001600160a01b03821661424257610dc6816146d8565b826001600160a01b0316826001600160a01b031614610dc657610dc6828261478d565b600080825160410361429b5760208301516040840151606085015160001a61428f878285856147d3565b945094505050506112cc565b506000905060026112cc565b60008160048111156142bb576142bb6157de565b036142c35750565b60018160048111156142d7576142d76157de565b036143245760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610efa565b6002816004811115614338576143386157de565b036143855760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610efa565b6003816004811115614399576143996157de565b036143f15760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610efa565b6004816004811115614405576144056157de565b036120e45760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b6064820152608401610efa565b60008181526001830160205260408120546144a457508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610dab565b506000610dab565b6144b683836148c0565b6144c36000848484613ec0565b610dc65760405162461bcd60e51b8152600401610efa90615679565b600081815260018301602052604081205480156145c857600061450360018361561b565b85549091506000906145179060019061561b565b905081811461457c5760008660000182815481106145375761453761545b565b906000526020600020015490508087600001848154811061455a5761455a61545b565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061458d5761458d6157f4565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610dab565b6000915050610dab565b60008183106145ee576000828152602084905260409020611947565b6000838152602083905260409020611947565b60006001600160e01b03198216637965db0b60e01b1480610dab57506301ffc9a760e01b6001600160e01b0319831614610dab565b6000600161464384611e44565b61464d919061561b565b600083815261013760205260409020549091508082146146a3576001600160a01b038416600090815261013660209081526040808320858452825280832054848452818420819055835261013790915290208190555b506000918252610137602090815260408084208490556001600160a01b03909416835261013681528383209183525290812055565b610138546000906146eb9060019061561b565b6000838152610139602052604081205461013880549394509092849081106147155761471561545b565b906000526020600020015490508061013883815481106147375761473761545b565b60009182526020808320909101929092558281526101399091526040808220849055858252812055610138805480614771576147716157f4565b6001900381819060005260206000200160009055905550505050565b600061479883611e44565b6001600160a01b0390931660009081526101366020908152604080832086845282528083208590559382526101379052919091209190915550565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561480a57506000905060036148b7565b8460ff16601b1415801561482257508460ff16601c14155b1561483357506000905060046148b7565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015614887573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166148b0576000600192509250506148b7565b9150600090505b94509492505050565b6001600160a01b0382166149165760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610efa565b600081815261010660205260409020546001600160a01b03161561497c5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610efa565b61498860008383613d05565b6001600160a01b0382166000908152610107602052604081208054600192906149b2908490615448565b90915550506000818152610106602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6001600160e01b0319811681146120e457600080fd5b600060208284031215614a3957600080fd5b813561194781614a11565b80356001600160a01b0381168114614a5b57600080fd5b919050565b80356001600160601b0381168114614a5b57600080fd5b60008060408385031215614a8a57600080fd5b614a9383614a44565b9150614aa160208401614a60565b90509250929050565b600060208284031215614abc57600080fd5b5035919050565b60005b83811015614ade578181015183820152602001614ac6565b50506000910152565b60008151808452614aff816020860160208601614ac3565b601f01601f19169290920160200192915050565b6020815260006119476020830184614ae7565b60008060408385031215614b3957600080fd5b614b4283614a44565b946020939093013593505050565b60008060408385031215614b6357600080fd5b50508035926020909101359150565b600080600060608486031215614b8757600080fd5b614b9084614a44565b9250614b9e60208501614a44565b9150604084013590509250925092565b60008060408385031215614bc157600080fd5b82359150614aa160208401614a44565b80358015158114614a5b57600080fd5b60008060008060808587031215614bf757600080fd5b84359350614c0760208601614a60565b925060408501359150614c1c60608601614bd1565b905092959194509250565b80356001600160401b0381168114614a5b57600080fd5b60008060008060008060008060e0898b031215614c5a57600080fd5b88359750614c6a60208a01614a60565b9650614c7860408a01614c27565b9550614c8660608a01614a44565b94506080890135935060a0890135925060c08901356001600160401b0380821115614cb057600080fd5b818b0191508b601f830112614cc457600080fd5b813581811115614cd357600080fd5b8c6020828501011115614ce557600080fd5b6020830194508093505050509295985092959890939650565b60008083601f840112614d1057600080fd5b5081356001600160401b03811115614d2757600080fd5b6020830191508360208260051b85010111156112cc57600080fd5b600080600060408486031215614d5757600080fd5b8335925060208401356001600160401b03811115614d7457600080fd5b614d8086828701614cfe565b9497909650939450505050565b634e487b7160e01b600052604160045260246000fd5b60006001600160401b0380841115614dbd57614dbd614d8d565b604051601f8501601f19908116603f01168101908282118183101715614de557614de5614d8d565b81604052809350858152868686011115614dfe57600080fd5b858560208301376000602087830101525050509392505050565b600082601f830112614e2957600080fd5b61194783833560208501614da3565b600060208284031215614e4a57600080fd5b81356001600160401b03811115614e6057600080fd5b612ec484828501614e18565b600060208284031215614e7e57600080fd5b61194782614a44565b600080600060608486031215614e9c57600080fd5b83359250614eac60208501614a44565b9150614eba60408501614a60565b90509250925092565b600080600080600060608688031215614edb57600080fd5b8535945060208601356001600160401b0380821115614ef957600080fd5b614f0589838a01614cfe565b90965094506040880135915080821115614f1e57600080fd5b50614f2b88828901614cfe565b969995985093965092949392505050565b600060208284031215614f4e57600080fd5b61194782614a60565b60008060008060008060c08789031215614f7057600080fd5b86356001600160401b0380821115614f8757600080fd5b614f938a838b01614e18565b97506020890135915080821115614fa957600080fd5b50614fb689828a01614e18565b955050614fc560408801614a44565b9350614fd360608801614a44565b9250614fe160808801614a60565b9150614fef60a08801614a60565b90509295509295509295565b600080600080600060a0868803121561501357600080fd5b8535945060208601359350604086013592506060860135915061503860808701614bd1565b90509295509295909350565b600080600080600080600060c0888a03121561505f57600080fd5b8735965061506f60208901614a60565b955061507d60408901614c27565b945061508b60608901614c27565b935061509960808901614a44565b925060a08801356001600160401b038111156150b457600080fd5b6150c08a828b01614cfe565b989b979a50959850939692959293505050565b600080604083850312156150e657600080fd5b82359150614aa160208401614a60565b6000806000806080858703121561510c57600080fd5b8435935061511c60208601614a60565b925061512a60408601614c27565b9150614c1c60608601614a44565b6000806040838503121561514b57600080fd5b61515483614a44565b9150614aa160208401614bd1565b6000806000806080858703121561517857600080fd5b61518185614a44565b935061518f60208601614a44565b92506040850135915060608501356001600160401b038111156151b157600080fd5b8501601f810187136151c257600080fd5b6151d187823560208401614da3565b91505092959194509250565b600080604083850312156151f057600080fd5b6151f983614a44565b9150614aa160208401614a44565b60008060006060848603121561521c57600080fd5b83359250614b9e60208501614a60565b600181811c9082168061524057607f821691505b60208210810361526057634e487b7160e01b600052602260045260246000fd5b50919050565b6020808252602e908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526d1c881b9bdc88185c1c1c9bdd995960921b606082015260800190565b6020808252600b908201526a2737ba10309037bbb732b960a91b604082015260600190565b602080825260139082015272151bdad95b881b9bdd081858dd1a5d985d1959606a1b604082015260600190565b634e487b7160e01b600052601160045260246000fd5b600081600019048311821515161561533657615336615306565b500290565b634e487b7160e01b600052601260045260246000fd5b6000826153605761536061533b565b500490565b6020808252600f908201526e53616c65206e6f742061637469766560881b604082015260600190565b6020808252600d908201526c05175616e74697479206973203609c1b604082015260600190565b6020808252601390820152724578636565646564206d617820737570706c7960681b604082015260600190565b602080825260159082015274115e18d959591959081b585e081c195c881b5a5b9d605a1b604082015260600190565b60208082526017908201527f4578636565646564206d6178207065722077616c6c6574000000000000000000604082015260600190565b80820180821115610dab57610dab615306565b634e487b7160e01b600052603260045260246000fd5b601f821115610dc657600081815260208120601f850160051c810160208610156154985750805b601f850160051c820191505b8181101561343c578281556001016154a4565b81516001600160401b038111156154d0576154d0614d8d565b6154e4816154de845461522c565b84615471565b602080601f83116001811461551957600084156155015750858301515b600019600386901b1c1916600185901b17855561343c565b600085815260208120601f198616915b8281101561554857888601518255948401946001909101908401615529565b50858210156155665787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60208082526012908201527114185cdcc8191bd95cdb89dd08195e1a5cdd60721b604082015260600190565b600083516155b4818460208801614ac3565b8351908301906155c8818360208801614ac3565b01949350505050565b6020808252602a908201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646040820152692073616c65507269636560b01b606082015260800190565b81810381811115610dab57610dab615306565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6000600182016156dd576156dd615306565b5060010190565b6000826156f3576156f361533b565b500690565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351615730816017850160208801614ac3565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351615761816028840160208801614ac3565b01602801949350505050565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906157a090830184614ae7565b9695505050505050565b6000602082840312156157bc57600080fd5b815161194781614a11565b6000816157d6576157d6615306565b506000190190565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052603160045260246000fdfea2646970667358221220af48ac41d6f60ba7d358b2b499fd77f358943ab43fb191914c379d59cbe4cf8064736f6c63430008100033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 26 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.