ETH Price: $2,584.28 (-2.76%)

Token

Pawn Bots Pool (BOTSp)
 

Overview

Max Total Supply

68 BOTSp

Holders

75

Total Transfers

-

Market

Onchain Market Cap

$0.00

Circulating Supply Market Cap

-

Other Info

Token Contract (WITH 18 Decimals)

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:
ERC721Pool

Compiler Version
v0.8.13+commit.abaa5c0e

Optimization Enabled:
Yes with 800 runs

Other Settings:
default evmVersion
File 1 of 10 : ERC721Pool.sol
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity >=0.8.4;

import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
import "./IERC721Pool.sol";

import "./ERC20Wnft.sol";

/// @title ERC721Pool
/// @author Hifi
contract ERC721Pool is IERC721Pool, ERC20Wnft {
    using EnumerableSet for EnumerableSet.UintSet;
    /// INTERNAL STORAGE ///

    /// @dev The asset token IDs held in the pool.
    EnumerableSet.UintSet internal holdings;

    /// CONSTRUCTOR ///

    constructor() ERC20Wnft() {
        // solhint-disable-previous-line no-empty-blocks
    }

    /// PUBLIC CONSTANT FUNCTIONS ///

    /// @inheritdoc IERC721Pool
    function holdingAt(uint256 index) external view override returns (uint256) {
        return holdings.at(index);
    }

    /// @inheritdoc IERC721Pool
    function holdingsLength() external view override returns (uint256) {
        return holdings.length();
    }

    /// PUBLIC NON-CONSTANT FUNCTIONS ///

    /// @inheritdoc IERC721Pool
    function deposit(uint256[] calldata ids) external override {
        if (ids.length == 0) {
            revert ERC721Pool__InsufficientIn();
        }
        for (uint256 i; i < ids.length; ) {
            uint256 id = ids[i];
            require(holdings.add(id));
            IERC721(asset).transferFrom(msg.sender, address(this), id);
            unchecked {
                ++i;
            }
        }
        _mint(msg.sender, ids.length * 10**18);
        emit Deposit(ids, msg.sender);
    }

    /// @inheritdoc IERC721Pool
    function withdraw(uint256[] calldata ids) public override {
        if (ids.length == 0) {
            revert ERC721Pool__InsufficientIn();
        }
        _burn(msg.sender, ids.length * 10**18);
        for (uint256 i; i < ids.length; ) {
            uint256 id = ids[i];
            require(holdings.remove(id));
            IERC721(asset).transferFrom(address(this), msg.sender, id);
            unchecked {
                ++i;
            }
        }
        emit Withdraw(ids, msg.sender);
    }

    /// @inheritdoc IERC721Pool
    function withdrawWithSignature(
        uint256[] calldata ids,
        uint256 deadline,
        bytes memory signature
    ) external override {
        permitInternal(ids.length * 10**18, deadline, signature);
        withdraw(ids);
    }
}

File 2 of 10 : IERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/IERC721.sol)

pragma solidity ^0.8.0;

import "../../utils/introspection/IERC165.sol";

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

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

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

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

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

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

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

    /**
     * @dev Transfers `tokenId` token from `from` to `to`.
     *
     * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721
     * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must
     * understand this adds an external call which potentially creates a reentrancy vulnerability.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external;

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

    /**
     * @dev Approve or remove `operator` as an operator for the caller.
     * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
     *
     * Requirements:
     *
     * - The `operator` cannot be the 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 3 of 10 : EnumerableSet.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/structs/EnumerableSet.sol)
// This file was procedurally generated from scripts/generate/templates/EnumerableSet.js.

pragma solidity ^0.8.0;

/**
 * @dev Library for managing
 * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
 * types.
 *
 * Sets have the following properties:
 *
 * - Elements are added, removed, and checked for existence in constant time
 * (O(1)).
 * - Elements are enumerated in O(n). No guarantees are made on the ordering.
 *
 * ```
 * contract Example {
 *     // Add the library methods
 *     using EnumerableSet for EnumerableSet.AddressSet;
 *
 *     // Declare a set state variable
 *     EnumerableSet.AddressSet private mySet;
 * }
 * ```
 *
 * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)
 * and `uint256` (`UintSet`) are supported.
 *
 * [WARNING]
 * ====
 * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure
 * unusable.
 * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.
 *
 * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an
 * array of EnumerableSet.
 * ====
 */
library EnumerableSet {
    // To implement this library for multiple types with as little code
    // repetition as possible, we write it in terms of a generic Set type with
    // bytes32 values.
    // The Set implementation uses private functions, and user-facing
    // implementations (such as AddressSet) are just wrappers around the
    // underlying Set.
    // This means that we can only create new EnumerableSets for types that fit
    // in bytes32.

    struct Set {
        // Storage of set values
        bytes32[] _values;
        // Position of the value in the `values` array, plus 1 because index 0
        // means a value is not in the set.
        mapping(bytes32 => uint256) _indexes;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function _add(Set storage set, bytes32 value) private returns (bool) {
        if (!_contains(set, value)) {
            set._values.push(value);
            // The value is stored at length-1, but we add 1 to all indexes
            // and use 0 as a sentinel value
            set._indexes[value] = set._values.length;
            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function _remove(Set storage set, bytes32 value) private returns (bool) {
        // We read and store the value's index to prevent multiple reads from the same storage slot
        uint256 valueIndex = set._indexes[value];

        if (valueIndex != 0) {
            // Equivalent to contains(set, value)
            // To delete an element from the _values array in O(1), we swap the element to delete with the last one in
            // the array, and then remove the last element (sometimes called as 'swap and pop').
            // This modifies the order of the array, as noted in {at}.

            uint256 toDeleteIndex = valueIndex - 1;
            uint256 lastIndex = set._values.length - 1;

            if (lastIndex != toDeleteIndex) {
                bytes32 lastValue = set._values[lastIndex];

                // Move the last value to the index where the value to delete is
                set._values[toDeleteIndex] = lastValue;
                // Update the index for the moved value
                set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex
            }

            // Delete the slot where the moved value was stored
            set._values.pop();

            // Delete the index for the deleted slot
            delete set._indexes[value];

            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function _contains(Set storage set, bytes32 value) private view returns (bool) {
        return set._indexes[value] != 0;
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function _length(Set storage set) private view returns (uint256) {
        return set._values.length;
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function _at(Set storage set, uint256 index) private view returns (bytes32) {
        return set._values[index];
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function _values(Set storage set) private view returns (bytes32[] memory) {
        return set._values;
    }

    // Bytes32Set

    struct Bytes32Set {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _add(set._inner, value);
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _remove(set._inner, value);
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {
        return _contains(set._inner, value);
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(Bytes32Set storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {
        return _at(set._inner, index);
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {
        bytes32[] memory store = _values(set._inner);
        bytes32[] memory result;

        /// @solidity memory-safe-assembly
        assembly {
            result := store
        }

        return result;
    }

    // AddressSet

    struct AddressSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(AddressSet storage set, address value) internal returns (bool) {
        return _add(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(AddressSet storage set, address value) internal returns (bool) {
        return _remove(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(AddressSet storage set, address value) internal view returns (bool) {
        return _contains(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(AddressSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(AddressSet storage set, uint256 index) internal view returns (address) {
        return address(uint160(uint256(_at(set._inner, index))));
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(AddressSet storage set) internal view returns (address[] memory) {
        bytes32[] memory store = _values(set._inner);
        address[] memory result;

        /// @solidity memory-safe-assembly
        assembly {
            result := store
        }

        return result;
    }

    // UintSet

    struct UintSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(UintSet storage set, uint256 value) internal returns (bool) {
        return _add(set._inner, bytes32(value));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(UintSet storage set, uint256 value) internal returns (bool) {
        return _remove(set._inner, bytes32(value));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(UintSet storage set, uint256 value) internal view returns (bool) {
        return _contains(set._inner, bytes32(value));
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(UintSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(UintSet storage set, uint256 index) internal view returns (uint256) {
        return uint256(_at(set._inner, index));
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(UintSet storage set) internal view returns (uint256[] memory) {
        bytes32[] memory store = _values(set._inner);
        uint256[] memory result;

        /// @solidity memory-safe-assembly
        assembly {
            result := store
        }

        return result;
    }
}

File 4 of 10 : IERC721Pool.sol
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity >=0.8.4;

/// @title IERC721Pool
/// @author Hifi
interface IERC721Pool {
    /// CUSTOM ERRORS ///

    error ERC721Pool__InsufficientIn();
    error ERC721Pool__InvalidTo();

    /// EVENTS ///

    /// @notice Emitted when NFTs are deposited and an equal amount of pool tokens are minted.
    /// @param ids The asset token IDs sent from the user's account to the pool.
    /// @param caller The caller of the function equal to msg.sender
    event Deposit(uint256[] ids, address caller);

    /// @notice Emitted when NFTs are withdrawn from the pool in exchange for an equal amount of pool tokens.
    /// @param ids The asset token IDs released from the pool.
    /// @param caller The caller of the function equal to msg.sender
    event Withdraw(uint256[] ids, address caller);

    /// CONSTANT FUNCTIONS ///

    /// @notice Returns the asset token ID held at index.
    /// @param index The index to check.
    function holdingAt(uint256 index) external view returns (uint256);

    /// @notice Returns the total number of asset token IDs held.
    function holdingsLength() external view returns (uint256);

    /// NON-CONSTANT FUNCTIONS ///

    /// @notice Deposit NFTs in exchange for an equivalent amount of pool tokens.
    ///
    /// @dev Emits a {Deposit} event.
    ///
    /// @dev Requirements:
    ///
    /// - The length of `ids` must be greater than zero.
    /// - The length of `ids` scaled to 18 decimals.
    /// - The address `to` must not be the zero address.
    ///
    /// @param ids The asset token IDs sent from the user's account to the pool.
    function deposit(uint256[] calldata ids) external;

    /// @notice Withdraw specified NFTs in exchange for an equivalent amount of pool tokens.
    ///
    /// @dev Emits a {Withdraw} event.
    ///
    /// @dev Requirements:
    ///
    /// - The length of `ids` must be greater than zero.
    /// - The length of `ids` scaled to 18 decimals.
    /// - The address `to` must not be the zero address.
    ///
    /// @param ids The asset token IDs to be released from the pool.
    function withdraw(uint256[] calldata ids) external;

    /// @notice Withdraw specified NFTs in exchange for an equivalent amount of pool tokens.
    ///
    /// @dev Emits a {Withdraw} event.
    ///
    /// @dev Requirements:
    /// - The `signature` must be a valid signed approval given by the caller to the ERC721Pool to spend pool tokens
    ///   equal to the length of the ids array for the given `deadline` and the caller's current nonce.
    /// - The length of `ids` must be greater than zero.
    /// - The length of `ids` scaled to 18 decimals.
    /// - The address `to` must not be the zero address.
    ///
    /// @param ids The asset token IDs to be released from the pool.
    /// @param deadline The deadline beyond which the signature is not valid anymore.
    /// @param signature The packed signature for ERC721Pool.
    function withdrawWithSignature(
        uint256[] calldata ids,
        uint256 deadline,
        bytes memory signature
    ) external;
}

File 5 of 10 : ERC20Wnft.sol
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity >=0.8.4;

import "./IERC20Wnft.sol";

/// @title ERC20Wnft
/// @author Hifi
contract ERC20Wnft is IERC20Wnft {
    /// PUBLIC STORAGE ///

    /// @inheritdoc IERC20
    uint256 public override totalSupply;

    /// @inheritdoc IERC20
    mapping(address => uint256) public override balanceOf;

    /// @inheritdoc IERC20
    mapping(address => mapping(address => uint256)) public override allowance;

    /// @inheritdoc IERC20Metadata
    string public override name;

    /// @inheritdoc IERC20Metadata
    string public override symbol;

    /// @inheritdoc IERC20Metadata
    uint8 public constant override decimals = 18;

    /// @dev version
    string public constant version = "1";

    /// @inheritdoc IERC20Permit
    bytes32 public override DOMAIN_SEPARATOR;
    // solhint-disable-previous-line var-name-mixedcase

    /// @inheritdoc IERC20Permit
    mapping(address => uint256) public override nonces;

    /// @dev keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)");
    bytes32 public constant PERMIT_TYPEHASH = 0x6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9;

    /// @inheritdoc IERC20Wnft
    address public override asset;

    /// @inheritdoc IERC20Wnft
    address public immutable override factory;

    /// CONSTRUCTOR ///

    constructor() {
        factory = msg.sender;
    }

    /// PUBLIC NON-CONSTANT FUNCTIONS ///

    /// @inheritdoc IERC20Wnft
    function initialize(
        string memory name_,
        string memory symbol_,
        address asset_
    ) public override {
        if (msg.sender != factory) {
            revert ERC20Wnft__Forbidden();
        }
        name = name_;
        symbol = symbol_;
        asset = asset_;

        uint256 chainId;
        assembly {
            // solhint-disable-previous-line no-inline-assembly
            chainId := chainid()
        }
        DOMAIN_SEPARATOR = keccak256(
            abi.encode(
                keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"),
                keccak256(bytes(name)),
                keccak256(bytes(version)),
                chainId,
                address(this)
            )
        );
        emit Initialize(name, symbol, asset);
    }

    /// @inheritdoc IERC20
    function approve(address spender, uint256 value) external override returns (bool) {
        _approve(msg.sender, spender, value);
        return true;
    }

    /// @inheritdoc IERC20
    function transfer(address to, uint256 value) external override returns (bool) {
        _transfer(msg.sender, to, value);
        return true;
    }

    /// @inheritdoc IERC20
    function transferFrom(
        address from,
        address to,
        uint256 value
    ) external override returns (bool) {
        if (allowance[from][msg.sender] != type(uint256).max) {
            allowance[from][msg.sender] = allowance[from][msg.sender] - value;
        }
        _transfer(from, to, value);
        return true;
    }

    /// @inheritdoc IERC20Permit
    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) public override {
        if (deadline < block.timestamp) {
            revert ERC20Wnft__PermitExpired();
        }
        bytes32 digest = keccak256(
            abi.encodePacked(
                "\x19\x01",
                DOMAIN_SEPARATOR,
                keccak256(abi.encode(PERMIT_TYPEHASH, owner, spender, value, nonces[owner]++, deadline))
            )
        );
        address recoveredAddress = ecrecover(digest, v, r, s);
        if (recoveredAddress == address(0) || recoveredAddress != owner) {
            revert ERC20Wnft__InvalidSignature();
        }
        _approve(owner, spender, value);
    }

    /// INTERNAL NON-CONSTANT FUNCTIONS ///

    function _mint(address to, uint256 value) internal {
        totalSupply = totalSupply + value;
        balanceOf[to] = balanceOf[to] + value;
        emit Transfer(address(0), to, value);
    }

    function _burn(address from, uint256 value) internal {
        balanceOf[from] = balanceOf[from] - value;
        totalSupply = totalSupply - value;
        emit Transfer(from, address(0), value);
    }

    /// @dev See the documentation for the public functions that call this internal function.
    function permitInternal(
        uint256 amount,
        uint256 deadline,
        bytes memory signature
    ) internal {
        if (signature.length > 0) {
            bytes32 r;
            bytes32 s;
            uint8 v;

            // solhint-disable-next-line no-inline-assembly
            assembly {
                r := mload(add(signature, 0x20))
                s := mload(add(signature, 0x40))
                v := byte(0, mload(add(signature, 0x60)))
            }
            permit(msg.sender, address(this), amount, deadline, v, r, s);
        }
    }

    function _approve(
        address owner,
        address spender,
        uint256 value
    ) private {
        allowance[owner][spender] = value;
        emit Approval(owner, spender, value);
    }

    function _transfer(
        address from,
        address to,
        uint256 value
    ) private {
        balanceOf[from] = balanceOf[from] - value;
        balanceOf[to] = balanceOf[to] + value;
        emit Transfer(from, to, value);
    }
}

File 6 of 10 : IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[EIP].
 *
 * Implementers can declare support of contract interfaces, which can then be
 * queried by others ({ERC165Checker}).
 *
 * For an implementation, see {ERC165}.
 */
interface 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 7 of 10 : IERC20Wnft.sol
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity >=0.8.4;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol";

/// @title IERC20Wnft
/// @author Hifi
interface IERC20Wnft is IERC20Permit, IERC20Metadata {
    /// CUSTOM ERRORS ///

    error ERC20Wnft__Forbidden();
    error ERC20Wnft__InvalidSignature();
    error ERC20Wnft__PermitExpired();

    /// EVENTS ///

    /// @notice Emitted when the contract is initialized.
    /// @param name The ERC-20 name of the vault.
    /// @param symbol The ERC-20 symbol of the vault.
    /// @param asset The underlying ERC-721 asset contract address.
    event Initialize(string name, string symbol, address indexed asset);

    /// CONSTANT FUNCTIONS ///

    /// @notice Returns the address of the underlying ERC-721 asset.
    function asset() external view returns (address);

    /// @notice Returns the factory contract address.
    function factory() external view returns (address);

    /// NON-CONSTANT FUNCTIONS ///

    /// @notice Initializes the contract with the given values.
    ///
    /// @dev Emits an {Initialize} event.
    ///
    /// @dev Requirements:
    /// - Can only be called by the factory.
    ///
    /// @param name The ERC-20 name of the vault.
    /// @param symbol The ERC-20 symbol of the vault.
    /// @param asset The underlying ERC-721 asset contract address.
    function initialize(
        string memory name,
        string memory symbol,
        address asset
    ) external;
}

File 8 of 10 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);

    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the amount of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves `amount` tokens from the caller's account to `to`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address to, uint256 amount) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `from` to `to` using the
     * allowance mechanism. `amount` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address from,
        address to,
        uint256 amount
    ) external returns (bool);
}

File 9 of 10 : IERC20Metadata.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";

/**
 * @dev Interface for the optional metadata functions from the ERC20 standard.
 *
 * _Available since v4.1._
 */
interface IERC20Metadata is IERC20 {
    /**
     * @dev Returns the name of the token.
     */
    function name() external view returns (string memory);

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

    /**
     * @dev Returns the decimals places of the token.
     */
    function decimals() external view returns (uint8);
}

File 10 of 10 : draft-IERC20Permit.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
 * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
 *
 * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
 * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
 * need to send a transaction, and thus is not required to hold Ether at all.
 */
interface IERC20Permit {
    /**
     * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
     * given ``owner``'s signed approval.
     *
     * IMPORTANT: The same issues {IERC20-approve} has related to transaction
     * ordering also apply here.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `deadline` must be a timestamp in the future.
     * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
     * over the EIP712-formatted function arguments.
     * - the signature must use ``owner``'s current nonce (see {nonces}).
     *
     * For more information on the signature format, see the
     * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
     * section].
     */
    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;

    /**
     * @dev Returns the current nonce for `owner`. This value must be
     * included whenever a signature is generated for {permit}.
     *
     * Every successful call to {permit} increases ``owner``'s nonce by one. This
     * prevents a signature from being used multiple times.
     */
    function nonces(address owner) external view returns (uint256);

    /**
     * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
     */
    // solhint-disable-next-line func-name-mixedcase
    function DOMAIN_SEPARATOR() external view returns (bytes32);
}

Settings
{
  "metadata": {
    "bytecodeHash": "none"
  },
  "optimizer": {
    "enabled": true,
    "runs": 800
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ERC20Wnft__Forbidden","type":"error"},{"inputs":[],"name":"ERC20Wnft__InvalidSignature","type":"error"},{"inputs":[],"name":"ERC20Wnft__PermitExpired","type":"error"},{"inputs":[],"name":"ERC721Pool__InsufficientIn","type":"error"},{"inputs":[],"name":"ERC721Pool__InvalidTo","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"indexed":false,"internalType":"address","name":"caller","type":"address"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"name","type":"string"},{"indexed":false,"internalType":"string","name":"symbol","type":"string"},{"indexed":true,"internalType":"address","name":"asset","type":"address"}],"name":"Initialize","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"indexed":false,"internalType":"address","name":"caller","type":"address"}],"name":"Withdraw","type":"event"},{"inputs":[],"name":"DOMAIN_SEPARATOR","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PERMIT_TYPEHASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"asset","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"ids","type":"uint256[]"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"factory","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"holdingAt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"holdingsLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"name_","type":"string"},{"internalType":"string","name":"symbol_","type":"string"},{"internalType":"address","name":"asset_","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"nonces","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"permit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"version","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"ids","type":"uint256[]"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"withdrawWithSignature","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60a060405234801561001057600080fd5b50336080526080516115ff61003760003960008181610348015261044901526115ff6000f3fe608060405234801561001057600080fd5b50600436106101825760003560e01c806370a08231116100d8578063a9059cbb1161008c578063d505accf11610066578063d505accf1461036a578063dd62ed3e1461037d578063e037a2c7146103a857600080fd5b8063a9059cbb1461031d578063afee80d914610330578063c45a01551461034357600080fd5b806391c03b1b116100bd57806391c03b1b146102ef57806395d89b4114610302578063983d95ce1461030a57600080fd5b806370a08231146102af5780637ecebe00146102cf57600080fd5b806330adf81f1161013a57806338d52e0f1161011457806338d52e0f1461025157806354fd4d501461027c578063598b8e711461029c57600080fd5b806330adf81f14610207578063313ce5671461022e5780633644e5151461024857600080fd5b8063095ea7b31161016b578063095ea7b3146101ba57806318160ddd146101dd57806323b872dd146101f457600080fd5b806306fdde0314610187578063077f224a146101a5575b600080fd5b61018f6103b0565b60405161019c9190610fa7565b60405180910390f35b6101b86101b33660046110c4565b61043e565b005b6101cd6101c8366004611138565b6105e0565b604051901515815260200161019c565b6101e660005481565b60405190815260200161019c565b6101cd610202366004611162565b6105f7565b6101e67f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b610236601281565b60405160ff909116815260200161019c565b6101e660055481565b600754610264906001600160a01b031681565b6040516001600160a01b03909116815260200161019c565b61018f604051806040016040528060018152602001603160f81b81525081565b6101b86102aa3660046111ea565b61068c565b6101e66102bd36600461122c565b60016020526000908152604090205481565b6101e66102dd36600461122c565b60066020526000908152604090205481565b6101b86102fd366004611247565b6107c4565b61018f6107f0565b6101b86103183660046111ea565b6107fd565b6101cd61032b366004611138565b610929565b6101e661033e3660046112ce565b610936565b6102647f000000000000000000000000000000000000000000000000000000000000000081565b6101b86103783660046112e7565b610943565b6101e661038b36600461135a565b600260209081526000928352604080842090915290825290205481565b6101e6610b04565b600380546103bd9061138d565b80601f01602080910402602001604051908101604052809291908181526020018280546103e99061138d565b80156104365780601f1061040b57610100808354040283529160200191610436565b820191906000526020600020905b81548152906001019060200180831161041957829003601f168201915b505050505081565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161461048757604051632dc9a2c560e11b815260040160405180910390fd5b825161049a906003906020860190610f0e565b5081516104ae906004906020850190610f0e565b50600780547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b03831617905560405146907f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f90610515906003906113c7565b60408051918290038220828201825260018352603160f81b6020938401528151928301939093528101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc66060820152608081018290523060a082015260c00160408051601f198184030181529082905280516020909101206005556007546001600160a01b0316907f1ad5258fd94fd6ce147b9bf86c9fa73f75ad24a4838ae307465cb85e4f88a892906105d2906003906004906114b0565b60405180910390a250505050565b60006105ed338484610b15565b5060015b92915050565b6001600160a01b038316600090815260026020908152604080832033845290915281205460001914610677576001600160a01b03841660009081526002602090815260408083203384529091529020546106529083906114f4565b6001600160a01b03851660009081526002602090815260408083203384529091529020555b610682848484610b77565b5060019392505050565b60008190036106ae5760405163251e5fcb60e11b815260040160405180910390fd5b60005b818110156107695760008383838181106106cd576106cd61150b565b9050602002013590506106ea816008610c1f90919063ffffffff16565b6106f357600080fd5b6007546040516323b872dd60e01b8152336004820152306024820152604481018390526001600160a01b03909116906323b872dd90606401600060405180830381600087803b15801561074557600080fd5b505af1158015610759573d6000803e3d6000fd5b50505050816001019150506106b1565b506107853361078083670de0b6b3a7640000611521565b610c32565b7f42b71104669d6b9b0ed0596b13bf72373d2139566545df2b53b72931c69657158282336040516107b893929190611540565b60405180910390a15050565b6107e06107d984670de0b6b3a7640000611521565b8383610cc3565b6107ea84846107fd565b50505050565b600480546103bd9061138d565b600081900361081f5760405163251e5fcb60e11b815260040160405180910390fd5b61083a3361083583670de0b6b3a7640000611521565b610cf4565b60005b818110156108f55760008383838181106108595761085961150b565b905060200201359050610876816008610d8090919063ffffffff16565b61087f57600080fd5b6007546040516323b872dd60e01b8152306004820152336024820152604481018390526001600160a01b03909116906323b872dd90606401600060405180830381600087803b1580156108d157600080fd5b505af11580156108e5573d6000803e3d6000fd5b505050508160010191505061083d565b507f7bba1845c3eeae05ee144781cd5e90a7f295e8e097186d1ca50d2fd3c78ae9148282336040516107b893929190611540565b60006105ed338484610b77565b60006105f1600883610d8c565b4284101561096457604051639436330960e01b815260040160405180910390fd5b6005546001600160a01b038816600090815260066020526040812080549192917f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9918b918b918b9190876109b7836115ab565b909155506040805160208101969096526001600160a01b0394851690860152929091166060840152608083015260a082015260c0810187905260e00160405160208183030381529060405280519060200120604051602001610a3092919061190160f01b81526002810192909252602282015260420190565b60408051601f198184030181528282528051602091820120600080855291840180845281905260ff88169284019290925260608301869052608083018590529092509060019060a0016020604051602081039080840390855afa158015610a9b573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381161580610ad05750886001600160a01b0316816001600160a01b031614155b15610aee5760405163068d22f760e11b815260040160405180910390fd5b610af9898989610b15565b505050505050505050565b6000610b106008610d98565b905090565b6001600160a01b0383811660008181526002602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b6001600160a01b038316600090815260016020526040902054610b9b9082906114f4565b6001600160a01b038085166000908152600160205260408082209390935590841681522054610bcb9082906115c4565b6001600160a01b0380841660008181526001602052604090819020939093559151908516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90610b6a9085815260200190565b6000610c2b8383610da2565b9392505050565b80600054610c4091906115c4565b60009081556001600160a01b038316815260016020526040902054610c669082906115c4565b6001600160a01b0383166000818152600160205260408082209390935591519091907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90610cb79085815260200190565b60405180910390a35050565b805115610cef5760208101516040820151606083015160001a610ceb33308888858888610943565b5050505b505050565b6001600160a01b038216600090815260016020526040902054610d189082906114f4565b6001600160a01b03831660009081526001602052604081209190915554610d409082906114f4565b60009081556040518281526001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90602001610cb7565b6000610c2b8383610df1565b6000610c2b8383610ee4565b60006105f1825490565b6000818152600183016020526040812054610de9575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556105f1565b5060006105f1565b60008181526001830160205260408120548015610eda576000610e156001836114f4565b8554909150600090610e29906001906114f4565b9050818114610e8e576000866000018281548110610e4957610e4961150b565b9060005260206000200154905080876000018481548110610e6c57610e6c61150b565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080610e9f57610e9f6115dc565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506105f1565b60009150506105f1565b6000826000018281548110610efb57610efb61150b565b9060005260206000200154905092915050565b828054610f1a9061138d565b90600052602060002090601f016020900481019282610f3c5760008555610f82565b82601f10610f5557805160ff1916838001178555610f82565b82800160010185558215610f82579182015b82811115610f82578251825591602001919060010190610f67565b50610f8e929150610f92565b5090565b5b80821115610f8e5760008155600101610f93565b600060208083528351808285015260005b81811015610fd457858101830151858201604001528201610fb8565b81811115610fe6576000604083870101525b50601f01601f1916929092016040019392505050565b634e487b7160e01b600052604160045260246000fd5b600067ffffffffffffffff8084111561102d5761102d610ffc565b604051601f8501601f19908116603f0116810190828211818310171561105557611055610ffc565b8160405280935085815286868601111561106e57600080fd5b858560208301376000602087830101525050509392505050565b600082601f83011261109957600080fd5b610c2b83833560208501611012565b80356001600160a01b03811681146110bf57600080fd5b919050565b6000806000606084860312156110d957600080fd5b833567ffffffffffffffff808211156110f157600080fd5b6110fd87838801611088565b9450602086013591508082111561111357600080fd5b5061112086828701611088565b92505061112f604085016110a8565b90509250925092565b6000806040838503121561114b57600080fd5b611154836110a8565b946020939093013593505050565b60008060006060848603121561117757600080fd5b611180846110a8565b925061118e602085016110a8565b9150604084013590509250925092565b60008083601f8401126111b057600080fd5b50813567ffffffffffffffff8111156111c857600080fd5b6020830191508360208260051b85010111156111e357600080fd5b9250929050565b600080602083850312156111fd57600080fd5b823567ffffffffffffffff81111561121457600080fd5b6112208582860161119e565b90969095509350505050565b60006020828403121561123e57600080fd5b610c2b826110a8565b6000806000806060858703121561125d57600080fd5b843567ffffffffffffffff8082111561127557600080fd5b6112818883890161119e565b90965094506020870135935060408701359150808211156112a157600080fd5b508501601f810187136112b357600080fd5b6112c287823560208401611012565b91505092959194509250565b6000602082840312156112e057600080fd5b5035919050565b600080600080600080600060e0888a03121561130257600080fd5b61130b886110a8565b9650611319602089016110a8565b95506040880135945060608801359350608088013560ff8116811461133d57600080fd5b9699959850939692959460a0840135945060c09093013592915050565b6000806040838503121561136d57600080fd5b611376836110a8565b9150611384602084016110a8565b90509250929050565b600181811c908216806113a157607f821691505b6020821081036113c157634e487b7160e01b600052602260045260246000fd5b50919050565b60008083546113d58161138d565b600182811680156113ed57600181146113fe5761142d565b60ff1984168752828701945061142d565b8760005260208060002060005b858110156114245781548a82015290840190820161140b565b50505082870194505b50929695505050505050565b600081546114468161138d565b8085526020600183811680156114635760018114611477576114a5565b60ff198516888401526040880195506114a5565b866000528260002060005b8581101561149d5781548a8201860152908301908401611482565b890184019650505b505050505092915050565b6040815260006114c36040830185611439565b82810360208401526114d58185611439565b95945050505050565b634e487b7160e01b600052601160045260246000fd5b600082821015611506576115066114de565b500390565b634e487b7160e01b600052603260045260246000fd5b600081600019048311821515161561153b5761153b6114de565b500290565b6040815282604082015260007f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff84111561157957600080fd5b8360051b80866060850137606081840101905060008152809150506001600160a01b0383166020830152949350505050565b6000600182016115bd576115bd6114de565b5060010190565b600082198211156115d7576115d76114de565b500190565b634e487b7160e01b600052603160045260246000fdfea164736f6c634300080d000a

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101825760003560e01c806370a08231116100d8578063a9059cbb1161008c578063d505accf11610066578063d505accf1461036a578063dd62ed3e1461037d578063e037a2c7146103a857600080fd5b8063a9059cbb1461031d578063afee80d914610330578063c45a01551461034357600080fd5b806391c03b1b116100bd57806391c03b1b146102ef57806395d89b4114610302578063983d95ce1461030a57600080fd5b806370a08231146102af5780637ecebe00146102cf57600080fd5b806330adf81f1161013a57806338d52e0f1161011457806338d52e0f1461025157806354fd4d501461027c578063598b8e711461029c57600080fd5b806330adf81f14610207578063313ce5671461022e5780633644e5151461024857600080fd5b8063095ea7b31161016b578063095ea7b3146101ba57806318160ddd146101dd57806323b872dd146101f457600080fd5b806306fdde0314610187578063077f224a146101a5575b600080fd5b61018f6103b0565b60405161019c9190610fa7565b60405180910390f35b6101b86101b33660046110c4565b61043e565b005b6101cd6101c8366004611138565b6105e0565b604051901515815260200161019c565b6101e660005481565b60405190815260200161019c565b6101cd610202366004611162565b6105f7565b6101e67f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b610236601281565b60405160ff909116815260200161019c565b6101e660055481565b600754610264906001600160a01b031681565b6040516001600160a01b03909116815260200161019c565b61018f604051806040016040528060018152602001603160f81b81525081565b6101b86102aa3660046111ea565b61068c565b6101e66102bd36600461122c565b60016020526000908152604090205481565b6101e66102dd36600461122c565b60066020526000908152604090205481565b6101b86102fd366004611247565b6107c4565b61018f6107f0565b6101b86103183660046111ea565b6107fd565b6101cd61032b366004611138565b610929565b6101e661033e3660046112ce565b610936565b6102647f000000000000000000000000b67dc4b5a296c3068e8eec16f02cdae4c9a255e581565b6101b86103783660046112e7565b610943565b6101e661038b36600461135a565b600260209081526000928352604080842090915290825290205481565b6101e6610b04565b600380546103bd9061138d565b80601f01602080910402602001604051908101604052809291908181526020018280546103e99061138d565b80156104365780601f1061040b57610100808354040283529160200191610436565b820191906000526020600020905b81548152906001019060200180831161041957829003601f168201915b505050505081565b336001600160a01b037f000000000000000000000000b67dc4b5a296c3068e8eec16f02cdae4c9a255e5161461048757604051632dc9a2c560e11b815260040160405180910390fd5b825161049a906003906020860190610f0e565b5081516104ae906004906020850190610f0e565b50600780547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b03831617905560405146907f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f90610515906003906113c7565b60408051918290038220828201825260018352603160f81b6020938401528151928301939093528101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc66060820152608081018290523060a082015260c00160408051601f198184030181529082905280516020909101206005556007546001600160a01b0316907f1ad5258fd94fd6ce147b9bf86c9fa73f75ad24a4838ae307465cb85e4f88a892906105d2906003906004906114b0565b60405180910390a250505050565b60006105ed338484610b15565b5060015b92915050565b6001600160a01b038316600090815260026020908152604080832033845290915281205460001914610677576001600160a01b03841660009081526002602090815260408083203384529091529020546106529083906114f4565b6001600160a01b03851660009081526002602090815260408083203384529091529020555b610682848484610b77565b5060019392505050565b60008190036106ae5760405163251e5fcb60e11b815260040160405180910390fd5b60005b818110156107695760008383838181106106cd576106cd61150b565b9050602002013590506106ea816008610c1f90919063ffffffff16565b6106f357600080fd5b6007546040516323b872dd60e01b8152336004820152306024820152604481018390526001600160a01b03909116906323b872dd90606401600060405180830381600087803b15801561074557600080fd5b505af1158015610759573d6000803e3d6000fd5b50505050816001019150506106b1565b506107853361078083670de0b6b3a7640000611521565b610c32565b7f42b71104669d6b9b0ed0596b13bf72373d2139566545df2b53b72931c69657158282336040516107b893929190611540565b60405180910390a15050565b6107e06107d984670de0b6b3a7640000611521565b8383610cc3565b6107ea84846107fd565b50505050565b600480546103bd9061138d565b600081900361081f5760405163251e5fcb60e11b815260040160405180910390fd5b61083a3361083583670de0b6b3a7640000611521565b610cf4565b60005b818110156108f55760008383838181106108595761085961150b565b905060200201359050610876816008610d8090919063ffffffff16565b61087f57600080fd5b6007546040516323b872dd60e01b8152306004820152336024820152604481018390526001600160a01b03909116906323b872dd90606401600060405180830381600087803b1580156108d157600080fd5b505af11580156108e5573d6000803e3d6000fd5b505050508160010191505061083d565b507f7bba1845c3eeae05ee144781cd5e90a7f295e8e097186d1ca50d2fd3c78ae9148282336040516107b893929190611540565b60006105ed338484610b77565b60006105f1600883610d8c565b4284101561096457604051639436330960e01b815260040160405180910390fd5b6005546001600160a01b038816600090815260066020526040812080549192917f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9918b918b918b9190876109b7836115ab565b909155506040805160208101969096526001600160a01b0394851690860152929091166060840152608083015260a082015260c0810187905260e00160405160208183030381529060405280519060200120604051602001610a3092919061190160f01b81526002810192909252602282015260420190565b60408051601f198184030181528282528051602091820120600080855291840180845281905260ff88169284019290925260608301869052608083018590529092509060019060a0016020604051602081039080840390855afa158015610a9b573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381161580610ad05750886001600160a01b0316816001600160a01b031614155b15610aee5760405163068d22f760e11b815260040160405180910390fd5b610af9898989610b15565b505050505050505050565b6000610b106008610d98565b905090565b6001600160a01b0383811660008181526002602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b6001600160a01b038316600090815260016020526040902054610b9b9082906114f4565b6001600160a01b038085166000908152600160205260408082209390935590841681522054610bcb9082906115c4565b6001600160a01b0380841660008181526001602052604090819020939093559151908516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90610b6a9085815260200190565b6000610c2b8383610da2565b9392505050565b80600054610c4091906115c4565b60009081556001600160a01b038316815260016020526040902054610c669082906115c4565b6001600160a01b0383166000818152600160205260408082209390935591519091907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90610cb79085815260200190565b60405180910390a35050565b805115610cef5760208101516040820151606083015160001a610ceb33308888858888610943565b5050505b505050565b6001600160a01b038216600090815260016020526040902054610d189082906114f4565b6001600160a01b03831660009081526001602052604081209190915554610d409082906114f4565b60009081556040518281526001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90602001610cb7565b6000610c2b8383610df1565b6000610c2b8383610ee4565b60006105f1825490565b6000818152600183016020526040812054610de9575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556105f1565b5060006105f1565b60008181526001830160205260408120548015610eda576000610e156001836114f4565b8554909150600090610e29906001906114f4565b9050818114610e8e576000866000018281548110610e4957610e4961150b565b9060005260206000200154905080876000018481548110610e6c57610e6c61150b565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080610e9f57610e9f6115dc565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506105f1565b60009150506105f1565b6000826000018281548110610efb57610efb61150b565b9060005260206000200154905092915050565b828054610f1a9061138d565b90600052602060002090601f016020900481019282610f3c5760008555610f82565b82601f10610f5557805160ff1916838001178555610f82565b82800160010185558215610f82579182015b82811115610f82578251825591602001919060010190610f67565b50610f8e929150610f92565b5090565b5b80821115610f8e5760008155600101610f93565b600060208083528351808285015260005b81811015610fd457858101830151858201604001528201610fb8565b81811115610fe6576000604083870101525b50601f01601f1916929092016040019392505050565b634e487b7160e01b600052604160045260246000fd5b600067ffffffffffffffff8084111561102d5761102d610ffc565b604051601f8501601f19908116603f0116810190828211818310171561105557611055610ffc565b8160405280935085815286868601111561106e57600080fd5b858560208301376000602087830101525050509392505050565b600082601f83011261109957600080fd5b610c2b83833560208501611012565b80356001600160a01b03811681146110bf57600080fd5b919050565b6000806000606084860312156110d957600080fd5b833567ffffffffffffffff808211156110f157600080fd5b6110fd87838801611088565b9450602086013591508082111561111357600080fd5b5061112086828701611088565b92505061112f604085016110a8565b90509250925092565b6000806040838503121561114b57600080fd5b611154836110a8565b946020939093013593505050565b60008060006060848603121561117757600080fd5b611180846110a8565b925061118e602085016110a8565b9150604084013590509250925092565b60008083601f8401126111b057600080fd5b50813567ffffffffffffffff8111156111c857600080fd5b6020830191508360208260051b85010111156111e357600080fd5b9250929050565b600080602083850312156111fd57600080fd5b823567ffffffffffffffff81111561121457600080fd5b6112208582860161119e565b90969095509350505050565b60006020828403121561123e57600080fd5b610c2b826110a8565b6000806000806060858703121561125d57600080fd5b843567ffffffffffffffff8082111561127557600080fd5b6112818883890161119e565b90965094506020870135935060408701359150808211156112a157600080fd5b508501601f810187136112b357600080fd5b6112c287823560208401611012565b91505092959194509250565b6000602082840312156112e057600080fd5b5035919050565b600080600080600080600060e0888a03121561130257600080fd5b61130b886110a8565b9650611319602089016110a8565b95506040880135945060608801359350608088013560ff8116811461133d57600080fd5b9699959850939692959460a0840135945060c09093013592915050565b6000806040838503121561136d57600080fd5b611376836110a8565b9150611384602084016110a8565b90509250929050565b600181811c908216806113a157607f821691505b6020821081036113c157634e487b7160e01b600052602260045260246000fd5b50919050565b60008083546113d58161138d565b600182811680156113ed57600181146113fe5761142d565b60ff1984168752828701945061142d565b8760005260208060002060005b858110156114245781548a82015290840190820161140b565b50505082870194505b50929695505050505050565b600081546114468161138d565b8085526020600183811680156114635760018114611477576114a5565b60ff198516888401526040880195506114a5565b866000528260002060005b8581101561149d5781548a8201860152908301908401611482565b890184019650505b505050505092915050565b6040815260006114c36040830185611439565b82810360208401526114d58185611439565b95945050505050565b634e487b7160e01b600052601160045260246000fd5b600082821015611506576115066114de565b500390565b634e487b7160e01b600052603260045260246000fd5b600081600019048311821515161561153b5761153b6114de565b500290565b6040815282604082015260007f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff84111561157957600080fd5b8360051b80866060850137606081840101905060008152809150506001600160a01b0383166020830152949350505050565b6000600182016115bd576115bd6114de565b5060010190565b600082198211156115d7576115d76114de565b500190565b634e487b7160e01b600052603160045260246000fdfea164736f6c634300080d000a

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.