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 | 20419124 | 80 days ago | IN | 0 ETH | 0.03849074 |
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_BEANZ = IERC721Upgradeable(0x306b1ea3ecdf94aB739F1910bbda052Ed4A9f949); IERC721Upgradeable public constant AZUKI_ELEMENTALS = IERC721Upgradeable(0xB6a37b5d14D502c3Ab0Ae6f3a0E058BC9517786e); IERC721Upgradeable public constant AZUKI_ELEMENTAL_BEANZ = IERC721Upgradeable(0x3Af2A97414d1101E2107a70E7F33955da1346305); IERC721Upgradeable public constant ARC_STELLARS = IERC721Upgradeable(0xf4A7C105CFdc6aaBe9AE65bDF2d0dF0A567A7aDE); 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; uint256 public saleOneArcStellarsLimit; mapping(uint256 => uint256) public saleOneArcStellarsBalances; uint256 public reservedAmount; uint256 public saleOneBeanzLimit; mapping(uint256 => uint256) public saleOneBeanzBalances; 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; uint256[] arcStellarsIds; uint256[] arcStellarsAmounts; uint256[] beanzIds; uint256[] beanzAmounts; } 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; saleOneArcStellarsLimit = 2; 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[] memory arcStellarsIds = request_.arcStellarsIds; uint256[] memory arcStellarsAmounts = request_.arcStellarsAmounts; uint256[] memory beanzIds = request_.beanzIds; uint256[] memory beanzAmounts = request_.beanzAmounts; 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; } for (uint256 i = 0; i < arcStellarsIds.length; i++) { uint256 arcStellarsId = arcStellarsIds[i]; uint256 arcStellarsAmount = arcStellarsAmounts[i]; _validateArcStellarsOwnership(arcStellarsId); require( saleOneArcStellarsBalances[arcStellarsId] + arcStellarsAmount <= saleOneArcStellarsLimit, "ARC Stellars exceeds limit" ); saleOneArcStellarsBalances[arcStellarsId] += arcStellarsAmount; amount += arcStellarsAmount; } for (uint256 i = 0; i < beanzIds.length; i++) { uint256 beanzId = beanzIds[i]; uint256 beanzAmount = beanzAmounts[i]; _validateBeanzOwnership(beanzId); require( saleOneBeanzBalances[beanzId] + beanzAmount <= saleOneBeanzLimit, "Beanz exceeds limit" ); saleOneBeanzBalances[beanzId] += beanzAmount; amount += beanzAmount; } require(reservedAmount + amount <= _maxSupply, "Exceeds supply"); reservedAmount += amount; _handlePayment(amount, price[Phase.SaleOne]); emit Presale(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_); emit Presale(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 setSaleOneBeanzLimit( uint256 saleOneBeanzLimit_ ) external onlyOwner { saleOneBeanzLimit = saleOneBeanzLimit_; } function setSaleOneCoMuseumLimit( uint256 saleOneCoMuseumLimit_ ) external onlyOwner { saleOneCoMuseumLimit = saleOneCoMuseumLimit_; } function setSaleOneStellarLimit( uint256 saleOneArcStellarsLimit_ ) external onlyOwner { saleOneArcStellarsLimit = saleOneArcStellarsLimit_; } 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 _validateBeanzOwnership(uint256 id_) private view { address owner = AZUKI_BEANZ.ownerOf(id_); require( msg.sender == owner || DELEGATE_REGISTRY.checkDelegateForERC721( msg.sender, owner, address(AZUKI_BEANZ), id_, "" ), "Invalid Beanz 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 _validateArcStellarsOwnership(uint256 id_) private view { address owner = ARC_STELLARS.ownerOf(id_); require( msg.sender == owner || DELEGATE_REGISTRY.checkDelegateForERC721( msg.sender, owner, address(ARC_STELLARS), id_, "" ), "Invalid ARC Stellars 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 setReservedAmount(uint256 reservedAmount_) external onlyOwner { reservedAmount = reservedAmount_; } 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":"ARC_STELLARS","outputs":[{"internalType":"contract IERC721Upgradeable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"AZUKI","outputs":[{"internalType":"contract IERC721Upgradeable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"AZUKI_BEANZ","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":[],"name":"reservedAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"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":"uint256[]","name":"arcStellarsIds","type":"uint256[]"},{"internalType":"uint256[]","name":"arcStellarsAmounts","type":"uint256[]"},{"internalType":"uint256[]","name":"beanzIds","type":"uint256[]"},{"internalType":"uint256[]","name":"beanzAmounts","type":"uint256[]"}],"internalType":"struct NFTSale.SaleOneRequest","name":"request_","type":"tuple"}],"name":"saleOne","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"saleOneArcStellarsBalances","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"saleOneArcStellarsLimit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","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":"saleOneBeanzBalances","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"saleOneBeanzLimit","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":"reservedAmount_","type":"uint256"}],"name":"setReservedAmount","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":"saleOneBeanzLimit_","type":"uint256"}],"name":"setSaleOneBeanzLimit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"saleOneCoMuseumLimit_","type":"uint256"}],"name":"setSaleOneCoMuseumLimit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"saleOneArcStellarsLimit_","type":"uint256"}],"name":"setSaleOneStellarLimit","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
608060405234801561001057600080fd5b506151a1806100206000396000f3fe6080604052600436106104525760003560e01c80638286eee21161023f578063b7fafcd711610139578063d2c8ed4c116100b6578063f29b4fbc1161007a578063f29b4fbc14610d74578063f2fde38b14610d94578063f7073c3a14610db4578063f92c45b714610dc9578063ff1473a814610de057600080fd5b8063d2c8ed4c14610ce0578063d5abeb0114610d08578063de90871f14610d1d578063e7ebdca614610d3d578063e985e9c514610d5457600080fd5b8063c87b56dd116100fd578063c87b56dd14610c40578063c9672e2614610c60578063cbccdec314610c73578063cc5dbcf214610ca1578063cd1f5a2914610cc957600080fd5b8063b7fafcd714610b80578063b88d4fde14610bae578063bde750fb14610bc1578063c03afb5914610bef578063c13085db14610c0f57600080fd5b806395d89b41116101c7578063a49340cc1161018b578063a49340cc14610ad6578063a9a1d6b014610af6578063b1c9fe6e14610b16578063b2caf79014610b45578063b7e08d4114610b6d57600080fd5b806395d89b4114610a1d5780639831ef2a14610a3257806398ac859e14610a605780639e7b40d614610a88578063a22cb46514610ab657600080fd5b806385cb593b1161020e57806385cb593b146109885780638692810c146109a85780638da5cb5b146109c85780638e8a07b3146109e6578063910354c2146109fd57600080fd5b80638286eee2146109135780638456cb591461093457806384b0196e14610949578063857b9bd41461097157600080fd5b8063481b86ac116103505780636e820527116102d857806375d5ae9f1161029c57806375d5ae9f1461088757806375dadb32146108a7578063782312a3146108bc5780637c5b35a3146108d35780637fcf1af5146108f357600080fd5b80636e820527146107e45780636f8b44b01461081257806370a0823114610832578063715018a61461085257806373af7a401461086757600080fd5b80635c975abb1161031f5780635c975abb1461074c5780635eff75c1146107645780636352211e146107845780636a00670b146107a45780636c19e783146107c457600080fd5b8063481b86ac146106c75780634bf47ebd146106de57806351cff8d91461070c5780635bf6846e1461072c57600080fd5b8063238ac933116103de5780632df507be116103a25780632df507be1461061b5780633c80c1d1146106495780633d8f833d146106775780633f4ba83a1461069f57806342842e0e146106b457600080fd5b8063238ac9331461059057806323b872dd146105b1578063240ff27f146105c457806324d7806c146105e45780632cb29a0d1461060457600080fd5b8063096cca7d11610425578063096cca7d146104fb5780631429fbe41461052357806315720c5f14610548578063170e17361461055b57806318160ddd1461057b57600080fd5b806301ffc9a71461045757806306fdde031461048c578063081812fc146104ae578063095ea7b3146104e6575b600080fd5b34801561046357600080fd5b506104776104723660046144c9565b610e0e565b60405190151581526020015b60405180910390f35b34801561049857600080fd5b506104a1610e60565b604051610483919061453d565b3480156104ba57600080fd5b506104ce6104c9366004614550565b610efb565b6040516001600160a01b039091168152602001610483565b6104f96104f4366004614589565b610f3f565b005b34801561050757600080fd5b506104ce73e166a1fc32647ba4ec271b753cc56b5f0870d23281565b34801561052f57600080fd5b5061053a6101965481565b604051908152602001610483565b6104f96105563660046145b5565b610f4f565b34801561056757600080fd5b506104f9610576366004614550565b611963565b34801561058757600080fd5b5061053a611971565b34801561059c57600080fd5b50610193546104ce906001600160a01b031681565b6104f96105bf3660046145f0565b611991565b3480156105d057600080fd5b506104f96105df36600461463f565b611b61565b3480156105f057600080fd5b506104776105ff366004614678565b611bb1565b34801561061057600080fd5b5061053a6101995481565b34801561062757600080fd5b5061053a610636366004614550565b61019d6020526000908152604090205481565b34801561065557600080fd5b5061053a610664366004614678565b6101986020526000908152604090205481565b34801561068357600080fd5b506104ce73b6a37b5d14d502c3ab0ae6f3a0e058bc9517786e81565b3480156106ab57600080fd5b506104f9611bcf565b6104f96106c23660046145f0565b611be1565b3480156106d357600080fd5b5061053a61019a5481565b3480156106ea57600080fd5b5061053a6106f9366004614550565b61019e6020526000908152604090205481565b34801561071857600080fd5b506104f9610727366004614678565b611c01565b34801561073857600080fd5b506104f9610747366004614740565b611c9e565b34801561075857600080fd5b5060655460ff16610477565b34801561077057600080fd5b506104f961077f366004614550565b611fe7565b34801561079057600080fd5b506104ce61079f366004614550565b611ff5565b3480156107b057600080fd5b506104f96107bf366004614812565b612000565b3480156107d057600080fd5b506104f96107df366004614678565b612046565b3480156107f057600080fd5b5061053a6107ff366004614550565b61019f6020526000908152604090205481565b34801561081e57600080fd5b506104f961082d366004614550565b612071565b34801561083e57600080fd5b5061053a61084d366004614678565b61209b565b34801561085e57600080fd5b506104f96120fa565b34801561087357600080fd5b506104f9610882366004614550565b61210c565b34801561089357600080fd5b506104f96108a2366004614871565b61211a565b3480156108b357600080fd5b506104a161214d565b3480156108c857600080fd5b5061053a61019c5481565b3480156108df57600080fd5b506104f96108ee366004614550565b61215d565b3480156108ff57600080fd5b506104f961090e3660046148ca565b61216b565b34801561091f57600080fd5b506104ce6c447e69651d841bd8d104bed49381565b34801561094057600080fd5b506104f961226d565b34801561095557600080fd5b5061095e61227d565b604051610483979695949392919061491d565b34801561097d57600080fd5b5061053a6101a65481565b34801561099457600080fd5b506104f96109a3366004614871565b612348565b3480156109b457600080fd5b506104f96109c3366004614550565b61237b565b3480156109d457600080fd5b506033546001600160a01b03166104ce565b3480156109f257600080fd5b5061053a6101a35481565b348015610a0957600080fd5b506104f9610a18366004614550565b612389565b348015610a2957600080fd5b506104a1612397565b348015610a3e57600080fd5b5061053a610a4d366004614550565b6101976020526000908152604090205481565b348015610a6c57600080fd5b506104ce733af2a97414d1101e2107a70e7f33955da134630581565b348015610a9457600080fd5b5061053a610aa3366004614550565b6101a76020526000908152604090205481565b348015610ac257600080fd5b506104f9610ad136600461463f565b6123af565b348015610ae257600080fd5b506104f9610af13660046149fa565b61242c565b348015610b0257600080fd5b506104f9610b11366004614550565b612504565b348015610b2257600080fd5b5061019354610b3890600160a01b900460ff1681565b6040516104839190614a99565b348015610b5157600080fd5b506104ce73f4a7c105cfdc6aabe9ae65bdf2d0df0a567a7ade81565b6104f9610b7b366004614aac565b612512565b348015610b8c57600080fd5b5061053a610b9b366004614b63565b6101946020526000908152604090205481565b6104f9610bbc366004614b80565b61286d565b348015610bcd57600080fd5b5061053a610bdc366004614550565b6101a46020526000908152604090205481565b348015610bfb57600080fd5b506104f9610c0a366004614b63565b6128ae565b348015610c1b57600080fd5b50610b38610c2a366004614550565b6101956020526000908152604090205460ff1681565b348015610c4c57600080fd5b506104a1610c5b366004614550565b6128e4565b6104f9610c6e366004614550565b612915565b348015610c7f57600080fd5b5061053a610c8e366004614678565b6101a26020526000908152604090205481565b348015610cad57600080fd5b506104ce73306b1ea3ecdf94ab739f1910bbda052ed4a9f94981565b348015610cd557600080fd5b5061053a6101a15481565b348015610cec57600080fd5b506104ce73ed5af388653567af2f388e6224dc7c4b3241c54481565b348015610d1457600080fd5b5060fd5461053a565b348015610d2957600080fd5b506104f9610d38366004614550565b612a33565b348015610d4957600080fd5b5061053a61019b5481565b348015610d6057600080fd5b50610477610d6f366004614bff565b612a41565b348015610d8057600080fd5b506104f9610d8f366004614550565b612a7e565b348015610da057600080fd5b506104f9610daf366004614678565b612a8c565b348015610dc057600080fd5b506104a1612b05565b348015610dd557600080fd5b5061053a6101a55481565b348015610dec57600080fd5b5061053a610dfb366004614550565b6101a06020526000908152604090205481565b60006301ffc9a760e01b6001600160e01b031983161480610e3f57506380ac58cd60e01b6001600160e01b03198316145b80610e5a5750635b5e139f60e01b6001600160e01b03198316145b92915050565b6060610e6a612b15565b6002018054610e7890614c2d565b80601f0160208091040260200160405190810160405280929190818152602001828054610ea490614c2d565b8015610ef15780601f10610ec657610100808354040283529160200191610ef1565b820191906000526020600020905b815481529060010190602001808311610ed457829003601f168201915b5050505050905090565b6000610f0682612b39565b610f1a57610f1a6333d1c03960e21b612b99565b610f22612b15565b60009283526006016020525060409020546001600160a01b031690565b610f4b82826001612ba3565b5050565b60018061019354600160a01b900460ff166002811115610f7157610f71614a65565b14610f975760405162461bcd60e51b8152600401610f8e90614c61565b60405180910390fd5b610f9f612c54565b6000610fab8380614c8c565b808060200260200160405190810160405280939291908181526020018383602002808284376000920182905250939450610fec925050506020850185614c8c565b80806020026020016040519081016040528093929190818152602001838360200280828437600092018290525093945061102d925050506040860186614c8c565b80806020026020016040519081016040528093929190818152602001838360200280828437600092018290525093945061106e925050506060870187614c8c565b8080602002602001604051908101604052809392919081815260200183836020028082843760009201829052509394506110af925050506080880188614c8c565b8080602002602001604051908101604052809392919081815260200183836020028082843760009201829052509394506110f09250505060a0890189614c8c565b8080602002602001604051908101604052809392919081815260200183836020028082843760009201829052509394506111319250505060c08a018a614c8c565b8080602002602001604051908101604052809392919081815260200183836020028082843760009201829052509394506111729250505060e08b018b614c8c565b8080602002602001604051908101604052809392919081815260200183836020028082843760009201829052509394506111b4925050506101008c018c614c8c565b8080602002602001604051908101604052809392919081815260200183836020028082843760009201829052509394506111f6925050506101208d018d614c8c565b808060200260200160405190810160405280939291908181526020018383602002808284376000920182905250939450611238925050506101408e018e614c8c565b80806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f82011690508083019250505050505050905060008d80610160019061128d9190614c8c565b80806020026020016040519081016040528093929190818152602001838360200280828437600092018290525093945083925050505b8d518110156113b35760008e82815181106112e0576112e0614cd5565b6020026020010151905060008e83815181106112fe576112fe614cd5565b6020026020010151905061131182612c9a565b61019954600083815261019d6020526040902054611330908390614d01565b11156113785760405162461bcd60e51b815260206004820152601760248201527610dbcb535d5cd95d5b48195e18d959591cc81b1a5b5a5d604a1b6044820152606401610f8e565b600082815261019d602052604081208054839290611397908490614d01565b909155506113a790508185614d01565b935050506001016112c3565b5060005b8b518110156114a35760008c82815181106113d4576113d4614cd5565b6020026020010151905060008c83815181106113f2576113f2614cd5565b6020026020010151905061140582612dfc565b61019a54600083815261019e6020526040902054611424908390614d01565b11156114685760405162461bcd60e51b8152602060048201526013602482015272105e9d5ada48195e18d959591cc81b1a5b5a5d606a1b6044820152606401610f8e565b600082815261019e602052604081208054839290611487908490614d01565b9091555061149790508185614d01565b935050506001016113b7565b5060005b895181101561159d5760008a82815181106114c4576114c4614cd5565b6020026020010151905060008a83815181106114e2576114e2614cd5565b602002602001015190506114f582612f54565b61019b54600083815261019f6020526040902054611514908390614d01565b11156115625760405162461bcd60e51b815260206004820152601d60248201527f417a756b6920656c656d656e74616c2065786365656473206c696d69740000006044820152606401610f8e565b600082815261019f602052604081208054839290611581908490614d01565b9091555061159190508185614d01565b935050506001016114a7565b5060005b87518110156116975760008882815181106115be576115be614cd5565b6020026020010151905060008883815181106115dc576115dc614cd5565b602002602001015190506115ef826130b6565b61019c5460008381526101a0602052604090205461160e908390614d01565b111561165c5760405162461bcd60e51b815260206004820152601d60248201527f417a756b6920656c656d656e74616c2065786365656473206c696d69740000006044820152606401610f8e565b60008281526101a060205260408120805483929061167b908490614d01565b9091555061168b90508185614d01565b935050506001016115a1565b5060005b85518110156117915760008682815181106116b8576116b8614cd5565b6020026020010151905060008683815181106116d6576116d6614cd5565b602002602001015190506116e982613224565b6101a35460008381526101a46020526040902054611708908390614d01565b11156117565760405162461bcd60e51b815260206004820152601a60248201527f415243205374656c6c6172732065786365656473206c696d69740000000000006044820152606401610f8e565b60008281526101a4602052604081208054839290611775908490614d01565b9091555061178590508185614d01565b9350505060010161169b565b5060005b83518110156118815760008482815181106117b2576117b2614cd5565b6020026020010151905060008483815181106117d0576117d0614cd5565b602002602001015190506117e382613386565b6101a65460008381526101a76020526040902054611802908390614d01565b11156118465760405162461bcd60e51b81526020600482015260136024820152721099585b9e88195e18d959591cc81b1a5b5a5d606a1b6044820152606401610f8e565b60008281526101a7602052604081208054839290611865908490614d01565b9091555061187590508185614d01565b93505050600101611795565b5060fd54816101a5546118949190614d01565b11156118d35760405162461bcd60e51b815260206004820152600e60248201526d4578636565647320737570706c7960901b6044820152606401610f8e565b806101a560008282546118e69190614d01565b9091555061191d905081610194600060015b600281111561190957611909614a65565b8152602001908152602001600020546134de565b60405181815233907f10fcc92ce3ae296b6d2813de054ab2cf2d6dd59a1eed235681bc8bf6c36a5cb79060200160405180910390a2505050505050505050505050505050565b61196b61356b565b6101a555565b6000600161197d612b15565b60010154611989612b15565b540303905090565b600061199c826135c5565b6001600160a01b0394851694909150811684146119c2576119c262a1148160e81b612b99565b6000806119ce84613688565b915091506119f381876119de3390565b6001600160a01b039081169116811491141790565b611a1557611a018633612a41565b611a1557611a15632ce44b5f60e11b612b99565b611a2286868660016136b0565b8015611a2d57600082555b611a35612b15565b6001600160a01b0387166000908152600591909101602052604090208054600019019055611a61612b15565b6001600160a01b03861660008181526005929092016020526040909120805460010190554260a01b17600160e11b17611a98612b15565b60008681526004919091016020526040812091909155600160e11b84169003611b0e5760018401611ac7612b15565b600082815260049190910160205260408120549003611b0c57611ae8612b15565b548114611b0c5783611af8612b15565b600083815260049190910160205260409020555b505b6001600160a01b0385168481887fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a480600003611b5857611b58633a954ecd60e21b612b99565b50505050505050565b611b6a33611bb1565b611b865760405162461bcd60e51b8152600401610f8e90614d14565b6001600160a01b0391909116600090815260cb60205260409020805460ff1916911515919091179055565b6001600160a01b0316600090815260cb602052604090205460ff1690565b611bd761356b565b611bdf613734565b565b611bfc8383836040518060200160405280600081525061286d565b505050565b611c0961356b565b6000816001600160a01b03164760405160006040518083038185875af1925050503d8060008114611c56576040519150601f19603f3d011682016040523d82523d6000602084013e611c5b565b606091505b5050905080610f4b5760405162461bcd60e51b815260206004820152600f60248201526e15da5d1a191c985dc819985a5b1959608a1b6044820152606401610f8e565b60008051602061514c83398151915254610100900460ff16611cd35760008051602061514c8339815191525460ff1615611cd7565b303b155b611d495760405162461bcd60e51b815260206004820152603760248201527f455243373231415f5f496e697469616c697a61626c653a20636f6e747261637460448201527f20697320616c726561647920696e697469616c697a65640000000000000000006064820152608401610f8e565b60008051602061514c83398151915254610100900460ff16158015611d855760008051602061514c833981519152805461ffff19166101011790555b600054610100900460ff1615808015611da55750600054600160ff909116105b80611dbf5750303b158015611dbf575060005460ff166001145b611e225760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610f8e565b6000805460ff191660011790558015611e45576000805461ff0019166101001790555b611e4d613786565b611e556137b5565b611e7d60405180602001604052806000815250604051806020016040528060008152506137e4565b611e878888613815565b611e8f613853565b611e9886613896565b611ea285856138bd565b611eaa6138ff565b611eb2613926565b61019380546001600160a81b0319166001600160a01b03851617905561019460205267013c3107490280007fac2681a0ffcdeb8d930437e36dc6669c17d1245fb57aa4cfab8f62b41ea51f818190557f431122e4fe9c44f5a319c6d2afd7cf7bcc21253a0483556b9b40b9255f70a15e819055600260008190527f4f2fafccb5d28f3aaff6cbdf8ff32db4167d35308651b7acedb7127f6ec061859190915561019681905561019981905561019a819055600161019b81905561019c556101a35560056101a1558015611fbf576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b508015611b5857505060008051602061514c833981519152805461ff00191690555050505050565b611fef61356b565b61019655565b6000610e5a826135c5565b61200861356b565b80610194600084600281111561202057612020614a65565b600281111561203157612031614a65565b81526020810191909152604001600020555050565b61204e61356b565b61019380546001600160a01b0319166001600160a01b0392909216919091179055565b61207a33611bb1565b6120965760405162461bcd60e51b8152600401610f8e90614d14565b60fd55565b60006001600160a01b0382166120bb576120bb6323d3ad8160e21b612b99565b6001600160401b036120cb612b15565b6005016000846001600160a01b03166001600160a01b0316815260200190815260200160002054169050919050565b61210261356b565b611bdf6000613963565b61211461356b565b61019c55565b61212333611bb1565b61213f5760405162461bcd60e51b8152600401610f8e90614d14565b610130611bfc828483614d82565b606061012f8054610e7890614c2d565b61216561356b565b6101a655565b8282826000612179846139b5565b9050600061218682613a36565b905060006121ca8286868080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250613a6392505050565b610193549091506001600160a01b038083169116146122225760405162461bcd60e51b8152602060048201526014602482015273155b985d5d1a1bdc9a5e9959081c995c5d595cdd60621b6044820152606401610f8e565b61223260408a0160208b01614b63565b8935600090815261019560205260409020805460ff1916600183600281111561225d5761225d614a65565b0217905550505050505050505050565b61227561356b565b611bdf613926565b6000606080600080600060606097546000801b14801561229d5750609854155b6122e15760405162461bcd60e51b81526020600482015260156024820152741152540dcc4c8e88155b9a5b9a5d1a585b1a5e9959605a1b6044820152606401610f8e565b50506040805180820182526011815270415a554b495f585f434f5f4d555345554d60781b6020808301919091528251808401845260058152640302e312e360dc1b8183015283516000808252928101909452600f60f81b9992985096504695503094509250565b61235133611bb1565b61236d5760405162461bcd60e51b8152600401610f8e90614d14565b61012f611bfc828483614d82565b61238361356b565b6101a355565b61239161356b565b6101a155565b60606123a1612b15565b6003018054610e7890614c2d565b806123b8612b15565b336000818152600792909201602090815260408084206001600160a01b03881680865290835293819020805460ff19169515159590951790945592518415158152919290917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b61243533611bb1565b6124515760405162461bcd60e51b8152600401610f8e90614d14565b828181146124a15760405162461bcd60e51b815260206004820152601760248201527f41646d696e206d696e743a2062616420726571756573740000000000000000006044820152606401610f8e565b60005b818110156124fc576124f48686838181106124c1576124c1614cd5565b90506020020160208101906124d69190614678565b8585848181106124e8576124e8614cd5565b90506020020135613a87565b6001016124a4565b505050505050565b61250c61356b565b61019b55565b83838383831561262a57600061252784613a91565b9050600061253482613a36565b905060006125788286868080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250613a6392505050565b610193549091506001600160a01b038083169116146125d05760405162461bcd60e51b8152602060048201526014602482015273155b985d5d1a1bdc9a5e9959081c995c5d595cdd60621b6044820152606401610f8e565b336125de6020880188614678565b6001600160a01b0316146126265760405162461bcd60e51b815260206004820152600f60248201526e125b9d985b1a59081858d8dbdd5b9d608a1b6044820152606401610f8e565b5050505b60008061019354600160a01b900460ff16600281111561264c5761264c614a65565b146126695760405162461bcd60e51b8152600401610f8e90614c61565b612671612c54565b6000805b8d8110156127625760008f8f8381811061269157612691614cd5565b90506020020135905060008e8e848181106126ae576126ae614cd5565b9050602002013590506126c082612c9a565b61019654600083815261019760205260409020546126df908390614d01565b11156127275760405162461bcd60e51b815260206004820152601760248201527610dbcb535d5cd95d5b48195e18d959591cc81b1a5b5a5d604a1b6044820152606401610f8e565b6000828152610197602052604081208054839290612746908490614d01565b9091555061275690508185614d01565b93505050600101612675565b503360009081526101986020908152604090912054908a013590612787908c90614d01565b11156127cd5760405162461bcd60e51b81526020600482015260156024820152741058d8dbdd5b9d08195e18d959591cc81b1a5b5a5d605a1b6044820152606401610f8e565b3360009081526101986020526040812080548c92906127ed908490614d01565b909155506127fd90508a82614d01565b905061280e816101946000806118f8565b61281b60208a018a614678565b6001600160a01b03167f10fcc92ce3ae296b6d2813de054ab2cf2d6dd59a1eed235681bc8bf6c36a5cb78260405161285591815260200190565b60405180910390a25050505050505050505050505050565b612878848484611991565b6001600160a01b0383163b156128a85761289484848484613aee565b6128a8576128a86368d2bf6b60e11b612b99565b50505050565b6128b661356b565b610193805482919060ff60a01b1916600160a01b8360028111156128dc576128dc614a65565b021790555050565b60606128ef82612b39565b61290c57604051630a14c4b560e41b815260040160405180910390fd5b610e5a82613bd0565b60028061019354600160a01b900460ff16600281111561293757612937614a65565b146129545760405162461bcd60e51b8152600401610f8e90614c61565b61295c612c54565b6101a1543360009081526101a2602052604090205461297c908490614d01565b11156129ba5760405162461bcd60e51b815260206004820152600d60248201526c115e18d959591cc81b1a5b5a5d609a1b6044820152606401610f8e565b3360009081526101a26020526040812080548492906129da908490614d01565b909155506129f0905082610194600060026118f8565b6129fa3383613c09565b60405182815233907f10fcc92ce3ae296b6d2813de054ab2cf2d6dd59a1eed235681bc8bf6c36a5cb79060200160405180910390a25050565b612a3b61356b565b61019955565b6000612a4b612b15565b6001600160a01b039384166000908152600791909101602090815260408083209490951682529290925250205460ff1690565b612a8661356b565b61019a55565b612a9461356b565b6001600160a01b038116612af95760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610f8e565b612b0281613963565b50565b60606101308054610e7890614c2d565b7f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c4090565b600081600111612b9457612b4b612b15565b54821015612b945760005b612b5e612b15565b600084815260049190910160205260408120549150819003612b8a57612b8383614e41565b9250612b56565b600160e01b161590505b919050565b8060005260046000fd5b6000612bae83611ff5565b9050818015612bc65750336001600160a01b03821614155b15612be957612bd58133612a41565b612be957612be96367d9dca160e11b612b99565b83612bf2612b15565b6000858152600691909101602052604080822080546001600160a01b0319166001600160a01b0394851617905551859287811692908516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259190a450505050565b60655460ff1615611bdf5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610f8e565b6040516331a9108f60e11b81526004810182905260009073e166a1fc32647ba4ec271b753cc56b5f0870d23290636352211e90602401602060405180830381865afa158015612ced573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d119190614e58565b9050336001600160a01b0382161480612db05750604051632e7cda1d60e21b81526c447e69651d841bd8d104bed4939063b9f3687490612d6f903390859073e166a1fc32647ba4ec271b753cc56b5f0870d232908890600401614e75565b602060405180830381865afa158015612d8c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612db09190614ea6565b610f4b5760405162461bcd60e51b815260206004820152601760248201527f496e76616c696420436f2d4d757365756d206f776e65720000000000000000006044820152606401610f8e565b6040516331a9108f60e11b81526004810182905260009073ed5af388653567af2f388e6224dc7c4b3241c54490636352211e90602401602060405180830381865afa158015612e4f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e739190614e58565b9050336001600160a01b0382161480612f125750604051632e7cda1d60e21b81526c447e69651d841bd8d104bed4939063b9f3687490612ed1903390859073ed5af388653567af2f388e6224dc7c4b3241c544908890600401614e75565b602060405180830381865afa158015612eee573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f129190614ea6565b610f4b5760405162461bcd60e51b815260206004820152601360248201527224b73b30b634b21020bd3ab5b49037bbb732b960691b6044820152606401610f8e565b6040516331a9108f60e11b81526004810182905260009073b6a37b5d14d502c3ab0ae6f3a0e058bc9517786e90636352211e90602401602060405180830381865afa158015612fa7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612fcb9190614e58565b9050336001600160a01b038216148061306a5750604051632e7cda1d60e21b81526c447e69651d841bd8d104bed4939063b9f3687490613029903390859073b6a37b5d14d502c3ab0ae6f3a0e058bc9517786e908890600401614e75565b602060405180830381865afa158015613046573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061306a9190614ea6565b610f4b5760405162461bcd60e51b815260206004820152601e60248201527f496e76616c696420417a756b6920656c656d656e74616c73206f776e657200006044820152606401610f8e565b6040516331a9108f60e11b815260048101829052600090733af2a97414d1101e2107a70e7f33955da134630590636352211e90602401602060405180830381865afa158015613109573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061312d9190614e58565b9050336001600160a01b03821614806131cc5750604051632e7cda1d60e21b81526c447e69651d841bd8d104bed4939063b9f368749061318b9033908590733af2a97414d1101e2107a70e7f33955da1346305908890600401614e75565b602060405180830381865afa1580156131a8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131cc9190614ea6565b610f4b5760405162461bcd60e51b815260206004820152602360248201527f496e76616c696420417a756b6920656c656d656e74616c206265616e7a206f776044820152623732b960e91b6064820152608401610f8e565b6040516331a9108f60e11b81526004810182905260009073f4a7c105cfdc6aabe9ae65bdf2d0df0a567a7ade90636352211e90602401602060405180830381865afa158015613277573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061329b9190614e58565b9050336001600160a01b038216148061333a5750604051632e7cda1d60e21b81526c447e69651d841bd8d104bed4939063b9f36874906132f9903390859073f4a7c105cfdc6aabe9ae65bdf2d0df0a567a7ade908890600401614e75565b602060405180830381865afa158015613316573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061333a9190614ea6565b610f4b5760405162461bcd60e51b815260206004820152601a60248201527f496e76616c696420415243205374656c6c617273206f776e65720000000000006044820152606401610f8e565b6040516331a9108f60e11b81526004810182905260009073306b1ea3ecdf94ab739f1910bbda052ed4a9f94990636352211e90602401602060405180830381865afa1580156133d9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906133fd9190614e58565b9050336001600160a01b038216148061349c5750604051632e7cda1d60e21b81526c447e69651d841bd8d104bed4939063b9f368749061345b903390859073306b1ea3ecdf94ab739f1910bbda052ed4a9f949908890600401614e75565b602060405180830381865afa158015613478573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061349c9190614ea6565b610f4b5760405162461bcd60e51b815260206004820152601360248201527224b73b30b634b2102132b0b73d1037bbb732b960691b6044820152606401610f8e565b60006134ea8284614ec3565b90508034101561352d5760405162461bcd60e51b815260206004820152600e60248201526d09cdee840cadcdeeaced0408aa8960931b6044820152606401610f8e565b80341115611bfc57336108fc6135438334614eda565b6040518115909202916000818181858888f193505050501580156128a8573d6000803e3d6000fd5b6033546001600160a01b03163314611bdf5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610f8e565b600081600111613678576135d7612b15565b60008381526004919091016020526040902054905080600003613665576135fc612b15565b54821061361357613613636f96cda160e11b612b99565b61361b612b15565b60001990920160008181526004939093016020526040909220549050801561361357600160e01b811660000361365057919050565b613660636f96cda160e11b612b99565b613613565b600160e01b811660000361367857919050565b612b94636f96cda160e11b612b99565b6000806000613695612b15565b60009485526006016020525050604090912080549092909150565b6001600160a01b03841615806136ea575060016000838152610195602052604090205460ff1660028111156136e7576136e7614a65565b14155b61372f5760405162461bcd60e51b8152602060048201526016602482015275546f6b656e206e6f74207472616e7366657261626c6560501b6044820152606401610f8e565b6128a8565b61373c613ca2565b6065805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b600054610100900460ff166137ad5760405162461bcd60e51b8152600401610f8e90614eed565b611bdf613ceb565b600054610100900460ff166137dc5760405162461bcd60e51b8152600401610f8e90614eed565b611bdf613d1b565b600054610100900460ff1661380b5760405162461bcd60e51b8152600401610f8e90614eed565b610f4b8282613d4e565b60008051602061514c83398151915254610100900460ff166138495760405162461bcd60e51b8152600401610f8e90614f38565b610f4b8282613d9d565b600054610100900460ff1661387a5760405162461bcd60e51b8152600401610f8e90614eed565b33600090815260cb60205260409020805460ff19166001179055565b600054610100900460ff166120965760405162461bcd60e51b8152600401610f8e90614eed565b600054610100900460ff166138e45760405162461bcd60e51b8152600401610f8e90614eed565b61012f6138f18382614f8c565b50610130611bfc8282614f8c565b600054610100900460ff16611bdf5760405162461bcd60e51b8152600401610f8e90614eed565b61392e612c54565b6065805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586137693390565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60007fcb47c620e4bac89d873a47d71176d24b42a701da50e4400c4fc5eee71211be7182356139ea6040850160208601614b63565b60028111156139fb576139fb614a65565b60408051602081019490945283019190915260ff1660608201526080015b604051602081830303815290604052805190602001209050919050565b6000610e5a613a43613e10565b8360405161190160f01b8152600281019290925260228201526042902090565b6000806000613a728585613e1f565b91509150613a7f81613e64565b509392505050565b610f4b8282613c09565b60007f904116aebab2081d38d8cae3b4fbc5c844749e354a61c1001bc4c71f06596cb2613ac16020840184614678565b604080516020818101949094526001600160a01b0390921690820152908301356060820152608001613a19565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a0290613b2390339089908890889060040161504b565b6020604051808303816000875af1925050508015613b5e575060408051601f3d908101601f19168201909252613b5b91810190615088565b60015b613bb3573d808015613b8c576040519150601f19603f3d011682016040523d82523d6000602084013e613b91565b606091505b508051600003613bab57613bab6368d2bf6b60e11b612b99565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050949350505050565b606061012f613bde83613fae565b610130604051602001613bf393929190615118565b6040516020818303038152906040529050919050565b8060fd5481613c16614040565b613c209190614d01565b1115613c5f5760405162461bcd60e51b815260206004820152600e60248201526d4578636565647320737570706c7960901b6044820152606401610f8e565b323314613c985760405162461bcd60e51b81526020600482015260076024820152664e6f20626f747360c81b6044820152606401610f8e565b611bfc838361404a565b60655460ff16611bdf5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610f8e565b600054610100900460ff16613d125760405162461bcd60e51b8152600401610f8e90614eed565b611bdf33613963565b600054610100900460ff16613d425760405162461bcd60e51b8152600401610f8e90614eed565b6065805460ff19169055565b600054610100900460ff16613d755760405162461bcd60e51b8152600401610f8e90614eed565b6099613d818382614f8c565b50609a613d8e8282614f8c565b50506000609781905560985550565b60008051602061514c83398151915254610100900460ff16613dd15760405162461bcd60e51b8152600401610f8e90614f38565b81613dda612b15565b60020190613de89082614f8c565b5080613df2612b15565b60030190613e009082614f8c565b506001613e0b612b15565b555050565b6000613e1a614064565b905090565b6000808251604103613e555760208301516040840151606085015160001a613e49878285856140d8565b94509450505050613e5d565b506000905060025b9250929050565b6000816004811115613e7857613e78614a65565b03613e805750565b6001816004811115613e9457613e94614a65565b03613ee15760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610f8e565b6002816004811115613ef557613ef5614a65565b03613f425760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610f8e565b6003816004811115613f5657613f56614a65565b03612b025760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610f8e565b60606000613fbb8361419c565b60010190506000816001600160401b03811115613fda57613fda614695565b6040519080825280601f01601f191660200182016040528015614004576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a850494508461400e57509392505050565b6000613e1a611971565b610f4b828260405180602001604052806000815250614274565b60007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f61408f6142e8565b614097614367565b60408051602081019490945283019190915260608201524660808201523060a082015260c00160405160208183030381529060405280519060200120905090565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561410f5750600090506003614193565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015614163573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661418c57600060019250925050614193565b9150600090505b94509492505050565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106141db5772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310614207576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc10000831061422557662386f26fc10000830492506010015b6305f5e100831061423d576305f5e100830492506008015b612710831061425157612710830492506004015b60648310614263576064830492506002015b600a8310610e5a5760010192915050565b61427e83836143b2565b6001600160a01b0383163b15611bfc576000614298612b15565b5490508281035b6142b26000868380600101945086613aee565b6142c6576142c66368d2bf6b60e11b612b99565b81811061429f57816142d6612b15565b54146142e157600080fd5b5050505050565b600080614319604080518082019091526011815270415a554b495f585f434f5f4d555345554d60781b602082015290565b805190915015614330578051602090910120919050565b609754801561433f5792915050565b7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a4709250505090565b60008061438c6040805180820190915260058152640302e312e360dc1b602082015290565b8051909150156143a3578051602090910120919050565b609854801561433f5792915050565b60006143bc612b15565b54905060008290036143d8576143d863b562e8dd60e01b612b99565b6143e560008483856136b0565b6001600160a01b0383164260a01b6001841460e11b1717614404612b15565b6000838152600491909101602052604090205568010000000000000001820261442b612b15565b6001600160a01b038516600081815260059290920160205260408220805490930190925581900361446557614465622e076360e81b612b99565b818301825b808360007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a481816001019150810361446a57816144a9612b15565b5550611bfc915050565b6001600160e01b031981168114612b0257600080fd5b6000602082840312156144db57600080fd5b81356144e6816144b3565b9392505050565b60005b838110156145085781810151838201526020016144f0565b50506000910152565b600081518084526145298160208601602086016144ed565b601f01601f19169290920160200192915050565b6020815260006144e66020830184614511565b60006020828403121561456257600080fd5b5035919050565b6001600160a01b0381168114612b0257600080fd5b8035612b9481614569565b6000806040838503121561459c57600080fd5b82356145a781614569565b946020939093013593505050565b6000602082840312156145c757600080fd5b81356001600160401b038111156145dd57600080fd5b820161018081850312156144e657600080fd5b60008060006060848603121561460557600080fd5b833561461081614569565b9250602084013561462081614569565b929592945050506040919091013590565b8015158114612b0257600080fd5b6000806040838503121561465257600080fd5b823561465d81614569565b9150602083013561466d81614631565b809150509250929050565b60006020828403121561468a57600080fd5b81356144e681614569565b634e487b7160e01b600052604160045260246000fd5b60006001600160401b03808411156146c5576146c5614695565b604051601f8501601f19908116603f011681019082821181831017156146ed576146ed614695565b8160405280935085815286868601111561470657600080fd5b858560208301376000602087830101525050509392505050565b600082601f83011261473157600080fd5b6144e6838335602085016146ab565b60008060008060008060c0878903121561475957600080fd5b86356001600160401b038082111561477057600080fd5b61477c8a838b01614720565b9750602089013591508082111561479257600080fd5b61479e8a838b01614720565b96506040890135955060608901359150808211156147bb57600080fd5b6147c78a838b01614720565b945060808901359150808211156147dd57600080fd5b506147ea89828a01614720565b9250506147f960a0880161457e565b90509295509295509295565b60038110612b0257600080fd5b6000806040838503121561482557600080fd5b82356145a781614805565b60008083601f84011261484257600080fd5b5081356001600160401b0381111561485957600080fd5b602083019150836020828501011115613e5d57600080fd5b6000806020838503121561488457600080fd5b82356001600160401b0381111561489a57600080fd5b6148a685828601614830565b90969095509350505050565b6000604082840312156148c457600080fd5b50919050565b6000806000606084860312156148df57600080fd5b6148e985856148b2565b925060408401356001600160401b0381111561490457600080fd5b61491086828701614830565b9497909650939450505050565b60ff60f81b881681526000602060e0602084015261493e60e084018a614511565b8381036040850152614950818a614511565b606085018990526001600160a01b038816608086015260a0850187905284810360c08601528551808252602080880193509091019060005b818110156149a457835183529284019291840191600101614988565b50909c9b505050505050505050505050565b60008083601f8401126149c857600080fd5b5081356001600160401b038111156149df57600080fd5b6020830191508360208260051b8501011115613e5d57600080fd5b60008060008060408587031215614a1057600080fd5b84356001600160401b0380821115614a2757600080fd5b614a33888389016149b6565b90965094506020870135915080821115614a4c57600080fd5b50614a59878288016149b6565b95989497509550505050565b634e487b7160e01b600052602160045260246000fd5b60038110612b0257634e487b7160e01b600052602160045260246000fd5b60208101614aa683614a7b565b91905290565b60008060008060008060008060c0898b031215614ac857600080fd5b88356001600160401b0380821115614adf57600080fd5b614aeb8c838d016149b6565b909a50985060208b0135915080821115614b0457600080fd5b614b108c838d016149b6565b909850965060408b01359550869150614b2c8c60608d016148b2565b945060a08b0135915080821115614b4257600080fd5b50614b4f8b828c01614830565b999c989b5096995094979396929594505050565b600060208284031215614b7557600080fd5b81356144e681614805565b60008060008060808587031215614b9657600080fd5b8435614ba181614569565b93506020850135614bb181614569565b92506040850135915060608501356001600160401b03811115614bd357600080fd5b8501601f81018713614be457600080fd5b614bf3878235602084016146ab565b91505092959194509250565b60008060408385031215614c1257600080fd5b8235614c1d81614569565b9150602083013561466d81614569565b600181811c90821680614c4157607f821691505b6020821081036148c457634e487b7160e01b600052602260045260246000fd5b602080825260119082015270141a185cd9481b9bdd08195b98589b1959607a1b604082015260600190565b6000808335601e19843603018112614ca357600080fd5b8301803591506001600160401b03821115614cbd57600080fd5b6020019150600581901b3603821315613e5d57600080fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b80820180821115610e5a57610e5a614ceb565b6020808252600c908201526b2737ba1030b71030b236b4b760a11b604082015260600190565b601f821115611bfc576000816000526020600020601f850160051c81016020861015614d635750805b601f850160051c820191505b818110156124fc57828155600101614d6f565b6001600160401b03831115614d9957614d99614695565b614dad83614da78354614c2d565b83614d3a565b6000601f841160018114614de15760008515614dc95750838201355b600019600387901b1c1916600186901b1783556142e1565b600083815260209020601f19861690835b82811015614e125786850135825560209485019460019092019101614df2565b5086821015614e2f5760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b600081614e5057614e50614ceb565b506000190190565b600060208284031215614e6a57600080fd5b81516144e681614569565b6001600160a01b03948516815292841660208401529216604082015260608101919091526000608082015260a00190565b600060208284031215614eb857600080fd5b81516144e681614631565b8082028115828204841417610e5a57610e5a614ceb565b81810381811115610e5a57610e5a614ceb565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b60208082526034908201527f455243373231415f5f496e697469616c697a61626c653a20636f6e7472616374604082015273206973206e6f7420696e697469616c697a696e6760601b606082015260800190565b81516001600160401b03811115614fa557614fa5614695565b614fb981614fb38454614c2d565b84614d3a565b602080601f831160018114614fee5760008415614fd65750858301515b600019600386901b1c1916600185901b1785556124fc565b600085815260208120601f198616915b8281101561501d57888601518255948401946001909101908401614ffe565b508582101561503b5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061507e90830184614511565b9695505050505050565b60006020828403121561509a57600080fd5b81516144e6816144b3565b600081546150b281614c2d565b600182811680156150ca57600181146150df5761510e565b60ff198416875282151583028701945061510e565b8560005260208060002060005b858110156151055781548a8201529084019082016150ec565b50505082870194505b5050505092915050565b600061512482866150a5565b84516151348183602089016144ed565b615140818301866150a5565b97965050505050505056feee151c8401928dc223602bb187aff91b9a56c7cae5476ef1b3287b085a16c85fa264697066735822122076f731978ffcf0c353ea17182a43bde1ab76e510482e4ffa4970b4ff29ed161f64736f6c63430008180033
Deployed Bytecode
0x6080604052600436106104525760003560e01c80638286eee21161023f578063b7fafcd711610139578063d2c8ed4c116100b6578063f29b4fbc1161007a578063f29b4fbc14610d74578063f2fde38b14610d94578063f7073c3a14610db4578063f92c45b714610dc9578063ff1473a814610de057600080fd5b8063d2c8ed4c14610ce0578063d5abeb0114610d08578063de90871f14610d1d578063e7ebdca614610d3d578063e985e9c514610d5457600080fd5b8063c87b56dd116100fd578063c87b56dd14610c40578063c9672e2614610c60578063cbccdec314610c73578063cc5dbcf214610ca1578063cd1f5a2914610cc957600080fd5b8063b7fafcd714610b80578063b88d4fde14610bae578063bde750fb14610bc1578063c03afb5914610bef578063c13085db14610c0f57600080fd5b806395d89b41116101c7578063a49340cc1161018b578063a49340cc14610ad6578063a9a1d6b014610af6578063b1c9fe6e14610b16578063b2caf79014610b45578063b7e08d4114610b6d57600080fd5b806395d89b4114610a1d5780639831ef2a14610a3257806398ac859e14610a605780639e7b40d614610a88578063a22cb46514610ab657600080fd5b806385cb593b1161020e57806385cb593b146109885780638692810c146109a85780638da5cb5b146109c85780638e8a07b3146109e6578063910354c2146109fd57600080fd5b80638286eee2146109135780638456cb591461093457806384b0196e14610949578063857b9bd41461097157600080fd5b8063481b86ac116103505780636e820527116102d857806375d5ae9f1161029c57806375d5ae9f1461088757806375dadb32146108a7578063782312a3146108bc5780637c5b35a3146108d35780637fcf1af5146108f357600080fd5b80636e820527146107e45780636f8b44b01461081257806370a0823114610832578063715018a61461085257806373af7a401461086757600080fd5b80635c975abb1161031f5780635c975abb1461074c5780635eff75c1146107645780636352211e146107845780636a00670b146107a45780636c19e783146107c457600080fd5b8063481b86ac146106c75780634bf47ebd146106de57806351cff8d91461070c5780635bf6846e1461072c57600080fd5b8063238ac933116103de5780632df507be116103a25780632df507be1461061b5780633c80c1d1146106495780633d8f833d146106775780633f4ba83a1461069f57806342842e0e146106b457600080fd5b8063238ac9331461059057806323b872dd146105b1578063240ff27f146105c457806324d7806c146105e45780632cb29a0d1461060457600080fd5b8063096cca7d11610425578063096cca7d146104fb5780631429fbe41461052357806315720c5f14610548578063170e17361461055b57806318160ddd1461057b57600080fd5b806301ffc9a71461045757806306fdde031461048c578063081812fc146104ae578063095ea7b3146104e6575b600080fd5b34801561046357600080fd5b506104776104723660046144c9565b610e0e565b60405190151581526020015b60405180910390f35b34801561049857600080fd5b506104a1610e60565b604051610483919061453d565b3480156104ba57600080fd5b506104ce6104c9366004614550565b610efb565b6040516001600160a01b039091168152602001610483565b6104f96104f4366004614589565b610f3f565b005b34801561050757600080fd5b506104ce73e166a1fc32647ba4ec271b753cc56b5f0870d23281565b34801561052f57600080fd5b5061053a6101965481565b604051908152602001610483565b6104f96105563660046145b5565b610f4f565b34801561056757600080fd5b506104f9610576366004614550565b611963565b34801561058757600080fd5b5061053a611971565b34801561059c57600080fd5b50610193546104ce906001600160a01b031681565b6104f96105bf3660046145f0565b611991565b3480156105d057600080fd5b506104f96105df36600461463f565b611b61565b3480156105f057600080fd5b506104776105ff366004614678565b611bb1565b34801561061057600080fd5b5061053a6101995481565b34801561062757600080fd5b5061053a610636366004614550565b61019d6020526000908152604090205481565b34801561065557600080fd5b5061053a610664366004614678565b6101986020526000908152604090205481565b34801561068357600080fd5b506104ce73b6a37b5d14d502c3ab0ae6f3a0e058bc9517786e81565b3480156106ab57600080fd5b506104f9611bcf565b6104f96106c23660046145f0565b611be1565b3480156106d357600080fd5b5061053a61019a5481565b3480156106ea57600080fd5b5061053a6106f9366004614550565b61019e6020526000908152604090205481565b34801561071857600080fd5b506104f9610727366004614678565b611c01565b34801561073857600080fd5b506104f9610747366004614740565b611c9e565b34801561075857600080fd5b5060655460ff16610477565b34801561077057600080fd5b506104f961077f366004614550565b611fe7565b34801561079057600080fd5b506104ce61079f366004614550565b611ff5565b3480156107b057600080fd5b506104f96107bf366004614812565b612000565b3480156107d057600080fd5b506104f96107df366004614678565b612046565b3480156107f057600080fd5b5061053a6107ff366004614550565b61019f6020526000908152604090205481565b34801561081e57600080fd5b506104f961082d366004614550565b612071565b34801561083e57600080fd5b5061053a61084d366004614678565b61209b565b34801561085e57600080fd5b506104f96120fa565b34801561087357600080fd5b506104f9610882366004614550565b61210c565b34801561089357600080fd5b506104f96108a2366004614871565b61211a565b3480156108b357600080fd5b506104a161214d565b3480156108c857600080fd5b5061053a61019c5481565b3480156108df57600080fd5b506104f96108ee366004614550565b61215d565b3480156108ff57600080fd5b506104f961090e3660046148ca565b61216b565b34801561091f57600080fd5b506104ce6c447e69651d841bd8d104bed49381565b34801561094057600080fd5b506104f961226d565b34801561095557600080fd5b5061095e61227d565b604051610483979695949392919061491d565b34801561097d57600080fd5b5061053a6101a65481565b34801561099457600080fd5b506104f96109a3366004614871565b612348565b3480156109b457600080fd5b506104f96109c3366004614550565b61237b565b3480156109d457600080fd5b506033546001600160a01b03166104ce565b3480156109f257600080fd5b5061053a6101a35481565b348015610a0957600080fd5b506104f9610a18366004614550565b612389565b348015610a2957600080fd5b506104a1612397565b348015610a3e57600080fd5b5061053a610a4d366004614550565b6101976020526000908152604090205481565b348015610a6c57600080fd5b506104ce733af2a97414d1101e2107a70e7f33955da134630581565b348015610a9457600080fd5b5061053a610aa3366004614550565b6101a76020526000908152604090205481565b348015610ac257600080fd5b506104f9610ad136600461463f565b6123af565b348015610ae257600080fd5b506104f9610af13660046149fa565b61242c565b348015610b0257600080fd5b506104f9610b11366004614550565b612504565b348015610b2257600080fd5b5061019354610b3890600160a01b900460ff1681565b6040516104839190614a99565b348015610b5157600080fd5b506104ce73f4a7c105cfdc6aabe9ae65bdf2d0df0a567a7ade81565b6104f9610b7b366004614aac565b612512565b348015610b8c57600080fd5b5061053a610b9b366004614b63565b6101946020526000908152604090205481565b6104f9610bbc366004614b80565b61286d565b348015610bcd57600080fd5b5061053a610bdc366004614550565b6101a46020526000908152604090205481565b348015610bfb57600080fd5b506104f9610c0a366004614b63565b6128ae565b348015610c1b57600080fd5b50610b38610c2a366004614550565b6101956020526000908152604090205460ff1681565b348015610c4c57600080fd5b506104a1610c5b366004614550565b6128e4565b6104f9610c6e366004614550565b612915565b348015610c7f57600080fd5b5061053a610c8e366004614678565b6101a26020526000908152604090205481565b348015610cad57600080fd5b506104ce73306b1ea3ecdf94ab739f1910bbda052ed4a9f94981565b348015610cd557600080fd5b5061053a6101a15481565b348015610cec57600080fd5b506104ce73ed5af388653567af2f388e6224dc7c4b3241c54481565b348015610d1457600080fd5b5060fd5461053a565b348015610d2957600080fd5b506104f9610d38366004614550565b612a33565b348015610d4957600080fd5b5061053a61019b5481565b348015610d6057600080fd5b50610477610d6f366004614bff565b612a41565b348015610d8057600080fd5b506104f9610d8f366004614550565b612a7e565b348015610da057600080fd5b506104f9610daf366004614678565b612a8c565b348015610dc057600080fd5b506104a1612b05565b348015610dd557600080fd5b5061053a6101a55481565b348015610dec57600080fd5b5061053a610dfb366004614550565b6101a06020526000908152604090205481565b60006301ffc9a760e01b6001600160e01b031983161480610e3f57506380ac58cd60e01b6001600160e01b03198316145b80610e5a5750635b5e139f60e01b6001600160e01b03198316145b92915050565b6060610e6a612b15565b6002018054610e7890614c2d565b80601f0160208091040260200160405190810160405280929190818152602001828054610ea490614c2d565b8015610ef15780601f10610ec657610100808354040283529160200191610ef1565b820191906000526020600020905b815481529060010190602001808311610ed457829003601f168201915b5050505050905090565b6000610f0682612b39565b610f1a57610f1a6333d1c03960e21b612b99565b610f22612b15565b60009283526006016020525060409020546001600160a01b031690565b610f4b82826001612ba3565b5050565b60018061019354600160a01b900460ff166002811115610f7157610f71614a65565b14610f975760405162461bcd60e51b8152600401610f8e90614c61565b60405180910390fd5b610f9f612c54565b6000610fab8380614c8c565b808060200260200160405190810160405280939291908181526020018383602002808284376000920182905250939450610fec925050506020850185614c8c565b80806020026020016040519081016040528093929190818152602001838360200280828437600092018290525093945061102d925050506040860186614c8c565b80806020026020016040519081016040528093929190818152602001838360200280828437600092018290525093945061106e925050506060870187614c8c565b8080602002602001604051908101604052809392919081815260200183836020028082843760009201829052509394506110af925050506080880188614c8c565b8080602002602001604051908101604052809392919081815260200183836020028082843760009201829052509394506110f09250505060a0890189614c8c565b8080602002602001604051908101604052809392919081815260200183836020028082843760009201829052509394506111319250505060c08a018a614c8c565b8080602002602001604051908101604052809392919081815260200183836020028082843760009201829052509394506111729250505060e08b018b614c8c565b8080602002602001604051908101604052809392919081815260200183836020028082843760009201829052509394506111b4925050506101008c018c614c8c565b8080602002602001604051908101604052809392919081815260200183836020028082843760009201829052509394506111f6925050506101208d018d614c8c565b808060200260200160405190810160405280939291908181526020018383602002808284376000920182905250939450611238925050506101408e018e614c8c565b80806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f82011690508083019250505050505050905060008d80610160019061128d9190614c8c565b80806020026020016040519081016040528093929190818152602001838360200280828437600092018290525093945083925050505b8d518110156113b35760008e82815181106112e0576112e0614cd5565b6020026020010151905060008e83815181106112fe576112fe614cd5565b6020026020010151905061131182612c9a565b61019954600083815261019d6020526040902054611330908390614d01565b11156113785760405162461bcd60e51b815260206004820152601760248201527610dbcb535d5cd95d5b48195e18d959591cc81b1a5b5a5d604a1b6044820152606401610f8e565b600082815261019d602052604081208054839290611397908490614d01565b909155506113a790508185614d01565b935050506001016112c3565b5060005b8b518110156114a35760008c82815181106113d4576113d4614cd5565b6020026020010151905060008c83815181106113f2576113f2614cd5565b6020026020010151905061140582612dfc565b61019a54600083815261019e6020526040902054611424908390614d01565b11156114685760405162461bcd60e51b8152602060048201526013602482015272105e9d5ada48195e18d959591cc81b1a5b5a5d606a1b6044820152606401610f8e565b600082815261019e602052604081208054839290611487908490614d01565b9091555061149790508185614d01565b935050506001016113b7565b5060005b895181101561159d5760008a82815181106114c4576114c4614cd5565b6020026020010151905060008a83815181106114e2576114e2614cd5565b602002602001015190506114f582612f54565b61019b54600083815261019f6020526040902054611514908390614d01565b11156115625760405162461bcd60e51b815260206004820152601d60248201527f417a756b6920656c656d656e74616c2065786365656473206c696d69740000006044820152606401610f8e565b600082815261019f602052604081208054839290611581908490614d01565b9091555061159190508185614d01565b935050506001016114a7565b5060005b87518110156116975760008882815181106115be576115be614cd5565b6020026020010151905060008883815181106115dc576115dc614cd5565b602002602001015190506115ef826130b6565b61019c5460008381526101a0602052604090205461160e908390614d01565b111561165c5760405162461bcd60e51b815260206004820152601d60248201527f417a756b6920656c656d656e74616c2065786365656473206c696d69740000006044820152606401610f8e565b60008281526101a060205260408120805483929061167b908490614d01565b9091555061168b90508185614d01565b935050506001016115a1565b5060005b85518110156117915760008682815181106116b8576116b8614cd5565b6020026020010151905060008683815181106116d6576116d6614cd5565b602002602001015190506116e982613224565b6101a35460008381526101a46020526040902054611708908390614d01565b11156117565760405162461bcd60e51b815260206004820152601a60248201527f415243205374656c6c6172732065786365656473206c696d69740000000000006044820152606401610f8e565b60008281526101a4602052604081208054839290611775908490614d01565b9091555061178590508185614d01565b9350505060010161169b565b5060005b83518110156118815760008482815181106117b2576117b2614cd5565b6020026020010151905060008483815181106117d0576117d0614cd5565b602002602001015190506117e382613386565b6101a65460008381526101a76020526040902054611802908390614d01565b11156118465760405162461bcd60e51b81526020600482015260136024820152721099585b9e88195e18d959591cc81b1a5b5a5d606a1b6044820152606401610f8e565b60008281526101a7602052604081208054839290611865908490614d01565b9091555061187590508185614d01565b93505050600101611795565b5060fd54816101a5546118949190614d01565b11156118d35760405162461bcd60e51b815260206004820152600e60248201526d4578636565647320737570706c7960901b6044820152606401610f8e565b806101a560008282546118e69190614d01565b9091555061191d905081610194600060015b600281111561190957611909614a65565b8152602001908152602001600020546134de565b60405181815233907f10fcc92ce3ae296b6d2813de054ab2cf2d6dd59a1eed235681bc8bf6c36a5cb79060200160405180910390a2505050505050505050505050505050565b61196b61356b565b6101a555565b6000600161197d612b15565b60010154611989612b15565b540303905090565b600061199c826135c5565b6001600160a01b0394851694909150811684146119c2576119c262a1148160e81b612b99565b6000806119ce84613688565b915091506119f381876119de3390565b6001600160a01b039081169116811491141790565b611a1557611a018633612a41565b611a1557611a15632ce44b5f60e11b612b99565b611a2286868660016136b0565b8015611a2d57600082555b611a35612b15565b6001600160a01b0387166000908152600591909101602052604090208054600019019055611a61612b15565b6001600160a01b03861660008181526005929092016020526040909120805460010190554260a01b17600160e11b17611a98612b15565b60008681526004919091016020526040812091909155600160e11b84169003611b0e5760018401611ac7612b15565b600082815260049190910160205260408120549003611b0c57611ae8612b15565b548114611b0c5783611af8612b15565b600083815260049190910160205260409020555b505b6001600160a01b0385168481887fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a480600003611b5857611b58633a954ecd60e21b612b99565b50505050505050565b611b6a33611bb1565b611b865760405162461bcd60e51b8152600401610f8e90614d14565b6001600160a01b0391909116600090815260cb60205260409020805460ff1916911515919091179055565b6001600160a01b0316600090815260cb602052604090205460ff1690565b611bd761356b565b611bdf613734565b565b611bfc8383836040518060200160405280600081525061286d565b505050565b611c0961356b565b6000816001600160a01b03164760405160006040518083038185875af1925050503d8060008114611c56576040519150601f19603f3d011682016040523d82523d6000602084013e611c5b565b606091505b5050905080610f4b5760405162461bcd60e51b815260206004820152600f60248201526e15da5d1a191c985dc819985a5b1959608a1b6044820152606401610f8e565b60008051602061514c83398151915254610100900460ff16611cd35760008051602061514c8339815191525460ff1615611cd7565b303b155b611d495760405162461bcd60e51b815260206004820152603760248201527f455243373231415f5f496e697469616c697a61626c653a20636f6e747261637460448201527f20697320616c726561647920696e697469616c697a65640000000000000000006064820152608401610f8e565b60008051602061514c83398151915254610100900460ff16158015611d855760008051602061514c833981519152805461ffff19166101011790555b600054610100900460ff1615808015611da55750600054600160ff909116105b80611dbf5750303b158015611dbf575060005460ff166001145b611e225760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610f8e565b6000805460ff191660011790558015611e45576000805461ff0019166101001790555b611e4d613786565b611e556137b5565b611e7d60405180602001604052806000815250604051806020016040528060008152506137e4565b611e878888613815565b611e8f613853565b611e9886613896565b611ea285856138bd565b611eaa6138ff565b611eb2613926565b61019380546001600160a81b0319166001600160a01b03851617905561019460205267013c3107490280007fac2681a0ffcdeb8d930437e36dc6669c17d1245fb57aa4cfab8f62b41ea51f818190557f431122e4fe9c44f5a319c6d2afd7cf7bcc21253a0483556b9b40b9255f70a15e819055600260008190527f4f2fafccb5d28f3aaff6cbdf8ff32db4167d35308651b7acedb7127f6ec061859190915561019681905561019981905561019a819055600161019b81905561019c556101a35560056101a1558015611fbf576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b508015611b5857505060008051602061514c833981519152805461ff00191690555050505050565b611fef61356b565b61019655565b6000610e5a826135c5565b61200861356b565b80610194600084600281111561202057612020614a65565b600281111561203157612031614a65565b81526020810191909152604001600020555050565b61204e61356b565b61019380546001600160a01b0319166001600160a01b0392909216919091179055565b61207a33611bb1565b6120965760405162461bcd60e51b8152600401610f8e90614d14565b60fd55565b60006001600160a01b0382166120bb576120bb6323d3ad8160e21b612b99565b6001600160401b036120cb612b15565b6005016000846001600160a01b03166001600160a01b0316815260200190815260200160002054169050919050565b61210261356b565b611bdf6000613963565b61211461356b565b61019c55565b61212333611bb1565b61213f5760405162461bcd60e51b8152600401610f8e90614d14565b610130611bfc828483614d82565b606061012f8054610e7890614c2d565b61216561356b565b6101a655565b8282826000612179846139b5565b9050600061218682613a36565b905060006121ca8286868080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250613a6392505050565b610193549091506001600160a01b038083169116146122225760405162461bcd60e51b8152602060048201526014602482015273155b985d5d1a1bdc9a5e9959081c995c5d595cdd60621b6044820152606401610f8e565b61223260408a0160208b01614b63565b8935600090815261019560205260409020805460ff1916600183600281111561225d5761225d614a65565b0217905550505050505050505050565b61227561356b565b611bdf613926565b6000606080600080600060606097546000801b14801561229d5750609854155b6122e15760405162461bcd60e51b81526020600482015260156024820152741152540dcc4c8e88155b9a5b9a5d1a585b1a5e9959605a1b6044820152606401610f8e565b50506040805180820182526011815270415a554b495f585f434f5f4d555345554d60781b6020808301919091528251808401845260058152640302e312e360dc1b8183015283516000808252928101909452600f60f81b9992985096504695503094509250565b61235133611bb1565b61236d5760405162461bcd60e51b8152600401610f8e90614d14565b61012f611bfc828483614d82565b61238361356b565b6101a355565b61239161356b565b6101a155565b60606123a1612b15565b6003018054610e7890614c2d565b806123b8612b15565b336000818152600792909201602090815260408084206001600160a01b03881680865290835293819020805460ff19169515159590951790945592518415158152919290917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b61243533611bb1565b6124515760405162461bcd60e51b8152600401610f8e90614d14565b828181146124a15760405162461bcd60e51b815260206004820152601760248201527f41646d696e206d696e743a2062616420726571756573740000000000000000006044820152606401610f8e565b60005b818110156124fc576124f48686838181106124c1576124c1614cd5565b90506020020160208101906124d69190614678565b8585848181106124e8576124e8614cd5565b90506020020135613a87565b6001016124a4565b505050505050565b61250c61356b565b61019b55565b83838383831561262a57600061252784613a91565b9050600061253482613a36565b905060006125788286868080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250613a6392505050565b610193549091506001600160a01b038083169116146125d05760405162461bcd60e51b8152602060048201526014602482015273155b985d5d1a1bdc9a5e9959081c995c5d595cdd60621b6044820152606401610f8e565b336125de6020880188614678565b6001600160a01b0316146126265760405162461bcd60e51b815260206004820152600f60248201526e125b9d985b1a59081858d8dbdd5b9d608a1b6044820152606401610f8e565b5050505b60008061019354600160a01b900460ff16600281111561264c5761264c614a65565b146126695760405162461bcd60e51b8152600401610f8e90614c61565b612671612c54565b6000805b8d8110156127625760008f8f8381811061269157612691614cd5565b90506020020135905060008e8e848181106126ae576126ae614cd5565b9050602002013590506126c082612c9a565b61019654600083815261019760205260409020546126df908390614d01565b11156127275760405162461bcd60e51b815260206004820152601760248201527610dbcb535d5cd95d5b48195e18d959591cc81b1a5b5a5d604a1b6044820152606401610f8e565b6000828152610197602052604081208054839290612746908490614d01565b9091555061275690508185614d01565b93505050600101612675565b503360009081526101986020908152604090912054908a013590612787908c90614d01565b11156127cd5760405162461bcd60e51b81526020600482015260156024820152741058d8dbdd5b9d08195e18d959591cc81b1a5b5a5d605a1b6044820152606401610f8e565b3360009081526101986020526040812080548c92906127ed908490614d01565b909155506127fd90508a82614d01565b905061280e816101946000806118f8565b61281b60208a018a614678565b6001600160a01b03167f10fcc92ce3ae296b6d2813de054ab2cf2d6dd59a1eed235681bc8bf6c36a5cb78260405161285591815260200190565b60405180910390a25050505050505050505050505050565b612878848484611991565b6001600160a01b0383163b156128a85761289484848484613aee565b6128a8576128a86368d2bf6b60e11b612b99565b50505050565b6128b661356b565b610193805482919060ff60a01b1916600160a01b8360028111156128dc576128dc614a65565b021790555050565b60606128ef82612b39565b61290c57604051630a14c4b560e41b815260040160405180910390fd5b610e5a82613bd0565b60028061019354600160a01b900460ff16600281111561293757612937614a65565b146129545760405162461bcd60e51b8152600401610f8e90614c61565b61295c612c54565b6101a1543360009081526101a2602052604090205461297c908490614d01565b11156129ba5760405162461bcd60e51b815260206004820152600d60248201526c115e18d959591cc81b1a5b5a5d609a1b6044820152606401610f8e565b3360009081526101a26020526040812080548492906129da908490614d01565b909155506129f0905082610194600060026118f8565b6129fa3383613c09565b60405182815233907f10fcc92ce3ae296b6d2813de054ab2cf2d6dd59a1eed235681bc8bf6c36a5cb79060200160405180910390a25050565b612a3b61356b565b61019955565b6000612a4b612b15565b6001600160a01b039384166000908152600791909101602090815260408083209490951682529290925250205460ff1690565b612a8661356b565b61019a55565b612a9461356b565b6001600160a01b038116612af95760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610f8e565b612b0281613963565b50565b60606101308054610e7890614c2d565b7f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c4090565b600081600111612b9457612b4b612b15565b54821015612b945760005b612b5e612b15565b600084815260049190910160205260408120549150819003612b8a57612b8383614e41565b9250612b56565b600160e01b161590505b919050565b8060005260046000fd5b6000612bae83611ff5565b9050818015612bc65750336001600160a01b03821614155b15612be957612bd58133612a41565b612be957612be96367d9dca160e11b612b99565b83612bf2612b15565b6000858152600691909101602052604080822080546001600160a01b0319166001600160a01b0394851617905551859287811692908516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259190a450505050565b60655460ff1615611bdf5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610f8e565b6040516331a9108f60e11b81526004810182905260009073e166a1fc32647ba4ec271b753cc56b5f0870d23290636352211e90602401602060405180830381865afa158015612ced573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d119190614e58565b9050336001600160a01b0382161480612db05750604051632e7cda1d60e21b81526c447e69651d841bd8d104bed4939063b9f3687490612d6f903390859073e166a1fc32647ba4ec271b753cc56b5f0870d232908890600401614e75565b602060405180830381865afa158015612d8c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612db09190614ea6565b610f4b5760405162461bcd60e51b815260206004820152601760248201527f496e76616c696420436f2d4d757365756d206f776e65720000000000000000006044820152606401610f8e565b6040516331a9108f60e11b81526004810182905260009073ed5af388653567af2f388e6224dc7c4b3241c54490636352211e90602401602060405180830381865afa158015612e4f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e739190614e58565b9050336001600160a01b0382161480612f125750604051632e7cda1d60e21b81526c447e69651d841bd8d104bed4939063b9f3687490612ed1903390859073ed5af388653567af2f388e6224dc7c4b3241c544908890600401614e75565b602060405180830381865afa158015612eee573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f129190614ea6565b610f4b5760405162461bcd60e51b815260206004820152601360248201527224b73b30b634b21020bd3ab5b49037bbb732b960691b6044820152606401610f8e565b6040516331a9108f60e11b81526004810182905260009073b6a37b5d14d502c3ab0ae6f3a0e058bc9517786e90636352211e90602401602060405180830381865afa158015612fa7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612fcb9190614e58565b9050336001600160a01b038216148061306a5750604051632e7cda1d60e21b81526c447e69651d841bd8d104bed4939063b9f3687490613029903390859073b6a37b5d14d502c3ab0ae6f3a0e058bc9517786e908890600401614e75565b602060405180830381865afa158015613046573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061306a9190614ea6565b610f4b5760405162461bcd60e51b815260206004820152601e60248201527f496e76616c696420417a756b6920656c656d656e74616c73206f776e657200006044820152606401610f8e565b6040516331a9108f60e11b815260048101829052600090733af2a97414d1101e2107a70e7f33955da134630590636352211e90602401602060405180830381865afa158015613109573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061312d9190614e58565b9050336001600160a01b03821614806131cc5750604051632e7cda1d60e21b81526c447e69651d841bd8d104bed4939063b9f368749061318b9033908590733af2a97414d1101e2107a70e7f33955da1346305908890600401614e75565b602060405180830381865afa1580156131a8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131cc9190614ea6565b610f4b5760405162461bcd60e51b815260206004820152602360248201527f496e76616c696420417a756b6920656c656d656e74616c206265616e7a206f776044820152623732b960e91b6064820152608401610f8e565b6040516331a9108f60e11b81526004810182905260009073f4a7c105cfdc6aabe9ae65bdf2d0df0a567a7ade90636352211e90602401602060405180830381865afa158015613277573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061329b9190614e58565b9050336001600160a01b038216148061333a5750604051632e7cda1d60e21b81526c447e69651d841bd8d104bed4939063b9f36874906132f9903390859073f4a7c105cfdc6aabe9ae65bdf2d0df0a567a7ade908890600401614e75565b602060405180830381865afa158015613316573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061333a9190614ea6565b610f4b5760405162461bcd60e51b815260206004820152601a60248201527f496e76616c696420415243205374656c6c617273206f776e65720000000000006044820152606401610f8e565b6040516331a9108f60e11b81526004810182905260009073306b1ea3ecdf94ab739f1910bbda052ed4a9f94990636352211e90602401602060405180830381865afa1580156133d9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906133fd9190614e58565b9050336001600160a01b038216148061349c5750604051632e7cda1d60e21b81526c447e69651d841bd8d104bed4939063b9f368749061345b903390859073306b1ea3ecdf94ab739f1910bbda052ed4a9f949908890600401614e75565b602060405180830381865afa158015613478573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061349c9190614ea6565b610f4b5760405162461bcd60e51b815260206004820152601360248201527224b73b30b634b2102132b0b73d1037bbb732b960691b6044820152606401610f8e565b60006134ea8284614ec3565b90508034101561352d5760405162461bcd60e51b815260206004820152600e60248201526d09cdee840cadcdeeaced0408aa8960931b6044820152606401610f8e565b80341115611bfc57336108fc6135438334614eda565b6040518115909202916000818181858888f193505050501580156128a8573d6000803e3d6000fd5b6033546001600160a01b03163314611bdf5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610f8e565b600081600111613678576135d7612b15565b60008381526004919091016020526040902054905080600003613665576135fc612b15565b54821061361357613613636f96cda160e11b612b99565b61361b612b15565b60001990920160008181526004939093016020526040909220549050801561361357600160e01b811660000361365057919050565b613660636f96cda160e11b612b99565b613613565b600160e01b811660000361367857919050565b612b94636f96cda160e11b612b99565b6000806000613695612b15565b60009485526006016020525050604090912080549092909150565b6001600160a01b03841615806136ea575060016000838152610195602052604090205460ff1660028111156136e7576136e7614a65565b14155b61372f5760405162461bcd60e51b8152602060048201526016602482015275546f6b656e206e6f74207472616e7366657261626c6560501b6044820152606401610f8e565b6128a8565b61373c613ca2565b6065805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b600054610100900460ff166137ad5760405162461bcd60e51b8152600401610f8e90614eed565b611bdf613ceb565b600054610100900460ff166137dc5760405162461bcd60e51b8152600401610f8e90614eed565b611bdf613d1b565b600054610100900460ff1661380b5760405162461bcd60e51b8152600401610f8e90614eed565b610f4b8282613d4e565b60008051602061514c83398151915254610100900460ff166138495760405162461bcd60e51b8152600401610f8e90614f38565b610f4b8282613d9d565b600054610100900460ff1661387a5760405162461bcd60e51b8152600401610f8e90614eed565b33600090815260cb60205260409020805460ff19166001179055565b600054610100900460ff166120965760405162461bcd60e51b8152600401610f8e90614eed565b600054610100900460ff166138e45760405162461bcd60e51b8152600401610f8e90614eed565b61012f6138f18382614f8c565b50610130611bfc8282614f8c565b600054610100900460ff16611bdf5760405162461bcd60e51b8152600401610f8e90614eed565b61392e612c54565b6065805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586137693390565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60007fcb47c620e4bac89d873a47d71176d24b42a701da50e4400c4fc5eee71211be7182356139ea6040850160208601614b63565b60028111156139fb576139fb614a65565b60408051602081019490945283019190915260ff1660608201526080015b604051602081830303815290604052805190602001209050919050565b6000610e5a613a43613e10565b8360405161190160f01b8152600281019290925260228201526042902090565b6000806000613a728585613e1f565b91509150613a7f81613e64565b509392505050565b610f4b8282613c09565b60007f904116aebab2081d38d8cae3b4fbc5c844749e354a61c1001bc4c71f06596cb2613ac16020840184614678565b604080516020818101949094526001600160a01b0390921690820152908301356060820152608001613a19565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a0290613b2390339089908890889060040161504b565b6020604051808303816000875af1925050508015613b5e575060408051601f3d908101601f19168201909252613b5b91810190615088565b60015b613bb3573d808015613b8c576040519150601f19603f3d011682016040523d82523d6000602084013e613b91565b606091505b508051600003613bab57613bab6368d2bf6b60e11b612b99565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050949350505050565b606061012f613bde83613fae565b610130604051602001613bf393929190615118565b6040516020818303038152906040529050919050565b8060fd5481613c16614040565b613c209190614d01565b1115613c5f5760405162461bcd60e51b815260206004820152600e60248201526d4578636565647320737570706c7960901b6044820152606401610f8e565b323314613c985760405162461bcd60e51b81526020600482015260076024820152664e6f20626f747360c81b6044820152606401610f8e565b611bfc838361404a565b60655460ff16611bdf5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610f8e565b600054610100900460ff16613d125760405162461bcd60e51b8152600401610f8e90614eed565b611bdf33613963565b600054610100900460ff16613d425760405162461bcd60e51b8152600401610f8e90614eed565b6065805460ff19169055565b600054610100900460ff16613d755760405162461bcd60e51b8152600401610f8e90614eed565b6099613d818382614f8c565b50609a613d8e8282614f8c565b50506000609781905560985550565b60008051602061514c83398151915254610100900460ff16613dd15760405162461bcd60e51b8152600401610f8e90614f38565b81613dda612b15565b60020190613de89082614f8c565b5080613df2612b15565b60030190613e009082614f8c565b506001613e0b612b15565b555050565b6000613e1a614064565b905090565b6000808251604103613e555760208301516040840151606085015160001a613e49878285856140d8565b94509450505050613e5d565b506000905060025b9250929050565b6000816004811115613e7857613e78614a65565b03613e805750565b6001816004811115613e9457613e94614a65565b03613ee15760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610f8e565b6002816004811115613ef557613ef5614a65565b03613f425760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610f8e565b6003816004811115613f5657613f56614a65565b03612b025760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610f8e565b60606000613fbb8361419c565b60010190506000816001600160401b03811115613fda57613fda614695565b6040519080825280601f01601f191660200182016040528015614004576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a850494508461400e57509392505050565b6000613e1a611971565b610f4b828260405180602001604052806000815250614274565b60007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f61408f6142e8565b614097614367565b60408051602081019490945283019190915260608201524660808201523060a082015260c00160405160208183030381529060405280519060200120905090565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561410f5750600090506003614193565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015614163573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661418c57600060019250925050614193565b9150600090505b94509492505050565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106141db5772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310614207576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc10000831061422557662386f26fc10000830492506010015b6305f5e100831061423d576305f5e100830492506008015b612710831061425157612710830492506004015b60648310614263576064830492506002015b600a8310610e5a5760010192915050565b61427e83836143b2565b6001600160a01b0383163b15611bfc576000614298612b15565b5490508281035b6142b26000868380600101945086613aee565b6142c6576142c66368d2bf6b60e11b612b99565b81811061429f57816142d6612b15565b54146142e157600080fd5b5050505050565b600080614319604080518082019091526011815270415a554b495f585f434f5f4d555345554d60781b602082015290565b805190915015614330578051602090910120919050565b609754801561433f5792915050565b7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a4709250505090565b60008061438c6040805180820190915260058152640302e312e360dc1b602082015290565b8051909150156143a3578051602090910120919050565b609854801561433f5792915050565b60006143bc612b15565b54905060008290036143d8576143d863b562e8dd60e01b612b99565b6143e560008483856136b0565b6001600160a01b0383164260a01b6001841460e11b1717614404612b15565b6000838152600491909101602052604090205568010000000000000001820261442b612b15565b6001600160a01b038516600081815260059290920160205260408220805490930190925581900361446557614465622e076360e81b612b99565b818301825b808360007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a481816001019150810361446a57816144a9612b15565b5550611bfc915050565b6001600160e01b031981168114612b0257600080fd5b6000602082840312156144db57600080fd5b81356144e6816144b3565b9392505050565b60005b838110156145085781810151838201526020016144f0565b50506000910152565b600081518084526145298160208601602086016144ed565b601f01601f19169290920160200192915050565b6020815260006144e66020830184614511565b60006020828403121561456257600080fd5b5035919050565b6001600160a01b0381168114612b0257600080fd5b8035612b9481614569565b6000806040838503121561459c57600080fd5b82356145a781614569565b946020939093013593505050565b6000602082840312156145c757600080fd5b81356001600160401b038111156145dd57600080fd5b820161018081850312156144e657600080fd5b60008060006060848603121561460557600080fd5b833561461081614569565b9250602084013561462081614569565b929592945050506040919091013590565b8015158114612b0257600080fd5b6000806040838503121561465257600080fd5b823561465d81614569565b9150602083013561466d81614631565b809150509250929050565b60006020828403121561468a57600080fd5b81356144e681614569565b634e487b7160e01b600052604160045260246000fd5b60006001600160401b03808411156146c5576146c5614695565b604051601f8501601f19908116603f011681019082821181831017156146ed576146ed614695565b8160405280935085815286868601111561470657600080fd5b858560208301376000602087830101525050509392505050565b600082601f83011261473157600080fd5b6144e6838335602085016146ab565b60008060008060008060c0878903121561475957600080fd5b86356001600160401b038082111561477057600080fd5b61477c8a838b01614720565b9750602089013591508082111561479257600080fd5b61479e8a838b01614720565b96506040890135955060608901359150808211156147bb57600080fd5b6147c78a838b01614720565b945060808901359150808211156147dd57600080fd5b506147ea89828a01614720565b9250506147f960a0880161457e565b90509295509295509295565b60038110612b0257600080fd5b6000806040838503121561482557600080fd5b82356145a781614805565b60008083601f84011261484257600080fd5b5081356001600160401b0381111561485957600080fd5b602083019150836020828501011115613e5d57600080fd5b6000806020838503121561488457600080fd5b82356001600160401b0381111561489a57600080fd5b6148a685828601614830565b90969095509350505050565b6000604082840312156148c457600080fd5b50919050565b6000806000606084860312156148df57600080fd5b6148e985856148b2565b925060408401356001600160401b0381111561490457600080fd5b61491086828701614830565b9497909650939450505050565b60ff60f81b881681526000602060e0602084015261493e60e084018a614511565b8381036040850152614950818a614511565b606085018990526001600160a01b038816608086015260a0850187905284810360c08601528551808252602080880193509091019060005b818110156149a457835183529284019291840191600101614988565b50909c9b505050505050505050505050565b60008083601f8401126149c857600080fd5b5081356001600160401b038111156149df57600080fd5b6020830191508360208260051b8501011115613e5d57600080fd5b60008060008060408587031215614a1057600080fd5b84356001600160401b0380821115614a2757600080fd5b614a33888389016149b6565b90965094506020870135915080821115614a4c57600080fd5b50614a59878288016149b6565b95989497509550505050565b634e487b7160e01b600052602160045260246000fd5b60038110612b0257634e487b7160e01b600052602160045260246000fd5b60208101614aa683614a7b565b91905290565b60008060008060008060008060c0898b031215614ac857600080fd5b88356001600160401b0380821115614adf57600080fd5b614aeb8c838d016149b6565b909a50985060208b0135915080821115614b0457600080fd5b614b108c838d016149b6565b909850965060408b01359550869150614b2c8c60608d016148b2565b945060a08b0135915080821115614b4257600080fd5b50614b4f8b828c01614830565b999c989b5096995094979396929594505050565b600060208284031215614b7557600080fd5b81356144e681614805565b60008060008060808587031215614b9657600080fd5b8435614ba181614569565b93506020850135614bb181614569565b92506040850135915060608501356001600160401b03811115614bd357600080fd5b8501601f81018713614be457600080fd5b614bf3878235602084016146ab565b91505092959194509250565b60008060408385031215614c1257600080fd5b8235614c1d81614569565b9150602083013561466d81614569565b600181811c90821680614c4157607f821691505b6020821081036148c457634e487b7160e01b600052602260045260246000fd5b602080825260119082015270141a185cd9481b9bdd08195b98589b1959607a1b604082015260600190565b6000808335601e19843603018112614ca357600080fd5b8301803591506001600160401b03821115614cbd57600080fd5b6020019150600581901b3603821315613e5d57600080fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b80820180821115610e5a57610e5a614ceb565b6020808252600c908201526b2737ba1030b71030b236b4b760a11b604082015260600190565b601f821115611bfc576000816000526020600020601f850160051c81016020861015614d635750805b601f850160051c820191505b818110156124fc57828155600101614d6f565b6001600160401b03831115614d9957614d99614695565b614dad83614da78354614c2d565b83614d3a565b6000601f841160018114614de15760008515614dc95750838201355b600019600387901b1c1916600186901b1783556142e1565b600083815260209020601f19861690835b82811015614e125786850135825560209485019460019092019101614df2565b5086821015614e2f5760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b600081614e5057614e50614ceb565b506000190190565b600060208284031215614e6a57600080fd5b81516144e681614569565b6001600160a01b03948516815292841660208401529216604082015260608101919091526000608082015260a00190565b600060208284031215614eb857600080fd5b81516144e681614631565b8082028115828204841417610e5a57610e5a614ceb565b81810381811115610e5a57610e5a614ceb565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b60208082526034908201527f455243373231415f5f496e697469616c697a61626c653a20636f6e7472616374604082015273206973206e6f7420696e697469616c697a696e6760601b606082015260800190565b81516001600160401b03811115614fa557614fa5614695565b614fb981614fb38454614c2d565b84614d3a565b602080601f831160018114614fee5760008415614fd65750858301515b600019600386901b1c1916600185901b1785556124fc565b600085815260208120601f198616915b8281101561501d57888601518255948401946001909101908401614ffe565b508582101561503b5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061507e90830184614511565b9695505050505050565b60006020828403121561509a57600080fd5b81516144e6816144b3565b600081546150b281614c2d565b600182811680156150ca57600181146150df5761510e565b60ff198416875282151583028701945061510e565b8560005260208060002060005b858110156151055781548a8201529084019082016150ec565b50505082870194505b5050505092915050565b600061512482866150a5565b84516151348183602089016144ed565b615140818301866150a5565b97965050505050505056feee151c8401928dc223602bb187aff91b9a56c7cae5476ef1b3287b085a16c85fa264697066735822122076f731978ffcf0c353ea17182a43bde1ab76e510482e4ffa4970b4ff29ed161f64736f6c63430008180033
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.