-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add token-merge-factory & token-merge-minter
- Loading branch information
1 parent
5fb3404
commit 266a953
Showing
41 changed files
with
3,412 additions
and
0 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 --example schema" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Build results | ||
/target | ||
|
||
# Cargo+Git helper file (https://github.com/rust-lang/cargo/blob/0.44.1/src/cargo/sources/git/utils.rs#L320-L327) | ||
.cargo-ok | ||
|
||
# Text file backups | ||
**/*.rs.bk | ||
|
||
# macOS | ||
.DS_Store | ||
|
||
# IDEs | ||
*.iml | ||
.idea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
[package] | ||
name = "token-merge-factory" | ||
authors = ["Shane Vitarana <[email protected]>"] | ||
description = "Stargaze token merge factory contract" | ||
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] | ||
base-factory = { workspace = true, features = ["library"] } | ||
cosmwasm-schema = { workspace = true } | ||
cosmwasm-std = { workspace = true } | ||
cw2 = { workspace = true } | ||
cw-storage-plus = { workspace = true } | ||
cw-utils = { workspace = true } | ||
schemars = { workspace = true } | ||
semver = { workspace = true } | ||
serde = { workspace = true } | ||
sg1 = { workspace = true } | ||
sg2 = { workspace = true } | ||
sg721 = { workspace = true } | ||
sg-std = { workspace = true } | ||
thiserror = { workspace = true } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Token Merge Minter Factory | ||
|
||
A contract that maintains all token merge minter governance parameters. | ||
|
||
It's responsible for creating new minters with the latest governance parameters. | ||
|
||
It also maintains status lists for token merge minters. This is inherited from sg4. |
17 changes: 17 additions & 0 deletions
17
contracts/factories/token-merge-factory/examples/schema.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
use std::env::current_dir; | ||
use std::fs::create_dir_all; | ||
|
||
use cosmwasm_schema::{export_schema, remove_schemas, schema_for}; | ||
|
||
use sg2::query::Sg2QueryMsg; | ||
use token_merge_factory::msg::InstantiateMsg; | ||
|
||
fn main() { | ||
let mut out_dir = current_dir().unwrap(); | ||
out_dir.push("schema"); | ||
create_dir_all(&out_dir).unwrap(); | ||
remove_schemas(&out_dir).unwrap(); | ||
|
||
export_schema(&schema_for!(InstantiateMsg), &out_dir); | ||
export_schema(&schema_for!(Sg2QueryMsg), &out_dir); | ||
} |
123 changes: 123 additions & 0 deletions
123
contracts/factories/token-merge-factory/schema/instantiate_msg.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"title": "InstantiateMsg", | ||
"type": "object", | ||
"required": [ | ||
"params" | ||
], | ||
"properties": { | ||
"params": { | ||
"$ref": "#/definitions/MinterParams_for_ParamsExtension" | ||
} | ||
}, | ||
"additionalProperties": false, | ||
"definitions": { | ||
"Coin": { | ||
"type": "object", | ||
"required": [ | ||
"amount", | ||
"denom" | ||
], | ||
"properties": { | ||
"amount": { | ||
"$ref": "#/definitions/Uint128" | ||
}, | ||
"denom": { | ||
"type": "string" | ||
} | ||
} | ||
}, | ||
"MinterParams_for_ParamsExtension": { | ||
"description": "Common params for all minters used for storage", | ||
"type": "object", | ||
"required": [ | ||
"allowed_sg721_code_ids", | ||
"code_id", | ||
"creation_fee", | ||
"extension", | ||
"frozen", | ||
"max_trading_offset_secs", | ||
"min_mint_price", | ||
"mint_fee_bps" | ||
], | ||
"properties": { | ||
"allowed_sg721_code_ids": { | ||
"type": "array", | ||
"items": { | ||
"type": "integer", | ||
"format": "uint64", | ||
"minimum": 0.0 | ||
} | ||
}, | ||
"code_id": { | ||
"description": "The minter code id", | ||
"type": "integer", | ||
"format": "uint64", | ||
"minimum": 0.0 | ||
}, | ||
"creation_fee": { | ||
"$ref": "#/definitions/Coin" | ||
}, | ||
"extension": { | ||
"$ref": "#/definitions/ParamsExtension" | ||
}, | ||
"frozen": { | ||
"type": "boolean" | ||
}, | ||
"max_trading_offset_secs": { | ||
"type": "integer", | ||
"format": "uint64", | ||
"minimum": 0.0 | ||
}, | ||
"min_mint_price": { | ||
"$ref": "#/definitions/Coin" | ||
}, | ||
"mint_fee_bps": { | ||
"type": "integer", | ||
"format": "uint64", | ||
"minimum": 0.0 | ||
} | ||
}, | ||
"additionalProperties": false | ||
}, | ||
"ParamsExtension": { | ||
"description": "Parameters common to all vending minters, as determined by governance", | ||
"type": "object", | ||
"required": [ | ||
"airdrop_mint_fee_bps", | ||
"airdrop_mint_price", | ||
"max_per_address_limit", | ||
"max_token_limit", | ||
"shuffle_fee" | ||
], | ||
"properties": { | ||
"airdrop_mint_fee_bps": { | ||
"type": "integer", | ||
"format": "uint64", | ||
"minimum": 0.0 | ||
}, | ||
"airdrop_mint_price": { | ||
"$ref": "#/definitions/Coin" | ||
}, | ||
"max_per_address_limit": { | ||
"type": "integer", | ||
"format": "uint32", | ||
"minimum": 0.0 | ||
}, | ||
"max_token_limit": { | ||
"type": "integer", | ||
"format": "uint32", | ||
"minimum": 0.0 | ||
}, | ||
"shuffle_fee": { | ||
"$ref": "#/definitions/Coin" | ||
} | ||
}, | ||
"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" | ||
} | ||
} | ||
} |
47 changes: 47 additions & 0 deletions
47
contracts/factories/token-merge-factory/schema/sg2_query_msg.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"title": "Sg2QueryMsg", | ||
"oneOf": [ | ||
{ | ||
"description": "Returns `ParamsResponse`", | ||
"type": "object", | ||
"required": [ | ||
"params" | ||
], | ||
"properties": { | ||
"params": { | ||
"type": "object", | ||
"additionalProperties": false | ||
} | ||
}, | ||
"additionalProperties": false | ||
}, | ||
{ | ||
"type": "object", | ||
"required": [ | ||
"allowed_collection_code_ids" | ||
], | ||
"properties": { | ||
"allowed_collection_code_ids": { | ||
"type": "object", | ||
"additionalProperties": false | ||
} | ||
}, | ||
"additionalProperties": false | ||
}, | ||
{ | ||
"type": "object", | ||
"required": [ | ||
"allowed_collection_code_id" | ||
], | ||
"properties": { | ||
"allowed_collection_code_id": { | ||
"type": "integer", | ||
"format": "uint64", | ||
"minimum": 0.0 | ||
} | ||
}, | ||
"additionalProperties": false | ||
} | ||
] | ||
} |
Oops, something went wrong.