Skip to content

Commit

Permalink
fix: marketplace quirk
Browse files Browse the repository at this point in the history
Signed-off-by: Norman Meier <[email protected]>
  • Loading branch information
n0izn0iz committed Feb 21, 2024
1 parent 3a308e5 commit a04d35e
Show file tree
Hide file tree
Showing 13 changed files with 383 additions and 154 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
INDEXER_NETWORK_ID=teritori-testnet
TERITORI_MINTER_CODE_IDS=10
TENDERMINT_WEBSOCKET_ENDPOINT=wss://rpc.testnet.teritori.com/websocket
TERITORI_COLLECTION_WHITELIST=tori122qmagdhqxr00ldp5jax08zgdumahx4h03shcy4wn9ckchfzky5q3hdylc,tori1hzz0s0ucrhdp6tue2lxk3c03nj6f60qy463we7lgx0wudd72ctmstg4wkc,tori14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9s3hewys,0x43cc70bf324d716782628bed38af97e4afe92f69,0x916ad9d549907ccbbaf9ba65526826bfc3a9c0c4,tori162skshe30f43kv2q2rw6we2mu3pvz43lm2zrg4hq50jdd2fjjdjsvm8mc7,tori1zxzv4j9dxarfhxhkxm5cfnv06vy6g4l80adjwaq3dxdzmh5jm8rsrkzz65,tori18etjzrma5604af50jjklk3wlkqcsxdrvmy6jzw5naw2t7kyv4rys3kpwky,tori10z8um7u47e24rv68ghd43tspeztmqy3cc283gvc3pj48zxs5ljdqn84deq,tori1afwrcs58afaka6ltynevwcvq8zhejr3ssn703c0hky5emh890vzsry5wp5
TERITORI_COLLECTION_WHITELIST=tori156edst4w2cjj2l7g6xezzs7hf2vpl25mrpagkgde85aj360pc22s48m2ff,tori1hzz0s0ucrhdp6tue2lxk3c03nj6f60qy463we7lgx0wudd72ctmstg4wkc,tori14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9s3hewys,0x43cc70bf324d716782628bed38af97e4afe92f69,0x916ad9d549907ccbbaf9ba65526826bfc3a9c0c4,tori162skshe30f43kv2q2rw6we2mu3pvz43lm2zrg4hq50jdd2fjjdjsvm8mc7,tori1zxzv4j9dxarfhxhkxm5cfnv06vy6g4l80adjwaq3dxdzmh5jm8rsrkzz65,tori18etjzrma5604af50jjklk3wlkqcsxdrvmy6jzw5naw2t7kyv4rys3kpwky,tori10z8um7u47e24rv68ghd43tspeztmqy3cc283gvc3pj48zxs5ljdqn84deq,tori1afwrcs58afaka6ltynevwcvq8zhejr3ssn703c0hky5emh890vzsry5wp5

PUBLIC_TENOR_KEY=AIzaSyA8TpVfoyoBaDdLww6wJ1Xe0OVN-Hi8qPE

Expand Down
2 changes: 1 addition & 1 deletion cosmwasm-contracts/cw721-membership/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ cw-storage-plus = "1.1.0"
thiserror = "1.0.44"
cw721 = "0.18.0"
cw721-metadata-onchain = { version = "0.15.0", features = ["library"] }
cw2981-royalties = "0.18.0"
cw2981-royalties = { version = "0.18.0", features = ["library"] }
integer-encoding = "4.0.0"
base64 = "0.21.7"

Expand Down
4 changes: 2 additions & 2 deletions cosmwasm-contracts/cw721-membership/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ ADMIN_ADDR=$(shell teritorid keys show $(ADMIN) --keyring-backend test --output
NODE_FLAG=--node https://rpc.testnet.teritori.com:443
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
QUERY_FLAGS=$(NODE_FLAG) -o json
CODE_ID=53
CODE_ID=58
CONFIG=$(shell cat config.json | jq --rawfile desc desc.txt -r '.admin_addr="$(ADMIN_ADDR)" | .description=$$desc | tojson | @sh')

# only informative
CONTRACT_ADDRESS=tori122qmagdhqxr00ldp5jax08zgdumahx4h03shcy4wn9ckchfzky5q3hdylc
CONTRACT_ADDRESS=tori156edst4w2cjj2l7g6xezzs7hf2vpl25mrpagkgde85aj360pc22s48m2ff

.PHONY: artifacts/cw721_membership.wasm
artifacts/cw721_membership.wasm:
Expand Down
156 changes: 96 additions & 60 deletions cosmwasm-contracts/cw721-membership/schema/cw721-membership.json
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,50 @@
}
],
"definitions": {
"Cw2981BorkedQueryMsg": {
"oneOf": [
{
"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",
"type": "object",
"required": [
"RoyaltyInfo"
],
"properties": {
"RoyaltyInfo": {
"type": "object",
"required": [
"sale_price",
"token_id"
],
"properties": {
"sale_price": {
"$ref": "#/definitions/Uint128"
},
"token_id": {
"type": "string"
}
},
"additionalProperties": false
}
},
"additionalProperties": false
},
{
"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)",
"type": "object",
"required": [
"CheckRoyalties"
],
"properties": {
"CheckRoyalties": {
"type": "object",
"additionalProperties": false
}
},
"additionalProperties": false
}
]
},
"QueryMsg": {
"oneOf": [
{
Expand Down Expand Up @@ -523,39 +567,23 @@
{
"type": "object",
"required": [
"royalty_info"
"extension"
],
"properties": {
"royalty_info": {
"extension": {
"type": "object",
"required": [
"sale_price",
"token_id"
"msg"
],
"properties": {
"sale_price": {
"$ref": "#/definitions/Uint128"
},
"token_id": {
"type": "string"
"msg": {
"$ref": "#/definitions/Cw2981BorkedQueryMsg"
}
}
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"check_royalties"
],
"properties": {
"check_royalties": {
"type": "object"
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
Expand Down Expand Up @@ -1164,21 +1192,6 @@
}
}
},
"check_royalties": {
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "CheckRoyaltiesResponse",
"description": "Shows if the contract implements royalties if royalty_payments is true, marketplaces should pay them",
"type": "object",
"required": [
"royalty_payments"
],
"properties": {
"royalty_payments": {
"type": "boolean"
}
},
"additionalProperties": false
},
"config": {
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Config",
Expand Down Expand Up @@ -1239,6 +1252,53 @@
},
"additionalProperties": false
},
"extension": {
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Cw2981Response",
"anyOf": [
{
"$ref": "#/definitions/CheckRoyaltiesResponse"
},
{
"$ref": "#/definitions/RoyaltiesInfoResponse"
}
],
"definitions": {
"CheckRoyaltiesResponse": {
"description": "Shows if the contract implements royalties if royalty_payments is true, marketplaces should pay them",
"type": "object",
"required": [
"royalty_payments"
],
"properties": {
"royalty_payments": {
"type": "boolean"
}
},
"additionalProperties": false
},
"RoyaltiesInfoResponse": {
"type": "object",
"required": [
"address",
"royalty_amount"
],
"properties": {
"address": {
"type": "string"
},
"royalty_amount": {
"$ref": "#/definitions/Uint128"
}
},
"additionalProperties": false
},
"Uint128": {
"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); ```",
"type": "string"
}
}
},
"nft_info": {
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "NftInfoResponse_for_Metadata",
Expand Down Expand Up @@ -1474,30 +1534,6 @@
}
}
},
"royalty_info": {
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "RoyaltiesInfoResponse",
"type": "object",
"required": [
"address",
"royalty_amount"
],
"properties": {
"address": {
"type": "string"
},
"royalty_amount": {
"$ref": "#/definitions/Uint128"
}
},
"additionalProperties": false,
"definitions": {
"Uint128": {
"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); ```",
"type": "string"
}
}
},
"subscription": {
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "SubscriptionResponse",
Expand Down
70 changes: 49 additions & 21 deletions cosmwasm-contracts/cw721-membership/schema/raw/query.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,50 @@
}
],
"definitions": {
"Cw2981BorkedQueryMsg": {
"oneOf": [
{
"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",
"type": "object",
"required": [
"RoyaltyInfo"
],
"properties": {
"RoyaltyInfo": {
"type": "object",
"required": [
"sale_price",
"token_id"
],
"properties": {
"sale_price": {
"$ref": "#/definitions/Uint128"
},
"token_id": {
"type": "string"
}
},
"additionalProperties": false
}
},
"additionalProperties": false
},
{
"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)",
"type": "object",
"required": [
"CheckRoyalties"
],
"properties": {
"CheckRoyalties": {
"type": "object",
"additionalProperties": false
}
},
"additionalProperties": false
}
]
},
"QueryMsg": {
"oneOf": [
{
Expand Down Expand Up @@ -100,39 +144,23 @@
{
"type": "object",
"required": [
"royalty_info"
"extension"
],
"properties": {
"royalty_info": {
"extension": {
"type": "object",
"required": [
"sale_price",
"token_id"
"msg"
],
"properties": {
"sale_price": {
"$ref": "#/definitions/Uint128"
},
"token_id": {
"type": "string"
"msg": {
"$ref": "#/definitions/Cw2981BorkedQueryMsg"
}
}
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"check_royalties"
],
"properties": {
"check_royalties": {
"type": "object"
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Cw2981Response",
"anyOf": [
{
"$ref": "#/definitions/CheckRoyaltiesResponse"
},
{
"$ref": "#/definitions/RoyaltiesInfoResponse"
}
],
"definitions": {
"CheckRoyaltiesResponse": {
"description": "Shows if the contract implements royalties if royalty_payments is true, marketplaces should pay them",
"type": "object",
"required": [
"royalty_payments"
],
"properties": {
"royalty_payments": {
"type": "boolean"
}
},
"additionalProperties": false
},
"RoyaltiesInfoResponse": {
"type": "object",
"required": [
"address",
"royalty_amount"
],
"properties": {
"address": {
"type": "string"
},
"royalty_amount": {
"$ref": "#/definitions/Uint128"
}
},
"additionalProperties": false
},
"Uint128": {
"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); ```",
"type": "string"
}
}
}
Loading

0 comments on commit a04d35e

Please sign in to comment.