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 | 20874103 | 17 days ago | IN | 0 ETH | 0.03346487 |
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 "./interfaces/IERC5192.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[] tokenIds; TokenPhase[] phases; } event Presale(address indexed account, uint256 amount); event TokenPhaseChange(uint256 indexed tokenId, TokenPhase tokenPhase); event Locked(uint256 tokenId); event Unlocked(uint256 tokenId); 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[] tokenIds,uint8[] phases)"); 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 adminSetTokensPhase( SetTokenPhaseRequest calldata request_, bytes calldata signature_ ) external whenSetTokenPhaseAuthorized(request_, signature_) { uint256[] memory tokenIds = request_.tokenIds; TokenPhase[] memory phases = request_.phases; require(tokenIds.length == phases.length, "Invalid request"); for (uint256 i = 0; i < tokenIds.length; i++) { uint256 tokenId = tokenIds[i]; TokenPhase tokenPhase = phases[i]; _changeTokenPhase(tokenId, tokenPhase); } } function lockTokens(uint256[] calldata tokenIds) external { for (uint256 i = 0; i < tokenIds.length; i++) { uint256 tokenId = tokenIds[i]; require(msg.sender == ownerOf(tokenId), "Unauthorized request"); _changeTokenPhase(tokenId, TokenPhase.Claimed); } } function getTokensPhase( uint256[] calldata tokenIds ) external view returns (uint8[] memory) { uint8[] memory phases = new uint8[](tokenIds.length); for (uint256 i = 0; i < tokenIds.length; i++) { uint256 tokenId = tokenIds[i]; phases[i] = uint8(tokenPhases[tokenId]); } return phases; } 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 emitLockEvents(uint256[] calldata tokenIds) external onlyOwner { for (uint256 i = 0; i < tokenIds.length; i++) { emit Locked(tokenIds[i]); } } function tokenURI( uint256 tokenId ) public view override returns (string memory) { if (!_exists(tokenId)) { revert URIQueryForNonexistentToken(); } return _buildUri(tokenId); } function locked(uint256 tokenId_) external view returns (bool) { return tokenPhases[tokenId_] == TokenPhase.Claimed; } function supportsInterface( bytes4 interfaceId_ ) public view virtual override returns (bool) { return super.supportsInterface(interfaceId_) || interfaceId_ == type(IERC5192).interfaceId; } function _changeTokenPhase(uint256 tokenId_, TokenPhase phase_) internal { if (phase_ == TokenPhase.Claimed) { emit Locked(tokenId_); } else { emit Unlocked(tokenId_); } tokenPhases[tokenId_] = phase_; emit TokenPhaseChange(tokenId_, phase_); } 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, keccak256(abi.encodePacked(request_.tokenIds)), keccak256( abi.encodePacked(_convertPhasesToUint8(request_.phases)) ) ) ); } function _convertPhasesToUint8( TokenPhase[] memory phases ) internal pure returns (uint8[] memory) { uint8[] memory uint8Phases = new uint8[](phases.length); for (uint i = 0; i < phases.length; i++) { uint8Phases[i] = uint8(phases[i]); } return uint8Phases; } 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: CC0-1.0 pragma solidity ^0.8.0; interface IERC5192 { /// @notice Emitted when the locking status is changed to locked. /// @dev If a token is minted and the status is locked, this event should be emitted. /// @param tokenId The identifier for a token. event Locked(uint256 tokenId); /// @notice Emitted when the locking status is changed to unlocked. /// @dev If a token is minted and the status is unlocked, this event should be emitted. /// @param tokenId The identifier for a token. event Unlocked(uint256 tokenId); /// @notice Returns the locking status of an Soulbound Token /// @dev SBTs assigned to zero address are considered invalid, and queries /// about them do throw. /// @param tokenId The identifier for an SBT. function locked(uint256 tokenId) external view returns (bool); }
//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":false,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Locked","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":"uint256","name":"tokenId","type":"uint256"}],"name":"Unlocked","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":[{"components":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"enum NFTSale.TokenPhase[]","name":"phases","type":"uint8[]"}],"internalType":"struct NFTSale.SetTokenPhaseRequest","name":"request_","type":"tuple"},{"internalType":"bytes","name":"signature_","type":"bytes"}],"name":"adminSetTokensPhase","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":"tokenIds","type":"uint256[]"}],"name":"emitLockEvents","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"getTokensPhase","outputs":[{"internalType":"uint8[]","name":"","type":"uint8[]"}],"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":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"lockTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId_","type":"uint256"}],"name":"locked","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":[],"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
608060405234801561001057600080fd5b5061582780620000216000396000f3fe60806040526004361061047e5760003560e01c80638286eee211610255578063b7fafcd711610144578063d2c8ed4c116100c1578063e985e9c511610085578063e985e9c514610e0d578063f29b4fbc14610e2d578063f2fde38b14610e4d578063f7073c3a14610e6d578063f92c45b714610e82578063ff1473a814610e9957600080fd5b8063d2c8ed4c14610d6c578063d454e0b314610d94578063d5abeb0114610dc1578063de90871f14610dd6578063e7ebdca614610df657600080fd5b8063c87b56dd11610108578063c87b56dd14610ccc578063c9672e2614610cec578063cbccdec314610cff578063cc5dbcf214610d2d578063cd1f5a2914610d5557600080fd5b8063b7fafcd714610c0c578063b88d4fde14610c3a578063bde750fb14610c4d578063c03afb5914610c7b578063c13085db14610c9b57600080fd5b80639831ef2a116101d2578063a9a1d6b011610196578063a9a1d6b014610b62578063b1c9fe6e14610b82578063b2caf79014610bb1578063b45a3c0e14610bd9578063b7e08d4114610bf957600080fd5b80639831ef2a14610a9e57806398ac859e14610acc5780639e7b40d614610af4578063a22cb46514610b22578063a49340cc14610b4257600080fd5b80638692810c116102195780638692810c14610a145780638da5cb5b14610a345780638e8a07b314610a52578063910354c214610a6957806395d89b4114610a8957600080fd5b80638286eee21461097f5780638456cb59146109a057806384b0196e146109b5578063857b9bd4146109dd57806385cb593b146109f457600080fd5b8063413cf93b116103715780636c19e783116102ee57806373af7a40116102b257806373af7a40146108f357806375d5ae9f1461091357806375dadb3214610933578063782312a3146109485780637c5b35a31461095f57600080fd5b80636c19e783146108505780636e820527146108705780636f8b44b01461089e57806370a08231146108be578063715018a6146108de57600080fd5b80635bf6846e116103355780635bf6846e146107b85780635c975abb146107d85780635eff75c1146107f05780636352211e146108105780636a00670b1461083057600080fd5b8063413cf93b1461072057806342842e0e14610740578063481b86ac146107535780634bf47ebd1461076a57806351cff8d91461079857600080fd5b806318160ddd116103ff5780632cb29a0d116103c35780632cb29a0d146106705780632df507be146106875780633c80c1d1146106b55780633d8f833d146106e35780633f4ba83a1461070b57600080fd5b806318160ddd146105e7578063238ac933146105fc57806323b872dd1461061d578063240ff27f1461063057806324d7806c1461065057600080fd5b8063095ea7b311610446578063095ea7b314610554578063096cca7d146105675780631429fbe41461058f57806315720c5f146105b4578063170e1736146105c757600080fd5b806301ffc9a714610483578063046211b0146104b857806306fdde03146104da578063081812fc146104fc578063084b731a14610534575b600080fd5b34801561048f57600080fd5b506104a361049e366004614a30565b610ec7565b60405190151581526020015b60405180910390f35b3480156104c457600080fd5b506104d86104d3366004614aad565b610ef3565b005b3480156104e657600080fd5b506104ef6110bf565b6040516104af9190614b65565b34801561050857600080fd5b5061051c610517366004614b78565b61115a565b6040516001600160a01b0390911681526020016104af565b34801561054057600080fd5b506104d861054f366004614bd5565b61119e565b6104d8610562366004614c36565b611218565b34801561057357600080fd5b5061051c73e166a1fc32647ba4ec271b753cc56b5f0870d23281565b34801561059b57600080fd5b506105a66101965481565b6040519081526020016104af565b6104d86105c2366004614c62565b611228565b3480156105d357600080fd5b506104d86105e2366004614b78565b611c33565b3480156105f357600080fd5b506105a6611c41565b34801561060857600080fd5b506101935461051c906001600160a01b031681565b6104d861062b366004614c9d565b611c61565b34801561063c57600080fd5b506104d861064b366004614cec565b611e31565b34801561065c57600080fd5b506104a361066b366004614d25565b611e81565b34801561067c57600080fd5b506105a66101995481565b34801561069357600080fd5b506105a66106a2366004614b78565b61019d6020526000908152604090205481565b3480156106c157600080fd5b506105a66106d0366004614d25565b6101986020526000908152604090205481565b3480156106ef57600080fd5b5061051c73b6a37b5d14d502c3ab0ae6f3a0e058bc9517786e81565b34801561071757600080fd5b506104d8611e9f565b34801561072c57600080fd5b506104d861073b366004614bd5565b611eb1565b6104d861074e366004614c9d565b611f1d565b34801561075f57600080fd5b506105a661019a5481565b34801561077657600080fd5b506105a6610785366004614b78565b61019e6020526000908152604090205481565b3480156107a457600080fd5b506104d86107b3366004614d25565b611f38565b3480156107c457600080fd5b506104d86107d3366004614ded565b611fd5565b3480156107e457600080fd5b5060655460ff166104a3565b3480156107fc57600080fd5b506104d861080b366004614b78565b61231e565b34801561081c57600080fd5b5061051c61082b366004614b78565b61232c565b34801561083c57600080fd5b506104d861084b366004614ec1565b612337565b34801561085c57600080fd5b506104d861086b366004614d25565b61237d565b34801561087c57600080fd5b506105a661088b366004614b78565b61019f6020526000908152604090205481565b3480156108aa57600080fd5b506104d86108b9366004614b78565b6123a8565b3480156108ca57600080fd5b506105a66108d9366004614d25565b6123d2565b3480156108ea57600080fd5b506104d8612431565b3480156108ff57600080fd5b506104d861090e366004614b78565b612443565b34801561091f57600080fd5b506104d861092e366004614edd565b612451565b34801561093f57600080fd5b506104ef612484565b34801561095457600080fd5b506105a661019c5481565b34801561096b57600080fd5b506104d861097a366004614b78565b612494565b34801561098b57600080fd5b5061051c6c447e69651d841bd8d104bed49381565b3480156109ac57600080fd5b506104d86124a2565b3480156109c157600080fd5b506109ca6124b2565b6040516104af9796959493929190614f12565b3480156109e957600080fd5b506105a66101a65481565b348015610a0057600080fd5b506104d8610a0f366004614edd565b61257d565b348015610a2057600080fd5b506104d8610a2f366004614b78565b6125b0565b348015610a4057600080fd5b506033546001600160a01b031661051c565b348015610a5e57600080fd5b506105a66101a35481565b348015610a7557600080fd5b506104d8610a84366004614b78565b6125be565b348015610a9557600080fd5b506104ef6125cc565b348015610aaa57600080fd5b506105a6610ab9366004614b78565b6101976020526000908152604090205481565b348015610ad857600080fd5b5061051c733af2a97414d1101e2107a70e7f33955da134630581565b348015610b0057600080fd5b506105a6610b0f366004614b78565b6101a76020526000908152604090205481565b348015610b2e57600080fd5b506104d8610b3d366004614cec565b6125e4565b348015610b4e57600080fd5b506104d8610b5d366004614fab565b612661565b348015610b6e57600080fd5b506104d8610b7d366004614b78565b612739565b348015610b8e57600080fd5b5061019354610ba490600160a01b900460ff1681565b6040516104af919061504a565b348015610bbd57600080fd5b5061051c73f4a7c105cfdc6aabe9ae65bdf2d0df0a567a7ade81565b348015610be557600080fd5b506104a3610bf4366004614b78565b612747565b6104d8610c0736600461505d565b612776565b348015610c1857600080fd5b506105a6610c27366004615114565b6101946020526000908152604090205481565b6104d8610c4836600461512f565b612aaa565b348015610c5957600080fd5b506105a6610c68366004614b78565b6101a46020526000908152604090205481565b348015610c8757600080fd5b506104d8610c96366004615114565b612aeb565b348015610ca757600080fd5b50610ba4610cb6366004614b78565b6101956020526000908152604090205460ff1681565b348015610cd857600080fd5b506104ef610ce7366004614b78565b612b21565b6104d8610cfa366004614b78565b612b52565b348015610d0b57600080fd5b506105a6610d1a366004614d25565b6101a26020526000908152604090205481565b348015610d3957600080fd5b5061051c73306b1ea3ecdf94ab739f1910bbda052ed4a9f94981565b348015610d6157600080fd5b506105a66101a15481565b348015610d7857600080fd5b5061051c73ed5af388653567af2f388e6224dc7c4b3241c54481565b348015610da057600080fd5b50610db4610daf366004614bd5565b612c71565b6040516104af91906151ae565b348015610dcd57600080fd5b5060fd546105a6565b348015610de257600080fd5b506104d8610df1366004614b78565b612d40565b348015610e0257600080fd5b506105a661019b5481565b348015610e1957600080fd5b506104a3610e283660046151f5565b612d4e565b348015610e3957600080fd5b506104d8610e48366004614b78565b612d8b565b348015610e5957600080fd5b506104d8610e68366004614d25565b612d99565b348015610e7957600080fd5b506104ef612e12565b348015610e8e57600080fd5b506105a66101a55481565b348015610ea557600080fd5b506105a6610eb4366004614b78565b6101a06020526000908152604090205481565b6000610ed282612e22565b80610eed57506001600160e01b03198216635a2d1e0760e11b145b92915050565b8282826000610f0184612e70565b90506000610f0e82612f6c565b90506000610f528286868080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250612f9992505050565b610193549091506001600160a01b03808316911614610f8c5760405162461bcd60e51b8152600401610f8390615223565b60405180910390fd5b6000610f988a80615251565b808060200260200160405190810160405280939291908181526020018383602002808284376000920182905250939450610fd99250505060208c018c615251565b80806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250508251855193945092909214915061105590505760405162461bcd60e51b815260206004820152600f60248201526e125b9d985b1a59081c995c5d595cdd608a1b6044820152606401610f83565b60005b82518110156110b15760008382815181106110755761107561529a565b6020026020010151905060008383815181106110935761109361529a565b602002602001015190506110a78282612fb5565b5050600101611058565b505050505050505050505050565b60606110c961309b565b60020180546110d7906152b0565b80601f0160208091040260200160405190810160405280929190818152602001828054611103906152b0565b80156111505780601f1061112557610100808354040283529160200191611150565b820191906000526020600020905b81548152906001019060200180831161113357829003601f168201915b5050505050905090565b6000611165826130bf565b611179576111796333d1c03960e21b61311f565b61118161309b565b60009283526006016020525060409020546001600160a01b031690565b60005b818110156112135760008383838181106111bd576111bd61529a565b9050602002013590506111cf8161232c565b6001600160a01b0316336001600160a01b0316146111ff5760405162461bcd60e51b8152600401610f8390615223565b61120a816001612fb5565b506001016111a1565b505050565b61122482826001613129565b5050565b60018061019354600160a01b900460ff16600281111561124a5761124a615016565b146112675760405162461bcd60e51b8152600401610f83906152e4565b61126f6131da565b600061127b8380615251565b8080602002602001604051908101604052809392919081815260200183836020028082843760009201829052509394506112bc925050506020850185615251565b8080602002602001604051908101604052809392919081815260200183836020028082843760009201829052509394506112fd925050506040860186615251565b80806020026020016040519081016040528093929190818152602001838360200280828437600092018290525093945061133e925050506060870187615251565b80806020026020016040519081016040528093929190818152602001838360200280828437600092018290525093945061137f925050506080880188615251565b8080602002602001604051908101604052809392919081815260200183836020028082843760009201829052509394506113c09250505060a0890189615251565b8080602002602001604051908101604052809392919081815260200183836020028082843760009201829052509394506114019250505060c08a018a615251565b8080602002602001604051908101604052809392919081815260200183836020028082843760009201829052509394506114429250505060e08b018b615251565b808060200260200160405190810160405280939291908181526020018383602002808284376000920182905250939450611484925050506101008c018c615251565b8080602002602001604051908101604052809392919081815260200183836020028082843760009201829052509394506114c6925050506101208d018d615251565b808060200260200160405190810160405280939291908181526020018383602002808284376000920182905250939450611508925050506101408e018e615251565b80806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f82011690508083019250505050505050905060008d80610160019061155d9190615251565b80806020026020016040519081016040528093929190818152602001838360200280828437600092018290525093945083925050505b8d518110156116835760008e82815181106115b0576115b061529a565b6020026020010151905060008e83815181106115ce576115ce61529a565b602002602001015190506115e182613220565b61019954600083815261019d6020526040902054611600908390615325565b11156116485760405162461bcd60e51b815260206004820152601760248201527610dbcb535d5cd95d5b48195e18d959591cc81b1a5b5a5d604a1b6044820152606401610f83565b600082815261019d602052604081208054839290611667908490615325565b9091555061167790508185615325565b93505050600101611593565b5060005b8b518110156117735760008c82815181106116a4576116a461529a565b6020026020010151905060008c83815181106116c2576116c261529a565b602002602001015190506116d582613382565b61019a54600083815261019e60205260409020546116f4908390615325565b11156117385760405162461bcd60e51b8152602060048201526013602482015272105e9d5ada48195e18d959591cc81b1a5b5a5d606a1b6044820152606401610f83565b600082815261019e602052604081208054839290611757908490615325565b9091555061176790508185615325565b93505050600101611687565b5060005b895181101561186d5760008a82815181106117945761179461529a565b6020026020010151905060008a83815181106117b2576117b261529a565b602002602001015190506117c5826134da565b61019b54600083815261019f60205260409020546117e4908390615325565b11156118325760405162461bcd60e51b815260206004820152601d60248201527f417a756b6920656c656d656e74616c2065786365656473206c696d69740000006044820152606401610f83565b600082815261019f602052604081208054839290611851908490615325565b9091555061186190508185615325565b93505050600101611777565b5060005b875181101561196757600088828151811061188e5761188e61529a565b6020026020010151905060008883815181106118ac576118ac61529a565b602002602001015190506118bf8261363c565b61019c5460008381526101a060205260409020546118de908390615325565b111561192c5760405162461bcd60e51b815260206004820152601d60248201527f417a756b6920656c656d656e74616c2065786365656473206c696d69740000006044820152606401610f83565b60008281526101a060205260408120805483929061194b908490615325565b9091555061195b90508185615325565b93505050600101611871565b5060005b8551811015611a615760008682815181106119885761198861529a565b6020026020010151905060008683815181106119a6576119a661529a565b602002602001015190506119b9826137aa565b6101a35460008381526101a460205260409020546119d8908390615325565b1115611a265760405162461bcd60e51b815260206004820152601a60248201527f415243205374656c6c6172732065786365656473206c696d69740000000000006044820152606401610f83565b60008281526101a4602052604081208054839290611a45908490615325565b90915550611a5590508185615325565b9350505060010161196b565b5060005b8351811015611b51576000848281518110611a8257611a8261529a565b602002602001015190506000848381518110611aa057611aa061529a565b60200260200101519050611ab38261390c565b6101a65460008381526101a76020526040902054611ad2908390615325565b1115611b165760405162461bcd60e51b81526020600482015260136024820152721099585b9e88195e18d959591cc81b1a5b5a5d606a1b6044820152606401610f83565b60008281526101a7602052604081208054839290611b35908490615325565b90915550611b4590508185615325565b93505050600101611a65565b5060fd54816101a554611b649190615325565b1115611ba35760405162461bcd60e51b815260206004820152600e60248201526d4578636565647320737570706c7960901b6044820152606401610f83565b806101a56000828254611bb69190615325565b90915550611bed905081610194600060015b6002811115611bd957611bd9615016565b815260200190815260200160002054613a64565b60405181815233907f10fcc92ce3ae296b6d2813de054ab2cf2d6dd59a1eed235681bc8bf6c36a5cb79060200160405180910390a2505050505050505050505050505050565b611c3b613af1565b6101a555565b60006001611c4d61309b565b60010154611c5961309b565b540303905090565b6000611c6c82613b4b565b6001600160a01b039485169490915081168414611c9257611c9262a1148160e81b61311f565b600080611c9e84613c0e565b91509150611cc38187611cae3390565b6001600160a01b039081169116811491141790565b611ce557611cd18633612d4e565b611ce557611ce5632ce44b5f60e11b61311f565b611cf28686866001613c36565b8015611cfd57600082555b611d0561309b565b6001600160a01b0387166000908152600591909101602052604090208054600019019055611d3161309b565b6001600160a01b03861660008181526005929092016020526040909120805460010190554260a01b17600160e11b17611d6861309b565b60008681526004919091016020526040812091909155600160e11b84169003611dde5760018401611d9761309b565b600082815260049190910160205260408120549003611ddc57611db861309b565b548114611ddc5783611dc861309b565b600083815260049190910160205260409020555b505b6001600160a01b0385168481887fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a480600003611e2857611e28633a954ecd60e21b61311f565b50505050505050565b611e3a33611e81565b611e565760405162461bcd60e51b8152600401610f8390615338565b6001600160a01b0391909116600090815260cb60205260409020805460ff1916911515919091179055565b6001600160a01b0316600090815260cb602052604090205460ff1690565b611ea7613af1565b611eaf613cba565b565b611eb9613af1565b60005b81811015611213577f032bc66be43dbccb7487781d168eb7bda224628a3b2c3388bdf69b532a3a1611838383818110611ef757611ef761529a565b90506020020135604051611f0d91815260200190565b60405180910390a1600101611ebc565b61121383838360405180602001604052806000815250612aaa565b611f40613af1565b6000816001600160a01b03164760405160006040518083038185875af1925050503d8060008114611f8d576040519150601f19603f3d011682016040523d82523d6000602084013e611f92565b606091505b50509050806112245760405162461bcd60e51b815260206004820152600f60248201526e15da5d1a191c985dc819985a5b1959608a1b6044820152606401610f83565b6000805160206157d283398151915254610100900460ff1661200a576000805160206157d28339815191525460ff161561200e565b303b155b6120805760405162461bcd60e51b815260206004820152603760248201527f455243373231415f5f496e697469616c697a61626c653a20636f6e747261637460448201527f20697320616c726561647920696e697469616c697a65640000000000000000006064820152608401610f83565b6000805160206157d283398151915254610100900460ff161580156120bc576000805160206157d2833981519152805461ffff19166101011790555b600054610100900460ff16158080156120dc5750600054600160ff909116105b806120f65750303b1580156120f6575060005460ff166001145b6121595760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610f83565b6000805460ff19166001179055801561217c576000805461ff0019166101001790555b612184613d0c565b61218c613d3b565b6121b46040518060200160405280600081525060405180602001604052806000815250613d6a565b6121be8888613d9b565b6121c6613dd9565b6121cf86613e1c565b6121d98585613e43565b6121e1613e85565b6121e9613eac565b61019380546001600160a81b0319166001600160a01b03851617905561019460205267013c3107490280007fac2681a0ffcdeb8d930437e36dc6669c17d1245fb57aa4cfab8f62b41ea51f818190557f431122e4fe9c44f5a319c6d2afd7cf7bcc21253a0483556b9b40b9255f70a15e819055600260008190527f4f2fafccb5d28f3aaff6cbdf8ff32db4167d35308651b7acedb7127f6ec061859190915561019681905561019981905561019a819055600161019b81905561019c556101a35560056101a15580156122f6576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b508015611e285750506000805160206157d2833981519152805461ff00191690555050505050565b612326613af1565b61019655565b6000610eed82613b4b565b61233f613af1565b80610194600084600281111561235757612357615016565b600281111561236857612368615016565b81526020810191909152604001600020555050565b612385613af1565b61019380546001600160a01b0319166001600160a01b0392909216919091179055565b6123b133611e81565b6123cd5760405162461bcd60e51b8152600401610f8390615338565b60fd55565b60006001600160a01b0382166123f2576123f26323d3ad8160e21b61311f565b6001600160401b0361240261309b565b6005016000846001600160a01b03166001600160a01b0316815260200190815260200160002054169050919050565b612439613af1565b611eaf6000613ee9565b61244b613af1565b61019c55565b61245a33611e81565b6124765760405162461bcd60e51b8152600401610f8390615338565b6101306112138284836153a6565b606061012f80546110d7906152b0565b61249c613af1565b6101a655565b6124aa613af1565b611eaf613eac565b6000606080600080600060606097546000801b1480156124d25750609854155b6125165760405162461bcd60e51b81526020600482015260156024820152741152540dcc4c8e88155b9a5b9a5d1a585b1a5e9959605a1b6044820152606401610f83565b50506040805180820182526011815270415a554b495f585f434f5f4d555345554d60781b6020808301919091528251808401845260058152640302e312e360dc1b8183015283516000808252928101909452600f60f81b9992985096504695503094509250565b61258633611e81565b6125a25760405162461bcd60e51b8152600401610f8390615338565b61012f6112138284836153a6565b6125b8613af1565b6101a355565b6125c6613af1565b6101a155565b60606125d661309b565b60030180546110d7906152b0565b806125ed61309b565b336000818152600792909201602090815260408084206001600160a01b03881680865290835293819020805460ff19169515159590951790945592518415158152919290917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b61266a33611e81565b6126865760405162461bcd60e51b8152600401610f8390615338565b828181146126d65760405162461bcd60e51b815260206004820152601760248201527f41646d696e206d696e743a2062616420726571756573740000000000000000006044820152606401610f83565b60005b81811015612731576127298686838181106126f6576126f661529a565b905060200201602081019061270b9190614d25565b85858481811061271d5761271d61529a565b90506020020135613f3b565b6001016126d9565b505050505050565b612741613af1565b61019b55565b600060016000838152610195602052604090205460ff16600281111561276f5761276f615016565b1492915050565b83838383831561286757600061278b84613f45565b9050600061279882612f6c565b905060006127dc8286868080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250612f9992505050565b610193549091506001600160a01b0380831691161461280d5760405162461bcd60e51b8152600401610f8390615223565b3361281b6020880188614d25565b6001600160a01b0316146128635760405162461bcd60e51b815260206004820152600f60248201526e125b9d985b1a59081858d8dbdd5b9d608a1b6044820152606401610f83565b5050505b60008061019354600160a01b900460ff16600281111561288957612889615016565b146128a65760405162461bcd60e51b8152600401610f83906152e4565b6128ae6131da565b6000805b8d81101561299f5760008f8f838181106128ce576128ce61529a565b90506020020135905060008e8e848181106128eb576128eb61529a565b9050602002013590506128fd82613220565b610196546000838152610197602052604090205461291c908390615325565b11156129645760405162461bcd60e51b815260206004820152601760248201527610dbcb535d5cd95d5b48195e18d959591cc81b1a5b5a5d604a1b6044820152606401610f83565b6000828152610197602052604081208054839290612983908490615325565b9091555061299390508185615325565b935050506001016128b2565b503360009081526101986020908152604090912054908a0135906129c4908c90615325565b1115612a0a5760405162461bcd60e51b81526020600482015260156024820152741058d8dbdd5b9d08195e18d959591cc81b1a5b5a5d605a1b6044820152606401610f83565b3360009081526101986020526040812080548c9290612a2a908490615325565b90915550612a3a90508a82615325565b9050612a4b81610194600080611bc8565b612a5860208a018a614d25565b6001600160a01b03167f10fcc92ce3ae296b6d2813de054ab2cf2d6dd59a1eed235681bc8bf6c36a5cb782604051612a9291815260200190565b60405180910390a25050505050505050505050505050565b612ab5848484611c61565b6001600160a01b0383163b15612ae557612ad184848484613fa2565b612ae557612ae56368d2bf6b60e11b61311f565b50505050565b612af3613af1565b610193805482919060ff60a01b1916600160a01b836002811115612b1957612b19615016565b021790555050565b6060612b2c826130bf565b612b4957604051630a14c4b560e41b815260040160405180910390fd5b610eed82614084565b60028061019354600160a01b900460ff166002811115612b7457612b74615016565b14612b915760405162461bcd60e51b8152600401610f83906152e4565b612b996131da565b6101a1543360009081526101a26020526040902054612bb9908490615325565b1115612bf75760405162461bcd60e51b815260206004820152600d60248201526c115e18d959591cc81b1a5b5a5d609a1b6044820152606401610f83565b3360009081526101a2602052604081208054849290612c17908490615325565b90915550612c2d90508261019460006002611bc8565b612c3733836140bd565b60405182815233907f10fcc92ce3ae296b6d2813de054ab2cf2d6dd59a1eed235681bc8bf6c36a5cb7906020015b60405180910390a25050565b60606000826001600160401b03811115612c8d57612c8d614d42565b604051908082528060200260200182016040528015612cb6578160200160208202803683370190505b50905060005b83811015612d38576000858583818110612cd857612cd861529a565b6020908102929092013560008181526101959093526040909220549192505060ff166002811115612d0b57612d0b615016565b838381518110612d1d57612d1d61529a565b60ff9092166020928302919091019091015250600101612cbc565b509392505050565b612d48613af1565b61019955565b6000612d5861309b565b6001600160a01b039384166000908152600791909101602090815260408083209490951682529290925250205460ff1690565b612d93613af1565b61019a55565b612da1613af1565b6001600160a01b038116612e065760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610f83565b612e0f81613ee9565b50565b606061013080546110d7906152b0565b60006301ffc9a760e01b6001600160e01b031983161480612e5357506380ac58cd60e01b6001600160e01b03198316145b80610eed5750506001600160e01b031916635b5e139f60e01b1490565b60007f780db704172bf30eb0a6bf00bb2884f530193152cc89f7a8487c2adb179519d1612e9d8380615251565b604051602001612eae929190615465565b60405160208183030381529060405280519060200120612f0e848060200190612ed79190615251565b8080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061415692505050565b604051602001612f1e919061548e565b60408051601f1981840301815282825280516020918201209083019490945281019190915260608101919091526080015b604051602081830303815290604052805190602001209050919050565b6000610eed612f79614209565b8360405161190160f01b8152600281019290925260228201526042902090565b6000806000612fa88585614218565b91509150612d388161425d565b6001816002811115612fc957612fc9615016565b03613006576040518281527f032bc66be43dbccb7487781d168eb7bda224628a3b2c3388bdf69b532a3a16119060200160405180910390a161303a565b6040518281527ff27b6ce5b2f5e68ddb2fd95a8a909d4ecf1daaac270935fff052feacb24f18429060200160405180910390a15b600082815261019560205260409020805482919060ff1916600183600281111561306657613066615016565b0217905550817f92b778e5d3324b34627600713b43857de3c5f6f8efdcb9435b17198a3888c2dc82604051612c65919061504a565b7f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c4090565b60008160011161311a576130d161309b565b5482101561311a5760005b6130e461309b565b60008481526004919091016020526040812054915081900361311057613109836154c7565b92506130dc565b600160e01b161590505b919050565b8060005260046000fd5b60006131348361232c565b905081801561314c5750336001600160a01b03821614155b1561316f5761315b8133612d4e565b61316f5761316f6367d9dca160e11b61311f565b8361317861309b565b6000858152600691909101602052604080822080546001600160a01b0319166001600160a01b0394851617905551859287811692908516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259190a450505050565b60655460ff1615611eaf5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610f83565b6040516331a9108f60e11b81526004810182905260009073e166a1fc32647ba4ec271b753cc56b5f0870d23290636352211e90602401602060405180830381865afa158015613273573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061329791906154de565b9050336001600160a01b03821614806133365750604051632e7cda1d60e21b81526c447e69651d841bd8d104bed4939063b9f36874906132f5903390859073e166a1fc32647ba4ec271b753cc56b5f0870d2329088906004016154fb565b602060405180830381865afa158015613312573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613336919061552c565b6112245760405162461bcd60e51b815260206004820152601760248201527f496e76616c696420436f2d4d757365756d206f776e65720000000000000000006044820152606401610f83565b6040516331a9108f60e11b81526004810182905260009073ed5af388653567af2f388e6224dc7c4b3241c54490636352211e90602401602060405180830381865afa1580156133d5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906133f991906154de565b9050336001600160a01b03821614806134985750604051632e7cda1d60e21b81526c447e69651d841bd8d104bed4939063b9f3687490613457903390859073ed5af388653567af2f388e6224dc7c4b3241c5449088906004016154fb565b602060405180830381865afa158015613474573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613498919061552c565b6112245760405162461bcd60e51b815260206004820152601360248201527224b73b30b634b21020bd3ab5b49037bbb732b960691b6044820152606401610f83565b6040516331a9108f60e11b81526004810182905260009073b6a37b5d14d502c3ab0ae6f3a0e058bc9517786e90636352211e90602401602060405180830381865afa15801561352d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061355191906154de565b9050336001600160a01b03821614806135f05750604051632e7cda1d60e21b81526c447e69651d841bd8d104bed4939063b9f36874906135af903390859073b6a37b5d14d502c3ab0ae6f3a0e058bc9517786e9088906004016154fb565b602060405180830381865afa1580156135cc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906135f0919061552c565b6112245760405162461bcd60e51b815260206004820152601e60248201527f496e76616c696420417a756b6920656c656d656e74616c73206f776e657200006044820152606401610f83565b6040516331a9108f60e11b815260048101829052600090733af2a97414d1101e2107a70e7f33955da134630590636352211e90602401602060405180830381865afa15801561368f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906136b391906154de565b9050336001600160a01b03821614806137525750604051632e7cda1d60e21b81526c447e69651d841bd8d104bed4939063b9f36874906137119033908590733af2a97414d1101e2107a70e7f33955da13463059088906004016154fb565b602060405180830381865afa15801561372e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613752919061552c565b6112245760405162461bcd60e51b815260206004820152602360248201527f496e76616c696420417a756b6920656c656d656e74616c206265616e7a206f776044820152623732b960e91b6064820152608401610f83565b6040516331a9108f60e11b81526004810182905260009073f4a7c105cfdc6aabe9ae65bdf2d0df0a567a7ade90636352211e90602401602060405180830381865afa1580156137fd573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061382191906154de565b9050336001600160a01b03821614806138c05750604051632e7cda1d60e21b81526c447e69651d841bd8d104bed4939063b9f368749061387f903390859073f4a7c105cfdc6aabe9ae65bdf2d0df0a567a7ade9088906004016154fb565b602060405180830381865afa15801561389c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906138c0919061552c565b6112245760405162461bcd60e51b815260206004820152601a60248201527f496e76616c696420415243205374656c6c617273206f776e65720000000000006044820152606401610f83565b6040516331a9108f60e11b81526004810182905260009073306b1ea3ecdf94ab739f1910bbda052ed4a9f94990636352211e90602401602060405180830381865afa15801561395f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061398391906154de565b9050336001600160a01b0382161480613a225750604051632e7cda1d60e21b81526c447e69651d841bd8d104bed4939063b9f36874906139e1903390859073306b1ea3ecdf94ab739f1910bbda052ed4a9f9499088906004016154fb565b602060405180830381865afa1580156139fe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613a22919061552c565b6112245760405162461bcd60e51b815260206004820152601360248201527224b73b30b634b2102132b0b73d1037bbb732b960691b6044820152606401610f83565b6000613a708284615549565b905080341015613ab35760405162461bcd60e51b815260206004820152600e60248201526d09cdee840cadcdeeaced0408aa8960931b6044820152606401610f83565b8034111561121357336108fc613ac98334615560565b6040518115909202916000818181858888f19350505050158015612ae5573d6000803e3d6000fd5b6033546001600160a01b03163314611eaf5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610f83565b600081600111613bfe57613b5d61309b565b60008381526004919091016020526040902054905080600003613beb57613b8261309b565b548210613b9957613b99636f96cda160e11b61311f565b613ba161309b565b600019909201600081815260049390930160205260409092205490508015613b9957600160e01b8116600003613bd657919050565b613be6636f96cda160e11b61311f565b613b99565b600160e01b8116600003613bfe57919050565b61311a636f96cda160e11b61311f565b6000806000613c1b61309b565b60009485526006016020525050604090912080549092909150565b6001600160a01b0384161580613c70575060016000838152610195602052604090205460ff166002811115613c6d57613c6d615016565b14155b613cb55760405162461bcd60e51b8152602060048201526016602482015275546f6b656e206e6f74207472616e7366657261626c6560501b6044820152606401610f83565b612ae5565b613cc26143a7565b6065805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b600054610100900460ff16613d335760405162461bcd60e51b8152600401610f8390615573565b611eaf6143f0565b600054610100900460ff16613d625760405162461bcd60e51b8152600401610f8390615573565b611eaf614420565b600054610100900460ff16613d915760405162461bcd60e51b8152600401610f8390615573565b6112248282614453565b6000805160206157d283398151915254610100900460ff16613dcf5760405162461bcd60e51b8152600401610f83906155be565b61122482826144a2565b600054610100900460ff16613e005760405162461bcd60e51b8152600401610f8390615573565b33600090815260cb60205260409020805460ff19166001179055565b600054610100900460ff166123cd5760405162461bcd60e51b8152600401610f8390615573565b600054610100900460ff16613e6a5760405162461bcd60e51b8152600401610f8390615573565b61012f613e778382615612565b506101306112138282615612565b600054610100900460ff16611eaf5760405162461bcd60e51b8152600401610f8390615573565b613eb46131da565b6065805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258613cef3390565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b61122482826140bd565b60007f904116aebab2081d38d8cae3b4fbc5c844749e354a61c1001bc4c71f06596cb2613f756020840184614d25565b604080516020818101949094526001600160a01b0390921690820152908301356060820152608001612f4f565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a0290613fd79033908990889088906004016156d1565b6020604051808303816000875af1925050508015614012575060408051601f3d908101601f1916820190925261400f9181019061570e565b60015b614067573d808015614040576040519150601f19603f3d011682016040523d82523d6000602084013e614045565b606091505b50805160000361405f5761405f6368d2bf6b60e11b61311f565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050949350505050565b606061012f61409283614515565b6101306040516020016140a79392919061579e565b6040516020818303038152906040529050919050565b8060fd54816140ca6145a7565b6140d49190615325565b11156141135760405162461bcd60e51b815260206004820152600e60248201526d4578636565647320737570706c7960901b6044820152606401610f83565b32331461414c5760405162461bcd60e51b81526020600482015260076024820152664e6f20626f747360c81b6044820152606401610f83565b61121383836145b1565b6060600082516001600160401b0381111561417357614173614d42565b60405190808252806020026020018201604052801561419c578160200160208202803683370190505b50905060005b8351811015614202578381815181106141bd576141bd61529a565b602002602001015160028111156141d6576141d6615016565b8282815181106141e8576141e861529a565b60ff909216602092830291909101909101526001016141a2565b5092915050565b60006142136145cb565b905090565b600080825160410361424e5760208301516040840151606085015160001a6142428782858561463f565b94509450505050614256565b506000905060025b9250929050565b600081600481111561427157614271615016565b036142795750565b600181600481111561428d5761428d615016565b036142da5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610f83565b60028160048111156142ee576142ee615016565b0361433b5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610f83565b600381600481111561434f5761434f615016565b03612e0f5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610f83565b60655460ff16611eaf5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610f83565b600054610100900460ff166144175760405162461bcd60e51b8152600401610f8390615573565b611eaf33613ee9565b600054610100900460ff166144475760405162461bcd60e51b8152600401610f8390615573565b6065805460ff19169055565b600054610100900460ff1661447a5760405162461bcd60e51b8152600401610f8390615573565b60996144868382615612565b50609a6144938282615612565b50506000609781905560985550565b6000805160206157d283398151915254610100900460ff166144d65760405162461bcd60e51b8152600401610f83906155be565b816144df61309b565b600201906144ed9082615612565b50806144f761309b565b600301906145059082615612565b50600161451061309b565b555050565b6060600061452283614703565b60010190506000816001600160401b0381111561454157614541614d42565b6040519080825280601f01601f19166020018201604052801561456b576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a850494508461457557509392505050565b6000614213611c41565b6112248282604051806020016040528060008152506147db565b60007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6145f661484f565b6145fe6148ce565b60408051602081019490945283019190915260608201524660808201523060a082015260c00160405160208183030381529060405280519060200120905090565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561467657506000905060036146fa565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156146ca573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166146f3576000600192509250506146fa565b9150600090505b94509492505050565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106147425772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef8100000000831061476e576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc10000831061478c57662386f26fc10000830492506010015b6305f5e10083106147a4576305f5e100830492506008015b61271083106147b857612710830492506004015b606483106147ca576064830492506002015b600a8310610eed5760010192915050565b6147e58383614919565b6001600160a01b0383163b156112135760006147ff61309b565b5490508281035b6148196000868380600101945086613fa2565b61482d5761482d6368d2bf6b60e11b61311f565b818110614806578161483d61309b565b541461484857600080fd5b5050505050565b600080614880604080518082019091526011815270415a554b495f585f434f5f4d555345554d60781b602082015290565b805190915015614897578051602090910120919050565b60975480156148a65792915050565b7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a4709250505090565b6000806148f36040805180820190915260058152640302e312e360dc1b602082015290565b80519091501561490a578051602090910120919050565b60985480156148a65792915050565b600061492361309b565b549050600082900361493f5761493f63b562e8dd60e01b61311f565b61494c6000848385613c36565b6001600160a01b0383164260a01b6001841460e11b171761496b61309b565b6000838152600491909101602052604090205568010000000000000001820261499261309b565b6001600160a01b03851660008181526005929092016020526040822080549093019092558190036149cc576149cc622e076360e81b61311f565b818301825b808360007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a48181600101915081036149d15781614a1061309b565b5550611213915050565b6001600160e01b031981168114612e0f57600080fd5b600060208284031215614a4257600080fd5b8135614a4d81614a1a565b9392505050565b600060408284031215614a6657600080fd5b50919050565b60008083601f840112614a7e57600080fd5b5081356001600160401b03811115614a9557600080fd5b60208301915083602082850101111561425657600080fd5b600080600060408486031215614ac257600080fd5b83356001600160401b0380821115614ad957600080fd5b614ae587838801614a54565b94506020860135915080821115614afb57600080fd5b50614b0886828701614a6c565b9497909650939450505050565b60005b83811015614b30578181015183820152602001614b18565b50506000910152565b60008151808452614b51816020860160208601614b15565b601f01601f19169290920160200192915050565b602081526000614a4d6020830184614b39565b600060208284031215614b8a57600080fd5b5035919050565b60008083601f840112614ba357600080fd5b5081356001600160401b03811115614bba57600080fd5b6020830191508360208260051b850101111561425657600080fd5b60008060208385031215614be857600080fd5b82356001600160401b03811115614bfe57600080fd5b614c0a85828601614b91565b90969095509350505050565b6001600160a01b0381168114612e0f57600080fd5b803561311a81614c16565b60008060408385031215614c4957600080fd5b8235614c5481614c16565b946020939093013593505050565b600060208284031215614c7457600080fd5b81356001600160401b03811115614c8a57600080fd5b82016101808185031215614a4d57600080fd5b600080600060608486031215614cb257600080fd5b8335614cbd81614c16565b92506020840135614ccd81614c16565b929592945050506040919091013590565b8015158114612e0f57600080fd5b60008060408385031215614cff57600080fd5b8235614d0a81614c16565b91506020830135614d1a81614cde565b809150509250929050565b600060208284031215614d3757600080fd5b8135614a4d81614c16565b634e487b7160e01b600052604160045260246000fd5b60006001600160401b0380841115614d7257614d72614d42565b604051601f8501601f19908116603f01168101908282118183101715614d9a57614d9a614d42565b81604052809350858152868686011115614db357600080fd5b858560208301376000602087830101525050509392505050565b600082601f830112614dde57600080fd5b614a4d83833560208501614d58565b60008060008060008060c08789031215614e0657600080fd5b86356001600160401b0380821115614e1d57600080fd5b614e298a838b01614dcd565b97506020890135915080821115614e3f57600080fd5b614e4b8a838b01614dcd565b9650604089013595506060890135915080821115614e6857600080fd5b614e748a838b01614dcd565b94506080890135915080821115614e8a57600080fd5b50614e9789828a01614dcd565b925050614ea660a08801614c2b565b90509295509295509295565b80356003811061311a57600080fd5b60008060408385031215614ed457600080fd5b614c5483614eb2565b60008060208385031215614ef057600080fd5b82356001600160401b03811115614f0657600080fd5b614c0a85828601614a6c565b60ff60f81b881681526000602060e06020840152614f3360e084018a614b39565b8381036040850152614f45818a614b39565b606085018990526001600160a01b038816608086015260a0850187905284810360c08601528551808252602080880193509091019060005b81811015614f9957835183529284019291840191600101614f7d565b50909c9b505050505050505050505050565b60008060008060408587031215614fc157600080fd5b84356001600160401b0380821115614fd857600080fd5b614fe488838901614b91565b90965094506020870135915080821115614ffd57600080fd5b5061500a87828801614b91565b95989497509550505050565b634e487b7160e01b600052602160045260246000fd5b60038110612e0f57634e487b7160e01b600052602160045260246000fd5b602081016150578361502c565b91905290565b60008060008060008060008060c0898b03121561507957600080fd5b88356001600160401b038082111561509057600080fd5b61509c8c838d01614b91565b909a50985060208b01359150808211156150b557600080fd5b6150c18c838d01614b91565b909850965060408b013595508691506150dd8c60608d01614a54565b945060a08b01359150808211156150f357600080fd5b506151008b828c01614a6c565b999c989b5096995094979396929594505050565b60006020828403121561512657600080fd5b614a4d82614eb2565b6000806000806080858703121561514557600080fd5b843561515081614c16565b9350602085013561516081614c16565b92506040850135915060608501356001600160401b0381111561518257600080fd5b8501601f8101871361519357600080fd5b6151a287823560208401614d58565b91505092959194509250565b6020808252825182820181905260009190848201906040850190845b818110156151e957835160ff16835292840192918401916001016151ca565b50909695505050505050565b6000806040838503121561520857600080fd5b823561521381614c16565b91506020830135614d1a81614c16565b602080825260149082015273155b985d5d1a1bdc9a5e9959081c995c5d595cdd60621b604082015260600190565b6000808335601e1984360301811261526857600080fd5b8301803591506001600160401b0382111561528257600080fd5b6020019150600581901b360382131561425657600080fd5b634e487b7160e01b600052603260045260246000fd5b600181811c908216806152c457607f821691505b602082108103614a6657634e487b7160e01b600052602260045260246000fd5b602080825260119082015270141a185cd9481b9bdd08195b98589b1959607a1b604082015260600190565b634e487b7160e01b600052601160045260246000fd5b80820180821115610eed57610eed61530f565b6020808252600c908201526b2737ba1030b71030b236b4b760a11b604082015260600190565b601f821115611213576000816000526020600020601f850160051c810160208610156153875750805b601f850160051c820191505b8181101561273157828155600101615393565b6001600160401b038311156153bd576153bd614d42565b6153d1836153cb83546152b0565b8361535e565b6000601f84116001811461540557600085156153ed5750838201355b600019600387901b1c1916600186901b178355614848565b600083815260209020601f19861690835b828110156154365786850135825560209485019460019092019101615416565b50868210156154535760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b60006001600160fb1b0383111561547b57600080fd5b8260051b80858437919091019392505050565b815160009082906020808601845b838110156154bb57815160ff168552938201939082019060010161549c565b50929695505050505050565b6000816154d6576154d661530f565b506000190190565b6000602082840312156154f057600080fd5b8151614a4d81614c16565b6001600160a01b03948516815292841660208401529216604082015260608101919091526000608082015260a00190565b60006020828403121561553e57600080fd5b8151614a4d81614cde565b8082028115828204841417610eed57610eed61530f565b81810381811115610eed57610eed61530f565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b60208082526034908201527f455243373231415f5f496e697469616c697a61626c653a20636f6e7472616374604082015273206973206e6f7420696e697469616c697a696e6760601b606082015260800190565b81516001600160401b0381111561562b5761562b614d42565b61563f8161563984546152b0565b8461535e565b602080601f831160018114615674576000841561565c5750858301515b600019600386901b1c1916600185901b178555612731565b600085815260208120601f198616915b828110156156a357888601518255948401946001909101908401615684565b50858210156156c15787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061570490830184614b39565b9695505050505050565b60006020828403121561572057600080fd5b8151614a4d81614a1a565b60008154615738816152b0565b60018281168015615750576001811461576557615794565b60ff1984168752821515830287019450615794565b8560005260208060002060005b8581101561578b5781548a820152908401908201615772565b50505082870194505b5050505092915050565b60006157aa828661572b565b84516157ba818360208901614b15565b6157c68183018661572b565b97965050505050505056feee151c8401928dc223602bb187aff91b9a56c7cae5476ef1b3287b085a16c85fa26469706673582212204b416c87e64c91b17b8d4562498e9fa62fa99fe6bb298a10771db1d8e385de9b64736f6c63430008180033
Deployed Bytecode
0x60806040526004361061047e5760003560e01c80638286eee211610255578063b7fafcd711610144578063d2c8ed4c116100c1578063e985e9c511610085578063e985e9c514610e0d578063f29b4fbc14610e2d578063f2fde38b14610e4d578063f7073c3a14610e6d578063f92c45b714610e82578063ff1473a814610e9957600080fd5b8063d2c8ed4c14610d6c578063d454e0b314610d94578063d5abeb0114610dc1578063de90871f14610dd6578063e7ebdca614610df657600080fd5b8063c87b56dd11610108578063c87b56dd14610ccc578063c9672e2614610cec578063cbccdec314610cff578063cc5dbcf214610d2d578063cd1f5a2914610d5557600080fd5b8063b7fafcd714610c0c578063b88d4fde14610c3a578063bde750fb14610c4d578063c03afb5914610c7b578063c13085db14610c9b57600080fd5b80639831ef2a116101d2578063a9a1d6b011610196578063a9a1d6b014610b62578063b1c9fe6e14610b82578063b2caf79014610bb1578063b45a3c0e14610bd9578063b7e08d4114610bf957600080fd5b80639831ef2a14610a9e57806398ac859e14610acc5780639e7b40d614610af4578063a22cb46514610b22578063a49340cc14610b4257600080fd5b80638692810c116102195780638692810c14610a145780638da5cb5b14610a345780638e8a07b314610a52578063910354c214610a6957806395d89b4114610a8957600080fd5b80638286eee21461097f5780638456cb59146109a057806384b0196e146109b5578063857b9bd4146109dd57806385cb593b146109f457600080fd5b8063413cf93b116103715780636c19e783116102ee57806373af7a40116102b257806373af7a40146108f357806375d5ae9f1461091357806375dadb3214610933578063782312a3146109485780637c5b35a31461095f57600080fd5b80636c19e783146108505780636e820527146108705780636f8b44b01461089e57806370a08231146108be578063715018a6146108de57600080fd5b80635bf6846e116103355780635bf6846e146107b85780635c975abb146107d85780635eff75c1146107f05780636352211e146108105780636a00670b1461083057600080fd5b8063413cf93b1461072057806342842e0e14610740578063481b86ac146107535780634bf47ebd1461076a57806351cff8d91461079857600080fd5b806318160ddd116103ff5780632cb29a0d116103c35780632cb29a0d146106705780632df507be146106875780633c80c1d1146106b55780633d8f833d146106e35780633f4ba83a1461070b57600080fd5b806318160ddd146105e7578063238ac933146105fc57806323b872dd1461061d578063240ff27f1461063057806324d7806c1461065057600080fd5b8063095ea7b311610446578063095ea7b314610554578063096cca7d146105675780631429fbe41461058f57806315720c5f146105b4578063170e1736146105c757600080fd5b806301ffc9a714610483578063046211b0146104b857806306fdde03146104da578063081812fc146104fc578063084b731a14610534575b600080fd5b34801561048f57600080fd5b506104a361049e366004614a30565b610ec7565b60405190151581526020015b60405180910390f35b3480156104c457600080fd5b506104d86104d3366004614aad565b610ef3565b005b3480156104e657600080fd5b506104ef6110bf565b6040516104af9190614b65565b34801561050857600080fd5b5061051c610517366004614b78565b61115a565b6040516001600160a01b0390911681526020016104af565b34801561054057600080fd5b506104d861054f366004614bd5565b61119e565b6104d8610562366004614c36565b611218565b34801561057357600080fd5b5061051c73e166a1fc32647ba4ec271b753cc56b5f0870d23281565b34801561059b57600080fd5b506105a66101965481565b6040519081526020016104af565b6104d86105c2366004614c62565b611228565b3480156105d357600080fd5b506104d86105e2366004614b78565b611c33565b3480156105f357600080fd5b506105a6611c41565b34801561060857600080fd5b506101935461051c906001600160a01b031681565b6104d861062b366004614c9d565b611c61565b34801561063c57600080fd5b506104d861064b366004614cec565b611e31565b34801561065c57600080fd5b506104a361066b366004614d25565b611e81565b34801561067c57600080fd5b506105a66101995481565b34801561069357600080fd5b506105a66106a2366004614b78565b61019d6020526000908152604090205481565b3480156106c157600080fd5b506105a66106d0366004614d25565b6101986020526000908152604090205481565b3480156106ef57600080fd5b5061051c73b6a37b5d14d502c3ab0ae6f3a0e058bc9517786e81565b34801561071757600080fd5b506104d8611e9f565b34801561072c57600080fd5b506104d861073b366004614bd5565b611eb1565b6104d861074e366004614c9d565b611f1d565b34801561075f57600080fd5b506105a661019a5481565b34801561077657600080fd5b506105a6610785366004614b78565b61019e6020526000908152604090205481565b3480156107a457600080fd5b506104d86107b3366004614d25565b611f38565b3480156107c457600080fd5b506104d86107d3366004614ded565b611fd5565b3480156107e457600080fd5b5060655460ff166104a3565b3480156107fc57600080fd5b506104d861080b366004614b78565b61231e565b34801561081c57600080fd5b5061051c61082b366004614b78565b61232c565b34801561083c57600080fd5b506104d861084b366004614ec1565b612337565b34801561085c57600080fd5b506104d861086b366004614d25565b61237d565b34801561087c57600080fd5b506105a661088b366004614b78565b61019f6020526000908152604090205481565b3480156108aa57600080fd5b506104d86108b9366004614b78565b6123a8565b3480156108ca57600080fd5b506105a66108d9366004614d25565b6123d2565b3480156108ea57600080fd5b506104d8612431565b3480156108ff57600080fd5b506104d861090e366004614b78565b612443565b34801561091f57600080fd5b506104d861092e366004614edd565b612451565b34801561093f57600080fd5b506104ef612484565b34801561095457600080fd5b506105a661019c5481565b34801561096b57600080fd5b506104d861097a366004614b78565b612494565b34801561098b57600080fd5b5061051c6c447e69651d841bd8d104bed49381565b3480156109ac57600080fd5b506104d86124a2565b3480156109c157600080fd5b506109ca6124b2565b6040516104af9796959493929190614f12565b3480156109e957600080fd5b506105a66101a65481565b348015610a0057600080fd5b506104d8610a0f366004614edd565b61257d565b348015610a2057600080fd5b506104d8610a2f366004614b78565b6125b0565b348015610a4057600080fd5b506033546001600160a01b031661051c565b348015610a5e57600080fd5b506105a66101a35481565b348015610a7557600080fd5b506104d8610a84366004614b78565b6125be565b348015610a9557600080fd5b506104ef6125cc565b348015610aaa57600080fd5b506105a6610ab9366004614b78565b6101976020526000908152604090205481565b348015610ad857600080fd5b5061051c733af2a97414d1101e2107a70e7f33955da134630581565b348015610b0057600080fd5b506105a6610b0f366004614b78565b6101a76020526000908152604090205481565b348015610b2e57600080fd5b506104d8610b3d366004614cec565b6125e4565b348015610b4e57600080fd5b506104d8610b5d366004614fab565b612661565b348015610b6e57600080fd5b506104d8610b7d366004614b78565b612739565b348015610b8e57600080fd5b5061019354610ba490600160a01b900460ff1681565b6040516104af919061504a565b348015610bbd57600080fd5b5061051c73f4a7c105cfdc6aabe9ae65bdf2d0df0a567a7ade81565b348015610be557600080fd5b506104a3610bf4366004614b78565b612747565b6104d8610c0736600461505d565b612776565b348015610c1857600080fd5b506105a6610c27366004615114565b6101946020526000908152604090205481565b6104d8610c4836600461512f565b612aaa565b348015610c5957600080fd5b506105a6610c68366004614b78565b6101a46020526000908152604090205481565b348015610c8757600080fd5b506104d8610c96366004615114565b612aeb565b348015610ca757600080fd5b50610ba4610cb6366004614b78565b6101956020526000908152604090205460ff1681565b348015610cd857600080fd5b506104ef610ce7366004614b78565b612b21565b6104d8610cfa366004614b78565b612b52565b348015610d0b57600080fd5b506105a6610d1a366004614d25565b6101a26020526000908152604090205481565b348015610d3957600080fd5b5061051c73306b1ea3ecdf94ab739f1910bbda052ed4a9f94981565b348015610d6157600080fd5b506105a66101a15481565b348015610d7857600080fd5b5061051c73ed5af388653567af2f388e6224dc7c4b3241c54481565b348015610da057600080fd5b50610db4610daf366004614bd5565b612c71565b6040516104af91906151ae565b348015610dcd57600080fd5b5060fd546105a6565b348015610de257600080fd5b506104d8610df1366004614b78565b612d40565b348015610e0257600080fd5b506105a661019b5481565b348015610e1957600080fd5b506104a3610e283660046151f5565b612d4e565b348015610e3957600080fd5b506104d8610e48366004614b78565b612d8b565b348015610e5957600080fd5b506104d8610e68366004614d25565b612d99565b348015610e7957600080fd5b506104ef612e12565b348015610e8e57600080fd5b506105a66101a55481565b348015610ea557600080fd5b506105a6610eb4366004614b78565b6101a06020526000908152604090205481565b6000610ed282612e22565b80610eed57506001600160e01b03198216635a2d1e0760e11b145b92915050565b8282826000610f0184612e70565b90506000610f0e82612f6c565b90506000610f528286868080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250612f9992505050565b610193549091506001600160a01b03808316911614610f8c5760405162461bcd60e51b8152600401610f8390615223565b60405180910390fd5b6000610f988a80615251565b808060200260200160405190810160405280939291908181526020018383602002808284376000920182905250939450610fd99250505060208c018c615251565b80806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250508251855193945092909214915061105590505760405162461bcd60e51b815260206004820152600f60248201526e125b9d985b1a59081c995c5d595cdd608a1b6044820152606401610f83565b60005b82518110156110b15760008382815181106110755761107561529a565b6020026020010151905060008383815181106110935761109361529a565b602002602001015190506110a78282612fb5565b5050600101611058565b505050505050505050505050565b60606110c961309b565b60020180546110d7906152b0565b80601f0160208091040260200160405190810160405280929190818152602001828054611103906152b0565b80156111505780601f1061112557610100808354040283529160200191611150565b820191906000526020600020905b81548152906001019060200180831161113357829003601f168201915b5050505050905090565b6000611165826130bf565b611179576111796333d1c03960e21b61311f565b61118161309b565b60009283526006016020525060409020546001600160a01b031690565b60005b818110156112135760008383838181106111bd576111bd61529a565b9050602002013590506111cf8161232c565b6001600160a01b0316336001600160a01b0316146111ff5760405162461bcd60e51b8152600401610f8390615223565b61120a816001612fb5565b506001016111a1565b505050565b61122482826001613129565b5050565b60018061019354600160a01b900460ff16600281111561124a5761124a615016565b146112675760405162461bcd60e51b8152600401610f83906152e4565b61126f6131da565b600061127b8380615251565b8080602002602001604051908101604052809392919081815260200183836020028082843760009201829052509394506112bc925050506020850185615251565b8080602002602001604051908101604052809392919081815260200183836020028082843760009201829052509394506112fd925050506040860186615251565b80806020026020016040519081016040528093929190818152602001838360200280828437600092018290525093945061133e925050506060870187615251565b80806020026020016040519081016040528093929190818152602001838360200280828437600092018290525093945061137f925050506080880188615251565b8080602002602001604051908101604052809392919081815260200183836020028082843760009201829052509394506113c09250505060a0890189615251565b8080602002602001604051908101604052809392919081815260200183836020028082843760009201829052509394506114019250505060c08a018a615251565b8080602002602001604051908101604052809392919081815260200183836020028082843760009201829052509394506114429250505060e08b018b615251565b808060200260200160405190810160405280939291908181526020018383602002808284376000920182905250939450611484925050506101008c018c615251565b8080602002602001604051908101604052809392919081815260200183836020028082843760009201829052509394506114c6925050506101208d018d615251565b808060200260200160405190810160405280939291908181526020018383602002808284376000920182905250939450611508925050506101408e018e615251565b80806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f82011690508083019250505050505050905060008d80610160019061155d9190615251565b80806020026020016040519081016040528093929190818152602001838360200280828437600092018290525093945083925050505b8d518110156116835760008e82815181106115b0576115b061529a565b6020026020010151905060008e83815181106115ce576115ce61529a565b602002602001015190506115e182613220565b61019954600083815261019d6020526040902054611600908390615325565b11156116485760405162461bcd60e51b815260206004820152601760248201527610dbcb535d5cd95d5b48195e18d959591cc81b1a5b5a5d604a1b6044820152606401610f83565b600082815261019d602052604081208054839290611667908490615325565b9091555061167790508185615325565b93505050600101611593565b5060005b8b518110156117735760008c82815181106116a4576116a461529a565b6020026020010151905060008c83815181106116c2576116c261529a565b602002602001015190506116d582613382565b61019a54600083815261019e60205260409020546116f4908390615325565b11156117385760405162461bcd60e51b8152602060048201526013602482015272105e9d5ada48195e18d959591cc81b1a5b5a5d606a1b6044820152606401610f83565b600082815261019e602052604081208054839290611757908490615325565b9091555061176790508185615325565b93505050600101611687565b5060005b895181101561186d5760008a82815181106117945761179461529a565b6020026020010151905060008a83815181106117b2576117b261529a565b602002602001015190506117c5826134da565b61019b54600083815261019f60205260409020546117e4908390615325565b11156118325760405162461bcd60e51b815260206004820152601d60248201527f417a756b6920656c656d656e74616c2065786365656473206c696d69740000006044820152606401610f83565b600082815261019f602052604081208054839290611851908490615325565b9091555061186190508185615325565b93505050600101611777565b5060005b875181101561196757600088828151811061188e5761188e61529a565b6020026020010151905060008883815181106118ac576118ac61529a565b602002602001015190506118bf8261363c565b61019c5460008381526101a060205260409020546118de908390615325565b111561192c5760405162461bcd60e51b815260206004820152601d60248201527f417a756b6920656c656d656e74616c2065786365656473206c696d69740000006044820152606401610f83565b60008281526101a060205260408120805483929061194b908490615325565b9091555061195b90508185615325565b93505050600101611871565b5060005b8551811015611a615760008682815181106119885761198861529a565b6020026020010151905060008683815181106119a6576119a661529a565b602002602001015190506119b9826137aa565b6101a35460008381526101a460205260409020546119d8908390615325565b1115611a265760405162461bcd60e51b815260206004820152601a60248201527f415243205374656c6c6172732065786365656473206c696d69740000000000006044820152606401610f83565b60008281526101a4602052604081208054839290611a45908490615325565b90915550611a5590508185615325565b9350505060010161196b565b5060005b8351811015611b51576000848281518110611a8257611a8261529a565b602002602001015190506000848381518110611aa057611aa061529a565b60200260200101519050611ab38261390c565b6101a65460008381526101a76020526040902054611ad2908390615325565b1115611b165760405162461bcd60e51b81526020600482015260136024820152721099585b9e88195e18d959591cc81b1a5b5a5d606a1b6044820152606401610f83565b60008281526101a7602052604081208054839290611b35908490615325565b90915550611b4590508185615325565b93505050600101611a65565b5060fd54816101a554611b649190615325565b1115611ba35760405162461bcd60e51b815260206004820152600e60248201526d4578636565647320737570706c7960901b6044820152606401610f83565b806101a56000828254611bb69190615325565b90915550611bed905081610194600060015b6002811115611bd957611bd9615016565b815260200190815260200160002054613a64565b60405181815233907f10fcc92ce3ae296b6d2813de054ab2cf2d6dd59a1eed235681bc8bf6c36a5cb79060200160405180910390a2505050505050505050505050505050565b611c3b613af1565b6101a555565b60006001611c4d61309b565b60010154611c5961309b565b540303905090565b6000611c6c82613b4b565b6001600160a01b039485169490915081168414611c9257611c9262a1148160e81b61311f565b600080611c9e84613c0e565b91509150611cc38187611cae3390565b6001600160a01b039081169116811491141790565b611ce557611cd18633612d4e565b611ce557611ce5632ce44b5f60e11b61311f565b611cf28686866001613c36565b8015611cfd57600082555b611d0561309b565b6001600160a01b0387166000908152600591909101602052604090208054600019019055611d3161309b565b6001600160a01b03861660008181526005929092016020526040909120805460010190554260a01b17600160e11b17611d6861309b565b60008681526004919091016020526040812091909155600160e11b84169003611dde5760018401611d9761309b565b600082815260049190910160205260408120549003611ddc57611db861309b565b548114611ddc5783611dc861309b565b600083815260049190910160205260409020555b505b6001600160a01b0385168481887fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a480600003611e2857611e28633a954ecd60e21b61311f565b50505050505050565b611e3a33611e81565b611e565760405162461bcd60e51b8152600401610f8390615338565b6001600160a01b0391909116600090815260cb60205260409020805460ff1916911515919091179055565b6001600160a01b0316600090815260cb602052604090205460ff1690565b611ea7613af1565b611eaf613cba565b565b611eb9613af1565b60005b81811015611213577f032bc66be43dbccb7487781d168eb7bda224628a3b2c3388bdf69b532a3a1611838383818110611ef757611ef761529a565b90506020020135604051611f0d91815260200190565b60405180910390a1600101611ebc565b61121383838360405180602001604052806000815250612aaa565b611f40613af1565b6000816001600160a01b03164760405160006040518083038185875af1925050503d8060008114611f8d576040519150601f19603f3d011682016040523d82523d6000602084013e611f92565b606091505b50509050806112245760405162461bcd60e51b815260206004820152600f60248201526e15da5d1a191c985dc819985a5b1959608a1b6044820152606401610f83565b6000805160206157d283398151915254610100900460ff1661200a576000805160206157d28339815191525460ff161561200e565b303b155b6120805760405162461bcd60e51b815260206004820152603760248201527f455243373231415f5f496e697469616c697a61626c653a20636f6e747261637460448201527f20697320616c726561647920696e697469616c697a65640000000000000000006064820152608401610f83565b6000805160206157d283398151915254610100900460ff161580156120bc576000805160206157d2833981519152805461ffff19166101011790555b600054610100900460ff16158080156120dc5750600054600160ff909116105b806120f65750303b1580156120f6575060005460ff166001145b6121595760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610f83565b6000805460ff19166001179055801561217c576000805461ff0019166101001790555b612184613d0c565b61218c613d3b565b6121b46040518060200160405280600081525060405180602001604052806000815250613d6a565b6121be8888613d9b565b6121c6613dd9565b6121cf86613e1c565b6121d98585613e43565b6121e1613e85565b6121e9613eac565b61019380546001600160a81b0319166001600160a01b03851617905561019460205267013c3107490280007fac2681a0ffcdeb8d930437e36dc6669c17d1245fb57aa4cfab8f62b41ea51f818190557f431122e4fe9c44f5a319c6d2afd7cf7bcc21253a0483556b9b40b9255f70a15e819055600260008190527f4f2fafccb5d28f3aaff6cbdf8ff32db4167d35308651b7acedb7127f6ec061859190915561019681905561019981905561019a819055600161019b81905561019c556101a35560056101a15580156122f6576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b508015611e285750506000805160206157d2833981519152805461ff00191690555050505050565b612326613af1565b61019655565b6000610eed82613b4b565b61233f613af1565b80610194600084600281111561235757612357615016565b600281111561236857612368615016565b81526020810191909152604001600020555050565b612385613af1565b61019380546001600160a01b0319166001600160a01b0392909216919091179055565b6123b133611e81565b6123cd5760405162461bcd60e51b8152600401610f8390615338565b60fd55565b60006001600160a01b0382166123f2576123f26323d3ad8160e21b61311f565b6001600160401b0361240261309b565b6005016000846001600160a01b03166001600160a01b0316815260200190815260200160002054169050919050565b612439613af1565b611eaf6000613ee9565b61244b613af1565b61019c55565b61245a33611e81565b6124765760405162461bcd60e51b8152600401610f8390615338565b6101306112138284836153a6565b606061012f80546110d7906152b0565b61249c613af1565b6101a655565b6124aa613af1565b611eaf613eac565b6000606080600080600060606097546000801b1480156124d25750609854155b6125165760405162461bcd60e51b81526020600482015260156024820152741152540dcc4c8e88155b9a5b9a5d1a585b1a5e9959605a1b6044820152606401610f83565b50506040805180820182526011815270415a554b495f585f434f5f4d555345554d60781b6020808301919091528251808401845260058152640302e312e360dc1b8183015283516000808252928101909452600f60f81b9992985096504695503094509250565b61258633611e81565b6125a25760405162461bcd60e51b8152600401610f8390615338565b61012f6112138284836153a6565b6125b8613af1565b6101a355565b6125c6613af1565b6101a155565b60606125d661309b565b60030180546110d7906152b0565b806125ed61309b565b336000818152600792909201602090815260408084206001600160a01b03881680865290835293819020805460ff19169515159590951790945592518415158152919290917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b61266a33611e81565b6126865760405162461bcd60e51b8152600401610f8390615338565b828181146126d65760405162461bcd60e51b815260206004820152601760248201527f41646d696e206d696e743a2062616420726571756573740000000000000000006044820152606401610f83565b60005b81811015612731576127298686838181106126f6576126f661529a565b905060200201602081019061270b9190614d25565b85858481811061271d5761271d61529a565b90506020020135613f3b565b6001016126d9565b505050505050565b612741613af1565b61019b55565b600060016000838152610195602052604090205460ff16600281111561276f5761276f615016565b1492915050565b83838383831561286757600061278b84613f45565b9050600061279882612f6c565b905060006127dc8286868080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250612f9992505050565b610193549091506001600160a01b0380831691161461280d5760405162461bcd60e51b8152600401610f8390615223565b3361281b6020880188614d25565b6001600160a01b0316146128635760405162461bcd60e51b815260206004820152600f60248201526e125b9d985b1a59081858d8dbdd5b9d608a1b6044820152606401610f83565b5050505b60008061019354600160a01b900460ff16600281111561288957612889615016565b146128a65760405162461bcd60e51b8152600401610f83906152e4565b6128ae6131da565b6000805b8d81101561299f5760008f8f838181106128ce576128ce61529a565b90506020020135905060008e8e848181106128eb576128eb61529a565b9050602002013590506128fd82613220565b610196546000838152610197602052604090205461291c908390615325565b11156129645760405162461bcd60e51b815260206004820152601760248201527610dbcb535d5cd95d5b48195e18d959591cc81b1a5b5a5d604a1b6044820152606401610f83565b6000828152610197602052604081208054839290612983908490615325565b9091555061299390508185615325565b935050506001016128b2565b503360009081526101986020908152604090912054908a0135906129c4908c90615325565b1115612a0a5760405162461bcd60e51b81526020600482015260156024820152741058d8dbdd5b9d08195e18d959591cc81b1a5b5a5d605a1b6044820152606401610f83565b3360009081526101986020526040812080548c9290612a2a908490615325565b90915550612a3a90508a82615325565b9050612a4b81610194600080611bc8565b612a5860208a018a614d25565b6001600160a01b03167f10fcc92ce3ae296b6d2813de054ab2cf2d6dd59a1eed235681bc8bf6c36a5cb782604051612a9291815260200190565b60405180910390a25050505050505050505050505050565b612ab5848484611c61565b6001600160a01b0383163b15612ae557612ad184848484613fa2565b612ae557612ae56368d2bf6b60e11b61311f565b50505050565b612af3613af1565b610193805482919060ff60a01b1916600160a01b836002811115612b1957612b19615016565b021790555050565b6060612b2c826130bf565b612b4957604051630a14c4b560e41b815260040160405180910390fd5b610eed82614084565b60028061019354600160a01b900460ff166002811115612b7457612b74615016565b14612b915760405162461bcd60e51b8152600401610f83906152e4565b612b996131da565b6101a1543360009081526101a26020526040902054612bb9908490615325565b1115612bf75760405162461bcd60e51b815260206004820152600d60248201526c115e18d959591cc81b1a5b5a5d609a1b6044820152606401610f83565b3360009081526101a2602052604081208054849290612c17908490615325565b90915550612c2d90508261019460006002611bc8565b612c3733836140bd565b60405182815233907f10fcc92ce3ae296b6d2813de054ab2cf2d6dd59a1eed235681bc8bf6c36a5cb7906020015b60405180910390a25050565b60606000826001600160401b03811115612c8d57612c8d614d42565b604051908082528060200260200182016040528015612cb6578160200160208202803683370190505b50905060005b83811015612d38576000858583818110612cd857612cd861529a565b6020908102929092013560008181526101959093526040909220549192505060ff166002811115612d0b57612d0b615016565b838381518110612d1d57612d1d61529a565b60ff9092166020928302919091019091015250600101612cbc565b509392505050565b612d48613af1565b61019955565b6000612d5861309b565b6001600160a01b039384166000908152600791909101602090815260408083209490951682529290925250205460ff1690565b612d93613af1565b61019a55565b612da1613af1565b6001600160a01b038116612e065760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610f83565b612e0f81613ee9565b50565b606061013080546110d7906152b0565b60006301ffc9a760e01b6001600160e01b031983161480612e5357506380ac58cd60e01b6001600160e01b03198316145b80610eed5750506001600160e01b031916635b5e139f60e01b1490565b60007f780db704172bf30eb0a6bf00bb2884f530193152cc89f7a8487c2adb179519d1612e9d8380615251565b604051602001612eae929190615465565b60405160208183030381529060405280519060200120612f0e848060200190612ed79190615251565b8080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061415692505050565b604051602001612f1e919061548e565b60408051601f1981840301815282825280516020918201209083019490945281019190915260608101919091526080015b604051602081830303815290604052805190602001209050919050565b6000610eed612f79614209565b8360405161190160f01b8152600281019290925260228201526042902090565b6000806000612fa88585614218565b91509150612d388161425d565b6001816002811115612fc957612fc9615016565b03613006576040518281527f032bc66be43dbccb7487781d168eb7bda224628a3b2c3388bdf69b532a3a16119060200160405180910390a161303a565b6040518281527ff27b6ce5b2f5e68ddb2fd95a8a909d4ecf1daaac270935fff052feacb24f18429060200160405180910390a15b600082815261019560205260409020805482919060ff1916600183600281111561306657613066615016565b0217905550817f92b778e5d3324b34627600713b43857de3c5f6f8efdcb9435b17198a3888c2dc82604051612c65919061504a565b7f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c4090565b60008160011161311a576130d161309b565b5482101561311a5760005b6130e461309b565b60008481526004919091016020526040812054915081900361311057613109836154c7565b92506130dc565b600160e01b161590505b919050565b8060005260046000fd5b60006131348361232c565b905081801561314c5750336001600160a01b03821614155b1561316f5761315b8133612d4e565b61316f5761316f6367d9dca160e11b61311f565b8361317861309b565b6000858152600691909101602052604080822080546001600160a01b0319166001600160a01b0394851617905551859287811692908516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259190a450505050565b60655460ff1615611eaf5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610f83565b6040516331a9108f60e11b81526004810182905260009073e166a1fc32647ba4ec271b753cc56b5f0870d23290636352211e90602401602060405180830381865afa158015613273573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061329791906154de565b9050336001600160a01b03821614806133365750604051632e7cda1d60e21b81526c447e69651d841bd8d104bed4939063b9f36874906132f5903390859073e166a1fc32647ba4ec271b753cc56b5f0870d2329088906004016154fb565b602060405180830381865afa158015613312573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613336919061552c565b6112245760405162461bcd60e51b815260206004820152601760248201527f496e76616c696420436f2d4d757365756d206f776e65720000000000000000006044820152606401610f83565b6040516331a9108f60e11b81526004810182905260009073ed5af388653567af2f388e6224dc7c4b3241c54490636352211e90602401602060405180830381865afa1580156133d5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906133f991906154de565b9050336001600160a01b03821614806134985750604051632e7cda1d60e21b81526c447e69651d841bd8d104bed4939063b9f3687490613457903390859073ed5af388653567af2f388e6224dc7c4b3241c5449088906004016154fb565b602060405180830381865afa158015613474573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613498919061552c565b6112245760405162461bcd60e51b815260206004820152601360248201527224b73b30b634b21020bd3ab5b49037bbb732b960691b6044820152606401610f83565b6040516331a9108f60e11b81526004810182905260009073b6a37b5d14d502c3ab0ae6f3a0e058bc9517786e90636352211e90602401602060405180830381865afa15801561352d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061355191906154de565b9050336001600160a01b03821614806135f05750604051632e7cda1d60e21b81526c447e69651d841bd8d104bed4939063b9f36874906135af903390859073b6a37b5d14d502c3ab0ae6f3a0e058bc9517786e9088906004016154fb565b602060405180830381865afa1580156135cc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906135f0919061552c565b6112245760405162461bcd60e51b815260206004820152601e60248201527f496e76616c696420417a756b6920656c656d656e74616c73206f776e657200006044820152606401610f83565b6040516331a9108f60e11b815260048101829052600090733af2a97414d1101e2107a70e7f33955da134630590636352211e90602401602060405180830381865afa15801561368f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906136b391906154de565b9050336001600160a01b03821614806137525750604051632e7cda1d60e21b81526c447e69651d841bd8d104bed4939063b9f36874906137119033908590733af2a97414d1101e2107a70e7f33955da13463059088906004016154fb565b602060405180830381865afa15801561372e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613752919061552c565b6112245760405162461bcd60e51b815260206004820152602360248201527f496e76616c696420417a756b6920656c656d656e74616c206265616e7a206f776044820152623732b960e91b6064820152608401610f83565b6040516331a9108f60e11b81526004810182905260009073f4a7c105cfdc6aabe9ae65bdf2d0df0a567a7ade90636352211e90602401602060405180830381865afa1580156137fd573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061382191906154de565b9050336001600160a01b03821614806138c05750604051632e7cda1d60e21b81526c447e69651d841bd8d104bed4939063b9f368749061387f903390859073f4a7c105cfdc6aabe9ae65bdf2d0df0a567a7ade9088906004016154fb565b602060405180830381865afa15801561389c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906138c0919061552c565b6112245760405162461bcd60e51b815260206004820152601a60248201527f496e76616c696420415243205374656c6c617273206f776e65720000000000006044820152606401610f83565b6040516331a9108f60e11b81526004810182905260009073306b1ea3ecdf94ab739f1910bbda052ed4a9f94990636352211e90602401602060405180830381865afa15801561395f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061398391906154de565b9050336001600160a01b0382161480613a225750604051632e7cda1d60e21b81526c447e69651d841bd8d104bed4939063b9f36874906139e1903390859073306b1ea3ecdf94ab739f1910bbda052ed4a9f9499088906004016154fb565b602060405180830381865afa1580156139fe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613a22919061552c565b6112245760405162461bcd60e51b815260206004820152601360248201527224b73b30b634b2102132b0b73d1037bbb732b960691b6044820152606401610f83565b6000613a708284615549565b905080341015613ab35760405162461bcd60e51b815260206004820152600e60248201526d09cdee840cadcdeeaced0408aa8960931b6044820152606401610f83565b8034111561121357336108fc613ac98334615560565b6040518115909202916000818181858888f19350505050158015612ae5573d6000803e3d6000fd5b6033546001600160a01b03163314611eaf5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610f83565b600081600111613bfe57613b5d61309b565b60008381526004919091016020526040902054905080600003613beb57613b8261309b565b548210613b9957613b99636f96cda160e11b61311f565b613ba161309b565b600019909201600081815260049390930160205260409092205490508015613b9957600160e01b8116600003613bd657919050565b613be6636f96cda160e11b61311f565b613b99565b600160e01b8116600003613bfe57919050565b61311a636f96cda160e11b61311f565b6000806000613c1b61309b565b60009485526006016020525050604090912080549092909150565b6001600160a01b0384161580613c70575060016000838152610195602052604090205460ff166002811115613c6d57613c6d615016565b14155b613cb55760405162461bcd60e51b8152602060048201526016602482015275546f6b656e206e6f74207472616e7366657261626c6560501b6044820152606401610f83565b612ae5565b613cc26143a7565b6065805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b600054610100900460ff16613d335760405162461bcd60e51b8152600401610f8390615573565b611eaf6143f0565b600054610100900460ff16613d625760405162461bcd60e51b8152600401610f8390615573565b611eaf614420565b600054610100900460ff16613d915760405162461bcd60e51b8152600401610f8390615573565b6112248282614453565b6000805160206157d283398151915254610100900460ff16613dcf5760405162461bcd60e51b8152600401610f83906155be565b61122482826144a2565b600054610100900460ff16613e005760405162461bcd60e51b8152600401610f8390615573565b33600090815260cb60205260409020805460ff19166001179055565b600054610100900460ff166123cd5760405162461bcd60e51b8152600401610f8390615573565b600054610100900460ff16613e6a5760405162461bcd60e51b8152600401610f8390615573565b61012f613e778382615612565b506101306112138282615612565b600054610100900460ff16611eaf5760405162461bcd60e51b8152600401610f8390615573565b613eb46131da565b6065805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258613cef3390565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b61122482826140bd565b60007f904116aebab2081d38d8cae3b4fbc5c844749e354a61c1001bc4c71f06596cb2613f756020840184614d25565b604080516020818101949094526001600160a01b0390921690820152908301356060820152608001612f4f565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a0290613fd79033908990889088906004016156d1565b6020604051808303816000875af1925050508015614012575060408051601f3d908101601f1916820190925261400f9181019061570e565b60015b614067573d808015614040576040519150601f19603f3d011682016040523d82523d6000602084013e614045565b606091505b50805160000361405f5761405f6368d2bf6b60e11b61311f565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050949350505050565b606061012f61409283614515565b6101306040516020016140a79392919061579e565b6040516020818303038152906040529050919050565b8060fd54816140ca6145a7565b6140d49190615325565b11156141135760405162461bcd60e51b815260206004820152600e60248201526d4578636565647320737570706c7960901b6044820152606401610f83565b32331461414c5760405162461bcd60e51b81526020600482015260076024820152664e6f20626f747360c81b6044820152606401610f83565b61121383836145b1565b6060600082516001600160401b0381111561417357614173614d42565b60405190808252806020026020018201604052801561419c578160200160208202803683370190505b50905060005b8351811015614202578381815181106141bd576141bd61529a565b602002602001015160028111156141d6576141d6615016565b8282815181106141e8576141e861529a565b60ff909216602092830291909101909101526001016141a2565b5092915050565b60006142136145cb565b905090565b600080825160410361424e5760208301516040840151606085015160001a6142428782858561463f565b94509450505050614256565b506000905060025b9250929050565b600081600481111561427157614271615016565b036142795750565b600181600481111561428d5761428d615016565b036142da5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610f83565b60028160048111156142ee576142ee615016565b0361433b5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610f83565b600381600481111561434f5761434f615016565b03612e0f5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610f83565b60655460ff16611eaf5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610f83565b600054610100900460ff166144175760405162461bcd60e51b8152600401610f8390615573565b611eaf33613ee9565b600054610100900460ff166144475760405162461bcd60e51b8152600401610f8390615573565b6065805460ff19169055565b600054610100900460ff1661447a5760405162461bcd60e51b8152600401610f8390615573565b60996144868382615612565b50609a6144938282615612565b50506000609781905560985550565b6000805160206157d283398151915254610100900460ff166144d65760405162461bcd60e51b8152600401610f83906155be565b816144df61309b565b600201906144ed9082615612565b50806144f761309b565b600301906145059082615612565b50600161451061309b565b555050565b6060600061452283614703565b60010190506000816001600160401b0381111561454157614541614d42565b6040519080825280601f01601f19166020018201604052801561456b576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a850494508461457557509392505050565b6000614213611c41565b6112248282604051806020016040528060008152506147db565b60007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6145f661484f565b6145fe6148ce565b60408051602081019490945283019190915260608201524660808201523060a082015260c00160405160208183030381529060405280519060200120905090565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561467657506000905060036146fa565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156146ca573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166146f3576000600192509250506146fa565b9150600090505b94509492505050565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106147425772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef8100000000831061476e576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc10000831061478c57662386f26fc10000830492506010015b6305f5e10083106147a4576305f5e100830492506008015b61271083106147b857612710830492506004015b606483106147ca576064830492506002015b600a8310610eed5760010192915050565b6147e58383614919565b6001600160a01b0383163b156112135760006147ff61309b565b5490508281035b6148196000868380600101945086613fa2565b61482d5761482d6368d2bf6b60e11b61311f565b818110614806578161483d61309b565b541461484857600080fd5b5050505050565b600080614880604080518082019091526011815270415a554b495f585f434f5f4d555345554d60781b602082015290565b805190915015614897578051602090910120919050565b60975480156148a65792915050565b7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a4709250505090565b6000806148f36040805180820190915260058152640302e312e360dc1b602082015290565b80519091501561490a578051602090910120919050565b60985480156148a65792915050565b600061492361309b565b549050600082900361493f5761493f63b562e8dd60e01b61311f565b61494c6000848385613c36565b6001600160a01b0383164260a01b6001841460e11b171761496b61309b565b6000838152600491909101602052604090205568010000000000000001820261499261309b565b6001600160a01b03851660008181526005929092016020526040822080549093019092558190036149cc576149cc622e076360e81b61311f565b818301825b808360007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a48181600101915081036149d15781614a1061309b565b5550611213915050565b6001600160e01b031981168114612e0f57600080fd5b600060208284031215614a4257600080fd5b8135614a4d81614a1a565b9392505050565b600060408284031215614a6657600080fd5b50919050565b60008083601f840112614a7e57600080fd5b5081356001600160401b03811115614a9557600080fd5b60208301915083602082850101111561425657600080fd5b600080600060408486031215614ac257600080fd5b83356001600160401b0380821115614ad957600080fd5b614ae587838801614a54565b94506020860135915080821115614afb57600080fd5b50614b0886828701614a6c565b9497909650939450505050565b60005b83811015614b30578181015183820152602001614b18565b50506000910152565b60008151808452614b51816020860160208601614b15565b601f01601f19169290920160200192915050565b602081526000614a4d6020830184614b39565b600060208284031215614b8a57600080fd5b5035919050565b60008083601f840112614ba357600080fd5b5081356001600160401b03811115614bba57600080fd5b6020830191508360208260051b850101111561425657600080fd5b60008060208385031215614be857600080fd5b82356001600160401b03811115614bfe57600080fd5b614c0a85828601614b91565b90969095509350505050565b6001600160a01b0381168114612e0f57600080fd5b803561311a81614c16565b60008060408385031215614c4957600080fd5b8235614c5481614c16565b946020939093013593505050565b600060208284031215614c7457600080fd5b81356001600160401b03811115614c8a57600080fd5b82016101808185031215614a4d57600080fd5b600080600060608486031215614cb257600080fd5b8335614cbd81614c16565b92506020840135614ccd81614c16565b929592945050506040919091013590565b8015158114612e0f57600080fd5b60008060408385031215614cff57600080fd5b8235614d0a81614c16565b91506020830135614d1a81614cde565b809150509250929050565b600060208284031215614d3757600080fd5b8135614a4d81614c16565b634e487b7160e01b600052604160045260246000fd5b60006001600160401b0380841115614d7257614d72614d42565b604051601f8501601f19908116603f01168101908282118183101715614d9a57614d9a614d42565b81604052809350858152868686011115614db357600080fd5b858560208301376000602087830101525050509392505050565b600082601f830112614dde57600080fd5b614a4d83833560208501614d58565b60008060008060008060c08789031215614e0657600080fd5b86356001600160401b0380821115614e1d57600080fd5b614e298a838b01614dcd565b97506020890135915080821115614e3f57600080fd5b614e4b8a838b01614dcd565b9650604089013595506060890135915080821115614e6857600080fd5b614e748a838b01614dcd565b94506080890135915080821115614e8a57600080fd5b50614e9789828a01614dcd565b925050614ea660a08801614c2b565b90509295509295509295565b80356003811061311a57600080fd5b60008060408385031215614ed457600080fd5b614c5483614eb2565b60008060208385031215614ef057600080fd5b82356001600160401b03811115614f0657600080fd5b614c0a85828601614a6c565b60ff60f81b881681526000602060e06020840152614f3360e084018a614b39565b8381036040850152614f45818a614b39565b606085018990526001600160a01b038816608086015260a0850187905284810360c08601528551808252602080880193509091019060005b81811015614f9957835183529284019291840191600101614f7d565b50909c9b505050505050505050505050565b60008060008060408587031215614fc157600080fd5b84356001600160401b0380821115614fd857600080fd5b614fe488838901614b91565b90965094506020870135915080821115614ffd57600080fd5b5061500a87828801614b91565b95989497509550505050565b634e487b7160e01b600052602160045260246000fd5b60038110612e0f57634e487b7160e01b600052602160045260246000fd5b602081016150578361502c565b91905290565b60008060008060008060008060c0898b03121561507957600080fd5b88356001600160401b038082111561509057600080fd5b61509c8c838d01614b91565b909a50985060208b01359150808211156150b557600080fd5b6150c18c838d01614b91565b909850965060408b013595508691506150dd8c60608d01614a54565b945060a08b01359150808211156150f357600080fd5b506151008b828c01614a6c565b999c989b5096995094979396929594505050565b60006020828403121561512657600080fd5b614a4d82614eb2565b6000806000806080858703121561514557600080fd5b843561515081614c16565b9350602085013561516081614c16565b92506040850135915060608501356001600160401b0381111561518257600080fd5b8501601f8101871361519357600080fd5b6151a287823560208401614d58565b91505092959194509250565b6020808252825182820181905260009190848201906040850190845b818110156151e957835160ff16835292840192918401916001016151ca565b50909695505050505050565b6000806040838503121561520857600080fd5b823561521381614c16565b91506020830135614d1a81614c16565b602080825260149082015273155b985d5d1a1bdc9a5e9959081c995c5d595cdd60621b604082015260600190565b6000808335601e1984360301811261526857600080fd5b8301803591506001600160401b0382111561528257600080fd5b6020019150600581901b360382131561425657600080fd5b634e487b7160e01b600052603260045260246000fd5b600181811c908216806152c457607f821691505b602082108103614a6657634e487b7160e01b600052602260045260246000fd5b602080825260119082015270141a185cd9481b9bdd08195b98589b1959607a1b604082015260600190565b634e487b7160e01b600052601160045260246000fd5b80820180821115610eed57610eed61530f565b6020808252600c908201526b2737ba1030b71030b236b4b760a11b604082015260600190565b601f821115611213576000816000526020600020601f850160051c810160208610156153875750805b601f850160051c820191505b8181101561273157828155600101615393565b6001600160401b038311156153bd576153bd614d42565b6153d1836153cb83546152b0565b8361535e565b6000601f84116001811461540557600085156153ed5750838201355b600019600387901b1c1916600186901b178355614848565b600083815260209020601f19861690835b828110156154365786850135825560209485019460019092019101615416565b50868210156154535760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b60006001600160fb1b0383111561547b57600080fd5b8260051b80858437919091019392505050565b815160009082906020808601845b838110156154bb57815160ff168552938201939082019060010161549c565b50929695505050505050565b6000816154d6576154d661530f565b506000190190565b6000602082840312156154f057600080fd5b8151614a4d81614c16565b6001600160a01b03948516815292841660208401529216604082015260608101919091526000608082015260a00190565b60006020828403121561553e57600080fd5b8151614a4d81614cde565b8082028115828204841417610eed57610eed61530f565b81810381811115610eed57610eed61530f565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b60208082526034908201527f455243373231415f5f496e697469616c697a61626c653a20636f6e7472616374604082015273206973206e6f7420696e697469616c697a696e6760601b606082015260800190565b81516001600160401b0381111561562b5761562b614d42565b61563f8161563984546152b0565b8461535e565b602080601f831160018114615674576000841561565c5750858301515b600019600386901b1c1916600185901b178555612731565b600085815260208120601f198616915b828110156156a357888601518255948401946001909101908401615684565b50858210156156c15787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061570490830184614b39565b9695505050505050565b60006020828403121561572057600080fd5b8151614a4d81614a1a565b60008154615738816152b0565b60018281168015615750576001811461576557615794565b60ff1984168752821515830287019450615794565b8560005260208060002060005b8581101561578b5781548a820152908401908201615772565b50505082870194505b5050505092915050565b60006157aa828661572b565b84516157ba818360208901614b15565b6157c68183018661572b565b97965050505050505056feee151c8401928dc223602bb187aff91b9a56c7cae5476ef1b3287b085a16c85fa26469706673582212204b416c87e64c91b17b8d4562498e9fa62fa99fe6bb298a10771db1d8e385de9b64736f6c63430008180033
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.