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 | 20332317 | 92 days ago | IN | 0 ETH | 0.03980023 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
NFTSale
Compiler Version
v0.8.24+commit.e11b9ed9
Optimization Enabled:
Yes with 200 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.19; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/cryptography/EIP712Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/cryptography/ECDSAUpgradeable.sol"; import "erc721a-upgradeable/contracts/ERC721AUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC721/IERC721Upgradeable.sol"; import "./interfaces/IDelegateRegistry.sol"; import "./SupplyUpgradable.sol"; import "./UriManagerUpgradable.sol"; import "./AdminMintUpgradable.sol"; contract NFTSale is Initializable, OwnableUpgradeable, PausableUpgradeable, EIP712Upgradeable, ERC721AUpgradeable, SupplyUpgradable, UriManagerUpgradable, AdminMintUpgradable { // External contracts IERC721Upgradeable public constant CO_MUSEUM = IERC721Upgradeable(0xE166A1fC32647ba4eC271B753cC56B5F0870d232); IERC721Upgradeable public constant AZUKI = IERC721Upgradeable(0xED5AF388653567Af2F388E6224dC7C4b3241C544); IERC721Upgradeable public constant AZUKI_ELEMENTALS = IERC721Upgradeable(0xB6a37b5d14D502c3Ab0Ae6f3a0E058BC9517786e); IERC721Upgradeable public constant AZUKI_ELEMENTAL_BEANZ = IERC721Upgradeable(0x3Af2A97414d1101E2107a70E7F33955da1346305); IDelegateRegistry public constant DELEGATE_REGISTRY = IDelegateRegistry(0x00000000000000447e69651d841bD8D104Bed493); // General mint configurations address public signer; Phase public phase; mapping(Phase => uint256) public price; mapping(uint256 => TokenPhase) public tokenPhases; // Presale configurations uint256 public presaleCoMuseumLimit; mapping(uint256 => uint256) public presaleCoMuseumBalances; mapping(address => uint256) public presaleAccountBalances; // Sale one configurations uint256 public saleOneCoMuseumLimit; uint256 public saleOneAzukiLimit; uint256 public saleOneAzukiElementalsLimit; uint256 public saleOneAzukiElementalBeanzLimit; mapping(uint256 => uint256) public saleOneCoMuseumBalances; mapping(uint256 => uint256) public saleOneAzukiBalances; mapping(uint256 => uint256) public saleOneAzukiElementalsBalances; mapping(uint256 => uint256) public saleOneAzukiElementalBeanzBalances; // Sale two configurations uint256 public saleTwoAccountLimit; mapping(address => uint256) public saleTwoAccountBalances; enum TokenPhase { Minted, Claimed, Decoupled } enum Phase { Presale, SaleOne, SaleTwo } struct PresaleRequest { address account; uint256 limit; } struct SaleOneRequest { uint256[] coMuseumIds; uint256[] coMuseumAmounts; uint256[] azukiIds; uint256[] azukiAmounts; uint256[] azukiElementalsIds; uint256[] azukiElementalsAmounts; uint256[] azukiElementalBeanzIds; uint256[] azukiElementalBeanzAmounts; } struct SetTokenPhaseRequest { uint256 tokenId; TokenPhase phase; } event Presale(address indexed account, uint256 amount); event TokenPhaseChange(uint256 indexed tokenId, TokenPhase tokenPhase); bytes32 private constant PRESALE_REQUEST_TYPE_HASH = keccak256("PresaleRequest(address account,uint256 limit)"); bytes32 private constant SET_TOKEN_PHASE_REQUEST_TYPE_HASH = keccak256("SetTokenPhaseRequest(uint256 tokenId,uint8 phase)"); function initialize( string memory name_, string memory symbol_, uint256 maxSupply_, string memory prefix_, string memory suffix_, address signer_ ) public initializerERC721A initializer { __Ownable_init(); __Pausable_init(); __EIP712_init("", ""); __ERC721A_init(name_, symbol_); __AdminManager_init_unchained(); __Supply_init_unchained(maxSupply_); __UriManager_init_unchained(prefix_, suffix_); __AdminMint_init_unchained(); _pause(); signer = signer_; phase = Phase.Presale; price[Phase.Presale] = 0.089 ether; price[Phase.SaleOne] = 0.089 ether; price[Phase.SaleTwo] = 0.089 ether; presaleCoMuseumLimit = 2; saleOneCoMuseumLimit = 2; saleOneAzukiLimit = 2; saleOneAzukiElementalsLimit = 1; saleOneAzukiElementalBeanzLimit = 1; saleTwoAccountLimit = 5; } function presale( uint256[] calldata coMuseumIds_, uint256[] calldata coMuseumAmounts_, uint256 accountAmount_, PresaleRequest calldata request_, bytes calldata signature_ ) external payable whenPresaleAuthorized(accountAmount_, request_, signature_) whenPhaseIsActive(Phase.Presale) whenNotPaused { uint256 amount = 0; for (uint256 i = 0; i < coMuseumIds_.length; i++) { uint256 coMuseumId = coMuseumIds_[i]; uint256 coMuseumAmount = coMuseumAmounts_[i]; _validateCoMuseumOwnership(coMuseumId); require( presaleCoMuseumBalances[coMuseumId] + coMuseumAmount <= presaleCoMuseumLimit, "Co-Museum exceeds limit" ); presaleCoMuseumBalances[coMuseumId] += coMuseumAmount; amount += coMuseumAmount; } require( presaleAccountBalances[msg.sender] + accountAmount_ <= request_.limit, "Account exceeds limit" ); presaleAccountBalances[msg.sender] += accountAmount_; amount += accountAmount_; _handlePayment(amount, price[Phase.Presale]); emit Presale(request_.account, amount); } function saleOne( SaleOneRequest calldata request_ ) public payable whenPhaseIsActive(Phase.SaleOne) whenNotPaused { uint256[] memory coMuseumIds = request_.coMuseumIds; uint256[] memory coMuseumAmounts = request_.coMuseumAmounts; uint256[] memory azukiIds = request_.azukiIds; uint256[] memory azukiAmounts = request_.azukiAmounts; uint256[] memory azukiElementalsIds = request_.azukiElementalsIds; uint256[] memory azukiElementalsAmounts = request_ .azukiElementalsAmounts; uint256[] memory azukiElementalBeanzIds = request_ .azukiElementalBeanzIds; uint256[] memory azukiElementalBeanzAmounts = request_ .azukiElementalBeanzAmounts; uint256 amount = 0; for (uint256 i = 0; i < coMuseumIds.length; i++) { uint256 coMuseumId = coMuseumIds[i]; uint256 coMuseumAmount = coMuseumAmounts[i]; _validateCoMuseumOwnership(coMuseumId); require( saleOneCoMuseumBalances[coMuseumId] + coMuseumAmount <= saleOneCoMuseumLimit, "Co-Museum exceeds limit" ); saleOneCoMuseumBalances[coMuseumId] += coMuseumAmount; amount += coMuseumAmount; } for (uint256 i = 0; i < azukiIds.length; i++) { uint256 azukiId = azukiIds[i]; uint256 azukiAmount = azukiAmounts[i]; _validateAzukiOwnership(azukiId); require( saleOneAzukiBalances[azukiId] + azukiAmount <= saleOneAzukiLimit, "Azuki exceeds limit" ); saleOneAzukiBalances[azukiId] += azukiAmount; amount += azukiAmount; } for (uint256 i = 0; i < azukiElementalsIds.length; i++) { uint256 azukiElementalId = azukiElementalsIds[i]; uint256 azukiElementalAmount = azukiElementalsAmounts[i]; _validateAzukiElementalsOwnership(azukiElementalId); require( saleOneAzukiElementalsBalances[azukiElementalId] + azukiElementalAmount <= saleOneAzukiElementalsLimit, "Azuki elemental exceeds limit" ); saleOneAzukiElementalsBalances[ azukiElementalId ] += azukiElementalAmount; amount += azukiElementalAmount; } for (uint256 i = 0; i < azukiElementalBeanzIds.length; i++) { uint256 azukiElementalBeanzId = azukiElementalBeanzIds[i]; uint256 azukiElementalBeanzAmount = azukiElementalBeanzAmounts[i]; _validateAzukiElementalBeanzOwnership(azukiElementalBeanzId); require( saleOneAzukiElementalBeanzBalances[azukiElementalBeanzId] + azukiElementalBeanzAmount <= saleOneAzukiElementalBeanzLimit, "Azuki elemental exceeds limit" ); saleOneAzukiElementalBeanzBalances[ azukiElementalBeanzId ] += azukiElementalBeanzAmount; amount += azukiElementalBeanzAmount; } _handlePayment(amount, price[Phase.SaleOne]); _callMint(msg.sender, amount); } function saleTwo( uint256 amount_ ) public payable whenPhaseIsActive(Phase.SaleTwo) whenNotPaused { require( saleTwoAccountBalances[msg.sender] + amount_ <= saleTwoAccountLimit, "Exceeds limit" ); saleTwoAccountBalances[msg.sender] += amount_; _handlePayment(amount_, price[Phase.SaleTwo]); _callMint(msg.sender, amount_); } function setSigner(address signer_) external onlyOwner { signer = signer_; } function setPhase(Phase phase_) external onlyOwner { phase = phase_; } function setPrice(Phase phase_, uint256 price_) external onlyOwner { price[phase_] = price_; } function setTokenPhase( SetTokenPhaseRequest calldata request_, bytes calldata signature_ ) external whenSetTokenPhaseAuthorized(request_, signature_) { tokenPhases[request_.tokenId] = request_.phase; } function setPresaleCoMuseumLimit( uint256 presaleCoMuseumLimit_ ) external onlyOwner { presaleCoMuseumLimit = presaleCoMuseumLimit_; } function setSaleOneCoMuseumLimit( uint256 saleOneCoMuseumLimit_ ) external onlyOwner { saleOneCoMuseumLimit = saleOneCoMuseumLimit_; } function setSaleOneAzukiLimit( uint256 saleOneAzukiLimit_ ) external onlyOwner { saleOneAzukiLimit = saleOneAzukiLimit_; } function setSaleOneAzukiElementalsLimit( uint256 saleOneAzukiElementalsLimit_ ) external onlyOwner { saleOneAzukiElementalsLimit = saleOneAzukiElementalsLimit_; } function setSaleOneAzukiElementalBeanzLimit( uint256 saleOneAzukiElementalBeanzLimit_ ) external onlyOwner { saleOneAzukiElementalBeanzLimit = saleOneAzukiElementalBeanzLimit_; } function setSaleTwoAccountLimit( uint256 saleTwoAccountLimit_ ) external onlyOwner { saleTwoAccountLimit = saleTwoAccountLimit_; } function pause() external onlyOwner { _pause(); } function unpause() external onlyOwner { _unpause(); } function withdraw(address recipient_) external onlyOwner { (bool success, ) = recipient_.call{value: address(this).balance}(""); require(success, "Withdraw failed"); } function tokenURI( uint256 tokenId ) public view override returns (string memory) { if (!_exists(tokenId)) { revert URIQueryForNonexistentToken(); } return _buildUri(tokenId); } function _adminMint(address account_, uint256 amount_) internal override { _callMint(account_, amount_); } function _validateCoMuseumOwnership(uint256 id_) private view { address owner = CO_MUSEUM.ownerOf(id_); require( msg.sender == owner || DELEGATE_REGISTRY.checkDelegateForERC721( msg.sender, owner, address(CO_MUSEUM), id_, "" ), "Invalid Co-Museum owner" ); } function _validateAzukiOwnership(uint256 id_) private view { address owner = AZUKI.ownerOf(id_); require( msg.sender == owner || DELEGATE_REGISTRY.checkDelegateForERC721( msg.sender, owner, address(AZUKI), id_, "" ), "Invalid Azuki owner" ); } function _validateAzukiElementalsOwnership(uint256 id_) private view { address owner = AZUKI_ELEMENTALS.ownerOf(id_); require( msg.sender == owner || DELEGATE_REGISTRY.checkDelegateForERC721( msg.sender, owner, address(AZUKI_ELEMENTALS), id_, "" ), "Invalid Azuki elementals owner" ); } function _validateAzukiElementalBeanzOwnership(uint256 id_) private view { address owner = AZUKI_ELEMENTAL_BEANZ.ownerOf(id_); require( msg.sender == owner || DELEGATE_REGISTRY.checkDelegateForERC721( msg.sender, owner, address(AZUKI_ELEMENTAL_BEANZ), id_, "" ), "Invalid Azuki elemental beanz owner" ); } function _handlePayment(uint256 amount_, uint256 price_) internal { uint256 total = amount_ * price_; require(msg.value >= total, "Not enough ETH"); if (msg.value > total) { payable(msg.sender).transfer(msg.value - total); } } function _callMint( address account_, uint256 amount_ ) internal onlyInSupply(amount_) { require(tx.origin == msg.sender, "No bots"); _safeMint(account_, amount_); } function _currentSupply() internal view override returns (uint256) { return totalSupply(); } function _hashPresaleTypedData( PresaleRequest calldata request_ ) internal pure returns (bytes32) { return keccak256( abi.encode( PRESALE_REQUEST_TYPE_HASH, request_.account, request_.limit ) ); } function _hashSetTokenPhaseTypedData( SetTokenPhaseRequest calldata request_ ) internal pure returns (bytes32) { return keccak256( abi.encode( SET_TOKEN_PHASE_REQUEST_TYPE_HASH, request_.tokenId, uint8(request_.phase) ) ); } function _beforeTokenTransfers( address from_, address to_, uint256 tokenId_, uint256 quantity_ ) internal override { require( from_ == address(0) || tokenPhases[tokenId_] != TokenPhase.Claimed, "Token not transferable" ); super._beforeTokenTransfers(from_, to_, tokenId_, quantity_); } function _startTokenId() internal pure override returns (uint256) { return 1; } function _EIP712Name() internal pure override returns (string memory) { return "AZUKI_X_CO_MUSEUM"; } function _EIP712Version() internal pure override returns (string memory) { return "0.1.0"; } modifier whenPresaleAuthorized( uint256 amount_, PresaleRequest calldata request_, bytes calldata signature_ ) { if (amount_ > 0) { bytes32 structHash = _hashPresaleTypedData(request_); bytes32 digest = _hashTypedDataV4(structHash); address recoveredSigner = ECDSAUpgradeable.recover( digest, signature_ ); require(recoveredSigner == signer, "Unauthorized request"); require(request_.account == msg.sender, "Invalid account"); } _; } modifier whenSetTokenPhaseAuthorized( SetTokenPhaseRequest calldata request_, bytes calldata signature_ ) { bytes32 structHash = _hashSetTokenPhaseTypedData(request_); bytes32 digest = _hashTypedDataV4(structHash); address recoveredSigner = ECDSAUpgradeable.recover(digest, signature_); require(recoveredSigner == signer, "Unauthorized request"); _; } modifier whenPhaseIsActive(Phase phase_) { require(phase == phase_, "Phase not enabled"); _; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/ContextUpgradeable.sol"; import {Initializable} from "../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. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby disabling 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.9.0) (interfaces/IERC5267.sol) pragma solidity ^0.8.0; interface IERC5267Upgradeable { /** * @dev MAY be emitted to signal that the domain could have changed. */ event EIP712DomainChanged(); /** * @dev returns the fields and values that describe the domain separator used by this contract for EIP-712 * signature. */ function eip712Domain() external view returns ( bytes1 fields, string memory name, string memory version, uint256 chainId, address verifyingContract, bytes32 salt, uint256[] memory extensions ); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.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] * ```solidity * 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. * * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a * constructor. * * Emits an {Initialized} event. */ 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. * * 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. * * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer` * cannot be nested. If one is invoked in the context of another, execution will revert. * * 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. * * WARNING: setting the version to 255 will prevent any future reinitialization. * * Emits an {Initialized} event. */ 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. * * Emits an {Initialized} event the first time it is successfully executed. */ function _disableInitializers() internal virtual { require(!_initializing, "Initializable: contract is initializing"); if (_initialized != type(uint8).max) { _initialized = type(uint8).max; emit Initialized(type(uint8).max); } } /** * @dev Returns the highest version that has been initialized. See {reinitializer}. */ function _getInitializedVersion() internal view returns (uint8) { return _initialized; } /** * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}. */ function _isInitializing() internal view returns (bool) { return _initializing; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol) pragma solidity ^0.8.0; import "../utils/ContextUpgradeable.sol"; import {Initializable} from "../proxy/utils/Initializable.sol"; /** * @dev Contract module which allows children to implement an emergency stop * mechanism that can be triggered by an authorized account. * * This module is used through inheritance. It will make available the * modifiers `whenNotPaused` and `whenPaused`, which can be applied to * the functions of your contract. Note that they will not be pausable by * simply including this module, only once the modifiers are put in place. */ abstract contract PausableUpgradeable is Initializable, ContextUpgradeable { /** * @dev Emitted when the pause is triggered by `account`. */ event Paused(address account); /** * @dev Emitted when the pause is lifted by `account`. */ event Unpaused(address account); bool private _paused; /** * @dev Initializes the contract in unpaused state. */ function __Pausable_init() internal onlyInitializing { __Pausable_init_unchained(); } function __Pausable_init_unchained() internal onlyInitializing { _paused = false; } /** * @dev Modifier to make a function callable only when the contract is not paused. * * Requirements: * * - The contract must not be paused. */ modifier whenNotPaused() { _requireNotPaused(); _; } /** * @dev Modifier to make a function callable only when the contract is paused. * * Requirements: * * - The contract must be paused. */ modifier whenPaused() { _requirePaused(); _; } /** * @dev Returns true if the contract is paused, and false otherwise. */ function paused() public view virtual returns (bool) { return _paused; } /** * @dev Throws if the contract is paused. */ function _requireNotPaused() internal view virtual { require(!paused(), "Pausable: paused"); } /** * @dev Throws if the contract is not paused. */ function _requirePaused() internal view virtual { require(paused(), "Pausable: not paused"); } /** * @dev Triggers stopped state. * * Requirements: * * - The contract must not be paused. */ function _pause() internal virtual whenNotPaused { _paused = true; emit Paused(_msgSender()); } /** * @dev Returns to normal state. * * Requirements: * * - The contract must be paused. */ function _unpause() internal virtual whenPaused { _paused = false; emit Unpaused(_msgSender()); } /** * @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.9.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: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721 * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must * understand this adds an external call which potentially creates a reentrancy vulnerability. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom(address from, address to, uint256 tokenId) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool approved) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.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 * * Furthermore, `isContract` will also return true if the target contract within * the same transaction is already scheduled for destruction by `SELFDESTRUCT`, * which only has an effect at the end of a transaction. * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract. * * _Available since v4.8._ */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata, string memory errorMessage ) internal view returns (bytes memory) { if (success) { if (returndata.length == 0) { // only check isContract if the call was successful and the return data is empty // otherwise we already know that it was a contract require(isContract(target), "Address: call to non-contract"); } return returndata; } else { _revert(returndata, errorMessage); } } /** * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason or using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { _revert(returndata, errorMessage); } } function _revert(bytes memory returndata, string memory errorMessage) private pure { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.4) (utils/Context.sol) pragma solidity ^0.8.0; import {Initializable} from "../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; } function _contextSuffixLength() internal view virtual returns (uint256) { return 0; } /** * @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.9.0) (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 // Deprecated in v4.8 } function _throwError(RecoverError error) private pure { if (error == RecoverError.NoError) { return; // no error: do nothing } else if (error == RecoverError.InvalidSignature) { revert("ECDSA: invalid signature"); } else if (error == RecoverError.InvalidSignatureLength) { revert("ECDSA: invalid signature length"); } else if (error == RecoverError.InvalidSignatureS) { revert("ECDSA: invalid signature 's' value"); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature` or error string. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. * * Documentation for signature generation: * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js] * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers] * * _Available since v4.3._ */ function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) { if (signature.length == 65) { bytes32 r; bytes32 s; uint8 v; // ecrecover takes the signature parameters, and the only way to get them // currently is to use assembly. /// @solidity memory-safe-assembly assembly { r := mload(add(signature, 0x20)) s := mload(add(signature, 0x40)) v := byte(0, mload(add(signature, 0x60))) } return tryRecover(hash, v, r, s); } else { return (address(0), RecoverError.InvalidSignatureLength); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature`. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. */ function recover(bytes32 hash, bytes memory signature) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, signature); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately. * * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures] * * _Available since v4.3._ */ function tryRecover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address, RecoverError) { bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff); uint8 v = uint8((uint256(vs) >> 255) + 27); return tryRecover(hash, v, r, s); } /** * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately. * * _Available since v4.2._ */ function recover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, r, vs); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `v`, * `r` and `s` signature fields separately. * * _Available since v4.3._ */ function tryRecover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address, RecoverError) { // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most // signatures from current libraries generate a unique signature with an s-value in the lower half order. // // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept // these malleable signatures as well. if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) { return (address(0), RecoverError.InvalidSignatureS); } // If the signature is valid (and not malleable), return the signer address address signer = ecrecover(hash, v, r, s); if (signer == address(0)) { return (address(0), RecoverError.InvalidSignature); } return (signer, RecoverError.NoError); } /** * @dev Overload of {ECDSA-recover} that receives the `v`, * `r` and `s` signature fields separately. */ function recover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, v, r, s); _throwError(error); return recovered; } /** * @dev Returns an Ethereum Signed Message, created from a `hash`. This * produces hash corresponding to the one signed with the * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] * JSON-RPC method as part of EIP-191. * * See {recover}. */ function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32 message) { // 32 is the length in bytes of hash, // enforced by the type signature above /// @solidity memory-safe-assembly assembly { mstore(0x00, "\x19Ethereum Signed Message:\n32") mstore(0x1c, hash) message := keccak256(0x00, 0x3c) } } /** * @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 data) { /// @solidity memory-safe-assembly assembly { let ptr := mload(0x40) mstore(ptr, "\x19\x01") mstore(add(ptr, 0x02), domainSeparator) mstore(add(ptr, 0x22), structHash) data := keccak256(ptr, 0x42) } } /** * @dev Returns an Ethereum Signed Data with intended validator, created from a * `validator` and `data` according to the version 0 of EIP-191. * * See {recover}. */ function toDataWithIntendedValidatorHash(address validator, bytes memory data) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19\x00", validator, data)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/cryptography/EIP712.sol) pragma solidity ^0.8.8; import "./ECDSAUpgradeable.sol"; import "../../interfaces/IERC5267Upgradeable.sol"; import {Initializable} from "../../proxy/utils/Initializable.sol"; /** * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data. * * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible, * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding * they need in their contracts using a combination of `abi.encode` and `keccak256`. * * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA * ({_hashTypedDataV4}). * * The implementation of the domain separator was designed to be as efficient as possible while still properly updating * the chain id to protect against replay attacks on an eventual fork of the chain. * * NOTE: This contract implements the version of the encoding known as "v4", as implemented by the JSON RPC method * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask]. * * NOTE: In the upgradeable version of this contract, the cached values will correspond to the address, and the domain * separator of the implementation contract. This will cause the `_domainSeparatorV4` function to always rebuild the * separator from the immutable values, which is cheaper than accessing a cached version in cold storage. * * _Available since v3.4._ * * @custom:storage-size 52 */ abstract contract EIP712Upgradeable is Initializable, IERC5267Upgradeable { bytes32 private constant _TYPE_HASH = keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"); /// @custom:oz-renamed-from _HASHED_NAME bytes32 private _hashedName; /// @custom:oz-renamed-from _HASHED_VERSION bytes32 private _hashedVersion; string private _name; string private _version; /** * @dev Initializes the domain separator and parameter caches. * * The meaning of `name` and `version` is specified in * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]: * * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol. * - `version`: the current major version of the signing domain. * * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart * contract upgrade]. */ function __EIP712_init(string memory name, string memory version) internal onlyInitializing { __EIP712_init_unchained(name, version); } function __EIP712_init_unchained(string memory name, string memory version) internal onlyInitializing { _name = name; _version = version; // Reset prior values in storage if upgrading _hashedName = 0; _hashedVersion = 0; } /** * @dev Returns the domain separator for the current chain. */ function _domainSeparatorV4() internal view returns (bytes32) { return _buildDomainSeparator(); } function _buildDomainSeparator() private view returns (bytes32) { return keccak256(abi.encode(_TYPE_HASH, _EIP712NameHash(), _EIP712VersionHash(), block.chainid, address(this))); } /** * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this * function returns the hash of the fully encoded EIP712 message for this domain. * * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example: * * ```solidity * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode( * keccak256("Mail(address to,string contents)"), * mailTo, * keccak256(bytes(mailContents)) * ))); * address signer = ECDSA.recover(digest, signature); * ``` */ function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) { return ECDSAUpgradeable.toTypedDataHash(_domainSeparatorV4(), structHash); } /** * @dev See {EIP-5267}. * * _Available since v4.9._ */ function eip712Domain() public view virtual override returns ( bytes1 fields, string memory name, string memory version, uint256 chainId, address verifyingContract, bytes32 salt, uint256[] memory extensions ) { // If the hashed name and version in storage are non-zero, the contract hasn't been properly initialized // and the EIP712 domain is not reliable, as it will be missing name and version. require(_hashedName == 0 && _hashedVersion == 0, "EIP712: Uninitialized"); return ( hex"0f", // 01111 _EIP712Name(), _EIP712Version(), block.chainid, address(this), bytes32(0), new uint256[](0) ); } /** * @dev The name parameter for the EIP712 domain. * * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs * are a concern. */ function _EIP712Name() internal virtual view returns (string memory) { return _name; } /** * @dev The version parameter for the EIP712 domain. * * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs * are a concern. */ function _EIP712Version() internal virtual view returns (string memory) { return _version; } /** * @dev The hash of the name parameter for the EIP712 domain. * * NOTE: In previous versions this function was virtual. In this version you should override `_EIP712Name` instead. */ function _EIP712NameHash() internal view returns (bytes32) { string memory name = _EIP712Name(); if (bytes(name).length > 0) { return keccak256(bytes(name)); } else { // If the name is empty, the contract may have been upgraded without initializing the new storage. // We return the name hash in storage if non-zero, otherwise we assume the name is empty by design. bytes32 hashedName = _hashedName; if (hashedName != 0) { return hashedName; } else { return keccak256(""); } } } /** * @dev The hash of the version parameter for the EIP712 domain. * * NOTE: In previous versions this function was virtual. In this version you should override `_EIP712Version` instead. */ function _EIP712VersionHash() internal view returns (bytes32) { string memory version = _EIP712Version(); if (bytes(version).length > 0) { return keccak256(bytes(version)); } else { // If the version is empty, the contract may have been upgraded without initializing the new storage. // We return the version hash in storage if non-zero, otherwise we assume the version is empty by design. bytes32 hashedVersion = _hashedVersion; if (hashedVersion != 0) { return hashedVersion; } else { return keccak256(""); } } } /** * @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 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.9.0) (utils/math/Math.sol) pragma solidity ^0.8.0; /** * @dev Standard math utilities missing in the Solidity language. */ library MathUpgradeable { enum Rounding { Down, // Toward negative infinity Up, // Toward infinity Zero // Toward zero } /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a > b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds up instead * of rounding down. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b - 1) / b can overflow on addition, so we distribute. return a == 0 ? 0 : (a - 1) / b + 1; } /** * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0 * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) * with further edits by Uniswap Labs also under MIT license. */ function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) { unchecked { // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256 // variables such that product = prod1 * 2^256 + prod0. uint256 prod0; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod0 := mul(x, y) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division. if (prod1 == 0) { // Solidity will revert if denominator == 0, unlike the div opcode on its own. // The surrounding unchecked block does not change this fact. // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic. return prod0 / denominator; } // Make sure the result is less than 2^256. Also prevents denominator == 0. require(denominator > prod1, "Math: mulDiv overflow"); /////////////////////////////////////////////// // 512 by 256 division. /////////////////////////////////////////////// // Make division exact by subtracting the remainder from [prod1 prod0]. uint256 remainder; assembly { // Compute remainder using mulmod. remainder := mulmod(x, y, denominator) // Subtract 256 bit number from 512 bit number. prod1 := sub(prod1, gt(remainder, prod0)) prod0 := sub(prod0, remainder) } // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1. // See https://cs.stackexchange.com/q/138556/92363. // Does not overflow because the denominator cannot be zero at this stage in the function. uint256 twos = denominator & (~denominator + 1); assembly { // Divide denominator by twos. denominator := div(denominator, twos) // Divide [prod1 prod0] by twos. prod0 := div(prod0, twos) // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one. twos := add(div(sub(0, twos), twos), 1) } // Shift in bits from prod1 into prod0. prod0 |= prod1 * twos; // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for // four bits. That is, denominator * inv = 1 mod 2^4. uint256 inverse = (3 * denominator) ^ 2; // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works // in modular arithmetic, doubling the correct bits in each step. inverse *= 2 - denominator * inverse; // inverse mod 2^8 inverse *= 2 - denominator * inverse; // inverse mod 2^16 inverse *= 2 - denominator * inverse; // inverse mod 2^32 inverse *= 2 - denominator * inverse; // inverse mod 2^64 inverse *= 2 - denominator * inverse; // inverse mod 2^128 inverse *= 2 - denominator * inverse; // inverse mod 2^256 // Because the division is now exact we can divide by multiplying with the modular inverse of denominator. // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1 // is no longer required. result = prod0 * inverse; return result; } } /** * @notice Calculates x * y / denominator with full precision, following the selected rounding direction. */ function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) { uint256 result = mulDiv(x, y, denominator); if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) { result += 1; } return result; } /** * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down. * * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11). */ function sqrt(uint256 a) internal pure returns (uint256) { if (a == 0) { return 0; } // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target. // // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`. // // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)` // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))` // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)` // // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit. uint256 result = 1 << (log2(a) >> 1); // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128, // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision // into the expected uint128 result. unchecked { result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; return min(result, a / result); } } /** * @notice Calculates sqrt(a), following the selected rounding direction. */ function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = sqrt(a); return result + (rounding == Rounding.Up && result * result < a ? 1 : 0); } } /** * @dev Return the log in base 2, rounded down, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 128; } if (value >> 64 > 0) { value >>= 64; result += 64; } if (value >> 32 > 0) { value >>= 32; result += 32; } if (value >> 16 > 0) { value >>= 16; result += 16; } if (value >> 8 > 0) { value >>= 8; result += 8; } if (value >> 4 > 0) { value >>= 4; result += 4; } if (value >> 2 > 0) { value >>= 2; result += 2; } if (value >> 1 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 2, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log2(value); return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0); } } /** * @dev Return the log in base 10, rounded down, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >= 10 ** 64) { value /= 10 ** 64; result += 64; } if (value >= 10 ** 32) { value /= 10 ** 32; result += 32; } if (value >= 10 ** 16) { value /= 10 ** 16; result += 16; } if (value >= 10 ** 8) { value /= 10 ** 8; result += 8; } if (value >= 10 ** 4) { value /= 10 ** 4; result += 4; } if (value >= 10 ** 2) { value /= 10 ** 2; result += 2; } if (value >= 10 ** 1) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log10(value); return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0); } } /** * @dev Return the log in base 256, rounded down, of a positive value. * Returns 0 if given 0. * * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string. */ function log256(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 16; } if (value >> 64 > 0) { value >>= 64; result += 8; } if (value >> 32 > 0) { value >>= 32; result += 4; } if (value >> 16 > 0) { value >>= 16; result += 2; } if (value >> 8 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 256, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log256(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log256(value); return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol) pragma solidity ^0.8.0; /** * @dev Standard signed math utilities missing in the Solidity language. */ library SignedMathUpgradeable { /** * @dev Returns the largest of two signed numbers. */ function max(int256 a, int256 b) internal pure returns (int256) { return a > b ? a : b; } /** * @dev Returns the smallest of two signed numbers. */ function min(int256 a, int256 b) internal pure returns (int256) { return a < b ? a : b; } /** * @dev Returns the average of two signed numbers without overflow. * The result is rounded towards zero. */ function average(int256 a, int256 b) internal pure returns (int256) { // Formula from the book "Hacker's Delight" int256 x = (a & b) + ((a ^ b) >> 1); return x + (int256(uint256(x) >> 255) & (a ^ b)); } /** * @dev Returns the absolute unsigned value of a signed value. */ function abs(int256 n) internal pure returns (uint256) { unchecked { // must be unchecked in order to support `n = type(int256).min` return uint256(n >= 0 ? n : -n); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/Strings.sol) pragma solidity ^0.8.0; import "./math/MathUpgradeable.sol"; import "./math/SignedMathUpgradeable.sol"; /** * @dev String operations. */ library StringsUpgradeable { bytes16 private constant _SYMBOLS = "0123456789abcdef"; uint8 private constant _ADDRESS_LENGTH = 20; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { unchecked { uint256 length = MathUpgradeable.log10(value) + 1; string memory buffer = new string(length); uint256 ptr; /// @solidity memory-safe-assembly assembly { ptr := add(buffer, add(32, length)) } while (true) { ptr--; /// @solidity memory-safe-assembly assembly { mstore8(ptr, byte(mod(value, 10), _SYMBOLS)) } value /= 10; if (value == 0) break; } return buffer; } } /** * @dev Converts a `int256` to its ASCII `string` decimal representation. */ function toString(int256 value) internal pure returns (string memory) { return string(abi.encodePacked(value < 0 ? "-" : "", toString(SignedMathUpgradeable.abs(value)))); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { unchecked { return toHexString(value, MathUpgradeable.log256(value) + 1); } } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH); } /** * @dev Returns true if the two strings are equal. */ function equal(string memory a, string memory b) internal pure returns (bool) { return keccak256(bytes(a)) == keccak256(bytes(b)); } }
//SPDX-License-Identifier: MIT pragma solidity ^0.8.19; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; contract AdminManagerUpgradable is Initializable { mapping(address => bool) private _admins; function __AdminManager_init() internal onlyInitializing { __AdminManager_init_unchained(); } function __AdminManager_init_unchained() internal onlyInitializing { _admins[msg.sender] = true; } function setAdminPermissions( address account_, bool enable_ ) external onlyAdmin { _admins[account_] = enable_; } function isAdmin(address account_) public view returns (bool) { return _admins[account_]; } modifier onlyAdmin() { require(isAdmin(msg.sender), "Not an admin"); _; } uint256[49] private __gap; }
//SPDX-License-Identifier: MIT pragma solidity ^0.8.19; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import "./AdminManagerUpgradable.sol"; abstract contract AdminMintUpgradable is Initializable, AdminManagerUpgradable { function __AdminMint_init() internal onlyInitializing { __AdminManager_init_unchained(); __AdminMint_init_unchained(); } function __AdminMint_init_unchained() internal onlyInitializing {} function adminMint( address[] calldata accounts_, uint256[] calldata amounts_ ) external onlyAdmin { uint256 accountsLength = accounts_.length; require(accountsLength == amounts_.length, "Admin mint: bad request"); for (uint256 i; i < accountsLength; i++) { _adminMint(accounts_[i], amounts_[i]); } } function _adminMint(address account_, uint256 amount_) internal virtual; uint256[50] private __gap; }
// SPDX-License-Identifier: CC0-1.0 pragma solidity >=0.8.13; /** * @title IDelegateRegistry * @custom:version 2.0 * @custom:author foobar (0xfoobar) * @notice A standalone immutable registry storing delegated permissions from one address to another */ interface IDelegateRegistry { /// @notice Delegation type, NONE is used when a delegation does not exist or is revoked enum DelegationType { NONE, ALL, CONTRACT, ERC721, ERC20, ERC1155 } /// @notice Struct for returning delegations struct Delegation { DelegationType type_; address to; address from; bytes32 rights; address contract_; uint256 tokenId; uint256 amount; } /// @notice Emitted when an address delegates or revokes rights for their entire wallet event DelegateAll( address indexed from, address indexed to, bytes32 rights, bool enable ); /// @notice Emitted when an address delegates or revokes rights for a contract address event DelegateContract( address indexed from, address indexed to, address indexed contract_, bytes32 rights, bool enable ); /// @notice Emitted when an address delegates or revokes rights for an ERC721 tokenId event DelegateERC721( address indexed from, address indexed to, address indexed contract_, uint256 tokenId, bytes32 rights, bool enable ); /// @notice Emitted when an address delegates or revokes rights for an amount of ERC20 tokens event DelegateERC20( address indexed from, address indexed to, address indexed contract_, bytes32 rights, uint256 amount ); /// @notice Emitted when an address delegates or revokes rights for an amount of an ERC1155 tokenId event DelegateERC1155( address indexed from, address indexed to, address indexed contract_, uint256 tokenId, bytes32 rights, uint256 amount ); /// @notice Thrown if multicall calldata is malformed error MulticallFailed(); /** * ----------- WRITE ----------- */ /** * @notice Call multiple functions in the current contract and return the data from all of them if they all succeed * @param data The encoded function data for each of the calls to make to this contract * @return results The results from each of the calls passed in via data */ function multicall( bytes[] calldata data ) external payable returns (bytes[] memory results); /** * @notice Allow the delegate to act on behalf of `msg.sender` for all contracts * @param to The address to act as delegate * @param rights Specific subdelegation rights granted to the delegate, pass an empty bytestring to encompass all rights * @param enable Whether to enable or disable this delegation, true delegates and false revokes * @return delegationHash The unique identifier of the delegation */ function delegateAll( address to, bytes32 rights, bool enable ) external payable returns (bytes32 delegationHash); /** * @notice Allow the delegate to act on behalf of `msg.sender` for a specific contract * @param to The address to act as delegate * @param contract_ The contract whose rights are being delegated * @param rights Specific subdelegation rights granted to the delegate, pass an empty bytestring to encompass all rights * @param enable Whether to enable or disable this delegation, true delegates and false revokes * @return delegationHash The unique identifier of the delegation */ function delegateContract( address to, address contract_, bytes32 rights, bool enable ) external payable returns (bytes32 delegationHash); /** * @notice Allow the delegate to act on behalf of `msg.sender` for a specific ERC721 token * @param to The address to act as delegate * @param contract_ The contract whose rights are being delegated * @param tokenId The token id to delegate * @param rights Specific subdelegation rights granted to the delegate, pass an empty bytestring to encompass all rights * @param enable Whether to enable or disable this delegation, true delegates and false revokes * @return delegationHash The unique identifier of the delegation */ function delegateERC721( address to, address contract_, uint256 tokenId, bytes32 rights, bool enable ) external payable returns (bytes32 delegationHash); /** * @notice Allow the delegate to act on behalf of `msg.sender` for a specific amount of ERC20 tokens * @dev The actual amount is not encoded in the hash, just the existence of a amount (since it is an upper bound) * @param to The address to act as delegate * @param contract_ The address for the fungible token contract * @param rights Specific subdelegation rights granted to the delegate, pass an empty bytestring to encompass all rights * @param amount The amount to delegate, > 0 delegates and 0 revokes * @return delegationHash The unique identifier of the delegation */ function delegateERC20( address to, address contract_, bytes32 rights, uint256 amount ) external payable returns (bytes32 delegationHash); /** * @notice Allow the delegate to act on behalf of `msg.sender` for a specific amount of ERC1155 tokens * @dev The actual amount is not encoded in the hash, just the existence of a amount (since it is an upper bound) * @param to The address to act as delegate * @param contract_ The address of the contract that holds the token * @param tokenId The token id to delegate * @param rights Specific subdelegation rights granted to the delegate, pass an empty bytestring to encompass all rights * @param amount The amount of that token id to delegate, > 0 delegates and 0 revokes * @return delegationHash The unique identifier of the delegation */ function delegateERC1155( address to, address contract_, uint256 tokenId, bytes32 rights, uint256 amount ) external payable returns (bytes32 delegationHash); /** * ----------- CHECKS ----------- */ /** * @notice Check if `to` is a delegate of `from` for the entire wallet * @param to The potential delegate address * @param from The potential address who delegated rights * @param rights Specific rights to check for, pass the zero value to ignore subdelegations and check full delegations only * @return valid Whether delegate is granted to act on the from's behalf */ function checkDelegateForAll( address to, address from, bytes32 rights ) external view returns (bool); /** * @notice Check if `to` is a delegate of `from` for the specified `contract_` or the entire wallet * @param to The delegated address to check * @param contract_ The specific contract address being checked * @param from The cold wallet who issued the delegation * @param rights Specific rights to check for, pass the zero value to ignore subdelegations and check full delegations only * @return valid Whether delegate is granted to act on from's behalf for entire wallet or that specific contract */ function checkDelegateForContract( address to, address from, address contract_, bytes32 rights ) external view returns (bool); /** * @notice Check if `to` is a delegate of `from` for the specific `contract` and `tokenId`, the entire `contract_`, or the entire wallet * @param to The delegated address to check * @param contract_ The specific contract address being checked * @param tokenId The token id for the token to delegating * @param from The wallet that issued the delegation * @param rights Specific rights to check for, pass the zero value to ignore subdelegations and check full delegations only * @return valid Whether delegate is granted to act on from's behalf for entire wallet, that contract, or that specific tokenId */ function checkDelegateForERC721( address to, address from, address contract_, uint256 tokenId, bytes32 rights ) external view returns (bool); /** * @notice Returns the amount of ERC20 tokens the delegate is granted rights to act on the behalf of * @param to The delegated address to check * @param contract_ The address of the token contract * @param from The cold wallet who issued the delegation * @param rights Specific rights to check for, pass the zero value to ignore subdelegations and check full delegations only * @return balance The delegated balance, which will be 0 if the delegation does not exist */ function checkDelegateForERC20( address to, address from, address contract_, bytes32 rights ) external view returns (uint256); /** * @notice Returns the amount of a ERC1155 tokens the delegate is granted rights to act on the behalf of * @param to The delegated address to check * @param contract_ The address of the token contract * @param tokenId The token id to check the delegated amount of * @param from The cold wallet who issued the delegation * @param rights Specific rights to check for, pass the zero value to ignore subdelegations and check full delegations only * @return balance The delegated balance, which will be 0 if the delegation does not exist */ function checkDelegateForERC1155( address to, address from, address contract_, uint256 tokenId, bytes32 rights ) external view returns (uint256); /** * ----------- ENUMERATIONS ----------- */ /** * @notice Returns all enabled delegations a given delegate has received * @param to The address to retrieve delegations for * @return delegations Array of Delegation structs */ function getIncomingDelegations( address to ) external view returns (Delegation[] memory delegations); /** * @notice Returns all enabled delegations an address has given out * @param from The address to retrieve delegations for * @return delegations Array of Delegation structs */ function getOutgoingDelegations( address from ) external view returns (Delegation[] memory delegations); /** * @notice Returns all hashes associated with enabled delegations an address has received * @param to The address to retrieve incoming delegation hashes for * @return delegationHashes Array of delegation hashes */ function getIncomingDelegationHashes( address to ) external view returns (bytes32[] memory delegationHashes); /** * @notice Returns all hashes associated with enabled delegations an address has given out * @param from The address to retrieve outgoing delegation hashes for * @return delegationHashes Array of delegation hashes */ function getOutgoingDelegationHashes( address from ) external view returns (bytes32[] memory delegationHashes); /** * @notice Returns the delegations for a given array of delegation hashes * @param delegationHashes is an array of hashes that correspond to delegations * @return delegations Array of Delegation structs, return empty structs for nonexistent or revoked delegations */ function getDelegationsFromHashes( bytes32[] calldata delegationHashes ) external view returns (Delegation[] memory delegations); /** * ----------- STORAGE ACCESS ----------- */ /** * @notice Allows external contracts to read arbitrary storage slots */ function readSlot(bytes32 location) external view returns (bytes32); /** * @notice Allows external contracts to read an arbitrary array of storage slots */ function readSlots( bytes32[] calldata locations ) external view returns (bytes32[] memory); }
//SPDX-License-Identifier: MIT pragma solidity ^0.8.19; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import "./AdminManagerUpgradable.sol"; abstract contract SupplyUpgradable is Initializable, AdminManagerUpgradable { uint256 internal _maxSupply; function __Supply_init(uint256 maxSupply_) internal onlyInitializing { __AdminManager_init_unchained(); __Supply_init_unchained(maxSupply_); } function __Supply_init_unchained( uint256 maxSupply_ ) internal onlyInitializing { _maxSupply = maxSupply_; } function setMaxSupply(uint256 maxSupply_) external onlyAdmin { _maxSupply = maxSupply_; } function maxSupply() external view returns (uint256) { return _maxSupply; } function _currentSupply() internal view virtual returns (uint256); modifier onlyInSupply(uint256 amount_) { require(_currentSupply() + amount_ <= _maxSupply, "Exceeds supply"); _; } uint256[49] private __gap; }
//SPDX-License-Identifier: MIT pragma solidity ^0.8.19; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import "@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol"; import "./AdminManagerUpgradable.sol"; contract UriManagerUpgradable is Initializable, AdminManagerUpgradable { using StringsUpgradeable for uint256; string internal _prefix; string internal _suffix; function prefix() public view returns (string memory) { return _prefix; } function suffix() public view returns (string memory) { return _suffix; } function __UriManager_init( string memory prefix_, string memory suffix_ ) internal onlyInitializing { __AdminManager_init_unchained(); __UriManager_init_unchained(prefix_, suffix_); } function __UriManager_init_unchained( string memory prefix_, string memory suffix_ ) internal onlyInitializing { _prefix = prefix_; _suffix = suffix_; } function _buildUri(uint256 tokenId) internal view returns (string memory) { return string(abi.encodePacked(_prefix, tokenId.toString(), _suffix)); } function setPrefix(string calldata prefix_) external onlyAdmin { _prefix = prefix_; } function setSuffix(string calldata suffix_) external onlyAdmin { _suffix = suffix_; } uint256[48] private __gap; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev This is a base contract to aid in writing upgradeable diamond facet 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. * * 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. */ import {ERC721A__InitializableStorage} from './ERC721A__InitializableStorage.sol'; abstract contract ERC721A__Initializable { using ERC721A__InitializableStorage for ERC721A__InitializableStorage.Layout; /** * @dev Modifier to protect an initializer function from being invoked twice. */ modifier initializerERC721A() { // If the contract is initializing we ignore whether _initialized is set in order to support multiple // inheritance patterns, but we only do this in the context of a constructor, because in other contexts the // contract may have been reentered. require( ERC721A__InitializableStorage.layout()._initializing ? _isConstructor() : !ERC721A__InitializableStorage.layout()._initialized, 'ERC721A__Initializable: contract is already initialized' ); bool isTopLevelCall = !ERC721A__InitializableStorage.layout()._initializing; if (isTopLevelCall) { ERC721A__InitializableStorage.layout()._initializing = true; ERC721A__InitializableStorage.layout()._initialized = true; } _; if (isTopLevelCall) { ERC721A__InitializableStorage.layout()._initializing = false; } } /** * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the * {initializer} modifier, directly or indirectly. */ modifier onlyInitializingERC721A() { require( ERC721A__InitializableStorage.layout()._initializing, 'ERC721A__Initializable: contract is not initializing' ); _; } /// @dev Returns true if and only if the function is running in the constructor function _isConstructor() private view returns (bool) { // extcodesize checks the size of the code stored in an address, and // address returns the current address. Since the code is still not // deployed when running a constructor, any checks on its code size will // yield zero, making it an effective way to detect if a contract is // under construction or not. address self = address(this); uint256 cs; assembly { cs := extcodesize(self) } return cs == 0; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev This is a base storage for the initialization function for upgradeable diamond facet contracts **/ library ERC721A__InitializableStorage { struct Layout { /* * Indicates that the contract has been initialized. */ bool _initialized; /* * Indicates that the contract is in the process of being initialized. */ bool _initializing; } bytes32 internal constant STORAGE_SLOT = keccak256('ERC721A.contracts.storage.initializable.facet'); function layout() internal pure returns (Layout storage l) { bytes32 slot = STORAGE_SLOT; assembly { l.slot := slot } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; library ERC721AStorage { // Bypass for a `--via-ir` bug (https://github.com/chiru-labs/ERC721A/pull/364). struct TokenApprovalRef { address value; } struct Layout { // ============================================================= // STORAGE // ============================================================= // The next token ID to be minted. uint256 _currentIndex; // The number of tokens burned. uint256 _burnCounter; // Token name string _name; // Token symbol string _symbol; // Mapping from token ID to ownership details // An empty struct value does not necessarily mean the token is unowned. // See {_packedOwnershipOf} implementation for details. // // Bits Layout: // - [0..159] `addr` // - [160..223] `startTimestamp` // - [224] `burned` // - [225] `nextInitialized` // - [232..255] `extraData` mapping(uint256 => uint256) _packedOwnerships; // Mapping owner address to address data. // // Bits Layout: // - [0..63] `balance` // - [64..127] `numberMinted` // - [128..191] `numberBurned` // - [192..255] `aux` mapping(address => uint256) _packedAddressData; // Mapping from token ID to approved address. mapping(uint256 => ERC721AStorage.TokenApprovalRef) _tokenApprovals; // Mapping from owner to operator approvals mapping(address => mapping(address => bool)) _operatorApprovals; // The amount of tokens minted above `_sequentialUpTo()`. // We call these spot mints (i.e. non-sequential mints). uint256 _spotMinted; } bytes32 internal constant STORAGE_SLOT = keccak256('ERC721A.contracts.storage.ERC721A'); function layout() internal pure returns (Layout storage l) { bytes32 slot = STORAGE_SLOT; assembly { l.slot := slot } } }
// SPDX-License-Identifier: MIT // ERC721A Contracts v4.3.0 // Creator: Chiru Labs pragma solidity ^0.8.4; import './IERC721AUpgradeable.sol'; import {ERC721AStorage} from './ERC721AStorage.sol'; import './ERC721A__Initializable.sol'; /** * @dev Interface of ERC721 token receiver. */ interface ERC721A__IERC721ReceiverUpgradeable { function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); } /** * @title ERC721A * * @dev Implementation of the [ERC721](https://eips.ethereum.org/EIPS/eip-721) * Non-Fungible Token Standard, including the Metadata extension. * Optimized for lower gas during batch mints. * * Token IDs are minted in sequential order (e.g. 0, 1, 2, 3, ...) * starting from `_startTokenId()`. * * The `_sequentialUpTo()` function can be overriden to enable spot mints * (i.e. non-consecutive mints) for `tokenId`s greater than `_sequentialUpTo()`. * * Assumptions: * * - An owner cannot have more than 2**64 - 1 (max value of uint64) of supply. * - The maximum token ID cannot exceed 2**256 - 1 (max value of uint256). */ contract ERC721AUpgradeable is ERC721A__Initializable, IERC721AUpgradeable { using ERC721AStorage for ERC721AStorage.Layout; // ============================================================= // CONSTANTS // ============================================================= // Mask of an entry in packed address data. uint256 private constant _BITMASK_ADDRESS_DATA_ENTRY = (1 << 64) - 1; // The bit position of `numberMinted` in packed address data. uint256 private constant _BITPOS_NUMBER_MINTED = 64; // The bit position of `numberBurned` in packed address data. uint256 private constant _BITPOS_NUMBER_BURNED = 128; // The bit position of `aux` in packed address data. uint256 private constant _BITPOS_AUX = 192; // Mask of all 256 bits in packed address data except the 64 bits for `aux`. uint256 private constant _BITMASK_AUX_COMPLEMENT = (1 << 192) - 1; // The bit position of `startTimestamp` in packed ownership. uint256 private constant _BITPOS_START_TIMESTAMP = 160; // The bit mask of the `burned` bit in packed ownership. uint256 private constant _BITMASK_BURNED = 1 << 224; // The bit position of the `nextInitialized` bit in packed ownership. uint256 private constant _BITPOS_NEXT_INITIALIZED = 225; // The bit mask of the `nextInitialized` bit in packed ownership. uint256 private constant _BITMASK_NEXT_INITIALIZED = 1 << 225; // The bit position of `extraData` in packed ownership. uint256 private constant _BITPOS_EXTRA_DATA = 232; // Mask of all 256 bits in a packed ownership except the 24 bits for `extraData`. uint256 private constant _BITMASK_EXTRA_DATA_COMPLEMENT = (1 << 232) - 1; // The mask of the lower 160 bits for addresses. uint256 private constant _BITMASK_ADDRESS = (1 << 160) - 1; // The maximum `quantity` that can be minted with {_mintERC2309}. // This limit is to prevent overflows on the address data entries. // For a limit of 5000, a total of 3.689e15 calls to {_mintERC2309} // is required to cause an overflow, which is unrealistic. uint256 private constant _MAX_MINT_ERC2309_QUANTITY_LIMIT = 5000; // The `Transfer` event signature is given by: // `keccak256(bytes("Transfer(address,address,uint256)"))`. bytes32 private constant _TRANSFER_EVENT_SIGNATURE = 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef; // ============================================================= // CONSTRUCTOR // ============================================================= function __ERC721A_init(string memory name_, string memory symbol_) internal onlyInitializingERC721A { __ERC721A_init_unchained(name_, symbol_); } function __ERC721A_init_unchained(string memory name_, string memory symbol_) internal onlyInitializingERC721A { ERC721AStorage.layout()._name = name_; ERC721AStorage.layout()._symbol = symbol_; ERC721AStorage.layout()._currentIndex = _startTokenId(); if (_sequentialUpTo() < _startTokenId()) _revert(SequentialUpToTooSmall.selector); } // ============================================================= // TOKEN COUNTING OPERATIONS // ============================================================= /** * @dev Returns the starting token ID for sequential mints. * * Override this function to change the starting token ID for sequential mints. * * Note: The value returned must never change after any tokens have been minted. */ function _startTokenId() internal view virtual returns (uint256) { return 0; } /** * @dev Returns the maximum token ID (inclusive) for sequential mints. * * Override this function to return a value less than 2**256 - 1, * but greater than `_startTokenId()`, to enable spot (non-sequential) mints. * * Note: The value returned must never change after any tokens have been minted. */ function _sequentialUpTo() internal view virtual returns (uint256) { return type(uint256).max; } /** * @dev Returns the next token ID to be minted. */ function _nextTokenId() internal view virtual returns (uint256) { return ERC721AStorage.layout()._currentIndex; } /** * @dev Returns the total number of tokens in existence. * Burned tokens will reduce the count. * To get the total number of tokens minted, please see {_totalMinted}. */ function totalSupply() public view virtual override returns (uint256 result) { // Counter underflow is impossible as `_burnCounter` cannot be incremented // more than `_currentIndex + _spotMinted - _startTokenId()` times. unchecked { // With spot minting, the intermediate `result` can be temporarily negative, // and the computation must be unchecked. result = ERC721AStorage.layout()._currentIndex - ERC721AStorage.layout()._burnCounter - _startTokenId(); if (_sequentialUpTo() != type(uint256).max) result += ERC721AStorage.layout()._spotMinted; } } /** * @dev Returns the total amount of tokens minted in the contract. */ function _totalMinted() internal view virtual returns (uint256 result) { // Counter underflow is impossible as `_currentIndex` does not decrement, // and it is initialized to `_startTokenId()`. unchecked { result = ERC721AStorage.layout()._currentIndex - _startTokenId(); if (_sequentialUpTo() != type(uint256).max) result += ERC721AStorage.layout()._spotMinted; } } /** * @dev Returns the total number of tokens burned. */ function _totalBurned() internal view virtual returns (uint256) { return ERC721AStorage.layout()._burnCounter; } /** * @dev Returns the total number of tokens that are spot-minted. */ function _totalSpotMinted() internal view virtual returns (uint256) { return ERC721AStorage.layout()._spotMinted; } // ============================================================= // ADDRESS DATA OPERATIONS // ============================================================= /** * @dev Returns the number of tokens in `owner`'s account. */ function balanceOf(address owner) public view virtual override returns (uint256) { if (owner == address(0)) _revert(BalanceQueryForZeroAddress.selector); return ERC721AStorage.layout()._packedAddressData[owner] & _BITMASK_ADDRESS_DATA_ENTRY; } /** * Returns the number of tokens minted by `owner`. */ function _numberMinted(address owner) internal view returns (uint256) { return (ERC721AStorage.layout()._packedAddressData[owner] >> _BITPOS_NUMBER_MINTED) & _BITMASK_ADDRESS_DATA_ENTRY; } /** * Returns the number of tokens burned by or on behalf of `owner`. */ function _numberBurned(address owner) internal view returns (uint256) { return (ERC721AStorage.layout()._packedAddressData[owner] >> _BITPOS_NUMBER_BURNED) & _BITMASK_ADDRESS_DATA_ENTRY; } /** * Returns the auxiliary data for `owner`. (e.g. number of whitelist mint slots used). */ function _getAux(address owner) internal view returns (uint64) { return uint64(ERC721AStorage.layout()._packedAddressData[owner] >> _BITPOS_AUX); } /** * Sets the auxiliary data for `owner`. (e.g. number of whitelist mint slots used). * If there are multiple variables, please pack them into a uint64. */ function _setAux(address owner, uint64 aux) internal virtual { uint256 packed = ERC721AStorage.layout()._packedAddressData[owner]; uint256 auxCasted; // Cast `aux` with assembly to avoid redundant masking. assembly { auxCasted := aux } packed = (packed & _BITMASK_AUX_COMPLEMENT) | (auxCasted << _BITPOS_AUX); ERC721AStorage.layout()._packedAddressData[owner] = packed; } // ============================================================= // IERC165 // ============================================================= /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * [EIP section](https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified) * to learn more about how these ids are created. * * This function call must use less than 30000 gas. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { // The interface IDs are constants representing the first 4 bytes // of the XOR of all function selectors in the interface. // See: [ERC165](https://eips.ethereum.org/EIPS/eip-165) // (e.g. `bytes4(i.functionA.selector ^ i.functionB.selector ^ ...)`) return interfaceId == 0x01ffc9a7 || // ERC165 interface ID for ERC165. interfaceId == 0x80ac58cd || // ERC165 interface ID for ERC721. interfaceId == 0x5b5e139f; // ERC165 interface ID for ERC721Metadata. } // ============================================================= // IERC721Metadata // ============================================================= /** * @dev Returns the token collection name. */ function name() public view virtual override returns (string memory) { return ERC721AStorage.layout()._name; } /** * @dev Returns the token collection symbol. */ function symbol() public view virtual override returns (string memory) { return ERC721AStorage.layout()._symbol; } /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { if (!_exists(tokenId)) _revert(URIQueryForNonexistentToken.selector); string memory baseURI = _baseURI(); return bytes(baseURI).length != 0 ? string(abi.encodePacked(baseURI, _toString(tokenId))) : ''; } /** * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each * token will be the concatenation of the `baseURI` and the `tokenId`. Empty * by default, it can be overridden in child contracts. */ function _baseURI() internal view virtual returns (string memory) { return ''; } // ============================================================= // OWNERSHIPS OPERATIONS // ============================================================= /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) public view virtual override returns (address) { return address(uint160(_packedOwnershipOf(tokenId))); } /** * @dev Gas spent here starts off proportional to the maximum mint batch size. * It gradually moves to O(1) as tokens get transferred around over time. */ function _ownershipOf(uint256 tokenId) internal view virtual returns (TokenOwnership memory) { return _unpackedOwnership(_packedOwnershipOf(tokenId)); } /** * @dev Returns the unpacked `TokenOwnership` struct at `index`. */ function _ownershipAt(uint256 index) internal view virtual returns (TokenOwnership memory) { return _unpackedOwnership(ERC721AStorage.layout()._packedOwnerships[index]); } /** * @dev Returns whether the ownership slot at `index` is initialized. * An uninitialized slot does not necessarily mean that the slot has no owner. */ function _ownershipIsInitialized(uint256 index) internal view virtual returns (bool) { return ERC721AStorage.layout()._packedOwnerships[index] != 0; } /** * @dev Initializes the ownership slot minted at `index` for efficiency purposes. */ function _initializeOwnershipAt(uint256 index) internal virtual { if (ERC721AStorage.layout()._packedOwnerships[index] == 0) { ERC721AStorage.layout()._packedOwnerships[index] = _packedOwnershipOf(index); } } /** * @dev Returns the packed ownership data of `tokenId`. */ function _packedOwnershipOf(uint256 tokenId) private view returns (uint256 packed) { if (_startTokenId() <= tokenId) { packed = ERC721AStorage.layout()._packedOwnerships[tokenId]; if (tokenId > _sequentialUpTo()) { if (_packedOwnershipExists(packed)) return packed; _revert(OwnerQueryForNonexistentToken.selector); } // If the data at the starting slot does not exist, start the scan. if (packed == 0) { if (tokenId >= ERC721AStorage.layout()._currentIndex) _revert(OwnerQueryForNonexistentToken.selector); // Invariant: // There will always be an initialized ownership slot // (i.e. `ownership.addr != address(0) && ownership.burned == false`) // before an unintialized ownership slot // (i.e. `ownership.addr == address(0) && ownership.burned == false`) // Hence, `tokenId` will not underflow. // // We can directly compare the packed value. // If the address is zero, packed will be zero. for (;;) { unchecked { packed = ERC721AStorage.layout()._packedOwnerships[--tokenId]; } if (packed == 0) continue; if (packed & _BITMASK_BURNED == 0) return packed; // Otherwise, the token is burned, and we must revert. // This handles the case of batch burned tokens, where only the burned bit // of the starting slot is set, and remaining slots are left uninitialized. _revert(OwnerQueryForNonexistentToken.selector); } } // Otherwise, the data exists and we can skip the scan. // This is possible because we have already achieved the target condition. // This saves 2143 gas on transfers of initialized tokens. // If the token is not burned, return `packed`. Otherwise, revert. if (packed & _BITMASK_BURNED == 0) return packed; } _revert(OwnerQueryForNonexistentToken.selector); } /** * @dev Returns the unpacked `TokenOwnership` struct from `packed`. */ function _unpackedOwnership(uint256 packed) private pure returns (TokenOwnership memory ownership) { ownership.addr = address(uint160(packed)); ownership.startTimestamp = uint64(packed >> _BITPOS_START_TIMESTAMP); ownership.burned = packed & _BITMASK_BURNED != 0; ownership.extraData = uint24(packed >> _BITPOS_EXTRA_DATA); } /** * @dev Packs ownership data into a single uint256. */ function _packOwnershipData(address owner, uint256 flags) private view returns (uint256 result) { assembly { // Mask `owner` to the lower 160 bits, in case the upper bits somehow aren't clean. owner := and(owner, _BITMASK_ADDRESS) // `owner | (block.timestamp << _BITPOS_START_TIMESTAMP) | flags`. result := or(owner, or(shl(_BITPOS_START_TIMESTAMP, timestamp()), flags)) } } /** * @dev Returns the `nextInitialized` flag set if `quantity` equals 1. */ function _nextInitializedFlag(uint256 quantity) private pure returns (uint256 result) { // For branchless setting of the `nextInitialized` flag. assembly { // `(quantity == 1) << _BITPOS_NEXT_INITIALIZED`. result := shl(_BITPOS_NEXT_INITIALIZED, eq(quantity, 1)) } } // ============================================================= // APPROVAL OPERATIONS // ============================================================= /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. See {ERC721A-_approve}. * * Requirements: * * - The caller must own the token or be an approved operator. */ function approve(address to, uint256 tokenId) public payable virtual override { _approve(to, tokenId, true); } /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) public view virtual override returns (address) { if (!_exists(tokenId)) _revert(ApprovalQueryForNonexistentToken.selector); return ERC721AStorage.layout()._tokenApprovals[tokenId].value; } /** * @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) public virtual override { ERC721AStorage.layout()._operatorApprovals[_msgSenderERC721A()][operator] = approved; emit ApprovalForAll(_msgSenderERC721A(), operator, approved); } /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll}. */ function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { return ERC721AStorage.layout()._operatorApprovals[owner][operator]; } /** * @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. See {_mint}. */ function _exists(uint256 tokenId) internal view virtual returns (bool result) { if (_startTokenId() <= tokenId) { if (tokenId > _sequentialUpTo()) return _packedOwnershipExists(ERC721AStorage.layout()._packedOwnerships[tokenId]); if (tokenId < ERC721AStorage.layout()._currentIndex) { uint256 packed; while ((packed = ERC721AStorage.layout()._packedOwnerships[tokenId]) == 0) --tokenId; result = packed & _BITMASK_BURNED == 0; } } } /** * @dev Returns whether `packed` represents a token that exists. */ function _packedOwnershipExists(uint256 packed) private pure returns (bool result) { assembly { // The following is equivalent to `owner != address(0) && burned == false`. // Symbolically tested. result := gt(and(packed, _BITMASK_ADDRESS), and(packed, _BITMASK_BURNED)) } } /** * @dev Returns whether `msgSender` is equal to `approvedAddress` or `owner`. */ function _isSenderApprovedOrOwner( address approvedAddress, address owner, address msgSender ) private pure returns (bool result) { assembly { // Mask `owner` to the lower 160 bits, in case the upper bits somehow aren't clean. owner := and(owner, _BITMASK_ADDRESS) // Mask `msgSender` to the lower 160 bits, in case the upper bits somehow aren't clean. msgSender := and(msgSender, _BITMASK_ADDRESS) // `msgSender == owner || msgSender == approvedAddress`. result := or(eq(msgSender, owner), eq(msgSender, approvedAddress)) } } /** * @dev Returns the storage slot and value for the approved address of `tokenId`. */ function _getApprovedSlotAndAddress(uint256 tokenId) private view returns (uint256 approvedAddressSlot, address approvedAddress) { ERC721AStorage.TokenApprovalRef storage tokenApproval = ERC721AStorage.layout()._tokenApprovals[tokenId]; // The following is equivalent to `approvedAddress = _tokenApprovals[tokenId].value`. assembly { approvedAddressSlot := tokenApproval.slot approvedAddress := sload(approvedAddressSlot) } } // ============================================================= // TRANSFER OPERATIONS // ============================================================= /** * @dev Transfers `tokenId` from `from` to `to`. * * 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 ) public payable virtual override { uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId); // Mask `from` to the lower 160 bits, in case the upper bits somehow aren't clean. from = address(uint160(uint256(uint160(from)) & _BITMASK_ADDRESS)); if (address(uint160(prevOwnershipPacked)) != from) _revert(TransferFromIncorrectOwner.selector); (uint256 approvedAddressSlot, address approvedAddress) = _getApprovedSlotAndAddress(tokenId); // The nested ifs save around 20+ gas over a compound boolean condition. if (!_isSenderApprovedOrOwner(approvedAddress, from, _msgSenderERC721A())) if (!isApprovedForAll(from, _msgSenderERC721A())) _revert(TransferCallerNotOwnerNorApproved.selector); _beforeTokenTransfers(from, to, tokenId, 1); // Clear approvals from the previous owner. assembly { if approvedAddress { // This is equivalent to `delete _tokenApprovals[tokenId]`. sstore(approvedAddressSlot, 0) } } // Underflow of the sender's balance is impossible because we check for // ownership above and the recipient's balance can't realistically overflow. // Counter overflow is incredibly unrealistic as `tokenId` would have to be 2**256. unchecked { // We can directly increment and decrement the balances. --ERC721AStorage.layout()._packedAddressData[from]; // Updates: `balance -= 1`. ++ERC721AStorage.layout()._packedAddressData[to]; // Updates: `balance += 1`. // Updates: // - `address` to the next owner. // - `startTimestamp` to the timestamp of transfering. // - `burned` to `false`. // - `nextInitialized` to `true`. ERC721AStorage.layout()._packedOwnerships[tokenId] = _packOwnershipData( to, _BITMASK_NEXT_INITIALIZED | _nextExtraData(from, to, prevOwnershipPacked) ); // If the next slot may not have been initialized (i.e. `nextInitialized == false`) . if (prevOwnershipPacked & _BITMASK_NEXT_INITIALIZED == 0) { uint256 nextTokenId = tokenId + 1; // If the next slot's address is zero and not burned (i.e. packed value is zero). if (ERC721AStorage.layout()._packedOwnerships[nextTokenId] == 0) { // If the next slot is within bounds. if (nextTokenId != ERC721AStorage.layout()._currentIndex) { // Initialize the next slot to maintain correctness for `ownerOf(tokenId + 1)`. ERC721AStorage.layout()._packedOwnerships[nextTokenId] = prevOwnershipPacked; } } } } // Mask `to` to the lower 160 bits, in case the upper bits somehow aren't clean. uint256 toMasked = uint256(uint160(to)) & _BITMASK_ADDRESS; assembly { // Emit the `Transfer` event. log4( 0, // Start of data (0, since no data). 0, // End of data (0, since no data). _TRANSFER_EVENT_SIGNATURE, // Signature. from, // `from`. toMasked, // `to`. tokenId // `tokenId`. ) } if (toMasked == 0) _revert(TransferToZeroAddress.selector); _afterTokenTransfers(from, to, tokenId, 1); } /** * @dev Equivalent to `safeTransferFrom(from, to, tokenId, '')`. */ function safeTransferFrom( address from, address to, uint256 tokenId ) public payable virtual override { safeTransferFrom(from, to, tokenId, ''); } /** * @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 memory _data ) public payable virtual override { transferFrom(from, to, tokenId); if (to.code.length != 0) if (!_checkContractOnERC721Received(from, to, tokenId, _data)) { _revert(TransferToNonERC721ReceiverImplementer.selector); } } /** * @dev Hook that is called before a set of serially-ordered token IDs * are about to be transferred. This includes minting. * And also called before burning one token. * * `startTokenId` - the first token ID to be transferred. * `quantity` - the amount to be transferred. * * Calling conditions: * * - When `from` and `to` are both non-zero, `from`'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, `tokenId` will be burned by `from`. * - `from` and `to` are never both zero. */ function _beforeTokenTransfers( address from, address to, uint256 startTokenId, uint256 quantity ) internal virtual {} /** * @dev Hook that is called after a set of serially-ordered token IDs * have been transferred. This includes minting. * And also called after one token has been burned. * * `startTokenId` - the first token ID to be transferred. * `quantity` - the amount to be transferred. * * Calling conditions: * * - When `from` and `to` are both non-zero, `from`'s `tokenId` has been * transferred to `to`. * - When `from` is zero, `tokenId` has been minted for `to`. * - When `to` is zero, `tokenId` has been burned by `from`. * - `from` and `to` are never both zero. */ function _afterTokenTransfers( address from, address to, uint256 startTokenId, uint256 quantity ) internal virtual {} /** * @dev Private function to invoke {IERC721Receiver-onERC721Received} on a target contract. * * `from` - Previous owner of the given token ID. * `to` - Target address that will receive the token. * `tokenId` - Token ID to be transferred. * `_data` - Optional data to send along with the call. * * Returns whether the call correctly returned the expected magic value. */ function _checkContractOnERC721Received( address from, address to, uint256 tokenId, bytes memory _data ) private returns (bool) { try ERC721A__IERC721ReceiverUpgradeable(to).onERC721Received(_msgSenderERC721A(), from, tokenId, _data) returns (bytes4 retval) { return retval == ERC721A__IERC721ReceiverUpgradeable(to).onERC721Received.selector; } catch (bytes memory reason) { if (reason.length == 0) { _revert(TransferToNonERC721ReceiverImplementer.selector); } assembly { revert(add(32, reason), mload(reason)) } } } // ============================================================= // MINT OPERATIONS // ============================================================= /** * @dev Mints `quantity` tokens and transfers them to `to`. * * Requirements: * * - `to` cannot be the zero address. * - `quantity` must be greater than 0. * * Emits a {Transfer} event for each mint. */ function _mint(address to, uint256 quantity) internal virtual { uint256 startTokenId = ERC721AStorage.layout()._currentIndex; if (quantity == 0) _revert(MintZeroQuantity.selector); _beforeTokenTransfers(address(0), to, startTokenId, quantity); // Overflows are incredibly unrealistic. // `balance` and `numberMinted` have a maximum limit of 2**64. // `tokenId` has a maximum limit of 2**256. unchecked { // Updates: // - `address` to the owner. // - `startTimestamp` to the timestamp of minting. // - `burned` to `false`. // - `nextInitialized` to `quantity == 1`. ERC721AStorage.layout()._packedOwnerships[startTokenId] = _packOwnershipData( to, _nextInitializedFlag(quantity) | _nextExtraData(address(0), to, 0) ); // Updates: // - `balance += quantity`. // - `numberMinted += quantity`. // // We can directly add to the `balance` and `numberMinted`. ERC721AStorage.layout()._packedAddressData[to] += quantity * ((1 << _BITPOS_NUMBER_MINTED) | 1); // Mask `to` to the lower 160 bits, in case the upper bits somehow aren't clean. uint256 toMasked = uint256(uint160(to)) & _BITMASK_ADDRESS; if (toMasked == 0) _revert(MintToZeroAddress.selector); uint256 end = startTokenId + quantity; uint256 tokenId = startTokenId; if (end - 1 > _sequentialUpTo()) _revert(SequentialMintExceedsLimit.selector); do { assembly { // Emit the `Transfer` event. log4( 0, // Start of data (0, since no data). 0, // End of data (0, since no data). _TRANSFER_EVENT_SIGNATURE, // Signature. 0, // `address(0)`. toMasked, // `to`. tokenId // `tokenId`. ) } // The `!=` check ensures that large values of `quantity` // that overflows uint256 will make the loop run out of gas. } while (++tokenId != end); ERC721AStorage.layout()._currentIndex = end; } _afterTokenTransfers(address(0), to, startTokenId, quantity); } /** * @dev Mints `quantity` tokens and transfers them to `to`. * * This function is intended for efficient minting only during contract creation. * * It emits only one {ConsecutiveTransfer} as defined in * [ERC2309](https://eips.ethereum.org/EIPS/eip-2309), * instead of a sequence of {Transfer} event(s). * * Calling this function outside of contract creation WILL make your contract * non-compliant with the ERC721 standard. * For full ERC721 compliance, substituting ERC721 {Transfer} event(s) with the ERC2309 * {ConsecutiveTransfer} event is only permissible during contract creation. * * Requirements: * * - `to` cannot be the zero address. * - `quantity` must be greater than 0. * * Emits a {ConsecutiveTransfer} event. */ function _mintERC2309(address to, uint256 quantity) internal virtual { uint256 startTokenId = ERC721AStorage.layout()._currentIndex; if (to == address(0)) _revert(MintToZeroAddress.selector); if (quantity == 0) _revert(MintZeroQuantity.selector); if (quantity > _MAX_MINT_ERC2309_QUANTITY_LIMIT) _revert(MintERC2309QuantityExceedsLimit.selector); _beforeTokenTransfers(address(0), to, startTokenId, quantity); // Overflows are unrealistic due to the above check for `quantity` to be below the limit. unchecked { // Updates: // - `balance += quantity`. // - `numberMinted += quantity`. // // We can directly add to the `balance` and `numberMinted`. ERC721AStorage.layout()._packedAddressData[to] += quantity * ((1 << _BITPOS_NUMBER_MINTED) | 1); // Updates: // - `address` to the owner. // - `startTimestamp` to the timestamp of minting. // - `burned` to `false`. // - `nextInitialized` to `quantity == 1`. ERC721AStorage.layout()._packedOwnerships[startTokenId] = _packOwnershipData( to, _nextInitializedFlag(quantity) | _nextExtraData(address(0), to, 0) ); if (startTokenId + quantity - 1 > _sequentialUpTo()) _revert(SequentialMintExceedsLimit.selector); emit ConsecutiveTransfer(startTokenId, startTokenId + quantity - 1, address(0), to); ERC721AStorage.layout()._currentIndex = startTokenId + quantity; } _afterTokenTransfers(address(0), to, startTokenId, quantity); } /** * @dev Safely mints `quantity` tokens and transfers them to `to`. * * Requirements: * * - If `to` refers to a smart contract, it must implement * {IERC721Receiver-onERC721Received}, which is called for each safe transfer. * - `quantity` must be greater than 0. * * See {_mint}. * * Emits a {Transfer} event for each mint. */ function _safeMint( address to, uint256 quantity, bytes memory _data ) internal virtual { _mint(to, quantity); unchecked { if (to.code.length != 0) { uint256 end = ERC721AStorage.layout()._currentIndex; uint256 index = end - quantity; do { if (!_checkContractOnERC721Received(address(0), to, index++, _data)) { _revert(TransferToNonERC721ReceiverImplementer.selector); } } while (index < end); // This prevents reentrancy to `_safeMint`. // It does not prevent reentrancy to `_safeMintSpot`. if (ERC721AStorage.layout()._currentIndex != end) revert(); } } } /** * @dev Equivalent to `_safeMint(to, quantity, '')`. */ function _safeMint(address to, uint256 quantity) internal virtual { _safeMint(to, quantity, ''); } /** * @dev Mints a single token at `tokenId`. * * Note: A spot-minted `tokenId` that has been burned can be re-minted again. * * Requirements: * * - `to` cannot be the zero address. * - `tokenId` must be greater than `_sequentialUpTo()`. * - `tokenId` must not exist. * * Emits a {Transfer} event for each mint. */ function _mintSpot(address to, uint256 tokenId) internal virtual { if (tokenId <= _sequentialUpTo()) _revert(SpotMintTokenIdTooSmall.selector); uint256 prevOwnershipPacked = ERC721AStorage.layout()._packedOwnerships[tokenId]; if (_packedOwnershipExists(prevOwnershipPacked)) _revert(TokenAlreadyExists.selector); _beforeTokenTransfers(address(0), to, tokenId, 1); // Overflows are incredibly unrealistic. // The `numberMinted` for `to` is incremented by 1, and has a max limit of 2**64 - 1. // `_spotMinted` is incremented by 1, and has a max limit of 2**256 - 1. unchecked { // Updates: // - `address` to the owner. // - `startTimestamp` to the timestamp of minting. // - `burned` to `false`. // - `nextInitialized` to `true` (as `quantity == 1`). ERC721AStorage.layout()._packedOwnerships[tokenId] = _packOwnershipData( to, _nextInitializedFlag(1) | _nextExtraData(address(0), to, prevOwnershipPacked) ); // Updates: // - `balance += 1`. // - `numberMinted += 1`. // // We can directly add to the `balance` and `numberMinted`. ERC721AStorage.layout()._packedAddressData[to] += (1 << _BITPOS_NUMBER_MINTED) | 1; // Mask `to` to the lower 160 bits, in case the upper bits somehow aren't clean. uint256 toMasked = uint256(uint160(to)) & _BITMASK_ADDRESS; if (toMasked == 0) _revert(MintToZeroAddress.selector); assembly { // Emit the `Transfer` event. log4( 0, // Start of data (0, since no data). 0, // End of data (0, since no data). _TRANSFER_EVENT_SIGNATURE, // Signature. 0, // `address(0)`. toMasked, // `to`. tokenId // `tokenId`. ) } ++ERC721AStorage.layout()._spotMinted; } _afterTokenTransfers(address(0), to, tokenId, 1); } /** * @dev Safely mints a single token at `tokenId`. * * Note: A spot-minted `tokenId` that has been burned can be re-minted again. * * Requirements: * * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}. * - `tokenId` must be greater than `_sequentialUpTo()`. * - `tokenId` must not exist. * * See {_mintSpot}. * * Emits a {Transfer} event. */ function _safeMintSpot( address to, uint256 tokenId, bytes memory _data ) internal virtual { _mintSpot(to, tokenId); unchecked { if (to.code.length != 0) { uint256 currentSpotMinted = ERC721AStorage.layout()._spotMinted; if (!_checkContractOnERC721Received(address(0), to, tokenId, _data)) { _revert(TransferToNonERC721ReceiverImplementer.selector); } // This prevents reentrancy to `_safeMintSpot`. // It does not prevent reentrancy to `_safeMint`. if (ERC721AStorage.layout()._spotMinted != currentSpotMinted) revert(); } } } /** * @dev Equivalent to `_safeMintSpot(to, tokenId, '')`. */ function _safeMintSpot(address to, uint256 tokenId) internal virtual { _safeMintSpot(to, tokenId, ''); } // ============================================================= // APPROVAL OPERATIONS // ============================================================= /** * @dev Equivalent to `_approve(to, tokenId, false)`. */ function _approve(address to, uint256 tokenId) internal virtual { _approve(to, tokenId, false); } /** * @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: * * - `tokenId` must exist. * * Emits an {Approval} event. */ function _approve( address to, uint256 tokenId, bool approvalCheck ) internal virtual { address owner = ownerOf(tokenId); if (approvalCheck && _msgSenderERC721A() != owner) if (!isApprovedForAll(owner, _msgSenderERC721A())) { _revert(ApprovalCallerNotOwnerNorApproved.selector); } ERC721AStorage.layout()._tokenApprovals[tokenId].value = to; emit Approval(owner, to, tokenId); } // ============================================================= // BURN OPERATIONS // ============================================================= /** * @dev Equivalent to `_burn(tokenId, false)`. */ function _burn(uint256 tokenId) internal virtual { _burn(tokenId, false); } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId, bool approvalCheck) internal virtual { uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId); address from = address(uint160(prevOwnershipPacked)); (uint256 approvedAddressSlot, address approvedAddress) = _getApprovedSlotAndAddress(tokenId); if (approvalCheck) { // The nested ifs save around 20+ gas over a compound boolean condition. if (!_isSenderApprovedOrOwner(approvedAddress, from, _msgSenderERC721A())) if (!isApprovedForAll(from, _msgSenderERC721A())) _revert(TransferCallerNotOwnerNorApproved.selector); } _beforeTokenTransfers(from, address(0), tokenId, 1); // Clear approvals from the previous owner. assembly { if approvedAddress { // This is equivalent to `delete _tokenApprovals[tokenId]`. sstore(approvedAddressSlot, 0) } } // Underflow of the sender's balance is impossible because we check for // ownership above and the recipient's balance can't realistically overflow. // Counter overflow is incredibly unrealistic as `tokenId` would have to be 2**256. unchecked { // Updates: // - `balance -= 1`. // - `numberBurned += 1`. // // We can directly decrement the balance, and increment the number burned. // This is equivalent to `packed -= 1; packed += 1 << _BITPOS_NUMBER_BURNED;`. ERC721AStorage.layout()._packedAddressData[from] += (1 << _BITPOS_NUMBER_BURNED) - 1; // Updates: // - `address` to the last owner. // - `startTimestamp` to the timestamp of burning. // - `burned` to `true`. // - `nextInitialized` to `true`. ERC721AStorage.layout()._packedOwnerships[tokenId] = _packOwnershipData( from, (_BITMASK_BURNED | _BITMASK_NEXT_INITIALIZED) | _nextExtraData(from, address(0), prevOwnershipPacked) ); // If the next slot may not have been initialized (i.e. `nextInitialized == false`) . if (prevOwnershipPacked & _BITMASK_NEXT_INITIALIZED == 0) { uint256 nextTokenId = tokenId + 1; // If the next slot's address is zero and not burned (i.e. packed value is zero). if (ERC721AStorage.layout()._packedOwnerships[nextTokenId] == 0) { // If the next slot is within bounds. if (nextTokenId != ERC721AStorage.layout()._currentIndex) { // Initialize the next slot to maintain correctness for `ownerOf(tokenId + 1)`. ERC721AStorage.layout()._packedOwnerships[nextTokenId] = prevOwnershipPacked; } } } } emit Transfer(from, address(0), tokenId); _afterTokenTransfers(from, address(0), tokenId, 1); // Overflow not possible, as `_burnCounter` cannot be exceed `_currentIndex + _spotMinted` times. unchecked { ERC721AStorage.layout()._burnCounter++; } } // ============================================================= // EXTRA DATA OPERATIONS // ============================================================= /** * @dev Directly sets the extra data for the ownership data `index`. */ function _setExtraDataAt(uint256 index, uint24 extraData) internal virtual { uint256 packed = ERC721AStorage.layout()._packedOwnerships[index]; if (packed == 0) _revert(OwnershipNotInitializedForExtraData.selector); uint256 extraDataCasted; // Cast `extraData` with assembly to avoid redundant masking. assembly { extraDataCasted := extraData } packed = (packed & _BITMASK_EXTRA_DATA_COMPLEMENT) | (extraDataCasted << _BITPOS_EXTRA_DATA); ERC721AStorage.layout()._packedOwnerships[index] = packed; } /** * @dev Called during each token transfer to set the 24bit `extraData` field. * Intended to be overridden by the cosumer contract. * * `previousExtraData` - the value of `extraData` before transfer. * * Calling conditions: * * - When `from` and `to` are both non-zero, `from`'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, `tokenId` will be burned by `from`. * - `from` and `to` are never both zero. */ function _extraData( address from, address to, uint24 previousExtraData ) internal view virtual returns (uint24) {} /** * @dev Returns the next extra data for the packed ownership data. * The returned result is shifted into position. */ function _nextExtraData( address from, address to, uint256 prevOwnershipPacked ) private view returns (uint256) { uint24 extraData = uint24(prevOwnershipPacked >> _BITPOS_EXTRA_DATA); return uint256(_extraData(from, to, extraData)) << _BITPOS_EXTRA_DATA; } // ============================================================= // OTHER OPERATIONS // ============================================================= /** * @dev Returns the message sender (defaults to `msg.sender`). * * If you are writing GSN compatible contracts, you need to override this function. */ function _msgSenderERC721A() internal view virtual returns (address) { return msg.sender; } /** * @dev Converts a uint256 to its ASCII string decimal representation. */ function _toString(uint256 value) internal pure virtual returns (string memory str) { assembly { // The maximum value of a uint256 contains 78 digits (1 byte per digit), but // we allocate 0xa0 bytes to keep the free memory pointer 32-byte word aligned. // We will need 1 word for the trailing zeros padding, 1 word for the length, // and 3 words for a maximum of 78 digits. Total: 5 * 0x20 = 0xa0. let m := add(mload(0x40), 0xa0) // Update the free memory pointer to allocate. mstore(0x40, m) // Assign the `str` to the end. str := sub(m, 0x20) // Zeroize the slot after the string. mstore(str, 0) // Cache the end of the memory to calculate the length later. let end := str // We write the string from rightmost digit to leftmost digit. // The following is essentially a do-while loop that also handles the zero case. // prettier-ignore for { let temp := value } 1 {} { str := sub(str, 1) // Write the character to the pointer. // The ASCII index of the '0' character is 48. mstore8(str, add(48, mod(temp, 10))) // Keep dividing `temp` until zero. temp := div(temp, 10) // prettier-ignore if iszero(temp) { break } } let length := sub(end, str) // Move the pointer 32 bytes leftwards to make room for the length. str := sub(str, 0x20) // Store the length. mstore(str, length) } } /** * @dev For more efficient reverts. */ function _revert(bytes4 errorSelector) internal pure { assembly { mstore(0x00, errorSelector) revert(0x00, 0x04) } } }
// SPDX-License-Identifier: MIT // ERC721A Contracts v4.3.0 // Creator: Chiru Labs pragma solidity ^0.8.4; /** * @dev Interface of ERC721A. */ interface IERC721AUpgradeable { /** * The caller must own the token or be an approved operator. */ error ApprovalCallerNotOwnerNorApproved(); /** * The token does not exist. */ error ApprovalQueryForNonexistentToken(); /** * Cannot query the balance for the zero address. */ error BalanceQueryForZeroAddress(); /** * Cannot mint to the zero address. */ error MintToZeroAddress(); /** * The quantity of tokens minted must be more than zero. */ error MintZeroQuantity(); /** * The token does not exist. */ error OwnerQueryForNonexistentToken(); /** * The caller must own the token or be an approved operator. */ error TransferCallerNotOwnerNorApproved(); /** * The token must be owned by `from`. */ error TransferFromIncorrectOwner(); /** * Cannot safely transfer to a contract that does not implement the * ERC721Receiver interface. */ error TransferToNonERC721ReceiverImplementer(); /** * Cannot transfer to the zero address. */ error TransferToZeroAddress(); /** * The token does not exist. */ error URIQueryForNonexistentToken(); /** * The `quantity` minted with ERC2309 exceeds the safety limit. */ error MintERC2309QuantityExceedsLimit(); /** * The `extraData` cannot be set on an unintialized ownership slot. */ error OwnershipNotInitializedForExtraData(); /** * `_sequentialUpTo()` must be greater than `_startTokenId()`. */ error SequentialUpToTooSmall(); /** * The `tokenId` of a sequential mint exceeds `_sequentialUpTo()`. */ error SequentialMintExceedsLimit(); /** * Spot minting requires a `tokenId` greater than `_sequentialUpTo()`. */ error SpotMintTokenIdTooSmall(); /** * Cannot mint over a token that already exists. */ error TokenAlreadyExists(); /** * The feature is not compatible with spot mints. */ error NotCompatibleWithSpotMints(); // ============================================================= // STRUCTS // ============================================================= struct TokenOwnership { // The address of the owner. address addr; // Stores the start time of ownership with minimal overhead for tokenomics. uint64 startTimestamp; // Whether the token has been burned. bool burned; // Arbitrary data similar to `startTimestamp` that can be set via {_extraData}. uint24 extraData; } // ============================================================= // TOKEN COUNTERS // ============================================================= /** * @dev Returns the total number of tokens in existence. * Burned tokens will reduce the count. * To get the total number of tokens minted, please see {_totalMinted}. */ function totalSupply() external view returns (uint256); // ============================================================= // IERC165 // ============================================================= /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * [EIP section](https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified) * to learn more about how these ids are created. * * This function call must use less than 30000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); // ============================================================= // IERC721 // ============================================================= /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables * (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in `owner`'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`, * checking first that contract recipients are aware of the ERC721 protocol * to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be have been allowed to move * this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement * {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes calldata data ) external payable; /** * @dev Equivalent to `safeTransferFrom(from, to, tokenId, '')`. */ function safeTransferFrom( address from, address to, uint256 tokenId ) external payable; /** * @dev Transfers `tokenId` 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 payable; /** * @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 payable; /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} * for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool _approved) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll}. */ function isApprovedForAll(address owner, address operator) external view returns (bool); // ============================================================= // IERC721Metadata // ============================================================= /** * @dev Returns the token collection name. */ function name() external view returns (string memory); /** * @dev Returns the token collection symbol. */ function symbol() external view returns (string memory); /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ function tokenURI(uint256 tokenId) external view returns (string memory); // ============================================================= // IERC2309 // ============================================================= /** * @dev Emitted when tokens in `fromTokenId` to `toTokenId` * (inclusive) is transferred from `from` to `to`, as defined in the * [ERC2309](https://eips.ethereum.org/EIPS/eip-2309) standard. * * See {_mintERC2309} for more details. */ event ConsecutiveTransfer(uint256 indexed fromTokenId, uint256 toTokenId, address indexed from, address indexed to); }
{ "optimizer": { "enabled": true, "runs": 200 }, "evmVersion": "paris", "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[],"name":"ApprovalCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"ApprovalQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"BalanceQueryForZeroAddress","type":"error"},{"inputs":[],"name":"MintERC2309QuantityExceedsLimit","type":"error"},{"inputs":[],"name":"MintToZeroAddress","type":"error"},{"inputs":[],"name":"MintZeroQuantity","type":"error"},{"inputs":[],"name":"NotCompatibleWithSpotMints","type":"error"},{"inputs":[],"name":"OwnerQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"OwnershipNotInitializedForExtraData","type":"error"},{"inputs":[],"name":"SequentialMintExceedsLimit","type":"error"},{"inputs":[],"name":"SequentialUpToTooSmall","type":"error"},{"inputs":[],"name":"SpotMintTokenIdTooSmall","type":"error"},{"inputs":[],"name":"TokenAlreadyExists","type":"error"},{"inputs":[],"name":"TransferCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"TransferFromIncorrectOwner","type":"error"},{"inputs":[],"name":"TransferToNonERC721ReceiverImplementer","type":"error"},{"inputs":[],"name":"TransferToZeroAddress","type":"error"},{"inputs":[],"name":"URIQueryForNonexistentToken","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"fromTokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"toTokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"ConsecutiveTransfer","type":"event"},{"anonymous":false,"inputs":[],"name":"EIP712DomainChanged","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":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Presale","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"enum NFTSale.TokenPhase","name":"tokenPhase","type":"uint8"}],"name":"TokenPhaseChange","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"AZUKI","outputs":[{"internalType":"contract IERC721Upgradeable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"AZUKI_ELEMENTALS","outputs":[{"internalType":"contract IERC721Upgradeable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"AZUKI_ELEMENTAL_BEANZ","outputs":[{"internalType":"contract IERC721Upgradeable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"CO_MUSEUM","outputs":[{"internalType":"contract IERC721Upgradeable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DELEGATE_REGISTRY","outputs":[{"internalType":"contract IDelegateRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"accounts_","type":"address[]"},{"internalType":"uint256[]","name":"amounts_","type":"uint256[]"}],"name":"adminMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"eip712Domain","outputs":[{"internalType":"bytes1","name":"fields","type":"bytes1"},{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"version","type":"string"},{"internalType":"uint256","name":"chainId","type":"uint256"},{"internalType":"address","name":"verifyingContract","type":"address"},{"internalType":"bytes32","name":"salt","type":"bytes32"},{"internalType":"uint256[]","name":"extensions","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"name_","type":"string"},{"internalType":"string","name":"symbol_","type":"string"},{"internalType":"uint256","name":"maxSupply_","type":"uint256"},{"internalType":"string","name":"prefix_","type":"string"},{"internalType":"string","name":"suffix_","type":"string"},{"internalType":"address","name":"signer_","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account_","type":"address"}],"name":"isAdmin","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxSupply","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":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"phase","outputs":[{"internalType":"enum NFTSale.Phase","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"prefix","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"coMuseumIds_","type":"uint256[]"},{"internalType":"uint256[]","name":"coMuseumAmounts_","type":"uint256[]"},{"internalType":"uint256","name":"accountAmount_","type":"uint256"},{"components":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"limit","type":"uint256"}],"internalType":"struct NFTSale.PresaleRequest","name":"request_","type":"tuple"},{"internalType":"bytes","name":"signature_","type":"bytes"}],"name":"presale","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"presaleAccountBalances","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"presaleCoMuseumBalances","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"presaleCoMuseumLimit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"enum NFTSale.Phase","name":"","type":"uint8"}],"name":"price","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"payable","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":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256[]","name":"coMuseumIds","type":"uint256[]"},{"internalType":"uint256[]","name":"coMuseumAmounts","type":"uint256[]"},{"internalType":"uint256[]","name":"azukiIds","type":"uint256[]"},{"internalType":"uint256[]","name":"azukiAmounts","type":"uint256[]"},{"internalType":"uint256[]","name":"azukiElementalsIds","type":"uint256[]"},{"internalType":"uint256[]","name":"azukiElementalsAmounts","type":"uint256[]"},{"internalType":"uint256[]","name":"azukiElementalBeanzIds","type":"uint256[]"},{"internalType":"uint256[]","name":"azukiElementalBeanzAmounts","type":"uint256[]"}],"internalType":"struct NFTSale.SaleOneRequest","name":"request_","type":"tuple"}],"name":"saleOne","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"saleOneAzukiBalances","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"saleOneAzukiElementalBeanzBalances","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"saleOneAzukiElementalBeanzLimit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"saleOneAzukiElementalsBalances","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"saleOneAzukiElementalsLimit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"saleOneAzukiLimit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"saleOneCoMuseumBalances","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"saleOneCoMuseumLimit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount_","type":"uint256"}],"name":"saleTwo","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"saleTwoAccountBalances","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"saleTwoAccountLimit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account_","type":"address"},{"internalType":"bool","name":"enable_","type":"bool"}],"name":"setAdminPermissions","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"maxSupply_","type":"uint256"}],"name":"setMaxSupply","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"enum NFTSale.Phase","name":"phase_","type":"uint8"}],"name":"setPhase","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"prefix_","type":"string"}],"name":"setPrefix","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"presaleCoMuseumLimit_","type":"uint256"}],"name":"setPresaleCoMuseumLimit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"enum NFTSale.Phase","name":"phase_","type":"uint8"},{"internalType":"uint256","name":"price_","type":"uint256"}],"name":"setPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"saleOneAzukiElementalBeanzLimit_","type":"uint256"}],"name":"setSaleOneAzukiElementalBeanzLimit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"saleOneAzukiElementalsLimit_","type":"uint256"}],"name":"setSaleOneAzukiElementalsLimit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"saleOneAzukiLimit_","type":"uint256"}],"name":"setSaleOneAzukiLimit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"saleOneCoMuseumLimit_","type":"uint256"}],"name":"setSaleOneCoMuseumLimit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"saleTwoAccountLimit_","type":"uint256"}],"name":"setSaleTwoAccountLimit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"signer_","type":"address"}],"name":"setSigner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"suffix_","type":"string"}],"name":"setSuffix","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"enum NFTSale.TokenPhase","name":"phase","type":"uint8"}],"internalType":"struct NFTSale.SetTokenPhaseRequest","name":"request_","type":"tuple"},{"internalType":"bytes","name":"signature_","type":"bytes"}],"name":"setTokenPhase","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"signer","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"suffix","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tokenPhases","outputs":[{"internalType":"enum NFTSale.TokenPhase","name":"","type":"uint8"}],"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":"result","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":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"recipient_","type":"address"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
608060405234801561001057600080fd5b50614921806100206000396000f3fe6080604052600436106103e45760003560e01c806375dadb3211610208578063b7fafcd711610118578063d2c8ed4c116100ab578063e985e9c51161007a578063e985e9c514610bac578063f29b4fbc14610bcc578063f2fde38b14610bec578063f7073c3a14610c0c578063ff1473a814610c2157600080fd5b8063d2c8ed4c14610b38578063d5abeb0114610b60578063de90871f14610b75578063e7ebdca614610b9557600080fd5b8063c87b56dd116100e7578063c87b56dd14610ac0578063c9672e2614610ae0578063cbccdec314610af3578063cd1f5a2914610b2157600080fd5b8063b7fafcd714610a2e578063b88d4fde14610a5c578063c03afb5914610a6f578063c13085db14610a8f57600080fd5b8063910354c21161019b578063a22cb4651161016a578063a22cb4651461098c578063a49340cc146109ac578063a9a1d6b0146109cc578063b1c9fe6e146109ec578063b7e08d4114610a1b57600080fd5b8063910354c21461090157806395d89b41146109215780639831ef2a1461093657806398ac859e1461096457600080fd5b80638456cb59116101d75780638456cb591461088657806384b0196e1461089b57806385cb593b146108c35780638da5cb5b146108e357600080fd5b806375dadb3214610819578063782312a31461082e5780637fcf1af5146108455780638286eee21461086557600080fd5b806342842e0e116103035780636352211e116102965780636f8b44b0116102655780636f8b44b01461078457806370a08231146107a4578063715018a6146107c457806373af7a40146107d957806375d5ae9f146107f957600080fd5b80636352211e146106f65780636a00670b146107165780636c19e783146107365780636e8205271461075657600080fd5b806351cff8d9116102d257806351cff8d91461067e5780635bf6846e1461069e5780635c975abb146106be5780635eff75c1146106d657600080fd5b806342842e0e14610613578063481b86ac146106265780634bf47ebd1461063d57806351c9c58b1461066b57600080fd5b806323b872dd1161037b5780632df507be1161034a5780632df507be1461057a5780633c80c1d1146105a85780633d8f833d146105d65780633f4ba83a146105fe57600080fd5b806323b872dd14610510578063240ff27f1461052357806324d7806c146105435780632cb29a0d1461056357600080fd5b8063096cca7d116103b7578063096cca7d1461048d5780631429fbe4146104b557806318160ddd146104da578063238ac933146104ef57600080fd5b806301ffc9a7146103e957806306fdde031461041e578063081812fc14610440578063095ea7b314610478575b600080fd5b3480156103f557600080fd5b50610409610404366004613c49565b610c4f565b60405190151581526020015b60405180910390f35b34801561042a57600080fd5b50610433610ca1565b6040516104159190613cbd565b34801561044c57600080fd5b5061046061045b366004613cd0565b610d3c565b6040516001600160a01b039091168152602001610415565b61048b610486366004613d09565b610d80565b005b34801561049957600080fd5b5061046073e166a1fc32647ba4ec271b753cc56b5f0870d23281565b3480156104c157600080fd5b506104cc6101965481565b604051908152602001610415565b3480156104e657600080fd5b506104cc610d90565b3480156104fb57600080fd5b5061019354610460906001600160a01b031681565b61048b61051e366004613d35565b610db0565b34801561052f57600080fd5b5061048b61053e366004613d84565b610f80565b34801561054f57600080fd5b5061040961055e366004613dbd565b610fd9565b34801561056f57600080fd5b506104cc6101995481565b34801561058657600080fd5b506104cc610595366004613cd0565b61019d6020526000908152604090205481565b3480156105b457600080fd5b506104cc6105c3366004613dbd565b6101986020526000908152604090205481565b3480156105e257600080fd5b5061046073b6a37b5d14d502c3ab0ae6f3a0e058bc9517786e81565b34801561060a57600080fd5b5061048b610ff7565b61048b610621366004613d35565b611009565b34801561063257600080fd5b506104cc61019a5481565b34801561064957600080fd5b506104cc610658366004613cd0565b61019e6020526000908152604090205481565b61048b610679366004613dda565b611029565b34801561068a57600080fd5b5061048b610699366004613dbd565b611696565b3480156106aa57600080fd5b5061048b6106b9366004613ec0565b611733565b3480156106ca57600080fd5b5060655460ff16610409565b3480156106e257600080fd5b5061048b6106f1366004613cd0565b611a76565b34801561070257600080fd5b50610460610711366004613cd0565b611a84565b34801561072257600080fd5b5061048b610731366004613f92565b611a8f565b34801561074257600080fd5b5061048b610751366004613dbd565b611ad5565b34801561076257600080fd5b506104cc610771366004613cd0565b61019f6020526000908152604090205481565b34801561079057600080fd5b5061048b61079f366004613cd0565b611b00565b3480156107b057600080fd5b506104cc6107bf366004613dbd565b611b2a565b3480156107d057600080fd5b5061048b611b89565b3480156107e557600080fd5b5061048b6107f4366004613cd0565b611b9b565b34801561080557600080fd5b5061048b610814366004613ff1565b611ba9565b34801561082557600080fd5b50610433611bdc565b34801561083a57600080fd5b506104cc61019c5481565b34801561085157600080fd5b5061048b61086036600461404a565b611bec565b34801561087157600080fd5b506104606c447e69651d841bd8d104bed49381565b34801561089257600080fd5b5061048b611cee565b3480156108a757600080fd5b506108b0611cfe565b604051610415979695949392919061409d565b3480156108cf57600080fd5b5061048b6108de366004613ff1565b611dc9565b3480156108ef57600080fd5b506033546001600160a01b0316610460565b34801561090d57600080fd5b5061048b61091c366004613cd0565b611dfc565b34801561092d57600080fd5b50610433611e0a565b34801561094257600080fd5b506104cc610951366004613cd0565b6101976020526000908152604090205481565b34801561097057600080fd5b50610460733af2a97414d1101e2107a70e7f33955da134630581565b34801561099857600080fd5b5061048b6109a7366004613d84565b611e22565b3480156109b857600080fd5b5061048b6109c736600461417a565b611e9f565b3480156109d857600080fd5b5061048b6109e7366004613cd0565b611f77565b3480156109f857600080fd5b5061019354610a0e90600160a01b900460ff1681565b6040516104159190614219565b61048b610a2936600461422c565b611f85565b348015610a3a57600080fd5b506104cc610a493660046142e3565b6101946020526000908152604090205481565b61048b610a6a366004614300565b6122e0565b348015610a7b57600080fd5b5061048b610a8a3660046142e3565b612321565b348015610a9b57600080fd5b50610a0e610aaa366004613cd0565b6101956020526000908152604090205460ff1681565b348015610acc57600080fd5b50610433610adb366004613cd0565b612357565b61048b610aee366004613cd0565b612388565b348015610aff57600080fd5b506104cc610b0e366004613dbd565b6101a26020526000908152604090205481565b348015610b2d57600080fd5b506104cc6101a15481565b348015610b4457600080fd5b5061046073ed5af388653567af2f388e6224dc7c4b3241c54481565b348015610b6c57600080fd5b5060fd546104cc565b348015610b8157600080fd5b5061048b610b90366004613cd0565b61246d565b348015610ba157600080fd5b506104cc61019b5481565b348015610bb857600080fd5b50610409610bc736600461437f565b61247b565b348015610bd857600080fd5b5061048b610be7366004613cd0565b6124b8565b348015610bf857600080fd5b5061048b610c07366004613dbd565b6124c6565b348015610c1857600080fd5b5061043361253f565b348015610c2d57600080fd5b506104cc610c3c366004613cd0565b6101a06020526000908152604090205481565b60006301ffc9a760e01b6001600160e01b031983161480610c8057506380ac58cd60e01b6001600160e01b03198316145b80610c9b5750635b5e139f60e01b6001600160e01b03198316145b92915050565b6060610cab61254f565b6002018054610cb9906143ad565b80601f0160208091040260200160405190810160405280929190818152602001828054610ce5906143ad565b8015610d325780601f10610d0757610100808354040283529160200191610d32565b820191906000526020600020905b815481529060010190602001808311610d1557829003601f168201915b5050505050905090565b6000610d4782612573565b610d5b57610d5b6333d1c03960e21b6125d3565b610d6361254f565b60009283526006016020525060409020546001600160a01b031690565b610d8c828260016125dd565b5050565b60006001610d9c61254f565b60010154610da861254f565b540303905090565b6000610dbb8261268e565b6001600160a01b039485169490915081168414610de157610de162a1148160e81b6125d3565b600080610ded84612751565b91509150610e128187610dfd3390565b6001600160a01b039081169116811491141790565b610e3457610e20863361247b565b610e3457610e34632ce44b5f60e11b6125d3565b610e418686866001612779565b8015610e4c57600082555b610e5461254f565b6001600160a01b0387166000908152600591909101602052604090208054600019019055610e8061254f565b6001600160a01b03861660008181526005929092016020526040909120805460010190554260a01b17600160e11b17610eb761254f565b60008681526004919091016020526040812091909155600160e11b84169003610f2d5760018401610ee661254f565b600082815260049190910160205260408120549003610f2b57610f0761254f565b548114610f2b5783610f1761254f565b600083815260049190910160205260409020555b505b6001600160a01b0385168481887fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a480600003610f7757610f77633a954ecd60e21b6125d3565b50505050505050565b610f8933610fd9565b610fae5760405162461bcd60e51b8152600401610fa5906143e1565b60405180910390fd5b6001600160a01b0391909116600090815260cb60205260409020805460ff1916911515919091179055565b6001600160a01b0316600090815260cb602052604090205460ff1690565b610fff6127fd565b611007612857565b565b611024838383604051806020016040528060008152506122e0565b505050565b60018061019354600160a01b900460ff16600281111561104b5761104b6141e5565b146110685760405162461bcd60e51b8152600401610fa590614407565b6110706128a9565b600061107c8380614432565b8080602002602001604051908101604052809392919081815260200183836020028082843760009201829052509394506110bd925050506020850185614432565b8080602002602001604051908101604052809392919081815260200183836020028082843760009201829052509394506110fe925050506040860186614432565b80806020026020016040519081016040528093929190818152602001838360200280828437600092018290525093945061113f925050506060870187614432565b808060200260200160405190810160405280939291908181526020018383602002808284376000920182905250939450611180925050506080880188614432565b8080602002602001604051908101604052809392919081815260200183836020028082843760009201829052509394506111c19250505060a0890189614432565b8080602002602001604051908101604052809392919081815260200183836020028082843760009201829052509394506112029250505060c08a018a614432565b8080602002602001604051908101604052809392919081815260200183836020028082843760009201829052509394506112439250505060e08b018b614432565b80806020026020016040519081016040528093929190818152602001838360200280828437600092018290525093945083925050505b89518110156113695760008a82815181106112965761129661447b565b6020026020010151905060008a83815181106112b4576112b461447b565b602002602001015190506112c7826128ef565b61019954600083815261019d60205260409020546112e69083906144a7565b111561132e5760405162461bcd60e51b815260206004820152601760248201527610dbcb535d5cd95d5b48195e18d959591cc81b1a5b5a5d604a1b6044820152606401610fa5565b600082815261019d60205260408120805483929061134d9084906144a7565b9091555061135d905081856144a7565b93505050600101611279565b5060005b875181101561145957600088828151811061138a5761138a61447b565b6020026020010151905060008883815181106113a8576113a861447b565b602002602001015190506113bb82612a51565b61019a54600083815261019e60205260409020546113da9083906144a7565b111561141e5760405162461bcd60e51b8152602060048201526013602482015272105e9d5ada48195e18d959591cc81b1a5b5a5d606a1b6044820152606401610fa5565b600082815261019e60205260408120805483929061143d9084906144a7565b9091555061144d905081856144a7565b9350505060010161136d565b5060005b855181101561155357600086828151811061147a5761147a61447b565b6020026020010151905060008683815181106114985761149861447b565b602002602001015190506114ab82612ba9565b61019b54600083815261019f60205260409020546114ca9083906144a7565b11156115185760405162461bcd60e51b815260206004820152601d60248201527f417a756b6920656c656d656e74616c2065786365656473206c696d69740000006044820152606401610fa5565b600082815261019f6020526040812080548392906115379084906144a7565b90915550611547905081856144a7565b9350505060010161145d565b5060005b835181101561164d5760008482815181106115745761157461447b565b6020026020010151905060008483815181106115925761159261447b565b602002602001015190506115a582612d0b565b61019c5460008381526101a060205260409020546115c49083906144a7565b11156116125760405162461bcd60e51b815260206004820152601d60248201527f417a756b6920656c656d656e74616c2065786365656473206c696d69740000006044820152606401610fa5565b60008281526101a06020526040812080548392906116319084906144a7565b90915550611641905081856144a7565b93505050600101611557565b5061167f81610194600060015b600281111561166b5761166b6141e5565b815260200190815260200160002054612e79565b6116893382612f06565b5050505050505050505050565b61169e6127fd565b6000816001600160a01b03164760405160006040518083038185875af1925050503d80600081146116eb576040519150601f19603f3d011682016040523d82523d6000602084013e6116f0565b606091505b5050905080610d8c5760405162461bcd60e51b815260206004820152600f60248201526e15da5d1a191c985dc819985a5b1959608a1b6044820152606401610fa5565b6000805160206148cc83398151915254610100900460ff16611768576000805160206148cc8339815191525460ff161561176c565b303b155b6117de5760405162461bcd60e51b815260206004820152603760248201527f455243373231415f5f496e697469616c697a61626c653a20636f6e747261637460448201527f20697320616c726561647920696e697469616c697a65640000000000000000006064820152608401610fa5565b6000805160206148cc83398151915254610100900460ff1615801561181a576000805160206148cc833981519152805461ffff19166101011790555b600054610100900460ff161580801561183a5750600054600160ff909116105b806118545750303b158015611854575060005460ff166001145b6118b75760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610fa5565b6000805460ff1916600117905580156118da576000805461ff0019166101001790555b6118e2612f9f565b6118ea612fce565b6119126040518060200160405280600081525060405180602001604052806000815250612ffd565b61191c888861302e565b61192461306c565b61192d866130af565b61193785856130d6565b61193f613118565b61194761313f565b61019380546001600160a81b0319166001600160a01b03851617905561019460205267013c3107490280007fac2681a0ffcdeb8d930437e36dc6669c17d1245fb57aa4cfab8f62b41ea51f818190557f431122e4fe9c44f5a319c6d2afd7cf7bcc21253a0483556b9b40b9255f70a15e819055600260008190527f4f2fafccb5d28f3aaff6cbdf8ff32db4167d35308651b7acedb7127f6ec061859190915561019681905561019981905561019a55600161019b81905561019c5560056101a1558015611a4e576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b508015610f775750506000805160206148cc833981519152805461ff00191690555050505050565b611a7e6127fd565b61019655565b6000610c9b8261268e565b611a976127fd565b806101946000846002811115611aaf57611aaf6141e5565b6002811115611ac057611ac06141e5565b81526020810191909152604001600020555050565b611add6127fd565b61019380546001600160a01b0319166001600160a01b0392909216919091179055565b611b0933610fd9565b611b255760405162461bcd60e51b8152600401610fa5906143e1565b60fd55565b60006001600160a01b038216611b4a57611b4a6323d3ad8160e21b6125d3565b6001600160401b03611b5a61254f565b6005016000846001600160a01b03166001600160a01b0316815260200190815260200160002054169050919050565b611b916127fd565b611007600061317c565b611ba36127fd565b61019c55565b611bb233610fd9565b611bce5760405162461bcd60e51b8152600401610fa5906143e1565b610130611024828483614502565b606061012f8054610cb9906143ad565b8282826000611bfa846131ce565b90506000611c078261324f565b90506000611c4b8286868080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061327c92505050565b610193549091506001600160a01b03808316911614611ca35760405162461bcd60e51b8152602060048201526014602482015273155b985d5d1a1bdc9a5e9959081c995c5d595cdd60621b6044820152606401610fa5565b611cb360408a0160208b016142e3565b8935600090815261019560205260409020805460ff19166001836002811115611cde57611cde6141e5565b0217905550505050505050505050565b611cf66127fd565b61100761313f565b6000606080600080600060606097546000801b148015611d1e5750609854155b611d625760405162461bcd60e51b81526020600482015260156024820152741152540dcc4c8e88155b9a5b9a5d1a585b1a5e9959605a1b6044820152606401610fa5565b50506040805180820182526011815270415a554b495f585f434f5f4d555345554d60781b6020808301919091528251808401845260058152640302e312e360dc1b8183015283516000808252928101909452600f60f81b9992985096504695503094509250565b611dd233610fd9565b611dee5760405162461bcd60e51b8152600401610fa5906143e1565b61012f611024828483614502565b611e046127fd565b6101a155565b6060611e1461254f565b6003018054610cb9906143ad565b80611e2b61254f565b336000818152600792909201602090815260408084206001600160a01b03881680865290835293819020805460ff19169515159590951790945592518415158152919290917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b611ea833610fd9565b611ec45760405162461bcd60e51b8152600401610fa5906143e1565b82818114611f145760405162461bcd60e51b815260206004820152601760248201527f41646d696e206d696e743a2062616420726571756573740000000000000000006044820152606401610fa5565b60005b81811015611f6f57611f67868683818110611f3457611f3461447b565b9050602002016020810190611f499190613dbd565b858584818110611f5b57611f5b61447b565b905060200201356132a0565b600101611f17565b505050505050565b611f7f6127fd565b61019b55565b83838383831561209d576000611f9a846132aa565b90506000611fa78261324f565b90506000611feb8286868080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061327c92505050565b610193549091506001600160a01b038083169116146120435760405162461bcd60e51b8152602060048201526014602482015273155b985d5d1a1bdc9a5e9959081c995c5d595cdd60621b6044820152606401610fa5565b336120516020880188613dbd565b6001600160a01b0316146120995760405162461bcd60e51b815260206004820152600f60248201526e125b9d985b1a59081858d8dbdd5b9d608a1b6044820152606401610fa5565b5050505b60008061019354600160a01b900460ff1660028111156120bf576120bf6141e5565b146120dc5760405162461bcd60e51b8152600401610fa590614407565b6120e46128a9565b6000805b8d8110156121d55760008f8f838181106121045761210461447b565b90506020020135905060008e8e848181106121215761212161447b565b905060200201359050612133826128ef565b61019654600083815261019760205260409020546121529083906144a7565b111561219a5760405162461bcd60e51b815260206004820152601760248201527610dbcb535d5cd95d5b48195e18d959591cc81b1a5b5a5d604a1b6044820152606401610fa5565b60008281526101976020526040812080548392906121b99084906144a7565b909155506121c9905081856144a7565b935050506001016120e8565b503360009081526101986020908152604090912054908a0135906121fa908c906144a7565b11156122405760405162461bcd60e51b81526020600482015260156024820152741058d8dbdd5b9d08195e18d959591cc81b1a5b5a5d605a1b6044820152606401610fa5565b3360009081526101986020526040812080548c92906122609084906144a7565b9091555061227090508a826144a7565b90506122818161019460008061165a565b61228e60208a018a613dbd565b6001600160a01b03167f10fcc92ce3ae296b6d2813de054ab2cf2d6dd59a1eed235681bc8bf6c36a5cb7826040516122c891815260200190565b60405180910390a25050505050505050505050505050565b6122eb848484610db0565b6001600160a01b0383163b1561231b5761230784848484613307565b61231b5761231b6368d2bf6b60e11b6125d3565b50505050565b6123296127fd565b610193805482919060ff60a01b1916600160a01b83600281111561234f5761234f6141e5565b021790555050565b606061236282612573565b61237f57604051630a14c4b560e41b815260040160405180910390fd5b610c9b826133e9565b60028061019354600160a01b900460ff1660028111156123aa576123aa6141e5565b146123c75760405162461bcd60e51b8152600401610fa590614407565b6123cf6128a9565b6101a1543360009081526101a260205260409020546123ef9084906144a7565b111561242d5760405162461bcd60e51b815260206004820152600d60248201526c115e18d959591cc81b1a5b5a5d609a1b6044820152606401610fa5565b3360009081526101a260205260408120805484929061244d9084906144a7565b909155506124639050826101946000600261165a565b610d8c3383612f06565b6124756127fd565b61019955565b600061248561254f565b6001600160a01b039384166000908152600791909101602090815260408083209490951682529290925250205460ff1690565b6124c06127fd565b61019a55565b6124ce6127fd565b6001600160a01b0381166125335760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610fa5565b61253c8161317c565b50565b60606101308054610cb9906143ad565b7f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c4090565b6000816001116125ce5761258561254f565b548210156125ce5760005b61259861254f565b6000848152600491909101602052604081205491508190036125c4576125bd836145c1565b9250612590565b600160e01b161590505b919050565b8060005260046000fd5b60006125e883611a84565b90508180156126005750336001600160a01b03821614155b156126235761260f813361247b565b612623576126236367d9dca160e11b6125d3565b8361262c61254f565b6000858152600691909101602052604080822080546001600160a01b0319166001600160a01b0394851617905551859287811692908516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259190a450505050565b600081600111612741576126a061254f565b6000838152600491909101602052604090205490508060000361272e576126c561254f565b5482106126dc576126dc636f96cda160e11b6125d3565b6126e461254f565b6000199092016000818152600493909301602052604090922054905080156126dc57600160e01b811660000361271957919050565b612729636f96cda160e11b6125d3565b6126dc565b600160e01b811660000361274157919050565b6125ce636f96cda160e11b6125d3565b600080600061275e61254f565b60009485526006016020525050604090912080549092909150565b6001600160a01b03841615806127b3575060016000838152610195602052604090205460ff1660028111156127b0576127b06141e5565b14155b6127f85760405162461bcd60e51b8152602060048201526016602482015275546f6b656e206e6f74207472616e7366657261626c6560501b6044820152606401610fa5565b61231b565b6033546001600160a01b031633146110075760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610fa5565b61285f613422565b6065805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b60655460ff16156110075760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610fa5565b6040516331a9108f60e11b81526004810182905260009073e166a1fc32647ba4ec271b753cc56b5f0870d23290636352211e90602401602060405180830381865afa158015612942573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061296691906145d8565b9050336001600160a01b0382161480612a055750604051632e7cda1d60e21b81526c447e69651d841bd8d104bed4939063b9f36874906129c4903390859073e166a1fc32647ba4ec271b753cc56b5f0870d2329088906004016145f5565b602060405180830381865afa1580156129e1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a059190614626565b610d8c5760405162461bcd60e51b815260206004820152601760248201527f496e76616c696420436f2d4d757365756d206f776e65720000000000000000006044820152606401610fa5565b6040516331a9108f60e11b81526004810182905260009073ed5af388653567af2f388e6224dc7c4b3241c54490636352211e90602401602060405180830381865afa158015612aa4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ac891906145d8565b9050336001600160a01b0382161480612b675750604051632e7cda1d60e21b81526c447e69651d841bd8d104bed4939063b9f3687490612b26903390859073ed5af388653567af2f388e6224dc7c4b3241c5449088906004016145f5565b602060405180830381865afa158015612b43573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b679190614626565b610d8c5760405162461bcd60e51b815260206004820152601360248201527224b73b30b634b21020bd3ab5b49037bbb732b960691b6044820152606401610fa5565b6040516331a9108f60e11b81526004810182905260009073b6a37b5d14d502c3ab0ae6f3a0e058bc9517786e90636352211e90602401602060405180830381865afa158015612bfc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c2091906145d8565b9050336001600160a01b0382161480612cbf5750604051632e7cda1d60e21b81526c447e69651d841bd8d104bed4939063b9f3687490612c7e903390859073b6a37b5d14d502c3ab0ae6f3a0e058bc9517786e9088906004016145f5565b602060405180830381865afa158015612c9b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612cbf9190614626565b610d8c5760405162461bcd60e51b815260206004820152601e60248201527f496e76616c696420417a756b6920656c656d656e74616c73206f776e657200006044820152606401610fa5565b6040516331a9108f60e11b815260048101829052600090733af2a97414d1101e2107a70e7f33955da134630590636352211e90602401602060405180830381865afa158015612d5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d8291906145d8565b9050336001600160a01b0382161480612e215750604051632e7cda1d60e21b81526c447e69651d841bd8d104bed4939063b9f3687490612de09033908590733af2a97414d1101e2107a70e7f33955da13463059088906004016145f5565b602060405180830381865afa158015612dfd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e219190614626565b610d8c5760405162461bcd60e51b815260206004820152602360248201527f496e76616c696420417a756b6920656c656d656e74616c206265616e7a206f776044820152623732b960e91b6064820152608401610fa5565b6000612e858284614643565b905080341015612ec85760405162461bcd60e51b815260206004820152600e60248201526d09cdee840cadcdeeaced0408aa8960931b6044820152606401610fa5565b8034111561102457336108fc612ede833461465a565b6040518115909202916000818181858888f1935050505015801561231b573d6000803e3d6000fd5b8060fd5481612f1361346b565b612f1d91906144a7565b1115612f5c5760405162461bcd60e51b815260206004820152600e60248201526d4578636565647320737570706c7960901b6044820152606401610fa5565b323314612f955760405162461bcd60e51b81526020600482015260076024820152664e6f20626f747360c81b6044820152606401610fa5565b611024838361347a565b600054610100900460ff16612fc65760405162461bcd60e51b8152600401610fa59061466d565b611007613494565b600054610100900460ff16612ff55760405162461bcd60e51b8152600401610fa59061466d565b6110076134c4565b600054610100900460ff166130245760405162461bcd60e51b8152600401610fa59061466d565b610d8c82826134f7565b6000805160206148cc83398151915254610100900460ff166130625760405162461bcd60e51b8152600401610fa5906146b8565b610d8c8282613546565b600054610100900460ff166130935760405162461bcd60e51b8152600401610fa59061466d565b33600090815260cb60205260409020805460ff19166001179055565b600054610100900460ff16611b255760405162461bcd60e51b8152600401610fa59061466d565b600054610100900460ff166130fd5760405162461bcd60e51b8152600401610fa59061466d565b61012f61310a838261470c565b50610130611024828261470c565b600054610100900460ff166110075760405162461bcd60e51b8152600401610fa59061466d565b6131476128a9565b6065805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25861288c3390565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60007fcb47c620e4bac89d873a47d71176d24b42a701da50e4400c4fc5eee71211be71823561320360408501602086016142e3565b6002811115613214576132146141e5565b60408051602081019490945283019190915260ff1660608201526080015b604051602081830303815290604052805190602001209050919050565b6000610c9b61325c6135b9565b8360405161190160f01b8152600281019290925260228201526042902090565b600080600061328b85856135c3565b9150915061329881613608565b509392505050565b610d8c8282612f06565b60007f904116aebab2081d38d8cae3b4fbc5c844749e354a61c1001bc4c71f06596cb26132da6020840184613dbd565b604080516020818101949094526001600160a01b0390921690820152908301356060820152608001613232565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a029061333c9033908990889088906004016147cb565b6020604051808303816000875af1925050508015613377575060408051601f3d908101601f1916820190925261337491810190614808565b60015b6133cc573d8080156133a5576040519150601f19603f3d011682016040523d82523d6000602084013e6133aa565b606091505b5080516000036133c4576133c46368d2bf6b60e11b6125d3565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050949350505050565b606061012f6133f783613752565b61013060405160200161340c93929190614898565b6040516020818303038152906040529050919050565b60655460ff166110075760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610fa5565b6000613475610d90565b905090565b610d8c8282604051806020016040528060008152506137e4565b600054610100900460ff166134bb5760405162461bcd60e51b8152600401610fa59061466d565b6110073361317c565b600054610100900460ff166134eb5760405162461bcd60e51b8152600401610fa59061466d565b6065805460ff19169055565b600054610100900460ff1661351e5760405162461bcd60e51b8152600401610fa59061466d565b609961352a838261470c565b50609a613537828261470c565b50506000609781905560985550565b6000805160206148cc83398151915254610100900460ff1661357a5760405162461bcd60e51b8152600401610fa5906146b8565b8161358361254f565b60020190613591908261470c565b508061359b61254f565b600301906135a9908261470c565b5060016135b461254f565b555050565b6000613475613858565b60008082516041036135f95760208301516040840151606085015160001a6135ed878285856138cc565b94509450505050613601565b506000905060025b9250929050565b600081600481111561361c5761361c6141e5565b036136245750565b6001816004811115613638576136386141e5565b036136855760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610fa5565b6002816004811115613699576136996141e5565b036136e65760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610fa5565b60038160048111156136fa576136fa6141e5565b0361253c5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610fa5565b6060600061375f83613990565b60010190506000816001600160401b0381111561377e5761377e613e15565b6040519080825280601f01601f1916602001820160405280156137a8576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a85049450846137b257509392505050565b6137ee8383613a68565b6001600160a01b0383163b1561102457600061380861254f565b5490508281035b6138226000868380600101945086613307565b613836576138366368d2bf6b60e11b6125d3565b81811061380f578161384661254f565b541461385157600080fd5b5050505050565b60007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f613883613b69565b61388b613be8565b60408051602081019490945283019190915260608201524660808201523060a082015260c00160405160208183030381529060405280519060200120905090565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156139035750600090506003613987565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015613957573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661398057600060019250925050613987565b9150600090505b94509492505050565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106139cf5772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef810000000083106139fb576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc100008310613a1957662386f26fc10000830492506010015b6305f5e1008310613a31576305f5e100830492506008015b6127108310613a4557612710830492506004015b60648310613a57576064830492506002015b600a8310610c9b5760010192915050565b6000613a7261254f565b5490506000829003613a8e57613a8e63b562e8dd60e01b6125d3565b613a9b6000848385612779565b6001600160a01b0383164260a01b6001841460e11b1717613aba61254f565b60008381526004919091016020526040902055680100000000000000018202613ae161254f565b6001600160a01b0385166000818152600592909201602052604082208054909301909255819003613b1b57613b1b622e076360e81b6125d3565b818301825b808360007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a4818160010191508103613b205781613b5f61254f565b5550611024915050565b600080613b9a604080518082019091526011815270415a554b495f585f434f5f4d555345554d60781b602082015290565b805190915015613bb1578051602090910120919050565b6097548015613bc05792915050565b7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a4709250505090565b600080613c0d6040805180820190915260058152640302e312e360dc1b602082015290565b805190915015613c24578051602090910120919050565b6098548015613bc05792915050565b6001600160e01b03198116811461253c57600080fd5b600060208284031215613c5b57600080fd5b8135613c6681613c33565b9392505050565b60005b83811015613c88578181015183820152602001613c70565b50506000910152565b60008151808452613ca9816020860160208601613c6d565b601f01601f19169290920160200192915050565b602081526000613c666020830184613c91565b600060208284031215613ce257600080fd5b5035919050565b6001600160a01b038116811461253c57600080fd5b80356125ce81613ce9565b60008060408385031215613d1c57600080fd5b8235613d2781613ce9565b946020939093013593505050565b600080600060608486031215613d4a57600080fd5b8335613d5581613ce9565b92506020840135613d6581613ce9565b929592945050506040919091013590565b801515811461253c57600080fd5b60008060408385031215613d9757600080fd5b8235613da281613ce9565b91506020830135613db281613d76565b809150509250929050565b600060208284031215613dcf57600080fd5b8135613c6681613ce9565b600060208284031215613dec57600080fd5b81356001600160401b03811115613e0257600080fd5b82016101008185031215613c6657600080fd5b634e487b7160e01b600052604160045260246000fd5b60006001600160401b0380841115613e4557613e45613e15565b604051601f8501601f19908116603f01168101908282118183101715613e6d57613e6d613e15565b81604052809350858152868686011115613e8657600080fd5b858560208301376000602087830101525050509392505050565b600082601f830112613eb157600080fd5b613c6683833560208501613e2b565b60008060008060008060c08789031215613ed957600080fd5b86356001600160401b0380821115613ef057600080fd5b613efc8a838b01613ea0565b97506020890135915080821115613f1257600080fd5b613f1e8a838b01613ea0565b9650604089013595506060890135915080821115613f3b57600080fd5b613f478a838b01613ea0565b94506080890135915080821115613f5d57600080fd5b50613f6a89828a01613ea0565b925050613f7960a08801613cfe565b90509295509295509295565b6003811061253c57600080fd5b60008060408385031215613fa557600080fd5b8235613d2781613f85565b60008083601f840112613fc257600080fd5b5081356001600160401b03811115613fd957600080fd5b60208301915083602082850101111561360157600080fd5b6000806020838503121561400457600080fd5b82356001600160401b0381111561401a57600080fd5b61402685828601613fb0565b90969095509350505050565b60006040828403121561404457600080fd5b50919050565b60008060006060848603121561405f57600080fd5b6140698585614032565b925060408401356001600160401b0381111561408457600080fd5b61409086828701613fb0565b9497909650939450505050565b60ff60f81b881681526000602060e060208401526140be60e084018a613c91565b83810360408501526140d0818a613c91565b606085018990526001600160a01b038816608086015260a0850187905284810360c08601528551808252602080880193509091019060005b8181101561412457835183529284019291840191600101614108565b50909c9b505050505050505050505050565b60008083601f84011261414857600080fd5b5081356001600160401b0381111561415f57600080fd5b6020830191508360208260051b850101111561360157600080fd5b6000806000806040858703121561419057600080fd5b84356001600160401b03808211156141a757600080fd5b6141b388838901614136565b909650945060208701359150808211156141cc57600080fd5b506141d987828801614136565b95989497509550505050565b634e487b7160e01b600052602160045260246000fd5b6003811061253c57634e487b7160e01b600052602160045260246000fd5b60208101614226836141fb565b91905290565b60008060008060008060008060c0898b03121561424857600080fd5b88356001600160401b038082111561425f57600080fd5b61426b8c838d01614136565b909a50985060208b013591508082111561428457600080fd5b6142908c838d01614136565b909850965060408b013595508691506142ac8c60608d01614032565b945060a08b01359150808211156142c257600080fd5b506142cf8b828c01613fb0565b999c989b5096995094979396929594505050565b6000602082840312156142f557600080fd5b8135613c6681613f85565b6000806000806080858703121561431657600080fd5b843561432181613ce9565b9350602085013561433181613ce9565b92506040850135915060608501356001600160401b0381111561435357600080fd5b8501601f8101871361436457600080fd5b61437387823560208401613e2b565b91505092959194509250565b6000806040838503121561439257600080fd5b823561439d81613ce9565b91506020830135613db281613ce9565b600181811c908216806143c157607f821691505b60208210810361404457634e487b7160e01b600052602260045260246000fd5b6020808252600c908201526b2737ba1030b71030b236b4b760a11b604082015260600190565b602080825260119082015270141a185cd9481b9bdd08195b98589b1959607a1b604082015260600190565b6000808335601e1984360301811261444957600080fd5b8301803591506001600160401b0382111561446357600080fd5b6020019150600581901b360382131561360157600080fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b80820180821115610c9b57610c9b614491565b601f821115611024576000816000526020600020601f850160051c810160208610156144e35750805b601f850160051c820191505b81811015611f6f578281556001016144ef565b6001600160401b0383111561451957614519613e15565b61452d8361452783546143ad565b836144ba565b6000601f84116001811461456157600085156145495750838201355b600019600387901b1c1916600186901b178355613851565b600083815260209020601f19861690835b828110156145925786850135825560209485019460019092019101614572565b50868210156145af5760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b6000816145d0576145d0614491565b506000190190565b6000602082840312156145ea57600080fd5b8151613c6681613ce9565b6001600160a01b03948516815292841660208401529216604082015260608101919091526000608082015260a00190565b60006020828403121561463857600080fd5b8151613c6681613d76565b8082028115828204841417610c9b57610c9b614491565b81810381811115610c9b57610c9b614491565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b60208082526034908201527f455243373231415f5f496e697469616c697a61626c653a20636f6e7472616374604082015273206973206e6f7420696e697469616c697a696e6760601b606082015260800190565b81516001600160401b0381111561472557614725613e15565b6147398161473384546143ad565b846144ba565b602080601f83116001811461476e57600084156147565750858301515b600019600386901b1c1916600185901b178555611f6f565b600085815260208120601f198616915b8281101561479d5788860151825594840194600190910190840161477e565b50858210156147bb5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906147fe90830184613c91565b9695505050505050565b60006020828403121561481a57600080fd5b8151613c6681613c33565b60008154614832816143ad565b6001828116801561484a576001811461485f5761488e565b60ff198416875282151583028701945061488e565b8560005260208060002060005b858110156148855781548a82015290840190820161486c565b50505082870194505b5050505092915050565b60006148a48286614825565b84516148b4818360208901613c6d565b6148c081830186614825565b97965050505050505056feee151c8401928dc223602bb187aff91b9a56c7cae5476ef1b3287b085a16c85fa26469706673582212202b41b456f4a72b539551efa8791952567a3c217d0bffef2cd5c66d5283d88e6264736f6c63430008180033
Deployed Bytecode
0x6080604052600436106103e45760003560e01c806375dadb3211610208578063b7fafcd711610118578063d2c8ed4c116100ab578063e985e9c51161007a578063e985e9c514610bac578063f29b4fbc14610bcc578063f2fde38b14610bec578063f7073c3a14610c0c578063ff1473a814610c2157600080fd5b8063d2c8ed4c14610b38578063d5abeb0114610b60578063de90871f14610b75578063e7ebdca614610b9557600080fd5b8063c87b56dd116100e7578063c87b56dd14610ac0578063c9672e2614610ae0578063cbccdec314610af3578063cd1f5a2914610b2157600080fd5b8063b7fafcd714610a2e578063b88d4fde14610a5c578063c03afb5914610a6f578063c13085db14610a8f57600080fd5b8063910354c21161019b578063a22cb4651161016a578063a22cb4651461098c578063a49340cc146109ac578063a9a1d6b0146109cc578063b1c9fe6e146109ec578063b7e08d4114610a1b57600080fd5b8063910354c21461090157806395d89b41146109215780639831ef2a1461093657806398ac859e1461096457600080fd5b80638456cb59116101d75780638456cb591461088657806384b0196e1461089b57806385cb593b146108c35780638da5cb5b146108e357600080fd5b806375dadb3214610819578063782312a31461082e5780637fcf1af5146108455780638286eee21461086557600080fd5b806342842e0e116103035780636352211e116102965780636f8b44b0116102655780636f8b44b01461078457806370a08231146107a4578063715018a6146107c457806373af7a40146107d957806375d5ae9f146107f957600080fd5b80636352211e146106f65780636a00670b146107165780636c19e783146107365780636e8205271461075657600080fd5b806351cff8d9116102d257806351cff8d91461067e5780635bf6846e1461069e5780635c975abb146106be5780635eff75c1146106d657600080fd5b806342842e0e14610613578063481b86ac146106265780634bf47ebd1461063d57806351c9c58b1461066b57600080fd5b806323b872dd1161037b5780632df507be1161034a5780632df507be1461057a5780633c80c1d1146105a85780633d8f833d146105d65780633f4ba83a146105fe57600080fd5b806323b872dd14610510578063240ff27f1461052357806324d7806c146105435780632cb29a0d1461056357600080fd5b8063096cca7d116103b7578063096cca7d1461048d5780631429fbe4146104b557806318160ddd146104da578063238ac933146104ef57600080fd5b806301ffc9a7146103e957806306fdde031461041e578063081812fc14610440578063095ea7b314610478575b600080fd5b3480156103f557600080fd5b50610409610404366004613c49565b610c4f565b60405190151581526020015b60405180910390f35b34801561042a57600080fd5b50610433610ca1565b6040516104159190613cbd565b34801561044c57600080fd5b5061046061045b366004613cd0565b610d3c565b6040516001600160a01b039091168152602001610415565b61048b610486366004613d09565b610d80565b005b34801561049957600080fd5b5061046073e166a1fc32647ba4ec271b753cc56b5f0870d23281565b3480156104c157600080fd5b506104cc6101965481565b604051908152602001610415565b3480156104e657600080fd5b506104cc610d90565b3480156104fb57600080fd5b5061019354610460906001600160a01b031681565b61048b61051e366004613d35565b610db0565b34801561052f57600080fd5b5061048b61053e366004613d84565b610f80565b34801561054f57600080fd5b5061040961055e366004613dbd565b610fd9565b34801561056f57600080fd5b506104cc6101995481565b34801561058657600080fd5b506104cc610595366004613cd0565b61019d6020526000908152604090205481565b3480156105b457600080fd5b506104cc6105c3366004613dbd565b6101986020526000908152604090205481565b3480156105e257600080fd5b5061046073b6a37b5d14d502c3ab0ae6f3a0e058bc9517786e81565b34801561060a57600080fd5b5061048b610ff7565b61048b610621366004613d35565b611009565b34801561063257600080fd5b506104cc61019a5481565b34801561064957600080fd5b506104cc610658366004613cd0565b61019e6020526000908152604090205481565b61048b610679366004613dda565b611029565b34801561068a57600080fd5b5061048b610699366004613dbd565b611696565b3480156106aa57600080fd5b5061048b6106b9366004613ec0565b611733565b3480156106ca57600080fd5b5060655460ff16610409565b3480156106e257600080fd5b5061048b6106f1366004613cd0565b611a76565b34801561070257600080fd5b50610460610711366004613cd0565b611a84565b34801561072257600080fd5b5061048b610731366004613f92565b611a8f565b34801561074257600080fd5b5061048b610751366004613dbd565b611ad5565b34801561076257600080fd5b506104cc610771366004613cd0565b61019f6020526000908152604090205481565b34801561079057600080fd5b5061048b61079f366004613cd0565b611b00565b3480156107b057600080fd5b506104cc6107bf366004613dbd565b611b2a565b3480156107d057600080fd5b5061048b611b89565b3480156107e557600080fd5b5061048b6107f4366004613cd0565b611b9b565b34801561080557600080fd5b5061048b610814366004613ff1565b611ba9565b34801561082557600080fd5b50610433611bdc565b34801561083a57600080fd5b506104cc61019c5481565b34801561085157600080fd5b5061048b61086036600461404a565b611bec565b34801561087157600080fd5b506104606c447e69651d841bd8d104bed49381565b34801561089257600080fd5b5061048b611cee565b3480156108a757600080fd5b506108b0611cfe565b604051610415979695949392919061409d565b3480156108cf57600080fd5b5061048b6108de366004613ff1565b611dc9565b3480156108ef57600080fd5b506033546001600160a01b0316610460565b34801561090d57600080fd5b5061048b61091c366004613cd0565b611dfc565b34801561092d57600080fd5b50610433611e0a565b34801561094257600080fd5b506104cc610951366004613cd0565b6101976020526000908152604090205481565b34801561097057600080fd5b50610460733af2a97414d1101e2107a70e7f33955da134630581565b34801561099857600080fd5b5061048b6109a7366004613d84565b611e22565b3480156109b857600080fd5b5061048b6109c736600461417a565b611e9f565b3480156109d857600080fd5b5061048b6109e7366004613cd0565b611f77565b3480156109f857600080fd5b5061019354610a0e90600160a01b900460ff1681565b6040516104159190614219565b61048b610a2936600461422c565b611f85565b348015610a3a57600080fd5b506104cc610a493660046142e3565b6101946020526000908152604090205481565b61048b610a6a366004614300565b6122e0565b348015610a7b57600080fd5b5061048b610a8a3660046142e3565b612321565b348015610a9b57600080fd5b50610a0e610aaa366004613cd0565b6101956020526000908152604090205460ff1681565b348015610acc57600080fd5b50610433610adb366004613cd0565b612357565b61048b610aee366004613cd0565b612388565b348015610aff57600080fd5b506104cc610b0e366004613dbd565b6101a26020526000908152604090205481565b348015610b2d57600080fd5b506104cc6101a15481565b348015610b4457600080fd5b5061046073ed5af388653567af2f388e6224dc7c4b3241c54481565b348015610b6c57600080fd5b5060fd546104cc565b348015610b8157600080fd5b5061048b610b90366004613cd0565b61246d565b348015610ba157600080fd5b506104cc61019b5481565b348015610bb857600080fd5b50610409610bc736600461437f565b61247b565b348015610bd857600080fd5b5061048b610be7366004613cd0565b6124b8565b348015610bf857600080fd5b5061048b610c07366004613dbd565b6124c6565b348015610c1857600080fd5b5061043361253f565b348015610c2d57600080fd5b506104cc610c3c366004613cd0565b6101a06020526000908152604090205481565b60006301ffc9a760e01b6001600160e01b031983161480610c8057506380ac58cd60e01b6001600160e01b03198316145b80610c9b5750635b5e139f60e01b6001600160e01b03198316145b92915050565b6060610cab61254f565b6002018054610cb9906143ad565b80601f0160208091040260200160405190810160405280929190818152602001828054610ce5906143ad565b8015610d325780601f10610d0757610100808354040283529160200191610d32565b820191906000526020600020905b815481529060010190602001808311610d1557829003601f168201915b5050505050905090565b6000610d4782612573565b610d5b57610d5b6333d1c03960e21b6125d3565b610d6361254f565b60009283526006016020525060409020546001600160a01b031690565b610d8c828260016125dd565b5050565b60006001610d9c61254f565b60010154610da861254f565b540303905090565b6000610dbb8261268e565b6001600160a01b039485169490915081168414610de157610de162a1148160e81b6125d3565b600080610ded84612751565b91509150610e128187610dfd3390565b6001600160a01b039081169116811491141790565b610e3457610e20863361247b565b610e3457610e34632ce44b5f60e11b6125d3565b610e418686866001612779565b8015610e4c57600082555b610e5461254f565b6001600160a01b0387166000908152600591909101602052604090208054600019019055610e8061254f565b6001600160a01b03861660008181526005929092016020526040909120805460010190554260a01b17600160e11b17610eb761254f565b60008681526004919091016020526040812091909155600160e11b84169003610f2d5760018401610ee661254f565b600082815260049190910160205260408120549003610f2b57610f0761254f565b548114610f2b5783610f1761254f565b600083815260049190910160205260409020555b505b6001600160a01b0385168481887fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a480600003610f7757610f77633a954ecd60e21b6125d3565b50505050505050565b610f8933610fd9565b610fae5760405162461bcd60e51b8152600401610fa5906143e1565b60405180910390fd5b6001600160a01b0391909116600090815260cb60205260409020805460ff1916911515919091179055565b6001600160a01b0316600090815260cb602052604090205460ff1690565b610fff6127fd565b611007612857565b565b611024838383604051806020016040528060008152506122e0565b505050565b60018061019354600160a01b900460ff16600281111561104b5761104b6141e5565b146110685760405162461bcd60e51b8152600401610fa590614407565b6110706128a9565b600061107c8380614432565b8080602002602001604051908101604052809392919081815260200183836020028082843760009201829052509394506110bd925050506020850185614432565b8080602002602001604051908101604052809392919081815260200183836020028082843760009201829052509394506110fe925050506040860186614432565b80806020026020016040519081016040528093929190818152602001838360200280828437600092018290525093945061113f925050506060870187614432565b808060200260200160405190810160405280939291908181526020018383602002808284376000920182905250939450611180925050506080880188614432565b8080602002602001604051908101604052809392919081815260200183836020028082843760009201829052509394506111c19250505060a0890189614432565b8080602002602001604051908101604052809392919081815260200183836020028082843760009201829052509394506112029250505060c08a018a614432565b8080602002602001604051908101604052809392919081815260200183836020028082843760009201829052509394506112439250505060e08b018b614432565b80806020026020016040519081016040528093929190818152602001838360200280828437600092018290525093945083925050505b89518110156113695760008a82815181106112965761129661447b565b6020026020010151905060008a83815181106112b4576112b461447b565b602002602001015190506112c7826128ef565b61019954600083815261019d60205260409020546112e69083906144a7565b111561132e5760405162461bcd60e51b815260206004820152601760248201527610dbcb535d5cd95d5b48195e18d959591cc81b1a5b5a5d604a1b6044820152606401610fa5565b600082815261019d60205260408120805483929061134d9084906144a7565b9091555061135d905081856144a7565b93505050600101611279565b5060005b875181101561145957600088828151811061138a5761138a61447b565b6020026020010151905060008883815181106113a8576113a861447b565b602002602001015190506113bb82612a51565b61019a54600083815261019e60205260409020546113da9083906144a7565b111561141e5760405162461bcd60e51b8152602060048201526013602482015272105e9d5ada48195e18d959591cc81b1a5b5a5d606a1b6044820152606401610fa5565b600082815261019e60205260408120805483929061143d9084906144a7565b9091555061144d905081856144a7565b9350505060010161136d565b5060005b855181101561155357600086828151811061147a5761147a61447b565b6020026020010151905060008683815181106114985761149861447b565b602002602001015190506114ab82612ba9565b61019b54600083815261019f60205260409020546114ca9083906144a7565b11156115185760405162461bcd60e51b815260206004820152601d60248201527f417a756b6920656c656d656e74616c2065786365656473206c696d69740000006044820152606401610fa5565b600082815261019f6020526040812080548392906115379084906144a7565b90915550611547905081856144a7565b9350505060010161145d565b5060005b835181101561164d5760008482815181106115745761157461447b565b6020026020010151905060008483815181106115925761159261447b565b602002602001015190506115a582612d0b565b61019c5460008381526101a060205260409020546115c49083906144a7565b11156116125760405162461bcd60e51b815260206004820152601d60248201527f417a756b6920656c656d656e74616c2065786365656473206c696d69740000006044820152606401610fa5565b60008281526101a06020526040812080548392906116319084906144a7565b90915550611641905081856144a7565b93505050600101611557565b5061167f81610194600060015b600281111561166b5761166b6141e5565b815260200190815260200160002054612e79565b6116893382612f06565b5050505050505050505050565b61169e6127fd565b6000816001600160a01b03164760405160006040518083038185875af1925050503d80600081146116eb576040519150601f19603f3d011682016040523d82523d6000602084013e6116f0565b606091505b5050905080610d8c5760405162461bcd60e51b815260206004820152600f60248201526e15da5d1a191c985dc819985a5b1959608a1b6044820152606401610fa5565b6000805160206148cc83398151915254610100900460ff16611768576000805160206148cc8339815191525460ff161561176c565b303b155b6117de5760405162461bcd60e51b815260206004820152603760248201527f455243373231415f5f496e697469616c697a61626c653a20636f6e747261637460448201527f20697320616c726561647920696e697469616c697a65640000000000000000006064820152608401610fa5565b6000805160206148cc83398151915254610100900460ff1615801561181a576000805160206148cc833981519152805461ffff19166101011790555b600054610100900460ff161580801561183a5750600054600160ff909116105b806118545750303b158015611854575060005460ff166001145b6118b75760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610fa5565b6000805460ff1916600117905580156118da576000805461ff0019166101001790555b6118e2612f9f565b6118ea612fce565b6119126040518060200160405280600081525060405180602001604052806000815250612ffd565b61191c888861302e565b61192461306c565b61192d866130af565b61193785856130d6565b61193f613118565b61194761313f565b61019380546001600160a81b0319166001600160a01b03851617905561019460205267013c3107490280007fac2681a0ffcdeb8d930437e36dc6669c17d1245fb57aa4cfab8f62b41ea51f818190557f431122e4fe9c44f5a319c6d2afd7cf7bcc21253a0483556b9b40b9255f70a15e819055600260008190527f4f2fafccb5d28f3aaff6cbdf8ff32db4167d35308651b7acedb7127f6ec061859190915561019681905561019981905561019a55600161019b81905561019c5560056101a1558015611a4e576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b508015610f775750506000805160206148cc833981519152805461ff00191690555050505050565b611a7e6127fd565b61019655565b6000610c9b8261268e565b611a976127fd565b806101946000846002811115611aaf57611aaf6141e5565b6002811115611ac057611ac06141e5565b81526020810191909152604001600020555050565b611add6127fd565b61019380546001600160a01b0319166001600160a01b0392909216919091179055565b611b0933610fd9565b611b255760405162461bcd60e51b8152600401610fa5906143e1565b60fd55565b60006001600160a01b038216611b4a57611b4a6323d3ad8160e21b6125d3565b6001600160401b03611b5a61254f565b6005016000846001600160a01b03166001600160a01b0316815260200190815260200160002054169050919050565b611b916127fd565b611007600061317c565b611ba36127fd565b61019c55565b611bb233610fd9565b611bce5760405162461bcd60e51b8152600401610fa5906143e1565b610130611024828483614502565b606061012f8054610cb9906143ad565b8282826000611bfa846131ce565b90506000611c078261324f565b90506000611c4b8286868080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061327c92505050565b610193549091506001600160a01b03808316911614611ca35760405162461bcd60e51b8152602060048201526014602482015273155b985d5d1a1bdc9a5e9959081c995c5d595cdd60621b6044820152606401610fa5565b611cb360408a0160208b016142e3565b8935600090815261019560205260409020805460ff19166001836002811115611cde57611cde6141e5565b0217905550505050505050505050565b611cf66127fd565b61100761313f565b6000606080600080600060606097546000801b148015611d1e5750609854155b611d625760405162461bcd60e51b81526020600482015260156024820152741152540dcc4c8e88155b9a5b9a5d1a585b1a5e9959605a1b6044820152606401610fa5565b50506040805180820182526011815270415a554b495f585f434f5f4d555345554d60781b6020808301919091528251808401845260058152640302e312e360dc1b8183015283516000808252928101909452600f60f81b9992985096504695503094509250565b611dd233610fd9565b611dee5760405162461bcd60e51b8152600401610fa5906143e1565b61012f611024828483614502565b611e046127fd565b6101a155565b6060611e1461254f565b6003018054610cb9906143ad565b80611e2b61254f565b336000818152600792909201602090815260408084206001600160a01b03881680865290835293819020805460ff19169515159590951790945592518415158152919290917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b611ea833610fd9565b611ec45760405162461bcd60e51b8152600401610fa5906143e1565b82818114611f145760405162461bcd60e51b815260206004820152601760248201527f41646d696e206d696e743a2062616420726571756573740000000000000000006044820152606401610fa5565b60005b81811015611f6f57611f67868683818110611f3457611f3461447b565b9050602002016020810190611f499190613dbd565b858584818110611f5b57611f5b61447b565b905060200201356132a0565b600101611f17565b505050505050565b611f7f6127fd565b61019b55565b83838383831561209d576000611f9a846132aa565b90506000611fa78261324f565b90506000611feb8286868080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061327c92505050565b610193549091506001600160a01b038083169116146120435760405162461bcd60e51b8152602060048201526014602482015273155b985d5d1a1bdc9a5e9959081c995c5d595cdd60621b6044820152606401610fa5565b336120516020880188613dbd565b6001600160a01b0316146120995760405162461bcd60e51b815260206004820152600f60248201526e125b9d985b1a59081858d8dbdd5b9d608a1b6044820152606401610fa5565b5050505b60008061019354600160a01b900460ff1660028111156120bf576120bf6141e5565b146120dc5760405162461bcd60e51b8152600401610fa590614407565b6120e46128a9565b6000805b8d8110156121d55760008f8f838181106121045761210461447b565b90506020020135905060008e8e848181106121215761212161447b565b905060200201359050612133826128ef565b61019654600083815261019760205260409020546121529083906144a7565b111561219a5760405162461bcd60e51b815260206004820152601760248201527610dbcb535d5cd95d5b48195e18d959591cc81b1a5b5a5d604a1b6044820152606401610fa5565b60008281526101976020526040812080548392906121b99084906144a7565b909155506121c9905081856144a7565b935050506001016120e8565b503360009081526101986020908152604090912054908a0135906121fa908c906144a7565b11156122405760405162461bcd60e51b81526020600482015260156024820152741058d8dbdd5b9d08195e18d959591cc81b1a5b5a5d605a1b6044820152606401610fa5565b3360009081526101986020526040812080548c92906122609084906144a7565b9091555061227090508a826144a7565b90506122818161019460008061165a565b61228e60208a018a613dbd565b6001600160a01b03167f10fcc92ce3ae296b6d2813de054ab2cf2d6dd59a1eed235681bc8bf6c36a5cb7826040516122c891815260200190565b60405180910390a25050505050505050505050505050565b6122eb848484610db0565b6001600160a01b0383163b1561231b5761230784848484613307565b61231b5761231b6368d2bf6b60e11b6125d3565b50505050565b6123296127fd565b610193805482919060ff60a01b1916600160a01b83600281111561234f5761234f6141e5565b021790555050565b606061236282612573565b61237f57604051630a14c4b560e41b815260040160405180910390fd5b610c9b826133e9565b60028061019354600160a01b900460ff1660028111156123aa576123aa6141e5565b146123c75760405162461bcd60e51b8152600401610fa590614407565b6123cf6128a9565b6101a1543360009081526101a260205260409020546123ef9084906144a7565b111561242d5760405162461bcd60e51b815260206004820152600d60248201526c115e18d959591cc81b1a5b5a5d609a1b6044820152606401610fa5565b3360009081526101a260205260408120805484929061244d9084906144a7565b909155506124639050826101946000600261165a565b610d8c3383612f06565b6124756127fd565b61019955565b600061248561254f565b6001600160a01b039384166000908152600791909101602090815260408083209490951682529290925250205460ff1690565b6124c06127fd565b61019a55565b6124ce6127fd565b6001600160a01b0381166125335760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610fa5565b61253c8161317c565b50565b60606101308054610cb9906143ad565b7f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c4090565b6000816001116125ce5761258561254f565b548210156125ce5760005b61259861254f565b6000848152600491909101602052604081205491508190036125c4576125bd836145c1565b9250612590565b600160e01b161590505b919050565b8060005260046000fd5b60006125e883611a84565b90508180156126005750336001600160a01b03821614155b156126235761260f813361247b565b612623576126236367d9dca160e11b6125d3565b8361262c61254f565b6000858152600691909101602052604080822080546001600160a01b0319166001600160a01b0394851617905551859287811692908516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259190a450505050565b600081600111612741576126a061254f565b6000838152600491909101602052604090205490508060000361272e576126c561254f565b5482106126dc576126dc636f96cda160e11b6125d3565b6126e461254f565b6000199092016000818152600493909301602052604090922054905080156126dc57600160e01b811660000361271957919050565b612729636f96cda160e11b6125d3565b6126dc565b600160e01b811660000361274157919050565b6125ce636f96cda160e11b6125d3565b600080600061275e61254f565b60009485526006016020525050604090912080549092909150565b6001600160a01b03841615806127b3575060016000838152610195602052604090205460ff1660028111156127b0576127b06141e5565b14155b6127f85760405162461bcd60e51b8152602060048201526016602482015275546f6b656e206e6f74207472616e7366657261626c6560501b6044820152606401610fa5565b61231b565b6033546001600160a01b031633146110075760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610fa5565b61285f613422565b6065805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b60655460ff16156110075760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610fa5565b6040516331a9108f60e11b81526004810182905260009073e166a1fc32647ba4ec271b753cc56b5f0870d23290636352211e90602401602060405180830381865afa158015612942573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061296691906145d8565b9050336001600160a01b0382161480612a055750604051632e7cda1d60e21b81526c447e69651d841bd8d104bed4939063b9f36874906129c4903390859073e166a1fc32647ba4ec271b753cc56b5f0870d2329088906004016145f5565b602060405180830381865afa1580156129e1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a059190614626565b610d8c5760405162461bcd60e51b815260206004820152601760248201527f496e76616c696420436f2d4d757365756d206f776e65720000000000000000006044820152606401610fa5565b6040516331a9108f60e11b81526004810182905260009073ed5af388653567af2f388e6224dc7c4b3241c54490636352211e90602401602060405180830381865afa158015612aa4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ac891906145d8565b9050336001600160a01b0382161480612b675750604051632e7cda1d60e21b81526c447e69651d841bd8d104bed4939063b9f3687490612b26903390859073ed5af388653567af2f388e6224dc7c4b3241c5449088906004016145f5565b602060405180830381865afa158015612b43573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b679190614626565b610d8c5760405162461bcd60e51b815260206004820152601360248201527224b73b30b634b21020bd3ab5b49037bbb732b960691b6044820152606401610fa5565b6040516331a9108f60e11b81526004810182905260009073b6a37b5d14d502c3ab0ae6f3a0e058bc9517786e90636352211e90602401602060405180830381865afa158015612bfc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c2091906145d8565b9050336001600160a01b0382161480612cbf5750604051632e7cda1d60e21b81526c447e69651d841bd8d104bed4939063b9f3687490612c7e903390859073b6a37b5d14d502c3ab0ae6f3a0e058bc9517786e9088906004016145f5565b602060405180830381865afa158015612c9b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612cbf9190614626565b610d8c5760405162461bcd60e51b815260206004820152601e60248201527f496e76616c696420417a756b6920656c656d656e74616c73206f776e657200006044820152606401610fa5565b6040516331a9108f60e11b815260048101829052600090733af2a97414d1101e2107a70e7f33955da134630590636352211e90602401602060405180830381865afa158015612d5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d8291906145d8565b9050336001600160a01b0382161480612e215750604051632e7cda1d60e21b81526c447e69651d841bd8d104bed4939063b9f3687490612de09033908590733af2a97414d1101e2107a70e7f33955da13463059088906004016145f5565b602060405180830381865afa158015612dfd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e219190614626565b610d8c5760405162461bcd60e51b815260206004820152602360248201527f496e76616c696420417a756b6920656c656d656e74616c206265616e7a206f776044820152623732b960e91b6064820152608401610fa5565b6000612e858284614643565b905080341015612ec85760405162461bcd60e51b815260206004820152600e60248201526d09cdee840cadcdeeaced0408aa8960931b6044820152606401610fa5565b8034111561102457336108fc612ede833461465a565b6040518115909202916000818181858888f1935050505015801561231b573d6000803e3d6000fd5b8060fd5481612f1361346b565b612f1d91906144a7565b1115612f5c5760405162461bcd60e51b815260206004820152600e60248201526d4578636565647320737570706c7960901b6044820152606401610fa5565b323314612f955760405162461bcd60e51b81526020600482015260076024820152664e6f20626f747360c81b6044820152606401610fa5565b611024838361347a565b600054610100900460ff16612fc65760405162461bcd60e51b8152600401610fa59061466d565b611007613494565b600054610100900460ff16612ff55760405162461bcd60e51b8152600401610fa59061466d565b6110076134c4565b600054610100900460ff166130245760405162461bcd60e51b8152600401610fa59061466d565b610d8c82826134f7565b6000805160206148cc83398151915254610100900460ff166130625760405162461bcd60e51b8152600401610fa5906146b8565b610d8c8282613546565b600054610100900460ff166130935760405162461bcd60e51b8152600401610fa59061466d565b33600090815260cb60205260409020805460ff19166001179055565b600054610100900460ff16611b255760405162461bcd60e51b8152600401610fa59061466d565b600054610100900460ff166130fd5760405162461bcd60e51b8152600401610fa59061466d565b61012f61310a838261470c565b50610130611024828261470c565b600054610100900460ff166110075760405162461bcd60e51b8152600401610fa59061466d565b6131476128a9565b6065805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25861288c3390565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60007fcb47c620e4bac89d873a47d71176d24b42a701da50e4400c4fc5eee71211be71823561320360408501602086016142e3565b6002811115613214576132146141e5565b60408051602081019490945283019190915260ff1660608201526080015b604051602081830303815290604052805190602001209050919050565b6000610c9b61325c6135b9565b8360405161190160f01b8152600281019290925260228201526042902090565b600080600061328b85856135c3565b9150915061329881613608565b509392505050565b610d8c8282612f06565b60007f904116aebab2081d38d8cae3b4fbc5c844749e354a61c1001bc4c71f06596cb26132da6020840184613dbd565b604080516020818101949094526001600160a01b0390921690820152908301356060820152608001613232565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a029061333c9033908990889088906004016147cb565b6020604051808303816000875af1925050508015613377575060408051601f3d908101601f1916820190925261337491810190614808565b60015b6133cc573d8080156133a5576040519150601f19603f3d011682016040523d82523d6000602084013e6133aa565b606091505b5080516000036133c4576133c46368d2bf6b60e11b6125d3565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050949350505050565b606061012f6133f783613752565b61013060405160200161340c93929190614898565b6040516020818303038152906040529050919050565b60655460ff166110075760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610fa5565b6000613475610d90565b905090565b610d8c8282604051806020016040528060008152506137e4565b600054610100900460ff166134bb5760405162461bcd60e51b8152600401610fa59061466d565b6110073361317c565b600054610100900460ff166134eb5760405162461bcd60e51b8152600401610fa59061466d565b6065805460ff19169055565b600054610100900460ff1661351e5760405162461bcd60e51b8152600401610fa59061466d565b609961352a838261470c565b50609a613537828261470c565b50506000609781905560985550565b6000805160206148cc83398151915254610100900460ff1661357a5760405162461bcd60e51b8152600401610fa5906146b8565b8161358361254f565b60020190613591908261470c565b508061359b61254f565b600301906135a9908261470c565b5060016135b461254f565b555050565b6000613475613858565b60008082516041036135f95760208301516040840151606085015160001a6135ed878285856138cc565b94509450505050613601565b506000905060025b9250929050565b600081600481111561361c5761361c6141e5565b036136245750565b6001816004811115613638576136386141e5565b036136855760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610fa5565b6002816004811115613699576136996141e5565b036136e65760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610fa5565b60038160048111156136fa576136fa6141e5565b0361253c5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610fa5565b6060600061375f83613990565b60010190506000816001600160401b0381111561377e5761377e613e15565b6040519080825280601f01601f1916602001820160405280156137a8576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a85049450846137b257509392505050565b6137ee8383613a68565b6001600160a01b0383163b1561102457600061380861254f565b5490508281035b6138226000868380600101945086613307565b613836576138366368d2bf6b60e11b6125d3565b81811061380f578161384661254f565b541461385157600080fd5b5050505050565b60007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f613883613b69565b61388b613be8565b60408051602081019490945283019190915260608201524660808201523060a082015260c00160405160208183030381529060405280519060200120905090565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156139035750600090506003613987565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015613957573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661398057600060019250925050613987565b9150600090505b94509492505050565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106139cf5772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef810000000083106139fb576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc100008310613a1957662386f26fc10000830492506010015b6305f5e1008310613a31576305f5e100830492506008015b6127108310613a4557612710830492506004015b60648310613a57576064830492506002015b600a8310610c9b5760010192915050565b6000613a7261254f565b5490506000829003613a8e57613a8e63b562e8dd60e01b6125d3565b613a9b6000848385612779565b6001600160a01b0383164260a01b6001841460e11b1717613aba61254f565b60008381526004919091016020526040902055680100000000000000018202613ae161254f565b6001600160a01b0385166000818152600592909201602052604082208054909301909255819003613b1b57613b1b622e076360e81b6125d3565b818301825b808360007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a4818160010191508103613b205781613b5f61254f565b5550611024915050565b600080613b9a604080518082019091526011815270415a554b495f585f434f5f4d555345554d60781b602082015290565b805190915015613bb1578051602090910120919050565b6097548015613bc05792915050565b7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a4709250505090565b600080613c0d6040805180820190915260058152640302e312e360dc1b602082015290565b805190915015613c24578051602090910120919050565b6098548015613bc05792915050565b6001600160e01b03198116811461253c57600080fd5b600060208284031215613c5b57600080fd5b8135613c6681613c33565b9392505050565b60005b83811015613c88578181015183820152602001613c70565b50506000910152565b60008151808452613ca9816020860160208601613c6d565b601f01601f19169290920160200192915050565b602081526000613c666020830184613c91565b600060208284031215613ce257600080fd5b5035919050565b6001600160a01b038116811461253c57600080fd5b80356125ce81613ce9565b60008060408385031215613d1c57600080fd5b8235613d2781613ce9565b946020939093013593505050565b600080600060608486031215613d4a57600080fd5b8335613d5581613ce9565b92506020840135613d6581613ce9565b929592945050506040919091013590565b801515811461253c57600080fd5b60008060408385031215613d9757600080fd5b8235613da281613ce9565b91506020830135613db281613d76565b809150509250929050565b600060208284031215613dcf57600080fd5b8135613c6681613ce9565b600060208284031215613dec57600080fd5b81356001600160401b03811115613e0257600080fd5b82016101008185031215613c6657600080fd5b634e487b7160e01b600052604160045260246000fd5b60006001600160401b0380841115613e4557613e45613e15565b604051601f8501601f19908116603f01168101908282118183101715613e6d57613e6d613e15565b81604052809350858152868686011115613e8657600080fd5b858560208301376000602087830101525050509392505050565b600082601f830112613eb157600080fd5b613c6683833560208501613e2b565b60008060008060008060c08789031215613ed957600080fd5b86356001600160401b0380821115613ef057600080fd5b613efc8a838b01613ea0565b97506020890135915080821115613f1257600080fd5b613f1e8a838b01613ea0565b9650604089013595506060890135915080821115613f3b57600080fd5b613f478a838b01613ea0565b94506080890135915080821115613f5d57600080fd5b50613f6a89828a01613ea0565b925050613f7960a08801613cfe565b90509295509295509295565b6003811061253c57600080fd5b60008060408385031215613fa557600080fd5b8235613d2781613f85565b60008083601f840112613fc257600080fd5b5081356001600160401b03811115613fd957600080fd5b60208301915083602082850101111561360157600080fd5b6000806020838503121561400457600080fd5b82356001600160401b0381111561401a57600080fd5b61402685828601613fb0565b90969095509350505050565b60006040828403121561404457600080fd5b50919050565b60008060006060848603121561405f57600080fd5b6140698585614032565b925060408401356001600160401b0381111561408457600080fd5b61409086828701613fb0565b9497909650939450505050565b60ff60f81b881681526000602060e060208401526140be60e084018a613c91565b83810360408501526140d0818a613c91565b606085018990526001600160a01b038816608086015260a0850187905284810360c08601528551808252602080880193509091019060005b8181101561412457835183529284019291840191600101614108565b50909c9b505050505050505050505050565b60008083601f84011261414857600080fd5b5081356001600160401b0381111561415f57600080fd5b6020830191508360208260051b850101111561360157600080fd5b6000806000806040858703121561419057600080fd5b84356001600160401b03808211156141a757600080fd5b6141b388838901614136565b909650945060208701359150808211156141cc57600080fd5b506141d987828801614136565b95989497509550505050565b634e487b7160e01b600052602160045260246000fd5b6003811061253c57634e487b7160e01b600052602160045260246000fd5b60208101614226836141fb565b91905290565b60008060008060008060008060c0898b03121561424857600080fd5b88356001600160401b038082111561425f57600080fd5b61426b8c838d01614136565b909a50985060208b013591508082111561428457600080fd5b6142908c838d01614136565b909850965060408b013595508691506142ac8c60608d01614032565b945060a08b01359150808211156142c257600080fd5b506142cf8b828c01613fb0565b999c989b5096995094979396929594505050565b6000602082840312156142f557600080fd5b8135613c6681613f85565b6000806000806080858703121561431657600080fd5b843561432181613ce9565b9350602085013561433181613ce9565b92506040850135915060608501356001600160401b0381111561435357600080fd5b8501601f8101871361436457600080fd5b61437387823560208401613e2b565b91505092959194509250565b6000806040838503121561439257600080fd5b823561439d81613ce9565b91506020830135613db281613ce9565b600181811c908216806143c157607f821691505b60208210810361404457634e487b7160e01b600052602260045260246000fd5b6020808252600c908201526b2737ba1030b71030b236b4b760a11b604082015260600190565b602080825260119082015270141a185cd9481b9bdd08195b98589b1959607a1b604082015260600190565b6000808335601e1984360301811261444957600080fd5b8301803591506001600160401b0382111561446357600080fd5b6020019150600581901b360382131561360157600080fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b80820180821115610c9b57610c9b614491565b601f821115611024576000816000526020600020601f850160051c810160208610156144e35750805b601f850160051c820191505b81811015611f6f578281556001016144ef565b6001600160401b0383111561451957614519613e15565b61452d8361452783546143ad565b836144ba565b6000601f84116001811461456157600085156145495750838201355b600019600387901b1c1916600186901b178355613851565b600083815260209020601f19861690835b828110156145925786850135825560209485019460019092019101614572565b50868210156145af5760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b6000816145d0576145d0614491565b506000190190565b6000602082840312156145ea57600080fd5b8151613c6681613ce9565b6001600160a01b03948516815292841660208401529216604082015260608101919091526000608082015260a00190565b60006020828403121561463857600080fd5b8151613c6681613d76565b8082028115828204841417610c9b57610c9b614491565b81810381811115610c9b57610c9b614491565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b60208082526034908201527f455243373231415f5f496e697469616c697a61626c653a20636f6e7472616374604082015273206973206e6f7420696e697469616c697a696e6760601b606082015260800190565b81516001600160401b0381111561472557614725613e15565b6147398161473384546143ad565b846144ba565b602080601f83116001811461476e57600084156147565750858301515b600019600386901b1c1916600185901b178555611f6f565b600085815260208120601f198616915b8281101561479d5788860151825594840194600190910190840161477e565b50858210156147bb5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906147fe90830184613c91565b9695505050505050565b60006020828403121561481a57600080fd5b8151613c6681613c33565b60008154614832816143ad565b6001828116801561484a576001811461485f5761488e565b60ff198416875282151583028701945061488e565b8560005260208060002060005b858110156148855781548a82015290840190820161486c565b50505082870194505b5050505092915050565b60006148a48286614825565b84516148b4818360208901613c6d565b6148c081830186614825565b97965050505050505056feee151c8401928dc223602bb187aff91b9a56c7cae5476ef1b3287b085a16c85fa26469706673582212202b41b456f4a72b539551efa8791952567a3c217d0bffef2cd5c66d5283d88e6264736f6c63430008180033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 27 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.