ETH Price: $3,602.14 (+4.52%)
 

Overview

Max Total Supply

61 CDK

Holders

31

Market

Volume (24H)

N/A

Min Price (24H)

N/A

Max Price (24H)

N/A
Balance
1 CDK
0x74e163959d171d49a042058de03cb9608d5cc94f
Loading...
Loading
Loading...
Loading
Loading...
Loading

Click here to update the token information / general information
# Exchange Pair Price  24H Volume % Volume

Contract Source Code Verified (Exact Match)

Contract Name:
CodeDaoKeys

Compiler Version
v0.8.26+commit.8a97fa7a

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 1 : cdk.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.14;


// File: solidity-bits/contracts/Popcount.sol

/**
   _____       ___     ___ __           ____  _ __      
  / ___/____  / (_)___/ (_) /___  __   / __ )(_) /______
  \__ \/ __ \/ / / __  / / __/ / / /  / __  / / __/ ___/
 ___/ / /_/ / / / /_/ / / /_/ /_/ /  / /_/ / / /_(__  ) 
/____/\____/_/_/\__,_/_/\__/\__, /  /_____/_/\__/____/  
                           /____/                        

- npm: https://www.npmjs.com/package/solidity-bits
- github: https://github.com/estarriolvetch/solidity-bits

 */

//pragma solidity ^0.8.0;

library Popcount {
    uint256 private constant m1 = 0x5555555555555555555555555555555555555555555555555555555555555555;
    uint256 private constant m2 = 0x3333333333333333333333333333333333333333333333333333333333333333;
    uint256 private constant m4 = 0x0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f;
    uint256 private constant h01 = 0x0101010101010101010101010101010101010101010101010101010101010101;

    function popcount256A(uint256 x) internal pure returns (uint256 count) {
        unchecked{
            for (count=0; x!=0; count++)
                x &= x - 1;
        }
    }

    function popcount256B(uint256 x) internal pure returns (uint256) {
        if (x == type(uint256).max) {
            return 256;
        }
        unchecked {
            x -= (x >> 1) & m1;             //put count of each 2 bits into those 2 bits
            x = (x & m2) + ((x >> 2) & m2); //put count of each 4 bits into those 4 bits 
            x = (x + (x >> 4)) & m4;        //put count of each 8 bits into those 8 bits 
            x = (x * h01) >> 248;  //returns left 8 bits of x + (x<<8) + (x<<16) + (x<<24) + ... 
        }
        return x;
    }
}
// File: solidity-bits/contracts/BitScan.sol


/**
   _____       ___     ___ __           ____  _ __      
  / ___/____  / (_)___/ (_) /___  __   / __ )(_) /______
  \__ \/ __ \/ / / __  / / __/ / / /  / __  / / __/ ___/
 ___/ / /_/ / / / /_/ / / /_/ /_/ /  / /_/ / / /_(__  ) 
/____/\____/_/_/\__,_/_/\__/\__, /  /_____/_/\__/____/  
                           /____/                        

- npm: https://www.npmjs.com/package/solidity-bits
- github: https://github.com/estarriolvetch/solidity-bits

 */

//pragma solidity ^0.8.0;


library BitScan {
    uint256 constant private DEBRUIJN_256 = 0x818283848586878898a8b8c8d8e8f929395969799a9b9d9e9faaeb6bedeeff;
    bytes constant private LOOKUP_TABLE_256 = hex"0001020903110a19042112290b311a3905412245134d2a550c5d32651b6d3a7506264262237d468514804e8d2b95569d0d495ea533a966b11c886eb93bc176c9071727374353637324837e9b47af86c7155181ad4fd18ed32c9096db57d59ee30e2e4a6a5f92a6be3498aae067ddb2eb1d5989b56fd7baf33ca0c2ee77e5caf7ff0810182028303840444c545c646c7425617c847f8c949c48a4a8b087b8c0c816365272829aaec650acd0d28fdad4e22d6991bd97dfdcea58b4d6f29fede4f6fe0f1f2f3f4b5b6b607b8b93a3a7b7bf357199c5abcfd9e168bcdee9b3f1ecf5fd1e3e5a7a8aa2b670c4ced8bbe8f0f4fc3d79a1c3cde7effb78cce6facbf9f8";

    /**
        @dev Isolate the least significant set bit.
     */ 
    function isolateLS1B256(uint256 bb) pure internal returns (uint256) {
        require(bb > 0);
        unchecked {
            return bb & (0 - bb);
        }
    } 

    /**
        @dev Isolate the most significant set bit.
     */ 
    function isolateMS1B256(uint256 bb) pure internal returns (uint256) {
        require(bb > 0);
        unchecked {
            bb |= bb >> 128;
            bb |= bb >> 64;
            bb |= bb >> 32;
            bb |= bb >> 16;
            bb |= bb >> 8;
            bb |= bb >> 4;
            bb |= bb >> 2;
            bb |= bb >> 1;
            
            return (bb >> 1) + 1;
        }
    } 

    /**
        @dev Find the index of the lest significant set bit. (trailing zero count)
     */ 
    function bitScanForward256(uint256 bb) pure internal returns (uint8) {
        unchecked {
            return uint8(LOOKUP_TABLE_256[(isolateLS1B256(bb) * DEBRUIJN_256) >> 248]);
        }   
    }

    /**
        @dev Find the index of the most significant set bit.
     */ 
    function bitScanReverse256(uint256 bb) pure internal returns (uint8) {
        unchecked {
            return 255 - uint8(LOOKUP_TABLE_256[((isolateMS1B256(bb) * DEBRUIJN_256) >> 248)]);
        }   
    }

    function log2(uint256 bb) pure internal returns (uint8) {
        unchecked {
            return uint8(LOOKUP_TABLE_256[(isolateMS1B256(bb) * DEBRUIJN_256) >> 248]);
        } 
    }
}

// File: solidity-bits/contracts/BitMaps.sol


/**
   _____       ___     ___ __           ____  _ __      
  / ___/____  / (_)___/ (_) /___  __   / __ )(_) /______
  \__ \/ __ \/ / / __  / / __/ / / /  / __  / / __/ ___/
 ___/ / /_/ / / / /_/ / / /_/ /_/ /  / /_/ / / /_(__  ) 
/____/\____/_/_/\__,_/_/\__/\__, /  /_____/_/\__/____/  
                           /____/                        

- npm: https://www.npmjs.com/package/solidity-bits
- github: https://github.com/estarriolvetch/solidity-bits

 */
//pragma solidity ^0.8.0;



/**
 * @dev This Library is a modified version of Openzeppelin's BitMaps library with extra features.
 *
 * 1. Functions of finding the index of the closest set bit from a given index are added.
 *    The indexing of each bucket is modifed to count from the MSB to the LSB instead of from the LSB to the MSB.
 *    The modification of indexing makes finding the closest previous set bit more efficient in gas usage.
 * 2. Setting and unsetting the bitmap consecutively.
 * 3. Accounting number of set bits within a given range.   
 *
*/

/**
 * @dev Library for managing uint256 to bool mapping in a compact and efficient way, providing the keys are sequential.
 * Largelly inspired by Uniswap's https://github.com/Uniswap/merkle-distributor/blob/master/contracts/MerkleDistributor.sol[merkle-distributor].
 */

library BitMaps {
    using BitScan for uint256;
    uint256 private constant MASK_INDEX_ZERO = (1 << 255);
    uint256 private constant MASK_FULL = type(uint256).max;

    struct BitMap {
        mapping(uint256 => uint256) _data;
    }

    /**
     * @dev Returns whether the bit at `index` is set.
     */
    function get(BitMap storage bitmap, uint256 index) internal view returns (bool) {
        uint256 bucket = index >> 8;
        uint256 mask = MASK_INDEX_ZERO >> (index & 0xff);
        return bitmap._data[bucket] & mask != 0;
    }

    /**
     * @dev Sets the bit at `index` to the boolean `value`.
     */
    function setTo(
        BitMap storage bitmap,
        uint256 index,
        bool value
    ) internal {
        if (value) {
            set(bitmap, index);
        } else {
            unset(bitmap, index);
        }
    }

    /**
     * @dev Sets the bit at `index`.
     */
    function set(BitMap storage bitmap, uint256 index) internal {
        uint256 bucket = index >> 8;
        uint256 mask = MASK_INDEX_ZERO >> (index & 0xff);
        bitmap._data[bucket] |= mask;
    }

    /**
     * @dev Unsets the bit at `index`.
     */
    function unset(BitMap storage bitmap, uint256 index) internal {
        uint256 bucket = index >> 8;
        uint256 mask = MASK_INDEX_ZERO >> (index & 0xff);
        bitmap._data[bucket] &= ~mask;
    }


    /**
     * @dev Consecutively sets `amount` of bits starting from the bit at `startIndex`.
     */    
    function setBatch(BitMap storage bitmap, uint256 startIndex, uint256 amount) internal {
        uint256 bucket = startIndex >> 8;

        uint256 bucketStartIndex = (startIndex & 0xff);

        unchecked {
            if(bucketStartIndex + amount < 256) {
                bitmap._data[bucket] |= MASK_FULL << (256 - amount) >> bucketStartIndex;
            } else {
                bitmap._data[bucket] |= MASK_FULL >> bucketStartIndex;
                amount -= (256 - bucketStartIndex);
                bucket++;

                while(amount > 256) {
                    bitmap._data[bucket] = MASK_FULL;
                    amount -= 256;
                    bucket++;
                }

                bitmap._data[bucket] |= MASK_FULL << (256 - amount);
            }
        }
    }


    /**
     * @dev Consecutively unsets `amount` of bits starting from the bit at `startIndex`.
     */    
    function unsetBatch(BitMap storage bitmap, uint256 startIndex, uint256 amount) internal {
        uint256 bucket = startIndex >> 8;

        uint256 bucketStartIndex = (startIndex & 0xff);

        unchecked {
            if(bucketStartIndex + amount < 256) {
                bitmap._data[bucket] &= ~(MASK_FULL << (256 - amount) >> bucketStartIndex);
            } else {
                bitmap._data[bucket] &= ~(MASK_FULL >> bucketStartIndex);
                amount -= (256 - bucketStartIndex);
                bucket++;

                while(amount > 256) {
                    bitmap._data[bucket] = 0;
                    amount -= 256;
                    bucket++;
                }

                bitmap._data[bucket] &= ~(MASK_FULL << (256 - amount));
            }
        }
    }

    /**
     * @dev Returns number of set bits within a range.
     */
    function popcountA(BitMap storage bitmap, uint256 startIndex, uint256 amount) internal view returns(uint256 count) {
        uint256 bucket = startIndex >> 8;

        uint256 bucketStartIndex = (startIndex & 0xff);

        unchecked {
            if(bucketStartIndex + amount < 256) {
                count +=  Popcount.popcount256A(
                    bitmap._data[bucket] & (MASK_FULL << (256 - amount) >> bucketStartIndex)
                );
            } else {
                count += Popcount.popcount256A(
                    bitmap._data[bucket] & (MASK_FULL >> bucketStartIndex)
                );
                amount -= (256 - bucketStartIndex);
                bucket++;

                while(amount > 256) {
                    count += Popcount.popcount256A(bitmap._data[bucket]);
                    amount -= 256;
                    bucket++;
                }
                count += Popcount.popcount256A(
                    bitmap._data[bucket] & (MASK_FULL << (256 - amount))
                );
            }
        }
    }

    /**
     * @dev Returns number of set bits within a range.
     */
    function popcountB(BitMap storage bitmap, uint256 startIndex, uint256 amount) internal view returns(uint256 count) {
        uint256 bucket = startIndex >> 8;

        uint256 bucketStartIndex = (startIndex & 0xff);

        unchecked {
            if(bucketStartIndex + amount < 256) {
                count +=  Popcount.popcount256B(
                    bitmap._data[bucket] & (MASK_FULL << (256 - amount) >> bucketStartIndex)
                );
            } else {
                count += Popcount.popcount256B(
                    bitmap._data[bucket] & (MASK_FULL >> bucketStartIndex)
                );
                amount -= (256 - bucketStartIndex);
                bucket++;

                while(amount > 256) {
                    count += Popcount.popcount256B(bitmap._data[bucket]);
                    amount -= 256;
                    bucket++;
                }
                count += Popcount.popcount256B(
                    bitmap._data[bucket] & (MASK_FULL << (256 - amount))
                );
            }
        }
    }


    /**
     * @dev Find the closest index of the set bit before `index`.
     */
    function scanForward(BitMap storage bitmap, uint256 index) internal view returns (uint256 setBitIndex) {
        uint256 bucket = index >> 8;

        // index within the bucket
        uint256 bucketIndex = (index & 0xff);

        // load a bitboard from the bitmap.
        uint256 bb = bitmap._data[bucket];

        // offset the bitboard to scan from `bucketIndex`.
        bb = bb >> (0xff ^ bucketIndex); // bb >> (255 - bucketIndex)
        
        if(bb > 0) {
            unchecked {
                setBitIndex = (bucket << 8) | (bucketIndex -  bb.bitScanForward256());    
            }
        } else {
            while(true) {
                require(bucket > 0, "BitMaps: The set bit before the index doesn't exist.");
                unchecked {
                    bucket--;
                }
                // No offset. Always scan from the least significiant bit now.
                bb = bitmap._data[bucket];
                
                if(bb > 0) {
                    unchecked {
                        setBitIndex = (bucket << 8) | (255 -  bb.bitScanForward256());
                        break;
                    }
                } 
            }
        }
    }

    function getBucket(BitMap storage bitmap, uint256 bucket) internal view returns (uint256) {
        return bitmap._data[bucket];
    }
}

// File: @openzeppelin/contracts/utils/StorageSlot.sol


// OpenZeppelin Contracts (last updated v4.7.0) (utils/StorageSlot.sol)

//pragma solidity ^0.8.0;

/**
 * @dev Library for reading and writing primitive types to specific storage slots.
 *
 * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.
 * This library helps with reading and writing to such slots without the need for inline assembly.
 *
 * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.
 *
 * Example usage to set ERC1967 implementation slot:
 * ```
 * contract ERC1967 {
 *     bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
 *
 *     function _getImplementation() internal view returns (address) {
 *         return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;
 *     }
 *
 *     function _setImplementation(address newImplementation) internal {
 *         require(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract");
 *         StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;
 *     }
 * }
 * ```
 *
 * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._
 */
library StorageSlot {
    struct AddressSlot {
        address value;
    }

    struct BooleanSlot {
        bool value;
    }

    struct Bytes32Slot {
        bytes32 value;
    }

    struct Uint256Slot {
        uint256 value;
    }

    /**
     * @dev Returns an `AddressSlot` with member `value` located at `slot`.
     */
    function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `BooleanSlot` with member `value` located at `slot`.
     */
    function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.
     */
    function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `Uint256Slot` with member `value` located at `slot`.
     */
    function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }
}

// File: @openzeppelin/contracts/utils/Address.sol


// OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol)

//pragma solidity ^0.8.1;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 0;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        (bool success, ) = recipient.call{value: amount}("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain `call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCall(target, data, "Address: low-level call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        require(isContract(target), "Address: call to non-contract");

        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        require(isContract(target), "Address: static call to non-contract");

        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionDelegateCall(target, data, "Address: low-level delegate call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(isContract(target), "Address: delegate call to non-contract");

        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly
                /// @solidity memory-safe-assembly
                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

// File: @openzeppelin/contracts/utils/Strings.sol


// OpenZeppelin Contracts (last updated v4.7.0) (utils/Strings.sol)

//pragma solidity ^0.8.0;

/**
 * @dev String operations.
 */
library Strings {
    bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
    uint8 private constant _ADDRESS_LENGTH = 20;

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        // Inspired by OraclizeAPI's implementation - MIT licence
        // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol

        if (value == 0) {
            return "0";
        }
        uint256 temp = value;
        uint256 digits;
        while (temp != 0) {
            digits++;
            temp /= 10;
        }
        bytes memory buffer = new bytes(digits);
        while (value != 0) {
            digits -= 1;
            buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
            value /= 10;
        }
        return string(buffer);
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        if (value == 0) {
            return "0x00";
        }
        uint256 temp = value;
        uint256 length = 0;
        while (temp != 0) {
            length++;
            temp >>= 8;
        }
        return toHexString(value, length);
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
     */
    function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
        bytes memory buffer = new bytes(2 * length + 2);
        buffer[0] = "0";
        buffer[1] = "x";
        for (uint256 i = 2 * length + 1; i > 1; --i) {
            buffer[i] = _HEX_SYMBOLS[value & 0xf];
            value >>= 4;
        }
        require(value == 0, "Strings: hex length insufficient");
        return string(buffer);
    }

    /**
     * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.
     */
    function toHexString(address addr) internal pure returns (string memory) {
        return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);
    }
}

// File: @openzeppelin/contracts/utils/Context.sol


// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

//pragma solidity ^0.8.0;

/**
 * @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/Ownable.sol


// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)

//pragma solidity ^0.8.0;


/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
    address private _owner;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _transferOwnership(_msgSender());
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

// File: @openzeppelin/contracts/token/ERC721/IERC721Receiver.sol


// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol)

//pragma solidity ^0.8.0;

/**
 * @title ERC721 token receiver interface
 * @dev Interface for any contract that wants to support safeTransfers
 * from ERC721 asset contracts.
 */
interface IERC721Receiver {
    /**
     * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
     * by `operator` from `from`, this function is called.
     *
     * It must return its Solidity selector to confirm the token transfer.
     * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.
     *
     * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.
     */
    function onERC721Received(
        address operator,
        address from,
        uint256 tokenId,
        bytes calldata data
    ) external returns (bytes4);
}

// File: @openzeppelin/contracts/utils/introspection/IERC165.sol


// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)

//pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[EIP].
 *
 * Implementers can declare support of contract interfaces, which can then be
 * queried by others ({ERC165Checker}).
 *
 * For an implementation, see {ERC165}.
 */
interface IERC165 {
    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);
}

// File: @openzeppelin/contracts/utils/introspection/ERC165.sol


// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)

//pragma solidity ^0.8.0;


/**
 * @dev Implementation of the {IERC165} interface.
 *
 * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
 * for the additional interface id that will be supported. For example:
 *
 * ```solidity
 * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
 *     return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
 * }
 * ```
 *
 * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
 */
abstract contract ERC165 is IERC165 {
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IERC165).interfaceId;
    }
}

// File: @openzeppelin/contracts/token/ERC721/IERC721.sol


// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC721/IERC721.sol)

//pragma solidity ^0.8.0;


/**
 * @dev Required interface of an ERC721 compliant contract.
 */
interface IERC721 is IERC165 {
    /**
     * @dev Emitted when `tokenId` token is transferred from `from` to `to`.
     */
    event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
     */
    event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
     */
    event ApprovalForAll(address indexed owner, address indexed operator, bool approved);

    /**
     * @dev Returns the number of tokens in ``owner``'s account.
     */
    function balanceOf(address owner) external view returns (uint256 balance);

    /**
     * @dev Returns the owner of the `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function ownerOf(uint256 tokenId) external view returns (address owner);

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId,
        bytes calldata data
    ) external;

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
     * are aware of the ERC721 protocol to prevent tokens from being forever locked.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external;

    /**
     * @dev Transfers `tokenId` token from `from` to `to`.
     *
     * WARNING: 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;

    /**
     * @dev Gives permission to `to` to transfer `tokenId` token to another account.
     * The approval is cleared when the token is transferred.
     *
     * Only a single account can be approved at a time, so approving the zero address clears previous approvals.
     *
     * Requirements:
     *
     * - The caller must own the token or be an approved operator.
     * - `tokenId` must exist.
     *
     * Emits an {Approval} event.
     */
    function approve(address to, uint256 tokenId) external;

    /**
     * @dev Approve or remove `operator` as an operator for the caller.
     * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
     *
     * Requirements:
     *
     * - The `operator` cannot be the caller.
     *
     * Emits an {ApprovalForAll} event.
     */
    function setApprovalForAll(address operator, bool _approved) external;

    /**
     * @dev Returns the account approved for `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function getApproved(uint256 tokenId) external view returns (address operator);

    /**
     * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
     *
     * See {setApprovalForAll}
     */
    function isApprovedForAll(address owner, address operator) external view returns (bool);
}

// File: @openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol


// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/extensions/IERC721Enumerable.sol)

//pragma solidity ^0.8.0;


/**
 * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension
 * @dev See https://eips.ethereum.org/EIPS/eip-721
 */
interface IERC721Enumerable is IERC721 {
    /**
     * @dev Returns the total amount of tokens stored by the contract.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns a token ID owned by `owner` at a given `index` of its token list.
     * Use along with {balanceOf} to enumerate all of ``owner``'s tokens.
     */
    function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256);

    /**
     * @dev Returns a token ID at a given `index` of all the tokens stored by the contract.
     * Use along with {totalSupply} to enumerate all tokens.
     */
    function tokenByIndex(uint256 index) external view returns (uint256);
}

// File: @openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol


// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol)

//pragma solidity ^0.8.0;


/**
 * @title ERC-721 Non-Fungible Token Standard, optional metadata extension
 * @dev See https://eips.ethereum.org/EIPS/eip-721
 */
interface IERC721Metadata is IERC721 {
    /**
     * @dev Returns the token collection name.
     */
    function name() external view returns (string memory);

    /**
     * @dev Returns the token collection symbol.
     */
    function symbol() external view returns (string memory);

    /**
     * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
     */
    function tokenURI(uint256 tokenId) external view returns (string memory);
}

// File: docs.chain.link/EVAKeepersAutomationPsi.sol


/**
  ______ _____   _____ ______ ___  __ _  _  _ 
 |  ____|  __ \ / ____|____  |__ \/_ | || || |
 | |__  | |__) | |        / /   ) || | \| |/ |
 |  __| |  _  /| |       / /   / / | |\_   _/ 
 | |____| | \ \| |____  / /   / /_ | |  | |   
 |______|_|  \_\\_____|/_/   |____||_|  |_|   

 - github: https://github.com/estarriolvetch/ERC721Psi
 - npm: https://www.npmjs.com/package/erc721psi
                                          
 */

//pragma solidity ^0.8.0;





// File: SafeMath.sol

/**
 * @dev Wrappers over Solidity's arithmetic operations with added overflow
 * checks.
 *
 * Arithmetic operations in Solidity wrap on overflow. This can easily result
 * in bugs, because programmers usually assume that an overflow raises an
 * error, which is the standard behavior in high level programming languages.
 * `SafeMath` restores this intuition by reverting the transaction when an
 * operation overflows.
 *
 * Using this library instead of the unchecked operations eliminates an entire
 * class of bugs, so it's recommended to use it always.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryAdd(uint256 a, uint256 b)
        internal
        pure
        returns (bool, uint256)
    {
        uint256 c = a + b;
        if (c < a) return (false, 0);
        return (true, c);
    }

    /**
     * @dev Returns the substraction of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function trySub(uint256 a, uint256 b)
        internal
        pure
        returns (bool, uint256)
    {
        if (b > a) return (false, 0);
        return (true, a - b);
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryMul(uint256 a, uint256 b)
        internal
        pure
        returns (bool, uint256)
    {
        // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
        // benefit is lost if 'b' is also tested.
        // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
        if (a == 0) return (true, 0);
        uint256 c = a * b;
        if (c / a != b) return (false, 0);
        return (true, c);
    }

    /**
     * @dev Returns the division of two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryDiv(uint256 a, uint256 b)
        internal
        pure
        returns (bool, uint256)
    {
        if (b == 0) return (false, 0);
        return (true, a / b);
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryMod(uint256 a, uint256 b)
        internal
        pure
        returns (bool, uint256)
    {
        if (b == 0) return (false, 0);
        return (true, a % b);
    }

    /**
     * @dev Returns the addition of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     *
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c = a + b;
        require(c >= a, "SafeMath: addition overflow");
        return c;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b <= a, "SafeMath: subtraction overflow");
        return a - b;
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     *
     * - Multiplication cannot overflow.
     */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        if (a == 0) return 0;
        uint256 c = a * b;
        require(c / a == b, "SafeMath: multiplication overflow");
        return c;
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b > 0, "SafeMath: division by zero");
        return a / b;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b > 0, "SafeMath: modulo by zero");
        return a % b;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {trySub}.
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        require(b <= a, errorMessage);
        return a - b;
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting with custom message on
     * division by zero. The result is rounded towards zero.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryDiv}.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        require(b > 0, errorMessage);
        return a / b;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting with custom message when dividing by zero.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryMod}.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        require(b > 0, errorMessage);
        return a % b;
    }
}

contract ERC721Psi is Context, ERC165, IERC721, IERC721Metadata, IERC721Enumerable {
    using Address for address;
    using Strings for uint256;
    using BitMaps for BitMaps.BitMap;

    BitMaps.BitMap private _batchHead;

    string private _name;
    string private _symbol;

    // Mapping from token ID to owner address
    mapping(uint256 => address) internal _owners;
    uint256 internal _minted;

    mapping(uint256 => address) private _tokenApprovals;
    mapping(address => mapping(address => bool)) private _operatorApprovals;

    /**
     * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.
     */
    constructor(string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
    }

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId)
        public
        view
        virtual
        override(ERC165, IERC165)
        returns (bool)
    {
        return
            interfaceId == type(IERC721).interfaceId ||
            interfaceId == type(IERC721Metadata).interfaceId ||
            interfaceId == type(IERC721Enumerable).interfaceId ||
            super.supportsInterface(interfaceId);
    }

    /**
     * @dev See {IERC721-balanceOf}.
     */
    function balanceOf(address owner) 
        public 
        view 
        virtual 
        override 
        returns (uint) 
    {
        require(owner != address(0), "ERC721Psi: balance query for the zero address");

        uint count;
        for( uint i; i < _minted; ++i ){
            if(_exists(i)){
                if( owner == ownerOf(i)){
                    ++count;
                }
            }
        }
        return count;
    }

    /**
     * @dev See {IERC721-ownerOf}.
     */
    function ownerOf(uint256 tokenId)
        public
        view
        virtual
        override
        returns (address)
    {
        (address owner, ) = _ownerAndBatchHeadOf(tokenId);
        return owner;
    }

    function _ownerAndBatchHeadOf(uint256 tokenId) internal view returns (address owner, uint256 tokenIdBatchHead){
        require(_exists(tokenId), "ERC721Psi: owner query for nonexistent token");
        tokenIdBatchHead = _getBatchHead(tokenId);
        owner = _owners[tokenIdBatchHead];
    }

    /**
     * @dev See {IERC721Metadata-name}.
     */
    function name() public view virtual override returns (string memory) {
        return _name;
    }

    /**
     * @dev See {IERC721Metadata-symbol}.
     */
    function symbol() public view virtual override returns (string memory) {
        return _symbol;
    }

    /**
     * @dev See {IERC721Metadata-tokenURI}.
     */
    function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
        require(_exists(tokenId), "ERC721Psi: URI query for nonexistent token");

        string memory baseURI = _baseURI();
        return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : "";
    }

    /**
     * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each
     * token will be the concatenation of the `baseURI` and the `tokenId`. Empty
     * by default, can be overriden in child contracts.
     */
    function _baseURI() internal view virtual returns (string memory) {
        return "";
    }


    /**
     * @dev See {IERC721-approve}.
     */
    function approve(address to, uint256 tokenId) public virtual override {
        address owner = ownerOf(tokenId);
        require(to != owner, "ERC721Psi: approval to current owner");

        require(
            _msgSender() == owner || isApprovedForAll(owner, _msgSender()),
            "ERC721Psi: approve caller is not owner nor approved for all"
        );

        _approve(to, tokenId);
    }

    /**
     * @dev See {IERC721-getApproved}.
     */
    function getApproved(uint256 tokenId)
        public
        view
        virtual
        override
        returns (address)
    {
        require(
            _exists(tokenId),
            "ERC721Psi: approved query for nonexistent token"
        );

        return _tokenApprovals[tokenId];
    }

    /**
     * @dev See {IERC721-setApprovalForAll}.
     */
    function setApprovalForAll(address operator, bool approved)
        public
        virtual
        override
    {
        require(operator != _msgSender(), "ERC721Psi: approve to caller");

        _operatorApprovals[_msgSender()][operator] = approved;
        emit ApprovalForAll(_msgSender(), operator, approved);
    }

    /**
     * @dev See {IERC721-isApprovedForAll}.
     */
    function isApprovedForAll(address owner, address operator)
        public
        view
        virtual
        override
        returns (bool)
    {
        return _operatorApprovals[owner][operator];
    }

    /**
     * @dev See {IERC721-transferFrom}.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public virtual override {
        //solhint-disable-next-line max-line-length
        require(
            _isApprovedOrOwner(_msgSender(), tokenId),
            "ERC721Psi: transfer caller is not owner nor approved"
        );

        _transfer(from, to, tokenId);
    }

    /**
     * @dev See {IERC721-safeTransferFrom}.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public virtual override {
        safeTransferFrom(from, to, tokenId, "");
    }

    /**
     * @dev See {IERC721-safeTransferFrom}.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId,
        bytes memory _data
    ) public virtual override {
        require(
            _isApprovedOrOwner(_msgSender(), tokenId),
            "ERC721Psi: transfer caller is not owner nor approved"
        );
        _safeTransfer(from, to, tokenId, _data);
    }

    /**
     * @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.
     *
     * `_data` is additional data, it has no specified format and it is sent in call to `to`.
     *
     * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.
     * implement alternative mechanisms to perform token transfer, such as signature-based.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function _safeTransfer(
        address from,
        address to,
        uint256 tokenId,
        bytes memory _data
    ) internal virtual {
        _transfer(from, to, tokenId);
        require(
            _checkOnERC721Received(from, to, tokenId, 1,_data),
            "ERC721Psi: transfer to non ERC721Receiver implementer"
        );
    }

    /**
     * @dev Returns whether `tokenId` exists.
     *
     * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.
     *
     * Tokens start existing when they are minted (`_mint`).
     */
    function _exists(uint256 tokenId) internal view virtual returns (bool) {
        return tokenId < _minted;
    }

    /**
     * @dev Returns whether `spender` is allowed to manage `tokenId`.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function _isApprovedOrOwner(address spender, uint256 tokenId)
        internal
        view
        virtual
        returns (bool)
    {
        require(
            _exists(tokenId),
            "ERC721Psi: operator query for nonexistent token"
        );
        address owner = ownerOf(tokenId);
        return (spender == owner ||
            getApproved(tokenId) == spender ||
            isApprovedForAll(owner, spender));
    }

    /**
     * @dev Safely mints `quantity` tokens and transfers them to `to`.
     *
     * Requirements:
     *
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called for each safe transfer.
     * - `quantity` must be greater than 0.
     *
     * Emits a {Transfer} event.
     */
    function _safeMint(address to, uint256 quantity) internal virtual {
        _safeMint(to, quantity, "");
    }

    
    function _safeMint(
        address to,
        uint256 quantity,
        bytes memory _data
    ) internal virtual {
        uint256 startTokenId = _minted;
        _mint(to, quantity);
        require(
            _checkOnERC721Received(address(0), to, startTokenId, quantity, _data),
            "ERC721Psi: transfer to non ERC721Receiver implementer"
        );
    }


    function _mint(
        address to,
        uint256 quantity
    ) internal virtual {
        uint256 tokenIdBatchHead = _minted;
        
        require(quantity > 0, "ERC721Psi: quantity must be greater 0");
        require(to != address(0), "ERC721Psi: mint to the zero address");
        
        _beforeTokenTransfers(address(0), to, tokenIdBatchHead, quantity);
        _minted += quantity;
        _owners[tokenIdBatchHead] = to;
        _batchHead.set(tokenIdBatchHead);
        _afterTokenTransfers(address(0), to, tokenIdBatchHead, quantity);
        
        // Emit events
        for(uint256 tokenId=tokenIdBatchHead;tokenId < tokenIdBatchHead + quantity; tokenId++){
            emit Transfer(address(0), to, tokenId);
        } 
    }


    /**
     * @dev Transfers `tokenId` from `from` to `to`.
     *  As opposed to {transferFrom}, this imposes no restrictions on msg.sender.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     *
     * Emits a {Transfer} event.
     */
    function _transfer(
        address from,
        address to,
        uint256 tokenId
    ) internal virtual {
        (address owner, uint256 tokenIdBatchHead) = _ownerAndBatchHeadOf(tokenId);

        require(
            owner == from,
            "ERC721Psi: transfer of token that is not own"
        );
        require(to != address(0), "ERC721Psi: transfer to the zero address");

        _beforeTokenTransfers(from, to, tokenId, 1);

        // Clear approvals from the previous owner
        _approve(address(0), tokenId);   

        uint256 nextTokenId = tokenId + 1;

        if(!_batchHead.get(nextTokenId) &&  
            nextTokenId < _minted
        ) {
            _owners[nextTokenId] = from;
            _batchHead.set(nextTokenId);
        }

        _owners[tokenId] = to;
        if(tokenId != tokenIdBatchHead) {
            _batchHead.set(tokenId);
        }

        emit Transfer(from, to, tokenId);

        _afterTokenTransfers(from, to, tokenId, 1);
    }

    /**
     * @dev Approve `to` to operate on `tokenId`
     *
     * Emits a {Approval} event.
     */
    function _approve(address to, uint256 tokenId) internal virtual {
        _tokenApprovals[tokenId] = to;
        emit Approval(ownerOf(tokenId), to, tokenId);
    }

    /**
     * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.
     * The call is not executed if the target address is not a contract.
     *
     * @param from address representing the previous owner of the given token ID
     * @param to target address that will receive the tokens
     * @param startTokenId uint256 the first ID of the tokens to be transferred
     * @param quantity uint256 amount of the tokens to be transfered.
     * @param _data bytes optional data to send along with the call
     * @return r bool whether the call correctly returned the expected magic value
     */
    function _checkOnERC721Received(
        address from,
        address to,
        uint256 startTokenId,
        uint256 quantity,
        bytes memory _data
    ) private returns (bool r) {
        if (to.isContract()) {
            r = true;
            for(uint256 tokenId = startTokenId; tokenId < startTokenId + quantity; tokenId++){
                try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) {
                    r = r && retval == IERC721Receiver.onERC721Received.selector;
                } catch (bytes memory reason) {
                    if (reason.length == 0) {
                        revert("ERC721Psi: transfer to non ERC721Receiver implementer");
                    } else {
                        assembly {
                            revert(add(32, reason), mload(reason))
                        }
                    }
                }
            }
            return r;
        } else {
            return true;
        }
    }

    function _getBatchHead(uint256 tokenId) internal view returns (uint256 tokenIdBatchHead) {
        tokenIdBatchHead = _batchHead.scanForward(tokenId); 
    }

    /**
     * @dev See {IERC721Enumerable-totalSupply}.
     */
    function totalSupply() public view virtual override returns (uint256) {
        return _minted;
    }

    /**
     * @dev See {IERC721Enumerable-tokenByIndex}.
     */
    function tokenByIndex(uint256 index) public view virtual override returns (uint256 tokenId) {
        require(index < totalSupply(), "ERC721Psi: global index out of bounds");
        
        uint count;
        for(uint i; i < _minted; i++){
            if(_exists(i)){
                if(count == index) return i;
                else count++;
            }
        }
    }

    /**
     * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}.
     */
    function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override returns (uint256 tokenId) {
        uint count;
        for(uint i; i < _minted; i++){
            if(_exists(i) && owner == ownerOf(i)){
                if(count == index) return i;
                else count++;
            }
        }

        revert("ERC721Psi: owner index out of bounds");
    }


    /**
     * @dev Hook that is called before a set of serially-ordered token ids are about to be transferred. This includes minting.
     *
     * 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`.
     */
    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.
     *
     * 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` and `to` are never both zero.
     */
    function _afterTokenTransfers(
        address from,
        address to,
        uint256 startTokenId,
        uint256 quantity
    ) internal virtual {}
}


error ApprovalCallerNotOwnerNorApproved();
error ApprovalQueryForNonexistentToken();
error ApproveToCaller();
error ApprovalToCurrentOwner();
error BalanceQueryForZeroAddress();
error MintedQueryForZeroAddress();
error BurnedQueryForZeroAddress();
error MintToZeroAddress();
error MintZeroQuantity();
error OwnerIndexOutOfBounds();
error OwnerQueryForNonexistentToken();
error TokenIndexOutOfBounds();
error TransferCallerNotOwnerNorApproved();
error TransferFromIncorrectOwner();
error TransferToNonERC721ReceiverImplementer();
error TransferToZeroAddress();
error URIQueryForNonexistentToken();

contract CodeDaoKeys is ERC721Psi, Ownable {
    using SafeMath for uint256;
    using Strings for uint;

    /*
     * @dev Set Initial Parameters Before deployment
     * settings are still fully updateable after deployment
     */

    uint256 public maxSupply = 500;
    uint256 public mintRate = 0.08 ether;
    uint256 public maxMint = 3;

    /*
    * @Dev Booleans for sale state 
    * salesIsActive must be true in any case to mint
    */
    bool public globalSaleIsActive = false;

    /*
     * @dev Set base URI
     */
    string private baseURI;

    /*
    * mapping for keeping wallet mint qtys
    */
    mapping(address => uint256) public mintedTokens;

    
    /*
     * @dev Set Collection/Contract name and Token Ticker
     * below. Cannot be changed after
     * contract deployment.
     */
    constructor(string memory _baseUri) ERC721Psi("CodeDaoKeys", "CDK") {
        baseURI = _baseUri;
    }

    /**
     * @dev See {IERC721Metadata-tokenURI}.
     */
    function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
        if (!_exists(tokenId)) revert URIQueryForNonexistentToken();
        return string(abi.encodePacked(baseURI, "/", tokenId.toString(), ""));
    }

    // Function to change maxMint value
    function setMaxMint(uint256 _newMaxMint) external onlyOwner {
        maxMint = _newMaxMint;
    }


    /*
     *@dev
     * Set publicsale price to mint per NFT
     */
    function setMintPrice(uint256 _price) external onlyOwner {
        mintRate = _price;
    }

    /*
    * @dev mint funtion with _to address. no cost mint
    *  by contract owner/deployer
    */
    function QwikMint(uint256 quantity, address _to) external onlyOwner {
        require(globalSaleIsActive, "Sales must be active to mint");
        require(totalSupply() + quantity <= maxSupply, "Not enough NFTs left to Mint");
         _safeMint(_to, quantity);

    }

    /*
    * @dev mint function and checks for saleState and mint quantity
    */   
    function mint(uint256 quantity) external payable {
        require(globalSaleIsActive, "Sales must be active to mint");
        require(totalSupply() + quantity <= maxSupply, "Not enough NFTs left to mint");
        require((mintRate * quantity) <= msg.value, "Not enough Eth");

            // Check if the user has already minted maxmint or more NFTs
        require(mintedTokens[msg.sender] + quantity <= maxMint, "You alreadt minted the max allowed NFTs");

            // Update the count of NFTs minted by this wallet
        mintedTokens[msg.sender] += quantity;

        _safeMint(msg.sender, quantity);
    }


    /*
     * @dev Set new Base URI
     * useful for setting unrevealed uri to revealed Base URI
     * same as a reveal switch/state
     */
    function setBaseURI(string calldata newBaseURI) external onlyOwner {
        baseURI = newBaseURI;
    }


     /*
     * @dev internal baseUri function
     */
    function _baseURI() internal view override returns (string memory) {
        return baseURI;
    }

    // global sale active to enable contract mints globally
    function setGlobalSaleActive() public onlyOwner {
        globalSaleIsActive = !globalSaleIsActive;
    }


    /*
     * @dev Public Keepers or to Owner wallet Withdrawl function, Contract ETH balance
     * to owner wallet address.
     */
    function withdraw() external onlyOwner {
        payable(owner()).transfer(address(this).balance);
    }

    
    /*
    * @dev Get the minted count for a specific user
    */
    function getMintedCount(address _user) public view returns (uint256) {
        return mintedTokens[_user];
    }
    
    /*
    * @dev Alternative withdrawl
    * 
    */
    function Withdraw(uint256 _amount, address payable _to)
        external
        onlyOwner
    {
        require(_amount > 0, "Withdraw must be greater than 0");
        require(_amount <= address(this).balance, "Amount too high");
        (bool success, ) = _to.call{value: _amount}("");
        require(success);
    }

        /**
     * Get the array of token for owner.
     */
    function tokensOfOwner(address _owner)
        external
        view
        returns (uint256[] memory)
    {
        uint256 tokenCount = balanceOf(_owner);
        if (tokenCount == 0) {
            return new uint256[](0);
        } else {
            uint256[] memory result = new uint256[](tokenCount);
            for (uint256 index; index < tokenCount; index++) {
                result[index] = tokenOfOwnerByIndex(_owner, index);
            }
            return result;
        }
    }

}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "remappings": []
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"string","name":"_baseUri","type":"string"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"URIQueryForNonexistentToken","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[{"internalType":"uint256","name":"quantity","type":"uint256"},{"internalType":"address","name":"_to","type":"address"}],"name":"QwikMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address payable","name":"_to","type":"address"}],"name":"Withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"getMintedCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"globalSaleIsActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxMint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"quantity","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"mintRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"mintedTokens","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"newBaseURI","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"setGlobalSaleActive","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_newMaxMint","type":"uint256"}],"name":"setMaxMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_price","type":"uint256"}],"name":"setMintPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"}],"name":"tokensOfOwner","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60806040526101f460085567011c37937e0800006009556003600a55600b805460ff19169055348015610030575f80fd5b5060405161275038038061275083398101604081905261004f91610140565b6040518060400160405280600b81526020016a436f646544616f4b65797360a81b8152506040518060400160405280600381526020016243444b60e81b815250816001908161009e9190610274565b5060026100ab8282610274565b5050506100c46100bf6100d760201b60201c565b6100db565b600c6100d08282610274565b505061032e565b3390565b600780546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b634e487b7160e01b5f52604160045260245ffd5b5f60208284031215610150575f80fd5b81516001600160401b03811115610165575f80fd5b8201601f81018413610175575f80fd5b80516001600160401b0381111561018e5761018e61012c565b604051601f8201601f19908116603f011681016001600160401b03811182821017156101bc576101bc61012c565b6040528181528282016020018610156101d3575f80fd5b8160208401602083015e5f91810160200191909152949350505050565b600181811c9082168061020457607f821691505b60208210810361022257634e487b7160e01b5f52602260045260245ffd5b50919050565b601f82111561026f57805f5260205f20601f840160051c8101602085101561024d5750805b601f840160051c820191505b8181101561026c575f8155600101610259565b50505b505050565b81516001600160401b0381111561028d5761028d61012c565b6102a18161029b84546101f0565b84610228565b6020601f8211600181146102d3575f83156102bc5750848201515b5f19600385901b1c1916600184901b17845561026c565b5f84815260208120601f198516915b8281101561030257878501518255602094850194600190920191016102e2565b508482101561031f57868401515f19600387901b60f8161c191681555b50505050600190811b01905550565b6124158061033b5f395ff3fe6080604052600436106101f1575f3560e01c80637241dfa011610108578063a22cb4651161009d578063d5abeb011161006d578063d5abeb0114610582578063d76d1fc814610597578063e985e9c5146105b6578063f2fde38b146105fd578063f4a0a5281461061c575f80fd5b8063a22cb46514610510578063b88d4fde1461052f578063c87b56dd1461054e578063ca0dcf161461056d575f80fd5b80638da5cb5b116100d85780638da5cb5b1461049857806395d89b41146104b557806397d6696b146104c9578063a0712d68146104fd575f80fd5b80637241dfa01461040d5780637501f741146104385780638353ffca1461044d5780638462151c1461046c575f80fd5b80632f745c5911610189578063547520fe11610159578063547520fe1461037d57806355f804b31461039c5780636352211e146103bb57806370a08231146103da578063715018a6146103f9575f80fd5b80632f745c591461030c5780633ccfd60b1461032b57806342842e0e1461033f5780634f6ccce71461035e575f80fd5b8063095ea7b3116101c4578063095ea7b3146102975780631348bcc1146102b657806318160ddd146102cf57806323b872dd146102ed575f80fd5b806301ffc9a7146101f557806304c46ed91461022957806306fdde031461023f578063081812fc14610260575b5f80fd5b348015610200575f80fd5b5061021461020f366004611c25565b61063b565b60405190151581526020015b60405180910390f35b348015610234575f80fd5b5061023d6106a7565b005b34801561024a575f80fd5b506102536106c3565b6040516102209190611c75565b34801561026b575f80fd5b5061027f61027a366004611c87565b610753565b6040516001600160a01b039091168152602001610220565b3480156102a2575f80fd5b5061023d6102b1366004611cb2565b6107e3565b3480156102c1575f80fd5b50600b546102149060ff1681565b3480156102da575f80fd5b506004545b604051908152602001610220565b3480156102f8575f80fd5b5061023d610307366004611cdc565b6108f9565b348015610317575f80fd5b506102df610326366004611cb2565b61092a565b348015610336575f80fd5b5061023d6109e8565b34801561034a575f80fd5b5061023d610359366004611cdc565b610a29565b348015610369575f80fd5b506102df610378366004611c87565b610a43565b348015610388575f80fd5b5061023d610397366004611c87565b610af1565b3480156103a7575f80fd5b5061023d6103b6366004611d1a565b610afe565b3480156103c6575f80fd5b5061027f6103d5366004611c87565b610b13565b3480156103e5575f80fd5b506102df6103f4366004611d88565b610b26565b348015610404575f80fd5b5061023d610bec565b348015610418575f80fd5b506102df610427366004611d88565b600d6020525f908152604090205481565b348015610443575f80fd5b506102df600a5481565b348015610458575f80fd5b5061023d610467366004611da3565b610bff565b348015610477575f80fd5b5061048b610486366004611d88565b610cf3565b6040516102209190611dd1565b3480156104a3575f80fd5b506007546001600160a01b031661027f565b3480156104c0575f80fd5b50610253610da2565b3480156104d4575f80fd5b506102df6104e3366004611d88565b6001600160a01b03165f908152600d602052604090205490565b61023d61050b366004611c87565b610db1565b34801561051b575f80fd5b5061023d61052a366004611e13565b610f5f565b34801561053a575f80fd5b5061023d610549366004611e57565b611022565b348015610559575f80fd5b50610253610568366004611c87565b61105a565b348015610578575f80fd5b506102df60095481565b34801561058d575f80fd5b506102df60085481565b3480156105a2575f80fd5b5061023d6105b1366004611da3565b6110b6565b3480156105c1575f80fd5b506102146105d0366004611f38565b6001600160a01b039182165f90815260066020908152604080832093909416825291909152205460ff1690565b348015610608575f80fd5b5061023d610617366004611d88565b611183565b348015610627575f80fd5b5061023d610636366004611c87565b6111f9565b5f6001600160e01b031982166380ac58cd60e01b148061066b57506001600160e01b03198216635b5e139f60e01b145b8061068657506001600160e01b0319821663780e9d6360e01b145b806106a157506301ffc9a760e01b6001600160e01b03198316145b92915050565b6106af611206565b600b805460ff19811660ff90911615179055565b6060600180546106d290611f64565b80601f01602080910402602001604051908101604052809291908181526020018280546106fe90611f64565b80156107495780601f1061072057610100808354040283529160200191610749565b820191905f5260205f20905b81548152906001019060200180831161072c57829003601f168201915b5050505050905090565b5f61075f826004541190565b6107c85760405162461bcd60e51b815260206004820152602f60248201527f4552433732315073693a20617070726f76656420717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b60648201526084015b60405180910390fd5b505f908152600560205260409020546001600160a01b031690565b5f6107ed82610b13565b9050806001600160a01b0316836001600160a01b03160361085c5760405162461bcd60e51b8152602060048201526024808201527f4552433732315073693a20617070726f76616c20746f2063757272656e74206f6044820152633bb732b960e11b60648201526084016107bf565b336001600160a01b0382161480610878575061087881336105d0565b6108ea5760405162461bcd60e51b815260206004820152603b60248201527f4552433732315073693a20617070726f76652063616c6c6572206973206e6f7460448201527f206f776e6572206e6f7220617070726f76656420666f7220616c6c000000000060648201526084016107bf565b6108f48383611260565b505050565b61090333826112cd565b61091f5760405162461bcd60e51b81526004016107bf90611f96565b6108f48383836113b9565b5f805f5b60045481101561099357610943816004541190565b8015610968575061095381610b13565b6001600160a01b0316856001600160a01b0316145b1561098b5783820361097d5791506106a19050565b8161098781611ffe565b9250505b60010161092e565b5060405162461bcd60e51b8152602060048201526024808201527f4552433732315073693a206f776e657220696e646578206f7574206f6620626f604482015263756e647360e01b60648201526084016107bf565b6109f0611206565b6007546040516001600160a01b03909116904780156108fc02915f818181858888f19350505050158015610a26573d5f803e3d5ffd5b50565b6108f483838360405180602001604052805f815250611022565b5f610a4d60045490565b8210610aa95760405162461bcd60e51b815260206004820152602560248201527f4552433732315073693a20676c6f62616c20696e646578206f7574206f6620626044820152646f756e647360d81b60648201526084016107bf565b5f805b600454811015610aea57610ac1816004541190565b15610ae257838203610ad4579392505050565b81610ade81611ffe565b9250505b600101610aac565b5050919050565b610af9611206565b600a55565b610b06611206565b600c6108f4828483612061565b5f80610b1e8361159e565b509392505050565b5f6001600160a01b038216610b935760405162461bcd60e51b815260206004820152602d60248201527f4552433732315073693a2062616c616e636520717565727920666f722074686560448201526c207a65726f206164647265737360981b60648201526084016107bf565b5f805b600454811015610be557610bab816004541190565b15610bdd57610bb981610b13565b6001600160a01b0316846001600160a01b031603610bdd57610bda82611ffe565b91505b600101610b96565b5092915050565b610bf4611206565b610bfd5f611635565b565b610c07611206565b5f8211610c565760405162461bcd60e51b815260206004820152601f60248201527f5769746864726177206d7573742062652067726561746572207468616e20300060448201526064016107bf565b47821115610c985760405162461bcd60e51b815260206004820152600f60248201526e082dadeeadce840e8dede40d0d2ced608b1b60448201526064016107bf565b5f816001600160a01b0316836040515f6040518083038185875af1925050503d805f8114610ce1576040519150601f19603f3d011682016040523d82523d5f602084013e610ce6565b606091505b50509050806108f4575f80fd5b60605f610cff83610b26565b9050805f03610d1d57604080515f8082526020820190925290610b1e565b5f8167ffffffffffffffff811115610d3757610d37611e43565b604051908082528060200260200182016040528015610d60578160200160208202803683370190505b5090505f5b82811015610b1e57610d77858261092a565b828281518110610d8957610d8961211b565b6020908102919091010152600101610d65565b50919050565b6060600280546106d290611f64565b600b5460ff16610e035760405162461bcd60e51b815260206004820152601c60248201527f53616c6573206d7573742062652061637469766520746f206d696e740000000060448201526064016107bf565b60085481610e1060045490565b610e1a919061212f565b1115610e685760405162461bcd60e51b815260206004820152601c60248201527f4e6f7420656e6f756768204e465473206c65667420746f206d696e740000000060448201526064016107bf565b3481600954610e779190612142565b1115610eb65760405162461bcd60e51b815260206004820152600e60248201526d09cdee840cadcdeeaced0408ae8d60931b60448201526064016107bf565b600a54335f908152600d6020526040902054610ed390839061212f565b1115610f315760405162461bcd60e51b815260206004820152602760248201527f596f7520616c7265616474206d696e74656420746865206d617820616c6c6f776044820152666564204e46547360c81b60648201526084016107bf565b335f908152600d602052604081208054839290610f4f90849061212f565b90915550610a2690503382611686565b336001600160a01b03831603610fb75760405162461bcd60e51b815260206004820152601c60248201527f4552433732315073693a20617070726f766520746f2063616c6c65720000000060448201526064016107bf565b335f8181526006602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b61102c33836112cd565b6110485760405162461bcd60e51b81526004016107bf90611f96565b6110548484848461169f565b50505050565b6060611067826004541190565b61108457604051630a14c4b560e41b815260040160405180910390fd5b600c61108f836116d4565b6040516020016110a0929190612159565b6040516020818303038152906040529050919050565b6110be611206565b600b5460ff166111105760405162461bcd60e51b815260206004820152601c60248201527f53616c6573206d7573742062652061637469766520746f206d696e740000000060448201526064016107bf565b6008548261111d60045490565b611127919061212f565b11156111755760405162461bcd60e51b815260206004820152601c60248201527f4e6f7420656e6f756768204e465473206c65667420746f204d696e740000000060448201526064016107bf565b61117f8183611686565b5050565b61118b611206565b6001600160a01b0381166111f05760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016107bf565b610a2681611635565b611201611206565b600955565b6007546001600160a01b03163314610bfd5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016107bf565b5f81815260056020526040902080546001600160a01b0319166001600160a01b038416908117909155819061129482610b13565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b5f6112d9826004541190565b61133d5760405162461bcd60e51b815260206004820152602f60248201527f4552433732315073693a206f70657261746f7220717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b60648201526084016107bf565b5f61134783610b13565b9050806001600160a01b0316846001600160a01b031614806113825750836001600160a01b031661137784610753565b6001600160a01b0316145b806113b157506001600160a01b038082165f9081526006602090815260408083209388168352929052205460ff165b949350505050565b5f806113c48361159e565b91509150846001600160a01b0316826001600160a01b03161461143e5760405162461bcd60e51b815260206004820152602c60248201527f4552433732315073693a207472616e73666572206f6620746f6b656e2074686160448201526b3a1034b9903737ba1037bbb760a11b60648201526084016107bf565b6001600160a01b0384166114a45760405162461bcd60e51b815260206004820152602760248201527f4552433732315073693a207472616e7366657220746f20746865207a65726f206044820152666164647265737360c81b60648201526084016107bf565b6114ae5f84611260565b5f6114ba84600161212f565b600881901c5f90815260208190526040902054909150600160ff1b60ff83161c161580156114e9575060045481105b1561151e575f81815260036020526040812080546001600160a01b0319166001600160a01b03891617905561151e90826117d1565b5f84815260036020526040902080546001600160a01b0319166001600160a01b038716179055818414611555576115555f856117d1565b83856001600160a01b0316876001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4505050505050565b5f806115ab836004541190565b61160c5760405162461bcd60e51b815260206004820152602c60248201527f4552433732315073693a206f776e657220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084016107bf565b611615836117fc565b5f818152600360205260409020546001600160a01b031694909350915050565b600780546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b61117f828260405180602001604052805f815250611807565b6116aa8484846113b9565b6116b884848460018561181d565b6110545760405162461bcd60e51b81526004016107bf906121e6565b6060815f036116fa5750506040805180820190915260018152600360fc1b602082015290565b815f5b8115611723578061170d81611ffe565b915061171c9050600a8361224f565b91506116fd565b5f8167ffffffffffffffff81111561173d5761173d611e43565b6040519080825280601f01601f191660200182016040528015611767576020820181803683370190505b5090505b84156113b15761177c600183612262565b9150611789600a86612275565b61179490603061212f565b60f81b8183815181106117a9576117a961211b565b60200101906001600160f81b03191690815f1a9053506117ca600a8661224f565b945061176b565b600881901c5f90815260209290925260409091208054600160ff1b60ff9093169290921c9091179055565b5f6106a18183611946565b6004546118148484611a3a565b6116b85f858386865b5f6001600160a01b0385163b1561193957506001835b61183d848661212f565b81101561193357604051630a85bd0160e11b81526001600160a01b0387169063150b7a02906118769033908b9086908990600401612288565b6020604051808303815f875af19250505080156118b0575060408051601f3d908101601f191682019092526118ad918101906122c4565b60015b61190b573d8080156118dd576040519150601f19603f3d011682016040523d82523d5f602084013e6118e2565b606091505b5080515f036119035760405162461bcd60e51b81526004016107bf906121e6565b805181602001fd5b82801561192857506001600160e01b03198116630a85bd0160e11b145b925050600101611833565b5061193d565b5060015b95945050505050565b600881901c5f8181526020849052604081205490919060ff808516919082181c80156119875761197581611b92565b60ff168203600884901b179350611a31565b5f83116119f35760405162461bcd60e51b815260206004820152603460248201527f4269744d6170733a205468652073657420626974206265666f7265207468652060448201527334b73232bc103237b2b9b713ba1032bc34b9ba1760611b60648201526084016107bf565b505f199091015f818152602086905260409020549091908015611a2c57611a1981611b92565b60ff0360ff16600884901b179350611a31565b611987565b50505092915050565b60045481611a985760405162461bcd60e51b815260206004820152602560248201527f4552433732315073693a207175616e74697479206d7573742062652067726561604482015264074657220360dc1b60648201526084016107bf565b6001600160a01b038316611afa5760405162461bcd60e51b815260206004820152602360248201527f4552433732315073693a206d696e7420746f20746865207a65726f206164647260448201526265737360e81b60648201526084016107bf565b8160045f828254611b0b919061212f565b90915550505f81815260036020526040812080546001600160a01b0319166001600160a01b038616179055611b4090826117d1565b805b611b4c838361212f565b8110156110545760405181906001600160a01b038616905f907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a4600101611b42565b5f60405180610120016040528061010081526020016122e0610100913960f87e818283848586878898a8b8c8d8e8f929395969799a9b9d9e9faaeb6bedeeff611bda85611bfb565b02901c81518110611bed57611bed61211b565b016020015160f81c92915050565b5f808211611c07575f80fd5b505f8190031690565b6001600160e01b031981168114610a26575f80fd5b5f60208284031215611c35575f80fd5b8135611c4081611c10565b9392505050565b5f81518084528060208401602086015e5f602082860101526020601f19601f83011685010191505092915050565b602081525f611c406020830184611c47565b5f60208284031215611c97575f80fd5b5035919050565b6001600160a01b0381168114610a26575f80fd5b5f8060408385031215611cc3575f80fd5b8235611cce81611c9e565b946020939093013593505050565b5f805f60608486031215611cee575f80fd5b8335611cf981611c9e565b92506020840135611d0981611c9e565b929592945050506040919091013590565b5f8060208385031215611d2b575f80fd5b823567ffffffffffffffff811115611d41575f80fd5b8301601f81018513611d51575f80fd5b803567ffffffffffffffff811115611d67575f80fd5b856020828401011115611d78575f80fd5b6020919091019590945092505050565b5f60208284031215611d98575f80fd5b8135611c4081611c9e565b5f8060408385031215611db4575f80fd5b823591506020830135611dc681611c9e565b809150509250929050565b602080825282518282018190525f918401906040840190835b81811015611e08578351835260209384019390920191600101611dea565b509095945050505050565b5f8060408385031215611e24575f80fd5b8235611e2f81611c9e565b915060208301358015158114611dc6575f80fd5b634e487b7160e01b5f52604160045260245ffd5b5f805f8060808587031215611e6a575f80fd5b8435611e7581611c9e565b93506020850135611e8581611c9e565b925060408501359150606085013567ffffffffffffffff811115611ea7575f80fd5b8501601f81018713611eb7575f80fd5b803567ffffffffffffffff811115611ed157611ed1611e43565b604051601f8201601f19908116603f0116810167ffffffffffffffff81118282101715611f0057611f00611e43565b604052818152828201602001891015611f17575f80fd5b816020840160208301375f6020838301015280935050505092959194509250565b5f8060408385031215611f49575f80fd5b8235611f5481611c9e565b91506020830135611dc681611c9e565b600181811c90821680611f7857607f821691505b602082108103610d9c57634e487b7160e01b5f52602260045260245ffd5b60208082526034908201527f4552433732315073693a207472616e736665722063616c6c6572206973206e6f6040820152731d081bdddb995c881b9bdc88185c1c1c9bdd995960621b606082015260800190565b634e487b7160e01b5f52601160045260245ffd5b5f6001820161200f5761200f611fea565b5060010190565b601f8211156108f457805f5260205f20601f840160051c8101602085101561203b5750805b601f840160051c820191505b8181101561205a575f8155600101612047565b5050505050565b67ffffffffffffffff83111561207957612079611e43565b61208d836120878354611f64565b83612016565b5f601f8411600181146120be575f85156120a75750838201355b5f19600387901b1c1916600186901b17835561205a565b5f83815260208120601f198716915b828110156120ed57868501358255602094850194600190920191016120cd565b5086821015612109575f1960f88860031b161c19848701351681555b505060018560011b0183555050505050565b634e487b7160e01b5f52603260045260245ffd5b808201808211156106a1576106a1611fea565b80820281158282048414176106a1576106a1611fea565b5f80845461216681611f64565b60018216801561217d5760018114612192576121bf565b60ff19831686528115158202860193506121bf565b875f5260205f205f5b838110156121b75781548882015260019091019060200161219b565b505081860193505b505050602f60f81b815283518060208601600184015e5f9101600101908152949350505050565b60208082526035908201527f4552433732315073693a207472616e7366657220746f206e6f6e20455243373260408201527418a932b1b2b4bb32b91034b6b83632b6b2b73a32b960591b606082015260800190565b634e487b7160e01b5f52601260045260245ffd5b5f8261225d5761225d61223b565b500490565b818103818111156106a1576106a1611fea565b5f826122835761228361223b565b500690565b6001600160a01b03858116825284166020820152604081018390526080606082018190525f906122ba90830184611c47565b9695505050505050565b5f602082840312156122d4575f80fd5b8151611c4081611c1056fe0001020903110a19042112290b311a3905412245134d2a550c5d32651b6d3a7506264262237d468514804e8d2b95569d0d495ea533a966b11c886eb93bc176c9071727374353637324837e9b47af86c7155181ad4fd18ed32c9096db57d59ee30e2e4a6a5f92a6be3498aae067ddb2eb1d5989b56fd7baf33ca0c2ee77e5caf7ff0810182028303840444c545c646c7425617c847f8c949c48a4a8b087b8c0c816365272829aaec650acd0d28fdad4e22d6991bd97dfdcea58b4d6f29fede4f6fe0f1f2f3f4b5b6b607b8b93a3a7b7bf357199c5abcfd9e168bcdee9b3f1ecf5fd1e3e5a7a8aa2b670c4ced8bbe8f0f4fc3d79a1c3cde7effb78cce6facbf9f8a2646970667358221220f5b23dcd96b9d0246dc00dd34776154ec0878172ba6ab50c721da3688ab4827a64736f6c634300081a00330000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004368747470733a2f2f697066732e696f2f697066732f516d51684e46553868654b4a353654457168715256795836706e5078696f31514e6f646657434d686779476375450000000000000000000000000000000000000000000000000000000000

Deployed Bytecode

0x6080604052600436106101f1575f3560e01c80637241dfa011610108578063a22cb4651161009d578063d5abeb011161006d578063d5abeb0114610582578063d76d1fc814610597578063e985e9c5146105b6578063f2fde38b146105fd578063f4a0a5281461061c575f80fd5b8063a22cb46514610510578063b88d4fde1461052f578063c87b56dd1461054e578063ca0dcf161461056d575f80fd5b80638da5cb5b116100d85780638da5cb5b1461049857806395d89b41146104b557806397d6696b146104c9578063a0712d68146104fd575f80fd5b80637241dfa01461040d5780637501f741146104385780638353ffca1461044d5780638462151c1461046c575f80fd5b80632f745c5911610189578063547520fe11610159578063547520fe1461037d57806355f804b31461039c5780636352211e146103bb57806370a08231146103da578063715018a6146103f9575f80fd5b80632f745c591461030c5780633ccfd60b1461032b57806342842e0e1461033f5780634f6ccce71461035e575f80fd5b8063095ea7b3116101c4578063095ea7b3146102975780631348bcc1146102b657806318160ddd146102cf57806323b872dd146102ed575f80fd5b806301ffc9a7146101f557806304c46ed91461022957806306fdde031461023f578063081812fc14610260575b5f80fd5b348015610200575f80fd5b5061021461020f366004611c25565b61063b565b60405190151581526020015b60405180910390f35b348015610234575f80fd5b5061023d6106a7565b005b34801561024a575f80fd5b506102536106c3565b6040516102209190611c75565b34801561026b575f80fd5b5061027f61027a366004611c87565b610753565b6040516001600160a01b039091168152602001610220565b3480156102a2575f80fd5b5061023d6102b1366004611cb2565b6107e3565b3480156102c1575f80fd5b50600b546102149060ff1681565b3480156102da575f80fd5b506004545b604051908152602001610220565b3480156102f8575f80fd5b5061023d610307366004611cdc565b6108f9565b348015610317575f80fd5b506102df610326366004611cb2565b61092a565b348015610336575f80fd5b5061023d6109e8565b34801561034a575f80fd5b5061023d610359366004611cdc565b610a29565b348015610369575f80fd5b506102df610378366004611c87565b610a43565b348015610388575f80fd5b5061023d610397366004611c87565b610af1565b3480156103a7575f80fd5b5061023d6103b6366004611d1a565b610afe565b3480156103c6575f80fd5b5061027f6103d5366004611c87565b610b13565b3480156103e5575f80fd5b506102df6103f4366004611d88565b610b26565b348015610404575f80fd5b5061023d610bec565b348015610418575f80fd5b506102df610427366004611d88565b600d6020525f908152604090205481565b348015610443575f80fd5b506102df600a5481565b348015610458575f80fd5b5061023d610467366004611da3565b610bff565b348015610477575f80fd5b5061048b610486366004611d88565b610cf3565b6040516102209190611dd1565b3480156104a3575f80fd5b506007546001600160a01b031661027f565b3480156104c0575f80fd5b50610253610da2565b3480156104d4575f80fd5b506102df6104e3366004611d88565b6001600160a01b03165f908152600d602052604090205490565b61023d61050b366004611c87565b610db1565b34801561051b575f80fd5b5061023d61052a366004611e13565b610f5f565b34801561053a575f80fd5b5061023d610549366004611e57565b611022565b348015610559575f80fd5b50610253610568366004611c87565b61105a565b348015610578575f80fd5b506102df60095481565b34801561058d575f80fd5b506102df60085481565b3480156105a2575f80fd5b5061023d6105b1366004611da3565b6110b6565b3480156105c1575f80fd5b506102146105d0366004611f38565b6001600160a01b039182165f90815260066020908152604080832093909416825291909152205460ff1690565b348015610608575f80fd5b5061023d610617366004611d88565b611183565b348015610627575f80fd5b5061023d610636366004611c87565b6111f9565b5f6001600160e01b031982166380ac58cd60e01b148061066b57506001600160e01b03198216635b5e139f60e01b145b8061068657506001600160e01b0319821663780e9d6360e01b145b806106a157506301ffc9a760e01b6001600160e01b03198316145b92915050565b6106af611206565b600b805460ff19811660ff90911615179055565b6060600180546106d290611f64565b80601f01602080910402602001604051908101604052809291908181526020018280546106fe90611f64565b80156107495780601f1061072057610100808354040283529160200191610749565b820191905f5260205f20905b81548152906001019060200180831161072c57829003601f168201915b5050505050905090565b5f61075f826004541190565b6107c85760405162461bcd60e51b815260206004820152602f60248201527f4552433732315073693a20617070726f76656420717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b60648201526084015b60405180910390fd5b505f908152600560205260409020546001600160a01b031690565b5f6107ed82610b13565b9050806001600160a01b0316836001600160a01b03160361085c5760405162461bcd60e51b8152602060048201526024808201527f4552433732315073693a20617070726f76616c20746f2063757272656e74206f6044820152633bb732b960e11b60648201526084016107bf565b336001600160a01b0382161480610878575061087881336105d0565b6108ea5760405162461bcd60e51b815260206004820152603b60248201527f4552433732315073693a20617070726f76652063616c6c6572206973206e6f7460448201527f206f776e6572206e6f7220617070726f76656420666f7220616c6c000000000060648201526084016107bf565b6108f48383611260565b505050565b61090333826112cd565b61091f5760405162461bcd60e51b81526004016107bf90611f96565b6108f48383836113b9565b5f805f5b60045481101561099357610943816004541190565b8015610968575061095381610b13565b6001600160a01b0316856001600160a01b0316145b1561098b5783820361097d5791506106a19050565b8161098781611ffe565b9250505b60010161092e565b5060405162461bcd60e51b8152602060048201526024808201527f4552433732315073693a206f776e657220696e646578206f7574206f6620626f604482015263756e647360e01b60648201526084016107bf565b6109f0611206565b6007546040516001600160a01b03909116904780156108fc02915f818181858888f19350505050158015610a26573d5f803e3d5ffd5b50565b6108f483838360405180602001604052805f815250611022565b5f610a4d60045490565b8210610aa95760405162461bcd60e51b815260206004820152602560248201527f4552433732315073693a20676c6f62616c20696e646578206f7574206f6620626044820152646f756e647360d81b60648201526084016107bf565b5f805b600454811015610aea57610ac1816004541190565b15610ae257838203610ad4579392505050565b81610ade81611ffe565b9250505b600101610aac565b5050919050565b610af9611206565b600a55565b610b06611206565b600c6108f4828483612061565b5f80610b1e8361159e565b509392505050565b5f6001600160a01b038216610b935760405162461bcd60e51b815260206004820152602d60248201527f4552433732315073693a2062616c616e636520717565727920666f722074686560448201526c207a65726f206164647265737360981b60648201526084016107bf565b5f805b600454811015610be557610bab816004541190565b15610bdd57610bb981610b13565b6001600160a01b0316846001600160a01b031603610bdd57610bda82611ffe565b91505b600101610b96565b5092915050565b610bf4611206565b610bfd5f611635565b565b610c07611206565b5f8211610c565760405162461bcd60e51b815260206004820152601f60248201527f5769746864726177206d7573742062652067726561746572207468616e20300060448201526064016107bf565b47821115610c985760405162461bcd60e51b815260206004820152600f60248201526e082dadeeadce840e8dede40d0d2ced608b1b60448201526064016107bf565b5f816001600160a01b0316836040515f6040518083038185875af1925050503d805f8114610ce1576040519150601f19603f3d011682016040523d82523d5f602084013e610ce6565b606091505b50509050806108f4575f80fd5b60605f610cff83610b26565b9050805f03610d1d57604080515f8082526020820190925290610b1e565b5f8167ffffffffffffffff811115610d3757610d37611e43565b604051908082528060200260200182016040528015610d60578160200160208202803683370190505b5090505f5b82811015610b1e57610d77858261092a565b828281518110610d8957610d8961211b565b6020908102919091010152600101610d65565b50919050565b6060600280546106d290611f64565b600b5460ff16610e035760405162461bcd60e51b815260206004820152601c60248201527f53616c6573206d7573742062652061637469766520746f206d696e740000000060448201526064016107bf565b60085481610e1060045490565b610e1a919061212f565b1115610e685760405162461bcd60e51b815260206004820152601c60248201527f4e6f7420656e6f756768204e465473206c65667420746f206d696e740000000060448201526064016107bf565b3481600954610e779190612142565b1115610eb65760405162461bcd60e51b815260206004820152600e60248201526d09cdee840cadcdeeaced0408ae8d60931b60448201526064016107bf565b600a54335f908152600d6020526040902054610ed390839061212f565b1115610f315760405162461bcd60e51b815260206004820152602760248201527f596f7520616c7265616474206d696e74656420746865206d617820616c6c6f776044820152666564204e46547360c81b60648201526084016107bf565b335f908152600d602052604081208054839290610f4f90849061212f565b90915550610a2690503382611686565b336001600160a01b03831603610fb75760405162461bcd60e51b815260206004820152601c60248201527f4552433732315073693a20617070726f766520746f2063616c6c65720000000060448201526064016107bf565b335f8181526006602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b61102c33836112cd565b6110485760405162461bcd60e51b81526004016107bf90611f96565b6110548484848461169f565b50505050565b6060611067826004541190565b61108457604051630a14c4b560e41b815260040160405180910390fd5b600c61108f836116d4565b6040516020016110a0929190612159565b6040516020818303038152906040529050919050565b6110be611206565b600b5460ff166111105760405162461bcd60e51b815260206004820152601c60248201527f53616c6573206d7573742062652061637469766520746f206d696e740000000060448201526064016107bf565b6008548261111d60045490565b611127919061212f565b11156111755760405162461bcd60e51b815260206004820152601c60248201527f4e6f7420656e6f756768204e465473206c65667420746f204d696e740000000060448201526064016107bf565b61117f8183611686565b5050565b61118b611206565b6001600160a01b0381166111f05760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016107bf565b610a2681611635565b611201611206565b600955565b6007546001600160a01b03163314610bfd5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016107bf565b5f81815260056020526040902080546001600160a01b0319166001600160a01b038416908117909155819061129482610b13565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b5f6112d9826004541190565b61133d5760405162461bcd60e51b815260206004820152602f60248201527f4552433732315073693a206f70657261746f7220717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b60648201526084016107bf565b5f61134783610b13565b9050806001600160a01b0316846001600160a01b031614806113825750836001600160a01b031661137784610753565b6001600160a01b0316145b806113b157506001600160a01b038082165f9081526006602090815260408083209388168352929052205460ff165b949350505050565b5f806113c48361159e565b91509150846001600160a01b0316826001600160a01b03161461143e5760405162461bcd60e51b815260206004820152602c60248201527f4552433732315073693a207472616e73666572206f6620746f6b656e2074686160448201526b3a1034b9903737ba1037bbb760a11b60648201526084016107bf565b6001600160a01b0384166114a45760405162461bcd60e51b815260206004820152602760248201527f4552433732315073693a207472616e7366657220746f20746865207a65726f206044820152666164647265737360c81b60648201526084016107bf565b6114ae5f84611260565b5f6114ba84600161212f565b600881901c5f90815260208190526040902054909150600160ff1b60ff83161c161580156114e9575060045481105b1561151e575f81815260036020526040812080546001600160a01b0319166001600160a01b03891617905561151e90826117d1565b5f84815260036020526040902080546001600160a01b0319166001600160a01b038716179055818414611555576115555f856117d1565b83856001600160a01b0316876001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4505050505050565b5f806115ab836004541190565b61160c5760405162461bcd60e51b815260206004820152602c60248201527f4552433732315073693a206f776e657220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084016107bf565b611615836117fc565b5f818152600360205260409020546001600160a01b031694909350915050565b600780546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b61117f828260405180602001604052805f815250611807565b6116aa8484846113b9565b6116b884848460018561181d565b6110545760405162461bcd60e51b81526004016107bf906121e6565b6060815f036116fa5750506040805180820190915260018152600360fc1b602082015290565b815f5b8115611723578061170d81611ffe565b915061171c9050600a8361224f565b91506116fd565b5f8167ffffffffffffffff81111561173d5761173d611e43565b6040519080825280601f01601f191660200182016040528015611767576020820181803683370190505b5090505b84156113b15761177c600183612262565b9150611789600a86612275565b61179490603061212f565b60f81b8183815181106117a9576117a961211b565b60200101906001600160f81b03191690815f1a9053506117ca600a8661224f565b945061176b565b600881901c5f90815260209290925260409091208054600160ff1b60ff9093169290921c9091179055565b5f6106a18183611946565b6004546118148484611a3a565b6116b85f858386865b5f6001600160a01b0385163b1561193957506001835b61183d848661212f565b81101561193357604051630a85bd0160e11b81526001600160a01b0387169063150b7a02906118769033908b9086908990600401612288565b6020604051808303815f875af19250505080156118b0575060408051601f3d908101601f191682019092526118ad918101906122c4565b60015b61190b573d8080156118dd576040519150601f19603f3d011682016040523d82523d5f602084013e6118e2565b606091505b5080515f036119035760405162461bcd60e51b81526004016107bf906121e6565b805181602001fd5b82801561192857506001600160e01b03198116630a85bd0160e11b145b925050600101611833565b5061193d565b5060015b95945050505050565b600881901c5f8181526020849052604081205490919060ff808516919082181c80156119875761197581611b92565b60ff168203600884901b179350611a31565b5f83116119f35760405162461bcd60e51b815260206004820152603460248201527f4269744d6170733a205468652073657420626974206265666f7265207468652060448201527334b73232bc103237b2b9b713ba1032bc34b9ba1760611b60648201526084016107bf565b505f199091015f818152602086905260409020549091908015611a2c57611a1981611b92565b60ff0360ff16600884901b179350611a31565b611987565b50505092915050565b60045481611a985760405162461bcd60e51b815260206004820152602560248201527f4552433732315073693a207175616e74697479206d7573742062652067726561604482015264074657220360dc1b60648201526084016107bf565b6001600160a01b038316611afa5760405162461bcd60e51b815260206004820152602360248201527f4552433732315073693a206d696e7420746f20746865207a65726f206164647260448201526265737360e81b60648201526084016107bf565b8160045f828254611b0b919061212f565b90915550505f81815260036020526040812080546001600160a01b0319166001600160a01b038616179055611b4090826117d1565b805b611b4c838361212f565b8110156110545760405181906001600160a01b038616905f907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a4600101611b42565b5f60405180610120016040528061010081526020016122e0610100913960f87e818283848586878898a8b8c8d8e8f929395969799a9b9d9e9faaeb6bedeeff611bda85611bfb565b02901c81518110611bed57611bed61211b565b016020015160f81c92915050565b5f808211611c07575f80fd5b505f8190031690565b6001600160e01b031981168114610a26575f80fd5b5f60208284031215611c35575f80fd5b8135611c4081611c10565b9392505050565b5f81518084528060208401602086015e5f602082860101526020601f19601f83011685010191505092915050565b602081525f611c406020830184611c47565b5f60208284031215611c97575f80fd5b5035919050565b6001600160a01b0381168114610a26575f80fd5b5f8060408385031215611cc3575f80fd5b8235611cce81611c9e565b946020939093013593505050565b5f805f60608486031215611cee575f80fd5b8335611cf981611c9e565b92506020840135611d0981611c9e565b929592945050506040919091013590565b5f8060208385031215611d2b575f80fd5b823567ffffffffffffffff811115611d41575f80fd5b8301601f81018513611d51575f80fd5b803567ffffffffffffffff811115611d67575f80fd5b856020828401011115611d78575f80fd5b6020919091019590945092505050565b5f60208284031215611d98575f80fd5b8135611c4081611c9e565b5f8060408385031215611db4575f80fd5b823591506020830135611dc681611c9e565b809150509250929050565b602080825282518282018190525f918401906040840190835b81811015611e08578351835260209384019390920191600101611dea565b509095945050505050565b5f8060408385031215611e24575f80fd5b8235611e2f81611c9e565b915060208301358015158114611dc6575f80fd5b634e487b7160e01b5f52604160045260245ffd5b5f805f8060808587031215611e6a575f80fd5b8435611e7581611c9e565b93506020850135611e8581611c9e565b925060408501359150606085013567ffffffffffffffff811115611ea7575f80fd5b8501601f81018713611eb7575f80fd5b803567ffffffffffffffff811115611ed157611ed1611e43565b604051601f8201601f19908116603f0116810167ffffffffffffffff81118282101715611f0057611f00611e43565b604052818152828201602001891015611f17575f80fd5b816020840160208301375f6020838301015280935050505092959194509250565b5f8060408385031215611f49575f80fd5b8235611f5481611c9e565b91506020830135611dc681611c9e565b600181811c90821680611f7857607f821691505b602082108103610d9c57634e487b7160e01b5f52602260045260245ffd5b60208082526034908201527f4552433732315073693a207472616e736665722063616c6c6572206973206e6f6040820152731d081bdddb995c881b9bdc88185c1c1c9bdd995960621b606082015260800190565b634e487b7160e01b5f52601160045260245ffd5b5f6001820161200f5761200f611fea565b5060010190565b601f8211156108f457805f5260205f20601f840160051c8101602085101561203b5750805b601f840160051c820191505b8181101561205a575f8155600101612047565b5050505050565b67ffffffffffffffff83111561207957612079611e43565b61208d836120878354611f64565b83612016565b5f601f8411600181146120be575f85156120a75750838201355b5f19600387901b1c1916600186901b17835561205a565b5f83815260208120601f198716915b828110156120ed57868501358255602094850194600190920191016120cd565b5086821015612109575f1960f88860031b161c19848701351681555b505060018560011b0183555050505050565b634e487b7160e01b5f52603260045260245ffd5b808201808211156106a1576106a1611fea565b80820281158282048414176106a1576106a1611fea565b5f80845461216681611f64565b60018216801561217d5760018114612192576121bf565b60ff19831686528115158202860193506121bf565b875f5260205f205f5b838110156121b75781548882015260019091019060200161219b565b505081860193505b505050602f60f81b815283518060208601600184015e5f9101600101908152949350505050565b60208082526035908201527f4552433732315073693a207472616e7366657220746f206e6f6e20455243373260408201527418a932b1b2b4bb32b91034b6b83632b6b2b73a32b960591b606082015260800190565b634e487b7160e01b5f52601260045260245ffd5b5f8261225d5761225d61223b565b500490565b818103818111156106a1576106a1611fea565b5f826122835761228361223b565b500690565b6001600160a01b03858116825284166020820152604081018390526080606082018190525f906122ba90830184611c47565b9695505050505050565b5f602082840312156122d4575f80fd5b8151611c4081611c1056fe0001020903110a19042112290b311a3905412245134d2a550c5d32651b6d3a7506264262237d468514804e8d2b95569d0d495ea533a966b11c886eb93bc176c9071727374353637324837e9b47af86c7155181ad4fd18ed32c9096db57d59ee30e2e4a6a5f92a6be3498aae067ddb2eb1d5989b56fd7baf33ca0c2ee77e5caf7ff0810182028303840444c545c646c7425617c847f8c949c48a4a8b087b8c0c816365272829aaec650acd0d28fdad4e22d6991bd97dfdcea58b4d6f29fede4f6fe0f1f2f3f4b5b6b607b8b93a3a7b7bf357199c5abcfd9e168bcdee9b3f1ecf5fd1e3e5a7a8aa2b670c4ced8bbe8f0f4fc3d79a1c3cde7effb78cce6facbf9f8a2646970667358221220f5b23dcd96b9d0246dc00dd34776154ec0878172ba6ab50c721da3688ab4827a64736f6c634300081a0033

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004368747470733a2f2f697066732e696f2f697066732f516d51684e46553868654b4a353654457168715256795836706e5078696f31514e6f646657434d686779476375450000000000000000000000000000000000000000000000000000000000

-----Decoded View---------------
Arg [0] : _baseUri (string): https://ipfs.io/ipfs/QmQhNFU8heKJ56TEqhqRVyX6pnPxio1QNodfWCMhgyGcuE

-----Encoded View---------------
5 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000020
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000043
Arg [2] : 68747470733a2f2f697066732e696f2f697066732f516d51684e46553868654b
Arg [3] : 4a353654457168715256795836706e5078696f31514e6f646657434d68677947
Arg [4] : 6375450000000000000000000000000000000000000000000000000000000000


Loading...
Loading
Loading...
Loading
[ Download: CSV Export  ]
[ Download: CSV Export  ]

A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.