Skip to content

Commit

Permalink
voting contracts refractored to secret cosmwasm
Browse files Browse the repository at this point in the history
  • Loading branch information
Abhishek-1857 committed Feb 6, 2024
1 parent ab2a4d1 commit 80c5eb8
Show file tree
Hide file tree
Showing 49 changed files with 2,922 additions and 1,373 deletions.
110 changes: 41 additions & 69 deletions Cargo.lock

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

8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ cw20 = "1.1"
cw20-base = "1.1"
cw3 = "1.1"
cw4 = {path = "./packages/cw4-1.1.2/"}
cw4-group = "1.1"
cw4-group = {path = "./packages/cw4-group-1.1.2/"}
cw721 = "0.18"
cw721-base = "0.18"
env_logger = "0.10"
Expand Down Expand Up @@ -123,7 +123,7 @@ dao-voting = { path = "./packages/dao-voting", version = "2.4.0" }
dao-voting-cw20-balance = { path = "./contracts/test/dao-voting-cw20-balance", version = "2.4.0" }
dao-voting-snip20-staked = { path = "./contracts/voting/dao-voting-snip20-staked", version = "2.4.0" }
dao-voting-cw4 = { path = "./contracts/voting/dao-voting-cw4", version = "2.4.0" }
dao-voting-cw721-roles = { path = "./contracts/voting/dao-voting-cw721-roles", version = "2.4.0" }
dao-voting-snip721-roles = { path = "./contracts/voting/dao-voting-snip721-roles", version = "2.4.0" }
dao-voting-snip721-staked = { path = "./contracts/voting/dao-voting-snip721-staked", version = "2.4.0" }
dao-voting-token-staked = { path = "./contracts/voting/dao-voting-token-staked", version = "2.4.0" }

Expand Down Expand Up @@ -157,8 +157,8 @@ secret-cw-controllers = { path = "./packages/controllers/"}
secret-cw2 = { path="./packages/cw2/" }
secret-multi-test = {path = "./packages/multi-test/"}

cosmwasm-std = { package = "secret-cosmwasm-std", version = "1.1.10",features = ["stargate","staking","ibc3","random"] }
cosmwasm-storage = { package = "secret-cosmwasm-storage", version = "1.1.10" }
cosmwasm-std = { package = "secret-cosmwasm-std", version = "1.1.11",features = ["stargate","staking","ibc3","random"] }
cosmwasm-storage = { package = "secret-cosmwasm-storage", version = "1.1.11" }
schemars = { version = "0.8.11" }
serde = { version = "1.0" }
thiserror = { version = "1.0" }
Expand Down
4 changes: 2 additions & 2 deletions contracts/external/cw-tokenfactory-issuer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ exclude = [
crate-type = ["cdylib", "rlib"]

[features]
default = ["osmosis_tokenfactory"]
default = ["cosmwasm_tokenfactory"]
# for more explicit tests, cargo test --features=backtraces
backtraces = ["cosmwasm-std/backtraces"]
# use library feature to disable all instantiate/execute/query exports
library = []
# use test tube feature to enable test-tube integration tests, for example
# cargo test --features "test-tube"
test-tube = ["osmosis_tokenfactory"]
test-tube = ["cosmwasm_tokenfactory"]
# different tokenfactory cosmos sdk module standards. enable corresponding
# standard in types library
osmosis_tokenfactory = ["cw-tokenfactory-types/osmosis_tokenfactory"]
Expand Down
27 changes: 14 additions & 13 deletions contracts/external/cw-tokenfactory-issuer/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ use cosmwasm_std::{
to_binary, Binary, Deps, DepsMut, Env, MessageInfo, Reply, Response, StdResult, SubMsg,
};
use secret_cw2::{get_contract_version, set_contract_version, ContractVersion};
use cw_tokenfactory_types::msg::{msg_create_denom, MsgCreateDenomResponse};
use cw_tokenfactory_types::msg::msg_create_denom;
use cw_tokenfactory_types::cosmwasm::MsgCreateDenomResponse;

use crate::error::ContractError;
use crate::execute;
Expand Down Expand Up @@ -178,15 +179,15 @@ pub fn migrate(deps: DepsMut, _env: Env, _msg: MigrateMsg) -> Result<Response, C
Ok(Response::default())
}

// #[cfg_attr(not(feature = "library"), entry_point)]
// pub fn reply(deps: DepsMut, _env: Env, msg: Reply) -> Result<Response, ContractError> {
// match msg.id {
// CREATE_DENOM_REPLY_ID => {
// let MsgCreateDenomResponse { new_token_denom } = msg.result.try_into()?;
// DENOM.save(deps.storage, &new_token_denom)?;

// Ok(Response::new().add_attribute("denom", new_token_denom))
// }
// _ => Err(ContractError::UnknownReplyId { id: msg.id }),
// }
// }
#[cfg_attr(not(feature = "library"), entry_point)]
pub fn reply(deps: DepsMut, _env: Env, msg: Reply) -> Result<Response, ContractError> {
match msg.id {
CREATE_DENOM_REPLY_ID => {
let MsgCreateDenomResponse { new_token_denom } = msg.result.try_into()?;
DENOM.save(deps.storage, &new_token_denom)?;

Ok(Response::new().add_attribute("denom", new_token_denom))
}
_ => Err(ContractError::UnknownReplyId { id: msg.id }),
}
}
4 changes: 2 additions & 2 deletions contracts/external/snip721-roles/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ secret-storage-plus = { workspace = true }
secret-utils = { workspace = true }
secret-cw2 = { workspace = true }
cw4 = { workspace = true }
cw721 = { workspace = true }
cw721-base = { workspace = true, features = ["library"] }
# cw721 = { workspace = true }
# cw721-base = { workspace = true, features = ["library"] }
dao-snip721-extensions = { workspace = true }
serde = { workspace = true }
thiserror = { workspace = true }
Expand Down
Loading

0 comments on commit 80c5eb8

Please sign in to comment.