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

Webb Protocol implementation in Ink!

Webb Protocol Ink! 🕸️ Webb Protocol Ink! ⧫ ⚠️ Beta Software ⚠️ Dependencies A prerequisite for compiling smart contracts is to have Rust and Cargo in

Helpers crate to simplify ink! chain extension development

OpenBrush Chain Extension library The library provides tools and primitives to simplify the development of chain extensions for ink! and for the subst

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

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

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

Minimal Substrate node configured for smart contracts via pallet-contracts.

substrate-contracts-node This repository contains Substrate's node-template configured to include Substrate's pallet-contracts ‒ a smart contract modu

This is a node implementation of Thippy, a Substrate parachain for smart contracts

Thippy ‒- A Smart Contracts Parachain This is a node implementation of Thippy, a Substrate parachain for smart contracts. Developing Smart Contracts f

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 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
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
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 7 Oct 3, 2022
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

null 5 Apr 4, 2022
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

ono 6 Jan 30, 2022
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

null 12 Nov 23, 2022
Emerging smart contract language for the Ethereum blockchain.

Emerging smart contract language for the Ethereum blockchain.

null 1.2k Nov 22, 2022
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

Nymlab 20 Nov 22, 2022
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.

Prajjwal Chittori 9 Oct 11, 2022