MetadataHandler

This contract keeps track of where the FNFTs metadata is stored, this contract is dynamic so it can be swapped out in the future.

Code

Read-Only Functions

getTokenURI

function getTokenURI(uint fnftId) external view override returns (string memory ) {
    return uri;
}

Returns the cached IAddressRegistry connected to this contract.

getRenderTokenURI

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

Experimental method to allow future-proofing for the iNFT standard. Gets the render token URI for a given tokenId and owner, along with parameters.

State-Changing Functions

setTokenURI

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

Sets the token URI for a given fnftId to the passed in _uri.

setRenderTokenURI

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

Experimental method to allow future-proofing for the iNFT standard. Sets the renderTokenURI.

Interface

// 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;

}

ABI

Last updated