git.delta.rocks / unique-network / refs/commits / 5ecbc869df92

difftreelog

Merge branch 'develop' into feature/NFTPAR-96

sotmorskiy2020-11-26parents: #31f6053 #eaea941.patch.diff
in: master
# Conflicts:
#	pallets/nft/src/lib.rs
#	pallets/nft/src/tests.rs

34 files changed

modified.dockerignorediffbeforeafterboth
--- a/.dockerignore
+++ b/.dockerignore
@@ -3,4 +3,4 @@
 doc/
 target/
 chain-data*/
-smart_contract/
\ No newline at end of file
+smart_contract/
modifiedCargo.lockdiffbeforeafterboth
before · Cargo.lock
599 packageslockfile v1
modifiedDockerfilediffbeforeafterboth
--- a/Dockerfile
+++ b/Dockerfile
@@ -3,7 +3,7 @@
 FROM phusion/baseimage:0.10.2 as builder
 LABEL maintainer="gz@usetech.com"
 
-ENV WASM_TOOLCHAIN=nightly-2020-05-01
+ENV WASM_TOOLCHAIN=nightly-2020-10-01
 
 ARG PROFILE=release
 
@@ -17,19 +17,23 @@
 WORKDIR /nft_parachain
 COPY . .
 
-RUN curl https://sh.rustup.rs -sSf | sh -s -- -y && \
-	export PATH="$PATH:$HOME/.cargo/bin" && \
+RUN export CARGO_HOME="/cargo-home" && curl https://sh.rustup.rs -sSf | sh -s -- -y
+RUN export PATH="/cargo-home/bin:$PATH" && \
+    export CARGO_HOME="/cargo-home" && \
+	cargo fetch
+RUN export PATH="/cargo-home/bin:$PATH" && \
+    export CARGO_HOME="/cargo-home" && \
 	rustup toolchain uninstall $(rustup toolchain list) && \
-	rustup default 1.44.0 && \
 	rustup toolchain install $WASM_TOOLCHAIN && \
 	rustup target add wasm32-unknown-unknown --toolchain $WASM_TOOLCHAIN && \
     rustup target list --installed && \
-    rustup show && \
-	cargo build "--$PROFILE" 
+    rustup show
+
+RUN export PATH="/cargo-home/bin:$PATH" && \
+    export CARGO_HOME="/cargo-home" && \
+	cargo +$WASM_TOOLCHAIN build "--$PROFILE"
 	# && \
 	# cargo test
-
-RUN cd target/release && ls -la
 
 # ===== RUN ======
 
modifiedREADME.mddiffbeforeafterboth
--- a/README.md
+++ b/README.md
@@ -115,7 +115,23 @@
 
 Additional CLI usage options are available and may be shown by running `cargo run -- --help`.
 
+## Benchmarks
 
+First of all, add rust toolchain and make it default.
+```bash
+rustup target add wasm32-unknown-unknown --toolchain nightly-2020-10-01
+```
+
+Then in "/node/src" run build command below
+```bash
+cargo +nightly-2020-10-01 build --release --features runtime-benchmarks
+```
+
+Run benchmark
+```bash
+target/release/nft benchmark --chain dev --pallet "pallet_nft" --extrinsic "*" --repeat 1
+```
+
 ## UI custom types
 ```
 {
@@ -151,9 +167,9 @@
   "CollectionMode": {
     "_enum": {
       "Invalid": null,
-      "NFT": "u32",
+      "NFT": null,
       "Fungible": "u32",
-      "ReFungible": "(u32, u32)"
+      "ReFungible": "u32"
     }
   },
   "Ownership": {
@@ -173,7 +189,8 @@
   "NftItemType": {
     "Collection": "u64",
     "Owner": "AccountId",
-    "Data": "Vec<u8>"
+    "ConstData": "Vec<u8>",
+    "VariableData": "Vec<u8>"
   },
   "Ownership": {
     "owner": "AccountId",
@@ -182,7 +199,8 @@
   "ReFungibleItemType": {
     "Collection": "u64",
     "Owner": "Vec<Ownership<AccountId>>",
-    "Data": "Vec<u8>"
+    "ConstData": "Vec<u8>",
+    "VariableData": "Vec<u8>"
   },
   "CollectionType": {
     "Owner": "AccountId",
@@ -192,11 +210,12 @@
     "Name": "Vec<u16>",
     "Description": "Vec<u16>",
     "TokenPrefix": "Vec<u8>",
-    "CustomDataSize": "u32",
     "MintMode": "bool",
     "OffchainSchema": "Vec<u8>",
     "Sponsor": "AccountId",
-    "UnconfirmedSponsor": "AccountId"
+    "UnconfirmedSponsor": "AccountId",
+    "VariableOnChainSchema": "Vec<u8>",
+    "ConstOnChainSchema": "Vec<u8>"
   },
   "ApprovePermissions": {
     "Approved": "AccountId",
@@ -205,7 +224,23 @@
   "RawData": "Vec<u8>",
   "Address": "AccountId",
   "LookupSource": "AccountId",
-  "Weight": "u64"
+  "Weight": "u64",
+  "CreateNftData": {
+    "const_data": "Vec<u8>",
+    "variable_data": "Vec<u8>" 
+  },
+  "CreateFungibleData": {},
+  "CreateReFungibleData": {
+    "const_data": "Vec<u8>",
+    "variable_data": "Vec<u8>" 
+  },
+  "CreateItemData": {
+    "_enum": {
+      "NFT": "CreateNftData",
+      "Fungible": "CreateFungibleData",
+      "ReFungible": "CreateReFungibleData"
+    }
+  }
 }
 
 ```
\ No newline at end of file
addeddoc/milestone_1.mddiffbeforeafterboth
--- /dev/null
+++ b/doc/milestone_1.md
@@ -0,0 +1,65 @@
+## Milestone 1
+
+**User Paid Fees and Sponsored. Finish/Debug white listing and spam/DOS protection**
+
+Implementation of two models 
+If collection sponsor is set and confirmed for collection instance that means Sponsored Economic Model has chosen. Otherwise default economic model User Paid Fees is set.
+For Sponsored Economic Model exists timeouts for token transactions. For every NFT type timeouts defined separately. Timeouts and white list limits together prevented spam and malicious actions.
+
+Set sponsor
+`nft`.`set_collection_sponsor`
+Confirm sponsor
+`nft`.`confirm_sponsorship`
+
+A white list mode presented by collection property `access` and can be enabled with `set_public_access_mode`. Rules provide spam/DOS protection
+While collection in the white list mode rules below are active:
+Owner can add address to white list
+Admin can add address to white list
+Non-privileged user cannot add address to white list
+Owner can remove address from white list
+Admin can remove address from white list
+Non-privileged user cannot remove address from white list
+If Public Access mode is set to WhiteList, tokens can’t be transferred from a non-whitelisted address with transfer or transferFrom
+If Public Access mode is set to WhiteList, tokens can’t be transferred to a non-whitelisted address with transfer or transferFrom
+If Public Access mode is set to WhiteList, tokens can’t be destroyed by a non-whitelisted address (even if it owned them before enabling WhiteList mode)
+If Public Access mode is set to WhiteList, token transfers can’t be Approved by a non-whitelisted address (see Approve method).
+If Public Access mode is set to WhiteList, tokens can be transferred to a whitelisted address with transfer or transferFrom
+If Public Access mode is set to WhiteList, tokens can be transferred from a whitelisted address with transfer or transferFrom 
+If Public Access mode is set to WhiteList, and Mint Permission is set to false, tokens can be created by owner.
+If Public Access mode is set to WhiteList, and Mint Permission is set to false, tokens can be created by admin.
+If Public Access mode is set to WhiteList, and Mint Permission is set to false, tokens cannot be created by non-privileged and white listed address.
+If Public Access mode is set to WhiteList, and Mint Permission is set to false, tokens cannot be created by non-privileged and non-white listed address.
+If Public Access mode is set to WhiteList, and Mint Permission is set to true, tokens can be created by owner.
+If Public Access mode is set to WhiteList, and Mint Permission is set to true, tokens can be created by admin.
+If Public Access mode is set to WhiteList, and Mint Permission is set to true, tokens cannot be created by non-privileged and non-white listed address.
+If Public Access mode is set to WhiteList, and Mint Permission is set to true, tokens can be created by non-privileged and white listed address.
+
+**Add missing custom types (CollectionMode, FungibleItemType, ReFungibleItemType)**
+
+Follow types defined
+```
+pub struct NftItemType<AccountId> {
+    pub collection: u64,
+    pub owner: AccountId,
+    pub data: Vec<u8>,
+}
+pub struct FungibleItemType<AccountId> {
+    pub collection: u64,
+    pub owner: AccountId,
+    pub value: u128,
+}
+pub struct ReFungibleItemType<AccountId> {
+    pub collection: u64,
+    pub owner: Vec<Ownership<AccountId>>,
+    pub data: Vec<u8>,
+}
+```
+
+**Add substrate bounds for number of collections, owned tokens, and number of collection admins.**
+
+Bounds defined in chain specification and can be set with 'sudo' privileges `nft`.`set_chain_limits`.
+
+**Add/document extra genesis**
+
+Extra genesis defined in `node/src/chain_spec.rs` file. Configuration consist from 5 items:
+Collection list,  Nft items list, Fungible items list, Refungible items list, Chain limits
\ No newline at end of file
modifiednode/Cargo.tomldiffbeforeafterboth
--- a/node/Cargo.toml
+++ b/node/Cargo.toml
@@ -1,7 +1,7 @@
 [build-dependencies.substrate-build-script-utils]
 git = 'https://github.com/usetech-llc/substrate.git'
-branch = 'rc4_ext_dispatch_reenabled'
-version = '2.0.0-rc4'
+branch = 'v2.0.0_release'
+version = '2.0.0'
 
 [[bin]]
 name = 'nft'
@@ -15,7 +15,7 @@
 license = 'Unlicense'
 name = 'nft'
 repository = 'https://github.com/substrate-developer-hub/nft/'
-version = '2.0.0-rc4'
+version = '2.0.0'
 
 [package.metadata.docs.rs]
 targets = ['x86_64-unknown-linux-gnu']
@@ -25,102 +25,38 @@
 log = '0.4.8'
 parking_lot = '0.10.0'
 structopt = '0.3.8'
-jsonrpc-core = '14.0.5'
+jsonrpc-core = '15.0.0'
 
-[dependencies.nft-runtime]
-path = '../runtime'
-version = '2.0.0-rc4'
-
-[dependencies.sc-basic-authorship]
-git = 'https://github.com/usetech-llc/substrate.git'
-branch = 'rc4_ext_dispatch_reenabled'
-version = '0.8.0-rc4'
+# Substrate dependencies
+nft-runtime = { path = '../runtime', version = '2.0.0' }
+frame-benchmarking = {version = '2.0.0', git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release'}
+frame-benchmarking-cli = {version = '2.0.0', git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release'}
+pallet-transaction-payment-rpc = {version = '2.0.0', git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release'}
+sc-basic-authorship = {version = '0.8.0', git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release'}
+sc-cli = { features = ['wasmtime'], version = '0.8.0', git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release' }
+sc-client-api = {version = '2.0.0', git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release'}
+sc-consensus = {version = '0.8.0', git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release'}
+sc-consensus-aura = {version = '0.8.0', git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release'}
+sc-executor = { features = ['wasmtime'], version = '0.8.0', git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release' }
+sc-finality-grandpa = {version = '0.8.0', git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release'}
+sc-rpc = {version = '2.0.0', git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release'}
+sc-rpc-api = {version = '0.8.0', git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release'}
+sc-service = { features = ['wasmtime'], version = '0.8.0', git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release' }
+sc-transaction-pool = {version = '2.0.0', git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release'}
+sp-api = {version = '2.0.0', git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release'}
+sp-block-builder = {version = '2.0.0', git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release'}
+sp-blockchain = {version = '2.0.0', git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release'}
+sp-consensus = {version = '0.8.0', git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release'}
+sp-consensus-aura = {version = '0.8.0', git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release'}
+sp-core = {version = '2.0.0', git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release'}
+sp-finality-grandpa = {version = '2.0.0', git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release'}
+sp-inherents = {version = '2.0.0', git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release'}
+sp-runtime = {version = '2.0.0', git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release'}
+sp-transaction-pool = {version = '2.0.0', git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release'}
+sc-network = {version = '0.8.0', git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release'} 
+substrate-frame-rpc-system = {version = '2.0.0', git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release'}
+pallet-contracts-rpc = {version = '0.8.0', git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release'} 
 
-[dependencies.sc-cli]
-git = 'https://github.com/usetech-llc/substrate.git'
-branch = 'rc4_ext_dispatch_reenabled'
-version = '0.8.0-rc4'
-
-[dependencies.sc-client-api]
-git = 'https://github.com/usetech-llc/substrate.git'
-branch = 'rc4_ext_dispatch_reenabled'
-version = '2.0.0-rc4'
-
-[dependencies.sc-consensus]
-git = 'https://github.com/usetech-llc/substrate.git'
-branch = 'rc4_ext_dispatch_reenabled'
-version = '0.8.0-rc4'
-
-[dependencies.pallet-contracts-rpc]
-git = 'https://github.com/usetech-llc/substrate.git'
-version = '0.8.0-rc4'
-branch = 'rc4_ext_dispatch_reenabled'
-
-[dependencies.sc-rpc]
-git = 'https://github.com/usetech-llc/substrate.git'
-branch = 'rc4_ext_dispatch_reenabled'
-
-[dependencies.sc-consensus-aura]
-git = 'https://github.com/usetech-llc/substrate.git'
-branch = 'rc4_ext_dispatch_reenabled'
-version = '0.8.0-rc4'
-
-[dependencies.sc-executor]
-git = 'https://github.com/usetech-llc/substrate.git'
-branch = 'rc4_ext_dispatch_reenabled'
-version = '0.8.0-rc4'
-
-[dependencies.sc-finality-grandpa]
-git = 'https://github.com/usetech-llc/substrate.git'
-branch = 'rc4_ext_dispatch_reenabled'
-version = '0.8.0-rc4'
-
-[dependencies.sc-network]
-git = 'https://github.com/usetech-llc/substrate.git'
-branch = 'rc4_ext_dispatch_reenabled'
-version = '0.8.0-rc4'
-
-[dependencies.sc-service]
-git = 'https://github.com/usetech-llc/substrate.git'
-branch = 'rc4_ext_dispatch_reenabled'
-version = '0.8.0-rc4'
-
-[dependencies.sc-transaction-pool]
-git = 'https://github.com/usetech-llc/substrate.git'
-branch = 'rc4_ext_dispatch_reenabled'
-version = '2.0.0-rc4'
-
-[dependencies.sp-consensus]
-git = 'https://github.com/usetech-llc/substrate.git'
-branch = 'rc4_ext_dispatch_reenabled'
-version = '0.8.0-rc4'
-
-[dependencies.sp-consensus-aura]
-git = 'https://github.com/usetech-llc/substrate.git'
-branch = 'rc4_ext_dispatch_reenabled'
-version = '0.8.0-rc4'
-
-[dependencies.sp-core]
-git = 'https://github.com/usetech-llc/substrate.git'
-branch = 'rc4_ext_dispatch_reenabled'
-version = '2.0.0-rc4'
-
-[dependencies.sp-finality-grandpa]
-git = 'https://github.com/usetech-llc/substrate.git'
-branch = 'rc4_ext_dispatch_reenabled'
-version = '2.0.0-rc4'
-
-[dependencies.sp-inherents]
-git = 'https://github.com/usetech-llc/substrate.git'
-branch = 'rc4_ext_dispatch_reenabled'
-version = '2.0.0-rc4'
-
-[dependencies.sp-runtime]
-git = 'https://github.com/usetech-llc/substrate.git'
-branch = 'rc4_ext_dispatch_reenabled'
-version = '2.0.0-rc4'
-
-[dependencies.sp-transaction-pool]
-git = 'https://github.com/usetech-llc/substrate.git'
-branch = 'rc4_ext_dispatch_reenabled'
-version = '2.0.0-rc4'
+[features]
+default = []
+runtime-benchmarks = ['nft-runtime/runtime-benchmarks']
modifiednode/src/chain_spec.rsdiffbeforeafterboth
--- a/node/src/chain_spec.rs
+++ b/node/src/chain_spec.rs
@@ -38,70 +38,95 @@
     (get_from_seed::<AuraId>(s), get_from_seed::<GrandpaId>(s))
 }
 
-pub fn development_config() -> ChainSpec {
-    ChainSpec::from_genesis(
-        "Development",
-        "dev",
-        ChainType::Development,
-        || {
-            testnet_genesis(
-                vec![authority_keys_from_seed("Alice")],
-                get_account_id_from_seed::<sr25519::Public>("Alice"),
-                vec![
-                    get_account_id_from_seed::<sr25519::Public>("Alice"),
-                    get_account_id_from_seed::<sr25519::Public>("Bob"),
-                    get_account_id_from_seed::<sr25519::Public>("Alice//stash"),
-                    get_account_id_from_seed::<sr25519::Public>("Bob//stash"),
-                ],
-                true,
-            )
-        },
-        vec![],
-        None,
-        None,
-        None,
-        None,
-    )
+pub fn development_config() -> Result<ChainSpec, String> {
+	let wasm_binary = WASM_BINARY.ok_or("Development wasm binary not available".to_string())?;
+
+	Ok(ChainSpec::from_genesis(
+		// Name
+		"Development",
+		// ID
+		"dev",
+		ChainType::Development,
+		move || testnet_genesis(
+			wasm_binary,
+			// Initial PoA authorities
+			vec![
+				authority_keys_from_seed("Alice"),
+			],
+			// Sudo account
+			get_account_id_from_seed::<sr25519::Public>("Alice"),
+			// Pre-funded accounts
+			vec![
+				get_account_id_from_seed::<sr25519::Public>("Alice"),
+				get_account_id_from_seed::<sr25519::Public>("Bob"),
+				get_account_id_from_seed::<sr25519::Public>("Alice//stash"),
+				get_account_id_from_seed::<sr25519::Public>("Bob//stash"),
+			],
+			true,
+		),
+		// Bootnodes
+		vec![],
+		// Telemetry
+		None,
+		// Protocol ID
+		None,
+		// Properties
+		None,
+		// Extensions
+		None,
+	))
 }
 
-pub fn local_testnet_config() -> ChainSpec {
-    ChainSpec::from_genesis(
-        "Local Testnet",
-        "local_testnet",
-        ChainType::Local,
-        || {
-            testnet_genesis(
-                vec![
-                    authority_keys_from_seed("Alice"),
-                    authority_keys_from_seed("Bob"),
-                ],
-                get_account_id_from_seed::<sr25519::Public>("Alice"),
-                vec![
-                    get_account_id_from_seed::<sr25519::Public>("Alice"),
-                    get_account_id_from_seed::<sr25519::Public>("Bob"),
-                    get_account_id_from_seed::<sr25519::Public>("Charlie"),
-                    get_account_id_from_seed::<sr25519::Public>("Dave"),
-                    get_account_id_from_seed::<sr25519::Public>("Eve"),
-                    get_account_id_from_seed::<sr25519::Public>("Ferdie"),
-                    get_account_id_from_seed::<sr25519::Public>("Alice//stash"),
-                    get_account_id_from_seed::<sr25519::Public>("Bob//stash"),
-                    get_account_id_from_seed::<sr25519::Public>("Charlie//stash"),
-                    get_account_id_from_seed::<sr25519::Public>("Dave//stash"),
-                    get_account_id_from_seed::<sr25519::Public>("Eve//stash"),
-                    get_account_id_from_seed::<sr25519::Public>("Ferdie//stash"),
-                ],
-                true,
-            )
-        },
-        vec![],
-        None,
-        None,
-        None,
-        None,
-    )
+pub fn local_testnet_config() -> Result<ChainSpec, String> {
+	let wasm_binary = WASM_BINARY.ok_or("Development wasm binary not available".to_string())?;
+
+	Ok(ChainSpec::from_genesis(
+		// Name
+		"Local Testnet",
+		// ID
+		"local_testnet",
+		ChainType::Local,
+		move || testnet_genesis(
+			wasm_binary,
+			// Initial PoA authorities
+			vec![
+				authority_keys_from_seed("Alice"),
+				authority_keys_from_seed("Bob"),
+			],
+			// Sudo account
+			get_account_id_from_seed::<sr25519::Public>("Alice"),
+			// Pre-funded accounts
+			vec![
+				get_account_id_from_seed::<sr25519::Public>("Alice"),
+				get_account_id_from_seed::<sr25519::Public>("Bob"),
+				get_account_id_from_seed::<sr25519::Public>("Charlie"),
+				get_account_id_from_seed::<sr25519::Public>("Dave"),
+				get_account_id_from_seed::<sr25519::Public>("Eve"),
+				get_account_id_from_seed::<sr25519::Public>("Ferdie"),
+				get_account_id_from_seed::<sr25519::Public>("Alice//stash"),
+				get_account_id_from_seed::<sr25519::Public>("Bob//stash"),
+				get_account_id_from_seed::<sr25519::Public>("Charlie//stash"),
+				get_account_id_from_seed::<sr25519::Public>("Dave//stash"),
+				get_account_id_from_seed::<sr25519::Public>("Eve//stash"),
+				get_account_id_from_seed::<sr25519::Public>("Ferdie//stash"),
+			],
+			true,
+		),
+		// Bootnodes
+		vec![],
+		// Telemetry
+		None,
+		// Protocol ID
+		None,
+		// Properties
+		None,
+		// Extensions
+		None,
+	))
 }
 
 fn testnet_genesis(
+    wasm_binary: &[u8],
     initial_authorities: Vec<(AuraId, GrandpaId)>,
     root_key: AccountId,
     endowed_accounts: Vec<AccountId>,
@@ -109,42 +134,43 @@
 ) -> GenesisConfig {
     GenesisConfig {
         system: Some(SystemConfig {
-            code: WASM_BINARY.to_vec(),
+            code: wasm_binary.to_vec(),
             changes_trie_config: Default::default(),
         }),
-        balances: Some(BalancesConfig {
+        pallet_balances: Some(BalancesConfig {
             balances: endowed_accounts
                 .iter()
                 .cloned()
                 .map(|k| (k, 1 << 100))
                 .collect(),
         }),
-        aura: Some(AuraConfig {
+        pallet_aura: Some(AuraConfig {
             authorities: initial_authorities.iter().map(|x| (x.0.clone())).collect(),
         }),
-        grandpa: Some(GrandpaConfig {
+        pallet_grandpa: Some(GrandpaConfig {
             authorities: initial_authorities
                 .iter()
                 .map(|x| (x.1.clone(), 1))
                 .collect(),
         }),
-        sudo: Some(SudoConfig { key: root_key }),
-        nft: Some(NftConfig {
+        pallet_sudo: Some(SudoConfig { key: root_key }),
+        pallet_nft: Some(NftConfig {
             collection: vec![(
                 1,
                 CollectionType {
                     owner: get_account_id_from_seed::<sr25519::Public>("Alice"),
-                    mode: CollectionMode::NFT(50),
+                    mode: CollectionMode::NFT,
                     access: AccessMode::Normal,
                     decimal_points: 0,
                     name: vec![],
                     description: vec![],
                     token_prefix: vec![],
-                    custom_data_size: 50,
                     mint_mode: false,
                     offchain_schema: vec![],
                     sponsor: get_account_id_from_seed::<sr25519::Public>("Alice"),
                     unconfirmed_sponsor: get_account_id_from_seed::<sr25519::Public>("Alice"),
+                    const_on_chain_schema: vec![],
+                    variable_on_chain_schema: vec![]
                 },
             )],
             nft_item_id: vec![],
@@ -160,7 +186,7 @@
                 refungible_sponsor_transfer_timeout: 15,
             },
         }),
-        contracts: Some(ContractsConfig {
+        pallet_contracts: Some(ContractsConfig {
             current_schedule: ContractsSchedule {
                 enable_println,
                 ..Default::default()
modifiednode/src/cli.rsdiffbeforeafterboth
--- a/node/src/cli.rs
+++ b/node/src/cli.rs
@@ -1,11 +1,39 @@
-use sc_cli::{RunCmd, Subcommand};
 use structopt::StructOpt;
+use sc_cli::RunCmd;
 
 #[derive(Debug, StructOpt)]
 pub struct Cli {
-    #[structopt(subcommand)]
-    pub subcommand: Option<Subcommand>,
+	#[structopt(subcommand)]
+	pub subcommand: Option<Subcommand>,
+
+	#[structopt(flatten)]
+	pub run: RunCmd,
+}
+
+#[derive(Debug, StructOpt)]
+pub enum Subcommand {
+	/// Build a chain specification.
+	BuildSpec(sc_cli::BuildSpecCmd),
+
+	/// Validate blocks.
+	CheckBlock(sc_cli::CheckBlockCmd),
+
+	/// Export blocks.
+	ExportBlocks(sc_cli::ExportBlocksCmd),
+
+	/// Export the state of a given block into a chain spec.
+	ExportState(sc_cli::ExportStateCmd),
+
+	/// Import blocks.
+	ImportBlocks(sc_cli::ImportBlocksCmd),
 
-    #[structopt(flatten)]
-    pub run: RunCmd,
+	/// Remove the whole chain.
+	PurgeChain(sc_cli::PurgeChainCmd),
+
+	/// Revert the chain to a previous state.
+	Revert(sc_cli::RevertCmd),
+
+	// The custom benchmark subcommmand benchmarking runtime pallets.
+	#[structopt(name = "benchmark", about = "Benchmark runtime pallets.")]
+	Benchmark(frame_benchmarking_cli::BenchmarkCmd),
 }
modifiednode/src/command.rsdiffbeforeafterboth
--- a/node/src/command.rs
+++ b/node/src/command.rs
@@ -15,63 +15,121 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-use crate::chain_spec;
-use crate::cli::Cli;
-use crate::service;
-use sc_cli::SubstrateCli;
+use crate::{chain_spec, service};
+use crate::cli::{Cli, Subcommand};
+use sc_cli::{SubstrateCli, RuntimeVersion, Role, ChainSpec};
+use sc_service::PartialComponents;
+use nft_runtime::Block;
 
 impl SubstrateCli for Cli {
-    fn impl_name() -> &'static str {
-        "Substrate Node"
-    }
+	fn impl_name() -> String {
+		"Substrate Node".into()
+	}
 
-    fn impl_version() -> &'static str {
-        env!("SUBSTRATE_CLI_IMPL_VERSION")
-    }
+	fn impl_version() -> String {
+		env!("SUBSTRATE_CLI_IMPL_VERSION").into()
+	}
 
-    fn description() -> &'static str {
-        env!("CARGO_PKG_DESCRIPTION")
-    }
+	fn description() -> String {
+		env!("CARGO_PKG_DESCRIPTION").into()
+	}
 
-    fn author() -> &'static str {
-        env!("CARGO_PKG_AUTHORS")
-    }
+	fn author() -> String {
+		env!("CARGO_PKG_AUTHORS").into()
+	}
 
-    fn support_url() -> &'static str {
-        "support.anonymous.an"
-    }
+	fn support_url() -> String {
+		"support.anonymous.an".into()
+	}
 
-    fn copyright_start_year() -> i32 {
-        2017
-    }
+	fn copyright_start_year() -> i32 {
+		2017
+	}
 
-    fn executable_name() -> &'static str {
-        env!("CARGO_PKG_NAME")
-    }
+	fn load_spec(&self, id: &str) -> Result<Box<dyn sc_service::ChainSpec>, String> {
+		Ok(match id {
+			"dev" => Box::new(chain_spec::development_config()?),
+			"" | "local" => Box::new(chain_spec::local_testnet_config()?),
+			path => Box::new(chain_spec::ChainSpec::from_json_file(
+				std::path::PathBuf::from(path),
+			)?),
+		})
+	}
 
-    fn load_spec(&self, id: &str) -> Result<Box<dyn sc_service::ChainSpec>, String> {
-        Ok(match id {
-            "dev" => Box::new(chain_spec::development_config()),
-            "" | "local" => Box::new(chain_spec::local_testnet_config()),
-            path => Box::new(chain_spec::ChainSpec::from_json_file(
-                std::path::PathBuf::from(path),
-            )?),
-        })
-    }
+	fn native_runtime_version(_: &Box<dyn ChainSpec>) -> &'static RuntimeVersion {
+		&nft_runtime::VERSION
+	}
 }
 
 /// Parse and run command line arguments
 pub fn run() -> sc_cli::Result<()> {
-    let cli = Cli::from_args();
+	let cli = Cli::from_args();
+
+	match &cli.subcommand {
+		Some(Subcommand::BuildSpec(cmd)) => {
+			let runner = cli.create_runner(cmd)?;
+			runner.sync_run(|config| cmd.run(config.chain_spec, config.network))
+		},
+		Some(Subcommand::CheckBlock(cmd)) => {
+			let runner = cli.create_runner(cmd)?;
+			runner.async_run(|config| {
+				let PartialComponents { client, task_manager, import_queue, ..}
+					= service::new_partial(&config)?;
+				Ok((cmd.run(client, import_queue), task_manager))
+			})
+		},
+		Some(Subcommand::ExportBlocks(cmd)) => {
+			let runner = cli.create_runner(cmd)?;
+			runner.async_run(|config| {
+				let PartialComponents { client, task_manager, ..}
+					= service::new_partial(&config)?;
+				Ok((cmd.run(client, config.database), task_manager))
+			})
+		},
+		Some(Subcommand::ExportState(cmd)) => {
+			let runner = cli.create_runner(cmd)?;
+			runner.async_run(|config| {
+				let PartialComponents { client, task_manager, ..}
+					= service::new_partial(&config)?;
+				Ok((cmd.run(client, config.chain_spec), task_manager))
+			})
+		},
+		Some(Subcommand::ImportBlocks(cmd)) => {
+			let runner = cli.create_runner(cmd)?;
+			runner.async_run(|config| {
+				let PartialComponents { client, task_manager, import_queue, ..}
+					= service::new_partial(&config)?;
+				Ok((cmd.run(client, import_queue), task_manager))
+			})
+		},
+		Some(Subcommand::PurgeChain(cmd)) => {
+			let runner = cli.create_runner(cmd)?;
+			runner.sync_run(|config| cmd.run(config.database))
+		},
+		Some(Subcommand::Revert(cmd)) => {
+			let runner = cli.create_runner(cmd)?;
+			runner.async_run(|config| {
+				let PartialComponents { client, task_manager, backend, ..}
+					= service::new_partial(&config)?;
+				Ok((cmd.run(client, backend), task_manager))
+			})
+		},
+		Some(Subcommand::Benchmark(cmd)) => {
+			if cfg!(feature = "runtime-benchmarks") {
+				let runner = cli.create_runner(cmd)?;
 
-    match &cli.subcommand {
-        Some(subcommand) => {
-            let runner = cli.create_runner(subcommand)?;
-            runner.run_subcommand(subcommand, |config| Ok(new_full_start!(config).0))
-        }
-        None => {
-            let runner = cli.create_runner(&cli.run)?;
-            runner.run_node(service::new_light, service::new_full, nft_runtime::VERSION)
-        }
-    }
+				runner.sync_run(|config| cmd.run::<Block, service::Executor>(config))
+			} else {
+				Err("Benchmarking wasn't enabled when building the node. \
+				You can enable it with `--features runtime-benchmarks`.".into())
+			}
+		},
+		None => {
+			let runner = cli.create_runner(&cli.run)?;
+			runner.run_node_until_exit(|config| match config.role {
+				Role::Light => service::new_light(config),
+				_ => service::new_full(config),
+			})
+		}
+	}
 }
addednode/src/lib.rsdiffbeforeafterboth
--- /dev/null
+++ b/node/src/lib.rs
@@ -0,0 +1,3 @@
+pub mod chain_spec;
+pub mod service;
+pub mod rpc;
modifiednode/src/main.rsdiffbeforeafterboth
--- a/node/src/main.rs
+++ b/node/src/main.rs
@@ -6,6 +6,7 @@
 mod service;
 mod cli;
 mod command;
+mod rpc;
 
 fn main() -> sc_cli::Result<()> {
     command::run()
addednode/src/rpc.rsdiffbeforeafterboth
--- /dev/null
+++ b/node/src/rpc.rs
@@ -0,0 +1,69 @@
+//! A collection of node-specific RPC methods.
+//! Substrate provides the `sc-rpc` crate, which defines the core RPC layer
+//! used by Substrate nodes. This file extends those RPC definitions with
+//! capabilities that are specific to this project's runtime configuration.
+
+#![warn(missing_docs)]
+
+use std::sync::Arc;
+
+use nft_runtime::{opaque::Block, AccountId, Balance, Index, BlockNumber};
+use sp_api::ProvideRuntimeApi;
+use sp_blockchain::{Error as BlockChainError, HeaderMetadata, HeaderBackend};
+use sp_block_builder::BlockBuilder;
+pub use sc_rpc_api::DenyUnsafe;
+use sp_transaction_pool::TransactionPool;
+use pallet_contracts_rpc::{Contracts, ContractsApi};
+
+/// Full client dependencies.
+pub struct FullDeps<C, P> {
+	/// The client instance to use.
+	pub client: Arc<C>,
+	/// Transaction pool instance.
+	pub pool: Arc<P>,
+	/// Whether to deny unsafe calls
+	pub deny_unsafe: DenyUnsafe,
+}
+
+/// Instantiate all full RPC extensions.
+pub fn create_full<C, P>(
+	deps: FullDeps<C, P>,
+) -> jsonrpc_core::IoHandler<sc_rpc::Metadata> where
+	C: ProvideRuntimeApi<Block>,
+	C: HeaderBackend<Block> + HeaderMetadata<Block, Error=BlockChainError> + 'static,
+	C: Send + Sync + 'static,
+	C::Api: substrate_frame_rpc_system::AccountNonceApi<Block, AccountId, Index>,
+	C::Api: pallet_transaction_payment_rpc::TransactionPaymentRuntimeApi<Block, Balance>,
+	C::Api: BlockBuilder<Block>,
+	C::Api: pallet_contracts_rpc::ContractsRuntimeApi<Block, AccountId, Balance, BlockNumber>,
+	P: TransactionPool + 'static,
+{
+	use substrate_frame_rpc_system::{FullSystem, SystemApi};
+	use pallet_transaction_payment_rpc::{TransactionPayment, TransactionPaymentApi};
+
+	let mut io = jsonrpc_core::IoHandler::default();
+	let FullDeps {
+		client,
+		pool,
+		deny_unsafe,
+	} = deps;
+
+	io.extend_with(
+		SystemApi::to_delegate(FullSystem::new(client.clone(), pool, deny_unsafe))
+	);
+
+	io.extend_with(
+		TransactionPaymentApi::to_delegate(TransactionPayment::new(client.clone()))
+	);
+
+    io.extend_with(
+        ContractsApi::to_delegate(Contracts::new(client.clone()))
+	);
+		
+	// Extend this RPC with a custom API by using the following syntax.
+	// `YourRpcStruct` should have a reference to a client, which is needed
+	// to call into the runtime.
+	// `io.extend_with(YourRpcTrait::to_delegate(YourRpcStruct::new(ReferenceToClient, ...)));`
+
+	io
+}
modifiednode/src/service.rsdiffbeforeafterboth
--- a/node/src/service.rs
+++ b/node/src/service.rs
@@ -1,274 +1,303 @@
 //! Service and ServiceFactory implementation. Specialized wrapper over substrate service.
 
+use std::sync::Arc;
+use std::time::Duration;
+use sc_client_api::{ExecutorProvider, RemoteBackend};
 use nft_runtime::{self, opaque::Block, RuntimeApi};
-use sc_client_api::ExecutorProvider;
-use sc_consensus::LongestChain;
+use sc_service::{error::Error as ServiceError, Configuration, TaskManager};
+use sp_inherents::InherentDataProviders;
 use sc_executor::native_executor_instance;
 pub use sc_executor::NativeExecutor;
-use sc_finality_grandpa::{
-    FinalityProofProvider as GrandpaFinalityProofProvider, SharedVoterState,
-    StorageAndProofProvider,
-};
-use sc_service::{error::Error as ServiceError, AbstractService, Configuration, ServiceBuilder};
-use sp_consensus_aura::sr25519::AuthorityPair as AuraPair;
-use sp_inherents::InherentDataProviders;
-use std::sync::Arc;
-use std::time::Duration;
+use sp_consensus_aura::sr25519::{AuthorityPair as AuraPair};
+use sc_finality_grandpa::{FinalityProofProvider as GrandpaFinalityProofProvider, SharedVoterState};
 
 // Our native executor instance.
 native_executor_instance!(
-    pub Executor,
+	pub Executor,
     nft_runtime::api::dispatch,
     nft_runtime::native_version,
+	frame_benchmarking::benchmarking::HostFunctions,
 );
 
-/// Starts a `ServiceBuilder` for a full service.
-///
-/// Use this macro if you don't actually need the full service, but just the builder in order to
-/// be able to perform chain operations.
-macro_rules! new_full_start {
-    ($config:expr) => {{
-        use jsonrpc_core::IoHandler;
-        use sp_consensus_aura::sr25519::AuthorityPair as AuraPair;
-        use std::sync::Arc;
-
-        let mut import_setup = None;
-        let inherent_data_providers = sp_inherents::InherentDataProviders::new();
+type FullClient = sc_service::TFullClient<Block, RuntimeApi, Executor>;
+type FullBackend = sc_service::TFullBackend<Block>;
+type FullSelectChain = sc_consensus::LongestChain<FullBackend, Block>;
 
-        let builder = sc_service::ServiceBuilder::new_full::<
-            nft_runtime::opaque::Block,
-            nft_runtime::RuntimeApi,
-            crate::service::Executor,
-        >($config)?
-        .with_select_chain(|_config, backend| Ok(sc_consensus::LongestChain::new(backend.clone())))?
-        .with_transaction_pool(|builder| {
-            let pool_api = sc_transaction_pool::FullChainApi::new(builder.client().clone());
-            Ok(sc_transaction_pool::BasicPool::new(
-                builder.config().transaction_pool.clone(),
-                std::sync::Arc::new(pool_api),
-                builder.prometheus_registry(),
-            ))
-        })?
-        .with_import_queue(
-            |_config, client, mut select_chain, _transaction_pool, spawn_task_handle, registry| {
-                let select_chain = select_chain
-                    .take()
-                    .ok_or_else(|| sc_service::Error::SelectChainRequired)?;
+pub fn new_partial(config: &Configuration) -> Result<sc_service::PartialComponents<
+	FullClient, FullBackend, FullSelectChain,
+	sp_consensus::DefaultImportQueue<Block, FullClient>,
+	sc_transaction_pool::FullPool<Block, FullClient>,
+	(
+		sc_consensus_aura::AuraBlockImport<
+			Block,
+			FullClient,
+			sc_finality_grandpa::GrandpaBlockImport<FullBackend, Block, FullClient, FullSelectChain>,
+			AuraPair
+		>,
+		sc_finality_grandpa::LinkHalf<Block, FullClient, FullSelectChain>
+	)
+>, ServiceError> {
+	let inherent_data_providers = sp_inherents::InherentDataProviders::new();
 
-                let (grandpa_block_import, grandpa_link) = sc_finality_grandpa::block_import(
-                    client.clone(),
-                    &(client.clone() as Arc<_>),
-                    select_chain,
-                )?;
+	let (client, backend, keystore, task_manager) =
+		sc_service::new_full_parts::<Block, RuntimeApi, Executor>(&config)?;
+	let client = Arc::new(client);
 
-                let aura_block_import =
-                    sc_consensus_aura::AuraBlockImport::<_, _, _, AuraPair>::new(
-                        grandpa_block_import.clone(),
-                        client.clone(),
-                    );
+	let select_chain = sc_consensus::LongestChain::new(backend.clone());
 
-                let import_queue = sc_consensus_aura::import_queue::<_, _, _, AuraPair, _>(
-                    sc_consensus_aura::slot_duration(&*client)?,
-                    aura_block_import,
-                    Some(Box::new(grandpa_block_import.clone())),
-                    None,
-                    client,
-                    inherent_data_providers.clone(),
-                    spawn_task_handle,
-                    registry,
-                )?;
+	let transaction_pool = sc_transaction_pool::BasicPool::new_full(
+		config.transaction_pool.clone(),
+		config.prometheus_registry(),
+		task_manager.spawn_handle(),
+		client.clone(),
+	);
 
-                import_setup = Some((grandpa_block_import, grandpa_link));
+	let (grandpa_block_import, grandpa_link) = sc_finality_grandpa::block_import(
+		client.clone(), &(client.clone() as Arc<_>), select_chain.clone(),
+	)?;
 
-                Ok(import_queue)
-            },
-        )?
-        .with_rpc_extensions(|builder| -> Result<IoHandler<sc_rpc::Metadata>, _> {
-            let handler = pallet_contracts_rpc::Contracts::new(builder.client().clone());
-            let delegate = pallet_contracts_rpc::ContractsApi::to_delegate(handler);
+	let aura_block_import = sc_consensus_aura::AuraBlockImport::<_, _, _, AuraPair>::new(
+		grandpa_block_import.clone(), client.clone(),
+	);
 
-            let mut io = IoHandler::default();
-            io.extend_with(delegate);
-            Ok(io)
-        })?;
+	let import_queue = sc_consensus_aura::import_queue::<_, _, _, AuraPair, _, _>(
+		sc_consensus_aura::slot_duration(&*client)?,
+		aura_block_import.clone(),
+		Some(Box::new(grandpa_block_import.clone())),
+		None,
+		client.clone(),
+		inherent_data_providers.clone(),
+		&task_manager.spawn_handle(),
+		config.prometheus_registry(),
+		sp_consensus::CanAuthorWithNativeVersion::new(client.executor().clone()),
+	)?;
 
-        (builder, import_setup, inherent_data_providers)
-    }};
+	Ok(sc_service::PartialComponents {
+		client, backend, task_manager, import_queue, keystore, select_chain, transaction_pool,
+		inherent_data_providers,
+		other: (aura_block_import, grandpa_link),
+	})
 }
 
 /// Builds a new service for a full client.
-pub fn new_full(config: Configuration) -> Result<impl AbstractService, ServiceError> {
-    let role = config.role.clone();
-    let force_authoring = config.force_authoring;
-    let name = config.network.node_name.clone();
-    let disable_grandpa = config.disable_grandpa;
+pub fn new_full(config: Configuration) -> Result<TaskManager, ServiceError> {
+	let sc_service::PartialComponents {
+		client, backend, mut task_manager, import_queue, keystore, select_chain, transaction_pool,
+		inherent_data_providers,
+		other: (block_import, grandpa_link),
+	} = new_partial(&config)?;
 
-    let (builder, mut import_setup, inherent_data_providers) = new_full_start!(config);
+	let finality_proof_provider =
+		GrandpaFinalityProofProvider::new_for_service(backend.clone(), client.clone());
 
-    let (block_import, grandpa_link) = import_setup.take().expect(
-        "Link Half and Block Import are present for Full Services or setup failed before. qed",
-    );
+	let (network, network_status_sinks, system_rpc_tx, network_starter) =
+		sc_service::build_network(sc_service::BuildNetworkParams {
+			config: &config,
+			client: client.clone(),
+			transaction_pool: transaction_pool.clone(),
+			spawn_handle: task_manager.spawn_handle(),
+			import_queue,
+			on_demand: None,
+			block_announce_validator_builder: None,
+			finality_proof_request_builder: None,
+			finality_proof_provider: Some(finality_proof_provider.clone()),
+		})?;
 
-    let service = builder
-        .with_finality_proof_provider(|client, backend| {
-            // GenesisAuthoritySetProvider is implemented for StorageAndProofProvider
-            let provider = client as Arc<dyn StorageAndProofProvider<_, _>>;
-            Ok(Arc::new(GrandpaFinalityProofProvider::new(backend, provider)) as _)
-        })?
-        .build_full()?;
+	if config.offchain_worker.enabled {
+		sc_service::build_offchain_workers(
+			&config, backend.clone(), task_manager.spawn_handle(), client.clone(), network.clone(),
+		);
+	}
 
-    if role.is_authority() {
-        let proposer = sc_basic_authorship::ProposerFactory::new(
-            service.client(),
-            service.transaction_pool(),
-            service.prometheus_registry().as_ref(),
-        );
+	let role = config.role.clone();
+	let force_authoring = config.force_authoring;
+	let name = config.network.node_name.clone();
+	let enable_grandpa = !config.disable_grandpa;
+	let prometheus_registry = config.prometheus_registry().cloned();
+	let telemetry_connection_sinks = sc_service::TelemetryConnectionSinks::default();
 
-        let client = service.client();
-        let select_chain = service
-            .select_chain()
-            .ok_or(ServiceError::SelectChainRequired)?;
+	let rpc_extensions_builder = {
+		let client = client.clone();
+		let pool = transaction_pool.clone();
 
-        let can_author_with =
-            sp_consensus::CanAuthorWithNativeVersion::new(client.executor().clone());
+		Box::new(move |deny_unsafe, _| {
+			let deps = crate::rpc::FullDeps {
+				client: client.clone(),
+				pool: pool.clone(),
+				deny_unsafe,
+			};
 
-        let aura = sc_consensus_aura::start_aura::<_, _, _, _, _, AuraPair, _, _, _>(
-            sc_consensus_aura::slot_duration(&*client)?,
-            client,
-            select_chain,
-            block_import,
-            proposer,
-            service.network(),
-            inherent_data_providers.clone(),
-            force_authoring,
-            service.keystore(),
-            can_author_with,
-        )?;
+			crate::rpc::create_full(deps)
+		})
+	};
 
-        // the AURA authoring task is considered essential, i.e. if it
-        // fails we take down the service with it.
-        service
-            .spawn_essential_task_handle()
-            .spawn_blocking("aura", aura);
-    }
+	sc_service::spawn_tasks(sc_service::SpawnTasksParams {
+		network: network.clone(),
+		client: client.clone(),
+		keystore: keystore.clone(),
+		task_manager: &mut task_manager,
+		transaction_pool: transaction_pool.clone(),
+		telemetry_connection_sinks: telemetry_connection_sinks.clone(),
+		rpc_extensions_builder: rpc_extensions_builder,
+		on_demand: None,
+		remote_blockchain: None,
+		backend, network_status_sinks, system_rpc_tx, config,
+	})?;
 
-    // if the node isn't actively participating in consensus then it doesn't
-    // need a keystore, regardless of which protocol we use below.
-    let keystore = if role.is_authority() {
-        Some(service.keystore() as sp_core::traits::BareCryptoStorePtr)
-    } else {
-        None
-    };
+	if role.is_authority() {
+		let proposer = sc_basic_authorship::ProposerFactory::new(
+			client.clone(),
+			transaction_pool,
+			prometheus_registry.as_ref(),
+		);
 
-    let grandpa_config = sc_finality_grandpa::Config {
-        // FIXME #1578 make this available through chainspec
-        gossip_duration: Duration::from_millis(333),
-        justification_period: 512,
-        name: Some(name),
-        observer_enabled: false,
-        keystore,
-        is_authority: role.is_network_authority(),
-    };
+		let can_author_with =
+			sp_consensus::CanAuthorWithNativeVersion::new(client.executor().clone());
 
-    let enable_grandpa = !disable_grandpa;
-    if enable_grandpa {
-        // start the full GRANDPA voter
-        // NOTE: non-authorities could run the GRANDPA observer protocol, but at
-        // this point the full voter should provide better guarantees of block
-        // and vote data availability than the observer. The observer has not
-        // been tested extensively yet and having most nodes in a network run it
-        // could lead to finality stalls.
-        let grandpa_config = sc_finality_grandpa::GrandpaParams {
-            config: grandpa_config,
-            link: grandpa_link,
-            network: service.network(),
-            inherent_data_providers: inherent_data_providers.clone(),
-            telemetry_on_connect: Some(service.telemetry_on_connect_stream()),
-            voting_rule: sc_finality_grandpa::VotingRulesBuilder::default().build(),
-            prometheus_registry: service.prometheus_registry(),
-            shared_voter_state: SharedVoterState::empty(),
-        };
+		let aura = sc_consensus_aura::start_aura::<_, _, _, _, _, AuraPair, _, _, _>(
+			sc_consensus_aura::slot_duration(&*client)?,
+			client.clone(),
+			select_chain,
+			block_import,
+			proposer,
+			network.clone(),
+			inherent_data_providers.clone(),
+			force_authoring,
+			keystore.clone(),
+			can_author_with,
+		)?;
+
+		// the AURA authoring task is considered essential, i.e. if it
+		// fails we take down the service with it.
+		task_manager.spawn_essential_handle().spawn_blocking("aura", aura);
+	}
+
+	// if the node isn't actively participating in consensus then it doesn't
+	// need a keystore, regardless of which protocol we use below.
+	let keystore = if role.is_authority() {
+		Some(keystore as sp_core::traits::BareCryptoStorePtr)
+	} else {
+		None
+	};
+
+	let grandpa_config = sc_finality_grandpa::Config {
+		// FIXME #1578 make this available through chainspec
+		gossip_duration: Duration::from_millis(333),
+		justification_period: 512,
+		name: Some(name),
+		observer_enabled: false,
+		keystore,
+		is_authority: role.is_network_authority(),
+	};
+
+	if enable_grandpa {
+		// start the full GRANDPA voter
+		// NOTE: non-authorities could run the GRANDPA observer protocol, but at
+		// this point the full voter should provide better guarantees of block
+		// and vote data availability than the observer. The observer has not
+		// been tested extensively yet and having most nodes in a network run it
+		// could lead to finality stalls.
+		let grandpa_config = sc_finality_grandpa::GrandpaParams {
+			config: grandpa_config,
+			link: grandpa_link,
+			network,
+			inherent_data_providers,
+			telemetry_on_connect: Some(telemetry_connection_sinks.on_connect_stream()),
+			voting_rule: sc_finality_grandpa::VotingRulesBuilder::default().build(),
+			prometheus_registry,
+			shared_voter_state: SharedVoterState::empty(),
+		};
 
-        // the GRANDPA voter task is considered infallible, i.e.
-        // if it fails we take down the service with it.
-        service.spawn_essential_task_handle().spawn_blocking(
-            "grandpa-voter",
-            sc_finality_grandpa::run_grandpa_voter(grandpa_config)?,
-        );
-    } else {
-        sc_finality_grandpa::setup_disabled_grandpa(
-            service.client(),
-            &inherent_data_providers,
-            service.network(),
-        )?;
-    }
+		// the GRANDPA voter task is considered infallible, i.e.
+		// if it fails we take down the service with it.
+		task_manager.spawn_essential_handle().spawn_blocking(
+			"grandpa-voter",
+			sc_finality_grandpa::run_grandpa_voter(grandpa_config)?
+		);
+	} else {
+		sc_finality_grandpa::setup_disabled_grandpa(
+			client,
+			&inherent_data_providers,
+			network,
+		)?;
+	}
 
-    Ok(service)
+	network_starter.start_network();
+	Ok(task_manager)
 }
 
 /// Builds a new service for a light client.
-pub fn new_light(config: Configuration) -> Result<impl AbstractService, ServiceError> {
-    let inherent_data_providers = InherentDataProviders::new();
+pub fn new_light(config: Configuration) -> Result<TaskManager, ServiceError> {
+	let (client, backend, keystore, mut task_manager, on_demand) =
+		sc_service::new_light_parts::<Block, RuntimeApi, Executor>(&config)?;
+
+	let transaction_pool = Arc::new(sc_transaction_pool::BasicPool::new_light(
+		config.transaction_pool.clone(),
+		config.prometheus_registry(),
+		task_manager.spawn_handle(),
+		client.clone(),
+		on_demand.clone(),
+	));
 
-    ServiceBuilder::new_light::<Block, RuntimeApi, Executor>(config)?
-        .with_select_chain(|_config, backend| Ok(LongestChain::new(backend.clone())))?
-        .with_transaction_pool(|builder| {
-            let fetcher = builder
-                .fetcher()
-                .ok_or_else(|| "Trying to start light transaction pool without active fetcher")?;
+	let grandpa_block_import = sc_finality_grandpa::light_block_import(
+		client.clone(), backend.clone(), &(client.clone() as Arc<_>),
+		Arc::new(on_demand.checker().clone()) as Arc<_>,
+	)?;
+	let finality_proof_import = grandpa_block_import.clone();
+	let finality_proof_request_builder =
+		finality_proof_import.create_finality_proof_request_builder();
+
+	let import_queue = sc_consensus_aura::import_queue::<_, _, _, AuraPair, _, _>(
+		sc_consensus_aura::slot_duration(&*client)?,
+		grandpa_block_import,
+		None,
+		Some(Box::new(finality_proof_import)),
+		client.clone(),
+		InherentDataProviders::new(),
+		&task_manager.spawn_handle(),
+		config.prometheus_registry(),
+		sp_consensus::NeverCanAuthor,
+	)?;
 
-            let pool_api =
-                sc_transaction_pool::LightChainApi::new(builder.client().clone(), fetcher.clone());
-            let pool = sc_transaction_pool::BasicPool::with_revalidation_type(
-                builder.config().transaction_pool.clone(),
-                Arc::new(pool_api),
-                builder.prometheus_registry(),
-                sc_transaction_pool::RevalidationType::Light,
-            );
-            Ok(pool)
-        })?
-        .with_import_queue_and_fprb(
-            |_config,
-             client,
-             backend,
-             fetcher,
-             _select_chain,
-             _tx_pool,
-             spawn_task_handle,
-             prometheus_registry| {
-                let fetch_checker = fetcher
-                    .map(|fetcher| fetcher.checker().clone())
-                    .ok_or_else(|| {
-                        "Trying to start light import queue without active fetch checker"
-                    })?;
-                let grandpa_block_import = sc_finality_grandpa::light_block_import(
-                    client.clone(),
-                    backend,
-                    &(client.clone() as Arc<_>),
-                    Arc::new(fetch_checker),
-                )?;
-                let finality_proof_import = grandpa_block_import.clone();
-                let finality_proof_request_builder =
-                    finality_proof_import.create_finality_proof_request_builder();
+	let finality_proof_provider =
+		GrandpaFinalityProofProvider::new_for_service(backend.clone(), client.clone());
+
+	let (network, network_status_sinks, system_rpc_tx, network_starter) =
+		sc_service::build_network(sc_service::BuildNetworkParams {
+			config: &config,
+			client: client.clone(),
+			transaction_pool: transaction_pool.clone(),
+			spawn_handle: task_manager.spawn_handle(),
+			import_queue,
+			on_demand: Some(on_demand.clone()),
+			block_announce_validator_builder: None,
+			finality_proof_request_builder: Some(finality_proof_request_builder),
+			finality_proof_provider: Some(finality_proof_provider),
+		})?;
+
+	if config.offchain_worker.enabled {
+		sc_service::build_offchain_workers(
+			&config, backend.clone(), task_manager.spawn_handle(), client.clone(), network.clone(),
+		);
+	}
+
+	sc_service::spawn_tasks(sc_service::SpawnTasksParams {
+		remote_blockchain: Some(backend.remote_blockchain()),
+		transaction_pool,
+		task_manager: &mut task_manager,
+		on_demand: Some(on_demand),
+		rpc_extensions_builder: Box::new(|_, _| ()),
+		telemetry_connection_sinks: sc_service::TelemetryConnectionSinks::default(),
+		config,
+		client,
+		keystore,
+		backend,
+		network,
+		network_status_sinks,
+		system_rpc_tx,
+	 })?;
 
-                let import_queue = sc_consensus_aura::import_queue::<_, _, _, AuraPair, _>(
-                    sc_consensus_aura::slot_duration(&*client)?,
-                    grandpa_block_import,
-                    None,
-                    Some(Box::new(finality_proof_import)),
-                    client,
-                    inherent_data_providers.clone(),
-                    spawn_task_handle,
-                    prometheus_registry,
-                )?;
+	 network_starter.start_network();
 
-                Ok((import_queue, finality_proof_request_builder))
-            },
-        )?
-        .with_finality_proof_provider(|client, backend| {
-            // GenesisAuthoritySetProvider is implemented for StorageAndProofProvider
-            let provider = client as Arc<dyn StorageAndProofProvider<_, _>>;
-            Ok(Arc::new(GrandpaFinalityProofProvider::new(backend, provider)) as _)
-        })?
-        .build_light()
+	 Ok(task_manager)
 }
modifiedpallets/nft/Cargo.tomldiffbeforeafterboth
--- a/pallets/nft/Cargo.toml
+++ b/pallets/nft/Cargo.toml
@@ -1,37 +1,52 @@
+[package]
+authors = ['Substrate DevHub <https://github.com/substrate-developer-hub>']
+description = 'FRAME pallet nft'
+edition = '2018'
+homepage = 'https://substrate.io'
+license = 'Unlicense'
+name = 'pallet-nft'
+repository = 'https://github.com/substrate-developer-hub/nft/'
+version = '2.0.0'
+
+[package.metadata.docs.rs]
+targets = ['x86_64-unknown-linux-gnu']
+
+# alias "parity-scale-code" to "codec"
 [dependencies.codec]
 default-features = false
 features = ['derive']
 package = 'parity-scale-codec'
-version = '1.3.0'
+version = '1.3.4'
 
 [dependencies.frame-support]
 default-features = false
 git = 'https://github.com/usetech-llc/substrate.git'
-branch = 'rc4_ext_dispatch_reenabled'
-version = '2.0.0-rc4'
+branch = 'v2.0.0_release'
+version = '2.0.0'
 
 [dependencies.frame-system]
 default-features = false
 git = 'https://github.com/usetech-llc/substrate.git'
-branch = 'rc4_ext_dispatch_reenabled'
-version = '2.0.0-rc4'
+branch = 'v2.0.0_release'
+version = '2.0.0'
+
 [dev-dependencies.sp-core]
 default-features = false
 git = 'https://github.com/usetech-llc/substrate.git'
-branch = 'rc4_ext_dispatch_reenabled'
-version = '2.0.0-rc4'
+branch = 'v2.0.0_release'
+version = '2.0.0'
 
 [dev-dependencies.sp-io]
 default-features = false
 git = 'https://github.com/usetech-llc/substrate.git'
-branch = 'rc4_ext_dispatch_reenabled'
-version = '2.0.0-rc4'
+branch = 'v2.0.0_release'
+version = '2.0.0'
 
 [dependencies.sp-runtime]
 default-features = false
 git = 'https://github.com/usetech-llc/substrate.git'
-branch = 'rc4_ext_dispatch_reenabled'
-version = '2.0.0-rc4'
+branch = 'v2.0.0_release'
+version = '2.0.0'
 	
 [dependencies]
 # third-party dependencies
@@ -41,27 +56,50 @@
 [dependencies.sp-std]
 default-features = false
 git = 'https://github.com/usetech-llc/substrate.git'
-branch = 'rc4_ext_dispatch_reenabled'
-version = '2.0.0-rc4'
+branch = 'v2.0.0_release'
+version = '2.0.0'
 
 [dependencies.transaction-payment]
 default-features = false
 git = 'https://github.com/usetech-llc/substrate.git'
 package = 'pallet-transaction-payment'
-branch = 'rc4_ext_dispatch_reenabled'
-version = '2.0.0-rc4'
+branch = 'v2.0.0_release'
+version = '2.0.0'
 
-[package]
-authors = ['Substrate DevHub <https://github.com/substrate-developer-hub>']
-description = 'FRAME pallet nft'
-edition = '2018'
-homepage = 'https://substrate.io'
-license = 'Unlicense'
-name = 'pallet-nft'
-repository = 'https://github.com/substrate-developer-hub/nft/'
-version = '2.0.0-rc4'
-[package.metadata.docs.rs]
-targets = ['x86_64-unknown-linux-gnu']
+[dependencies.frame-benchmarking]
+version = "2.0.0"
+default-features = false
+git = 'https://github.com/usetech-llc/substrate.git'
+branch = 'v2.0.0_release'
+optional = true
+
+[dependencies.pallet-contracts]
+default-features = false
+git = 'https://github.com/usetech-llc/substrate.git'
+package = 'pallet-contracts'
+branch = 'v2.0.0_release'
+version = '2.0.0'
+
+[dependencies.pallet-balances]
+default-features = false
+git = 'https://github.com/usetech-llc/substrate.git'
+package = 'pallet-balances'
+branch = 'v2.0.0_release'
+version = '2.0.0'
+
+[dependencies.pallet-timestamp]
+default-features = false
+git = 'https://github.com/usetech-llc/substrate.git'
+package = 'pallet-timestamp'
+branch = 'v2.0.0_release'
+version = '2.0.0'
+
+[dependencies.pallet-randomness-collective-flip]
+default-features = false
+git = 'https://github.com/usetech-llc/substrate.git'
+package = 'pallet-randomness-collective-flip'
+branch = 'v2.0.0_release'
+version = '2.0.0'
 
 [features]
 default = ['std']
@@ -70,6 +108,11 @@
     "serde/std",
     'frame-support/std',
     'frame-system/std',
+    'pallet-balances/std',
+    'pallet-timestamp/std',
+    'pallet-randomness-collective-flip/std',
+    'sp-std/std',
     'sp-runtime/std',
-    'sp-std/std',
+    'frame-benchmarking/std',
 ]
+runtime-benchmarks = ["frame-benchmarking"]
addedpallets/nft/src/benchmarking.rsdiffbeforeafterboth
--- /dev/null
+++ b/pallets/nft/src/benchmarking.rs
@@ -0,0 +1,353 @@
+#[cfg(feature = "runtime-benchmarks")]
+// mod benchmarking {
+    use super::*;
+    use sp_std::prelude::*;
+    use frame_system::RawOrigin;
+    // use frame_support::{ensure, traits::OnFinalize};
+    use frame_benchmarking::{benchmarks, account, whitelisted_caller};  // , TrackedStorageKey, 
+    use crate::Module as Nft;
+
+    const SEED: u32 = 1;
+
+    fn default_nft_data() -> CreateItemData {
+        CreateItemData::NFT(CreateNftData { const_data: vec![1, 2, 3], variable_data: vec![3, 2, 1] })
+    }
+    
+    fn default_fungible_data () -> CreateItemData {
+        CreateItemData::Fungible(CreateFungibleData { })
+    }
+    
+    fn default_re_fungible_data () -> CreateItemData {
+        CreateItemData::ReFungible(CreateReFungibleData { const_data: vec![1, 2, 3], variable_data: vec![3, 2, 1] })
+    }
+
+
+    benchmarks! {
+
+        _ {}
+
+        create_collection {
+            let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+            let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+            let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+            let mode: CollectionMode = CollectionMode::NFT;
+            let caller: T::AccountId = account("caller", 0, SEED);
+        }: create_collection(RawOrigin::Signed(caller.clone()), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode)
+        verify {
+			assert_eq!(Nft::<T>::collection(2).owner, caller);
+        }
+
+        destroy_collection {
+            let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+            let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+            let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+            let mode: CollectionMode = CollectionMode::NFT;
+            let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+            Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+        }: destroy_collection(RawOrigin::Signed(caller.clone()), 2)
+
+        add_to_white_list {
+            let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+            let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+            let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+            let mode: CollectionMode = CollectionMode::NFT;
+            let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+            let whitelist_account: T::AccountId = account("admin", 0, SEED);
+            Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+        }: add_to_white_list(RawOrigin::Signed(caller.clone()), 2, whitelist_account)
+
+        remove_from_white_list {
+            let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+            let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+            let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+            let mode: CollectionMode = CollectionMode::NFT;
+            let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+            let whitelist_account: T::AccountId = account("admin", 0, SEED);
+            Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+            Nft::<T>::add_to_white_list(RawOrigin::Signed(caller.clone()).into(), 2, whitelist_account.clone())?;
+        }: remove_from_white_list(RawOrigin::Signed(caller.clone()), 2, whitelist_account)
+
+        set_public_access_mode {
+            let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+            let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+            let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+            let mode: CollectionMode = CollectionMode::NFT;
+            let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+            Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+        }: set_public_access_mode(RawOrigin::Signed(caller.clone()), 2, AccessMode::WhiteList)
+
+        set_mint_permission {
+            let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+            let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+            let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+            let mode: CollectionMode = CollectionMode::NFT;
+            let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+            Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+        }: set_mint_permission(RawOrigin::Signed(caller.clone()), 2, true)
+
+        change_collection_owner {
+            let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+            let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+            let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+            let mode: CollectionMode = CollectionMode::NFT;
+            let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+            Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+            let new_owner: T::AccountId = account("admin", 0, SEED);
+        }: change_collection_owner(RawOrigin::Signed(caller.clone()), 2, new_owner)
+
+        add_collection_admin {
+            let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+            let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+            let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+            let mode: CollectionMode = CollectionMode::NFT;
+            let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+            Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+            let new_admin: T::AccountId = account("admin", 0, SEED);
+        }: add_collection_admin(RawOrigin::Signed(caller.clone()), 2, new_admin)
+
+        remove_collection_admin {
+            let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+            let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+            let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+            let mode: CollectionMode = CollectionMode::NFT;
+            let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+            Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+            let new_admin: T::AccountId = account("admin", 0, SEED);
+            Nft::<T>::add_collection_admin(RawOrigin::Signed(caller.clone()).into(), 2, new_admin.clone())?;
+        }: remove_collection_admin(RawOrigin::Signed(caller.clone()), 2, new_admin)
+
+        set_collection_sponsor {
+            let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+            let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+            let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+            let mode: CollectionMode = CollectionMode::NFT;
+            let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+            Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+        }: set_collection_sponsor(RawOrigin::Signed(caller.clone()), 2, caller.clone())
+
+        confirm_sponsorship {
+            let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+            let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+            let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+            let mode: CollectionMode = CollectionMode::NFT;
+            let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+            Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+            Nft::<T>::set_collection_sponsor(RawOrigin::Signed(caller.clone()).into(), 2, caller.clone())?;
+        }: confirm_sponsorship(RawOrigin::Signed(caller.clone()), 2)
+
+        remove_collection_sponsor {
+            let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+            let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+            let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+            let mode: CollectionMode = CollectionMode::NFT;
+            let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+            Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+            Nft::<T>::set_collection_sponsor(RawOrigin::Signed(caller.clone()).into(), 2, caller.clone())?;
+            Nft::<T>::confirm_sponsorship(RawOrigin::Signed(caller.clone()).into(), 2)?;
+        }: remove_collection_sponsor(RawOrigin::Signed(caller.clone()), 2)
+
+        // nft item
+        create_item_nft {
+            let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+            let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+            let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+            let mode: CollectionMode = CollectionMode::NFT;
+            let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+            Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+            let data = default_nft_data();
+            
+        }: create_item(RawOrigin::Signed(caller.clone()), 2, caller.clone(), data)
+
+        #[extra]
+        create_item_nft_large {
+            let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+            let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+            let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+            let mode: CollectionMode = CollectionMode::NFT;
+            let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+            let nft_data = CreateNftData {
+                const_data: vec![],
+                variable_data: vec![]
+            };
+            for i in 0..1998 {
+                nft_data.const_data.push(10);
+                nft_data.variable_data.push(10);
+            }
+            let mut data = CreateItemData::NFT(nft_data);
+            Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+
+        }: create_item(RawOrigin::Signed(caller.clone()), 2, caller.clone(), data)
+
+        // fungible item
+        create_item_fungible {
+            let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+            let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+            let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+            let mode: CollectionMode = CollectionMode::Fungible(3);
+            let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+            Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+            let data = default_fungible_data();
+
+        }: create_item(RawOrigin::Signed(caller.clone()), 2, caller.clone(), data)
+
+        // refungible item
+        create_item_refungible {
+            let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+            let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+            let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+            let mode: CollectionMode = CollectionMode::ReFungible(3);
+            let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+            Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+            let data = default_re_fungible_data();
+
+        }: create_item(RawOrigin::Signed(caller.clone()), 2, caller.clone(), data)
+
+        burn_item {
+            let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+            let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+            let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+            let mode: CollectionMode = CollectionMode::NFT;
+            let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+            Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+            let data = default_nft_data();
+            Nft::<T>::create_item(RawOrigin::Signed(caller.clone()).into(), 2, caller.clone(), data)?;
+
+        }: burn_item(RawOrigin::Signed(caller.clone()), 2, 1)
+
+        transfer_nft {
+            let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+            let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+            let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+            let mode: CollectionMode = CollectionMode::NFT;
+            let recipient: T::AccountId = account("recipient", 0, SEED);
+            let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+            Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+            let data = default_nft_data();
+            Nft::<T>::create_item(RawOrigin::Signed(caller.clone()).into(), 2, caller.clone(), data)?;
+
+        }: transfer(RawOrigin::Signed(caller.clone()), recipient.clone(), 2, 1, 1)
+        
+        transfer_fungible {
+            let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+            let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+            let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+            let mode: CollectionMode = CollectionMode::Fungible(3);
+            let recipient: T::AccountId = account("recipient", 0, SEED);
+            let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+            Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+            let data = default_fungible_data();
+            Nft::<T>::create_item(RawOrigin::Signed(caller.clone()).into(), 2, caller.clone(), data)?;
+
+        }: transfer(RawOrigin::Signed(caller.clone()), recipient.clone(), 2, 1, 1)
+
+        transfer_refungible {
+            let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+            let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+            let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+            let mode: CollectionMode = CollectionMode::ReFungible(3);
+            let recipient: T::AccountId = account("recipient", 0, SEED);
+            let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+            Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+            let data = default_re_fungible_data();
+            Nft::<T>::create_item(RawOrigin::Signed(caller.clone()).into(), 2, caller.clone(), data)?;
+
+        }: transfer(RawOrigin::Signed(caller.clone()), recipient.clone(), 2, 1, 1)
+
+        approve {
+            let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+            let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+            let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+            let mode: CollectionMode = CollectionMode::ReFungible(3);
+            let recipient: T::AccountId = account("recipient", 0, SEED);
+            let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+            Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+            let data = default_re_fungible_data();
+            Nft::<T>::create_item(RawOrigin::Signed(caller.clone()).into(), 2, caller.clone(), data)?;
+
+        }: approve(RawOrigin::Signed(caller.clone()), recipient.clone(), 2, 1)
+
+        // Nft
+        transfer_from_nft {
+            let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+            let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+            let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+            let mode: CollectionMode = CollectionMode::NFT;
+            let recipient: T::AccountId = account("recipient", 0, SEED);
+            let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+            Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+            let data = default_nft_data();
+            Nft::<T>::create_item(RawOrigin::Signed(caller.clone()).into(), 2, caller.clone(), data)?;
+            Nft::<T>::approve(RawOrigin::Signed(caller.clone()).into(), recipient.clone(), 2, 1)?;
+
+        }: transfer_from(RawOrigin::Signed(caller.clone()), caller.clone(), recipient.clone(), 2, 1, 1)
+
+        // Fungible
+        transfer_from_fungible {
+            let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+            let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+            let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+            let mode: CollectionMode = CollectionMode::Fungible(3);
+            let recipient: T::AccountId = account("recipient", 0, SEED);
+            let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+            Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+            let data = default_fungible_data();
+            Nft::<T>::create_item(RawOrigin::Signed(caller.clone()).into(), 2, caller.clone(), data)?;
+            Nft::<T>::approve(RawOrigin::Signed(caller.clone()).into(), recipient.clone(), 2, 1)?;
+
+        }: transfer_from(RawOrigin::Signed(caller.clone()), caller.clone(), recipient.clone(), 2, 1, 1)
+
+        // ReFungible
+        transfer_from_refungible {
+            let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+            let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+            let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+            let mode: CollectionMode = CollectionMode::ReFungible(3);
+            let recipient: T::AccountId = account("recipient", 0, SEED);
+            let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+            Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+            let data = default_re_fungible_data();
+            Nft::<T>::create_item(RawOrigin::Signed(caller.clone()).into(), 2, caller.clone(), data)?;
+            Nft::<T>::approve(RawOrigin::Signed(caller.clone()).into(), recipient.clone(), 2, 1)?;
+
+        }: transfer_from(RawOrigin::Signed(caller.clone()), caller.clone(), recipient.clone(), 2, 1, 1)
+
+        set_offchain_schema {
+            let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+            let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+            let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+            let mode: CollectionMode = CollectionMode::ReFungible(3);
+            let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+            Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+
+        }: set_offchain_schema(RawOrigin::Signed(caller.clone()), 2, [1,2,3].to_vec())
+
+        set_const_on_chain_schema {
+            let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+            let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+            let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+            let mode: CollectionMode = CollectionMode::ReFungible(3);
+            let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+            Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+        }: set_const_on_chain_schema(RawOrigin::Signed(caller.clone()), 2, [1,2,3].to_vec())
+        
+        set_variable_on_chain_schema {
+            let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+            let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+            let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+            let mode: CollectionMode = CollectionMode::ReFungible(3);
+            let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+            Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+        }: set_variable_on_chain_schema(RawOrigin::Signed(caller.clone()), 2, [1,2,3].to_vec())
+
+        set_variable_meta_data {
+            let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+            let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+            let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+            let mode: CollectionMode = CollectionMode::NFT;
+            let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+            Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+            let data = default_nft_data();
+            Nft::<T>::create_item(RawOrigin::Signed(caller.clone()).into(), 2, caller.clone(), data)?;
+
+        }: set_variable_meta_data(RawOrigin::Signed(caller.clone()), 2, 1, [1, 2, 3].to_vec())
+}
\ No newline at end of file
addedpallets/nft/src/default_weights.rsdiffbeforeafterboth
--- /dev/null
+++ b/pallets/nft/src/default_weights.rs
@@ -0,0 +1,115 @@
+use frame_support::weights::{Weight, constants::RocksDbWeight as DbWeight};
+
+impl crate::WeightInfo for () {
+	fn create_collection() -> Weight {
+		(70_000_000 as Weight)
+			.saturating_add(DbWeight::get().reads(7 as Weight))
+			.saturating_add(DbWeight::get().writes(5 as Weight))
+	}
+	fn destroy_collection() -> Weight {
+		(90_000_000 as Weight)
+			.saturating_add(DbWeight::get().reads(2 as Weight))
+			.saturating_add(DbWeight::get().writes(5 as Weight))
+	}
+	fn add_to_white_list() -> Weight {
+		(30_000_000 as Weight)
+			.saturating_add(DbWeight::get().reads(3 as Weight))
+			.saturating_add(DbWeight::get().writes(1 as Weight))
+    }
+    fn remove_from_white_list() -> Weight {
+		(35_000_000 as Weight)
+			.saturating_add(DbWeight::get().reads(3 as Weight))
+			.saturating_add(DbWeight::get().writes(1 as Weight))
+	}
+	fn set_public_access_mode() -> Weight {
+		(27_000_000 as Weight)
+			.saturating_add(DbWeight::get().reads(1 as Weight))
+			.saturating_add(DbWeight::get().writes(1 as Weight))
+	}
+	fn set_mint_permission() -> Weight {
+		(27_000_000 as Weight)
+			.saturating_add(DbWeight::get().reads(1 as Weight))
+			.saturating_add(DbWeight::get().writes(1 as Weight))
+	}
+	fn change_collection_owner() -> Weight {
+		(27_000_000 as Weight)
+			.saturating_add(DbWeight::get().reads(1 as Weight))
+			.saturating_add(DbWeight::get().writes(1 as Weight))
+	}
+	fn add_collection_admin() -> Weight {
+        (32_000_000 as Weight)
+            .saturating_add(DbWeight::get().reads(3 as Weight))
+            .saturating_add(DbWeight::get().writes(1 as Weight))
+	}
+	fn remove_collection_admin() -> Weight {
+		(50_000_000 as Weight)
+            .saturating_add(DbWeight::get().reads(2 as Weight))
+            .saturating_add(DbWeight::get().writes(1 as Weight))
+    }
+    fn set_collection_sponsor() -> Weight {
+		(32_000_000 as Weight)
+            .saturating_add(DbWeight::get().reads(2 as Weight))
+            .saturating_add(DbWeight::get().writes(1 as Weight))
+    }  
+    fn confirm_sponsorship() -> Weight {
+		(22_000_000 as Weight)
+            .saturating_add(DbWeight::get().reads(1 as Weight))
+            .saturating_add(DbWeight::get().writes(1 as Weight))
+    }  
+    fn remove_collection_sponsor() -> Weight {
+		(24_000_000 as Weight)
+            .saturating_add(DbWeight::get().reads(1 as Weight))
+            .saturating_add(DbWeight::get().writes(1 as Weight))
+    }  
+    fn create_item(s: usize, ) -> Weight {
+        (130_000_000 as Weight)
+            .saturating_add((2135 as Weight).saturating_mul(s as Weight))
+            .saturating_add(DbWeight::get().reads(10 as Weight))
+            .saturating_add(DbWeight::get().writes(8 as Weight))
+    }  
+    fn burn_item() -> Weight {
+		(170_000_000 as Weight)
+            .saturating_add(DbWeight::get().reads(9 as Weight))
+            .saturating_add(DbWeight::get().writes(7 as Weight))
+    }  
+    fn transfer() -> Weight {
+        (125_000_000 as Weight)
+            .saturating_add(DbWeight::get().reads(7 as Weight))
+            .saturating_add(DbWeight::get().writes(7 as Weight))
+    }  
+    fn approve() -> Weight {
+        (45_000_000 as Weight)
+            .saturating_add(DbWeight::get().reads(3 as Weight))
+            .saturating_add(DbWeight::get().writes(1 as Weight))
+    }
+    fn transfer_from() -> Weight {
+        (150_000_000 as Weight)
+            .saturating_add(DbWeight::get().reads(9 as Weight))
+            .saturating_add(DbWeight::get().writes(8 as Weight))
+    }
+    fn set_offchain_schema() -> Weight {
+        (33_000_000 as Weight)
+            .saturating_add(DbWeight::get().reads(2 as Weight))
+            .saturating_add(DbWeight::get().writes(1 as Weight))
+    }
+    fn set_const_on_chain_schema() -> Weight {
+        (11_100_000 as Weight)
+            .saturating_add(DbWeight::get().reads(2 as Weight))
+            .saturating_add(DbWeight::get().writes(1 as Weight))
+    }
+    fn set_variable_on_chain_schema() -> Weight {
+        (11_100_000 as Weight)
+            .saturating_add(DbWeight::get().reads(2 as Weight))
+            .saturating_add(DbWeight::get().writes(1 as Weight))
+    }
+    fn set_variable_meta_data() -> Weight {
+        (17_500_000 as Weight)
+            .saturating_add(DbWeight::get().reads(2 as Weight))
+            .saturating_add(DbWeight::get().writes(1 as Weight))
+    }
+    // fn enable_contract_sponsoring() -> Weight {
+    //     (0 as Weight)
+    //         .saturating_add(DbWeight::get().reads(1 as Weight))
+    //         .saturating_add(DbWeight::get().writes(1 as Weight))
+    // }
+}
modifiedpallets/nft/src/lib.rsdiffbeforeafterboth
--- a/pallets/nft/src/lib.rs
+++ b/pallets/nft/src/lib.rs
@@ -27,15 +27,15 @@
 use sp_runtime::sp_std::prelude::Vec;
 use sp_runtime::{
     traits::{
-        DispatchInfoOf, Dispatchable, PostDispatchInfoOf, SaturatedConversion, Saturating,
-        SignedExtension, Zero,
+        DispatchInfoOf, Dispatchable, PostDispatchInfoOf, Saturating, SignedExtension, Zero,
     },
     transaction_validity::{
-        InvalidTransaction, TransactionPriority, TransactionValidity, TransactionValidityError,
-        ValidTransaction,
+        InvalidTransaction, TransactionValidity, TransactionValidityError, ValidTransaction,
     },
     FixedPointOperand, FixedU128,
 };
+use pallet_contracts::ContractAddressFor;
+use sp_runtime::traits::StaticLookup;
 
 #[cfg(test)]
 mod mock;
@@ -43,6 +43,8 @@
 #[cfg(test)]
 mod tests;
 
+mod default_weights;
+
 // Structs
 // #region
 
@@ -50,21 +52,20 @@
 #[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
 pub enum CollectionMode {
     Invalid,
-    // custom data size
-    NFT(u32),
+    NFT,
     // decimal points
     Fungible(u32),
-    // custom data size and decimal points
-    ReFungible(u32, u32),
+    // decimal points
+    ReFungible(u32),
 }
 
 impl Into<u8> for CollectionMode {
     fn into(self) -> u8 {
         match self {
             CollectionMode::Invalid => 0,
-            CollectionMode::NFT(_) => 1,
+            CollectionMode::NFT => 1,
             CollectionMode::Fungible(_) => 2,
-            CollectionMode::ReFungible(_, _) => 3,
+            CollectionMode::ReFungible(_) => 3,
         }
     }
 }
@@ -104,11 +105,12 @@
     pub name: Vec<u16>,        // 64 include null escape char
     pub description: Vec<u16>, // 256 include null escape char
     pub token_prefix: Vec<u8>, // 16 include null escape char
-    pub custom_data_size: u32,
     pub mint_mode: bool,
     pub offchain_schema: Vec<u8>,
     pub sponsor: AccountId, // Who pays fees. If set to default address, the fees are applied to the transaction sender
     pub unconfirmed_sponsor: AccountId, // Sponsor address that has not yet confirmed sponsorship
+    pub variable_on_chain_schema: Vec<u8>, //
+    pub const_on_chain_schema: Vec<u8>, //
 }
 
 #[derive(Encode, Decode, Default, Debug, Clone, PartialEq)]
@@ -123,7 +125,8 @@
 pub struct NftItemType<AccountId> {
     pub collection: u64,
     pub owner: AccountId,
-    pub data: Vec<u8>,
+    pub const_data: Vec<u8>,
+    pub variable_data: Vec<u8>,
 }
 
 #[derive(Encode, Decode, Default, Debug, Clone, PartialEq)]
@@ -139,7 +142,8 @@
 pub struct ReFungibleItemType<AccountId> {
     pub collection: u64,
     pub owner: Vec<Ownership<AccountId>>,
-    pub data: Vec<u8>,
+    pub const_data: Vec<u8>,
+    pub variable_data: Vec<u8>,
 }
 
 #[derive(Encode, Decode, Default, Debug, Clone, PartialEq)]
@@ -181,10 +185,98 @@
     pub refungible_sponsor_transfer_timeout: u32,
 }
 
-pub trait Trait: system::Trait {
+pub trait WeightInfo {
+	fn create_collection() -> Weight;
+	fn destroy_collection() -> Weight;
+	fn add_to_white_list() -> Weight;
+	fn remove_from_white_list() -> Weight;
+    fn set_public_access_mode() -> Weight;
+    fn set_mint_permission() -> Weight;
+    fn change_collection_owner() -> Weight;
+    fn add_collection_admin() -> Weight;
+    fn remove_collection_admin() -> Weight;
+    fn set_collection_sponsor() -> Weight;
+    fn confirm_sponsorship() -> Weight;
+    fn remove_collection_sponsor() -> Weight;
+    fn create_item(s: usize) -> Weight;
+    fn burn_item() -> Weight;
+    fn transfer() -> Weight;
+    fn approve() -> Weight;
+    fn transfer_from() -> Weight;
+    fn set_offchain_schema() -> Weight;
+    fn set_const_on_chain_schema() -> Weight;
+    fn set_variable_on_chain_schema() -> Weight;
+    fn set_variable_meta_data() -> Weight;
+    // fn enable_contract_sponsoring() -> Weight;
+}
+
+#[derive(Encode, Decode, Default, Debug, Clone, PartialEq)]
+#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
+pub struct CreateNftData {
+    pub const_data: Vec<u8>,
+    pub variable_data: Vec<u8>,
+}
+
+#[derive(Encode, Decode, Default, Debug, Clone, PartialEq)]
+#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
+pub struct CreateFungibleData {
+}
+
+#[derive(Encode, Decode, Default, Debug, Clone, PartialEq)]
+#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
+pub struct CreateReFungibleData {
+    pub const_data: Vec<u8>,
+    pub variable_data: Vec<u8>,
+}
+
+#[derive(Encode, Decode, Debug, Clone, PartialEq)]
+#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
+pub enum CreateItemData {
+    NFT(CreateNftData),
+    Fungible(CreateFungibleData),
+    ReFungible(CreateReFungibleData)
+}
+
+impl CreateItemData {
+    pub fn len(&self) -> usize {
+        let len = match self {
+            CreateItemData::NFT(data) => data.variable_data.len() + data.const_data.len(),
+            CreateItemData::ReFungible(data) => data.variable_data.len() + data.const_data.len(),
+            _ => 0
+        };
+        
+        return len;
+    }
+}
+
+impl From<CreateNftData> for CreateItemData {
+    fn from(item: CreateNftData) -> Self {
+        CreateItemData::NFT(item)
+    }
+}
+
+impl From<CreateReFungibleData> for CreateItemData {
+    fn from(item: CreateReFungibleData) -> Self {
+        CreateItemData::ReFungible(item)
+    }
+}
+
+impl From<CreateFungibleData> for CreateItemData {
+    fn from(item: CreateFungibleData) -> Self {
+        CreateItemData::Fungible(item)
+    }
+}
+
+pub trait Trait: system::Trait + Sized + transaction_payment::Trait + pallet_contracts::Trait {
     type Event: From<Event<Self>> + Into<<Self as system::Trait>::Event>;
+
+    /// Weight information for extrinsics in this pallet.
+	type WeightInfo: WeightInfo;
 }
 
+#[cfg(feature = "runtime-benchmarks")]
+mod benchmarking;
+
 // #endregion
 
 decl_storage! {
@@ -227,9 +319,9 @@
         pub FungibleTransferBasket get(fn fungible_transfer_basket): double_map hasher(blake2_128_concat) u64, hasher(blake2_128_concat) u64 => Vec<BasketItem<T::AccountId, T::BlockNumber>>;
         pub ReFungibleTransferBasket get(fn refungible_transfer_basket): double_map hasher(blake2_128_concat) u64, hasher(blake2_128_concat) u64 => T::BlockNumber;
 
-        // Sponsorship
-        pub ContractSponsor get(fn contract_sponsor): map hasher(identity) T::AccountId => T::AccountId;
-        pub UnconfirmedContractSponsor get(fn unconfirmed_contract_sponsor): map hasher(identity) T::AccountId => T::AccountId;
+        // Contract Sponsorship and Ownership
+        pub ContractOwner get(fn contract_owner): map hasher(identity) T::AccountId => T::AccountId;
+        pub ContractSelfSponsoring get(fn contract_self_sponsoring): map hasher(identity) T::AccountId => bool;
     }
     add_extra_genesis {
         build(|config: &GenesisConfig<T>| {
@@ -322,7 +414,7 @@
         /// 
         /// * mode: [CollectionMode] collection type and type dependent data.
         // returns collection ID
-        #[weight = 0]
+        #[weight = T::WeightInfo::create_collection()]
         pub fn create_collection(origin,
                                  collection_name: Vec<u16>,
                                  collection_description: Vec<u16>,
@@ -331,25 +423,10 @@
 
             // Anyone can create a collection
             let who = ensure_signed(origin)?;
-            let custom_data_size = match mode {
-                CollectionMode::NFT(size) => {
-
-                    // bound Custom data size
-                    ensure!(size < ChainLimit::get().custom_data_limit, "Custom data size bound exceeded");
-                    size
-                },
-                CollectionMode::ReFungible(size, _) => {
 
-                    // bound Custom data size
-                    ensure!(size < ChainLimit::get().custom_data_limit, "Custom data size bound exceeded");
-                    size
-                },
-                _ => 0
-            };
-
             let decimal_points = match mode {
                 CollectionMode::Fungible(points) => points,
-                CollectionMode::ReFungible(_, points) => points,
+                CollectionMode::ReFungible(points) => points,
                 _ => 0
             };
 
@@ -395,9 +472,10 @@
                 decimal_points: decimal_points,
                 token_prefix: prefix,
                 offchain_schema: Vec::new(),
-                custom_data_size: custom_data_size,
                 sponsor: T::AccountId::default(),
                 unconfirmed_sponsor: T::AccountId::default(),
+                variable_on_chain_schema: Vec::new(),
+                const_on_chain_schema: Vec::new(),
             };
 
             // Add new collection to map
@@ -418,7 +496,7 @@
         /// # Arguments
         /// 
         /// * collection_id: collection to destroy.
-        #[weight = 0]
+        #[weight = T::WeightInfo::destroy_collection()]
         pub fn destroy_collection(origin, collection_id: u64) -> DispatchResult {
 
             let sender = ensure_signed(origin)?;
@@ -465,7 +543,7 @@
         /// * collection_id.
         /// 
         /// * address.
-        #[weight = 0]
+        #[weight = T::WeightInfo::add_to_white_list()]
         pub fn add_to_white_list(origin, collection_id: u64, address: T::AccountId) -> DispatchResult{
 
             let sender = ensure_signed(origin)?;
@@ -500,7 +578,7 @@
         /// * collection_id.
         /// 
         /// * address.
-        #[weight = 0]
+        #[weight = T::WeightInfo::remove_from_white_list()]
         pub fn remove_from_white_list(origin, collection_id: u64, address: T::AccountId) -> DispatchResult{
 
             let sender = ensure_signed(origin)?;
@@ -529,7 +607,7 @@
         /// * collection_id.
         /// 
         /// * mode: [AccessMode]
-        #[weight = 0]
+        #[weight = T::WeightInfo::set_public_access_mode()]
         pub fn set_public_access_mode(origin, collection_id: u64, mode: AccessMode) -> DispatchResult
         {
             let sender = ensure_signed(origin)?;
@@ -555,7 +633,7 @@
         /// * collection_id.
         /// 
         /// * mint_permission: Boolean parameter. If True, allows minting to Anyone with conditions above.
-        #[weight = 0]
+        #[weight = T::WeightInfo::set_mint_permission()]
         pub fn set_mint_permission(origin, collection_id: u64, mint_permission: bool) -> DispatchResult
         {
             let sender = ensure_signed(origin)?;
@@ -579,7 +657,7 @@
         /// * collection_id.
         /// 
         /// * new_owner.
-        #[weight = 0]
+        #[weight = T::WeightInfo::change_collection_owner()]
         pub fn change_collection_owner(origin, collection_id: u64, new_owner: T::AccountId) -> DispatchResult {
 
             let sender = ensure_signed(origin)?;
@@ -604,7 +682,7 @@
         /// * collection_id: ID of the Collection to add admin for.
         /// 
         /// * new_admin_id: Address of new admin to add.
-        #[weight = 0]
+        #[weight = T::WeightInfo::add_collection_admin()]
         pub fn add_collection_admin(origin, collection_id: u64, new_admin_id: T::AccountId) -> DispatchResult {
 
             let sender = ensure_signed(origin)?;
@@ -638,7 +716,7 @@
         /// * collection_id: ID of the Collection to remove admin for.
         /// 
         /// * account_id: Address of admin to remove.
-        #[weight = 0]
+        #[weight = T::WeightInfo::remove_collection_admin()]
         pub fn remove_collection_admin(origin, collection_id: u64, account_id: T::AccountId) -> DispatchResult {
 
             let sender = ensure_signed(origin)?;
@@ -663,7 +741,7 @@
         /// * collection_id.
         /// 
         /// * new_sponsor.
-        #[weight = 0]
+        #[weight = T::WeightInfo::set_collection_sponsor()]
         pub fn set_collection_sponsor(origin, collection_id: u64, new_sponsor: T::AccountId) -> DispatchResult {
 
             let sender = ensure_signed(origin)?;
@@ -685,7 +763,7 @@
         /// # Arguments
         /// 
         /// * collection_id.
-        #[weight = 0]
+        #[weight = T::WeightInfo::confirm_sponsorship()]
         pub fn confirm_sponsorship(origin, collection_id: u64) -> DispatchResult {
 
             let sender = ensure_signed(origin)?;
@@ -710,7 +788,7 @@
         /// # Arguments
         /// 
         /// * collection_id.
-        #[weight = 0]
+        #[weight = T::WeightInfo::remove_collection_sponsor()]
         pub fn remove_collection_sponsor(origin, collection_id: u64) -> DispatchResult {
 
             let sender = ensure_signed(origin)?;
@@ -739,12 +817,18 @@
         /// # Arguments
         /// 
         /// * collection_id: ID of the collection.
-        /// 
-        /// * properties: Array of bytes that contains NFT properties. Since NFT Module is agnostic of properties meaning, it is treated purely as an array of bytes.
         /// 
         /// * owner: Address, initial owner of the NFT.
-        #[weight = 0]
-        pub fn create_item(origin, collection_id: u64, properties: Vec<u8>, owner: T::AccountId) -> DispatchResult {
+        ///
+        /// * data: Token data to store on chain.
+        // #[weight =
+        // (130_000_000 as Weight)
+        // .saturating_add((2135 as Weight).saturating_mul((properties.len() as u64) as Weight))
+        // .saturating_add(RocksDbWeight::get().reads(10 as Weight))
+        // .saturating_add(RocksDbWeight::get().writes(8 as Weight))]
+
+        #[weight = T::WeightInfo::create_item(data.len())]
+        pub fn create_item(origin, collection_id: u64, owner: T::AccountId, data: CreateItemData) -> DispatchResult {
 
             let sender = ensure_signed(origin)?;
 
@@ -811,7 +895,7 @@
         /// * collection_id: ID of the collection.
         /// 
         /// * item_id: ID of NFT to burn.
-        #[weight = 0]
+        #[weight = T::WeightInfo::burn_item()]
         pub fn burn_item(origin, collection_id: u64, item_id: u64) -> DispatchResult {
 
             let sender = ensure_signed(origin)?;
@@ -829,9 +913,9 @@
 
             match target_collection.mode
             {
-                CollectionMode::NFT(_) => Self::burn_nft_item(collection_id, item_id)?,
+                CollectionMode::NFT => Self::burn_nft_item(collection_id, item_id)?,
                 CollectionMode::Fungible(_)  => Self::burn_fungible_item(collection_id, item_id)?,
-                CollectionMode::ReFungible(_, _)  => Self::burn_refungible_item(collection_id, item_id, sender.clone())?,
+                CollectionMode::ReFungible(_)  => Self::burn_refungible_item(collection_id, item_id, sender.clone())?,
                 _ => ()
             };
 
@@ -864,7 +948,7 @@
         ///     * Non-Fungible Mode: Ignored
         ///     * Fungible Mode: Must specify transferred amount
         ///     * Re-Fungible Mode: Must specify transferred portion (between 0 and 1)
-        #[weight = 0]
+        #[weight = T::WeightInfo::transfer()]
         pub fn transfer(origin, recipient: T::AccountId, collection_id: u64, item_id: u64, value: u64) -> DispatchResult {
 
             let sender = ensure_signed(origin)?;
@@ -882,9 +966,9 @@
 
             match target_collection.mode
             {
-                CollectionMode::NFT(_) => Self::transfer_nft(collection_id, item_id, sender.clone(), recipient)?,
+                CollectionMode::NFT => Self::transfer_nft(collection_id, item_id, sender.clone(), recipient)?,
                 CollectionMode::Fungible(_)  => Self::transfer_fungible(collection_id, item_id, value, sender.clone(), recipient)?,
-                CollectionMode::ReFungible(_, _)  => Self::transfer_refungible(collection_id, item_id, value, sender.clone(), recipient)?,
+                CollectionMode::ReFungible(_)  => Self::transfer_refungible(collection_id, item_id, value, sender.clone(), recipient)?,
                 _ => ()
             };
 
@@ -906,7 +990,7 @@
         /// * collection_id.
         /// 
         /// * item_id: ID of the item.
-        #[weight = 0]
+        #[weight = T::WeightInfo::approve()]
         pub fn approve(origin, approved: T::AccountId, collection_id: u64, item_id: u64) -> DispatchResult {
 
             let sender = ensure_signed(origin)?;
@@ -964,7 +1048,7 @@
         /// * item_id: ID of the item.
         /// 
         /// * value: Amount to transfer.
-        #[weight = 0]
+        #[weight = T::WeightInfo::transfer_from()]
         pub fn transfer_from(origin, from: T::AccountId, recipient: T::AccountId, collection_id: u64, item_id: u64, value: u64 ) -> DispatchResult {
 
             let sender = ensure_signed(origin)?;
@@ -974,8 +1058,11 @@
             if <ApprovedList<T>>::contains_key(collection_id, (item_id, from.clone())) {
                 let list_itm = <ApprovedList<T>>::get(collection_id, (item_id, from.clone()));
                 let opt_item = list_itm.iter().find(|i| i.approved == sender.clone());
-                appoved_transfer = opt_item.is_some();
-                ensure!(opt_item.unwrap().amount >= value, "Requested value more than approved");
+                if opt_item.is_some()
+                {
+                    appoved_transfer = true;
+                    ensure!(opt_item.unwrap().amount >= value, "Requested value more than approved");
+                }
             }
 
             // Transfer permissions check
@@ -996,9 +1083,9 @@
 
             match target_collection.mode
             {
-                CollectionMode::NFT(_) => Self::transfer_nft(collection_id, item_id, from, recipient)?,
+                CollectionMode::NFT => Self::transfer_nft(collection_id, item_id, from, recipient)?,
                 CollectionMode::Fungible(_)  => Self::transfer_fungible(collection_id, item_id, value, from.clone(), recipient)?,
-                CollectionMode::ReFungible(_, _)  => Self::transfer_refungible(collection_id, item_id, value, from.clone(), recipient)?,
+                CollectionMode::ReFungible(_)  => Self::transfer_refungible(collection_id, item_id, value, from.clone(), recipient)?,
                 _ => ()
             };
 
@@ -1033,7 +1120,49 @@
         /// * collection_id.
         /// 
         /// * schema: String representing the offchain data schema.
-        #[weight = 0]
+        #[weight = T::WeightInfo::set_variable_meta_data()]
+        pub fn set_variable_meta_data (
+            origin,
+            collection_id: u64,
+            item_id: u64,
+            data: Vec<u8>
+        ) -> DispatchResult {
+            let sender = ensure_signed(origin)?;
+            
+            Self::collection_exists(collection_id)?;
+
+            // Modify permissions check
+            let target_collection = <Collection<T>>::get(collection_id);
+            ensure!(Self::is_item_owner(sender.clone(), collection_id, item_id) ||
+                Self::is_owner_or_admin_permissions(collection_id, sender.clone()),
+                "Only item owner, collection owner and admins can modify item");
+
+            Self::item_exists(collection_id, item_id, &target_collection.mode)?;
+
+            match target_collection.mode
+            {
+                CollectionMode::NFT => Self::set_nft_variable_data(collection_id, item_id, data)?,
+                CollectionMode::ReFungible(_)  => Self::set_re_fungible_variable_data(collection_id, item_id, data)?,
+                _ => ()
+            };
+
+            Ok(())
+        }
+        
+
+        /// Set off-chain data schema.
+        /// 
+        /// # Permissions
+        /// 
+        /// * Collection Owner
+        /// * Collection Admin
+        /// 
+        /// # Arguments
+        /// 
+        /// * collection_id.
+        /// 
+        /// * schema: String representing the offchain data schema.
+        #[weight = T::WeightInfo::set_offchain_schema()]
         pub fn set_offchain_schema(
             origin,
             collection_id: u64,
@@ -1049,6 +1178,62 @@
             Ok(())
         }
 
+        /// Set const on-chain data schema.
+        /// 
+        /// # Permissions
+        /// 
+        /// * Collection Owner
+        /// * Collection Admin
+        /// 
+        /// # Arguments
+        /// 
+        /// * collection_id.
+        /// 
+        /// * schema: String representing the const on-chain data schema.
+        #[weight = T::WeightInfo::set_const_on_chain_schema()]
+        pub fn set_const_on_chain_schema (
+            origin,
+            collection_id: u64,
+            schema: Vec<u8>
+        ) -> DispatchResult {
+            let sender = ensure_signed(origin)?;
+            Self::check_owner_or_admin_permissions(collection_id, sender.clone())?;
+
+            let mut target_collection = <Collection<T>>::get(collection_id);
+            target_collection.const_on_chain_schema = schema;
+            <Collection<T>>::insert(collection_id, target_collection);
+
+            Ok(())
+        }
+
+        /// Set variable on-chain data schema.
+        /// 
+        /// # Permissions
+        /// 
+        /// * Collection Owner
+        /// * Collection Admin
+        /// 
+        /// # Arguments
+        /// 
+        /// * collection_id.
+        /// 
+        /// * schema: String representing the variable on-chain data schema.
+        #[weight = T::WeightInfo::set_const_on_chain_schema()]
+        pub fn set_variable_on_chain_schema (
+            origin,
+            collection_id: u64,
+            schema: Vec<u8>
+        ) -> DispatchResult {
+            let sender = ensure_signed(origin)?;
+            Self::check_owner_or_admin_permissions(collection_id, sender.clone())?;
+
+            let mut target_collection = <Collection<T>>::get(collection_id);
+            target_collection.variable_on_chain_schema = schema;
+            <Collection<T>>::insert(collection_id, target_collection);
+
+            Ok(())
+        }
+
         // Sudo permissions function
         #[weight = 0]
         pub fn set_chain_limits(
@@ -1058,7 +1243,37 @@
             ensure_root(origin)?;
             <ChainLimit>::put(limits);
             Ok(())
-        }        
+        }
+
+        /// Enable smart contract self-sponsoring.
+        /// 
+        /// # Permissions
+        /// 
+        /// * Contract Owner
+        /// 
+        /// # Arguments
+        /// 
+        /// * contract address
+        /// * enable flag
+        /// 
+        #[weight = 0]
+        pub fn enable_contract_sponsoring(
+            origin,
+            contract_address: T::AccountId,
+            enable: bool
+        ) -> DispatchResult {
+            let sender = ensure_signed(origin)?;
+            let mut is_owner = false;
+            if <ContractOwner<T>>::contains_key(contract_address.clone()) {
+                let owner = <ContractOwner<T>>::get(&contract_address);
+                is_owner = sender == owner;
+            }
+            ensure!(is_owner, "Only contract owner may call this method");
+
+            <ContractSelfSponsoring<T>>::insert(contract_address, enable);
+            Ok(())
+        }
+
     }
 }
 
@@ -1356,13 +1571,13 @@
         let target_collection = <Collection<T>>::get(collection_id);
 
         match target_collection.mode {
-            CollectionMode::NFT(_) => {
+            CollectionMode::NFT => {
                 <NftItemList<T>>::get(collection_id, item_id).owner == subject
             }
             CollectionMode::Fungible(_) => {
                 <FungibleItemList<T>>::get(collection_id, item_id).owner == subject
             }
-            CollectionMode::ReFungible(_, _) => {
+            CollectionMode::ReFungible(_) => {
                 <ReFungibleItemList<T>>::get(collection_id, item_id)
                     .owner
                     .iter()
@@ -1597,7 +1812,50 @@
         <ApprovedList<T>>::remove(collection_id, (item_id, old_owner));
         Ok(())
     }
+    
+    fn item_exists(
+        collection_id: u64,
+        item_id: u64,
+        mode: &CollectionMode
+    ) -> DispatchResult {
+        match mode {
+            CollectionMode::NFT => ensure!(<NftItemList<T>>::contains_key(collection_id, item_id), "Item does not exists"),
+            CollectionMode::ReFungible(_) => ensure!(<ReFungibleItemList<T>>::contains_key(collection_id, item_id), "Item does not exists"),
+            CollectionMode::Fungible(_) => ensure!(<FungibleItemList<T>>::contains_key(collection_id, item_id), "Item does not exists"),
+            _ => ()
+        };
+        
+        Ok(())
+    }
+
+    fn set_re_fungible_variable_data(
+        collection_id: u64,
+        item_id: u64,
+        data: Vec<u8>
+    ) -> DispatchResult {
+        let mut item = <ReFungibleItemList<T>>::get(collection_id, item_id);
+
+        item.variable_data = data;
 
+        <ReFungibleItemList<T>>::insert(collection_id, item_id, item);
+
+        Ok(())
+    }
+
+    fn set_nft_variable_data(
+        collection_id: u64,
+        item_id: u64,
+        data: Vec<u8>
+    ) -> DispatchResult {
+        let mut item = <NftItemList<T>>::get(collection_id, item_id);
+        
+        item.variable_data = data;
+
+        <NftItemList<T>>::insert(collection_id, item_id, item);
+        
+        Ok(())
+    }
+
     fn init_collection(item: &CollectionType<T::AccountId>) {
         // check params
         assert!(
@@ -1771,11 +2029,11 @@
 /// Require the transactor pay for themselves and maybe include a tip to gain additional priority
 /// in the queue.
 #[derive(Encode, Decode, Clone, Eq, PartialEq)]
-pub struct ChargeTransactionPayment<T: transaction_payment::Trait + Send + Sync>(
-    #[codec(compact)] BalanceOf<T>,
+pub struct ChargeTransactionPayment<T: Trait + Send + Sync>(
+    #[codec(compact)] BalanceOf<T>
 );
 
-impl<T: Trait + transaction_payment::Trait + Send + Sync> sp_std::fmt::Debug
+impl<T: Trait + Send + Sync> sp_std::fmt::Debug
     for ChargeTransactionPayment<T>
 {
     #[cfg(feature = "std")]
@@ -1788,10 +2046,9 @@
     }
 }
 
-impl<T: Trait + transaction_payment::Trait + Send + Sync> ChargeTransactionPayment<T>
+impl<T: Trait + Send + Sync> ChargeTransactionPayment<T>
 where
-    T::Call:
-        Dispatchable<Info = DispatchInfo, PostInfo = PostDispatchInfo> + IsSubType<Module<T>, T>,
+    T::Call: Dispatchable<Info = DispatchInfo, PostInfo = PostDispatchInfo> + IsSubType<Call<T>> + IsSubType<pallet_contracts::Call<T>>,
     BalanceOf<T>: Send + Sync + FixedPointOperand,
 {
     /// utility constructor. Used only in client/factory code.
@@ -1821,15 +2078,16 @@
 
         // Set fee based on call type. Creating collection costs 1 Unique.
         // All other transactions have traditional fees so far
-        let fee = match call.is_sub_type() {
-            Some(Call::create_collection(..)) => <BalanceOf<T>>::from(1_000_000_000),
-            _ => Self::traditional_fee(len, info, tip), // Flat fee model, use only for testing purposes
-                                                        // _ => <BalanceOf<T>>::from(100)
-        };
+        // let fee = match call.is_sub_type() {
+        //     Some(Call::create_collection(..)) => <BalanceOf<T>>::from(1_000_000_000),
+        //     _ => Self::traditional_fee(len, info, tip), // Flat fee model, use only for testing purposes
+        //                                                 // _ => <BalanceOf<T>>::from(100)
+        // };
+        let fee = Self::traditional_fee(len, info, tip);
 
         // Determine who is paying transaction fee based on ecnomic model
         // Parse call to extract collection ID and access collection sponsor
-        let sponsor: T::AccountId = match call.is_sub_type() {
+        let mut sponsor: T::AccountId = match IsSubType::<Call<T>>::is_sub_type(call) {
             Some(Call::create_item(collection_id, _properties, _owner)) => {
                 <Collection<T>>::get(collection_id).sponsor
             }
@@ -1838,7 +2096,7 @@
 
                 // sponsor timeout
                 let sponsor_transfer = match _collection_mode {
-                    CollectionMode::NFT(_) => {
+                    CollectionMode::NFT => {
                         let basket = <NftTransferBasket<T>>::get(collection_id, _item_id);
                         let block_number = <system::Module<T>>::block_number() as T::BlockNumber;
                         let limit_time = basket + ChainLimit::get().nft_sponsor_transfer_timeout.into();
@@ -1872,7 +2130,7 @@
                             true
                         }
                     }
-                    CollectionMode::ReFungible(_, _) => {
+                    CollectionMode::ReFungible(_) => {
                         let basket = <ReFungibleTransferBasket<T>>::get(collection_id, _item_id);
                         let block_number = <system::Module<T>>::block_number() as T::BlockNumber;
                         let limit_time = basket + ChainLimit::get().nft_sponsor_transfer_timeout.into();
@@ -1898,6 +2156,39 @@
             _ => T::AccountId::default(),
         };
 
+        // Sponsor smart contracts
+        sponsor = match IsSubType::<pallet_contracts::Call<T>>::is_sub_type(call) {
+
+            // On instantiation: set the contract owner
+            Some(pallet_contracts::Call::instantiate(_endowment, _gas_limit, code_hash, data)) => {
+
+                let new_contract_address = <T as pallet_contracts::Trait>::DetermineContractAddress::contract_address_for(
+                    code_hash,
+                    &data,
+                    &who,
+                );
+                <ContractOwner<T>>::insert(new_contract_address.clone(), who.clone());
+
+                T::AccountId::default()
+            },
+
+            // When the contract is called, check if the sponsoring is enabled and pay fees from contract endowment if it is
+            Some(pallet_contracts::Call::call(dest, _value, _gas_limit, _data)) => {
+
+                let mut sp = T::AccountId::default();
+                let called_contract: T::AccountId = T::Lookup::lookup((*dest).clone()).unwrap_or(T::AccountId::default());
+                if <ContractSelfSponsoring<T>>::contains_key(called_contract.clone()) {
+                    if <ContractSelfSponsoring<T>>::get(called_contract.clone()) {
+                        sp = called_contract;
+                    }
+                }
+
+                sp
+            },
+
+            _ => sponsor,
+        };
+
         let mut who_pays_fee: T::AccountId = sponsor.clone();
         if sponsor == T::AccountId::default() {
             who_pays_fee = who.clone();
@@ -1924,12 +2215,12 @@
     }
 }
 
-impl<T: Trait + transaction_payment::Trait + Send + Sync> SignedExtension
+
+impl<T: Trait + Send + Sync> SignedExtension
     for ChargeTransactionPayment<T>
 where
     BalanceOf<T>: Send + Sync + From<u64> + FixedPointOperand,
-    T::Call:
-        Dispatchable<Info = DispatchInfo, PostInfo = PostDispatchInfo> + IsSubType<Module<T>, T>,
+    T::Call: Dispatchable<Info = DispatchInfo, PostInfo = PostDispatchInfo> + IsSubType<Call<T>> + IsSubType<pallet_contracts::Call<T>>,
 {
     const IDENTIFIER: &'static str = "ChargeTransactionPayment";
     type AccountId = T::AccountId;
@@ -1947,18 +2238,12 @@
 
     fn validate(
         &self,
-        who: &Self::AccountId,
-        call: &Self::Call,
-        info: &DispatchInfoOf<Self::Call>,
-        len: usize,
+        _who: &Self::AccountId,
+        _call: &Self::Call,
+        _info: &DispatchInfoOf<Self::Call>,
+        _len: usize,
     ) -> TransactionValidity {
-        let (fee, _) = self.withdraw_fee(who, call, info, len)?;
-
-        let mut r = ValidTransaction::default();
-        // NOTE: we probably want to maximize the _fee (of any type) per weight unit_ here, which
-        // will be a bit more than setting the priority to tip. For now, this is enough.
-        r.priority = fee.saturated_into::<TransactionPriority>();
-        Ok(r)
+        Ok(ValidTransaction::default())
     }
 
     fn pre_dispatch(
@@ -2009,4 +2294,5 @@
         Ok(())
     }
 }
+
 // #endregion
modifiedpallets/nft/src/mock.rsdiffbeforeafterboth
--- a/pallets/nft/src/mock.rs
+++ b/pallets/nft/src/mock.rs
@@ -1,20 +1,27 @@
 // Creating mock runtime here
 
 use crate::{Module, Trait};
+
+use pallet_contracts::{
+	ContractAddressFor, TrieId, TrieIdGenerator,
+};
+
 use frame_support::{
     impl_outer_origin, parameter_types,
     weights::{
-        constants::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight},
-        Weight,
+      //  constants::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight},
+        Weight, IdentityFee,
     },
 };
 use frame_system as system;
+use transaction_payment;
 use sp_core::H256;
 use sp_runtime::{
     testing::Header,
     traits::{BlakeTwo256, IdentityLookup, Saturating},
     Perbill,
 };
+pub use pallet_balances;
 
 impl_outer_origin! {
     pub enum Origin for Test {}
@@ -35,33 +42,122 @@
 }
 
 impl system::Trait for Test {
-    type Origin = Origin;
-    type Call = ();
-    type Index = u64;
-    type BlockNumber = u64;
-    type Hash = H256;
-    type Hashing = BlakeTwo256;
-    type AccountId = u64;
-    type Lookup = IdentityLookup<Self::AccountId>;
-    type Header = Header;
+	type BaseCallFilter = ();
+	type Origin = Origin;
+	type Call = ();
+	type Index = u64;
+	type BlockNumber = u64;
+	type Hash = H256;
+	type Hashing = BlakeTwo256;
+	type AccountId = u64;
+	type Lookup = IdentityLookup<Self::AccountId>;
+	type Header = Header;
+	type Event = ();
+	type BlockHashCount = BlockHashCount;
+	type MaximumBlockWeight = MaximumBlockWeight;
+	type DbWeight = ();
+	type BlockExecutionWeight = ();
+	type ExtrinsicBaseWeight = ();
+	type MaximumExtrinsicWeight = MaximumBlockWeight;
+	type MaximumBlockLength = MaximumBlockLength;
+	type AvailableBlockRatio = AvailableBlockRatio;
+	type Version = ();
+	type PalletInfo = ();
+	type AccountData = pallet_balances::AccountData<u64>;
+	type OnNewAccount = ();
+	type OnKilledAccount = ();
+	type SystemWeightInfo = ();
+}
+
+parameter_types! {
+	pub const ExistentialDeposit: u64 = 1;
+	pub const MaxLocks: u32 = 50;
+}
+
+type System = frame_system::Module<Test>;
+impl pallet_balances::Trait for Test {
+    type AccountStore = System;
+    type Balance = u64;
+    type DustRemoval = ();
     type Event = ();
-    type BlockHashCount = BlockHashCount;
-    type MaximumBlockWeight = MaximumBlockWeight;
-    type MaximumBlockLength = MaximumBlockLength;
-    type AvailableBlockRatio = AvailableBlockRatio;
-    type BaseCallFilter = ();
-    type DbWeight = RocksDbWeight;
-    type BlockExecutionWeight = BlockExecutionWeight;
-    type ExtrinsicBaseWeight = ExtrinsicBaseWeight;
-    type MaximumExtrinsicWeight = MaximumExtrinsicWeight;
-    type Version = ();
-    type ModuleToIndex = ();
-    type AccountData = ();
-    type OnNewAccount = ();
-    type OnKilledAccount = ();
+	type ExistentialDeposit = ExistentialDeposit;
+	type WeightInfo = ();
+	type MaxLocks = MaxLocks;
+}
+
+parameter_types! {
+	pub const TransactionByteFee: u64 = 1;
+}
+impl transaction_payment::Trait for Test {
+	type Currency = pallet_balances::Module<Test>;
+	type OnTransactionPayment = ();
+	type TransactionByteFee = TransactionByteFee;
+	type WeightToFee = IdentityFee<u64>;
+	type FeeMultiplierUpdate = ();
+}
+
+
+parameter_types! {
+	pub const MinimumPeriod: u64 = 1;
+}
+impl pallet_timestamp::Trait for Test {
+	type Moment = u64;
+	type OnTimestampSet = ();
+	type MinimumPeriod = MinimumPeriod;
+	type WeightInfo = ();
+}
+
+type Timestamp = pallet_timestamp::Module<Test>;
+type Randomness = pallet_randomness_collective_flip::Module<Test>;
+
+parameter_types! {
+	pub const TombstoneDeposit: u64 = 1;
+	pub const RentByteFee: u64 = 1;
+	pub const RentDepositOffset: u64 = 1;
+	pub const SurchargeReward: u64 = 1;
+}
+
+pub struct DummyTrieIdGenerator;
+impl TrieIdGenerator<u64> for DummyTrieIdGenerator {
+	fn trie_id(account_id: &u64) -> TrieId {
+		let new_seed = *account_id + 1;
+		let mut res = vec![];
+		res.extend_from_slice(&new_seed.to_le_bytes());
+		res.extend_from_slice(&account_id.to_le_bytes());
+		res
+	}
+}
+
+pub struct DummyContractAddressFor;
+impl ContractAddressFor<H256, u64> for DummyContractAddressFor {
+	fn contract_address_for(_code_hash: &H256, _data: &[u8], origin: &u64) -> u64 {
+		*origin + 1
+	}
+}
+
+impl pallet_contracts::Trait for Test {
+	type Time = Timestamp;
+	type Randomness = Randomness;
+	type Currency = pallet_balances::Module<Test>;
+	type Event = ();
+	type DetermineContractAddress = DummyContractAddressFor;
+	type TrieIdGenerator = DummyTrieIdGenerator;
+	type RentPayment = ();
+	type SignedClaimHandicap = pallet_contracts::DefaultSignedClaimHandicap;
+	type TombstoneDeposit = TombstoneDeposit;
+	type StorageSizeOffset = pallet_contracts::DefaultStorageSizeOffset;
+	type RentByteFee = RentByteFee;
+	type RentDepositOffset = RentDepositOffset;
+	type SurchargeReward = SurchargeReward;
+	type MaxDepth = pallet_contracts::DefaultMaxDepth;
+	type MaxValueSize = pallet_contracts::DefaultMaxValueSize;
+	type WeightPrice = ();
 }
+
 impl Trait for Test {
-    type Event = ();
+	type Event = ();
+	type WeightInfo = ();
+
 }
 pub type TemplateModule = Module<Test>;
 
modifiedpallets/nft/src/tests.rsdiffbeforeafterboth
--- a/pallets/nft/src/tests.rs
+++ b/pallets/nft/src/tests.rs
@@ -1,21 +1,16 @@
 // Tests to be written here
 use crate::mock::*;
-use crate::{AccessMode, ApprovePermissions, CollectionMode, Ownership, ChainLimits};
+use crate::{AccessMode, ApprovePermissions, CollectionMode, Ownership, ChainLimits, CreateItemData, CreateNftData, CreateFungibleData, CreateReFungibleData};
 use frame_support::{assert_noop, assert_ok};
 use frame_system::{ RawOrigin };
 
-// Use cases tests region
-// #region
-#[test]
-fn create_nft_item() {
-    new_test_ext().execute_with(|| {
-        let col_name1: Vec<u16> = "Test1\0".encode_utf16().collect::<Vec<u16>>();
-        let col_desc1: Vec<u16> = "TestDescription1\0".encode_utf16().collect::<Vec<u16>>();
-        let token_prefix1: Vec<u8> = b"token_prefix1\0".to_vec();
-        let mode: CollectionMode = CollectionMode::NFT(2000);
+fn default_collection_numbers_limit() -> u64 {
+    10
+}
 
-        assert_ok!(TemplateModule::set_chain_limits(RawOrigin::Root.into(), ChainLimits { 
-            collection_numbers_limit: 10,
+fn default_limits() {
+    assert_ok!(TemplateModule::set_chain_limits(RawOrigin::Root.into(), ChainLimits { 
+            collection_numbers_limit: default_collection_numbers_limit(),
             account_token_ownership_limit: 10,
             collections_admins_limit: 5,
             custom_data_limit: 2048,
@@ -23,24 +18,72 @@
             fungible_sponsor_transfer_timeout: 15,
             refungible_sponsor_transfer_timeout: 15,          
         }));
+}
+
+fn default_nft_data() -> CreateNftData {
+    CreateNftData { const_data: vec![1, 2, 3], variable_data: vec![3, 2, 1] }
+}
+
+fn default_fungible_data () -> CreateFungibleData {
+    CreateFungibleData { }
+}
+
+fn default_re_fungible_data () -> CreateReFungibleData {
+    CreateReFungibleData { const_data: vec![1, 2, 3], variable_data: vec![3, 2, 1] }
+}
+
+fn create_test_collection_for_owner(mode: &CollectionMode, owner: u64, id: u64) -> u64 {
+    let col_name1: Vec<u16> = "Test1\0".encode_utf16().collect::<Vec<u16>>();
+    let col_desc1: Vec<u16> = "TestDescription1\0".encode_utf16().collect::<Vec<u16>>();
+    let token_prefix1: Vec<u8> = b"token_prefix1\0".to_vec();
 
-        let origin1 = Origin::signed(1);
-        assert_ok!(TemplateModule::create_collection(
+    let origin1 = Origin::signed(owner);
+    assert_ok!(TemplateModule::create_collection(
             origin1.clone(),
             col_name1.clone(),
             col_desc1.clone(),
             token_prefix1.clone(),
-            mode
+            mode.clone()
         ));
-        assert_eq!(TemplateModule::collection(1).owner, 1);
 
-        assert_ok!(TemplateModule::create_item(
+    let saved_col_name: Vec<u16> = "Test1\0\0".encode_utf16().collect::<Vec<u16>>();
+    let saved_description: Vec<u16> = "TestDescription1\0\0".encode_utf16().collect::<Vec<u16>>();
+    let saved_prefix: Vec<u8> = b"token_prefix1\0\0".to_vec();
+    assert_eq!(TemplateModule::collection(id).owner, owner);
+    assert_eq!(TemplateModule::collection(id).name, saved_col_name);
+    assert_eq!(TemplateModule::collection(id).mode, *mode);
+    assert_eq!(TemplateModule::collection(id).description, saved_description);
+    assert_eq!(TemplateModule::collection(id).token_prefix, saved_prefix);
+    id
+}
+
+fn create_test_collection(mode: &CollectionMode, id: u64) -> u64 {
+    create_test_collection_for_owner(&mode, 1, id)
+}
+
+fn create_test_item(collection_id: u64, data: &CreateItemData) {
+    let origin1 = Origin::signed(1);
+    assert_ok!(TemplateModule::create_item(
             origin1.clone(),
+            collection_id,
             1,
-            [1, 2, 3].to_vec(),
-            1
+            data.clone()
         ));
-        assert_eq!(TemplateModule::nft_item_id(1, 1).data, [1, 2, 3].to_vec());
+
+}
+
+// Use cases tests region
+// #region
+#[test]
+fn create_nft_item() {
+    new_test_ext().execute_with(|| {
+        default_limits();
+        let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+        
+        let data = default_nft_data();
+        create_test_item(collection_id, &data.clone().into());
+        assert_eq!(TemplateModule::nft_item_id(collection_id, 1).const_data, data.const_data);
+        assert_eq!(TemplateModule::nft_item_id(collection_id, 1).variable_data, data.variable_data);
     });
 }
 
@@ -91,43 +134,21 @@
 #[test]
 fn create_refungible_item() {
     new_test_ext().execute_with(|| {
-        let col_name1: Vec<u16> = "Test1\0".encode_utf16().collect::<Vec<u16>>();
-        let col_desc1: Vec<u16> = "TestDescription1\0".encode_utf16().collect::<Vec<u16>>();
-        let token_prefix1: Vec<u8> = b"token_prefix1\0".to_vec();
-        let mode: CollectionMode = CollectionMode::ReFungible(2000, 3);
+        default_limits();
+        let collection_id = create_test_collection(&CollectionMode::ReFungible(3), 1);
 
-        assert_ok!(TemplateModule::set_chain_limits(RawOrigin::Root.into(), ChainLimits { 
-            collection_numbers_limit: 10,
-            account_token_ownership_limit: 10,
-            collections_admins_limit: 5,
-            custom_data_limit: 2048,
-            nft_sponsor_transfer_timeout: 15,
-            fungible_sponsor_transfer_timeout: 15,
-            refungible_sponsor_transfer_timeout: 15,          
-        }));
-
-        let origin1 = Origin::signed(1);
-        assert_ok!(TemplateModule::create_collection(
-            origin1.clone(),
-            col_name1.clone(),
-            col_desc1.clone(),
-            token_prefix1.clone(),
-            mode
-        ));
-        assert_eq!(TemplateModule::collection(1).owner, 1);
-
-        assert_ok!(TemplateModule::create_item(
-            origin1.clone(),
-            1,
-            [1, 2, 3].to_vec(),
-            1
-        ));
+        let data = default_re_fungible_data();
+        create_test_item(collection_id, &data.clone().into());
+        assert_eq!(
+            TemplateModule::refungible_item_id(collection_id, 1).const_data,
+            data.const_data
+        );
         assert_eq!(
-            TemplateModule::refungible_item_id(1, 1).data,
-            [1, 2, 3].to_vec()
+            TemplateModule::refungible_item_id(collection_id, 1).variable_data,
+            data.variable_data
         );
         assert_eq!(
-            TemplateModule::refungible_item_id(1, 1).owner[0],
+            TemplateModule::refungible_item_id(collection_id, 1).owner[0],
             Ownership {
                 owner: 1,
                 fraction: 1000
@@ -190,38 +211,14 @@
 #[test]
 fn create_fungible_item() {
     new_test_ext().execute_with(|| {
-        let col_name1: Vec<u16> = "Test1\0".encode_utf16().collect::<Vec<u16>>();
-        let col_desc1: Vec<u16> = "TestDescription1\0".encode_utf16().collect::<Vec<u16>>();
-        let token_prefix1: Vec<u8> = b"token_prefix1\0".to_vec();
-        let mode: CollectionMode = CollectionMode::Fungible(3);
+        default_limits();
+        
+        let collection_id = create_test_collection(&CollectionMode::Fungible(3), 1);
 
-        assert_ok!(TemplateModule::set_chain_limits(RawOrigin::Root.into(), ChainLimits { 
-            collection_numbers_limit: 10,
-            account_token_ownership_limit: 10,
-            collections_admins_limit: 5,
-            custom_data_limit: 2048,
-            nft_sponsor_transfer_timeout: 15,
-            fungible_sponsor_transfer_timeout: 15,
-            refungible_sponsor_transfer_timeout: 15,          
-        }));
+        let data = default_fungible_data();
+        create_test_item(collection_id, &data.into());
 
-        let origin1 = Origin::signed(1);
-        assert_ok!(TemplateModule::create_collection(
-            origin1.clone(),
-            col_name1.clone(),
-            col_desc1.clone(),
-            token_prefix1.clone(),
-            mode
-        ));
-        assert_eq!(TemplateModule::collection(1).owner, 1);
-
-        assert_ok!(TemplateModule::create_item(
-            origin1.clone(),
-            1,
-            [].to_vec(),
-            1
-        ));
-        assert_eq!(TemplateModule::fungible_item_id(1, 1).owner, 1);
+        assert_eq!(TemplateModule::fungible_item_id(collection_id, 1).owner, 1);
     });
 }
 
@@ -273,38 +270,16 @@
 #[test]
 fn transfer_fungible_item() {
     new_test_ext().execute_with(|| {
-        let col_name1: Vec<u16> = "Test1\0".encode_utf16().collect::<Vec<u16>>();
-        let col_desc1: Vec<u16> = "TestDescription1\0".encode_utf16().collect::<Vec<u16>>();
-        let token_prefix1: Vec<u8> = b"token_prefix1\0".to_vec();
-        let mode: CollectionMode = CollectionMode::Fungible(3);
-
-        assert_ok!(TemplateModule::set_chain_limits(RawOrigin::Root.into(), ChainLimits { 
-            collection_numbers_limit: 10,
-            account_token_ownership_limit: 10,
-            collections_admins_limit: 5,
-            custom_data_limit: 2048,
-            nft_sponsor_transfer_timeout: 15,
-            fungible_sponsor_transfer_timeout: 15,
-            refungible_sponsor_transfer_timeout: 15,          
-        }));
+        default_limits();
+        
+        let collection_id = create_test_collection(&CollectionMode::Fungible(3), 1);
 
         let origin1 = Origin::signed(1);
         let origin2 = Origin::signed(2);
-        assert_ok!(TemplateModule::create_collection(
-            origin1.clone(),
-            col_name1.clone(),
-            col_desc1.clone(),
-            token_prefix1.clone(),
-            mode
-        ));
-        assert_eq!(TemplateModule::collection(1).owner, 1);
 
-        assert_ok!(TemplateModule::create_item(
-            origin1.clone(),
-            1,
-            [].to_vec(),
-            1
-        ));
+        let data = default_fungible_data();
+        create_test_item(collection_id, &data.into());
+
         assert_eq!(TemplateModule::fungible_item_id(1, 1).owner, 1);
         assert_eq!(TemplateModule::balance_count(1, 1), 1000);
         assert_eq!(TemplateModule::address_tokens(1, 1), [1]);
@@ -315,7 +290,7 @@
         assert_eq!(TemplateModule::fungible_item_id(1, 1).value, 1000);
         assert_eq!(TemplateModule::balance_count(1, 1), 0);
         assert_eq!(TemplateModule::balance_count(1, 2), 1000);
-        assert_eq!(TemplateModule::address_tokens(1, 1), []);
+        // assert_eq!(TemplateModule::address_tokens(1, 1), []);
         assert_eq!(TemplateModule::address_tokens(1, 2), [1]);
 
         // split item scenario
@@ -341,44 +316,25 @@
 #[test]
 fn transfer_refungible_item() {
     new_test_ext().execute_with(|| {
-        let col_name1: Vec<u16> = "Test1\0".encode_utf16().collect::<Vec<u16>>();
-        let col_desc1: Vec<u16> = "TestDescription1\0".encode_utf16().collect::<Vec<u16>>();
-        let token_prefix1: Vec<u8> = b"token_prefix1\0".to_vec();
-        let mode: CollectionMode = CollectionMode::ReFungible(2000, 3);
+        default_limits();
+        
+        let collection_id = create_test_collection(&CollectionMode::ReFungible(3), 1);
 
-        assert_ok!(TemplateModule::set_chain_limits(RawOrigin::Root.into(), ChainLimits { 
-            collection_numbers_limit: 10,
-            account_token_ownership_limit: 10,
-            collections_admins_limit: 5,
-            custom_data_limit: 2048,
-            nft_sponsor_transfer_timeout: 15,
-            fungible_sponsor_transfer_timeout: 15,
-            refungible_sponsor_transfer_timeout: 15,          
-        }));
+        let data = default_re_fungible_data();
+        create_test_item(collection_id, &data.clone().into());
 
         let origin1 = Origin::signed(1);
         let origin2 = Origin::signed(2);
-        assert_ok!(TemplateModule::create_collection(
-            origin1.clone(),
-            col_name1.clone(),
-            col_desc1.clone(),
-            token_prefix1.clone(),
-            mode
-        ));
-        assert_eq!(TemplateModule::collection(1).owner, 1);
-
-        assert_ok!(TemplateModule::create_item(
-            origin1.clone(),
-            1,
-            [1, 2, 3].to_vec(),
-            1
-        ));
         assert_eq!(
-            TemplateModule::refungible_item_id(1, 1).data,
-            [1, 2, 3].to_vec()
+            TemplateModule::refungible_item_id(collection_id, 1).const_data,
+            data.const_data
+        );
+        assert_eq!(
+            TemplateModule::refungible_item_id(collection_id, 1).variable_data,
+            data.variable_data
         );
         assert_eq!(
-            TemplateModule::refungible_item_id(1, 1).owner[0],
+            TemplateModule::refungible_item_id(collection_id, 1).owner[0],
             Ownership {
                 owner: 1,
                 fraction: 1000
@@ -398,7 +354,7 @@
         );
         assert_eq!(TemplateModule::balance_count(1, 1), 0);
         assert_eq!(TemplateModule::balance_count(1, 2), 1000);
-        assert_eq!(TemplateModule::address_tokens(1, 1), []);
+        // assert_eq!(TemplateModule::address_tokens(1, 1), []);
         assert_eq!(TemplateModule::address_tokens(1, 2), [1]);
 
         // split item scenario
@@ -448,47 +404,22 @@
 #[test]
 fn transfer_nft_item() {
     new_test_ext().execute_with(|| {
-        let col_name1: Vec<u16> = "Test1\0".encode_utf16().collect::<Vec<u16>>();
-        let col_desc1: Vec<u16> = "TestDescription1\0".encode_utf16().collect::<Vec<u16>>();
-        let token_prefix1: Vec<u8> = b"token_prefix1\0".to_vec();
-        let mode: CollectionMode = CollectionMode::NFT(2000);
-
-        assert_ok!(TemplateModule::set_chain_limits(RawOrigin::Root.into(), ChainLimits { 
-            collection_numbers_limit: 10,
-            account_token_ownership_limit: 10,
-            collections_admins_limit: 5,
-            custom_data_limit: 2048,
-            nft_sponsor_transfer_timeout: 15,
-            fungible_sponsor_transfer_timeout: 15,
-            refungible_sponsor_transfer_timeout: 15,          
-        }));
+        default_limits();
+        
+        let collection_id = create_test_collection(&CollectionMode::NFT, 1);
 
-        let origin1 = Origin::signed(1);
-        assert_ok!(TemplateModule::create_collection(
-            origin1.clone(),
-            col_name1.clone(),
-            col_desc1.clone(),
-            token_prefix1.clone(),
-            mode
-        ));
-        assert_eq!(TemplateModule::collection(1).owner, 1);
-
-        assert_ok!(TemplateModule::create_item(
-            origin1.clone(),
-            1,
-            [1, 2, 3].to_vec(),
-            1
-        ));
-        assert_eq!(TemplateModule::nft_item_id(1, 1).data, [1, 2, 3].to_vec());
+        let data = default_nft_data();
+        create_test_item(collection_id, &data.into());
         assert_eq!(TemplateModule::balance_count(1, 1), 1);
         assert_eq!(TemplateModule::address_tokens(1, 1), [1]);
 
+        let origin1 = Origin::signed(1);
         // default scenario
         assert_ok!(TemplateModule::transfer(origin1.clone(), 2, 1, 1, 1000));
         assert_eq!(TemplateModule::nft_item_id(1, 1).owner, 2);
         assert_eq!(TemplateModule::balance_count(1, 1), 0);
         assert_eq!(TemplateModule::balance_count(1, 2), 1);
-        assert_eq!(TemplateModule::address_tokens(1, 1), []);
+        // assert_eq!(TemplateModule::address_tokens(1, 1), []);
         assert_eq!(TemplateModule::address_tokens(1, 2), [1]);
     });
 }
@@ -496,39 +427,65 @@
 #[test]
 fn nft_approve_and_transfer_from() {
     new_test_ext().execute_with(|| {
-        let col_name1: Vec<u16> = "Test1\0".encode_utf16().collect::<Vec<u16>>();
-        let col_desc1: Vec<u16> = "TestDescription1\0".encode_utf16().collect::<Vec<u16>>();
-        let token_prefix1: Vec<u8> = b"token_prefix1\0".to_vec();
-        let mode: CollectionMode = CollectionMode::NFT(2000);
+        default_limits();
+        
+        let collection_id = create_test_collection(&CollectionMode::NFT, 1);
 
-        assert_ok!(TemplateModule::set_chain_limits(RawOrigin::Root.into(), ChainLimits { 
-            collection_numbers_limit: 10,
-            account_token_ownership_limit: 10,
-            collections_admins_limit: 5,
-            custom_data_limit: 2048,
-            nft_sponsor_transfer_timeout: 15,
-            fungible_sponsor_transfer_timeout: 15,
-            refungible_sponsor_transfer_timeout: 15,          
-        }));
+        let data = default_nft_data();
+        create_test_item(collection_id, &data.into());
 
         let origin1 = Origin::signed(1);
         let origin2 = Origin::signed(2);
-        assert_ok!(TemplateModule::create_collection(
-            origin1.clone(),
-            col_name1.clone(),
-            col_desc1.clone(),
-            token_prefix1.clone(),
-            mode
-        ));
-        assert_eq!(TemplateModule::collection(1).owner, 1);
 
-        assert_ok!(TemplateModule::create_item(
-            origin1.clone(),
+        assert_eq!(TemplateModule::balance_count(1, 1), 1);
+        assert_eq!(TemplateModule::address_tokens(1, 1), [1]);
+
+        // neg transfer
+        assert_noop!(TemplateModule::transfer_from(
+            origin2.clone(),
             1,
-            [1, 2, 3].to_vec(),
+            2,
+            1,
+            1,
+            1), "Only item owner, collection owner and admins can modify items");
+
+        // do approve
+        assert_ok!(TemplateModule::approve(origin1.clone(), 2, 1, 1));
+        assert_eq!(TemplateModule::approved(1, (1, 1)).len(), 1);
+        assert_eq!(
+            TemplateModule::approved(1, (1, 1))[0],
+            ApprovePermissions {
+                approved: 2,
+                amount: 100000000
+            }
+        );
+
+        assert_ok!(TemplateModule::transfer_from(
+            origin2.clone(),
+            1,
+            2,
+            1,
+            1,
             1
         ));
-        assert_eq!(TemplateModule::nft_item_id(1, 1).data, [1, 2, 3].to_vec());
+        assert_eq!(TemplateModule::approved(1, (1, 1)).len(), 0);
+    });
+}
+
+#[test]
+fn nft_approve_and_transfer_from_white_list() {
+    new_test_ext().execute_with(|| {
+        default_limits();
+        
+        let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+
+        let origin1 = Origin::signed(1);
+        let origin2 = Origin::signed(2);
+
+        let data = default_nft_data();
+        create_test_item(collection_id, &data.clone().into());
+
+        assert_eq!(TemplateModule::nft_item_id(1, 1).const_data, data.const_data);
         assert_eq!(TemplateModule::balance_count(1, 1), 1);
         assert_eq!(TemplateModule::address_tokens(1, 1), [1]);
 
@@ -574,49 +531,16 @@
 #[test]
 fn refungible_approve_and_transfer_from() {
     new_test_ext().execute_with(|| {
-        let col_name1: Vec<u16> = "Test1\0".encode_utf16().collect::<Vec<u16>>();
-        let col_desc1: Vec<u16> = "TestDescription1\0".encode_utf16().collect::<Vec<u16>>();
-        let token_prefix1: Vec<u8> = b"token_prefix1\0".to_vec();
-        let mode: CollectionMode = CollectionMode::ReFungible(2000, 3);
-
-        assert_ok!(TemplateModule::set_chain_limits(RawOrigin::Root.into(), ChainLimits { 
-            collection_numbers_limit: 10,
-            account_token_ownership_limit: 10,
-            collections_admins_limit: 5,
-            custom_data_limit: 2048,
-            nft_sponsor_transfer_timeout: 15,
-            fungible_sponsor_transfer_timeout: 15,
-            refungible_sponsor_transfer_timeout: 15,          
-        }));
-
+        default_limits();
+        
+        let collection_id = create_test_collection(&CollectionMode::ReFungible(3), 1);
+        
         let origin1 = Origin::signed(1);
         let origin2 = Origin::signed(2);
-        assert_ok!(TemplateModule::create_collection(
-            origin1.clone(),
-            col_name1.clone(),
-            col_desc1.clone(),
-            token_prefix1.clone(),
-            mode
-        ));
-        assert_eq!(TemplateModule::collection(1).owner, 1);
 
-        assert_ok!(TemplateModule::create_item(
-            origin1.clone(),
-            1,
-            [1, 2, 3].to_vec(),
-            1
-        ));
-        assert_eq!(
-            TemplateModule::refungible_item_id(1, 1).data,
-            [1, 2, 3].to_vec()
-        );
-        assert_eq!(
-            TemplateModule::refungible_item_id(1, 1).owner[0],
-            Ownership {
-                owner: 1,
-                fraction: 1000
-            }
-        );
+        let data = default_re_fungible_data();
+        create_test_item(collection_id, &data.into());
+
         assert_eq!(TemplateModule::balance_count(1, 1), 1000);
         assert_eq!(TemplateModule::address_tokens(1, 1), [1]);
 
@@ -674,39 +598,16 @@
 #[test]
 fn fungible_approve_and_transfer_from() {
     new_test_ext().execute_with(|| {
-        let col_name1: Vec<u16> = "Test1\0".encode_utf16().collect::<Vec<u16>>();
-        let col_desc1: Vec<u16> = "TestDescription1\0".encode_utf16().collect::<Vec<u16>>();
-        let token_prefix1: Vec<u8> = b"token_prefix1\0".to_vec();
-        let mode: CollectionMode = CollectionMode::Fungible(3);
+        default_limits();
+        
+        let collection_id = create_test_collection(&CollectionMode::Fungible(3), 1);
+        
+        let data = default_fungible_data();
+        create_test_item(collection_id, &data.into());
 
-        assert_ok!(TemplateModule::set_chain_limits(RawOrigin::Root.into(), ChainLimits { 
-            collection_numbers_limit: 10,
-            account_token_ownership_limit: 10,
-            collections_admins_limit: 5,
-            custom_data_limit: 2048,
-            nft_sponsor_transfer_timeout: 15,
-            fungible_sponsor_transfer_timeout: 15,
-            refungible_sponsor_transfer_timeout: 15,          
-        }));
-
         let origin1 = Origin::signed(1);
         let origin2 = Origin::signed(2);
-        assert_ok!(TemplateModule::create_collection(
-            origin1.clone(),
-            col_name1.clone(),
-            col_desc1.clone(),
-            token_prefix1.clone(),
-            mode
-        ));
-        assert_eq!(TemplateModule::collection(1).owner, 1);
 
-        assert_ok!(TemplateModule::create_item(
-            origin1.clone(),
-            1,
-            [].to_vec(),
-            1
-        ));
-        assert_eq!(TemplateModule::fungible_item_id(1, 1).owner, 1);
         assert_eq!(TemplateModule::balance_count(1, 1), 1000);
         assert_eq!(TemplateModule::address_tokens(1, 1), [1]);
 
@@ -770,7 +671,7 @@
         ));
         assert_eq!(TemplateModule::balance_count(1, 1), 0);
         assert_eq!(TemplateModule::balance_count(1, 3), 1000);
-        assert_eq!(TemplateModule::address_tokens(1, 1), []);
+        // assert_eq!(TemplateModule::address_tokens(1, 1), []);
         assert_eq!(TemplateModule::address_tokens(1, 3), [2]);
 
         assert_eq!(TemplateModule::approved(1, (1, 1)).len(), 0);
@@ -780,103 +681,44 @@
 #[test]
 fn change_collection_owner() {
     new_test_ext().execute_with(|| {
-        let col_name1: Vec<u16> = "Test1\0".encode_utf16().collect::<Vec<u16>>();
-        let col_desc1: Vec<u16> = "TestDescription1\0".encode_utf16().collect::<Vec<u16>>();
-        let token_prefix1: Vec<u8> = b"token_prefix1\0".to_vec();
-        let mode: CollectionMode = CollectionMode::NFT(2000);
-
-        assert_ok!(TemplateModule::set_chain_limits(RawOrigin::Root.into(), ChainLimits { 
-            collection_numbers_limit: 10,
-            account_token_ownership_limit: 10,
-            collections_admins_limit: 5,
-            custom_data_limit: 2048,
-            nft_sponsor_transfer_timeout: 15,
-            fungible_sponsor_transfer_timeout: 15,
-            refungible_sponsor_transfer_timeout: 15,          
-        }));
-
+        default_limits();
+        
+        let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+        
         let origin1 = Origin::signed(1);
-        assert_ok!(TemplateModule::create_collection(
-            origin1.clone(),
-            col_name1.clone(),
-            col_desc1.clone(),
-            token_prefix1.clone(),
-            mode
-        ));
         assert_ok!(TemplateModule::change_collection_owner(
             origin1.clone(),
-            1,
+            collection_id,
             2
         ));
-        assert_eq!(TemplateModule::collection(1).owner, 2);
+        assert_eq!(TemplateModule::collection(collection_id).owner, 2);
     });
 }
 
 #[test]
 fn destroy_collection() {
     new_test_ext().execute_with(|| {
-        let col_name1: Vec<u16> = "Test1\0".encode_utf16().collect::<Vec<u16>>();
-        let col_desc1: Vec<u16> = "TestDescription1\0".encode_utf16().collect::<Vec<u16>>();
-        let token_prefix1: Vec<u8> = b"token_prefix1\0".to_vec();
-        let mode: CollectionMode = CollectionMode::NFT(2000);
-
-        assert_ok!(TemplateModule::set_chain_limits(RawOrigin::Root.into(), ChainLimits { 
-            collection_numbers_limit: 10,
-            account_token_ownership_limit: 10,
-            collections_admins_limit: 5,
-            custom_data_limit: 2048,
-            nft_sponsor_transfer_timeout: 15,
-            fungible_sponsor_transfer_timeout: 15,
-            refungible_sponsor_transfer_timeout: 15,          
-        }));
-
+        default_limits();
+        
+        let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+        
         let origin1 = Origin::signed(1);
-        assert_ok!(TemplateModule::create_collection(
-            origin1.clone(),
-            col_name1.clone(),
-            col_desc1.clone(),
-            token_prefix1.clone(),
-            mode
-        ));
-        assert_ok!(TemplateModule::destroy_collection(origin1.clone(), 1));
+        assert_ok!(TemplateModule::destroy_collection(origin1.clone(), collection_id));
     });
 }
 
 #[test]
 fn burn_nft_item() {
     new_test_ext().execute_with(|| {
-        let col_name1: Vec<u16> = "Test1\0".encode_utf16().collect::<Vec<u16>>();
-        let col_desc1: Vec<u16> = "TestDescription1\0".encode_utf16().collect::<Vec<u16>>();
-        let token_prefix1: Vec<u8> = b"token_prefix1\0".to_vec();
-        let mode: CollectionMode = CollectionMode::NFT(2000);
-
-        assert_ok!(TemplateModule::set_chain_limits(RawOrigin::Root.into(), ChainLimits { 
-            collection_numbers_limit: 10,
-            account_token_ownership_limit: 10,
-            collections_admins_limit: 5,
-            custom_data_limit: 2048,
-            nft_sponsor_transfer_timeout: 15,
-            fungible_sponsor_transfer_timeout: 15,
-            refungible_sponsor_transfer_timeout: 15,          
-        }));
+        default_limits();
+        
+        let collection_id = create_test_collection(&CollectionMode::NFT, 1);
 
         let origin1 = Origin::signed(1);
-        assert_ok!(TemplateModule::create_collection(
-            origin1.clone(),
-            col_name1.clone(),
-            col_desc1.clone(),
-            token_prefix1.clone(),
-            mode
-        ));
-        assert_ok!(TemplateModule::add_collection_admin(origin1.clone(), 1, 2));
-        assert_ok!(TemplateModule::create_item(
-            origin1.clone(),
-            1,
-            [1, 2, 3].to_vec(),
-            1
-        ));
-
-        assert_eq!(TemplateModule::nft_item_id(1, 1).data, [1, 2, 3].to_vec());
+        assert_ok!(TemplateModule::add_collection_admin(origin1.clone(), collection_id, 2));
+        
+        let data = default_nft_data();
+        create_test_item(collection_id, &data.into());
 
         // check balance (collection with id = 1, user id = 1)
         assert_eq!(TemplateModule::balance_count(1, 1), 1);
@@ -895,36 +737,15 @@
 #[test]
 fn burn_fungible_item() {
     new_test_ext().execute_with(|| {
-        let col_name1: Vec<u16> = "Test1\0".encode_utf16().collect::<Vec<u16>>();
-        let col_desc1: Vec<u16> = "TestDescription1\0".encode_utf16().collect::<Vec<u16>>();
-        let token_prefix1: Vec<u8> = b"token_prefix1\0".to_vec();
-        let mode: CollectionMode = CollectionMode::Fungible(3);
-
-        assert_ok!(TemplateModule::set_chain_limits(RawOrigin::Root.into(), ChainLimits { 
-            collection_numbers_limit: 10,
-            account_token_ownership_limit: 10,
-            collections_admins_limit: 5,
-            custom_data_limit: 2048,
-            nft_sponsor_transfer_timeout: 15,
-            fungible_sponsor_transfer_timeout: 15,
-            refungible_sponsor_transfer_timeout: 15,          
-        }));
-
+        default_limits();
+        
+        let collection_id = create_test_collection(&CollectionMode::Fungible(3), 1);
+        
         let origin1 = Origin::signed(1);
-        assert_ok!(TemplateModule::create_collection(
-            origin1.clone(),
-            col_name1.clone(),
-            col_desc1.clone(),
-            token_prefix1.clone(),
-            mode
-        ));
-        assert_ok!(TemplateModule::add_collection_admin(origin1.clone(), 1, 2));
-        assert_ok!(TemplateModule::create_item(
-            origin1.clone(),
-            1,
-            [].to_vec(),
-            1
-        ));
+        assert_ok!(TemplateModule::add_collection_admin(origin1.clone(), collection_id, 2));
+        
+        let data = default_fungible_data();
+        create_test_item(collection_id, &data.into());
 
         // check balance (collection with id = 1, user id = 1)
         assert_eq!(TemplateModule::balance_count(1, 1), 1000);
@@ -943,55 +764,27 @@
 #[test]
 fn burn_refungible_item() {
     new_test_ext().execute_with(|| {
-        let col_name1: Vec<u16> = "Test1\0".encode_utf16().collect::<Vec<u16>>();
-        let col_desc1: Vec<u16> = "TestDescription1\0".encode_utf16().collect::<Vec<u16>>();
-        let token_prefix1: Vec<u8> = b"token_prefix1\0".to_vec();
-        let mode: CollectionMode = CollectionMode::ReFungible(200, 3);
-
-        assert_ok!(TemplateModule::set_chain_limits(RawOrigin::Root.into(), ChainLimits { 
-            collection_numbers_limit: 10,
-            account_token_ownership_limit: 10,
-            collections_admins_limit: 5,
-            custom_data_limit: 2048,
-            nft_sponsor_transfer_timeout: 15,
-            fungible_sponsor_transfer_timeout: 15,
-            refungible_sponsor_transfer_timeout: 15,          
-        }));
-
+        default_limits();
+        
+        let collection_id = create_test_collection(&CollectionMode::ReFungible(3), 1);
         let origin1 = Origin::signed(1);
-        let origin2 = Origin::signed(2);
-        assert_ok!(TemplateModule::create_collection(
-            origin1.clone(),
-            col_name1.clone(),
-            col_desc1.clone(),
-            token_prefix1.clone(),
-            mode
-        ));
 
         assert_ok!(TemplateModule::set_mint_permission(
             origin1.clone(),
-            1,
+            collection_id,
             true
         ));
         assert_ok!(TemplateModule::set_public_access_mode(
             origin1.clone(),
-            1,
+            collection_id,
             AccessMode::WhiteList
         ));
         assert_ok!(TemplateModule::add_to_white_list(origin1.clone(), 1, 1));
 
         assert_ok!(TemplateModule::add_collection_admin(origin1.clone(), 1, 2));
-        assert_ok!(TemplateModule::create_item(
-            origin2.clone(),
-            1,
-            [1, 2, 3].to_vec(),
-            1
-        ));
-
-        assert_eq!(
-            TemplateModule::refungible_item_id(1, 1).data,
-            [1, 2, 3].to_vec()
-        );
+        
+        let data = default_re_fungible_data();
+        create_test_item(collection_id, &data.into());
 
         // check balance (collection with id = 1, user id = 2)
         assert_eq!(TemplateModule::balance_count(1, 1), 1000);
@@ -1010,110 +803,38 @@
 #[test]
 fn add_collection_admin() {
     new_test_ext().execute_with(|| {
-        let col_name1: Vec<u16> = "Test1\0".encode_utf16().collect::<Vec<u16>>();
-        let col_desc1: Vec<u16> = "TestDescription1\0".encode_utf16().collect::<Vec<u16>>();
-        let token_prefix1: Vec<u8> = b"token_prefix1\0".to_vec();
-        let mode: CollectionMode = CollectionMode::NFT(2000);
-
-        assert_ok!(TemplateModule::set_chain_limits(RawOrigin::Root.into(), ChainLimits { 
-            collection_numbers_limit: 10,
-            account_token_ownership_limit: 10,
-            collections_admins_limit: 5,
-            custom_data_limit: 2048,
-            nft_sponsor_transfer_timeout: 15,
-            fungible_sponsor_transfer_timeout: 15,
-            refungible_sponsor_transfer_timeout: 15,          
-        }));
-
+        default_limits();
+        
+        let collection1_id = create_test_collection_for_owner(&CollectionMode::NFT, 1, 1);
+        create_test_collection_for_owner(&CollectionMode::NFT, 2, 2);
+        create_test_collection_for_owner(&CollectionMode::NFT, 3, 3);
+        
         let origin1 = Origin::signed(1);
-        let origin2 = Origin::signed(2);
-        let origin3 = Origin::signed(3);
-        assert_ok!(TemplateModule::create_collection(
-            origin1.clone(),
-            col_name1.clone(),
-            col_desc1.clone(),
-            token_prefix1.clone(),
-            mode.clone()
-        ));
-        assert_ok!(TemplateModule::create_collection(
-            origin2.clone(),
-            col_name1.clone(),
-            col_desc1.clone(),
-            token_prefix1.clone(),
-            mode.clone()
-        ));
-        assert_ok!(TemplateModule::create_collection(
-            origin3.clone(),
-            col_name1.clone(),
-            col_desc1.clone(),
-            token_prefix1.clone(),
-            mode.clone()
-        ));
-
-        assert_eq!(TemplateModule::collection(1).owner, 1);
-        assert_eq!(TemplateModule::collection(2).owner, 2);
-        assert_eq!(TemplateModule::collection(3).owner, 3);
 
         // collection admin
-        assert_ok!(TemplateModule::add_collection_admin(origin1.clone(), 1, 2));
-        assert_ok!(TemplateModule::add_collection_admin(origin1.clone(), 1, 3));
+        assert_ok!(TemplateModule::add_collection_admin(origin1.clone(), collection1_id, 2));
+        assert_ok!(TemplateModule::add_collection_admin(origin1.clone(), collection1_id, 3));
 
-        assert_eq!(TemplateModule::admin_list_collection(1).contains(&2), true);
-        assert_eq!(TemplateModule::admin_list_collection(1).contains(&3), true);
+        assert_eq!(TemplateModule::admin_list_collection(collection1_id).contains(&2), true);
+        assert_eq!(TemplateModule::admin_list_collection(collection1_id).contains(&3), true);
     });
 }
 
 #[test]
 fn remove_collection_admin() {
     new_test_ext().execute_with(|| {
-        let col_name1: Vec<u16> = "Test1\0".encode_utf16().collect::<Vec<u16>>();
-        let col_desc1: Vec<u16> = "TestDescription1\0".encode_utf16().collect::<Vec<u16>>();
-        let token_prefix1: Vec<u8> = b"token_prefix1\0".to_vec();
-        let mode: CollectionMode = CollectionMode::NFT(2000);
+        default_limits();
+        
+        let collection1_id = create_test_collection_for_owner(&CollectionMode::NFT, 1, 1);
+        create_test_collection_for_owner(&CollectionMode::NFT, 2, 2);
+        create_test_collection_for_owner(&CollectionMode::NFT, 3, 3);
 
         let origin1 = Origin::signed(1);
         let origin2 = Origin::signed(2);
-        let origin3 = Origin::signed(3);
 
-        assert_ok!(TemplateModule::set_chain_limits(RawOrigin::Root.into(), ChainLimits { 
-            collection_numbers_limit: 10,
-            account_token_ownership_limit: 10,
-            collections_admins_limit: 5,
-            custom_data_limit: 2048,
-            nft_sponsor_transfer_timeout: 15,
-            fungible_sponsor_transfer_timeout: 15,
-            refungible_sponsor_transfer_timeout: 15,          
-        }));
-
-        assert_ok!(TemplateModule::create_collection(
-            origin1.clone(),
-            col_name1.clone(),
-            col_desc1.clone(),
-            token_prefix1.clone(),
-            mode.clone()
-        ));
-        assert_ok!(TemplateModule::create_collection(
-            origin2.clone(),
-            col_name1.clone(),
-            col_desc1.clone(),
-            token_prefix1.clone(),
-            mode.clone()
-        ));
-        assert_ok!(TemplateModule::create_collection(
-            origin3.clone(),
-            col_name1.clone(),
-            col_desc1.clone(),
-            token_prefix1.clone(),
-            mode.clone()
-        ));
-
-        assert_eq!(TemplateModule::collection(1).owner, 1);
-        assert_eq!(TemplateModule::collection(2).owner, 2);
-        assert_eq!(TemplateModule::collection(3).owner, 3);
-
         // collection admin
-        assert_ok!(TemplateModule::add_collection_admin(origin1.clone(), 1, 2));
-        assert_ok!(TemplateModule::add_collection_admin(origin1.clone(), 1, 3));
+        assert_ok!(TemplateModule::add_collection_admin(origin1.clone(), collection1_id, 2));
+        assert_ok!(TemplateModule::add_collection_admin(origin1.clone(), collection1_id, 3));
 
         assert_eq!(TemplateModule::admin_list_collection(1).contains(&2), true);
         assert_eq!(TemplateModule::admin_list_collection(1).contains(&3), true);
@@ -1131,125 +852,48 @@
 #[test]
 fn balance_of() {
     new_test_ext().execute_with(|| {
-        let col_name1: Vec<u16> = "Test1\0".encode_utf16().collect::<Vec<u16>>();
-        let col_desc1: Vec<u16> = "TestDescription1\0".encode_utf16().collect::<Vec<u16>>();
-        let token_prefix1: Vec<u8> = b"token_prefix1\0".to_vec();
-        let nft_mode: CollectionMode = CollectionMode::NFT(2000);
-        let furg_mode: CollectionMode = CollectionMode::Fungible(3);
-        let refung_mode: CollectionMode = CollectionMode::ReFungible(2000, 3);
-
-        let origin1 = Origin::signed(1);
-
-        assert_ok!(TemplateModule::set_chain_limits(RawOrigin::Root.into(), ChainLimits { 
-            collection_numbers_limit: 10,
-            account_token_ownership_limit: 10,
-            collections_admins_limit: 5,
-            custom_data_limit: 2048,
-            nft_sponsor_transfer_timeout: 15,
-            fungible_sponsor_transfer_timeout: 15,
-            refungible_sponsor_transfer_timeout: 15,          
-        }));
-
-        assert_ok!(TemplateModule::create_collection(
-            origin1.clone(),
-            col_name1.clone(),
-            col_desc1.clone(),
-            token_prefix1.clone(),
-            nft_mode.clone()
-        ));
-        assert_ok!(TemplateModule::create_collection(
-            origin1.clone(),
-            col_name1.clone(),
-            col_desc1.clone(),
-            token_prefix1.clone(),
-            furg_mode.clone()
-        ));
-        assert_ok!(TemplateModule::create_collection(
-            origin1.clone(),
-            col_name1.clone(),
-            col_desc1.clone(),
-            token_prefix1.clone(),
-            refung_mode.clone()
-        ));
-
-        assert_eq!(TemplateModule::collection(1).owner, 1);
-        assert_eq!(TemplateModule::collection(2).owner, 1);
-        assert_eq!(TemplateModule::collection(3).owner, 1);
-
+        default_limits();
+        
+        let nft_collection_id = create_test_collection(&CollectionMode::NFT, 1);
+        let fungible_collection_id = create_test_collection(&CollectionMode::Fungible(3), 2);
+        let re_fungible_collection_id = create_test_collection(&CollectionMode::ReFungible(3), 3);
+        
         // check balance before
-        assert_eq!(TemplateModule::balance_count(1, 1), 0);
-        assert_eq!(TemplateModule::balance_count(2, 1), 0);
-        assert_eq!(TemplateModule::balance_count(3, 1), 0);
-
-        // create item
-        assert_ok!(TemplateModule::create_item(
-            origin1.clone(),
-            1,
-            [1, 1, 1].to_vec(),
-            1
-        ));
+        assert_eq!(TemplateModule::balance_count(nft_collection_id, 1), 0);
+        assert_eq!(TemplateModule::balance_count(fungible_collection_id, 1), 0);
+        assert_eq!(TemplateModule::balance_count(re_fungible_collection_id, 1), 0);
 
-        assert_ok!(TemplateModule::create_item(
-            origin1.clone(),
-            2,
-            [].to_vec(),
-            1
-        ));
-
-        assert_ok!(TemplateModule::create_item(
-            origin1.clone(),
-            3,
-            [1, 1, 1].to_vec(),
-            1
-        ));
+        let nft_data = default_nft_data();
+        create_test_item(nft_collection_id, &nft_data.into());
+        
+        let fungible_data = default_fungible_data();
+        create_test_item(fungible_collection_id, &fungible_data.into());
+        
+        let re_fungible_data = default_re_fungible_data();
+        create_test_item(re_fungible_collection_id, &re_fungible_data.into());
 
         // check balance (collection with id = 1, user id = 1)
-        assert_eq!(TemplateModule::balance_count(1, 1), 1);
-        assert_eq!(TemplateModule::balance_count(2, 1), 1000);
-        assert_eq!(TemplateModule::balance_count(3, 1), 1000);
-        assert_eq!(TemplateModule::nft_item_id(1, 1).owner, 1);
-        assert_eq!(TemplateModule::fungible_item_id(2, 1).owner, 1);
-        assert_eq!(TemplateModule::refungible_item_id(3, 1).owner[0].owner, 1);
+        assert_eq!(TemplateModule::balance_count(nft_collection_id, 1), 1);
+        assert_eq!(TemplateModule::balance_count(fungible_collection_id, 1), 1000);
+        assert_eq!(TemplateModule::balance_count(re_fungible_collection_id, 1), 1000);
+        assert_eq!(TemplateModule::nft_item_id(nft_collection_id, 1).owner, 1);
+        assert_eq!(TemplateModule::fungible_item_id(fungible_collection_id, 1).owner, 1);
+        assert_eq!(TemplateModule::refungible_item_id(re_fungible_collection_id, 1).owner[0].owner, 1);
     });
 }
 
 #[test]
 fn approve() {
     new_test_ext().execute_with(|| {
-        let col_name1: Vec<u16> = "Test1\0".encode_utf16().collect::<Vec<u16>>();
-        let col_desc1: Vec<u16> = "TestDescription1\0".encode_utf16().collect::<Vec<u16>>();
-        let token_prefix1: Vec<u8> = b"token_prefix1\0".to_vec();
-        let nft_mode: CollectionMode = CollectionMode::NFT(2000);
-        let origin1 = Origin::signed(1);
-
-        assert_ok!(TemplateModule::set_chain_limits(RawOrigin::Root.into(), ChainLimits { 
-            collection_numbers_limit: 10,
-            account_token_ownership_limit: 10,
-            collections_admins_limit: 5,
-            custom_data_limit: 2048,
-            nft_sponsor_transfer_timeout: 15,
-            fungible_sponsor_transfer_timeout: 15,
-            refungible_sponsor_transfer_timeout: 15,          
-        }));
-
-        assert_ok!(TemplateModule::create_collection(
-            origin1.clone(),
-            col_name1.clone(),
-            col_desc1.clone(),
-            token_prefix1.clone(),
-            nft_mode.clone()
-        ));
-
-        assert_eq!(TemplateModule::collection(1).owner, 1);
-
-        // create item
-        assert_ok!(TemplateModule::create_item(
-            origin1.clone(),
-            1,
-            [1, 1, 1].to_vec(),
-            1
-        ));
+        default_limits();
+        
+        let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+        
+        let data = default_nft_data();
+        create_test_item(collection_id, &data.into());
 
+        let origin1 = Origin::signed(1);
+        
         // approve
         assert_ok!(TemplateModule::approve(origin1.clone(), 2, 1, 1));
         assert_eq!(TemplateModule::approved(1, (1, 1))[0].approved, 2);
@@ -1259,40 +903,14 @@
 #[test]
 fn transfer_from() {
     new_test_ext().execute_with(|| {
-        let col_name1: Vec<u16> = "Test1\0".encode_utf16().collect::<Vec<u16>>();
-        let col_desc1: Vec<u16> = "TestDescription1\0".encode_utf16().collect::<Vec<u16>>();
-        let token_prefix1: Vec<u8> = b"token_prefix1\0".to_vec();
-        let mode: CollectionMode = CollectionMode::NFT(2000);
+        default_limits();
+        
+        let collection_id = create_test_collection(&CollectionMode::NFT, 1);
         let origin1 = Origin::signed(1);
         let origin2 = Origin::signed(2);
 
-        assert_ok!(TemplateModule::set_chain_limits(RawOrigin::Root.into(), ChainLimits { 
-            collection_numbers_limit: 10,
-            account_token_ownership_limit: 10,
-            collections_admins_limit: 5,
-            custom_data_limit: 2048,
-            nft_sponsor_transfer_timeout: 15,
-            fungible_sponsor_transfer_timeout: 15,
-            refungible_sponsor_transfer_timeout: 15,          
-        }));
-
-        assert_ok!(TemplateModule::create_collection(
-            origin1.clone(),
-            col_name1.clone(),
-            col_desc1.clone(),
-            token_prefix1.clone(),
-            mode
-        ));
-
-        assert_eq!(TemplateModule::collection(1).owner, 1);
-
-        // create item
-        assert_ok!(TemplateModule::create_item(
-            origin1.clone(),
-            1,
-            [1, 1, 1].to_vec(),
-            1
-        ));
+        let data = default_nft_data();
+        create_test_item(collection_id, &data.into());
 
         // approve
         assert_ok!(TemplateModule::approve(origin1.clone(), 2, 1, 1));
@@ -1335,99 +953,41 @@
 #[test]
 fn owner_can_add_address_to_white_list() {
     new_test_ext().execute_with(|| {
-        let col_name1: Vec<u16> = "Test1\0".encode_utf16().collect::<Vec<u16>>();
-        let col_desc1: Vec<u16> = "TestDescription1\0".encode_utf16().collect::<Vec<u16>>();
-        let token_prefix1: Vec<u8> = b"token_prefix1\0".to_vec();
-        let mode: CollectionMode = CollectionMode::NFT(2000);
-        let origin1 = Origin::signed(1);
-
-        assert_ok!(TemplateModule::set_chain_limits(RawOrigin::Root.into(), ChainLimits { 
-            collection_numbers_limit: 10,
-            account_token_ownership_limit: 10,
-            collections_admins_limit: 5,
-            custom_data_limit: 2048,
-            nft_sponsor_transfer_timeout: 15,
-            fungible_sponsor_transfer_timeout: 15,
-            refungible_sponsor_transfer_timeout: 15,          
-        }));
+        default_limits();
+        
+        let collection_id = create_test_collection(&CollectionMode::NFT, 1);
 
-        assert_ok!(TemplateModule::create_collection(
-            origin1.clone(),
-            col_name1.clone(),
-            col_desc1.clone(),
-            token_prefix1.clone(),
-            mode
-        ));
-
-        assert_ok!(TemplateModule::add_to_white_list(origin1.clone(), 1, 2));
-        assert_eq!(TemplateModule::white_list(1)[0], 2);
+        let origin1 = Origin::signed(1);
+        assert_ok!(TemplateModule::add_to_white_list(origin1.clone(), collection_id, 2));
+        assert_eq!(TemplateModule::white_list(collection_id)[0], 2);
     });
 }
 
 #[test]
 fn admin_can_add_address_to_white_list() {
     new_test_ext().execute_with(|| {
-        let col_name1: Vec<u16> = "Test1\0".encode_utf16().collect::<Vec<u16>>();
-        let col_desc1: Vec<u16> = "TestDescription1\0".encode_utf16().collect::<Vec<u16>>();
-        let token_prefix1: Vec<u8> = b"token_prefix1\0".to_vec();
-        let mode: CollectionMode = CollectionMode::NFT(2000);
+        default_limits();
+        
+        let collection_id = create_test_collection(&CollectionMode::NFT, 1);
         let origin1 = Origin::signed(1);
         let origin2 = Origin::signed(2);
-
-        assert_ok!(TemplateModule::set_chain_limits(RawOrigin::Root.into(), ChainLimits { 
-            collection_numbers_limit: 10,
-            account_token_ownership_limit: 10,
-            collections_admins_limit: 5,
-            custom_data_limit: 2048,
-            nft_sponsor_transfer_timeout: 15,
-            fungible_sponsor_transfer_timeout: 15,
-            refungible_sponsor_transfer_timeout: 15,          
-        }));
 
-        assert_ok!(TemplateModule::create_collection(
-            origin1.clone(),
-            col_name1.clone(),
-            col_desc1.clone(),
-            token_prefix1.clone(),
-            mode
-        ));
-
-        assert_ok!(TemplateModule::add_collection_admin(origin1.clone(), 1, 2));
-        assert_ok!(TemplateModule::add_to_white_list(origin2.clone(), 1, 3));
-        assert_eq!(TemplateModule::white_list(1)[0], 3);
+        assert_ok!(TemplateModule::add_collection_admin(origin1.clone(), collection_id, 2));
+        assert_ok!(TemplateModule::add_to_white_list(origin2.clone(), collection_id, 3));
+        assert_eq!(TemplateModule::white_list(collection_id)[0], 3);
     });
 }
 
 #[test]
 fn nonprivileged_user_cannot_add_address_to_white_list() {
     new_test_ext().execute_with(|| {
-        let col_name1: Vec<u16> = "Test1\0".encode_utf16().collect::<Vec<u16>>();
-        let col_desc1: Vec<u16> = "TestDescription1\0".encode_utf16().collect::<Vec<u16>>();
-        let token_prefix1: Vec<u8> = b"token_prefix1\0".to_vec();
-        let mode: CollectionMode = CollectionMode::NFT(2000);
-        let origin1 = Origin::signed(1);
-        let origin2 = Origin::signed(2);
-
-        assert_ok!(TemplateModule::set_chain_limits(RawOrigin::Root.into(), ChainLimits { 
-            collection_numbers_limit: 10,
-            account_token_ownership_limit: 10,
-            collections_admins_limit: 5,
-            custom_data_limit: 2048,
-            nft_sponsor_transfer_timeout: 15,
-            fungible_sponsor_transfer_timeout: 15,
-            refungible_sponsor_transfer_timeout: 15,          
-        }));
-
-        assert_ok!(TemplateModule::create_collection(
-            origin1.clone(),
-            col_name1.clone(),
-            col_desc1.clone(),
-            token_prefix1.clone(),
-            mode
-        ));
+        default_limits();
+        
+        let collection_id = create_test_collection(&CollectionMode::NFT, 1);
 
+        let origin2 = Origin::signed(2);
         assert_noop!(
-            TemplateModule::add_to_white_list(origin2.clone(), 1, 3),
+            TemplateModule::add_to_white_list(origin2.clone(), collection_id, 3),
             "You do not have permissions to modify this collection"
         );
     });
@@ -1436,17 +996,9 @@
 #[test]
 fn nobody_can_add_address_to_white_list_of_nonexisting_collection() {
     new_test_ext().execute_with(|| {
+        default_limits();
+
         let origin1 = Origin::signed(1);
-
-        assert_ok!(TemplateModule::set_chain_limits(RawOrigin::Root.into(), ChainLimits { 
-            collection_numbers_limit: 10,
-            account_token_ownership_limit: 10,
-            collections_admins_limit: 5,
-            custom_data_limit: 2048,
-            nft_sponsor_transfer_timeout: 15,
-            fungible_sponsor_transfer_timeout: 15,
-            refungible_sponsor_transfer_timeout: 15,          
-        }));
 
         assert_noop!(
             TemplateModule::add_to_white_list(origin1.clone(), 1, 2),
@@ -1458,33 +1010,14 @@
 #[test]
 fn nobody_can_add_address_to_white_list_of_deleted_collection() {
     new_test_ext().execute_with(|| {
-        let col_name1: Vec<u16> = "Test1\0".encode_utf16().collect::<Vec<u16>>();
-        let col_desc1: Vec<u16> = "TestDescription1\0".encode_utf16().collect::<Vec<u16>>();
-        let token_prefix1: Vec<u8> = b"token_prefix1\0".to_vec();
-        let mode: CollectionMode = CollectionMode::NFT(2000);
-        let origin1 = Origin::signed(1);
-
-        assert_ok!(TemplateModule::set_chain_limits(RawOrigin::Root.into(), ChainLimits { 
-            collection_numbers_limit: 10,
-            account_token_ownership_limit: 10,
-            collections_admins_limit: 5,
-            custom_data_limit: 2048,
-            nft_sponsor_transfer_timeout: 15,
-            fungible_sponsor_transfer_timeout: 15,
-            refungible_sponsor_transfer_timeout: 15,          
-        }));
+        default_limits();
+        
+        let collection_id = create_test_collection(&CollectionMode::NFT, 1);
 
-        assert_ok!(TemplateModule::create_collection(
-            origin1.clone(),
-            col_name1.clone(),
-            col_desc1.clone(),
-            token_prefix1.clone(),
-            mode
-        ));
-
-        assert_ok!(TemplateModule::destroy_collection(origin1.clone(), 1));
+        let origin1 = Origin::signed(1);
+        assert_ok!(TemplateModule::destroy_collection(origin1.clone(), collection_id));
         assert_noop!(
-            TemplateModule::add_to_white_list(origin1.clone(), 1, 2),
+            TemplateModule::add_to_white_list(origin1.clone(), collection_id, 2),
             "This collection does not exist"
         );
     });
@@ -1494,166 +1027,81 @@
 #[test]
 fn address_is_already_added_to_white_list() {
     new_test_ext().execute_with(|| {
-        let col_name1: Vec<u16> = "Test1\0".encode_utf16().collect::<Vec<u16>>();
-        let col_desc1: Vec<u16> = "TestDescription1\0".encode_utf16().collect::<Vec<u16>>();
-        let token_prefix1: Vec<u8> = b"token_prefix1\0".to_vec();
-        let mode: CollectionMode = CollectionMode::NFT(2000);
+        default_limits();
+        
+        let collection_id = create_test_collection(&CollectionMode::NFT, 1);
         let origin1 = Origin::signed(1);
-
-        assert_ok!(TemplateModule::set_chain_limits(RawOrigin::Root.into(), ChainLimits { 
-            collection_numbers_limit: 10,
-            account_token_ownership_limit: 10,
-            collections_admins_limit: 5,
-            custom_data_limit: 2048,
-            nft_sponsor_transfer_timeout: 15,
-            fungible_sponsor_transfer_timeout: 15,
-            refungible_sponsor_transfer_timeout: 15,          
-        }));
-
-        assert_ok!(TemplateModule::create_collection(
-            origin1.clone(),
-            col_name1.clone(),
-            col_desc1.clone(),
-            token_prefix1.clone(),
-            mode
-        ));
-
-        assert_ok!(TemplateModule::add_to_white_list(origin1.clone(), 1, 2));
-        assert_ok!(TemplateModule::add_to_white_list(origin1.clone(), 1, 2));
-        assert_eq!(TemplateModule::white_list(1)[0], 2);
-        assert_eq!(TemplateModule::white_list(1).len(), 1);
+        
+        assert_ok!(TemplateModule::add_to_white_list(origin1.clone(), collection_id, 2));
+        assert_ok!(TemplateModule::add_to_white_list(origin1.clone(), collection_id, 2));
+        assert_eq!(TemplateModule::white_list(collection_id)[0], 2);
+        assert_eq!(TemplateModule::white_list(collection_id).len(), 1);
     });
 }
 
 #[test]
 fn owner_can_remove_address_from_white_list() {
     new_test_ext().execute_with(|| {
-        let col_name1: Vec<u16> = "Test1\0".encode_utf16().collect::<Vec<u16>>();
-        let col_desc1: Vec<u16> = "TestDescription1\0".encode_utf16().collect::<Vec<u16>>();
-        let token_prefix1: Vec<u8> = b"token_prefix1\0".to_vec();
-        let mode: CollectionMode = CollectionMode::NFT(2000);
-        let origin1 = Origin::signed(1);
-
-        assert_ok!(TemplateModule::set_chain_limits(RawOrigin::Root.into(), ChainLimits { 
-            collection_numbers_limit: 10,
-            account_token_ownership_limit: 10,
-            collections_admins_limit: 5,
-            custom_data_limit: 2048,
-            nft_sponsor_transfer_timeout: 15,
-            fungible_sponsor_transfer_timeout: 15,
-            refungible_sponsor_transfer_timeout: 15,          
-        }));
+        default_limits();
+        
+        let collection_id = create_test_collection(&CollectionMode::NFT, 1);
 
-        assert_ok!(TemplateModule::create_collection(
-            origin1.clone(),
-            col_name1.clone(),
-            col_desc1.clone(),
-            token_prefix1.clone(),
-            mode
-        ));
-
-        assert_ok!(TemplateModule::add_to_white_list(origin1.clone(), 1, 2));
+        let origin1 = Origin::signed(1);
+        assert_ok!(TemplateModule::add_to_white_list(origin1.clone(), collection_id, 2));
         assert_ok!(TemplateModule::remove_from_white_list(
             origin1.clone(),
-            1,
+            collection_id,
             2
         ));
-        assert_eq!(TemplateModule::white_list(1).len(), 0);
+        assert_eq!(TemplateModule::white_list(collection_id).len(), 0);
     });
 }
 
 #[test]
 fn admin_can_remove_address_from_white_list() {
     new_test_ext().execute_with(|| {
-        let col_name1: Vec<u16> = "Test1\0".encode_utf16().collect::<Vec<u16>>();
-        let col_desc1: Vec<u16> = "TestDescription1\0".encode_utf16().collect::<Vec<u16>>();
-        let token_prefix1: Vec<u8> = b"token_prefix1\0".to_vec();
-        let mode: CollectionMode = CollectionMode::NFT(2000);
+        default_limits();
+        
+        let collection_id = create_test_collection(&CollectionMode::NFT, 1);
         let origin1 = Origin::signed(1);
         let origin2 = Origin::signed(2);
 
-        assert_ok!(TemplateModule::set_chain_limits(RawOrigin::Root.into(), ChainLimits { 
-            collection_numbers_limit: 10,
-            account_token_ownership_limit: 10,
-            collections_admins_limit: 5,
-            custom_data_limit: 2048,
-            nft_sponsor_transfer_timeout: 15,
-            fungible_sponsor_transfer_timeout: 15,
-            refungible_sponsor_transfer_timeout: 15,          
-        }));
-
-        assert_ok!(TemplateModule::create_collection(
-            origin1.clone(),
-            col_name1.clone(),
-            col_desc1.clone(),
-            token_prefix1.clone(),
-            mode
-        ));
-
-        assert_ok!(TemplateModule::add_collection_admin(origin1.clone(), 1, 2));
+        assert_ok!(TemplateModule::add_collection_admin(origin1.clone(), collection_id, 2));
 
-        assert_ok!(TemplateModule::add_to_white_list(origin1.clone(), 1, 3));
+        assert_ok!(TemplateModule::add_to_white_list(origin1.clone(), collection_id, 3));
         assert_ok!(TemplateModule::remove_from_white_list(
             origin2.clone(),
-            1,
+            collection_id,
             3
         ));
-        assert_eq!(TemplateModule::white_list(1).len(), 0);
+        assert_eq!(TemplateModule::white_list(collection_id).len(), 0);
     });
 }
 
 #[test]
 fn nonprivileged_user_cannot_remove_address_from_white_list() {
     new_test_ext().execute_with(|| {
-        let col_name1: Vec<u16> = "Test1\0".encode_utf16().collect::<Vec<u16>>();
-        let col_desc1: Vec<u16> = "TestDescription1\0".encode_utf16().collect::<Vec<u16>>();
-        let token_prefix1: Vec<u8> = b"token_prefix1\0".to_vec();
-        let mode: CollectionMode = CollectionMode::NFT(2000);
+        default_limits();
+        
+        let collection_id = create_test_collection(&CollectionMode::NFT, 1);
         let origin1 = Origin::signed(1);
         let origin2 = Origin::signed(2);
 
-        assert_ok!(TemplateModule::set_chain_limits(RawOrigin::Root.into(), ChainLimits { 
-            collection_numbers_limit: 10,
-            account_token_ownership_limit: 10,
-            collections_admins_limit: 5,
-            custom_data_limit: 2048,
-            nft_sponsor_transfer_timeout: 15,
-            fungible_sponsor_transfer_timeout: 15,
-            refungible_sponsor_transfer_timeout: 15,          
-        }));
-
-        assert_ok!(TemplateModule::create_collection(
-            origin1.clone(),
-            col_name1.clone(),
-            col_desc1.clone(),
-            token_prefix1.clone(),
-            mode
-        ));
-
-        assert_ok!(TemplateModule::add_to_white_list(origin1.clone(), 1, 2));
+        assert_ok!(TemplateModule::add_to_white_list(origin1.clone(), collection_id, 2));
         assert_noop!(
-            TemplateModule::remove_from_white_list(origin2.clone(), 1, 2),
+            TemplateModule::remove_from_white_list(origin2.clone(), collection_id, 2),
             "You do not have permissions to modify this collection"
         );
-        assert_eq!(TemplateModule::white_list(1)[0], 2);
+        assert_eq!(TemplateModule::white_list(collection_id)[0], 2);
     });
 }
 
 #[test]
 fn nobody_can_remove_address_from_white_list_of_nonexisting_collection() {
     new_test_ext().execute_with(|| {
+        default_limits();
         let origin1 = Origin::signed(1);
 
-        assert_ok!(TemplateModule::set_chain_limits(RawOrigin::Root.into(), ChainLimits { 
-            collection_numbers_limit: 10,
-            account_token_ownership_limit: 10,
-            collections_admins_limit: 5,
-            custom_data_limit: 2048,
-            nft_sponsor_transfer_timeout: 15,
-            fungible_sponsor_transfer_timeout: 15,
-            refungible_sponsor_transfer_timeout: 15,          
-        }));
-
         assert_noop!(
             TemplateModule::remove_from_white_list(origin1.clone(), 1, 2),
             "This collection does not exist"
@@ -1664,38 +1112,19 @@
 #[test]
 fn nobody_can_remove_address_from_white_list_of_deleted_collection() {
     new_test_ext().execute_with(|| {
-        let col_name1: Vec<u16> = "Test1\0".encode_utf16().collect::<Vec<u16>>();
-        let col_desc1: Vec<u16> = "TestDescription1\0".encode_utf16().collect::<Vec<u16>>();
-        let token_prefix1: Vec<u8> = b"token_prefix1\0".to_vec();
-        let mode: CollectionMode = CollectionMode::NFT(2000);
+        default_limits();
+        
+        let collection_id = create_test_collection(&CollectionMode::NFT, 1);
         let origin1 = Origin::signed(1);
         let origin2 = Origin::signed(2);
 
-        assert_ok!(TemplateModule::set_chain_limits(RawOrigin::Root.into(), ChainLimits { 
-            collection_numbers_limit: 10,
-            account_token_ownership_limit: 10,
-            collections_admins_limit: 5,
-            custom_data_limit: 2048,
-            nft_sponsor_transfer_timeout: 15,
-            fungible_sponsor_transfer_timeout: 15,
-            refungible_sponsor_transfer_timeout: 15,          
-        }));
-
-        assert_ok!(TemplateModule::create_collection(
-            origin1.clone(),
-            col_name1.clone(),
-            col_desc1.clone(),
-            token_prefix1.clone(),
-            mode
-        ));
-
-        assert_ok!(TemplateModule::add_to_white_list(origin1.clone(), 1, 2));
-        assert_ok!(TemplateModule::destroy_collection(origin1.clone(), 1));
+        assert_ok!(TemplateModule::add_to_white_list(origin1.clone(), collection_id, 2));
+        assert_ok!(TemplateModule::destroy_collection(origin1.clone(), collection_id));
         assert_noop!(
-            TemplateModule::remove_from_white_list(origin2.clone(), 1, 2),
+            TemplateModule::remove_from_white_list(origin2.clone(), collection_id, 2),
             "This collection does not exist"
         );
-        assert_eq!(TemplateModule::white_list(1).len(), 0);
+        assert_eq!(TemplateModule::white_list(collection_id).len(), 0);
     });
 }
 
@@ -1703,42 +1132,23 @@
 #[test]
 fn address_is_already_removed_from_white_list() {
     new_test_ext().execute_with(|| {
-        let col_name1: Vec<u16> = "Test1\0".encode_utf16().collect::<Vec<u16>>();
-        let col_desc1: Vec<u16> = "TestDescription1\0".encode_utf16().collect::<Vec<u16>>();
-        let token_prefix1: Vec<u8> = b"token_prefix1\0".to_vec();
-        let mode: CollectionMode = CollectionMode::NFT(2000);
+        default_limits();
+        
+        let collection_id = create_test_collection(&CollectionMode::NFT, 1);
         let origin1 = Origin::signed(1);
 
-        assert_ok!(TemplateModule::set_chain_limits(RawOrigin::Root.into(), ChainLimits { 
-            collection_numbers_limit: 10,
-            account_token_ownership_limit: 10,
-            collections_admins_limit: 5,
-            custom_data_limit: 2048,
-            nft_sponsor_transfer_timeout: 15,
-            fungible_sponsor_transfer_timeout: 15,
-            refungible_sponsor_transfer_timeout: 15,          
-        }));
-
-        assert_ok!(TemplateModule::create_collection(
-            origin1.clone(),
-            col_name1.clone(),
-            col_desc1.clone(),
-            token_prefix1.clone(),
-            mode
-        ));
-
-        assert_ok!(TemplateModule::add_to_white_list(origin1.clone(), 1, 2));
+        assert_ok!(TemplateModule::add_to_white_list(origin1.clone(), collection_id, 2));
         assert_ok!(TemplateModule::remove_from_white_list(
             origin1.clone(),
-            1,
+            collection_id,
             2
         ));
         assert_ok!(TemplateModule::remove_from_white_list(
             origin1.clone(),
-            1,
+            collection_id,
             2
         ));
-        assert_eq!(TemplateModule::white_list(1).len(), 0);
+        assert_eq!(TemplateModule::white_list(collection_id).len(), 0);
     });
 }
 
@@ -1746,44 +1156,21 @@
 #[test]
 fn white_list_test_1() {
     new_test_ext().execute_with(|| {
-        let col_name1: Vec<u16> = "Test1\0".encode_utf16().collect::<Vec<u16>>();
-        let col_desc1: Vec<u16> = "TestDescription1\0".encode_utf16().collect::<Vec<u16>>();
-        let token_prefix1: Vec<u8> = b"token_prefix1\0".to_vec();
-        let mode: CollectionMode = CollectionMode::NFT(2000);
-
-        assert_ok!(TemplateModule::set_chain_limits(RawOrigin::Root.into(), ChainLimits { 
-            collection_numbers_limit: 10,
-            account_token_ownership_limit: 10,
-            collections_admins_limit: 5,
-            custom_data_limit: 2048,
-            nft_sponsor_transfer_timeout: 15,
-            fungible_sponsor_transfer_timeout: 15,
-            refungible_sponsor_transfer_timeout: 15,          
-        }));
+        default_limits();
+        
+        let collection_id = create_test_collection(&CollectionMode::NFT, 1);
 
         let origin1 = Origin::signed(1);
-        assert_ok!(TemplateModule::create_collection(
-            origin1.clone(),
-            col_name1.clone(),
-            col_desc1.clone(),
-            token_prefix1.clone(),
-            mode
-        ));
-        assert_eq!(TemplateModule::collection(1).owner, 1);
-
-        assert_ok!(TemplateModule::create_item(
-            origin1.clone(),
-            1,
-            [1, 2, 3].to_vec(),
-            1
-        ));
+        
+        let data = default_nft_data();
+        create_test_item(collection_id, &data.into());
 
         assert_ok!(TemplateModule::set_public_access_mode(
             origin1.clone(),
-            1,
+            collection_id,
             AccessMode::WhiteList
         ));
-        assert_ok!(TemplateModule::add_to_white_list(origin1.clone(), 1, 2));
+        assert_ok!(TemplateModule::add_to_white_list(origin1.clone(), collection_id, 2));
 
         assert_noop!(
             TemplateModule::transfer(origin1.clone(), 3, 1, 1, 1),
@@ -1795,41 +1182,17 @@
 #[test]
 fn white_list_test_2() {
     new_test_ext().execute_with(|| {
-        let col_name1: Vec<u16> = "Test1\0".encode_utf16().collect::<Vec<u16>>();
-        let col_desc1: Vec<u16> = "TestDescription1\0".encode_utf16().collect::<Vec<u16>>();
-        let token_prefix1: Vec<u8> = b"token_prefix1\0".to_vec();
-        let mode: CollectionMode = CollectionMode::NFT(2000);
-
-        assert_ok!(TemplateModule::set_chain_limits(RawOrigin::Root.into(), ChainLimits { 
-            collection_numbers_limit: 10,
-            account_token_ownership_limit: 10,
-            collections_admins_limit: 5,
-            custom_data_limit: 2048,
-            nft_sponsor_transfer_timeout: 15,
-            fungible_sponsor_transfer_timeout: 15,
-            refungible_sponsor_transfer_timeout: 15,          
-        }));
-
+        default_limits();
+        
+        let collection_id = create_test_collection(&CollectionMode::NFT, 1);
         let origin1 = Origin::signed(1);
-        assert_ok!(TemplateModule::create_collection(
-            origin1.clone(),
-            col_name1.clone(),
-            col_desc1.clone(),
-            token_prefix1.clone(),
-            mode
-        ));
-        assert_eq!(TemplateModule::collection(1).owner, 1);
-
-        assert_ok!(TemplateModule::create_item(
-            origin1.clone(),
-            1,
-            [1, 2, 3].to_vec(),
-            1
-        ));
+        
+        let data = default_nft_data();
+        create_test_item(collection_id, &data.into());
 
         assert_ok!(TemplateModule::set_public_access_mode(
             origin1.clone(),
-            1,
+            collection_id,
             AccessMode::WhiteList
         ));
         assert_ok!(TemplateModule::add_to_white_list(origin1.clone(), 1, 1));
@@ -1856,41 +1219,18 @@
 #[test]
 fn white_list_test_3() {
     new_test_ext().execute_with(|| {
-        let col_name1: Vec<u16> = "Test1\0".encode_utf16().collect::<Vec<u16>>();
-        let col_desc1: Vec<u16> = "TestDescription1\0".encode_utf16().collect::<Vec<u16>>();
-        let token_prefix1: Vec<u8> = b"token_prefix1\0".to_vec();
-        let mode: CollectionMode = CollectionMode::NFT(2000);
-
-        assert_ok!(TemplateModule::set_chain_limits(RawOrigin::Root.into(), ChainLimits { 
-            collection_numbers_limit: 10,
-            account_token_ownership_limit: 10,
-            collections_admins_limit: 5,
-            custom_data_limit: 2048,
-            nft_sponsor_transfer_timeout: 15,
-            fungible_sponsor_transfer_timeout: 15,
-            refungible_sponsor_transfer_timeout: 15,          
-        }));
+        default_limits();
+        
+        let collection_id = create_test_collection(&CollectionMode::NFT, 1);
 
         let origin1 = Origin::signed(1);
-        assert_ok!(TemplateModule::create_collection(
-            origin1.clone(),
-            col_name1.clone(),
-            col_desc1.clone(),
-            token_prefix1.clone(),
-            mode
-        ));
-        assert_eq!(TemplateModule::collection(1).owner, 1);
+        
+        let data = default_nft_data();
+        create_test_item(collection_id, &data.into());
 
-        assert_ok!(TemplateModule::create_item(
-            origin1.clone(),
-            1,
-            [1, 2, 3].to_vec(),
-            1
-        ));
-
         assert_ok!(TemplateModule::set_public_access_mode(
             origin1.clone(),
-            1,
+            collection_id,
             AccessMode::WhiteList
         ));
         assert_ok!(TemplateModule::add_to_white_list(origin1.clone(), 1, 1));
@@ -1905,45 +1245,22 @@
 #[test]
 fn white_list_test_4() {
     new_test_ext().execute_with(|| {
-        let col_name1: Vec<u16> = "Test1\0".encode_utf16().collect::<Vec<u16>>();
-        let col_desc1: Vec<u16> = "TestDescription1\0".encode_utf16().collect::<Vec<u16>>();
-        let token_prefix1: Vec<u8> = b"token_prefix1\0".to_vec();
-        let mode: CollectionMode = CollectionMode::NFT(2000);
-
-        assert_ok!(TemplateModule::set_chain_limits(RawOrigin::Root.into(), ChainLimits { 
-            collection_numbers_limit: 10,
-            account_token_ownership_limit: 10,
-            collections_admins_limit: 5,
-            custom_data_limit: 2048,
-            nft_sponsor_transfer_timeout: 15,
-            fungible_sponsor_transfer_timeout: 15,
-            refungible_sponsor_transfer_timeout: 15,          
-        }));
+        default_limits();
+        
+        let collection_id = create_test_collection(&CollectionMode::NFT, 1);
 
         let origin1 = Origin::signed(1);
-        assert_ok!(TemplateModule::create_collection(
-            origin1.clone(),
-            col_name1.clone(),
-            col_desc1.clone(),
-            token_prefix1.clone(),
-            mode
-        ));
-        assert_eq!(TemplateModule::collection(1).owner, 1);
 
-        assert_ok!(TemplateModule::create_item(
-            origin1.clone(),
-            1,
-            [1, 2, 3].to_vec(),
-            1
-        ));
+        let data = default_nft_data();
+        create_test_item(collection_id, &data.into());
 
         assert_ok!(TemplateModule::set_public_access_mode(
             origin1.clone(),
-            1,
+            collection_id,
             AccessMode::WhiteList
         ));
-        assert_ok!(TemplateModule::add_to_white_list(origin1.clone(), 1, 1));
-        assert_ok!(TemplateModule::add_to_white_list(origin1.clone(), 1, 2));
+        assert_ok!(TemplateModule::add_to_white_list(origin1.clone(), collection_id, 1));
+        assert_ok!(TemplateModule::add_to_white_list(origin1.clone(), collection_id, 2));
 
         // do approve
         assert_ok!(TemplateModule::approve(origin1.clone(), 1, 1, 1));
@@ -1951,7 +1268,7 @@
 
         assert_ok!(TemplateModule::remove_from_white_list(
             origin1.clone(),
-            1,
+            collection_id,
             2
         ));
 
@@ -1966,41 +1283,18 @@
 #[test]
 fn white_list_test_5() {
     new_test_ext().execute_with(|| {
-        let col_name1: Vec<u16> = "Test1\0".encode_utf16().collect::<Vec<u16>>();
-        let col_desc1: Vec<u16> = "TestDescription1\0".encode_utf16().collect::<Vec<u16>>();
-        let token_prefix1: Vec<u8> = b"token_prefix1\0".to_vec();
-        let mode: CollectionMode = CollectionMode::NFT(2000);
-
-        assert_ok!(TemplateModule::set_chain_limits(RawOrigin::Root.into(), ChainLimits { 
-            collection_numbers_limit: 10,
-            account_token_ownership_limit: 10,
-            collections_admins_limit: 5,
-            custom_data_limit: 2048,
-            nft_sponsor_transfer_timeout: 15,
-            fungible_sponsor_transfer_timeout: 15,
-            refungible_sponsor_transfer_timeout: 15,          
-        }));
+        default_limits();
+        
+        let collection_id = create_test_collection(&CollectionMode::NFT, 1);
 
         let origin1 = Origin::signed(1);
-        assert_ok!(TemplateModule::create_collection(
-            origin1.clone(),
-            col_name1.clone(),
-            col_desc1.clone(),
-            token_prefix1.clone(),
-            mode
-        ));
-        assert_eq!(TemplateModule::collection(1).owner, 1);
 
-        assert_ok!(TemplateModule::create_item(
-            origin1.clone(),
-            1,
-            [1, 2, 3].to_vec(),
-            1
-        ));
+        let data = default_nft_data();
+        create_test_item(collection_id, &data.into());
 
         assert_ok!(TemplateModule::set_public_access_mode(
             origin1.clone(),
-            1,
+            collection_id,
             AccessMode::WhiteList
         ));
         assert_noop!(
@@ -2014,32 +1308,14 @@
 #[test]
 fn white_list_test_6() {
     new_test_ext().execute_with(|| {
-        let col_name1: Vec<u16> = "Test1\0".encode_utf16().collect::<Vec<u16>>();
-        let col_desc1: Vec<u16> = "TestDescription1\0".encode_utf16().collect::<Vec<u16>>();
-        let token_prefix1: Vec<u8> = b"token_prefix1\0".to_vec();
-        let mode: CollectionMode = CollectionMode::NFT(2000);
-
-        assert_ok!(TemplateModule::set_chain_limits(RawOrigin::Root.into(), ChainLimits { 
-            collection_numbers_limit: 10,
-            account_token_ownership_limit: 10,
-            collections_admins_limit: 5,
-            custom_data_limit: 2048,
-            nft_sponsor_transfer_timeout: 15,
-            fungible_sponsor_transfer_timeout: 15,
-            refungible_sponsor_transfer_timeout: 15,          
-        }));
+        default_limits();
+        
+        let collection_id = create_test_collection(&CollectionMode::NFT, 1);
 
         let origin1 = Origin::signed(1);
-        assert_ok!(TemplateModule::create_collection(
-            origin1.clone(),
-            col_name1.clone(),
-            col_desc1.clone(),
-            token_prefix1.clone(),
-            mode
-        ));
         assert_ok!(TemplateModule::set_public_access_mode(
             origin1.clone(),
-            1,
+            collection_id,
             AccessMode::WhiteList
         ));
 
@@ -2056,45 +1332,22 @@
 #[test]
 fn white_list_test_7() {
     new_test_ext().execute_with(|| {
-        let col_name1: Vec<u16> = "Test1\0".encode_utf16().collect::<Vec<u16>>();
-        let col_desc1: Vec<u16> = "TestDescription1\0".encode_utf16().collect::<Vec<u16>>();
-        let token_prefix1: Vec<u8> = b"token_prefix1\0".to_vec();
-        let mode: CollectionMode = CollectionMode::NFT(2000);
+        default_limits();
+        
+        let collection_id = create_test_collection(&CollectionMode::NFT, 1);
 
-        assert_ok!(TemplateModule::set_chain_limits(RawOrigin::Root.into(), ChainLimits { 
-            collection_numbers_limit: 10,
-            account_token_ownership_limit: 10,
-            collections_admins_limit: 5,
-            custom_data_limit: 2048,
-            nft_sponsor_transfer_timeout: 15,
-            fungible_sponsor_transfer_timeout: 15,
-            refungible_sponsor_transfer_timeout: 15,          
-        }));
-
+        let data = default_nft_data();
+        create_test_item(collection_id, &data.into());
+        
         let origin1 = Origin::signed(1);
-        assert_ok!(TemplateModule::create_collection(
-            origin1.clone(),
-            col_name1.clone(),
-            col_desc1.clone(),
-            token_prefix1.clone(),
-            mode
-        ));
-        assert_eq!(TemplateModule::collection(1).owner, 1);
 
-        assert_ok!(TemplateModule::create_item(
-            origin1.clone(),
-            1,
-            [1, 2, 3].to_vec(),
-            1
-        ));
-
         assert_ok!(TemplateModule::set_public_access_mode(
             origin1.clone(),
-            1,
+            collection_id,
             AccessMode::WhiteList
         ));
-        assert_ok!(TemplateModule::add_to_white_list(origin1.clone(), 1, 1));
-        assert_ok!(TemplateModule::add_to_white_list(origin1.clone(), 1, 2));
+        assert_ok!(TemplateModule::add_to_white_list(origin1.clone(), collection_id, 1));
+        assert_ok!(TemplateModule::add_to_white_list(origin1.clone(), collection_id, 2));
 
         assert_ok!(TemplateModule::transfer(origin1.clone(), 2, 1, 1, 1));
     });
@@ -2103,45 +1356,22 @@
 #[test]
 fn white_list_test_8() {
     new_test_ext().execute_with(|| {
-        let col_name1: Vec<u16> = "Test1\0".encode_utf16().collect::<Vec<u16>>();
-        let col_desc1: Vec<u16> = "TestDescription1\0".encode_utf16().collect::<Vec<u16>>();
-        let token_prefix1: Vec<u8> = b"token_prefix1\0".to_vec();
-        let mode: CollectionMode = CollectionMode::NFT(2000);
-
-        assert_ok!(TemplateModule::set_chain_limits(RawOrigin::Root.into(), ChainLimits { 
-            collection_numbers_limit: 10,
-            account_token_ownership_limit: 10,
-            collections_admins_limit: 5,
-            custom_data_limit: 2048,
-            nft_sponsor_transfer_timeout: 15,
-            fungible_sponsor_transfer_timeout: 15,
-            refungible_sponsor_transfer_timeout: 15,          
-        }));
+        default_limits();
+        
+        let collection_id = create_test_collection(&CollectionMode::NFT, 1);
 
+        let data = default_nft_data();
+        create_test_item(collection_id, &data.into());
+        
         let origin1 = Origin::signed(1);
-        assert_ok!(TemplateModule::create_collection(
-            origin1.clone(),
-            col_name1.clone(),
-            col_desc1.clone(),
-            token_prefix1.clone(),
-            mode
-        ));
-        assert_eq!(TemplateModule::collection(1).owner, 1);
 
-        assert_ok!(TemplateModule::create_item(
-            origin1.clone(),
-            1,
-            [1, 2, 3].to_vec(),
-            1
-        ));
-
         assert_ok!(TemplateModule::set_public_access_mode(
             origin1.clone(),
-            1,
+            collection_id,
             AccessMode::WhiteList
         ));
-        assert_ok!(TemplateModule::add_to_white_list(origin1.clone(), 1, 1));
-        assert_ok!(TemplateModule::add_to_white_list(origin1.clone(), 1, 2));
+        assert_ok!(TemplateModule::add_to_white_list(origin1.clone(), collection_id, 1));
+        assert_ok!(TemplateModule::add_to_white_list(origin1.clone(), collection_id, 2));
 
         // do approve
         assert_ok!(TemplateModule::approve(origin1.clone(), 1, 1, 1));
@@ -2162,47 +1392,24 @@
 #[test]
 fn white_list_test_9() {
     new_test_ext().execute_with(|| {
-        let col_name1: Vec<u16> = "Test1\0".encode_utf16().collect::<Vec<u16>>();
-        let col_desc1: Vec<u16> = "TestDescription1\0".encode_utf16().collect::<Vec<u16>>();
-        let token_prefix1: Vec<u8> = b"token_prefix1\0".to_vec();
-        let mode: CollectionMode = CollectionMode::NFT(2000);
-
-        assert_ok!(TemplateModule::set_chain_limits(RawOrigin::Root.into(), ChainLimits { 
-            collection_numbers_limit: 10,
-            account_token_ownership_limit: 10,
-            collections_admins_limit: 5,
-            custom_data_limit: 2048,
-            nft_sponsor_transfer_timeout: 15,
-            fungible_sponsor_transfer_timeout: 15,
-            refungible_sponsor_transfer_timeout: 15,          
-        }));
-
+        default_limits();
+        
+        let collection_id = create_test_collection(&CollectionMode::NFT, 1);
         let origin1 = Origin::signed(1);
-        assert_ok!(TemplateModule::create_collection(
-            origin1.clone(),
-            col_name1.clone(),
-            col_desc1.clone(),
-            token_prefix1.clone(),
-            mode
-        ));
 
         assert_ok!(TemplateModule::set_public_access_mode(
             origin1.clone(),
-            1,
+            collection_id,
             AccessMode::WhiteList
         ));
         assert_ok!(TemplateModule::set_mint_permission(
             origin1.clone(),
-            1,
+            collection_id,
             false
         ));
 
-        assert_ok!(TemplateModule::create_item(
-            origin1.clone(),
-            1,
-            [1, 2, 3].to_vec(),
-            1
-        ));
+        let data = default_nft_data();
+        create_test_item(collection_id, &data.into());
     });
 }
 
@@ -2210,49 +1417,31 @@
 #[test]
 fn white_list_test_10() {
     new_test_ext().execute_with(|| {
-        let col_name1: Vec<u16> = "Test1\0".encode_utf16().collect::<Vec<u16>>();
-        let col_desc1: Vec<u16> = "TestDescription1\0".encode_utf16().collect::<Vec<u16>>();
-        let token_prefix1: Vec<u8> = b"token_prefix1\0".to_vec();
-        let mode: CollectionMode = CollectionMode::NFT(2000);
-
-        assert_ok!(TemplateModule::set_chain_limits(RawOrigin::Root.into(), ChainLimits { 
-            collection_numbers_limit: 10,
-            account_token_ownership_limit: 10,
-            collections_admins_limit: 5,
-            custom_data_limit: 2048,
-            nft_sponsor_transfer_timeout: 15,
-            fungible_sponsor_transfer_timeout: 15,
-            refungible_sponsor_transfer_timeout: 15,          
-        }));
+        default_limits();
+        
+        let collection_id = create_test_collection(&CollectionMode::NFT, 1);
 
         let origin1 = Origin::signed(1);
         let origin2 = Origin::signed(2);
-        assert_ok!(TemplateModule::create_collection(
-            origin1.clone(),
-            col_name1.clone(),
-            col_desc1.clone(),
-            token_prefix1.clone(),
-            mode
-        ));
 
         assert_ok!(TemplateModule::set_public_access_mode(
             origin1.clone(),
-            1,
+            collection_id,
             AccessMode::WhiteList
         ));
         assert_ok!(TemplateModule::set_mint_permission(
             origin1.clone(),
-            1,
+            collection_id,
             false
         ));
 
-        assert_ok!(TemplateModule::add_collection_admin(origin1.clone(), 1, 2));
+        assert_ok!(TemplateModule::add_collection_admin(origin1.clone(), collection_id, 2));
 
         assert_ok!(TemplateModule::create_item(
             origin2.clone(),
-            1,
-            [1, 2, 3].to_vec(),
-            2
+            collection_id,
+            2,
+            default_nft_data().into()
         ));
     });
 }
@@ -2261,46 +1450,28 @@
 #[test]
 fn white_list_test_11() {
     new_test_ext().execute_with(|| {
-        let col_name1: Vec<u16> = "Test1\0".encode_utf16().collect::<Vec<u16>>();
-        let col_desc1: Vec<u16> = "TestDescription1\0".encode_utf16().collect::<Vec<u16>>();
-        let token_prefix1: Vec<u8> = b"token_prefix1\0".to_vec();
-        let mode: CollectionMode = CollectionMode::NFT(2000);
-
-        assert_ok!(TemplateModule::set_chain_limits(RawOrigin::Root.into(), ChainLimits { 
-            collection_numbers_limit: 10,
-            account_token_ownership_limit: 10,
-            collections_admins_limit: 5,
-            custom_data_limit: 2048,
-            nft_sponsor_transfer_timeout: 15,
-            fungible_sponsor_transfer_timeout: 15,
-            refungible_sponsor_transfer_timeout: 15,          
-        }));
+        default_limits();
+        
+        let collection_id = create_test_collection(&CollectionMode::NFT, 1);
 
         let origin1 = Origin::signed(1);
         let origin2 = Origin::signed(2);
-        assert_ok!(TemplateModule::create_collection(
-            origin1.clone(),
-            col_name1.clone(),
-            col_desc1.clone(),
-            token_prefix1.clone(),
-            mode
-        ));
 
         assert_ok!(TemplateModule::set_public_access_mode(
             origin1.clone(),
-            1,
+            collection_id,
             AccessMode::WhiteList
         ));
         assert_ok!(TemplateModule::set_mint_permission(
             origin1.clone(),
-            1,
+            collection_id,
             false
         ));
-        assert_ok!(TemplateModule::add_to_white_list(origin1.clone(), 1, 2));
+        assert_ok!(TemplateModule::add_to_white_list(origin1.clone(), collection_id, 2));
 
         assert_noop!(
-            TemplateModule::create_item(origin2.clone(), 1, [1, 2, 3].to_vec(), 2),
-            "Collection is not in mint mode"
+            TemplateModule::create_item(origin2.clone(), 1, 2, default_nft_data().into()),
+            "Public minting is not allowed for this collection."
         );
     });
 }
@@ -2309,45 +1480,27 @@
 #[test]
 fn white_list_test_12() {
     new_test_ext().execute_with(|| {
-        let col_name1: Vec<u16> = "Test1\0".encode_utf16().collect::<Vec<u16>>();
-        let col_desc1: Vec<u16> = "TestDescription1\0".encode_utf16().collect::<Vec<u16>>();
-        let token_prefix1: Vec<u8> = b"token_prefix1\0".to_vec();
-        let mode: CollectionMode = CollectionMode::NFT(2000);
-
-        assert_ok!(TemplateModule::set_chain_limits(RawOrigin::Root.into(), ChainLimits { 
-            collection_numbers_limit: 10,
-            account_token_ownership_limit: 10,
-            collections_admins_limit: 5,
-            custom_data_limit: 2048,
-            nft_sponsor_transfer_timeout: 15,
-            fungible_sponsor_transfer_timeout: 15,
-            refungible_sponsor_transfer_timeout: 15,          
-        }));
+        default_limits();
+        
+        let collection_id = create_test_collection(&CollectionMode::NFT, 1);
 
         let origin1 = Origin::signed(1);
         let origin2 = Origin::signed(2);
-        assert_ok!(TemplateModule::create_collection(
-            origin1.clone(),
-            col_name1.clone(),
-            col_desc1.clone(),
-            token_prefix1.clone(),
-            mode
-        ));
 
         assert_ok!(TemplateModule::set_public_access_mode(
             origin1.clone(),
-            1,
+            collection_id,
             AccessMode::WhiteList
         ));
         assert_ok!(TemplateModule::set_mint_permission(
             origin1.clone(),
-            1,
+            collection_id,
             false
         ));
 
         assert_noop!(
-            TemplateModule::create_item(origin2.clone(), 1, [1, 2, 3].to_vec(), 2),
-            "Collection is not in mint mode"
+            TemplateModule::create_item(origin2.clone(), 1, 2, default_nft_data().into()),
+            "Public minting is not allowed for this collection."
         );
     });
 }
@@ -2356,47 +1509,25 @@
 #[test]
 fn white_list_test_13() {
     new_test_ext().execute_with(|| {
-        let col_name1: Vec<u16> = "Test1\0".encode_utf16().collect::<Vec<u16>>();
-        let col_desc1: Vec<u16> = "TestDescription1\0".encode_utf16().collect::<Vec<u16>>();
-        let token_prefix1: Vec<u8> = b"token_prefix1\0".to_vec();
-        let mode: CollectionMode = CollectionMode::NFT(2000);
-
-        assert_ok!(TemplateModule::set_chain_limits(RawOrigin::Root.into(), ChainLimits { 
-            collection_numbers_limit: 10,
-            account_token_ownership_limit: 10,
-            collections_admins_limit: 5,
-            custom_data_limit: 2048,
-            nft_sponsor_transfer_timeout: 15,
-            fungible_sponsor_transfer_timeout: 15,
-            refungible_sponsor_transfer_timeout: 15,          
-        }));
+        default_limits();
+        
+        let collection_id = create_test_collection(&CollectionMode::NFT, 1);
 
         let origin1 = Origin::signed(1);
-        assert_ok!(TemplateModule::create_collection(
-            origin1.clone(),
-            col_name1.clone(),
-            col_desc1.clone(),
-            token_prefix1.clone(),
-            mode
-        ));
 
         assert_ok!(TemplateModule::set_public_access_mode(
             origin1.clone(),
-            1,
+            collection_id,
             AccessMode::WhiteList
         ));
         assert_ok!(TemplateModule::set_mint_permission(
             origin1.clone(),
-            1,
+            collection_id,
             true
         ));
 
-        assert_ok!(TemplateModule::create_item(
-            origin1.clone(),
-            1,
-            [1, 2, 3].to_vec(),
-            1
-        ));
+        let data = default_nft_data();
+        create_test_item(collection_id, &data.into());
     });
 }
 
@@ -2404,49 +1535,31 @@
 #[test]
 fn white_list_test_14() {
     new_test_ext().execute_with(|| {
-        let col_name1: Vec<u16> = "Test1\0".encode_utf16().collect::<Vec<u16>>();
-        let col_desc1: Vec<u16> = "TestDescription1\0".encode_utf16().collect::<Vec<u16>>();
-        let token_prefix1: Vec<u8> = b"token_prefix1\0".to_vec();
-        let mode: CollectionMode = CollectionMode::NFT(2000);
-
-        assert_ok!(TemplateModule::set_chain_limits(RawOrigin::Root.into(), ChainLimits { 
-            collection_numbers_limit: 10,
-            account_token_ownership_limit: 10,
-            collections_admins_limit: 5,
-            custom_data_limit: 2048,
-            nft_sponsor_transfer_timeout: 15,
-            fungible_sponsor_transfer_timeout: 15,
-            refungible_sponsor_transfer_timeout: 15,          
-        }));
+        default_limits();
+        
+        let collection_id = create_test_collection(&CollectionMode::NFT, 1);
 
         let origin1 = Origin::signed(1);
         let origin2 = Origin::signed(2);
-        assert_ok!(TemplateModule::create_collection(
-            origin1.clone(),
-            col_name1.clone(),
-            col_desc1.clone(),
-            token_prefix1.clone(),
-            mode
-        ));
 
         assert_ok!(TemplateModule::set_public_access_mode(
             origin1.clone(),
-            1,
+            collection_id,
             AccessMode::WhiteList
         ));
         assert_ok!(TemplateModule::set_mint_permission(
             origin1.clone(),
-            1,
+            collection_id,
             true
         ));
 
-        assert_ok!(TemplateModule::add_collection_admin(origin1.clone(), 1, 2));
+        assert_ok!(TemplateModule::add_collection_admin(origin1.clone(), collection_id, 2));
 
         assert_ok!(TemplateModule::create_item(
             origin2.clone(),
             1,
-            [1, 2, 3].to_vec(),
-            2
+            2,
+            default_nft_data().into()
         ));
     });
 }
@@ -2455,44 +1568,26 @@
 #[test]
 fn white_list_test_15() {
     new_test_ext().execute_with(|| {
-        let col_name1: Vec<u16> = "Test1\0".encode_utf16().collect::<Vec<u16>>();
-        let col_desc1: Vec<u16> = "TestDescription1\0".encode_utf16().collect::<Vec<u16>>();
-        let token_prefix1: Vec<u8> = b"token_prefix1\0".to_vec();
-        let mode: CollectionMode = CollectionMode::NFT(2000);
-
-        assert_ok!(TemplateModule::set_chain_limits(RawOrigin::Root.into(), ChainLimits { 
-            collection_numbers_limit: 10,
-            account_token_ownership_limit: 10,
-            collections_admins_limit: 5,
-            custom_data_limit: 2048,
-            nft_sponsor_transfer_timeout: 15,
-            fungible_sponsor_transfer_timeout: 15,
-            refungible_sponsor_transfer_timeout: 15,          
-        }));
+        default_limits();
+        
+        let collection_id = create_test_collection(&CollectionMode::NFT, 1);
 
         let origin1 = Origin::signed(1);
         let origin2 = Origin::signed(2);
-        assert_ok!(TemplateModule::create_collection(
-            origin1.clone(),
-            col_name1.clone(),
-            col_desc1.clone(),
-            token_prefix1.clone(),
-            mode
-        ));
 
         assert_ok!(TemplateModule::set_public_access_mode(
             origin1.clone(),
-            1,
+            collection_id,
             AccessMode::WhiteList
         ));
         assert_ok!(TemplateModule::set_mint_permission(
             origin1.clone(),
-            1,
+            collection_id,
             true
         ));
 
         assert_noop!(
-            TemplateModule::create_item(origin2.clone(), 1, [1, 2, 3].to_vec(), 2),
+            TemplateModule::create_item(origin2.clone(), 1, 2, default_nft_data().into()),
             "Address is not in white list"
         );
     });
@@ -2502,48 +1597,30 @@
 #[test]
 fn white_list_test_16() {
     new_test_ext().execute_with(|| {
-        let col_name1: Vec<u16> = "Test1\0".encode_utf16().collect::<Vec<u16>>();
-        let col_desc1: Vec<u16> = "TestDescription1\0".encode_utf16().collect::<Vec<u16>>();
-        let token_prefix1: Vec<u8> = b"token_prefix1\0".to_vec();
-        let mode: CollectionMode = CollectionMode::NFT(2000);
-
-        assert_ok!(TemplateModule::set_chain_limits(RawOrigin::Root.into(), ChainLimits { 
-            collection_numbers_limit: 10,
-            account_token_ownership_limit: 10,
-            collections_admins_limit: 5,
-            custom_data_limit: 2048,
-            nft_sponsor_transfer_timeout: 15,
-            fungible_sponsor_transfer_timeout: 15,
-            refungible_sponsor_transfer_timeout: 15,          
-        }));
+        default_limits();
+        
+        let collection_id = create_test_collection(&CollectionMode::NFT, 1);
 
         let origin1 = Origin::signed(1);
         let origin2 = Origin::signed(2);
-        assert_ok!(TemplateModule::create_collection(
-            origin1.clone(),
-            col_name1.clone(),
-            col_desc1.clone(),
-            token_prefix1.clone(),
-            mode
-        ));
 
         assert_ok!(TemplateModule::set_public_access_mode(
             origin1.clone(),
-            1,
+            collection_id,
             AccessMode::WhiteList
         ));
         assert_ok!(TemplateModule::set_mint_permission(
             origin1.clone(),
-            1,
+            collection_id,
             true
         ));
-        assert_ok!(TemplateModule::add_to_white_list(origin1.clone(), 1, 2));
+        assert_ok!(TemplateModule::add_to_white_list(origin1.clone(), collection_id, 2));
 
         assert_ok!(TemplateModule::create_item(
             origin2.clone(),
             1,
-            [1, 2, 3].to_vec(),
-            2
+            2,
+            default_nft_data().into()
         ));
     });
 }
@@ -2552,29 +1629,9 @@
 #[test]
 fn total_number_collections_bound() {
     new_test_ext().execute_with(|| {
-        let col_name1: Vec<u16> = "Test1\0".encode_utf16().collect::<Vec<u16>>();
-        let col_desc1: Vec<u16> = "TestDescription1\0".encode_utf16().collect::<Vec<u16>>();
-        let token_prefix1: Vec<u8> = b"token_prefix1\0".to_vec();
-        let mode: CollectionMode = CollectionMode::NFT(2000);
-
-        assert_ok!(TemplateModule::set_chain_limits(RawOrigin::Root.into(), ChainLimits { 
-            collection_numbers_limit: 10,
-            account_token_ownership_limit: 10,
-            collections_admins_limit: 5,
-            custom_data_limit: 2048,
-            nft_sponsor_transfer_timeout: 15,
-            fungible_sponsor_transfer_timeout: 15,
-            refungible_sponsor_transfer_timeout: 15,          
-        }));
-
-        let origin1 = Origin::signed(1);
-        assert_ok!(TemplateModule::create_collection(
-            origin1.clone(),
-            col_name1.clone(),
-            col_desc1.clone(),
-            token_prefix1.clone(),
-            mode
-        ));
+        default_limits();
+        
+        create_test_collection(&CollectionMode::NFT, 1);
     });
 }
 
@@ -2582,41 +1639,25 @@
 #[test]
 fn total_number_collections_bound_neg() {
     new_test_ext().execute_with(|| {
-        let col_name1: Vec<u16> = "Test1\0".encode_utf16().collect::<Vec<u16>>();
-        let col_desc1: Vec<u16> = "TestDescription1\0".encode_utf16().collect::<Vec<u16>>();
-        let token_prefix1: Vec<u8> = b"token_prefix1\0".to_vec();
-        let mode: CollectionMode = CollectionMode::NFT(2000);
-
-        assert_ok!(TemplateModule::set_chain_limits(RawOrigin::Root.into(), ChainLimits { 
-            collection_numbers_limit: 10,
-            account_token_ownership_limit: 10,
-            collections_admins_limit: 5,
-            custom_data_limit: 2048,
-            nft_sponsor_transfer_timeout: 15,
-            fungible_sponsor_transfer_timeout: 15,
-            refungible_sponsor_transfer_timeout: 15,          
-        }));
+        default_limits();
 
         let origin1 = Origin::signed(1);
-
-        for _ in 0..10 {
 
-            assert_ok!(TemplateModule::create_collection(
-                origin1.clone(),
-                col_name1.clone(),
-                col_desc1.clone(),
-                token_prefix1.clone(),
-                mode.clone()
-            ));
+        for i in 0..default_collection_numbers_limit() {
+            create_test_collection(&CollectionMode::NFT, i + 1);
         }
 
+        let col_name1: Vec<u16> = "Test1\0".encode_utf16().collect::<Vec<u16>>();
+        let col_desc1: Vec<u16> = "TestDescription1\0".encode_utf16().collect::<Vec<u16>>();
+        let token_prefix1: Vec<u8> = b"token_prefix1\0".to_vec();
+
         // 11-th collection in chain. Expects error
         assert_noop!(TemplateModule::create_collection(
             origin1.clone(),
             col_name1.clone(),
             col_desc1.clone(),
             token_prefix1.clone(),
-            mode.clone()
+            CollectionMode::NFT
         ), "Total collections bound exceeded");
     });
 }
@@ -2625,43 +1666,13 @@
 #[test]
 fn owned_tokens_bound() {
     new_test_ext().execute_with(|| {
-        let col_name1: Vec<u16> = "Test1\0".encode_utf16().collect::<Vec<u16>>();
-        let col_desc1: Vec<u16> = "TestDescription1\0".encode_utf16().collect::<Vec<u16>>();
-        let token_prefix1: Vec<u8> = b"token_prefix1\0".to_vec();
-        let mode: CollectionMode = CollectionMode::NFT(2000);
-
-        assert_ok!(TemplateModule::set_chain_limits(RawOrigin::Root.into(), ChainLimits { 
-            collection_numbers_limit: 10,
-            account_token_ownership_limit: 10,
-            collections_admins_limit: 5,
-            custom_data_limit: 2048,
-            nft_sponsor_transfer_timeout: 15,
-            fungible_sponsor_transfer_timeout: 15,
-            refungible_sponsor_transfer_timeout: 15,          
-        }));
-
-        let origin1 = Origin::signed(1);
-        assert_ok!(TemplateModule::create_collection(
-            origin1.clone(),
-            col_name1.clone(),
-            col_desc1.clone(),
-            token_prefix1.clone(),
-            mode
-        ));
-
-        assert_ok!(TemplateModule::create_item(
-            origin1.clone(),
-            1,
-            [1, 2, 3].to_vec(),
-            1
-        ));
+        default_limits();
+        
+        let collection_id = create_test_collection(&CollectionMode::NFT, 1);
 
-        assert_ok!(TemplateModule::create_item(
-            origin1.clone(),
-            1,
-            [1, 2, 3].to_vec(),
-            1
-        ));
+        let data = default_nft_data();
+        create_test_item(collection_id, &data.clone().into());
+        create_test_item(collection_id, &data.into());
     });
 }
 
@@ -2669,11 +1680,6 @@
 #[test]
 fn owned_tokens_bound_neg() {
     new_test_ext().execute_with(|| {
-        let col_name1: Vec<u16> = "Test1\0".encode_utf16().collect::<Vec<u16>>();
-        let col_desc1: Vec<u16> = "TestDescription1\0".encode_utf16().collect::<Vec<u16>>();
-        let token_prefix1: Vec<u8> = b"token_prefix1\0".to_vec();
-        let mode: CollectionMode = CollectionMode::NFT(2000);
-
         assert_ok!(TemplateModule::set_chain_limits(RawOrigin::Root.into(), ChainLimits { 
             collection_numbers_limit: 10,
             account_token_ownership_limit: 1,
@@ -2683,28 +1689,18 @@
             fungible_sponsor_transfer_timeout: 15,
             refungible_sponsor_transfer_timeout: 15,          
         }));
+        
+        let collection_id = create_test_collection(&CollectionMode::NFT, 1);
 
         let origin1 = Origin::signed(1);
-        assert_ok!(TemplateModule::create_collection(
-            origin1.clone(),
-            col_name1.clone(),
-            col_desc1.clone(),
-            token_prefix1.clone(),
-            mode
-        ));
-
-        assert_ok!(TemplateModule::create_item(
-            origin1.clone(),
-            1,
-            [1, 2, 3].to_vec(),
-            1
-        ));
+        let data = default_nft_data();
+        create_test_item(collection_id, &data.clone().into());
 
         assert_noop!(TemplateModule::create_item(
             origin1.clone(),
             1,
-            [1, 2, 3].to_vec(),
-            1
+            1,
+            data.into()
         ), "Owned tokens by a single address bound exceeded");
     });
 }
@@ -2713,11 +1709,6 @@
 #[test]
 fn collection_admins_bound() {
     new_test_ext().execute_with(|| {
-        let col_name1: Vec<u16> = "Test1\0".encode_utf16().collect::<Vec<u16>>();
-        let col_desc1: Vec<u16> = "TestDescription1\0".encode_utf16().collect::<Vec<u16>>();
-        let token_prefix1: Vec<u8> = b"token_prefix1\0".to_vec();
-        let mode: CollectionMode = CollectionMode::NFT(2000);
-
         assert_ok!(TemplateModule::set_chain_limits(RawOrigin::Root.into(), ChainLimits { 
             collection_numbers_limit: 10,
             account_token_ownership_limit: 10,
@@ -2727,18 +1718,13 @@
             fungible_sponsor_transfer_timeout: 15,
             refungible_sponsor_transfer_timeout: 15,          
         }));
+        
+        let collection_id = create_test_collection(&CollectionMode::NFT, 1);
 
         let origin1 = Origin::signed(1);
-        assert_ok!(TemplateModule::create_collection(
-            origin1.clone(),
-            col_name1.clone(),
-            col_desc1.clone(),
-            token_prefix1.clone(),
-            mode
-        ));
-
-        assert_ok!(TemplateModule::add_collection_admin(origin1.clone(), 1, 2));
-        assert_ok!(TemplateModule::add_collection_admin(origin1.clone(), 1, 3));
+        
+        assert_ok!(TemplateModule::add_collection_admin(origin1.clone(), collection_id, 2));
+        assert_ok!(TemplateModule::add_collection_admin(origin1.clone(), collection_id, 3));
     });
 }
 
@@ -2746,11 +1732,6 @@
 #[test]
 fn collection_admins_bound_neg() {
     new_test_ext().execute_with(|| {
-        let col_name1: Vec<u16> = "Test1\0".encode_utf16().collect::<Vec<u16>>();
-        let col_desc1: Vec<u16> = "TestDescription1\0".encode_utf16().collect::<Vec<u16>>();
-        let token_prefix1: Vec<u8> = b"token_prefix1\0".to_vec();
-        let mode: CollectionMode = CollectionMode::NFT(2000);
-
         assert_ok!(TemplateModule::set_chain_limits(RawOrigin::Root.into(), ChainLimits { 
             collection_numbers_limit: 10,
             account_token_ownership_limit: 1,
@@ -2760,78 +1741,167 @@
             fungible_sponsor_transfer_timeout: 15,
             refungible_sponsor_transfer_timeout: 15,          
         }));
+        
+        let collection_id = create_test_collection(&CollectionMode::NFT, 1);
 
         let origin1 = Origin::signed(1);
-        assert_ok!(TemplateModule::create_collection(
-            origin1.clone(),
-            col_name1.clone(),
-            col_desc1.clone(),
-            token_prefix1.clone(),
-            mode
-        ));
 
-        assert_ok!(TemplateModule::add_collection_admin(origin1.clone(), 1, 2));
-        assert_noop!(TemplateModule::add_collection_admin(origin1.clone(), 1, 3), "Number of collection admins bound exceeded");
+        assert_ok!(TemplateModule::add_collection_admin(origin1.clone(), collection_id, 2));
+        assert_noop!(TemplateModule::add_collection_admin(origin1.clone(), collection_id, 3), "Number of collection admins bound exceeded");
     });
 }
 
-// Custom data size. Positive test
+// NFT custom data size. Negative test const_data.
 #[test]
-fn custom_data_size_bound() {
+fn custom_data_size_nft_const_data_bound_neg() {
     new_test_ext().execute_with(|| {
-        let col_name1: Vec<u16> = "Test1\0".encode_utf16().collect::<Vec<u16>>();
-        let col_desc1: Vec<u16> = "TestDescription1\0".encode_utf16().collect::<Vec<u16>>();
-        let token_prefix1: Vec<u8> = b"token_prefix1\0".to_vec();
-        let mode: CollectionMode = CollectionMode::NFT(2000);
+        assert_ok!(TemplateModule::set_chain_limits(RawOrigin::Root.into(), ChainLimits { 
+            collection_numbers_limit: 10,
+            account_token_ownership_limit: 10,
+            collections_admins_limit: 5,
+            custom_data_limit: 2,
+            nft_sponsor_transfer_timeout: 15,
+            fungible_sponsor_transfer_timeout: 15,
+            refungible_sponsor_transfer_timeout: 15,          
+        }));
+        
+        let collection_id = create_test_collection(&CollectionMode::NFT, 1);
 
+        let origin1 = Origin::signed(1);
+        let too_big_const_data = CreateItemData::NFT(CreateNftData{
+            const_data: vec![1, 2, 3, 4],
+            variable_data: vec![]
+        });
+
+        assert_noop!(TemplateModule::create_item(
+            origin1.clone(),
+            collection_id,
+            1,
+            too_big_const_data
+        ), "const_data exceeded data limit.");
+    });
+}
+
+// NFT custom data size. Negative test variable_data.
+#[test]
+fn custom_data_size_nft_variable_data_bound_neg() {
+    new_test_ext().execute_with(|| {
         assert_ok!(TemplateModule::set_chain_limits(RawOrigin::Root.into(), ChainLimits { 
             collection_numbers_limit: 10,
             account_token_ownership_limit: 10,
             collections_admins_limit: 5,
-            custom_data_limit: 2048,
+            custom_data_limit: 2,
             nft_sponsor_transfer_timeout: 15,
             fungible_sponsor_transfer_timeout: 15,
             refungible_sponsor_transfer_timeout: 15,          
         }));
 
+        let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+
         let origin1 = Origin::signed(1);
-        assert_ok!(TemplateModule::create_collection(
+        let too_big_const_data = CreateItemData::NFT(CreateNftData{
+            const_data: vec![],
+            variable_data: vec![1, 2, 3, 4]
+        });
+
+        assert_noop!(TemplateModule::create_item(
             origin1.clone(),
-            col_name1.clone(),
-            col_desc1.clone(),
-            token_prefix1.clone(),
-            mode
-        ));
+            collection_id,
+            1,
+            too_big_const_data
+        ), "variable_data exceeded data limit.");
     });
 }
 
-// Custom data size. Negotive test
+// Re fungible custom data size. Negative test const_data.
 #[test]
-fn custom_data_size_bound_neg() {
+fn custom_data_size_re_fungible_const_data_bound_neg() {
     new_test_ext().execute_with(|| {
-        let col_name1: Vec<u16> = "Test1\0".encode_utf16().collect::<Vec<u16>>();
-        let col_desc1: Vec<u16> = "TestDescription1\0".encode_utf16().collect::<Vec<u16>>();
-        let token_prefix1: Vec<u8> = b"token_prefix1\0".to_vec();
-        let mode: CollectionMode = CollectionMode::NFT(2000);
+        assert_ok!(TemplateModule::set_chain_limits(RawOrigin::Root.into(), ChainLimits { 
+            collection_numbers_limit: 10,
+            account_token_ownership_limit: 10,
+            collections_admins_limit: 5,
+            custom_data_limit: 2,
+            nft_sponsor_transfer_timeout: 15,
+            fungible_sponsor_transfer_timeout: 15,
+            refungible_sponsor_transfer_timeout: 15,          
+        }));
+
+        let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+
+        let origin1 = Origin::signed(1);
+        let too_big_const_data = CreateItemData::NFT(CreateNftData{
+            const_data: vec![1, 2, 3, 4],
+            variable_data: vec![]
+        });
+
+        assert_noop!(TemplateModule::create_item(
+            origin1.clone(),
+            collection_id,
+            1,
+            too_big_const_data
+        ), "const_data exceeded data limit.");
+    });
+}
 
+// Re fungible custom data size. Negative test variable_data.
+#[test]
+fn custom_data_size_re_fungible_variable_data_bound_neg() {
+    new_test_ext().execute_with(|| {
         assert_ok!(TemplateModule::set_chain_limits(RawOrigin::Root.into(), ChainLimits { 
             collection_numbers_limit: 10,
             account_token_ownership_limit: 10,
             collections_admins_limit: 5,
-            custom_data_limit: 200,
+            custom_data_limit: 2,
             nft_sponsor_transfer_timeout: 15,
             fungible_sponsor_transfer_timeout: 15,
             refungible_sponsor_transfer_timeout: 15,          
         }));
 
+        let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+
         let origin1 = Origin::signed(1);
-        assert_noop!(TemplateModule::create_collection(
+        let too_big_const_data = CreateItemData::NFT(CreateNftData{
+            const_data: vec![],
+            variable_data: vec![1, 2, 3, 4]
+        });
+
+        assert_noop!(TemplateModule::create_item(
             origin1.clone(),
-            col_name1.clone(),
-            col_desc1.clone(),
-            token_prefix1.clone(),
-            mode
-        ), "Custom data size bound exceeded");
+            collection_id,
+            1,
+            too_big_const_data
+        ), "variable_data exceeded data limit.");
     });
 }
 // #endregion
+
+#[test]
+fn set_const_on_chain_schema() {
+    new_test_ext().execute_with(|| {
+        default_limits();
+
+        let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+
+        let origin1 = Origin::signed(1);
+        assert_ok!(TemplateModule::set_const_on_chain_schema(origin1, collection_id, b"test const on chain schema".to_vec()));
+
+        assert_eq!(TemplateModule::collection(collection_id).const_on_chain_schema, b"test const on chain schema".to_vec());
+        assert_eq!(TemplateModule::collection(collection_id).variable_on_chain_schema, b"".to_vec());
+    });
+}
+
+#[test]
+fn set_variable_on_chain_schema() {
+    new_test_ext().execute_with(|| {
+        default_limits();
+        
+        let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+
+        let origin1 = Origin::signed(1);
+        assert_ok!(TemplateModule::set_variable_on_chain_schema(origin1, collection_id, b"test variable on chain schema".to_vec()));
+
+        assert_eq!(TemplateModule::collection(collection_id).const_on_chain_schema, b"".to_vec());
+        assert_eq!(TemplateModule::collection(collection_id).variable_on_chain_schema, b"test variable on chain schema".to_vec());
+    });
+}
\ No newline at end of file
modifiedruntime/Cargo.tomldiffbeforeafterboth
--- a/runtime/Cargo.toml
+++ b/runtime/Cargo.toml
@@ -1,186 +1,3 @@
-[dependencies.aura]
-default-features = false
-git = 'https://github.com/usetech-llc/substrate.git'
-package = 'pallet-aura'
-branch = 'rc4_ext_dispatch_reenabled'
-version = '2.0.0-rc4'
-
-[dependencies.balances]
-default-features = false
-git = 'https://github.com/usetech-llc/substrate.git'
-package = 'pallet-balances'
-branch = 'rc4_ext_dispatch_reenabled'
-version = '2.0.0-rc4'
-
-[dependencies.codec]
-default-features = false
-features = ['derive']
-package = 'parity-scale-codec'
-version = '1.3.0'
-
-[dependencies.contracts]
-git = 'https://github.com/usetech-llc/substrate.git'
-default-features = false
-package = 'pallet-contracts'
-branch = 'rc4_ext_dispatch_reenabled'
-version = '2.0.0-rc4'
-
-[dependencies.contracts-primitives]
-git = 'https://github.com/usetech-llc/substrate.git'
-default-features = false
-package = 'pallet-contracts-primitives'
-branch = 'rc4_ext_dispatch_reenabled'
-version = '2.0.0-rc4'
-
-[dependencies.contracts-rpc-runtime-api]
-git = 'https://github.com/usetech-llc/substrate.git'
-default-features = false
-package = 'pallet-contracts-rpc-runtime-api'
-version = '0.8.0-rc4'
-branch = 'rc4_ext_dispatch_reenabled'
-
-[dependencies.frame-executive]
-default-features = false
-git = 'https://github.com/usetech-llc/substrate.git'
-branch = 'rc4_ext_dispatch_reenabled'
-version = '2.0.0-rc4'
-
-[dependencies.frame-support]
-default-features = false
-git = 'https://github.com/usetech-llc/substrate.git'
-branch = 'rc4_ext_dispatch_reenabled'
-version = '2.0.0-rc4'
-
-[dependencies.grandpa]
-default-features = false
-git = 'https://github.com/usetech-llc/substrate.git'
-package = 'pallet-grandpa'
-branch = 'rc4_ext_dispatch_reenabled'
-version = '2.0.0-rc4'
-
-[dependencies.randomness-collective-flip]
-default-features = false
-git = 'https://github.com/usetech-llc/substrate.git'
-package = 'pallet-randomness-collective-flip'
-branch = 'rc4_ext_dispatch_reenabled'
-version = '2.0.0-rc4'
-
-[dependencies.serde]
-features = ['derive']
-optional = true
-version = '1.0.101'
-
-[dependencies.sp-api]
-default-features = false
-git = 'https://github.com/usetech-llc/substrate.git'
-branch = 'rc4_ext_dispatch_reenabled'
-version = '2.0.0-rc4'
-
-[dependencies.sp-block-builder]
-default-features = false
-git = 'https://github.com/usetech-llc/substrate.git'
-branch = 'rc4_ext_dispatch_reenabled'
-version = '2.0.0-rc4'
-
-[dependencies.sp-consensus-aura]
-default-features = false
-git = 'https://github.com/usetech-llc/substrate.git'
-branch = 'rc4_ext_dispatch_reenabled'
-version = '0.8.0-rc4'
-
-[dependencies.sp-core]
-default-features = false
-git = 'https://github.com/usetech-llc/substrate.git'
-branch = 'rc4_ext_dispatch_reenabled'
-version = '2.0.0-rc4'
-
-[dependencies.sp-inherents]
-default-features = false
-git = 'https://github.com/usetech-llc/substrate.git'
-branch = 'rc4_ext_dispatch_reenabled'
-version = '2.0.0-rc4'
-
-[dependencies.sp-io]
-default-features = false
-git = 'https://github.com/usetech-llc/substrate.git'
-branch = 'rc4_ext_dispatch_reenabled'
-version = '2.0.0-rc4'
-
-[dependencies.sp-offchain]
-default-features = false
-git = 'https://github.com/usetech-llc/substrate.git'
-branch = 'rc4_ext_dispatch_reenabled'
-version = '2.0.0-rc4'
-
-[dependencies.sp-runtime]
-default-features = false
-git = 'https://github.com/usetech-llc/substrate.git'
-branch = 'rc4_ext_dispatch_reenabled'
-version = '2.0.0-rc4'
-
-[dependencies.sp-session]
-default-features = false
-git = 'https://github.com/usetech-llc/substrate.git'
-branch = 'rc4_ext_dispatch_reenabled'
-version = '2.0.0-rc4'
-
-[dependencies.sp-std]
-default-features = false
-git = 'https://github.com/usetech-llc/substrate.git'
-branch = 'rc4_ext_dispatch_reenabled'
-version = '2.0.0-rc4'
-
-[dependencies.sp-transaction-pool]
-default-features = false
-git = 'https://github.com/usetech-llc/substrate.git'
-branch = 'rc4_ext_dispatch_reenabled'
-version = '2.0.0-rc4'
-
-[dependencies.sp-version]
-default-features = false
-git = 'https://github.com/usetech-llc/substrate.git'
-branch = 'rc4_ext_dispatch_reenabled'
-version = '2.0.0-rc4'
-
-[dependencies.sudo]
-default-features = false
-git = 'https://github.com/usetech-llc/substrate.git'
-package = 'pallet-sudo'
-branch = 'rc4_ext_dispatch_reenabled'
-version = '2.0.0-rc4'
-
-[dependencies.system]
-default-features = false
-git = 'https://github.com/usetech-llc/substrate.git'
-package = 'frame-system'
-branch = 'rc4_ext_dispatch_reenabled'
-version = '2.0.0-rc4'
-
-[dependencies.nft]
-default-features = false
-package = 'pallet-nft'
-path = '../pallets/nft'
-version = '2.0.0-rc4'
-
-[dependencies.timestamp]
-default-features = false
-git = 'https://github.com/usetech-llc/substrate.git'
-package = 'pallet-timestamp'
-branch = 'rc4_ext_dispatch_reenabled'
-version = '2.0.0-rc4'
-
-[dependencies.transaction-payment]
-default-features = false
-git = 'https://github.com/usetech-llc/substrate.git'
-package = 'pallet-transaction-payment'
-branch = 'rc4_ext_dispatch_reenabled'
-version = '2.0.0-rc4'
-[build-dependencies.wasm-builder-runner]
-git = 'https://github.com/usetech-llc/substrate.git'
-package = 'substrate-wasm-builder-runner'
-branch = 'rc4_ext_dispatch_reenabled'
-version = '1.0.5'
-
 [package]
 authors = ['Substrate DevHub <https://github.com/substrate-developer-hub>']
 edition = '2018'
@@ -188,39 +5,99 @@
 license = 'Unlicense'
 name = 'nft-runtime'
 repository = 'https://github.com/usetech-llc/nft_parachain/'
-version = '2.0.0-rc4'
+version = '2.0.0'
+
 [package.metadata.docs.rs]
 targets = ['x86_64-unknown-linux-gnu']
 
+[build-dependencies]
+wasm-builder-runner = { package = 'substrate-wasm-builder-runner', version = '1.0.5' }
+
+# alias "parity-scale-code" to "codec"
+[dependencies.codec]
+default-features = false
+features = ['derive']
+package = 'parity-scale-codec'
+version = '1.3.4'
+
+[dependencies]
+hex-literal = { optional = true, version = '0.3.1' }
+serde = { features = ['derive'], optional = true, version = '1.0.101' }
+
+# local dependencies
+pallet-nft = { path = '../pallets/nft', default-features = false, version = '2.0.0' }
+
+# Substrate dependencies
+frame-benchmarking = { default-features = false, optional = true, version = '2.0.0' , git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release' }
+frame-executive = { default-features = false, version = '2.0.0' , git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release' }
+frame-support = { default-features = false, version = '2.0.0' , git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release' }
+frame-system = { default-features = false, version = '2.0.0' , git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release' }
+frame-system-benchmarking = { default-features = false, optional = true, version = '2.0.0' , git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release' }
+frame-system-rpc-runtime-api = { default-features = false, version = '2.0.0' , git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release' }
+pallet-aura = { default-features = false, version = '2.0.0' , git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release' }
+pallet-balances = { default-features = false, version = '2.0.0' , git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release' }
+pallet-contracts = { default-features = false, version = '2.0.0' , git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release' }
+pallet-contracts-primitives = { default-features = false, version = '2.0.0', git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release' }
+pallet-contracts-rpc-runtime-api = { default-features = false, version = '0.8.0' , git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release' }
+pallet-grandpa = { default-features = false, version = '2.0.0' , git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release' }
+pallet-randomness-collective-flip = { default-features = false, version = '2.0.0' , git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release' }
+pallet-sudo = { default-features = false, version = '2.0.0' , git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release' }
+pallet-timestamp = { default-features = false, version = '2.0.0' , git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release' }
+pallet-transaction-payment = { default-features = false, version = '2.0.0' , git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release' }
+pallet-transaction-payment-rpc-runtime-api = { default-features = false, version = '2.0.0' , git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release' }
+sp-api = { default-features = false, version = '2.0.0' , git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release' }
+sp-block-builder = { default-features = false, version = '2.0.0' , git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release' }
+sp-consensus-aura = { default-features = false, version = '0.8.0' , git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release' }
+sp-core = { default-features = false, version = '2.0.0' , git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release' }
+sp-inherents = { default-features = false, version = '2.0.0' , git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release' }
+sp-offchain = { default-features = false, version = '2.0.0' , git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release' }
+sp-runtime = { default-features = false, version = '2.0.0' , git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release' }
+sp-session = { default-features = false, version = '2.0.0' , git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release' }
+sp-std = { default-features = false, version = '2.0.0' , git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release' }
+sp-transaction-pool = { default-features = false, version = '2.0.0' , git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release' }
+sp-version = { default-features = false, version = '2.0.0' , git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release' }
+
 [features]
 default = ['std']
+runtime-benchmarks = [
+    'hex-literal',
+    'frame-benchmarking',
+    'frame-support/runtime-benchmarks',
+    'frame-system-benchmarking',
+    'frame-system/runtime-benchmarks',
+    'pallet-balances/runtime-benchmarks',
+    'pallet-timestamp/runtime-benchmarks',
+    'pallet-nft/runtime-benchmarks',
+    'sp-runtime/runtime-benchmarks',
+]
 std = [
-    'aura/std',
-    'balances/std',
     'codec/std',
-    'contracts/std',
-    'contracts-primitives/std',
-    'contracts-rpc-runtime-api/std',
+    'serde',
     'frame-executive/std',
     'frame-support/std',
-    'grandpa/std',
-    'randomness-collective-flip/std',
-    'serde',
+    'frame-system/std',
+    'frame-system-rpc-runtime-api/std',
+    'pallet-aura/std',
+    'pallet-balances/std',
+    'pallet-contracts/std',
+    'pallet-contracts-primitives/std',
+    'pallet-contracts-rpc-runtime-api/std',
+    'pallet-grandpa/std',
+    'pallet-randomness-collective-flip/std',
+    'pallet-sudo/std',
+    'pallet-timestamp/std',
+    'pallet-transaction-payment/std',
+    'pallet-transaction-payment-rpc-runtime-api/std',
+    'pallet-nft/std',
     'sp-api/std',
     'sp-block-builder/std',
     'sp-consensus-aura/std',
     'sp-core/std',
     'sp-inherents/std',
-    'sp-io/std',
     'sp-offchain/std',
     'sp-runtime/std',
     'sp-session/std',
     'sp-std/std',
     'sp-transaction-pool/std',
     'sp-version/std',
-    'sudo/std',
-    'system/std',
-    'timestamp/std',
-    'transaction-payment/std',
-    'nft/std',
 ]
modifiedruntime/build.rsdiffbeforeafterboth
--- a/runtime/build.rs
+++ b/runtime/build.rs
@@ -3,7 +3,7 @@
 fn main() {
     WasmBuilder::new()
         .with_current_project()
-        .with_wasm_builder_from_crates("1.0.11")
+        .with_wasm_builder_from_crates("2.0.0")
         .export_heap_base()
         .import_memory()
         .build()
modifiedruntime/src/lib.rsdiffbeforeafterboth
--- a/runtime/src/lib.rs
+++ b/runtime/src/lib.rs
@@ -8,9 +8,9 @@
 #[cfg(feature = "std")]
 include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs"));
 
-use contracts_rpc_runtime_api::ContractExecResult;
-use grandpa::fg_primitives;
-use grandpa::{AuthorityId as GrandpaId, AuthorityList as GrandpaAuthorityList};
+use pallet_contracts_rpc_runtime_api::ContractExecResult;
+use pallet_grandpa::fg_primitives;
+use pallet_grandpa::{AuthorityId as GrandpaId, AuthorityList as GrandpaAuthorityList};
 use sp_api::impl_runtime_apis;
 use sp_consensus_aura::sr25519::AuthorityId as AuraId;
 use sp_core::{crypto::KeyTypeId, OpaqueMetadata};
@@ -29,8 +29,8 @@
 use sp_version::RuntimeVersion;
 
 // A few exports that help ease life for downstream crates.
-pub use balances::Call as BalancesCall;
-pub use contracts::Schedule as ContractsSchedule;
+pub use pallet_balances::Call as BalancesCall;
+pub use pallet_contracts::Schedule as ContractsSchedule;
 pub use frame_support::{
     construct_runtime,
     dispatch::DispatchResult,
@@ -49,14 +49,14 @@
 #[cfg(any(feature = "std", test))]
 pub use sp_runtime::BuildStorage;
 use sp_runtime::Perbill;
-use system::{self as system};
+use frame_system::{self as system};
 
-pub use timestamp::Call as TimestampCall;
+pub use pallet_timestamp::Call as TimestampCall;
 
 /// Re-export a nft pallet
 /// TODO: Check this re-export. Is this safe and good style?
-extern crate nft;
-pub use nft::*;
+extern crate pallet_nft;
+pub use pallet_nft::*;
 
 /// An index to a block.
 pub type BlockNumber = u32;
@@ -84,6 +84,8 @@
 /// Digest item type.
 pub type DigestItem = generic::DigestItem<Hash>;
 
+mod nft_weights;
+
 /// Opaque types. These are used by the CLI to instantiate machinery that don't need to know
 /// the specifics of the runtime. They can then be made to be agnostic over specific formats
 /// of data like extrinsics, allowing for them to continue syncing the network through upgrades
@@ -194,62 +196,69 @@
     type AvailableBlockRatio = AvailableBlockRatio;
     /// Version of the runtime.
     type Version = Version;
-    /// Converts a module to the index of the module in `construct_runtime!`.
-    /// This type is being generated by `construct_runtime!`.
-    type ModuleToIndex = ModuleToIndex;
+ 	/// This type is being generated by `construct_runtime!`.
+    type PalletInfo = PalletInfo;
     /// What to do if a new account is created.
     type OnNewAccount = ();
     /// What to do if an account is fully reaped from the system.
     type OnKilledAccount = ();
     /// The data to be stored in an account.
-    type AccountData = balances::AccountData<Balance>;
+    type AccountData = pallet_balances::AccountData<Balance>;
+	/// Weight information for the extrinsics of this pallet.
+	type SystemWeightInfo = ();
 }
 
-impl aura::Trait for Runtime {
+impl pallet_aura::Trait for Runtime {
     type AuthorityId = AuraId;
 }
 
-impl grandpa::Trait for Runtime {
-    type Event = Event;
-    type Call = Call;
+impl pallet_grandpa::Trait for Runtime {
+	type Event = Event;
+	type Call = Call;
 
-    type KeyOwnerProofSystem = ();
+	type KeyOwnerProofSystem = ();
 
-    type KeyOwnerProof =
-        <Self::KeyOwnerProofSystem as KeyOwnerProofSystem<(KeyTypeId, GrandpaId)>>::Proof;
+	type KeyOwnerProof =
+		<Self::KeyOwnerProofSystem as KeyOwnerProofSystem<(KeyTypeId, GrandpaId)>>::Proof;
 
-    type KeyOwnerIdentification = <Self::KeyOwnerProofSystem as KeyOwnerProofSystem<(
-        KeyTypeId,
-        GrandpaId,
-    )>>::IdentificationTuple;
+	type KeyOwnerIdentification = <Self::KeyOwnerProofSystem as KeyOwnerProofSystem<(
+		KeyTypeId,
+		GrandpaId,
+	)>>::IdentificationTuple;
+
+	type HandleEquivocation = ();
 
-    type HandleEquivocation = ();
+	type WeightInfo = ();
 }
 
 parameter_types! {
     pub const MinimumPeriod: u64 = SLOT_DURATION / 2;
 }
 
-impl timestamp::Trait for Runtime {
-    /// A timestamp: milliseconds since the unix epoch.
-    type Moment = u64;
-    type OnTimestampSet = Aura;
-    type MinimumPeriod = MinimumPeriod;
+impl pallet_timestamp::Trait for Runtime {
+	/// A timestamp: milliseconds since the unix epoch.
+	type Moment = u64;
+	type OnTimestampSet = Aura;
+	type MinimumPeriod = MinimumPeriod;
+	type WeightInfo = ();
 }
 
 parameter_types! {
     // pub const ExistentialDeposit: u128 = 500;
     pub const ExistentialDeposit: u128 = 0;
+	pub const MaxLocks: u32 = 50;
 }
 
-impl balances::Trait for Runtime {
-    /// The type for recording an account's balance.
-    type Balance = Balance;
-    /// The ubiquitous event type.
-    type Event = Event;
-    type DustRemoval = ();
-    type ExistentialDeposit = ExistentialDeposit;
-    type AccountStore = System;
+impl pallet_balances::Trait for Runtime {
+	type MaxLocks = MaxLocks;
+	/// The type for recording an account's balance.
+	type Balance = Balance;
+	/// The ubiquitous event type.
+	type Event = Event;
+	type DustRemoval = ();
+	type ExistentialDeposit = ExistentialDeposit;
+	type AccountStore = System;
+	type WeightInfo = ();
 }
 
 pub const MILLICENTS: Balance = 1_000_000_000;
@@ -263,46 +272,46 @@
     pub const SurchargeReward: Balance = 150 * MILLICENTS;
 }
 
-impl contracts::Trait for Runtime {
-    type Call = Call;
-    type Time = Timestamp;
-    type Randomness = RandomnessCollectiveFlip;
-    type Currency = Balances;
-    type Event = Event;
-    type DetermineContractAddress = contracts::SimpleAddressDeterminer<Runtime>;
-    type TrieIdGenerator = contracts::TrieIdFromParentCounter<Runtime>;
-    type RentPayment = ();
-    type SignedClaimHandicap = contracts::DefaultSignedClaimHandicap;
-    type TombstoneDeposit = TombstoneDeposit;
-    type StorageSizeOffset = contracts::DefaultStorageSizeOffset;
-    type RentByteFee = RentByteFee;
-    type RentDepositOffset = RentDepositOffset;
-    type SurchargeReward = SurchargeReward;
-    type MaxDepth = contracts::DefaultMaxDepth;
-    type MaxValueSize = contracts::DefaultMaxValueSize;
-    type WeightPrice = transaction_payment::Module<Self>;
+impl pallet_contracts::Trait for Runtime {
+	type Time = Timestamp;
+	type Randomness = RandomnessCollectiveFlip;
+	type Currency = Balances;
+	type Event = Event;
+	type DetermineContractAddress = pallet_contracts::SimpleAddressDeterminer<Runtime>;
+	type TrieIdGenerator = pallet_contracts::TrieIdFromParentCounter<Runtime>;
+	type RentPayment = ();
+	type SignedClaimHandicap = pallet_contracts::DefaultSignedClaimHandicap;
+	type TombstoneDeposit = TombstoneDeposit;
+	type StorageSizeOffset = pallet_contracts::DefaultStorageSizeOffset;
+	type RentByteFee = RentByteFee;
+	type RentDepositOffset = RentDepositOffset;
+	type SurchargeReward = SurchargeReward;
+	type MaxDepth = pallet_contracts::DefaultMaxDepth;
+	type MaxValueSize = pallet_contracts::DefaultMaxValueSize;
+	type WeightPrice = pallet_transaction_payment::Module<Self>;
 }
 
 parameter_types! {
-    pub const TransactionByteFee: Balance = 1;
+	pub const TransactionByteFee: Balance = 10 * MILLICENTS;
 }
 
-impl transaction_payment::Trait for Runtime {
-    type Currency = balances::Module<Runtime>;
+impl pallet_transaction_payment::Trait for Runtime {
+    type Currency = pallet_balances::Module<Runtime>;
     type OnTransactionPayment = ();
     type TransactionByteFee = TransactionByteFee;
     type WeightToFee = IdentityFee<Balance>;
-    type FeeMultiplierUpdate = ();
+    type FeeMultiplierUpdate =  ();
 }
 
-impl sudo::Trait for Runtime {
+impl pallet_sudo::Trait for Runtime {
     type Event = Event;
     type Call = Call;
 }
 
 /// Used for the module nft in `./nft.rs`
-impl nft::Trait for Runtime {
+impl pallet_nft::Trait for Runtime {
     type Event = Event;
+    type WeightInfo = nft_weights::WeightInfo;
 }
 
 construct_runtime!(
@@ -312,15 +321,15 @@
         UncheckedExtrinsic = UncheckedExtrinsic
     {
         System: system::{Module, Call, Config, Storage, Event<T>},
-        RandomnessCollectiveFlip: randomness_collective_flip::{Module, Call, Storage},
-        Contracts: contracts::{Module, Call, Config, Storage, Event<T>},
-        Timestamp: timestamp::{Module, Call, Storage, Inherent},
-        Aura: aura::{Module, Config<T>, Inherent(Timestamp)},
-        Grandpa: grandpa::{Module, Call, Storage, Config, Event},
-        Balances: balances::{Module, Call, Storage, Config<T>, Event<T>},
-        TransactionPayment: transaction_payment::{Module, Storage},
-        Sudo: sudo::{Module, Call, Config<T>, Storage, Event<T>},
-        Nft: nft::{Module, Call, Config<T>, Storage, Event<T>},
+        RandomnessCollectiveFlip: pallet_randomness_collective_flip::{Module, Call, Storage},
+        Contracts: pallet_contracts::{Module, Call, Config, Storage, Event<T>},
+        Timestamp: pallet_timestamp::{Module, Call, Storage, Inherent},
+        Aura: pallet_aura::{Module, Config<T>, Inherent},
+        Grandpa: pallet_grandpa::{Module, Call, Storage, Config, Event},
+        Balances: pallet_balances::{Module, Call, Storage, Config<T>, Event<T>},
+        TransactionPayment: pallet_transaction_payment::{Module, Storage},
+        Sudo: pallet_sudo::{Module, Call, Config<T>, Storage, Event<T>},
+        Nft: pallet_nft::{Module, Call, Config<T>, Storage, Event<T>},
     }
 );
 
@@ -342,7 +351,7 @@
     system::CheckEra<Runtime>,
     system::CheckNonce<Runtime>,
     system::CheckWeight<Runtime>,
-    nft::ChargeTransactionPayment<Runtime>,
+    pallet_nft::ChargeTransactionPayment<Runtime>,
 );
 /// Unchecked extrinsic type as expected by this runtime.
 pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<Address, Call, Signature, SignedExtra>;
@@ -354,7 +363,7 @@
 
 impl_runtime_apis! {
 
-    impl contracts_rpc_runtime_api::ContractsApi<Block, AccountId, Balance, BlockNumber>
+    impl pallet_contracts_rpc_runtime_api::ContractsApi<Block, AccountId, Balance, BlockNumber>
     for Runtime
     {
         fn call(
@@ -364,27 +373,28 @@
             gas_limit: u64,
             input_data: Vec<u8>,
         ) -> ContractExecResult {
-            let exec_result =
-                Contracts::bare_call(origin, dest.into(), value, gas_limit, input_data);
-            match exec_result {
-                Ok(v) => ContractExecResult::Success {
-                    status: v.status,
-                    data: v.data,
-                },
-                Err(_) => ContractExecResult::Error,
-            }
+			let (exec_result, gas_consumed) =
+				Contracts::bare_call(origin, dest.into(), value, gas_limit, input_data);
+			match exec_result {
+				Ok(v) => ContractExecResult::Success {
+					flags: v.flags.bits(),
+					data: v.data,
+					gas_consumed: gas_consumed,
+				},
+				Err(_) => ContractExecResult::Error,
+			}
         }
 
         fn get_storage(
             address: AccountId,
             key: [u8; 32],
-        ) -> contracts_primitives::GetStorageResult {
+        ) -> pallet_contracts_primitives::GetStorageResult {
             Contracts::get_storage(address, key)
         }
 
         fn rent_projection(
             address: AccountId,
-        ) -> contracts_primitives::RentProjectionResult<BlockNumber> {
+        ) -> pallet_contracts_primitives::RentProjectionResult<BlockNumber> {
             Contracts::rent_projection(address)
         }
     }
@@ -471,29 +481,74 @@
         }
     }
 
-    impl fg_primitives::GrandpaApi<Block> for Runtime {
-        fn grandpa_authorities() -> GrandpaAuthorityList {
-            Grandpa::grandpa_authorities()
-        }
+	impl fg_primitives::GrandpaApi<Block> for Runtime {
+		fn grandpa_authorities() -> GrandpaAuthorityList {
+			Grandpa::grandpa_authorities()
+		}
 
-        fn submit_report_equivocation_extrinsic(
-            _equivocation_proof: fg_primitives::EquivocationProof<
-                <Block as BlockT>::Hash,
-                NumberFor<Block>,
-            >,
-            _key_owner_proof: fg_primitives::OpaqueKeyOwnershipProof,
-        ) -> Option<()> {
-            None
-        }
+		fn submit_report_equivocation_unsigned_extrinsic(
+			_equivocation_proof: fg_primitives::EquivocationProof<
+				<Block as BlockT>::Hash,
+				NumberFor<Block>,
+			>,
+			_key_owner_proof: fg_primitives::OpaqueKeyOwnershipProof,
+		) -> Option<()> {
+			None
+		}
 
-        fn generate_key_ownership_proof(
-            _set_id: fg_primitives::SetId,
-            _authority_id: GrandpaId,
-        ) -> Option<fg_primitives::OpaqueKeyOwnershipProof> {
-            // NOTE: this is the only implementation possible since we've
-            // defined our key owner proof type as a bottom type (i.e. a type
-            // with no values).
-            None
-        }
+		fn generate_key_ownership_proof(
+			_set_id: fg_primitives::SetId,
+			_authority_id: GrandpaId,
+		) -> Option<fg_primitives::OpaqueKeyOwnershipProof> {
+			// NOTE: this is the only implementation possible since we've
+			// defined our key owner proof type as a bottom type (i.e. a type
+			// with no values).
+			None
+		}
     }
+    
+	impl frame_system_rpc_runtime_api::AccountNonceApi<Block, AccountId, Index> for Runtime {
+		fn account_nonce(account: AccountId) -> Index {
+			System::account_nonce(account)
+		}
+	}
+
+	impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi<Block, Balance> for Runtime {
+		fn query_info(
+			uxt: <Block as BlockT>::Extrinsic,
+			len: u32,
+		) -> pallet_transaction_payment_rpc_runtime_api::RuntimeDispatchInfo<Balance> {
+			TransactionPayment::query_info(uxt, len)
+		}
+	}
+
+    #[cfg(feature = "runtime-benchmarks")]
+	impl frame_benchmarking::Benchmark<Block> for Runtime {
+		fn dispatch_benchmark(
+			config: frame_benchmarking::BenchmarkConfig
+		) -> Result<Vec<frame_benchmarking::BenchmarkBatch>, sp_runtime::RuntimeString> {
+			use frame_benchmarking::{Benchmarking, BenchmarkBatch, add_benchmark, TrackedStorageKey};
+
+			let whitelist: Vec<TrackedStorageKey> = vec![
+				// Alice account
+				hex_literal::hex!("d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d").to_vec().into(),
+				// // Total Issuance
+				// hex_literal::hex!("c2261276cc9d1f8598ea4b6a74b15c2f57c875e4cff74148e4628f264b974c80").to_vec().into(),
+				// // Execution Phase
+				// hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef7ff553b5a9862a516939d82b3d3d8661a").to_vec().into(),
+				// // Event Count
+				// hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef70a98fdbe9ce6c55837576c60c7af3850").to_vec().into(),
+				// // System Events
+				// hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef780d41e5e16056765bc8461851072c9d7").to_vec().into(),
+            ];
+
+			let mut batches = Vec::<BenchmarkBatch>::new();
+			let params = (&config, &whitelist);
+
+			add_benchmark!(params, batches, pallet_nft, Nft);
+
+			if batches.is_empty() { return Err("Benchmark not found for this pallet.".into()) }
+			Ok(batches)
+		}
+	}
 }
addedruntime/src/nft_weights.rsdiffbeforeafterboth
--- /dev/null
+++ b/runtime/src/nft_weights.rs
@@ -0,0 +1,111 @@
+use frame_support::weights::{Weight, constants::RocksDbWeight as DbWeight};
+
+pub struct WeightInfo;
+impl pallet_nft::WeightInfo for WeightInfo {
+	fn create_collection() -> Weight {
+		(70_000_000 as Weight)
+			.saturating_add(DbWeight::get().reads(7 as Weight))
+			.saturating_add(DbWeight::get().writes(5 as Weight))
+	}
+	fn destroy_collection() -> Weight {
+		(90_000_000 as Weight)
+			.saturating_add(DbWeight::get().reads(2 as Weight))
+			.saturating_add(DbWeight::get().writes(5 as Weight))
+	}
+	fn add_to_white_list() -> Weight {
+		(30_000_000 as Weight)
+			.saturating_add(DbWeight::get().reads(3 as Weight))
+			.saturating_add(DbWeight::get().writes(1 as Weight))
+    }
+    fn remove_from_white_list() -> Weight {
+		(35_000_000 as Weight)
+			.saturating_add(DbWeight::get().reads(3 as Weight))
+			.saturating_add(DbWeight::get().writes(1 as Weight))
+	}
+	fn set_public_access_mode() -> Weight {
+		(27_000_000 as Weight)
+			.saturating_add(DbWeight::get().reads(1 as Weight))
+			.saturating_add(DbWeight::get().writes(1 as Weight))
+	}
+	fn set_mint_permission() -> Weight {
+		(27_000_000 as Weight)
+			.saturating_add(DbWeight::get().reads(1 as Weight))
+			.saturating_add(DbWeight::get().writes(1 as Weight))
+	}
+	fn change_collection_owner() -> Weight {
+		(27_000_000 as Weight)
+			.saturating_add(DbWeight::get().reads(1 as Weight))
+			.saturating_add(DbWeight::get().writes(1 as Weight))
+	}
+	fn add_collection_admin() -> Weight {
+        (32_000_000 as Weight)
+            .saturating_add(DbWeight::get().reads(3 as Weight))
+            .saturating_add(DbWeight::get().writes(1 as Weight))
+	}
+	fn remove_collection_admin() -> Weight {
+		(50_000_000 as Weight)
+            .saturating_add(DbWeight::get().reads(2 as Weight))
+            .saturating_add(DbWeight::get().writes(1 as Weight))
+    }
+    fn set_collection_sponsor() -> Weight {
+		(32_000_000 as Weight)
+            .saturating_add(DbWeight::get().reads(2 as Weight))
+            .saturating_add(DbWeight::get().writes(1 as Weight))
+    }  
+    fn confirm_sponsorship() -> Weight {
+		(22_000_000 as Weight)
+            .saturating_add(DbWeight::get().reads(1 as Weight))
+            .saturating_add(DbWeight::get().writes(1 as Weight))
+    }  
+    fn remove_collection_sponsor() -> Weight {
+		(24_000_000 as Weight)
+            .saturating_add(DbWeight::get().reads(1 as Weight))
+            .saturating_add(DbWeight::get().writes(1 as Weight))
+    }  
+    fn create_item(s: usize, ) -> Weight {
+        (130_000_000 as Weight)
+            .saturating_add((2135 as Weight).saturating_mul(s as Weight))
+            .saturating_add(DbWeight::get().reads(10 as Weight))
+            .saturating_add(DbWeight::get().writes(8 as Weight))
+    }  
+    fn burn_item() -> Weight {
+		(170_000_000 as Weight)
+            .saturating_add(DbWeight::get().reads(9 as Weight))
+            .saturating_add(DbWeight::get().writes(7 as Weight))
+    }  
+    fn transfer() -> Weight {
+        (125_000_000 as Weight)
+            .saturating_add(DbWeight::get().reads(7 as Weight))
+            .saturating_add(DbWeight::get().writes(7 as Weight))
+    }  
+    fn approve() -> Weight {
+        (45_000_000 as Weight)
+            .saturating_add(DbWeight::get().reads(3 as Weight))
+            .saturating_add(DbWeight::get().writes(1 as Weight))
+    }
+    fn transfer_from() -> Weight {
+        (150_000_000 as Weight)
+            .saturating_add(DbWeight::get().reads(9 as Weight))
+            .saturating_add(DbWeight::get().writes(8 as Weight))
+    }
+    fn set_offchain_schema() -> Weight {
+        (33_000_000 as Weight)
+            .saturating_add(DbWeight::get().reads(2 as Weight))
+            .saturating_add(DbWeight::get().writes(1 as Weight))
+    }
+    fn set_const_on_chain_schema() -> Weight {
+        (11_100_000 as Weight)
+            .saturating_add(DbWeight::get().reads(2 as Weight))
+            .saturating_add(DbWeight::get().writes(1 as Weight))
+    }
+    fn set_variable_on_chain_schema() -> Weight {
+        (11_100_000 as Weight)
+            .saturating_add(DbWeight::get().reads(2 as Weight))
+            .saturating_add(DbWeight::get().writes(1 as Weight))
+    }
+    fn set_variable_meta_data() -> Weight {
+        (17_500_000 as Weight)
+            .saturating_add(DbWeight::get().reads(2 as Weight))
+            .saturating_add(DbWeight::get().writes(1 as Weight))
+    }
+}
modifiedtests/flipper-src/.gitignorediffbeforeafterboth
--- a/tests/flipper-src/.gitignore
+++ b/tests/flipper-src/.gitignore
@@ -6,4 +6,4 @@
 
 # Remove Cargo.lock when creating an executable, leave it for libraries
 # More information here http://doc.crates.io/guide.html#cargotoml-vs-cargolock
-Cargo.lock
+Cargo.lock
\ No newline at end of file
deletedtests/flipper-src/.ink/abi_gen/Cargo.tomldiffbeforeafterboth
--- a/tests/flipper-src/.ink/abi_gen/Cargo.toml
+++ /dev/null
@@ -1,16 +0,0 @@
-[package]
-name = "abi-gen"
-version = "0.1.0"
-authors = ["Parity Technologies <admin@parity.io>"]
-edition = "2018"
-publish = false
-
-[[bin]]
-name = "abi-gen"
-path = "main.rs"
-
-[dependencies]
-contract = { path = "../..", package = "flipper", default-features = false, features = ["ink-generate-abi"] }
-ink_lang = { version = "2", git = "https://github.com/paritytech/ink", tag = "latest-v2", package = "ink_lang", default-features = false, features = ["ink-generate-abi"] }
-serde = "1.0"
-serde_json = "1.0"
deletedtests/flipper-src/.ink/abi_gen/main.rsdiffbeforeafterboth
--- a/tests/flipper-src/.ink/abi_gen/main.rs
+++ /dev/null
@@ -1,7 +0,0 @@
-fn main() -> Result<(), std::io::Error> {
-    let abi = <contract::Flipper as ink_lang::GenerateAbi>::generate_abi();
-    let contents = serde_json::to_string_pretty(&abi)?;
-    std::fs::create_dir("target").ok();
-    std::fs::write("target/metadata.json", contents)?;
-    Ok(())
-}
modifiedtests/flipper-src/Cargo.tomldiffbeforeafterboth
--- a/tests/flipper-src/Cargo.toml
+++ b/tests/flipper-src/Cargo.toml
@@ -1,67 +1,35 @@
 [package]
 name = "flipper"
-version = "0.1.0"
-authors = ["[your_name] <[your_email]>"]
+version = "3.0.0-rc1"
+authors = ["Parity Technologies <admin@parity.io>"]
 edition = "2018"
 
 [dependencies]
-ink_abi = { version = "2", git = "https://github.com/paritytech/ink", tag = "latest-v2", package = "ink_abi", default-features = false, features = ["derive"], optional = true }
-ink_primitives = { version = "2", git = "https://github.com/paritytech/ink", tag = "latest-v2", package = "ink_primitives", default-features = false }
-ink_core = { version = "2", git = "https://github.com/paritytech/ink", tag = "latest-v2", package = "ink_core", default-features = false }
-ink_lang = { version = "2", git = "https://github.com/paritytech/ink", tag = "latest-v2", package = "ink_lang", default-features = false }
+ink_primitives = { version = "3.0.0-rc1", git = "https://github.com/paritytech/ink", tag = "v3.0.0-rc1", default-features = false }
+ink_metadata = { version = "3.0.0-rc1", git = "https://github.com/paritytech/ink", tag = "v3.0.0-rc1", default-features = false, features = ["derive"], optional = true }
+ink_env = { version = "3.0.0-rc1", git = "https://github.com/paritytech/ink", tag = "v3.0.0-rc1", default-features = false }
+ink_storage = { version = "3.0.0-rc1", git = "https://github.com/paritytech/ink", tag = "v3.0.0-rc1", default-features = false }
+ink_lang = { version = "3.0.0-rc1", git = "https://github.com/paritytech/ink", tag = "v3.0.0-rc1", default-features = false }
 
-scale = { package = "parity-scale-codec", version = "1.2", default-features = false, features = ["derive"] }
-
-[dependencies.type-metadata]
-git = "https://github.com/type-metadata/type-metadata.git"
-rev = "02eae9f35c40c943b56af5b60616219f2b72b47d"
-default-features = false
-features = ["derive"]
-optional = true
+scale = { package = "parity-scale-codec", version = "1.3", default-features = false, features = ["derive"] }
+scale-info = { version = "0.4", default-features = false, features = ["derive"], optional = true }
 
 [lib]
 name = "flipper"
 path = "lib.rs"
-crate-type = [
-	# Used for normal contract Wasm blobs.
-	"cdylib",
-	# Required for ABI generation, and using this contract as a dependency.
-	# If using `cargo contract build`, it will be automatically disabled to produce a smaller Wasm binary
-	"rlib",
-]
+crate-type = ["cdylib"]
 
 [features]
-default = ["test-env"]
+default = ["std"]
 std = [
-    "ink_abi/std",
-    "ink_core/std",
     "ink_primitives/std",
+    "ink_metadata",
+    "ink_metadata/std",
+    "ink_env/std",
+    "ink_storage/std",
+    "ink_lang/std",
     "scale/std",
-    "type-metadata/std",
-]
-test-env = [
-    "std",
-    "ink_lang/test-env",
-]
-ink-generate-abi = [
-    "std",
-    "ink_abi",
-    "type-metadata",
-    "ink_core/ink-generate-abi",
-    "ink_lang/ink-generate-abi",
-]
-ink-as-dependency = []
-
-[profile.release]
-panic = "abort"
-lto = true
-opt-level = "z"
-overflow-checks = true
-
-[workspace]
-members = [
-	".ink/abi_gen"
+    "scale-info",
+    "scale-info/std",
 ]
-exclude = [
-	".ink"
-]
+ink-as-dependency = []
\ No newline at end of file
modifiedtests/flipper-src/build.shdiffbeforeafterboth
--- a/tests/flipper-src/build.sh
+++ b/tests/flipper-src/build.sh
@@ -1,2 +1,3 @@
+rustup component add rust-src --toolchain nightly
 cargo +nightly contract build
 cargo +nightly contract generate-metadata
modifiedtests/flipper-src/lib.rsdiffbeforeafterboth
--- a/tests/flipper-src/lib.rs
+++ b/tests/flipper-src/lib.rs
@@ -1,70 +1,64 @@
+// Copyright 2018-2020 Parity Technologies (UK) Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
 #![cfg_attr(not(feature = "std"), no_std)]
 
 use ink_lang as ink;
 
-#[ink::contract(version = "0.1.0")]
-mod flipper {
-    use ink_core::storage;
-
-    /// Defines the storage of your contract.
-    /// Add new fields to the below struct in order
-    /// to add new static storage fields to your contract.
+#[ink::contract]
+pub mod flipper {
     #[ink(storage)]
-    struct Flipper {
-        /// Stores a single `bool` value on the storage.
-        value: storage::Value<bool>,
+    pub struct Flipper {
+        value: bool,
     }
 
     impl Flipper {
-        /// Constructor that initializes the `bool` value to the given `init_value`.
+        /// Creates a new flipper smart contract initialized with the given value.
         #[ink(constructor)]
-        fn new(&mut self, init_value: bool) {
-            self.value.set(init_value);
+        pub fn new(init_value: bool) -> Self {
+            Self { value: init_value }
         }
 
-        /// Constructor that initializes the `bool` value to `false`.
-        ///
-        /// Constructors can delegate to other constructors.
+        /// Creates a new flipper smart contract initialized to `false`.
         #[ink(constructor)]
-        fn default(&mut self) {
-            self.new(false)
+        pub fn default() -> Self {
+            Self::new(Default::default())
         }
 
-        /// A message that can be called on instantiated contracts.
-        /// This one flips the value of the stored `bool` from `true`
-        /// to `false` and vice versa.
+        /// Flips the current value of the Flipper's bool.
         #[ink(message)]
-        fn flip(&mut self) {
-            *self.value = !self.get();
+        pub fn flip(&mut self) {
+            self.value = !self.value;
         }
 
-        /// Simply returns the current value of our `bool`.
+        /// Returns the current value of the Flipper's bool.
         #[ink(message)]
-        fn get(&self) -> bool {
-            *self.value
+        pub fn get(&self) -> bool {
+            self.value
         }
     }
 
-    /// Unit tests in Rust are normally defined within such a `#[cfg(test)]`
-    /// module and test functions are marked with a `#[test]` attribute.
-    /// The below code is technically just normal Rust code.
     #[cfg(test)]
     mod tests {
-        /// Imports all the definitions from the outer scope so we can use them here.
         use super::*;
 
-        /// We test if the default constructor does its job.
         #[test]
         fn default_works() {
-            // Note that even though we defined our `#[ink(constructor)]`
-            // above as `&mut self` functions that return nothing we can call
-            // them in test code as if they were normal Rust constructors
-            // that take no `self` argument but return `Self`.
             let flipper = Flipper::default();
             assert_eq!(flipper.get(), false);
         }
 
-        /// We test a simple use case of our contract.
         #[test]
         fn it_works() {
             let mut flipper = Flipper::new(false);
@@ -73,4 +67,4 @@
             assert_eq!(flipper.get(), true);
         }
     }
-}
+}
\ No newline at end of file
modifiedtests/package-lock.jsondiffbeforeafterboth
--- a/tests/package-lock.json
+++ b/tests/package-lock.json
@@ -3916,282 +3916,143 @@
       }
     },
     "@polkadot/api": {
-      "version": "1.34.1",
-      "resolved": "https://registry.npmjs.org/@polkadot/api/-/api-1.34.1.tgz",
-      "integrity": "sha512-3gCibNRchH+XbEdULS1bwiV1RgarZW1PDw1Y1mAQBVqPrUpkYqntp1D52SQOpAbRzldkwk296Sj+mx9/IeDRXA==",
+      "version": "2.3.1",
+      "resolved": "https://registry.npmjs.org/@polkadot/api/-/api-2.3.1.tgz",
+      "integrity": "sha512-B9ZOb1PiPaAlke4wQHoivVQ5ZCQWn5bgLjhVIGdcEZ4WjIcxApmzTV4ruSfqVoRKpRiVOyV3Dx/VUQDD/WgBFw==",
       "requires": {
-        "@babel/runtime": "^7.11.2",
-        "@polkadot/api-derive": "1.34.1",
-        "@polkadot/keyring": "^3.4.1",
-        "@polkadot/metadata": "1.34.1",
-        "@polkadot/rpc-core": "1.34.1",
-        "@polkadot/rpc-provider": "1.34.1",
-        "@polkadot/types": "1.34.1",
-        "@polkadot/types-known": "1.34.1",
-        "@polkadot/util": "^3.4.1",
-        "@polkadot/util-crypto": "^3.4.1",
+        "@babel/runtime": "^7.12.1",
+        "@polkadot/api-derive": "2.3.1",
+        "@polkadot/keyring": "^3.6.1",
+        "@polkadot/metadata": "2.3.1",
+        "@polkadot/rpc-core": "2.3.1",
+        "@polkadot/rpc-provider": "2.3.1",
+        "@polkadot/types": "2.3.1",
+        "@polkadot/types-known": "2.3.1",
+        "@polkadot/util": "^3.6.1",
+        "@polkadot/util-crypto": "^3.6.1",
         "bn.js": "^5.1.3",
         "eventemitter3": "^4.0.7",
         "rxjs": "^6.6.3"
       },
       "dependencies": {
-        "@polkadot/metadata": {
-          "version": "1.34.1",
-          "resolved": "https://registry.npmjs.org/@polkadot/metadata/-/metadata-1.34.1.tgz",
-          "integrity": "sha512-uoaOhNHjECDaLBYvGRaLvF0mhZBFmsV3oikYDP4sZx3a5oD0xYsyXtr5bFPQDImwPFASP8/ltrMVqcYTX42xFg==",
-          "requires": {
-            "@babel/runtime": "^7.11.2",
-            "@polkadot/types": "1.34.1",
-            "@polkadot/types-known": "1.34.1",
-            "@polkadot/util": "^3.4.1",
-            "@polkadot/util-crypto": "^3.4.1",
-            "bn.js": "^5.1.3"
-          }
-        },
-        "@polkadot/types": {
-          "version": "1.34.1",
-          "resolved": "https://registry.npmjs.org/@polkadot/types/-/types-1.34.1.tgz",
-          "integrity": "sha512-jPwix2y+ZXKYB4ghODXlqYmcI3Tnsl3iO3xIkiGsZhhs9PdrKibcNeAv4LUiRpPuGRnAM+mrlPrBbCuzguKSGg==",
-          "requires": {
-            "@babel/runtime": "^7.11.2",
-            "@polkadot/metadata": "1.34.1",
-            "@polkadot/util": "^3.4.1",
-            "@polkadot/util-crypto": "^3.4.1",
-            "@types/bn.js": "^4.11.6",
-            "bn.js": "^5.1.3",
-            "memoizee": "^0.4.14",
-            "rxjs": "^6.6.3"
-          }
-        },
-        "@polkadot/types-known": {
-          "version": "1.34.1",
-          "resolved": "https://registry.npmjs.org/@polkadot/types-known/-/types-known-1.34.1.tgz",
-          "integrity": "sha512-H9V8u9cqbKjxU/dxEyLl7kJwoBImXpRskQ5+X0fq3BH7g1nQ6jrIg/buRPpbc3GxKivdFYUZWshPY9hbqE8y8A==",
+        "@babel/runtime": {
+          "version": "7.12.1",
+          "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.12.1.tgz",
+          "integrity": "sha512-J5AIf3vPj3UwXaAzb5j1xM4WAQDX3EMgemF8rjCP3SoW09LfRKAXQKt6CoVYl230P6iWdRcBbnLDDdnqWxZSCA==",
           "requires": {
-            "@babel/runtime": "^7.11.2",
-            "@polkadot/types": "1.34.1",
-            "@polkadot/util": "^3.4.1",
-            "bn.js": "^5.1.3"
+            "regenerator-runtime": "^0.13.4"
           }
         },
         "@polkadot/util": {
-          "version": "3.4.1",
-          "resolved": "https://registry.npmjs.org/@polkadot/util/-/util-3.4.1.tgz",
-          "integrity": "sha512-CJo0wAzXR8vjAzs9mHDooZr5a3XRW8LlYWik8d/+bv1VDwCC/metSiBrYBOapFhYUjlS5IYIw5bhWS5dnpkXvQ==",
+          "version": "3.6.1",
+          "resolved": "https://registry.npmjs.org/@polkadot/util/-/util-3.6.1.tgz",
+          "integrity": "sha512-ToGVghmTtC8s8cg8mCGG3I88UasrCg9VNm5JoUvBH4nTZCxc/dQEkU24nULXwHUpmd7d39p3RLpVbkLCVYIMZw==",
           "requires": {
-            "@babel/runtime": "^7.11.2",
+            "@babel/runtime": "^7.12.1",
+            "@polkadot/x-textdecoder": "^0.3.3",
+            "@polkadot/x-textencoder": "^0.3.3",
             "@types/bn.js": "^4.11.6",
             "bn.js": "^5.1.3",
             "camelcase": "^5.3.1",
             "chalk": "^4.1.0",
-            "ip-regex": "^4.1.0"
+            "ip-regex": "^4.2.0"
           }
+        },
+        "ip-regex": {
+          "version": "4.2.0",
+          "resolved": "https://registry.npmjs.org/ip-regex/-/ip-regex-4.2.0.tgz",
+          "integrity": "sha512-n5cDDeTWWRwK1EBoWwRti+8nP4NbytBBY0pldmnIkq6Z55KNFmWofh4rl9dPZpj+U/nVq7gweR3ylrvMt4YZ5A=="
         }
       }
     },
     "@polkadot/api-contract": {
-      "version": "1.34.1",
-      "resolved": "https://registry.npmjs.org/@polkadot/api-contract/-/api-contract-1.34.1.tgz",
-      "integrity": "sha512-oXh7An6E9wdbczXQhw+TfIkoKLQr4t0j3OwxubrhS5Qn6f99xGoAkk0BIKjsHPGIbMHEJoywmmLrDUAeTxExgg==",
+      "version": "2.3.1",
+      "resolved": "https://registry.npmjs.org/@polkadot/api-contract/-/api-contract-2.3.1.tgz",
+      "integrity": "sha512-hqRU2mGkHK84dtqZSX71tFCuBmBiV/6H7pJwj5E7UPcd124LM2ETXYJ9T0ElxbAHmZQD7yv+2ZM/ncvGC/A68Q==",
       "requires": {
-        "@babel/runtime": "^7.11.2",
-        "@polkadot/api": "1.34.1",
-        "@polkadot/rpc-core": "1.34.1",
-        "@polkadot/types": "1.34.1",
-        "@polkadot/util": "^3.4.1",
+        "@babel/runtime": "^7.12.1",
+        "@polkadot/api": "2.3.1",
+        "@polkadot/rpc-core": "2.3.1",
+        "@polkadot/types": "2.3.1",
+        "@polkadot/util": "^3.6.1",
         "bn.js": "^5.1.3",
         "rxjs": "^6.6.3"
       },
       "dependencies": {
-        "@polkadot/api": {
-          "version": "1.34.1",
-          "resolved": "https://registry.npmjs.org/@polkadot/api/-/api-1.34.1.tgz",
-          "integrity": "sha512-3gCibNRchH+XbEdULS1bwiV1RgarZW1PDw1Y1mAQBVqPrUpkYqntp1D52SQOpAbRzldkwk296Sj+mx9/IeDRXA==",
-          "requires": {
-            "@babel/runtime": "^7.11.2",
-            "@polkadot/api-derive": "1.34.1",
-            "@polkadot/keyring": "^3.4.1",
-            "@polkadot/metadata": "1.34.1",
-            "@polkadot/rpc-core": "1.34.1",
-            "@polkadot/rpc-provider": "1.34.1",
-            "@polkadot/types": "1.34.1",
-            "@polkadot/types-known": "1.34.1",
-            "@polkadot/util": "^3.4.1",
-            "@polkadot/util-crypto": "^3.4.1",
-            "bn.js": "^5.1.3",
-            "eventemitter3": "^4.0.7",
-            "rxjs": "^6.6.3"
-          }
-        },
-        "@polkadot/api-derive": {
-          "version": "1.34.1",
-          "resolved": "https://registry.npmjs.org/@polkadot/api-derive/-/api-derive-1.34.1.tgz",
-          "integrity": "sha512-LMlCkNJRp29MwKa36crYuY6cZpnkHCFrPCv9dmJEuDbMqrK+EAhXM9/6sTDYJ4uKNhyetJKe9rXslkXdI6pidA==",
-          "requires": {
-            "@babel/runtime": "^7.11.2",
-            "@polkadot/api": "1.34.1",
-            "@polkadot/rpc-core": "1.34.1",
-            "@polkadot/rpc-provider": "1.34.1",
-            "@polkadot/types": "1.34.1",
-            "@polkadot/util": "^3.4.1",
-            "@polkadot/util-crypto": "^3.4.1",
-            "bn.js": "^5.1.3",
-            "memoizee": "^0.4.14",
-            "rxjs": "^6.6.3"
-          }
-        },
-        "@polkadot/metadata": {
-          "version": "1.34.1",
-          "resolved": "https://registry.npmjs.org/@polkadot/metadata/-/metadata-1.34.1.tgz",
-          "integrity": "sha512-uoaOhNHjECDaLBYvGRaLvF0mhZBFmsV3oikYDP4sZx3a5oD0xYsyXtr5bFPQDImwPFASP8/ltrMVqcYTX42xFg==",
-          "requires": {
-            "@babel/runtime": "^7.11.2",
-            "@polkadot/types": "1.34.1",
-            "@polkadot/types-known": "1.34.1",
-            "@polkadot/util": "^3.4.1",
-            "@polkadot/util-crypto": "^3.4.1",
-            "bn.js": "^5.1.3"
-          }
-        },
-        "@polkadot/rpc-core": {
-          "version": "1.34.1",
-          "resolved": "https://registry.npmjs.org/@polkadot/rpc-core/-/rpc-core-1.34.1.tgz",
-          "integrity": "sha512-BVQDyBEkbRe5b/u8p9UPpTCj0sDZ32sTmPEP43Klc4s9+oHtiNvOFYvkjK5oyW9dlcOwXi8HpLsQxGAeMtM7Tw==",
-          "requires": {
-            "@babel/runtime": "^7.11.2",
-            "@polkadot/metadata": "1.34.1",
-            "@polkadot/rpc-provider": "1.34.1",
-            "@polkadot/types": "1.34.1",
-            "@polkadot/util": "^3.4.1",
-            "memoizee": "^0.4.14",
-            "rxjs": "^6.6.3"
-          }
-        },
-        "@polkadot/rpc-provider": {
-          "version": "1.34.1",
-          "resolved": "https://registry.npmjs.org/@polkadot/rpc-provider/-/rpc-provider-1.34.1.tgz",
-          "integrity": "sha512-bebeis9mB4LS9Spk1WSHoadZHsyHmK4gyyC6uKSLZxHZmnopWna6zWnOBIrYHRz7qDHSZC5eNTseuU8NJXtscA==",
-          "requires": {
-            "@babel/runtime": "^7.11.2",
-            "@polkadot/metadata": "1.34.1",
-            "@polkadot/types": "1.34.1",
-            "@polkadot/util": "^3.4.1",
-            "@polkadot/util-crypto": "^3.4.1",
-            "@polkadot/x-fetch": "^0.3.2",
-            "@polkadot/x-ws": "^0.3.2",
-            "bn.js": "^5.1.3",
-            "eventemitter3": "^4.0.7"
-          }
-        },
-        "@polkadot/types": {
-          "version": "1.34.1",
-          "resolved": "https://registry.npmjs.org/@polkadot/types/-/types-1.34.1.tgz",
-          "integrity": "sha512-jPwix2y+ZXKYB4ghODXlqYmcI3Tnsl3iO3xIkiGsZhhs9PdrKibcNeAv4LUiRpPuGRnAM+mrlPrBbCuzguKSGg==",
-          "requires": {
-            "@babel/runtime": "^7.11.2",
-            "@polkadot/metadata": "1.34.1",
-            "@polkadot/util": "^3.4.1",
-            "@polkadot/util-crypto": "^3.4.1",
-            "@types/bn.js": "^4.11.6",
-            "bn.js": "^5.1.3",
-            "memoizee": "^0.4.14",
-            "rxjs": "^6.6.3"
-          }
-        },
-        "@polkadot/types-known": {
-          "version": "1.34.1",
-          "resolved": "https://registry.npmjs.org/@polkadot/types-known/-/types-known-1.34.1.tgz",
-          "integrity": "sha512-H9V8u9cqbKjxU/dxEyLl7kJwoBImXpRskQ5+X0fq3BH7g1nQ6jrIg/buRPpbc3GxKivdFYUZWshPY9hbqE8y8A==",
+        "@babel/runtime": {
+          "version": "7.12.1",
+          "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.12.1.tgz",
+          "integrity": "sha512-J5AIf3vPj3UwXaAzb5j1xM4WAQDX3EMgemF8rjCP3SoW09LfRKAXQKt6CoVYl230P6iWdRcBbnLDDdnqWxZSCA==",
           "requires": {
-            "@babel/runtime": "^7.11.2",
-            "@polkadot/types": "1.34.1",
-            "@polkadot/util": "^3.4.1",
-            "bn.js": "^5.1.3"
+            "regenerator-runtime": "^0.13.4"
           }
         },
         "@polkadot/util": {
-          "version": "3.4.1",
-          "resolved": "https://registry.npmjs.org/@polkadot/util/-/util-3.4.1.tgz",
-          "integrity": "sha512-CJo0wAzXR8vjAzs9mHDooZr5a3XRW8LlYWik8d/+bv1VDwCC/metSiBrYBOapFhYUjlS5IYIw5bhWS5dnpkXvQ==",
+          "version": "3.6.1",
+          "resolved": "https://registry.npmjs.org/@polkadot/util/-/util-3.6.1.tgz",
+          "integrity": "sha512-ToGVghmTtC8s8cg8mCGG3I88UasrCg9VNm5JoUvBH4nTZCxc/dQEkU24nULXwHUpmd7d39p3RLpVbkLCVYIMZw==",
           "requires": {
-            "@babel/runtime": "^7.11.2",
+            "@babel/runtime": "^7.12.1",
+            "@polkadot/x-textdecoder": "^0.3.3",
+            "@polkadot/x-textencoder": "^0.3.3",
             "@types/bn.js": "^4.11.6",
             "bn.js": "^5.1.3",
             "camelcase": "^5.3.1",
             "chalk": "^4.1.0",
-            "ip-regex": "^4.1.0"
+            "ip-regex": "^4.2.0"
           }
+        },
+        "ip-regex": {
+          "version": "4.2.0",
+          "resolved": "https://registry.npmjs.org/ip-regex/-/ip-regex-4.2.0.tgz",
+          "integrity": "sha512-n5cDDeTWWRwK1EBoWwRti+8nP4NbytBBY0pldmnIkq6Z55KNFmWofh4rl9dPZpj+U/nVq7gweR3ylrvMt4YZ5A=="
         }
       }
     },
     "@polkadot/api-derive": {
-      "version": "1.34.1",
-      "resolved": "https://registry.npmjs.org/@polkadot/api-derive/-/api-derive-1.34.1.tgz",
-      "integrity": "sha512-LMlCkNJRp29MwKa36crYuY6cZpnkHCFrPCv9dmJEuDbMqrK+EAhXM9/6sTDYJ4uKNhyetJKe9rXslkXdI6pidA==",
+      "version": "2.3.1",
+      "resolved": "https://registry.npmjs.org/@polkadot/api-derive/-/api-derive-2.3.1.tgz",
+      "integrity": "sha512-FcDEx+/1Io7zOHPjbQAEzXB0KenA9emgY+96aHS4yPV/OVmAifU0IAxudZdMVp7uVC2dWq9iFvjxx84yCXgVRA==",
       "requires": {
-        "@babel/runtime": "^7.11.2",
-        "@polkadot/api": "1.34.1",
-        "@polkadot/rpc-core": "1.34.1",
-        "@polkadot/rpc-provider": "1.34.1",
-        "@polkadot/types": "1.34.1",
-        "@polkadot/util": "^3.4.1",
-        "@polkadot/util-crypto": "^3.4.1",
+        "@babel/runtime": "^7.12.1",
+        "@polkadot/api": "2.3.1",
+        "@polkadot/rpc-core": "2.3.1",
+        "@polkadot/rpc-provider": "2.3.1",
+        "@polkadot/types": "2.3.1",
+        "@polkadot/util": "^3.6.1",
+        "@polkadot/util-crypto": "^3.6.1",
         "bn.js": "^5.1.3",
         "memoizee": "^0.4.14",
         "rxjs": "^6.6.3"
       },
       "dependencies": {
-        "@polkadot/metadata": {
-          "version": "1.34.1",
-          "resolved": "https://registry.npmjs.org/@polkadot/metadata/-/metadata-1.34.1.tgz",
-          "integrity": "sha512-uoaOhNHjECDaLBYvGRaLvF0mhZBFmsV3oikYDP4sZx3a5oD0xYsyXtr5bFPQDImwPFASP8/ltrMVqcYTX42xFg==",
-          "requires": {
-            "@babel/runtime": "^7.11.2",
-            "@polkadot/types": "1.34.1",
-            "@polkadot/types-known": "1.34.1",
-            "@polkadot/util": "^3.4.1",
-            "@polkadot/util-crypto": "^3.4.1",
-            "bn.js": "^5.1.3"
-          }
-        },
-        "@polkadot/types": {
-          "version": "1.34.1",
-          "resolved": "https://registry.npmjs.org/@polkadot/types/-/types-1.34.1.tgz",
-          "integrity": "sha512-jPwix2y+ZXKYB4ghODXlqYmcI3Tnsl3iO3xIkiGsZhhs9PdrKibcNeAv4LUiRpPuGRnAM+mrlPrBbCuzguKSGg==",
-          "requires": {
-            "@babel/runtime": "^7.11.2",
-            "@polkadot/metadata": "1.34.1",
-            "@polkadot/util": "^3.4.1",
-            "@polkadot/util-crypto": "^3.4.1",
-            "@types/bn.js": "^4.11.6",
-            "bn.js": "^5.1.3",
-            "memoizee": "^0.4.14",
-            "rxjs": "^6.6.3"
-          }
-        },
-        "@polkadot/types-known": {
-          "version": "1.34.1",
-          "resolved": "https://registry.npmjs.org/@polkadot/types-known/-/types-known-1.34.1.tgz",
-          "integrity": "sha512-H9V8u9cqbKjxU/dxEyLl7kJwoBImXpRskQ5+X0fq3BH7g1nQ6jrIg/buRPpbc3GxKivdFYUZWshPY9hbqE8y8A==",
+        "@babel/runtime": {
+          "version": "7.12.1",
+          "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.12.1.tgz",
+          "integrity": "sha512-J5AIf3vPj3UwXaAzb5j1xM4WAQDX3EMgemF8rjCP3SoW09LfRKAXQKt6CoVYl230P6iWdRcBbnLDDdnqWxZSCA==",
           "requires": {
-            "@babel/runtime": "^7.11.2",
-            "@polkadot/types": "1.34.1",
-            "@polkadot/util": "^3.4.1",
-            "bn.js": "^5.1.3"
+            "regenerator-runtime": "^0.13.4"
           }
         },
         "@polkadot/util": {
-          "version": "3.4.1",
-          "resolved": "https://registry.npmjs.org/@polkadot/util/-/util-3.4.1.tgz",
-          "integrity": "sha512-CJo0wAzXR8vjAzs9mHDooZr5a3XRW8LlYWik8d/+bv1VDwCC/metSiBrYBOapFhYUjlS5IYIw5bhWS5dnpkXvQ==",
+          "version": "3.6.1",
+          "resolved": "https://registry.npmjs.org/@polkadot/util/-/util-3.6.1.tgz",
+          "integrity": "sha512-ToGVghmTtC8s8cg8mCGG3I88UasrCg9VNm5JoUvBH4nTZCxc/dQEkU24nULXwHUpmd7d39p3RLpVbkLCVYIMZw==",
           "requires": {
-            "@babel/runtime": "^7.11.2",
+            "@babel/runtime": "^7.12.1",
+            "@polkadot/x-textdecoder": "^0.3.3",
+            "@polkadot/x-textencoder": "^0.3.3",
             "@types/bn.js": "^4.11.6",
             "bn.js": "^5.1.3",
             "camelcase": "^5.3.1",
             "chalk": "^4.1.0",
-            "ip-regex": "^4.1.0"
+            "ip-regex": "^4.2.0"
           }
+        },
+        "ip-regex": {
+          "version": "4.2.0",
+          "resolved": "https://registry.npmjs.org/ip-regex/-/ip-regex-4.2.0.tgz",
+          "integrity": "sha512-n5cDDeTWWRwK1EBoWwRti+8nP4NbytBBY0pldmnIkq6Z55KNFmWofh4rl9dPZpj+U/nVq7gweR3ylrvMt4YZ5A=="
         }
       }
     },
@@ -4277,193 +4138,193 @@
       }
     },
     "@polkadot/keyring": {
-      "version": "3.4.1",
-      "resolved": "https://registry.npmjs.org/@polkadot/keyring/-/keyring-3.4.1.tgz",
-      "integrity": "sha512-x8FxzDzyFX5ai+tnPaxAFUBV/2Mw/om8sRoMh+fT6Jzh3nC7pXfecH5ticJPKe73v/y42hn9xM0tiAI5P8Ohcw==",
+      "version": "3.6.1",
+      "resolved": "https://registry.npmjs.org/@polkadot/keyring/-/keyring-3.6.1.tgz",
+      "integrity": "sha512-JbW4M5Ct3HaX3vgoa/UWAQVF/0sc1PbbA2D6v0KKaJkXl+EYVP9uyOYAoRCppB6ENZThz7CUJVQp8trs8WTrFQ==",
       "requires": {
-        "@babel/runtime": "^7.11.2",
-        "@polkadot/util": "3.4.1",
-        "@polkadot/util-crypto": "3.4.1"
+        "@babel/runtime": "^7.12.1",
+        "@polkadot/util": "3.6.1",
+        "@polkadot/util-crypto": "3.6.1"
       },
       "dependencies": {
+        "@babel/runtime": {
+          "version": "7.12.1",
+          "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.12.1.tgz",
+          "integrity": "sha512-J5AIf3vPj3UwXaAzb5j1xM4WAQDX3EMgemF8rjCP3SoW09LfRKAXQKt6CoVYl230P6iWdRcBbnLDDdnqWxZSCA==",
+          "requires": {
+            "regenerator-runtime": "^0.13.4"
+          }
+        },
         "@polkadot/util": {
-          "version": "3.4.1",
-          "resolved": "https://registry.npmjs.org/@polkadot/util/-/util-3.4.1.tgz",
-          "integrity": "sha512-CJo0wAzXR8vjAzs9mHDooZr5a3XRW8LlYWik8d/+bv1VDwCC/metSiBrYBOapFhYUjlS5IYIw5bhWS5dnpkXvQ==",
+          "version": "3.6.1",
+          "resolved": "https://registry.npmjs.org/@polkadot/util/-/util-3.6.1.tgz",
+          "integrity": "sha512-ToGVghmTtC8s8cg8mCGG3I88UasrCg9VNm5JoUvBH4nTZCxc/dQEkU24nULXwHUpmd7d39p3RLpVbkLCVYIMZw==",
           "requires": {
-            "@babel/runtime": "^7.11.2",
+            "@babel/runtime": "^7.12.1",
+            "@polkadot/x-textdecoder": "^0.3.3",
+            "@polkadot/x-textencoder": "^0.3.3",
             "@types/bn.js": "^4.11.6",
             "bn.js": "^5.1.3",
             "camelcase": "^5.3.1",
             "chalk": "^4.1.0",
-            "ip-regex": "^4.1.0"
+            "ip-regex": "^4.2.0"
           }
+        },
+        "ip-regex": {
+          "version": "4.2.0",
+          "resolved": "https://registry.npmjs.org/ip-regex/-/ip-regex-4.2.0.tgz",
+          "integrity": "sha512-n5cDDeTWWRwK1EBoWwRti+8nP4NbytBBY0pldmnIkq6Z55KNFmWofh4rl9dPZpj+U/nVq7gweR3ylrvMt4YZ5A=="
         }
       }
     },
     "@polkadot/metadata": {
-      "version": "1.34.1",
-      "resolved": "https://registry.npmjs.org/@polkadot/metadata/-/metadata-1.34.1.tgz",
-      "integrity": "sha512-uoaOhNHjECDaLBYvGRaLvF0mhZBFmsV3oikYDP4sZx3a5oD0xYsyXtr5bFPQDImwPFASP8/ltrMVqcYTX42xFg==",
+      "version": "2.3.1",
+      "resolved": "https://registry.npmjs.org/@polkadot/metadata/-/metadata-2.3.1.tgz",
+      "integrity": "sha512-F/QwDDR/d9mcqToDqndRTUYvMt/GYzjQ+kNGjQYBOIDRqF9zDbPHAXruqcHd0Y5MMpPMRBZGNaqPOb3BMrIdOQ==",
       "requires": {
-        "@babel/runtime": "^7.11.2",
-        "@polkadot/types": "1.34.1",
-        "@polkadot/types-known": "1.34.1",
-        "@polkadot/util": "^3.4.1",
-        "@polkadot/util-crypto": "^3.4.1",
+        "@babel/runtime": "^7.12.1",
+        "@polkadot/types": "2.3.1",
+        "@polkadot/types-known": "2.3.1",
+        "@polkadot/util": "^3.6.1",
+        "@polkadot/util-crypto": "^3.6.1",
         "bn.js": "^5.1.3"
       },
       "dependencies": {
+        "@babel/runtime": {
+          "version": "7.12.1",
+          "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.12.1.tgz",
+          "integrity": "sha512-J5AIf3vPj3UwXaAzb5j1xM4WAQDX3EMgemF8rjCP3SoW09LfRKAXQKt6CoVYl230P6iWdRcBbnLDDdnqWxZSCA==",
+          "requires": {
+            "regenerator-runtime": "^0.13.4"
+          }
+        },
         "@polkadot/util": {
-          "version": "3.4.1",
-          "resolved": "https://registry.npmjs.org/@polkadot/util/-/util-3.4.1.tgz",
-          "integrity": "sha512-CJo0wAzXR8vjAzs9mHDooZr5a3XRW8LlYWik8d/+bv1VDwCC/metSiBrYBOapFhYUjlS5IYIw5bhWS5dnpkXvQ==",
+          "version": "3.6.1",
+          "resolved": "https://registry.npmjs.org/@polkadot/util/-/util-3.6.1.tgz",
+          "integrity": "sha512-ToGVghmTtC8s8cg8mCGG3I88UasrCg9VNm5JoUvBH4nTZCxc/dQEkU24nULXwHUpmd7d39p3RLpVbkLCVYIMZw==",
           "requires": {
-            "@babel/runtime": "^7.11.2",
+            "@babel/runtime": "^7.12.1",
+            "@polkadot/x-textdecoder": "^0.3.3",
+            "@polkadot/x-textencoder": "^0.3.3",
             "@types/bn.js": "^4.11.6",
             "bn.js": "^5.1.3",
             "camelcase": "^5.3.1",
             "chalk": "^4.1.0",
-            "ip-regex": "^4.1.0"
+            "ip-regex": "^4.2.0"
           }
+        },
+        "ip-regex": {
+          "version": "4.2.0",
+          "resolved": "https://registry.npmjs.org/ip-regex/-/ip-regex-4.2.0.tgz",
+          "integrity": "sha512-n5cDDeTWWRwK1EBoWwRti+8nP4NbytBBY0pldmnIkq6Z55KNFmWofh4rl9dPZpj+U/nVq7gweR3ylrvMt4YZ5A=="
         }
       }
     },
+    "@polkadot/networks": {
+      "version": "3.6.1",
+      "resolved": "https://registry.npmjs.org/@polkadot/networks/-/networks-3.6.1.tgz",
+      "integrity": "sha512-PEEw/vTZaKf32vuAUeFXYNJei+b/s3hr7msMKfvoYeKDU/otgt9Mgkqrh6VCaE6+lHHgX8vLbH70pCqQrGG/uA==",
+      "requires": {
+        "@babel/runtime": "^7.12.1"
+      },
+      "dependencies": {
+        "@babel/runtime": {
+          "version": "7.12.1",
+          "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.12.1.tgz",
+          "integrity": "sha512-J5AIf3vPj3UwXaAzb5j1xM4WAQDX3EMgemF8rjCP3SoW09LfRKAXQKt6CoVYl230P6iWdRcBbnLDDdnqWxZSCA==",
+          "requires": {
+            "regenerator-runtime": "^0.13.4"
+          }
+        }
+      }
+    },
     "@polkadot/rpc-core": {
-      "version": "1.34.1",
-      "resolved": "https://registry.npmjs.org/@polkadot/rpc-core/-/rpc-core-1.34.1.tgz",
-      "integrity": "sha512-BVQDyBEkbRe5b/u8p9UPpTCj0sDZ32sTmPEP43Klc4s9+oHtiNvOFYvkjK5oyW9dlcOwXi8HpLsQxGAeMtM7Tw==",
+      "version": "2.3.1",
+      "resolved": "https://registry.npmjs.org/@polkadot/rpc-core/-/rpc-core-2.3.1.tgz",
+      "integrity": "sha512-SWYU6azxNwWkhz6bm/wpRPQZ/5KJ2hnEXPS4EN77q7EFH4c4k9mNtVyjUQFkKJsG7T85vxaCCWwhx60aYCZVeA==",
       "requires": {
-        "@babel/runtime": "^7.11.2",
-        "@polkadot/metadata": "1.34.1",
-        "@polkadot/rpc-provider": "1.34.1",
-        "@polkadot/types": "1.34.1",
-        "@polkadot/util": "^3.4.1",
+        "@babel/runtime": "^7.12.1",
+        "@polkadot/metadata": "2.3.1",
+        "@polkadot/rpc-provider": "2.3.1",
+        "@polkadot/types": "2.3.1",
+        "@polkadot/util": "^3.6.1",
         "memoizee": "^0.4.14",
         "rxjs": "^6.6.3"
       },
       "dependencies": {
-        "@polkadot/metadata": {
-          "version": "1.34.1",
-          "resolved": "https://registry.npmjs.org/@polkadot/metadata/-/metadata-1.34.1.tgz",
-          "integrity": "sha512-uoaOhNHjECDaLBYvGRaLvF0mhZBFmsV3oikYDP4sZx3a5oD0xYsyXtr5bFPQDImwPFASP8/ltrMVqcYTX42xFg==",
-          "requires": {
-            "@babel/runtime": "^7.11.2",
-            "@polkadot/types": "1.34.1",
-            "@polkadot/types-known": "1.34.1",
-            "@polkadot/util": "^3.4.1",
-            "@polkadot/util-crypto": "^3.4.1",
-            "bn.js": "^5.1.3"
-          }
-        },
-        "@polkadot/types": {
-          "version": "1.34.1",
-          "resolved": "https://registry.npmjs.org/@polkadot/types/-/types-1.34.1.tgz",
-          "integrity": "sha512-jPwix2y+ZXKYB4ghODXlqYmcI3Tnsl3iO3xIkiGsZhhs9PdrKibcNeAv4LUiRpPuGRnAM+mrlPrBbCuzguKSGg==",
+        "@babel/runtime": {
+          "version": "7.12.1",
+          "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.12.1.tgz",
+          "integrity": "sha512-J5AIf3vPj3UwXaAzb5j1xM4WAQDX3EMgemF8rjCP3SoW09LfRKAXQKt6CoVYl230P6iWdRcBbnLDDdnqWxZSCA==",
           "requires": {
-            "@babel/runtime": "^7.11.2",
-            "@polkadot/metadata": "1.34.1",
-            "@polkadot/util": "^3.4.1",
-            "@polkadot/util-crypto": "^3.4.1",
-            "@types/bn.js": "^4.11.6",
-            "bn.js": "^5.1.3",
-            "memoizee": "^0.4.14",
-            "rxjs": "^6.6.3"
+            "regenerator-runtime": "^0.13.4"
           }
         },
-        "@polkadot/types-known": {
-          "version": "1.34.1",
-          "resolved": "https://registry.npmjs.org/@polkadot/types-known/-/types-known-1.34.1.tgz",
-          "integrity": "sha512-H9V8u9cqbKjxU/dxEyLl7kJwoBImXpRskQ5+X0fq3BH7g1nQ6jrIg/buRPpbc3GxKivdFYUZWshPY9hbqE8y8A==",
-          "requires": {
-            "@babel/runtime": "^7.11.2",
-            "@polkadot/types": "1.34.1",
-            "@polkadot/util": "^3.4.1",
-            "bn.js": "^5.1.3"
-          }
-        },
         "@polkadot/util": {
-          "version": "3.4.1",
-          "resolved": "https://registry.npmjs.org/@polkadot/util/-/util-3.4.1.tgz",
-          "integrity": "sha512-CJo0wAzXR8vjAzs9mHDooZr5a3XRW8LlYWik8d/+bv1VDwCC/metSiBrYBOapFhYUjlS5IYIw5bhWS5dnpkXvQ==",
+          "version": "3.6.1",
+          "resolved": "https://registry.npmjs.org/@polkadot/util/-/util-3.6.1.tgz",
+          "integrity": "sha512-ToGVghmTtC8s8cg8mCGG3I88UasrCg9VNm5JoUvBH4nTZCxc/dQEkU24nULXwHUpmd7d39p3RLpVbkLCVYIMZw==",
           "requires": {
-            "@babel/runtime": "^7.11.2",
+            "@babel/runtime": "^7.12.1",
+            "@polkadot/x-textdecoder": "^0.3.3",
+            "@polkadot/x-textencoder": "^0.3.3",
             "@types/bn.js": "^4.11.6",
             "bn.js": "^5.1.3",
             "camelcase": "^5.3.1",
             "chalk": "^4.1.0",
-            "ip-regex": "^4.1.0"
+            "ip-regex": "^4.2.0"
           }
+        },
+        "ip-regex": {
+          "version": "4.2.0",
+          "resolved": "https://registry.npmjs.org/ip-regex/-/ip-regex-4.2.0.tgz",
+          "integrity": "sha512-n5cDDeTWWRwK1EBoWwRti+8nP4NbytBBY0pldmnIkq6Z55KNFmWofh4rl9dPZpj+U/nVq7gweR3ylrvMt4YZ5A=="
         }
       }
     },
     "@polkadot/rpc-provider": {
-      "version": "1.34.1",
-      "resolved": "https://registry.npmjs.org/@polkadot/rpc-provider/-/rpc-provider-1.34.1.tgz",
-      "integrity": "sha512-bebeis9mB4LS9Spk1WSHoadZHsyHmK4gyyC6uKSLZxHZmnopWna6zWnOBIrYHRz7qDHSZC5eNTseuU8NJXtscA==",
+      "version": "2.3.1",
+      "resolved": "https://registry.npmjs.org/@polkadot/rpc-provider/-/rpc-provider-2.3.1.tgz",
+      "integrity": "sha512-lRN68RosWvtBA844PWqhYEV2ifT3T9SUyAP2WvRYyWVPiMmXjw57qG1zHKQWgZk5aFzeaHKSYgsKTmkWz9IM4g==",
       "requires": {
-        "@babel/runtime": "^7.11.2",
-        "@polkadot/metadata": "1.34.1",
-        "@polkadot/types": "1.34.1",
-        "@polkadot/util": "^3.4.1",
-        "@polkadot/util-crypto": "^3.4.1",
-        "@polkadot/x-fetch": "^0.3.2",
-        "@polkadot/x-ws": "^0.3.2",
+        "@babel/runtime": "^7.12.1",
+        "@polkadot/metadata": "2.3.1",
+        "@polkadot/types": "2.3.1",
+        "@polkadot/util": "^3.6.1",
+        "@polkadot/util-crypto": "^3.6.1",
+        "@polkadot/x-fetch": "^0.3.3",
+        "@polkadot/x-ws": "^0.3.3",
         "bn.js": "^5.1.3",
         "eventemitter3": "^4.0.7"
       },
       "dependencies": {
-        "@polkadot/metadata": {
-          "version": "1.34.1",
-          "resolved": "https://registry.npmjs.org/@polkadot/metadata/-/metadata-1.34.1.tgz",
-          "integrity": "sha512-uoaOhNHjECDaLBYvGRaLvF0mhZBFmsV3oikYDP4sZx3a5oD0xYsyXtr5bFPQDImwPFASP8/ltrMVqcYTX42xFg==",
+        "@babel/runtime": {
+          "version": "7.12.1",
+          "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.12.1.tgz",
+          "integrity": "sha512-J5AIf3vPj3UwXaAzb5j1xM4WAQDX3EMgemF8rjCP3SoW09LfRKAXQKt6CoVYl230P6iWdRcBbnLDDdnqWxZSCA==",
           "requires": {
-            "@babel/runtime": "^7.11.2",
-            "@polkadot/types": "1.34.1",
-            "@polkadot/types-known": "1.34.1",
-            "@polkadot/util": "^3.4.1",
-            "@polkadot/util-crypto": "^3.4.1",
-            "bn.js": "^5.1.3"
-          }
-        },
-        "@polkadot/types": {
-          "version": "1.34.1",
-          "resolved": "https://registry.npmjs.org/@polkadot/types/-/types-1.34.1.tgz",
-          "integrity": "sha512-jPwix2y+ZXKYB4ghODXlqYmcI3Tnsl3iO3xIkiGsZhhs9PdrKibcNeAv4LUiRpPuGRnAM+mrlPrBbCuzguKSGg==",
-          "requires": {
-            "@babel/runtime": "^7.11.2",
-            "@polkadot/metadata": "1.34.1",
-            "@polkadot/util": "^3.4.1",
-            "@polkadot/util-crypto": "^3.4.1",
-            "@types/bn.js": "^4.11.6",
-            "bn.js": "^5.1.3",
-            "memoizee": "^0.4.14",
-            "rxjs": "^6.6.3"
-          }
-        },
-        "@polkadot/types-known": {
-          "version": "1.34.1",
-          "resolved": "https://registry.npmjs.org/@polkadot/types-known/-/types-known-1.34.1.tgz",
-          "integrity": "sha512-H9V8u9cqbKjxU/dxEyLl7kJwoBImXpRskQ5+X0fq3BH7g1nQ6jrIg/buRPpbc3GxKivdFYUZWshPY9hbqE8y8A==",
-          "requires": {
-            "@babel/runtime": "^7.11.2",
-            "@polkadot/types": "1.34.1",
-            "@polkadot/util": "^3.4.1",
-            "bn.js": "^5.1.3"
+            "regenerator-runtime": "^0.13.4"
           }
         },
         "@polkadot/util": {
-          "version": "3.4.1",
-          "resolved": "https://registry.npmjs.org/@polkadot/util/-/util-3.4.1.tgz",
-          "integrity": "sha512-CJo0wAzXR8vjAzs9mHDooZr5a3XRW8LlYWik8d/+bv1VDwCC/metSiBrYBOapFhYUjlS5IYIw5bhWS5dnpkXvQ==",
+          "version": "3.6.1",
+          "resolved": "https://registry.npmjs.org/@polkadot/util/-/util-3.6.1.tgz",
+          "integrity": "sha512-ToGVghmTtC8s8cg8mCGG3I88UasrCg9VNm5JoUvBH4nTZCxc/dQEkU24nULXwHUpmd7d39p3RLpVbkLCVYIMZw==",
           "requires": {
-            "@babel/runtime": "^7.11.2",
+            "@babel/runtime": "^7.12.1",
+            "@polkadot/x-textdecoder": "^0.3.3",
+            "@polkadot/x-textencoder": "^0.3.3",
             "@types/bn.js": "^4.11.6",
             "bn.js": "^5.1.3",
             "camelcase": "^5.3.1",
             "chalk": "^4.1.0",
-            "ip-regex": "^4.1.0"
+            "ip-regex": "^4.2.0"
           }
+        },
+        "ip-regex": {
+          "version": "4.2.0",
+          "resolved": "https://registry.npmjs.org/ip-regex/-/ip-regex-4.2.0.tgz",
+          "integrity": "sha512-n5cDDeTWWRwK1EBoWwRti+8nP4NbytBBY0pldmnIkq6Z55KNFmWofh4rl9dPZpj+U/nVq7gweR3ylrvMt4YZ5A=="
         }
       }
     },
@@ -4477,58 +4338,88 @@
       }
     },
     "@polkadot/types": {
-      "version": "1.34.1",
-      "resolved": "https://registry.npmjs.org/@polkadot/types/-/types-1.34.1.tgz",
-      "integrity": "sha512-jPwix2y+ZXKYB4ghODXlqYmcI3Tnsl3iO3xIkiGsZhhs9PdrKibcNeAv4LUiRpPuGRnAM+mrlPrBbCuzguKSGg==",
+      "version": "2.3.1",
+      "resolved": "https://registry.npmjs.org/@polkadot/types/-/types-2.3.1.tgz",
+      "integrity": "sha512-G3cyYYV+vYmpkMjPirwOA/zLreb1uBrKpEMWTvtTuCz/sNwcbCT5hI/KZCzNo1PueOQAowroKPe4yQ793dqVPw==",
       "requires": {
-        "@babel/runtime": "^7.11.2",
-        "@polkadot/metadata": "1.34.1",
-        "@polkadot/util": "^3.4.1",
-        "@polkadot/util-crypto": "^3.4.1",
+        "@babel/runtime": "^7.12.1",
+        "@polkadot/metadata": "2.3.1",
+        "@polkadot/util": "^3.6.1",
+        "@polkadot/util-crypto": "^3.6.1",
         "@types/bn.js": "^4.11.6",
         "bn.js": "^5.1.3",
         "memoizee": "^0.4.14",
         "rxjs": "^6.6.3"
       },
       "dependencies": {
+        "@babel/runtime": {
+          "version": "7.12.1",
+          "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.12.1.tgz",
+          "integrity": "sha512-J5AIf3vPj3UwXaAzb5j1xM4WAQDX3EMgemF8rjCP3SoW09LfRKAXQKt6CoVYl230P6iWdRcBbnLDDdnqWxZSCA==",
+          "requires": {
+            "regenerator-runtime": "^0.13.4"
+          }
+        },
         "@polkadot/util": {
-          "version": "3.4.1",
-          "resolved": "https://registry.npmjs.org/@polkadot/util/-/util-3.4.1.tgz",
-          "integrity": "sha512-CJo0wAzXR8vjAzs9mHDooZr5a3XRW8LlYWik8d/+bv1VDwCC/metSiBrYBOapFhYUjlS5IYIw5bhWS5dnpkXvQ==",
+          "version": "3.6.1",
+          "resolved": "https://registry.npmjs.org/@polkadot/util/-/util-3.6.1.tgz",
+          "integrity": "sha512-ToGVghmTtC8s8cg8mCGG3I88UasrCg9VNm5JoUvBH4nTZCxc/dQEkU24nULXwHUpmd7d39p3RLpVbkLCVYIMZw==",
           "requires": {
-            "@babel/runtime": "^7.11.2",
+            "@babel/runtime": "^7.12.1",
+            "@polkadot/x-textdecoder": "^0.3.3",
+            "@polkadot/x-textencoder": "^0.3.3",
             "@types/bn.js": "^4.11.6",
             "bn.js": "^5.1.3",
             "camelcase": "^5.3.1",
             "chalk": "^4.1.0",
-            "ip-regex": "^4.1.0"
+            "ip-regex": "^4.2.0"
           }
+        },
+        "ip-regex": {
+          "version": "4.2.0",
+          "resolved": "https://registry.npmjs.org/ip-regex/-/ip-regex-4.2.0.tgz",
+          "integrity": "sha512-n5cDDeTWWRwK1EBoWwRti+8nP4NbytBBY0pldmnIkq6Z55KNFmWofh4rl9dPZpj+U/nVq7gweR3ylrvMt4YZ5A=="
         }
       }
     },
     "@polkadot/types-known": {
-      "version": "1.34.1",
-      "resolved": "https://registry.npmjs.org/@polkadot/types-known/-/types-known-1.34.1.tgz",
-      "integrity": "sha512-H9V8u9cqbKjxU/dxEyLl7kJwoBImXpRskQ5+X0fq3BH7g1nQ6jrIg/buRPpbc3GxKivdFYUZWshPY9hbqE8y8A==",
+      "version": "2.3.1",
+      "resolved": "https://registry.npmjs.org/@polkadot/types-known/-/types-known-2.3.1.tgz",
+      "integrity": "sha512-34yuvDraW9Sjy5ookQZf55sBKLOsTqos+WQdTu6DUxtRuwvMP9DEAGcs2m6AFvWxwZps+3zFGUvzn6SMHsSJ5Q==",
       "requires": {
-        "@babel/runtime": "^7.11.2",
-        "@polkadot/types": "1.34.1",
-        "@polkadot/util": "^3.4.1",
+        "@babel/runtime": "^7.12.1",
+        "@polkadot/types": "2.3.1",
+        "@polkadot/util": "^3.6.1",
         "bn.js": "^5.1.3"
       },
       "dependencies": {
+        "@babel/runtime": {
+          "version": "7.12.1",
+          "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.12.1.tgz",
+          "integrity": "sha512-J5AIf3vPj3UwXaAzb5j1xM4WAQDX3EMgemF8rjCP3SoW09LfRKAXQKt6CoVYl230P6iWdRcBbnLDDdnqWxZSCA==",
+          "requires": {
+            "regenerator-runtime": "^0.13.4"
+          }
+        },
         "@polkadot/util": {
-          "version": "3.4.1",
-          "resolved": "https://registry.npmjs.org/@polkadot/util/-/util-3.4.1.tgz",
-          "integrity": "sha512-CJo0wAzXR8vjAzs9mHDooZr5a3XRW8LlYWik8d/+bv1VDwCC/metSiBrYBOapFhYUjlS5IYIw5bhWS5dnpkXvQ==",
+          "version": "3.6.1",
+          "resolved": "https://registry.npmjs.org/@polkadot/util/-/util-3.6.1.tgz",
+          "integrity": "sha512-ToGVghmTtC8s8cg8mCGG3I88UasrCg9VNm5JoUvBH4nTZCxc/dQEkU24nULXwHUpmd7d39p3RLpVbkLCVYIMZw==",
           "requires": {
-            "@babel/runtime": "^7.11.2",
+            "@babel/runtime": "^7.12.1",
+            "@polkadot/x-textdecoder": "^0.3.3",
+            "@polkadot/x-textencoder": "^0.3.3",
             "@types/bn.js": "^4.11.6",
             "bn.js": "^5.1.3",
             "camelcase": "^5.3.1",
             "chalk": "^4.1.0",
-            "ip-regex": "^4.1.0"
+            "ip-regex": "^4.2.0"
           }
+        },
+        "ip-regex": {
+          "version": "4.2.0",
+          "resolved": "https://registry.npmjs.org/ip-regex/-/ip-regex-4.2.0.tgz",
+          "integrity": "sha512-n5cDDeTWWRwK1EBoWwRti+8nP4NbytBBY0pldmnIkq6Z55KNFmWofh4rl9dPZpj+U/nVq7gweR3ylrvMt4YZ5A=="
         }
       }
     },
@@ -4546,12 +4437,13 @@
       }
     },
     "@polkadot/util-crypto": {
-      "version": "3.4.1",
-      "resolved": "https://registry.npmjs.org/@polkadot/util-crypto/-/util-crypto-3.4.1.tgz",
-      "integrity": "sha512-RdTAiJ6dFE8nQJ7/wQkvYa6aNZG3Lusf/r7UmPJ56dZldvDTP3OdekzcfYdogU8hSJrE/xX84ii4DrHLnXXfAQ==",
+      "version": "3.6.1",
+      "resolved": "https://registry.npmjs.org/@polkadot/util-crypto/-/util-crypto-3.6.1.tgz",
+      "integrity": "sha512-mRCijOXrxTa2JD5vpNvr1MHSj3NaSGaImg1yzAf3l7nw7zNGjLy1K3qQNcFgr8+0NHyPKk5lCIehtwGTRZYsiA==",
       "requires": {
-        "@babel/runtime": "^7.11.2",
-        "@polkadot/util": "3.4.1",
+        "@babel/runtime": "^7.12.1",
+        "@polkadot/networks": "3.6.1",
+        "@polkadot/util": "3.6.1",
         "@polkadot/wasm-crypto": "^1.4.1",
         "base-x": "^3.0.8",
         "bip39": "^3.0.2",
@@ -4565,18 +4457,33 @@
         "xxhashjs": "^0.2.2"
       },
       "dependencies": {
+        "@babel/runtime": {
+          "version": "7.12.1",
+          "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.12.1.tgz",
+          "integrity": "sha512-J5AIf3vPj3UwXaAzb5j1xM4WAQDX3EMgemF8rjCP3SoW09LfRKAXQKt6CoVYl230P6iWdRcBbnLDDdnqWxZSCA==",
+          "requires": {
+            "regenerator-runtime": "^0.13.4"
+          }
+        },
         "@polkadot/util": {
-          "version": "3.4.1",
-          "resolved": "https://registry.npmjs.org/@polkadot/util/-/util-3.4.1.tgz",
-          "integrity": "sha512-CJo0wAzXR8vjAzs9mHDooZr5a3XRW8LlYWik8d/+bv1VDwCC/metSiBrYBOapFhYUjlS5IYIw5bhWS5dnpkXvQ==",
+          "version": "3.6.1",
+          "resolved": "https://registry.npmjs.org/@polkadot/util/-/util-3.6.1.tgz",
+          "integrity": "sha512-ToGVghmTtC8s8cg8mCGG3I88UasrCg9VNm5JoUvBH4nTZCxc/dQEkU24nULXwHUpmd7d39p3RLpVbkLCVYIMZw==",
           "requires": {
-            "@babel/runtime": "^7.11.2",
+            "@babel/runtime": "^7.12.1",
+            "@polkadot/x-textdecoder": "^0.3.3",
+            "@polkadot/x-textencoder": "^0.3.3",
             "@types/bn.js": "^4.11.6",
             "bn.js": "^5.1.3",
             "camelcase": "^5.3.1",
             "chalk": "^4.1.0",
-            "ip-regex": "^4.1.0"
+            "ip-regex": "^4.2.0"
           }
+        },
+        "ip-regex": {
+          "version": "4.2.0",
+          "resolved": "https://registry.npmjs.org/ip-regex/-/ip-regex-4.2.0.tgz",
+          "integrity": "sha512-n5cDDeTWWRwK1EBoWwRti+8nP4NbytBBY0pldmnIkq6Z55KNFmWofh4rl9dPZpj+U/nVq7gweR3ylrvMt4YZ5A=="
         }
       }
     },
@@ -4586,30 +4493,79 @@
       "integrity": "sha512-GPBCh8YvQmA5bobI4rqRkUhrEHkEWU1+lcJVPbZYsa7jiHFaZpzCLrGQfiqW/vtbU1aBS2wmJ0x1nlt33B9QqQ=="
     },
     "@polkadot/x-fetch": {
-      "version": "0.3.2",
-      "resolved": "https://registry.npmjs.org/@polkadot/x-fetch/-/x-fetch-0.3.2.tgz",
-      "integrity": "sha512-lk9M8ql/kBBqiZ8KOWj7LFK7P9OxDgVn2fZPNELJzQbfFZwFF8umBPDIWlQIK7wTnlRsQlzOuf6MGEyMK5p42w==",
+      "version": "0.3.3",
+      "resolved": "https://registry.npmjs.org/@polkadot/x-fetch/-/x-fetch-0.3.3.tgz",
+      "integrity": "sha512-Osa+ifkqlndIW5U5jLnuugLYTd6q/cHkjdfisyYgNev/etsEtXkqesbGvF/UKw5FgZBxhK8sj6jjfProfh2NZw==",
       "requires": {
-        "@babel/runtime": "^7.11.2",
+        "@babel/runtime": "^7.12.1",
         "@types/node-fetch": "^2.5.7",
         "node-fetch": "^2.6.1"
       },
       "dependencies": {
-        "node-fetch": {
-          "version": "2.6.1",
-          "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz",
-          "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw=="
+        "@babel/runtime": {
+          "version": "7.12.1",
+          "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.12.1.tgz",
+          "integrity": "sha512-J5AIf3vPj3UwXaAzb5j1xM4WAQDX3EMgemF8rjCP3SoW09LfRKAXQKt6CoVYl230P6iWdRcBbnLDDdnqWxZSCA==",
+          "requires": {
+            "regenerator-runtime": "^0.13.4"
+          }
+        }
+      }
+    },
+    "@polkadot/x-textdecoder": {
+      "version": "0.3.3",
+      "resolved": "https://registry.npmjs.org/@polkadot/x-textdecoder/-/x-textdecoder-0.3.3.tgz",
+      "integrity": "sha512-ehbPUUNn34kJh/RV8eQwyLnAFcMQSbtGPKqGRB7GSa/bL7P6hh1QGxB4DwvtlFU//bDTlofsv44ydpjDNmfWLg==",
+      "requires": {
+        "@babel/runtime": "^7.12.1"
+      },
+      "dependencies": {
+        "@babel/runtime": {
+          "version": "7.12.1",
+          "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.12.1.tgz",
+          "integrity": "sha512-J5AIf3vPj3UwXaAzb5j1xM4WAQDX3EMgemF8rjCP3SoW09LfRKAXQKt6CoVYl230P6iWdRcBbnLDDdnqWxZSCA==",
+          "requires": {
+            "regenerator-runtime": "^0.13.4"
+          }
+        }
+      }
+    },
+    "@polkadot/x-textencoder": {
+      "version": "0.3.3",
+      "resolved": "https://registry.npmjs.org/@polkadot/x-textencoder/-/x-textencoder-0.3.3.tgz",
+      "integrity": "sha512-klbz82L5LxDJTFoCO64G/EFfY1mKXHDlteJMDGFTOim/1oK1ypLOG8/7BmncmQAw2BevA0r1YkvWN+F3muJSag==",
+      "requires": {
+        "@babel/runtime": "^7.12.1"
+      },
+      "dependencies": {
+        "@babel/runtime": {
+          "version": "7.12.1",
+          "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.12.1.tgz",
+          "integrity": "sha512-J5AIf3vPj3UwXaAzb5j1xM4WAQDX3EMgemF8rjCP3SoW09LfRKAXQKt6CoVYl230P6iWdRcBbnLDDdnqWxZSCA==",
+          "requires": {
+            "regenerator-runtime": "^0.13.4"
+          }
         }
       }
     },
     "@polkadot/x-ws": {
-      "version": "0.3.2",
-      "resolved": "https://registry.npmjs.org/@polkadot/x-ws/-/x-ws-0.3.2.tgz",
-      "integrity": "sha512-1aiG11Py8sgzJsz19melMzvBOn5zeMmfjCPoMryX4//063E0mcfnkujg4O6pTMygxJdFGAV1INB9wvMU9Dg9Wg==",
+      "version": "0.3.3",
+      "resolved": "https://registry.npmjs.org/@polkadot/x-ws/-/x-ws-0.3.3.tgz",
+      "integrity": "sha512-t06ID5QLYi5B8bzlT2fcYsQ09yfLf5Uq9idunKRZj13EwSELaqvZFfn2UmiDFiIB1H5u7c2y+VDWbIdqE8ZxKw==",
       "requires": {
-        "@babel/runtime": "^7.11.2",
+        "@babel/runtime": "^7.12.1",
         "@types/websocket": "^1.0.1",
         "websocket": "^1.0.32"
+      },
+      "dependencies": {
+        "@babel/runtime": {
+          "version": "7.12.1",
+          "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.12.1.tgz",
+          "integrity": "sha512-J5AIf3vPj3UwXaAzb5j1xM4WAQDX3EMgemF8rjCP3SoW09LfRKAXQKt6CoVYl230P6iWdRcBbnLDDdnqWxZSCA==",
+          "requires": {
+            "regenerator-runtime": "^0.13.4"
+          }
+        }
       }
     },
     "@sindresorhus/is": {
@@ -16840,6 +16796,11 @@
         "lower-case": "^1.1.1"
       }
     },
+    "node-fetch": {
+      "version": "2.6.1",
+      "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz",
+      "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw=="
+    },
     "node-fetch-npm": {
       "version": "2.0.4",
       "resolved": "https://registry.npmjs.org/node-fetch-npm/-/node-fetch-npm-2.0.4.tgz",
modifiedtests/package.jsondiffbeforeafterboth
--- a/tests/package.json
+++ b/tests/package.json
@@ -23,9 +23,9 @@
   "license": "Apache 2.0",
   "homepage": "",
   "dependencies": {
-    "@polkadot/api": "^1.34.1",
-    "@polkadot/api-contract": "^1.34.1",
-    "@polkadot/types": "^1.34.1",
+    "@polkadot/api": "^2.3.1",
+    "@polkadot/api-contract": "^2.3.1",
+    "@polkadot/types": "^2.3.1",
     "@polkadot/util": "^3.4.1",
     "@types/bn.js": "^4.11.6",
     "chai-as-promised": "^7.1.1"
modifiedtests/src/contracts.test.tsdiffbeforeafterboth
--- a/tests/src/contracts.test.ts
+++ b/tests/src/contracts.test.ts
@@ -1,129 +1,91 @@
 import { expect } from "chai";
 import usingApi from "./substrate/substrate-api";
-import promisifySubstrate from "./substrate/promisify-substrate";
 import fs from "fs";
-import privateKey from "./substrate/privateKey";
-import { compactAddLength, u8aToU8a } from '@polkadot/util';
-import { Hash, AccountId } from "@polkadot/types/interfaces";
-import { Abi, PromiseContract } from "@polkadot/api-contract";
-import { ISubmittableResult, IKeyringPair } from "@polkadot/types/types";
-import BN from "bn.js";
-import { alicesPublicKey, bobsPublicKey } from "./accounts";
-import { ApiPromise } from "@polkadot/api";
-import { GenericAccountId, u128 } from "@polkadot/types";
-import getBalance from "./substrate/get-balance";
+import { Abi, BlueprintPromise, CodePromise } from "@polkadot/api-contract";
+import { IKeyringPair } from "@polkadot/types/types";
+import { Keyring } from "@polkadot/api";
+import { ApiTypes, SubmittableExtrinsic } from "@polkadot/api/types";
 
+const value = 0;
+const gasLimit = 3000n * 1000000n;
 
-function deployContract(api: ApiPromise, contract: Uint8Array, privateKey: IKeyringPair): Promise<Hash> {
-  return promisifySubstrate(api, () => {
-    return new Promise<Hash>(async (resolve, reject) => {
-      const unsubscribe = api.tx.contracts.putCode(contract).signAndSend(privateKey, async result => {
-        if(!result.isInBlock){
-          return;
+function deployBlueprint(alice: IKeyringPair, code: CodePromise): Promise<BlueprintPromise> {
+  return new Promise<BlueprintPromise>(async (resolve, reject) => {
+    const unsub = await code
+      .createBlueprint()
+      .signAndSend(alice, (result) => {
+        if (result.status.isInBlock || result.status.isFinalized) {
+          // here we have an additional field in the result, containing the blueprint
+          resolve(result.blueprint);
+          unsub();
         }
+      })
+  });
+}
 
-        const record = result.findRecord('contracts', 'CodeStored');
+function deployContract(alice: IKeyringPair, blueprint: BlueprintPromise) : Promise<any> {
+  return new Promise<any>(async (resolve, reject) => {
+    const endowment = 1000000000000000n;
+    const initValue = true;
 
-        if(record) {
-          (await unsubscribe)();
-          resolve(record.event.data[0] as unknown as Hash);
-        } else {
-          reject('Failed to find contract hash in putCode transaction result.');
-        }
-      });
-    })
-  })();
+    const unsub = await blueprint.tx
+    .new(endowment, gasLimit, initValue)
+    .signAndSend(alice, (result) => {
+      if (result.status.isInBlock || result.status.isFinalized) {
+        unsub();
+        resolve(result);
+      }
+    });    
+  });
 }
 
-function instantiateContract(api: ApiPromise, contractHash: Hash, args: Uint8Array, privateKey: IKeyringPair): Promise<AccountId> {
-  return promisifySubstrate(api, () => {
-    return new Promise<AccountId>((resolve, reject) => {
-      const unsubscribe = api.tx.contracts.instantiate(1000000000000000n, 1000000000000n, contractHash, args)
-        .signAndSend(privateKey, async (result:ISubmittableResult) => {
-          if(!result.isInBlock) {
-            return;
-          }
-          const record = result.findRecord('contracts', 'Instantiated');
-          if(record) {
-            (await unsubscribe)();
-            expect(alicesPublicKey).to.be.equal(record.event.data[0].toString());
-            resolve(record.event.data[1] as AccountId);
-          } else {
-            reject('Failed to find instantiated event.');
-          }
-        });
-    });
-  })();
-}
-
-function txContractCall(api: ApiPromise, privateKey: IKeyringPair, address: string, call: Uint8Array): Promise<void> {
-  return promisifySubstrate(api, async () => {
-    return new Promise<void>(async (resolve, reject) => {
-      api.tx.contracts.call(address, 0, 1000000000000n, call)
-        .signAndSend(privateKey, async result => {
-          if(!result.isInBlock) {
-            return;
-          }
+function runTransaction(privateKey: IKeyringPair, extrinsic: SubmittableExtrinsic<ApiTypes>) {
+  return new Promise<void>(async (resolve, reject) => {
+    extrinsic.signAndSend(privateKey, async result => {
+        if(!result.isInBlock) {
+          return;
+        }
 
-          if(result.findRecord('system', 'ExtrinsicSuccess')) {
-            resolve();
-          }
-          else {
-            reject('Failed to execute tx call.');
-          }
-        })
-    });
-  })();
+        if(result.findRecord('system', 'ExtrinsicSuccess')) {
+          resolve();
+        }
+        else {
+          reject('Failed to flip value.');
+        }
+      })
+  });
 }
 
 describe('Contracts', () => {
   it(`Can deploy smart contract Flipper, instantiate it and call it's get and flip messages.`, async () => {
     await usingApi(async api => {
+      const keyring = new Keyring({ type: 'sr25519' });
+      const alice = keyring.addFromUri("//Alice");
+      
       const wasm = fs.readFileSync('./src/flipper/flipper.wasm');
-      const contract = compactAddLength(u8aToU8a(wasm));
-
+      
       const metadata = JSON.parse(fs.readFileSync('./src/flipper/metadata.json').toString('utf-8'));
-      const abi = new Abi(api.registry as any, metadata);
+      const abi = new Abi(metadata);
 
-      const alicesPrivateKey = privateKey('//Alice');
+      const code = new CodePromise(api, abi, wasm);
 
-      const contractHash = await deployContract(api, contract, alicesPrivateKey);
-
-      const args = abi.constructors[0](true);
-      const instanceAccountId = await instantiateContract(api, contractHash, args, alicesPrivateKey);
+      const blueprint = await deployBlueprint(alice, code);
+      const contract = (await deployContract(alice, blueprint))['contract'];
 
-      const contractInstance = new PromiseContract(api, abi, instanceAccountId);
       const getFlipValue = async () => {
-        return await promisifySubstrate(api, async () => {
-          const result = await contractInstance.call('rpc', 'get', 0, new BN('1000000000000'))
-            .send(alicesPublicKey);
-          if(!result.isSuccess) {
-            throw 'Failed to get flipper value';
-          }
-          return result.output && result.output.valueOf && result.output.valueOf();
-        })();
+        const result = await contract.query.get(alice.address, value, gasLimit);
+
+        if(!result.result.isSuccess) {
+          throw `Failed to get flipper value`;
+        }
+        return (result.result.asSuccess.data[0] == 0x00) ? false : true;
       }
 
       const initialGetResponse = await getFlipValue();
       expect(initialGetResponse).to.be.true;
 
-      await promisifySubstrate(api, async () => {
-        return new Promise<void>(async (resolve, reject) => {
-          api.tx.contracts.call(contractInstance.address.toString(), 0, 1000000000000n, contractInstance.getMessage('flip').fn())
-            .signAndSend(alicesPrivateKey, async result => {
-              if(!result.isInBlock) {
-                return;
-              }
-
-              if(result.findRecord('system', 'ExtrinsicSuccess')) {
-                resolve();
-              }
-              else {
-                reject('Failed to flip value.');
-              }
-            })
-        });
-      })();
+      const flip = contract.exec('flip', value, gasLimit);
+      await runTransaction(alice, flip);
 
       const afterFlipGetResponse = await getFlipValue();
 
@@ -131,30 +93,31 @@
     });
   });
 
-  it('Can transfer balance using smart contract.', async () => {
+  it.skip('Can transfer balance using smart contract.', async () => {
     await usingApi(async api => {
-      const [alicesBalanceBefore, bobsBalanceBefore] = await getBalance(api, [alicesPublicKey, bobsPublicKey]);
-      const wasm = fs.readFileSync('./src/balance-transfer-contract/calls.wasm');
-      const contract = compactAddLength(u8aToU8a(wasm));
+      // const [alicesBalanceBefore, bobsBalanceBefore] = await getBalance(api, [alicesPublicKey, bobsPublicKey]);
+      // const wasm = fs.readFileSync('./src/balance-transfer-contract/calls.wasm');
+      // const contract = compactAddLength(u8aToU8a(wasm));
+
+      // const metadata = JSON.parse(fs.readFileSync('./src/balance-transfer-contract/metadata.json').toString('utf-8'));
+      // const abi = new Abi(api.registry as any, metadata);
 
-      const metadata = JSON.parse(fs.readFileSync('./src/balance-transfer-contract/metadata.json').toString('utf-8'));
-      const abi = new Abi(api.registry as any, metadata);
+      // const alicesPrivateKey = privateKey('//Alice');
 
-      const alicesPrivateKey = privateKey('//Alice');
+      // const contractHash = await deployContract(api, contract, alicesPrivateKey);
 
-      const contractHash = await deployContract(api, contract, alicesPrivateKey);
+      // // const args = abi.constructors[0]();
+      // const instanceAccountId = await instantiateContract(api, contractHash, /*args,*/ alicesPrivateKey);
+      // const contractInstance = new ContractPromise(api, abi, instanceAccountId);
+      // const bob = new GenericAccountId(api.registry, bobsPublicKey);
 
-      const args = abi.constructors[0]();
-      const instanceAccountId = await instantiateContract(api, contractHash, args, alicesPrivateKey);
-      const contractInstance = new PromiseContract(api, abi, instanceAccountId);
-      const bob = new GenericAccountId(api.registry, bobsPublicKey);
-      const call = contractInstance.getMessage('balance_transfer').fn(bob, new u128(api.registry, 1000000));
-      await txContractCall(api, alicesPrivateKey, contractInstance.address.toString(), call);
+      // const transfer = contractInstance.exec('balance_transfer', 0, 1000000000000n, [bob, new u128(api.registry, 1000000)]);
+      // await runTransaction(alicesPrivateKey, transfer);
 
-      const [alicesBalanceAfter, bobsBalanceAfter] = await getBalance(api, [alicesPublicKey, bobsPublicKey]);
+      // const [alicesBalanceAfter, bobsBalanceAfter] = await getBalance(api, [alicesPublicKey, bobsPublicKey]);
 
-      expect(alicesBalanceAfter < alicesBalanceBefore).to.be.true;
-      expect(bobsBalanceAfter > bobsBalanceBefore).to.be.true;
+      // expect(alicesBalanceAfter < alicesBalanceBefore).to.be.true;
+      // expect(bobsBalanceAfter > bobsBalanceBefore).to.be.true;
     });
   })
 });
modifiedtests/src/flipper/flipper.wasmdiffbeforeafterboth

binary blob — no preview

modifiedtests/src/flipper/metadata.jsondiffbeforeafterboth
--- a/tests/src/flipper/metadata.json
+++ b/tests/src/flipper/metadata.json
@@ -1,204 +1,106 @@
 {
-  "registry": {
-    "strings": [
-      "Storage",
-      "flipper",
-      "__ink_private",
-      "__ink_storage",
-      "value",
-      "Value",
-      "ink_core",
-      "storage",
-      "cell",
-      "SyncCell",
-      "sync_cell",
-      "Key",
-      "ink_primitives",
-      "new",
-      "init_value",
-      "bool",
-      "default",
-      "flip",
-      "get"
-    ],
-    "types": [
-      {
-        "id": {
-          "custom.name": 1,
-          "custom.namespace": [
-            2,
-            2,
-            3,
-            4
-          ],
-          "custom.params": []
-        },
-        "def": {
-          "struct.fields": [
-            {
-              "name": 5,
-              "type": 2
-            }
-          ]
-        }
-      },
-      {
-        "id": {
-          "custom.name": 6,
-          "custom.namespace": [
-            7,
-            8,
-            5
-          ],
-          "custom.params": [
-            3
-          ]
-        },
-        "def": {
-          "struct.fields": [
-            {
-              "name": 9,
-              "type": 4
-            }
-          ]
-        }
-      },
-      {
-        "id": "bool",
-        "def": "builtin"
-      },
-      {
-        "id": {
-          "custom.name": 10,
-          "custom.namespace": [
-            7,
-            8,
-            9,
-            11
-          ],
-          "custom.params": [
-            3
-          ]
-        },
-        "def": {
-          "struct.fields": [
-            {
-              "name": 9,
-              "type": 5
-            }
-          ]
-        }
-      },
-      {
-        "id": {
-          "custom.name": 12,
-          "custom.namespace": [
-            13
-          ],
-          "custom.params": []
-        },
-        "def": {
-          "tuple_struct.types": [
-            6
-          ]
-        }
-      },
-      {
-        "id": {
-          "array.len": 32,
-          "array.type": 7
-        },
-        "def": "builtin"
-      },
-      {
-        "id": "u8",
-        "def": "builtin"
-      }
-    ]
+  "metadataVersion": "0.1.0",
+  "source": {
+    "hash": "0x36431d9da78a6bb099474e49c9e35a9c3a04272b58815634082626109826cac6",
+    "language": "ink! 3.0.0-rc1",
+    "compiler": "rustc 1.49.0-nightly"
   },
-  "storage": {
-    "struct.type": 1,
-    "struct.fields": [
-      {
-        "name": 5,
-        "layout": {
-          "struct.type": 2,
-          "struct.fields": [
-            {
-              "name": 9,
-              "layout": {
-                "range.offset": "0x0000000000000000000000000000000000000000000000000000000000000000",
-                "range.len": 1,
-                "range.elem_type": 3
-              }
-            }
-          ]
-        }
-      }
+  "contract": {
+    "name": "flipper",
+    "version": "3.0.0-rc1",
+    "authors": [
+      "Parity Technologies <admin@parity.io>"
     ]
   },
-  "contract": {
-    "name": 2,
+  "spec": {
     "constructors": [
       {
-        "name": 14,
-        "selector": "[\"0x5E\",\"0xBD\",\"0x88\",\"0xD6\"]",
         "args": [
           {
-            "name": 15,
+            "name": "init_value",
             "type": {
-              "ty": 3,
-              "display_name": [
-                16
-              ]
+              "displayName": [
+                "bool"
+              ],
+              "type": 1
             }
           }
         ],
         "docs": [
-          "Constructor that initializes the `bool` value to the given `init_value`."
-        ]
+          " Creates a new flipper smart contract initialized with the given value."
+        ],
+        "name": [
+          "new"
+        ],
+        "selector": "0xd183512b"
       },
       {
-        "name": 17,
-        "selector": "[\"0x02\",\"0x22\",\"0xFF\",\"0x18\"]",
         "args": [],
         "docs": [
-          "Constructor that initializes the `bool` value to `false`.",
-          "",
-          "Constructors can delegate to other constructors."
-        ]
+          " Creates a new flipper smart contract initialized to `false`."
+        ],
+        "name": [
+          "default"
+        ],
+        "selector": "0x6a3712e2"
       }
     ],
+    "docs": [],
+    "events": [],
     "messages": [
       {
-        "name": 18,
-        "selector": "[\"0x8C\",\"0x97\",\"0xDB\",\"0x39\"]",
-        "mutates": true,
         "args": [],
-        "return_type": null,
         "docs": [
-          "A message that can be called on instantiated contracts.",
-          "This one flips the value of the stored `bool` from `true`",
-          "to `false` and vice versa."
-        ]
+          " Flips the current value of the Flipper's bool."
+        ],
+        "mutates": true,
+        "name": [
+          "flip"
+        ],
+        "payable": false,
+        "returnType": null,
+        "selector": "0xc096a5f3"
       },
       {
-        "name": 19,
-        "selector": "[\"0x25\",\"0x44\",\"0x4A\",\"0xFE\"]",
-        "mutates": false,
         "args": [],
-        "return_type": {
-          "ty": 3,
-          "display_name": [
-            16
-          ]
-        },
         "docs": [
-          "Simply returns the current value of our `bool`."
-        ]
+          " Returns the current value of the Flipper's bool."
+        ],
+        "mutates": false,
+        "name": [
+          "get"
+        ],
+        "payable": false,
+        "returnType": {
+          "displayName": [
+            "bool"
+          ],
+          "type": 1
+        },
+        "selector": "0x1e5ca456"
       }
-    ],
-    "events": [],
-    "docs": []
-  }
+    ]
+  },
+  "storage": {
+    "struct": {
+      "fields": [
+        {
+          "layout": {
+            "cell": {
+              "key": "0x0000000000000000000000000000000000000000000000000000000000000000",
+              "ty": 1
+            }
+          },
+          "name": "value"
+        }
+      ]
+    }
+  },
+  "types": [
+    {
+      "def": {
+        "primitive": "bool"
+      }
+    }
+  ]
 }
\ No newline at end of file