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

CW-1155 (and royalties extension) #162

Open
wants to merge 59 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 44 commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
2b1ba1b
feat: add cw1155-base
ALPAC-4 Aug 17, 2022
26122c8
feat: add cw1155-metadata-onchain
ALPAC-4 Aug 18, 2022
78746b0
feat: add jobs for cw1155
ALPAC-4 Aug 18, 2022
8fe5edb
fix: fix spaceing
ALPAC-4 Aug 18, 2022
b70c8dc
fix: add jobs to test and add package_cw1155
ALPAC-4 Aug 18, 2022
5e3fd48
add schema
ALPAC-4 Aug 18, 2022
753cb6b
fix: add package schema, fix typo
ALPAC-4 Aug 18, 2022
adeb7cf
trivial
dirtyshab Apr 30, 2024
d822a4f
fix: split up transfer event into relevant action events.
dirtyshab May 1, 2024
42a4499
fix: bring back ApprovedForAll and IsApprovedForAll queries (part of …
dirtyshab May 2, 2024
159c79e
Cw1155 Approve/Revoke single (#3)
dirtyshab May 3, 2024
ad05092
refactor: moves cw1155 messages to package, renames messages to close…
dirtyshab May 3, 2024
823639f
fix: mint logic
dirtyshab May 3, 2024
71a1f2a
fix: rename events to be in format *_single and *_batch
dirtyshab May 3, 2024
5875ad0
fix: schema files
dirtyshab May 3, 2024
e107869
feat: implement mint_batch
dirtyshab May 3, 2024
ed56d0a
feat: implements contract_info, minter, and ownership queries.
dirtyshab May 3, 2024
d8e7f76
feat: query all_token_infos
dirtyshab May 4, 2024
0f49674
feat: store and query total supply (sum of all token balances)
dirtyshab May 4, 2024
e42a811
fix: use library feature in cw721-base import
dirtyshab May 6, 2024
b2c060c
fix: store total supply in base instantiate.
dirtyshab May 6, 2024
56e4bc3
fix: cw1155-metadata tests
dirtyshab May 6, 2024
6635fa3
feat: cw1155 on-chain royalties extension
dirtyshab May 6, 2024
00c7b19
fix: existing tests/imports
dirtyshab May 6, 2024
8f9afd2
fix: generic usage
dirtyshab May 6, 2024
c048017
chore: lint
dirtyshab May 6, 2024
be21d01
chore: clippy
dirtyshab May 6, 2024
65ab7d4
fix: lint 2, add circle ci config for cw1155-royalties
dirtyshab May 6, 2024
09f471d
fix: circle ci
dirtyshab May 6, 2024
68960bb
fix: circle ci lint
dirtyshab May 7, 2024
85e5d47
fix: move cosmwasm-schema to deps in metadata extension
dirtyshab May 7, 2024
6f5e9f5
fix: clippy
dirtyshab May 7, 2024
4c7600e
adds custom execute extension and response generics to Cw1155Contract…
dirtyshab May 22, 2024
c00a913
impl cw_ownable_execute on cw1155.
dirtyshab May 23, 2024
1d3b795
fix: cargo schema
dirtyshab May 23, 2024
32c6e41
fix: cargo schema package
dirtyshab May 23, 2024
cfa0c08
chore: merge queries num_tokens/supply
dirtyshab May 23, 2024
3751bf6
fix query BalanceOfBatch
dirtyshab Jun 5, 2024
3609e4a
make state mod public
dirtyshab Jul 1, 2024
5acfcbf
rename AllBalancesResponse to BalancesResponse and return as response…
dirtyshab Jul 3, 2024
d1e6c9d
remove query AllTokenInfo
dirtyshab Jul 3, 2024
07105d8
transfer funds along with send/batch_send
dirtyshab Jul 3, 2024
46136ba
Merge upstream (#4)
dirtyshab Jul 8, 2024
1e1108d
Merge branch 'main' of github.com:CosmWasm/cw-nfts into cw1155
dirtyshab Jul 9, 2024
f142b3b
add more tests
dirtyshab Jul 9, 2024
9dbbc6e
add sender/owner to transfer/mint/burn events
dirtyshab Jul 23, 2024
49d70aa
implement update_metadata() for updating exension/token_uri. not on b…
dirtyshab Jul 23, 2024
e076bd1
clippy
dirtyshab Jul 23, 2024
de3e709
change events to be attributes under wasm like cw721 has
dirtyshab Jul 24, 2024
f0e2812
use same collection key as cw721
dirtyshab Jul 24, 2024
45fc627
zero amount check
dirtyshab Jul 24, 2024
5b88809
use rust version 1.75
dirtyshab Jul 25, 2024
3ba9341
add Cw2981QueryExtensionMsg for convenience (possibly also to add bac…
dirtyshab Aug 9, 2024
1ac8336
fixes cw2981 extension query msg
dirtyshab Aug 9, 2024
2d0420f
fix cw2981 entry mod
dirtyshab Aug 9, 2024
501bfcf
adds query OwnersOf - gets balances of owners of a token id, and also…
dirtyshab Aug 16, 2024
76a30e0
error instead of take min when transferring tokens with amount > than…
dirtyshab Aug 16, 2024
76700c1
Merge branch 'main' of github.com:CosmWasm/cw-nfts into cw1155
dirtyshab Aug 23, 2024
58e692b
bump rust version in ci
dirtyshab Aug 23, 2024
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
112 changes: 112 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@ workflows:
version: 2
test:
jobs:
- contract_cw1155_base
- contract_cw1155_royalties
- contract_cw721_base
- contract_cw721_expiration
- contract_cw721_fixed_price
- contract_cw721_receiver_tester
- package_cw721
- package_cw1155
- lint
- wasm-build
deploy:
Expand Down Expand Up @@ -189,6 +192,115 @@ jobs:
- target
key: cargocache-v2-cw721:1.64.0-{{ checksum "~/project/Cargo.lock" }}

contract_cw1155_base:
docker:
- image: rust:1.65.0
working_directory: ~/project/contracts/cw1155-base
steps:
- checkout:
path: ~/project
- run:
name: Version information
command: rustc --version; cargo --version; rustup --version
- restore_cache:
keys:
- cargocache-cw1155-base-rust:1.65.0-{{ checksum "~/project/Cargo.lock" }}
- run:
name: Unit Tests
environment:
RUST_BACKTRACE: 1
command: cargo unit-test --locked
- run:
name: Build and run schema generator
command: cargo schema --locked
- run:
name: Ensure checked-in schemas are up-to-date
command: |
CHANGES_IN_REPO=$(git status --porcelain)
if [[ -n "$CHANGES_IN_REPO" ]]; then
echo "Repository is dirty. Showing 'git status' and 'git --no-pager diff' for debugging now:"
git status && git --no-pager diff
exit 1
fi
- save_cache:
paths:
- /usr/local/cargo/registry
- target
key: cargocache-cw1155-base-rust:1.65.0-{{ checksum "~/project/Cargo.lock" }}

contract_cw1155_royalties:
docker:
- image: rust:1.65.0
working_directory: ~/project/contracts/cw1155-royalties
steps:
- checkout:
path: ~/project
- run:
name: Version information
command: rustc --version; cargo --version; rustup --version
- restore_cache:
keys:
- cargocache-cw1155-royalties-rust:1.65.0-{{ checksum "~/project/Cargo.lock" }}
- run:
name: Unit Tests
environment:
RUST_BACKTRACE: 1
command: cargo unit-test --locked
- run:
name: Build and run schema generator
command: cargo schema --locked
- run:
name: Ensure checked-in schemas are up-to-date
command: |
CHANGES_IN_REPO=$(git status --porcelain)
if [[ -n "$CHANGES_IN_REPO" ]]; then
echo "Repository is dirty. Showing 'git status' and 'git --no-pager diff' for debugging now:"
git status && git --no-pager diff
exit 1
fi
- save_cache:
paths:
- /usr/local/cargo/registry
- target
key: cargocache-cw1155-royalties-rust:1.65.0-{{ checksum "~/project/Cargo.lock" }}

package_cw1155:
docker:
- image: rust:1.65.0
working_directory: ~/project/packages/cw1155
steps:
- checkout:
path: ~/project
- run:
name: Version information
command: rustc --version; cargo --version; rustup --version; rustup target list --installed
- restore_cache:
keys:
- cargocache-v2-cw1155:1.65.0-{{ checksum "~/project/Cargo.lock" }}
- run:
name: Build library for native target
command: cargo build --locked
- run:
name: Run unit tests
command: cargo test --locked
- run:
name: Build and run schema generator
command: cargo schema --locked
- run:
name: Ensure schemas are up-to-date
command: |
CHANGES_IN_REPO=$(git status --porcelain)
if [[ -n "$CHANGES_IN_REPO" ]]; then
echo "Repository is dirty. Showing 'git status' and 'git --no-pager diff' for debugging now:"
git status && git --no-pager diff
exit 1
fi
- save_cache:
paths:
- /usr/local/cargo/registry
- target
key: cargocache-v2-cw1155:1.65.0-{{ checksum "~/project/Cargo.lock" }}

lint:
docker:
- image: rust:1.78.0
Expand Down
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ artifacts/
# code coverage
tarpaulin-report.*

# raw json schema files
**/raw/*.json
# json schema files
**/schema/**/*.json
48 changes: 48 additions & 0 deletions 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 Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ cw721-base = { version = "*", path = "./contracts/cw721-base" }
cw721-base-016 = { git = "https://github.com/CosmWasm/cw-nfts", tag = "v0.16.0", package = "cw721-base" } # needed for testing legacy migration
cw721-base-017 = { git = "https://github.com/CosmWasm/cw-nfts", tag = "v0.17.0", package = "cw721-base" } # needed for testing legacy migration
cw721-base-018 = { git = "https://github.com/CosmWasm/cw-nfts", tag = "v0.18.0", package = "cw721-base" } # needed for testing legacy migration
cw1155 = { path = "./packages/cw1155", version = "*" }
cw1155-base = { path = "./contracts/cw1155-base", version = "*" }
cw-multi-test = "^0.20"
cw-ownable = { git = "https://github.com/public-awesome/cw-plus-plus.git", rev = "28c1a09bfc6b4f1942fefe3eb0b50faf9d3b1523"} # TODO: switch to official https://github.com/larry0x/cw-plus-plus once merged
cw-storage-plus = "^1.1"
Expand Down
5 changes: 5 additions & 0 deletions contracts/cw1155-base/.cargo/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[alias]
wasm = "build --release --target wasm32-unknown-unknown"
wasm-debug = "build --target wasm32-unknown-unknown"
unit-test = "test --lib"
schema = "run --example schema"
38 changes: 38 additions & 0 deletions contracts/cw1155-base/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
[package]
name = "cw1155-base"
authors = ["shab <[email protected]>"]
description = "Basic implementation cw1155"
version = { workspace = true }
edition = { workspace = true }
license = { workspace = true }
repository = { workspace = true }
homepage = { workspace = true }
documentation = { workspace = true }

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.
"artifacts/*",
]

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[lib]
crate-type = ["cdylib", "rlib"]

[features]
# for more explicit tests, cargo test --features=backtraces
backtraces = ["cosmwasm-std/backtraces"]
# use library feature to disable all instantiate/execute/query exports
library = []

[dependencies]
cw-utils = { workspace = true }
cw2 = { workspace = true }
cw1155 = { workspace = true }
cw721 = { workspace = true }
cw721-base = { workspace = true, features = ["library"] }
cw-ownable = { workspace = true }
cw-storage-plus = { workspace = true }
cosmwasm-std = { workspace = true }
schemars = { workspace = true }
serde = { workspace = true }
cosmwasm-schema = { workspace = true }
12 changes: 12 additions & 0 deletions contracts/cw1155-base/examples/schema.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
use cosmwasm_schema::write_api;
use cw1155::msg::Cw1155InstantiateMsg;

use cw1155_base::{Cw1155BaseExecuteMsg, Cw1155BaseQueryMsg};

fn main() {
write_api! {
instantiate: Cw1155InstantiateMsg,
execute: Cw1155BaseExecuteMsg,
query: Cw1155BaseQueryMsg,
}
}
Loading