Craftable Input Token
A description of the Abstract Contract for Input Tokens
A key constraint for the input tokens is that they must implement on-chain attribute storage.
What's CraftableIn?
It's an abstract contract providing all necessary functionality to be adapted as an input in future crafting rules.
Implementing CraftableIn in your Token
To turn your token in development into a Craftable Input token. Here are the instructions:
Compose your definition metadata file. Set the classes you have and their attributes descriptions.
make sure to edit your contract to handle storing your token attribute on-chain.
import
craftable/CraftableIn.sol
from the repo.
extend the abstract contract from your token
Implement the virtual functions to make the contract usable.
First override the functions to enable CraftableBase
. Other functions to override for CraftableIn specifically are the following:
attributes( _id)
This function returns a list of integers representing the attributes of the token ordered according to the definition. The implementation of this functions depends on how the original attributes were stored for the contract. We provide a simple example here:
(optional)
tokenURI(_tokenId)
: This can be edited to use different contract scheme
Docs
Last updated