git.delta.rocks / unique-network / refs/commits / ff74635c138f

difftreelog

source

README.md4.8 KiBsourcehistory
1# Unique Parachain23## Project Description45The Unique Pallet is the core of NFT functionality. Like ERC-721 standard in Ethereum ecosystem, this pallet provides the6basement for creating collections of unique non-divisible things, also called Non Fungible Tokens (NFTs), minting NFT of7a given Collection, and managing their ownership.89The pallet also enables storing NFT properties. Though (according to ERC-721) NFT properties belong to logic of a10concrete application that operates a Collection, so purposefully the NFT Tracking Module does not have any knowledge11about properties except their byte size leaving application logic out to be controlled by Smart Contracts.1213The Unique Chain also provides:1415-   Smart Contracts Pallet and example smart contract that interacts with Unique Runtime16-   ERC-1155 Functionality (currently PoC as Re-Fungible tokens, i.e. items that are still unique, but that can be split17    between multiple users)18-   Variety of economic options for dapp producers to choose from to create freemium games and other ways to attract19    users. As a step one, we implemented an economic model when a collection sponsor can be set to pay for collection20    Transfer transactions.2122Wider Unique Ecosystem (most of it was developed during Hackusama):2324-   [SubstraPunks Game hosted on IPFS](https://github.com/UniqueNetwork/substrapunks)25-   [Unique Wallet and UI](https://wallet.unique.network)26-   [NFT Asset for Unity Framework](https://github.com/usetech-llc/nft_unity)2728Please see our [walk-through instructions](doc/hackusama_walk_through.md) to try everything out!2930## Application Development3132If you are building an application that operates NFT tokens, use [this document](doc/application_development.md).333435## Building3637Building Unique chain requires special versions of Rust and toolchain. We don't use the most recent versions of everything38so that we can keep the builds stable.3940*Windows note: We do not provide support for Windows systems and don't test the Unique chain on them.41Nonetheless, the Unique chain node might work on Windows. To build it on Windows, you need to enable symlink support in Git:*42```43git config --global core.symlinks true44```45461. Install Rust:4748```bash49sudo apt-get install git curl libssl-dev llvm pkg-config libclang-dev clang make cmake protobuf-compiler50curl https://sh.rustup.rs -sSf | sh51```52532. Remove all installed toolchains with `rustup toolchain list` and `rustup toolchain uninstall <toolchain>`.54553. Install toolchain nightly-2023-05-22 and make it default:5657```bash58rustup toolchain install nightly-2023-05-2259rustup default nightly-2023-05-2260```61624. Add wasm target for nightly toolchain:6364```bash65rustup target add wasm32-unknown-unknown --toolchain nightly-2023-05-2266```67685. Build:6970Opal71```bash72cargo build --release73```74Quartz75```bash76cargo build --features=quartz-runtime --release77```78Unique79```bash80cargo build --features=unique-runtime --release81```8283## Building as Parachain locally8485Note: checkout this project and all related projects (see below) in the sibling folders (both under the same folder)8687### Build relay8889```90git clone https://github.com/paritytech/polkadot.git91cd polkadot92git checkout release-v0.9.4393cargo build --release94```9596### Build Unique parachain9798Run in the root of this project:99```100cargo build --release101```102103### Build Acala parachain (optional, full config only)104105```106git clone https://github.com/AcalaNetwork/Acala107cd Acala108git checkout 54db3acd409a0b787f116f20e163a3b24101ce38109make build-release110```111112## Running as Parachain locally113114TODO115116## Run Integration Tests1171181. Install all needed dependencies119```120cd tests121yarn install122```1231242. Run tests125```126yarn test127```128129130## Code Formatting131132### Apply formatting and clippy fixes133```bash134cargo clippy135cargo fmt136```137138### Format tests139```bash140pushd tests && yarn fix ; popd141```142143### Check code style in tests144```bash145cd tests && yarn eslint --ext .ts,.js src/146```147148### Enable checking of code style on commits149```bash150make git-hooks151```152153154## Karura token transfer155156To get started, you need to open inbound and outbound hrmp channels.157158### Next, we need to register our asset at Karura.159```160assetRegistry -> registerForeignAsset(location, metadata)161location:162	V0(X2(Parent, Parachain(PARA_ID)))163metadata:164	name         QTZ165	symbol       QTZ166	decimals     18167minimalBalance	 1168```169170### Next, we can send tokens from Quartz to Karura:171```172polkadotXcm -> reserveTransferAssets173dest:174	V0(X2(Parent, Parachain(<KARURA_PARA_ID>)))175beneficiary:176	X1(AccountId(Any, <ACCOUNT>))177assets:178	V1(Concrete(0,Here), Fungible(<AMOUNT>))179feeAssetItem:180	0181weightLimit:182	<LIMIT>183```184185The result will be displayed in ChainState186tokens -> accounts187188### To send tokens from Karura to Quartz:189```190xtokens -> transfer191192currencyId:193	ForeignAsset194		<TOKEN_ID>195196amount:197		<AMOUNT>198dest:199	V1200	(201		Parents:1,202		X2(Parachain(<KARURA_PARA_ID>), AccountId(Any, <ACCOUNT>)203	)204destWeight:205	<WEIGHT>206```