Skip to content

Commit

Permalink
fix: cw2981 support
Browse files Browse the repository at this point in the history
Signed-off-by: Norman Meier <[email protected]>
  • Loading branch information
n0izn0iz committed Feb 22, 2024
1 parent 1bcafbb commit 9ef9c1e
Show file tree
Hide file tree
Showing 9 changed files with 289 additions and 23 deletions.
1 change: 1 addition & 0 deletions cosmwasm-contracts/nft-marketplace/.gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Build results
/target
/artifacts

# Cargo+Git helper file (https://github.com/rust-lang/cargo/blob/0.44.1/src/cargo/sources/git/utils.rs#L320-L327)
.cargo-ok
Expand Down
200 changes: 197 additions & 3 deletions cosmwasm-contracts/nft-marketplace/Cargo.lock

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

1 change: 1 addition & 0 deletions cosmwasm-contracts/nft-marketplace/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ cosmwasm-std = { version = "1.0.0" }
cw-storage-plus = { version = "0.13.4" }
schemars = "0.8.10"
serde = { version = "1.0.137", default-features = false, features = ["derive"] }
cw2981-royalties = "0.18.0"

[dev-dependencies]
cosmwasm-schema = { version = "1.1.0" }
30 changes: 30 additions & 0 deletions cosmwasm-contracts/nft-marketplace/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
ADMIN=testnet-adm
ADMIN_ADDR=$(shell teritorid keys show $(ADMIN) --keyring-backend test --output json | jq -r .address)
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=52
CONFIG=$(shell cat config.json | jq --rawfile desc desc.txt -r '.admin_addr="$(ADMIN_ADDR)" | .description=$$desc | tojson | @sh')

# only informative
CONTRACT_ADDRESS=tori16w7h5tkkjtr36rpcdg8qv4sfs2e44xcrz6a9eczcslywyfpsynfqyj5pt0

.PHONY: artifacts/nft_marketplace.wasm
artifacts/nft_marketplace.wasm:
docker run --rm -v "$(PWD)":/code \
--platform linux/amd64 \
--mount type=volume,source=nft_marketplace_cache,target=/target \
--mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \
cosmwasm/rust-optimizer:0.14.0

.PHONY: deploy.testnet
deploy.testnet: artifacts/nft_marketplace.wasm
set -o pipefail; \
TXHASH=$$(teritorid tx wasm store artifacts/nft_marketplace.wasm $(TX_FLAGS) | jq -r .txhash); \
while ! teritorid query tx $$TXHASH $(QUERY_FLAGS) 2>/dev/null | jq -r '.logs[0].events[] | select(.type=="store_code").attributes[] | select(.key=="code_id").value'; do sleep 1; done

.PHONY: instantiate.testnet
instantiate.testnet: config.json
set -o pipefail; \
TXHASH=$$(teritorid tx wasm instantiate $(CODE_ID) $(CONFIG) --label Cw721Membership --admin $(ADMIN_ADDR) $(TX_FLAGS) | jq -r .txhash); \
while ! teritorid query tx $$TXHASH $(QUERY_FLAGS) 2>/dev/null | jq -r '.logs[0].events[] | select(.type=="instantiate").attributes[] | select(.key=="_contract_address").value'; do sleep 1; done
4 changes: 2 additions & 2 deletions cosmwasm-contracts/nft-marketplace/schema/nft_query_msg.json

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

Loading

0 comments on commit 9ef9c1e

Please sign in to comment.