-
Notifications
You must be signed in to change notification settings - Fork 142
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
1,604 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
[package] | ||
name = "btsg-ft-factory" | ||
authors = ["noah <[email protected]>"] | ||
description = "A CosmWasm factory contract for issuing fantokens on BitSong." | ||
edition = { workspace = true } | ||
license = { workspace = true } | ||
repository = { workspace = true } | ||
version = { workspace = true } | ||
|
||
[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-std = { workspace = true } | ||
cosmwasm-schema = { workspace = true } | ||
cw-storage-plus = { workspace = true } | ||
cw2 = { workspace = true } | ||
dao-interface = { workspace = true } | ||
osmosis-std-derive = { workspace = true } | ||
prost = { workspace = true } | ||
prost-types = { workspace = true } | ||
schemars = { workspace = true } | ||
serde = { workspace = true } | ||
thiserror = { workspace = true } | ||
|
||
[dev-dependencies] | ||
anyhow = { workspace = true } | ||
cosmwasm-schema = { workspace = true } | ||
cw-multi-test = { workspace = true } | ||
cw-utils = { workspace = true } | ||
dao-dao-core = { workspace = true, features = ["library"] } | ||
dao-proposal-single = { workspace = true, features = ["library"] } | ||
dao-testing = { workspace = true } | ||
dao-voting-token-staked = { workspace = true, features = ["library"] } | ||
dao-voting = { 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,11 @@ | ||
# btsg-ft-factory | ||
|
||
Serves as a factory that issues new | ||
[fantokens](https://github.com/bitsongofficial/go-bitsong/tree/main/x/fantoken) | ||
on BitSong and returns their denom for use with the | ||
[dao-voting-token-staked](../../voting/dao-voting-token-staked) voting module | ||
contract. | ||
|
||
Instantiation and execution are permissionless. All DAOs will use the same | ||
factory and execute `Issue` to create new fantokens through `TokenInfo::Factory` | ||
during voting module instantiation. |
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,11 @@ | ||
use btsg_ft_factory::msg::{ExecuteMsg, InstantiateMsg, MigrateMsg, QueryMsg}; | ||
use cosmwasm_schema::write_api; | ||
|
||
fn main() { | ||
write_api! { | ||
instantiate: InstantiateMsg, | ||
query: QueryMsg, | ||
execute: ExecuteMsg, | ||
migrate: MigrateMsg, | ||
} | ||
} |
117 changes: 117 additions & 0 deletions
117
contracts/external/btsg-ft-factory/schema/btsg-ft-factory.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,117 @@ | ||
{ | ||
"contract_name": "btsg-ft-factory", | ||
"contract_version": "2.5.0", | ||
"idl_version": "1.0.0", | ||
"instantiate": { | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"title": "InstantiateMsg", | ||
"type": "object", | ||
"additionalProperties": false | ||
}, | ||
"execute": { | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"title": "ExecuteMsg", | ||
"oneOf": [ | ||
{ | ||
"description": "Issues a new fantoken.", | ||
"type": "object", | ||
"required": [ | ||
"issue" | ||
], | ||
"properties": { | ||
"issue": { | ||
"$ref": "#/definitions/NewFanToken" | ||
} | ||
}, | ||
"additionalProperties": false | ||
} | ||
], | ||
"definitions": { | ||
"InitialBalance": { | ||
"type": "object", | ||
"required": [ | ||
"address", | ||
"amount" | ||
], | ||
"properties": { | ||
"address": { | ||
"type": "string" | ||
}, | ||
"amount": { | ||
"$ref": "#/definitions/Uint128" | ||
} | ||
}, | ||
"additionalProperties": false | ||
}, | ||
"NewFanToken": { | ||
"type": "object", | ||
"required": [ | ||
"initial_balances", | ||
"max_supply", | ||
"name", | ||
"symbol", | ||
"uri" | ||
], | ||
"properties": { | ||
"initial_balances": { | ||
"description": "The initial balances to set for the token, cannot be empty.", | ||
"type": "array", | ||
"items": { | ||
"$ref": "#/definitions/InitialBalance" | ||
} | ||
}, | ||
"initial_dao_balance": { | ||
"description": "Optional balance to mint for the DAO.", | ||
"anyOf": [ | ||
{ | ||
"$ref": "#/definitions/Uint128" | ||
}, | ||
{ | ||
"type": "null" | ||
} | ||
] | ||
}, | ||
"max_supply": { | ||
"description": "Fan token max supply.", | ||
"allOf": [ | ||
{ | ||
"$ref": "#/definitions/Uint128" | ||
} | ||
] | ||
}, | ||
"name": { | ||
"description": "Fan token name.", | ||
"type": "string" | ||
}, | ||
"symbol": { | ||
"description": "Fan token symbol.", | ||
"type": "string" | ||
}, | ||
"uri": { | ||
"description": "Fan token URI.", | ||
"type": "string" | ||
} | ||
}, | ||
"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" | ||
} | ||
} | ||
}, | ||
"query": { | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"title": "QueryMsg", | ||
"type": "string", | ||
"enum": [] | ||
}, | ||
"migrate": { | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"title": "MigrateMsg", | ||
"type": "object", | ||
"additionalProperties": false | ||
}, | ||
"sudo": null, | ||
"responses": {} | ||
} |
Oops, something went wrong.