Contract 0x9c934a9F966f0E1c860537D1B91Ec61a3fbd8C3a 1

Txn Hash Method
Block
From
To
Value [Txn Fee]
0x6eb44af017598e020eff2445a9e49706885513fbaaab625e357541200bef53e00x60806040228102182022-11-25 4:37:153 days 10 hrs ago0x98634f1cfba567ce9aa1be9d3f894e147c881c24 IN  Create: TokenUriHelperFeature0 AVAX0.010184751 27
[ Download CSV Export 
Parent Txn Hash Block From To Value
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
TokenUriHelperFeature

Compiler Version
v0.8.16+commit.07a7930e

Optimization Enabled:
No with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 5 : TokenUriHelperFeature.sol
/// SPDX-License-Identifier: MIT

pragma solidity ^0.8.15;

import "./ITokenUriHelperFeature.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol";


contract TokenUriHelperFeature is ITokenUriHelperFeature {

    uint256 constant MASK_ADDRESS = (1 << 160) - 1;

    function tokenURIs(TokenUriParam[] calldata params) external view override returns (string[] memory uris) {
        uris = new string[](params.length);
        for (uint256 i; i < params.length;) {
            address erc721 = address(uint160(params[i].methodIdAndAddress & MASK_ADDRESS));
            bytes4 methodId = bytes4(uint32(params[i].methodIdAndAddress >> 224));
            if (methodId == 0) {
                methodId = IERC721Metadata.tokenURI.selector;
            }

            (bool success, bytes memory uri) = erc721.staticcall(abi.encodeWithSelector(methodId, params[i].tokenId));
            if (success) {
                uris[i] = string(uri);
            }
            unchecked {++i;}
        }
        return uris;
    }
}

File 2 of 5 : ITokenUriHelperFeature.sol
/// SPDX-License-Identifier: MIT

pragma solidity ^0.8.15;

interface ITokenUriHelperFeature {

    struct TokenUriParam {
        // 32bits(methodId) + 64bits(unused) + 160bits(tokenAddress)
        uint256 methodIdAndAddress;
        uint256 tokenId;
    }
    function tokenURIs(TokenUriParam[] calldata params) external view returns(string[] memory uris);
}

File 3 of 5 : IERC721Metadata.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol)

pragma solidity ^0.8.0;

import "../IERC721.sol";

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

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

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

File 4 of 5 : IERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (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`, checking first that contract recipients
     * are aware of the ERC721 protocol to prevent tokens from being forever locked.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) 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 Returns the account approved for `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function getApproved(uint256 tokenId) external view returns (address operator);

    /**
     * @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 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);

    /**
     * @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;
}

File 5 of 5 : 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 ABI

[{"inputs":[{"components":[{"internalType":"uint256","name":"methodIdAndAddress","type":"uint256"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"internalType":"struct ITokenUriHelperFeature.TokenUriParam[]","name":"params","type":"tuple[]"}],"name":"tokenURIs","outputs":[{"internalType":"string[]","name":"uris","type":"string[]"}],"stateMutability":"view","type":"function"}]

608060405234801561001057600080fd5b506105e0806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c8063880d9eb314610030575b600080fd5b61004a600480360381019061004591906102f9565b610060565b6040516100579190610498565b60405180910390f35b60608282905067ffffffffffffffff81111561007f5761007e6104ba565b5b6040519080825280602002602001820160405280156100b257816020015b606081526020019060019003908161009d5790505b50905060005b8383905081101561028357600073ffffffffffffffffffffffffffffffffffffffff8585848181106100ed576100ec6104e9565b5b90506040020160000135169050600060e0868685818110610111576101106104e9565b5b90506040020160000135901c60e01b9050600060e01b817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916036101575763c87b56dd60e01b90505b6000808373ffffffffffffffffffffffffffffffffffffffff1683898988818110610185576101846104e9565b5b9050604002016020013560405160240161019f9190610531565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040516102099190610593565b600060405180830381855afa9150503d8060008114610244576040519150601f19603f3d011682016040523d82523d6000602084013e610249565b606091505b509150915081156102745780868681518110610268576102676104e9565b5b60200260200101819052505b846001019450505050506100b8565b5092915050565b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b60008083601f8401126102b9576102b8610294565b5b8235905067ffffffffffffffff8111156102d6576102d5610299565b5b6020830191508360408202830111156102f2576102f161029e565b5b9250929050565b600080602083850312156103105761030f61028a565b5b600083013567ffffffffffffffff81111561032e5761032d61028f565b5b61033a858286016102a3565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b600081519050919050565b600082825260208201905092915050565b60005b838110156103ac578082015181840152602081019050610391565b60008484015250505050565b6000601f19601f8301169050919050565b60006103d482610372565b6103de818561037d565b93506103ee81856020860161038e565b6103f7816103b8565b840191505092915050565b600061040e83836103c9565b905092915050565b6000602082019050919050565b600061042e82610346565b6104388185610351565b93508360208202850161044a85610362565b8060005b8581101561048657848403895281516104678582610402565b945061047283610416565b925060208a0199505060018101905061044e565b50829750879550505050505092915050565b600060208201905081810360008301526104b28184610423565b905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000819050919050565b61052b81610518565b82525050565b60006020820190506105466000830184610522565b92915050565b600081519050919050565b600081905092915050565b600061056d8261054c565b6105778185610557565b935061058781856020860161038e565b80840191505092915050565b600061059f8284610562565b91508190509291505056fea2646970667358221220a847584ae30c3b0efc79b717a113e52da1667825fbedbda900ac16f816f80c1d64736f6c63430008100033

Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.