Skip to content

Commit

Permalink
Merge pull request #3 from discoverdefiteam/v0.3.0-testnet
Browse files Browse the repository at this point in the history
V0.3.0 testnet
  • Loading branch information
discoverdefiteam authored Nov 22, 2023
2 parents d852c3a + e3e4ada commit 2cc333d
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 27 deletions.
27 changes: 21 additions & 6 deletions Cargo.lock

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

12 changes: 6 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ repository = "https://github.com/terpnetwork/headstash-patch"
license = "Apache-2.0"

[workspace.dependencies]
cosmwasm-schema = "1.2.1"
cosmwasm-std = "1.2.1"
cw-controllers = "1.1.0"
cw2 = "1.1.0"
cw4 = "1.1.0"
cw4-group = "1.1.0"
cosmwasm-schema = "1.3.1"
cosmwasm-std = { version = "1.5.0", default-features = false, features = ["cosmwasm_1_3"] }
cw-controllers = "1.1.1"
cw2 = "1.1.1"
cw4 = "1.1.1"
cw4-group = "1.1.1"
cw721 = "0.18.0"
cw721-base = "0.18.0"
cw-multi-test = "0.16.2"
Expand Down
27 changes: 14 additions & 13 deletions contracts/headstash-contract/src/contract.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#[cfg(not(feature = "library"))]
use cosmwasm_std::entry_point;
use cosmwasm_std::{
attr, coin,to_binary, Binary, Deps, DepsMut, Env, MessageInfo, Response, StdResult,
Uint128, BankMsg, CosmosMsg,
attr, coin,to_json_binary, Binary, Deps, DepsMut, Env, MessageInfo, Response, StdResult,
Uint128, BankMsg, CosmosMsg, DistributionMsg,
};
use cw2::{get_contract_version, set_contract_version};
use crate::contract::validation::validate_claim;
Expand Down Expand Up @@ -180,15 +180,18 @@ pub fn execute_clawback(
// get balance
let balance_to_burn = total_amount.checked_sub(claimed)?;

// TODO: send to burn module
// clawback to community pool
let clawback_msg = CosmosMsg::Distribution(DistributionMsg::FundCommunityPool {
amount: vec![coin(balance_to_burn.u128(), NATIVE_BOND_DENOM),
coin(balance_to_burn.u128(), NATIVE_FEE_DENOM),],
});

// Burn the tokens and response
let mut res = Response::new().add_attribute("action", "burn");
let mut res = Response::new().add_attribute("action", "clawback");

res = res
// .add_message(msg)
.add_message(clawback_msg)
.add_attributes(vec![
attr("address", info.sender),
attr("amount", balance_to_burn),
]);

Expand Down Expand Up @@ -232,12 +235,12 @@ pub fn execute_resume(
#[cfg_attr(not(feature = "library"), entry_point)]
pub fn query(deps: Deps, _env: Env, msg: QueryMsg) -> StdResult<Binary> {
match msg {
QueryMsg::Config {} => to_binary(&query_config(deps)?),
QueryMsg::MerkleRoot {} => to_binary(&query_merkle_root(deps)?),
QueryMsg::Config {} => to_json_binary(&query_config(deps)?),
QueryMsg::MerkleRoot {} => to_json_binary(&query_merkle_root(deps)?),
QueryMsg::IsClaimed { address } => {
to_binary(&query_is_claimed(deps, address)?)
to_json_binary(&query_is_claimed(deps, address)?)
}
QueryMsg::TotalClaimed {} => to_binary(&query_total_claimed(deps)?),
QueryMsg::TotalClaimed {} => to_json_binary(&query_total_claimed(deps)?),
}
}

Expand Down Expand Up @@ -292,9 +295,7 @@ mod validation {
use cosmwasm_std::StdError;
use ethereum_verify::verify_ethereum_text;

use crate::{
state::Config,
};
use crate::state::Config;

pub fn compute_plaintext_msg(config: &Config, info: MessageInfo) -> String {
str::replace(
Expand Down
4 changes: 2 additions & 2 deletions contracts/headstash-contract/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ pub struct Config {
}
pub const CONFIG: Item<Config> = Item::new("config");

pub const NATIVE_FEE_DENOM: &str = "uterp";
pub const NATIVE_BOND_DENOM: &str = "uthiol";
pub const NATIVE_FEE_DENOM: &str = "uterpx";
pub const NATIVE_BOND_DENOM: &str = "uthiolx";

// saves external network airdrop accounts
pub const ACCOUNT_MAP_KEY: &str = "account_map";
Expand Down

0 comments on commit 2cc333d

Please sign in to comment.