The Unique Pallet is the core of NFT functionality. Like ERC-721 standard in Ethereum ecosystem, this pallet provides the basement for creating collections of unique non-divisible things, also called Non Fungible Tokens (NFTs), minting NFT of a given Collection, and managing their ownership.
The pallet also enables storing NFT properties. Though (according to ERC-721) NFT properties belong to logic of a concrete application that operates a Collection, so purposefully the NFT Tracking Module does not have any knowledge about properties except their byte size leaving application logic out to be controlled by Smart Contracts.
The Unique Chain also provides:
- Smart Contracts Pallet and example smart contract that interacts with Unique Runtime
- ERC-1155 Functionality (currently PoC as Re-Fungible tokens, i.e. items that are still unique, but that can be split between multiple users)
- Variety of economic options for dapp producers to choose from to create freemium games and other ways to attract users. As a step one, we implemented an economic model when a collection sponsor can be set to pay for collection Transfer transactions.
Wider Unique Ecosystem (most of it was developed during Hackusama):
Please see our walk-through instructions to try everything out!
If you are building an application that operates NFT tokens, use this document.
Building Unique chain requires special versions of Rust and toolchain. We don't use the most recent versions of everything so that we can keep the builds stable.
Windows note: We do not provide support for Windows systems and don't test the Unique chain on them. Nonetheless, the Unique chain node might work on Windows. To build it on Windows, you need to enable symlink support in Git:
git config --global core.symlinks true
- Install Rust:
sudo apt-get install git curl libssl-dev llvm pkg-config libclang-dev clang make cmake protobuf-compiler
curl https://sh.rustup.rs -sSf | sh
-
Remove all installed toolchains with
rustup toolchain list
andrustup toolchain uninstall <toolchain>
. -
Install toolchain nightly-2022-11-15 and make it default:
rustup toolchain install nightly-2022-11-15
rustup default nightly-2022-11-15
- Add wasm target for nightly toolchain:
rustup target add wasm32-unknown-unknown --toolchain nightly-2022-11-15
- Build:
Opal
cargo build --release
Quartz
cargo build --features=quartz-runtime --release
Unique
cargo build --features=unique-runtime --release
Note: checkout this project and all related projects (see below) in the sibling folders (both under the same folder)
git clone https://github.com/UniqueNetwork/polkadot-launch.git
git checkout unique-network
git clone https://github.com/paritytech/polkadot.git
cd polkadot
git checkout release-v0.9.43
cargo build --release
Run in the root of this project:
cargo build --release
git clone https://github.com/AcalaNetwork/Acala
cd Acala
git checkout 54db3acd409a0b787f116f20e163a3b24101ce38
make build-release
./launch-testnet.sh
Optional, full setup with Acala and Statemint
./launch-testnet-full.sh
- Install all needed dependecies
cd tests
yarn install
- Run tests
yarn test
cargo clippy
cargo fmt
pushd tests && yarn fix ; popd
cd tests && yarn eslint --ext .ts,.js src/
To get started, you need to open inbound and outbound hrmp channels.
assetRegistry -> registerForeignAsset(location, metadata)
location:
V0(X2(Parent, Parachain(PARA_ID)))
metadata:
name QTZ
symbol QTZ
decimals 18
minimalBalance 1
polkadotXcm -> reserveTransferAssets
dest:
V0(X2(Parent, Parachain(<KARURA_PARA_ID>)))
beneficiary:
X1(AccountId(Any, <ACCOUNT>))
assets:
V1(Concrete(0,Here), Fungible(<AMOUNT>))
feeAssetItem:
0
weightLimit:
<LIMIT>
The result will be displayed in ChainState tokens -> accounts
xtokens -> transfer
currencyId:
ForeignAsset
<TOKEN_ID>
amount:
<AMOUNT>
dest:
V1
(
Parents:1,
X2(Parachain(<KARURA_PARA_ID>), AccountId(Any, <ACCOUNT>)
)
destWeight:
<WEIGHT>