Skip to content

Fully on-chain dynamic NFT as a function of contents of 6551 TBA

License

Notifications You must be signed in to change notification settings

mcgingras/on-chain-6551

Repository files navigation

On-Chain 6551

Attempting to create an NFT that derives it's image fully on-chain from tokens that it holds in a 6551 TBA.

Current state of the art for showing the contents of a 6551 is to use animation_url to return an iframe that is responsible for polling the contents of the TBA. An example can be found here. Perhaps a more elegant solution would be for the base NFT to derive it's image entirely on-chain depending on the NFTs that are in the TBA associated with the base NFT.

This repo is an attempt at doing just that. It takes inspiration from Loot

Glossary

Character.sol

The base NFT contract. This is the primary NFT that renders it's children. It is originally blank, but as sub NFTs are sent to the TBA for the base NFT, each sub NFT renders on the base NFT. Since this is inspired by Loot, we can image the base NFT as an empty character, and the sub NFTs are traits that the character collects. As the character collects the traits, they render on the character (in the form of white text on a black background)

Trait.sol

The sub NFT contract. Following the Loot example, these are the traits that render on the base NFT. These NFTs have their own image property so they render on their own. These NFTs must exist in the TBA of a given base NFT to show up on the base NFT.

TraitStorage.sol

Storage for the trait details.

SVGStorageBase.sol

Storage for SVG details.

SVGStorageEmpty.sol

Storage for "empty" SVG

Contract Links

Trait Registry Account Implementation Character

About

Fully on-chain dynamic NFT as a function of contents of 6551 TBA

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published