forked from DA0-DA0/dao-contracts
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
support kujira's /kujira.denom... tokenfactory fork (DA0-DA0#816)
- Loading branch information
Showing
17 changed files
with
418 additions
and
155 deletions.
There are no files selected for viewing
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
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
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
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
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 |
---|---|---|
@@ -1,6 +1,10 @@ | ||
[package] | ||
name = "dao-voting-token-staked" | ||
authors = ["Callum Anderson <[email protected]>", "Noah Saso <[email protected]>", "Jake Hartnell <[email protected]>"] | ||
authors = [ | ||
"Callum Anderson <[email protected]>", | ||
"Noah Saso <[email protected]>", | ||
"Jake Hartnell <[email protected]>", | ||
] | ||
description = "A DAO DAO voting module based on staked token factory or native tokens. Only works with chains that support Token Factory." | ||
edition = { workspace = true } | ||
license = { workspace = true } | ||
|
@@ -11,6 +15,7 @@ version = { workspace = true } | |
crate-type = ["cdylib", "rlib"] | ||
|
||
[features] | ||
default = ["osmosis_tokenfactory"] | ||
# for more explicit tests, cargo test --features=backtraces | ||
backtraces = ["cosmwasm-std/backtraces"] | ||
# use library feature to disable all instantiate/execute/query exports | ||
|
@@ -20,9 +25,14 @@ library = [] | |
test-tube = [] | ||
# when writing tests you may wish to enable test-tube as a default feature | ||
# default = ["test-tube"] | ||
# different tokenfactory cosmos sdk module standards. enable corresponding | ||
# standard in types library | ||
osmosis_tokenfactory = ["cw-tokenfactory-issuer/osmosis_tokenfactory"] | ||
cosmwasm_tokenfactory = ["cw-tokenfactory-issuer/cosmwasm_tokenfactory"] | ||
kujira_tokenfactory = ["cw-tokenfactory-issuer/kujira_tokenfactory"] | ||
|
||
[dependencies] | ||
cosmwasm-std = { workspace = true, features = ["cosmwasm_1_1"] } | ||
cosmwasm-std = { workspace = true, features = ["cosmwasm_1_1"] } | ||
cosmwasm-schema = { workspace = true } | ||
cw-ownable = { workspace = true } | ||
cw-storage-plus = { workspace = true } | ||
|
@@ -35,12 +45,13 @@ dao-dao-macros = { workspace = true } | |
dao-hooks = { workspace = true } | ||
dao-interface = { workspace = true } | ||
dao-voting = { workspace = true } | ||
cw-tokenfactory-issuer = { workspace = true, features = ["library"] } | ||
cw-tokenfactory-issuer = { workspace = true, default-features = false, features = [ | ||
"library", | ||
] } | ||
|
||
[dev-dependencies] | ||
anyhow = { workspace = true } | ||
cw-multi-test = { workspace = true } | ||
cw-tokenfactory-issuer = { workspace = true } | ||
dao-proposal-single = { workspace = true } | ||
dao-proposal-hook-counter = { workspace = true } | ||
dao-test-custom-factory = { 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
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
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,97 @@ | ||
use std::convert::TryFrom; | ||
use std::convert::TryInto; | ||
|
||
use osmosis_std_derive::CosmwasmExt; | ||
|
||
/// Coin defines a token with a denomination and an amount. | ||
/// | ||
/// NOTE: The amount field is an Int which implements the custom method | ||
/// signatures required by gogoproto. | ||
#[derive( | ||
Clone, | ||
PartialEq, | ||
Eq, | ||
::prost::Message, | ||
::serde::Serialize, | ||
::serde::Deserialize, | ||
schemars::JsonSchema, | ||
CosmwasmExt, | ||
)] | ||
#[proto_message(type_url = "/cosmos.base.v1beta1.Coin")] | ||
pub struct Coin { | ||
#[prost(string, tag = "1")] | ||
pub denom: ::prost::alloc::string::String, | ||
#[prost(string, tag = "2")] | ||
pub amount: ::prost::alloc::string::String, | ||
} | ||
|
||
/// DenomUnit represents a struct that describes a given | ||
/// denomination unit of the basic token. | ||
#[derive( | ||
Clone, | ||
PartialEq, | ||
Eq, | ||
::prost::Message, | ||
::serde::Serialize, | ||
::serde::Deserialize, | ||
::schemars::JsonSchema, | ||
CosmwasmExt, | ||
)] | ||
#[proto_message(type_url = "/cosmos.bank.v1beta1.DenomUnit")] | ||
pub struct DenomUnit { | ||
/// denom represents the string name of the given denom unit (e.g uatom). | ||
#[prost(string, tag = "1")] | ||
pub denom: ::prost::alloc::string::String, | ||
/// exponent represents power of 10 exponent that one must | ||
/// raise the base_denom to in order to equal the given DenomUnit's denom | ||
/// 1 denom = 1^exponent base_denom | ||
/// (e.g. with a base_denom of uatom, one can create a DenomUnit of 'atom' with | ||
/// exponent = 6, thus: 1 atom = 10^6 uatom). | ||
#[prost(uint32, tag = "2")] | ||
#[serde( | ||
serialize_with = "crate::shim::as_str::serialize", | ||
deserialize_with = "crate::shim::as_str::deserialize" | ||
)] | ||
pub exponent: u32, | ||
/// aliases is a list of string aliases for the given denom | ||
#[prost(string, repeated, tag = "3")] | ||
pub aliases: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, | ||
} | ||
/// Metadata represents a struct that describes | ||
/// a basic token. | ||
#[derive( | ||
Clone, | ||
PartialEq, | ||
Eq, | ||
::prost::Message, | ||
::serde::Serialize, | ||
::serde::Deserialize, | ||
::schemars::JsonSchema, | ||
CosmwasmExt, | ||
)] | ||
#[proto_message(type_url = "/cosmos.bank.v1beta1.Metadata")] | ||
pub struct Metadata { | ||
#[prost(string, tag = "1")] | ||
pub description: ::prost::alloc::string::String, | ||
/// denom_units represents the list of DenomUnit's for a given coin | ||
#[prost(message, repeated, tag = "2")] | ||
pub denom_units: ::prost::alloc::vec::Vec<DenomUnit>, | ||
/// base represents the base denom (should be the DenomUnit with exponent = 0). | ||
#[prost(string, tag = "3")] | ||
pub base: ::prost::alloc::string::String, | ||
/// display indicates the suggested denom that should be | ||
/// displayed in clients. | ||
#[prost(string, tag = "4")] | ||
pub display: ::prost::alloc::string::String, | ||
/// name defines the name of the token (eg: Cosmos Atom) | ||
/// | ||
/// Since: cosmos-sdk 0.43 | ||
#[prost(string, tag = "5")] | ||
pub name: ::prost::alloc::string::String, | ||
/// symbol is the token symbol usually shown on exchanges (eg: ATOM). This can | ||
/// be the same as the display. | ||
/// | ||
/// Since: cosmos-sdk 0.43 | ||
#[prost(string, tag = "6")] | ||
pub symbol: ::prost::alloc::string::String, | ||
} |
Oops, something went wrong.