Contract 0x962e129C2f16a44E88178da2C83C269a108Bdc86 13

 
Txn Hash Method
Block
From
To
Value
0x94f361f793b6856fd81b0374ec877d4757bd848a6613476ddda17686b2ed3534Transfer Ownersh...256374932022-09-26 22:28:51366 days 14 hrs ago0x8ca573430fd584065c080ff1d2ea1a8dfb259ae8 IN  0x962e129c2f16a44e88178da2c83c269a108bdc860 ETH0.0000429532250.00100155
0xdfbfb66f18e8250c37ec63e32ad7e71f8ca08c0c9e4cb08c452e184853044c800x60806040256038142022-09-26 16:32:52366 days 20 hrs ago0x8ca573430fd584065c080ff1d2ea1a8dfb259ae8 IN  Create: MetadataHandler0 ETH0.001909504090.1
[ Download CSV Export 
Parent Txn Hash Block From To Value
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
MetadataHandler

Compiler Version
v0.8.13+commit.abaa5c0e

Optimization Enabled:
Yes with 10000 runs

Other Settings:
default evmVersion
File 1 of 4 : MetadataHandler.sol
// SPDX-License-Identifier: GNU-GPL v3.0 or later

pragma solidity ^0.8.0;

import "@openzeppelin/contracts/access/Ownable.sol";
import "./interfaces/IMetadataHandler.sol";


contract MetadataHandler is Ownable, IMetadataHandler{

    string public uri;
    string public renderURI;

    constructor(string memory _uri) Ownable() {
        uri = _uri;
    }

    function getTokenURI(uint fnftId) external view override returns (string memory ) {
        return string(abi.encodePacked(uri,uint2str(fnftId),'&chainId=',uint2str(block.chainid)));
    }

    function setTokenURI(uint fnftId, string memory _uri) external onlyOwner override {
        uri = _uri;
    }

    function getRenderTokenURI(
        uint tokenId,
        address owner
    ) external view override returns (string memory baseRenderURI, string[] memory parameters) {
        string[] memory arr;
        return (renderURI, arr);
    }

    function setRenderTokenURI(
        uint tokenID,
        string memory baseRenderURI
    ) external onlyOwner override {
        renderURI = baseRenderURI;
    }

    function uint2str(uint _i) internal pure returns (string memory _uintAsString) {
        if (_i == 0) {
            return "0";
        }
        uint j = _i;
        uint len;
        while (j != 0) {
            len++;
            j /= 10;
        }
        bytes memory bstr = new bytes(len);
        uint k = len;
        while (_i != 0) {
            k = k-1;
            uint8 temp = (48 + uint8(_i - _i / 10 * 10));
            bytes1 b1 = bytes1(temp);
            bstr[k] = b1;
            _i /= 10;
        }
        return string(bstr);
    }

}

File 2 of 4 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (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 Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        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 3 of 4 : IMetadataHandler.sol
// SPDX-License-Identifier: GNU-GPL v3.0 or later

pragma solidity ^0.8.0;

interface IMetadataHandler {

    function getTokenURI(uint fnftId) external view returns (string memory );

    function setTokenURI(uint fnftId, string memory _uri) external;

    function getRenderTokenURI(
        uint tokenId,
        address owner
    ) external view returns (
        string memory baseRenderURI,
        string[] memory parameters
    );

    function setRenderTokenURI(
        uint tokenID,
        string memory baseRenderURI
    ) external;

}

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

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"string","name":"_uri","type":"string"}],"stateMutability":"nonpayable","type":"constructor"},{"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":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"owner","type":"address"}],"name":"getRenderTokenURI","outputs":[{"internalType":"string","name":"baseRenderURI","type":"string"},{"internalType":"string[]","name":"parameters","type":"string[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"fnftId","type":"uint256"}],"name":"getTokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renderURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenID","type":"uint256"},{"internalType":"string","name":"baseRenderURI","type":"string"}],"name":"setRenderTokenURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"fnftId","type":"uint256"},{"internalType":"string","name":"_uri","type":"string"}],"name":"setTokenURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"uri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"}]

60806040523480156200001157600080fd5b506040516200106138038062001061833981016040819052620000349162000168565b6200003f336200005c565b805162000054906001906020840190620000ac565b505062000280565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b828054620000ba9062000244565b90600052602060002090601f016020900481019282620000de576000855562000129565b82601f10620000f957805160ff191683800117855562000129565b8280016001018555821562000129579182015b82811115620001295782518255916020019190600101906200010c565b50620001379291506200013b565b5090565b5b808211156200013757600081556001016200013c565b634e487b7160e01b600052604160045260246000fd5b600060208083850312156200017c57600080fd5b82516001600160401b03808211156200019457600080fd5b818501915085601f830112620001a957600080fd5b815181811115620001be57620001be62000152565b604051601f8201601f19908116603f01168101908382118183101715620001e957620001e962000152565b8160405282815288868487010111156200020257600080fd5b600093505b8284101562000226578484018601518185018701529285019262000207565b82841115620002385760008684830101525b98975050505050505050565b600181811c908216806200025957607f821691505b6020821081036200027a57634e487b7160e01b600052602260045260246000fd5b50919050565b610dd180620002906000396000f3fe608060405234801561001057600080fd5b50600436106100a35760003560e01c8063827bffb511610076578063d0d321a51161005b578063d0d321a51461014a578063eac989f814610152578063f2fde38b1461015a57600080fd5b8063827bffb5146101015780638da5cb5b1461012257600080fd5b8063162094c4146100a85780633bb3a24d146100bd57806346c2f669146100e6578063715018a6146100f9575b600080fd5b6100bb6100b6366004610872565b61016d565b005b6100d06100cb36600461094b565b61020b565b6040516100dd91906109de565b60405180910390f35b6100bb6100f4366004610872565b610249565b6100bb6102dd565b61011461010f366004610a21565b61036a565b6040516100dd929190610a4d565b60005460405173ffffffffffffffffffffffffffffffffffffffff90911681526020016100dd565b6100d061040a565b6100d0610498565b6100bb610168366004610add565b6104a5565b60005473ffffffffffffffffffffffffffffffffffffffff1633146101f3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b80516102069060019060208401906107aa565b505050565b60606001610218836105d5565b610221466105d5565b60405160200161023393929190610b67565b6040516020818303038152906040529050919050565b60005473ffffffffffffffffffffffffffffffffffffffff1633146102ca576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016101ea565b80516102069060029060208401906107aa565b60005473ffffffffffffffffffffffffffffffffffffffff16331461035e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016101ea565b6103686000610735565b565b606080606060028181805461037e90610af8565b80601f01602080910402602001604051908101604052809291908181526020018280546103aa90610af8565b80156103f75780601f106103cc576101008083540402835291602001916103f7565b820191906000526020600020905b8154815290600101906020018083116103da57829003601f168201915b5050505050915092509250509250929050565b6002805461041790610af8565b80601f016020809104026020016040519081016040528092919081815260200182805461044390610af8565b80156104905780601f1061046557610100808354040283529160200191610490565b820191906000526020600020905b81548152906001019060200180831161047357829003601f168201915b505050505081565b6001805461041790610af8565b60005473ffffffffffffffffffffffffffffffffffffffff163314610526576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016101ea565b73ffffffffffffffffffffffffffffffffffffffff81166105c9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084016101ea565b6105d281610735565b50565b60608160000361061857505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b8115610642578061062c81610ca9565b915061063b9050600a83610ce1565b915061061c565b60008167ffffffffffffffff81111561065d5761065d610843565b6040519080825280601f01601f191660200182016040528015610687576020820181803683370190505b509050815b851561072c5761069d600182610d1c565b905060006106ac600a88610ce1565b6106b790600a610d33565b6106c19088610d1c565b6106cc906030610d70565b905060008160f81b9050808484815181106106e9576106e9610d95565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350610723600a89610ce1565b9750505061068c565b50949350505050565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b8280546107b690610af8565b90600052602060002090601f0160209004810192826107d8576000855561081e565b82601f106107f157805160ff191683800117855561081e565b8280016001018555821561081e579182015b8281111561081e578251825591602001919060010190610803565b5061082a92915061082e565b5090565b5b8082111561082a576000815560010161082f565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000806040838503121561088557600080fd5b82359150602083013567ffffffffffffffff808211156108a457600080fd5b818501915085601f8301126108b857600080fd5b8135818111156108ca576108ca610843565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810190838211818310171561091057610910610843565b8160405282815288602084870101111561092957600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b60006020828403121561095d57600080fd5b5035919050565b60005b8381101561097f578181015183820152602001610967565b8381111561098e576000848401525b50505050565b600081518084526109ac816020860160208601610964565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b6020815260006109f16020830184610994565b9392505050565b803573ffffffffffffffffffffffffffffffffffffffff81168114610a1c57600080fd5b919050565b60008060408385031215610a3457600080fd5b82359150610a44602084016109f8565b90509250929050565b604081526000610a606040830185610994565b6020838203818501528185518084528284019150828160051b85010183880160005b83811015610ace577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0878403018552610abc838351610994565b94860194925090850190600101610a82565b50909998505050505050505050565b600060208284031215610aef57600080fd5b6109f1826109f8565b600181811c90821680610b0c57607f821691505b602082108103610b45577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b60008151610b5d818560208601610964565b9290920192915050565b600080855481600182811c915080831680610b8357607f831692505b60208084108203610bbb577f4e487b710000000000000000000000000000000000000000000000000000000086526022600452602486fd5b818015610bcf5760018114610bfe57610c2b565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00861689528489019650610c2b565b60008c81526020902060005b86811015610c235781548b820152908501908301610c0a565b505084890196505b505050505050610c70610c6a610c418388610b4b565b7f26636861696e49643d0000000000000000000000000000000000000000000000815260090190565b85610b4b565b9695505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203610cda57610cda610c7a565b5060010190565b600082610d17577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b600082821015610d2e57610d2e610c7a565b500390565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615610d6b57610d6b610c7a565b500290565b600060ff821660ff84168060ff03821115610d8d57610d8d610c7a565b019392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fdfea164736f6c634300080d000a0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002768747470733a2f2f6170692e7265766573742e66696e616e63652f6d657461646174613f69643d00000000000000000000000000000000000000000000000000

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

0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002768747470733a2f2f6170692e7265766573742e66696e616e63652f6d657461646174613f69643d00000000000000000000000000000000000000000000000000

-----Decoded View---------------
Arg [0] : _uri (string): https://api.revest.finance/metadata?id=

-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000020
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000027
Arg [2] : 68747470733a2f2f6170692e7265766573742e66696e616e63652f6d65746164
Arg [3] : 6174613f69643d00000000000000000000000000000000000000000000000000


Block Transaction Difficulty Gas Used Reward
Block Uncle Number Difficulty Gas Used Reward
Loading
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.