Skip to content

Instantly share code, notes, and snippets.

@anildukkipatty
Last active November 29, 2023 19:09
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save anildukkipatty/6107b980fe73bd8fa48349531462724e to your computer and use it in GitHub Desktop.
Tezos SmartPy sample contract
import smartpy as sp
FA2 = sp.io.import_script_from_url("https://smartpy.io/templates/fa2_lib.py")
class TezDynamicNft(FA2.Fa2Nft):
@sp.entry_point
def mint(self, owner, token_info):
token_id = self.data.last_token_id
self.data.ledger[token_id] = owner
self.data.token_metadata[token_id] = sp.record(token_id=token_id, token_info=token_info)
self.data.last_token_id += 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment