Skip to content

Latest commit

 

History

History
61 lines (37 loc) · 2.13 KB

README.md

File metadata and controls

61 lines (37 loc) · 2.13 KB

nft-marketplace

ZNG NFT Marketplace using NEAR-Rust SDK

zng-nft-marketplace-sc

NFT Marketplace using Near-Rust


How to run Smart Contract

Step 0: Install near-cli (optional)

[near-cli] is a command line interface (CLI) for interacting with the NEAR blockchain. It was installed to the local node_modules folder when you ran yarn install, but for best ergonomics you may want to install it globally:

yarn install --global near-cli

Or, if you'd rather use the locally-installed version, you can prefix all near commands with npx

Ensure that it's installed with near --version (or npx near --version)

Step 1: Create an account for the contract

Each account on NEAR can have at most one contract deployed to it. If you've already created an account such as your-name.testnet, you can deploy your contract to todo-app.your-name.testnet. Assuming you've already created an account on [NEAR Wallet], here's how to create todo-app.your-name.testnet:

  1. Authorize NEAR CLI, following the commands it gives you:

    near login

  2. Create a subaccount (replace YOUR-NAME below with your actual account name):

    near create-account todo-app.YOUR-NAME.testnet --masterAccount YOUR-NAME.testnet

Step 2: set contract name in code


NFT Marketplace Smart Contract

A smart contract written in Rust for an app initialized with create-near-app

Quick Start

Before you compile this code, you will need to install Rust with correct target

Exploring The Code

  1. The main smart contract code lives in src/lib.rs. You can compile it with the ./compile script.
  2. Tests: You can run smart contract tests with the ./test script. This runs standard Rust tests using cargo with a --nocapture flag so that you can see any debug info you print to the console.