From 32f411740039161bc8e40ea01fa7c0dd74ebf606 Mon Sep 17 00:00:00 2001 From: Mauro Lacy Date: Mon, 25 Jul 2022 12:44:12 +0200 Subject: [PATCH 1/6] Add support for unbonded vesting amounts unbonding period --- contracts/tg4-stake/src/claim.rs | 21 ++++- contracts/tg4-stake/src/contract.rs | 125 +++++++++++++++++----------- contracts/tg4-stake/src/msg.rs | 2 +- 3 files changed, 94 insertions(+), 54 deletions(-) diff --git a/contracts/tg4-stake/src/claim.rs b/contracts/tg4-stake/src/claim.rs index 05b186bc..f5636300 100644 --- a/contracts/tg4-stake/src/claim.rs +++ b/contracts/tg4-stake/src/claim.rs @@ -19,8 +19,10 @@ const DEFAULT_LIMIT: u32 = 30; pub struct Claim { /// Address owning the claim pub addr: Addr, - /// Amount of tokens in claim + /// Liquid amount of tokens in claim pub amount: Uint128, + /// Vesting amount of tokens in claim + pub vesting_amount: Uint128, /// Release time of the claim. Originally in `cw_controllers` it is an `Expiration` type, but /// here we need to query for claims via release time, and expiration is impossible to be /// properly sorted, as it is impossible to properly compare expiration by height and @@ -43,10 +45,17 @@ impl<'a> IndexList for ClaimIndexes<'a> { } impl Claim { - pub fn new(addr: Addr, amount: u128, released: Expiration, creation_height: u64) -> Self { + pub fn new( + addr: Addr, + amount: u128, + vesting_amount: u128, + released: Expiration, + creation_height: u64, + ) -> Self { Claim { addr, amount: amount.into(), + vesting_amount: vesting_amount.into(), release_at: released, creation_height, } @@ -80,6 +89,7 @@ impl<'a> Claims<'a> { storage: &mut dyn Storage, addr: Addr, amount: Uint128, + vesting_amount: Uint128, release_at: Expiration, creation_height: u64, ) -> StdResult<()> { @@ -92,11 +102,13 @@ impl<'a> Claims<'a> { match claim { Some(mut claim) => { claim.amount += amount; + claim.vesting_amount += vesting_amount; Ok(claim) } None => Ok(Claim { addr: addr.clone(), amount, + vesting_amount, release_at, creation_height, }), @@ -115,7 +127,7 @@ impl<'a> Claims<'a> { addr: &Addr, block: &BlockInfo, limit: impl Into>, - ) -> StdResult { + ) -> StdResult<(Uint128, Uint128)> { let claims = self .claims .prefix(addr) @@ -129,10 +141,11 @@ impl<'a> Claims<'a> { let claims = self.collect_claims(claims, limit.into())?; let amount = claims.iter().map(|claim| claim.amount).sum(); + let vesting_amount = claims.iter().map(|claim| claim.vesting_amount).sum(); self.release_claims(storage, claims)?; - Ok(amount) + Ok((amount, vesting_amount)) } /// This iterates over all mature claims of any addresses, and removes them. Up to `limit` diff --git a/contracts/tg4-stake/src/contract.rs b/contracts/tg4-stake/src/contract.rs index 848f6b84..42dc8c87 100644 --- a/contracts/tg4-stake/src/contract.rs +++ b/contracts/tg4-stake/src/contract.rs @@ -233,23 +233,14 @@ pub fn execute_unbond( STAKE_VESTING.update(deps.storage, &info.sender, |stake| -> StdResult<_> { Ok(stake.unwrap_or_default().checked_sub(vesting_amount)?) })?; - // Undelegate (unstake from contract) to sender's vesting account - if vesting_amount > Uint128::zero() { - let msg = TgradeMsg::Undelegate { - funds: coin(vesting_amount.into(), cfg.denom.clone()), - recipient: info.sender.to_string(), - }; - res = res - .add_message(msg) - .add_attribute("vesting_amount", vesting_amount); - } - // Create claim for unbonded liquid amount + // Create claim for unbonded liquid and vesting amounts let completion = cfg.unbonding_period.after(&env.block); claims().create_claim( deps.storage, info.sender.clone(), min(stake, amount), + vesting_amount, completion, env.block.height, )?; @@ -455,22 +446,38 @@ pub fn execute_claim( env: Env, info: MessageInfo, ) -> Result { - let release = claims().claim_addr(deps.storage, &info.sender, &env.block, None)?; - if release.is_zero() { + let (release, vesting_release) = + claims().claim_addr(deps.storage, &info.sender, &env.block, None)?; + if release.is_zero() && vesting_release.is_zero() { return Err(ContractError::NothingToClaim {}); } let config = CONFIG.load(deps.storage)?; - let amount = coins(release.into(), config.denom); - let res = Response::new() + let mut res = Response::new() .add_attribute("action", "claim") - .add_attribute("tokens", coins_to_string(&amount)) - .add_attribute("sender", &info.sender) - .add_message(BankMsg::Send { - to_address: info.sender.into(), - amount, - }); + .add_attribute("sender", &info.sender); + + if !release.is_zero() { + let amount = coins(release.into(), config.denom.clone()); + res = res + .add_attribute("liquid_tokens", coins_to_string(&amount)) + .add_message(BankMsg::Send { + to_address: info.sender.clone().into(), + amount, + }); + } + + if !vesting_release.is_zero() { + let vesting_amount = coin(vesting_release.into(), config.denom); + // Undelegate (unstake from contract) to sender's vesting account + res = res + .add_attribute("vesting_tokens", coins_to_string(&[vesting_amount.clone()])) + .add_message(TgradeMsg::Undelegate { + funds: vesting_amount, + recipient: info.sender.to_string(), + }); + } Ok(res) } @@ -1058,12 +1065,12 @@ mod tests { Member { addr: USER1.into(), points: 12, - start_height: None + start_height: None, }, Member { addr: USER2.into(), points: 7, - start_height: None + start_height: None, }, ] ); @@ -1077,7 +1084,7 @@ mod tests { vec![Member { addr: USER1.into(), points: 12, - start_height: None + start_height: None, },] ); @@ -1093,7 +1100,7 @@ mod tests { vec![Member { addr: USER2.into(), points: 7, - start_height: None + start_height: None, },] ); @@ -1123,18 +1130,18 @@ mod tests { Member { addr: USER1.into(), points: 11, - start_height: None + start_height: None, }, Member { addr: USER2.into(), points: 6, - start_height: None + start_height: None, }, Member { addr: USER3.into(), points: 5, - start_height: None - } + start_height: None, + }, ] ); @@ -1149,7 +1156,7 @@ mod tests { vec![Member { addr: USER1.into(), points: 11, - start_height: None + start_height: None, },] ); @@ -1167,13 +1174,13 @@ mod tests { Member { addr: USER2.into(), points: 6, - start_height: None + start_height: None, }, Member { addr: USER3.into(), points: 5, - start_height: None - } + start_height: None, + }, ] ); @@ -1230,7 +1237,7 @@ mod tests { ContractError::Std(StdError::overflow(OverflowError::new( OverflowOperation::Sub, 4900, - 5000 + 5000, ))) ); } @@ -1278,7 +1285,7 @@ mod tests { // create some data bond(deps.as_mut(), (4_000, 7_500), (7_500, 0), (3_000, 1_000), 1); let height_delta = 2; - // Only 4_000 (liquid) will be claimed for USER1 + // 4_000 (liquid) and 500 (vesting) will be claimed for USER1 unbond(deps.as_mut(), 4_500, 2_600, 0, height_delta, 0); let mut env = mock_env(); env.block.height += height_delta; @@ -1290,8 +1297,9 @@ mod tests { vec![Claim::new( Addr::unchecked(USER1), 4_000, + 500, expires, - env.block.height + env.block.height, )] ); assert_eq!( @@ -1299,8 +1307,9 @@ mod tests { vec![Claim::new( Addr::unchecked(USER2), 2_600, + 0, expires, - env.block.height + env.block.height, )] ); assert_eq!( @@ -1323,15 +1332,22 @@ mod tests { vec![Claim::new( Addr::unchecked(USER1), 4_000, + 500, expires, - env.block.height + env.block.height, )] ); assert_eq!( get_claims(deps.as_ref(), Addr::unchecked(USER2), None, None), vec![ - Claim::new(Addr::unchecked(USER2), 2_600, expires, env.block.height), - Claim::new(Addr::unchecked(USER2), 1_345, expires2, env2.block.height) + Claim::new(Addr::unchecked(USER2), 2_600, 0, expires, env.block.height), + Claim::new( + Addr::unchecked(USER2), + 1_345, + 0, + expires2, + env2.block.height, + ), ] ); assert_eq!( @@ -1339,8 +1355,9 @@ mod tests { vec![Claim::new( Addr::unchecked(USER3), 1_500, + 0, expires2, - env2.block.height + env2.block.height, )] ); @@ -1367,10 +1384,16 @@ mod tests { .unwrap(); assert_eq!( res.messages, - vec![SubMsg::new(BankMsg::Send { - to_address: USER1.into(), - amount: coins(4_000, DENOM), - })] + vec![ + SubMsg::new(BankMsg::Send { + to_address: USER1.into(), + amount: coins(4_000, DENOM), + }), + SubMsg::new(TgradeMsg::Undelegate { + funds: coin(500, DENOM), + recipient: USER1.into(), + }) + ] ); // second releases partially @@ -1409,8 +1432,9 @@ mod tests { vec![Claim::new( Addr::unchecked(USER2), 1_345, + 0, expires2, - env2.block.height + env2.block.height, )] ); assert_eq!( @@ -1418,8 +1442,9 @@ mod tests { vec![Claim::new( Addr::unchecked(USER3), 1_500, + 0, expires2, - env2.block.height + env2.block.height, )] ); @@ -1833,8 +1858,9 @@ mod tests { vec![Claim::new( Addr::unchecked(USER1), 12_000, + 0, expires, - env.block.height + env.block.height, )] ); @@ -1845,8 +1871,9 @@ mod tests { vec![Claim::new( Addr::unchecked(USER1), 9_600, + 0, expires, - env.block.height + env.block.height, )] ); assert_burned(res, &coins(2_400, &cfg.denom), &[]); diff --git a/contracts/tg4-stake/src/msg.rs b/contracts/tg4-stake/src/msg.rs index 9dd675d3..bb85cab3 100644 --- a/contracts/tg4-stake/src/msg.rs +++ b/contracts/tg4-stake/src/msg.rs @@ -45,7 +45,7 @@ pub enum ExecuteMsg { /// Tokens will be unbonded from the liquid stake first, and then from the vesting stake /// if available. Unbond { tokens: Coin }, - /// Claim is used to claim your native tokens that you previously "unbonded" + /// Claim is used to claim your native and vesting tokens that you previously "unbonded" /// after the contract-defined waiting period (eg. 1 week) Claim {}, From 3785b723c503e14a4c7d9a1a399ff48c83efd343 Mon Sep 17 00:00:00 2001 From: Mauro Lacy Date: Mon, 25 Jul 2022 17:59:11 +0200 Subject: [PATCH 2/6] Fix: slash also the vesting amount in the pending claims --- contracts/tg4-stake/src/claim.rs | 8 +++-- contracts/tg4-stake/src/contract.rs | 45 ++++++++++++++++------------- 2 files changed, 31 insertions(+), 22 deletions(-) diff --git a/contracts/tg4-stake/src/claim.rs b/contracts/tg4-stake/src/claim.rs index f5636300..47383379 100644 --- a/contracts/tg4-stake/src/claim.rs +++ b/contracts/tg4-stake/src/claim.rs @@ -224,7 +224,7 @@ impl<'a> Claims<'a> { storage: &mut dyn Storage, address: Addr, portion: Decimal, - ) -> StdResult { + ) -> StdResult<(Uint128, Uint128)> { let claims: StdResult> = self .claims .prefix(&address) @@ -233,21 +233,25 @@ impl<'a> Claims<'a> { let claims = claims?; let mut total_slashed = Uint128::zero(); + let mut total_vesting_slashed = Uint128::zero(); for (release_at, claim) in claims { let key = (&address, release_at); let slashed = claim.amount * portion; + let vesting_slashed = claim.vesting_amount * portion; let mut new_claim = claim.clone(); new_claim.amount -= slashed; + new_claim.vesting_amount -= vesting_slashed; self.claims .replace(storage, key, Some(&new_claim), Some(&claim))?; total_slashed += slashed; + total_vesting_slashed += vesting_slashed; } - Ok(total_slashed) + Ok((total_slashed, total_vesting_slashed)) } pub fn query_claims( diff --git a/contracts/tg4-stake/src/contract.rs b/contracts/tg4-stake/src/contract.rs index 42dc8c87..8ea87b4b 100644 --- a/contracts/tg4-stake/src/contract.rs +++ b/contracts/tg4-stake/src/contract.rs @@ -337,39 +337,44 @@ pub fn execute_slash( // slash the liquid stake, if any let mut new_liquid_stake = Uint128::zero(); + let mut liquid_slashed = Uint128::zero(); if let Some(liquid_stake) = liquid_stake { - let mut liquid_slashed = liquid_stake * portion; + liquid_slashed = liquid_stake * portion; new_liquid_stake = STAKE.update(deps.storage, &addr, |stake| -> StdResult<_> { Ok(stake.unwrap_or_default().sub(liquid_slashed)) })?; - - // slash the claims - liquid_slashed += claims().slash_claims_for_addr(deps.storage, addr.clone(), portion)?; - - // burn the liquid slashed tokens - if liquid_slashed > Uint128::zero() { - let burn_liquid_msg = BankMsg::Burn { - amount: coins(liquid_slashed.u128(), &cfg.denom), - }; - res = res.add_message(burn_liquid_msg); - } } // slash the vesting stake, if any let mut new_vesting_stake = Uint128::zero(); + let mut vesting_slashed = Uint128::zero(); if let Some(vesting_stake) = vesting_stake { - let vesting_slashed = vesting_stake * portion; + vesting_slashed = vesting_stake * portion; new_vesting_stake = STAKE_VESTING.update(deps.storage, &addr, |stake| -> StdResult<_> { Ok(stake.unwrap_or_default().sub(vesting_slashed)) })?; + } - // burn the vesting slashed tokens - if vesting_slashed > Uint128::zero() { - let burn_vesting_msg = BankMsg::Burn { - amount: coins(vesting_slashed.u128(), &cfg.denom), - }; - res = res.add_message(burn_vesting_msg); - } + // slash the liquid and vesting claims + let (liquid_claims_slashed, vesting_claims_slashed) = + claims().slash_claims_for_addr(deps.storage, addr.clone(), portion)?; + liquid_slashed += liquid_claims_slashed; + vesting_slashed += vesting_claims_slashed; + + // burn the liquid slashed tokens + if liquid_slashed > Uint128::zero() { + let burn_liquid_msg = BankMsg::Burn { + amount: coins(liquid_slashed.u128(), &cfg.denom), + }; + res = res.add_message(burn_liquid_msg); + } + + // burn the vesting slashed tokens + if vesting_slashed > Uint128::zero() { + let burn_vesting_msg = BankMsg::Burn { + amount: coins(vesting_slashed.u128(), &cfg.denom), + }; + res = res.add_message(burn_vesting_msg); } res.messages.extend(update_membership( From e43946896be0de866641ba29aeb2f3680032c33d Mon Sep 17 00:00:00 2001 From: Mauro Lacy Date: Mon, 25 Jul 2022 22:05:14 +0200 Subject: [PATCH 3/6] Improve slashing claims tests for vesting amounts --- contracts/tg4-stake/src/contract.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/contracts/tg4-stake/src/contract.rs b/contracts/tg4-stake/src/contract.rs index 8ea87b4b..1e4e5998 100644 --- a/contracts/tg4-stake/src/contract.rs +++ b/contracts/tg4-stake/src/contract.rs @@ -1851,8 +1851,9 @@ mod tests { // create some data bond_liquid(deps.as_mut(), 12_000, 7_500, 4_000, 1); + bond_vesting(deps.as_mut(), 1_000, 750, 40, 1); let height_delta = 2; - unbond(deps.as_mut(), 12_000, 2_600, 0, height_delta, 0); + unbond(deps.as_mut(), 13_000, 2_600, 0, height_delta, 0); let mut env = mock_env(); env.block.height += height_delta; @@ -1863,7 +1864,7 @@ mod tests { vec![Claim::new( Addr::unchecked(USER1), 12_000, - 0, + 1_000, expires, env.block.height, )] @@ -1876,12 +1877,12 @@ mod tests { vec![Claim::new( Addr::unchecked(USER1), 9_600, - 0, + 800, expires, env.block.height, )] ); - assert_burned(res, &coins(2_400, &cfg.denom), &[]); + assert_burned(res, &coins(2_400, &cfg.denom), &coins(200, &cfg.denom)); } #[test] From 91d99187b0bf54cecb2dcc5274fbe6ac1bbfc853 Mon Sep 17 00:00:00 2001 From: Mauro Lacy Date: Tue, 26 Jul 2022 15:03:26 +0200 Subject: [PATCH 4/6] Avoid migration / breaking change by using optional vesting_account field in claims --- contracts/tg4-stake/src/claim.rs | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/contracts/tg4-stake/src/claim.rs b/contracts/tg4-stake/src/claim.rs index 47383379..441a89ef 100644 --- a/contracts/tg4-stake/src/claim.rs +++ b/contracts/tg4-stake/src/claim.rs @@ -22,7 +22,7 @@ pub struct Claim { /// Liquid amount of tokens in claim pub amount: Uint128, /// Vesting amount of tokens in claim - pub vesting_amount: Uint128, + pub vesting_amount: Option, /// Release time of the claim. Originally in `cw_controllers` it is an `Expiration` type, but /// here we need to query for claims via release time, and expiration is impossible to be /// properly sorted, as it is impossible to properly compare expiration by height and @@ -55,7 +55,7 @@ impl Claim { Claim { addr, amount: amount.into(), - vesting_amount: vesting_amount.into(), + vesting_amount: Some(vesting_amount.into()), release_at: released, creation_height, } @@ -102,13 +102,14 @@ impl<'a> Claims<'a> { match claim { Some(mut claim) => { claim.amount += amount; - claim.vesting_amount += vesting_amount; + claim.vesting_amount = + Some(claim.vesting_amount.unwrap_or_default() + vesting_amount); Ok(claim) } None => Ok(Claim { addr: addr.clone(), amount, - vesting_amount, + vesting_amount: Some(vesting_amount), release_at, creation_height, }), @@ -141,7 +142,10 @@ impl<'a> Claims<'a> { let claims = self.collect_claims(claims, limit.into())?; let amount = claims.iter().map(|claim| claim.amount).sum(); - let vesting_amount = claims.iter().map(|claim| claim.vesting_amount).sum(); + let vesting_amount = claims + .iter() + .map(|claim| claim.vesting_amount.unwrap_or_default()) + .sum(); self.release_claims(storage, claims)?; @@ -239,10 +243,11 @@ impl<'a> Claims<'a> { let key = (&address, release_at); let slashed = claim.amount * portion; - let vesting_slashed = claim.vesting_amount * portion; + let vesting_slashed = claim.vesting_amount.unwrap_or_default() * portion; let mut new_claim = claim.clone(); new_claim.amount -= slashed; - new_claim.vesting_amount -= vesting_slashed; + new_claim.vesting_amount = + Some(claim.vesting_amount.unwrap_or_default() - vesting_slashed); self.claims .replace(storage, key, Some(&new_claim), Some(&claim))?; From 8431655ff6e208094683115ec4958391e0db9a4a Mon Sep 17 00:00:00 2001 From: Mauro Lacy Date: Tue, 26 Jul 2022 10:13:36 +0200 Subject: [PATCH 5/6] Set version: 0.13.0 --- Cargo.lock | 32 ++++++++++---------- contracts/tg4-engagement/Cargo.toml | 10 +++--- contracts/tg4-group/Cargo.toml | 4 +-- contracts/tg4-mixer/Cargo.toml | 12 ++++---- contracts/tg4-stake/Cargo.toml | 10 +++--- contracts/tgrade-community-pool/Cargo.toml | 16 +++++----- contracts/tgrade-gov-reflect/Cargo.toml | 4 +-- contracts/tgrade-validator-voting/Cargo.toml | 20 ++++++------ contracts/tgrade-valset/Cargo.toml | 14 ++++----- contracts/tgrade-vesting-account/Cargo.toml | 8 ++--- packages/bindings-test/Cargo.toml | 4 +-- packages/bindings/Cargo.toml | 2 +- packages/test-utils/Cargo.toml | 4 +-- packages/tg3/Cargo.toml | 6 ++-- packages/tg4/Cargo.toml | 4 +-- packages/utils/Cargo.toml | 6 ++-- packages/voting-contract/Cargo.toml | 14 ++++----- 17 files changed, 85 insertions(+), 85 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 395733cf..2d8701b3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1545,7 +1545,7 @@ dependencies = [ [[package]] name = "tg-bindings" -version = "0.12.0" +version = "0.13.0" dependencies = [ "base64", "cosmwasm-schema", @@ -1558,7 +1558,7 @@ dependencies = [ [[package]] name = "tg-bindings-test" -version = "0.12.0" +version = "0.13.0" dependencies = [ "anyhow", "cosmwasm-std", @@ -1572,7 +1572,7 @@ dependencies = [ [[package]] name = "tg-test-utils" -version = "0.12.0" +version = "0.13.0" dependencies = [ "cosmwasm-std", "tg-voting-contract", @@ -1580,7 +1580,7 @@ dependencies = [ [[package]] name = "tg-utils" -version = "0.12.0" +version = "0.13.0" dependencies = [ "cosmwasm-std", "cw-controllers", @@ -1597,7 +1597,7 @@ dependencies = [ [[package]] name = "tg-voting-contract" -version = "0.12.0" +version = "0.13.0" dependencies = [ "anyhow", "cosmwasm-schema", @@ -1619,7 +1619,7 @@ dependencies = [ [[package]] name = "tg3" -version = "0.12.0" +version = "0.13.0" dependencies = [ "cosmwasm-schema", "cosmwasm-std", @@ -1631,7 +1631,7 @@ dependencies = [ [[package]] name = "tg4" -version = "0.12.0" +version = "0.13.0" dependencies = [ "cosmwasm-schema", "cosmwasm-std", @@ -1642,7 +1642,7 @@ dependencies = [ [[package]] name = "tg4-engagement" -version = "0.12.0" +version = "0.13.0" dependencies = [ "anyhow", "cosmwasm-schema", @@ -1664,7 +1664,7 @@ dependencies = [ [[package]] name = "tg4-group" -version = "0.12.0" +version = "0.13.0" dependencies = [ "cosmwasm-schema", "cosmwasm-std", @@ -1681,7 +1681,7 @@ dependencies = [ [[package]] name = "tg4-mixer" -version = "0.12.0" +version = "0.13.0" dependencies = [ "cosmwasm-schema", "cosmwasm-std", @@ -1706,7 +1706,7 @@ dependencies = [ [[package]] name = "tg4-stake" -version = "0.12.0" +version = "0.13.0" dependencies = [ "cosmwasm-schema", "cosmwasm-std", @@ -1726,7 +1726,7 @@ dependencies = [ [[package]] name = "tgrade-community-pool" -version = "0.12.0" +version = "0.13.0" dependencies = [ "anyhow", "cosmwasm-schema", @@ -1747,7 +1747,7 @@ dependencies = [ [[package]] name = "tgrade-gov-reflect" -version = "0.12.0" +version = "0.13.0" dependencies = [ "cosmwasm-schema", "cosmwasm-std", @@ -1760,7 +1760,7 @@ dependencies = [ [[package]] name = "tgrade-validator-voting" -version = "0.12.0" +version = "0.13.0" dependencies = [ "anyhow", "cosmwasm-schema", @@ -1782,7 +1782,7 @@ dependencies = [ [[package]] name = "tgrade-valset" -version = "0.12.0" +version = "0.13.0" dependencies = [ "anyhow", "assert_matches", @@ -1810,7 +1810,7 @@ dependencies = [ [[package]] name = "tgrade-vesting-account" -version = "0.12.0" +version = "0.13.0" dependencies = [ "anyhow", "assert_matches", diff --git a/contracts/tg4-engagement/Cargo.toml b/contracts/tg4-engagement/Cargo.toml index 8365a1ac..b9fc18c7 100644 --- a/contracts/tg4-engagement/Cargo.toml +++ b/contracts/tg4-engagement/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tg4-engagement" -version = "0.12.0" +version = "0.13.0" authors = ["Ethan Frey "] edition = "2018" description = "Simple TG4 implementation of group membership controlled by an admin" @@ -25,9 +25,9 @@ cw-controllers = "0.13.4" cw-storage-plus = "0.13.4" cw-utils = "0.13.4" cw2 = "0.13.4" -tg-utils = { version = "0.12.0", path = "../../packages/utils" } -tg-bindings = { version = "0.12.0", path = "../../packages/bindings" } -tg4 = { path = "../../packages/tg4", version = "0.12.0" } +tg-utils = { version = "0.13.0", path = "../../packages/utils" } +tg-bindings = { version = "0.13.0", path = "../../packages/bindings" } +tg4 = { path = "../../packages/tg4", version = "0.13.0" } schemars = "0.8" serde = { version = "1.0.103", default-features = false, features = ["derive"] } thiserror = "1.0.21" @@ -37,4 +37,4 @@ anyhow = "1" cosmwasm-schema = "1.0.0" cw-multi-test = "0.13.4" derivative = "2" -tg-bindings-test = { version = "0.12.0", path = "../../packages/bindings-test" } +tg-bindings-test = { version = "0.13.0", path = "../../packages/bindings-test" } diff --git a/contracts/tg4-group/Cargo.toml b/contracts/tg4-group/Cargo.toml index 21f725b3..ffe4ed70 100644 --- a/contracts/tg4-group/Cargo.toml +++ b/contracts/tg4-group/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tg4-group" -version = "0.12.0" +version = "0.13.0" authors = ["Mauro Lacy "] edition = "2018" description = "Simple tg4 implementation of group membership controlled by admin" @@ -34,7 +34,7 @@ cw-controllers = "0.13.4" cw-storage-plus = "0.13.4" schemars = "0.8.1" serde = { version = "1.0.103", default-features = false, features = ["derive"] } -tg4 = { version = "0.12.0", path = "../../packages/tg4" } +tg4 = { version = "0.13.0", path = "../../packages/tg4" } thiserror = { version = "1.0.23" } [dev-dependencies] diff --git a/contracts/tg4-mixer/Cargo.toml b/contracts/tg4-mixer/Cargo.toml index 4eb6b24a..6e98941f 100644 --- a/contracts/tg4-mixer/Cargo.toml +++ b/contracts/tg4-mixer/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tg4-mixer" -version = "0.12.0" +version = "0.13.0" authors = ["Ethan Frey "] edition = "2018" description = "TG4 implementation that combines two different groups with a merge function" @@ -33,17 +33,17 @@ rust_decimal_macros = { version = "1.16", default-features = false } thiserror = "1.0.21" schemars = "0.8" serde = { version = "1.0.103", default-features = false, features = ["derive"] } -tg4 = { path = "../../packages/tg4", version = "0.12.0" } -tg-utils = { path = "../../packages/utils", version = "0.12.0" } -tg-bindings = { path = "../../packages/bindings", version = "0.12.0" } +tg4 = { path = "../../packages/tg4", version = "0.13.0" } +tg-utils = { path = "../../packages/utils", version = "0.13.0" } +tg-bindings = { path = "../../packages/bindings", version = "0.13.0" } [dev-dependencies] cosmwasm-schema = "1.0.0" # bench dependencies cosmwasm-vm = { version = "1.0.0" } cw-multi-test = "0.13.4" -tg4-engagement = { path = "../tg4-engagement", version = "0.12.0", features = ["library"] } -tg4-stake = { path = "../tg4-stake", version = "0.12.0", features = ["library"] } +tg4-engagement = { path = "../tg4-engagement", version = "0.13.0", features = ["library"] } +tg4-stake = { path = "../tg4-stake", version = "0.13.0", features = ["library"] } [[bench]] name = "main" diff --git a/contracts/tg4-stake/Cargo.toml b/contracts/tg4-stake/Cargo.toml index f78e6fb9..26ff1b32 100644 --- a/contracts/tg4-stake/Cargo.toml +++ b/contracts/tg4-stake/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tg4-stake" -version = "0.12.0" +version = "0.13.0" authors = ["Ethan Frey "] edition = "2018" description = "TG4 implementation of group based on staked tokens" @@ -28,11 +28,11 @@ cw-storage-plus = "0.13.4" itertools = "0.10" schemars = "0.8.1" serde = { version = "1.0.103", default-features = false, features = ["derive"] } -tg4 = { path = "../../packages/tg4", version = "0.12.0" } -tg-utils = { path = "../../packages/utils", version = "0.12.0" } -tg-bindings = { path = "../../packages/bindings", version = "0.12.0" } +tg4 = { path = "../../packages/tg4", version = "0.13.0" } +tg-utils = { path = "../../packages/utils", version = "0.13.0" } +tg-bindings = { path = "../../packages/bindings", version = "0.13.0" } thiserror = "1.0.21" [dev-dependencies] cosmwasm-schema = "1.0.0" -tg-bindings-test = { path = "../../packages/bindings-test", version = "0.12.0" } +tg-bindings-test = { path = "../../packages/bindings-test", version = "0.13.0" } diff --git a/contracts/tgrade-community-pool/Cargo.toml b/contracts/tgrade-community-pool/Cargo.toml index e7e97474..eb53e39b 100644 --- a/contracts/tgrade-community-pool/Cargo.toml +++ b/contracts/tgrade-community-pool/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tgrade-community-pool" -version = "0.12.0" +version = "0.13.0" authors = ["Bartłomiej Kuras "] edition = "2018" description = "Implementing tgrade-community-pool voting contract" @@ -21,16 +21,16 @@ cosmwasm-std = "1.0.0" cw2 = "0.13.4" schemars = "0.8.1" serde = { version = "1", default-features = false, features = ["derive"] } -tg-bindings = { path = "../../packages/bindings", version = "0.12.0" } -tg-utils = { path = "../../packages/utils", version = "0.12.0" } -tg-voting-contract = { version = "0.12.0", path = "../../packages/voting-contract" } -tg3 = { path = "../../packages/tg3", version = "0.12.0" } -tg4-engagement = { path = "../tg4-engagement", version = "0.12.0", features = ["library"] } +tg-bindings = { path = "../../packages/bindings", version = "0.13.0" } +tg-utils = { path = "../../packages/utils", version = "0.13.0" } +tg-voting-contract = { version = "0.13.0", path = "../../packages/voting-contract" } +tg3 = { path = "../../packages/tg3", version = "0.13.0" } +tg4-engagement = { path = "../tg4-engagement", version = "0.13.0", features = ["library"] } thiserror = "1" [dev-dependencies] anyhow = "1" cosmwasm-schema = "1.0.0" cw-multi-test = "0.13.4" -tg-bindings-test = { path = "../../packages/bindings-test", version = "0.12.0" } -tg4 = { path = "../../packages/tg4", version = "0.12.0" } +tg-bindings-test = { path = "../../packages/bindings-test", version = "0.13.0" } +tg4 = { path = "../../packages/tg4", version = "0.13.0" } diff --git a/contracts/tgrade-gov-reflect/Cargo.toml b/contracts/tgrade-gov-reflect/Cargo.toml index 5fce25f6..f2a16a71 100644 --- a/contracts/tgrade-gov-reflect/Cargo.toml +++ b/contracts/tgrade-gov-reflect/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tgrade-gov-reflect" -version = "0.12.0" +version = "0.13.0" authors = ["Ethan Frey "] edition = "2018" description = "Implementing tgrade-gov-reflect voting contract" @@ -28,7 +28,7 @@ cosmwasm-std = "1.0.0" cw-storage-plus = "0.13.4" schemars = "0.8.1" serde = { version = "1.0.103", default-features = false, features = ["derive"] } -tg-bindings = { version = "0.12.0", path = "../../packages/bindings" } +tg-bindings = { version = "0.13.0", path = "../../packages/bindings" } thiserror = "1" [dev-dependencies] diff --git a/contracts/tgrade-validator-voting/Cargo.toml b/contracts/tgrade-validator-voting/Cargo.toml index b49a9456..1638a973 100644 --- a/contracts/tgrade-validator-voting/Cargo.toml +++ b/contracts/tgrade-validator-voting/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tgrade-validator-voting" -version = "0.12.0" +version = "0.13.0" authors = ["Ethan Frey "] edition = "2018" description = "Implementing tgrade-validator-voting" @@ -21,10 +21,10 @@ cosmwasm-std = "1.0.0" cw2 = "0.13.4" schemars = "0.8.1" serde = { version = "1", default-features = false, features = ["derive"] } -tg-bindings = { path = "../../packages/bindings", version = "0.12.0" } -tg-utils = { path = "../../packages/utils", version = "0.12.0" } -tg-voting-contract = { version = "0.12.0", path = "../../packages/voting-contract" } -tg3 = { path = "../../packages/tg3", version = "0.12.0" } +tg-bindings = { path = "../../packages/bindings", version = "0.13.0" } +tg-utils = { path = "../../packages/utils", version = "0.13.0" } +tg-voting-contract = { version = "0.13.0", path = "../../packages/voting-contract" } +tg3 = { path = "../../packages/tg3", version = "0.13.0" } thiserror = "1" [dev-dependencies] @@ -32,8 +32,8 @@ anyhow = "1" cosmwasm-schema = "1.0.0" cw-multi-test = "0.13.4" cw-storage-plus = "0.13.4" -tg-bindings-test = { version = "0.12.0", path = "../../packages/bindings-test" } -tg-utils = { version = "0.12.0", path = "../../packages/utils" } -tg-voting-contract = { version = "0.12.0", path = "../../packages/voting-contract" } -tg4 = { path = "../../packages/tg4", version = "0.12.0" } -tg4-engagement = { path = "../tg4-engagement", version = "0.12.0", features = ["library"] } +tg-bindings-test = { version = "0.13.0", path = "../../packages/bindings-test" } +tg-utils = { version = "0.13.0", path = "../../packages/utils" } +tg-voting-contract = { version = "0.13.0", path = "../../packages/voting-contract" } +tg4 = { path = "../../packages/tg4", version = "0.13.0" } +tg4-engagement = { path = "../tg4-engagement", version = "0.13.0", features = ["library"] } diff --git a/contracts/tgrade-valset/Cargo.toml b/contracts/tgrade-valset/Cargo.toml index 35f0907f..b52f6946 100644 --- a/contracts/tgrade-valset/Cargo.toml +++ b/contracts/tgrade-valset/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tgrade-valset" -version = "0.12.0" +version = "0.13.0" authors = ["Ethan Frey "] edition = "2018" description = "Control the validator set based on membership of trusted tg4 contract" @@ -35,9 +35,9 @@ schemars = "0.8" semver = "1" serde = { version = "1.0.103", default-features = false, features = ["derive"] } thiserror = "1.0.21" -tg4 = { path = "../../packages/tg4", version = "0.12.0" } -tg-bindings = { version = "0.12.0", path = "../../packages/bindings" } -tg-utils = { version = "0.12.0", path = "../../packages/utils" } +tg4 = { path = "../../packages/tg4", version = "0.13.0" } +tg-bindings = { version = "0.13.0", path = "../../packages/bindings" } +tg-utils = { version = "0.13.0", path = "../../packages/utils" } # For integration tests ("integration" feature) bech32 = { version = "0.8.1", optional = true } @@ -49,7 +49,7 @@ assert_matches = "1.5" cosmwasm-schema = "1.0.0" cw-multi-test = "0.13.4" derivative = "2" -tg4-engagement = { path = "../tg4-engagement", version = "0.12.0" } -tg4-stake = { path = "../tg4-stake", version = "0.12.0" } +tg4-engagement = { path = "../tg4-engagement", version = "0.13.0" } +tg4-stake = { path = "../tg4-stake", version = "0.13.0" } # we enable multitest feature only for tests -tg-bindings-test = { path = "../../packages/bindings-test", version = "0.12.0" } +tg-bindings-test = { path = "../../packages/bindings-test", version = "0.13.0" } diff --git a/contracts/tgrade-vesting-account/Cargo.toml b/contracts/tgrade-vesting-account/Cargo.toml index 92b50922..1d1f8cf4 100644 --- a/contracts/tgrade-vesting-account/Cargo.toml +++ b/contracts/tgrade-vesting-account/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tgrade-vesting-account" -version = "0.12.0" +version = "0.13.0" authors = ["Jakub Bogucki "] edition = "2018" description = "Vesting Account as a contract" @@ -22,8 +22,8 @@ cw2 = "0.13.4" cw-storage-plus = "0.13.4" schemars = "0.8.1" serde = { version = "1.0.103", default-features = false, features = ["derive"] } -tg-bindings = { version = "0.12.0", path = "../../packages/bindings" } -tg-utils = { version = "0.12.0", path = "../../packages/utils" } +tg-bindings = { version = "0.13.0", path = "../../packages/bindings" } +tg-utils = { version = "0.13.0", path = "../../packages/utils" } thiserror = "1" [dev-dependencies] @@ -32,4 +32,4 @@ assert_matches = "1" derivative = "2" cosmwasm-schema = "1.0.0" cw-multi-test = "0.13.4" -tg-bindings-test = { version = "0.12.0", path = "../../packages/bindings-test" } +tg-bindings-test = { version = "0.13.0", path = "../../packages/bindings-test" } diff --git a/packages/bindings-test/Cargo.toml b/packages/bindings-test/Cargo.toml index d4d9a9d2..1f465e67 100644 --- a/packages/bindings-test/Cargo.toml +++ b/packages/bindings-test/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tg-bindings-test" -version = "0.12.0" +version = "0.13.0" authors = ["Ethan Frey "] edition = "2018" description = "Multitest (and other test helpers) support for Tgrade-specific contracts" @@ -15,5 +15,5 @@ cw-multi-test = "0.13.4" cw-storage-plus = "0.13.4" schemars = "0.8" serde = { version = "1.0.103", default-features = false, features = ["derive"] } -tg-bindings = { version = "0.12.0", path = "../bindings" } +tg-bindings = { version = "0.13.0", path = "../bindings" } thiserror = "1.0.21" diff --git a/packages/bindings/Cargo.toml b/packages/bindings/Cargo.toml index 3c0500cd..1d7b1790 100644 --- a/packages/bindings/Cargo.toml +++ b/packages/bindings/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tg-bindings" -version = "0.12.0" +version = "0.13.0" authors = ["Ethan Frey "] edition = "2018" description = "Bindings for CustomMsg and CustomQuery for the Tgrade blockchain" diff --git a/packages/test-utils/Cargo.toml b/packages/test-utils/Cargo.toml index 885ea524..2dacbc8b 100644 --- a/packages/test-utils/Cargo.toml +++ b/packages/test-utils/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tg-test-utils" -version = "0.12.0" +version = "0.13.0" authors = ["Jakub Bogucki "] edition = "2018" description = "Utilities used in contract tests" @@ -10,4 +10,4 @@ license = "Apache-2.0" [dependencies] cosmwasm-std = "1.0.0" -tg-voting-contract = { path = "../voting-contract", version = "0.12.0" } +tg-voting-contract = { path = "../voting-contract", version = "0.13.0" } diff --git a/packages/tg3/Cargo.toml b/packages/tg3/Cargo.toml index 3193d6a7..9e8763bf 100644 --- a/packages/tg3/Cargo.toml +++ b/packages/tg3/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tg3" -version = "0.12.0" +version = "0.13.0" authors = ["Bartłomiej Kuras "] edition = "2018" description = "Tgrade-3 Interface: On-Chain MultiSig/Voting contracts" @@ -12,8 +12,8 @@ license = "Apache-2.0" cosmwasm-std = "1.0.0" schemars = "0.8.1" serde = { version = "1.0.103", default-features = false, features = ["derive"] } -tg-bindings = { version = "0.12.0", path = "../../packages/bindings" } -tg-utils = { version = "0.12.0", path = "../../packages/utils" } +tg-bindings = { version = "0.13.0", path = "../../packages/bindings" } +tg-utils = { version = "0.13.0", path = "../../packages/utils" } [dev-dependencies] cosmwasm-schema = "1.0.0" diff --git a/packages/tg4/Cargo.toml b/packages/tg4/Cargo.toml index ab21d858..948ea706 100644 --- a/packages/tg4/Cargo.toml +++ b/packages/tg4/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tg4" -version = "0.12.0" +version = "0.13.0" authors = ["Ethan Frey "] edition = "2018" description = "Tgrade-4 Interface: Groups Members" @@ -12,7 +12,7 @@ license = "Apache-2.0" cosmwasm-std = "1.0.0" schemars = "0.8.1" serde = { version = "1.0.103", default-features = false, features = ["derive"] } -tg-bindings = { path = "../bindings", version = "0.12.0" } +tg-bindings = { path = "../bindings", version = "0.13.0" } [dev-dependencies] cosmwasm-schema = "1.0.0" diff --git a/packages/utils/Cargo.toml b/packages/utils/Cargo.toml index f9c612e4..8234c755 100644 --- a/packages/utils/Cargo.toml +++ b/packages/utils/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tg-utils" -version = "0.12.0" +version = "0.13.0" authors = ["Ethan Frey "] edition = "2018" description = "Tgrade Utils: helpers for various contracts" @@ -19,6 +19,6 @@ cw2 = "0.13.4" schemars = "0.8.1" semver = "1" serde = { version = "1.0.103", default-features = false, features = ["derive"] } -tg4 = { path = "../tg4", version = "0.12.0" } -tg-bindings = { path = "../bindings", version = "0.12.0" } +tg4 = { path = "../tg4", version = "0.13.0" } +tg-bindings = { path = "../bindings", version = "0.13.0" } thiserror = "1.0.21" diff --git a/packages/voting-contract/Cargo.toml b/packages/voting-contract/Cargo.toml index 7b040d16..131b216e 100644 --- a/packages/voting-contract/Cargo.toml +++ b/packages/voting-contract/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tg-voting-contract" -version = "0.12.0" +version = "0.13.0" authors = ["Bartłomiej Kuras "] edition = "2018" description = "Generic utils for building voting contracts for tgrade" @@ -16,10 +16,10 @@ cw-utils = "0.13.4" cw-storage-plus = "0.13.4" schemars = "0.8.1" serde = { version = "1", default-features = false, features = ["derive"] } -tg3 = { path = "../../packages/tg3", version = "0.12.0" } -tg4 = { path = "../tg4", version = "0.12.0" } -tg-bindings = { path = "../bindings", version = "0.12.0" } -tg-utils = { version = "0.12.0", path = "../utils" } +tg3 = { path = "../../packages/tg3", version = "0.13.0" } +tg4 = { path = "../tg4", version = "0.13.0" } +tg-bindings = { path = "../bindings", version = "0.13.0" } +tg-utils = { version = "0.13.0", path = "../utils" } thiserror = "1" [dev-dependencies] @@ -27,5 +27,5 @@ anyhow = "1" cosmwasm-schema = "1.0.0" cw-multi-test = "0.13.4" derivative = "2" -tg-bindings-test = { path = "../../packages/bindings-test", version = "0.12.0" } -tg4-engagement = { path = "../../contracts/tg4-engagement", version = "0.12.0", features = ["library"] } +tg-bindings-test = { path = "../../packages/bindings-test", version = "0.13.0" } +tg4-engagement = { path = "../../contracts/tg4-engagement", version = "0.13.0", features = ["library"] } From d07adfd166f8e550c61c3d800cd8c5cf78c59941 Mon Sep 17 00:00:00 2001 From: Mauro Lacy Date: Tue, 26 Jul 2022 17:19:44 +0200 Subject: [PATCH 6/6] Update CHANGELOG --- CHANGELOG.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 27ad1c0e..13ffc5cb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,21 @@ ## [Unreleased](https://github.com/confio/poe-contracts/tree/HEAD) -[Full Changelog](https://github.com/confio/poe-contracts/compare/v0.12.0...HEAD) +[Full Changelog](https://github.com/confio/poe-contracts/compare/v0.13.0...HEAD) + +## [v0.13.0](https://github.com/confio/poe-contracts/tree/v0.13.0) (2022-07-26) + +[Full Changelog](https://github.com/confio/poe-contracts/compare/v0.12.0...v0.13.0) + +**Closed issues:** + +- bug when defining the jailing start time [\#162](https://github.com/confio/poe-contracts/issues/162) +- \[tgrade-validator-voting\] Add proposal validation during creation [\#156](https://github.com/confio/poe-contracts/issues/156) + +**Merged pull requests:** + +- Older version migration helper [\#164](https://github.com/confio/poe-contracts/pull/164) ([maurolacy](https://github.com/maurolacy)) +- Validate proposal during creation [\#163](https://github.com/confio/poe-contracts/pull/163) ([maurolacy](https://github.com/maurolacy)) ## [v0.12.0](https://github.com/confio/poe-contracts/tree/v0.12.0) (2022-07-14)