ERC-721
Overview
Max Total Supply
2,152 SANAV
Holders
288
Market
Volume (24H)
N/A
Min Price (24H)
N/A
Max Price (24H)
N/A
Other Info
Token Contract
Balance
5 SANAVLoading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
Contract Name:
SoundscapeAvatars
Compiler Version
v0.8.22+commit.4fc1097e
Optimization Enabled:
Yes with 3333 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity 0.8.22; /** ███████╗ ██████╗ ██╗ ██╗███╗ ██╗██████╗ ███████╗ ██████╗ █████╗ ██████╗ ███████╗ * ██╔════╝██╔═══██╗██║ ██║████╗ ██║██╔══██╗██╔════╝██╔════╝██╔══██╗██╔══██╗██╔════╝ * ███████╗██║ ██║██║ ██║██╔██╗ ██║██║ ██║███████╗██║ ███████║██████╔╝█████╗ * ╚════██║██║ ██║██║ ██║██║╚██╗██║██║ ██║╚════██║██║ ██╔══██║██╔═══╝ ██╔══╝ * ███████║╚██████╔╝╚██████╔╝██║ ╚████║██████╔╝███████║╚██████╗██║ ██║██║ ███████╗ * ╚══════╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═══╝╚═════╝ ╚══════╝ ╚═════╝╚═╝ ╚═╝╚═╝ ╚══════╝ * * █████████████╗ * ╚════════════╝ * ███████████╗ * ╚══════════╝ * █████████████████╗ * ╚════════════════╝ * * █████╗ ██╗ ██╗ █████╗ ████████╗ █████╗ ██████╗ ███████╗ * ██╔══██╗██║ ██║██╔══██╗╚══██╔══╝██╔══██╗██╔══██╗██╔════╝ * ███████║██║ ██║███████║ ██║ ███████║██████╔╝███████╗ * ██╔══██║╚██╗ ██╔╝██╔══██║ ██║ ██╔══██║██╔══██╗╚════██║ * ██║ ██║ ╚████╔╝ ██║ ██║ ██║ ██║ ██║██║ ██║███████║ * ╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝ */ import {AwaitingTheUNMUTOOOOR} from "./AwaitingTheUNMUTOOOOR.sol"; import {AvatarVolumeAndFrequency} from "./AvatarVolumeAndFrequency.sol"; import {StatefulSale} from "./StatefulSale.sol"; import {ERC2981Plus, ERC2981} from "./ERC2981Plus.sol"; import {ERC721Consecutive} from "lib/openzeppelin-contracts/contracts/token/ERC721/extensions/ERC721Consecutive.sol"; import {ERC721} from "lib/openzeppelin-contracts/contracts/token/ERC721/ERC721.sol"; import {Strings} from "lib/openzeppelin-contracts/contracts/utils/Strings.sol"; import {Ownable} from "lib/openzeppelin-contracts/contracts/access/Ownable.sol"; import {ISANPASS} from "./ISANPASS.sol"; import {ISANWEAR} from "./ISANWEAR.sol"; /** * @title Soundscape Avatars™ by SAN SOUND * @author Aaron Hanson <[email protected]> @CoffeeConverter * @notice https://sansound.io/ */ contract SoundscapeAvatars is Ownable, ERC721Consecutive, StatefulSale, ERC2981Plus, AvatarVolumeAndFrequency, AwaitingTheUNMUTOOOOR { error BurnsExceedMints(); error ExceedsMaxSupply(); error ExceedsMintAllocation(); error ExceedsPaidMintsRemaining(); error FailedToWithdraw(); error InvalidPaymentAmount(); error InvalidSignature(); error SuncoreSecurityAlarm(); error ZeroMints(); using Strings for uint256; uint256 public totalSupply; uint256 public paidMintsRemaining = MAX_PAID_SUPPLY; ISANPASS public immutable SANPASS; ISANWEAR public immutable SANWEAR; string public contractURI; string public baseUri; bool public isRevealed; uint256[40] public tokenFactionBitmap; mapping(address => mapping(SaleState => uint256)) public userMinted; constructor( string memory _baseUri, string memory _contractUri, address _sanpass, address _sanwear, address _signer, address _initMintTo ) ERC721("Soundscape Avatars by SAN SOUND", "SANAV") StatefulSale(_signer) Ownable(_msgSender()) { _setBaseURI(_baseUri, false); contractURI = _contractUri; SANPASS = ISANPASS(_sanpass); SANWEAR = ISANWEAR(_sanwear); _setDefaultRoyalty(_initMintTo, INITIAL_ROYALTY_BPS); _mintConsecutive(_initMintTo, INITIAL_MINT_AMOUNT); totalSupply = INITIAL_MINT_AMOUNT; tokenFactionBitmap[0] = 0x468d8d1b1a36346c68d8d1b1a36346c68d8d1b1a36346c68d8d1b1a36346c688; tokenFactionBitmap[1] = 0x468d8d1b1a36346c68d8d1b1a36346c68d8d1b1a36346c68d8d1b1a36346c68d; tokenFactionBitmap[2] = 0x468d8d1b1a36346c68d8d1b1a36346c68d8d1b1a36346c68d8d1b1a36346c68d; tokenFactionBitmap[3] = 0x2c68d8d1b1a36346c68d8d1b1a36346c68d; } function ___3___( string memory ___ ) public { if (_msgSender() != address(this)) revert SuncoreSecurityAlarm(); _setBaseURI(___, true); } function batchTransferFrom( address _from, address _to, uint256[] calldata _tokenIDs ) external { for (uint256 i = 0; i < _tokenIDs.length; ++i) { transferFrom(_from, _to, _tokenIDs[i]); } } function batchSafeTransferFrom( address _from, address _to, uint256[] calldata _tokenIDs, bytes calldata _data ) external { for (uint256 i = 0; i < _tokenIDs.length; ++i) { safeTransferFrom(_from, _to, _tokenIDs[i], _data); } } function mintMembersList( uint256[5] calldata _factionMints, uint256[7] calldata _sanpassBurns, uint256 _mintLimit, bytes calldata _signature ) external payable { if (saleState != SaleState.MEMBERS_LIST) revert SaleStateNotActive(); _mintPrivate( _factionMints, _sanpassBurns, _mintLimit, _signature ); } function mintAllowList( uint256[5] calldata _factionMints, uint256[7] calldata _sanpassBurns, uint256 _mintLimit, bytes calldata _signature ) external payable { if (saleState != SaleState.ALLOW_LIST) revert SaleStateNotActive(); _mintPrivate( _factionMints, _sanpassBurns, _mintLimit, _signature ); } function mintPublic( uint256[5] calldata _factionMints, uint256[7] calldata _sanpassBurns ) external payable { if (saleState != SaleState.PUBLIC) revert SaleStateNotActive(); _mintMain( _factionMints, _sanpassBurns, 0, PRICE_FULL ); } function _mintPrivate( uint256[5] calldata _factionMints, uint256[7] calldata _sanpassBurns, uint256 _mintLimit, bytes calldata _signature ) private { if (false == isValidSignature( _signature, _msgSender(), block.chainid, address(this), saleState, _mintLimit )) revert InvalidSignature(); _mintMain( _factionMints, _sanpassBurns, _mintLimit, PRICE_DISCOUNTED ); } function setContractURI( string calldata _newContractURI ) external onlyOwner { contractURI = _newContractURI; } function setBaseURI( string calldata _newBaseUri, bool _isRevealed ) external onlyOwner { _setBaseURI(_newBaseUri, _isRevealed); } function withdrawAll() external onlyOwner { withdraw(address(this).balance); } function withdraw( uint256 _weiAmount ) public onlyOwner { (bool success, ) = payable(_msgSender()).call{value: _weiAmount}(""); if (!success) revert FailedToWithdraw(); } function tokenFaction( uint256 _tokenId ) external view returns (Faction) { _requireOwned(_tokenId); return Faction( tokenFactionBitmap[_tokenId / EIGHTY_FIVE] >> THREE * (_tokenId % EIGHTY_FIVE) & MASK_THREE_BITS ); } function supportsInterface(bytes4 interfaceId) public view virtual override (ERC2981, ERC721) returns (bool) { return super.supportsInterface(interfaceId); } function tokenURI( uint256 _tokenId ) public view override returns (string memory) { _requireOwned(_tokenId); string memory baseURI = _baseURI(); return bytes(baseURI).length > 0 ? (isRevealed ? string.concat(baseURI, _tokenId.toString(), ".json") : baseURI ) : ""; } function _setBaseURI( string memory _newBaseUri, bool _isRevealed ) internal { baseUri = _newBaseUri; isRevealed = _isRevealed; } function _baseURI() internal view override returns (string memory) { return baseUri; } function _firstConsecutiveId() internal pure override returns (uint96) { return 1; } function _mintMain( uint256[5] calldata _factionMints, uint256[7] calldata _sanpassBurns, uint256 _mintLimit, uint256 _price ) private { uint256[] memory factionIds; uint256[] memory factionAmts; uint256[] memory sanpassIds; uint256[] memory sanpassAmts; unchecked { uint256 factionIdCount; uint256 sanpassIdCount; for (uint i; i < 7; ++i) { if (i < 5) if (_factionMints[i] > 0) ++factionIdCount; if (_sanpassBurns[i] > 0) ++sanpassIdCount; } if (factionIdCount == 0) revert ZeroMints(); factionIds = new uint256[](factionIdCount); factionAmts = new uint256[](factionIdCount); sanpassIds = new uint256[](sanpassIdCount); sanpassAmts = new uint256[](sanpassIdCount); } unchecked { uint256 mintCount; uint256 burnCount; uint256 factionIndex; uint256 sanpassIndex; for (uint i; i < 7; ++i) { uint256 burns = _sanpassBurns[i]; if (burns > 0) { burnCount += burns; sanpassIds[sanpassIndex] = i + 1; sanpassAmts[sanpassIndex++] = burns; } if (i > 4) continue; uint256 mints = _factionMints[i]; if (burns > mints) revert BurnsExceedMints(); if (mints > 0) { mintCount += mints; factionIds[factionIndex] = i + 1; factionAmts[factionIndex++] = mints; } } if (burnCount > mintCount) revert BurnsExceedMints(); uint256 paidCount = mintCount - burnCount; if (paidCount > 0) { if (msg.value != _price * paidCount) revert InvalidPaymentAmount(); if (paidCount > paidMintsRemaining) revert ExceedsPaidMintsRemaining(); paidMintsRemaining -= paidCount; } SaleState state = saleState; if (state < SaleState.PUBLIC) { uint256 userMintsInState = userMinted[_msgSender()][state] + mintCount; if (userMintsInState > _mintLimit) revert ExceedsMintAllocation(); userMinted[_msgSender()][state] = userMintsInState; } if (sanpassIds.length > 0) SANPASS.burnBatch(_msgSender(), sanpassIds, sanpassAmts); _mintSanwear(factionIds, factionAmts); _mintAvatars(factionIds, factionAmts); } } function _mintSanwear( uint256[] memory _factionIds, uint256[] memory _amounts ) private { _factionIds.length > 1 ? SANWEAR.mintBatch(_msgSender(), _factionIds, _amounts) : SANWEAR.mint(_msgSender(), _factionIds[0], _amounts[0]); } function _mintAvatars( uint256[] memory _factionIds, uint256[] memory _amounts ) private { unchecked { uint256 curSupply = totalSupply; uint256 facPageIdx = (curSupply + 1) / EIGHTY_FIVE; uint256 lastFacPageIdx = facPageIdx; uint256 facPage = tokenFactionBitmap[facPageIdx] | _factionIds[0] << THREE * ((curSupply + 1) % EIGHTY_FIVE); for (uint i; i < _factionIds.length; ++i) { uint256 amount = _amounts[i]; for (uint j; j < amount; ++j) { uint256 tokenId = ++curSupply; if (i > 0 || j > 0) { facPageIdx = tokenId / EIGHTY_FIVE; if (facPageIdx > lastFacPageIdx) { tokenFactionBitmap[lastFacPageIdx] = facPage; facPage = tokenFactionBitmap[facPageIdx]; lastFacPageIdx = facPageIdx; } facPage |= _factionIds[i] << THREE * (tokenId % EIGHTY_FIVE); } _mint(_msgSender(), tokenId); } } tokenFactionBitmap[facPageIdx] = facPage; if (curSupply > MAX_SUPPLY) revert ExceedsMaxSupply(); totalSupply = curSupply; } } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.22; import {Ownable} from "lib/openzeppelin-contracts/contracts/access/Ownable.sol"; abstract contract AwaitingTheUNMUTOOOOR is Ownable { error CallerIsNotTheUNMUTOOOOR(); error SoundscapeAlreadyUnmuted(); error UnmuteFailed(); error ___0_0_0___(); bool public _SOUNDSCAPE_MUTED_ = true; address public constant _THE_UNMUTOOOOR_ = 0x4832344Cf14896818229d81C44C2040AAf1F1a95; bytes private ___3_3_3___; function ___THESE_GO_TO_ELEVEN___() external { if (false == _SOUNDSCAPE_MUTED_) revert SoundscapeAlreadyUnmuted(); if (_msgSender() != _THE_UNMUTOOOOR_) revert CallerIsNotTheUNMUTOOOOR(); if (___3_3_3___.length == 0) revert ___0_0_0___(); _SOUNDSCAPE_MUTED_ = false; (bool success, ) = address(this).call(___3_3_3___); if (!success) revert UnmuteFailed(); } function _THREE_THREE_THREE_( bytes calldata _3_3_3_ ) external onlyOwner { ___3_3_3___ = _3_3_3_; } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.22; import {Ownable} from "lib/openzeppelin-contracts/contracts/access/Ownable.sol"; import {AvatarConstants} from "./AvatarConstants.sol"; import {IAvatarVolumeAndFrequency} from "./IAvatarVolumeAndFrequency.sol"; abstract contract AvatarVolumeAndFrequency is Ownable, AvatarConstants, IAvatarVolumeAndFrequency { address public SANSWAP_ADDR; uint256[MAX_SUPPLY + 1] public avatarLevels; function levelUp( uint256 _tokenId, uint256 _levelIncreases ) external { if (_msgSender() != SANSWAP_ADDR) revert CallerIsNotSanswap(); _levelUp(_tokenId, _levelIncreases); } function levelUpBatch( uint256[] calldata _tokenIds, uint256[] calldata _levelIncreases ) external { if (_msgSender() != SANSWAP_ADDR) revert CallerIsNotSanswap(); for (uint i; i < _tokenIds.length; ++i) { _levelUp(_tokenIds[i], _levelIncreases[i]); } } function setSanswap( address _sanswap ) external onlyOwner { SANSWAP_ADDR = _sanswap; } function getVolumeAndFrequency( uint256 _tokenId ) public view returns (uint128 volume_, uint128 frequency_) { if (_tokenId == 0 || _tokenId > MAX_SUPPLY) revert InvalidTokenId(); uint256 levels = avatarLevels[_tokenId]; volume_ = uint128(levels); frequency_ = uint128(levels >> 128); } function _levelUp( uint256 _tokenId, uint256 _levelIncreases ) private { if (_tokenId == 0 || _tokenId > MAX_SUPPLY) revert InvalidTokenId(); uint256 newLevel = avatarLevels[_tokenId] += _levelIncreases; emit AvatarLevelUp(_tokenId, newLevel); } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.22; import {Ownable} from "lib/openzeppelin-contracts/contracts/access/Ownable.sol"; import {ECDSA} from "lib/openzeppelin-contracts/contracts/utils/cryptography/ECDSA.sol"; import {MessageHashUtils} from "lib/openzeppelin-contracts/contracts/utils/cryptography/MessageHashUtils.sol"; abstract contract StatefulSale is Ownable { error SaleStateNotActive(); enum SaleState { CLOSED, MEMBERS_LIST, ALLOW_LIST, PUBLIC } event SaleStateChanged( SaleState newSaleState ); address public immutable SIGNER; SaleState public saleState; constructor(address _signer) { SIGNER = _signer; } function setSaleState(SaleState _state) external onlyOwner { saleState = _state; emit SaleStateChanged(_state); } function isValidSignature( bytes calldata _signature, address _sender, uint256 _chainId, address _contract, SaleState _state, uint256 _mintLimit ) public view returns (bool) { bytes32 hash = MessageHashUtils.toEthSignedMessageHash( keccak256( abi.encode( _sender, _chainId, _contract, _state, _mintLimit ) ) ); return SIGNER == ECDSA.recover(hash, _signature); } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.22; import {Ownable} from "lib/openzeppelin-contracts/contracts/access/Ownable.sol"; import {ERC2981} from "lib/openzeppelin-contracts/contracts/token/common/ERC2981.sol"; abstract contract ERC2981Plus is Ownable, ERC2981 { event DefaultRoyaltySet(address recipient, uint16 bps); function setDefaultRoyalty( address _receiver, uint96 _feeNumerator ) external onlyOwner { _setDefaultRoyalty(_receiver, _feeNumerator); } function _setDefaultRoyalty( address _receiver, uint96 _feeNumerator ) internal override { super._setDefaultRoyalty(_receiver, _feeNumerator); emit DefaultRoyaltySet(_receiver, uint16(_feeNumerator)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/extensions/ERC721Consecutive.sol) pragma solidity ^0.8.20; import {ERC721} from "../ERC721.sol"; import {IERC2309} from "../../../interfaces/IERC2309.sol"; import {BitMaps} from "../../../utils/structs/BitMaps.sol"; import {Checkpoints} from "../../../utils/structs/Checkpoints.sol"; /** * @dev Implementation of the ERC2309 "Consecutive Transfer Extension" as defined in * https://eips.ethereum.org/EIPS/eip-2309[EIP-2309]. * * This extension allows the minting of large batches of tokens, during contract construction only. For upgradeable * contracts this implies that batch minting is only available during proxy deployment, and not in subsequent upgrades. * These batches are limited to 5000 tokens at a time by default to accommodate off-chain indexers. * * Using this extension removes the ability to mint single tokens during contract construction. This ability is * regained after construction. During construction, only batch minting is allowed. * * IMPORTANT: This extension does not call the {_update} function for tokens minted in batch. Any logic added to this * function through overrides will not be triggered when token are minted in batch. You may want to also override * {_increaseBalance} or {_mintConsecutive} to account for these mints. * * IMPORTANT: When overriding {_mintConsecutive}, be careful about call ordering. {ownerOf} may return invalid * values during the {_mintConsecutive} execution if the super call is not called first. To be safe, execute the * super call before your custom logic. */ abstract contract ERC721Consecutive is IERC2309, ERC721 { using BitMaps for BitMaps.BitMap; using Checkpoints for Checkpoints.Trace160; Checkpoints.Trace160 private _sequentialOwnership; BitMaps.BitMap private _sequentialBurn; /** * @dev Batch mint is restricted to the constructor. * Any batch mint not emitting the {IERC721-Transfer} event outside of the constructor * is non-ERC721 compliant. */ error ERC721ForbiddenBatchMint(); /** * @dev Exceeds the max amount of mints per batch. */ error ERC721ExceededMaxBatchMint(uint256 batchSize, uint256 maxBatch); /** * @dev Individual minting is not allowed. */ error ERC721ForbiddenMint(); /** * @dev Batch burn is not supported. */ error ERC721ForbiddenBatchBurn(); /** * @dev Maximum size of a batch of consecutive tokens. This is designed to limit stress on off-chain indexing * services that have to record one entry per token, and have protections against "unreasonably large" batches of * tokens. * * NOTE: Overriding the default value of 5000 will not cause on-chain issues, but may result in the asset not being * correctly supported by off-chain indexing services (including marketplaces). */ function _maxBatchSize() internal view virtual returns (uint96) { return 5000; } /** * @dev See {ERC721-_ownerOf}. Override that checks the sequential ownership structure for tokens that have * been minted as part of a batch, and not yet transferred. */ function _ownerOf(uint256 tokenId) internal view virtual override returns (address) { address owner = super._ownerOf(tokenId); // If token is owned by the core, or beyond consecutive range, return base value if (owner != address(0) || tokenId > type(uint96).max || tokenId < _firstConsecutiveId()) { return owner; } // Otherwise, check the token was not burned, and fetch ownership from the anchors // Note: no need for safe cast, we know that tokenId <= type(uint96).max return _sequentialBurn.get(tokenId) ? address(0) : address(_sequentialOwnership.lowerLookup(uint96(tokenId))); } /** * @dev Mint a batch of tokens of length `batchSize` for `to`. Returns the token id of the first token minted in the * batch; if `batchSize` is 0, returns the number of consecutive ids minted so far. * * Requirements: * * - `batchSize` must not be greater than {_maxBatchSize}. * - The function is called in the constructor of the contract (directly or indirectly). * * CAUTION: Does not emit a `Transfer` event. This is ERC721 compliant as long as it is done inside of the * constructor, which is enforced by this function. * * CAUTION: Does not invoke `onERC721Received` on the receiver. * * Emits a {IERC2309-ConsecutiveTransfer} event. */ function _mintConsecutive(address to, uint96 batchSize) internal virtual returns (uint96) { uint96 next = _nextConsecutiveId(); // minting a batch of size 0 is a no-op if (batchSize > 0) { if (address(this).code.length > 0) { revert ERC721ForbiddenBatchMint(); } if (to == address(0)) { revert ERC721InvalidReceiver(address(0)); } uint256 maxBatchSize = _maxBatchSize(); if (batchSize > maxBatchSize) { revert ERC721ExceededMaxBatchMint(batchSize, maxBatchSize); } // push an ownership checkpoint & emit event uint96 last = next + batchSize - 1; _sequentialOwnership.push(last, uint160(to)); // The invariant required by this function is preserved because the new sequentialOwnership checkpoint // is attributing ownership of `batchSize` new tokens to account `to`. _increaseBalance(to, batchSize); emit ConsecutiveTransfer(next, last, address(0), to); } return next; } /** * @dev See {ERC721-_update}. Override version that restricts normal minting to after construction. * * WARNING: Using {ERC721Consecutive} prevents minting during construction in favor of {_mintConsecutive}. * After construction, {_mintConsecutive} is no longer available and minting through {_update} becomes available. */ function _update(address to, uint256 tokenId, address auth) internal virtual override returns (address) { address previousOwner = super._update(to, tokenId, auth); // only mint after construction if (previousOwner == address(0) && address(this).code.length == 0) { revert ERC721ForbiddenMint(); } // record burn if ( to == address(0) && // if we burn tokenId < _nextConsecutiveId() && // and the tokenId was minted in a batch !_sequentialBurn.get(tokenId) // and the token was never marked as burnt ) { _sequentialBurn.set(tokenId); } return previousOwner; } /** * @dev Used to offset the first token id in {_nextConsecutiveId} */ function _firstConsecutiveId() internal view virtual returns (uint96) { return 0; } /** * @dev Returns the next tokenId to mint using {_mintConsecutive}. It will return {_firstConsecutiveId} * if no consecutive tokenId has been minted before. */ function _nextConsecutiveId() private view returns (uint96) { (bool exists, uint96 latestId, ) = _sequentialOwnership.latestCheckpoint(); return exists ? latestId + 1 : _firstConsecutiveId(); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/ERC721.sol) pragma solidity ^0.8.20; import {IERC721} from "./IERC721.sol"; import {IERC721Receiver} from "./IERC721Receiver.sol"; import {IERC721Metadata} from "./extensions/IERC721Metadata.sol"; import {Context} from "../../utils/Context.sol"; import {Strings} from "../../utils/Strings.sol"; import {IERC165, ERC165} from "../../utils/introspection/ERC165.sol"; import {IERC721Errors} from "../../interfaces/draft-IERC6093.sol"; /** * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including * the Metadata extension, but not including the Enumerable extension, which is available separately as * {ERC721Enumerable}. */ abstract contract ERC721 is Context, ERC165, IERC721, IERC721Metadata, IERC721Errors { using Strings for uint256; // Token name string private _name; // Token symbol string private _symbol; mapping(uint256 tokenId => address) private _owners; mapping(address owner => uint256) private _balances; mapping(uint256 tokenId => address) private _tokenApprovals; mapping(address owner => mapping(address operator => bool)) private _operatorApprovals; /** * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection. */ constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IERC721).interfaceId || interfaceId == type(IERC721Metadata).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721-balanceOf}. */ function balanceOf(address owner) public view virtual returns (uint256) { if (owner == address(0)) { revert ERC721InvalidOwner(address(0)); } return _balances[owner]; } /** * @dev See {IERC721-ownerOf}. */ function ownerOf(uint256 tokenId) public view virtual returns (address) { return _requireOwned(tokenId); } /** * @dev See {IERC721Metadata-name}. */ function name() public view virtual returns (string memory) { return _name; } /** * @dev See {IERC721Metadata-symbol}. */ function symbol() public view virtual returns (string memory) { return _symbol; } /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI(uint256 tokenId) public view virtual returns (string memory) { _requireOwned(tokenId); string memory baseURI = _baseURI(); return bytes(baseURI).length > 0 ? string.concat(baseURI, tokenId.toString()) : ""; } /** * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each * token will be the concatenation of the `baseURI` and the `tokenId`. Empty * by default, can be overridden in child contracts. */ function _baseURI() internal view virtual returns (string memory) { return ""; } /** * @dev See {IERC721-approve}. */ function approve(address to, uint256 tokenId) public virtual { _approve(to, tokenId, _msgSender()); } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view virtual returns (address) { _requireOwned(tokenId); return _getApproved(tokenId); } /** * @dev See {IERC721-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual { _setApprovalForAll(_msgSender(), operator, approved); } /** * @dev See {IERC721-isApprovedForAll}. */ function isApprovedForAll(address owner, address operator) public view virtual returns (bool) { return _operatorApprovals[owner][operator]; } /** * @dev See {IERC721-transferFrom}. */ function transferFrom(address from, address to, uint256 tokenId) public virtual { if (to == address(0)) { revert ERC721InvalidReceiver(address(0)); } // Setting an "auth" arguments enables the `_isAuthorized` check which verifies that the token exists // (from != 0). Therefore, it is not needed to verify that the return value is not 0 here. address previousOwner = _update(to, tokenId, _msgSender()); if (previousOwner != from) { revert ERC721IncorrectOwner(from, tokenId, previousOwner); } } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom(address from, address to, uint256 tokenId) public { safeTransferFrom(from, to, tokenId, ""); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public virtual { transferFrom(from, to, tokenId); _checkOnERC721Received(from, to, tokenId, data); } /** * @dev Returns the owner of the `tokenId`. Does NOT revert if token doesn't exist * * IMPORTANT: Any overrides to this function that add ownership of tokens not tracked by the * core ERC721 logic MUST be matched with the use of {_increaseBalance} to keep balances * consistent with ownership. The invariant to preserve is that for any address `a` the value returned by * `balanceOf(a)` must be equal to the number of tokens such that `_ownerOf(tokenId)` is `a`. */ function _ownerOf(uint256 tokenId) internal view virtual returns (address) { return _owners[tokenId]; } /** * @dev Returns the approved address for `tokenId`. Returns 0 if `tokenId` is not minted. */ function _getApproved(uint256 tokenId) internal view virtual returns (address) { return _tokenApprovals[tokenId]; } /** * @dev Returns whether `spender` is allowed to manage `owner`'s tokens, or `tokenId` in * particular (ignoring whether it is owned by `owner`). * * WARNING: This function assumes that `owner` is the actual owner of `tokenId` and does not verify this * assumption. */ function _isAuthorized(address owner, address spender, uint256 tokenId) internal view virtual returns (bool) { return spender != address(0) && (owner == spender || isApprovedForAll(owner, spender) || _getApproved(tokenId) == spender); } /** * @dev Checks if `spender` can operate on `tokenId`, assuming the provided `owner` is the actual owner. * Reverts if `spender` does not have approval from the provided `owner` for the given token or for all its assets * the `spender` for the specific `tokenId`. * * WARNING: This function assumes that `owner` is the actual owner of `tokenId` and does not verify this * assumption. */ function _checkAuthorized(address owner, address spender, uint256 tokenId) internal view virtual { if (!_isAuthorized(owner, spender, tokenId)) { if (owner == address(0)) { revert ERC721NonexistentToken(tokenId); } else { revert ERC721InsufficientApproval(spender, tokenId); } } } /** * @dev Unsafe write access to the balances, used by extensions that "mint" tokens using an {ownerOf} override. * * NOTE: the value is limited to type(uint128).max. This protect against _balance overflow. It is unrealistic that * a uint256 would ever overflow from increments when these increments are bounded to uint128 values. * * WARNING: Increasing an account's balance using this function tends to be paired with an override of the * {_ownerOf} function to resolve the ownership of the corresponding tokens so that balances and ownership * remain consistent with one another. */ function _increaseBalance(address account, uint128 value) internal virtual { unchecked { _balances[account] += value; } } /** * @dev Transfers `tokenId` from its current owner to `to`, or alternatively mints (or burns) if the current owner * (or `to`) is the zero address. Returns the owner of the `tokenId` before the update. * * The `auth` argument is optional. If the value passed is non 0, then this function will check that * `auth` is either the owner of the token, or approved to operate on the token (by the owner). * * Emits a {Transfer} event. * * NOTE: If overriding this function in a way that tracks balances, see also {_increaseBalance}. */ function _update(address to, uint256 tokenId, address auth) internal virtual returns (address) { address from = _ownerOf(tokenId); // Perform (optional) operator check if (auth != address(0)) { _checkAuthorized(from, auth, tokenId); } // Execute the update if (from != address(0)) { // Clear approval. No need to re-authorize or emit the Approval event _approve(address(0), tokenId, address(0), false); unchecked { _balances[from] -= 1; } } if (to != address(0)) { unchecked { _balances[to] += 1; } } _owners[tokenId] = to; emit Transfer(from, to, tokenId); return from; } /** * @dev Mints `tokenId` and transfers it to `to`. * * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible * * Requirements: * * - `tokenId` must not exist. * - `to` cannot be the zero address. * * Emits a {Transfer} event. */ function _mint(address to, uint256 tokenId) internal { if (to == address(0)) { revert ERC721InvalidReceiver(address(0)); } address previousOwner = _update(to, tokenId, address(0)); if (previousOwner != address(0)) { revert ERC721InvalidSender(address(0)); } } /** * @dev Mints `tokenId`, transfers it to `to` and checks for `to` acceptance. * * Requirements: * * - `tokenId` must not exist. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeMint(address to, uint256 tokenId) internal { _safeMint(to, tokenId, ""); } /** * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is * forwarded in {IERC721Receiver-onERC721Received} to contract recipients. */ function _safeMint(address to, uint256 tokenId, bytes memory data) internal virtual { _mint(to, tokenId); _checkOnERC721Received(address(0), to, tokenId, data); } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * This is an internal function that does not check if the sender is authorized to operate on the token. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId) internal { address previousOwner = _update(address(0), tokenId, address(0)); if (previousOwner == address(0)) { revert ERC721NonexistentToken(tokenId); } } /** * @dev Transfers `tokenId` from `from` to `to`. * As opposed to {transferFrom}, this imposes no restrictions on msg.sender. * * Requirements: * * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * * Emits a {Transfer} event. */ function _transfer(address from, address to, uint256 tokenId) internal { if (to == address(0)) { revert ERC721InvalidReceiver(address(0)); } address previousOwner = _update(to, tokenId, address(0)); if (previousOwner == address(0)) { revert ERC721NonexistentToken(tokenId); } else if (previousOwner != from) { revert ERC721IncorrectOwner(from, tokenId, previousOwner); } } /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking that contract recipients * are aware of the ERC721 standard to prevent tokens from being forever locked. * * `data` is additional data, it has no specified format and it is sent in call to `to`. * * This internal function is like {safeTransferFrom} in the sense that it invokes * {IERC721Receiver-onERC721Received} on the receiver, and can be used to e.g. * implement alternative mechanisms to perform token transfer, such as signature-based. * * Requirements: * * - `tokenId` token must exist and be owned by `from`. * - `to` cannot be the zero address. * - `from` cannot be the zero address. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeTransfer(address from, address to, uint256 tokenId) internal { _safeTransfer(from, to, tokenId, ""); } /** * @dev Same as {xref-ERC721-_safeTransfer-address-address-uint256-}[`_safeTransfer`], with an additional `data` parameter which is * forwarded in {IERC721Receiver-onERC721Received} to contract recipients. */ function _safeTransfer(address from, address to, uint256 tokenId, bytes memory data) internal virtual { _transfer(from, to, tokenId); _checkOnERC721Received(from, to, tokenId, data); } /** * @dev Approve `to` to operate on `tokenId` * * The `auth` argument is optional. If the value passed is non 0, then this function will check that `auth` is * either the owner of the token, or approved to operate on all tokens held by this owner. * * Emits an {Approval} event. * * Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument. */ function _approve(address to, uint256 tokenId, address auth) internal { _approve(to, tokenId, auth, true); } /** * @dev Variant of `_approve` with an optional flag to enable or disable the {Approval} event. The event is not * emitted in the context of transfers. */ function _approve(address to, uint256 tokenId, address auth, bool emitEvent) internal virtual { // Avoid reading the owner unless necessary if (emitEvent || auth != address(0)) { address owner = _requireOwned(tokenId); // We do not use _isAuthorized because single-token approvals should not be able to call approve if (auth != address(0) && owner != auth && !isApprovedForAll(owner, auth)) { revert ERC721InvalidApprover(auth); } if (emitEvent) { emit Approval(owner, to, tokenId); } } _tokenApprovals[tokenId] = to; } /** * @dev Approve `operator` to operate on all of `owner` tokens * * Requirements: * - operator can't be the address zero. * * Emits an {ApprovalForAll} event. */ function _setApprovalForAll(address owner, address operator, bool approved) internal virtual { if (operator == address(0)) { revert ERC721InvalidOperator(operator); } _operatorApprovals[owner][operator] = approved; emit ApprovalForAll(owner, operator, approved); } /** * @dev Reverts if the `tokenId` doesn't have a current owner (it hasn't been minted, or it has been burned). * Returns the owner. * * Overrides to ownership logic should be done to {_ownerOf}. */ function _requireOwned(uint256 tokenId) internal view returns (address) { address owner = _ownerOf(tokenId); if (owner == address(0)) { revert ERC721NonexistentToken(tokenId); } return owner; } /** * @dev Private function to invoke {IERC721Receiver-onERC721Received} on a target address. This will revert if the * recipient doesn't accept the token transfer. The call is not executed if the target address is not a contract. * * @param from address representing the previous owner of the given token ID * @param to target address that will receive the tokens * @param tokenId uint256 ID of the token to be transferred * @param data bytes optional data to send along with the call */ function _checkOnERC721Received(address from, address to, uint256 tokenId, bytes memory data) private { if (to.code.length > 0) { try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, data) returns (bytes4 retval) { if (retval != IERC721Receiver.onERC721Received.selector) { revert ERC721InvalidReceiver(to); } } catch (bytes memory reason) { if (reason.length == 0) { revert ERC721InvalidReceiver(to); } else { /// @solidity memory-safe-assembly assembly { revert(add(32, reason), mload(reason)) } } } } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/Strings.sol) pragma solidity ^0.8.20; import {Math} from "./math/Math.sol"; import {SignedMath} from "./math/SignedMath.sol"; /** * @dev String operations. */ library Strings { bytes16 private constant HEX_DIGITS = "0123456789abcdef"; uint8 private constant ADDRESS_LENGTH = 20; /** * @dev The `value` string doesn't fit in the specified `length`. */ error StringsInsufficientHexLength(uint256 value, uint256 length); /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { unchecked { uint256 length = Math.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), HEX_DIGITS)) } value /= 10; if (value == 0) break; } return buffer; } } /** * @dev Converts a `int256` to its ASCII `string` decimal representation. */ function toStringSigned(int256 value) internal pure returns (string memory) { return string.concat(value < 0 ? "-" : "", toString(SignedMath.abs(value))); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { unchecked { return toHexString(value, Math.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) { uint256 localValue = value; bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = HEX_DIGITS[localValue & 0xf]; localValue >>= 4; } if (localValue != 0) { revert StringsInsufficientHexLength(value, length); } return string(buffer); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal * representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), ADDRESS_LENGTH); } /** * @dev Returns true if the two strings are equal. */ function equal(string memory a, string memory b) internal pure returns (bool) { return bytes(a).length == bytes(b).length && keccak256(bytes(a)) == keccak256(bytes(b)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol) pragma solidity ^0.8.20; import {Context} from "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * The initial owner is set to the address provided by the deployer. This can * later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; /** * @dev The caller account is not authorized to perform an operation. */ error OwnableUnauthorizedAccount(address account); /** * @dev The owner is not a valid owner account. (eg. `address(0)`) */ error OwnableInvalidOwner(address owner); event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the address provided by the deployer as the initial owner. */ constructor(address initialOwner) { if (initialOwner == address(0)) { revert OwnableInvalidOwner(address(0)); } _transferOwnership(initialOwner); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { if (owner() != _msgSender()) { revert OwnableUnauthorizedAccount(_msgSender()); } } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby disabling any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { if (newOwner == address(0)) { revert OwnableInvalidOwner(address(0)); } _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.22; interface ISANPASS { function burn(address account, uint256 id, uint256 value) external; function burnBatch(address account, uint256[] memory ids, uint256[] memory values) external; }
// SPDX-License-Identifier: MIT pragma solidity 0.8.22; interface ISANWEAR { error ArrayLengthMismatch(); error ClaimAmountZero(); error ClaimInactive(); error InvalidTokenId(); function mint(address _to, uint256 _id, uint256 _amount) external; function mintBatch(address _to, uint256[] calldata _ids, uint256[] calldata _amounts) external; }
// SPDX-License-Identifier: MIT pragma solidity 0.8.22; abstract contract AvatarConstants { uint256 public constant MAX_SUPPLY = 3_333; uint256 public constant MAX_PAID_SUPPLY = 1_100; uint256 public constant PRICE_FULL = 0.3 ether; uint256 public constant PRICE_DISCOUNTED = 0.2 ether; uint96 internal constant INITIAL_ROYALTY_BPS = 250; uint96 internal constant INITIAL_MINT_AMOUNT = 300; uint256 internal constant THREE = 3; uint256 internal constant EIGHTY_FIVE = 85; uint256 internal constant MASK_THREE_BITS = 2**THREE - 1; }
// SPDX-License-Identifier: MIT pragma solidity 0.8.22; interface IAvatarVolumeAndFrequency { error CallerIsNotSanswap(); error InvalidTokenId(); enum Faction { UNUSED, Chi, Umi, Sora, Mecha, Nomad } event AvatarLevelUp ( uint256 indexed tokenId, uint256 level ); function levelUp( uint256 _tokenId, uint256 _levelIncreases ) external; function levelUpBatch( uint256[] calldata _tokenIds, uint256[] calldata _levelIncreases ) external; function getVolumeAndFrequency( uint256 _tokenId ) external view returns (uint128 volume_, uint128 frequency_); function tokenFaction( uint256 _tokenId ) external view returns (Faction); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/cryptography/ECDSA.sol) pragma solidity ^0.8.20; /** * @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 ECDSA { enum RecoverError { NoError, InvalidSignature, InvalidSignatureLength, InvalidSignatureS } /** * @dev The signature derives the `address(0)`. */ error ECDSAInvalidSignature(); /** * @dev The signature has an invalid length. */ error ECDSAInvalidSignatureLength(uint256 length); /** * @dev The signature has an S value that is in the upper half order. */ error ECDSAInvalidSignatureS(bytes32 s); /** * @dev Returns the address that signed a hashed message (`hash`) with `signature` or an error. This will not * return address(0) without also returning an error description. Errors are documented using an enum (error type) * and a bytes32 providing additional information about the error. * * If no error is returned, then the address can be used for verification purposes. * * The `ecrecover` EVM precompile 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 {MessageHashUtils-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] */ function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError, bytes32) { 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, bytes32(signature.length)); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature`. This address can then be used for verification purposes. * * The `ecrecover` EVM precompile 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 {MessageHashUtils-toEthSignedMessageHash} on it. */ function recover(bytes32 hash, bytes memory signature) internal pure returns (address) { (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, signature); _throwError(error, errorArg); 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] */ function tryRecover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address, RecoverError, bytes32) { unchecked { bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff); // We do not check for an overflow here since the shift operation results in 0 or 1. 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. */ function recover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address) { (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, r, vs); _throwError(error, errorArg); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `v`, * `r` and `s` signature fields separately. */ function tryRecover( bytes32 hash, uint8 v, bytes32 r, bytes32 s ) internal pure returns (address, RecoverError, bytes32) { // 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, s); } // 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, bytes32(0)); } return (signer, RecoverError.NoError, bytes32(0)); } /** * @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, bytes32 errorArg) = tryRecover(hash, v, r, s); _throwError(error, errorArg); return recovered; } /** * @dev Optionally reverts with the corresponding custom error according to the `error` argument provided. */ function _throwError(RecoverError error, bytes32 errorArg) private pure { if (error == RecoverError.NoError) { return; // no error: do nothing } else if (error == RecoverError.InvalidSignature) { revert ECDSAInvalidSignature(); } else if (error == RecoverError.InvalidSignatureLength) { revert ECDSAInvalidSignatureLength(uint256(errorArg)); } else if (error == RecoverError.InvalidSignatureS) { revert ECDSAInvalidSignatureS(errorArg); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/cryptography/MessageHashUtils.sol) pragma solidity ^0.8.20; import {Strings} from "../Strings.sol"; /** * @dev Signature message hash utilities for producing digests to be consumed by {ECDSA} recovery or signing. * * The library provides methods for generating a hash of a message that conforms to the * https://eips.ethereum.org/EIPS/eip-191[EIP 191] and https://eips.ethereum.org/EIPS/eip-712[EIP 712] * specifications. */ library MessageHashUtils { /** * @dev Returns the keccak256 digest of an EIP-191 signed data with version * `0x45` (`personal_sign` messages). * * The digest is calculated by prefixing a bytes32 `messageHash` with * `"\x19Ethereum Signed Message:\n32"` and hashing the result. It corresponds with the * hash signed when using the https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] JSON-RPC method. * * NOTE: The `messageHash` parameter is intended to be the result of hashing a raw message with * keccak256, although any bytes32 value can be safely used because the final digest will * be re-hashed. * * See {ECDSA-recover}. */ function toEthSignedMessageHash(bytes32 messageHash) internal pure returns (bytes32 digest) { /// @solidity memory-safe-assembly assembly { mstore(0x00, "\x19Ethereum Signed Message:\n32") // 32 is the bytes-length of messageHash mstore(0x1c, messageHash) // 0x1c (28) is the length of the prefix digest := keccak256(0x00, 0x3c) // 0x3c is the length of the prefix (0x1c) + messageHash (0x20) } } /** * @dev Returns the keccak256 digest of an EIP-191 signed data with version * `0x45` (`personal_sign` messages). * * The digest is calculated by prefixing an arbitrary `message` with * `"\x19Ethereum Signed Message:\n" + len(message)` and hashing the result. It corresponds with the * hash signed when using the https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] JSON-RPC method. * * See {ECDSA-recover}. */ function toEthSignedMessageHash(bytes memory message) internal pure returns (bytes32) { return keccak256(bytes.concat("\x19Ethereum Signed Message:\n", bytes(Strings.toString(message.length)), message)); } /** * @dev Returns the keccak256 digest of an EIP-191 signed data with version * `0x00` (data with intended validator). * * The digest is calculated by prefixing an arbitrary `data` with `"\x19\x00"` and the intended * `validator` address. Then hashing the result. * * See {ECDSA-recover}. */ function toDataWithIntendedValidatorHash(address validator, bytes memory data) internal pure returns (bytes32) { return keccak256(abi.encodePacked(hex"19_00", validator, data)); } /** * @dev Returns the keccak256 digest of an EIP-712 typed data (EIP-191 version `0x01`). * * The digest is calculated from a `domainSeparator` and a `structHash`, by prefixing them with * `\x19\x01` and hashing the result. It corresponds to the hash signed by the * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] JSON-RPC method as part of EIP-712. * * See {ECDSA-recover}. */ function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32 digest) { /// @solidity memory-safe-assembly assembly { let ptr := mload(0x40) mstore(ptr, hex"19_01") mstore(add(ptr, 0x02), domainSeparator) mstore(add(ptr, 0x22), structHash) digest := keccak256(ptr, 0x42) } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/common/ERC2981.sol) pragma solidity ^0.8.20; import {IERC2981} from "../../interfaces/IERC2981.sol"; import {IERC165, ERC165} from "../../utils/introspection/ERC165.sol"; /** * @dev Implementation of the NFT Royalty Standard, a standardized way to retrieve royalty payment information. * * Royalty information can be specified globally for all token ids via {_setDefaultRoyalty}, and/or individually for * specific token ids via {_setTokenRoyalty}. The latter takes precedence over the first. * * Royalty is specified as a fraction of sale price. {_feeDenominator} is overridable but defaults to 10000, meaning the * fee is specified in basis points by default. * * IMPORTANT: ERC-2981 only specifies a way to signal royalty information and does not enforce its payment. See * https://eips.ethereum.org/EIPS/eip-2981#optional-royalty-payments[Rationale] in the EIP. Marketplaces are expected to * voluntarily pay royalties together with sales, but note that this standard is not yet widely supported. */ abstract contract ERC2981 is IERC2981, ERC165 { struct RoyaltyInfo { address receiver; uint96 royaltyFraction; } RoyaltyInfo private _defaultRoyaltyInfo; mapping(uint256 tokenId => RoyaltyInfo) private _tokenRoyaltyInfo; /** * @dev The default royalty set is invalid (eg. (numerator / denominator) >= 1). */ error ERC2981InvalidDefaultRoyalty(uint256 numerator, uint256 denominator); /** * @dev The default royalty receiver is invalid. */ error ERC2981InvalidDefaultRoyaltyReceiver(address receiver); /** * @dev The royalty set for an specific `tokenId` is invalid (eg. (numerator / denominator) >= 1). */ error ERC2981InvalidTokenRoyalty(uint256 tokenId, uint256 numerator, uint256 denominator); /** * @dev The royalty receiver for `tokenId` is invalid. */ error ERC2981InvalidTokenRoyaltyReceiver(uint256 tokenId, address receiver); /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC165) returns (bool) { return interfaceId == type(IERC2981).interfaceId || super.supportsInterface(interfaceId); } /** * @inheritdoc IERC2981 */ function royaltyInfo(uint256 tokenId, uint256 salePrice) public view virtual returns (address, uint256) { RoyaltyInfo memory royalty = _tokenRoyaltyInfo[tokenId]; if (royalty.receiver == address(0)) { royalty = _defaultRoyaltyInfo; } uint256 royaltyAmount = (salePrice * royalty.royaltyFraction) / _feeDenominator(); return (royalty.receiver, royaltyAmount); } /** * @dev The denominator with which to interpret the fee set in {_setTokenRoyalty} and {_setDefaultRoyalty} as a * fraction of the sale price. Defaults to 10000 so fees are expressed in basis points, but may be customized by an * override. */ function _feeDenominator() internal pure virtual returns (uint96) { return 10000; } /** * @dev Sets the royalty information that all ids in this contract will default to. * * Requirements: * * - `receiver` cannot be the zero address. * - `feeNumerator` cannot be greater than the fee denominator. */ function _setDefaultRoyalty(address receiver, uint96 feeNumerator) internal virtual { uint256 denominator = _feeDenominator(); if (feeNumerator > denominator) { // Royalty fee will exceed the sale price revert ERC2981InvalidDefaultRoyalty(feeNumerator, denominator); } if (receiver == address(0)) { revert ERC2981InvalidDefaultRoyaltyReceiver(address(0)); } _defaultRoyaltyInfo = RoyaltyInfo(receiver, feeNumerator); } /** * @dev Removes default royalty information. */ function _deleteDefaultRoyalty() internal virtual { delete _defaultRoyaltyInfo; } /** * @dev Sets the royalty information for a specific token id, overriding the global default. * * Requirements: * * - `receiver` cannot be the zero address. * - `feeNumerator` cannot be greater than the fee denominator. */ function _setTokenRoyalty(uint256 tokenId, address receiver, uint96 feeNumerator) internal virtual { uint256 denominator = _feeDenominator(); if (feeNumerator > denominator) { // Royalty fee will exceed the sale price revert ERC2981InvalidTokenRoyalty(tokenId, feeNumerator, denominator); } if (receiver == address(0)) { revert ERC2981InvalidTokenRoyaltyReceiver(tokenId, address(0)); } _tokenRoyaltyInfo[tokenId] = RoyaltyInfo(receiver, feeNumerator); } /** * @dev Resets royalty information for the token id back to the global default. */ function _resetTokenRoyalty(uint256 tokenId) internal virtual { delete _tokenRoyaltyInfo[tokenId]; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC2309.sol) pragma solidity ^0.8.20; /** * @dev ERC-2309: ERC-721 Consecutive Transfer Extension. */ interface IERC2309 { /** * @dev Emitted when the tokens from `fromTokenId` to `toTokenId` are transferred from `fromAddress` to `toAddress`. */ event ConsecutiveTransfer( uint256 indexed fromTokenId, uint256 toTokenId, address indexed fromAddress, address indexed toAddress ); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/structs/BitMaps.sol) pragma solidity ^0.8.20; /** * @dev Library for managing uint256 to bool mapping in a compact and efficient way, provided the keys are sequential. * Largely inspired by Uniswap's https://github.com/Uniswap/merkle-distributor/blob/master/contracts/MerkleDistributor.sol[merkle-distributor]. * * BitMaps pack 256 booleans across each bit of a single 256-bit slot of `uint256` type. * Hence booleans corresponding to 256 _sequential_ indices would only consume a single slot, * unlike the regular `bool` which would consume an entire slot for a single value. * * This results in gas savings in two ways: * * - Setting a zero value to non-zero only once every 256 times * - Accessing the same warm slot for every 256 _sequential_ indices */ library BitMaps { struct BitMap { mapping(uint256 bucket => uint256) _data; } /** * @dev Returns whether the bit at `index` is set. */ function get(BitMap storage bitmap, uint256 index) internal view returns (bool) { uint256 bucket = index >> 8; uint256 mask = 1 << (index & 0xff); return bitmap._data[bucket] & mask != 0; } /** * @dev Sets the bit at `index` to the boolean `value`. */ function setTo(BitMap storage bitmap, uint256 index, bool value) internal { if (value) { set(bitmap, index); } else { unset(bitmap, index); } } /** * @dev Sets the bit at `index`. */ function set(BitMap storage bitmap, uint256 index) internal { uint256 bucket = index >> 8; uint256 mask = 1 << (index & 0xff); bitmap._data[bucket] |= mask; } /** * @dev Unsets the bit at `index`. */ function unset(BitMap storage bitmap, uint256 index) internal { uint256 bucket = index >> 8; uint256 mask = 1 << (index & 0xff); bitmap._data[bucket] &= ~mask; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/structs/Checkpoints.sol) // This file was procedurally generated from scripts/generate/templates/Checkpoints.js. pragma solidity ^0.8.20; import {Math} from "../math/Math.sol"; /** * @dev This library defines the `Trace*` struct, for checkpointing values as they change at different points in * time, and later looking up past values by block number. See {Votes} as an example. * * To create a history of checkpoints define a variable type `Checkpoints.Trace*` in your contract, and store a new * checkpoint for the current transaction block using the {push} function. */ library Checkpoints { /** * @dev A value was attempted to be inserted on a past checkpoint. */ error CheckpointUnorderedInsertion(); struct Trace224 { Checkpoint224[] _checkpoints; } struct Checkpoint224 { uint32 _key; uint224 _value; } /** * @dev Pushes a (`key`, `value`) pair into a Trace224 so that it is stored as the checkpoint. * * Returns previous value and new value. * * IMPORTANT: Never accept `key` as a user input, since an arbitrary `type(uint32).max` key set will disable the * library. */ function push(Trace224 storage self, uint32 key, uint224 value) internal returns (uint224, uint224) { return _insert(self._checkpoints, key, value); } /** * @dev Returns the value in the first (oldest) checkpoint with key greater or equal than the search key, or zero if * there is none. */ function lowerLookup(Trace224 storage self, uint32 key) internal view returns (uint224) { uint256 len = self._checkpoints.length; uint256 pos = _lowerBinaryLookup(self._checkpoints, key, 0, len); return pos == len ? 0 : _unsafeAccess(self._checkpoints, pos)._value; } /** * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero * if there is none. */ function upperLookup(Trace224 storage self, uint32 key) internal view returns (uint224) { uint256 len = self._checkpoints.length; uint256 pos = _upperBinaryLookup(self._checkpoints, key, 0, len); return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value; } /** * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero * if there is none. * * NOTE: This is a variant of {upperLookup} that is optimised to find "recent" checkpoint (checkpoints with high * keys). */ function upperLookupRecent(Trace224 storage self, uint32 key) internal view returns (uint224) { uint256 len = self._checkpoints.length; uint256 low = 0; uint256 high = len; if (len > 5) { uint256 mid = len - Math.sqrt(len); if (key < _unsafeAccess(self._checkpoints, mid)._key) { high = mid; } else { low = mid + 1; } } uint256 pos = _upperBinaryLookup(self._checkpoints, key, low, high); return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value; } /** * @dev Returns the value in the most recent checkpoint, or zero if there are no checkpoints. */ function latest(Trace224 storage self) internal view returns (uint224) { uint256 pos = self._checkpoints.length; return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value; } /** * @dev Returns whether there is a checkpoint in the structure (i.e. it is not empty), and if so the key and value * in the most recent checkpoint. */ function latestCheckpoint(Trace224 storage self) internal view returns (bool exists, uint32 _key, uint224 _value) { uint256 pos = self._checkpoints.length; if (pos == 0) { return (false, 0, 0); } else { Checkpoint224 memory ckpt = _unsafeAccess(self._checkpoints, pos - 1); return (true, ckpt._key, ckpt._value); } } /** * @dev Returns the number of checkpoint. */ function length(Trace224 storage self) internal view returns (uint256) { return self._checkpoints.length; } /** * @dev Returns checkpoint at given position. */ function at(Trace224 storage self, uint32 pos) internal view returns (Checkpoint224 memory) { return self._checkpoints[pos]; } /** * @dev Pushes a (`key`, `value`) pair into an ordered list of checkpoints, either by inserting a new checkpoint, * or by updating the last one. */ function _insert(Checkpoint224[] storage self, uint32 key, uint224 value) private returns (uint224, uint224) { uint256 pos = self.length; if (pos > 0) { // Copying to memory is important here. Checkpoint224 memory last = _unsafeAccess(self, pos - 1); // Checkpoint keys must be non-decreasing. if (last._key > key) { revert CheckpointUnorderedInsertion(); } // Update or push new checkpoint if (last._key == key) { _unsafeAccess(self, pos - 1)._value = value; } else { self.push(Checkpoint224({_key: key, _value: value})); } return (last._value, value); } else { self.push(Checkpoint224({_key: key, _value: value})); return (0, value); } } /** * @dev Return the index of the last (most recent) checkpoint with key lower or equal than the search key, or `high` * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive * `high`. * * WARNING: `high` should not be greater than the array's length. */ function _upperBinaryLookup( Checkpoint224[] storage self, uint32 key, uint256 low, uint256 high ) private view returns (uint256) { while (low < high) { uint256 mid = Math.average(low, high); if (_unsafeAccess(self, mid)._key > key) { high = mid; } else { low = mid + 1; } } return high; } /** * @dev Return the index of the first (oldest) checkpoint with key is greater or equal than the search key, or * `high` if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and * exclusive `high`. * * WARNING: `high` should not be greater than the array's length. */ function _lowerBinaryLookup( Checkpoint224[] storage self, uint32 key, uint256 low, uint256 high ) private view returns (uint256) { while (low < high) { uint256 mid = Math.average(low, high); if (_unsafeAccess(self, mid)._key < key) { low = mid + 1; } else { high = mid; } } return high; } /** * @dev Access an element of the array without performing bounds check. The position is assumed to be within bounds. */ function _unsafeAccess( Checkpoint224[] storage self, uint256 pos ) private pure returns (Checkpoint224 storage result) { assembly { mstore(0, self.slot) result.slot := add(keccak256(0, 0x20), pos) } } struct Trace208 { Checkpoint208[] _checkpoints; } struct Checkpoint208 { uint48 _key; uint208 _value; } /** * @dev Pushes a (`key`, `value`) pair into a Trace208 so that it is stored as the checkpoint. * * Returns previous value and new value. * * IMPORTANT: Never accept `key` as a user input, since an arbitrary `type(uint48).max` key set will disable the * library. */ function push(Trace208 storage self, uint48 key, uint208 value) internal returns (uint208, uint208) { return _insert(self._checkpoints, key, value); } /** * @dev Returns the value in the first (oldest) checkpoint with key greater or equal than the search key, or zero if * there is none. */ function lowerLookup(Trace208 storage self, uint48 key) internal view returns (uint208) { uint256 len = self._checkpoints.length; uint256 pos = _lowerBinaryLookup(self._checkpoints, key, 0, len); return pos == len ? 0 : _unsafeAccess(self._checkpoints, pos)._value; } /** * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero * if there is none. */ function upperLookup(Trace208 storage self, uint48 key) internal view returns (uint208) { uint256 len = self._checkpoints.length; uint256 pos = _upperBinaryLookup(self._checkpoints, key, 0, len); return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value; } /** * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero * if there is none. * * NOTE: This is a variant of {upperLookup} that is optimised to find "recent" checkpoint (checkpoints with high * keys). */ function upperLookupRecent(Trace208 storage self, uint48 key) internal view returns (uint208) { uint256 len = self._checkpoints.length; uint256 low = 0; uint256 high = len; if (len > 5) { uint256 mid = len - Math.sqrt(len); if (key < _unsafeAccess(self._checkpoints, mid)._key) { high = mid; } else { low = mid + 1; } } uint256 pos = _upperBinaryLookup(self._checkpoints, key, low, high); return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value; } /** * @dev Returns the value in the most recent checkpoint, or zero if there are no checkpoints. */ function latest(Trace208 storage self) internal view returns (uint208) { uint256 pos = self._checkpoints.length; return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value; } /** * @dev Returns whether there is a checkpoint in the structure (i.e. it is not empty), and if so the key and value * in the most recent checkpoint. */ function latestCheckpoint(Trace208 storage self) internal view returns (bool exists, uint48 _key, uint208 _value) { uint256 pos = self._checkpoints.length; if (pos == 0) { return (false, 0, 0); } else { Checkpoint208 memory ckpt = _unsafeAccess(self._checkpoints, pos - 1); return (true, ckpt._key, ckpt._value); } } /** * @dev Returns the number of checkpoint. */ function length(Trace208 storage self) internal view returns (uint256) { return self._checkpoints.length; } /** * @dev Returns checkpoint at given position. */ function at(Trace208 storage self, uint32 pos) internal view returns (Checkpoint208 memory) { return self._checkpoints[pos]; } /** * @dev Pushes a (`key`, `value`) pair into an ordered list of checkpoints, either by inserting a new checkpoint, * or by updating the last one. */ function _insert(Checkpoint208[] storage self, uint48 key, uint208 value) private returns (uint208, uint208) { uint256 pos = self.length; if (pos > 0) { // Copying to memory is important here. Checkpoint208 memory last = _unsafeAccess(self, pos - 1); // Checkpoint keys must be non-decreasing. if (last._key > key) { revert CheckpointUnorderedInsertion(); } // Update or push new checkpoint if (last._key == key) { _unsafeAccess(self, pos - 1)._value = value; } else { self.push(Checkpoint208({_key: key, _value: value})); } return (last._value, value); } else { self.push(Checkpoint208({_key: key, _value: value})); return (0, value); } } /** * @dev Return the index of the last (most recent) checkpoint with key lower or equal than the search key, or `high` * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive * `high`. * * WARNING: `high` should not be greater than the array's length. */ function _upperBinaryLookup( Checkpoint208[] storage self, uint48 key, uint256 low, uint256 high ) private view returns (uint256) { while (low < high) { uint256 mid = Math.average(low, high); if (_unsafeAccess(self, mid)._key > key) { high = mid; } else { low = mid + 1; } } return high; } /** * @dev Return the index of the first (oldest) checkpoint with key is greater or equal than the search key, or * `high` if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and * exclusive `high`. * * WARNING: `high` should not be greater than the array's length. */ function _lowerBinaryLookup( Checkpoint208[] storage self, uint48 key, uint256 low, uint256 high ) private view returns (uint256) { while (low < high) { uint256 mid = Math.average(low, high); if (_unsafeAccess(self, mid)._key < key) { low = mid + 1; } else { high = mid; } } return high; } /** * @dev Access an element of the array without performing bounds check. The position is assumed to be within bounds. */ function _unsafeAccess( Checkpoint208[] storage self, uint256 pos ) private pure returns (Checkpoint208 storage result) { assembly { mstore(0, self.slot) result.slot := add(keccak256(0, 0x20), pos) } } struct Trace160 { Checkpoint160[] _checkpoints; } struct Checkpoint160 { uint96 _key; uint160 _value; } /** * @dev Pushes a (`key`, `value`) pair into a Trace160 so that it is stored as the checkpoint. * * Returns previous value and new value. * * IMPORTANT: Never accept `key` as a user input, since an arbitrary `type(uint96).max` key set will disable the * library. */ function push(Trace160 storage self, uint96 key, uint160 value) internal returns (uint160, uint160) { return _insert(self._checkpoints, key, value); } /** * @dev Returns the value in the first (oldest) checkpoint with key greater or equal than the search key, or zero if * there is none. */ function lowerLookup(Trace160 storage self, uint96 key) internal view returns (uint160) { uint256 len = self._checkpoints.length; uint256 pos = _lowerBinaryLookup(self._checkpoints, key, 0, len); return pos == len ? 0 : _unsafeAccess(self._checkpoints, pos)._value; } /** * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero * if there is none. */ function upperLookup(Trace160 storage self, uint96 key) internal view returns (uint160) { uint256 len = self._checkpoints.length; uint256 pos = _upperBinaryLookup(self._checkpoints, key, 0, len); return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value; } /** * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero * if there is none. * * NOTE: This is a variant of {upperLookup} that is optimised to find "recent" checkpoint (checkpoints with high * keys). */ function upperLookupRecent(Trace160 storage self, uint96 key) internal view returns (uint160) { uint256 len = self._checkpoints.length; uint256 low = 0; uint256 high = len; if (len > 5) { uint256 mid = len - Math.sqrt(len); if (key < _unsafeAccess(self._checkpoints, mid)._key) { high = mid; } else { low = mid + 1; } } uint256 pos = _upperBinaryLookup(self._checkpoints, key, low, high); return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value; } /** * @dev Returns the value in the most recent checkpoint, or zero if there are no checkpoints. */ function latest(Trace160 storage self) internal view returns (uint160) { uint256 pos = self._checkpoints.length; return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value; } /** * @dev Returns whether there is a checkpoint in the structure (i.e. it is not empty), and if so the key and value * in the most recent checkpoint. */ function latestCheckpoint(Trace160 storage self) internal view returns (bool exists, uint96 _key, uint160 _value) { uint256 pos = self._checkpoints.length; if (pos == 0) { return (false, 0, 0); } else { Checkpoint160 memory ckpt = _unsafeAccess(self._checkpoints, pos - 1); return (true, ckpt._key, ckpt._value); } } /** * @dev Returns the number of checkpoint. */ function length(Trace160 storage self) internal view returns (uint256) { return self._checkpoints.length; } /** * @dev Returns checkpoint at given position. */ function at(Trace160 storage self, uint32 pos) internal view returns (Checkpoint160 memory) { return self._checkpoints[pos]; } /** * @dev Pushes a (`key`, `value`) pair into an ordered list of checkpoints, either by inserting a new checkpoint, * or by updating the last one. */ function _insert(Checkpoint160[] storage self, uint96 key, uint160 value) private returns (uint160, uint160) { uint256 pos = self.length; if (pos > 0) { // Copying to memory is important here. Checkpoint160 memory last = _unsafeAccess(self, pos - 1); // Checkpoint keys must be non-decreasing. if (last._key > key) { revert CheckpointUnorderedInsertion(); } // Update or push new checkpoint if (last._key == key) { _unsafeAccess(self, pos - 1)._value = value; } else { self.push(Checkpoint160({_key: key, _value: value})); } return (last._value, value); } else { self.push(Checkpoint160({_key: key, _value: value})); return (0, value); } } /** * @dev Return the index of the last (most recent) checkpoint with key lower or equal than the search key, or `high` * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive * `high`. * * WARNING: `high` should not be greater than the array's length. */ function _upperBinaryLookup( Checkpoint160[] storage self, uint96 key, uint256 low, uint256 high ) private view returns (uint256) { while (low < high) { uint256 mid = Math.average(low, high); if (_unsafeAccess(self, mid)._key > key) { high = mid; } else { low = mid + 1; } } return high; } /** * @dev Return the index of the first (oldest) checkpoint with key is greater or equal than the search key, or * `high` if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and * exclusive `high`. * * WARNING: `high` should not be greater than the array's length. */ function _lowerBinaryLookup( Checkpoint160[] storage self, uint96 key, uint256 low, uint256 high ) private view returns (uint256) { while (low < high) { uint256 mid = Math.average(low, high); if (_unsafeAccess(self, mid)._key < key) { low = mid + 1; } else { high = mid; } } return high; } /** * @dev Access an element of the array without performing bounds check. The position is assumed to be within bounds. */ function _unsafeAccess( Checkpoint160[] storage self, uint256 pos ) private pure returns (Checkpoint160 storage result) { assembly { mstore(0, self.slot) result.slot := add(keccak256(0, 0x20), pos) } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/IERC721.sol) pragma solidity ^0.8.20; import {IERC165} from "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721 is IERC165 { /** * @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 address zero. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool approved) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/IERC721Receiver.sol) pragma solidity ^0.8.20; /** * @title ERC721 token receiver interface * @dev Interface for any contract that wants to support safeTransfers * from ERC721 asset contracts. */ interface IERC721Receiver { /** * @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 v5.0.0) (token/ERC721/extensions/IERC721Metadata.sol) pragma solidity ^0.8.20; import {IERC721} from "../IERC721.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional metadata extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721Metadata is IERC721 { /** * @dev Returns the token collection name. */ function name() external view returns (string memory); /** * @dev Returns the token collection symbol. */ function symbol() external view returns (string memory); /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ function tokenURI(uint256 tokenId) external view returns (string memory); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/Context.sol) pragma solidity ^0.8.20; /** * @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 Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165.sol) pragma solidity ^0.8.20; import {IERC165} from "./IERC165.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); * } * ``` */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (interfaces/draft-IERC6093.sol) pragma solidity ^0.8.20; /** * @dev Standard ERC20 Errors * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC20 tokens. */ interface IERC20Errors { /** * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. * @param balance Current balance for the interacting account. * @param needed Minimum amount required to perform a transfer. */ error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed); /** * @dev Indicates a failure with the token `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. */ error ERC20InvalidSender(address sender); /** * @dev Indicates a failure with the token `receiver`. Used in transfers. * @param receiver Address to which tokens are being transferred. */ error ERC20InvalidReceiver(address receiver); /** * @dev Indicates a failure with the `spender`’s `allowance`. Used in transfers. * @param spender Address that may be allowed to operate on tokens without being their owner. * @param allowance Amount of tokens a `spender` is allowed to operate with. * @param needed Minimum amount required to perform a transfer. */ error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed); /** * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals. * @param approver Address initiating an approval operation. */ error ERC20InvalidApprover(address approver); /** * @dev Indicates a failure with the `spender` to be approved. Used in approvals. * @param spender Address that may be allowed to operate on tokens without being their owner. */ error ERC20InvalidSpender(address spender); } /** * @dev Standard ERC721 Errors * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC721 tokens. */ interface IERC721Errors { /** * @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in EIP-20. * Used in balance queries. * @param owner Address of the current owner of a token. */ error ERC721InvalidOwner(address owner); /** * @dev Indicates a `tokenId` whose `owner` is the zero address. * @param tokenId Identifier number of a token. */ error ERC721NonexistentToken(uint256 tokenId); /** * @dev Indicates an error related to the ownership over a particular token. Used in transfers. * @param sender Address whose tokens are being transferred. * @param tokenId Identifier number of a token. * @param owner Address of the current owner of a token. */ error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner); /** * @dev Indicates a failure with the token `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. */ error ERC721InvalidSender(address sender); /** * @dev Indicates a failure with the token `receiver`. Used in transfers. * @param receiver Address to which tokens are being transferred. */ error ERC721InvalidReceiver(address receiver); /** * @dev Indicates a failure with the `operator`’s approval. Used in transfers. * @param operator Address that may be allowed to operate on tokens without being their owner. * @param tokenId Identifier number of a token. */ error ERC721InsufficientApproval(address operator, uint256 tokenId); /** * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals. * @param approver Address initiating an approval operation. */ error ERC721InvalidApprover(address approver); /** * @dev Indicates a failure with the `operator` to be approved. Used in approvals. * @param operator Address that may be allowed to operate on tokens without being their owner. */ error ERC721InvalidOperator(address operator); } /** * @dev Standard ERC1155 Errors * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC1155 tokens. */ interface IERC1155Errors { /** * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. * @param balance Current balance for the interacting account. * @param needed Minimum amount required to perform a transfer. * @param tokenId Identifier number of a token. */ error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId); /** * @dev Indicates a failure with the token `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. */ error ERC1155InvalidSender(address sender); /** * @dev Indicates a failure with the token `receiver`. Used in transfers. * @param receiver Address to which tokens are being transferred. */ error ERC1155InvalidReceiver(address receiver); /** * @dev Indicates a failure with the `operator`’s approval. Used in transfers. * @param operator Address that may be allowed to operate on tokens without being their owner. * @param owner Address of the current owner of a token. */ error ERC1155MissingApprovalForAll(address operator, address owner); /** * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals. * @param approver Address initiating an approval operation. */ error ERC1155InvalidApprover(address approver); /** * @dev Indicates a failure with the `operator` to be approved. Used in approvals. * @param operator Address that may be allowed to operate on tokens without being their owner. */ error ERC1155InvalidOperator(address operator); /** * @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation. * Used in batch transfers. * @param idsLength Length of the array of token identifiers * @param valuesLength Length of the array of token amounts */ error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/math/Math.sol) pragma solidity ^0.8.20; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { /** * @dev Muldiv operation overflow. */ error MathOverflowedMulDiv(); enum Rounding { Floor, // Toward negative infinity Ceil, // Toward positive infinity Trunc, // Toward zero Expand // Away from zero } /** * @dev Returns the addition of two unsigned integers, with an overflow flag. */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } } /** * @dev Returns the subtraction of two unsigned integers, with an overflow flag. */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b > a) return (false, 0); return (true, a - b); } } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } } /** * @dev Returns the division of two unsigned integers, with a division by zero flag. */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a / b); } } /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a % b); } } /** * @dev Returns the 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 towards infinity instead * of rounding towards zero. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { if (b == 0) { // Guarantee the same behavior as in a regular Solidity division. return a / b; } // (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 = x * y; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division. if (prod1 == 0) { // Solidity will revert if denominator == 0, unlike the div opcode on its own. // The surrounding unchecked block does not change this fact. // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic. return prod0 / denominator; } // Make sure the result is less than 2^256. Also prevents denominator == 0. if (denominator <= prod1) { revert MathOverflowedMulDiv(); } /////////////////////////////////////////////// // 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. uint256 twos = denominator & (0 - denominator); 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 (unsignedRoundsUp(rounding) && 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 * towards zero. * * 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 + (unsignedRoundsUp(rounding) && result * result < a ? 1 : 0); } } /** * @dev Return the log in base 2 of a positive value rounded towards zero. * 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 + (unsignedRoundsUp(rounding) && 1 << result < value ? 1 : 0); } } /** * @dev Return the log in base 10 of a positive value rounded towards zero. * 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 + (unsignedRoundsUp(rounding) && 10 ** result < value ? 1 : 0); } } /** * @dev Return the log in base 256 of a positive value rounded towards zero. * Returns 0 if given 0. * * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string. */ function log256(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 16; } if (value >> 64 > 0) { value >>= 64; result += 8; } if (value >> 32 > 0) { value >>= 32; result += 4; } if (value >> 16 > 0) { value >>= 16; result += 2; } if (value >> 8 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 256, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log256(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log256(value); return result + (unsignedRoundsUp(rounding) && 1 << (result << 3) < value ? 1 : 0); } } /** * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers. */ function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) { return uint8(rounding) % 2 == 1; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/math/SignedMath.sol) pragma solidity ^0.8.20; /** * @dev Standard signed math utilities missing in the Solidity language. */ library SignedMath { /** * @dev Returns the largest of two signed numbers. */ function max(int256 a, int256 b) internal pure returns (int256) { return a > b ? a : b; } /** * @dev Returns the smallest of two signed numbers. */ function min(int256 a, int256 b) internal pure returns (int256) { return a < b ? a : b; } /** * @dev Returns the average of two signed numbers without overflow. * The result is rounded towards zero. */ function average(int256 a, int256 b) internal pure returns (int256) { // Formula from the book "Hacker's Delight" int256 x = (a & b) + ((a ^ b) >> 1); return x + (int256(uint256(x) >> 255) & (a ^ b)); } /** * @dev Returns the absolute unsigned value of a signed value. */ function abs(int256 n) internal pure returns (uint256) { unchecked { // must be unchecked in order to support `n = type(int256).min` return uint256(n >= 0 ? n : -n); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC2981.sol) pragma solidity ^0.8.20; import {IERC165} from "../utils/introspection/IERC165.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. */ interface IERC2981 is IERC165 { /** * @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 v5.0.0) (utils/introspection/IERC165.sol) pragma solidity ^0.8.20; /** * @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 IERC165 { /** * @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); }
{ "remappings": [ "@openzeppelin/=lib/erc6551/lib/openzeppelin-contracts/", "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/", "ds-test/=lib/forge-std/lib/ds-test/src/", "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/", "erc6551/=lib/erc6551/", "forge-std/=lib/forge-std/src/", "openzeppelin-contracts/=lib/openzeppelin-contracts/" ], "optimizer": { "enabled": true, "runs": 3333 }, "metadata": { "useLiteralContent": false, "bytecodeHash": "ipfs", "appendCBOR": true }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "evmVersion": "paris", "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"string","name":"_baseUri","type":"string"},{"internalType":"string","name":"_contractUri","type":"string"},{"internalType":"address","name":"_sanpass","type":"address"},{"internalType":"address","name":"_sanwear","type":"address"},{"internalType":"address","name":"_signer","type":"address"},{"internalType":"address","name":"_initMintTo","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"BurnsExceedMints","type":"error"},{"inputs":[],"name":"CallerIsNotSanswap","type":"error"},{"inputs":[],"name":"CallerIsNotTheUNMUTOOOOR","type":"error"},{"inputs":[],"name":"CheckpointUnorderedInsertion","type":"error"},{"inputs":[],"name":"ECDSAInvalidSignature","type":"error"},{"inputs":[{"internalType":"uint256","name":"length","type":"uint256"}],"name":"ECDSAInvalidSignatureLength","type":"error"},{"inputs":[{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"ECDSAInvalidSignatureS","type":"error"},{"inputs":[{"internalType":"uint256","name":"numerator","type":"uint256"},{"internalType":"uint256","name":"denominator","type":"uint256"}],"name":"ERC2981InvalidDefaultRoyalty","type":"error"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"}],"name":"ERC2981InvalidDefaultRoyaltyReceiver","type":"error"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"numerator","type":"uint256"},{"internalType":"uint256","name":"denominator","type":"uint256"}],"name":"ERC2981InvalidTokenRoyalty","type":"error"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"}],"name":"ERC2981InvalidTokenRoyaltyReceiver","type":"error"},{"inputs":[{"internalType":"uint256","name":"batchSize","type":"uint256"},{"internalType":"uint256","name":"maxBatch","type":"uint256"}],"name":"ERC721ExceededMaxBatchMint","type":"error"},{"inputs":[],"name":"ERC721ForbiddenBatchBurn","type":"error"},{"inputs":[],"name":"ERC721ForbiddenBatchMint","type":"error"},{"inputs":[],"name":"ERC721ForbiddenMint","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"owner","type":"address"}],"name":"ERC721IncorrectOwner","type":"error"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ERC721InsufficientApproval","type":"error"},{"inputs":[{"internalType":"address","name":"approver","type":"address"}],"name":"ERC721InvalidApprover","type":"error"},{"inputs":[{"internalType":"address","name":"operator","type":"address"}],"name":"ERC721InvalidOperator","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"ERC721InvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"}],"name":"ERC721InvalidReceiver","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"}],"name":"ERC721InvalidSender","type":"error"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ERC721NonexistentToken","type":"error"},{"inputs":[],"name":"ExceedsMaxSupply","type":"error"},{"inputs":[],"name":"ExceedsMintAllocation","type":"error"},{"inputs":[],"name":"ExceedsPaidMintsRemaining","type":"error"},{"inputs":[],"name":"FailedToWithdraw","type":"error"},{"inputs":[],"name":"InvalidPaymentAmount","type":"error"},{"inputs":[],"name":"InvalidSignature","type":"error"},{"inputs":[],"name":"InvalidTokenId","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"inputs":[],"name":"SaleStateNotActive","type":"error"},{"inputs":[],"name":"SoundscapeAlreadyUnmuted","type":"error"},{"inputs":[],"name":"SuncoreSecurityAlarm","type":"error"},{"inputs":[],"name":"UnmuteFailed","type":"error"},{"inputs":[],"name":"ZeroMints","type":"error"},{"inputs":[],"name":"___0_0_0___","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"level","type":"uint256"}],"name":"AvatarLevelUp","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"fromTokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"toTokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"fromAddress","type":"address"},{"indexed":true,"internalType":"address","name":"toAddress","type":"address"}],"name":"ConsecutiveTransfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint16","name":"bps","type":"uint16"}],"name":"DefaultRoyaltySet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"enum StatefulSale.SaleState","name":"newSaleState","type":"uint8"}],"name":"SaleStateChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"MAX_PAID_SUPPLY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_SUPPLY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PRICE_DISCOUNTED","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PRICE_FULL","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SANPASS","outputs":[{"internalType":"contract ISANPASS","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SANSWAP_ADDR","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SANWEAR","outputs":[{"internalType":"contract ISANWEAR","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SIGNER","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_SOUNDSCAPE_MUTED_","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_THE_UNMUTOOOOR_","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"_3_3_3_","type":"bytes"}],"name":"_THREE_THREE_THREE_","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"___","type":"string"}],"name":"___3___","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"___THESE_GO_TO_ELEVEN___","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"avatarLevels","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"baseUri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_from","type":"address"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256[]","name":"_tokenIDs","type":"uint256[]"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"batchSafeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_from","type":"address"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256[]","name":"_tokenIDs","type":"uint256[]"}],"name":"batchTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"contractURI","outputs":[{"internalType":"string","name":"","type":"string"}],"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":"_tokenId","type":"uint256"}],"name":"getVolumeAndFrequency","outputs":[{"internalType":"uint128","name":"volume_","type":"uint128"},{"internalType":"uint128","name":"frequency_","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isRevealed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"_signature","type":"bytes"},{"internalType":"address","name":"_sender","type":"address"},{"internalType":"uint256","name":"_chainId","type":"uint256"},{"internalType":"address","name":"_contract","type":"address"},{"internalType":"enum StatefulSale.SaleState","name":"_state","type":"uint8"},{"internalType":"uint256","name":"_mintLimit","type":"uint256"}],"name":"isValidSignature","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_levelIncreases","type":"uint256"}],"name":"levelUp","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"},{"internalType":"uint256[]","name":"_levelIncreases","type":"uint256[]"}],"name":"levelUpBatch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[5]","name":"_factionMints","type":"uint256[5]"},{"internalType":"uint256[7]","name":"_sanpassBurns","type":"uint256[7]"},{"internalType":"uint256","name":"_mintLimit","type":"uint256"},{"internalType":"bytes","name":"_signature","type":"bytes"}],"name":"mintAllowList","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256[5]","name":"_factionMints","type":"uint256[5]"},{"internalType":"uint256[7]","name":"_sanpassBurns","type":"uint256[7]"},{"internalType":"uint256","name":"_mintLimit","type":"uint256"},{"internalType":"bytes","name":"_signature","type":"bytes"}],"name":"mintMembersList","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256[5]","name":"_factionMints","type":"uint256[5]"},{"internalType":"uint256[7]","name":"_sanpassBurns","type":"uint256[7]"}],"name":"mintPublic","outputs":[],"stateMutability":"payable","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":"paidMintsRemaining","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"salePrice","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"saleState","outputs":[{"internalType":"enum StatefulSale.SaleState","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_newBaseUri","type":"string"},{"internalType":"bool","name":"_isRevealed","type":"bool"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_newContractURI","type":"string"}],"name":"setContractURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_receiver","type":"address"},{"internalType":"uint96","name":"_feeNumerator","type":"uint96"}],"name":"setDefaultRoyalty","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"enum StatefulSale.SaleState","name":"_state","type":"uint8"}],"name":"setSaleState","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_sanswap","type":"address"}],"name":"setSanswap","outputs":[],"stateMutability":"nonpayable","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":"tokenFaction","outputs":[{"internalType":"enum IAvatarVolumeAndFrequency.Faction","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tokenFactionBitmap","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"enum StatefulSale.SaleState","name":"","type":"uint8"}],"name":"userMinted","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_weiAmount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawAll","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60e0604052610d13805460ff1916600117905561044c610d16553480156200002657600080fd5b5060405162004a5038038062004a5083398101604081905262000049916200082d565b816040518060400160405280601f81526020017f536f756e64736361706520417661746172732062792053414e20534f554e44008152506040518060400160405280600581526020016429a0a720ab60d91b815250620000ae620001dc60201b60201c565b6001600160a01b038116620000de57604051631e4fbdf760e01b8152600060048201526024015b60405180910390fd5b620000e981620001e0565b506001620000f8838262000971565b50600262000107828262000971565b5050506001600160a01b03166080526200012386600062000230565b610d1762000132868262000971565b506001600160a01b0380851660a052831660c052620001538160fa62000255565b620001618161012c620002aa565b505061012c610d155550507f468d8d1b1a36346c68d8d1b1a36346c68d8d1b1a36346c68d8d1b1a36346c688610d1a5550507f468d8d1b1a36346c68d8d1b1a36346c68d8d1b1a36346c68d8d1b1a36346c68d610d1b819055610d1c55507102c68d8d1b1a36346c68d8d1b1a36346c68d610d1d5562000ab6565b3390565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b610d186200023f838262000971565b50610d19805460ff191691151591909117905550565b62000261828262000406565b604080516001600160a01b038416815261ffff831660208201527f2c5ea6e4103e78cb101e796fb2dace540362fc542cbff5145eaa24af7dd8fe41910160405180910390a15050565b600080620002b7620004ad565b90506001600160601b03831615620003fd57303b15620002ea576040516329cfc83160e11b815260040160405180910390fd5b6001600160a01b0384166200031657604051633250574960e11b815260006004820152602401620000d5565b6113886001600160601b03841681101562000357576040516308f58e5760e41b81526001600160601b038516600482015260248101829052604401620000d5565b6000600162000367868562000a53565b62000373919062000a7d565b90506200038360078288620004e4565b50506001600160a01b038616600090815260046020526040902080546001600160601b0387160190556040516001600160601b0382811682526001600160a01b038816916000918616907fdeaa91b6123d068f5821d0fb0678463d1a8a6079fe8af5de3ce5e896dcf9133d9060200160405180910390a450505b90505b92915050565b6127106001600160601b0382168110156200044757604051636f483d0960e01b81526001600160601b038316600482015260248101829052604401620000d5565b6001600160a01b0383166200047357604051635b6cc80560e11b815260006004820152602401620000d5565b50604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b90910217600a55565b60008080620004bd600762000501565b509150915081620004d0576001620004dd565b620004dd81600162000a53565b9250505090565b600080620004f485858562000599565b915091505b935093915050565b805460009081908190808203620005245760008060009350935093505062000592565b600062000546866200053860018562000aa0565b600091825260209091200190565b6040805180820190915290546001600160601b0381168083526c010000000000000000000000009091046001600160a01b03166020909201829052600196509450925062000592915050565b9193909250565b825460009081908015620006e2576000620005bb876200053860018562000aa0565b6040805180820190915290546001600160601b038082168084526c010000000000000000000000009092046001600160a01b0316602084015291925090871610156200061a57604051632520601d60e01b815260040160405180910390fd5b80516001600160601b0380881691160362000676578462000642886200053860018662000aa0565b80546001600160a01b03929092166c01000000000000000000000000026001600160601b03909216919091179055620006d1565b604080518082019091526001600160601b0380881682526001600160a01b0380881660208085019182528b54600181018d5560008d815291909120945191519092166c01000000000000000000000000029216919091179101555b602001519250839150620004f99050565b5050604080518082019091526001600160601b0380851682526001600160a01b0380851660208085019182528854600181018a5560008a8152918220955192519093166c01000000000000000000000000029190931617920191909155905081620004f9565b634e487b7160e01b600052604160045260246000fd5b600082601f8301126200077057600080fd5b81516001600160401b03808211156200078d576200078d62000748565b604051601f8301601f19908116603f01168101908282118183101715620007b857620007b862000748565b8160405283815260209250866020858801011115620007d657600080fd5b600091505b83821015620007fa5785820183015181830184015290820190620007db565b6000602085830101528094505050505092915050565b80516001600160a01b03811681146200082857600080fd5b919050565b60008060008060008060c087890312156200084757600080fd5b86516001600160401b03808211156200085f57600080fd5b6200086d8a838b016200075e565b975060208901519150808211156200088457600080fd5b506200089389828a016200075e565b955050620008a46040880162000810565b9350620008b46060880162000810565b9250620008c46080880162000810565b9150620008d460a0880162000810565b90509295509295509295565b600181811c90821680620008f557607f821691505b6020821081036200091657634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200096c576000816000526020600020601f850160051c81016020861015620009475750805b601f850160051c820191505b81811015620009685782815560010162000953565b5050505b505050565b81516001600160401b038111156200098d576200098d62000748565b620009a5816200099e8454620008e0565b846200091c565b602080601f831160018114620009dd5760008415620009c45750858301515b600019600386901b1c1916600185901b17855562000968565b600085815260208120601f198616915b8281101562000a0e57888601518255948401946001909101908401620009ed565b508582101562000a2d5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b634e487b7160e01b600052601160045260246000fd5b6001600160601b0381811683821601908082111562000a765762000a7662000a3d565b5092915050565b6001600160601b0382811682821603908082111562000a765762000a7662000a3d565b8181038181111562000400576200040062000a3d565b60805160a05160c051613f4e62000b0260003960008181610530015281816128b901526129c30152600081816108f001526120db01526000818161065801526117040152613f4e6000f3fe60806040526004361061036b5760003560e01c806386e34a3b116101c6578063c802066a116100f7578063e985e9c511610095578063f2b69fb31161006f578063f2b69fb314610a7b578063f2fde38b14610a8e578063f34ca3bd14610aae578063f3993d1114610ace57600080fd5b8063e985e9c5146109fd578063eab602c314610a46578063ee9ec17c14610a6657600080fd5b8063d1973a4d116100d1578063d1973a4d1461099b578063d1a4e0e2146109b2578063e8a3d485146109c8578063e90788da146109dd57600080fd5b8063c802066a14610912578063c87b56dd1461095b578063cd6b16631461097b57600080fd5b8063a22cb46511610164578063b64b21ca1161013e578063b64b21ca1461088b578063b71c929d146108ab578063b88d4fde146108be578063c30633e9146108de57600080fd5b8063a22cb4651461082f578063a81fd78f1461084f578063add03a301461086f57600080fd5b8063938e3d7b116101a0578063938e3d7b146107c557806394797588146107e557806395d89b41146108055780639abc83201461081a57600080fd5b806386e34a3b1461075e5780638da5cb5b1461078b57806392f4c917146107a957600080fd5b80633b6d9eab116102a05780635a67de071161023e5780636f8957dc116102185780636f8957dc1461070157806370a0823114610714578063715018a614610734578063853828b61461074957600080fd5b80635a67de071461069a578063603f4d52146106ba5780636352211e146106e157600080fd5b80635226dc931161027a5780635226dc931461060b57806354214f691461062b578063582abd12146106465780635a4fee301461067a57600080fd5b80633b6d9eab146105b057806342842e0e146105cb57806345e5d377146105eb57600080fd5b806323b872dd1161030d5780632c7a8d63116102e75780632c7a8d631461051e5780632e1a7d4d1461055257806332cb6b0c1461057257806334671f091461058857600080fd5b806323b872dd1461049f57806325898bb3146104bf5780632a55205a146104df57600080fd5b806306fdde031161034957806306fdde031461040e578063081812fc14610430578063095ea7b31461046857806318160ddd1461048857600080fd5b806301ffc9a7146103705780630455baeb146103a557806304634d8d146103ec575b600080fd5b34801561037c57600080fd5b5061039061038b3660046131c2565b610aee565b60405190151581526020015b60405180910390f35b3480156103b157600080fd5b506103de6103c036600461320a565b610d4260209081526000928352604080842090915290825290205481565b60405190815260200161039c565b3480156103f857600080fd5b5061040c61040736600461323d565b610aff565b005b34801561041a57600080fd5b50610423610b15565b60405161039c91906132d5565b34801561043c57600080fd5b5061045061044b3660046132e8565b610ba7565b6040516001600160a01b03909116815260200161039c565b34801561047457600080fd5b5061040c610483366004613301565b610bd0565b34801561049457600080fd5b506103de610d155481565b3480156104ab57600080fd5b5061040c6104ba36600461332b565b610bdb565b3480156104cb57600080fd5b5061040c6104da3660046133a9565b610c84565b3480156104eb57600080fd5b506104ff6104fa3660046133eb565b610c9f565b604080516001600160a01b03909316835260208301919091520161039c565b34801561052a57600080fd5b506104507f000000000000000000000000000000000000000000000000000000000000000081565b34801561055e57600080fd5b5061040c61056d3660046132e8565b610d7e565b34801561057e57600080fd5b506103de610d0581565b34801561059457600080fd5b50610450734832344cf14896818229d81c44c2040aaf1f1a9581565b3480156105bc57600080fd5b50610d13546103909060ff1681565b3480156105d757600080fd5b5061040c6105e636600461332b565b610e08565b3480156105f757600080fd5b50600c54610450906001600160a01b031681565b34801561061757600080fd5b5061040c6106263660046133eb565b610e23565b34801561063757600080fd5b50610d19546103909060ff1681565b34801561065257600080fd5b506104507f000000000000000000000000000000000000000000000000000000000000000081565b34801561068657600080fd5b5061040c610695366004613452565b610e7a565b3480156106a657600080fd5b5061040c6106b53660046134e3565b610ef0565b3480156106c657600080fd5b506009546106d49060ff1681565b60405161039c9190613528565b3480156106ed57600080fd5b506104506106fc3660046132e8565b610f56565b61040c61070f366004613558565b610f61565b34801561072057600080fd5b506103de61072f3660046135cc565b610fc6565b34801561074057600080fd5b5061040c611027565b34801561075557600080fd5b5061040c61103b565b34801561076a57600080fd5b5061077e6107793660046132e8565b61104c565b60405161039c91906135e7565b34801561079757600080fd5b506000546001600160a01b0316610450565b3480156107b557600080fd5b506103de670429d069189e000081565b3480156107d157600080fd5b5061040c6107e03660046133a9565b6110ba565b3480156107f157600080fd5b506103de6108003660046132e8565b6110d0565b34801561081157600080fd5b506104236110e8565b34801561082657600080fd5b506104236110f7565b34801561083b57600080fd5b5061040c61084a366004613611565b611186565b34801561085b57600080fd5b506103de61086a3660046132e8565b611191565b34801561087b57600080fd5b506103de6702c68af0bb14000081565b34801561089757600080fd5b5061040c6108a636600461363b565b6111a2565b61040c6108b936600461368f565b6111eb565b3480156108ca57600080fd5b5061040c6108d9366004613748565b611250565b3480156108ea57600080fd5b506104507f000000000000000000000000000000000000000000000000000000000000000081565b34801561091e57600080fd5b5061093261092d3660046132e8565b611267565b604080516fffffffffffffffffffffffffffffffff93841681529290911660208301520161039c565b34801561096757600080fd5b506104236109763660046132e8565b6112d5565b34801561098757600080fd5b5061040c6109963660046137c4565b61134e565b3480156109a757600080fd5b506103de610d165481565b3480156109be57600080fd5b506103de61044c81565b3480156109d457600080fd5b506104236113e8565b3480156109e957600080fd5b5061040c6109f83660046135cc565b6113f6565b348015610a0957600080fd5b50610390610a18366004613830565b6001600160a01b03918216600090815260066020908152604080832093909416825291909152205460ff1690565b348015610a5257600080fd5b5061040c610a6136600461385a565b611438565b348015610a7257600080fd5b5061040c61147f565b61040c610a89366004613558565b6115f4565b348015610a9a57600080fd5b5061040c610aa93660046135cc565b6115fb565b348015610aba57600080fd5b50610390610ac93660046138a3565b61164f565b348015610ada57600080fd5b5061040c610ae936600461392c565b61173b565b6000610af982611771565b92915050565b610b076117c7565b610b11828261180d565b5050565b606060018054610b2490613981565b80601f0160208091040260200160405190810160405280929190818152602001828054610b5090613981565b8015610b9d5780601f10610b7257610100808354040283529160200191610b9d565b820191906000526020600020905b815481529060010190602001808311610b8057829003601f168201915b5050505050905090565b6000610bb282611860565b506000828152600560205260409020546001600160a01b0316610af9565b610b118282336118b1565b6001600160a01b038216610c0a57604051633250574960e11b8152600060048201526024015b60405180910390fd5b6000610c178383336118be565b9050836001600160a01b0316816001600160a01b031614610c7e576040517f64283d7b0000000000000000000000000000000000000000000000000000000081526001600160a01b0380861660048301526024820184905282166044820152606401610c01565b50505050565b610c8c6117c7565b610d14610c9a828483613a03565b505050565b6000828152600b602090815260408083208151808301909252546001600160a01b038116808352740100000000000000000000000000000000000000009091046bffffffffffffffffffffffff16928201929092528291610d40575060408051808201909152600a546001600160a01b03811682527401000000000000000000000000000000000000000090046bffffffffffffffffffffffff1660208201525b602081015160009061271090610d64906bffffffffffffffffffffffff1687613ad9565b610d6e9190613b06565b91519350909150505b9250929050565b610d866117c7565b604051600090339083908381818185875af1925050503d8060008114610dc8576040519150601f19603f3d011682016040523d82523d6000602084013e610dcd565b606091505b5050905080610b11576040517f2684a07900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610c9a83838360405180602001604052806000815250611250565b600c546001600160a01b0316336001600160a01b031614610e70576040517fec2e987700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610b11828261199a565b60005b83811015610ee757610edf8787878785818110610e9c57610e9c613b1a565b9050602002013586868080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061125092505050565b600101610e7d565b50505050505050565b610ef86117c7565b6009805482919060ff19166001836003811115610f1757610f176134fe565b02179055507f92a17b827ee9d42ea9454bb4ca941a1800870e6d01c0842d09ba23ccc0190ee181604051610f4b9190613528565b60405180910390a150565b6000610af982611860565b60025b60095460ff166003811115610f7b57610f7b6134fe565b14610fb2576040517fd2ab239f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610fbf8585858585611a4d565b5050505050565b60006001600160a01b03821661100b576040517f89c62b6400000000000000000000000000000000000000000000000000000000815260006004820152602401610c01565b506001600160a01b031660009081526004602052604090205490565b61102f6117c7565b6110396000611ab2565b565b6110436117c7565b61103947610d7e565b600061105782611860565b50600161106660036002613c14565b6110709190613c20565b61107b605584613c33565b611086906003613ad9565b610d1a611094605586613b06565b602881106110a4576110a4613b1a565b0154901c166005811115610af957610af96134fe565b6110c26117c7565b610d17610c9a828483613a03565b610d1a81602881106110e157600080fd5b0154905081565b606060028054610b2490613981565b610d18805461110590613981565b80601f016020809104026020016040519081016040528092919081815260200182805461113190613981565b801561117e5780601f106111535761010080835404028352916020019161117e565b820191906000526020600020905b81548152906001019060200180831161116157829003601f168201915b505050505081565b610b11338383611b1a565b600d81610d0681106110e157600080fd5b6111aa6117c7565b610c9a83838080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250859250611bd2915050565b600360095460ff166003811115611204576112046134fe565b1461123b576040517fd2ab239f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610b1182826000670429d069189e0000611bf5565b61125b848484610bdb565b610c7e84848484612173565b6000808215806112785750610d0583115b156112af576040517f3f6cc76800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000600d84610d0681106112c5576112c5613b1a565b015494608086901c945092505050565b60606112e082611860565b5060006112eb6122df565b9050600081511161130b5760405180602001604052806000815250611347565b610d195460ff1661131c5780611347565b80611326846122ef565b604051602001611337929190613c47565b6040516020818303038152906040525b9392505050565b600c546001600160a01b0316336001600160a01b03161461139b576040517fec2e987700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b83811015610fbf576113e08585838181106113bb576113bb613b1a565b905060200201358484848181106113d4576113d4613b1a565b9050602002013561199a565b60010161139e565b610d17805461110590613981565b6113fe6117c7565b600c80547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b333014611471576040517f62c1430e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61147c816001611bd2565b50565b610d135460ff1615156000036114c1576040517fe679626600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b33734832344cf14896818229d81c44c2040aaf1f1a951461150e576040517f2603c33600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610d14805461151c90613981565b9050600003611557576040517f34e82fe600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610d13805460ff19169055604051600090309061157790610d1490613c9e565b6000604051808303816000865af19150503d80600081146115b4576040519150601f19603f3d011682016040523d82523d6000602084013e6115b9565b606091505b505090508061147c576040517f9823765f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001610f64565b6116036117c7565b6001600160a01b038116611646576040517f1e4fbdf700000000000000000000000000000000000000000000000000000000815260006004820152602401610c01565b61147c81611ab2565b6000806116b7878787878760405160200161166e959493929190613d14565b604051602081830303815290604052805190602001207f19457468657265756d205369676e6564204d6573736167653a0a3332000000006000908152601c91909152603c902090565b90506116f9818a8a8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061238f92505050565b6001600160a01b03167f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031614915050979650505050505050565b60005b81811015610fbf57611769858585858581811061175d5761175d613b1a565b90506020020135610bdb565b60010161173e565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f2a55205a000000000000000000000000000000000000000000000000000000001480610af95750610af9826123b9565b6000546001600160a01b03163314611039576040517f118cdaa7000000000000000000000000000000000000000000000000000000008152336004820152602401610c01565b611817828261249c565b604080516001600160a01b038416815261ffff831660208201527f2c5ea6e4103e78cb101e796fb2dace540362fc542cbff5145eaa24af7dd8fe41910160405180910390a15050565b60008061186c83612591565b90506001600160a01b038116610af9576040517f7e27328900000000000000000000000000000000000000000000000000000000815260048101849052602401610c01565b610c9a8383836001612612565b6000806118cc858585612768565b90506001600160a01b0381161580156118e45750303b155b1561191b576040517fad89505200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b0385161580156119465750611935612874565b6bffffffffffffffffffffffff1684105b801561196c5750600884811c60009081526020919091526040902054600160ff86161b16155b1561199257600884811c6000908152602091909152604090208054600160ff87161b1790555b949350505050565b8115806119a85750610d0582115b156119df576040517f3f6cc76800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600081600d84610d0681106119f6576119f6613b1a565b016000828254611a069190613d50565b9250508190559050827f564c02dc18b210b89920ed8d3a85425a1dd6cf68b282eb21706f0763b470a85a82604051611a4091815260200190565b60405180910390a2505050565b611a638282336009544690309060ff168961164f565b1515600003611a9e576040517f8baa579f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610fbf8585856702c68af0bb140000611bf5565b600080546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b038216611b65576040517f5b08ba180000000000000000000000000000000000000000000000000000000081526001600160a01b0383166004820152602401610c01565b6001600160a01b03838116600081815260066020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b610d18611bdf8382613d63565b50610d19805460ff191691151591909117905550565b60608060608060008060005b6007811015611c67576005811015611c395760008b8260058110611c2757611c27613b1a565b60200201351115611c39578260010192505b60008a8260078110611c4d57611c4d613b1a565b60200201351115611c5f578160010191505b600101611c01565b5081600003611ca2576040517f15d0124b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8167ffffffffffffffff811115611cbb57611cbb6136bc565b604051908082528060200260200182016040528015611ce4578160200160208202803683370190505b5095508167ffffffffffffffff811115611d0057611d006136bc565b604051908082528060200260200182016040528015611d29578160200160208202803683370190505b5094508067ffffffffffffffff811115611d4557611d456136bc565b604051908082528060200260200182016040528015611d6e578160200160208202803683370190505b5093508067ffffffffffffffff811115611d8a57611d8a6136bc565b604051908082528060200260200182016040528015611db3578160200160208202803683370190505b509250505060008060008060005b6007811015611efa5760008c8260078110611dde57611dde613b1a565b602002013590508015611e3857808501945081600101888481518110611e0657611e06613b1a565b60200260200101818152505080878480600101955081518110611e2b57611e2b613b1a565b6020026020010181815250505b6004821115611e475750611ef2565b60008e8360058110611e5b57611e5b613b1a565b6020020135905080821115611e9c576040517f01eb547d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8015611eef578087019650826001018b8681518110611ebd57611ebd613b1a565b602002602001018181525050808a8680600101975081518110611ee257611ee2613b1a565b6020026020010181815250505b50505b600101611dc1565b5083831115611f35576040517f01eb547d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b828403848414611fc257808a023414611f7a576040517ffc512fde00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610d1654811115611fb7576040517f991390df00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610d16805482900390555b60095460ff166003816003811115611fdc57611fdc6134fe565b10156120ac57336000908152610d4260205260408120879082846003811115612007576120076134fe565b6003811115612018576120186134fe565b8152602001908152602001600020540190508c811115612064576040517f76d750a000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b336000908152610d42602052604081208291846003811115612088576120886134fe565b6003811115612099576120996134fe565b8152602081019190915260400160002055505b87511561214f576040517f6b20c4540000000000000000000000000000000000000000000000000000000081527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690636b20c4549061211c9033908c908c90600401613e5f565b600060405180830381600087803b15801561213657600080fd5b505af115801561214a573d6000803e3d6000fd5b505050505b6121598a8a6128a6565b6121638a8a612a04565b5050505050505050505050505050565b6001600160a01b0383163b15610c7e576040517f150b7a020000000000000000000000000000000000000000000000000000000081526001600160a01b0384169063150b7a02906121ce903390889087908790600401613e9d565b6020604051808303816000875af1925050508015612209575060408051601f3d908101601f1916820190925261220691810190613ecf565b60015b612272573d808015612237576040519150601f19603f3d011682016040523d82523d6000602084013e61223c565b606091505b50805160000361226a57604051633250574960e11b81526001600160a01b0385166004820152602401610c01565b805181602001fd5b7fffffffff0000000000000000000000000000000000000000000000000000000081167f150b7a020000000000000000000000000000000000000000000000000000000014610fbf57604051633250574960e11b81526001600160a01b0385166004820152602401610c01565b6060610d188054610b2490613981565b606060006122fc83612b8a565b600101905060008167ffffffffffffffff81111561231c5761231c6136bc565b6040519080825280601f01601f191660200182016040528015612346576020820181803683370190505b5090508181016020015b600019017f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a850494508461235057509392505050565b60008060008061239f8686612c6c565b9250925092506123af8282612cb9565b5090949350505050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f80ac58cd00000000000000000000000000000000000000000000000000000000148061244c57507fffffffff0000000000000000000000000000000000000000000000000000000082167f5b5e139f00000000000000000000000000000000000000000000000000000000145b80610af957507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000831614610af9565b6127106bffffffffffffffffffffffff82168110156124fe576040517f6f483d090000000000000000000000000000000000000000000000000000000081526bffffffffffffffffffffffff8316600482015260248101829052604401610c01565b6001600160a01b038316612541576040517fb6d9900a00000000000000000000000000000000000000000000000000000000815260006004820152602401610c01565b50604080518082019091526001600160a01b039092168083526bffffffffffffffffffffffff90911660209092018290527401000000000000000000000000000000000000000090910217600a55565b6000818152600360205260408120546001600160a01b0316801515806125c257506bffffffffffffffffffffffff83115b806125cd5750600183105b156125d85792915050565b600883811c60009081526020919091526040902054600160ff85161b1661260957612604600784612dbd565b611347565b60009392505050565b808061262657506001600160a01b03821615155b1561272057600061263684611860565b90506001600160a01b038316158015906126625750826001600160a01b0316816001600160a01b031614155b801561269457506001600160a01b0380821660009081526006602090815260408083209387168352929052205460ff16155b156126d6576040517fa9fbf51f0000000000000000000000000000000000000000000000000000000081526001600160a01b0384166004820152602401610c01565b811561271e5783856001600160a01b0316826001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45b505b5050600090815260056020526040902080547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b60008061277484612591565b90506001600160a01b0383161561279057612790818486612e0e565b6001600160a01b038116156127ce576127ad600085600080612612565b6001600160a01b038116600090815260046020526040902080546000190190555b6001600160a01b038516156127fd576001600160a01b0385166000908152600460205260409020805460010190555b60008481526003602052604080822080547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0389811691821790925591518793918516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4949350505050565b60008060006128836007612ea4565b50915091508161289457600161289f565b61289f816001613eec565b9250505090565b600182511161299b576001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001663156e29f633846000815181106128f2576128f2613b1a565b60200260200101518460008151811061290d5761290d613b1a565b60209081029190910101516040517fffffffff0000000000000000000000000000000000000000000000000000000060e086901b1681526001600160a01b039093166004840152602483019190915260448201526064015b600060405180830381600087803b15801561297f57600080fd5b505af1158015612993573d6000803e3d6000fd5b505050505050565b6040517fd81d0a150000000000000000000000000000000000000000000000000000000081527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063d81d0a159061296590339086908690600401613e5f565b610d155460006055600183010490508060006055600185010660030286600081518110612a3357612a33613b1a565b6020026020010151901b610d1a8460288110612a5157612a51613b1a565b015417905060005b8651811015612b2b576000868281518110612a7657612a76613b1a565b6020026020010151905060005b81811015612b21576001909601958683151580612aa05750600082115b15612b0e5760558104965085871115612ae65784610d1a8760288110612ac857612ac8613b1a565b0155610d1a8760288110612ade57612ade613b1a565b015494508695505b605581066003028a8581518110612aff57612aff613b1a565b6020026020010151901b851794505b612b183382612f3b565b50600101612a83565b5050600101612a59565b5080610d1a8460288110612b4157612b41613b1a565b0155610d05841115612b7f576040517fc30436e900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b505050610d15555050565b6000807a184f03e93ff9f4daa797ed6e38ed64bf6a1f0100000000000000008310612bd3577a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000830492506040015b6d04ee2d6d415b85acef81000000008310612bff576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc100008310612c1d57662386f26fc10000830492506010015b6305f5e1008310612c35576305f5e100830492506008015b6127108310612c4957612710830492506004015b60648310612c5b576064830492506002015b600a8310610af95760010192915050565b60008060008351604103612ca65760208401516040850151606086015160001a612c9888828585612fb9565b955095509550505050612cb2565b50508151600091506002905b9250925092565b6000826003811115612ccd57612ccd6134fe565b03612cd6575050565b6001826003811115612cea57612cea6134fe565b03612d21576040517ff645eedf00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6002826003811115612d3557612d356134fe565b03612d6f576040517ffce698f700000000000000000000000000000000000000000000000000000000815260048101829052602401610c01565b6003826003811115612d8357612d836134fe565b03610b11576040517fd78bce0c00000000000000000000000000000000000000000000000000000000815260048101829052602401610c01565b815460009081612dcf85858385613088565b9050818114612e02576000858152602090208101546c0100000000000000000000000090046001600160a01b0316612e05565b60005b95945050505050565b612e198383836130f6565b610c9a576001600160a01b038316612e60576040517f7e27328900000000000000000000000000000000000000000000000000000000815260048101829052602401610c01565b6040517f177e802f0000000000000000000000000000000000000000000000000000000081526001600160a01b038316600482015260248101829052604401610c01565b805460009081908190808203612ec557600080600093509350935050612f34565b6000612ee486612ed6600185613c20565b600091825260209091200190565b6040805180820190915290546bffffffffffffffffffffffff81168083526c010000000000000000000000009091046001600160a01b031660209092018290526001965094509250612f34915050565b9193909250565b6001600160a01b038216612f6557604051633250574960e11b815260006004820152602401610c01565b6000612f73838360006118be565b90506001600160a01b03811615610c9a576040517f73c6ac6e00000000000000000000000000000000000000000000000000000000815260006004820152602401610c01565b600080807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0841115612ff4575060009150600390508261307e565b604080516000808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa158015613048573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166130745750600092506001915082905061307e565b9250600091508190505b9450945094915050565b60005b818310156130ee57600061309f8484613179565b6000878152602090209091506bffffffffffffffffffffffff8616908201546bffffffffffffffffffffffff1610156130e4576130dd816001613d50565b93506130e8565b8092505b5061308b565b509392505050565b60006001600160a01b038316158015906119925750826001600160a01b0316846001600160a01b0316148061315057506001600160a01b0380851660009081526006602090815260408083209387168352929052205460ff165b806119925750506000908152600560205260409020546001600160a01b03908116911614919050565b60006131886002848418613b06565b61134790848416613d50565b7fffffffff000000000000000000000000000000000000000000000000000000008116811461147c57600080fd5b6000602082840312156131d457600080fd5b813561134781613194565b80356001600160a01b03811681146131f657600080fd5b919050565b8035600481106131f657600080fd5b6000806040838503121561321d57600080fd5b613226836131df565b9150613234602084016131fb565b90509250929050565b6000806040838503121561325057600080fd5b613259836131df565b915060208301356bffffffffffffffffffffffff8116811461327a57600080fd5b809150509250929050565b60005b838110156132a0578181015183820152602001613288565b50506000910152565b600081518084526132c1816020860160208601613285565b601f01601f19169290920160200192915050565b60208152600061134760208301846132a9565b6000602082840312156132fa57600080fd5b5035919050565b6000806040838503121561331457600080fd5b61331d836131df565b946020939093013593505050565b60008060006060848603121561334057600080fd5b613349846131df565b9250613357602085016131df565b9150604084013590509250925092565b60008083601f84011261337957600080fd5b50813567ffffffffffffffff81111561339157600080fd5b602083019150836020828501011115610d7757600080fd5b600080602083850312156133bc57600080fd5b823567ffffffffffffffff8111156133d357600080fd5b6133df85828601613367565b90969095509350505050565b600080604083850312156133fe57600080fd5b50508035926020909101359150565b60008083601f84011261341f57600080fd5b50813567ffffffffffffffff81111561343757600080fd5b6020830191508360208260051b8501011115610d7757600080fd5b6000806000806000806080878903121561346b57600080fd5b613474876131df565b9550613482602088016131df565b9450604087013567ffffffffffffffff8082111561349f57600080fd5b6134ab8a838b0161340d565b909650945060608901359150808211156134c457600080fd5b506134d189828a01613367565b979a9699509497509295939492505050565b6000602082840312156134f557600080fd5b611347826131fb565b634e487b7160e01b600052602160045260246000fd5b60048110613524576135246134fe565b9052565b60208101610af98284613514565b8060a08101831015610af957600080fd5b8060e08101831015610af957600080fd5b60008060008060006101c0868803121561357157600080fd5b61357b8787613536565b945061358a8760a08801613547565b935061018086013592506101a086013567ffffffffffffffff8111156135af57600080fd5b6135bb88828901613367565b969995985093965092949392505050565b6000602082840312156135de57600080fd5b611347826131df565b60208101600683106135fb576135fb6134fe565b91905290565b803580151581146131f657600080fd5b6000806040838503121561362457600080fd5b61362d836131df565b915061323460208401613601565b60008060006040848603121561365057600080fd5b833567ffffffffffffffff81111561366757600080fd5b61367386828701613367565b9094509250613686905060208501613601565b90509250925092565b60008061018083850312156136a357600080fd5b6136ad8484613536565b91506132348460a08501613547565b634e487b7160e01b600052604160045260246000fd5b600067ffffffffffffffff808411156136ed576136ed6136bc565b604051601f8501601f19908116603f01168101908282118183101715613715576137156136bc565b8160405280935085815286868601111561372e57600080fd5b858560208301376000602087830101525050509392505050565b6000806000806080858703121561375e57600080fd5b613767856131df565b9350613775602086016131df565b925060408501359150606085013567ffffffffffffffff81111561379857600080fd5b8501601f810187136137a957600080fd5b6137b8878235602084016136d2565b91505092959194509250565b600080600080604085870312156137da57600080fd5b843567ffffffffffffffff808211156137f257600080fd5b6137fe8883890161340d565b9096509450602087013591508082111561381757600080fd5b506138248782880161340d565b95989497509550505050565b6000806040838503121561384357600080fd5b61384c836131df565b9150613234602084016131df565b60006020828403121561386c57600080fd5b813567ffffffffffffffff81111561388357600080fd5b8201601f8101841361389457600080fd5b611992848235602084016136d2565b600080600080600080600060c0888a0312156138be57600080fd5b873567ffffffffffffffff8111156138d557600080fd5b6138e18a828b01613367565b90985096506138f49050602089016131df565b945060408801359350613909606089016131df565b9250613917608089016131fb565b915060a0880135905092959891949750929550565b6000806000806060858703121561394257600080fd5b61394b856131df565b9350613959602086016131df565b9250604085013567ffffffffffffffff81111561397557600080fd5b6138248782880161340d565b600181811c9082168061399557607f821691505b6020821081036139b557634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115610c9a576000816000526020600020601f850160051c810160208610156139e45750805b601f850160051c820191505b81811015612993578281556001016139f0565b67ffffffffffffffff831115613a1b57613a1b6136bc565b613a2f83613a298354613981565b836139bb565b6000601f841160018114613a635760008515613a4b5750838201355b600019600387901b1c1916600186901b178355610fbf565b600083815260209020601f19861690835b82811015613a945786850135825560209485019460019092019101613a74565b5086821015613ab15760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b634e487b7160e01b600052601160045260246000fd5b8082028115828204841417610af957610af9613ac3565b634e487b7160e01b600052601260045260246000fd5b600082613b1557613b15613af0565b500490565b634e487b7160e01b600052603260045260246000fd5b600181815b80851115613b6b578160001904821115613b5157613b51613ac3565b80851615613b5e57918102915b93841c9390800290613b35565b509250929050565b600082613b8257506001610af9565b81613b8f57506000610af9565b8160018114613ba55760028114613baf57613bcb565b6001915050610af9565b60ff841115613bc057613bc0613ac3565b50506001821b610af9565b5060208310610133831016604e8410600b8410161715613bee575081810a610af9565b613bf88383613b30565b8060001904821115613c0c57613c0c613ac3565b029392505050565b60006113478383613b73565b81810381811115610af957610af9613ac3565b600082613c4257613c42613af0565b500690565b60008351613c59818460208801613285565b835190830190613c6d818360208801613285565b7f2e6a736f6e0000000000000000000000000000000000000000000000000000009101908152600501949350505050565b6000808354613cac81613981565b60018281168015613cc45760018114613cd957613d08565b60ff1984168752821515830287019450613d08565b8760005260208060002060005b85811015613cff5781548a820152908401908201613ce6565b50505082870194505b50929695505050505050565b6001600160a01b038681168252602082018690528416604082015260a08101613d406060830185613514565b8260808301529695505050505050565b80820180821115610af957610af9613ac3565b815167ffffffffffffffff811115613d7d57613d7d6136bc565b613d9181613d8b8454613981565b846139bb565b602080601f831160018114613dc65760008415613dae5750858301515b600019600386901b1c1916600185901b178555612993565b600085815260208120601f198616915b82811015613df557888601518255948401946001909101908401613dd6565b5085821015613e135787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60008151808452602080850194506020840160005b83811015613e5457815187529582019590820190600101613e38565b509495945050505050565b6001600160a01b0384168152606060208201526000613e816060830185613e23565b8281036040840152613e938185613e23565b9695505050505050565b60006001600160a01b03808716835280861660208401525083604083015260806060830152613e9360808301846132a9565b600060208284031215613ee157600080fd5b815161134781613194565b6bffffffffffffffffffffffff818116838216019080821115613f1157613f11613ac3565b509291505056fea2646970667358221220e76052a912860b6049ab5476d3aca26ff32dfe5b888e17c7a747a7cac4b0f02064736f6c6343000816003300000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000140000000000000000000000000512c8c57c97905134b12a8ab8479b57a327aa6ec000000000000000000000000ae2bc979178e97e0688384aab00055e67bea91ed000000000000000000000000fa4c6947adfef7614f48e99141fa3fec38692ee500000000000000000000000050ad8fdbc19ea06fd9383f1262ce691dc53fa99f0000000000000000000000000000000000000000000000000000000000000043697066733a2f2f6261667962656962707473356e6f7679756f766a6c78767975777a64703478683336736971637666796e697564686e75767537377965697a696e712f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000042697066733a2f2f6261667962656968646678626c6165647069686f36356e32776532366e6d6c6261796163616e697573656c36376b76767134656533756c6b646169000000000000000000000000000000000000000000000000000000000000
Deployed Bytecode
0x60806040526004361061036b5760003560e01c806386e34a3b116101c6578063c802066a116100f7578063e985e9c511610095578063f2b69fb31161006f578063f2b69fb314610a7b578063f2fde38b14610a8e578063f34ca3bd14610aae578063f3993d1114610ace57600080fd5b8063e985e9c5146109fd578063eab602c314610a46578063ee9ec17c14610a6657600080fd5b8063d1973a4d116100d1578063d1973a4d1461099b578063d1a4e0e2146109b2578063e8a3d485146109c8578063e90788da146109dd57600080fd5b8063c802066a14610912578063c87b56dd1461095b578063cd6b16631461097b57600080fd5b8063a22cb46511610164578063b64b21ca1161013e578063b64b21ca1461088b578063b71c929d146108ab578063b88d4fde146108be578063c30633e9146108de57600080fd5b8063a22cb4651461082f578063a81fd78f1461084f578063add03a301461086f57600080fd5b8063938e3d7b116101a0578063938e3d7b146107c557806394797588146107e557806395d89b41146108055780639abc83201461081a57600080fd5b806386e34a3b1461075e5780638da5cb5b1461078b57806392f4c917146107a957600080fd5b80633b6d9eab116102a05780635a67de071161023e5780636f8957dc116102185780636f8957dc1461070157806370a0823114610714578063715018a614610734578063853828b61461074957600080fd5b80635a67de071461069a578063603f4d52146106ba5780636352211e146106e157600080fd5b80635226dc931161027a5780635226dc931461060b57806354214f691461062b578063582abd12146106465780635a4fee301461067a57600080fd5b80633b6d9eab146105b057806342842e0e146105cb57806345e5d377146105eb57600080fd5b806323b872dd1161030d5780632c7a8d63116102e75780632c7a8d631461051e5780632e1a7d4d1461055257806332cb6b0c1461057257806334671f091461058857600080fd5b806323b872dd1461049f57806325898bb3146104bf5780632a55205a146104df57600080fd5b806306fdde031161034957806306fdde031461040e578063081812fc14610430578063095ea7b31461046857806318160ddd1461048857600080fd5b806301ffc9a7146103705780630455baeb146103a557806304634d8d146103ec575b600080fd5b34801561037c57600080fd5b5061039061038b3660046131c2565b610aee565b60405190151581526020015b60405180910390f35b3480156103b157600080fd5b506103de6103c036600461320a565b610d4260209081526000928352604080842090915290825290205481565b60405190815260200161039c565b3480156103f857600080fd5b5061040c61040736600461323d565b610aff565b005b34801561041a57600080fd5b50610423610b15565b60405161039c91906132d5565b34801561043c57600080fd5b5061045061044b3660046132e8565b610ba7565b6040516001600160a01b03909116815260200161039c565b34801561047457600080fd5b5061040c610483366004613301565b610bd0565b34801561049457600080fd5b506103de610d155481565b3480156104ab57600080fd5b5061040c6104ba36600461332b565b610bdb565b3480156104cb57600080fd5b5061040c6104da3660046133a9565b610c84565b3480156104eb57600080fd5b506104ff6104fa3660046133eb565b610c9f565b604080516001600160a01b03909316835260208301919091520161039c565b34801561052a57600080fd5b506104507f000000000000000000000000ae2bc979178e97e0688384aab00055e67bea91ed81565b34801561055e57600080fd5b5061040c61056d3660046132e8565b610d7e565b34801561057e57600080fd5b506103de610d0581565b34801561059457600080fd5b50610450734832344cf14896818229d81c44c2040aaf1f1a9581565b3480156105bc57600080fd5b50610d13546103909060ff1681565b3480156105d757600080fd5b5061040c6105e636600461332b565b610e08565b3480156105f757600080fd5b50600c54610450906001600160a01b031681565b34801561061757600080fd5b5061040c6106263660046133eb565b610e23565b34801561063757600080fd5b50610d19546103909060ff1681565b34801561065257600080fd5b506104507f000000000000000000000000fa4c6947adfef7614f48e99141fa3fec38692ee581565b34801561068657600080fd5b5061040c610695366004613452565b610e7a565b3480156106a657600080fd5b5061040c6106b53660046134e3565b610ef0565b3480156106c657600080fd5b506009546106d49060ff1681565b60405161039c9190613528565b3480156106ed57600080fd5b506104506106fc3660046132e8565b610f56565b61040c61070f366004613558565b610f61565b34801561072057600080fd5b506103de61072f3660046135cc565b610fc6565b34801561074057600080fd5b5061040c611027565b34801561075557600080fd5b5061040c61103b565b34801561076a57600080fd5b5061077e6107793660046132e8565b61104c565b60405161039c91906135e7565b34801561079757600080fd5b506000546001600160a01b0316610450565b3480156107b557600080fd5b506103de670429d069189e000081565b3480156107d157600080fd5b5061040c6107e03660046133a9565b6110ba565b3480156107f157600080fd5b506103de6108003660046132e8565b6110d0565b34801561081157600080fd5b506104236110e8565b34801561082657600080fd5b506104236110f7565b34801561083b57600080fd5b5061040c61084a366004613611565b611186565b34801561085b57600080fd5b506103de61086a3660046132e8565b611191565b34801561087b57600080fd5b506103de6702c68af0bb14000081565b34801561089757600080fd5b5061040c6108a636600461363b565b6111a2565b61040c6108b936600461368f565b6111eb565b3480156108ca57600080fd5b5061040c6108d9366004613748565b611250565b3480156108ea57600080fd5b506104507f000000000000000000000000512c8c57c97905134b12a8ab8479b57a327aa6ec81565b34801561091e57600080fd5b5061093261092d3660046132e8565b611267565b604080516fffffffffffffffffffffffffffffffff93841681529290911660208301520161039c565b34801561096757600080fd5b506104236109763660046132e8565b6112d5565b34801561098757600080fd5b5061040c6109963660046137c4565b61134e565b3480156109a757600080fd5b506103de610d165481565b3480156109be57600080fd5b506103de61044c81565b3480156109d457600080fd5b506104236113e8565b3480156109e957600080fd5b5061040c6109f83660046135cc565b6113f6565b348015610a0957600080fd5b50610390610a18366004613830565b6001600160a01b03918216600090815260066020908152604080832093909416825291909152205460ff1690565b348015610a5257600080fd5b5061040c610a6136600461385a565b611438565b348015610a7257600080fd5b5061040c61147f565b61040c610a89366004613558565b6115f4565b348015610a9a57600080fd5b5061040c610aa93660046135cc565b6115fb565b348015610aba57600080fd5b50610390610ac93660046138a3565b61164f565b348015610ada57600080fd5b5061040c610ae936600461392c565b61173b565b6000610af982611771565b92915050565b610b076117c7565b610b11828261180d565b5050565b606060018054610b2490613981565b80601f0160208091040260200160405190810160405280929190818152602001828054610b5090613981565b8015610b9d5780601f10610b7257610100808354040283529160200191610b9d565b820191906000526020600020905b815481529060010190602001808311610b8057829003601f168201915b5050505050905090565b6000610bb282611860565b506000828152600560205260409020546001600160a01b0316610af9565b610b118282336118b1565b6001600160a01b038216610c0a57604051633250574960e11b8152600060048201526024015b60405180910390fd5b6000610c178383336118be565b9050836001600160a01b0316816001600160a01b031614610c7e576040517f64283d7b0000000000000000000000000000000000000000000000000000000081526001600160a01b0380861660048301526024820184905282166044820152606401610c01565b50505050565b610c8c6117c7565b610d14610c9a828483613a03565b505050565b6000828152600b602090815260408083208151808301909252546001600160a01b038116808352740100000000000000000000000000000000000000009091046bffffffffffffffffffffffff16928201929092528291610d40575060408051808201909152600a546001600160a01b03811682527401000000000000000000000000000000000000000090046bffffffffffffffffffffffff1660208201525b602081015160009061271090610d64906bffffffffffffffffffffffff1687613ad9565b610d6e9190613b06565b91519350909150505b9250929050565b610d866117c7565b604051600090339083908381818185875af1925050503d8060008114610dc8576040519150601f19603f3d011682016040523d82523d6000602084013e610dcd565b606091505b5050905080610b11576040517f2684a07900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610c9a83838360405180602001604052806000815250611250565b600c546001600160a01b0316336001600160a01b031614610e70576040517fec2e987700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610b11828261199a565b60005b83811015610ee757610edf8787878785818110610e9c57610e9c613b1a565b9050602002013586868080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061125092505050565b600101610e7d565b50505050505050565b610ef86117c7565b6009805482919060ff19166001836003811115610f1757610f176134fe565b02179055507f92a17b827ee9d42ea9454bb4ca941a1800870e6d01c0842d09ba23ccc0190ee181604051610f4b9190613528565b60405180910390a150565b6000610af982611860565b60025b60095460ff166003811115610f7b57610f7b6134fe565b14610fb2576040517fd2ab239f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610fbf8585858585611a4d565b5050505050565b60006001600160a01b03821661100b576040517f89c62b6400000000000000000000000000000000000000000000000000000000815260006004820152602401610c01565b506001600160a01b031660009081526004602052604090205490565b61102f6117c7565b6110396000611ab2565b565b6110436117c7565b61103947610d7e565b600061105782611860565b50600161106660036002613c14565b6110709190613c20565b61107b605584613c33565b611086906003613ad9565b610d1a611094605586613b06565b602881106110a4576110a4613b1a565b0154901c166005811115610af957610af96134fe565b6110c26117c7565b610d17610c9a828483613a03565b610d1a81602881106110e157600080fd5b0154905081565b606060028054610b2490613981565b610d18805461110590613981565b80601f016020809104026020016040519081016040528092919081815260200182805461113190613981565b801561117e5780601f106111535761010080835404028352916020019161117e565b820191906000526020600020905b81548152906001019060200180831161116157829003601f168201915b505050505081565b610b11338383611b1a565b600d81610d0681106110e157600080fd5b6111aa6117c7565b610c9a83838080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250859250611bd2915050565b600360095460ff166003811115611204576112046134fe565b1461123b576040517fd2ab239f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610b1182826000670429d069189e0000611bf5565b61125b848484610bdb565b610c7e84848484612173565b6000808215806112785750610d0583115b156112af576040517f3f6cc76800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000600d84610d0681106112c5576112c5613b1a565b015494608086901c945092505050565b60606112e082611860565b5060006112eb6122df565b9050600081511161130b5760405180602001604052806000815250611347565b610d195460ff1661131c5780611347565b80611326846122ef565b604051602001611337929190613c47565b6040516020818303038152906040525b9392505050565b600c546001600160a01b0316336001600160a01b03161461139b576040517fec2e987700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b83811015610fbf576113e08585838181106113bb576113bb613b1a565b905060200201358484848181106113d4576113d4613b1a565b9050602002013561199a565b60010161139e565b610d17805461110590613981565b6113fe6117c7565b600c80547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b333014611471576040517f62c1430e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61147c816001611bd2565b50565b610d135460ff1615156000036114c1576040517fe679626600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b33734832344cf14896818229d81c44c2040aaf1f1a951461150e576040517f2603c33600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610d14805461151c90613981565b9050600003611557576040517f34e82fe600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610d13805460ff19169055604051600090309061157790610d1490613c9e565b6000604051808303816000865af19150503d80600081146115b4576040519150601f19603f3d011682016040523d82523d6000602084013e6115b9565b606091505b505090508061147c576040517f9823765f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001610f64565b6116036117c7565b6001600160a01b038116611646576040517f1e4fbdf700000000000000000000000000000000000000000000000000000000815260006004820152602401610c01565b61147c81611ab2565b6000806116b7878787878760405160200161166e959493929190613d14565b604051602081830303815290604052805190602001207f19457468657265756d205369676e6564204d6573736167653a0a3332000000006000908152601c91909152603c902090565b90506116f9818a8a8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061238f92505050565b6001600160a01b03167f000000000000000000000000fa4c6947adfef7614f48e99141fa3fec38692ee56001600160a01b031614915050979650505050505050565b60005b81811015610fbf57611769858585858581811061175d5761175d613b1a565b90506020020135610bdb565b60010161173e565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f2a55205a000000000000000000000000000000000000000000000000000000001480610af95750610af9826123b9565b6000546001600160a01b03163314611039576040517f118cdaa7000000000000000000000000000000000000000000000000000000008152336004820152602401610c01565b611817828261249c565b604080516001600160a01b038416815261ffff831660208201527f2c5ea6e4103e78cb101e796fb2dace540362fc542cbff5145eaa24af7dd8fe41910160405180910390a15050565b60008061186c83612591565b90506001600160a01b038116610af9576040517f7e27328900000000000000000000000000000000000000000000000000000000815260048101849052602401610c01565b610c9a8383836001612612565b6000806118cc858585612768565b90506001600160a01b0381161580156118e45750303b155b1561191b576040517fad89505200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b0385161580156119465750611935612874565b6bffffffffffffffffffffffff1684105b801561196c5750600884811c60009081526020919091526040902054600160ff86161b16155b1561199257600884811c6000908152602091909152604090208054600160ff87161b1790555b949350505050565b8115806119a85750610d0582115b156119df576040517f3f6cc76800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600081600d84610d0681106119f6576119f6613b1a565b016000828254611a069190613d50565b9250508190559050827f564c02dc18b210b89920ed8d3a85425a1dd6cf68b282eb21706f0763b470a85a82604051611a4091815260200190565b60405180910390a2505050565b611a638282336009544690309060ff168961164f565b1515600003611a9e576040517f8baa579f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610fbf8585856702c68af0bb140000611bf5565b600080546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b038216611b65576040517f5b08ba180000000000000000000000000000000000000000000000000000000081526001600160a01b0383166004820152602401610c01565b6001600160a01b03838116600081815260066020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b610d18611bdf8382613d63565b50610d19805460ff191691151591909117905550565b60608060608060008060005b6007811015611c67576005811015611c395760008b8260058110611c2757611c27613b1a565b60200201351115611c39578260010192505b60008a8260078110611c4d57611c4d613b1a565b60200201351115611c5f578160010191505b600101611c01565b5081600003611ca2576040517f15d0124b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8167ffffffffffffffff811115611cbb57611cbb6136bc565b604051908082528060200260200182016040528015611ce4578160200160208202803683370190505b5095508167ffffffffffffffff811115611d0057611d006136bc565b604051908082528060200260200182016040528015611d29578160200160208202803683370190505b5094508067ffffffffffffffff811115611d4557611d456136bc565b604051908082528060200260200182016040528015611d6e578160200160208202803683370190505b5093508067ffffffffffffffff811115611d8a57611d8a6136bc565b604051908082528060200260200182016040528015611db3578160200160208202803683370190505b509250505060008060008060005b6007811015611efa5760008c8260078110611dde57611dde613b1a565b602002013590508015611e3857808501945081600101888481518110611e0657611e06613b1a565b60200260200101818152505080878480600101955081518110611e2b57611e2b613b1a565b6020026020010181815250505b6004821115611e475750611ef2565b60008e8360058110611e5b57611e5b613b1a565b6020020135905080821115611e9c576040517f01eb547d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8015611eef578087019650826001018b8681518110611ebd57611ebd613b1a565b602002602001018181525050808a8680600101975081518110611ee257611ee2613b1a565b6020026020010181815250505b50505b600101611dc1565b5083831115611f35576040517f01eb547d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b828403848414611fc257808a023414611f7a576040517ffc512fde00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610d1654811115611fb7576040517f991390df00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610d16805482900390555b60095460ff166003816003811115611fdc57611fdc6134fe565b10156120ac57336000908152610d4260205260408120879082846003811115612007576120076134fe565b6003811115612018576120186134fe565b8152602001908152602001600020540190508c811115612064576040517f76d750a000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b336000908152610d42602052604081208291846003811115612088576120886134fe565b6003811115612099576120996134fe565b8152602081019190915260400160002055505b87511561214f576040517f6b20c4540000000000000000000000000000000000000000000000000000000081527f000000000000000000000000512c8c57c97905134b12a8ab8479b57a327aa6ec6001600160a01b031690636b20c4549061211c9033908c908c90600401613e5f565b600060405180830381600087803b15801561213657600080fd5b505af115801561214a573d6000803e3d6000fd5b505050505b6121598a8a6128a6565b6121638a8a612a04565b5050505050505050505050505050565b6001600160a01b0383163b15610c7e576040517f150b7a020000000000000000000000000000000000000000000000000000000081526001600160a01b0384169063150b7a02906121ce903390889087908790600401613e9d565b6020604051808303816000875af1925050508015612209575060408051601f3d908101601f1916820190925261220691810190613ecf565b60015b612272573d808015612237576040519150601f19603f3d011682016040523d82523d6000602084013e61223c565b606091505b50805160000361226a57604051633250574960e11b81526001600160a01b0385166004820152602401610c01565b805181602001fd5b7fffffffff0000000000000000000000000000000000000000000000000000000081167f150b7a020000000000000000000000000000000000000000000000000000000014610fbf57604051633250574960e11b81526001600160a01b0385166004820152602401610c01565b6060610d188054610b2490613981565b606060006122fc83612b8a565b600101905060008167ffffffffffffffff81111561231c5761231c6136bc565b6040519080825280601f01601f191660200182016040528015612346576020820181803683370190505b5090508181016020015b600019017f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a850494508461235057509392505050565b60008060008061239f8686612c6c565b9250925092506123af8282612cb9565b5090949350505050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f80ac58cd00000000000000000000000000000000000000000000000000000000148061244c57507fffffffff0000000000000000000000000000000000000000000000000000000082167f5b5e139f00000000000000000000000000000000000000000000000000000000145b80610af957507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000831614610af9565b6127106bffffffffffffffffffffffff82168110156124fe576040517f6f483d090000000000000000000000000000000000000000000000000000000081526bffffffffffffffffffffffff8316600482015260248101829052604401610c01565b6001600160a01b038316612541576040517fb6d9900a00000000000000000000000000000000000000000000000000000000815260006004820152602401610c01565b50604080518082019091526001600160a01b039092168083526bffffffffffffffffffffffff90911660209092018290527401000000000000000000000000000000000000000090910217600a55565b6000818152600360205260408120546001600160a01b0316801515806125c257506bffffffffffffffffffffffff83115b806125cd5750600183105b156125d85792915050565b600883811c60009081526020919091526040902054600160ff85161b1661260957612604600784612dbd565b611347565b60009392505050565b808061262657506001600160a01b03821615155b1561272057600061263684611860565b90506001600160a01b038316158015906126625750826001600160a01b0316816001600160a01b031614155b801561269457506001600160a01b0380821660009081526006602090815260408083209387168352929052205460ff16155b156126d6576040517fa9fbf51f0000000000000000000000000000000000000000000000000000000081526001600160a01b0384166004820152602401610c01565b811561271e5783856001600160a01b0316826001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45b505b5050600090815260056020526040902080547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b60008061277484612591565b90506001600160a01b0383161561279057612790818486612e0e565b6001600160a01b038116156127ce576127ad600085600080612612565b6001600160a01b038116600090815260046020526040902080546000190190555b6001600160a01b038516156127fd576001600160a01b0385166000908152600460205260409020805460010190555b60008481526003602052604080822080547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0389811691821790925591518793918516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4949350505050565b60008060006128836007612ea4565b50915091508161289457600161289f565b61289f816001613eec565b9250505090565b600182511161299b576001600160a01b037f000000000000000000000000ae2bc979178e97e0688384aab00055e67bea91ed1663156e29f633846000815181106128f2576128f2613b1a565b60200260200101518460008151811061290d5761290d613b1a565b60209081029190910101516040517fffffffff0000000000000000000000000000000000000000000000000000000060e086901b1681526001600160a01b039093166004840152602483019190915260448201526064015b600060405180830381600087803b15801561297f57600080fd5b505af1158015612993573d6000803e3d6000fd5b505050505050565b6040517fd81d0a150000000000000000000000000000000000000000000000000000000081527f000000000000000000000000ae2bc979178e97e0688384aab00055e67bea91ed6001600160a01b03169063d81d0a159061296590339086908690600401613e5f565b610d155460006055600183010490508060006055600185010660030286600081518110612a3357612a33613b1a565b6020026020010151901b610d1a8460288110612a5157612a51613b1a565b015417905060005b8651811015612b2b576000868281518110612a7657612a76613b1a565b6020026020010151905060005b81811015612b21576001909601958683151580612aa05750600082115b15612b0e5760558104965085871115612ae65784610d1a8760288110612ac857612ac8613b1a565b0155610d1a8760288110612ade57612ade613b1a565b015494508695505b605581066003028a8581518110612aff57612aff613b1a565b6020026020010151901b851794505b612b183382612f3b565b50600101612a83565b5050600101612a59565b5080610d1a8460288110612b4157612b41613b1a565b0155610d05841115612b7f576040517fc30436e900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b505050610d15555050565b6000807a184f03e93ff9f4daa797ed6e38ed64bf6a1f0100000000000000008310612bd3577a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000830492506040015b6d04ee2d6d415b85acef81000000008310612bff576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc100008310612c1d57662386f26fc10000830492506010015b6305f5e1008310612c35576305f5e100830492506008015b6127108310612c4957612710830492506004015b60648310612c5b576064830492506002015b600a8310610af95760010192915050565b60008060008351604103612ca65760208401516040850151606086015160001a612c9888828585612fb9565b955095509550505050612cb2565b50508151600091506002905b9250925092565b6000826003811115612ccd57612ccd6134fe565b03612cd6575050565b6001826003811115612cea57612cea6134fe565b03612d21576040517ff645eedf00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6002826003811115612d3557612d356134fe565b03612d6f576040517ffce698f700000000000000000000000000000000000000000000000000000000815260048101829052602401610c01565b6003826003811115612d8357612d836134fe565b03610b11576040517fd78bce0c00000000000000000000000000000000000000000000000000000000815260048101829052602401610c01565b815460009081612dcf85858385613088565b9050818114612e02576000858152602090208101546c0100000000000000000000000090046001600160a01b0316612e05565b60005b95945050505050565b612e198383836130f6565b610c9a576001600160a01b038316612e60576040517f7e27328900000000000000000000000000000000000000000000000000000000815260048101829052602401610c01565b6040517f177e802f0000000000000000000000000000000000000000000000000000000081526001600160a01b038316600482015260248101829052604401610c01565b805460009081908190808203612ec557600080600093509350935050612f34565b6000612ee486612ed6600185613c20565b600091825260209091200190565b6040805180820190915290546bffffffffffffffffffffffff81168083526c010000000000000000000000009091046001600160a01b031660209092018290526001965094509250612f34915050565b9193909250565b6001600160a01b038216612f6557604051633250574960e11b815260006004820152602401610c01565b6000612f73838360006118be565b90506001600160a01b03811615610c9a576040517f73c6ac6e00000000000000000000000000000000000000000000000000000000815260006004820152602401610c01565b600080807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0841115612ff4575060009150600390508261307e565b604080516000808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa158015613048573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166130745750600092506001915082905061307e565b9250600091508190505b9450945094915050565b60005b818310156130ee57600061309f8484613179565b6000878152602090209091506bffffffffffffffffffffffff8616908201546bffffffffffffffffffffffff1610156130e4576130dd816001613d50565b93506130e8565b8092505b5061308b565b509392505050565b60006001600160a01b038316158015906119925750826001600160a01b0316846001600160a01b0316148061315057506001600160a01b0380851660009081526006602090815260408083209387168352929052205460ff165b806119925750506000908152600560205260409020546001600160a01b03908116911614919050565b60006131886002848418613b06565b61134790848416613d50565b7fffffffff000000000000000000000000000000000000000000000000000000008116811461147c57600080fd5b6000602082840312156131d457600080fd5b813561134781613194565b80356001600160a01b03811681146131f657600080fd5b919050565b8035600481106131f657600080fd5b6000806040838503121561321d57600080fd5b613226836131df565b9150613234602084016131fb565b90509250929050565b6000806040838503121561325057600080fd5b613259836131df565b915060208301356bffffffffffffffffffffffff8116811461327a57600080fd5b809150509250929050565b60005b838110156132a0578181015183820152602001613288565b50506000910152565b600081518084526132c1816020860160208601613285565b601f01601f19169290920160200192915050565b60208152600061134760208301846132a9565b6000602082840312156132fa57600080fd5b5035919050565b6000806040838503121561331457600080fd5b61331d836131df565b946020939093013593505050565b60008060006060848603121561334057600080fd5b613349846131df565b9250613357602085016131df565b9150604084013590509250925092565b60008083601f84011261337957600080fd5b50813567ffffffffffffffff81111561339157600080fd5b602083019150836020828501011115610d7757600080fd5b600080602083850312156133bc57600080fd5b823567ffffffffffffffff8111156133d357600080fd5b6133df85828601613367565b90969095509350505050565b600080604083850312156133fe57600080fd5b50508035926020909101359150565b60008083601f84011261341f57600080fd5b50813567ffffffffffffffff81111561343757600080fd5b6020830191508360208260051b8501011115610d7757600080fd5b6000806000806000806080878903121561346b57600080fd5b613474876131df565b9550613482602088016131df565b9450604087013567ffffffffffffffff8082111561349f57600080fd5b6134ab8a838b0161340d565b909650945060608901359150808211156134c457600080fd5b506134d189828a01613367565b979a9699509497509295939492505050565b6000602082840312156134f557600080fd5b611347826131fb565b634e487b7160e01b600052602160045260246000fd5b60048110613524576135246134fe565b9052565b60208101610af98284613514565b8060a08101831015610af957600080fd5b8060e08101831015610af957600080fd5b60008060008060006101c0868803121561357157600080fd5b61357b8787613536565b945061358a8760a08801613547565b935061018086013592506101a086013567ffffffffffffffff8111156135af57600080fd5b6135bb88828901613367565b969995985093965092949392505050565b6000602082840312156135de57600080fd5b611347826131df565b60208101600683106135fb576135fb6134fe565b91905290565b803580151581146131f657600080fd5b6000806040838503121561362457600080fd5b61362d836131df565b915061323460208401613601565b60008060006040848603121561365057600080fd5b833567ffffffffffffffff81111561366757600080fd5b61367386828701613367565b9094509250613686905060208501613601565b90509250925092565b60008061018083850312156136a357600080fd5b6136ad8484613536565b91506132348460a08501613547565b634e487b7160e01b600052604160045260246000fd5b600067ffffffffffffffff808411156136ed576136ed6136bc565b604051601f8501601f19908116603f01168101908282118183101715613715576137156136bc565b8160405280935085815286868601111561372e57600080fd5b858560208301376000602087830101525050509392505050565b6000806000806080858703121561375e57600080fd5b613767856131df565b9350613775602086016131df565b925060408501359150606085013567ffffffffffffffff81111561379857600080fd5b8501601f810187136137a957600080fd5b6137b8878235602084016136d2565b91505092959194509250565b600080600080604085870312156137da57600080fd5b843567ffffffffffffffff808211156137f257600080fd5b6137fe8883890161340d565b9096509450602087013591508082111561381757600080fd5b506138248782880161340d565b95989497509550505050565b6000806040838503121561384357600080fd5b61384c836131df565b9150613234602084016131df565b60006020828403121561386c57600080fd5b813567ffffffffffffffff81111561388357600080fd5b8201601f8101841361389457600080fd5b611992848235602084016136d2565b600080600080600080600060c0888a0312156138be57600080fd5b873567ffffffffffffffff8111156138d557600080fd5b6138e18a828b01613367565b90985096506138f49050602089016131df565b945060408801359350613909606089016131df565b9250613917608089016131fb565b915060a0880135905092959891949750929550565b6000806000806060858703121561394257600080fd5b61394b856131df565b9350613959602086016131df565b9250604085013567ffffffffffffffff81111561397557600080fd5b6138248782880161340d565b600181811c9082168061399557607f821691505b6020821081036139b557634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115610c9a576000816000526020600020601f850160051c810160208610156139e45750805b601f850160051c820191505b81811015612993578281556001016139f0565b67ffffffffffffffff831115613a1b57613a1b6136bc565b613a2f83613a298354613981565b836139bb565b6000601f841160018114613a635760008515613a4b5750838201355b600019600387901b1c1916600186901b178355610fbf565b600083815260209020601f19861690835b82811015613a945786850135825560209485019460019092019101613a74565b5086821015613ab15760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b634e487b7160e01b600052601160045260246000fd5b8082028115828204841417610af957610af9613ac3565b634e487b7160e01b600052601260045260246000fd5b600082613b1557613b15613af0565b500490565b634e487b7160e01b600052603260045260246000fd5b600181815b80851115613b6b578160001904821115613b5157613b51613ac3565b80851615613b5e57918102915b93841c9390800290613b35565b509250929050565b600082613b8257506001610af9565b81613b8f57506000610af9565b8160018114613ba55760028114613baf57613bcb565b6001915050610af9565b60ff841115613bc057613bc0613ac3565b50506001821b610af9565b5060208310610133831016604e8410600b8410161715613bee575081810a610af9565b613bf88383613b30565b8060001904821115613c0c57613c0c613ac3565b029392505050565b60006113478383613b73565b81810381811115610af957610af9613ac3565b600082613c4257613c42613af0565b500690565b60008351613c59818460208801613285565b835190830190613c6d818360208801613285565b7f2e6a736f6e0000000000000000000000000000000000000000000000000000009101908152600501949350505050565b6000808354613cac81613981565b60018281168015613cc45760018114613cd957613d08565b60ff1984168752821515830287019450613d08565b8760005260208060002060005b85811015613cff5781548a820152908401908201613ce6565b50505082870194505b50929695505050505050565b6001600160a01b038681168252602082018690528416604082015260a08101613d406060830185613514565b8260808301529695505050505050565b80820180821115610af957610af9613ac3565b815167ffffffffffffffff811115613d7d57613d7d6136bc565b613d9181613d8b8454613981565b846139bb565b602080601f831160018114613dc65760008415613dae5750858301515b600019600386901b1c1916600185901b178555612993565b600085815260208120601f198616915b82811015613df557888601518255948401946001909101908401613dd6565b5085821015613e135787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60008151808452602080850194506020840160005b83811015613e5457815187529582019590820190600101613e38565b509495945050505050565b6001600160a01b0384168152606060208201526000613e816060830185613e23565b8281036040840152613e938185613e23565b9695505050505050565b60006001600160a01b03808716835280861660208401525083604083015260806060830152613e9360808301846132a9565b600060208284031215613ee157600080fd5b815161134781613194565b6bffffffffffffffffffffffff818116838216019080821115613f1157613f11613ac3565b509291505056fea2646970667358221220e76052a912860b6049ab5476d3aca26ff32dfe5b888e17c7a747a7cac4b0f02064736f6c63430008160033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000140000000000000000000000000512c8c57c97905134b12a8ab8479b57a327aa6ec000000000000000000000000ae2bc979178e97e0688384aab00055e67bea91ed000000000000000000000000fa4c6947adfef7614f48e99141fa3fec38692ee500000000000000000000000050ad8fdbc19ea06fd9383f1262ce691dc53fa99f0000000000000000000000000000000000000000000000000000000000000043697066733a2f2f6261667962656962707473356e6f7679756f766a6c78767975777a64703478683336736971637666796e697564686e75767537377965697a696e712f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000042697066733a2f2f6261667962656968646678626c6165647069686f36356e32776532366e6d6c6261796163616e697573656c36376b76767134656533756c6b646169000000000000000000000000000000000000000000000000000000000000
-----Decoded View---------------
Arg [0] : _baseUri (string): ipfs://bafybeibpts5novyuovjlxvyuwzdp4xh36siqcvfyniudhnuvu77yeizinq/
Arg [1] : _contractUri (string): ipfs://bafybeihdfxblaedpiho65n2we26nmlbayacaniusel67kvvq4ee3ulkdai
Arg [2] : _sanpass (address): 0x512C8C57C97905134b12a8Ab8479b57a327AA6eC
Arg [3] : _sanwear (address): 0xAE2Bc979178E97e0688384Aab00055E67bEa91ed
Arg [4] : _signer (address): 0xFa4C6947ADFEf7614f48E99141fA3FEc38692EE5
Arg [5] : _initMintTo (address): 0x50AD8FDBC19ea06fD9383F1262Ce691DC53FA99f
-----Encoded View---------------
14 Constructor Arguments found :
Arg [0] : 00000000000000000000000000000000000000000000000000000000000000c0
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000140
Arg [2] : 000000000000000000000000512c8c57c97905134b12a8ab8479b57a327aa6ec
Arg [3] : 000000000000000000000000ae2bc979178e97e0688384aab00055e67bea91ed
Arg [4] : 000000000000000000000000fa4c6947adfef7614f48e99141fa3fec38692ee5
Arg [5] : 00000000000000000000000050ad8fdbc19ea06fd9383f1262ce691dc53fa99f
Arg [6] : 0000000000000000000000000000000000000000000000000000000000000043
Arg [7] : 697066733a2f2f6261667962656962707473356e6f7679756f766a6c78767975
Arg [8] : 777a64703478683336736971637666796e697564686e75767537377965697a69
Arg [9] : 6e712f0000000000000000000000000000000000000000000000000000000000
Arg [10] : 0000000000000000000000000000000000000000000000000000000000000042
Arg [11] : 697066733a2f2f6261667962656968646678626c6165647069686f36356e3277
Arg [12] : 6532366e6d6c6261796163616e697573656c36376b76767134656533756c6b64
Arg [13] : 6169000000000000000000000000000000000000000000000000000000000000
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.