Substrate NFT !ink smart contract base

Overview

Substrate !ink NFT simple implementation


This is a simple working version of base NFT smart contract written using latest (as of this date) !ink 3.0.0-rc3.

To run all tests:

cargo +nightly test

To compile to WASM:

cargo +nightly contract build 

Original wasm size: 47.4K, Optimized: 26.3K

Once your contract is compiled you can find artifacts in: <PROJECT_DIR>/target/ink

  • nft.contract (code + metadata)
  • nft.wasm (the contract's code)
  • metadata.json (the contract's metadata)

If you are facing any issues please follow the setup step of substrate environment at:

https://substrate.dev/substrate-contracts-workshop/#/0/setup

Testing on using Polk4 canvas network


You can upload this contract and interract with it either via your own local Canvas node or using Polk4 Canvas testnet.

  • Head to https://paritytech.github.io/canvas-ui/
  • In node settings input custom node endpoint: wss://canvas.polk4.net
  • Upload nft.contract into the node via UI
  • Instantiate a contract and make RPC calls/transactions 🎉

License

This NFT template is MIT

You might also like...
clockchain is a system for benchmarking smart contract execution times across blockchains.
clockchain is a system for benchmarking smart contract execution times across blockchains.

Clockchain Clockchain is a research tool for benchmarking smart contract execution times across blockchains using Arcesco-- a block-chain agnostic ins

An example smart contract that builds on top of xyz

xyz Guestbook Tutorial Contract This repository contains an example smart contract that illustrates how to build on top of the xyz NFT contract. This

Simple template for building smart contract(Rust) and RPC Client(web3.js) on Solana (WIP) ⛏👷🚧⚠️
Simple template for building smart contract(Rust) and RPC Client(web3.js) on Solana (WIP) ⛏👷🚧⚠️

Solana BPF Boilerplate Simple template for building smart contract(Rust) and RPC Client(web3.js) on Solana This boilerplate provides the following. Si

Smart Contract for Terra Name Service

TERRA NAME SERVICE CONTRACTS Terra Name Service is to create easy-to-remember names for your Terra address like ‘dokwon.ust’ instead of ‘terra1...whez

Emerging smart contract language for the Ethereum blockchain.

Emerging smart contract language for the Ethereum blockchain.

Vectis - Smart Contract Wallet

A smart contract wallet project to add functionality for users of DApps to manage their keys by allowing for recovery and account freeze, whilst preserving user control, and enabling relayer capability for gas provisioning

Smart Contract built in Rust to run inside Cosmos SDK module on all chains that enable it

CoinSwap is a Smart Contract that is built on the terra blockchain and can be used to swap cryptocurrencies such as LUNA, UST, TerraUSD, Anchor, Mirror Protocol, LUNI and other CW20 tokens. The Project also contains a smart contract which works as a analysis tool for the gas fees on the Terra Blockchain.

Heimdall is an advanced Ethereum smart contract toolkit for forensic and heuristic analysis.
Heimdall is an advanced Ethereum smart contract toolkit for forensic and heuristic analysis.

Heimdall is an advanced EVM toolkit which aims to make dealing with smart contracts on EVM based chains easier. Installation & Usage Heimdall's update

A simple example demonstrating cross-contract calls in CosmWasm smart contracts

Cross-contract calls This tutorial demonstrates cross-contract calls with CosmWasm v1. Overview An end user calls the reservation contract to register

Comments
  • error on tests

    error on tests

    Hey, just try to make

    cargo +nightly test
    

    got error:

    error[E0277]: the trait bound `ink_env::AccountId: TypeInfo` is not satisfied
       --> lib.rs:9:5
        |
    9   | /     pub struct NFT {
    10  | |         owner: AccountId,
    11  | |         id_to_owner: ink_storage::collections::HashMap<u64, AccountId>,
    12  | |         owner_to_token_count: ink_storage::collections::HashMap<AccountId, u64>,
    13  | |     }
        | |_____^ the trait `TypeInfo` is not implemented for `ink_env::AccountId`
        |
    note: required by a bound in `FieldsBuilder::<NamedFields>::field_of`
    

    rustup:

    Default host: x86_64-unknown-linux-gnu
    rustup home:  /home/******/.rustup
    
    installed toolchains
    --------------------
    
    stable-x86_64-unknown-linux-gnu (default)
    nightly-x86_64-unknown-linux-gnu
    
    active toolchain
    ----------------
    
    stable-x86_64-unknown-linux-gnu (default)
    rustc 1.57.0 (f1edd0429 2021-11-29)
    
    opened by moneyzmey 2
Owner
POLK4.NET
POLK4.NET organisation
POLK4.NET
The Ink! smart contract SDK for XVM interface

Ink! XVM SDK The Ink! smart contract SDK for XVM interface. This SDK contains contract wrappers and all middleware code to make XVM development easy.

Astar Network 13 Jan 3, 2023
The NFT smart contract powering xyz on Terra

xyz NFT Contract This repository contains the core NFT smart contract that implements xyz, a base layer for metaverses on the Terra blockchain. The xy

null 16 Sep 25, 2022
A Simple Rust NFT API + Smart Contract

Rust NFT API Purpose Rust NFT API is a simple RESTful API developed in Rust that offers functionalities for creating, retrieving, and listing Non-Fung

Luis Soares 5 Feb 25, 2024
zink! is a library for developing ink! smart contracts with useful Rust macros that extend functionality and reduce boilerplate code.

zink! Smart Contract Macros This is a helper library for developing ink! smart contracts. It contains useful Rust macros that extend functionality and

Scio Labs 3 Nov 3, 2023
ARYA Network is a polkadot/substrate based chain for Non-fungible Token platform on which we can own sell and buy the NFT's on polkadot network.

ARYA Network ARYA Network is a polkadot/substrate based chain for Non-fungible Token platform on which we can own sell and buy the NFT's on polkadot n

Pankaj Chaudhary 6 Dec 20, 2022
Substrate blockchain generated with Substrate Startkit

Substrate Node Template A new FRAME-based Substrate node, ready for hacking ?? Getting Started This project contains some configuration files to help

HoangDuong 1 Oct 19, 2021
Substrate blockchain generated with Substrate Startkit

Substrate Node Template A new FRAME-based Substrate node, ready for hacking ?? Getting Started This project contains some configuration files to help

HoangDuong 1 Oct 19, 2021
Substrate blockchain generated with Substrate Startkit

Substrate Node Template A new FRAME-based Substrate node, ready for hacking ?? Getting Started This project contains some configuration files to help

Liam Parry 0 Nov 6, 2021
clockchain is a system for benchmarking smart contract execution times across blockchains.

Clockchain Clockchain is a research tool for benchmarking smart contract execution times across blockchains using Arcesco-- a block-chain agnostic ins

Zeke Medley 7 Oct 3, 2022
Testing a smart contract on the Solana blockchain

Environment Setup Install Rust from https://rustup.rs/ Install Solana from https://docs.solana.com/cli/install-solana-cli-tools#use-solanas-install-to

Maurice 1 Oct 25, 2021