Skip to content

Commit a04d35e

Browse files
committed
fix: marketplace quirk
Signed-off-by: Norman Meier <[email protected]>
1 parent 3a308e5 commit a04d35e

File tree

13 files changed

+383
-154
lines changed

13 files changed

+383
-154
lines changed

.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
INDEXER_NETWORK_ID=teritori-testnet
22
TERITORI_MINTER_CODE_IDS=10
33
TENDERMINT_WEBSOCKET_ENDPOINT=wss://rpc.testnet.teritori.com/websocket
4-
TERITORI_COLLECTION_WHITELIST=tori122qmagdhqxr00ldp5jax08zgdumahx4h03shcy4wn9ckchfzky5q3hdylc,tori1hzz0s0ucrhdp6tue2lxk3c03nj6f60qy463we7lgx0wudd72ctmstg4wkc,tori14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9s3hewys,0x43cc70bf324d716782628bed38af97e4afe92f69,0x916ad9d549907ccbbaf9ba65526826bfc3a9c0c4,tori162skshe30f43kv2q2rw6we2mu3pvz43lm2zrg4hq50jdd2fjjdjsvm8mc7,tori1zxzv4j9dxarfhxhkxm5cfnv06vy6g4l80adjwaq3dxdzmh5jm8rsrkzz65,tori18etjzrma5604af50jjklk3wlkqcsxdrvmy6jzw5naw2t7kyv4rys3kpwky,tori10z8um7u47e24rv68ghd43tspeztmqy3cc283gvc3pj48zxs5ljdqn84deq,tori1afwrcs58afaka6ltynevwcvq8zhejr3ssn703c0hky5emh890vzsry5wp5
4+
TERITORI_COLLECTION_WHITELIST=tori156edst4w2cjj2l7g6xezzs7hf2vpl25mrpagkgde85aj360pc22s48m2ff,tori1hzz0s0ucrhdp6tue2lxk3c03nj6f60qy463we7lgx0wudd72ctmstg4wkc,tori14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9s3hewys,0x43cc70bf324d716782628bed38af97e4afe92f69,0x916ad9d549907ccbbaf9ba65526826bfc3a9c0c4,tori162skshe30f43kv2q2rw6we2mu3pvz43lm2zrg4hq50jdd2fjjdjsvm8mc7,tori1zxzv4j9dxarfhxhkxm5cfnv06vy6g4l80adjwaq3dxdzmh5jm8rsrkzz65,tori18etjzrma5604af50jjklk3wlkqcsxdrvmy6jzw5naw2t7kyv4rys3kpwky,tori10z8um7u47e24rv68ghd43tspeztmqy3cc283gvc3pj48zxs5ljdqn84deq,tori1afwrcs58afaka6ltynevwcvq8zhejr3ssn703c0hky5emh890vzsry5wp5
55

66
PUBLIC_TENOR_KEY=AIzaSyA8TpVfoyoBaDdLww6wJ1Xe0OVN-Hi8qPE
77

cosmwasm-contracts/cw721-membership/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ cw-storage-plus = "1.1.0"
1717
thiserror = "1.0.44"
1818
cw721 = "0.18.0"
1919
cw721-metadata-onchain = { version = "0.15.0", features = ["library"] }
20-
cw2981-royalties = "0.18.0"
20+
cw2981-royalties = { version = "0.18.0", features = ["library"] }
2121
integer-encoding = "4.0.0"
2222
base64 = "0.21.7"
2323

cosmwasm-contracts/cw721-membership/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ ADMIN_ADDR=$(shell teritorid keys show $(ADMIN) --keyring-backend test --output
33
NODE_FLAG=--node https://rpc.testnet.teritori.com:443
44
TX_FLAGS=--from $(ADMIN) --chain-id teritori-test-6 $(NODE_FLAG) --gas auto --gas-adjustment 1.3 -y -b sync --output json --keyring-backend test -o json
55
QUERY_FLAGS=$(NODE_FLAG) -o json
6-
CODE_ID=53
6+
CODE_ID=58
77
CONFIG=$(shell cat config.json | jq --rawfile desc desc.txt -r '.admin_addr="$(ADMIN_ADDR)" | .description=$$desc | tojson | @sh')
88

99
# only informative
10-
CONTRACT_ADDRESS=tori122qmagdhqxr00ldp5jax08zgdumahx4h03shcy4wn9ckchfzky5q3hdylc
10+
CONTRACT_ADDRESS=tori156edst4w2cjj2l7g6xezzs7hf2vpl25mrpagkgde85aj360pc22s48m2ff
1111

1212
.PHONY: artifacts/cw721_membership.wasm
1313
artifacts/cw721_membership.wasm:

cosmwasm-contracts/cw721-membership/schema/cw721-membership.json

Lines changed: 96 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,50 @@
430430
}
431431
],
432432
"definitions": {
433+
"Cw2981BorkedQueryMsg": {
434+
"oneOf": [
435+
{
436+
"description": "Should be called on sale to see if royalties are owed by the marketplace selling the NFT, if CheckRoyalties returns true See https://eips.ethereum.org/EIPS/eip-2981",
437+
"type": "object",
438+
"required": [
439+
"RoyaltyInfo"
440+
],
441+
"properties": {
442+
"RoyaltyInfo": {
443+
"type": "object",
444+
"required": [
445+
"sale_price",
446+
"token_id"
447+
],
448+
"properties": {
449+
"sale_price": {
450+
"$ref": "#/definitions/Uint128"
451+
},
452+
"token_id": {
453+
"type": "string"
454+
}
455+
},
456+
"additionalProperties": false
457+
}
458+
},
459+
"additionalProperties": false
460+
},
461+
{
462+
"description": "Called against contract to determine if this NFT implements royalties. Should return a boolean as part of CheckRoyaltiesResponse - default can simply be true if royalties are implemented at token level (i.e. always check on sale)",
463+
"type": "object",
464+
"required": [
465+
"CheckRoyalties"
466+
],
467+
"properties": {
468+
"CheckRoyalties": {
469+
"type": "object",
470+
"additionalProperties": false
471+
}
472+
},
473+
"additionalProperties": false
474+
}
475+
]
476+
},
433477
"QueryMsg": {
434478
"oneOf": [
435479
{
@@ -523,39 +567,23 @@
523567
{
524568
"type": "object",
525569
"required": [
526-
"royalty_info"
570+
"extension"
527571
],
528572
"properties": {
529-
"royalty_info": {
573+
"extension": {
530574
"type": "object",
531575
"required": [
532-
"sale_price",
533-
"token_id"
576+
"msg"
534577
],
535578
"properties": {
536-
"sale_price": {
537-
"$ref": "#/definitions/Uint128"
538-
},
539-
"token_id": {
540-
"type": "string"
579+
"msg": {
580+
"$ref": "#/definitions/Cw2981BorkedQueryMsg"
541581
}
542582
}
543583
}
544584
},
545585
"additionalProperties": false
546586
},
547-
{
548-
"type": "object",
549-
"required": [
550-
"check_royalties"
551-
],
552-
"properties": {
553-
"check_royalties": {
554-
"type": "object"
555-
}
556-
},
557-
"additionalProperties": false
558-
},
559587
{
560588
"type": "object",
561589
"required": [
@@ -1164,21 +1192,6 @@
11641192
}
11651193
}
11661194
},
1167-
"check_royalties": {
1168-
"$schema": "http://json-schema.org/draft-07/schema#",
1169-
"title": "CheckRoyaltiesResponse",
1170-
"description": "Shows if the contract implements royalties if royalty_payments is true, marketplaces should pay them",
1171-
"type": "object",
1172-
"required": [
1173-
"royalty_payments"
1174-
],
1175-
"properties": {
1176-
"royalty_payments": {
1177-
"type": "boolean"
1178-
}
1179-
},
1180-
"additionalProperties": false
1181-
},
11821195
"config": {
11831196
"$schema": "http://json-schema.org/draft-07/schema#",
11841197
"title": "Config",
@@ -1239,6 +1252,53 @@
12391252
},
12401253
"additionalProperties": false
12411254
},
1255+
"extension": {
1256+
"$schema": "http://json-schema.org/draft-07/schema#",
1257+
"title": "Cw2981Response",
1258+
"anyOf": [
1259+
{
1260+
"$ref": "#/definitions/CheckRoyaltiesResponse"
1261+
},
1262+
{
1263+
"$ref": "#/definitions/RoyaltiesInfoResponse"
1264+
}
1265+
],
1266+
"definitions": {
1267+
"CheckRoyaltiesResponse": {
1268+
"description": "Shows if the contract implements royalties if royalty_payments is true, marketplaces should pay them",
1269+
"type": "object",
1270+
"required": [
1271+
"royalty_payments"
1272+
],
1273+
"properties": {
1274+
"royalty_payments": {
1275+
"type": "boolean"
1276+
}
1277+
},
1278+
"additionalProperties": false
1279+
},
1280+
"RoyaltiesInfoResponse": {
1281+
"type": "object",
1282+
"required": [
1283+
"address",
1284+
"royalty_amount"
1285+
],
1286+
"properties": {
1287+
"address": {
1288+
"type": "string"
1289+
},
1290+
"royalty_amount": {
1291+
"$ref": "#/definitions/Uint128"
1292+
}
1293+
},
1294+
"additionalProperties": false
1295+
},
1296+
"Uint128": {
1297+
"description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```",
1298+
"type": "string"
1299+
}
1300+
}
1301+
},
12421302
"nft_info": {
12431303
"$schema": "http://json-schema.org/draft-07/schema#",
12441304
"title": "NftInfoResponse_for_Metadata",
@@ -1474,30 +1534,6 @@
14741534
}
14751535
}
14761536
},
1477-
"royalty_info": {
1478-
"$schema": "http://json-schema.org/draft-07/schema#",
1479-
"title": "RoyaltiesInfoResponse",
1480-
"type": "object",
1481-
"required": [
1482-
"address",
1483-
"royalty_amount"
1484-
],
1485-
"properties": {
1486-
"address": {
1487-
"type": "string"
1488-
},
1489-
"royalty_amount": {
1490-
"$ref": "#/definitions/Uint128"
1491-
}
1492-
},
1493-
"additionalProperties": false,
1494-
"definitions": {
1495-
"Uint128": {
1496-
"description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```",
1497-
"type": "string"
1498-
}
1499-
}
1500-
},
15011537
"subscription": {
15021538
"$schema": "http://json-schema.org/draft-07/schema#",
15031539
"title": "SubscriptionResponse",

cosmwasm-contracts/cw721-membership/schema/raw/query.json

Lines changed: 49 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,50 @@
77
}
88
],
99
"definitions": {
10+
"Cw2981BorkedQueryMsg": {
11+
"oneOf": [
12+
{
13+
"description": "Should be called on sale to see if royalties are owed by the marketplace selling the NFT, if CheckRoyalties returns true See https://eips.ethereum.org/EIPS/eip-2981",
14+
"type": "object",
15+
"required": [
16+
"RoyaltyInfo"
17+
],
18+
"properties": {
19+
"RoyaltyInfo": {
20+
"type": "object",
21+
"required": [
22+
"sale_price",
23+
"token_id"
24+
],
25+
"properties": {
26+
"sale_price": {
27+
"$ref": "#/definitions/Uint128"
28+
},
29+
"token_id": {
30+
"type": "string"
31+
}
32+
},
33+
"additionalProperties": false
34+
}
35+
},
36+
"additionalProperties": false
37+
},
38+
{
39+
"description": "Called against contract to determine if this NFT implements royalties. Should return a boolean as part of CheckRoyaltiesResponse - default can simply be true if royalties are implemented at token level (i.e. always check on sale)",
40+
"type": "object",
41+
"required": [
42+
"CheckRoyalties"
43+
],
44+
"properties": {
45+
"CheckRoyalties": {
46+
"type": "object",
47+
"additionalProperties": false
48+
}
49+
},
50+
"additionalProperties": false
51+
}
52+
]
53+
},
1054
"QueryMsg": {
1155
"oneOf": [
1256
{
@@ -100,39 +144,23 @@
100144
{
101145
"type": "object",
102146
"required": [
103-
"royalty_info"
147+
"extension"
104148
],
105149
"properties": {
106-
"royalty_info": {
150+
"extension": {
107151
"type": "object",
108152
"required": [
109-
"sale_price",
110-
"token_id"
153+
"msg"
111154
],
112155
"properties": {
113-
"sale_price": {
114-
"$ref": "#/definitions/Uint128"
115-
},
116-
"token_id": {
117-
"type": "string"
156+
"msg": {
157+
"$ref": "#/definitions/Cw2981BorkedQueryMsg"
118158
}
119159
}
120160
}
121161
},
122162
"additionalProperties": false
123163
},
124-
{
125-
"type": "object",
126-
"required": [
127-
"check_royalties"
128-
],
129-
"properties": {
130-
"check_royalties": {
131-
"type": "object"
132-
}
133-
},
134-
"additionalProperties": false
135-
},
136164
{
137165
"type": "object",
138166
"required": [
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"title": "Cw2981Response",
4+
"anyOf": [
5+
{
6+
"$ref": "#/definitions/CheckRoyaltiesResponse"
7+
},
8+
{
9+
"$ref": "#/definitions/RoyaltiesInfoResponse"
10+
}
11+
],
12+
"definitions": {
13+
"CheckRoyaltiesResponse": {
14+
"description": "Shows if the contract implements royalties if royalty_payments is true, marketplaces should pay them",
15+
"type": "object",
16+
"required": [
17+
"royalty_payments"
18+
],
19+
"properties": {
20+
"royalty_payments": {
21+
"type": "boolean"
22+
}
23+
},
24+
"additionalProperties": false
25+
},
26+
"RoyaltiesInfoResponse": {
27+
"type": "object",
28+
"required": [
29+
"address",
30+
"royalty_amount"
31+
],
32+
"properties": {
33+
"address": {
34+
"type": "string"
35+
},
36+
"royalty_amount": {
37+
"$ref": "#/definitions/Uint128"
38+
}
39+
},
40+
"additionalProperties": false
41+
},
42+
"Uint128": {
43+
"description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```",
44+
"type": "string"
45+
}
46+
}
47+
}

0 commit comments

Comments
 (0)