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

Add mutable whitelist contract and package #2

Draft
wants to merge 12 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 9 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
141 changes: 138 additions & 3 deletions Cargo.lock

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

20 changes: 18 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
[workspace]
members = ["contracts/loyalty/*"]
members = [
"packages/*",
"contracts/loyalty/*",
"contracts/stargaze-mutable-whitelist",
]
resolver = "2"

[workspace.package]
version = "1.0.0"
version = "0.1.0"
edition = "2021"
homepage = "https://stargaze.zone"
repository = "https://github.com/public-awesome/core"
Expand All @@ -13,6 +17,7 @@ license = "Apache-2.0"
cosmwasm-schema = "1.2.1"
cosmwasm-std = "1.2.1"
cosmwasm-storage = "1.2.1"
cw-ownable = "0.5.0"
cw-storage-macro = "0.16.0"
cw-storage-plus = "0.16.0"
cw-controllers = "0.16.0"
Expand All @@ -26,10 +31,13 @@ semver = "1.0.16"
serde = { version = "1.0.145", default-features = false, features = ["derive"] }
thiserror = "1.0.31"
anyhow = "1.0.41"
sg-std = { version = "2.3.0" }


# dev-dependencies
cw-multi-test = "0.16.0"


[profile.release.package.loyalty-collection]
codegen-units = 1
incremental = false
Expand All @@ -38,6 +46,14 @@ incremental = false
codegen-units = 1
incremental = false

[profile.release.package.sg-basic-whitelist]
codegen-units = 1
incremental = false

[profile.release.package.sg-mutable-whitelist]
codegen-units = 1
incremental = false

[profile.release]
rpath = false
lto = true
Expand Down
2 changes: 1 addition & 1 deletion contracts/loyalty/collection/src/bin/schema.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use cosmwasm_schema::write_api;

use collection::msg::{ExecuteMsg, InstantiateMsg, QueryMsg};
use loyalty_collection::msg::{ExecuteMsg, InstantiateMsg, QueryMsg};

fn main() {
write_api! {
Expand Down
2 changes: 1 addition & 1 deletion contracts/loyalty/minter/src/bin/schema.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use cosmwasm_schema::write_api;

use minter::msg::{ExecuteMsg, InstantiateMsg, QueryMsg};
use loyalty_minter::msg::{ExecuteMsg, InstantiateMsg, QueryMsg};

fn main() {
write_api! {
Expand Down
4 changes: 4 additions & 0 deletions contracts/stargaze-mutable-whitelist/.cargo/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[alias]
wasm = "build --release --lib --target wasm32-unknown-unknown"
unit-test = "test --lib"
schema = "run --bin schema"
44 changes: 44 additions & 0 deletions contracts/stargaze-mutable-whitelist/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
[package]
name = "stargaze-mutable-whitelist"
authors = ["Shane Vitarana <[email protected]>"]
description = "Stargaze Mutable Whitelist"
version = { workspace = true }
edition = { workspace = true }
homepage = { workspace = true }
repository = { workspace = true }
license = { 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.
"contract.wasm",
"hash.txt",
]

# 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]
cosmwasm-schema = { workspace = true }
cosmwasm-std = { workspace = true }
cw-storage-plus = { workspace = true }
cw2 = { workspace = true }
schemars = { workspace = true }
serde = { workspace = true }
thiserror = { workspace = true }
sg-std = { workspace = true }
cw-ownable = { workspace = true }
sg-mutable-whitelist = { path = "../../packages/sg-mutable-whitelist", version = "0.1.0" }
cw-item-set = "0.7.1"


[dev-dependencies]
cw-multi-test = { workspace = true }
5 changes: 5 additions & 0 deletions contracts/stargaze-mutable-whitelist/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Stargaze Mutable Whitelist

This contract is used to manage a whitelist of addresses that can be used to mint tokens among other things.

It can work with bech32 Cosmos addresses or any other address that is in a string format. Bech32 addresses are validated before being added to the whitelist.
11 changes: 11 additions & 0 deletions contracts/stargaze-mutable-whitelist/src/bin/schema.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
use cosmwasm_schema::write_api;
use sg_mutable_whitelist::{ExecuteMsg, QueryMsg};
use stargaze_mutable_whitelist::msg::InstantiateMsg;

fn main() {
write_api! {
instantiate: InstantiateMsg,
execute: ExecuteMsg,
query: QueryMsg,
}
}
Loading