ETH Price: $3,289.62 (+1.06%)
Gas: 5 Gwei

Contract

0x87dD90A95E43e7Ed649E7a2bE42113E9172aD844
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Bulk Withdraw176447572023-07-07 22:00:59385 days ago1688767259IN
0x87dD90A9...9172aD844
0 ETH0.0025049621.40974739
Bulk Withdraw176447432023-07-07 21:58:11385 days ago1688767091IN
0x87dD90A9...9172aD844
0 ETH0.0026417122.57855587
Bulk Withdraw176446612023-07-07 21:41:47385 days ago1688766107IN
0x87dD90A9...9172aD844
0 ETH0.0065451523.44488893
Bulk Withdraw176446542023-07-07 21:40:23385 days ago1688766023IN
0x87dD90A9...9172aD844
0 ETH0.0075922522.00973291
Bulk Withdraw176446502023-07-07 21:39:35385 days ago1688765975IN
0x87dD90A9...9172aD844
0 ETH0.0027156923.19046638
Bulk Withdraw176444192023-07-07 20:53:11385 days ago1688763191IN
0x87dD90A9...9172aD844
0 ETH0.0043008339.74451707
Bulk Deposit176444172023-07-07 20:52:47385 days ago1688763167IN
0x87dD90A9...9172aD844
0 ETH0.0051140739.96436128
Bulk Withdraw176443892023-07-07 20:47:11385 days ago1688762831IN
0x87dD90A9...9172aD844
0 ETH0.0056781348.69634066
Bulk Deposit176300012023-07-05 20:17:11387 days ago1688588231IN
0x87dD90A9...9172aD844
0 ETH0.0081682461.91910203
Bulk Deposit176299192023-07-05 20:00:47387 days ago1688587247IN
0x87dD90A9...9172aD844
0 ETH0.0517797154.10645888
Bulk Deposit176291512023-07-05 17:25:23387 days ago1688577923IN
0x87dD90A9...9172aD844
0 ETH0.0390956651.19270165
Bulk Deposit175308462023-06-21 21:55:35401 days ago1687384535IN
0x87dD90A9...9172aD844
0 ETH0.0025868419.48251817
Bulk Deposit175291102023-06-21 16:05:23401 days ago1687363523IN
0x87dD90A9...9172aD844
0 ETH0.0101175967.50553579
Bulk Withdraw175291082023-06-21 16:04:59401 days ago1687363499IN
0x87dD90A9...9172aD844
0 ETH0.0064912963.0639072
Bulk Deposit175290972023-06-21 16:02:47401 days ago1687363367IN
0x87dD90A9...9172aD844
0 ETH0.0101239967.54822322
Bulk Withdraw175290952023-06-21 16:02:23401 days ago1687363343IN
0x87dD90A9...9172aD844
0 ETH0.009492660.76356685
Bulk Deposit175290852023-06-21 16:00:23401 days ago1687363223IN
0x87dD90A9...9172aD844
0 ETH0.0041406431.18475178
Bulk Deposit175290302023-06-21 15:49:11401 days ago1687362551IN
0x87dD90A9...9172aD844
0 ETH0.0040426730.44683985
Bulk Deposit175237042023-06-20 21:54:11402 days ago1687298051IN
0x87dD90A9...9172aD844
0 ETH0.0021137214.10299721
Bulk Withdraw174736002023-06-13 20:59:23409 days ago1686689963IN
0x87dD90A9...9172aD844
0 ETH0.0017621915.1128168
Bulk Deposit174735862023-06-13 20:56:35409 days ago1686689795IN
0x87dD90A9...9172aD844
0 ETH0.0063326517.88742884
0x60806040174733682023-06-13 20:12:59409 days ago1686687179IN
 Create: PeripheralERC721Pool
0 ETH0.0098572215.30894351

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
PeripheralERC721Pool

Compiler Version
v0.8.13+commit.abaa5c0e

Optimization Enabled:
Yes with 800 runs

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

import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "./IPeripheralERC721Pool.sol";
import "./IERC721Pool.sol";

/// @title PeripheralERC721Pool
/// @author Hifi
contract PeripheralERC721Pool is IPeripheralERC721Pool {
    /// PUBLIC NON-CONSTANT FUNCTIONS ///

    /// @inheritdoc IPeripheralERC721Pool
    function bulkDeposit(IERC721Pool pool, uint256[] calldata ids) external override {
        // Checks: ids length must be greater than zero
        if (ids.length == 0) {
            revert PeripheralERC721Pool__InsufficientIn();
        }

        IERC721 erc721Asset = IERC721(pool.asset());

        // Effects: Approve the pool to transfer the NFTs.
        if (!erc721Asset.isApprovedForAll(address(this), address(pool)))
            erc721Asset.setApprovalForAll(address(pool), true);

        // `msg.sender` is the owner of the NFTs who will receive the pool tokens.
        for (uint256 i = 0; i < ids.length; ) {
            // Interactions: Transfer the NFTs from caller to this contract.
            // The transfer will revert if this contract is not approved to transfer the NFT.
            erc721Asset.transferFrom(msg.sender, address(this), ids[i]);

            // Effects: transfer NFTs from this contract to the pool and mint pool tokens to msg.sender.
            pool.deposit(ids[i], msg.sender);
            unchecked {
                ++i;
            }
        }

        emit BulkDeposit(address(pool), ids, msg.sender);
    }

    /// @inheritdoc IPeripheralERC721Pool
    function bulkWithdraw(IERC721Pool pool, uint256[] calldata ids) public override {
        uint256 idsLength = ids.length;

        withdrawInternal(pool, idsLength);

        for (uint256 i = 0; i < idsLength; ) {
            // `msg.sender` is the owner of the pool tokens who will receive the NFTs.
            // Effects: transfer NFTs from the pool to msg.sender in exchange for pool tokens.
            pool.withdraw(ids[i], msg.sender);
            unchecked {
                ++i;
            }
        }
        emit BulkWithdraw(address(pool), ids, msg.sender);
    }

    /// @inheritdoc IPeripheralERC721Pool
    function withdrawAvailable(IERC721Pool pool, uint256[] calldata ids) external override {
        uint256 idsLength = ids.length;

        withdrawInternal(pool, idsLength);

        uint256[] memory withdrawnIds = new uint256[](idsLength);
        uint256 withdrawnCount;
        for (uint256 i; i < idsLength; ) {
            // `msg.sender` is the owner of the pool tokens who will receive the NFTs.
            // Effects: transfer available NFTs from the pool to msg.sender in exchange for pool tokens
            if (pool.holdingContains(ids[i])) {
                pool.withdraw(ids[i], msg.sender);
                withdrawnIds[withdrawnCount] = ids[i];
                withdrawnCount++;
            }
            unchecked {
                ++i;
            }
        }

        if (withdrawnCount == 0) {
            revert PeripheralERC721Pool__NoNFTsWithdrawn();
        }

        // Resize the withdrawnIds array to fit the actual number of withdrawn NFTs
        assembly {
            mstore(withdrawnIds, withdrawnCount)
        }
        pool.transfer(msg.sender, (idsLength - withdrawnCount) * 10**18);
        emit WithdrawAvailable(address(pool), withdrawnIds, msg.sender);
    }

    /// @dev See the documentation for the public functions that call this internal function.
    function withdrawInternal(IERC721Pool pool, uint256 idsLength) internal {
        // Checks: ids length must be greater than zero
        if (idsLength == 0) {
            revert PeripheralERC721Pool__InsufficientIn();
        }

        // Checks: The caller must have allowed this contract to transfer the pool tokens.
        if (pool.allowance(msg.sender, address(this)) < idsLength * 10**18)
            revert PeripheralERC721Pool__UnapprovedOperator();

        // Interactions: Transfer the pool token from caller to this contract.
        pool.transferFrom(msg.sender, address(this), idsLength * 10**18);
    }
}

File 2 of 9 : 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 9 : IPeripheralERC721Pool.sol
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity >=0.8.4;

import "./IERC721Pool.sol";

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

    error PeripheralERC721Pool__InsufficientIn();
    error PeripheralERC721Pool__NoNFTsWithdrawn();
    error PeripheralERC721Pool__UnapprovedOperator();

    /// EVENTS ///

    /// @notice Emitted when NFTs are deposited in exchange for an equivalent amount of pool tokens.
    /// @param pool The address of the pool.
    /// @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 BulkDeposit(address pool, uint256[] ids, address caller);

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

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

    /// CONSTANT FUNCTIONS ///

    // /// @notice The address of the pool.
    // function pool() external view returns (address);

    /// 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 caller must have allowed the pool to transfer the NFTs.
    /// - The address `beneficiary` must not be the zero address.
    ///
    /// @param pool The address of the pool.
    /// @param ids The asset token IDs sent from the user's account to the pool.
    function bulkDeposit(IERC721Pool pool, 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 caller must have allowed the PeripheralERC721Pool to transfer the pool tokens by calling
    ///   `approve()` on the pool token contract with sufficient allowance before calling this function.
    ///
    /// @param pool The address of the pool.
    /// @param ids The asset token IDs to be released from the pool.
    function bulkWithdraw(IERC721Pool pool, uint256[] calldata ids) external;

    /// @notice Withdraw specified available non-overlapping NFTs in exchange for an equivalent amount of pool tokens.
    ///
    /// @dev Emits a {WithdrawAvailable} event.
    ///
    /// @dev Requirements:
    ///
    /// - The length of `ids` must be greater than zero.
    /// - The caller must have allowed the PeripheralERC721Pool to transfer the pool tokens.
    /// - The address `beneficiary` must not be the zero address.
    ///
    /// @param pool The address of the pool.
    /// @param ids The asset token IDs to be released from the pool.
    function withdrawAvailable(IERC721Pool pool, uint256[] calldata ids) external;
}

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

import "./IERC20Wnft.sol";

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

    error ERC721Pool__CallerNotFactory(address factory, address caller);
    error ERC721Pool__MustContainExactlyOneNFT();
    error ERC721Pool__PoolFrozen();
    error ERC721Pool__NFTAlreadyInPool(uint256 id);
    error ERC721Pool__NFTNotFoundInPool(uint256 id);
    error ERC721Pool__ZeroAddress();

    /// EVENTS ///

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

    /// @notice Emitted when the last NFT of a pool is rescued.
    /// @param lastNFT The last NFT of the pool.
    /// @param to The address to which the NFT was sent.
    event RescueLastNFT(uint256 lastNFT, address to);

    /// @notice Emitted when NFT are withdrawn from the pool in exchange for an equal amount of pool tokens.
    /// @param id The asset token IDs released from the pool.
    /// @param beneficiary The address to receive the NFT.
    /// @param caller The caller of the function equal to msg.sender.
    event Withdraw(uint256 id, address beneficiary, 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 true if the asset token ID is held in the pool.
    /// @param id The asset token ID to check.
    function holdingContains(uint256 id) external view returns (bool);

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

    /// @notice A boolean flag indicating whether the pool is frozen.
    function poolFrozen() external view returns (bool);

    /// NON-CONSTANT FUNCTIONS ///

    /// @notice Deposit NFT in exchange for an equivalent amount of pool tokens.
    ///
    /// @dev Emits a {Deposit} event.
    ///
    /// @dev Requirements:
    /// - The caller must have allowed the Pool to transfer the NFT.
    /// - The pool must not be frozen.
    /// - The address `beneficiary` must not be the zero address.
    ///
    /// @param id The asset token ID sent from the user's account to the pool.
    /// @param beneficiary The address to receive the pool tokens. Can be the caller themselves or any other address.
    function deposit(uint256 id, address beneficiary) external;

    /// @notice Allows the factory to rescue the last NFT in the pool and set the pool to frozen.
    ///
    /// Emits a {RescueLastNFT} event.
    ///
    /// @dev Requirements:
    /// - The caller must be the factory.
    /// - The pool must only hold one NFT.
    ///
    /// @param to The address to send the NFT to.
    function rescueLastNFT(address to) external;

    /// @notice Allows the factory to set the ENS name for the pool.
    ///
    /// Emits a {ENSNameSet} event.
    ///
    /// @dev Requirements:
    /// - The caller must be the factory.
    ///
    /// @param registrar The address of the ENS registrar.
    /// @param name The name to set.
    /// @return The ENS node hash.
    function setENSName(address registrar, string memory name) external returns (bytes32);

    /// @notice Withdraws a specified NFT in exchange for an equivalent amount of pool tokens.
    ///
    /// @dev Emits a {Withdraw} event.
    ///
    /// @dev Requirements:
    /// - The pool must not be frozen.
    /// - The address `beneficiary` must not be the zero address.
    /// - The specified NFT must be held in the pool.
    /// - The caller must hold the equivalent amount of pool tokens
    ///
    /// @param id The asset token ID to be released from the pool.
    /// @param beneficiary The address to receive the NFT. Can be the caller themselves or any other address.
    function withdraw(uint256 id, address beneficiary) external;
}

File 5 of 9 : 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 6 of 9 : 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.
    /// @param symbol The ERC-20 symbol.
    /// @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.
    /// @param symbol The ERC-20 symbol.
    /// @param asset The underlying ERC-721 asset contract address.
    function initialize(
        string memory name,
        string memory symbol,
        address asset
    ) external;
}

File 7 of 9 : 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 8 of 9 : 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 9 of 9 : 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":[],"name":"PeripheralERC721Pool__InsufficientIn","type":"error"},{"inputs":[],"name":"PeripheralERC721Pool__NoNFTsWithdrawn","type":"error"},{"inputs":[],"name":"PeripheralERC721Pool__UnapprovedOperator","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"pool","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"indexed":false,"internalType":"address","name":"caller","type":"address"}],"name":"BulkDeposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"pool","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"indexed":false,"internalType":"address","name":"caller","type":"address"}],"name":"BulkWithdraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"pool","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"withdrawnIds","type":"uint256[]"},{"indexed":false,"internalType":"address","name":"caller","type":"address"}],"name":"WithdrawAvailable","type":"event"},{"inputs":[{"internalType":"contract IERC721Pool","name":"pool","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"}],"name":"bulkDeposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC721Pool","name":"pool","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"}],"name":"bulkWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC721Pool","name":"pool","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"}],"name":"withdrawAvailable","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405234801561001057600080fd5b50610ab0806100206000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c80634a33dcb314610046578063a02e40bc1461005b578063b0dc75f01461006e575b600080fd5b610059610054366004610855565b610081565b005b610059610069366004610855565b61033a565b61005961007c366004610855565b61041e565b8061008c84826106dd565b60008167ffffffffffffffff8111156100a7576100a76108dd565b6040519080825280602002602001820160405280156100d0578160200160208202803683370190505b5090506000805b8381101561023657866001600160a01b031663a20e2915878784818110610100576101006108f3565b905060200201356040518263ffffffff1660e01b815260040161012591815260200190565b602060405180830381865afa158015610142573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101669190610909565b1561022e57866001600160a01b031662f714ce87878481811061018b5761018b6108f3565b6040516001600160e01b031960e086901b16815260209091029290920135600483015250336024820152604401600060405180830381600087803b1580156101d257600080fd5b505af11580156101e6573d6000803e3d6000fd5b505050508585828181106101fc576101fc6108f3565b90506020020135838381518110610215576102156108f3565b60209081029190910101528161022a81610948565b9250505b6001016100d7565b50806000036102585760405163612d548560e11b815260040160405180910390fd5b8082526001600160a01b03861663a9059cbb336102758487610961565b61028790670de0b6b3a7640000610978565b6040516001600160e01b031960e085901b1681526001600160a01b03909216600483015260248201526044016020604051808303816000875af11580156102d2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102f69190610909565b507f5398a745a5e07d60a5241d6f9ef5e40cf44aab8ff5a9326599331c66cf0d2f9f86833360405161032a93929190610997565b60405180910390a1505050505050565b8061034584826106dd565b60005b818110156103da57846001600160a01b031662f714ce858584818110610370576103706108f3565b6040516001600160e01b031960e086901b16815260209091029290920135600483015250336024820152604401600060405180830381600087803b1580156103b757600080fd5b505af11580156103cb573d6000803e3d6000fd5b50505050806001019050610348565b507f04612b16c645f940330585d7b7b8ccc7a4b89addb70b6d33e2b0b2e3680d3cd48484843360405161041094939291906109fb565b60405180910390a150505050565b6000819003610440576040516370eccded60e01b815260040160405180910390fd5b6000836001600160a01b03166338d52e0f6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610480573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104a49190610a6d565b60405163e985e9c560e01b81523060048201526001600160a01b0386811660248301529192509082169063e985e9c590604401602060405180830381865afa1580156104f4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105189190610909565b61057f5760405163a22cb46560e01b81526001600160a01b0385811660048301526001602483015282169063a22cb46590604401600060405180830381600087803b15801561056657600080fd5b505af115801561057a573d6000803e3d6000fd5b505050505b60005b828110156106a757816001600160a01b03166323b872dd33308787868181106105ad576105ad6108f3565b6040516001600160e01b031960e088901b1681526001600160a01b03958616600482015294909316602485015250602090910201356044820152606401600060405180830381600087803b15801561060457600080fd5b505af1158015610618573d6000803e3d6000fd5b50505050846001600160a01b0316636e553f6585858481811061063d5761063d6108f3565b6040516001600160e01b031960e086901b16815260209091029290920135600483015250336024820152604401600060405180830381600087803b15801561068457600080fd5b505af1158015610698573d6000803e3d6000fd5b50505050806001019050610582565b507f3d1fdf669377ccc5d73720d007a0d4350c3d1574c0b2af1ae5fc2629d294219b8484843360405161041094939291906109fb565b806000036106fe576040516370eccded60e01b815260040160405180910390fd5b61071081670de0b6b3a7640000610978565b604051636eb1769f60e11b81523360048201523060248201526001600160a01b0384169063dd62ed3e90604401602060405180830381865afa15801561075a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061077e9190610a8a565b101561079d57604051633f878d7960e11b815260040160405180910390fd5b6001600160a01b0382166323b872dd33306107c085670de0b6b3a7640000610978565b6040516001600160e01b031960e086901b1681526001600160a01b03938416600482015292909116602483015260448201526064016020604051808303816000875af1158015610814573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108389190610909565b505050565b6001600160a01b038116811461085257600080fd5b50565b60008060006040848603121561086a57600080fd5b83356108758161083d565b9250602084013567ffffffffffffffff8082111561089257600080fd5b818601915086601f8301126108a657600080fd5b8135818111156108b557600080fd5b8760208260051b85010111156108ca57600080fd5b6020830194508093505050509250925092565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b60006020828403121561091b57600080fd5b8151801515811461092b57600080fd5b9392505050565b634e487b7160e01b600052601160045260246000fd5b60006001820161095a5761095a610932565b5060010190565b60008282101561097357610973610932565b500390565b600081600019048311821515161561099257610992610932565b500290565b6000606082016001600160a01b0380871684526020606081860152828751808552608087019150828901945060005b818110156109e2578551835294830194918301916001016109c6565b5050809450505080851660408501525050949350505050565b60006001600160a01b038087168352606060208401528460608401527f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff851115610a4457600080fd5b8460051b8087608086013760009084016080019081529316604090920191909152509392505050565b600060208284031215610a7f57600080fd5b815161092b8161083d565b600060208284031215610a9c57600080fd5b505191905056fea164736f6c634300080d000a

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106100415760003560e01c80634a33dcb314610046578063a02e40bc1461005b578063b0dc75f01461006e575b600080fd5b610059610054366004610855565b610081565b005b610059610069366004610855565b61033a565b61005961007c366004610855565b61041e565b8061008c84826106dd565b60008167ffffffffffffffff8111156100a7576100a76108dd565b6040519080825280602002602001820160405280156100d0578160200160208202803683370190505b5090506000805b8381101561023657866001600160a01b031663a20e2915878784818110610100576101006108f3565b905060200201356040518263ffffffff1660e01b815260040161012591815260200190565b602060405180830381865afa158015610142573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101669190610909565b1561022e57866001600160a01b031662f714ce87878481811061018b5761018b6108f3565b6040516001600160e01b031960e086901b16815260209091029290920135600483015250336024820152604401600060405180830381600087803b1580156101d257600080fd5b505af11580156101e6573d6000803e3d6000fd5b505050508585828181106101fc576101fc6108f3565b90506020020135838381518110610215576102156108f3565b60209081029190910101528161022a81610948565b9250505b6001016100d7565b50806000036102585760405163612d548560e11b815260040160405180910390fd5b8082526001600160a01b03861663a9059cbb336102758487610961565b61028790670de0b6b3a7640000610978565b6040516001600160e01b031960e085901b1681526001600160a01b03909216600483015260248201526044016020604051808303816000875af11580156102d2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102f69190610909565b507f5398a745a5e07d60a5241d6f9ef5e40cf44aab8ff5a9326599331c66cf0d2f9f86833360405161032a93929190610997565b60405180910390a1505050505050565b8061034584826106dd565b60005b818110156103da57846001600160a01b031662f714ce858584818110610370576103706108f3565b6040516001600160e01b031960e086901b16815260209091029290920135600483015250336024820152604401600060405180830381600087803b1580156103b757600080fd5b505af11580156103cb573d6000803e3d6000fd5b50505050806001019050610348565b507f04612b16c645f940330585d7b7b8ccc7a4b89addb70b6d33e2b0b2e3680d3cd48484843360405161041094939291906109fb565b60405180910390a150505050565b6000819003610440576040516370eccded60e01b815260040160405180910390fd5b6000836001600160a01b03166338d52e0f6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610480573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104a49190610a6d565b60405163e985e9c560e01b81523060048201526001600160a01b0386811660248301529192509082169063e985e9c590604401602060405180830381865afa1580156104f4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105189190610909565b61057f5760405163a22cb46560e01b81526001600160a01b0385811660048301526001602483015282169063a22cb46590604401600060405180830381600087803b15801561056657600080fd5b505af115801561057a573d6000803e3d6000fd5b505050505b60005b828110156106a757816001600160a01b03166323b872dd33308787868181106105ad576105ad6108f3565b6040516001600160e01b031960e088901b1681526001600160a01b03958616600482015294909316602485015250602090910201356044820152606401600060405180830381600087803b15801561060457600080fd5b505af1158015610618573d6000803e3d6000fd5b50505050846001600160a01b0316636e553f6585858481811061063d5761063d6108f3565b6040516001600160e01b031960e086901b16815260209091029290920135600483015250336024820152604401600060405180830381600087803b15801561068457600080fd5b505af1158015610698573d6000803e3d6000fd5b50505050806001019050610582565b507f3d1fdf669377ccc5d73720d007a0d4350c3d1574c0b2af1ae5fc2629d294219b8484843360405161041094939291906109fb565b806000036106fe576040516370eccded60e01b815260040160405180910390fd5b61071081670de0b6b3a7640000610978565b604051636eb1769f60e11b81523360048201523060248201526001600160a01b0384169063dd62ed3e90604401602060405180830381865afa15801561075a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061077e9190610a8a565b101561079d57604051633f878d7960e11b815260040160405180910390fd5b6001600160a01b0382166323b872dd33306107c085670de0b6b3a7640000610978565b6040516001600160e01b031960e086901b1681526001600160a01b03938416600482015292909116602483015260448201526064016020604051808303816000875af1158015610814573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108389190610909565b505050565b6001600160a01b038116811461085257600080fd5b50565b60008060006040848603121561086a57600080fd5b83356108758161083d565b9250602084013567ffffffffffffffff8082111561089257600080fd5b818601915086601f8301126108a657600080fd5b8135818111156108b557600080fd5b8760208260051b85010111156108ca57600080fd5b6020830194508093505050509250925092565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b60006020828403121561091b57600080fd5b8151801515811461092b57600080fd5b9392505050565b634e487b7160e01b600052601160045260246000fd5b60006001820161095a5761095a610932565b5060010190565b60008282101561097357610973610932565b500390565b600081600019048311821515161561099257610992610932565b500290565b6000606082016001600160a01b0380871684526020606081860152828751808552608087019150828901945060005b818110156109e2578551835294830194918301916001016109c6565b5050809450505080851660408501525050949350505050565b60006001600160a01b038087168352606060208401528460608401527f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff851115610a4457600080fd5b8460051b8087608086013760009084016080019081529316604090920191909152509392505050565b600060208284031215610a7f57600080fd5b815161092b8161083d565b600060208284031215610a9c57600080fd5b505191905056fea164736f6c634300080d000a

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.