Overview
APE Balance
APE Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 1 from a total of 1 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Deploy Tockable ... | 8677117 | 18 days ago | IN | 0 APE | 0.07074361 |
Latest 1 internal transaction
Parent Transaction Hash | Block | From | To | |||
---|---|---|---|---|---|---|
8677117 | 18 days ago | Contract Creation | 0 APE |
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
TockableRegularDropFromFactoryV1DeployerV1
Compiler Version
v0.8.26+commit.8a97fa7a
Contract Source Code (Solidity Multiple files format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import {TockableRegularDropFromFactoryV1} from "./TockableRegularDropFromFactoryV1.sol"; contract TockableRegularDropFromFactoryV1DeployerV1 { function deployTockableRegularDropFromFactoryV1( address _tockableAddress, address _signerAddress, string memory _contractName, string memory _tokenName, string memory _tokenSymbol, uint256 _baseFee, uint256 _totalSupply ) external returns (address) { TockableRegularDropFromFactoryV1 newCollection = new TockableRegularDropFromFactoryV1( _tockableAddress, _signerAddress, _contractName, _tokenName, _tokenSymbol, _baseFee, _totalSupply ); newCollection.transferOwnership(msg.sender); return address(newCollection); } }
// Sources flattened with hardhat v2.18.2 https://hardhat.org // SPDX-License-Identifier: MIT // File @openzeppelin/contracts/utils/[email protected] // Original license: 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; } } // File @openzeppelin/contracts/access/[email protected] // Original license: SPDX_License_Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol) pragma solidity ^0.8.20; /** * @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); } } // File @openzeppelin/contracts/utils/cryptography/[email protected] // Original license: 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); } } } // File @openzeppelin/contracts/utils/[email protected] // Original license: SPDX_License_Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/ReentrancyGuard.sol) pragma solidity ^0.8.20; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant NOT_ENTERED = 1; uint256 private constant ENTERED = 2; uint256 private _status; /** * @dev Unauthorized reentrant call. */ error ReentrancyGuardReentrantCall(); constructor() { _status = NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { _nonReentrantBefore(); _; _nonReentrantAfter(); } function _nonReentrantBefore() private { // On the first call to nonReentrant, _status will be NOT_ENTERED if (_status == ENTERED) { revert ReentrancyGuardReentrantCall(); } // Any calls to nonReentrant after this point will fail _status = ENTERED; } function _nonReentrantAfter() private { // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = NOT_ENTERED; } /** * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a * `nonReentrant` function in the call stack. */ function _reentrancyGuardEntered() internal view returns (bool) { return _status == ENTERED; } } // File erc721a/contracts/[email protected] // Original license: SPDX_License_Identifier: MIT // ERC721A Contracts v4.2.3 // Creator: Chiru Labs pragma solidity ^0.8.4; /** * @dev Interface of ERC721A. */ interface IERC721A { /** * The caller must own the token or be an approved operator. */ error ApprovalCallerNotOwnerNorApproved(); /** * The token does not exist. */ error ApprovalQueryForNonexistentToken(); /** * Cannot query the balance for the zero address. */ error BalanceQueryForZeroAddress(); /** * Cannot mint to the zero address. */ error MintToZeroAddress(); /** * The quantity of tokens minted must be more than zero. */ error MintZeroQuantity(); /** * The token does not exist. */ error OwnerQueryForNonexistentToken(); /** * The caller must own the token or be an approved operator. */ error TransferCallerNotOwnerNorApproved(); /** * The token must be owned by `from`. */ error TransferFromIncorrectOwner(); /** * Cannot safely transfer to a contract that does not implement the * ERC721Receiver interface. */ error TransferToNonERC721ReceiverImplementer(); /** * Cannot transfer to the zero address. */ error TransferToZeroAddress(); /** * The token does not exist. */ error URIQueryForNonexistentToken(); /** * The `quantity` minted with ERC2309 exceeds the safety limit. */ error MintERC2309QuantityExceedsLimit(); /** * The `extraData` cannot be set on an unintialized ownership slot. */ error OwnershipNotInitialazeddForExtraData(); // ============================================================= // STRUCTS // ============================================================= struct TokenOwnership { // The address of the owner. address addr; // Stores the start time of ownership with minimal overhead for tokenomics. uint64 startTimestamp; // Whether the token has been burned. bool burned; // Arbitrary data similar to `startTimestamp` that can be set via {_extraData}. uint24 extraData; } // ============================================================= // TOKEN COUNTERS // ============================================================= /** * @dev Returns the total number of tokens in existence. * Burned tokens will reduce the count. * To get the total number of tokens minted, please see {_totalMinted}. */ function totalSupply() external view returns (uint256); // ============================================================= // IERC165 // ============================================================= /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * [EIP section](https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified) * to learn more about how these ids are created. * * This function call must use less than 30000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); // ============================================================= // IERC721 // ============================================================= /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer( address indexed from, address indexed to, uint256 indexed tokenId ); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval( address indexed owner, address indexed approved, uint256 indexed tokenId ); /** * @dev Emitted when `owner` enables or disables * (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll( address indexed owner, address indexed operator, bool approved ); /** * @dev Returns the number of tokens in `owner`'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`, * checking first that contract recipients are aware of the ERC721 protocol * to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be have been allowed to move * this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement * {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes calldata data ) external payable; /** * @dev Equivalent to `safeTransferFrom(from, to, tokenId, '')`. */ function safeTransferFrom( address from, address to, uint256 tokenId ) external payable; /** * @dev Transfers `tokenId` from `from` to `to`. * * WARNING: Usage of this method is discouraged, use {safeTransferFrom} * whenever possible. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token * by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 tokenId ) external payable; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the * zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external payable; /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} * for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool _approved) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved( uint256 tokenId ) external view returns (address operator); /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll}. */ function isApprovedForAll( address owner, address operator ) external view returns (bool); // ============================================================= // IERC721Metadata // ============================================================= /** * @dev Returns the token collection name. */ function name() external view returns (string memory); /** * @dev Returns the token collection symbol. */ function symbol() external view returns (string memory); /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ function tokenURI(uint256 tokenId) external view returns (string memory); // ============================================================= // IERC2309 // ============================================================= /** * @dev Emitted when tokens in `fromTokenId` to `toTokenId` * (inclusive) is transferred from `from` to `to`, as defined in the * [ERC2309](https://eips.ethereum.org/EIPS/eip-2309) standard. * * See {_mintERC2309} for more details. */ event ConsecutiveTransfer( uint256 indexed fromTokenId, uint256 toTokenId, address indexed from, address indexed to ); } // File erc721a/contracts/[email protected] // Original license: SPDX_License_Identifier: MIT // ERC721A Contracts v4.2.3 // Creator: Chiru Labs pragma solidity ^0.8.4; /** * @dev Interface of ERC721 token receiver. */ interface ERC721A__IERC721Receiver { function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); } /** * @title ERC721A * * @dev Implementation of the [ERC721](https://eips.ethereum.org/EIPS/eip-721) * Non-Fungible Token Standard, including the Metadata extension. * Optimized for lower gas during batch mints. * * Token IDs are minted in sequential order (e.g. 0, 1, 2, 3, ...) * starting from `_startTokenId()`. * * Assumptions: * * - An owner cannot have more than 2**64 - 1 (max value of uint64) of supply. * - The maximum token ID cannot exceed 2**256 - 1 (max value of uint256). */ contract ERC721A is IERC721A { // Bypass for a `--via-ir` bug (https://github.com/chiru-labs/ERC721A/pull/364). struct TokenApprovalRef { address value; } // ============================================================= // CONSTANTS // ============================================================= // Mask of an entry in packed address data. uint256 private constant _BITMASK_ADDRESS_DATA_ENTRY = (1 << 64) - 1; // The bit position of `numberMinted` in packed address data. uint256 private constant _BITPOS_NUMBER_MINTED = 64; // The bit position of `numberBurned` in packed address data. uint256 private constant _BITPOS_NUMBER_BURNED = 128; // The bit position of `aux` in packed address data. uint256 private constant _BITPOS_AUX = 192; // Mask of all 256 bits in packed address data except the 64 bits for `aux`. uint256 private constant _BITMASK_AUX_COMPLEMENT = (1 << 192) - 1; // The bit position of `startTimestamp` in packed ownership. uint256 private constant _BITPOS_START_TIMESTAMP = 160; // The bit mask of the `burned` bit in packed ownership. uint256 private constant _BITMASK_BURNED = 1 << 224; // The bit position of the `nextInitialized` bit in packed ownership. uint256 private constant _BITPOS_NEXT_INITIALIZED = 225; // The bit mask of the `nextInitialized` bit in packed ownership. uint256 private constant _BITMASK_NEXT_INITIALIZED = 1 << 225; // The bit position of `extraData` in packed ownership. uint256 private constant _BITPOS_EXTRA_DATA = 232; // Mask of all 256 bits in a packed ownership except the 24 bits for `extraData`. uint256 private constant _BITMASK_EXTRA_DATA_COMPLEMENT = (1 << 232) - 1; // The mask of the lower 160 bits for addresses. uint256 private constant _BITMASK_ADDRESS = (1 << 160) - 1; // The maximum `quantity` that can be minted with {_mintERC2309}. // This limit is to prevent overflows on the address data entries. // For a limit of 5000, a total of 3.689e15 calls to {_mintERC2309} // is required to cause an overflow, which is unrealistic. uint256 private constant _MAX_MINT_ERC2309_QUANTITY_LIMIT = 5000; // The `Transfer` event signature is given by: // `keccak256(bytes("Transfer(address,address,uint256)"))`. bytes32 private constant _TRANSFER_EVENT_SIGNATURE = 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef; // ============================================================= // STORAGE // ============================================================= // The next token ID to be minted. uint256 private _currentIndex; // The number of tokens burned. uint256 private _burnCounter; // Token name string private _name; // Token symbol string private _symbol; // Mapping from token ID to ownership details // An empty struct value does not necessarily mean the token is unowned. // See {_packedOwnershipOf} implementation for details. // // Bits Layout: // - [0..159] `addr` // - [160..223] `startTimestamp` // - [224] `burned` // - [225] `nextInitialized` // - [232..255] `extraData` mapping(uint256 => uint256) private _packedOwnerships; // Mapping owner address to address data. // // Bits Layout: // - [0..63] `balance` // - [64..127] `numberMinted` // - [128..191] `numberBurned` // - [192..255] `aux` mapping(address => uint256) private _packedAddressData; // Mapping from token ID to approved address. mapping(uint256 => TokenApprovalRef) private _tokenApprovals; // Mapping from owner to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; // ============================================================= // CONSTRUCTOR // ============================================================= constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; _currentIndex = _startTokenId(); } // ============================================================= // TOKEN COUNTING OPERATIONS // ============================================================= /** * @dev Returns the starting token ID. * To change the starting token ID, please override this function. */ function _startTokenId() internal view virtual returns (uint256) { return 0; } /** * @dev Returns the next token ID to be minted. */ function _nextTokenId() internal view virtual returns (uint256) { return _currentIndex; } /** * @dev Returns the total number of tokens in existence. * Burned tokens will reduce the count. * To get the total number of tokens minted, please see {_totalMinted}. */ function totalSupply() public view virtual override returns (uint256) { // Counter underflow is impossible as _burnCounter cannot be incremented // more than `_currentIndex - _startTokenId()` times. unchecked { return _currentIndex - _burnCounter - _startTokenId(); } } /** * @dev Returns the total amount of tokens minted in the contract. */ function _totalMinted() internal view virtual returns (uint256) { // Counter underflow is impossible as `_currentIndex` does not decrement, // and it is initialized to `_startTokenId()`. unchecked { return _currentIndex - _startTokenId(); } } /** * @dev Returns the total number of tokens burned. */ function _totalBurned() internal view virtual returns (uint256) { return _burnCounter; } // ============================================================= // ADDRESS DATA OPERATIONS // ============================================================= /** * @dev Returns the number of tokens in `owner`'s account. */ function balanceOf( address owner ) public view virtual override returns (uint256) { if (owner == address(0)) revert BalanceQueryForZeroAddress(); return _packedAddressData[owner] & _BITMASK_ADDRESS_DATA_ENTRY; } /** * Returns the number of tokens minted by `owner`. */ function _numberMinted(address owner) internal view returns (uint256) { return (_packedAddressData[owner] >> _BITPOS_NUMBER_MINTED) & _BITMASK_ADDRESS_DATA_ENTRY; } /** * Returns the number of tokens burned by or on behalf of `owner`. */ function _numberBurned(address owner) internal view returns (uint256) { return (_packedAddressData[owner] >> _BITPOS_NUMBER_BURNED) & _BITMASK_ADDRESS_DATA_ENTRY; } /** * Returns the auxiliary data for `owner`. (e.g. number of whitelist mint slots used). */ function _getAux(address owner) internal view returns (uint64) { return uint64(_packedAddressData[owner] >> _BITPOS_AUX); } /** * Sets the auxiliary data for `owner`. (e.g. number of whitelist mint slots used). * If there are multiple variables, please pack them into a uint64. */ function _setAux(address owner, uint64 aux) internal virtual { uint256 packed = _packedAddressData[owner]; uint256 auxCasted; // Cast `aux` with assembly to avoid redundant masking. assembly { auxCasted := aux } packed = (packed & _BITMASK_AUX_COMPLEMENT) | (auxCasted << _BITPOS_AUX); _packedAddressData[owner] = packed; } // ============================================================= // IERC165 // ============================================================= /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * [EIP section](https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified) * to learn more about how these ids are created. * * This function call must use less than 30000 gas. */ function supportsInterface( bytes4 interfaceId ) public view virtual override returns (bool) { // The interface IDs are constants representing the first 4 bytes // of the XOR of all function selectors in the interface. // See: [ERC165](https://eips.ethereum.org/EIPS/eip-165) // (e.g. `bytes4(i.functionA.selector ^ i.functionB.selector ^ ...)`) return interfaceId == 0x01ffc9a7 || // ERC165 interface ID for ERC165. interfaceId == 0x80ac58cd || // ERC165 interface ID for ERC721. interfaceId == 0x5b5e139f; // ERC165 interface ID for ERC721Metadata. } // ============================================================= // IERC721Metadata // ============================================================= /** * @dev Returns the token collection name. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev Returns the token collection symbol. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ function tokenURI( uint256 tokenId ) public view virtual override returns (string memory) { if (!_exists(tokenId)) revert URIQueryForNonexistentToken(); string memory baseURI = _baseURI(); return bytes(baseURI).length != 0 ? string(abi.encodePacked(baseURI, _toString(tokenId))) : ""; } /** * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each * token will be the concatenation of the `baseURI` and the `tokenId`. Empty * by default, it can be overridden in child contracts. */ function _baseURI() internal view virtual returns (string memory) { return ""; } // ============================================================= // OWNERSHIPS OPERATIONS // ============================================================= /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf( uint256 tokenId ) public view virtual override returns (address) { return address(uint160(_packedOwnershipOf(tokenId))); } /** * @dev Gas spent here starts off proportional to the maximum mint batch size. * It gradually moves to O(1) as tokens get transferred around over time. */ function _ownershipOf( uint256 tokenId ) internal view virtual returns (TokenOwnership memory) { return _unpackedOwnership(_packedOwnershipOf(tokenId)); } /** * @dev Returns the unpacked `TokenOwnership` struct at `index`. */ function _ownershipAt( uint256 index ) internal view virtual returns (TokenOwnership memory) { return _unpackedOwnership(_packedOwnerships[index]); } /** * @dev Initializes the ownership slot minted at `index` for efficiency purposes. */ function _initializeOwnershipAt(uint256 index) internal virtual { if (_packedOwnerships[index] == 0) { _packedOwnerships[index] = _packedOwnershipOf(index); } } /** * Returns the packed ownership data of `tokenId`. */ function _packedOwnershipOf( uint256 tokenId ) private view returns (uint256) { uint256 curr = tokenId; unchecked { if (_startTokenId() <= curr) if (curr < _currentIndex) { uint256 packed = _packedOwnerships[curr]; // If not burned. if (packed & _BITMASK_BURNED == 0) { // Invariant: // There will always be an initialized ownership slot // (i.e. `ownership.addr != address(0) && ownership.burned == false`) // before an unintialized ownership slot // (i.e. `ownership.addr == address(0) && ownership.burned == false`) // Hence, `curr` will not underflow. // // We can directly compare the packed value. // If the address is zero, packed will be zero. while (packed == 0) { packed = _packedOwnerships[--curr]; } return packed; } } } revert OwnerQueryForNonexistentToken(); } /** * @dev Returns the unpacked `TokenOwnership` struct from `packed`. */ function _unpackedOwnership( uint256 packed ) private pure returns (TokenOwnership memory ownership) { ownership.addr = address(uint160(packed)); ownership.startTimestamp = uint64(packed >> _BITPOS_START_TIMESTAMP); ownership.burned = packed & _BITMASK_BURNED != 0; ownership.extraData = uint24(packed >> _BITPOS_EXTRA_DATA); } /** * @dev Packs ownership data into a single uint256. */ function _packOwnershipData( address owner, uint256 flags ) private view returns (uint256 result) { assembly { // Mask `owner` to the lower 160 bits, in case the upper bits somehow aren't clean. owner := and(owner, _BITMASK_ADDRESS) // `owner | (block.timestamp << _BITPOS_START_TIMESTAMP) | flags`. result := or( owner, or(shl(_BITPOS_START_TIMESTAMP, timestamp()), flags) ) } } /** * @dev Returns the `nextInitialized` flag set if `quantity` equals 1. */ function _nextInitializedFlag( uint256 quantity ) private pure returns (uint256 result) { // For branchless setting of the `nextInitialized` flag. assembly { // `(quantity == 1) << _BITPOS_NEXT_INITIALIZED`. result := shl(_BITPOS_NEXT_INITIALIZED, eq(quantity, 1)) } } // ============================================================= // APPROVAL OPERATIONS // ============================================================= /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * 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 ) public payable virtual override { address owner = ownerOf(tokenId); if (_msgSenderERC721A() != owner) if (!isApprovedForAll(owner, _msgSenderERC721A())) { revert ApprovalCallerNotOwnerNorApproved(); } _tokenApprovals[tokenId].value = to; emit Approval(owner, to, tokenId); } /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved( uint256 tokenId ) public view virtual override returns (address) { if (!_exists(tokenId)) revert ApprovalQueryForNonexistentToken(); return _tokenApprovals[tokenId].value; } /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} * for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll( address operator, bool approved ) public virtual override { _operatorApprovals[_msgSenderERC721A()][operator] = approved; emit ApprovalForAll(_msgSenderERC721A(), operator, approved); } /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll}. */ function isApprovedForAll( address owner, address operator ) public view virtual override returns (bool) { return _operatorApprovals[owner][operator]; } /** * @dev Returns whether `tokenId` exists. * * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}. * * Tokens start existing when they are minted. See {_mint}. */ function _exists(uint256 tokenId) internal view virtual returns (bool) { return _startTokenId() <= tokenId && tokenId < _currentIndex && // If within bounds, _packedOwnerships[tokenId] & _BITMASK_BURNED == 0; // and not burned. } /** * @dev Returns whether `msgSender` is equal to `approvedAddress` or `owner`. */ function _isSenderApprovedOrOwner( address approvedAddress, address owner, address msgSender ) private pure returns (bool result) { assembly { // Mask `owner` to the lower 160 bits, in case the upper bits somehow aren't clean. owner := and(owner, _BITMASK_ADDRESS) // Mask `msgSender` to the lower 160 bits, in case the upper bits somehow aren't clean. msgSender := and(msgSender, _BITMASK_ADDRESS) // `msgSender == owner || msgSender == approvedAddress`. result := or(eq(msgSender, owner), eq(msgSender, approvedAddress)) } } /** * @dev Returns the storage slot and value for the approved address of `tokenId`. */ function _getApprovedSlotAndAddress( uint256 tokenId ) private view returns (uint256 approvedAddressSlot, address approvedAddress) { TokenApprovalRef storage tokenApproval = _tokenApprovals[tokenId]; // The following is equivalent to `approvedAddress = _tokenApprovals[tokenId].value`. assembly { approvedAddressSlot := tokenApproval.slot approvedAddress := sload(approvedAddressSlot) } } // ============================================================= // TRANSFER OPERATIONS // ============================================================= /** * @dev Transfers `tokenId` from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token * by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 tokenId ) public payable virtual override { uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId); if (address(uint160(prevOwnershipPacked)) != from) revert TransferFromIncorrectOwner(); ( uint256 approvedAddressSlot, address approvedAddress ) = _getApprovedSlotAndAddress(tokenId); // The nested ifs save around 20+ gas over a compound boolean condition. if ( !_isSenderApprovedOrOwner( approvedAddress, from, _msgSenderERC721A() ) ) if (!isApprovedForAll(from, _msgSenderERC721A())) revert TransferCallerNotOwnerNorApproved(); if (to == address(0)) revert TransferToZeroAddress(); _beforeTokenTransfers(from, to, tokenId, 1); // Clear approvals from the previous owner. assembly { if approvedAddress { // This is equivalent to `delete _tokenApprovals[tokenId]`. sstore(approvedAddressSlot, 0) } } // Underflow of the sender's balance is impossible because we check for // ownership above and the recipient's balance can't realistically overflow. // Counter overflow is incredibly unrealistic as `tokenId` would have to be 2**256. unchecked { // We can directly increment and decrement the balances. --_packedAddressData[from]; // Updates: `balance -= 1`. ++_packedAddressData[to]; // Updates: `balance += 1`. // Updates: // - `address` to the next owner. // - `startTimestamp` to the timestamp of transfering. // - `burned` to `false`. // - `nextInitialized` to `true`. _packedOwnerships[tokenId] = _packOwnershipData( to, _BITMASK_NEXT_INITIALIZED | _nextExtraData(from, to, prevOwnershipPacked) ); // If the next slot may not have been initialized (i.e. `nextInitialized == false`) . if (prevOwnershipPacked & _BITMASK_NEXT_INITIALIZED == 0) { uint256 nextTokenId = tokenId + 1; // If the next slot's address is zero and not burned (i.e. packed value is zero). if (_packedOwnerships[nextTokenId] == 0) { // If the next slot is within bounds. if (nextTokenId != _currentIndex) { // Initialize the next slot to maintain correctness for `ownerOf(tokenId + 1)`. _packedOwnerships[nextTokenId] = prevOwnershipPacked; } } } } emit Transfer(from, to, tokenId); _afterTokenTransfers(from, to, tokenId, 1); } /** * @dev Equivalent to `safeTransferFrom(from, to, tokenId, '')`. */ function safeTransferFrom( address from, address to, uint256 tokenId ) public payable virtual override { safeTransferFrom(from, to, tokenId, ""); } /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token * by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement * {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory _data ) public payable virtual override { transferFrom(from, to, tokenId); if (to.code.length != 0) if (!_checkContractOnERC721Received(from, to, tokenId, _data)) { revert TransferToNonERC721ReceiverImplementer(); } } /** * @dev Hook that is called before a set of serially-ordered token IDs * are about to be transferred. This includes minting. * And also called before burning one token. * * `startTokenId` - the first token ID to be transferred. * `quantity` - the amount to be transferred. * * Calling conditions: * * - When `from` and `to` are both non-zero, `from`'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, `tokenId` will be burned by `from`. * - `from` and `to` are never both zero. */ function _beforeTokenTransfers( address from, address to, uint256 startTokenId, uint256 quantity ) internal virtual {} /** * @dev Hook that is called after a set of serially-ordered token IDs * have been transferred. This includes minting. * And also called after one token has been burned. * * `startTokenId` - the first token ID to be transferred. * `quantity` - the amount to be transferred. * * Calling conditions: * * - When `from` and `to` are both non-zero, `from`'s `tokenId` has been * transferred to `to`. * - When `from` is zero, `tokenId` has been minted for `to`. * - When `to` is zero, `tokenId` has been burned by `from`. * - `from` and `to` are never both zero. */ function _afterTokenTransfers( address from, address to, uint256 startTokenId, uint256 quantity ) internal virtual {} /** * @dev Private function to invoke {IERC721Receiver-onERC721Received} on a target contract. * * `from` - Previous owner of the given token ID. * `to` - Target address that will receive the token. * `tokenId` - Token ID to be transferred. * `_data` - Optional data to send along with the call. * * Returns whether the call correctly returned the expected magic value. */ function _checkContractOnERC721Received( address from, address to, uint256 tokenId, bytes memory _data ) private returns (bool) { try ERC721A__IERC721Receiver(to).onERC721Received( _msgSenderERC721A(), from, tokenId, _data ) returns (bytes4 retval) { return retval == ERC721A__IERC721Receiver(to).onERC721Received.selector; } catch (bytes memory reason) { if (reason.length == 0) { revert TransferToNonERC721ReceiverImplementer(); } else { assembly { revert(add(32, reason), mload(reason)) } } } } // ============================================================= // MINT OPERATIONS // ============================================================= /** * @dev Mints `quantity` tokens and transfers them to `to`. * * Requirements: * * - `to` cannot be the zero address. * - `quantity` must be greater than 0. * * Emits a {Transfer} event for each mint. */ function _mint(address to, uint256 quantity) internal virtual { uint256 startTokenId = _currentIndex; if (quantity == 0) revert MintZeroQuantity(); _beforeTokenTransfers(address(0), to, startTokenId, quantity); // Overflows are incredibly unrealistic. // `balance` and `numberMinted` have a maximum limit of 2**64. // `tokenId` has a maximum limit of 2**256. unchecked { // Updates: // - `balance += quantity`. // - `numberMinted += quantity`. // // We can directly add to the `balance` and `numberMinted`. _packedAddressData[to] += quantity * ((1 << _BITPOS_NUMBER_MINTED) | 1); // Updates: // - `address` to the owner. // - `startTimestamp` to the timestamp of minting. // - `burned` to `false`. // - `nextInitialized` to `quantity == 1`. _packedOwnerships[startTokenId] = _packOwnershipData( to, _nextInitializedFlag(quantity) | _nextExtraData(address(0), to, 0) ); uint256 toMasked; uint256 end = startTokenId + quantity; // Use assembly to loop and emit the `Transfer` event for gas savings. // The duplicated `log4` removes an extra check and reduces stack juggling. // The assembly, together with the surrounding Solidity code, have been // delicately arranged to nudge the compiler into producing optimized opcodes. assembly { // Mask `to` to the lower 160 bits, in case the upper bits somehow aren't clean. toMasked := and(to, _BITMASK_ADDRESS) // Emit the `Transfer` event. log4( 0, // Start of data (0, since no data). 0, // End of data (0, since no data). _TRANSFER_EVENT_SIGNATURE, // Signature. 0, // `address(0)`. toMasked, // `to`. startTokenId // `tokenId`. ) // The `iszero(eq(,))` check ensures that large values of `quantity` // that overflows uint256 will make the loop run out of gas. // The compiler will optimize the `iszero` away for performance. for { let tokenId := add(startTokenId, 1) } iszero(eq(tokenId, end)) { tokenId := add(tokenId, 1) } { // Emit the `Transfer` event. Similar to above. log4(0, 0, _TRANSFER_EVENT_SIGNATURE, 0, toMasked, tokenId) } } if (toMasked == 0) revert MintToZeroAddress(); _currentIndex = end; } _afterTokenTransfers(address(0), to, startTokenId, quantity); } /** * @dev Mints `quantity` tokens and transfers them to `to`. * * This function is intended for efficient minting only during contract creation. * * It emits only one {ConsecutiveTransfer} as defined in * [ERC2309](https://eips.ethereum.org/EIPS/eip-2309), * instead of a sequence of {Transfer} event(s). * * Calling this function outside of contract creation WILL make your contract * non-compliant with the ERC721 standard. * For full ERC721 compliance, substituting ERC721 {Transfer} event(s) with the ERC2309 * {ConsecutiveTransfer} event is only permissible during contract creation. * * Requirements: * * - `to` cannot be the zero address. * - `quantity` must be greater than 0. * * Emits a {ConsecutiveTransfer} event. */ function _mintERC2309(address to, uint256 quantity) internal virtual { uint256 startTokenId = _currentIndex; if (to == address(0)) revert MintToZeroAddress(); if (quantity == 0) revert MintZeroQuantity(); if (quantity > _MAX_MINT_ERC2309_QUANTITY_LIMIT) revert MintERC2309QuantityExceedsLimit(); _beforeTokenTransfers(address(0), to, startTokenId, quantity); // Overflows are unrealistic due to the above check for `quantity` to be below the limit. unchecked { // Updates: // - `balance += quantity`. // - `numberMinted += quantity`. // // We can directly add to the `balance` and `numberMinted`. _packedAddressData[to] += quantity * ((1 << _BITPOS_NUMBER_MINTED) | 1); // Updates: // - `address` to the owner. // - `startTimestamp` to the timestamp of minting. // - `burned` to `false`. // - `nextInitialized` to `quantity == 1`. _packedOwnerships[startTokenId] = _packOwnershipData( to, _nextInitializedFlag(quantity) | _nextExtraData(address(0), to, 0) ); emit ConsecutiveTransfer( startTokenId, startTokenId + quantity - 1, address(0), to ); _currentIndex = startTokenId + quantity; } _afterTokenTransfers(address(0), to, startTokenId, quantity); } /** * @dev Safely mints `quantity` tokens and transfers them to `to`. * * Requirements: * * - If `to` refers to a smart contract, it must implement * {IERC721Receiver-onERC721Received}, which is called for each safe transfer. * - `quantity` must be greater than 0. * * See {_mint}. * * Emits a {Transfer} event for each mint. */ function _safeMint( address to, uint256 quantity, bytes memory _data ) internal virtual { _mint(to, quantity); unchecked { if (to.code.length != 0) { uint256 end = _currentIndex; uint256 index = end - quantity; do { if ( !_checkContractOnERC721Received( address(0), to, index++, _data ) ) { revert TransferToNonERC721ReceiverImplementer(); } } while (index < end); // Reentrancy protection. if (_currentIndex != end) revert(); } } } /** * @dev Equivalent to `_safeMint(to, quantity, '')`. */ function _safeMint(address to, uint256 quantity) internal virtual { _safeMint(to, quantity, ""); } // ============================================================= // BURN OPERATIONS // ============================================================= /** * @dev Equivalent to `_burn(tokenId, false)`. */ function _burn(uint256 tokenId) internal virtual { _burn(tokenId, false); } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId, bool approvalCheck) internal virtual { uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId); address from = address(uint160(prevOwnershipPacked)); ( uint256 approvedAddressSlot, address approvedAddress ) = _getApprovedSlotAndAddress(tokenId); if (approvalCheck) { // The nested ifs save around 20+ gas over a compound boolean condition. if ( !_isSenderApprovedOrOwner( approvedAddress, from, _msgSenderERC721A() ) ) if (!isApprovedForAll(from, _msgSenderERC721A())) revert TransferCallerNotOwnerNorApproved(); } _beforeTokenTransfers(from, address(0), tokenId, 1); // Clear approvals from the previous owner. assembly { if approvedAddress { // This is equivalent to `delete _tokenApprovals[tokenId]`. sstore(approvedAddressSlot, 0) } } // Underflow of the sender's balance is impossible because we check for // ownership above and the recipient's balance can't realistically overflow. // Counter overflow is incredibly unrealistic as `tokenId` would have to be 2**256. unchecked { // Updates: // - `balance -= 1`. // - `numberBurned += 1`. // // We can directly decrement the balance, and increment the number burned. // This is equivalent to `packed -= 1; packed += 1 << _BITPOS_NUMBER_BURNED;`. _packedAddressData[from] += (1 << _BITPOS_NUMBER_BURNED) - 1; // Updates: // - `address` to the last owner. // - `startTimestamp` to the timestamp of burning. // - `burned` to `true`. // - `nextInitialized` to `true`. _packedOwnerships[tokenId] = _packOwnershipData( from, (_BITMASK_BURNED | _BITMASK_NEXT_INITIALIZED) | _nextExtraData(from, address(0), prevOwnershipPacked) ); // If the next slot may not have been initialized (i.e. `nextInitialized == false`) . if (prevOwnershipPacked & _BITMASK_NEXT_INITIALIZED == 0) { uint256 nextTokenId = tokenId + 1; // If the next slot's address is zero and not burned (i.e. packed value is zero). if (_packedOwnerships[nextTokenId] == 0) { // If the next slot is within bounds. if (nextTokenId != _currentIndex) { // Initialize the next slot to maintain correctness for `ownerOf(tokenId + 1)`. _packedOwnerships[nextTokenId] = prevOwnershipPacked; } } } } emit Transfer(from, address(0), tokenId); _afterTokenTransfers(from, address(0), tokenId, 1); // Overflow not possible, as _burnCounter cannot be exceed _currentIndex times. unchecked { _burnCounter++; } } // ============================================================= // EXTRA DATA OPERATIONS // ============================================================= /** * @dev Directly sets the extra data for the ownership data `index`. */ function _setExtraDataAt(uint256 index, uint24 extraData) internal virtual { uint256 packed = _packedOwnerships[index]; if (packed == 0) revert OwnershipNotInitialazeddForExtraData(); uint256 extraDataCasted; // Cast `extraData` with assembly to avoid redundant masking. assembly { extraDataCasted := extraData } packed = (packed & _BITMASK_EXTRA_DATA_COMPLEMENT) | (extraDataCasted << _BITPOS_EXTRA_DATA); _packedOwnerships[index] = packed; } /** * @dev Called during each token transfer to set the 24bit `extraData` field. * Intended to be overridden by the cosumer contract. * * `previousExtraData` - the value of `extraData` before transfer. * * Calling conditions: * * - When `from` and `to` are both non-zero, `from`'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, `tokenId` will be burned by `from`. * - `from` and `to` are never both zero. */ function _extraData( address from, address to, uint24 previousExtraData ) internal view virtual returns (uint24) {} /** * @dev Returns the next extra data for the packed ownership data. * The returned result is shifted into position. */ function _nextExtraData( address from, address to, uint256 prevOwnershipPacked ) private view returns (uint256) { uint24 extraData = uint24(prevOwnershipPacked >> _BITPOS_EXTRA_DATA); return uint256(_extraData(from, to, extraData)) << _BITPOS_EXTRA_DATA; } // ============================================================= // OTHER OPERATIONS // ============================================================= /** * @dev Returns the message sender (defaults to `msg.sender`). * * If you are writing GSN compatible contracts, you need to override this function. */ function _msgSenderERC721A() internal view virtual returns (address) { return msg.sender; } /** * @dev Converts a uint256 to its ASCII string decimal representation. */ function _toString( uint256 value ) internal pure virtual returns (string memory str) { assembly { // The maximum value of a uint256 contains 78 digits (1 byte per digit), but // we allocate 0xa0 bytes to keep the free memory pointer 32-byte word aligned. // We will need 1 word for the trailing zeros padding, 1 word for the length, // and 3 words for a maximum of 78 digits. Total: 5 * 0x20 = 0xa0. let m := add(mload(0x40), 0xa0) // Update the free memory pointer to allocate. mstore(0x40, m) // Assign the `str` to the end. str := sub(m, 0x20) // Zeroize the slot after the string. mstore(str, 0) // Cache the end of the memory to calculate the length later. let end := str // We write the string from rightmost digit to leftmost digit. // The following is essentially a do-while loop that also handles the zero case. // prettier-ignore for { let temp := value } 1 {} { str := sub(str, 1) // Write the character to the pointer. // The ASCII index of the '0' character is 48. mstore8(str, add(48, mod(temp, 10))) // Keep dividing `temp` until zero. temp := div(temp, 10) // prettier-ignore if iszero(temp) { break } } let length := sub(end, str) // Move the pointer 32 bytes leftwards to make room for the length. str := sub(str, 0x20) // Store the length. mstore(str, length) } } } // File erc721a/contracts/extensions/[email protected] // Original license: SPDX_License_Identifier: MIT // ERC721A Contracts v4.2.3 // Creator: Chiru Labs pragma solidity ^0.8.4; /** * @dev Interface of ERC721AQueryable. */ interface IERC721AQueryable is IERC721A { /** * Invalid query range (`start` >= `stop`). */ error InvalidQueryRange(); /** * @dev Returns the `TokenOwnership` struct at `tokenId` without reverting. * * If the `tokenId` is out of bounds: * * - `addr = address(0)` * - `startTimestamp = 0` * - `burned = false` * - `extraData = 0` * * If the `tokenId` is burned: * * - `addr = <Address of owner before token was burned>` * - `startTimestamp = <Timestamp when token was burned>` * - `burned = true` * - `extraData = <Extra data when token was burned>` * * Otherwise: * * - `addr = <Address of owner>` * - `startTimestamp = <Timestamp of start of ownership>` * - `burned = false` * - `extraData = <Extra data at start of ownership>` */ function explicitOwnershipOf( uint256 tokenId ) external view returns (TokenOwnership memory); /** * @dev Returns an array of `TokenOwnership` structs at `tokenIds` in order. * See {ERC721AQueryable-explicitOwnershipOf} */ function explicitOwnershipsOf( uint256[] memory tokenIds ) external view returns (TokenOwnership[] memory); /** * @dev Returns an array of token IDs owned by `owner`, * in the range [`start`, `stop`) * (i.e. `start <= tokenId < stop`). * * This function allows for tokens to be queried if the collection * grows too big for a single call of {ERC721AQueryable-tokensOfOwner}. * * Requirements: * * - `start < stop` */ function tokensOfOwnerIn( address owner, uint256 start, uint256 stop ) external view returns (uint256[] memory); /** * @dev Returns an array of token IDs owned by `owner`. * * This function scans the ownership mapping and is O(`totalSupply`) in complexity. * It is meant to be called off-chain. * * See {ERC721AQueryable-tokensOfOwnerIn} for splitting the scan into * multiple smaller scans if the collection is large enough to cause * an out-of-gas error (10K collections should be fine). */ function tokensOfOwner( address owner ) external view returns (uint256[] memory); } // File erc721a/contracts/extensions/[email protected] // Original license: SPDX_License_Identifier: MIT // ERC721A Contracts v4.2.3 // Creator: Chiru Labs pragma solidity ^0.8.4; /** * @title ERC721AQueryable. * * @dev ERC721A subclass with convenience query functions. */ abstract contract ERC721AQueryable is ERC721A, IERC721AQueryable { /** * @dev Returns the `TokenOwnership` struct at `tokenId` without reverting. * * If the `tokenId` is out of bounds: * * - `addr = address(0)` * - `startTimestamp = 0` * - `burned = false` * - `extraData = 0` * * If the `tokenId` is burned: * * - `addr = <Address of owner before token was burned>` * - `startTimestamp = <Timestamp when token was burned>` * - `burned = true` * - `extraData = <Extra data when token was burned>` * * Otherwise: * * - `addr = <Address of owner>` * - `startTimestamp = <Timestamp of start of ownership>` * - `burned = false` * - `extraData = <Extra data at start of ownership>` */ function explicitOwnershipOf( uint256 tokenId ) public view virtual override returns (TokenOwnership memory) { TokenOwnership memory ownership; if (tokenId < _startTokenId() || tokenId >= _nextTokenId()) { return ownership; } ownership = _ownershipAt(tokenId); if (ownership.burned) { return ownership; } return _ownershipOf(tokenId); } /** * @dev Returns an array of `TokenOwnership` structs at `tokenIds` in order. * See {ERC721AQueryable-explicitOwnershipOf} */ function explicitOwnershipsOf( uint256[] calldata tokenIds ) external view virtual override returns (TokenOwnership[] memory) { unchecked { uint256 tokenIdsLength = tokenIds.length; TokenOwnership[] memory ownerships = new TokenOwnership[]( tokenIdsLength ); for (uint256 i; i != tokenIdsLength; ++i) { ownerships[i] = explicitOwnershipOf(tokenIds[i]); } return ownerships; } } /** * @dev Returns an array of token IDs owned by `owner`, * in the range [`start`, `stop`) * (i.e. `start <= tokenId < stop`). * * This function allows for tokens to be queried if the collection * grows too big for a single call of {ERC721AQueryable-tokensOfOwner}. * * Requirements: * * - `start < stop` */ function tokensOfOwnerIn( address owner, uint256 start, uint256 stop ) external view virtual override returns (uint256[] memory) { unchecked { if (start >= stop) revert InvalidQueryRange(); uint256 tokenIdsIdx; uint256 stopLimit = _nextTokenId(); // Set `start = max(start, _startTokenId())`. if (start < _startTokenId()) { start = _startTokenId(); } // Set `stop = min(stop, stopLimit)`. if (stop > stopLimit) { stop = stopLimit; } uint256 tokenIdsMaxLength = balanceOf(owner); // Set `tokenIdsMaxLength = min(balanceOf(owner), stop - start)`, // to cater for cases where `balanceOf(owner)` is too big. if (start < stop) { uint256 rangeLength = stop - start; if (rangeLength < tokenIdsMaxLength) { tokenIdsMaxLength = rangeLength; } } else { tokenIdsMaxLength = 0; } uint256[] memory tokenIds = new uint256[](tokenIdsMaxLength); if (tokenIdsMaxLength == 0) { return tokenIds; } // We need to call `explicitOwnershipOf(start)`, // because the slot at `start` may not be initialized. TokenOwnership memory ownership = explicitOwnershipOf(start); address currOwnershipAddr; // If the starting slot exists (i.e. not burned), initialize `currOwnershipAddr`. // `ownership.address` will not be zero, as `start` is clamped to the valid token ID range. if (!ownership.burned) { currOwnershipAddr = ownership.addr; } for ( uint256 i = start; i != stop && tokenIdsIdx != tokenIdsMaxLength; ++i ) { ownership = _ownershipAt(i); if (ownership.burned) { continue; } if (ownership.addr != address(0)) { currOwnershipAddr = ownership.addr; } if (currOwnershipAddr == owner) { tokenIds[tokenIdsIdx++] = i; } } // Downsize the array to fit. assembly { mstore(tokenIds, tokenIdsIdx) } return tokenIds; } } /** * @dev Returns an array of token IDs owned by `owner`. * * This function scans the ownership mapping and is O(`totalSupply`) in complexity. * It is meant to be called off-chain. * * See {ERC721AQueryable-tokensOfOwnerIn} for splitting the scan into * multiple smaller scans if the collection is large enough to cause * an out-of-gas error (10K collections should be fine). */ function tokensOfOwner( address owner ) external view virtual override returns (uint256[] memory) { unchecked { uint256 tokenIdsIdx; address currOwnershipAddr; uint256 tokenIdsLength = balanceOf(owner); uint256[] memory tokenIds = new uint256[](tokenIdsLength); TokenOwnership memory ownership; for ( uint256 i = _startTokenId(); tokenIdsIdx != tokenIdsLength; ++i ) { ownership = _ownershipAt(i); if (ownership.burned) { continue; } if (ownership.addr != address(0)) { currOwnershipAddr = ownership.addr; } if (currOwnershipAddr == owner) { tokenIds[tokenIdsIdx++] = i; } } return tokenIds; } } } // File contracts/RegularDrop.sol // Original license: SPDX_License_Identifier: MIT // Tockable drop v1 pragma solidity ^0.8.0; contract TockableRegularDropFromFactoryV1 is ERC721AQueryable, Ownable(msg.sender), ReentrancyGuard { /** ************ * Contract * ************ */ uint256 public constant TOCKABLE_CONTRACT_VERSION = 1; /** * **ERC-721s:** * Tock drop = 0 * Regular drop = 1 * Mono drop = 2 * Selectable drop = 3 * * TockFromFactory = 4 * RegularFromFactory = 5 * MonoFromFactory = 6 * SelectableFromFactory = 7 */ uint256 public constant DROP_TYPE = 5; /** ********** * Errors * ********** */ error InvalidArgs(); error NotInitialazed(); error MintIsNotLive(); error MoreThanAllowed(); error MoreThanAvailable(); error NotElligible(); error NotEnoughEth(); error UnAuthorized(); error WithdrawFailed(); error MetadataIsFrozen(); error TokenIsNotExisted(); /** *********** * Structs * *********** */ struct Role { uint256 id; uint256 price; uint256 maxAllowedMint; } struct Session { uint256 id; uint256[] allowedRoles; uint256 allocation; } /** ************* * Variables * ************* */ string private CONTRACT_NAME; string private TOKEN_NAME; string private TOKEN_SYMBOL; uint256 public TOTAL_SUPPLY; uint256 private constant FIRST_TOKEN_ID = 1; uint256 private BASE_FEE; address private tockableAddress; address private signerAddress; bool public isMintLive = false; bool public isMetadataFrozen = false; uint256 public activeSession; uint256 private existingRolesLength; uint256 private exisitngSessionsLength; string private tokenBaseURI; bool private hasExtension; /** ************ * Mappings * ************ */ mapping(uint256 => uint256) private mintedInSessionById; mapping(address => mapping(uint256 => mapping(uint256 => uint256))) private mintedByAddressInRoleInSessionId; mapping(uint256 => Role) private getRoleById; mapping(uint256 => Session) private getSessionById; /** *********** * Setters * *********** */ function setRoles(Role[] calldata _roles) external onlyOwner { if (_roles.length == 0) revert InvalidArgs(); if (existingRolesLength > 0) { if (_roles.length < existingRolesLength) revert InvalidArgs(); } unchecked { for (uint256 i = 0; i < _roles.length; i++) { getRoleById[i] = _roles[i]; } } if (existingRolesLength < _roles.length) existingRolesLength = _roles.length; } function setSessions(Session[] calldata _sessions) external onlyOwner { if (_sessions.length == 0) revert InvalidArgs(); if (exisitngSessionsLength > 0) { if (_sessions.length < exisitngSessionsLength) revert InvalidArgs(); } unchecked { for (uint256 i = 0; i < _sessions.length; i++) { getSessionById[i] = _sessions[i]; } } if (exisitngSessionsLength < _sessions.length) exisitngSessionsLength = _sessions.length; } function setMintIsLive(bool _status) public onlyOwner { isMintLive = _status; } function setActiveSession(uint256 _activeSession) external onlyOwner { if (!isMintLive) setMintIsLive(true); activeSession = _activeSession; } function _startTokenId() internal view virtual override returns (uint256) { return FIRST_TOKEN_ID; } /** ******** * Mint * ******** */ function mint( uint256 _quantity, bytes calldata _signature, uint256 _roleId ) external payable nonReentrant { if (!isMintLive) revert MintIsNotLive(); isElligible(_roleId); isSignatureValid(msg.sender, _roleId, _signature); isTokenLeftInTotal(_quantity); isTokenLeftInActiveSession(_quantity); isTokenLeftForAddressInRoleInSession(msg.sender, _roleId, _quantity); uint256 payAmount = (getRoleById[_roleId].price + BASE_FEE) * _quantity; if (msg.value < payAmount) revert NotEnoughEth(); _safeMint(msg.sender, _quantity); mintedInSessionById[activeSession] = mintedInSessionById[activeSession] + _quantity; mintedByAddressInRoleInSessionId[msg.sender][_roleId][activeSession] = mintedByAddressInRoleInSessionId[msg.sender][_roleId][ activeSession ] + _quantity; uint256 tockableFee = _quantity * BASE_FEE; withdrawEth(payable(tockableAddress), tockableFee); } function publicMint(uint256 _quantity) external payable nonReentrant { if (!isMintLive) revert MintIsNotLive(); require(activeSession == 0, "Can't mint at this session"); isTokenLeftInTotal(_quantity); isTokenLeftInActiveSession(_quantity); isTokenLeftForAddressInRoleInSession(msg.sender, 0, _quantity); uint256 payAmount = (getRoleById[0].price + BASE_FEE) * _quantity; if (msg.value < payAmount) revert NotEnoughEth(); _safeMint(msg.sender, _quantity); mintedInSessionById[0] = mintedInSessionById[0] + _quantity; mintedByAddressInRoleInSessionId[msg.sender][0][0] = mintedByAddressInRoleInSessionId[msg.sender][0][0] + _quantity; uint256 tockableFee = _quantity * BASE_FEE; withdrawEth(payable(tockableAddress), tockableFee); } function ownerMint( address _to, uint256 _quantity ) external nonReentrant onlyOwner { isTokenLeftInTotal(_quantity); _safeMint(_to, _quantity); } /** ************** * Validators * ************** */ function isTokenLeftInTotal(uint256 _quantity) private view { if (tokensLeft() < _quantity) revert MoreThanAvailable(); } function isTokenLeftInActiveSession(uint256 _quantity) private view { if (tokensLeftInSession(activeSession) < _quantity) revert MoreThanAvailable(); } function isTokenLeftForAddressInRoleInSession( address _address, uint256 _roleId, uint256 _quantity ) private view { if ( tokensLeftForAddressInRoleInActiveSession(_address, _roleId) < _quantity ) revert MoreThanAllowed(); } function isSignatureValid( address _address, uint256 _roleId, bytes memory _signature ) private view { if (recoverSigner(_address, _roleId, _signature) != signerAddress) revert UnAuthorized(); } function isElligible(uint256 _roleId) private view { uint256[] memory allowedRolesIdsInCurrentSession = getSessionById[ activeSession ].allowedRoles; if (!isInArray(allowedRolesIdsInCurrentSession, _roleId)) revert NotElligible(); } /** ************ * Metadata * ************ */ function _baseURI() internal view virtual override returns (string memory) { return string(abi.encodePacked("ipfs://", tokenBaseURI, "/")); } function getBaseURI() public view returns (string memory) { return _baseURI(); } function setMetadataHasExtension(bool _hasExtension) public onlyOwner { hasExtension = _hasExtension; } function setBaseURI( string memory _newBaseURI, bool _hasExtension ) external onlyOwner { if (isMetadataFrozen) revert MetadataIsFrozen(); tokenBaseURI = _newBaseURI; setMetadataHasExtension(_hasExtension); } function freezeMetadata() external onlyOwner { if (!isMetadataFrozen) isMetadataFrozen = true; } function tokenURI( uint256 tokenId ) public view virtual override(ERC721A, IERC721A) returns (string memory) { if (!_exists(tokenId)) revert TokenIsNotExisted(); string memory baseURI = _baseURI(); if (bytes(baseURI).length == 0) return ""; string memory ext = hasExtension ? ".json" : ""; return string(abi.encodePacked(baseURI, _toString(tokenId), ext)); } /** ************ * Transfer * ************ */ function transfersFrom( address from, address to, uint256[] memory tokenIds ) public virtual { for (uint i = 0; i < tokenIds.length; i++) transferFrom(from, to, tokenIds[i]); } function safeTransfersFrom( address from, address to, uint256[] memory tokenIds, bytes memory _data ) public virtual { for (uint i = 0; i < tokenIds.length; i++) safeTransferFrom(from, to, tokenIds[i], _data); } /** ************ * Withdraw * ************ */ function withdraw() public onlyOwner { withdrawEth(payable(msg.sender), address(this).balance); } function withdrawEth(address payable to, uint256 amount) private { if (amount == 0) return; (bool ow, ) = to.call{value: amount}(""); if (!ow) revert WithdrawFailed(); } receive() external payable {} /** ********* * Utils * ********* */ function tokensLeft() public view returns (uint256) { return TOTAL_SUPPLY - _totalMinted(); } function tokensLeftInSession(uint256 _id) public view returns (uint256) { return getSessionById[_id].allocation - mintedInSessionById[_id]; } function tokensLeftForAddressInRoleInActiveSession( address _address, uint256 _roleId ) private view returns (uint256) { uint256 minted = mintedByAddressInRoleInSessionId[_address][_roleId][ activeSession ]; uint256 maxMintable = getRoleById[_roleId].maxAllowedMint; return maxMintable - minted; } function recoverSigner( address _address, uint256 _roleId, bytes memory _signature ) private view returns (address) { bytes32 hash = keccak256( abi.encodePacked(_address, _roleId, activeSession) ); bytes32 messageDigest = keccak256( abi.encodePacked("\x19Ethereum Signed Message:\n32", hash) ); return ECDSA.recover(messageDigest, _signature); } function getContractData() external view returns ( uint256, uint256, string memory, string memory, string memory, uint256, bool, bool, bool, string memory ) { return ( TOCKABLE_CONTRACT_VERSION, DROP_TYPE, CONTRACT_NAME, TOKEN_NAME, TOKEN_SYMBOL, TOTAL_SUPPLY, isMintLive, isMetadataFrozen, hasExtension, tokenBaseURI ); } function getSupplyData( address _address, uint256 _roleId ) external view returns (uint256, uint256, uint256) { uint256 tokensLeftInTotal = tokensLeft(); uint256 tokensLeftInActiveSession = tokensLeftInSession(activeSession); uint256 tokensLeftForAddress = tokensLeftForAddressInRoleInActiveSession( _address, _roleId ); return ( tokensLeftInTotal, tokensLeftInActiveSession, tokensLeftForAddress ); } function isInArray( uint256[] memory _arr, uint256 _val ) private pure returns (bool) { uint256 len = _arr.length; for (uint256 i = 0; i < len; i++) if (_arr[i] == _val) return true; return false; } /** *************** * Constructor * *************** */ constructor( address _tockableAddress, address _signerAddress, string memory _contractName, string memory _tokenName, string memory _tokenSymbol, uint256 _baseFee, uint256 _totalSupply ) ERC721A(_contractName, _tokenSymbol) { tockableAddress = _tockableAddress; signerAddress = _signerAddress; CONTRACT_NAME = _contractName; TOKEN_NAME = _tokenName; TOKEN_SYMBOL = _tokenSymbol; BASE_FEE = _baseFee; TOTAL_SUPPLY = _totalSupply; } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"_tockableAddress","type":"address"},{"internalType":"address","name":"_signerAddress","type":"address"},{"internalType":"string","name":"_contractName","type":"string"},{"internalType":"string","name":"_tokenName","type":"string"},{"internalType":"string","name":"_tokenSymbol","type":"string"},{"internalType":"uint256","name":"_baseFee","type":"uint256"},{"internalType":"uint256","name":"_totalSupply","type":"uint256"}],"name":"deployTockableRegularDropFromFactoryV1","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
6080604052348015600e575f80fd5b506137348061001c5f395ff3fe608060405234801561000f575f80fd5b5060043610610029575f3560e01c8063d1d6ba4a1461002d575b5f80fd5b61004061003b3660046101c6565b61005c565b6040516001600160a01b03909116815260200160405180910390f35b5f8088888888888888604051610071906100ff565b61008197969594939291906102b6565b604051809103905ff08015801561009a573d5f803e3d5ffd5b5060405163f2fde38b60e01b81523360048201529091506001600160a01b0382169063f2fde38b906024015f604051808303815f87803b1580156100dc575f80fd5b505af11580156100ee573d5f803e3d5ffd5b50929b9a5050505050505050505050565b6133e08061031f83390190565b80356001600160a01b0381168114610122575f80fd5b919050565b634e487b7160e01b5f52604160045260245ffd5b5f82601f83011261014a575f80fd5b813567ffffffffffffffff81111561016457610164610127565b604051601f8201601f19908116603f0116810167ffffffffffffffff8111828210171561019357610193610127565b6040528181528382016020018510156101aa575f80fd5b816020850160208301375f918101602001919091529392505050565b5f805f805f805f60e0888a0312156101dc575f80fd5b6101e58861010c565b96506101f36020890161010c565b9550604088013567ffffffffffffffff81111561020e575f80fd5b61021a8a828b0161013b565b955050606088013567ffffffffffffffff811115610236575f80fd5b6102428a828b0161013b565b945050608088013567ffffffffffffffff81111561025e575f80fd5b61026a8a828b0161013b565b979a969950949793969560a0850135955060c0909401359392505050565b5f81518084528060208401602086015e5f602082860101526020601f19601f83011685010191505092915050565b6001600160a01b0388811682528716602082015260e0604082018190525f906102e190830188610288565b82810360608401526102f38188610288565b905082810360808401526103078187610288565b60a0840195909552505060c001529594505050505056fe60806040526010805461ffff60a01b1916905534801561001d575f80fd5b506040516133e03803806133e083398101604081905261003c9161020f565b338584600261004b8382610359565b5060036100588282610359565b5060015f5550506001600160a01b03811661008c57604051631e4fbdf760e01b81525f600482015260240160405180910390fd5b61009581610106565b506001600955600f80546001600160a01b03808a166001600160a01b0319928316179092556010805492891692909116919091179055600a6100d78682610359565b50600b6100e48582610359565b50600c6100f18482610359565b50600e91909155600d55506104139350505050565b600880546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b80516001600160a01b038116811461016d575f80fd5b919050565b634e487b7160e01b5f52604160045260245ffd5b5f82601f830112610195575f80fd5b81516001600160401b038111156101ae576101ae610172565b604051601f8201601f19908116603f011681016001600160401b03811182821017156101dc576101dc610172565b6040528181528382016020018510156101f3575f80fd5b8160208501602083015e5f918101602001919091529392505050565b5f805f805f805f60e0888a031215610225575f80fd5b61022e88610157565b965061023c60208901610157565b60408901519096506001600160401b03811115610257575f80fd5b6102638a828b01610186565b60608a015190965090506001600160401b03811115610280575f80fd5b61028c8a828b01610186565b60808a015190955090506001600160401b038111156102a9575f80fd5b6102b58a828b01610186565b60a08a015160c0909a0151989b979a509598949795969495949350505050565b600181811c908216806102e957607f821691505b60208210810361030757634e487b7160e01b5f52602260045260245ffd5b50919050565b601f82111561035457805f5260205f20601f840160051c810160208510156103325750805b601f840160051c820191505b81811015610351575f815560010161033e565b50505b505050565b81516001600160401b0381111561037257610372610172565b6103868161038084546102d5565b8461030d565b6020601f8211600181146103b8575f83156103a15750848201515b5f19600385901b1c1916600184901b178455610351565b5f84815260208120601f198516915b828110156103e757878501518255602094850194600190920191016103c7565b508482101561040457868401515f19600387901b60f8161c191681555b50505050600190811b01905550565b612fc0806104205f395ff3fe60806040526004361061026d575f3560e01c806370a082311161014a578063a68b91ab116100be578063d111515d11610078578063d111515d146106fd578063d50c408714610711578063e8c0656614610726578063e985e9c514610760578063f2fde38b146107a7578063fdfc7aae146107c6575f80fd5b8063a68b91ab14610642578063b31f8f931461066c578063b64b21ca14610680578063b88d4fde1461069f578063c23dc68f146106b2578063c87b56dd146106de575f80fd5b806389b5a8c21161010f57806389b5a8c21461059f5780638da5cb5b146105be578063902d55a5146105db57806395d89b41146105f057806399a2557a14610604578063a22cb46514610623575f80fd5b806370a082311461050d578063714c53981461052c578063715018a614610540578063733c88d2146105545780638462151c14610573575f80fd5b80633ccfd60b116101e1578063518bd980116101a6578063518bd98014610451578063596b7300146104705780635bbb2177146104845780636352211e146104b05780636d16a801146104cf5780636e453d62146104ee575f80fd5b80633ccfd60b146103cd57806342842e0e146103e1578063484b973c146103f45780634f4edd74146104135780634f6b45df14610432575f80fd5b80630e24495e116102325780630e24495e1461033b57806318160ddd1461035b57806323b872dd146103755780632db11544146103885780632e87871d1461039b57806332ab9bbe146103ae575f80fd5b806301ffc9a71461027857806306fdde03146102ac578063081812fc146102cd578063095ea7b3146103045780630d472c6514610319575f80fd5b3661027457005b5f80fd5b348015610283575f80fd5b506102976102923660046124b0565b6107e6565b60405190151581526020015b60405180910390f35b3480156102b7575f80fd5b506102c0610837565b6040516102a391906124f9565b3480156102d8575f80fd5b506102ec6102e736600461250b565b6108c7565b6040516001600160a01b0390911681526020016102a3565b61031761031236600461253d565b610909565b005b348015610324575f80fd5b5061032d600581565b6040519081526020016102a3565b348015610346575f80fd5b5060105461029790600160a81b900460ff1681565b348015610366575f80fd5b506001545f54035f190161032d565b610317610383366004612565565b6109a7565b61031761039636600461250b565b610b36565b6103176103a936600461259f565b610d25565b3480156103b9575f80fd5b506103176103c836600461274a565b610ed0565b3480156103d8575f80fd5b50610317610f0f565b6103176103ef366004612565565b610f23565b3480156103ff575f80fd5b5061031761040e36600461253d565b610f42565b34801561041e575f80fd5b5061031761042d366004612814565b610f73565b34801561043d575f80fd5b5061031761044c36600461250b565b611027565b34801561045c575f80fd5b5061032d61046b36600461250b565b61104f565b34801561047b575f80fd5b5061032d600181565b34801561048f575f80fd5b506104a361049e366004612814565b611075565b6040516102a3919061288e565b3480156104bb575f80fd5b506102ec6104ca36600461250b565b61113c565b3480156104da575f80fd5b506103176104e93660046128ea565b611146565b3480156104f9575f80fd5b506103176105083660046128ea565b61116c565b348015610518575f80fd5b5061032d610527366004612903565b611187565b348015610537575f80fd5b506102c06111d3565b34801561054b575f80fd5b506103176111e2565b34801561055f575f80fd5b5061031761056e36600461291c565b6111f3565b34801561057e575f80fd5b5061059261058d366004612903565b6112af565b6040516102a3919061298b565b3480156105aa575f80fd5b506103176105b93660046129c2565b6113b3565b3480156105c9575f80fd5b506008546001600160a01b03166102ec565b3480156105e6575f80fd5b5061032d600d5481565b3480156105fb575f80fd5b506102c06113ea565b34801561060f575f80fd5b5061059261061e366004612a1b565b6113f9565b34801561062e575f80fd5b5061031761063d366004612a4b565b611578565b34801561064d575f80fd5b506106566115e3565b6040516102a39a99989796959493929190612a7c565b348015610677575f80fd5b5061032d611876565b34801561068b575f80fd5b5061031761069a366004612b07565b611889565b6103176106ad366004612b5b565b6118d2565b3480156106bd575f80fd5b506106d16106cc36600461250b565b611916565b6040516102a39190612ba6565b3480156106e9575f80fd5b506102c06106f836600461250b565b61199b565b348015610708575f80fd5b50610317611a61565b34801561071c575f80fd5b5061032d60115481565b348015610731575f80fd5b5061074561074036600461253d565b611a8f565b604080519384526020840192909252908201526060016102a3565b34801561076b575f80fd5b5061029761077a366004612bb4565b6001600160a01b039182165f90815260076020908152604080832093909416825291909152205460ff1690565b3480156107b2575f80fd5b506103176107c1366004612903565b611ac8565b3480156107d1575f80fd5b5060105461029790600160a01b900460ff1681565b5f6301ffc9a760e01b6001600160e01b03198316148061081657506380ac58cd60e01b6001600160e01b03198316145b806108315750635b5e139f60e01b6001600160e01b03198316145b92915050565b60606002805461084690612bdc565b80601f016020809104026020016040519081016040528092919081815260200182805461087290612bdc565b80156108bd5780601f10610894576101008083540402835291602001916108bd565b820191905f5260205f20905b8154815290600101906020018083116108a057829003601f168201915b5050505050905090565b5f6108d182611b02565b6108ee576040516333d1c03960e21b815260040160405180910390fd5b505f908152600660205260409020546001600160a01b031690565b5f6109138261113c565b9050336001600160a01b0382161461094c5761092f813361077a565b61094c576040516367d9dca160e11b815260040160405180910390fd5b5f8281526006602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b5f6109b182611b34565b9050836001600160a01b0316816001600160a01b0316146109e45760405162a1148160e81b815260040160405180910390fd5b5f8281526006602052604090208054338082146001600160a01b03881690911417610a3057610a13863361077a565b610a3057604051632ce44b5f60e11b815260040160405180910390fd5b6001600160a01b038516610a5757604051633a954ecd60e21b815260040160405180910390fd5b8015610a61575f82555b6001600160a01b038681165f9081526005602052604080822080545f19019055918716808252919020805460010190554260a01b17600160e11b175f85815260046020526040812091909155600160e11b84169003610aed57600184015f818152600460205260408120549003610aeb575f548114610aeb575f8181526004602052604090208490555b505b83856001600160a01b0316876001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4505050505050565b610b3e611b9d565b601054600160a01b900460ff16610b68576040516303eaac9360e01b815260040160405180910390fd5b60115415610bbd5760405162461bcd60e51b815260206004820152601a60248201527f43616e2774206d696e7420617420746869732073657373696f6e00000000000060448201526064015b60405180910390fd5b610bc681611bc7565b610bcf81611bef565b610bda335f83611bfb565b600e545f80805260186020527f999d26de3473317ead3eeaf34ca78057f1439db67b6953469c3c96ce9caf6bd85490918391610c169190612c28565b610c209190612c3b565b905080341015610c435760405163f14a42b760e01b815260040160405180910390fd5b610c4d3383611c25565b5f805260166020527f0263c2b778d062355049effc2dece97bc6547ff8a88a3258daa512061c2153dd54610c82908390612c28565b7f0263c2b778d062355049effc2dece97bc6547ff8a88a3258daa512061c2153dd55335f9081526017602090815260408083208380528252808320909152902054610cce908390612c28565b335f9081526017602090815260408083208380528252808320909152812091909155600e54610cfd9084612c3b565b600f54909150610d16906001600160a01b031682611c3e565b5050610d226001600955565b50565b610d2d611b9d565b601054600160a01b900460ff16610d57576040516303eaac9360e01b815260040160405180910390fd5b610d6081611cb9565b610da0338285858080601f0160208091040260200160405190810160405280939291908181526020018383808284375f92019190915250611d4092505050565b610da984611bc7565b610db284611bef565b610dbd338286611bfb565b600e545f8281526018602052604081206001015490918691610ddf9190612c28565b610de99190612c3b565b905080341015610e0c5760405163f14a42b760e01b815260040160405180910390fd5b610e163386611c25565b6011545f90815260166020526040902054610e32908690612c28565b601180545f9081526016602090815260408083209490945533825260178152838220868352815283822092548252919091522054610e71908690612c28565b335f90815260176020908152604080832086845282528083206011548452909152812091909155600e54610ea59087612c3b565b600f54909150610ebe906001600160a01b031682611c3e565b5050610eca6001600955565b50505050565b5f5b8251811015610f0857610f008585858481518110610ef257610ef2612c52565b6020026020010151856118d2565b600101610ed2565b5050505050565b610f17611d7e565b610f213347611c3e565b565b610f3d83838360405180602001604052805f8152506118d2565b505050565b610f4a611b9d565b610f52611d7e565b610f5b81611bc7565b610f658282611c25565b610f6f6001600955565b5050565b610f7b611d7e565b5f819003610f9c576040516350dd03f760e11b815260040160405180910390fd5b60135415610fc757601354811015610fc7576040516350dd03f760e11b815260040160405180910390fd5b5f5b8181101561101657828282818110610fe357610fe3612c52565b9050602002810190610ff59190612c66565b5f82815260196020526040902061100c8282612c98565b5050600101610fc9565b50601354811115610f6f5760135550565b61102f611d7e565b601054600160a01b900460ff1661104a5761104a6001611146565b601155565b5f8181526016602090815260408083205460199092528220600201546108319190612d5e565b6060815f816001600160401b038111156110915761109161261b565b6040519080825280602002602001820160405280156110e157816020015b604080516080810182525f8082526020808301829052928201819052606082015282525f199092019101816110af5790505b5090505f5b8281146111335761110e86868381811061110257611102612c52565b90506020020135611916565b82828151811061112057611120612c52565b60209081029190910101526001016110e6565b50949350505050565b5f61083182611b34565b61114e611d7e565b60108054911515600160a01b0260ff60a01b19909216919091179055565b611174611d7e565b6015805460ff1916911515919091179055565b5f6001600160a01b0382166111af576040516323d3ad8160e21b815260040160405180910390fd5b506001600160a01b03165f908152600560205260409020546001600160401b031690565b60606111dd611dab565b905090565b6111ea611d7e565b610f215f611dd3565b6111fb611d7e565b5f81900361121c576040516350dd03f760e11b815260040160405180910390fd5b6012541561124757601254811015611247576040516350dd03f760e11b815260040160405180910390fd5b5f5b8181101561129e5782828281811061126357611263612c52565b5f8481526018602090815260409182902060609093029490940180358355938401356001830155830135600282015590505050600101611249565b50601254811115610f6f5760125550565b60605f805f6112bd85611187565b90505f816001600160401b038111156112d8576112d861261b565b604051908082528060200260200182016040528015611301578160200160208202803683370190505b50905061132d604080516080810182525f80825260208201819052918101829052606081019190915290565b60015b8386146113a75761134081611e24565b9150816040015161139f5781516001600160a01b03161561136057815194505b876001600160a01b0316856001600160a01b03160361139f578083878060010198508151811061139257611392612c52565b6020026020010181815250505b600101611330565b50909695505050505050565b5f5b8151811015610eca576113e284848484815181106113d5576113d5612c52565b60200260200101516109a7565b6001016113b5565b60606003805461084690612bdc565b606081831061141b57604051631960ccad60e11b815260040160405180910390fd5b5f806114255f5490565b9050600185101561143557600194505b80841115611441578093505b5f61144b87611187565b90508486101561146a5785850381811015611464578091505b5061146d565b505f5b5f816001600160401b038111156114865761148661261b565b6040519080825280602002602001820160405280156114af578160200160208202803683370190505b509050815f036114c457935061157192505050565b5f6114ce88611916565b90505f81604001516114de575080515b885b8881141580156114f05750848714155b15611565576114fe81611e24565b9250826040015161155d5782516001600160a01b03161561151e57825191505b8a6001600160a01b0316826001600160a01b03160361155d578084888060010199508151811061155057611550612c52565b6020026020010181815250505b6001016114e0565b50505092835250909150505b9392505050565b335f8181526007602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b5f8060608060605f805f80606060016005600a600b600c600d54601060149054906101000a900460ff16601060159054906101000a900460ff1660155f9054906101000a900460ff16601487805461163a90612bdc565b80601f016020809104026020016040519081016040528092919081815260200182805461166690612bdc565b80156116b15780601f10611688576101008083540402835291602001916116b1565b820191905f5260205f20905b81548152906001019060200180831161169457829003601f168201915b505050505097508680546116c490612bdc565b80601f01602080910402602001604051908101604052809291908181526020018280546116f090612bdc565b801561173b5780601f106117125761010080835404028352916020019161173b565b820191905f5260205f20905b81548152906001019060200180831161171e57829003601f168201915b5050505050965085805461174e90612bdc565b80601f016020809104026020016040519081016040528092919081815260200182805461177a90612bdc565b80156117c55780601f1061179c576101008083540402835291602001916117c5565b820191905f5260205f20905b8154815290600101906020018083116117a857829003601f168201915b505050505095508080546117d890612bdc565b80601f016020809104026020016040519081016040528092919081815260200182805461180490612bdc565b801561184f5780601f106118265761010080835404028352916020019161184f565b820191905f5260205f20905b81548152906001019060200180831161183257829003601f168201915b50505050509050995099509950995099509950995099509950995090919293949596979899565b5f80545f1901600d546111dd9190612d5e565b611891611d7e565b601054600160a81b900460ff16156118bc5760405163b087bbf360e01b815260040160405180910390fd5b60146118c88382612da8565b50610f6f8161116c565b6118dd8484846109a7565b6001600160a01b0383163b15610eca576118f984848484611e5e565b610eca576040516368d2bf6b60e11b815260040160405180910390fd5b604080516080810182525f808252602082018190529181018290526060810191909152604080516080810182525f808252602082018190529181018290526060810191909152600183108061196c57505f548310155b156119775792915050565b61198083611e24565b90508060400151156119925792915050565b61157183611f45565b60606119a682611b02565b6119c357604051630f0b822560e21b815260040160405180910390fd5b5f6119cc611dab565b905080515f036119eb57505060408051602081019091525f8152919050565b6015545f9060ff16611a0b5760405180602001604052805f815250611a2a565b60405180604001604052806005815260200164173539b7b760d91b8152505b905081611a3685611f79565b82604051602001611a4993929190612e79565b60405160208183030381529060405292505050919050565b611a69611d7e565b601054600160a81b900460ff16610f21576010805460ff60a81b1916600160a81b179055565b5f805f80611a9b611876565b90505f611aa960115461104f565b90505f611ab68888611fbc565b929550909350909150505b9250925092565b611ad0611d7e565b6001600160a01b038116611af957604051631e4fbdf760e01b81525f6004820152602401610bb4565b610d2281611dd3565b5f81600111158015611b1457505f5482105b80156108315750505f90815260046020526040902054600160e01b161590565b5f8180600111611b84575f54811015611b84575f8181526004602052604081205490600160e01b82169003611b82575b805f0361157157505f19015f81815260046020526040902054611b64565b505b604051636f96cda160e11b815260040160405180910390fd5b600260095403611bc057604051633ee5aeb560e01b815260040160405180910390fd5b6002600955565b80611bd0611876565b1015610d22576040516362f4c29160e01b815260040160405180910390fd5b80611bd060115461104f565b80611c068484611fbc565b1015610f3d57604051636913512f60e01b815260040160405180910390fd5b610f6f828260405180602001604052805f81525061200a565b805f03611c49575050565b5f826001600160a01b0316826040515f6040518083038185875af1925050503d805f8114611c92576040519150601f19603f3d011682016040523d82523d5f602084013e611c97565b606091505b5050905080610f3d57604051631d42c86760e21b815260040160405180910390fd5b6011545f90815260196020908152604080832060010180548251818502810185019093528083529192909190830182828015611d1257602002820191905f5260205f20905b815481526020019060010190808311611cfe575b50505050509050611d23818361206c565b610f6f5760405163d727bd3760e01b815260040160405180910390fd5b6010546001600160a01b0316611d578484846120b7565b6001600160a01b031614610f3d5760405163be24598360e01b815260040160405180910390fd5b6008546001600160a01b03163314610f215760405163118cdaa760e01b8152336004820152602401610bb4565b60606014604051602001611dbf9190612e96565b604051602081830303815290604052905090565b600880546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b604080516080810182525f8082526020820181905291810182905260608101919091525f828152600460205260409020546108319061216e565b604051630a85bd0160e11b81525f906001600160a01b0385169063150b7a0290611e92903390899088908890600401612f29565b6020604051808303815f875af1925050508015611ecc575060408051601f3d908101601f19168201909252611ec991810190612f5b565b60015b611f28573d808015611ef9576040519150601f19603f3d011682016040523d82523d5f602084013e611efe565b606091505b5080515f03611f20576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050949350505050565b604080516080810182525f808252602082018190529181018290526060810191909152610831611f7483611b34565b61216e565b606060a06040510180604052602081039150505f815280825b600183039250600a81066030018353600a900480611f925750819003601f19909101908152919050565b6001600160a01b0382165f9081526017602090815260408083208484528252808320601154845282528083205484845260189092528220600201546120018282612d5e565b95945050505050565b61201483836121b5565b6001600160a01b0383163b15610f3d575f548281035b61203c5f868380600101945086611e5e565b612059576040516368d2bf6b60e11b815260040160405180910390fd5b81811061202a57815f5414610f08575f80fd5b81515f90815b818110156120ad578385828151811061208d5761208d612c52565b6020026020010151036120a557600192505050610831565b600101612072565b505f949350505050565b6011546040516bffffffffffffffffffffffff19606086901b1660208201526034810184905260548101919091525f9081906074016040516020818303038152906040528051906020012090505f8160405160200161214291907f19457468657265756d205369676e6564204d6573736167653a0a3332000000008152601c810191909152603c0190565b60405160208183030381529060405280519060200120905061216481856122ad565b9695505050505050565b604080516080810182526001600160a01b038316815260a083901c6001600160401b03166020820152600160e01b831615159181019190915260e89190911c606082015290565b5f8054908290036121d95760405163b562e8dd60e01b815260040160405180910390fd5b6001600160a01b0383165f8181526005602090815260408083208054680100000000000000018802019055848352600490915281206001851460e11b4260a01b178317905582840190839083907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8180a4600183015b8181146122855780835f7fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef5f80a460010161224f565b50815f036122a557604051622e076360e81b815260040160405180910390fd5b5f5550505050565b5f805f806122bb86866122d5565b9250925092506122cb828261231b565b5090949350505050565b5f805f835160410361230c576020840151604085015160608601515f1a6122fe888285856123d3565b955095509550505050611ac1565b505081515f9150600290611ac1565b5f82600381111561232e5761232e612f76565b03612337575050565b600182600381111561234b5761234b612f76565b036123695760405163f645eedf60e01b815260040160405180910390fd5b600282600381111561237d5761237d612f76565b0361239e5760405163fce698f760e01b815260048101829052602401610bb4565b60038260038111156123b2576123b2612f76565b03610f6f576040516335e2f38360e21b815260048101829052602401610bb4565b5f80807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a084111561240c57505f91506003905082612491565b604080515f808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa15801561245d573d5f803e3d5ffd5b5050604051601f1901519150506001600160a01b03811661248857505f925060019150829050612491565b92505f91508190505b9450945094915050565b6001600160e01b031981168114610d22575f80fd5b5f602082840312156124c0575f80fd5b81356115718161249b565b5f81518084528060208401602086015e5f602082860101526020601f19601f83011685010191505092915050565b602081525f61157160208301846124cb565b5f6020828403121561251b575f80fd5b5035919050565b80356001600160a01b0381168114612538575f80fd5b919050565b5f806040838503121561254e575f80fd5b61255783612522565b946020939093013593505050565b5f805f60608486031215612577575f80fd5b61258084612522565b925061258e60208501612522565b929592945050506040919091013590565b5f805f80606085870312156125b2575f80fd5b8435935060208501356001600160401b038111156125ce575f80fd5b8501601f810187136125de575f80fd5b80356001600160401b038111156125f3575f80fd5b876020828401011115612604575f80fd5b949760209190910196509394604001359392505050565b634e487b7160e01b5f52604160045260245ffd5b604051601f8201601f191681016001600160401b03811182821017156126575761265761261b565b604052919050565b5f82601f83011261266e575f80fd5b81356001600160401b038111156126875761268761261b565b8060051b6126976020820161262f565b918252602081850181019290810190868411156126b2575f80fd5b6020860192505b838310156121645782358252602092830192909101906126b9565b5f806001600160401b038411156126ed576126ed61261b565b50601f8301601f19166020016127028161262f565b915050828152838383011115612716575f80fd5b828260208301375f602084830101529392505050565b5f82601f83011261273b575f80fd5b611571838335602085016126d4565b5f805f806080858703121561275d575f80fd5b61276685612522565b935061277460208601612522565b925060408501356001600160401b0381111561278e575f80fd5b61279a8782880161265f565b92505060608501356001600160401b038111156127b5575f80fd5b6127c18782880161272c565b91505092959194509250565b5f8083601f8401126127dd575f80fd5b5081356001600160401b038111156127f3575f80fd5b6020830191508360208260051b850101111561280d575f80fd5b9250929050565b5f8060208385031215612825575f80fd5b82356001600160401b0381111561283a575f80fd5b612846858286016127cd565b90969095509350505050565b80516001600160a01b031682526020808201516001600160401b03169083015260408082015115159083015260609081015162ffffff16910152565b602080825282518282018190525f918401906040840190835b818110156128d0576128ba838551612852565b60209390930192608092909201916001016128a7565b509095945050505050565b80358015158114612538575f80fd5b5f602082840312156128fa575f80fd5b611571826128db565b5f60208284031215612913575f80fd5b61157182612522565b5f806020838503121561292d575f80fd5b82356001600160401b03811115612942575f80fd5b8301601f81018513612952575f80fd5b80356001600160401b03811115612967575f80fd5b85602060608302840101111561297b575f80fd5b6020919091019590945092505050565b602080825282518282018190525f918401906040840190835b818110156128d05783518352602093840193909201916001016129a4565b5f805f606084860312156129d4575f80fd5b6129dd84612522565b92506129eb60208501612522565b915060408401356001600160401b03811115612a05575f80fd5b612a118682870161265f565b9150509250925092565b5f805f60608486031215612a2d575f80fd5b612a3684612522565b95602085013595506040909401359392505050565b5f8060408385031215612a5c575f80fd5b612a6583612522565b9150612a73602084016128db565b90509250929050565b8a815289602082015261014060408201525f612a9c61014083018b6124cb565b8281036060840152612aae818b6124cb565b90508281036080840152612ac2818a6124cb565b90508760a084015286151560c084015285151560e0840152841515610100840152828103610120840152612af681856124cb565b9d9c50505050505050505050505050565b5f8060408385031215612b18575f80fd5b82356001600160401b03811115612b2d575f80fd5b8301601f81018513612b3d575f80fd5b612b4c858235602084016126d4565b925050612a73602084016128db565b5f805f8060808587031215612b6e575f80fd5b612b7785612522565b9350612b8560208601612522565b92506040850135915060608501356001600160401b038111156127b5575f80fd5b608081016108318284612852565b5f8060408385031215612bc5575f80fd5b612bce83612522565b9150612a7360208401612522565b600181811c90821680612bf057607f821691505b602082108103612c0e57634e487b7160e01b5f52602260045260245ffd5b50919050565b634e487b7160e01b5f52601160045260245ffd5b8082018082111561083157610831612c14565b808202811582820484141761083157610831612c14565b634e487b7160e01b5f52603260045260245ffd5b5f8235605e19833603018112612c7a575f80fd5b9190910192915050565b5b81811015610f6f575f8155600101612c85565b8135815560018101602083013536849003601e19018112612cb7575f80fd5b830180356001600160401b0381118015612ccf575f80fd5b6020830192508160051b3603831315612ce6575f80fd5b5068010000000000000000811115612d0057612d0061261b565b825481845580821015612d2457835f5260205f20612d22828201848301612c84565b505b505f92835260208320925b81811015612d4b57823584820155602090920191600101612d2f565b5050505060409190910135600290910155565b8181038181111561083157610831612c14565b601f821115610f3d57805f5260205f20601f840160051c81016020851015612d965750805b610f08601f850160051c830182612c84565b81516001600160401b03811115612dc157612dc161261b565b612dd581612dcf8454612bdc565b84612d71565b6020601f821160018114612e07575f8315612df05750848201515b5f19600385901b1c1916600184901b178455610f08565b5f84815260208120601f198516915b82811015612e365787850151825560209485019460019092019101612e16565b5084821015612e5357868401515f19600387901b60f8161c191681555b50505050600190811b01905550565b5f81518060208401855e5f93019283525090919050565b5f612001612e90612e8a8488612e62565b86612e62565b84612e62565b66697066733a2f2f60c81b81525f808354612eb081612bdc565b600182168015612ec75760018114612ee257612f15565b60ff1983166007870152600782151583028701019350612f15565b865f5260205f205f5b83811015612f0a57815488820160070152600190910190602001612eeb565b505060078287010193505b5050602f60f81b8252506001019392505050565b6001600160a01b03858116825284166020820152604081018390526080606082018190525f90612164908301846124cb565b5f60208284031215612f6b575f80fd5b81516115718161249b565b634e487b7160e01b5f52602160045260245ffdfea26469706673582212200d872db2df5063a17649654df757aa7a2dd55ffcfee6e0133c15a8362aa488e864736f6c634300081a0033a2646970667358221220ea70c2db8e194cd99bc6c8737ad1c1ee8b323f79a23e2e6e1a638710f55fd6f464736f6c634300081a0033
Deployed Bytecode
0x608060405234801561000f575f80fd5b5060043610610029575f3560e01c8063d1d6ba4a1461002d575b5f80fd5b61004061003b3660046101c6565b61005c565b6040516001600160a01b03909116815260200160405180910390f35b5f8088888888888888604051610071906100ff565b61008197969594939291906102b6565b604051809103905ff08015801561009a573d5f803e3d5ffd5b5060405163f2fde38b60e01b81523360048201529091506001600160a01b0382169063f2fde38b906024015f604051808303815f87803b1580156100dc575f80fd5b505af11580156100ee573d5f803e3d5ffd5b50929b9a5050505050505050505050565b6133e08061031f83390190565b80356001600160a01b0381168114610122575f80fd5b919050565b634e487b7160e01b5f52604160045260245ffd5b5f82601f83011261014a575f80fd5b813567ffffffffffffffff81111561016457610164610127565b604051601f8201601f19908116603f0116810167ffffffffffffffff8111828210171561019357610193610127565b6040528181528382016020018510156101aa575f80fd5b816020850160208301375f918101602001919091529392505050565b5f805f805f805f60e0888a0312156101dc575f80fd5b6101e58861010c565b96506101f36020890161010c565b9550604088013567ffffffffffffffff81111561020e575f80fd5b61021a8a828b0161013b565b955050606088013567ffffffffffffffff811115610236575f80fd5b6102428a828b0161013b565b945050608088013567ffffffffffffffff81111561025e575f80fd5b61026a8a828b0161013b565b979a969950949793969560a0850135955060c0909401359392505050565b5f81518084528060208401602086015e5f602082860101526020601f19601f83011685010191505092915050565b6001600160a01b0388811682528716602082015260e0604082018190525f906102e190830188610288565b82810360608401526102f38188610288565b905082810360808401526103078187610288565b60a0840195909552505060c001529594505050505056fe60806040526010805461ffff60a01b1916905534801561001d575f80fd5b506040516133e03803806133e083398101604081905261003c9161020f565b338584600261004b8382610359565b5060036100588282610359565b5060015f5550506001600160a01b03811661008c57604051631e4fbdf760e01b81525f600482015260240160405180910390fd5b61009581610106565b506001600955600f80546001600160a01b03808a166001600160a01b0319928316179092556010805492891692909116919091179055600a6100d78682610359565b50600b6100e48582610359565b50600c6100f18482610359565b50600e91909155600d55506104139350505050565b600880546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b80516001600160a01b038116811461016d575f80fd5b919050565b634e487b7160e01b5f52604160045260245ffd5b5f82601f830112610195575f80fd5b81516001600160401b038111156101ae576101ae610172565b604051601f8201601f19908116603f011681016001600160401b03811182821017156101dc576101dc610172565b6040528181528382016020018510156101f3575f80fd5b8160208501602083015e5f918101602001919091529392505050565b5f805f805f805f60e0888a031215610225575f80fd5b61022e88610157565b965061023c60208901610157565b60408901519096506001600160401b03811115610257575f80fd5b6102638a828b01610186565b60608a015190965090506001600160401b03811115610280575f80fd5b61028c8a828b01610186565b60808a015190955090506001600160401b038111156102a9575f80fd5b6102b58a828b01610186565b60a08a015160c0909a0151989b979a509598949795969495949350505050565b600181811c908216806102e957607f821691505b60208210810361030757634e487b7160e01b5f52602260045260245ffd5b50919050565b601f82111561035457805f5260205f20601f840160051c810160208510156103325750805b601f840160051c820191505b81811015610351575f815560010161033e565b50505b505050565b81516001600160401b0381111561037257610372610172565b6103868161038084546102d5565b8461030d565b6020601f8211600181146103b8575f83156103a15750848201515b5f19600385901b1c1916600184901b178455610351565b5f84815260208120601f198516915b828110156103e757878501518255602094850194600190920191016103c7565b508482101561040457868401515f19600387901b60f8161c191681555b50505050600190811b01905550565b612fc0806104205f395ff3fe60806040526004361061026d575f3560e01c806370a082311161014a578063a68b91ab116100be578063d111515d11610078578063d111515d146106fd578063d50c408714610711578063e8c0656614610726578063e985e9c514610760578063f2fde38b146107a7578063fdfc7aae146107c6575f80fd5b8063a68b91ab14610642578063b31f8f931461066c578063b64b21ca14610680578063b88d4fde1461069f578063c23dc68f146106b2578063c87b56dd146106de575f80fd5b806389b5a8c21161010f57806389b5a8c21461059f5780638da5cb5b146105be578063902d55a5146105db57806395d89b41146105f057806399a2557a14610604578063a22cb46514610623575f80fd5b806370a082311461050d578063714c53981461052c578063715018a614610540578063733c88d2146105545780638462151c14610573575f80fd5b80633ccfd60b116101e1578063518bd980116101a6578063518bd98014610451578063596b7300146104705780635bbb2177146104845780636352211e146104b05780636d16a801146104cf5780636e453d62146104ee575f80fd5b80633ccfd60b146103cd57806342842e0e146103e1578063484b973c146103f45780634f4edd74146104135780634f6b45df14610432575f80fd5b80630e24495e116102325780630e24495e1461033b57806318160ddd1461035b57806323b872dd146103755780632db11544146103885780632e87871d1461039b57806332ab9bbe146103ae575f80fd5b806301ffc9a71461027857806306fdde03146102ac578063081812fc146102cd578063095ea7b3146103045780630d472c6514610319575f80fd5b3661027457005b5f80fd5b348015610283575f80fd5b506102976102923660046124b0565b6107e6565b60405190151581526020015b60405180910390f35b3480156102b7575f80fd5b506102c0610837565b6040516102a391906124f9565b3480156102d8575f80fd5b506102ec6102e736600461250b565b6108c7565b6040516001600160a01b0390911681526020016102a3565b61031761031236600461253d565b610909565b005b348015610324575f80fd5b5061032d600581565b6040519081526020016102a3565b348015610346575f80fd5b5060105461029790600160a81b900460ff1681565b348015610366575f80fd5b506001545f54035f190161032d565b610317610383366004612565565b6109a7565b61031761039636600461250b565b610b36565b6103176103a936600461259f565b610d25565b3480156103b9575f80fd5b506103176103c836600461274a565b610ed0565b3480156103d8575f80fd5b50610317610f0f565b6103176103ef366004612565565b610f23565b3480156103ff575f80fd5b5061031761040e36600461253d565b610f42565b34801561041e575f80fd5b5061031761042d366004612814565b610f73565b34801561043d575f80fd5b5061031761044c36600461250b565b611027565b34801561045c575f80fd5b5061032d61046b36600461250b565b61104f565b34801561047b575f80fd5b5061032d600181565b34801561048f575f80fd5b506104a361049e366004612814565b611075565b6040516102a3919061288e565b3480156104bb575f80fd5b506102ec6104ca36600461250b565b61113c565b3480156104da575f80fd5b506103176104e93660046128ea565b611146565b3480156104f9575f80fd5b506103176105083660046128ea565b61116c565b348015610518575f80fd5b5061032d610527366004612903565b611187565b348015610537575f80fd5b506102c06111d3565b34801561054b575f80fd5b506103176111e2565b34801561055f575f80fd5b5061031761056e36600461291c565b6111f3565b34801561057e575f80fd5b5061059261058d366004612903565b6112af565b6040516102a3919061298b565b3480156105aa575f80fd5b506103176105b93660046129c2565b6113b3565b3480156105c9575f80fd5b506008546001600160a01b03166102ec565b3480156105e6575f80fd5b5061032d600d5481565b3480156105fb575f80fd5b506102c06113ea565b34801561060f575f80fd5b5061059261061e366004612a1b565b6113f9565b34801561062e575f80fd5b5061031761063d366004612a4b565b611578565b34801561064d575f80fd5b506106566115e3565b6040516102a39a99989796959493929190612a7c565b348015610677575f80fd5b5061032d611876565b34801561068b575f80fd5b5061031761069a366004612b07565b611889565b6103176106ad366004612b5b565b6118d2565b3480156106bd575f80fd5b506106d16106cc36600461250b565b611916565b6040516102a39190612ba6565b3480156106e9575f80fd5b506102c06106f836600461250b565b61199b565b348015610708575f80fd5b50610317611a61565b34801561071c575f80fd5b5061032d60115481565b348015610731575f80fd5b5061074561074036600461253d565b611a8f565b604080519384526020840192909252908201526060016102a3565b34801561076b575f80fd5b5061029761077a366004612bb4565b6001600160a01b039182165f90815260076020908152604080832093909416825291909152205460ff1690565b3480156107b2575f80fd5b506103176107c1366004612903565b611ac8565b3480156107d1575f80fd5b5060105461029790600160a01b900460ff1681565b5f6301ffc9a760e01b6001600160e01b03198316148061081657506380ac58cd60e01b6001600160e01b03198316145b806108315750635b5e139f60e01b6001600160e01b03198316145b92915050565b60606002805461084690612bdc565b80601f016020809104026020016040519081016040528092919081815260200182805461087290612bdc565b80156108bd5780601f10610894576101008083540402835291602001916108bd565b820191905f5260205f20905b8154815290600101906020018083116108a057829003601f168201915b5050505050905090565b5f6108d182611b02565b6108ee576040516333d1c03960e21b815260040160405180910390fd5b505f908152600660205260409020546001600160a01b031690565b5f6109138261113c565b9050336001600160a01b0382161461094c5761092f813361077a565b61094c576040516367d9dca160e11b815260040160405180910390fd5b5f8281526006602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b5f6109b182611b34565b9050836001600160a01b0316816001600160a01b0316146109e45760405162a1148160e81b815260040160405180910390fd5b5f8281526006602052604090208054338082146001600160a01b03881690911417610a3057610a13863361077a565b610a3057604051632ce44b5f60e11b815260040160405180910390fd5b6001600160a01b038516610a5757604051633a954ecd60e21b815260040160405180910390fd5b8015610a61575f82555b6001600160a01b038681165f9081526005602052604080822080545f19019055918716808252919020805460010190554260a01b17600160e11b175f85815260046020526040812091909155600160e11b84169003610aed57600184015f818152600460205260408120549003610aeb575f548114610aeb575f8181526004602052604090208490555b505b83856001600160a01b0316876001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4505050505050565b610b3e611b9d565b601054600160a01b900460ff16610b68576040516303eaac9360e01b815260040160405180910390fd5b60115415610bbd5760405162461bcd60e51b815260206004820152601a60248201527f43616e2774206d696e7420617420746869732073657373696f6e00000000000060448201526064015b60405180910390fd5b610bc681611bc7565b610bcf81611bef565b610bda335f83611bfb565b600e545f80805260186020527f999d26de3473317ead3eeaf34ca78057f1439db67b6953469c3c96ce9caf6bd85490918391610c169190612c28565b610c209190612c3b565b905080341015610c435760405163f14a42b760e01b815260040160405180910390fd5b610c4d3383611c25565b5f805260166020527f0263c2b778d062355049effc2dece97bc6547ff8a88a3258daa512061c2153dd54610c82908390612c28565b7f0263c2b778d062355049effc2dece97bc6547ff8a88a3258daa512061c2153dd55335f9081526017602090815260408083208380528252808320909152902054610cce908390612c28565b335f9081526017602090815260408083208380528252808320909152812091909155600e54610cfd9084612c3b565b600f54909150610d16906001600160a01b031682611c3e565b5050610d226001600955565b50565b610d2d611b9d565b601054600160a01b900460ff16610d57576040516303eaac9360e01b815260040160405180910390fd5b610d6081611cb9565b610da0338285858080601f0160208091040260200160405190810160405280939291908181526020018383808284375f92019190915250611d4092505050565b610da984611bc7565b610db284611bef565b610dbd338286611bfb565b600e545f8281526018602052604081206001015490918691610ddf9190612c28565b610de99190612c3b565b905080341015610e0c5760405163f14a42b760e01b815260040160405180910390fd5b610e163386611c25565b6011545f90815260166020526040902054610e32908690612c28565b601180545f9081526016602090815260408083209490945533825260178152838220868352815283822092548252919091522054610e71908690612c28565b335f90815260176020908152604080832086845282528083206011548452909152812091909155600e54610ea59087612c3b565b600f54909150610ebe906001600160a01b031682611c3e565b5050610eca6001600955565b50505050565b5f5b8251811015610f0857610f008585858481518110610ef257610ef2612c52565b6020026020010151856118d2565b600101610ed2565b5050505050565b610f17611d7e565b610f213347611c3e565b565b610f3d83838360405180602001604052805f8152506118d2565b505050565b610f4a611b9d565b610f52611d7e565b610f5b81611bc7565b610f658282611c25565b610f6f6001600955565b5050565b610f7b611d7e565b5f819003610f9c576040516350dd03f760e11b815260040160405180910390fd5b60135415610fc757601354811015610fc7576040516350dd03f760e11b815260040160405180910390fd5b5f5b8181101561101657828282818110610fe357610fe3612c52565b9050602002810190610ff59190612c66565b5f82815260196020526040902061100c8282612c98565b5050600101610fc9565b50601354811115610f6f5760135550565b61102f611d7e565b601054600160a01b900460ff1661104a5761104a6001611146565b601155565b5f8181526016602090815260408083205460199092528220600201546108319190612d5e565b6060815f816001600160401b038111156110915761109161261b565b6040519080825280602002602001820160405280156110e157816020015b604080516080810182525f8082526020808301829052928201819052606082015282525f199092019101816110af5790505b5090505f5b8281146111335761110e86868381811061110257611102612c52565b90506020020135611916565b82828151811061112057611120612c52565b60209081029190910101526001016110e6565b50949350505050565b5f61083182611b34565b61114e611d7e565b60108054911515600160a01b0260ff60a01b19909216919091179055565b611174611d7e565b6015805460ff1916911515919091179055565b5f6001600160a01b0382166111af576040516323d3ad8160e21b815260040160405180910390fd5b506001600160a01b03165f908152600560205260409020546001600160401b031690565b60606111dd611dab565b905090565b6111ea611d7e565b610f215f611dd3565b6111fb611d7e565b5f81900361121c576040516350dd03f760e11b815260040160405180910390fd5b6012541561124757601254811015611247576040516350dd03f760e11b815260040160405180910390fd5b5f5b8181101561129e5782828281811061126357611263612c52565b5f8481526018602090815260409182902060609093029490940180358355938401356001830155830135600282015590505050600101611249565b50601254811115610f6f5760125550565b60605f805f6112bd85611187565b90505f816001600160401b038111156112d8576112d861261b565b604051908082528060200260200182016040528015611301578160200160208202803683370190505b50905061132d604080516080810182525f80825260208201819052918101829052606081019190915290565b60015b8386146113a75761134081611e24565b9150816040015161139f5781516001600160a01b03161561136057815194505b876001600160a01b0316856001600160a01b03160361139f578083878060010198508151811061139257611392612c52565b6020026020010181815250505b600101611330565b50909695505050505050565b5f5b8151811015610eca576113e284848484815181106113d5576113d5612c52565b60200260200101516109a7565b6001016113b5565b60606003805461084690612bdc565b606081831061141b57604051631960ccad60e11b815260040160405180910390fd5b5f806114255f5490565b9050600185101561143557600194505b80841115611441578093505b5f61144b87611187565b90508486101561146a5785850381811015611464578091505b5061146d565b505f5b5f816001600160401b038111156114865761148661261b565b6040519080825280602002602001820160405280156114af578160200160208202803683370190505b509050815f036114c457935061157192505050565b5f6114ce88611916565b90505f81604001516114de575080515b885b8881141580156114f05750848714155b15611565576114fe81611e24565b9250826040015161155d5782516001600160a01b03161561151e57825191505b8a6001600160a01b0316826001600160a01b03160361155d578084888060010199508151811061155057611550612c52565b6020026020010181815250505b6001016114e0565b50505092835250909150505b9392505050565b335f8181526007602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b5f8060608060605f805f80606060016005600a600b600c600d54601060149054906101000a900460ff16601060159054906101000a900460ff1660155f9054906101000a900460ff16601487805461163a90612bdc565b80601f016020809104026020016040519081016040528092919081815260200182805461166690612bdc565b80156116b15780601f10611688576101008083540402835291602001916116b1565b820191905f5260205f20905b81548152906001019060200180831161169457829003601f168201915b505050505097508680546116c490612bdc565b80601f01602080910402602001604051908101604052809291908181526020018280546116f090612bdc565b801561173b5780601f106117125761010080835404028352916020019161173b565b820191905f5260205f20905b81548152906001019060200180831161171e57829003601f168201915b5050505050965085805461174e90612bdc565b80601f016020809104026020016040519081016040528092919081815260200182805461177a90612bdc565b80156117c55780601f1061179c576101008083540402835291602001916117c5565b820191905f5260205f20905b8154815290600101906020018083116117a857829003601f168201915b505050505095508080546117d890612bdc565b80601f016020809104026020016040519081016040528092919081815260200182805461180490612bdc565b801561184f5780601f106118265761010080835404028352916020019161184f565b820191905f5260205f20905b81548152906001019060200180831161183257829003601f168201915b50505050509050995099509950995099509950995099509950995090919293949596979899565b5f80545f1901600d546111dd9190612d5e565b611891611d7e565b601054600160a81b900460ff16156118bc5760405163b087bbf360e01b815260040160405180910390fd5b60146118c88382612da8565b50610f6f8161116c565b6118dd8484846109a7565b6001600160a01b0383163b15610eca576118f984848484611e5e565b610eca576040516368d2bf6b60e11b815260040160405180910390fd5b604080516080810182525f808252602082018190529181018290526060810191909152604080516080810182525f808252602082018190529181018290526060810191909152600183108061196c57505f548310155b156119775792915050565b61198083611e24565b90508060400151156119925792915050565b61157183611f45565b60606119a682611b02565b6119c357604051630f0b822560e21b815260040160405180910390fd5b5f6119cc611dab565b905080515f036119eb57505060408051602081019091525f8152919050565b6015545f9060ff16611a0b5760405180602001604052805f815250611a2a565b60405180604001604052806005815260200164173539b7b760d91b8152505b905081611a3685611f79565b82604051602001611a4993929190612e79565b60405160208183030381529060405292505050919050565b611a69611d7e565b601054600160a81b900460ff16610f21576010805460ff60a81b1916600160a81b179055565b5f805f80611a9b611876565b90505f611aa960115461104f565b90505f611ab68888611fbc565b929550909350909150505b9250925092565b611ad0611d7e565b6001600160a01b038116611af957604051631e4fbdf760e01b81525f6004820152602401610bb4565b610d2281611dd3565b5f81600111158015611b1457505f5482105b80156108315750505f90815260046020526040902054600160e01b161590565b5f8180600111611b84575f54811015611b84575f8181526004602052604081205490600160e01b82169003611b82575b805f0361157157505f19015f81815260046020526040902054611b64565b505b604051636f96cda160e11b815260040160405180910390fd5b600260095403611bc057604051633ee5aeb560e01b815260040160405180910390fd5b6002600955565b80611bd0611876565b1015610d22576040516362f4c29160e01b815260040160405180910390fd5b80611bd060115461104f565b80611c068484611fbc565b1015610f3d57604051636913512f60e01b815260040160405180910390fd5b610f6f828260405180602001604052805f81525061200a565b805f03611c49575050565b5f826001600160a01b0316826040515f6040518083038185875af1925050503d805f8114611c92576040519150601f19603f3d011682016040523d82523d5f602084013e611c97565b606091505b5050905080610f3d57604051631d42c86760e21b815260040160405180910390fd5b6011545f90815260196020908152604080832060010180548251818502810185019093528083529192909190830182828015611d1257602002820191905f5260205f20905b815481526020019060010190808311611cfe575b50505050509050611d23818361206c565b610f6f5760405163d727bd3760e01b815260040160405180910390fd5b6010546001600160a01b0316611d578484846120b7565b6001600160a01b031614610f3d5760405163be24598360e01b815260040160405180910390fd5b6008546001600160a01b03163314610f215760405163118cdaa760e01b8152336004820152602401610bb4565b60606014604051602001611dbf9190612e96565b604051602081830303815290604052905090565b600880546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b604080516080810182525f8082526020820181905291810182905260608101919091525f828152600460205260409020546108319061216e565b604051630a85bd0160e11b81525f906001600160a01b0385169063150b7a0290611e92903390899088908890600401612f29565b6020604051808303815f875af1925050508015611ecc575060408051601f3d908101601f19168201909252611ec991810190612f5b565b60015b611f28573d808015611ef9576040519150601f19603f3d011682016040523d82523d5f602084013e611efe565b606091505b5080515f03611f20576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050949350505050565b604080516080810182525f808252602082018190529181018290526060810191909152610831611f7483611b34565b61216e565b606060a06040510180604052602081039150505f815280825b600183039250600a81066030018353600a900480611f925750819003601f19909101908152919050565b6001600160a01b0382165f9081526017602090815260408083208484528252808320601154845282528083205484845260189092528220600201546120018282612d5e565b95945050505050565b61201483836121b5565b6001600160a01b0383163b15610f3d575f548281035b61203c5f868380600101945086611e5e565b612059576040516368d2bf6b60e11b815260040160405180910390fd5b81811061202a57815f5414610f08575f80fd5b81515f90815b818110156120ad578385828151811061208d5761208d612c52565b6020026020010151036120a557600192505050610831565b600101612072565b505f949350505050565b6011546040516bffffffffffffffffffffffff19606086901b1660208201526034810184905260548101919091525f9081906074016040516020818303038152906040528051906020012090505f8160405160200161214291907f19457468657265756d205369676e6564204d6573736167653a0a3332000000008152601c810191909152603c0190565b60405160208183030381529060405280519060200120905061216481856122ad565b9695505050505050565b604080516080810182526001600160a01b038316815260a083901c6001600160401b03166020820152600160e01b831615159181019190915260e89190911c606082015290565b5f8054908290036121d95760405163b562e8dd60e01b815260040160405180910390fd5b6001600160a01b0383165f8181526005602090815260408083208054680100000000000000018802019055848352600490915281206001851460e11b4260a01b178317905582840190839083907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8180a4600183015b8181146122855780835f7fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef5f80a460010161224f565b50815f036122a557604051622e076360e81b815260040160405180910390fd5b5f5550505050565b5f805f806122bb86866122d5565b9250925092506122cb828261231b565b5090949350505050565b5f805f835160410361230c576020840151604085015160608601515f1a6122fe888285856123d3565b955095509550505050611ac1565b505081515f9150600290611ac1565b5f82600381111561232e5761232e612f76565b03612337575050565b600182600381111561234b5761234b612f76565b036123695760405163f645eedf60e01b815260040160405180910390fd5b600282600381111561237d5761237d612f76565b0361239e5760405163fce698f760e01b815260048101829052602401610bb4565b60038260038111156123b2576123b2612f76565b03610f6f576040516335e2f38360e21b815260048101829052602401610bb4565b5f80807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a084111561240c57505f91506003905082612491565b604080515f808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa15801561245d573d5f803e3d5ffd5b5050604051601f1901519150506001600160a01b03811661248857505f925060019150829050612491565b92505f91508190505b9450945094915050565b6001600160e01b031981168114610d22575f80fd5b5f602082840312156124c0575f80fd5b81356115718161249b565b5f81518084528060208401602086015e5f602082860101526020601f19601f83011685010191505092915050565b602081525f61157160208301846124cb565b5f6020828403121561251b575f80fd5b5035919050565b80356001600160a01b0381168114612538575f80fd5b919050565b5f806040838503121561254e575f80fd5b61255783612522565b946020939093013593505050565b5f805f60608486031215612577575f80fd5b61258084612522565b925061258e60208501612522565b929592945050506040919091013590565b5f805f80606085870312156125b2575f80fd5b8435935060208501356001600160401b038111156125ce575f80fd5b8501601f810187136125de575f80fd5b80356001600160401b038111156125f3575f80fd5b876020828401011115612604575f80fd5b949760209190910196509394604001359392505050565b634e487b7160e01b5f52604160045260245ffd5b604051601f8201601f191681016001600160401b03811182821017156126575761265761261b565b604052919050565b5f82601f83011261266e575f80fd5b81356001600160401b038111156126875761268761261b565b8060051b6126976020820161262f565b918252602081850181019290810190868411156126b2575f80fd5b6020860192505b838310156121645782358252602092830192909101906126b9565b5f806001600160401b038411156126ed576126ed61261b565b50601f8301601f19166020016127028161262f565b915050828152838383011115612716575f80fd5b828260208301375f602084830101529392505050565b5f82601f83011261273b575f80fd5b611571838335602085016126d4565b5f805f806080858703121561275d575f80fd5b61276685612522565b935061277460208601612522565b925060408501356001600160401b0381111561278e575f80fd5b61279a8782880161265f565b92505060608501356001600160401b038111156127b5575f80fd5b6127c18782880161272c565b91505092959194509250565b5f8083601f8401126127dd575f80fd5b5081356001600160401b038111156127f3575f80fd5b6020830191508360208260051b850101111561280d575f80fd5b9250929050565b5f8060208385031215612825575f80fd5b82356001600160401b0381111561283a575f80fd5b612846858286016127cd565b90969095509350505050565b80516001600160a01b031682526020808201516001600160401b03169083015260408082015115159083015260609081015162ffffff16910152565b602080825282518282018190525f918401906040840190835b818110156128d0576128ba838551612852565b60209390930192608092909201916001016128a7565b509095945050505050565b80358015158114612538575f80fd5b5f602082840312156128fa575f80fd5b611571826128db565b5f60208284031215612913575f80fd5b61157182612522565b5f806020838503121561292d575f80fd5b82356001600160401b03811115612942575f80fd5b8301601f81018513612952575f80fd5b80356001600160401b03811115612967575f80fd5b85602060608302840101111561297b575f80fd5b6020919091019590945092505050565b602080825282518282018190525f918401906040840190835b818110156128d05783518352602093840193909201916001016129a4565b5f805f606084860312156129d4575f80fd5b6129dd84612522565b92506129eb60208501612522565b915060408401356001600160401b03811115612a05575f80fd5b612a118682870161265f565b9150509250925092565b5f805f60608486031215612a2d575f80fd5b612a3684612522565b95602085013595506040909401359392505050565b5f8060408385031215612a5c575f80fd5b612a6583612522565b9150612a73602084016128db565b90509250929050565b8a815289602082015261014060408201525f612a9c61014083018b6124cb565b8281036060840152612aae818b6124cb565b90508281036080840152612ac2818a6124cb565b90508760a084015286151560c084015285151560e0840152841515610100840152828103610120840152612af681856124cb565b9d9c50505050505050505050505050565b5f8060408385031215612b18575f80fd5b82356001600160401b03811115612b2d575f80fd5b8301601f81018513612b3d575f80fd5b612b4c858235602084016126d4565b925050612a73602084016128db565b5f805f8060808587031215612b6e575f80fd5b612b7785612522565b9350612b8560208601612522565b92506040850135915060608501356001600160401b038111156127b5575f80fd5b608081016108318284612852565b5f8060408385031215612bc5575f80fd5b612bce83612522565b9150612a7360208401612522565b600181811c90821680612bf057607f821691505b602082108103612c0e57634e487b7160e01b5f52602260045260245ffd5b50919050565b634e487b7160e01b5f52601160045260245ffd5b8082018082111561083157610831612c14565b808202811582820484141761083157610831612c14565b634e487b7160e01b5f52603260045260245ffd5b5f8235605e19833603018112612c7a575f80fd5b9190910192915050565b5b81811015610f6f575f8155600101612c85565b8135815560018101602083013536849003601e19018112612cb7575f80fd5b830180356001600160401b0381118015612ccf575f80fd5b6020830192508160051b3603831315612ce6575f80fd5b5068010000000000000000811115612d0057612d0061261b565b825481845580821015612d2457835f5260205f20612d22828201848301612c84565b505b505f92835260208320925b81811015612d4b57823584820155602090920191600101612d2f565b5050505060409190910135600290910155565b8181038181111561083157610831612c14565b601f821115610f3d57805f5260205f20601f840160051c81016020851015612d965750805b610f08601f850160051c830182612c84565b81516001600160401b03811115612dc157612dc161261b565b612dd581612dcf8454612bdc565b84612d71565b6020601f821160018114612e07575f8315612df05750848201515b5f19600385901b1c1916600184901b178455610f08565b5f84815260208120601f198516915b82811015612e365787850151825560209485019460019092019101612e16565b5084821015612e5357868401515f19600387901b60f8161c191681555b50505050600190811b01905550565b5f81518060208401855e5f93019283525090919050565b5f612001612e90612e8a8488612e62565b86612e62565b84612e62565b66697066733a2f2f60c81b81525f808354612eb081612bdc565b600182168015612ec75760018114612ee257612f15565b60ff1983166007870152600782151583028701019350612f15565b865f5260205f205f5b83811015612f0a57815488820160070152600190910190602001612eeb565b505060078287010193505b5050602f60f81b8252506001019392505050565b6001600160a01b03858116825284166020820152604081018390526080606082018190525f90612164908301846124cb565b5f60208284031215612f6b575f80fd5b81516115718161249b565b634e487b7160e01b5f52602160045260245ffdfea26469706673582212200d872db2df5063a17649654df757aa7a2dd55ffcfee6e0133c15a8362aa488e864736f6c634300081a0033a2646970667358221220ea70c2db8e194cd99bc6c8737ad1c1ee8b323f79a23e2e6e1a638710f55fd6f464736f6c634300081a0033
Deployed Bytecode Sourcemap
148:759:1:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;206:699;;;;;;:::i;:::-;;:::i;:::-;;;-1:-1:-1;;;;;2364:32:2;;;2346:51;;2334:2;2319:18;206:699:1;;;;;;;;507:7;526:46;625:16;655:14;683:13;710:10;734:12;760:8;782:12;575:229;;;;;:::i;:::-;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;815:43:1;;-1:-1:-1;;;815:43:1;;847:10;815:43;;;2346:51:2;526:278:1;;-1:-1:-1;;;;;;815:31:1;;;;;2319:18:2;;815:43:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;884:13:1;;206:699;-1:-1:-1;;;;;;;;;;;206:699:1:o;-1:-1:-1:-;;;;;;;;:::o;14:173:2:-;82:20;;-1:-1:-1;;;;;131:31:2;;121:42;;111:70;;177:1;174;167:12;111:70;14:173;;;:::o;192:127::-;253:10;248:3;244:20;241:1;234:31;284:4;281:1;274:15;308:4;305:1;298:15;324:726;367:5;420:3;413:4;405:6;401:17;397:27;387:55;;438:1;435;428:12;387:55;478:6;465:20;508:18;500:6;497:30;494:56;;;530:18;;:::i;:::-;579:2;573:9;671:2;633:17;;-1:-1:-1;;629:31:2;;;662:2;625:40;621:54;609:67;;706:18;691:34;;727:22;;;688:62;685:88;;;753:18;;:::i;:::-;789:2;782:22;813;;;854:19;;;875:4;850:30;847:39;-1:-1:-1;844:59:2;;;899:1;896;889:12;844:59;963:6;956:4;948:6;944:17;937:4;929:6;925:17;912:58;1018:1;990:19;;;1011:4;986:30;979:41;;;;994:6;324:726;-1:-1:-1;;;324:726:2:o;1055:1140::-;1198:6;1206;1214;1222;1230;1238;1246;1299:3;1287:9;1278:7;1274:23;1270:33;1267:53;;;1316:1;1313;1306:12;1267:53;1339:29;1358:9;1339:29;:::i;:::-;1329:39;;1387:38;1421:2;1410:9;1406:18;1387:38;:::i;:::-;1377:48;;1476:2;1465:9;1461:18;1448:32;1503:18;1495:6;1492:30;1489:50;;;1535:1;1532;1525:12;1489:50;1558;1600:7;1591:6;1580:9;1576:22;1558:50;:::i;:::-;1548:60;;;1661:2;1650:9;1646:18;1633:32;1690:18;1680:8;1677:32;1674:52;;;1722:1;1719;1712:12;1674:52;1745;1789:7;1778:8;1767:9;1763:24;1745:52;:::i;:::-;1735:62;;;1850:3;1839:9;1835:19;1822:33;1880:18;1870:8;1867:32;1864:52;;;1912:1;1909;1902:12;1864:52;1935;1979:7;1968:8;1957:9;1953:24;1935:52;:::i;:::-;1055:1140;;;;-1:-1:-1;1055:1140:2;;;;1925:62;2056:3;2041:19;;2028:33;;-1:-1:-1;2158:3:2;2143:19;;;2130:33;;1055:1140;-1:-1:-1;;;1055:1140:2:o;2408:289::-;2450:3;2488:5;2482:12;2515:6;2510:3;2503:19;2571:6;2564:4;2557:5;2553:16;2546:4;2541:3;2537:14;2531:47;2623:1;2616:4;2607:6;2602:3;2598:16;2594:27;2587:38;2686:4;2679:2;2675:7;2670:2;2662:6;2658:15;2654:29;2649:3;2645:39;2641:50;2634:57;;;2408:289;;;;:::o;2702:887::-;-1:-1:-1;;;;;3059:32:2;;;3041:51;;3128:32;;3123:2;3108:18;;3101:60;3197:3;3192:2;3177:18;;3170:31;;;-1:-1:-1;;3224:46:2;;3250:19;;3242:6;3224:46;:::i;:::-;3318:9;3310:6;3306:22;3301:2;3290:9;3286:18;3279:50;3352:33;3378:6;3370;3352:33;:::i;:::-;3338:47;;3434:9;3426:6;3422:22;3416:3;3405:9;3401:19;3394:51;3462:33;3488:6;3480;3462:33;:::i;:::-;3526:3;3511:19;;3504:35;;;;-1:-1:-1;;3570:3:2;3555:19;3548:35;3454:41;2702:887;-1:-1:-1;;;;;2702:887:2:o
Swarm Source
ipfs://ea70c2db8e194cd99bc6c8737ad1c1ee8b323f79a23e2e6e1a638710f55fd6f4
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
[ Download: CSV Export ]
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.