> For the complete documentation index, see [llms.txt](https://scaleyvalley.gitbook.io/main/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://scaleyvalley.gitbook.io/main/technical-details/scaleyvalleycollection-specification.md).

# ScaleyValleyCollection specification

ScaleyValleyCollection is a contract keeping all **NFT** information in it. This contract exists only on Ethereum network with bridge **Hyp721** backings on other **Valley**-chains.

### Storage mapping

<table><thead><tr><th width="203">Name</th><th width="285.3333333333333">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>kindSupply</code></td><td>mapping <code>uint256</code> => <code>uint256</code></td><td>Maps <code>kindId</code> to total <code>amount</code> minted of this kind</td></tr></tbody></table>

### Constants

| Name               | Type      | Description                                       |
| ------------------ | --------- | ------------------------------------------------- |
| `AQUATIQUE_KIND`   | `uint256` | `0x0000` — indentifier for Aquatique NFT kind     |
| `DRUID_KIND`       | `uint256` | `0x0001` — indentifier for Druid NFT kind         |
| `ILLUMINATOR_KIND` | `uint256` | `0x0002` — indentifier for Illuminator NFT kind   |
| `HERMES_KIND`      | `uint256` | `0x0003` — indentifier for Hermes NFT kind        |
| `MINTER_ROLE`      | bytes32   | `keccak256("MINTER_ROLE")` — only minter can mint |

### Methods

#### View state

`getNFTKindSupply(uint256 kind)` — gives supply for `kind`

`getKind(uint256 id)` — calculated `kind` from `id` using bitwise operators

`isKind(uint256 id, uint256 kind)` —whether `id` is amongst `kind` tokens

`tokenURI(uint256 tokenId)` — appends `tokenId` to `baseURI`

#### Changing state

`mintKind(address to, uint256 kind)` — mints `kind` token to user `to`. It emits event `Transfer` from `address(0)` so backend services will see minted token id.

token id is defined as follows:

`uint256 tokenId = (kindId << 16) | kindSupply[kindId]`

Interactor must have `MINTER_ROLE`.&#x20;

`setBaseURI(string memory newUri)` — set NFT's metadata URI. Only `DEFAULT_ADMIN_ROLE`
