ETH Price: $3,313.30 (+1.27%)
Gas: 4 Gwei

Contract

0x5C8d7748bF07709D3adC3f74fa0255F9f358C8b1
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Append161991542022-12-16 18:49:11591 days ago1671216551IN
0x5C8d7748...9f358C8b1
0 ETH0.0009547416.56328222
Append161991482022-12-16 18:47:59591 days ago1671216479IN
0x5C8d7748...9f358C8b1
0 ETH0.0009829816.97909806
Append161656872022-12-12 2:36:59595 days ago1670812619IN
0x5C8d7748...9f358C8b1
0 ETH0.0007369912.73487674
Append160665062022-11-28 5:51:11609 days ago1669614671IN
0x5C8d7748...9f358C8b1
0 ETH0.0005949110.28372096
Append160323552022-11-23 11:19:59614 days ago1669202399IN
0x5C8d7748...9f358C8b1
0 ETH0.0006328510.93957424
Append160323512022-11-23 11:19:11614 days ago1669202351IN
0x5C8d7748...9f358C8b1
0 ETH0.0008700411.60831967
0x60806040160323502022-11-23 11:18:59614 days ago1669202339IN
 Create: DynamicTokenGate
0 ETH0.0064892311.55020754

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
DynamicTokenGate

Compiler Version
v0.8.17+commit.8df45f5f

Optimization Enabled:
No with 200 runs

Other Settings:
default evmVersion
File 1 of 6 : DynamicTokenGate.sol
// SPDX-License-Identifier: MIT

/*
 * Created by Satoshi Nakajima (@snakajima)
 */

pragma solidity ^0.8.6;

import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "../interfaces/ITokenGate.sol";

contract DynamicTokenGate is Ownable, ITokenGate {
  IERC721[] whitelist;

  function append(IERC721 _contract) external onlyOwner returns(uint balance) {
    balance = _contract.balanceOf(msg.sender);
    whitelist.push(_contract);
  }

  function balanceOf(address _wallet) external view override returns(uint balance) {
    for (uint i=0; i<whitelist.length; i++) {
      balance += whitelist[i].balanceOf(_wallet);
    }
  }
}

File 2 of 6 : ITokenGate.sol
// SPDX-License-Identifier: MIT

/*
 * Created by Satoshi Nakajima (@snakajima)
 */

pragma solidity ^0.8.6;

interface ITokenGate {
  // Intentially same as ERC721's balanceOf
  function balanceOf(address _wallet) external view returns (uint256 balance);
}

File 3 of 6 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)

pragma solidity ^0.8.0;

import "../utils/Context.sol";

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

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

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

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

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

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

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

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

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

File 4 of 6 : IERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.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: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external;

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

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

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

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

File 5 of 6 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;

/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }
}

File 6 of 6 : 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);
}

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

Contract Security Audit

Contract ABI

[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[{"internalType":"contract IERC721","name":"_contract","type":"address"}],"name":"append","outputs":[{"internalType":"uint256","name":"balance","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_wallet","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"balance","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405234801561001057600080fd5b5061002d61002261003260201b60201c565b61003a60201b60201c565b6100fe565b600033905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6108bc8061010d6000396000f3fe608060405234801561001057600080fd5b50600436106100575760003560e01c806370a082311461005c578063715018a61461008c5780638da5cb5b14610096578063ac04f5a7146100b4578063f2fde38b146100e4575b600080fd5b6100766004803603810190610071919061054e565b610100565b6040516100839190610594565b60405180910390f35b6100946101f3565b005b61009e610207565b6040516100ab91906105be565b60405180910390f35b6100ce60048036038101906100c99190610617565b610230565b6040516100db9190610594565b60405180910390f35b6100fe60048036038101906100f9919061054e565b61031e565b005b600080600090505b6001805490508110156101ed576001818154811061012957610128610644565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231846040518263ffffffff1660e01b815260040161018c91906105be565b602060405180830381865afa1580156101a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101cd919061069f565b826101d891906106fb565b915080806101e59061072f565b915050610108565b50919050565b6101fb6103a1565b610205600061041f565b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600061023a6103a1565b8173ffffffffffffffffffffffffffffffffffffffff166370a08231336040518263ffffffff1660e01b815260040161027391906105be565b602060405180830381865afa158015610290573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102b4919061069f565b90506001829080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550919050565b6103266103a1565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610395576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161038c906107fa565b60405180910390fd5b61039e8161041f565b50565b6103a96104e3565b73ffffffffffffffffffffffffffffffffffffffff166103c7610207565b73ffffffffffffffffffffffffffffffffffffffff161461041d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161041490610866565b60405180910390fd5b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600033905090565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061051b826104f0565b9050919050565b61052b81610510565b811461053657600080fd5b50565b60008135905061054881610522565b92915050565b600060208284031215610564576105636104eb565b5b600061057284828501610539565b91505092915050565b6000819050919050565b61058e8161057b565b82525050565b60006020820190506105a96000830184610585565b92915050565b6105b881610510565b82525050565b60006020820190506105d360008301846105af565b92915050565b60006105e482610510565b9050919050565b6105f4816105d9565b81146105ff57600080fd5b50565b600081359050610611816105eb565b92915050565b60006020828403121561062d5761062c6104eb565b5b600061063b84828501610602565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b61067c8161057b565b811461068757600080fd5b50565b60008151905061069981610673565b92915050565b6000602082840312156106b5576106b46104eb565b5b60006106c38482850161068a565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006107068261057b565b91506107118361057b565b9250828201905080821115610729576107286106cc565b5b92915050565b600061073a8261057b565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361076c5761076b6106cc565b5b600182019050919050565b600082825260208201905092915050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b60006107e4602683610777565b91506107ef82610788565b604082019050919050565b60006020820190508181036000830152610813816107d7565b9050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000610850602083610777565b915061085b8261081a565b602082019050919050565b6000602082019050818103600083015261087f81610843565b905091905056fea26469706673582212205c80c2646da8757e288ff5770f1bf00a25bca3598ee82a82d7ae48f13861ba5f64736f6c63430008110033

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106100575760003560e01c806370a082311461005c578063715018a61461008c5780638da5cb5b14610096578063ac04f5a7146100b4578063f2fde38b146100e4575b600080fd5b6100766004803603810190610071919061054e565b610100565b6040516100839190610594565b60405180910390f35b6100946101f3565b005b61009e610207565b6040516100ab91906105be565b60405180910390f35b6100ce60048036038101906100c99190610617565b610230565b6040516100db9190610594565b60405180910390f35b6100fe60048036038101906100f9919061054e565b61031e565b005b600080600090505b6001805490508110156101ed576001818154811061012957610128610644565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231846040518263ffffffff1660e01b815260040161018c91906105be565b602060405180830381865afa1580156101a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101cd919061069f565b826101d891906106fb565b915080806101e59061072f565b915050610108565b50919050565b6101fb6103a1565b610205600061041f565b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600061023a6103a1565b8173ffffffffffffffffffffffffffffffffffffffff166370a08231336040518263ffffffff1660e01b815260040161027391906105be565b602060405180830381865afa158015610290573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102b4919061069f565b90506001829080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550919050565b6103266103a1565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610395576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161038c906107fa565b60405180910390fd5b61039e8161041f565b50565b6103a96104e3565b73ffffffffffffffffffffffffffffffffffffffff166103c7610207565b73ffffffffffffffffffffffffffffffffffffffff161461041d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161041490610866565b60405180910390fd5b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600033905090565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061051b826104f0565b9050919050565b61052b81610510565b811461053657600080fd5b50565b60008135905061054881610522565b92915050565b600060208284031215610564576105636104eb565b5b600061057284828501610539565b91505092915050565b6000819050919050565b61058e8161057b565b82525050565b60006020820190506105a96000830184610585565b92915050565b6105b881610510565b82525050565b60006020820190506105d360008301846105af565b92915050565b60006105e482610510565b9050919050565b6105f4816105d9565b81146105ff57600080fd5b50565b600081359050610611816105eb565b92915050565b60006020828403121561062d5761062c6104eb565b5b600061063b84828501610602565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b61067c8161057b565b811461068757600080fd5b50565b60008151905061069981610673565b92915050565b6000602082840312156106b5576106b46104eb565b5b60006106c38482850161068a565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006107068261057b565b91506107118361057b565b9250828201905080821115610729576107286106cc565b5b92915050565b600061073a8261057b565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361076c5761076b6106cc565b5b600182019050919050565b600082825260208201905092915050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b60006107e4602683610777565b91506107ef82610788565b604082019050919050565b60006020820190508181036000830152610813816107d7565b9050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000610850602083610777565b915061085b8261081a565b602082019050919050565b6000602082019050818103600083015261087f81610843565b905091905056fea26469706673582212205c80c2646da8757e288ff5770f1bf00a25bca3598ee82a82d7ae48f13861ba5f64736f6c63430008110033

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.