Coder Social home page Coder Social logo

zombies's Introduction

TZombies

This is the finalized repository for the TZombies Tezos NFT tutorial. It is recommended to follow the tutorial step-by-step, and refer to this repository to verify your code.

The app is deployed on https://zombies-pi.vercel.app/.

Quick command reference

Setup

alias ccli="npx completium-cli"
ccli init
ccli start sandbox
ccli set endpoint http://localhost:20000
ccli set account alice

Generate bindings

npx completium-cli generate binding-dapp-ts * --input-path ./contracts --output-path ./contracts/bindings
npx completium-cli generate binding-ts * --input-path ./contracts --output-path ./tests/bindings

Deploy contracts

ccli deploy contracts/permits.arl --parameters '{"owner": "tz1VSUr8wwNhLAzempoch5d6hLRiTh8Cjcjb"}'
ccli deploy ./contracts/tzombies.arl --parameters '{"owner": "tz1VSUr8wwNhLAzempoch5d6hLRiTh8Cjcjb", "permits": "<replace permits_contract_address>"}'
ccli deploy ./contracts/market.arl

Register NFTs

# register the "brainz" NFT
ccli call tzombies --entry set_token_metadata --arg '{"tid": 1, "tdata": [{"key": "", "value": "0x697066733a2f2f516d53445733794257756e7977624c544c78723835784843464d6d747a5372365a55565138433375346161314d65"}]}'
# register the "tzombie" NFT
ccli call tzombies --entry set_token_metadata --arg '{"tid": 2, "tdata": [{"key": "", "value": "697066733a2f2f516d546d65517a55754b37716d467337795466563254434c5a416852466d716d714a793536636b6b7a666a586939"}]}'

Mint

# mint one NFT
ccli call tzombies --entry mint --amount 2tz --arg '{"tow": "tz1VSUr8wwNhLAzempoch5d6hLRiTh8Cjcjb", "tid": 1, "nbt": 1}'

Market

# list token for sale
ccli call market --entry list_for_sale --arg '{"fa2_": "<replace fa2 address>", "token_id_": 1, "amount_": 1, "price_": 100, "expiry_": "2025-01-01 23:00:00"}'

# approve marketplace on fa2 contract
ccli call tzombies --entry update_operators_for_all --arg '{"upl": [{ "kind": "left", "value": "<replace market address>" }]}'

# switch to buyer account and buy the NFT
ccli set account bob
ccli call market --entry buy --arg '{"order_id": 1, "amount_": 1}' --amount 100utz

# check an operation receipt:
tezos-client -E http://localhost:20000 get receipt for $operation_hash

zombies's People

Contributors

lgaroche avatar

Stargazers

Sylvere Richard avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.