https://github.com/0xmichalis/manifold-dynamic-uri
A Manifold extension for dynamic token URIs
https://github.com/0xmichalis/manifold-dynamic-uri
dynamic-art nft
Last synced: 3 months ago
JSON representation
A Manifold extension for dynamic token URIs
- Host: GitHub
- URL: https://github.com/0xmichalis/manifold-dynamic-uri
- Owner: 0xmichalis
- Created: 2024-02-10T11:11:50.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-02-14T16:18:31.000Z (over 1 year ago)
- Last Synced: 2025-01-24T13:12:27.732Z (5 months ago)
- Topics: dynamic-art, nft
- Language: Solidity
- Homepage: https://manifold.xyz/
- Size: 41 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Manifold extension for dynamic URIs
`DynamicTokenURI` is a Manifold extension that enables dynamic token URIs
for a Manifold creator contract. Specifically, when a token is transferred
between wallets, the URI changes. [Foundry](https://book.getfoundry.sh/) is
used to build, test, and deploy the contract.## Build
```console
$ forge install
$ forge build
$ forge test
$ forge fmt
```## Deploy
```console
$ forge create --rpc-url \
--private-key \
--etherscan-api-key \
-- verify \
DynamicTokenURI
```Then call `setExtensionConfig()` to configure the following parameters
for a creator contract:
* `baseURI`: base URI to be used for all tokens minted by the extension
* `maxSupply`: the number of artworks and also the maximum number of tokens
to be minted by the extension
* `mintCost`: the cost of minting. Can be zero.Once the extension is deployed, it can be registered in the creator contract
by calling `registerExtension()` in the creator contract.### Configure token URIs
By default it is assumed that the metadata directory follows a specific structure:
```console
.
└──
├── 1.json
├── 2.json
├── ...
└── .json
```
eg., the token URI for a token without any transfers will be `${baseURI}1.json`,
the token URI for a token with a single transfer will be `${baseURI}2.json`, etc.In case the metadata files are not named after numbers indexed from 1 up to the
maximum supply of artworks, `setTokenURIs()` can be called on the extension to
map the numbers to fully qualified token URIs,
eg., `setTokenURIs(creatorContract,[1,2,..],["ar://bla420", "ar://bla69",...])`
will force tokens without a transfer to point to `"ar://bla420"`, tokens with a
single transfer to point to `"ar://bla69"`, etc.## Manifold extensions
Learn more about Manifold extensions:
* [developing](https://docs.manifold.xyz/v/manifold-for-developers/smart-contracts/manifold-creator/contracts/extensions)
* [deploying](https://docs.manifold.xyz/v/manifold-for-developers/smart-contracts/manifold-creator/contracts/extensions/extensions-deployment-guide)