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 | 18763830 | 245 days ago | IN | 0 ETH | 0.25709556 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.
Contract Name:
PropsERC721AUStakingV4
Compiler Version
v0.8.13+commit.abaa5c0e
Optimization Enabled:
Yes with 1 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: Apache 2.0 pragma solidity ^0.8.4; // ========== External imports ========== import "erc721a-upgradeable/contracts/extensions/ERC721AQueryableUpgradeable.sol"; import "erc721a-upgradeable/contracts/extensions/IERC721AQueryableUpgradeable.sol"; import "erc721a-upgradeable/contracts/extensions/ERC721ABurnableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/access/AccessControlEnumerableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/MulticallUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/interfaces/IERC2981Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/structs/EnumerableSetUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/cryptography/ECDSAUpgradeable.sol"; import "@thirdweb-dev/contracts/openzeppelin-presets/metatx/ERC2771ContextUpgradeable.sol"; import "@thirdweb-dev/contracts/feature/interface/IOwnable.sol"; import "@thirdweb-dev/contracts/lib/MerkleProof.sol"; // ========== Internal imports ========== import "../interfaces/IAllowlist.sol"; import "../interfaces/ISignatureMinting.sol"; import "../interfaces/IERC20StakingToken.sol"; import "../interfaces/IConfig.sol"; import "../interfaces/IPropsContract.sol"; interface SanctionsList { function isSanctioned(address addr) external view returns (bool); } contract PropsERC721AUStakingV4 is Initializable, IOwnable, IAllowlist, IConfig, IPropsContract, ReentrancyGuardUpgradeable, PausableUpgradeable, ERC2771ContextUpgradeable, MulticallUpgradeable, AccessControlEnumerableUpgradeable, ERC721ABurnableUpgradeable, ERC721AQueryableUpgradeable { using StringsUpgradeable for uint256; using EnumerableSetUpgradeable for EnumerableSetUpgradeable.Bytes32Set; using ECDSAUpgradeable for bytes32; ////////////////////////////////////////////// // State Vars ///////////////////////////////////////////// bytes32 private constant MODULE_TYPE = bytes32("PropsERC721AUStaking"); uint256 private constant VERSION = 1; uint256 private nextTokenId; mapping(address => uint256) public minted; mapping(address => mapping(uint256 => uint256)) public mintedByAllowlist; bytes32 private constant CONTRACT_ADMIN_ROLE = keccak256("CONTRACT_ADMIN_ROLE"); bytes32 private constant MINTER_ROLE = keccak256("MINTER_ROLE"); bytes32 private constant PRODUCER_ROLE = keccak256("PRODUCER_ROLE"); uint256 private SECONDS_IN_ISSUANCE_PERIOD; bool public isSelfClaimActive; // keeps track of unclaimed tokens mapping(address => mapping(uint256 => uint256)) public claimTimer; // @dev reserving space for 10 more roles bytes32[32] private __gap; string private baseURI_; string public contractURI; address private _owner; address private accessRegistry; address public project; address public receivingWallet; address public stakingERC20Address; address[] private trustedForwarders; Allowlists public allowlists; Config public config; ////////////////////////////////////////////// // Errors ///////////////////////////////////////////// error AllowlistInactive(); error MintQuantityInvalid(); error MerkleProofInvalid(); error MintClosed(); error InsufficientFunds(); error InvalidSignature(); ////////////////////////////////////////////// // Events ///////////////////////////////////////////// event Minted(address indexed account, string tokens); ////////////////////////////////////////////// // Init ///////////////////////////////////////////// function initialize( address _defaultAdmin, string memory _name, string memory _symbol, string memory _baseURI, address[] memory _trustedForwarders, address _receivingWallet, address _accessRegistry ) public initializer { __ReentrancyGuard_init(); __ERC2771Context_init(_trustedForwarders); __ERC721A_init(_name, _symbol); receivingWallet = _receivingWallet; _owner = _defaultAdmin; accessRegistry = _accessRegistry; baseURI_ = _baseURI; _setupRole(DEFAULT_ADMIN_ROLE, _defaultAdmin); _setRoleAdmin(CONTRACT_ADMIN_ROLE, DEFAULT_ADMIN_ROLE); _setRoleAdmin(PRODUCER_ROLE, CONTRACT_ADMIN_ROLE); _setRoleAdmin(MINTER_ROLE, PRODUCER_ROLE); nextTokenId = 1; SECONDS_IN_ISSUANCE_PERIOD = 86400; isSelfClaimActive = false; } /*/////////////////////////////////////////////////////////////// Generic contract logic //////////////////////////////////////////////////////////////*/ /// @dev Returns the type of the contract. function contractType() external pure returns (bytes32) { return MODULE_TYPE; } /// @dev Returns the version of the contract. function contractVersion() external pure returns (uint8) { return uint8(VERSION); } /** * @dev Returns the address of the current owner. */ function owner() public view returns (address) { return hasRole(DEFAULT_ADMIN_ROLE, _owner) ? _owner : address(0); } modifier onlyOwner() { require(tx.origin == _owner || msg.sender == _owner); _; } /*/////////////////////////////////////////////////////////////// ERC 165 / 721A logic //////////////////////////////////////////////////////////////*/ /** * @dev see {ERC721AUpgradeable} */ function _startTokenId() internal view virtual override returns (uint256) { return 1; } /** * @dev see {IERC721Metadata} */ function tokenURI(uint256 _tokenId) public view virtual override(ERC721AUpgradeable, IERC721MetadataUpgradeable) returns (string memory) { require( _exists(_tokenId), "ERC721Metadata: URI query for nonexistent token" ); return string(abi.encodePacked(baseURI_, _tokenId.toString(), ".json")); } /** * @dev see {IERC165-supportsInterface} */ function supportsInterface(bytes4 interfaceId) public view virtual override( AccessControlEnumerableUpgradeable, ERC721AUpgradeable, IERC165Upgradeable ) returns (bool) { return super.supportsInterface(interfaceId) || type(IERC2981Upgradeable).interfaceId == interfaceId; } function mint( uint256[] calldata _quantities, bytes32[][] calldata _proofs, uint256[] calldata _allocations, uint256[] calldata _allowlistIds ) external payable nonReentrant { if (isSanctioned(msg.sender)) revert Sanctioned(); uint256 _cost = 0; uint256 _quantity = 0; for (uint256 i = 0; i < _quantities.length; i++) { _quantity += _quantities[i]; // @dev Require could save .029kb revertOnInactiveList(_allowlistIds[i]); revertOnAllocationCheckFailure( msg.sender, _allowlistIds[i], mintedByAllowlist[msg.sender][_allowlistIds[i]], _quantities[i], _allocations[i], _proofs[i] ); _cost += allowlists.lists[_allowlistIds[i]].price * _quantities[i]; } require( nextTokenId + _quantity - 1 <= config.mintConfig.maxSupply, "Exceeded max supply." ); if (_cost > msg.value) revert InsufficientFunds(); (bool sent, bytes memory data) = receivingWallet.call{ value: msg.value }( "" ); // mint _quantity tokens string memory tokensMinted = ""; unchecked { for (uint256 i = nextTokenId; i < nextTokenId + _quantity; i++) { tokensMinted = string( abi.encodePacked(tokensMinted, i.toString(), ",") ); } for (uint256 i = 0; i < _quantities.length; i++) { mintedByAllowlist[address(msg.sender)][ _allowlistIds[i] ] += _quantities[i]; } minted[address(msg.sender)] += _quantity; nextTokenId += _quantity; _safeMint(msg.sender, _quantity); } emit Minted(msg.sender, tokensMinted); } function mintWithSignature(ISignatureMinting.SignatureMintCart calldata cart) external payable nonReentrant { uint256 _cost = 0; uint256 _quantity = 0; for (uint256 i = 0; i < cart.items.length; i++) { ISignatureMinting.SignatureMintCartItem memory _item = cart.items[i]; //validate signatures //validate quantities against allocations IERC20StakingToken(stakingERC20Address).revertOnInvalidMintSignature( msg.sender, _item ); IERC20StakingToken(stakingERC20Address).logMintActivity( cart.items[i].uid, address(msg.sender), cart.items[i].quantity ); _quantity += _item.quantity; _cost += _item.price * _item.quantity; } require( nextTokenId + _quantity - 1 <= config.mintConfig.maxSupply, "Exceeded max supply." ); if (_cost > msg.value) revert InsufficientFunds(); (bool sent, bytes memory data) = receivingWallet.call{ value: msg.value }( "" ); // mint _quantity tokens string memory tokensMinted = ""; unchecked { for (uint256 i = nextTokenId; i < nextTokenId + _quantity; i++) { tokensMinted = string( abi.encodePacked(tokensMinted, i.toString(), ",") ); } minted[address(msg.sender)] += _quantity; nextTokenId += _quantity; _safeMint(msg.sender, _quantity); } emit Minted(msg.sender, tokensMinted); } function revertOnInactiveList(uint256 _allowlistId) internal view { if ( paused() || block.timestamp < allowlists.lists[_allowlistId].startTime || block.timestamp > allowlists.lists[_allowlistId].endTime || !allowlists.lists[_allowlistId].isActive ) revert AllowlistInactive(); } // @dev +~0.695kb function revertOnAllocationCheckFailure( address _address, uint256 _allowlistId, uint256 _minted, uint256 _quantity, uint256 _alloted, bytes32[] calldata _proof ) internal view { Allowlist storage allowlist = allowlists.lists[_allowlistId]; if (_quantity + _minted > allowlist.maxMintPerWallet) revert MintQuantityInvalid(); if (allowlist.typedata != bytes32(0)) { if (_quantity > _alloted || ((_quantity + _minted) > _alloted)) revert MintQuantityInvalid(); (bool validMerkleProof, ) = MerkleProof.verify( _proof, allowlist.typedata, keccak256(abi.encodePacked(_address, _alloted)) ); if (!validMerkleProof) revert MerkleProofInvalid(); } } /*/////////////////////////////////////////////////////////////// Allowlist Logic //////////////////////////////////////////////////////////////*/ function updateAllowlistByIndex(Allowlist calldata _allowlist, uint256 i) external minRole(PRODUCER_ROLE) { allowlists.lists[i] = _allowlist; } function addAllowlist(Allowlist calldata _allowlist) external minRole(PRODUCER_ROLE) { allowlists.lists[allowlists.count] = _allowlist; allowlists.count++; } /*/////////////////////////////////////////////////////////////// Getters //////////////////////////////////////////////////////////////*/ /// @dev Returns the allowlist at the given uid. function getAllowlistById(uint256 _allowlistId) external view returns (Allowlist memory allowlist) { allowlist = allowlists.lists[_allowlistId]; } /// @dev Returns the number of minted tokens for sender by allowlist. function getMintedByAllowlist(uint256 _allowlistId) external view returns (uint256 mintedBy) { mintedBy = mintedByAllowlist[msg.sender][_allowlistId]; } /*/////////////////////////////////////////////////////////////// Setters //////////////////////////////////////////////////////////////*/ function setReceivingWallet(address _address) external onlyOwner { receivingWallet = _address; } function setStakingERC20Address(address _address) external minRole(CONTRACT_ADMIN_ROLE) { stakingERC20Address = _address; } function setConfig(Config calldata _config) external minRole(PRODUCER_ROLE) { config = _config; } /// @dev Lets a contract admin set a new owner for the contract. The new owner must be a contract admin. function setOwner(address _newOwner) external onlyRole(DEFAULT_ADMIN_ROLE) { require(hasRole(DEFAULT_ADMIN_ROLE, _newOwner), "!ADMIN"); address _prevOwner = _owner; _owner = _newOwner; emit OwnerUpdated(_prevOwner, _newOwner); } /// @dev Lets a contract admin set the URI for contract-level metadata. function setContractURI(string calldata _uri) external minRole(CONTRACT_ADMIN_ROLE) { contractURI = _uri; } /// @dev Lets a contract admin set the URI for the baseURI. function setBaseURI(string calldata _baseURI) external minRole(CONTRACT_ADMIN_ROLE) { baseURI_ = _baseURI; } /*/////////////////////////////////////////////////////////////// Miscellaneous / Overrides //////////////////////////////////////////////////////////////*/ function pause() external minRole(MINTER_ROLE) { _pause(); } function unpause() external minRole(MINTER_ROLE) { _unpause(); } function grantRole(bytes32 role, address account) public virtual override(AccessControlUpgradeable, IAccessControlUpgradeable) minRole(CONTRACT_ADMIN_ROLE) { if (!hasRole(role, account)) { super._grantRole(role, account); } } function revokeRole(bytes32 role, address account) public virtual override(AccessControlUpgradeable, IAccessControlUpgradeable) minRole(CONTRACT_ADMIN_ROLE) { if (hasRole(role, account)) { if (role == DEFAULT_ADMIN_ROLE && account == owner()) revert(); super._revokeRole(role, account); } } /** * @dev Check if minimum role for function is required. */ modifier minRole(bytes32 _role) { require(_hasMinRole(_role), "Not authorized"); _; } function hasMinRole(bytes32 _role) public view virtual returns (bool) { return _hasMinRole(_role); } function _hasMinRole(bytes32 _role) internal view returns (bool) { // @dev does account have role? if (hasRole(_role, msg.sender)) return true; // @dev are we checking against default admin? if (_role == DEFAULT_ADMIN_ROLE) return false; // @dev walk up tree to check if user has role admin role return _hasMinRole(getRoleAdmin(_role)); } // @dev See {ERC721-_beforeTokenTransfer}. function _beforeTokenTransfers( address from, address to, uint256 startTokenId, uint256 quantity ) internal override(ERC721AUpgradeable) { super._beforeTokenTransfers(from, to, startTokenId, quantity); if (isSanctioned(from)) revert Sanctioned(); if (isSanctioned(to)) revert Sanctioned(); for (uint256 i = 0; i < quantity; i++) { // claim unclaimed erc20 tokens if not mint if (from != address(0x0)) { forceClaimERC20Tokens(from, startTokenId + i); } // closed stream represented by 0 claimTimer[from][startTokenId + i] = 0; // open stream to claimTimer[to][startTokenId + i] = block.timestamp; } } //@dev retrieves the number of unclaimed ERC20 tokens for a specific token function unclaimedERC20BalanceByToken(uint256 tokenId, address holder) public view returns (uint256 unclaimedERC20Tokens) { // get time acquired nft uint256 acquiredTime = claimTimer[holder][tokenId]; if (acquiredTime == 0) { return 0; } // get current time uint256 timestamp = block.timestamp; // calculate delta uint256 timeDelta = timestamp - acquiredTime; // divide delta by seconds to get amounts of days (tokens) unclaimedERC20Tokens = timeDelta / SECONDS_IN_ISSUANCE_PERIOD; } //@dev retrieves the number of unclaimed ERC20 tokens by the holder function aggregateUnclaimedERC20TokenBalance(address holder) public view returns (uint256 erc20tokens) { // retrieve 721A tokens owned uint256[] memory tokensOwned = IERC721AQueryableUpgradeable(address(this)) .tokensOfOwner(holder); erc20tokens = 0; // iterate over owned tokens for (uint256 i = 0; i < tokensOwned.length; i++) { erc20tokens += unclaimedERC20BalanceByToken(tokensOwned[i], holder); } } //@dev aggregates the number of ERC20 tokens owned/claimed by the holder and the number of unclaimed ERC20 tokens for the holder function aggregateTotalERC20TokenBalance(address holder) public view returns (uint256 erc20tokens) { //retrieve balance of non-transferable ERC20 and add to unclaimed erc20tokens = IERC20Upgradeable(stakingERC20Address).balanceOf(holder); } //@dev, called on beforeTokenTransfers to mint unclaimed erc20 tokens to sender of token function forceClaimERC20Tokens(address from, uint256 tokenId) public { // require msg sender owner of eggs require(ownerOf(tokenId) == from, "Not Owner"); // get unstored balance uint256 unclaimedERC20Tokens = unclaimedERC20BalanceByToken(tokenId, from); // add to current balance IERC20StakingToken(stakingERC20Address).issueTokens( from, unclaimedERC20Tokens ); // reset time delta claimTimer[from][tokenId] = block.timestamp; } function claimERC20Tokens() public { require(isSelfClaimActive, "Self-Claim Inactive"); // retrieve 721A tokens owned uint256[] memory tokensOwned = IERC721AQueryableUpgradeable(address(this)) .tokensOfOwner(msg.sender); for (uint256 i = 0; i < tokensOwned.length; i++) { forceClaimERC20Tokens(msg.sender, tokensOwned[i]); claimTimer[msg.sender][tokensOwned[i]] = block.timestamp; } } function _msgSender() internal view virtual override(ContextUpgradeable, ERC2771ContextUpgradeable) returns (address sender) { return address(0); } function _msgData() internal view virtual override(ContextUpgradeable, ERC2771ContextUpgradeable) returns (bytes calldata) { return ERC2771ContextUpgradeable._msgData(); } //Upgrades function isSanctioned(address _operatorAddress) public view returns (bool) { SanctionsList sanctionsList = SanctionsList(SANCTIONS_CONTRACT); bool isToSanctioned = sanctionsList.isSanctioned(_operatorAddress); return isToSanctioned; } function setSanctionsContract(address _address) external { require(hasMinRole(CONTRACT_ADMIN_ROLE)); SANCTIONS_CONTRACT = _address; } /// @dev Returns the number of minted tokens for sender by allowlist. function getMintedByUid(string calldata _uid, address _wallet) external view returns (uint256) { return IERC20StakingToken(stakingERC20Address).getMintedByUid(_uid,_wallet); } address public SANCTIONS_CONTRACT; error Sanctioned(); function airdrop(address[] calldata __to, uint256[] calldata __quantities) external minRole(MINTER_ROLE){ for (uint i = 0; i < __to.length; i++) { nextTokenId += __quantities[i]; _safeMint(__to[i], __quantities[i]); } } uint256[47] private ___gap; }
// SPDX-License-Identifier: MIT // ERC721A Contracts v3.3.0 // Creator: Chiru Labs pragma solidity ^0.8.4; import "./IERC721AQueryableUpgradeable.sol"; import "../ERC721AUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; /** * @title ERC721A Queryable * @dev ERC721A subclass with convenience query functions. */ abstract contract ERC721AQueryableUpgradeable is Initializable, ERC721AUpgradeable, IERC721AQueryableUpgradeable { function __ERC721AQueryable_init() internal onlyInitializing { } function __ERC721AQueryable_init_unchained() internal onlyInitializing { } /** * @dev Returns the `TokenOwnership` struct at `tokenId` without reverting. * * If the `tokenId` is out of bounds: * - `addr` = `address(0)` * - `startTimestamp` = `0` * - `burned` = `false` * * If the `tokenId` is burned: * - `addr` = `<Address of owner before token was burned>` * - `startTimestamp` = `<Timestamp when token was burned>` * - `burned = `true` * * Otherwise: * - `addr` = `<Address of owner>` * - `startTimestamp` = `<Timestamp of start of ownership>` * - `burned = `false` */ function explicitOwnershipOf(uint256 tokenId) public view override returns (TokenOwnership memory) { TokenOwnership memory ownership; if (tokenId < _startTokenId() || tokenId >= _currentIndex) { return ownership; } ownership = _ownerships[tokenId]; if (ownership.burned) { return ownership; } return _ownershipOf(tokenId); } /** * @dev Returns an array of `TokenOwnership` structs at `tokenIds` in order. * See {ERC721AQueryable-explicitOwnershipOf} */ function explicitOwnershipsOf(uint256[] memory tokenIds) external view override returns (TokenOwnership[] memory) { unchecked { uint256 tokenIdsLength = tokenIds.length; TokenOwnership[] memory ownerships = new TokenOwnership[](tokenIdsLength); for (uint256 i; i != tokenIdsLength; ++i) { ownerships[i] = explicitOwnershipOf(tokenIds[i]); } return ownerships; } } /** * @dev Returns an array of token IDs owned by `owner`, * in the range [`start`, `stop`) * (i.e. `start <= tokenId < stop`). * * This function allows for tokens to be queried if the collection * grows too big for a single call of {ERC721AQueryable-tokensOfOwner}. * * Requirements: * * - `start` < `stop` */ function tokensOfOwnerIn( address owner, uint256 start, uint256 stop ) external view override returns (uint256[] memory) { unchecked { if (start >= stop) revert InvalidQueryRange(); uint256 tokenIdsIdx; uint256 stopLimit = _currentIndex; // Set `start = max(start, _startTokenId())`. if (start < _startTokenId()) { start = _startTokenId(); } // Set `stop = min(stop, _currentIndex)`. if (stop > stopLimit) { stop = stopLimit; } uint256 tokenIdsMaxLength = balanceOf(owner); // Set `tokenIdsMaxLength = min(balanceOf(owner), stop - start)`, // to cater for cases where `balanceOf(owner)` is too big. if (start < stop) { uint256 rangeLength = stop - start; if (rangeLength < tokenIdsMaxLength) { tokenIdsMaxLength = rangeLength; } } else { tokenIdsMaxLength = 0; } uint256[] memory tokenIds = new uint256[](tokenIdsMaxLength); if (tokenIdsMaxLength == 0) { return tokenIds; } // We need to call `explicitOwnershipOf(start)`, // because the slot at `start` may not be initialized. TokenOwnership memory ownership = explicitOwnershipOf(start); address currOwnershipAddr; // If the starting slot exists (i.e. not burned), initialize `currOwnershipAddr`. // `ownership.address` will not be zero, as `start` is clamped to the valid token ID range. if (!ownership.burned) { currOwnershipAddr = ownership.addr; } for (uint256 i = start; i != stop && tokenIdsIdx != tokenIdsMaxLength; ++i) { ownership = _ownerships[i]; if (ownership.burned) { continue; } if (ownership.addr != address(0)) { currOwnershipAddr = ownership.addr; } if (currOwnershipAddr == owner) { tokenIds[tokenIdsIdx++] = i; } } // Downsize the array to fit. assembly { mstore(tokenIds, tokenIdsIdx) } return tokenIds; } } /** * @dev Returns an array of token IDs owned by `owner`. * * This function scans the ownership mapping and is O(totalSupply) in complexity. * It is meant to be called off-chain. * * See {ERC721AQueryable-tokensOfOwnerIn} for splitting the scan into * multiple smaller scans if the collection is large enough to cause * an out-of-gas error (10K pfp collections should be fine). */ function tokensOfOwner(address owner) external view override returns (uint256[] memory) { unchecked { uint256 tokenIdsIdx; address currOwnershipAddr; uint256 tokenIdsLength = balanceOf(owner); uint256[] memory tokenIds = new uint256[](tokenIdsLength); TokenOwnership memory ownership; for (uint256 i = _startTokenId(); tokenIdsIdx != tokenIdsLength; ++i) { ownership = _ownerships[i]; if (ownership.burned) { continue; } if (ownership.addr != address(0)) { currOwnershipAddr = ownership.addr; } if (currOwnershipAddr == owner) { tokenIds[tokenIdsIdx++] = i; } } return tokenIds; } } /** * @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 // ERC721A Contracts v3.3.0 // Creator: Chiru Labs pragma solidity ^0.8.4; import "../IERC721AUpgradeable.sol"; /** * @dev Interface of an ERC721AQueryable compliant contract. */ interface IERC721AQueryableUpgradeable is IERC721AUpgradeable { /** * Invalid query range (`start` >= `stop`). */ error InvalidQueryRange(); /** * @dev Returns the `TokenOwnership` struct at `tokenId` without reverting. * * If the `tokenId` is out of bounds: * - `addr` = `address(0)` * - `startTimestamp` = `0` * - `burned` = `false` * * If the `tokenId` is burned: * - `addr` = `<Address of owner before token was burned>` * - `startTimestamp` = `<Timestamp when token was burned>` * - `burned = `true` * * Otherwise: * - `addr` = `<Address of owner>` * - `startTimestamp` = `<Timestamp of start of ownership>` * - `burned = `false` */ function explicitOwnershipOf(uint256 tokenId) external view returns (TokenOwnership memory); /** * @dev Returns an array of `TokenOwnership` structs at `tokenIds` in order. * See {ERC721AQueryable-explicitOwnershipOf} */ function explicitOwnershipsOf(uint256[] memory tokenIds) external view returns (TokenOwnership[] memory); /** * @dev Returns an array of token IDs owned by `owner`, * in the range [`start`, `stop`) * (i.e. `start <= tokenId < stop`). * * This function allows for tokens to be queried if the collection * grows too big for a single call of {ERC721AQueryable-tokensOfOwner}. * * Requirements: * * - `start` < `stop` */ function tokensOfOwnerIn( address owner, uint256 start, uint256 stop ) external view returns (uint256[] memory); /** * @dev Returns an array of token IDs owned by `owner`. * * This function scans the ownership mapping and is O(totalSupply) in complexity. * It is meant to be called off-chain. * * See {ERC721AQueryable-tokensOfOwnerIn} for splitting the scan into * multiple smaller scans if the collection is large enough to cause * an out-of-gas error (10K pfp collections should be fine). */ function tokensOfOwner(address owner) external view returns (uint256[] memory); }
// SPDX-License-Identifier: MIT // ERC721A Contracts v3.3.0 // Creator: Chiru Labs pragma solidity ^0.8.4; import "./IERC721ABurnableUpgradeable.sol"; import "../ERC721AUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; /** * @title ERC721A Burnable Token * @dev ERC721A Token that can be irreversibly burned (destroyed). */ abstract contract ERC721ABurnableUpgradeable is Initializable, ERC721AUpgradeable, IERC721ABurnableUpgradeable { function __ERC721ABurnable_init() internal onlyInitializing { } function __ERC721ABurnable_init_unchained() internal onlyInitializing { } /** * @dev Burns `tokenId`. See {ERC721A-_burn}. * * Requirements: * * - The caller must own `tokenId` or be an approved operator. */ function burn(uint256 tokenId) public virtual override { _burn(tokenId, true); } /** * @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.6.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20Upgradeable { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `from` to `to` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 amount ) external returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (access/AccessControlEnumerable.sol) pragma solidity ^0.8.0; import "./IAccessControlEnumerableUpgradeable.sol"; import "./AccessControlUpgradeable.sol"; import "../utils/structs/EnumerableSetUpgradeable.sol"; import "../proxy/utils/Initializable.sol"; /** * @dev Extension of {AccessControl} that allows enumerating the members of each role. */ abstract contract AccessControlEnumerableUpgradeable is Initializable, IAccessControlEnumerableUpgradeable, AccessControlUpgradeable { function __AccessControlEnumerable_init() internal onlyInitializing { } function __AccessControlEnumerable_init_unchained() internal onlyInitializing { } using EnumerableSetUpgradeable for EnumerableSetUpgradeable.AddressSet; mapping(bytes32 => EnumerableSetUpgradeable.AddressSet) private _roleMembers; /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControlEnumerableUpgradeable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Returns one of the accounts that have `role`. `index` must be a * value between 0 and {getRoleMemberCount}, non-inclusive. * * Role bearers are not sorted in any particular way, and their ordering may * change at any point. * * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure * you perform all queries on the same block. See the following * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post] * for more information. */ function getRoleMember(bytes32 role, uint256 index) public view virtual override returns (address) { return _roleMembers[role].at(index); } /** * @dev Returns the number of accounts that have `role`. Can be used * together with {getRoleMember} to enumerate all bearers of a role. */ function getRoleMemberCount(bytes32 role) public view virtual override returns (uint256) { return _roleMembers[role].length(); } /** * @dev Overload {_grantRole} to track enumerable memberships */ function _grantRole(bytes32 role, address account) internal virtual override { super._grantRole(role, account); _roleMembers[role].add(account); } /** * @dev Overload {_revokeRole} to track enumerable memberships */ function _revokeRole(bytes32 role, address account) internal virtual override { super._revokeRole(role, account); _roleMembers[role].remove(account); } /** * @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.8.0) (security/ReentrancyGuard.sol) pragma solidity ^0.8.0; import "../proxy/utils/Initializable.sol"; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuardUpgradeable is Initializable { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; function __ReentrancyGuard_init() internal onlyInitializing { __ReentrancyGuard_init_unchained(); } function __ReentrancyGuard_init_unchained() internal onlyInitializing { _status = _NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { _nonReentrantBefore(); _; _nonReentrantAfter(); } function _nonReentrantBefore() private { // On the first call to nonReentrant, _status will be _NOT_ENTERED require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; } function _nonReentrantAfter() private { // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } /** * @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.7.0) (security/Pausable.sol) pragma solidity ^0.8.0; import "../utils/ContextUpgradeable.sol"; import "../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.5.0) (utils/Multicall.sol) pragma solidity ^0.8.0; import "./AddressUpgradeable.sol"; import "../proxy/utils/Initializable.sol"; /** * @dev Provides a function to batch together multiple calls in a single external call. * * _Available since v4.1._ */ abstract contract MulticallUpgradeable is Initializable { function __Multicall_init() internal onlyInitializing { } function __Multicall_init_unchained() internal onlyInitializing { } /** * @dev Receives and executes a batch of function calls on this contract. */ function multicall(bytes[] calldata data) external virtual returns (bytes[] memory results) { results = new bytes[](data.length); for (uint256 i = 0; i < data.length; i++) { results[i] = _functionDelegateCall(address(this), data[i]); } return results; } /** * @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) private returns (bytes memory) { require(AddressUpgradeable.isContract(target), "Address: delegate call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.delegatecall(data); return AddressUpgradeable.verifyCallResult(success, returndata, "Address: low-level delegate call failed"); } /** * @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.8.0) (utils/Strings.sol) pragma solidity ^0.8.0; import "./math/MathUpgradeable.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 `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); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (interfaces/IERC2981.sol) pragma solidity ^0.8.0; import "../utils/introspection/IERC165Upgradeable.sol"; /** * @dev Interface for the NFT Royalty Standard. * * A standardized way to retrieve royalty payment information for non-fungible tokens (NFTs) to enable universal * support for royalty payments across all NFT marketplaces and ecosystem participants. * * _Available since v4.5._ */ interface IERC2981Upgradeable is IERC165Upgradeable { /** * @dev Returns how much royalty is owed and to whom, based on a sale price that may be denominated in any unit of * exchange. The royalty amount is denominated and should be paid in that same unit of exchange. */ function royaltyInfo(uint256 tokenId, uint256 salePrice) external view returns (address receiver, uint256 royaltyAmount); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/structs/EnumerableSet.sol) // This file was procedurally generated from scripts/generate/templates/EnumerableSet.js. pragma solidity ^0.8.0; /** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are made on the ordering. * * ``` * contract Example { * // Add the library methods * using EnumerableSet for EnumerableSet.AddressSet; * * // Declare a set state variable * EnumerableSet.AddressSet private mySet; * } * ``` * * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`) * and `uint256` (`UintSet`) are supported. * * [WARNING] * ==== * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure * unusable. * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info. * * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an * array of EnumerableSet. * ==== */ library EnumerableSetUpgradeable { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are just wrappers around the // underlying Set. // This means that we can only create new EnumerableSets for types that fit // in bytes32. struct Set { // Storage of set values bytes32[] _values; // Position of the value in the `values` array, plus 1 because index 0 // means a value is not in the set. mapping(bytes32 => uint256) _indexes; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function _add(Set storage set, bytes32 value) private returns (bool) { if (!_contains(set, value)) { set._values.push(value); // The value is stored at length-1, but we add 1 to all indexes // and use 0 as a sentinel value set._indexes[value] = set._values.length; return true; } else { return false; } } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function _remove(Set storage set, bytes32 value) private returns (bool) { // We read and store the value's index to prevent multiple reads from the same storage slot uint256 valueIndex = set._indexes[value]; if (valueIndex != 0) { // Equivalent to contains(set, value) // To delete an element from the _values array in O(1), we swap the element to delete with the last one in // the array, and then remove the last element (sometimes called as 'swap and pop'). // This modifies the order of the array, as noted in {at}. uint256 toDeleteIndex = valueIndex - 1; uint256 lastIndex = set._values.length - 1; if (lastIndex != toDeleteIndex) { bytes32 lastValue = set._values[lastIndex]; // Move the last value to the index where the value to delete is set._values[toDeleteIndex] = lastValue; // Update the index for the moved value set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex } // Delete the slot where the moved value was stored set._values.pop(); // Delete the index for the deleted slot delete set._indexes[value]; return true; } else { return false; } } /** * @dev Returns true if the value is in the set. O(1). */ function _contains(Set storage set, bytes32 value) private view returns (bool) { return set._indexes[value] != 0; } /** * @dev Returns the number of values on the set. O(1). */ function _length(Set storage set) private view returns (uint256) { return set._values.length; } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function _at(Set storage set, uint256 index) private view returns (bytes32) { return set._values[index]; } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function _values(Set storage set) private view returns (bytes32[] memory) { return set._values; } // Bytes32Set struct Bytes32Set { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _add(set._inner, value); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _remove(set._inner, value); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) { return _contains(set._inner, value); } /** * @dev Returns the number of values in the set. O(1). */ function length(Bytes32Set storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) { return _at(set._inner, index); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(Bytes32Set storage set) internal view returns (bytes32[] memory) { bytes32[] memory store = _values(set._inner); bytes32[] memory result; /// @solidity memory-safe-assembly assembly { result := store } return result; } // AddressSet struct AddressSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(AddressSet storage set, address value) internal returns (bool) { return _add(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(AddressSet storage set, address value) internal returns (bool) { return _remove(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(AddressSet storage set, address value) internal view returns (bool) { return _contains(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns the number of values in the set. O(1). */ function length(AddressSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(AddressSet storage set, uint256 index) internal view returns (address) { return address(uint160(uint256(_at(set._inner, index)))); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(AddressSet storage set) internal view returns (address[] memory) { bytes32[] memory store = _values(set._inner); address[] memory result; /// @solidity memory-safe-assembly assembly { result := store } return result; } // UintSet struct UintSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(UintSet storage set, uint256 value) internal returns (bool) { return _add(set._inner, bytes32(value)); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(UintSet storage set, uint256 value) internal returns (bool) { return _remove(set._inner, bytes32(value)); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(UintSet storage set, uint256 value) internal view returns (bool) { return _contains(set._inner, bytes32(value)); } /** * @dev Returns the number of values in the set. O(1). */ function length(UintSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(UintSet storage set, uint256 index) internal view returns (uint256) { return uint256(_at(set._inner, index)); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(UintSet storage set) internal view returns (uint256[] memory) { bytes32[] memory store = _values(set._inner); uint256[] memory result; /// @solidity memory-safe-assembly assembly { result := store } return result; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.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) { // 32 is the length in bytes of hash, // enforced by the type signature above return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash)); } /** * @dev Returns an Ethereum Signed Message, created from `s`. This * produces hash corresponding to the one signed with the * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] * JSON-RPC method as part of EIP-191. * * See {recover}. */ function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", StringsUpgradeable.toString(s.length), s)); } /** * @dev Returns an Ethereum Signed Typed Data, created from a * `domainSeparator` and a `structHash`. This produces hash corresponding * to the one signed with the * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] * JSON-RPC method as part of EIP-712. * * See {recover}. */ function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.0 (metatx/ERC2771Context.sol) pragma solidity ^0.8.11; import "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; /** * @dev Context variant with ERC2771 support. */ abstract contract ERC2771ContextUpgradeable is Initializable, ContextUpgradeable { mapping(address => bool) private _trustedForwarder; function __ERC2771Context_init(address[] memory trustedForwarder) internal onlyInitializing { __Context_init_unchained(); __ERC2771Context_init_unchained(trustedForwarder); } function __ERC2771Context_init_unchained(address[] memory trustedForwarder) internal onlyInitializing { for (uint256 i = 0; i < trustedForwarder.length; i++) { _trustedForwarder[trustedForwarder[i]] = true; } } function isTrustedForwarder(address forwarder) public view virtual returns (bool) { return _trustedForwarder[forwarder]; } function _msgSender() internal view virtual override returns (address sender) { if (isTrustedForwarder(msg.sender)) { // The assembly code is more direct than the Solidity version using `abi.decode`. assembly { sender := shr(96, calldataload(sub(calldatasize(), 20))) } } else { return super._msgSender(); } } function _msgData() internal view virtual override returns (bytes calldata) { if (isTrustedForwarder(msg.sender)) { return msg.data[:msg.data.length - 20]; } else { return super._msgData(); } } uint256[49] private __gap; }
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; /** * Thirdweb's `Ownable` is a contract extension to be used with any base contract. It exposes functions for setting and reading * who the 'owner' of the inheriting smart contract is, and lets the inheriting contract perform conditional logic that uses * information about who the contract's owner is. */ interface IOwnable { /// @dev Returns the owner of the contract. function owner() external view returns (address); /// @dev Lets a module admin set a new owner for the contract. The new owner must be a module admin. function setOwner(address _newOwner) external; /// @dev Emitted when a new Owner is set. event OwnerUpdated(address indexed prevOwner, address indexed newOwner); /// @dev Emitted when an unauthorized caller tries to set the owner. error Ownable__NotAuthorized(); }
// SPDX-License-Identifier: MIT // Modified from https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.3.0/contracts/utils/cryptography/MerkleProof.sol // Copied from https://github.com/ensdomains/governance/blob/master/contracts/MerkleProof.sol pragma solidity ^0.8.11; /** * @dev These functions deal with verification of Merkle Trees proofs. * * The proofs can be generated using the JavaScript library * https://github.com/miguelmota/merkletreejs[merkletreejs]. * Note: the hashing algorithm should be keccak256 and pair sorting should be enabled. * * See `test/utils/cryptography/MerkleProof.test.js` for some examples. * * Source: https://github.com/ensdomains/governance/blob/master/contracts/MerkleProof.sol */ library MerkleProof { /** * @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree * defined by `root`. For this, a `proof` must be provided, containing * sibling hashes on the branch from the leaf to the root of the tree. Each * pair of leaves and each pair of pre-images are assumed to be sorted. */ function verify( bytes32[] memory proof, bytes32 root, bytes32 leaf ) internal pure returns (bool, uint256) { bytes32 computedHash = leaf; uint256 index = 0; for (uint256 i = 0; i < proof.length; i++) { index *= 2; bytes32 proofElement = proof[i]; if (computedHash <= proofElement) { // Hash(current computed hash + current element of the proof) computedHash = keccak256(abi.encodePacked(computedHash, proofElement)); } else { // Hash(current element of the proof + current computed hash) computedHash = keccak256(abi.encodePacked(proofElement, computedHash)); index += 1; } } // Check if the computed hash (root) is equal to the provided root return (computedHash == root, index); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.9; interface IAllowlist { struct Allowlist { bytes32 typedata; bool isActive; string metadataUri; string name; uint256 price; uint256 maxMintPerWallet; uint256 tokenPool; uint256 startTime; uint256 endTime; } struct Allowlists { uint256 currentStartId; uint256 count; mapping(uint256 => Allowlist) lists; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.9; interface ISignatureMinting { struct SignatureMintCart { SignatureMintCartItem[] items; } struct SignatureMintCartItem{ string uid; uint256 quantity; uint256 price; uint256 allocation; uint256 expirationTime; bytes signature; } struct MintSignature { address wallet_address; string uid; uint256 quantity; uint256 price; uint256 allocation; uint256 startTime; uint256 endTime; } struct Version { uint256 major; uint256 minor; uint256 patch; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.9; import "./ISignatureMinting.sol"; interface IERC20StakingToken { function issueTokens(address _to, uint256 _amount) external; function getSignatureVerifier() external view returns (address); function revertOnInvalidMintSignature(address sender, ISignatureMinting.SignatureMintCartItem memory cartItem) external view; function logMintActivity(string memory uid, address wallet_address, uint256 incrementalQuantity) external; function getMintedByUid(string calldata _uid, address _wallet) external view returns (uint256); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.9; /// @author: @props /** * @dev */ interface IConfig { /** * @dev Retool that - legacy */ // enum Extensions { // Allowlist, // Royalty, // Split // } /** * @dev */ struct Config { Mint mintConfig; Token tokenConfig; } /** * @dev */ struct Mint { bool isActive; uint256 startTime; uint256 endTime; uint256 maxSupply; uint256 maxPerWallet; uint256 maxPerTxn; uint256 price; } /** * @dev */ struct Token { string metadataUri; } /** * @dev */ struct Token1155 { uint256 tokenId; uint256 redeemStart; uint256 redeemEnd; uint256[] tokensToIssueOnRedeem; bool isRedeemable; string baseURI; string name; } }
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.11; interface IPropsContract { /// @dev Returns the module type of the contract. function contractType() external pure returns (bytes32); /// @dev Returns the version of the contract. function contractVersion() external pure returns (uint8); /// @dev Returns the metadata URI of the contract. function contractURI() external view returns (string memory); /** * @dev Sets contract URI for the storefront-level metadata of the contract. * Only module admin can call this function. */ function setContractURI(string calldata _uri) external; }
// SPDX-License-Identifier: MIT // ERC721A Contracts v3.3.0 // Creator: Chiru Labs pragma solidity ^0.8.4; import "./IERC721AUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC721/IERC721ReceiverUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/introspection/ERC165Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; /** * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including * the Metadata extension. Built to optimize for lower gas during batch mints. * * Assumes serials are sequentially minted starting at _startTokenId() (defaults to 0, e.g. 0, 1, 2, 3..). * * Assumes that an owner cannot have more than 2**64 - 1 (max value of uint64) of supply. * * Assumes that the maximum token id cannot exceed 2**256 - 1 (max value of uint256). */ contract ERC721AUpgradeable is Initializable, ContextUpgradeable, ERC165Upgradeable, IERC721AUpgradeable { using AddressUpgradeable for address; using StringsUpgradeable for uint256; // The tokenId of the next token to be minted. uint256 internal _currentIndex; // The number of tokens burned. uint256 internal _burnCounter; // Token name string private _name; // Token symbol string private _symbol; // Mapping from token ID to ownership details // An empty struct value does not necessarily mean the token is unowned. See _ownershipOf implementation for details. mapping(uint256 => TokenOwnership) internal _ownerships; // Mapping owner address to address data mapping(address => AddressData) private _addressData; // Mapping from token ID to approved address mapping(uint256 => address) private _tokenApprovals; // Mapping from owner to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; function __ERC721A_init(string memory name_, string memory symbol_) internal onlyInitializing { __ERC721A_init_unchained(name_, symbol_); } function __ERC721A_init_unchained(string memory name_, string memory symbol_) internal onlyInitializing { _name = name_; _symbol = symbol_; _currentIndex = _startTokenId(); } /** * To change the starting tokenId, please override this function. */ function _startTokenId() internal view virtual returns (uint256) { return 0; } /** * @dev Burned tokens are calculated here, use _totalMinted() if you want to count just minted tokens. */ function totalSupply() public view override returns (uint256) { // Counter underflow is impossible as _burnCounter cannot be incremented // more than _currentIndex - _startTokenId() times unchecked { return _currentIndex - _burnCounter - _startTokenId(); } } /** * Returns the total amount of tokens minted in the contract. */ function _totalMinted() internal view returns (uint256) { // Counter underflow is impossible as _currentIndex does not decrement, // and it is initialized to _startTokenId() unchecked { return _currentIndex - _startTokenId(); } } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165Upgradeable, IERC165Upgradeable) returns (bool) { return interfaceId == type(IERC721Upgradeable).interfaceId || interfaceId == type(IERC721MetadataUpgradeable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721-balanceOf}. */ function balanceOf(address owner) public view override returns (uint256) { if (owner == address(0)) revert BalanceQueryForZeroAddress(); return uint256(_addressData[owner].balance); } /** * Returns the number of tokens minted by `owner`. */ function _numberMinted(address owner) internal view returns (uint256) { return uint256(_addressData[owner].numberMinted); } /** * Returns the number of tokens burned by or on behalf of `owner`. */ function _numberBurned(address owner) internal view returns (uint256) { return uint256(_addressData[owner].numberBurned); } /** * Returns the auxillary data for `owner`. (e.g. number of whitelist mint slots used). */ function _getAux(address owner) internal view returns (uint64) { return _addressData[owner].aux; } /** * Sets the auxillary 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 { _addressData[owner].aux = aux; } /** * Gas spent here starts off proportional to the maximum mint batch size. * It gradually moves to O(1) as tokens get transferred around in the collection over time. */ function _ownershipOf(uint256 tokenId) internal view returns (TokenOwnership memory) { uint256 curr = tokenId; unchecked { if (_startTokenId() <= curr) if (curr < _currentIndex) { TokenOwnership memory ownership = _ownerships[curr]; if (!ownership.burned) { if (ownership.addr != address(0)) { return ownership; } // Invariant: // There will always be an ownership that has an address and is not burned // before an ownership that does not have an address and is not burned. // Hence, curr will not underflow. while (true) { curr--; ownership = _ownerships[curr]; if (ownership.addr != address(0)) { return ownership; } } } } } revert OwnerQueryForNonexistentToken(); } /** * @dev See {IERC721-ownerOf}. */ function ownerOf(uint256 tokenId) public view override returns (address) { return _ownershipOf(tokenId).addr; } /** * @dev See {IERC721Metadata-name}. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev See {IERC721Metadata-symbol}. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { if (!_exists(tokenId)) revert URIQueryForNonexistentToken(); string memory baseURI = _baseURI(); return bytes(baseURI).length != 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : ''; } /** * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each * token will be the concatenation of the `baseURI` and the `tokenId`. Empty * by default, can be overriden in child contracts. */ function _baseURI() internal view virtual returns (string memory) { return ''; } /** * @dev See {IERC721-approve}. */ function approve(address to, uint256 tokenId) public override { address owner = ERC721AUpgradeable.ownerOf(tokenId); if (to == owner) revert ApprovalToCurrentOwner(); if (_msgSender() != owner) if(!isApprovedForAll(owner, _msgSender())) { revert ApprovalCallerNotOwnerNorApproved(); } _approve(to, tokenId, owner); } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view override returns (address) { if (!_exists(tokenId)) revert ApprovalQueryForNonexistentToken(); return _tokenApprovals[tokenId]; } /** * @dev See {IERC721-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { if (operator == _msgSender()) revert ApproveToCaller(); _operatorApprovals[_msgSender()][operator] = approved; emit ApprovalForAll(_msgSender(), operator, approved); } /** * @dev See {IERC721-isApprovedForAll}. */ function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { return _operatorApprovals[owner][operator]; } /** * @dev See {IERC721-transferFrom}. */ function transferFrom( address from, address to, uint256 tokenId ) public virtual override { _transfer(from, to, tokenId); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId ) public virtual override { safeTransferFrom(from, to, tokenId, ''); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory _data ) public virtual override { _transfer(from, to, tokenId); if (to.isContract()) if(!_checkContractOnERC721Received(from, to, tokenId, _data)) { revert TransferToNonERC721ReceiverImplementer(); } } /** * @dev Returns whether `tokenId` exists. * * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}. * * Tokens start existing when they are minted (`_mint`), */ function _exists(uint256 tokenId) internal view returns (bool) { return _startTokenId() <= tokenId && tokenId < _currentIndex && !_ownerships[tokenId].burned; } /** * @dev Equivalent to `_safeMint(to, quantity, '')`. */ function _safeMint(address to, uint256 quantity) internal { _safeMint(to, 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. * * Emits a {Transfer} event. */ function _safeMint( address to, uint256 quantity, bytes memory _data ) internal { uint256 startTokenId = _currentIndex; if (to == address(0)) revert MintToZeroAddress(); if (quantity == 0) revert MintZeroQuantity(); _beforeTokenTransfers(address(0), to, startTokenId, quantity); // Overflows are incredibly unrealistic. // balance or numberMinted overflow if current value of either + quantity > 1.8e19 (2**64) - 1 // updatedIndex overflows if _currentIndex + quantity > 1.2e77 (2**256) - 1 unchecked { _addressData[to].balance += uint64(quantity); _addressData[to].numberMinted += uint64(quantity); _ownerships[startTokenId].addr = to; _ownerships[startTokenId].startTimestamp = uint64(block.timestamp); uint256 updatedIndex = startTokenId; uint256 end = updatedIndex + quantity; if (to.isContract()) { do { emit Transfer(address(0), to, updatedIndex); if (!_checkContractOnERC721Received(address(0), to, updatedIndex++, _data)) { revert TransferToNonERC721ReceiverImplementer(); } } while (updatedIndex < end); // Reentrancy protection if (_currentIndex != startTokenId) revert(); } else { do { emit Transfer(address(0), to, updatedIndex++); } while (updatedIndex < end); } _currentIndex = updatedIndex; } _afterTokenTransfers(address(0), to, startTokenId, quantity); } /** * @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. */ function _mint(address to, uint256 quantity) internal { uint256 startTokenId = _currentIndex; if (to == address(0)) revert MintToZeroAddress(); if (quantity == 0) revert MintZeroQuantity(); _beforeTokenTransfers(address(0), to, startTokenId, quantity); // Overflows are incredibly unrealistic. // balance or numberMinted overflow if current value of either + quantity > 1.8e19 (2**64) - 1 // updatedIndex overflows if _currentIndex + quantity > 1.2e77 (2**256) - 1 unchecked { _addressData[to].balance += uint64(quantity); _addressData[to].numberMinted += uint64(quantity); _ownerships[startTokenId].addr = to; _ownerships[startTokenId].startTimestamp = uint64(block.timestamp); uint256 updatedIndex = startTokenId; uint256 end = updatedIndex + quantity; do { emit Transfer(address(0), to, updatedIndex++); } while (updatedIndex < end); _currentIndex = updatedIndex; } _afterTokenTransfers(address(0), to, startTokenId, quantity); } /** * @dev Transfers `tokenId` from `from` to `to`. * * Requirements: * * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * * Emits a {Transfer} event. */ function _transfer( address from, address to, uint256 tokenId ) private { TokenOwnership memory prevOwnership = _ownershipOf(tokenId); if (prevOwnership.addr != from) revert TransferFromIncorrectOwner(); bool isApprovedOrOwner = (_msgSender() == from || isApprovedForAll(from, _msgSender()) || getApproved(tokenId) == _msgSender()); if (!isApprovedOrOwner) revert TransferCallerNotOwnerNorApproved(); if (to == address(0)) revert TransferToZeroAddress(); _beforeTokenTransfers(from, to, tokenId, 1); // Clear approvals from the previous owner _approve(address(0), tokenId, from); // 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 { _addressData[from].balance -= 1; _addressData[to].balance += 1; TokenOwnership storage currSlot = _ownerships[tokenId]; currSlot.addr = to; currSlot.startTimestamp = uint64(block.timestamp); // If the ownership slot of tokenId+1 is not explicitly set, that means the transfer initiator owns it. // Set the slot of tokenId+1 explicitly in storage to maintain correctness for ownerOf(tokenId+1) calls. uint256 nextTokenId = tokenId + 1; TokenOwnership storage nextSlot = _ownerships[nextTokenId]; if (nextSlot.addr == address(0)) { // This will suffice for checking _exists(nextTokenId), // as a burned slot cannot contain the zero address. if (nextTokenId != _currentIndex) { nextSlot.addr = from; nextSlot.startTimestamp = prevOwnership.startTimestamp; } } } emit Transfer(from, to, tokenId); _afterTokenTransfers(from, to, tokenId, 1); } /** * @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 { TokenOwnership memory prevOwnership = _ownershipOf(tokenId); address from = prevOwnership.addr; if (approvalCheck) { bool isApprovedOrOwner = (_msgSender() == from || isApprovedForAll(from, _msgSender()) || getApproved(tokenId) == _msgSender()); if (!isApprovedOrOwner) revert TransferCallerNotOwnerNorApproved(); } _beforeTokenTransfers(from, address(0), tokenId, 1); // Clear approvals from the previous owner _approve(address(0), tokenId, from); // 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 { AddressData storage addressData = _addressData[from]; addressData.balance -= 1; addressData.numberBurned += 1; // Keep track of who burned the token, and the timestamp of burning. TokenOwnership storage currSlot = _ownerships[tokenId]; currSlot.addr = from; currSlot.startTimestamp = uint64(block.timestamp); currSlot.burned = true; // If the ownership slot of tokenId+1 is not explicitly set, that means the burn initiator owns it. // Set the slot of tokenId+1 explicitly in storage to maintain correctness for ownerOf(tokenId+1) calls. uint256 nextTokenId = tokenId + 1; TokenOwnership storage nextSlot = _ownerships[nextTokenId]; if (nextSlot.addr == address(0)) { // This will suffice for checking _exists(nextTokenId), // as a burned slot cannot contain the zero address. if (nextTokenId != _currentIndex) { nextSlot.addr = from; nextSlot.startTimestamp = prevOwnership.startTimestamp; } } } emit Transfer(from, address(0), tokenId); _afterTokenTransfers(from, address(0), tokenId, 1); // Overflow not possible, as _burnCounter cannot be exceed _currentIndex times. unchecked { _burnCounter++; } } /** * @dev Approve `to` to operate on `tokenId` * * Emits a {Approval} event. */ function _approve( address to, uint256 tokenId, address owner ) private { _tokenApprovals[tokenId] = to; emit Approval(owner, to, tokenId); } /** * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target contract. * * @param from address representing the previous owner of the given token ID * @param to target address that will receive the tokens * @param tokenId uint256 ID of the token to be transferred * @param _data bytes optional data to send along with the call * @return bool whether the call correctly returned the expected magic value */ function _checkContractOnERC721Received( address from, address to, uint256 tokenId, bytes memory _data ) private returns (bool) { try IERC721ReceiverUpgradeable(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) { return retval == IERC721ReceiverUpgradeable(to).onERC721Received.selector; } catch (bytes memory reason) { if (reason.length == 0) { revert TransferToNonERC721ReceiverImplementer(); } else { assembly { revert(add(32, reason), mload(reason)) } } } } /** * @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 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[42] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.1) (proxy/utils/Initializable.sol) pragma solidity ^0.8.2; import "../../utils/AddressUpgradeable.sol"; /** * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect. * * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in * case an upgrade adds a module that needs to be initialized. * * For example: * * [.hljs-theme-light.nopadding] * ``` * contract MyToken is ERC20Upgradeable { * function initialize() initializer public { * __ERC20_init("MyToken", "MTK"); * } * } * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable { * function initializeV2() reinitializer(2) public { * __ERC20Permit_init("MyToken"); * } * } * ``` * * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}. * * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity. * * [CAUTION] * ==== * Avoid leaving a contract uninitialized. * * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed: * * [.hljs-theme-light.nopadding] * ``` * /// @custom:oz-upgrades-unsafe-allow constructor * constructor() { * _disableInitializers(); * } * ``` * ==== */ abstract contract Initializable { /** * @dev Indicates that the contract has been initialized. * @custom:oz-retyped-from bool */ uint8 private _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool private _initializing; /** * @dev Triggered when the contract has been initialized or reinitialized. */ event Initialized(uint8 version); /** * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope, * `onlyInitializing` functions can be used to initialize parent contracts. * * 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 // ERC721A Contracts v3.3.0 // Creator: Chiru Labs pragma solidity ^0.8.4; import "@openzeppelin/contracts-upgradeable/token/ERC721/IERC721Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC721/extensions/IERC721MetadataUpgradeable.sol"; /** * @dev Interface of an ERC721A compliant contract. */ interface IERC721AUpgradeable is IERC721Upgradeable, IERC721MetadataUpgradeable { /** * The caller must own the token or be an approved operator. */ error ApprovalCallerNotOwnerNorApproved(); /** * The token does not exist. */ error ApprovalQueryForNonexistentToken(); /** * The caller cannot approve to their own address. */ error ApproveToCaller(); /** * The caller cannot approve to the current owner. */ error ApprovalToCurrentOwner(); /** * 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(); // Compiler will pack this into a single 256bit word. struct TokenOwnership { // The address of the owner. address addr; // Keeps track of the start time of ownership with minimal overhead for tokenomics. uint64 startTimestamp; // Whether the token has been burned. bool burned; } // Compiler will pack this into a single 256bit word. struct AddressData { // Realistically, 2**64-1 is more than enough. uint64 balance; // Keeps track of mint count with minimal overhead for tokenomics. uint64 numberMinted; // Keeps track of burn count with minimal overhead for tokenomics. uint64 numberBurned; // For miscellaneous variable(s) pertaining to the address // (e.g. number of whitelist mint slots used). // If there are multiple variables, please pack them into a uint64. uint64 aux; } /** * @dev Returns the total amount of tokens stored by the contract. * * Burned tokens are calculated here, use `_totalMinted()` if you want to count just minted tokens. */ function totalSupply() external view returns (uint256); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.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 v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol) pragma solidity ^0.8.0; import "../IERC721Upgradeable.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional metadata extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721MetadataUpgradeable is IERC721Upgradeable { /** * @dev Returns the token collection name. */ function name() external view returns (string memory); /** * @dev Returns the token collection symbol. */ function symbol() external view returns (string memory); /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ function tokenURI(uint256 tokenId) external view returns (string memory); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165Upgradeable { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol) pragma solidity ^0.8.0; /** * @title ERC721 token receiver interface * @dev Interface for any contract that wants to support safeTransfers * from ERC721 asset contracts. */ interface IERC721ReceiverUpgradeable { /** * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom} * by `operator` from `from`, this function is called. * * It must return its Solidity selector to confirm the token transfer. * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted. * * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`. */ function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library AddressUpgradeable { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return 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 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 v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; import "../proxy/utils/Initializable.sol"; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract ContextUpgradeable is Initializable { function __Context_init() internal onlyInitializing { } function __Context_init_unchained() internal onlyInitializing { } function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[50] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; import "./IERC165Upgradeable.sol"; import "../../proxy/utils/Initializable.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165Upgradeable is Initializable, IERC165Upgradeable { function __ERC165_init() internal onlyInitializing { } function __ERC165_init_unchained() internal onlyInitializing { } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165Upgradeable).interfaceId; } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[50] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.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) { return prod0 / denominator; } // Make sure the result is less than 2^256. Also prevents denominator == 0. require(denominator > prod1); /////////////////////////////////////////////// // 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 10, 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 * 8) < value ? 1 : 0); } } }
// SPDX-License-Identifier: MIT // ERC721A Contracts v3.3.0 // Creator: Chiru Labs pragma solidity ^0.8.4; import "../IERC721AUpgradeable.sol"; /** * @dev Interface of an ERC721ABurnable compliant contract. */ interface IERC721ABurnableUpgradeable is IERC721AUpgradeable { /** * @dev Burns `tokenId`. See {ERC721A-_burn}. * * Requirements: * * - The caller must own `tokenId` or be an approved operator. */ function burn(uint256 tokenId) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/IAccessControlEnumerable.sol) pragma solidity ^0.8.0; import "./IAccessControlUpgradeable.sol"; /** * @dev External interface of AccessControlEnumerable declared to support ERC165 detection. */ interface IAccessControlEnumerableUpgradeable is IAccessControlUpgradeable { /** * @dev Returns one of the accounts that have `role`. `index` must be a * value between 0 and {getRoleMemberCount}, non-inclusive. * * Role bearers are not sorted in any particular way, and their ordering may * change at any point. * * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure * you perform all queries on the same block. See the following * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post] * for more information. */ function getRoleMember(bytes32 role, uint256 index) external view returns (address); /** * @dev Returns the number of accounts that have `role`. Can be used * together with {getRoleMember} to enumerate all bearers of a role. */ function getRoleMemberCount(bytes32 role) external view returns (uint256); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (access/AccessControl.sol) pragma solidity ^0.8.0; import "./IAccessControlUpgradeable.sol"; import "../utils/ContextUpgradeable.sol"; import "../utils/StringsUpgradeable.sol"; import "../utils/introspection/ERC165Upgradeable.sol"; import "../proxy/utils/Initializable.sol"; /** * @dev Contract module that allows children to implement role-based access * control mechanisms. This is a lightweight version that doesn't allow enumerating role * members except through off-chain means by accessing the contract event logs. Some * applications may benefit from on-chain enumerability, for those cases see * {AccessControlEnumerable}. * * Roles are referred to by their `bytes32` identifier. These should be exposed * in the external API and be unique. The best way to achieve this is by * using `public constant` hash digests: * * ``` * bytes32 public constant MY_ROLE = keccak256("MY_ROLE"); * ``` * * Roles can be used to represent a set of permissions. To restrict access to a * function call, use {hasRole}: * * ``` * function foo() public { * require(hasRole(MY_ROLE, msg.sender)); * ... * } * ``` * * Roles can be granted and revoked dynamically via the {grantRole} and * {revokeRole} functions. Each role has an associated admin role, and only * accounts that have a role's admin role can call {grantRole} and {revokeRole}. * * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means * that only accounts with this role will be able to grant or revoke other * roles. More complex role relationships can be created by using * {_setRoleAdmin}. * * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to * grant and revoke this role. Extra precautions should be taken to secure * accounts that have been granted it. */ abstract contract AccessControlUpgradeable is Initializable, ContextUpgradeable, IAccessControlUpgradeable, ERC165Upgradeable { function __AccessControl_init() internal onlyInitializing { } function __AccessControl_init_unchained() internal onlyInitializing { } struct RoleData { mapping(address => bool) members; bytes32 adminRole; } mapping(bytes32 => RoleData) private _roles; bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /** * @dev Modifier that checks that an account has a specific role. Reverts * with a standardized message including the required role. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ * * _Available since v4.1._ */ modifier onlyRole(bytes32 role) { _checkRole(role); _; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControlUpgradeable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) public view virtual override returns (bool) { return _roles[role].members[account]; } /** * @dev Revert with a standard message if `_msgSender()` is missing `role`. * Overriding this function changes the behavior of the {onlyRole} modifier. * * Format of the revert message is described in {_checkRole}. * * _Available since v4.6._ */ function _checkRole(bytes32 role) internal view virtual { _checkRole(role, _msgSender()); } /** * @dev Revert with a standard message if `account` is missing `role`. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ */ function _checkRole(bytes32 role, address account) internal view virtual { if (!hasRole(role, account)) { revert( string( abi.encodePacked( "AccessControl: account ", StringsUpgradeable.toHexString(account), " is missing role ", StringsUpgradeable.toHexString(uint256(role), 32) ) ) ); } } /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) { return _roles[role].adminRole; } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. * * May emit a {RoleGranted} event. */ function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _grantRole(role, account); } /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. * * May emit a {RoleRevoked} event. */ function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _revokeRole(role, account); } /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been revoked `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. * * May emit a {RoleRevoked} event. */ function renounceRole(bytes32 role, address account) public virtual override { require(account == _msgSender(), "AccessControl: can only renounce roles for self"); _revokeRole(role, account); } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. Note that unlike {grantRole}, this function doesn't perform any * checks on the calling account. * * May emit a {RoleGranted} event. * * [WARNING] * ==== * This function should only be called from the constructor when setting * up the initial roles for the system. * * Using this function in any other way is effectively circumventing the admin * system imposed by {AccessControl}. * ==== * * NOTE: This function is deprecated in favor of {_grantRole}. */ function _setupRole(bytes32 role, address account) internal virtual { _grantRole(role, account); } /** * @dev Sets `adminRole` as ``role``'s admin role. * * Emits a {RoleAdminChanged} event. */ function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual { bytes32 previousAdminRole = getRoleAdmin(role); _roles[role].adminRole = adminRole; emit RoleAdminChanged(role, previousAdminRole, adminRole); } /** * @dev Grants `role` to `account`. * * Internal function without access restriction. * * May emit a {RoleGranted} event. */ function _grantRole(bytes32 role, address account) internal virtual { if (!hasRole(role, account)) { _roles[role].members[account] = true; emit RoleGranted(role, account, _msgSender()); } } /** * @dev Revokes `role` from `account`. * * Internal function without access restriction. * * May emit a {RoleRevoked} event. */ function _revokeRole(bytes32 role, address account) internal virtual { if (hasRole(role, account)) { _roles[role].members[account] = false; emit RoleRevoked(role, account, _msgSender()); } } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[49] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol) pragma solidity ^0.8.0; /** * @dev External interface of AccessControl declared to support ERC165 detection. */ interface IAccessControlUpgradeable { /** * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` * * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite * {RoleAdminChanged} not being emitted signaling this. * * _Available since v3.1._ */ event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole); /** * @dev Emitted when `account` is granted `role`. * * `sender` is the account that originated the contract call, an admin role * bearer except when using {AccessControl-_setupRole}. */ event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Emitted when `account` is revoked `role`. * * `sender` is the account that originated the contract call: * - if using `revokeRole`, it is the admin role bearer * - if using `renounceRole`, it is the role bearer (i.e. `account`) */ event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) external view returns (bool); /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {AccessControl-_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) external view returns (bytes32); /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function grantRole(bytes32 role, address account) external; /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function revokeRole(bytes32 role, address account) external; /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been granted `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. */ function renounceRole(bytes32 role, address account) external; }
{ "metadata": { "bytecodeHash": "none", "useLiteralContent": true }, "optimizer": { "enabled": true, "runs": 1 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[],"name":"AllowlistInactive","type":"error"},{"inputs":[],"name":"ApprovalCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"ApprovalQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"ApprovalToCurrentOwner","type":"error"},{"inputs":[],"name":"ApproveToCaller","type":"error"},{"inputs":[],"name":"BalanceQueryForZeroAddress","type":"error"},{"inputs":[],"name":"InsufficientFunds","type":"error"},{"inputs":[],"name":"InvalidQueryRange","type":"error"},{"inputs":[],"name":"InvalidSignature","type":"error"},{"inputs":[],"name":"MerkleProofInvalid","type":"error"},{"inputs":[],"name":"MintClosed","type":"error"},{"inputs":[],"name":"MintQuantityInvalid","type":"error"},{"inputs":[],"name":"MintToZeroAddress","type":"error"},{"inputs":[],"name":"MintZeroQuantity","type":"error"},{"inputs":[],"name":"Ownable__NotAuthorized","type":"error"},{"inputs":[],"name":"OwnerQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"Sanctioned","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":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"string","name":"tokens","type":"string"}],"name":"Minted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"prevOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnerUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SANCTIONS_CONTRACT","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"bytes32","name":"typedata","type":"bytes32"},{"internalType":"bool","name":"isActive","type":"bool"},{"internalType":"string","name":"metadataUri","type":"string"},{"internalType":"string","name":"name","type":"string"},{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint256","name":"maxMintPerWallet","type":"uint256"},{"internalType":"uint256","name":"tokenPool","type":"uint256"},{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"endTime","type":"uint256"}],"internalType":"struct IAllowlist.Allowlist","name":"_allowlist","type":"tuple"}],"name":"addAllowlist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"holder","type":"address"}],"name":"aggregateTotalERC20TokenBalance","outputs":[{"internalType":"uint256","name":"erc20tokens","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"holder","type":"address"}],"name":"aggregateUnclaimedERC20TokenBalance","outputs":[{"internalType":"uint256","name":"erc20tokens","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"__to","type":"address[]"},{"internalType":"uint256[]","name":"__quantities","type":"uint256[]"}],"name":"airdrop","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"allowlists","outputs":[{"internalType":"uint256","name":"currentStartId","type":"uint256"},{"internalType":"uint256","name":"count","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimERC20Tokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"claimTimer","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"config","outputs":[{"components":[{"internalType":"bool","name":"isActive","type":"bool"},{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"endTime","type":"uint256"},{"internalType":"uint256","name":"maxSupply","type":"uint256"},{"internalType":"uint256","name":"maxPerWallet","type":"uint256"},{"internalType":"uint256","name":"maxPerTxn","type":"uint256"},{"internalType":"uint256","name":"price","type":"uint256"}],"internalType":"struct IConfig.Mint","name":"mintConfig","type":"tuple"},{"components":[{"internalType":"string","name":"metadataUri","type":"string"}],"internalType":"struct IConfig.Token","name":"tokenConfig","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"contractType","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"contractURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"contractVersion","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"explicitOwnershipOf","outputs":[{"components":[{"internalType":"address","name":"addr","type":"address"},{"internalType":"uint64","name":"startTimestamp","type":"uint64"},{"internalType":"bool","name":"burned","type":"bool"}],"internalType":"struct IERC721AUpgradeable.TokenOwnership","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"explicitOwnershipsOf","outputs":[{"components":[{"internalType":"address","name":"addr","type":"address"},{"internalType":"uint64","name":"startTimestamp","type":"uint64"},{"internalType":"bool","name":"burned","type":"bool"}],"internalType":"struct IERC721AUpgradeable.TokenOwnership[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"forceClaimERC20Tokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_allowlistId","type":"uint256"}],"name":"getAllowlistById","outputs":[{"components":[{"internalType":"bytes32","name":"typedata","type":"bytes32"},{"internalType":"bool","name":"isActive","type":"bool"},{"internalType":"string","name":"metadataUri","type":"string"},{"internalType":"string","name":"name","type":"string"},{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint256","name":"maxMintPerWallet","type":"uint256"},{"internalType":"uint256","name":"tokenPool","type":"uint256"},{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"endTime","type":"uint256"}],"internalType":"struct IAllowlist.Allowlist","name":"allowlist","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_allowlistId","type":"uint256"}],"name":"getMintedByAllowlist","outputs":[{"internalType":"uint256","name":"mintedBy","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"_uid","type":"string"},{"internalType":"address","name":"_wallet","type":"address"}],"name":"getMintedByUid","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getRoleMember","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleMemberCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_role","type":"bytes32"}],"name":"hasMinRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_defaultAdmin","type":"address"},{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_symbol","type":"string"},{"internalType":"string","name":"_baseURI","type":"string"},{"internalType":"address[]","name":"_trustedForwarders","type":"address[]"},{"internalType":"address","name":"_receivingWallet","type":"address"},{"internalType":"address","name":"_accessRegistry","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_operatorAddress","type":"address"}],"name":"isSanctioned","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isSelfClaimActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"forwarder","type":"address"}],"name":"isTrustedForwarder","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_quantities","type":"uint256[]"},{"internalType":"bytes32[][]","name":"_proofs","type":"bytes32[][]"},{"internalType":"uint256[]","name":"_allocations","type":"uint256[]"},{"internalType":"uint256[]","name":"_allowlistIds","type":"uint256[]"}],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"components":[{"internalType":"string","name":"uid","type":"string"},{"internalType":"uint256","name":"quantity","type":"uint256"},{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint256","name":"allocation","type":"uint256"},{"internalType":"uint256","name":"expirationTime","type":"uint256"},{"internalType":"bytes","name":"signature","type":"bytes"}],"internalType":"struct ISignatureMinting.SignatureMintCartItem[]","name":"items","type":"tuple[]"}],"internalType":"struct ISignatureMinting.SignatureMintCart","name":"cart","type":"tuple"}],"name":"mintWithSignature","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"minted","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"mintedByAllowlist","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes[]","name":"data","type":"bytes[]"}],"name":"multicall","outputs":[{"internalType":"bytes[]","name":"results","type":"bytes[]"}],"stateMutability":"nonpayable","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":"project","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"receivingWallet","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_baseURI","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"components":[{"internalType":"bool","name":"isActive","type":"bool"},{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"endTime","type":"uint256"},{"internalType":"uint256","name":"maxSupply","type":"uint256"},{"internalType":"uint256","name":"maxPerWallet","type":"uint256"},{"internalType":"uint256","name":"maxPerTxn","type":"uint256"},{"internalType":"uint256","name":"price","type":"uint256"}],"internalType":"struct IConfig.Mint","name":"mintConfig","type":"tuple"},{"components":[{"internalType":"string","name":"metadataUri","type":"string"}],"internalType":"struct IConfig.Token","name":"tokenConfig","type":"tuple"}],"internalType":"struct IConfig.Config","name":"_config","type":"tuple"}],"name":"setConfig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_uri","type":"string"}],"name":"setContractURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"setOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"setReceivingWallet","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"setSanctionsContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"setStakingERC20Address","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"stakingERC20Address","outputs":[{"internalType":"address","name":"","type":"address"}],"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":"_tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"tokensOfOwner","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"start","type":"uint256"},{"internalType":"uint256","name":"stop","type":"uint256"}],"name":"tokensOfOwnerIn","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"holder","type":"address"}],"name":"unclaimedERC20BalanceByToken","outputs":[{"internalType":"uint256","name":"unclaimedERC20Tokens","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"bytes32","name":"typedata","type":"bytes32"},{"internalType":"bool","name":"isActive","type":"bool"},{"internalType":"string","name":"metadataUri","type":"string"},{"internalType":"string","name":"name","type":"string"},{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint256","name":"maxMintPerWallet","type":"uint256"},{"internalType":"uint256","name":"tokenPool","type":"uint256"},{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"endTime","type":"uint256"}],"internalType":"struct IAllowlist.Allowlist","name":"_allowlist","type":"tuple"},{"internalType":"uint256","name":"i","type":"uint256"}],"name":"updateAllowlistByIndex","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
608060405234801561001057600080fd5b50615af180620000216000396000f3fe60806040526004361061030a5760003560e01c806301ffc9a71461030f57806306fdde0314610344578063081812fc14610366578063095ea7b31461039357806313af4035146103b557806315e25d5a146103d557806318160ddd146103ea5780631e7269c51461041357806323b872dd14610441578063248a9ca31461046157806325221df1146104815780632e9dd350146104a15780632f2ff15d146104c157806333640c8b146104e157806336568abe146105015780633b6fda59146105215780633f4ba83a1461055a57806342842e0e1461056f57806342966c681461058f57806344bbff84146105af578063511d5d74146105c257806353a09eba146105e257806355f804b31461061b578063572b6c051461063b5780635ace6352146106745780635bbb2177146106945780635c975abb146106c15780636182ff53146106d95780636352211e1461070657806363906d0d1461072657806364274fef14610758578063672434821461077857806370a0823114610798578063738170a4146107b857806379502c55146107d957806383de187b146107fc5780638456cb591461081c5780638462151c1461083157806387b63e3a1461085e5780638b81a7ee146108975780638da5cb5b146108b75780638ead7b3d146108cc5780638ff992ae146108ed5780639010d07c1461090d57806391d148541461092d578063931e28e91461094d578063938e3d7b1461096e578063942593991461098e57806395d89b41146109a157806399a2557a146109b65780639ef44ead146109d6578063a0a8e460146109f6578063a217fddf14610a12578063a22cb46514610a27578063ac9650d814610a47578063b3738dfc14610a74578063b522ecff14610a94578063b88d4fde14610ab4578063c23dc68f14610ad4578063c25e0f6714610b01578063c87b56dd14610b21578063ca15c87314610b41578063cb2ef6f714610b61578063d547741f14610b8b578063df592f7d14610bab578063e27d153e14610bcb578063e8a3d48514610be6578063e985e9c514610bfb578063f60ca60d14610c45575b600080fd5b34801561031b57600080fd5b5061032f61032a3660046145ae565b610c66565b60405190151581526020015b60405180910390f35b34801561035057600080fd5b50610359610c92565b60405161033b9190614623565b34801561037257600080fd5b50610386610381366004614636565b610d25565b60405161033b919061464f565b34801561039f57600080fd5b506103b36103ae36600461467f565b610d6a565b005b3480156103c157600080fd5b506103b36103d03660046146a9565b610df0565b3480156103e157600080fd5b506103b3610e94565b3480156103f657600080fd5b50610192546101915403600019015b60405190815260200161033b565b34801561041f57600080fd5b5061040561042e3660046146a9565b6102286020526000908152604090205481565b34801561044d57600080fd5b506103b361045c3660046146c4565b610fd1565b34801561046d57600080fd5b5061040561047c366004614636565b610fdc565b34801561048d57600080fd5b5061040561049c3660046146a9565b610ff2565b3480156104ad57600080fd5b506103b36104bc36600461467f565b6110b9565b3480156104cd57600080fd5b506103b36104dc366004614700565b6111ae565b3480156104ed57600080fd5b506104056104fc366004614700565b6111fa565b34801561050d57600080fd5b506103b361051c366004614700565b611258565b34801561052d57600080fd5b5061040561053c36600461467f565b61022960209081526000928352604080842090915290825290205481565b34801561056657600080fd5b506103b36112d1565b34801561057b57600080fd5b506103b361058a3660046146c4565b611310565b34801561059b57600080fd5b506103b36105aa366004614636565b61132b565b6103b36105bd36600461472c565b611336565b3480156105ce57600080fd5b506103b36105dd3660046146a9565b61167f565b3480156105ee57600080fd5b506104056105fd36600461467f565b61022c60209081526000928352604080842090915290825290205481565b34801561062757600080fd5b506103b36106363660046147ae565b6116d7565b34801561064757600080fd5b5061032f6106563660046146a9565b6001600160a01b031660009081526097602052604090205460ff1690565b34801561068057600080fd5b506103b361068f3660046146a9565b61171e565b3480156106a057600080fd5b506106b46106af366004614880565b611761565b60405161033b9190614942565b3480156106cd57600080fd5b5060655460ff1661032f565b3480156106e557600080fd5b506106f96106f4366004614636565b611815565b60405161033b9190614984565b34801561071257600080fd5b50610386610721366004614636565b6119fe565b34801561073257600080fd5b506102555461025654610743919082565b6040805192835260208301919091520161033b565b34801561076457600080fd5b506103b3610773366004614a3a565b611a10565b34801561078457600080fd5b506103b3610793366004614ac2565b611a66565b3480156107a457600080fd5b506104056107b33660046146a9565b611b38565b3480156107c457600080fd5b5061025254610386906001600160a01b031681565b3480156107e557600080fd5b506107ee611b87565b60405161033b929190614b2d565b34801561080857600080fd5b506103b3610817366004614b90565b611c7b565b34801561082857600080fd5b506103b3611cbd565b34801561083d57600080fd5b5061085161084c3660046146a9565b611cf9565b60405161033b9190614bcb565b34801561086a57600080fd5b50610405610879366004614636565b33600090815261022960209081526040808320938352929052205490565b3480156108a357600080fd5b506103b36108b2366004614c03565b611e24565b3480156108c357600080fd5b50610386611e93565b3480156108d857600080fd5b5061026054610386906001600160a01b031681565b3480156108f957600080fd5b50610405610908366004614c37565b611ec9565b34801561091957600080fd5b50610386610928366004614c8a565b611f4a565b34801561093957600080fd5b5061032f610948366004614700565b611f63565b34801561095957600080fd5b5061025354610386906001600160a01b031681565b34801561097a57600080fd5b506103b36109893660046147ae565b611f8f565b6103b361099c366004614cac565b611fd0565b3480156109ad57600080fd5b50610359612379565b3480156109c257600080fd5b506108516109d1366004614d6f565b612389565b3480156109e257600080fd5b506103b36109f1366004614e7e565b61254c565b348015610a0257600080fd5b506040516001815260200161033b565b348015610a1e57600080fd5b50610405600081565b348015610a3357600080fd5b506103b3610a42366004614f6a565b61275b565b348015610a5357600080fd5b50610a67610a62366004614fa1565b6127ff565b60405161033b9190614fd6565b348015610a8057600080fd5b5061032f610a8f366004614636565b6128f3565b348015610aa057600080fd5b506103b3610aaf3660046146a9565b6128fe565b348015610ac057600080fd5b506103b3610acf366004615038565b61294f565b348015610ae057600080fd5b50610af4610aef366004614636565b61299a565b60405161033b919061509f565b348015610b0d57600080fd5b50610405610b1c3660046146a9565b612a31565b348015610b2d57600080fd5b50610359610b3c366004614636565b612aa4565b348015610b4d57600080fd5b50610405610b5c366004614636565b612b46565b348015610b6d57600080fd5b507350726f707345524337323141555374616b696e6760601b610405565b348015610b9757600080fd5b506103b3610ba6366004614700565b612b5e565b348015610bb757600080fd5b5061032f610bc63660046146a9565b612bdb565b348015610bd757600080fd5b5061022b5461032f9060ff1681565b348015610bf257600080fd5b50610359612c5a565b348015610c0757600080fd5b5061032f610c163660046150ad565b6001600160a01b0391821660009081526101986020908152604080832093909416825291909152205460ff1690565b348015610c5157600080fd5b5061025154610386906001600160a01b031681565b6000610c7182612ce9565b80610c8c575063152a902d60e11b6001600160e01b03198316145b92915050565b60606101938054610ca2906150d7565b80601f0160208091040260200160405190810160405280929190818152602001828054610cce906150d7565b8015610d1b5780601f10610cf057610100808354040283529160200191610d1b565b820191906000526020600020905b815481529060010190602001808311610cfe57829003601f168201915b5050505050905090565b6000610d3082612d29565b610d4d576040516333d1c03960e21b815260040160405180910390fd5b50600090815261019760205260409020546001600160a01b031690565b6000610d75826119fe565b9050806001600160a01b0316836001600160a01b031603610da95760405163250fdee360e21b815260040160405180910390fd5b6001600160a01b03811615610de057610dc3816000610c16565b610de0576040516367d9dca160e11b815260040160405180910390fd5b610deb838383612d64565b505050565b6000610dfb81612dc1565b610e06600083611f63565b610e405760405162461bcd60e51b815260206004820152600660248201526510a0a226a4a760d11b60448201526064015b60405180910390fd5b61024f80546001600160a01b038481166001600160a01b0319831681179093556040519116919082907f8292fce18fa69edf4db7b94ea2e58241df0ae57f97e0a6c9b29067028bf92d7690600090a3505050565b61022b5460ff16610edd5760405162461bcd60e51b815260206004820152601360248201527253656c662d436c61696d20496e61637469766560681b6044820152606401610e37565b604051632118854760e21b81526000903090638462151c90610f0390339060040161464f565b600060405180830381865afa158015610f20573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610f48919081019061510b565b905060005b8151811015610fcd57610f7933838381518110610f6c57610f6c615190565b60200260200101516110b9565b33600090815261022c602052604081208351429290859085908110610fa057610fa0615190565b60200260200101518152602001908152602001600020819055508080610fc5906151bc565b915050610f4d565b5050565b610deb838383612dcc565b600090815261012d602052604090206001015490565b604051632118854760e21b815260009081903090638462151c9061101a90869060040161464f565b600060405180830381865afa158015611037573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261105f919081019061510b565b90506000915060005b81518110156110b25761109482828151811061108657611086615190565b6020026020010151856111fa565b61109e90846151d5565b9250806110aa816151bc565b915050611068565b5050919050565b816001600160a01b03166110cc826119fe565b6001600160a01b03161461110e5760405162461bcd60e51b81526020600482015260096024820152682737ba1027bbb732b960b91b6044820152606401610e37565b600061111a82846111fa565b6102535460405163475a9fa960e01b81526001600160a01b0386811660048301526024820184905292935091169063475a9fa990604401600060405180830381600087803b15801561116b57600080fd5b505af115801561117f573d6000803e3d6000fd5b505050506001600160a01b0392909216600090815261022c602090815260408083209383529290522042905550565b600080516020615ac58339815191526111c681612fb7565b6111e25760405162461bcd60e51b8152600401610e37906151ed565b6111ec8383611f63565b610deb57610deb8383612fee565b6001600160a01b038116600090815261022c60209081526040808320858452909152812054808203611230576000915050610c8c565b42600061123d8383615215565b905061022a548161124e919061522c565b9695505050505050565b6001600160a01b038116156112c75760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610e37565b610fcd8282613011565b600080516020615a858339815191526112e981612fb7565b6113055760405162461bcd60e51b8152600401610e37906151ed565b61130d613034565b50565b610deb8383836040518060200160405280600081525061294f565b61130d816001613081565b61133e613242565b60008060005b61134e848061524e565b9050811015611503576000611363858061524e565b8381811061137357611373615190565b90506020028101906113859190615297565b61138e906152b7565b61025354604051634996ec2760e11b81529192506001600160a01b03169063932dd84e906113c2903390859060040161534b565b60006040518083038186803b1580156113da57600080fd5b505afa1580156113ee573d6000803e3d6000fd5b5050610253546001600160a01b03169150638b9e69c39050611410878061524e565b8581811061142057611420615190565b90506020028101906114329190615297565b61143c90806153bb565b336114478a8061524e565b8881811061145757611457615190565b90506020028101906114699190615297565b602001356040518563ffffffff1660e01b815260040161148c949392919061542a565b600060405180830381600087803b1580156114a657600080fd5b505af11580156114ba573d6000803e3d6000fd5b50505060208201516114cd9150846151d5565b9250806020015181604001516114e3919061545a565b6114ed90856151d5565b93505080806114fb906151bc565b915050611344565b5061025b546102275460019061151a9084906151d5565b6115249190615215565b11156115425760405162461bcd60e51b8152600401610e3790615479565b348211156115635760405163356680b760e01b815260040160405180910390fd5b6102525460405160009182916001600160a01b039091169034908381818185875af1925050503d80600081146115b5576040519150601f19603f3d011682016040523d82523d6000602084013e6115ba565b606091505b5060408051602081019091526000815261022754929450909250905b84610227540181101561161857816115ed8261329b565b6040516020016115fe9291906154a7565b60408051601f1981840301815291905291506001016115d6565b5033600081815261022860205260409020805486019055610227805486019055611642908561332d565b336001600160a01b0316600080516020615a1e833981519152826040516116699190614623565b60405180910390a2505050505061130d60018055565b600080516020615ac583398151915261169781612fb7565b6116b35760405162461bcd60e51b8152600401610e37906151ed565b5061025380546001600160a01b0319166001600160a01b0392909216919091179055565b600080516020615ac58339815191526116ef81612fb7565b61170b5760405162461bcd60e51b8152600401610e37906151ed565b61171861024d848461446b565b50505050565b611735600080516020615ac58339815191526128f3565b61173e57600080fd5b61026080546001600160a01b0319166001600160a01b0392909216919091179055565b80516060906000816001600160401b03811115611780576117806147ef565b6040519080825280602002602001820160405280156117b957816020015b6117a66144ef565b81526020019060019003908161179e5790505b50905060005b82811461180d576117e88582815181106117db576117db615190565b602002602001015161299a565b8282815181106117fa576117fa615190565b60209081029190910101526001016117bf565b509392505050565b61186960405180610120016040528060008019168152602001600015158152602001606081526020016060815260200160008152602001600081526020016000815260200160008152602001600081525090565b6000828152610257602090815260409182902082516101208101845281548152600182015460ff1615159281019290925260028101805492939192918401916118b1906150d7565b80601f01602080910402602001604051908101604052809291908181526020018280546118dd906150d7565b801561192a5780601f106118ff5761010080835404028352916020019161192a565b820191906000526020600020905b81548152906001019060200180831161190d57829003601f168201915b50505050508152602001600382018054611943906150d7565b80601f016020809104026020016040519081016040528092919081815260200182805461196f906150d7565b80156119bc5780601f10611991576101008083540402835291602001916119bc565b820191906000526020600020905b81548152906001019060200180831161199f57829003601f168201915b50505050508152602001600482015481526020016005820154815260200160068201548152602001600782015481526020016008820154815250509050919050565b6000611a098261334d565b5192915050565b600080516020615a3e833981519152611a2881612fb7565b611a445760405162461bcd60e51b8152600401610e37906151ed565b6000828152610257602052604090208390611a5f8282615618565b5050505050565b600080516020615a85833981519152611a7e81612fb7565b611a9a5760405162461bcd60e51b8152600401610e37906151ed565b60005b84811015611b3057838382818110611ab757611ab7615190565b905060200201356102276000828254611ad091906151d5565b90915550611b1e9050868683818110611aeb57611aeb615190565b9050602002016020810190611b0091906146a9565b858584818110611b1257611b12615190565b9050602002013561332d565b80611b28816151bc565b915050611a9d565b505050505050565b60006001600160a01b038216611b61576040516323d3ad8160e21b815260040160405180910390fd5b506001600160a01b0316600090815261019660205260409020546001600160401b031690565b6040805160e081018252610258805460ff16151582526102595460208084019190915261025a548385015261025b54606084015261025c54608084015261025d5460a084015261025e5460c0840152835190810190935261025f80549293919282908290611bf4906150d7565b80601f0160208091040260200160405190810160405280929190818152602001828054611c20906150d7565b8015611c6d5780601f10611c4257610100808354040283529160200191611c6d565b820191906000526020600020905b815481529060010190602001808311611c5057829003601f168201915b505050505081525050905082565b600080516020615a3e833981519152611c9381612fb7565b611caf5760405162461bcd60e51b8152600401610e37906151ed565b816102586117188282615767565b600080516020615a85833981519152611cd581612fb7565b611cf15760405162461bcd60e51b8152600401610e37906151ed565b61130d61345d565b60606000806000611d0985611b38565b90506000816001600160401b03811115611d2557611d256147ef565b604051908082528060200260200182016040528015611d4e578160200160208202803683370190505b509050611d596144ef565b60015b838614611e185760008181526101956020908152604091829020825160608101845290546001600160a01b0381168252600160a01b81046001600160401b031692820192909252600160e01b90910460ff1615159181018290529250611e105781516001600160a01b031615611dd157815194505b876001600160a01b0316856001600160a01b031603611e105780838780600101985081518110611e0357611e03615190565b6020026020010181815250505b600101611d5c565b50909695505050505050565b600080516020615a3e833981519152611e3c81612fb7565b611e585760405162461bcd60e51b8152600401610e37906151ed565b610256546000908152610257602052604090208290611e778282615618565b50506102568054906000611e8a836151bc565b91905055505050565b61024f54600090611eae9082906001600160a01b0316611f63565b611eb85750600090565b5061024f546001600160a01b031690565b610253546040516347fcc95760e11b81526000916001600160a01b031690638ff992ae90611eff908790879087906004016157df565b602060405180830381865afa158015611f1c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f40919061580b565b90505b9392505050565b600082815261015f60205260408120611f43908361349b565b600091825261012d602090815260408084206001600160a01b0393909316845291905290205460ff1690565b600080516020615ac5833981519152611fa781612fb7565b611fc35760405162461bcd60e51b8152600401610e37906151ed565b61171861024e848461446b565b611fd8613242565b611fe133612bdb565b15611fff576040516320cf996960e11b815260040160405180910390fd5b60008060005b8981101561217e578a8a8281811061201f5761201f615190565b905060200201358261203191906151d5565b915061205485858381811061204857612048615190565b905060200201356134a7565b61210a3386868481811061206a5761206a615190565b336000908152610229602090815260408220920293909301359290915089898781811061209957612099615190565b905060200201358152602001908152602001600020548e8e868181106120c1576120c1615190565b905060200201358b8b878181106120da576120da615190565b905060200201358e8e888181106120f3576120f3615190565b9050602002810190612105919061524e565b613521565b8a8a8281811061211c5761211c615190565b90506020020135610255600201600087878581811061213d5761213d615190565b90506020020135815260200190815260200160002060040154612160919061545a565b61216a90846151d5565b925080612176816151bc565b915050612005565b5061025b54610227546001906121959084906151d5565b61219f9190615215565b11156121bd5760405162461bcd60e51b8152600401610e3790615479565b348211156121de5760405163356680b760e01b815260040160405180910390fd5b6102525460405160009182916001600160a01b039091169034908381818185875af1925050503d8060008114612230576040519150601f19603f3d011682016040523d82523d6000602084013e612235565b606091505b5060408051602081019091526000815261022754929450909250905b84610227540181101561229357816122688261329b565b6040516020016122799291906154a7565b60408051601f198184030181529190529150600101612251565b5060005b8c811015612308578d8d828181106122b1576122b1615190565b33600090815261022960209081526040822092029390930135929091508a8a858181106122e0576122e0615190565b6020908102929092013583525081019190915260400160002080549091019055600101612297565b5033600081815261022860205260409020805486019055610227805486019055612332908561332d565b336001600160a01b0316600080516020615a1e833981519152826040516123599190614623565b60405180910390a2505050505061236f60018055565b5050505050505050565b60606101948054610ca2906150d7565b60608183106123ab57604051631960ccad60e11b815260040160405180910390fd5b6101915460009060018510156123c057600194505b808411156123cc578093505b60006123d787611b38565b9050848610156123f657858503818110156123f0578091505b506123fa565b5060005b6000816001600160401b03811115612414576124146147ef565b60405190808252806020026020018201604052801561243d578160200160208202803683370190505b50905081600003612453579350611f4392505050565b600061245e8861299a565b90506000816040015161246f575080515b885b8881141580156124815750848714155b1561253b5760008181526101956020908152604091829020825160608101845290546001600160a01b0381168252600160a01b81046001600160401b031692820192909252600160e01b90910460ff16151591810182905293506125335782516001600160a01b0316156124f457825191505b8a6001600160a01b0316826001600160a01b031603612533578084888060010199508151811061252657612526615190565b6020026020010181815250505b600101612471565b505050928352509095945050505050565b600054610100900460ff161580801561256c5750600054600160ff909116105b8061258d575061257b30613647565b15801561258d575060005460ff166001145b6125f05760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610e37565b6000805460ff191660011790558015612613576000805461ff0019166101001790555b61261b613656565b61262484613687565b61262e87876136bf565b61025280546001600160a01b038086166001600160a01b03199283161790925561024f80548b841690831617905561025080549285169290911691909117905584516126829061024d90602088019061450f565b5061268e6000896136f0565b6126a7600080516020615ac583398151915260006136fa565b6126cd600080516020615a3e833981519152600080516020615ac58339815191526136fa565b6126f3600080516020615a85833981519152600080516020615a3e8339815191526136fa565b6001610227556201518061022a5561022b805460ff19169055801561236f576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15050505050505050565b6001600160a01b0382166127825760405163b06307db60e01b815260040160405180910390fd5b6001600160a01b03821660008181527f4423f7c6e52e9185383a9cf02b7a6886e99ba21d91d7a83c121c6d17c40c5b7960209081526040808320805460ff191686151590811790915590519081527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b6060816001600160401b03811115612819576128196147ef565b60405190808252806020026020018201604052801561284c57816020015b60608152602001906001900390816128375790505b50905060005b828110156128ec576128bc3085858481811061287057612870615190565b905060200281019061288291906153bb565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061374e92505050565b8282815181106128ce576128ce615190565b602002602001018190525080806128e4906151bc565b915050612852565b5092915050565b6000610c8c82612fb7565b61024f546001600160a01b0316321480612923575061024f546001600160a01b031633145b61292c57600080fd5b61025280546001600160a01b0319166001600160a01b0392909216919091179055565b61295a848484612dcc565b61296c836001600160a01b0316613647565b156117185761297d84848484613840565b611718576040516368d2bf6b60e11b815260040160405180910390fd5b6129a26144ef565b6129aa6144ef565b60018310806129bc5750610191548310155b156129c75792915050565b5060008281526101956020908152604091829020825160608101845290546001600160a01b0381168252600160a01b81046001600160401b031692820192909252600160e01b90910460ff161580159282019290925290612a285792915050565b611f438361334d565b610253546040516370a0823160e01b81526000916001600160a01b0316906370a0823190612a6390859060040161464f565b602060405180830381865afa158015612a80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c8c919061580b565b6060612aaf82612d29565b612b135760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b6064820152608401610e37565b61024d612b1f8361329b565b604051602001612b30929190615824565b6040516020818303038152906040529050919050565b600081815261015f60205260408120610c8c9061392b565b600080516020615ac5833981519152612b7681612fb7565b612b925760405162461bcd60e51b8152600401610e37906151ed565b612b9c8383611f63565b15610deb5782158015612bc75750612bb2611e93565b6001600160a01b0316826001600160a01b0316145b15612bd157600080fd5b610deb8383613011565b6102605460405163df592f7d60e01b81526000916001600160a01b0316908290829063df592f7d90612c1190879060040161464f565b602060405180830381865afa158015612c2e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c5291906158b7565b949350505050565b61024e8054612c68906150d7565b80601f0160208091040260200160405190810160405280929190818152602001828054612c94906150d7565b8015612ce15780601f10612cb657610100808354040283529160200191612ce1565b820191906000526020600020905b815481529060010190602001808311612cc457829003601f168201915b505050505081565b60006001600160e01b031982166380ac58cd60e01b1480612d1a57506001600160e01b03198216635b5e139f60e01b145b80610c8c5750610c8c82613935565b600081600111158015612d3e57506101915482105b8015610c8c57505060009081526101956020526040902054600160e01b900460ff161590565b6000828152610197602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b61130d81600061395a565b6000612dd78261334d565b9050836001600160a01b031681600001516001600160a01b031614612e0e5760405162a1148160e81b815260040160405180910390fd5b60006001600160a01b0385161580612e2c5750612e2c856000610c16565b80612e4857506000612e3d84610d25565b6001600160a01b0316145b905080612e6857604051632ce44b5f60e11b815260040160405180910390fd5b6001600160a01b038416612e8f57604051633a954ecd60e21b815260040160405180910390fd5b612e9c85858560016139b3565b612ea860008487612d64565b6001600160a01b0385811660009081526101966020908152604080832080546001600160401b03198082166001600160401b039283166000190183161790925589861680865283862080549384169383166001908101841694909417905589865261019590945282852080546001600160e01b031916909417600160a01b42909216919091021783558701808452922080549193909116612f7e57610191548214612f7e57805460208601516001600160401b0316600160a01b026001600160e01b03199091166001600160a01b038a16171781555b50505082846001600160a01b0316866001600160a01b0316600080516020615aa583398151915260405160405180910390a45050505050565b6000612fc38233611f63565b15612fd057506001919050565b81612fdd57506000919050565b610c8c612fe983610fdc565b612fb7565b612ff88282613aa9565b600082815261015f60205260409020610deb9082613b31565b61301b8282613b46565b600082815261015f60205260409020610deb9082613bad565b61303c613bc2565b6065805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa60005b604051613077919061464f565b60405180910390a1565b600061308c8361334d565b805190915082156130f35760006001600160a01b03821615806130b557506130b5826000610c16565b806130d1575060006130c686610d25565b6001600160a01b0316145b9050806130f157604051632ce44b5f60e11b815260040160405180910390fd5b505b6131018160008660016139b3565b61310d60008583612d64565b6001600160a01b038082166000818152610196602090815260408083208054600160801b6000196001600160401b038084169190910181166001600160401b0319841681178390048216600190810183169093026001600160401b03600160801b03600160c01b0319909416179290921783558b8652610195909452828520805460ff60e01b1942909316600160a01b026001600160e01b03199091169097179690961716600160e01b1785559189018084529220805491949091166132085761019154821461320857805460208701516001600160401b0316600160a01b026001600160e01b03199091166001600160a01b038716171781555b5050604051869250600091506001600160a01b03841690600080516020615aa5833981519152908390a45050610192805460010190555050565b6002600154036132945760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610e37565b6002600155565b606060006132a883613c0b565b60010190506000816001600160401b038111156132c7576132c76147ef565b6040519080825280601f01601f1916602001820160405280156132f1576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a85049450846132fb57509392505050565b610fcd828260405180602001604052806000815250613ce1565b60018055565b6133556144ef565b818060011161344457610191548110156134445760008181526101956020908152604091829020825160608101845290546001600160a01b0381168252600160a01b81046001600160401b031692820192909252600160e01b90910460ff161515918101829052906134425780516001600160a01b0316156133d8579392505050565b506000190160008181526101956020908152604091829020825160608101845290546001600160a01b038116808352600160a01b82046001600160401b031693830193909352600160e01b900460ff161515928101929092521561343d579392505050565b6133d8565b505b604051636f96cda160e11b815260040160405180910390fd5b613465613e8e565b6065805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25861306a600090565b6000611f438383613ed4565b60655460ff16806134c957506000818152610257602052604090206007015442105b806134e557506000818152610257602052604090206008015442115b8061350357506000818152610257602052604090206001015460ff16155b1561130d576040516347cc82cd60e01b815260040160405180910390fd5b600086815261025760205260409020600581015461353f87876151d5565b111561355e57604051631f43edc360e11b815260040160405180910390fd5b80541561236f578385118061357b57508361357987876151d5565b115b1561359957604051631f43edc360e11b815260040160405180910390fd5b600061361b84848080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050855460405190925061360091508d908a9060200160609290921b6001600160601b0319168252601482015260340190565b60405160208183030381529060405280519060200120613efe565b5090508061363c5760405163c8ac23c360e01b815260040160405180910390fd5b505050505050505050565b6001600160a01b03163b151590565b600054610100900460ff1661367d5760405162461bcd60e51b8152600401610e37906158d4565b613685613fcc565b565b600054610100900460ff166136ae5760405162461bcd60e51b8152600401610e37906158d4565b6136b6613ff3565b61130d8161401a565b600054610100900460ff166136e65760405162461bcd60e51b8152600401610e37906158d4565b610fcd82826140a9565b610fcd8282612fee565b600061370583610fdc565b600084815261012d6020526040808220600101859055519192508391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b606061375983613647565b6137b45760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b6064820152608401610e37565b600080846001600160a01b0316846040516137cf919061591f565b600060405180830381855af49150503d806000811461380a576040519150601f19603f3d011682016040523d82523d6000602084013e61380f565b606091505b50915091506138378282604051806060016040528060278152602001615a5e60279139614104565b95945050505050565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a0290613875908490899088908890600401615931565b6020604051808303816000875af19250505080156138b0575060408051601f3d908101601f191682019092526138ad91810190615964565b60015b61390e573d8080156138de576040519150601f19603f3d011682016040523d82523d6000602084013e6138e3565b606091505b508051600003613906576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050949350505050565b6000610c8c825490565b60006001600160e01b03198216635a05180f60e01b1480610c8c5750610c8c8261411d565b6139648282611f63565b610fcd5761397181614152565b61397c836020614164565b60405160200161398d929190615981565b60408051601f198184030181529082905262461bcd60e51b8252610e3791600401614623565b6139bc84612bdb565b156139da576040516320cf996960e11b815260040160405180910390fd5b6139e383612bdb565b15613a01576040516320cf996960e11b815260040160405180910390fd5b60005b81811015611a5f576001600160a01b03851615613a2957613a29856104bc83866151d5565b6001600160a01b038516600090815261022c6020526040812081613a4d84876151d5565b815260208082019290925260409081016000908120939093556001600160a01b038716835261022c90915281204291613a8684876151d5565b815260208101919091526040016000205580613aa1816151bc565b915050613a04565b613ab38282611f63565b610fcd57600082815261012d602090815260408083206001600160a01b03851684529091529020805460ff19166001179055613aed600090565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000611f43836001600160a01b0384166142ff565b613b508282611f63565b15610fcd57600082815261012d602090815260408083206001600160a01b0385168085529252808320805460ff191690555184907ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b908490a45050565b6000611f43836001600160a01b03841661434e565b60655460ff166136855760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610e37565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b8310613c4a5772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6904ee2d6d415b85acef8160201b8310613c74576904ee2d6d415b85acef8160201b830492506020015b662386f26fc100008310613c9257662386f26fc10000830492506010015b6305f5e1008310613caa576305f5e100830492506008015b6127108310613cbe57612710830492506004015b60648310613cd0576064830492506002015b600a8310610c8c5760010192915050565b610191546001600160a01b038416613d0b57604051622e076360e81b815260040160405180910390fd5b82600003613d2c5760405163b562e8dd60e01b815260040160405180910390fd5b613d3960008583866139b3565b6001600160a01b03841660008181526101966020908152604080832080546001600160801b031981166001600160401b038083168b018116918217600160401b6001600160401b031990941690921783900481168b0181169092021790915585845261019590925290912080546001600160e01b0319168317600160a01b4290931692909202919091179055819081850190613dd490613647565b15613e4b575b60405182906001600160a01b03881690600090600080516020615aa5833981519152908290a4613e136000878480600101955087613840565b613e30576040516368d2bf6b60e11b815260040160405180910390fd5b808210613dda57826101915414613e4657600080fd5b613e7e565b5b6040516001830192906001600160a01b03881690600090600080516020615aa5833981519152908290a4808210613e4c575b5061019155611718600085838684565b60655460ff16156136855760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610e37565b6000826000018281548110613eeb57613eeb615190565b9060005260206000200154905092915050565b6000808281805b8751811015613fc057613f1960028361545a565b91506000888281518110613f2f57613f2f615190565b60200260200101519050808411613f71576040805160208101869052908101829052606001604051602081830303815290604052805190602001209350613fad565b6040805160208101839052908101859052606001604051602081830303815290604052805190602001209350600183613faa91906151d5565b92505b5080613fb8816151bc565b915050613f05565b50941495939450505050565b600054610100900460ff166133475760405162461bcd60e51b8152600401610e37906158d4565b600054610100900460ff166136855760405162461bcd60e51b8152600401610e37906158d4565b600054610100900460ff166140415760405162461bcd60e51b8152600401610e37906158d4565b60005b8151811015610fcd5760016097600084848151811061406557614065615190565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806140a1816151bc565b915050614044565b600054610100900460ff166140d05760405162461bcd60e51b8152600401610e37906158d4565b81516140e49061019390602085019061450f565b5080516140f99061019490602084019061450f565b506001610191555050565b60608315614113575081611f43565b611f438383614441565b60006001600160e01b03198216637965db0b60e01b1480610c8c57506301ffc9a760e01b6001600160e01b0319831614610c8c565b6060610c8c6001600160a01b03831660145b6060600061417383600261545a565b61417e9060026151d5565b6001600160401b03811115614195576141956147ef565b6040519080825280601f01601f1916602001820160405280156141bf576020820181803683370190505b509050600360fc1b816000815181106141da576141da615190565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061420957614209615190565b60200101906001600160f81b031916908160001a905350600061422d84600261545a565b6142389060016151d5565b90505b60018111156142b0576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061426c5761426c615190565b1a60f81b82828151811061428257614282615190565b60200101906001600160f81b031916908160001a90535060049490941c936142a9816159f0565b905061423b565b508315611f435760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610e37565b600081815260018301602052604081205461434657508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610c8c565b506000610c8c565b60008181526001830160205260408120548015614437576000614372600183615215565b855490915060009061438690600190615215565b90508181146143eb5760008660000182815481106143a6576143a6615190565b90600052602060002001549050808760000184815481106143c9576143c9615190565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806143fc576143fc615a07565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610c8c565b6000915050610c8c565b8151156144515781518083602001fd5b8060405162461bcd60e51b8152600401610e379190614623565b828054614477906150d7565b90600052602060002090601f01602090048101928261449957600085556144df565b82601f106144b25782800160ff198235161785556144df565b828001600101855582156144df579182015b828111156144df5782358255916020019190600101906144c4565b506144eb929150614583565b5090565b604080516060810182526000808252602082018190529181019190915290565b82805461451b906150d7565b90600052602060002090601f01602090048101928261453d57600085556144df565b82601f1061455657805160ff19168380011785556144df565b828001600101855582156144df579182015b828111156144df578251825591602001919060010190614568565b5b808211156144eb5760008155600101614584565b6001600160e01b03198116811461130d57600080fd5b6000602082840312156145c057600080fd5b8135611f4381614598565b60005b838110156145e65781810151838201526020016145ce565b838111156117185750506000910152565b6000815180845261460f8160208601602086016145cb565b601f01601f19169290920160200192915050565b602081526000611f4360208301846145f7565b60006020828403121561464857600080fd5b5035919050565b6001600160a01b0391909116815260200190565b80356001600160a01b038116811461467a57600080fd5b919050565b6000806040838503121561469257600080fd5b61469b83614663565b946020939093013593505050565b6000602082840312156146bb57600080fd5b611f4382614663565b6000806000606084860312156146d957600080fd5b6146e284614663565b92506146f060208501614663565b9150604084013590509250925092565b6000806040838503121561471357600080fd5b8235915061472360208401614663565b90509250929050565b60006020828403121561473e57600080fd5b81356001600160401b0381111561475457600080fd5b820160208185031215611f4357600080fd5b60008083601f84011261477857600080fd5b5081356001600160401b0381111561478f57600080fd5b6020830191508360208285010111156147a757600080fd5b9250929050565b600080602083850312156147c157600080fd5b82356001600160401b038111156147d757600080fd5b6147e385828601614766565b90969095509350505050565b634e487b7160e01b600052604160045260246000fd5b60405160c081016001600160401b0381118282101715614827576148276147ef565b60405290565b604051601f8201601f191681016001600160401b0381118282101715614855576148556147ef565b604052919050565b60006001600160401b03821115614876576148766147ef565b5060051b60200190565b6000602080838503121561489357600080fd5b82356001600160401b038111156148a957600080fd5b8301601f810185136148ba57600080fd5b80356148cd6148c88261485d565b61482d565b81815260059190911b820183019083810190878311156148ec57600080fd5b928401925b8284101561490a578335825292840192908401906148f1565b979650505050505050565b80516001600160a01b031682526020808201516001600160401b0316908301526040908101511515910152565b6020808252825182820181905260009190848201906040850190845b81811015611e1857614971838551614915565b928401926060929092019160010161495e565b6020815281516020820152600060208301516149a4604084018215159052565b5060408301516101208060608501526149c16101408501836145f7565b91506060850151601f198584030160808601526149de83826145f7565b925050608085015160a085015260a085015160c085015260c085015160e085015260e0850151610100818187015280870151838701525050508091505092915050565b60006101208284031215614a3457600080fd5b50919050565b60008060408385031215614a4d57600080fd5b82356001600160401b03811115614a6357600080fd5b614a6f85828601614a21565b95602094909401359450505050565b60008083601f840112614a9057600080fd5b5081356001600160401b03811115614aa757600080fd5b6020830191508360208260051b85010111156147a757600080fd5b60008060008060408587031215614ad857600080fd5b84356001600160401b0380821115614aef57600080fd5b614afb88838901614a7e565b90965094506020870135915080821115614b1457600080fd5b50614b2187828801614a7e565b95989497509550505050565b60006101008451151583526020850151602084015260408501516040840152606085015160608401526080850151608084015260a085015160a084015260c085015160c08401528060e0840152835160208285015261124e6101208501826145f7565b600060208284031215614ba257600080fd5b81356001600160401b03811115614bb857600080fd5b82016101008185031215611f4357600080fd5b6020808252825182820181905260009190848201906040850190845b81811015611e1857835183529284019291840191600101614be7565b600060208284031215614c1557600080fd5b81356001600160401b03811115614c2b57600080fd5b612c5284828501614a21565b600080600060408486031215614c4c57600080fd5b83356001600160401b03811115614c6257600080fd5b614c6e86828701614766565b9094509250614c81905060208501614663565b90509250925092565b60008060408385031215614c9d57600080fd5b50508035926020909101359150565b6000806000806000806000806080898b031215614cc857600080fd5b88356001600160401b0380821115614cdf57600080fd5b614ceb8c838d01614a7e565b909a50985060208b0135915080821115614d0457600080fd5b614d108c838d01614a7e565b909850965060408b0135915080821115614d2957600080fd5b614d358c838d01614a7e565b909650945060608b0135915080821115614d4e57600080fd5b50614d5b8b828c01614a7e565b999c989b5096995094979396929594505050565b600080600060608486031215614d8457600080fd5b614d8d84614663565b95602085013595506040909401359392505050565b600082601f830112614db357600080fd5b81356001600160401b03811115614dcc57614dcc6147ef565b614ddf601f8201601f191660200161482d565b818152846020838601011115614df457600080fd5b816020850160208301376000918101602001919091529392505050565b600082601f830112614e2257600080fd5b81356020614e326148c88361485d565b82815260059290921b84018101918181019086841115614e5157600080fd5b8286015b84811015614e7357614e6681614663565b8352918301918301614e55565b509695505050505050565b600080600080600080600060e0888a031215614e9957600080fd5b614ea288614663565b965060208801356001600160401b0380821115614ebe57600080fd5b614eca8b838c01614da2565b975060408a0135915080821115614ee057600080fd5b614eec8b838c01614da2565b965060608a0135915080821115614f0257600080fd5b614f0e8b838c01614da2565b955060808a0135915080821115614f2457600080fd5b50614f318a828b01614e11565b935050614f4060a08901614663565b9150614f4e60c08901614663565b905092959891949750929550565b801515811461130d57600080fd5b60008060408385031215614f7d57600080fd5b614f8683614663565b91506020830135614f9681614f5c565b809150509250929050565b60008060208385031215614fb457600080fd5b82356001600160401b03811115614fca57600080fd5b6147e385828601614a7e565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b8281101561502b57603f198886030184526150198583516145f7565b94509285019290850190600101614ffd565b5092979650505050505050565b6000806000806080858703121561504e57600080fd5b61505785614663565b935061506560208601614663565b92506040850135915060608501356001600160401b0381111561508757600080fd5b61509387828801614da2565b91505092959194509250565b60608101610c8c8284614915565b600080604083850312156150c057600080fd5b6150c983614663565b915061472360208401614663565b600181811c908216806150eb57607f821691505b602082108103614a3457634e487b7160e01b600052602260045260246000fd5b6000602080838503121561511e57600080fd5b82516001600160401b0381111561513457600080fd5b8301601f8101851361514557600080fd5b80516151536148c88261485d565b81815260059190911b8201830190838101908783111561517257600080fd5b928401925b8284101561490a57835182529284019290840190615177565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016151ce576151ce6151a6565b5060010190565b600082198211156151e8576151e86151a6565b500190565b6020808252600e908201526d139bdd08185d5d1a1bdc9a5e995960921b604082015260600190565b600082821015615227576152276151a6565b500390565b60008261524957634e487b7160e01b600052601260045260246000fd5b500490565b6000808335601e1984360301811261526557600080fd5b8301803591506001600160401b0382111561527f57600080fd5b6020019150600581901b36038213156147a757600080fd5b6000823560be198336030181126152ad57600080fd5b9190910192915050565b600060c082360312156152c957600080fd5b6152d1614805565b82356001600160401b03808211156152e857600080fd5b6152f436838701614da2565b83526020850135602084015260408501356040840152606085013560608401526080850135608084015260a085013591508082111561533257600080fd5b5061533f36828601614da2565b60a08301525092915050565b60018060a01b0383168152604060208201526000825160c060408401526153766101008401826145f7565b90506020840151606084015260408401516080840152606084015160a0840152608084015160c084015260a0840151603f198483030160e085015261124e82826145f7565b6000808335601e198436030181126153d257600080fd5b8301803591506001600160401b038211156153ec57600080fd5b6020019150368190038213156147a757600080fd5b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60608152600061543e606083018688615401565b6001600160a01b03949094166020830152506040015292915050565b6000816000190483118215151615615474576154746151a6565b500290565b60208082526014908201527322bc31b2b2b232b21036b0bc1039bab838363c9760611b604082015260600190565b600083516154b98184602088016145cb565b8351908301906154cd8183602088016145cb565b600b60fa1b9101908152600101949350505050565b60008135610c8c81614f5c565b60ff1981541660ff8315151681178255505050565b601f821115610deb57600081815260208120601f850160051c8101602086101561552b5750805b601f850160051c820191505b81811015611b3057828155600101615537565b600019600383901b1c191660019190911b1790565b6001600160401b03831115615576576155766147ef565b61558a8361558483546150d7565b83615504565b6000601f8411600181146155b857600085156155a65750838201355b6155b0868261554a565b845550611a5f565b600083815260209020601f19861690835b828110156155e957868501358255602094850194600190920191016155c9565b50868210156156065760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b8135815561563461562b602084016154e2565b600183016154ef565b61564160408301836153bb565b61564f81836002860161555f565b505061565e60608301836153bb565b61566c81836003860161555f565b50506080820135600482015560a0820135600582015560c0820135600682015560e0820135600782015561010082013560088201555050565b6156af82836153bb565b6001600160401b038111156156c6576156c66147ef565b6156da816156d485546150d7565b85615504565b6000601f82116001811461570857600083156156f65750838201355b615700848261554a565b865550611b30565b600085815260209020601f19841690835b828110156157395786850135825560209485019460019092019101615719565b50848210156157565760001960f88660031b161c19848701351681555b50505050600190811b019091555050565b813561577281614f5c565b61577c81836154ef565b506020820135600182015560408201356002820155606082013560038201556080820135600482015560a0820135600582015560c0820135600682015560e0820135601e198336030181126157d057600080fd5b610deb818401600784016156a5565b6040815260006157f3604083018587615401565b905060018060a01b0383166020830152949350505050565b60006020828403121561581d57600080fd5b5051919050565b6000808454615832816150d7565b6001828116801561584a576001811461585b5761588a565b60ff1984168752828701945061588a565b8860005260208060002060005b858110156158815781548a820152908401908201615868565b50505082870194505b50505050835161589e8183602088016145cb565b64173539b7b760d91b9101908152600501949350505050565b6000602082840312156158c957600080fd5b8151611f4381614f5c565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b600082516152ad8184602087016145cb565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061124e908301846145f7565b60006020828403121561597657600080fd5b8151611f4381614598565b76020b1b1b2b9b9a1b7b73a3937b61d1030b1b1b7bab73a1604d1b8152600083516159b38160178501602088016145cb565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516159e48160288401602088016145cb565b01602801949350505050565b6000816159ff576159ff6151a6565b506000190190565b634e487b7160e01b600052603160045260246000fdfe0c1b180fbb60448c5491c5ddc7c3a923854214b9ff70f90a7821333338971f928eb467f061ca67f42a2d2ca4a346fc9fb645efc0ba75056ee9f71c3a0ccc10a8416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c65649f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef2ce8d04a9c35987429af538825cd2438cc5c5bb5dc427955f84daaa3ea105016a164736f6c634300080d000a
Deployed Bytecode
0x60806040526004361061030a5760003560e01c806301ffc9a71461030f57806306fdde0314610344578063081812fc14610366578063095ea7b31461039357806313af4035146103b557806315e25d5a146103d557806318160ddd146103ea5780631e7269c51461041357806323b872dd14610441578063248a9ca31461046157806325221df1146104815780632e9dd350146104a15780632f2ff15d146104c157806333640c8b146104e157806336568abe146105015780633b6fda59146105215780633f4ba83a1461055a57806342842e0e1461056f57806342966c681461058f57806344bbff84146105af578063511d5d74146105c257806353a09eba146105e257806355f804b31461061b578063572b6c051461063b5780635ace6352146106745780635bbb2177146106945780635c975abb146106c15780636182ff53146106d95780636352211e1461070657806363906d0d1461072657806364274fef14610758578063672434821461077857806370a0823114610798578063738170a4146107b857806379502c55146107d957806383de187b146107fc5780638456cb591461081c5780638462151c1461083157806387b63e3a1461085e5780638b81a7ee146108975780638da5cb5b146108b75780638ead7b3d146108cc5780638ff992ae146108ed5780639010d07c1461090d57806391d148541461092d578063931e28e91461094d578063938e3d7b1461096e578063942593991461098e57806395d89b41146109a157806399a2557a146109b65780639ef44ead146109d6578063a0a8e460146109f6578063a217fddf14610a12578063a22cb46514610a27578063ac9650d814610a47578063b3738dfc14610a74578063b522ecff14610a94578063b88d4fde14610ab4578063c23dc68f14610ad4578063c25e0f6714610b01578063c87b56dd14610b21578063ca15c87314610b41578063cb2ef6f714610b61578063d547741f14610b8b578063df592f7d14610bab578063e27d153e14610bcb578063e8a3d48514610be6578063e985e9c514610bfb578063f60ca60d14610c45575b600080fd5b34801561031b57600080fd5b5061032f61032a3660046145ae565b610c66565b60405190151581526020015b60405180910390f35b34801561035057600080fd5b50610359610c92565b60405161033b9190614623565b34801561037257600080fd5b50610386610381366004614636565b610d25565b60405161033b919061464f565b34801561039f57600080fd5b506103b36103ae36600461467f565b610d6a565b005b3480156103c157600080fd5b506103b36103d03660046146a9565b610df0565b3480156103e157600080fd5b506103b3610e94565b3480156103f657600080fd5b50610192546101915403600019015b60405190815260200161033b565b34801561041f57600080fd5b5061040561042e3660046146a9565b6102286020526000908152604090205481565b34801561044d57600080fd5b506103b361045c3660046146c4565b610fd1565b34801561046d57600080fd5b5061040561047c366004614636565b610fdc565b34801561048d57600080fd5b5061040561049c3660046146a9565b610ff2565b3480156104ad57600080fd5b506103b36104bc36600461467f565b6110b9565b3480156104cd57600080fd5b506103b36104dc366004614700565b6111ae565b3480156104ed57600080fd5b506104056104fc366004614700565b6111fa565b34801561050d57600080fd5b506103b361051c366004614700565b611258565b34801561052d57600080fd5b5061040561053c36600461467f565b61022960209081526000928352604080842090915290825290205481565b34801561056657600080fd5b506103b36112d1565b34801561057b57600080fd5b506103b361058a3660046146c4565b611310565b34801561059b57600080fd5b506103b36105aa366004614636565b61132b565b6103b36105bd36600461472c565b611336565b3480156105ce57600080fd5b506103b36105dd3660046146a9565b61167f565b3480156105ee57600080fd5b506104056105fd36600461467f565b61022c60209081526000928352604080842090915290825290205481565b34801561062757600080fd5b506103b36106363660046147ae565b6116d7565b34801561064757600080fd5b5061032f6106563660046146a9565b6001600160a01b031660009081526097602052604090205460ff1690565b34801561068057600080fd5b506103b361068f3660046146a9565b61171e565b3480156106a057600080fd5b506106b46106af366004614880565b611761565b60405161033b9190614942565b3480156106cd57600080fd5b5060655460ff1661032f565b3480156106e557600080fd5b506106f96106f4366004614636565b611815565b60405161033b9190614984565b34801561071257600080fd5b50610386610721366004614636565b6119fe565b34801561073257600080fd5b506102555461025654610743919082565b6040805192835260208301919091520161033b565b34801561076457600080fd5b506103b3610773366004614a3a565b611a10565b34801561078457600080fd5b506103b3610793366004614ac2565b611a66565b3480156107a457600080fd5b506104056107b33660046146a9565b611b38565b3480156107c457600080fd5b5061025254610386906001600160a01b031681565b3480156107e557600080fd5b506107ee611b87565b60405161033b929190614b2d565b34801561080857600080fd5b506103b3610817366004614b90565b611c7b565b34801561082857600080fd5b506103b3611cbd565b34801561083d57600080fd5b5061085161084c3660046146a9565b611cf9565b60405161033b9190614bcb565b34801561086a57600080fd5b50610405610879366004614636565b33600090815261022960209081526040808320938352929052205490565b3480156108a357600080fd5b506103b36108b2366004614c03565b611e24565b3480156108c357600080fd5b50610386611e93565b3480156108d857600080fd5b5061026054610386906001600160a01b031681565b3480156108f957600080fd5b50610405610908366004614c37565b611ec9565b34801561091957600080fd5b50610386610928366004614c8a565b611f4a565b34801561093957600080fd5b5061032f610948366004614700565b611f63565b34801561095957600080fd5b5061025354610386906001600160a01b031681565b34801561097a57600080fd5b506103b36109893660046147ae565b611f8f565b6103b361099c366004614cac565b611fd0565b3480156109ad57600080fd5b50610359612379565b3480156109c257600080fd5b506108516109d1366004614d6f565b612389565b3480156109e257600080fd5b506103b36109f1366004614e7e565b61254c565b348015610a0257600080fd5b506040516001815260200161033b565b348015610a1e57600080fd5b50610405600081565b348015610a3357600080fd5b506103b3610a42366004614f6a565b61275b565b348015610a5357600080fd5b50610a67610a62366004614fa1565b6127ff565b60405161033b9190614fd6565b348015610a8057600080fd5b5061032f610a8f366004614636565b6128f3565b348015610aa057600080fd5b506103b3610aaf3660046146a9565b6128fe565b348015610ac057600080fd5b506103b3610acf366004615038565b61294f565b348015610ae057600080fd5b50610af4610aef366004614636565b61299a565b60405161033b919061509f565b348015610b0d57600080fd5b50610405610b1c3660046146a9565b612a31565b348015610b2d57600080fd5b50610359610b3c366004614636565b612aa4565b348015610b4d57600080fd5b50610405610b5c366004614636565b612b46565b348015610b6d57600080fd5b507350726f707345524337323141555374616b696e6760601b610405565b348015610b9757600080fd5b506103b3610ba6366004614700565b612b5e565b348015610bb757600080fd5b5061032f610bc63660046146a9565b612bdb565b348015610bd757600080fd5b5061022b5461032f9060ff1681565b348015610bf257600080fd5b50610359612c5a565b348015610c0757600080fd5b5061032f610c163660046150ad565b6001600160a01b0391821660009081526101986020908152604080832093909416825291909152205460ff1690565b348015610c5157600080fd5b5061025154610386906001600160a01b031681565b6000610c7182612ce9565b80610c8c575063152a902d60e11b6001600160e01b03198316145b92915050565b60606101938054610ca2906150d7565b80601f0160208091040260200160405190810160405280929190818152602001828054610cce906150d7565b8015610d1b5780601f10610cf057610100808354040283529160200191610d1b565b820191906000526020600020905b815481529060010190602001808311610cfe57829003601f168201915b5050505050905090565b6000610d3082612d29565b610d4d576040516333d1c03960e21b815260040160405180910390fd5b50600090815261019760205260409020546001600160a01b031690565b6000610d75826119fe565b9050806001600160a01b0316836001600160a01b031603610da95760405163250fdee360e21b815260040160405180910390fd5b6001600160a01b03811615610de057610dc3816000610c16565b610de0576040516367d9dca160e11b815260040160405180910390fd5b610deb838383612d64565b505050565b6000610dfb81612dc1565b610e06600083611f63565b610e405760405162461bcd60e51b815260206004820152600660248201526510a0a226a4a760d11b60448201526064015b60405180910390fd5b61024f80546001600160a01b038481166001600160a01b0319831681179093556040519116919082907f8292fce18fa69edf4db7b94ea2e58241df0ae57f97e0a6c9b29067028bf92d7690600090a3505050565b61022b5460ff16610edd5760405162461bcd60e51b815260206004820152601360248201527253656c662d436c61696d20496e61637469766560681b6044820152606401610e37565b604051632118854760e21b81526000903090638462151c90610f0390339060040161464f565b600060405180830381865afa158015610f20573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610f48919081019061510b565b905060005b8151811015610fcd57610f7933838381518110610f6c57610f6c615190565b60200260200101516110b9565b33600090815261022c602052604081208351429290859085908110610fa057610fa0615190565b60200260200101518152602001908152602001600020819055508080610fc5906151bc565b915050610f4d565b5050565b610deb838383612dcc565b600090815261012d602052604090206001015490565b604051632118854760e21b815260009081903090638462151c9061101a90869060040161464f565b600060405180830381865afa158015611037573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261105f919081019061510b565b90506000915060005b81518110156110b25761109482828151811061108657611086615190565b6020026020010151856111fa565b61109e90846151d5565b9250806110aa816151bc565b915050611068565b5050919050565b816001600160a01b03166110cc826119fe565b6001600160a01b03161461110e5760405162461bcd60e51b81526020600482015260096024820152682737ba1027bbb732b960b91b6044820152606401610e37565b600061111a82846111fa565b6102535460405163475a9fa960e01b81526001600160a01b0386811660048301526024820184905292935091169063475a9fa990604401600060405180830381600087803b15801561116b57600080fd5b505af115801561117f573d6000803e3d6000fd5b505050506001600160a01b0392909216600090815261022c602090815260408083209383529290522042905550565b600080516020615ac58339815191526111c681612fb7565b6111e25760405162461bcd60e51b8152600401610e37906151ed565b6111ec8383611f63565b610deb57610deb8383612fee565b6001600160a01b038116600090815261022c60209081526040808320858452909152812054808203611230576000915050610c8c565b42600061123d8383615215565b905061022a548161124e919061522c565b9695505050505050565b6001600160a01b038116156112c75760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610e37565b610fcd8282613011565b600080516020615a858339815191526112e981612fb7565b6113055760405162461bcd60e51b8152600401610e37906151ed565b61130d613034565b50565b610deb8383836040518060200160405280600081525061294f565b61130d816001613081565b61133e613242565b60008060005b61134e848061524e565b9050811015611503576000611363858061524e565b8381811061137357611373615190565b90506020028101906113859190615297565b61138e906152b7565b61025354604051634996ec2760e11b81529192506001600160a01b03169063932dd84e906113c2903390859060040161534b565b60006040518083038186803b1580156113da57600080fd5b505afa1580156113ee573d6000803e3d6000fd5b5050610253546001600160a01b03169150638b9e69c39050611410878061524e565b8581811061142057611420615190565b90506020028101906114329190615297565b61143c90806153bb565b336114478a8061524e565b8881811061145757611457615190565b90506020028101906114699190615297565b602001356040518563ffffffff1660e01b815260040161148c949392919061542a565b600060405180830381600087803b1580156114a657600080fd5b505af11580156114ba573d6000803e3d6000fd5b50505060208201516114cd9150846151d5565b9250806020015181604001516114e3919061545a565b6114ed90856151d5565b93505080806114fb906151bc565b915050611344565b5061025b546102275460019061151a9084906151d5565b6115249190615215565b11156115425760405162461bcd60e51b8152600401610e3790615479565b348211156115635760405163356680b760e01b815260040160405180910390fd5b6102525460405160009182916001600160a01b039091169034908381818185875af1925050503d80600081146115b5576040519150601f19603f3d011682016040523d82523d6000602084013e6115ba565b606091505b5060408051602081019091526000815261022754929450909250905b84610227540181101561161857816115ed8261329b565b6040516020016115fe9291906154a7565b60408051601f1981840301815291905291506001016115d6565b5033600081815261022860205260409020805486019055610227805486019055611642908561332d565b336001600160a01b0316600080516020615a1e833981519152826040516116699190614623565b60405180910390a2505050505061130d60018055565b600080516020615ac583398151915261169781612fb7565b6116b35760405162461bcd60e51b8152600401610e37906151ed565b5061025380546001600160a01b0319166001600160a01b0392909216919091179055565b600080516020615ac58339815191526116ef81612fb7565b61170b5760405162461bcd60e51b8152600401610e37906151ed565b61171861024d848461446b565b50505050565b611735600080516020615ac58339815191526128f3565b61173e57600080fd5b61026080546001600160a01b0319166001600160a01b0392909216919091179055565b80516060906000816001600160401b03811115611780576117806147ef565b6040519080825280602002602001820160405280156117b957816020015b6117a66144ef565b81526020019060019003908161179e5790505b50905060005b82811461180d576117e88582815181106117db576117db615190565b602002602001015161299a565b8282815181106117fa576117fa615190565b60209081029190910101526001016117bf565b509392505050565b61186960405180610120016040528060008019168152602001600015158152602001606081526020016060815260200160008152602001600081526020016000815260200160008152602001600081525090565b6000828152610257602090815260409182902082516101208101845281548152600182015460ff1615159281019290925260028101805492939192918401916118b1906150d7565b80601f01602080910402602001604051908101604052809291908181526020018280546118dd906150d7565b801561192a5780601f106118ff5761010080835404028352916020019161192a565b820191906000526020600020905b81548152906001019060200180831161190d57829003601f168201915b50505050508152602001600382018054611943906150d7565b80601f016020809104026020016040519081016040528092919081815260200182805461196f906150d7565b80156119bc5780601f10611991576101008083540402835291602001916119bc565b820191906000526020600020905b81548152906001019060200180831161199f57829003601f168201915b50505050508152602001600482015481526020016005820154815260200160068201548152602001600782015481526020016008820154815250509050919050565b6000611a098261334d565b5192915050565b600080516020615a3e833981519152611a2881612fb7565b611a445760405162461bcd60e51b8152600401610e37906151ed565b6000828152610257602052604090208390611a5f8282615618565b5050505050565b600080516020615a85833981519152611a7e81612fb7565b611a9a5760405162461bcd60e51b8152600401610e37906151ed565b60005b84811015611b3057838382818110611ab757611ab7615190565b905060200201356102276000828254611ad091906151d5565b90915550611b1e9050868683818110611aeb57611aeb615190565b9050602002016020810190611b0091906146a9565b858584818110611b1257611b12615190565b9050602002013561332d565b80611b28816151bc565b915050611a9d565b505050505050565b60006001600160a01b038216611b61576040516323d3ad8160e21b815260040160405180910390fd5b506001600160a01b0316600090815261019660205260409020546001600160401b031690565b6040805160e081018252610258805460ff16151582526102595460208084019190915261025a548385015261025b54606084015261025c54608084015261025d5460a084015261025e5460c0840152835190810190935261025f80549293919282908290611bf4906150d7565b80601f0160208091040260200160405190810160405280929190818152602001828054611c20906150d7565b8015611c6d5780601f10611c4257610100808354040283529160200191611c6d565b820191906000526020600020905b815481529060010190602001808311611c5057829003601f168201915b505050505081525050905082565b600080516020615a3e833981519152611c9381612fb7565b611caf5760405162461bcd60e51b8152600401610e37906151ed565b816102586117188282615767565b600080516020615a85833981519152611cd581612fb7565b611cf15760405162461bcd60e51b8152600401610e37906151ed565b61130d61345d565b60606000806000611d0985611b38565b90506000816001600160401b03811115611d2557611d256147ef565b604051908082528060200260200182016040528015611d4e578160200160208202803683370190505b509050611d596144ef565b60015b838614611e185760008181526101956020908152604091829020825160608101845290546001600160a01b0381168252600160a01b81046001600160401b031692820192909252600160e01b90910460ff1615159181018290529250611e105781516001600160a01b031615611dd157815194505b876001600160a01b0316856001600160a01b031603611e105780838780600101985081518110611e0357611e03615190565b6020026020010181815250505b600101611d5c565b50909695505050505050565b600080516020615a3e833981519152611e3c81612fb7565b611e585760405162461bcd60e51b8152600401610e37906151ed565b610256546000908152610257602052604090208290611e778282615618565b50506102568054906000611e8a836151bc565b91905055505050565b61024f54600090611eae9082906001600160a01b0316611f63565b611eb85750600090565b5061024f546001600160a01b031690565b610253546040516347fcc95760e11b81526000916001600160a01b031690638ff992ae90611eff908790879087906004016157df565b602060405180830381865afa158015611f1c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f40919061580b565b90505b9392505050565b600082815261015f60205260408120611f43908361349b565b600091825261012d602090815260408084206001600160a01b0393909316845291905290205460ff1690565b600080516020615ac5833981519152611fa781612fb7565b611fc35760405162461bcd60e51b8152600401610e37906151ed565b61171861024e848461446b565b611fd8613242565b611fe133612bdb565b15611fff576040516320cf996960e11b815260040160405180910390fd5b60008060005b8981101561217e578a8a8281811061201f5761201f615190565b905060200201358261203191906151d5565b915061205485858381811061204857612048615190565b905060200201356134a7565b61210a3386868481811061206a5761206a615190565b336000908152610229602090815260408220920293909301359290915089898781811061209957612099615190565b905060200201358152602001908152602001600020548e8e868181106120c1576120c1615190565b905060200201358b8b878181106120da576120da615190565b905060200201358e8e888181106120f3576120f3615190565b9050602002810190612105919061524e565b613521565b8a8a8281811061211c5761211c615190565b90506020020135610255600201600087878581811061213d5761213d615190565b90506020020135815260200190815260200160002060040154612160919061545a565b61216a90846151d5565b925080612176816151bc565b915050612005565b5061025b54610227546001906121959084906151d5565b61219f9190615215565b11156121bd5760405162461bcd60e51b8152600401610e3790615479565b348211156121de5760405163356680b760e01b815260040160405180910390fd5b6102525460405160009182916001600160a01b039091169034908381818185875af1925050503d8060008114612230576040519150601f19603f3d011682016040523d82523d6000602084013e612235565b606091505b5060408051602081019091526000815261022754929450909250905b84610227540181101561229357816122688261329b565b6040516020016122799291906154a7565b60408051601f198184030181529190529150600101612251565b5060005b8c811015612308578d8d828181106122b1576122b1615190565b33600090815261022960209081526040822092029390930135929091508a8a858181106122e0576122e0615190565b6020908102929092013583525081019190915260400160002080549091019055600101612297565b5033600081815261022860205260409020805486019055610227805486019055612332908561332d565b336001600160a01b0316600080516020615a1e833981519152826040516123599190614623565b60405180910390a2505050505061236f60018055565b5050505050505050565b60606101948054610ca2906150d7565b60608183106123ab57604051631960ccad60e11b815260040160405180910390fd5b6101915460009060018510156123c057600194505b808411156123cc578093505b60006123d787611b38565b9050848610156123f657858503818110156123f0578091505b506123fa565b5060005b6000816001600160401b03811115612414576124146147ef565b60405190808252806020026020018201604052801561243d578160200160208202803683370190505b50905081600003612453579350611f4392505050565b600061245e8861299a565b90506000816040015161246f575080515b885b8881141580156124815750848714155b1561253b5760008181526101956020908152604091829020825160608101845290546001600160a01b0381168252600160a01b81046001600160401b031692820192909252600160e01b90910460ff16151591810182905293506125335782516001600160a01b0316156124f457825191505b8a6001600160a01b0316826001600160a01b031603612533578084888060010199508151811061252657612526615190565b6020026020010181815250505b600101612471565b505050928352509095945050505050565b600054610100900460ff161580801561256c5750600054600160ff909116105b8061258d575061257b30613647565b15801561258d575060005460ff166001145b6125f05760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610e37565b6000805460ff191660011790558015612613576000805461ff0019166101001790555b61261b613656565b61262484613687565b61262e87876136bf565b61025280546001600160a01b038086166001600160a01b03199283161790925561024f80548b841690831617905561025080549285169290911691909117905584516126829061024d90602088019061450f565b5061268e6000896136f0565b6126a7600080516020615ac583398151915260006136fa565b6126cd600080516020615a3e833981519152600080516020615ac58339815191526136fa565b6126f3600080516020615a85833981519152600080516020615a3e8339815191526136fa565b6001610227556201518061022a5561022b805460ff19169055801561236f576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15050505050505050565b6001600160a01b0382166127825760405163b06307db60e01b815260040160405180910390fd5b6001600160a01b03821660008181527f4423f7c6e52e9185383a9cf02b7a6886e99ba21d91d7a83c121c6d17c40c5b7960209081526040808320805460ff191686151590811790915590519081527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b6060816001600160401b03811115612819576128196147ef565b60405190808252806020026020018201604052801561284c57816020015b60608152602001906001900390816128375790505b50905060005b828110156128ec576128bc3085858481811061287057612870615190565b905060200281019061288291906153bb565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061374e92505050565b8282815181106128ce576128ce615190565b602002602001018190525080806128e4906151bc565b915050612852565b5092915050565b6000610c8c82612fb7565b61024f546001600160a01b0316321480612923575061024f546001600160a01b031633145b61292c57600080fd5b61025280546001600160a01b0319166001600160a01b0392909216919091179055565b61295a848484612dcc565b61296c836001600160a01b0316613647565b156117185761297d84848484613840565b611718576040516368d2bf6b60e11b815260040160405180910390fd5b6129a26144ef565b6129aa6144ef565b60018310806129bc5750610191548310155b156129c75792915050565b5060008281526101956020908152604091829020825160608101845290546001600160a01b0381168252600160a01b81046001600160401b031692820192909252600160e01b90910460ff161580159282019290925290612a285792915050565b611f438361334d565b610253546040516370a0823160e01b81526000916001600160a01b0316906370a0823190612a6390859060040161464f565b602060405180830381865afa158015612a80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c8c919061580b565b6060612aaf82612d29565b612b135760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b6064820152608401610e37565b61024d612b1f8361329b565b604051602001612b30929190615824565b6040516020818303038152906040529050919050565b600081815261015f60205260408120610c8c9061392b565b600080516020615ac5833981519152612b7681612fb7565b612b925760405162461bcd60e51b8152600401610e37906151ed565b612b9c8383611f63565b15610deb5782158015612bc75750612bb2611e93565b6001600160a01b0316826001600160a01b0316145b15612bd157600080fd5b610deb8383613011565b6102605460405163df592f7d60e01b81526000916001600160a01b0316908290829063df592f7d90612c1190879060040161464f565b602060405180830381865afa158015612c2e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c5291906158b7565b949350505050565b61024e8054612c68906150d7565b80601f0160208091040260200160405190810160405280929190818152602001828054612c94906150d7565b8015612ce15780601f10612cb657610100808354040283529160200191612ce1565b820191906000526020600020905b815481529060010190602001808311612cc457829003601f168201915b505050505081565b60006001600160e01b031982166380ac58cd60e01b1480612d1a57506001600160e01b03198216635b5e139f60e01b145b80610c8c5750610c8c82613935565b600081600111158015612d3e57506101915482105b8015610c8c57505060009081526101956020526040902054600160e01b900460ff161590565b6000828152610197602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b61130d81600061395a565b6000612dd78261334d565b9050836001600160a01b031681600001516001600160a01b031614612e0e5760405162a1148160e81b815260040160405180910390fd5b60006001600160a01b0385161580612e2c5750612e2c856000610c16565b80612e4857506000612e3d84610d25565b6001600160a01b0316145b905080612e6857604051632ce44b5f60e11b815260040160405180910390fd5b6001600160a01b038416612e8f57604051633a954ecd60e21b815260040160405180910390fd5b612e9c85858560016139b3565b612ea860008487612d64565b6001600160a01b0385811660009081526101966020908152604080832080546001600160401b03198082166001600160401b039283166000190183161790925589861680865283862080549384169383166001908101841694909417905589865261019590945282852080546001600160e01b031916909417600160a01b42909216919091021783558701808452922080549193909116612f7e57610191548214612f7e57805460208601516001600160401b0316600160a01b026001600160e01b03199091166001600160a01b038a16171781555b50505082846001600160a01b0316866001600160a01b0316600080516020615aa583398151915260405160405180910390a45050505050565b6000612fc38233611f63565b15612fd057506001919050565b81612fdd57506000919050565b610c8c612fe983610fdc565b612fb7565b612ff88282613aa9565b600082815261015f60205260409020610deb9082613b31565b61301b8282613b46565b600082815261015f60205260409020610deb9082613bad565b61303c613bc2565b6065805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa60005b604051613077919061464f565b60405180910390a1565b600061308c8361334d565b805190915082156130f35760006001600160a01b03821615806130b557506130b5826000610c16565b806130d1575060006130c686610d25565b6001600160a01b0316145b9050806130f157604051632ce44b5f60e11b815260040160405180910390fd5b505b6131018160008660016139b3565b61310d60008583612d64565b6001600160a01b038082166000818152610196602090815260408083208054600160801b6000196001600160401b038084169190910181166001600160401b0319841681178390048216600190810183169093026001600160401b03600160801b03600160c01b0319909416179290921783558b8652610195909452828520805460ff60e01b1942909316600160a01b026001600160e01b03199091169097179690961716600160e01b1785559189018084529220805491949091166132085761019154821461320857805460208701516001600160401b0316600160a01b026001600160e01b03199091166001600160a01b038716171781555b5050604051869250600091506001600160a01b03841690600080516020615aa5833981519152908390a45050610192805460010190555050565b6002600154036132945760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610e37565b6002600155565b606060006132a883613c0b565b60010190506000816001600160401b038111156132c7576132c76147ef565b6040519080825280601f01601f1916602001820160405280156132f1576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a85049450846132fb57509392505050565b610fcd828260405180602001604052806000815250613ce1565b60018055565b6133556144ef565b818060011161344457610191548110156134445760008181526101956020908152604091829020825160608101845290546001600160a01b0381168252600160a01b81046001600160401b031692820192909252600160e01b90910460ff161515918101829052906134425780516001600160a01b0316156133d8579392505050565b506000190160008181526101956020908152604091829020825160608101845290546001600160a01b038116808352600160a01b82046001600160401b031693830193909352600160e01b900460ff161515928101929092521561343d579392505050565b6133d8565b505b604051636f96cda160e11b815260040160405180910390fd5b613465613e8e565b6065805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25861306a600090565b6000611f438383613ed4565b60655460ff16806134c957506000818152610257602052604090206007015442105b806134e557506000818152610257602052604090206008015442115b8061350357506000818152610257602052604090206001015460ff16155b1561130d576040516347cc82cd60e01b815260040160405180910390fd5b600086815261025760205260409020600581015461353f87876151d5565b111561355e57604051631f43edc360e11b815260040160405180910390fd5b80541561236f578385118061357b57508361357987876151d5565b115b1561359957604051631f43edc360e11b815260040160405180910390fd5b600061361b84848080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050855460405190925061360091508d908a9060200160609290921b6001600160601b0319168252601482015260340190565b60405160208183030381529060405280519060200120613efe565b5090508061363c5760405163c8ac23c360e01b815260040160405180910390fd5b505050505050505050565b6001600160a01b03163b151590565b600054610100900460ff1661367d5760405162461bcd60e51b8152600401610e37906158d4565b613685613fcc565b565b600054610100900460ff166136ae5760405162461bcd60e51b8152600401610e37906158d4565b6136b6613ff3565b61130d8161401a565b600054610100900460ff166136e65760405162461bcd60e51b8152600401610e37906158d4565b610fcd82826140a9565b610fcd8282612fee565b600061370583610fdc565b600084815261012d6020526040808220600101859055519192508391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b606061375983613647565b6137b45760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b6064820152608401610e37565b600080846001600160a01b0316846040516137cf919061591f565b600060405180830381855af49150503d806000811461380a576040519150601f19603f3d011682016040523d82523d6000602084013e61380f565b606091505b50915091506138378282604051806060016040528060278152602001615a5e60279139614104565b95945050505050565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a0290613875908490899088908890600401615931565b6020604051808303816000875af19250505080156138b0575060408051601f3d908101601f191682019092526138ad91810190615964565b60015b61390e573d8080156138de576040519150601f19603f3d011682016040523d82523d6000602084013e6138e3565b606091505b508051600003613906576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050949350505050565b6000610c8c825490565b60006001600160e01b03198216635a05180f60e01b1480610c8c5750610c8c8261411d565b6139648282611f63565b610fcd5761397181614152565b61397c836020614164565b60405160200161398d929190615981565b60408051601f198184030181529082905262461bcd60e51b8252610e3791600401614623565b6139bc84612bdb565b156139da576040516320cf996960e11b815260040160405180910390fd5b6139e383612bdb565b15613a01576040516320cf996960e11b815260040160405180910390fd5b60005b81811015611a5f576001600160a01b03851615613a2957613a29856104bc83866151d5565b6001600160a01b038516600090815261022c6020526040812081613a4d84876151d5565b815260208082019290925260409081016000908120939093556001600160a01b038716835261022c90915281204291613a8684876151d5565b815260208101919091526040016000205580613aa1816151bc565b915050613a04565b613ab38282611f63565b610fcd57600082815261012d602090815260408083206001600160a01b03851684529091529020805460ff19166001179055613aed600090565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000611f43836001600160a01b0384166142ff565b613b508282611f63565b15610fcd57600082815261012d602090815260408083206001600160a01b0385168085529252808320805460ff191690555184907ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b908490a45050565b6000611f43836001600160a01b03841661434e565b60655460ff166136855760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610e37565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b8310613c4a5772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6904ee2d6d415b85acef8160201b8310613c74576904ee2d6d415b85acef8160201b830492506020015b662386f26fc100008310613c9257662386f26fc10000830492506010015b6305f5e1008310613caa576305f5e100830492506008015b6127108310613cbe57612710830492506004015b60648310613cd0576064830492506002015b600a8310610c8c5760010192915050565b610191546001600160a01b038416613d0b57604051622e076360e81b815260040160405180910390fd5b82600003613d2c5760405163b562e8dd60e01b815260040160405180910390fd5b613d3960008583866139b3565b6001600160a01b03841660008181526101966020908152604080832080546001600160801b031981166001600160401b038083168b018116918217600160401b6001600160401b031990941690921783900481168b0181169092021790915585845261019590925290912080546001600160e01b0319168317600160a01b4290931692909202919091179055819081850190613dd490613647565b15613e4b575b60405182906001600160a01b03881690600090600080516020615aa5833981519152908290a4613e136000878480600101955087613840565b613e30576040516368d2bf6b60e11b815260040160405180910390fd5b808210613dda57826101915414613e4657600080fd5b613e7e565b5b6040516001830192906001600160a01b03881690600090600080516020615aa5833981519152908290a4808210613e4c575b5061019155611718600085838684565b60655460ff16156136855760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610e37565b6000826000018281548110613eeb57613eeb615190565b9060005260206000200154905092915050565b6000808281805b8751811015613fc057613f1960028361545a565b91506000888281518110613f2f57613f2f615190565b60200260200101519050808411613f71576040805160208101869052908101829052606001604051602081830303815290604052805190602001209350613fad565b6040805160208101839052908101859052606001604051602081830303815290604052805190602001209350600183613faa91906151d5565b92505b5080613fb8816151bc565b915050613f05565b50941495939450505050565b600054610100900460ff166133475760405162461bcd60e51b8152600401610e37906158d4565b600054610100900460ff166136855760405162461bcd60e51b8152600401610e37906158d4565b600054610100900460ff166140415760405162461bcd60e51b8152600401610e37906158d4565b60005b8151811015610fcd5760016097600084848151811061406557614065615190565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806140a1816151bc565b915050614044565b600054610100900460ff166140d05760405162461bcd60e51b8152600401610e37906158d4565b81516140e49061019390602085019061450f565b5080516140f99061019490602084019061450f565b506001610191555050565b60608315614113575081611f43565b611f438383614441565b60006001600160e01b03198216637965db0b60e01b1480610c8c57506301ffc9a760e01b6001600160e01b0319831614610c8c565b6060610c8c6001600160a01b03831660145b6060600061417383600261545a565b61417e9060026151d5565b6001600160401b03811115614195576141956147ef565b6040519080825280601f01601f1916602001820160405280156141bf576020820181803683370190505b509050600360fc1b816000815181106141da576141da615190565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061420957614209615190565b60200101906001600160f81b031916908160001a905350600061422d84600261545a565b6142389060016151d5565b90505b60018111156142b0576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061426c5761426c615190565b1a60f81b82828151811061428257614282615190565b60200101906001600160f81b031916908160001a90535060049490941c936142a9816159f0565b905061423b565b508315611f435760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610e37565b600081815260018301602052604081205461434657508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610c8c565b506000610c8c565b60008181526001830160205260408120548015614437576000614372600183615215565b855490915060009061438690600190615215565b90508181146143eb5760008660000182815481106143a6576143a6615190565b90600052602060002001549050808760000184815481106143c9576143c9615190565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806143fc576143fc615a07565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610c8c565b6000915050610c8c565b8151156144515781518083602001fd5b8060405162461bcd60e51b8152600401610e379190614623565b828054614477906150d7565b90600052602060002090601f01602090048101928261449957600085556144df565b82601f106144b25782800160ff198235161785556144df565b828001600101855582156144df579182015b828111156144df5782358255916020019190600101906144c4565b506144eb929150614583565b5090565b604080516060810182526000808252602082018190529181019190915290565b82805461451b906150d7565b90600052602060002090601f01602090048101928261453d57600085556144df565b82601f1061455657805160ff19168380011785556144df565b828001600101855582156144df579182015b828111156144df578251825591602001919060010190614568565b5b808211156144eb5760008155600101614584565b6001600160e01b03198116811461130d57600080fd5b6000602082840312156145c057600080fd5b8135611f4381614598565b60005b838110156145e65781810151838201526020016145ce565b838111156117185750506000910152565b6000815180845261460f8160208601602086016145cb565b601f01601f19169290920160200192915050565b602081526000611f4360208301846145f7565b60006020828403121561464857600080fd5b5035919050565b6001600160a01b0391909116815260200190565b80356001600160a01b038116811461467a57600080fd5b919050565b6000806040838503121561469257600080fd5b61469b83614663565b946020939093013593505050565b6000602082840312156146bb57600080fd5b611f4382614663565b6000806000606084860312156146d957600080fd5b6146e284614663565b92506146f060208501614663565b9150604084013590509250925092565b6000806040838503121561471357600080fd5b8235915061472360208401614663565b90509250929050565b60006020828403121561473e57600080fd5b81356001600160401b0381111561475457600080fd5b820160208185031215611f4357600080fd5b60008083601f84011261477857600080fd5b5081356001600160401b0381111561478f57600080fd5b6020830191508360208285010111156147a757600080fd5b9250929050565b600080602083850312156147c157600080fd5b82356001600160401b038111156147d757600080fd5b6147e385828601614766565b90969095509350505050565b634e487b7160e01b600052604160045260246000fd5b60405160c081016001600160401b0381118282101715614827576148276147ef565b60405290565b604051601f8201601f191681016001600160401b0381118282101715614855576148556147ef565b604052919050565b60006001600160401b03821115614876576148766147ef565b5060051b60200190565b6000602080838503121561489357600080fd5b82356001600160401b038111156148a957600080fd5b8301601f810185136148ba57600080fd5b80356148cd6148c88261485d565b61482d565b81815260059190911b820183019083810190878311156148ec57600080fd5b928401925b8284101561490a578335825292840192908401906148f1565b979650505050505050565b80516001600160a01b031682526020808201516001600160401b0316908301526040908101511515910152565b6020808252825182820181905260009190848201906040850190845b81811015611e1857614971838551614915565b928401926060929092019160010161495e565b6020815281516020820152600060208301516149a4604084018215159052565b5060408301516101208060608501526149c16101408501836145f7565b91506060850151601f198584030160808601526149de83826145f7565b925050608085015160a085015260a085015160c085015260c085015160e085015260e0850151610100818187015280870151838701525050508091505092915050565b60006101208284031215614a3457600080fd5b50919050565b60008060408385031215614a4d57600080fd5b82356001600160401b03811115614a6357600080fd5b614a6f85828601614a21565b95602094909401359450505050565b60008083601f840112614a9057600080fd5b5081356001600160401b03811115614aa757600080fd5b6020830191508360208260051b85010111156147a757600080fd5b60008060008060408587031215614ad857600080fd5b84356001600160401b0380821115614aef57600080fd5b614afb88838901614a7e565b90965094506020870135915080821115614b1457600080fd5b50614b2187828801614a7e565b95989497509550505050565b60006101008451151583526020850151602084015260408501516040840152606085015160608401526080850151608084015260a085015160a084015260c085015160c08401528060e0840152835160208285015261124e6101208501826145f7565b600060208284031215614ba257600080fd5b81356001600160401b03811115614bb857600080fd5b82016101008185031215611f4357600080fd5b6020808252825182820181905260009190848201906040850190845b81811015611e1857835183529284019291840191600101614be7565b600060208284031215614c1557600080fd5b81356001600160401b03811115614c2b57600080fd5b612c5284828501614a21565b600080600060408486031215614c4c57600080fd5b83356001600160401b03811115614c6257600080fd5b614c6e86828701614766565b9094509250614c81905060208501614663565b90509250925092565b60008060408385031215614c9d57600080fd5b50508035926020909101359150565b6000806000806000806000806080898b031215614cc857600080fd5b88356001600160401b0380821115614cdf57600080fd5b614ceb8c838d01614a7e565b909a50985060208b0135915080821115614d0457600080fd5b614d108c838d01614a7e565b909850965060408b0135915080821115614d2957600080fd5b614d358c838d01614a7e565b909650945060608b0135915080821115614d4e57600080fd5b50614d5b8b828c01614a7e565b999c989b5096995094979396929594505050565b600080600060608486031215614d8457600080fd5b614d8d84614663565b95602085013595506040909401359392505050565b600082601f830112614db357600080fd5b81356001600160401b03811115614dcc57614dcc6147ef565b614ddf601f8201601f191660200161482d565b818152846020838601011115614df457600080fd5b816020850160208301376000918101602001919091529392505050565b600082601f830112614e2257600080fd5b81356020614e326148c88361485d565b82815260059290921b84018101918181019086841115614e5157600080fd5b8286015b84811015614e7357614e6681614663565b8352918301918301614e55565b509695505050505050565b600080600080600080600060e0888a031215614e9957600080fd5b614ea288614663565b965060208801356001600160401b0380821115614ebe57600080fd5b614eca8b838c01614da2565b975060408a0135915080821115614ee057600080fd5b614eec8b838c01614da2565b965060608a0135915080821115614f0257600080fd5b614f0e8b838c01614da2565b955060808a0135915080821115614f2457600080fd5b50614f318a828b01614e11565b935050614f4060a08901614663565b9150614f4e60c08901614663565b905092959891949750929550565b801515811461130d57600080fd5b60008060408385031215614f7d57600080fd5b614f8683614663565b91506020830135614f9681614f5c565b809150509250929050565b60008060208385031215614fb457600080fd5b82356001600160401b03811115614fca57600080fd5b6147e385828601614a7e565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b8281101561502b57603f198886030184526150198583516145f7565b94509285019290850190600101614ffd565b5092979650505050505050565b6000806000806080858703121561504e57600080fd5b61505785614663565b935061506560208601614663565b92506040850135915060608501356001600160401b0381111561508757600080fd5b61509387828801614da2565b91505092959194509250565b60608101610c8c8284614915565b600080604083850312156150c057600080fd5b6150c983614663565b915061472360208401614663565b600181811c908216806150eb57607f821691505b602082108103614a3457634e487b7160e01b600052602260045260246000fd5b6000602080838503121561511e57600080fd5b82516001600160401b0381111561513457600080fd5b8301601f8101851361514557600080fd5b80516151536148c88261485d565b81815260059190911b8201830190838101908783111561517257600080fd5b928401925b8284101561490a57835182529284019290840190615177565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016151ce576151ce6151a6565b5060010190565b600082198211156151e8576151e86151a6565b500190565b6020808252600e908201526d139bdd08185d5d1a1bdc9a5e995960921b604082015260600190565b600082821015615227576152276151a6565b500390565b60008261524957634e487b7160e01b600052601260045260246000fd5b500490565b6000808335601e1984360301811261526557600080fd5b8301803591506001600160401b0382111561527f57600080fd5b6020019150600581901b36038213156147a757600080fd5b6000823560be198336030181126152ad57600080fd5b9190910192915050565b600060c082360312156152c957600080fd5b6152d1614805565b82356001600160401b03808211156152e857600080fd5b6152f436838701614da2565b83526020850135602084015260408501356040840152606085013560608401526080850135608084015260a085013591508082111561533257600080fd5b5061533f36828601614da2565b60a08301525092915050565b60018060a01b0383168152604060208201526000825160c060408401526153766101008401826145f7565b90506020840151606084015260408401516080840152606084015160a0840152608084015160c084015260a0840151603f198483030160e085015261124e82826145f7565b6000808335601e198436030181126153d257600080fd5b8301803591506001600160401b038211156153ec57600080fd5b6020019150368190038213156147a757600080fd5b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60608152600061543e606083018688615401565b6001600160a01b03949094166020830152506040015292915050565b6000816000190483118215151615615474576154746151a6565b500290565b60208082526014908201527322bc31b2b2b232b21036b0bc1039bab838363c9760611b604082015260600190565b600083516154b98184602088016145cb565b8351908301906154cd8183602088016145cb565b600b60fa1b9101908152600101949350505050565b60008135610c8c81614f5c565b60ff1981541660ff8315151681178255505050565b601f821115610deb57600081815260208120601f850160051c8101602086101561552b5750805b601f850160051c820191505b81811015611b3057828155600101615537565b600019600383901b1c191660019190911b1790565b6001600160401b03831115615576576155766147ef565b61558a8361558483546150d7565b83615504565b6000601f8411600181146155b857600085156155a65750838201355b6155b0868261554a565b845550611a5f565b600083815260209020601f19861690835b828110156155e957868501358255602094850194600190920191016155c9565b50868210156156065760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b8135815561563461562b602084016154e2565b600183016154ef565b61564160408301836153bb565b61564f81836002860161555f565b505061565e60608301836153bb565b61566c81836003860161555f565b50506080820135600482015560a0820135600582015560c0820135600682015560e0820135600782015561010082013560088201555050565b6156af82836153bb565b6001600160401b038111156156c6576156c66147ef565b6156da816156d485546150d7565b85615504565b6000601f82116001811461570857600083156156f65750838201355b615700848261554a565b865550611b30565b600085815260209020601f19841690835b828110156157395786850135825560209485019460019092019101615719565b50848210156157565760001960f88660031b161c19848701351681555b50505050600190811b019091555050565b813561577281614f5c565b61577c81836154ef565b506020820135600182015560408201356002820155606082013560038201556080820135600482015560a0820135600582015560c0820135600682015560e0820135601e198336030181126157d057600080fd5b610deb818401600784016156a5565b6040815260006157f3604083018587615401565b905060018060a01b0383166020830152949350505050565b60006020828403121561581d57600080fd5b5051919050565b6000808454615832816150d7565b6001828116801561584a576001811461585b5761588a565b60ff1984168752828701945061588a565b8860005260208060002060005b858110156158815781548a820152908401908201615868565b50505082870194505b50505050835161589e8183602088016145cb565b64173539b7b760d91b9101908152600501949350505050565b6000602082840312156158c957600080fd5b8151611f4381614f5c565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b600082516152ad8184602087016145cb565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061124e908301846145f7565b60006020828403121561597657600080fd5b8151611f4381614598565b76020b1b1b2b9b9a1b7b73a3937b61d1030b1b1b7bab73a1604d1b8152600083516159b38160178501602088016145cb565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516159e48160288401602088016145cb565b01602801949350505050565b6000816159ff576159ff6151a6565b506000190190565b634e487b7160e01b600052603160045260246000fdfe0c1b180fbb60448c5491c5ddc7c3a923854214b9ff70f90a7821333338971f928eb467f061ca67f42a2d2ca4a346fc9fb645efc0ba75056ee9f71c3a0ccc10a8416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c65649f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef2ce8d04a9c35987429af538825cd2438cc5c5bb5dc427955f84daaa3ea105016a164736f6c634300080d000a
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 26 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.