Movatterモバイル変換


[0]ホーム

URL:


Skip to content
DEV Community
Log in Create account

DEV Community

VivekAsCoder
VivekAsCoder

Posted on

     

How to deploy FA2 contract for NFT on Tezos.

Let's see.

Writing the code.

importsmartpyasspfa2=sp.io.import_script_from_url("file:./fa2.py")classToken(fa2.FA2):passadmin=sp.address("tz1Qd55E9faDRDUWVbFTv4GXe7mA46NPctLx")sp.add_compilation_target("Token",Token(config=fa2.FA2_config(non_fungible=True,assume_consecutive_token_ids=False),admin=admin,metadata=sp.big_map({"":sp.utils.bytes_of_string("tezos-storage:content"),"content":sp.utils.bytes_of_string("""{name: "LOL"}"""),})))
Enter fullscreen modeExit fullscreen mode

Deploying the code

Since, we're not noob here, let's create a makefile.

SP=~/smartpy-cli/SmartPy.shSHELL := /bin/bashnft:    $(SP) compile ./nft.py ./output --html    $(SP) originate-contract \    --code ./output/Token/step_000_cont_1_contract.tz \    --storage ./output/Token/step_000_cont_1_storage.tz \    --rpc https://hangzhounet.smartpy.io
Enter fullscreen modeExit fullscreen mode

Then write the following command to deploy the code to testnet.

make nft
Enter fullscreen modeExit fullscreen mode

Got any question, leave in the comments.

Top comments(0)

Subscribe
pic
Create template

Templates let you quickly answer FAQs or store snippets for re-use.

Dismiss

Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment'spermalink.

For further actions, you may consider blocking this person and/orreporting abuse

403 Bio is forbidden.
  • Joined

Trending onDEV CommunityHot

DEV Community

We're a place where coders share, stay up-to-date and grow their careers.

Log in Create account

[8]ページ先頭

©2009-2025 Movatter.jp