Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: NFT #283

Merged
merged 149 commits into from
Feb 11, 2022
Merged
Show file tree
Hide file tree
Changes from 131 commits
Commits
Show all changes
149 commits
Select commit Hold shift + click to select a range
c9144ba
wip builder's review refactoring
green-jay Aug 4, 2021
9692531
NFT builder's review refactoring
green-jay Aug 6, 2021
b791259
Merge branch 'master' of /~https://github.com/galacticcouncil/Basilisk-…
green-jay Aug 6, 2021
ef50a3a
bump + cosmetics + emote check
green-jay Aug 6, 2021
52fd31e
add tests for new errors
green-jay Aug 9, 2021
4dec2bf
change fixed constants to pallet constants
green-jay Aug 11, 2021
ea403cb
refactor pool
green-jay Aug 23, 2021
2b8758e
init
green-jay Aug 23, 2021
e43f264
Merge remote-tracking branch 'origin/master' into feat/marketplace
green-jay Aug 23, 2021
78ed35a
Merge remote-tracking branch 'origin/master' into feat/marketplace
green-jay Aug 31, 2021
432d1c7
fix imports
green-jay Aug 31, 2021
b17f2f6
fix tests
green-jay Aug 31, 2021
67474e9
remove ext builder
green-jay Aug 31, 2021
118d137
add ExtBuilder
green-jay Aug 31, 2021
e76fc90
fix missing semicolons
green-jay Aug 31, 2021
8e8beff
satisfy tarpaulin
green-jay Aug 31, 2021
b76d052
wip trading functions
green-jay Sep 1, 2021
241d000
buy and set price clean
green-jay Sep 3, 2021
3bb3bb0
add pallet-uniques
green-jay Sep 9, 2021
9787687
add JS types
green-jay Sep 9, 2021
4307879
add tests
green-jay Sep 10, 2021
3bbe2d0
full migration to Uniques, custom NFT functions
green-jay Sep 16, 2021
76b6f9c
Merge branch 'master' into feat/marketplace
green-jay Sep 16, 2021
6f553f1
clippy + benchmarks
green-jay Sep 16, 2021
28fd775
remove from storage on destroy
green-jay Sep 16, 2021
64a422d
remove unused import
green-jay Sep 16, 2021
68e09fe
clippy
green-jay Sep 17, 2021
06f2048
set price
green-jay Sep 17, 2021
e57f772
fix set price in bench
green-jay Sep 17, 2021
c7e1d4f
improve benchs and tests
green-jay Sep 21, 2021
e1fab1d
fix comments
green-jay Sep 21, 2021
a7798b1
Merge branch 'master' into feat/marketplace
mrq1911 Sep 24, 2021
598fc23
Merge branch 'master' into feat/marketplace
green-jay Oct 5, 2021
25b743d
fix imports
green-jay Oct 5, 2021
c665387
fix imports
green-jay Oct 5, 2021
acd0f07
add patches
green-jay Oct 5, 2021
fb69147
wip refactor to 0.9.10
green-jay Oct 8, 2021
0dd8e9b
latest changes
green-jay Oct 12, 2021
55a81cc
add ipfs hash
green-jay Oct 12, 2021
eb57bd9
add free trading test
green-jay Oct 13, 2021
8a6f155
Add offers
green-jay Oct 13, 2021
66b8ef4
update types
green-jay Oct 13, 2021
d0ca912
feat: add local uniques pallet
enthusiastmartin Oct 13, 2021
80b0e7a
introduce mint and burn permissions for unique pallet
enthusiastmartin Oct 13, 2021
19d063b
feat: add instance reserve deposit config to unique pallet
enthusiastmartin Oct 13, 2021
61a5b15
update uniques to allow different reserve strategy
enthusiastmartin Oct 14, 2021
d919c44
rework marketplace and uniques permissions
enthusiastmartin Oct 14, 2021
ebcd0de
add instance and class ids to permision model
enthusiastmartin Oct 14, 2021
0074d26
fix tests
green-jay Oct 14, 2021
4ccbb98
fix build
enthusiastmartin Oct 14, 2021
80a3d47
fix build
enthusiastmartin Oct 14, 2021
b54f0d3
add uniques destroy class permission
enthusiastmartin Oct 14, 2021
bc54d56
update marketplace tests
enthusiastmartin Oct 14, 2021
416410e
add transfer permission support to uniques pallet
enthusiastmartin Oct 14, 2021
b8d05cd
Market refactoring
green-jay Oct 19, 2021
6a48fe9
fmt
green-jay Oct 19, 2021
8d7994a
add offer mortality
green-jay Oct 19, 2021
254de63
add metadata
green-jay Oct 19, 2021
b81ed3d
TokenInfo struct type change
green-jay Oct 20, 2021
2e78e44
Complete benchmarks
green-jay Oct 21, 2021
5a1d9dc
add cancreateclass
green-jay Oct 25, 2021
a2b492c
elevate unlist
green-jay Oct 25, 2021
33955d0
add relisting
green-jay Oct 25, 2021
9b288f4
add unknown type to readme
green-jay Oct 26, 2021
fd859bc
Merge remote-tracking branch 'origin/master' into feat/marketplace
green-jay Oct 26, 2021
38c6f26
adjust benchmark
green-jay Oct 26, 2021
7f02f37
Move royalties to NFT pallet
green-jay Oct 27, 2021
cd269cf
adjust tests
green-jay Oct 27, 2021
5921d1e
fix tests and benchs
green-jay Oct 27, 2021
54cc607
fix docs
green-jay Oct 27, 2021
c18105f
fix test
green-jay Oct 27, 2021
d51a854
rework permissions model
enthusiastmartin Oct 27, 2021
a7aeb0d
fix runtime uniques config
enthusiastmartin Oct 27, 2021
820bf66
add tests for all errors
green-jay Oct 28, 2021
9aaf47a
bench wip
green-jay Oct 28, 2021
cdc3496
fix benchmark compilation
enthusiastmartin Oct 28, 2021
c3bff58
add permissions and tests for it
green-jay Oct 29, 2021
5567320
format
green-jay Oct 29, 2021
d550f11
rebench
green-jay Oct 29, 2021
71a5421
Merge remote-tracking branch 'origin/master' into feat/marketplace
green-jay Oct 29, 2021
a9bb5c2
readd orml-benchmarking
green-jay Oct 29, 2021
5a88267
Merge branch 'master' into feat/marketplace
green-jay Oct 29, 2021
b0b2187
fix readme
green-jay Oct 29, 2021
08635e1
adjust docs
green-jay Oct 29, 2021
18740cf
add destroy class check if class empty
green-jay Nov 1, 2021
287a6b6
refactor
green-jay Nov 1, 2021
9b067ba
add tests for repatriate
green-jay Nov 3, 2021
c9238b8
elevate transfer permissions
green-jay Nov 3, 2021
e3e301d
remove obsolete comment
green-jay Nov 3, 2021
93fd6ed
fix instance deposit transfer
enthusiastmartin Nov 5, 2021
b6a46c3
fix clippy
green-jay Nov 6, 2021
1081042
fmt
green-jay Nov 6, 2021
1becced
fix bench
green-jay Nov 6, 2021
b0cabab
fmt
green-jay Nov 6, 2021
7814665
fix clippy
green-jay Nov 6, 2021
30104e9
add support for multiple offers
green-jay Nov 17, 2021
7a591bb
improve comments
green-jay Nov 18, 2021
abc4cda
autobench
green-jay Nov 22, 2021
d05c967
pr comments
green-jay Nov 24, 2021
c464c03
pr comments + callfilter
green-jay Nov 24, 2021
a647030
Merge branch 'master' into feat/marketplace
green-jay Nov 24, 2021
1c4ea18
merge fixes
green-jay Nov 24, 2021
b9d39b8
remove list&unlist
green-jay Nov 25, 2021
1af0a79
fmt
green-jay Nov 25, 2021
7880b29
fix benchs
green-jay Nov 25, 2021
c23ad70
get owner fn
green-jay Nov 25, 2021
eae0cc9
refactor benchs
green-jay Nov 26, 2021
2229c5d
clippy
green-jay Nov 26, 2021
db4cfac
bump
green-jay Nov 26, 2021
0e7bbe7
Merge branch 'master' into feat/marketplace
green-jay Nov 26, 2021
8552023
separate storage
green-jay Nov 26, 2021
4e0866a
finalize split
green-jay Nov 27, 2021
68aacf7
add royaltypaid event
green-jay Nov 29, 2021
76c18f6
restructuring
green-jay Dec 7, 2021
ccc7dbe
nft init
green-jay Dec 7, 2021
19d4e5d
Merge branch 'master' into feat/nft
green-jay Dec 7, 2021
7715155
Merge branch 'master' into feat/marketplace
green-jay Dec 7, 2021
56094c3
Merge branch 'master' into feat/marketplace
green-jay Dec 8, 2021
74b4ca8
wip
green-jay Dec 10, 2021
338ae2a
refactor permissions
green-jay Dec 14, 2021
7b593c6
change perms
green-jay Dec 14, 2021
9a9705a
PoC1
green-jay Dec 15, 2021
868370e
fmt
green-jay Dec 15, 2021
068f4b7
marketplace poc
green-jay Dec 15, 2021
e0c2a75
finalize poc
green-jay Dec 16, 2021
e511a86
Merge branch 'jz_marketplace_experiment' into feat/nft
green-jay Dec 16, 2021
5b14f9d
Merge branch 'master' into feat/nft
green-jay Dec 16, 2021
73a07ed
minimize uniques customizations
green-jay Dec 21, 2021
86934e9
Remove unused errors and allow all clippy for uniques
green-jay Dec 22, 2021
638ab6a
add metadata
green-jay Dec 27, 2021
8b73acc
Merge branch 'master' into feat/nft
green-jay Dec 27, 2021
43e7dd1
Merge branch 'polkadot-v0.9.16' into feat/nft
green-jay Feb 3, 2022
5d21967
remove uniques fork
green-jay Feb 3, 2022
eea2de7
PR comments
green-jay Feb 3, 2022
9afdc06
move events to helper fns
green-jay Feb 3, 2022
a9586eb
change default class type to Marketplace
green-jay Feb 7, 2022
4ce9708
use custom IDs for classes and instances
green-jay Feb 7, 2022
7973ba5
Merge branch 'master' into feat/nft
green-jay Feb 8, 2022
5204a26
unify id types and bump runtime
green-jay Feb 8, 2022
cc8a37c
remove unused stuff
green-jay Feb 8, 2022
77084c2
reserve class ids for runtime pallets
green-jay Feb 8, 2022
ccfef30
fix bench
green-jay Feb 8, 2022
5649998
Merge branch 'master' into feat/nft
mrq1911 Feb 8, 2022
b50c91c
bump crates
green-jay Feb 8, 2022
37b926f
Merge branch 'master' into feat/nft
mrq1911 Feb 8, 2022
abe0eeb
fix runtime upgrade test
mrq1911 Feb 8, 2022
0481091
download binary from legacy workflow as well
mrq1911 Feb 9, 2022
7a4d90f
Merge branch 'master' into feat/nft
mrq1911 Feb 11, 2022
05546e1
fix: sudo key is an option
mrq1911 Feb 11, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 20 additions & 18 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ members = [
'pallets/duster',
'pallets/xyk',
'pallets/exchange',
'pallets/uniques',
'pallets/asset-registry',
'integration-tests',
]
Expand Down Expand Up @@ -190,4 +191,4 @@ cumulus-primitives-parachain-inherent = { git = "/~https://github.com/paritytech//
cumulus-primitives-timestamp = { git = "/~https://github.com/paritytech//cumulus", rev = "935bac869a72baef17e46d2ae1abc8c0c650cef5" }
cumulus-primitives-utility = { git = "/~https://github.com/paritytech//cumulus", rev = "935bac869a72baef17e46d2ae1abc8c0c650cef5" }
cumulus-test-relay-sproof-builder = { git = "/~https://github.com/paritytech//cumulus", rev = "935bac869a72baef17e46d2ae1abc8c0c650cef5" }
parachain-info = { git = "/~https://github.com/paritytech//cumulus", rev = "935bac869a72baef17e46d2ae1abc8c0c650cef5" }
parachain-info = { git = "/~https://github.com/paritytech//cumulus", rev = "935bac869a72baef17e46d2ae1abc8c0c650cef5" }
49 changes: 26 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,29 +137,6 @@ Then open settings screen -> developer and paste
},
"LookupSource":"AccountId",
"Price":"Balance",
"ClassId":"u64",
"TokenId":"u64",
"ClassData":{
"is_pool":"bool"
},
"TokenData":{
"locked":"bool"
},
"ClassInfo":{
"metadata":"Vec<u8>",
"total_issuance":"TokenId",
"owner":"AccountId",
"data":"ClassData"
},
"TokenInfo":{
"metadata":"Vec<u8>",
"owner":"AccountId",
"data":"TokenData"
},
"ClassInfoOf":"ClassInfo",
"TokenInfoOf":"TokenInfo",
"ClassIdOf":"ClassId",
"TokenIdOf":"TokenId",
"OrderedSet":"Vec<AssetId>",
"VestingSchedule":{
"start":"BlockNumber",
Expand Down Expand Up @@ -204,6 +181,32 @@ Then open settings screen -> developer and paste
"symbol":"Vec<u8>",
"decimals":"u8"
},
"ClassId":"u32",
"InstanceId":"u32",
"NftClassIdOf":"u32",
"NftTokenIdOf":"u32",
"ClassType":{
"_enum":[
"Marketplace",
"PoolShare"
]
},
"TokenInfo":{
"price":"Option<Balance>",
"offer":"Option<(AccountId,Balance,BlockNumber)>"
},
"TokenInfoOf":"TokenInfo",
"ClassInfo":{
"class_type":"ClassType",
"metadata":"Vec<u8>"
},
"ClassInfoOf":"ClassInfo",
"InstanceInfo":{
"author":"AccountId",
"royalty":"u8",
"metadata":"Vec<u8>"
},
"InstanceInfoOf":"InstanceInfo",
"AssetInstance": "AssetInstanceV1",
"MultiLocation": "MultiLocationV1",
"AssetNativeLocation": "MultiLocation",
Expand Down
2 changes: 0 additions & 2 deletions integration-tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ pallet-authorship = { git = "/~https://github.com/paritytech/substrate", branch =

# ORML dependencies
orml-currencies = { git = "/~https://github.com/open-web3-stack/open-runtime-module-library", rev = "ee37b76a7a8cf159e6c41851942758746318bb84", default-features = false }
orml-nft = { git = "/~https://github.com/open-web3-stack/open-runtime-module-library", rev = "ee37b76a7a8cf159e6c41851942758746318bb84", default-features = false }
orml-tokens = { git = "/~https://github.com/open-web3-stack/open-runtime-module-library", rev = "ee37b76a7a8cf159e6c41851942758746318bb84", default-features = false }
orml-traits = { git = "/~https://github.com/open-web3-stack/open-runtime-module-library", rev = "ee37b76a7a8cf159e6c41851942758746318bb84", default-features = false }
orml-vesting = { git = "/~https://github.com/open-web3-stack/open-runtime-module-library", rev = "ee37b76a7a8cf159e6c41851942758746318bb84", default-features = false }
Expand Down Expand Up @@ -140,7 +139,6 @@ std = [
"xcm-builder/std",
"xcm-executor/std",
"pallet-xcm/std",
"orml-nft/std",
"parachain-info/std",
"pallet-xyk/std",
"pallet-duster/std",
Expand Down
8 changes: 1 addition & 7 deletions node/src/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

use basilisk_runtime::{
AccountId, AssetRegistryConfig, AuraId, Balance, BalancesConfig, CollatorSelectionConfig, CouncilConfig,
DusterConfig, ElectionsConfig, GenesisConfig, MultiTransactionPaymentConfig, OrmlNftConfig, ParachainInfoConfig,
DusterConfig, ElectionsConfig, GenesisConfig, MultiTransactionPaymentConfig, ParachainInfoConfig,
SessionConfig, Signature, SudoConfig, SystemConfig, TechnicalCommitteeConfig, TokensConfig, VestingConfig,
NATIVE_EXISTENTIAL_DEPOSIT, UNITS, WASM_BINARY,
};
Expand Down Expand Up @@ -569,9 +569,6 @@ fn parachain_genesis(
],
phantom: Default::default(),
},
orml_nft: OrmlNftConfig {
tokens: Default::default(),
},
vesting: VestingConfig { vesting: vec![] },
parachain_info: ParachainInfoConfig { parachain_id },
aura_ext: Default::default(),
Expand Down Expand Up @@ -675,9 +672,6 @@ fn testnet_parachain_genesis(
phantom: Default::default(),
},
vesting: VestingConfig { vesting: vesting_list },
orml_nft: OrmlNftConfig {
tokens: Default::default(),
},
parachain_info: ParachainInfoConfig { parachain_id },
aura_ext: Default::default(),
duster: DusterConfig {
Expand Down
5 changes: 1 addition & 4 deletions node/src/testing_chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ use sp_core::{crypto::UncheckedInto, sr25519, Pair, Public};
use sp_runtime::traits::{IdentifyAccount, Verify};
use testing_basilisk_runtime::{
AccountId, AssetRegistryConfig, AuraId, Balance, BalancesConfig, CollatorSelectionConfig, CouncilConfig,
DusterConfig, ElectionsConfig, FaucetConfig, GenesisConfig, MultiTransactionPaymentConfig, OrmlNftConfig,
DusterConfig, ElectionsConfig, FaucetConfig, GenesisConfig, MultiTransactionPaymentConfig,
ParachainInfoConfig, SessionConfig, Signature, SudoConfig, SystemConfig, TechnicalCommitteeConfig, TokensConfig,
VestingConfig, NATIVE_EXISTENTIAL_DEPOSIT, UNITS, WASM_BINARY,
};
Expand Down Expand Up @@ -404,9 +404,6 @@ fn testnet_parachain_genesis(
phantom: Default::default(),
},
vesting: VestingConfig { vesting: vesting_list },
orml_nft: OrmlNftConfig {
tokens: Default::default(),
},
parachain_info: ParachainInfoConfig { parachain_id },
aura_ext: Default::default(),
duster: DusterConfig {
Expand Down
6 changes: 4 additions & 2 deletions pallets/nft/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ scale-info = { version = "1.0", default-features = false, features = ["derive"]
frame-benchmarking = { git = "/~https://github.com/paritytech/substrate", branch = "polkadot-v0.9.12", default-features = false, optional = true }
frame-support = { git = "/~https://github.com/paritytech/substrate", branch = "polkadot-v0.9.12", default-features = false }
frame-system = { git = "/~https://github.com/paritytech/substrate", branch = "polkadot-v0.9.12", default-features = false }
orml-nft = { git = "/~https://github.com/open-web3-stack/open-runtime-module-library", rev = "ee37b76a7a8cf159e6c41851942758746318bb84", default-features = false }
orml-utilities = { git = "/~https://github.com/open-web3-stack/open-runtime-module-library", rev = "ee37b76a7a8cf159e6c41851942758746318bb84", default-features = false }
pallet-uniques = { path = "../uniques", default-features = false }
serde = { version = "1.0.111", optional = true, features = ["derive"] }
sp-runtime = { git = "/~https://github.com/paritytech/substrate", branch = "polkadot-v0.9.12", default-features = false }
sp-arithmetic = { git = "/~https://github.com/paritytech/substrate", branch = "polkadot-v0.9.12", default-features = false }
sp-std = { git = "/~https://github.com/paritytech/substrate", branch = "polkadot-v0.9.12", default-features = false }

# local dependency
Expand All @@ -41,8 +42,9 @@ std = [
"frame-system/std",
"sp-std/std",
"sp-runtime/std",
"orml-nft/std",
"pallet-uniques/std",
"scale-info/std",

]
runtime-benchmarks = [
"frame-benchmarking",
Expand Down
Loading