# MetadataHandler

## Code

* [MetadataHandler.sol](https://github.com/Revest-Finance/RevestContracts/blob/master/hardhat/contracts/MetadataHandler.sol)

## 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


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://dev.revest.finance/smart-contracts/metadatahandler.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
