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

Ft/market mint for #23

Open
wants to merge 498 commits into
base: develop
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
498 commits
Select commit Hold shift + click to select a range
8925b76
update royalty offering & vrfdkg
ducphamle2 Oct 4, 2021
0f1cee5
update vrf dkg
ducphamle2 Oct 5, 2021
136ee39
update vrf flow
piggy2303 Oct 5, 2021
74c8fda
update pagination queries for storage
piggy2303 Oct 6, 2021
faa2dd4
update vrf health check & vrf dkg
piggy2303 Oct 6, 2021
e2c1c82
add gen typescript from schema
piggy2303 Oct 7, 2021
e9f4cf9
fix schema
piggy2303 Oct 7, 2021
372b340
update ai royalty storage & vrf check health
piggy2303 Oct 7, 2021
0ffa12b
add try catch
piggy2303 Oct 7, 2021
953a923
update env test
piggy2303 Oct 7, 2021
bd3c51b
update auction & add decay creator royalty
piggy2303 Oct 8, 2021
f3d8d30
update first lv royalty to work with ow1155
piggy2303 Oct 9, 2021
953cb22
revert first level royalty
piggy2303 Oct 10, 2021
386f6a6
update readme
piggy2303 Oct 11, 2021
d353740
add verify round & check auction buyout
piggy2303 Oct 11, 2021
99b9e6c
update vrf
piggy2303 Oct 11, 2021
3d34c5b
update build vrf
piggy2303 Oct 11, 2021
08cb01c
update build vrf
piggy2303 Oct 11, 2021
5eddd87
add config prod & testnet
piggy2303 Oct 11, 2021
6da01d0
update gitignore and ping interval
piggy2303 Oct 11, 2021
b2895fc
add attr action for execute requests
piggy2303 Oct 11, 2021
41c28dd
refractor blsdkg_js
piggy2303 Oct 12, 2021
fa76deb
update royalty percent to decimal & blsdkg client
piggy2303 Oct 12, 2021
0a2f800
update contract prod & add logs
piggy2303 Oct 12, 2021
2d92bc7
add test send gift & update max royalty marketplace
piggy2303 Oct 15, 2021
cffacdb
uncomment add ping blsdkg
piggy2303 Oct 15, 2021
0d5adbc
update market datahub prevent mint more
piggy2303 Oct 18, 2021
5a4fb72
remove old smart contracts
piggy2303 Oct 19, 2021
32ae1ae
init 1155 marketplace for airight
piggy2303 Oct 19, 2021
e105ffc
update query marketplace & allow change creator 1155 datahub
piggy2303 Oct 20, 2021
7842c8b
update sell & buy 1155
piggy2303 Oct 20, 2021
6ade645
update test royalty 1155
piggy2303 Oct 20, 2021
d4eb289
add auction 1155
piggy2303 Oct 21, 2021
87bebe5
add value to co owners when mint
thinb-orai Oct 22, 2021
fce90b5
update send valey to co-owner when mint
thinb-orai Oct 22, 2021
6b77b68
update send valey to co-owner when mint
thinb-orai Oct 22, 2021
06b431b
update market 1155 auction and add attr royalty
piggy2303 Oct 22, 2021
105c8a6
add test case for claim winner 1155 market
piggy2303 Oct 23, 2021
9ad57a7
add test cases market 1155 bid nft
piggy2303 Oct 25, 2021
eece1d8
fix bug 1155 implementation
piggy2303 Oct 25, 2021
50d48dc
update generic query storage 1155 market
piggy2303 Oct 25, 2021
39e8000
refactor market base query
piggy2303 Oct 25, 2021
00c6d65
update default auction time to timestamp & fix max fee
piggy2303 Oct 26, 2021
2f5325e
refactor datahub market sell
thinb-orai Oct 26, 2021
1890095
remove approve transaction in datahub market sell
thinb-orai Oct 26, 2021
9b12a92
fix bid nft add per price
piggy2303 Oct 26, 2021
ca23470
Merge pull request #1 from oraichain/feature/send-to-coowner-when-mint
ducphamle2 Oct 26, 2021
662e53e
change request_annotation: not change nft to market anymore, allow ma…
thinb-orai Oct 27, 2021
2573bfd
Merge pull request #2 from oraichain/feature/refactor-request-annotation
ducphamle2 Oct 27, 2021
02a06fe
init market multiple creator template
piggy2303 Oct 27, 2021
a7919b4
Merge branch 'master' of https://github.com/oraichain/oraiwasm
piggy2303 Oct 27, 2021
71dc01d
add multisig wallet
tubackkhoa Oct 27, 2021
66fc71a
add multisig wallet
tubackkhoa Oct 27, 2021
a66fd88
update market multiple creators
piggy2303 Oct 27, 2021
8c7ce67
fix empty cosmos msg market multiple creator
piggy2303 Oct 27, 2021
f0bca22
Merge branch 'master' of https://github.com/oraichain/oraiwasm
piggy2303 Oct 27, 2021
cae7401
update multi creator template & 1155 impl verify sell auction
piggy2303 Oct 28, 2021
054e517
optimize multi creator & fix seller (asker) 1155 implementation
piggy2303 Oct 28, 2021
0031c1b
bulk create annotation job
thinb-orai Oct 29, 2021
9b2edab
update optimize to install binaryen
hanhph-orai Oct 29, 2021
18484e8
add approval storage
piggy2303 Oct 29, 2021
9607a89
Merge pull request #3 from oraichain/feature/bulk-create-annotation-job
ducphamle2 Oct 29, 2021
b0cb04a
Merge branch 'master' of https://github.com/oraichain/oraiwasm
piggy2303 Oct 29, 2021
9d3aded
resolve conflict
hanhph-orai Oct 29, 2021
70741e1
Merge branch 'master' of https://github.com/oraichain/oraiwasm
hanhph-orai Oct 29, 2021
40bad22
update flex multisig
tubackkhoa Nov 1, 2021
5f6ee19
Merge branch 'master' of https://github.com/oraichain/oraiwasm
tubackkhoa Nov 1, 2021
9f3cbcc
add docs
tubackkhoa Nov 1, 2021
b0d9a20
update doc for vrfdkg
tubackkhoa Nov 1, 2021
cb9843e
update doc for vrfdkg
tubackkhoa Nov 1, 2021
adfc364
update doc for vrfdkg
tubackkhoa Nov 1, 2021
053d43e
update doc for vrfdkg
tubackkhoa Nov 1, 2021
493dbd9
update doc for vrfdkg
tubackkhoa Nov 1, 2021
2e49f6b
update doc for vrfdkg
tubackkhoa Nov 1, 2021
d76db88
update blacklist 1155
piggy2303 Nov 1, 2021
d366727
Merge branch 'master' of https://github.com/oraichain/oraiwasm
piggy2303 Nov 1, 2021
e109cf2
add more rights to owner nft 721 & 1155
piggy2303 Nov 1, 2021
835733a
add whitelist storage for nft
piggy2303 Nov 1, 2021
2d9f775
add test cases whitelist storage
piggy2303 Nov 2, 2021
6ef5079
update rejected storage remove owner
piggy2303 Nov 2, 2021
93945f7
add filter whitelist market 1155
piggy2303 Nov 2, 2021
9012b54
add event royalty market 1155
piggy2303 Nov 2, 2021
0307653
refactor pay royalties 1155 market
piggy2303 Nov 2, 2021
d5a77b4
change minter to same format 721
piggy2303 Nov 2, 2021
b79dc0d
update event royalties
piggy2303 Nov 3, 2021
d0eb232
refactor pay royalties 1155 market
piggy2303 Nov 4, 2021
b2b9a2b
Add transfer nft directly to market 1155 implementation
vjtc0n Nov 4, 2021
13e0b6b
Remove unused code
vjtc0n Nov 5, 2021
e4e920f
add change owner cw1155
piggy2303 Nov 5, 2021
201522d
change event change owner
piggy2303 Nov 5, 2021
4a224c9
update market datahub implementation
thinb-orai Nov 10, 2021
f0ebd38
annotation results
thinb-orai Nov 19, 2021
3a0270d
migrate aioracle, refactor market impl, update admin 1155 & add edit …
ducphamle2 Nov 22, 2021
2c3636c
udpate annotation review
thinb-orai Nov 22, 2021
7ddb08a
udpate annotation payout logic
thinb-orai Nov 23, 2021
e812924
Merge branch 'master' of https://github.com/oraichain/oraiwasm
piggy2303 Nov 23, 2021
80bc0d6
update vrf signed signature
piggy2303 Nov 23, 2021
d552ec3
update blsdkg
piggy2303 Nov 25, 2021
022147b
datahub-market-implementation: upload reward
thinb-orai Nov 25, 2021
5f3ff06
update signed eth signature format
piggy2303 Nov 30, 2021
022e9c3
update sign signature
piggy2303 Dec 1, 2021
a6376c2
update blsdkg js new version
piggy2303 Dec 2, 2021
954cf9a
add script to get eth address from a list
piggy2303 Dec 2, 2021
079b26c
add spawn exe file
piggy2303 Dec 6, 2021
8851b60
add download link vrf runner
piggy2303 Dec 6, 2021
5bdf828
update
thinb-orai Dec 14, 2021
653edf9
update
thinb-orai Dec 14, 2021
e6784c8
update
piggy2303 Dec 15, 2021
ef47f2b
udpate airight market
thinb-orai Dec 15, 2021
7b808d8
udpate datahub implementation
thinb-orai Dec 15, 2021
2947b89
Merge pull request #5 from oraichain/feature/update-datahub-implement…
ducphamle2 Dec 15, 2021
9cc91a0
Co-authored-by: Pham Thanh Tu <tubackkhoa@gmail.com>
ducphamle2 Dec 15, 2021
05a1f24
update package
piggy2303 Dec 16, 2021
432eaed
remove leveldb
piggy2303 Dec 16, 2021
2d7d281
Merge branch 'feature/update-airight-market' of https://github.com/or…
ducphamle2 Dec 21, 2021
12244cd
update market impl for 721
ducphamle2 Dec 21, 2021
d9a2b0c
add test functions for backward comp market
ducphamle2 Dec 21, 2021
1796626
update market impl airight & add vrf solana
ducphamle2 Dec 26, 2021
0bbcd60
Merge pull request #4 from oraichain/feature/update-airight-market
ducphamle2 Dec 26, 2021
4544e5d
update solana bridge
ducphamle2 Dec 28, 2021
fb7a8c1
add solana list & update market impl
ducphamle2 Dec 28, 2021
b929f96
update royalty formula & add approve 721 market
ducphamle2 Dec 30, 2021
b00da66
Merge pull request #6 from oraichain/feature/update-airight-market
ducphamle2 Jan 4, 2022
6e32742
finish aioracle v2 with pricefeed demo
ducphamle2 Jan 5, 2022
d7f7d0e
refactor price scripts
ducphamle2 Feb 8, 2022
0a11d36
remove redundant code oscript price
ducphamle2 Feb 8, 2022
86b1639
airight nft staking
thinb-orai Feb 8, 2022
71acdec
init oscript & tcase flower classification
ducphamle2 Feb 8, 2022
6010037
airight nft staking: create collection pool info
thinb-orai Feb 9, 2022
02e548f
update testcase flower classification flow
ducphamle2 Feb 10, 2022
7b71a96
airight nft staking: update
thinb-orai Feb 10, 2022
d591d6a
add query service fees
ducphamle2 Feb 11, 2022
1aa8954
airight nft staking: testing
thinb-orai Feb 11, 2022
a60cab8
airight nft staking: withdraw and claim
thi-nb Feb 13, 2022
bc884ec
airight nft staking: testing for claim and withdraw
thinb-orai Feb 14, 2022
9ec91e7
airight nft staking: testing for claim and withdraw
thinb-orai Feb 14, 2022
c8f2b2d
airight nft staking: allow admin to reset total earned
thinb-orai Feb 15, 2022
4c90d36
airight nft staking: allow admin to reset total earned
thinb-orai Feb 15, 2022
ec402c7
add manual update checkpoint when needed
ducphamle2 Feb 17, 2022
a5d6e47
set expired block to collection pool and allow user to choose withdra…
thinb-orai Feb 18, 2022
7a48f5b
get mutiple collection pool infos
thinb-orai Feb 18, 2022
b14a74a
airight nft staking: get real acc_per_share when query get collection…
thi-nb Feb 20, 2022
9db931f
update
thinb-orai Feb 22, 2022
0f6e1bf
fix runtime error
thi-nb Feb 22, 2022
224df7f
nft_staking: whitelist for ow1155 and ow721
thi-nb Feb 27, 2022
73c6f1a
nft_staking: update admin
thinb-orai Feb 28, 2022
28daa77
Merge pull request #7 from oraichain/feature/airight-nft-staking
ducphamle2 Feb 28, 2022
8409b5c
add migrate ow1155
ducphamle2 Mar 2, 2022
dc6b5a1
Merge branch 'update/aioracle-v2-serivces' of https://github.com/orai…
ducphamle2 Mar 2, 2022
a92d34d
add migrate msg ow1155
ducphamle2 Mar 3, 2022
5ef10bd
fix executor structure
ducphamle2 Mar 4, 2022
94a8e8d
update executor claim rewards
ducphamle2 Mar 8, 2022
d0e896a
add trusting pool mechanism & fix query fee bug aioracle
ducphamle2 Mar 8, 2022
d19bac7
add query maximum executor fee
ducphamle2 Mar 9, 2022
1839c69
rename reward pool & add pool response data
ducphamle2 Mar 9, 2022
d199dc6
rework trusting pool
ducphamle2 Mar 9, 2022
f977366
add new aioracle health check & update executor fee scheme
ducphamle2 Mar 11, 2022
01087e5
fix empty sent funds bug
ducphamle2 Mar 18, 2022
fea054e
fix default executor fee
ducphamle2 Mar 18, 2022
6b00cdb
update checkpoint & interval aioracle ping
ducphamle2 Mar 21, 2022
650c05f
update query executor response
ducphamle2 Mar 22, 2022
8f1ce2a
update claim reward scheme ping
ducphamle2 Mar 23, 2022
cfa1091
clean aioracle dir remove old code
ducphamle2 Mar 24, 2022
e1bbef9
update index for executors
ducphamle2 Mar 25, 2022
714515f
add test case for new executor struct
ducphamle2 Mar 27, 2022
a1208e2
update executor query & fix health check
ducphamle2 Mar 28, 2022
5aca7bd
temp finish market 721 impl support dif currency
ducphamle2 Apr 6, 2022
d6e4235
fix token id & royalty event format
ducphamle2 Apr 7, 2022
eb17101
add max decimal point market impl
ducphamle2 Apr 7, 2022
e6cfe83
add migrate marketplace, update 1155 market & fix some bugs
ducphamle2 Apr 7, 2022
0d268e9
update test cases market 1155
ducphamle2 Apr 8, 2022
a6aa17f
comment test case & add new chain
ducphamle2 Apr 12, 2022
6f5be67
add snake slash for amount event royalty
ducphamle2 Apr 13, 2022
2d08517
update new vrf contract testnet
piggy2303 Apr 14, 2022
2be55fd
Merge branch 'master' of https://github.com/oraichain/oraiwasm
piggy2303 Apr 14, 2022
ff1a361
add market payment storage
ducphamle2 Apr 15, 2022
1192339
fix payment storage & finish market 721 impl
ducphamle2 Apr 15, 2022
8c5a2ca
finish market payment storage
ducphamle2 Apr 15, 2022
da34cf8
update default denom market payment
ducphamle2 Apr 15, 2022
52eac42
fix payment 1155 bug & add query ranges
ducphamle2 Apr 15, 2022
dfb9c03
fix parse payment key market payment storage
ducphamle2 Apr 18, 2022
bd21cfa
update aioracle health check
ducphamle2 Apr 26, 2022
d93028f
add prev owner in royalty list
ducphamle2 Apr 27, 2022
8194ece
fix prev royalty bug
ducphamle2 Apr 27, 2022
240016a
Merge pull request #8 from oraichain/update/airight-marketplace
ducphamle2 May 4, 2022
8c390c1
Merge pull request #9 from oraichain/update/aioracle-v2-serivces
ducphamle2 May 4, 2022
cc948c8
ow20 multi transfer
duyhung2201 May 5, 2022
66420a2
update ow20 contract migration
ducphamle2 May 9, 2022
bc51ff3
refactor code, add join & leave executor
ducphamle2 May 9, 2022
cf9459d
downgrade edition cargo to 2018
ducphamle2 May 10, 2022
2c612e3
Update function and testcase for ai executor join and leave
duongtd1998 May 13, 2022
5c6e2af
refactor & add contract fees
ducphamle2 May 16, 2022
2e13140
Merge branch 'update/refactor-aioracle' of https://github.com/oraicha…
ducphamle2 May 16, 2022
65be10b
uncomment migrate func & add init contract fee
ducphamle2 May 16, 2022
6642e3c
fix unique constraint bug index
ducphamle2 May 16, 2022
e7a2ff8
Merge branch 'update/refactor-aioracle'
ducphamle2 May 16, 2022
ae3344f
Update msg migrate contract on ide
duongtd1998 May 18, 2022
cd4b414
Add market fee query and test case for it
duongtd1998 May 19, 2022
277b7b3
Update market fee variable when testing
duongtd1998 May 19, 2022
585fe42
refactor check funds
ducphamle2 May 20, 2022
03f5337
Refactor funds param on try_buy and try_bid market 1155
duongtd1998 May 20, 2022
9b8173e
Merge pull request #10 from oraichain/feat/AddMarketFeeQuery
ducphamle2 May 24, 2022
7a040d2
update init market fee when migrate
ducphamle2 May 24, 2022
5cf02ea
ow20 merkle airdrop
duyhung2201 May 25, 2022
44ae165
ow20-merkle-airdrop
duyhung2201 May 26, 2022
29fcee2
update tutorial link
hoangdv2429 May 28, 2022
9e15ed1
update cosmwasm docker & market airight
ducphamle2 May 29, 2022
59386eb
Merge branch 'master' of https://github.com/oraichain/oraiwasm
ducphamle2 May 29, 2022
9f36944
fix owner to null bug update config merkle airdrop
ducphamle2 May 29, 2022
7bc1bcd
Merge pull request #11 from hoangdv2429/master
ducphamle2 May 31, 2022
1e96e2b
merkle airdrop stage metadata
duyhung2201 Jun 7, 2022
376464d
update ow20 merkle airdrop
ducphamle2 Jun 7, 2022
bb68db0
update merkle airdrop & add basic oscript
ducphamle2 Jun 11, 2022
34efea9
fix executor join bug
ducphamle2 Jul 4, 2022
a1bbde5
Create .gitpod.yml
ducphamle2 Aug 3, 2022
ecb0a27
Update .gitpod.yml
ducphamle2 Aug 5, 2022
89c5e4d
fix: change ge to gt for try-payout
im6h Aug 9, 2022
4da2e38
fix: allow reviewer update their result that commited
im6h Aug 9, 2022
aa0ae15
update review result
tuanorai Aug 9, 2022
da78f12
update optimize
tubackkhoa Aug 15, 2022
1b0f42d
Update validate transfer nft direct & test
duongtd1998 Aug 18, 2022
409336e
Merge pull request #12 from oraichain/fix/market-datahub-trypayout
im6h Aug 18, 2022
063c335
add change minter cw20
ducphamle2 Aug 22, 2022
b883f82
Merge pull request #14 from oraichain/feat/change-minter-cw20
ducphamle2 Aug 22, 2022
ce84f97
merkle airdrop query claim keys
duyhung2201 Jul 16, 2022
69fc37f
airdrop: get claim key count
duyhung2201 Jul 16, 2022
9b5d449
airdrop: update claim
duyhung2201 Jul 16, 2022
97e8c98
Merge pull request #13 from oraichain/feature/merkle-airdrop
ducphamle2 Aug 23, 2022
e4af31b
fix: data invalid type when parse string input
im6h Aug 28, 2022
bb0a760
dino ai market basic logic smc + test
tuanorai Sep 18, 2022
a854354
fix: remove redundant dangerous code from ow20
ducphamle2 Sep 20, 2022
5d545b5
fix: remove send native
ducphamle2 Sep 20, 2022
8126758
Merge pull request #16 from oraichain/duc/fix-cw20-bug
ducphamle2 Sep 20, 2022
ed76777
optimize market_datahub_ai_marketplace contract
tubackkhoa Sep 23, 2022
4b115ce
update: refactor sign sig data field
ducphamle2 Oct 12, 2022
750471c
Merge pull request #19 from oraichain/duc/refactor-vrfjs
ducphamle2 Oct 13, 2022
08180b8
Merge pull request #17 from oraichain/feature/dino-ai-market
tubackkhoa Oct 14, 2022
18db978
Merge pull request #15 from oraichain/fix/oscript_flower_classisifcation
tubackkhoa Oct 14, 2022
b2fad66
fixed human addr unwrap or error market impl
ducphamle2 Jan 19, 2023
c30f1d9
fixed empty key error prev owner market impl
ducphamle2 Jan 19, 2023
6ce37fc
add: market1155 mintfor; remove: warning
meomeocoj Aug 1, 2023
5ed3df0
add: update and query admin market_1155_implementation
meomeocoj Aug 7, 2023
89b4a33
add: BuyMsg params buyer
meomeocoj Aug 7, 2023
3f6300a
update schema
tubackkhoa Aug 7, 2023
8e94f2f
update schema
tubackkhoa Aug 7, 2023
b284338
add: Pulling state from on-chain, add test mint_for, buy_for
meomeocoj Aug 9, 2023
99126aa
merge: conflict
meomeocoj Aug 9, 2023
a1e3ee4
update: test pull code from chain
meomeocoj Aug 10, 2023
e4780a8
add: test:ci, complete:test market_buy_for
meomeocoj Aug 10, 2023
7f9710e
update script
meomeocoj Sep 3, 2023
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
Prev Previous commit
Next Next commit
init 1155 marketplace for airight
  • Loading branch information
piggy2303 committed Oct 19, 2021
commit 32ae1ae2d05a2a5b2f4a3f49e781b1b0bc6683c5
3 changes: 3 additions & 0 deletions package/base/cw1155/src/query.rs
Original file line number Diff line number Diff line change
@@ -60,6 +60,9 @@ pub enum Cw1155QueryMsg {
start_after: Option<String>,
limit: Option<u32>,
},
Creator {
token_id: TokenId,
},
}

#[derive(Serialize, Deserialize, Clone, PartialEq, JsonSchema, Debug)]
4 changes: 4 additions & 0 deletions package/base/market_1155/.cargo/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[alias]
wasm = "build --release --target wasm32-unknown-unknown"
wasm-debug = "build --target wasm32-unknown-unknown"
schema = "run --example schema"
18 changes: 18 additions & 0 deletions package/base/market_1155/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[package]
name = "market_1155"
version = "0.6.0"
authors = ["ThanhTu <tu@orai.io>"]
edition = "2018"
description = "Implementation of an NFT marketplace proxy contract using a governance"
repository = "https://github.com/oraichain/oraiwasm"
homepage = "https://orai.io"

[dependencies]
cosmwasm-std = { version = "0.13.2" }
schemars = "0.7"
market = { path = "../../base/market" }
serde = { version = "1.0.103", default-features = false, features = ["derive"] }


[dev-dependencies]
cosmwasm-schema = { version = "0.13.2" }
14 changes: 14 additions & 0 deletions package/base/market_1155/NOTICE
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
CW721: A CosmWasm spec for non-fungible token contracts
Copyright (C) 2020 Confio OÜ

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.
122 changes: 122 additions & 0 deletions package/base/market_1155/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
# CW721 Spec: Non Fungible Tokens

CW721 is a specification for non-fungible tokens based on CosmWasm.
The name and design is based on Ethereum's ERC721 standard,
with some enhancements. The types in here can be imported by
contracts that wish to implement this spec, or by contracts that call
to any standard cw721 contract.

The specification is split into multiple sections, a contract may only
implement some of this functionality, but must implement the base.

## Base

This handles ownership, transfers, and allowances. These must be supported
as is by all CW721 contracts. Note that all tokens must have an owner,
as well as an ID. The ID is an arbitrary string, unique within the contract.

### Messages

`TransferNft{recipient, token_id}` -
This transfers ownership of the token to `recipient` account. This is
designed to send to an address controlled by a private key and *does not*
trigger any actions on the recipient if it is a contract.

Requires `token_id` to point to a valid token, and `env.sender` to be
the owner of it, or have an allowance to transfer it.

`SendNft{contract, token_id, msg}` -
This transfers ownership of the token to `contract` account. `contract`
must be an address controlled by a smart contract, which implements
the CW721Receiver interface. The `msg` will be passed to the recipient
contract, along with the token_id.

Requires `token_id` to point to a valid token, and `env.sender` to be
the owner of it, or have an allowance to transfer it.

`Approve{spender, token_id, expires}` - Grants permission to `spender` to
transfer or send the given token. This can only be performed when
`env.sender` is the owner of the given `token_id` or an `operator`.
There can multiple spender accounts per token, and they are cleared once
the token is transfered or sent.

`Revoke{spender, token_id}` - This revokes a previously granted permission
to transfer the given `token_id`. This can only be granted when
`env.sender` is the owner of the given `token_id` or an `operator`.

`ApproveAll{operator, expires}` - Grant `operator` permission to transfer or send
all tokens owned by `env.sender`. This approval is tied to the owner, not the
tokens and applies to any future token that the owner receives as well.

`RevokeAll{operator}` - Revoke a previous `ApproveAll` permission granted
to the given `operator`.

### Queries

`OwnerOf{token_id}` - Returns the owner of the given token,
as well as anyone with approval on this particular token.
If the token is unknown, returns an error. Return type is
`OwnerResponse{owner}`.

`ApprovedForAll{owner, include_expired}` - List all operators that can
access all of the owner's tokens. Return type is `ApprovedForAllResponse`.
If `include_expired` is set, show expired owners in the results, otherwise,
ignore them.

`NumTokens{}` - Total number of tokens issued

### Receiver

The counter-part to `SendNft` is `ReceiveNft`, which must be implemented by
any contract that wishes to manage CW721 tokens. This is generally *not*
implemented by any CW721 contract.

`ReceiveNft{sender, token_id, msg}` - This is designed to handle `SendNft`
messages. The address of the contract is stored in `env.sender`
so it cannot be faked. The contract should ensure the sender matches
the token contract it expects to handle, and not allow arbitrary addresses.

The `sender` is the original account requesting to move the token
and `msg` is a `Binary` data that can be decoded into a contract-specific
message. This can be empty if we have only one default action,
or it may be a `ReceiveMsg` variant to clarify the intention. For example,
if I send to an exchange, I can specify the price I want to list the token
for.

## Metadata

### Queries

`ContractInfo{}` - This returns top-level metadata about the contract.
Namely, `name` and `symbol`.

`NftInfo{token_id}` - This returns metadata about one particular token.
The return value is based on *ERC721 Metadata JSON Schema*, but directly
from the contract, not as a Uri. Only the image link is a Uri.

`AllNftInfo{token_id}` - This returns the result of both `NftInfo`
and `OwnerOf` as one query as an optimization for clients, which may
want both info to display one NFT.

## Enumerable

### Queries

Pagination is acheived via `start_after` and `limit`. Limit is a request
set by the client, if unset, the contract will automatically set it to
`DefaultLimit` (suggested 10). If set, it will be used up to a `MaxLimit`
value (suggested 30). Contracts can define other `DefaultLimit` and `MaxLimit`
values without violating the CW721 spec, and clients should not rely on
any particular values.

If `start_after` is unset, the query returns the first results, ordered by
lexogaphically by `token_id`. If `start_after` is set, then it returns the
first `limit` tokens *after* the given one. This allows straight-forward
pagination by taking the last result returned (a `token_id`) and using it
as the `start_after` value in a future query.

`Tokens{owner, start_after, limit}` - List all token_ids that belong to a given owner.
Return type is `TokensResponse{tokens: Vec<token_id>}`.

`AllTokens{start_after, limit}` - Requires pagination. Lists all token_ids controlled by
the contract.
17 changes: 17 additions & 0 deletions package/base/market_1155/examples/schema.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
use std::env::current_dir;
use std::fs::create_dir_all;

use cosmwasm_schema::{export_schema, remove_schemas, schema_for};

use market_1155::{MarketHandleMsg, MarketQueryMsg, Offering};

fn main() {
let mut out_dir = current_dir().unwrap();
out_dir.push("schema");
create_dir_all(&out_dir).unwrap();
remove_schemas(&out_dir).unwrap();

export_schema(&schema_for!(Offering), &out_dir);
export_schema(&schema_for!(MarketHandleMsg), &out_dir);
export_schema(&schema_for!(MarketQueryMsg), &out_dir);
}
6 changes: 6 additions & 0 deletions package/base/market_1155/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
mod msg;
mod query;

pub use crate::msg::*;
pub use crate::query::*;
pub use market::*;
46 changes: 46 additions & 0 deletions package/base/market_1155/src/msg.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
use cosmwasm_std::{HumanAddr, Uint128};

use schemars::JsonSchema;
use serde::{Deserialize, Serialize};

#[derive(Serialize, Deserialize, Clone, PartialEq, JsonSchema, Debug)]
pub struct Offering {
pub id: Option<u64>,
pub token_id: String,
pub contract_addr: HumanAddr,
pub seller: HumanAddr,
pub per_price: Uint128,
pub amount: Uint128,
}

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub struct MintMsg {
pub contract_addr: HumanAddr,
pub creator: HumanAddr,
pub creator_type: String,
pub royalty: Option<u64>,
pub mint: MintIntermediate,
}

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub struct MintIntermediate {
pub mint: MintStruct,
}

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub struct MintStruct {
pub to: String,
pub token_id: String,
pub value: Uint128,
}

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum MarketHandleMsg {
// this allow implementation contract to update the storage
UpdateOffering { offering: Offering },
RemoveOffering { id: u64 },
}
36 changes: 36 additions & 0 deletions package/base/market_1155/src/query.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
use cosmwasm_std::HumanAddr;

use schemars::JsonSchema;
use serde::{Deserialize, Serialize};

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum MarketQueryMsg {
// GetOfferings returns a list of all offerings
GetOfferings {
offset: Option<u64>,
limit: Option<u8>,
order: Option<u8>,
},
GetOfferingsBySeller {
seller: HumanAddr,
offset: Option<u64>,
limit: Option<u8>,
order: Option<u8>,
},
GetOfferingsByContract {
contract: HumanAddr,
offset: Option<u64>,
limit: Option<u8>,
order: Option<u8>,
},
GetOffering {
offering_id: u64,
},
GetUniqueOffering {
contract: HumanAddr,
token_id: String,
seller: HumanAddr,
},
GetContractInfo {},
}
50 changes: 50 additions & 0 deletions package/plus/market_1155_implementation/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
[package]
name = "market_1155_implementation"
version = "0.1.0"
authors = ["oraichain <tu@orai.io>"]
edition = "2018"

exclude = [
# Those files are rust-optimizer artifacts. You might want to commit them for convenience but they should not be part of the source code publication.
"contract.wasm",
"hash.txt",
]

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[lib]
crate-type = ["cdylib", "rlib"]

[profile.release]
opt-level = 3
debug = false
rpath = false
lto = true
debug-assertions = false
codegen-units = 1
panic = 'abort'
incremental = false
overflow-checks = true

[features]
# for more explicit tests, cargo test --features=backtraces
backtraces = ["cosmwasm-std/backtraces"]

[dependencies]
cosmwasm-std = { version = "0.13.2" }
cw-storage-plus = { version = "0.5.0", features = ["iterator"] }
cosmwasm-storage = { version = "0.13.2", features = ["iterator"] }
cw1155 = { path = "../../base/cw1155" }
market_1155 = { path = "../../base/market_1155" }
market = { path = "../../base/market" }
schemars = "0.7"
serde = { version = "1.0.103", default-features = false, features = ["derive"] }
thiserror = { version = "1.0.21" }
market_ai_royalty = { path = "../../base/market_ai_royalty" }

[dev-dependencies]
cosmwasm-schema = { version = "0.13.2" }
market_hub = { path = "../market_hub" }
market_ai_royalty_storage = { path = "../market_ai_royalty_storage" }
market_1155_storage = { path = "../market_1155_storage" }
ow1155 = { path = "../ow1155" }
Loading