difftreelog
Fix warnings, update Dockerfile
in: master
4 files changed
Dockerfilediffbeforeafterboth--- a/Dockerfile
+++ b/Dockerfile
@@ -3,8 +3,8 @@
FROM phusion/baseimage:18.04-1.0.0 as builder
LABEL maintainer="UniqueNetwork.io"
-ENV WASM_TOOLCHAIN=nightly-2021-01-27
-ENV NATIVE_TOOLCHAIN=1.49.0
+ENV WASM_TOOLCHAIN=nightly-2021-03-01
+# ENV NATIVE_TOOLCHAIN=1.50.0
ARG PROFILE=release
@@ -25,10 +25,10 @@
RUN export PATH="/cargo-home/bin:$PATH" && \
export CARGO_HOME="/cargo-home" && \
rustup toolchain uninstall $(rustup toolchain list) && \
- rustup toolchain install $NATIVE_TOOLCHAIN && \
+ # rustup toolchain install $NATIVE_TOOLCHAIN && \
rustup toolchain install $WASM_TOOLCHAIN && \
rustup target add wasm32-unknown-unknown --toolchain $WASM_TOOLCHAIN && \
- rustup default $NATIVE_TOOLCHAIN && \
+ rustup default $WASM_TOOLCHAIN && \
rustup target list --installed && \
rustup show
README.mddiffbeforeafterboth123# NFT Parachain45## Project Description67The NFT Pallet is the core of NFT functionality. Like ERC-721 standard in Ethereum ecosystem, this pallet provides the8basement for creating collections of unique non-divisible things, also called Non Fungible Tokens (NFTs), minting NFT of9a given Collection, and managing their ownership.1011The pallet also enables storing NFT properties. Though (according to ERC-721) NFT properties belong to logic of a12concrete application that operates a Collection, so purposefully the NFT Tracking Module does not have any knowledge13about properties except their byte size leaving application logic out to be controlled by Smart Contracts.1415The NFT Chain also provides:1617- Smart Contracts Pallet and example smart contract that interacts with NFT Runtime18- ERC-1155 Functionality (currently PoC as Re-Fungible tokens, i.e. items that are still unique, but that can be split19 between multiple users)20- Variety of economic options for dapp producers to choose from to create freemium games and other ways to attract21 users. As a step one, we implemented an economic model when a collection sponsor can be set to pay for collection22 Transfer transactions.2324Wider NFT Ecosystem (most of it was developed during Hackusama):2526- [SubstraPunks Game hosted on IPFS](https://github.com/usetech-llc/substrapunks)27- [NFT Wallet and UI](https://uniqueapps.usetech.com/#/nft)28- [NFT Asset for Unity Framework](https://github.com/usetech-llc/nft_unity)2930Please see our [walk-thorugh instructions](doc/hackusama_walk_through.md) to try everything out!3132## Hackusama Update3334During the Kusama Hackaphon the following changes were made:3536- Enabled Smart Contracts Pallet37- Enabled integration between Smart Contracts and NFT Pallet (required special edition of RC4 Substrate version)38- Fixed misc. bugs in NFT Pallet39- Deployed NFT TestNet. Public node available at wss://unique.usetech.com, custom UI types - see below in this README.40- New Features:41 - Re-Fungible Token Mode42 - Off-Chain Schema to store token image URLs43 - Alternative economic model44 - White Lists and Public Mint Permission45- Use example: [SubstraPunks Game](https://github.com/usetech-llc/substrapunks), fully hosted on IPFS and NFT Testnet46 Blockchain.4748## Application Development4950If you are building an application that operates NFT tokens, use [this document](doc/application_development.md).5152## Building5354Building NFT chain requires special versions of Rust and toolchain. We don't use the most recent versions of everything55so that we can keep the builds stable.56571. Install Rust:5859```bash60curl https://sh.rustup.rs -sSf | sh61sudo apt-get install libssl-dev pkg-config libclang-dev clang62```63642. Remove all installed toolchains with `rustup toolchain list` and `rustup toolchain uninstall <toolchain>`.65663. Install stable toolchain 1.49.0 and make it default, install nightly 2021-01-27:6768```bash69rustup toolchain install 1.49.070rustup toolchain install nightly-2020-01-2771rustup default nightly-2021-01-2772```73744. Add wasm target for nightly toolchain:7576```bash77rustup target add wasm32-unknown-unknown --toolchain nightly-2021-01-2778```79805. Build:81```bash82cargo build83```8485optionally, build in release:86```bash87cargo build --release88```8990## Run9192You can start a development chain with:9394```bash95cargo run -- --dev96```9798Detailed logs may be shown by running the node with the following environment variables set:99`RUST_LOG=debug RUST_BACKTRACE=1 cargo run -- --dev`.100101If you want to see the multi-node consensus algorithm in action locally, then you can create a local testnet with two102validator nodes for Alice and Bob, who are the initial authorities of the genesis chain that have been endowed with103testnet units. Give each node a name and expose them so they are listed on the Polkadot104[telemetry site](https://telemetry.polkadot.io/#/Local%20Testnet). You'll need two terminal windows open.105106We'll start Alice's substrate node first on default TCP port 30333 with her chain database stored locally at107`/tmp/alice`. The bootnode ID of her node is `QmQZ8TjTqeDj3ciwr93EJ95hxfDsb9pEYDizUAbWpigtQN`, which is generated from108the `--node-key` value that we specify below:109110```bash111cargo run -- \112 --base-path /tmp/alice \113 --chain=local \114 --alice \115 --node-key 0000000000000000000000000000000000000000000000000000000000000001 \116 --telemetry-url ws://telemetry.polkadot.io:1024 \117 --validator118```119120In the second terminal, we'll start Bob's substrate node on a different TCP port of 30334, and with his chain database121stored locally at `/tmp/bob`. We'll specify a value for the `--bootnodes` option that will connect his node to Alice's122bootnode ID on TCP port 30333:123124```bash125cargo run -- \126 --base-path /tmp/bob \127 --bootnodes /ip4/127.0.0.1/tcp/30333/p2p/QmQZ8TjTqeDj3ciwr93EJ95hxfDsb9pEYDizUAbWpigtQN \128 --chain=local \129 --bob \130 --port 30334 \131 --telemetry-url ws://telemetry.polkadot.io:1024 \132 --validator133```134135Additional CLI usage options are available and may be shown by running `cargo run -- --help`.136137## Run Integration Tests1381391. Install all needed dependecies140```141cd tests142yarn install143```1441452. Run tests146```147yarn test148```149150151## Benchmarks152153First of all, add rust toolchain and make it default.154```bash155rustup target add wasm32-unknown-unknown --toolchain nightly-2020-10-01156```157158Then in "/node/src" run build command below159```bash160cargo +nightly-2020-10-01 build --release --features runtime-benchmarks161```162163Run benchmark164```bash165target/release/nft benchmark --chain dev --pallet "pallet_nft" --extrinsic "*" --repeat 1166```167168## UI custom types169170Moved to [runtime_types.json](./runtime_types.json).171172## Running Integration Tests173174See [tests/README.md](./tests/README.md).123# NFT Parachain45## Project Description67The NFT Pallet is the core of NFT functionality. Like ERC-721 standard in Ethereum ecosystem, this pallet provides the8basement for creating collections of unique non-divisible things, also called Non Fungible Tokens (NFTs), minting NFT of9a given Collection, and managing their ownership.1011The pallet also enables storing NFT properties. Though (according to ERC-721) NFT properties belong to logic of a12concrete application that operates a Collection, so purposefully the NFT Tracking Module does not have any knowledge13about properties except their byte size leaving application logic out to be controlled by Smart Contracts.1415The NFT Chain also provides:1617- Smart Contracts Pallet and example smart contract that interacts with NFT Runtime18- ERC-1155 Functionality (currently PoC as Re-Fungible tokens, i.e. items that are still unique, but that can be split19 between multiple users)20- Variety of economic options for dapp producers to choose from to create freemium games and other ways to attract21 users. As a step one, we implemented an economic model when a collection sponsor can be set to pay for collection22 Transfer transactions.2324Wider NFT Ecosystem (most of it was developed during Hackusama):2526- [SubstraPunks Game hosted on IPFS](https://github.com/usetech-llc/substrapunks)27- [NFT Wallet and UI](https://uniqueapps.usetech.com/#/nft)28- [NFT Asset for Unity Framework](https://github.com/usetech-llc/nft_unity)2930Please see our [walk-thorugh instructions](doc/hackusama_walk_through.md) to try everything out!3132## Hackusama Update3334During the Kusama Hackaphon the following changes were made:3536- Enabled Smart Contracts Pallet37- Enabled integration between Smart Contracts and NFT Pallet (required special edition of RC4 Substrate version)38- Fixed misc. bugs in NFT Pallet39- Deployed NFT TestNet. Public node available at wss://unique.usetech.com, custom UI types - see below in this README.40- New Features:41 - Re-Fungible Token Mode42 - Off-Chain Schema to store token image URLs43 - Alternative economic model44 - White Lists and Public Mint Permission45- Use example: [SubstraPunks Game](https://github.com/usetech-llc/substrapunks), fully hosted on IPFS and NFT Testnet46 Blockchain.4748## Application Development4950If you are building an application that operates NFT tokens, use [this document](doc/application_development.md).5152## Building5354Building NFT chain requires special versions of Rust and toolchain. We don't use the most recent versions of everything55so that we can keep the builds stable.56571. Install Rust:5859```bash60curl https://sh.rustup.rs -sSf | sh61sudo apt-get install libssl-dev pkg-config libclang-dev clang62```63642. Remove all installed toolchains with `rustup toolchain list` and `rustup toolchain uninstall <toolchain>`.65663. Install install nightly 2021-03-01 and make it default:6768```bash69rustup toolchain install nightly-2021-03-0170rustup default nightly-2021-03-0171```72734. Add wasm target for nightly toolchain:7475```bash76rustup target add wasm32-unknown-unknown --toolchain nightly-2021-03-0177```78795. Build:80```bash81cargo build82```8384optionally, build in release:85```bash86cargo build --release87```8889## Run9091You can start a development chain with:9293```bash94cargo run -- --dev95```9697Detailed logs may be shown by running the node with the following environment variables set:98`RUST_LOG=debug RUST_BACKTRACE=1 cargo run -- --dev`.99100If you want to see the multi-node consensus algorithm in action locally, then you can create a local testnet with two101validator nodes for Alice and Bob, who are the initial authorities of the genesis chain that have been endowed with102testnet units. Give each node a name and expose them so they are listed on the Polkadot103[telemetry site](https://telemetry.polkadot.io/#/Local%20Testnet). You'll need two terminal windows open.104105We'll start Alice's substrate node first on default TCP port 30333 with her chain database stored locally at106`/tmp/alice`. The bootnode ID of her node is `QmQZ8TjTqeDj3ciwr93EJ95hxfDsb9pEYDizUAbWpigtQN`, which is generated from107the `--node-key` value that we specify below:108109```bash110cargo run -- \111 --base-path /tmp/alice \112 --chain=local \113 --alice \114 --node-key 0000000000000000000000000000000000000000000000000000000000000001 \115 --telemetry-url ws://telemetry.polkadot.io:1024 \116 --validator117```118119In the second terminal, we'll start Bob's substrate node on a different TCP port of 30334, and with his chain database120stored locally at `/tmp/bob`. We'll specify a value for the `--bootnodes` option that will connect his node to Alice's121bootnode ID on TCP port 30333:122123```bash124cargo run -- \125 --base-path /tmp/bob \126 --bootnodes /ip4/127.0.0.1/tcp/30333/p2p/QmQZ8TjTqeDj3ciwr93EJ95hxfDsb9pEYDizUAbWpigtQN \127 --chain=local \128 --bob \129 --port 30334 \130 --telemetry-url ws://telemetry.polkadot.io:1024 \131 --validator132```133134Additional CLI usage options are available and may be shown by running `cargo run -- --help`.135136## Run Integration Tests1371381. Install all needed dependecies139```140cd tests141yarn install142```1431442. Run tests145```146yarn test147```148149150## Benchmarks151152First of all, add rust toolchain and make it default.153```bash154rustup target add wasm32-unknown-unknown --toolchain nightly-2020-10-01155```156157Then in "/node/src" run build command below158```bash159cargo +nightly-2020-10-01 build --release --features runtime-benchmarks160```161162Run benchmark163```bash164target/release/nft benchmark --chain dev --pallet "pallet_nft" --extrinsic "*" --repeat 1165```166167## UI custom types168169Moved to [runtime_types.json](./runtime_types.json).170171## Running Integration Tests172173See [tests/README.md](./tests/README.md).node/src/service.rsdiffbeforeafterboth--- a/node/src/service.rs
+++ b/node/src/service.rs
@@ -16,7 +16,6 @@
use sp_consensus_aura::sr25519::{AuthorityPair as AuraPair};
use sc_finality_grandpa::SharedVoterState;
use sc_keystore::LocalKeystore;
-use sc_telemetry::TelemetrySpan;
// Our native executor instance.
native_executor_instance!(
pallets/nft/src/lib.rsdiffbeforeafterboth--- a/pallets/nft/src/lib.rs
+++ b/pallets/nft/src/lib.rs
@@ -43,7 +43,6 @@
};
use sp_runtime::traits::StaticLookup;
use pallet_contracts::chain_extension::UncheckedFrom;
-use pallet_contracts::*;
use pallet_transaction_payment::OnChargeTransaction;
#[cfg(test)]
@@ -1118,13 +1117,11 @@
// Transfer permissions check
let target_collection = <Collection<T>>::get(collection_id);
- let allowance_limit = if (
- target_collection.limits.owner_can_transfer &&
+ let allowance_limit = if target_collection.limits.owner_can_transfer &&
Self::is_owner_or_admin_permissions(
collection_id,
sender.clone(),
- )
- ) {
+ ) {
None
} else if let Some(amount) = Self::owned_amount(
sender.clone(),