# Mina smart contract URI

**URL:** <https://forums.minaprotocol.com/t/mina-smart-contract-uri/6232>\
**Category:** MIPs (Mina Improvement Proposals)\
**Created:** [February 23, 2024, 12:14pm UTC](https://forums.minaprotocol.com/t/mina-smart-contract-uri/6232 "2024-02-23T12:14:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pfedprog](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.minaprotocol.com/pfedprog/32/1980_2.png) [@Pfedprog](https://forums.minaprotocol.com/u/Pfedprog)\
**Post date:** [February 23, 2024, 12:14pm UTC](https://forums.minaprotocol.com/t/mina-smart-contract-uri/6232/1 "2024-02-23T12:14:17Z")

</div>

I have noticed that current account of Mina smart contract has a property `zkappUri` which we can set if we have the correct permission.

I do not think that any of the MIP drafts addressed this property.

> [@Mina Token Standard Smart Contract Implementation Discussion](https://forums.minaprotocol.com/t/mina-token-standard-smart-contract-implementation-discussion/5187/):
>
> Simple Summary I am trying to implement simple tokens on top of Mina, which would provide basic functionality to transfer tokens. This could in the future be transformed into a standard interface that allows any tokens on Mina to be re-used by other applications: from wallets to other Snapps. Motivation From my understanding, Mina used to have a documentation explaining the protocol layer support for tokens. Yet the previous documentation regarding the token section ([https://docs.minaprotocol…](https://docs.minaprotocol.com/en/architecture/tokens)

For example, on MinaScan Berkley testnet there is an image field, which no token seems to access. [Minascan Block Explorer](https://minascan.io/berkeley/tokens)

Here is my attempt: [Minascan Block Explorer](https://minascan.io/berkeley/token/yLX2vcK7zMg5Vt9AYWmg41XGvFxVGCV6japdgQMjSoi6T6MjST/zk-txs)

I have managed to add a uri link, but not an image field.

Personally, [ERC-1046: tokenURI Interoperability](https://eips.ethereum.org/EIPS/eip-1046) seems a viable interface implementation standard solution.

---

<div class="post-metadata">

**Author:** ![Pfedprog](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.minaprotocol.com/pfedprog/32/1980_2.png) [@Pfedprog](https://forums.minaprotocol.com/u/Pfedprog)\
**Post date:** [March 5, 2024, 7:35pm UTC](https://forums.minaprotocol.com/t/mina-smart-contract-uri/6232/2 "2024-03-05T19:35:00Z")

</div>

ERC-1046 has further details regarding the metadata.

```auto
/**
 * Asset Metadata
 */
interface ERC20TokenMetadata {
    /**
     * Interoperabiliy, to differentiate between different types of tokens and their corresponding URIs.
     **/
    interop: InteroperabilityMetadata;
    
    /**
     * The name of the ERC-20 token. 
     * If the `name()` function is present in the ERC-20 token and returns a nonempty string, these MUST be the same value.
     */
    name?: string;
    
    /**
     * The symbol of the ERC-20 token. 
     * If the `symbol()` function is present in the ERC-20 token and returns a nonempty string, these MUST be the same value.
     */
    symbol?: string;
    
    /**
     * The decimals of the ERC-20 token. 
     * If the `decimals()` function is present in the ERC-20 token, these MUST be the same value.
     * Defaults to 18 if neither this parameter nor the ERC-20 `decimals()` function are present.
     */
    decimals?: number;
    
    /**
     * Provides a short one-paragraph description of the ERC-20 token, without any markup or newlines.
     */
    description?: string;
    
    /**
     * A URI pointing to a resource with mime type `image/*` that represents this token.
     * If the image is a bitmap, it SHOULD have a width between 320 and 1080 pixels
     * The image SHOULD have an aspect ratio between 1.91:1 and 4:5 inclusive.
     */
    image?: string;
    
    /**
     * One or more URIs each pointing to a resource with mime type `image/*` that represents this token.
     * If an image is a bitmap, it SHOULD have a width between 320 and 1080 pixels
     * Images SHOULD have an aspect ratio between 1.91:1 and 4:5 inclusive.
     */
    images?: string[];
    
    /**
     * One or more URIs each pointing to a resource with mime type `image/*` that represent an icon for this token.
     * If an image is a bitmap, it SHOULD have a width between 320 and 1080 pixels, and MUST have a height equal to its width
     * Images MUST have an aspect ratio of 1:1, and use a transparent background
     */
    icons?: string[];
}

```

## On decimals

Further, I am delving into ERC 20:

> **[ERC-20: Token Standard](https://eips.ethereum.org/EIPS/eip-20#decimals)**

The amount of decimals by default is `18` in ERC 20.

On MinaScan I do not think that the explorer takes into account the decimals value.

On Pin Save smart contract I had to use `1_000_000_000` to get a display of `1` Unit.

Hence, default value of decimals is `9`.

### Miscellaneous Recommendations

Adapting recommendations from ERC-1046:

Not to implement the `name()`, `symbol()`, or `decimals()` functions, and instead to only include them in the metadata URI.

Additionally, for tokens, if the decimals is `9`, then it is NOT RECOMMENDED to include the `decimals` field in the metadata.

An example of uri.json

```auto
{
  "name": "PinSave Mina Token",
  "symbol": "PINSAV",
  "image": "https://pinsave.app/Pin.png"
}

```

Available at [https://pinsave.app/uri.json](https://pinsave.app/uri.json)
