Skip to content

Commit

Permalink
just gen-schema + callback messages in abc-factory
Browse files Browse the repository at this point in the history
  • Loading branch information
ismellike committed Sep 18, 2024
1 parent ea454e2 commit f347345
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 9 deletions.
2 changes: 1 addition & 1 deletion contracts/external/cw-abc/schema/cw-abc.json
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@
"type": "string"
},
"exponent": {
"description": "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).",
"description": "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 = 10^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).",
"type": "integer",
"format": "uint32",
"minimum": 0.0
Expand Down
2 changes: 2 additions & 0 deletions contracts/external/cw-abc/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,8 @@ pub fn reply(deps: DepsMut, env: Env, msg: Reply) -> Result<Response, ContractEr
display: metadata.display,
name: metadata.name,
symbol: metadata.symbol,
uri: String::default(),
uri_hash: String::default(),
},
})?,
funds: vec![],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@
"type": "string"
},
"exponent": {
"description": "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).",
"description": "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 = 10^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).",
"type": "integer",
"format": "uint32",
"minimum": 0.0
Expand Down Expand Up @@ -483,7 +483,9 @@
"description",
"display",
"name",
"symbol"
"symbol",
"uri",
"uri_hash"
],
"properties": {
"base": {
Expand Down Expand Up @@ -511,6 +513,14 @@
"symbol": {
"description": "symbol is the token symbol usually shown on exchanges (eg: ATOM). This can be the same as the display.\n\nSince: cosmos-sdk 0.43",
"type": "string"
},
"uri": {
"description": "URI to a document (on or off-chain) that contains additional information. Optional.\n\nSince: cosmos-sdk 0.46",
"type": "string"
},
"uri_hash": {
"description": "URIHash is a sha256 hash of a document pointed by URI. It's used to verify that the document didn't change. Optional.\n\nSince: cosmos-sdk 0.46",
"type": "string"
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@
"type": "string"
},
"exponent": {
"description": "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).",
"description": "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 = 10^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).",
"type": "integer",
"format": "uint32",
"minimum": 0.0
Expand Down
7 changes: 3 additions & 4 deletions contracts/external/dao-abc-factory/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ use cw_abc::msg::{
use cw_storage_plus::{Bound, Item, Map};
use cw_utils::parse_reply_instantiate_data;
use dao_interface::{
state::ModuleInstantiateCallback, token::TokenFactoryCallback,
voting::Query as VotingModuleQueryMsg,
state::CallbackMessages, token::TokenFactoryCallback, voting::Query as VotingModuleQueryMsg,
};

use crate::{
Expand Down Expand Up @@ -159,10 +158,10 @@ pub fn reply(deps: DepsMut, _env: Env, msg: Reply) -> Result<Response, ContractE
};

// DAO must accept ownership transfer. Here we include a
// ModuleInstantiateCallback message that will be called by the
// CallbackMessages message that will be called by the
// dao-dao-core contract when voting module instantiation is
// complete.
let callback = ModuleInstantiateCallback {
let callback = CallbackMessages {
msgs: vec![CosmosMsg::Wasm(WasmMsg::Execute {
contract_addr: abc_addr.clone(),
msg: to_json_binary(&AbcExecuteMsg::UpdateOwnership(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
"type": "string"
},
"exponent": {
"description": "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).",
"description": "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 = 10^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).",
"type": "integer",
"format": "uint32",
"minimum": 0.0
Expand Down

0 comments on commit f347345

Please sign in to comment.