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

feat: premium feed nft indexing and marketplace support #966

Merged
merged 14 commits into from
Feb 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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=0x43cc70bf324d716782628bed38af97e4afe92f69,0x916ad9d549907ccbbaf9ba65526826bfc3a9c0c4,tori162skshe30f43kv2q2rw6we2mu3pvz43lm2zrg4hq50jdd2fjjdjsvm8mc7,tori1zxzv4j9dxarfhxhkxm5cfnv06vy6g4l80adjwaq3dxdzmh5jm8rsrkzz65,tori18etjzrma5604af50jjklk3wlkqcsxdrvmy6jzw5naw2t7kyv4rys3kpwky,tori10z8um7u47e24rv68ghd43tspeztmqy3cc283gvc3pj48zxs5ljdqn84deq,tori1afwrcs58afaka6ltynevwcvq8zhejr3ssn703c0hky5emh890vzsry5wp5
TERITORI_COLLECTION_WHITELIST=tori16w7h5tkkjtr36rpcdg8qv4sfs2e44xcrz6a9eczcslywyfpsynfqyj5pt0,tori1hzz0s0ucrhdp6tue2lxk3c03nj6f60qy463we7lgx0wudd72ctmstg4wkc,tori14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9s3hewys,0x43cc70bf324d716782628bed38af97e4afe92f69,0x916ad9d549907ccbbaf9ba65526826bfc3a9c0c4,tori162skshe30f43kv2q2rw6we2mu3pvz43lm2zrg4hq50jdd2fjjdjsvm8mc7,tori1zxzv4j9dxarfhxhkxm5cfnv06vy6g4l80adjwaq3dxdzmh5jm8rsrkzz65,tori18etjzrma5604af50jjklk3wlkqcsxdrvmy6jzw5naw2t7kyv4rys3kpwky,tori10z8um7u47e24rv68ghd43tspeztmqy3cc283gvc3pj48zxs5ljdqn84deq,tori1afwrcs58afaka6ltynevwcvq8zhejr3ssn703c0hky5emh890vzsry5wp5

PUBLIC_TENOR_KEY=AIzaSyA8TpVfoyoBaDdLww6wJ1Xe0OVN-Hi8qPE

Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Rust

on:
push:
branches:
- main
pull_request:

jobs:
rust:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: dtolnay/rust-toolchain@stable

- name: Test
run: make test.rust

- name: Check diff
run: git diff --exit-code
11 changes: 10 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
CANDYMACHINE_REPO=teritori-nfts
BUNKER_MINTER_PACKAGE=teritori-bunker-minter
GO?=go
GOFMT?=$(shell $(GO) env GOROOT)/bin/gofmt

TOKEN_REPO=teritori-nfts
TOKEN_PACKAGE=teritori-nft
Expand Down Expand Up @@ -92,7 +93,8 @@ generate.contracts-clients: $(CONTRACTS_CLIENTS_DIR)/$(BUNKER_MINTER_PACKAGE) $(

.PHONY: generate.go-networks
generate.go-networks: node_modules validate-networks
npx tsx packages/scripts/generateGoNetworks.ts | gofmt > go/pkg/networks/networks.gen.go
npx tsx packages/scripts/generateGoNetworks.ts | $(GOFMT) > go/pkg/networks/networks.gen.go
npx tsx packages/scripts/codegen/generateGoNetworkFeatures.ts | $(GOFMT) > go/pkg/networks/features.gen.go

.PHONY/: $(CONTRACTS_CLIENTS_DIR)/cw721-membership
$(CONTRACTS_CLIENTS_DIR)/cw721-membership: node_modules
Expand Down Expand Up @@ -401,3 +403,10 @@ init-weshd-go:
bump-app-build-number:
npx tsx packages/scripts/app-build/bumpBuildNumber.ts $(shell echo $$(($$(git rev-list HEAD --count) + 10)))

.PHONY: test.rust
test.rust:
cd cosmwasm-contracts/cw721-membership && cargo test

.PHONY: build.rust
build.rust:
cd cosmwasm-contracts/cw721-membership && cargo wasm
143 changes: 142 additions & 1 deletion cosmwasm-contracts/cw721-membership/Cargo.lock

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

2 changes: 2 additions & 0 deletions cosmwasm-contracts/cw721-membership/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@ sylvia = "0.7.0"
schemars = "0.8.12"
cosmwasm-schema = "1.3.1"
serde = "1.0.180"
serde_json = "1.0"
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"

[dev-dependencies]
sylvia = { version = "0.7.0", features = ["mt"] }
11 changes: 6 additions & 5 deletions cosmwasm-contracts/cw721-membership/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@ 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=52
CONFIG=$(shell cat config.json | jq --rawfile desc desc.txt -r '.admin_addr="$(ADMIN_ADDR)" | .description=$$desc | tojson | @sh')

# only informative
CODE_ID=43
CONTRACT_ADDRESS=tori1quf0cu5tlg54aqjd8z54gpvcnh29n6l8qcqmllgrl4gz6jlyn7tsrjllj8
CONTRACT_ADDRESS=tori16w7h5tkkjtr36rpcdg8qv4sfs2e44xcrz6a9eczcslywyfpsynfqyj5pt0

.PHONY: artifacts/cw721_membership.wasm
artifacts/cw721_membership.wasm:
docker run --rm -v "$(PWD)":/code \
--platform linux/amd64 \
Expand All @@ -22,8 +24,7 @@ deploy.testnet: artifacts/cw721_membership.wasm
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:
instantiate.testnet: config.json
set -o pipefail; \
TXHASH=$$(teritorid tx wasm instantiate $(CODE_ID) '{ "admin_addr": "$(ADMIN_ADDR)", "mint_royalties": 1000 }' --label Cw721Membership --admin $(ADMIN_ADDR) $(TX_FLAGS) | jq -r .txhash); \
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

8 changes: 8 additions & 0 deletions cosmwasm-contracts/cw721-membership/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "Premium Memberships",
"symbol": "PMEM",
"mint_royalties": 500,
"image_uri": "ipfs://bafybeiaznarsgwk7stav6qrzjnwqw4j7eu7drm3xx4p3fokgsnrouelse4",
"admin_addr": "__EXTERNAL__",
"description": "__EXTERNAL__"
}
12 changes: 12 additions & 0 deletions cosmwasm-contracts/cw721-membership/desc.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Premium Memberships are exclusively held by premium subscribers of content creators, offering them access to content specially reserved for the creators' communities.

By holding a Premium Membership from a creator, you:

- Directly support the creation of their unique content.
- Gain privileged access to their latest creations.
- Receive access to exclusive perks as defined by the creator.
- Contribute to the broader economy of Teritori OS, with fees being reinvested into the $TORI token.
- Play a crucial role in the development of the Teritori ecosystem, aiding in financing the sustainable resilience of future communities.
- Enjoy potential future benefits across all Teritori OS features, including whitelists, airdrops, early access to new features, alpha information, and more.

Embrace the opportunity to be part of a vibrant creator economy while enjoying exclusive content and perks designed to enrich your experience.
Loading
Loading