I am looking for the FA2 template with the new syntax in version 0.18.0 and above in smartpy. Is there something already available as the token template in the smartpy template are using old version. Thank you.
1 Answer
The whole library exists with the new syntax: https://smartpy.io/ide?template=fa2_lib.py
There are tests with the three base classes with all available policies and mixins:
- https://smartpy.io/ide?template=fa2_lib_test_nft.py
- https://smartpy.io/ide?template=fa2_lib_test_fungible.py
- https://smartpy.io/ide?template=fa2_lib_test_single_asset.py
Also the two standalone minimal version, not intended for real usage but a good place to learn how it works:
There are two limitations at the moment:
- the base metadata is not generated so you cannot have the offchain views in your metadata
- there is no current way to inherit from a contract of another module so you have to use one of the contracts given by the library or copy the whole library and create a contract inside the library's module that inherits from a library's module.
These two limitations may disappear in a new version.