Coder Social home page Coder Social logo

nft-contracts's Introduction

NFT store Contract

This mono repo contains the source code for the smart contracts of our Open NFT Marketplace on NEAR.

Development

  1. Install rustup via https://rustup.rs/
  2. Run the following:
rustup default stable
rustup target add wasm32-unknown-unknown

Compiling

You can build release version by running script:

./build.sh

Deploying to Mainnet

To deploy to Mainnet, you can use next command:

near deploy 8o8.near --accountId 8o8.near --nodeUrl https://rpc.mainnet.near.org --networkId mainnet --explorerUrl https://explorer.mainnet.near.org --helperUrl https://helper.mainnet.near.org

Example of minimal usage

  1. Create store using:
near call jpn.near migrate '{}' --accountId jpn.near --nodeUrl https://rpc.mainnet.near.org --networkId mainnet --explorerUrl https://explorer.mainnet.near.org --helperUrl https://helper.mainnet.near.org
  1. Create store using:
near call 8o8.near new '{}' --accountId 8o8.near --gas 250000000000000 --nodeUrl https://rpc.mainnet.near.org --networkId mainnet --explorerUrl https://explorer.mainnet.near.org --helperUrl https://helper.mainnet.near.org
  1. Create store using:
near call 8o8.near create_market '{"prefix": "aa", "contract_metadata": {"spec": "nft-1.0.0", "name": "NAME", "symbol": "SYM"}}' --accountId turk.near --deposit 5 --gas 250000000000000 --nodeUrl https://rpc.mainnet.near.org --networkId mainnet --explorerUrl https://explorer.mainnet.near.org --helperUrl https://helper.mainnet.near.org
  1. Check total supply:
near view aa.8o8.near nft_total_supply '{}'
  1. Mint NFT:
near call aa.8o8.near nft_mint '{"token_id": "1", "token_owner_id": "turk.near", "token_metadata": {"title": "TITILE"}}' --accountId turk.near --deposit 0.1
  1. Mint NFT with payouts (sum of payouts MUST be less than 10000):
near call aa.8o8.near nft_mint 
  '{"token_id": "1", "token_owner_id": "turk.near", "token_metadata": {"title": "TITILE"}}, "payout": {"payout": {"bobrik.near": "100", "danielto.near": "500"}}' 
  --accountId turk.near 
  --deposit 0.1
  1. Get payouts:
near call aa.8o8.near nft_payout 
  '{"token_id": "1", "balance": "228322", "max_len_payout": 10}' 
  --accountId turk.near 
  --depositYocto 1
  1. Migrate:
near call mjol.near migrate '{}' --accountId mjol.near
  1. Create collection:
near call mjol.near create_collection '{"metadata" : {"title":"NPunks", "desc":"NPunks are NFTs on the Near blockchain. Each of these 10,000 NPunks has attributes that make them unique according to a defined rarity system.", "media": "https://ipfs.io/ipfs/bafybeicumf3colv5hyzk2orbtei7akcx6zgwku3oymf2sq2dm4ikpdmreu/E2pQm1oUUAI3_2z-1.jpg"}}' --accountId turk.near --deposit 0.1 --gas 250000000000000
  1. Get collection info:
near call mjol.near get_collection_info '{"collection_id" : "collection-3"}' --accountId mjol.near
  1. Get collection NFTs:
near call mjol.near get_nfts_from_collection '{"collection_id" : "collection-3", "from" : 0, "limit" : 20}' --accountId mjol.near

Deploying to Testnet

To deploy to Testnet, you can use next command:

near dev-deploy

This will output on the contract ID it deployed.

Deploying to Mainnet

To deploy to Mainnet, you can use next command:

export NEAR_ENV=mainnet
near deploy mjol.near --accountId mjol.near

nft-contracts's People

Contributors

atsushikan avatar b1boid avatar danielto1404 avatar olegggatttor avatar

Stargazers

 avatar  avatar  avatar  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.