From be9fc4b5b11a8cda7269b3f6b6726772717774b0 Mon Sep 17 00:00:00 2001 From: Philip Offtermatt <57488781+p-offtermatt@users.noreply.github.com> Date: Mon, 22 Apr 2024 12:50:59 +0200 Subject: [PATCH] Clean up code comments (#20) --- contracts/atom_wars/src/contract.rs | 3 --- contracts/atom_wars/src/state.rs | 26 ++++---------------------- 2 files changed, 4 insertions(+), 25 deletions(-) diff --git a/contracts/atom_wars/src/contract.rs b/contracts/atom_wars/src/contract.rs index 4692782..2d27b4b 100644 --- a/contracts/atom_wars/src/contract.rs +++ b/contracts/atom_wars/src/contract.rs @@ -1,8 +1,5 @@ // MAIN TODOS: -// - Query methods! We want a very complete set so that it is easy for third party tribute contracts -// - Tests! // - Add real covenant logic -// - Make it work for separate tranches // - Question: How to handle the case where a proposal is executed but the covenant fails? // - Covenant Question: How to deal with someone using MEV to skew the pool ratio right before the liquidity is pulled? Streaming the liquidity pull? You'd have to set up a cron job for that. // - Covenant Question: Can people sandwich this whole thing - covenant system has price limits - but we should allow people to retry executing the prop during the round diff --git a/contracts/atom_wars/src/state.rs b/contracts/atom_wars/src/state.rs index bb546ab..a70d3d2 100644 --- a/contracts/atom_wars/src/state.rs +++ b/contracts/atom_wars/src/state.rs @@ -16,11 +16,7 @@ pub const LOCK_ID: Item = Item::new("lock_id"); pub const PROP_ID: Item = Item::new("prop_id"); -// LOCKS_MAP: key(sender_address, lock_id) -> LockEntry { -// funds: Coin, -// lock_start: Timestamp, -// lock_end: Timestamp -// } +// LOCKS_MAP: key(sender_address, lock_id) -> LockEntry pub const LOCKS_MAP: Map<(Addr, u64), LockEntry> = Map::new("locks_map"); #[cw_serde] pub struct LockEntry { @@ -29,14 +25,7 @@ pub struct LockEntry { pub lock_end: Timestamp, } -// PROP_MAP: key(round_id, tranche_id, prop_id) -> Proposal { -// round_id: u64, -// tranche_id: u64, -// proposal_id: u64, -// covenant_params: String, -// executed: bool, -// power: Uint128 -// } +// PROPOSAL_MAP: key(round_id, tranche_id, prop_id) -> Proposal pub const PROPOSAL_MAP: Map<(u64, u64, u64), Proposal> = Map::new("prop_map"); #[cw_serde] pub struct Proposal { @@ -61,11 +50,7 @@ pub struct CovenantParams { pub funding_destination_name: String, } -// VOTE_MAP: key(round_id, tranche_id, sender_addr) -> Vote { -// prop_id: u64, -// power: Uint128, -// tribute_claimed: bool -// } +// VOTE_MAP: key(round_id, tranche_id, sender_addr) -> Vote pub const VOTE_MAP: Map<(u64, u64, Addr), Vote> = Map::new("vote_map"); #[cw_serde] pub struct Vote { @@ -79,10 +64,7 @@ pub const PROPS_BY_SCORE: Map<((u64, u64), u128, u64), u64> = Map::new("props_by // TOTAL_POWER_VOTING: key(round_id, tranche_id) -> Uint128 pub const TOTAL_POWER_VOTING: Map<(u64, u64), Uint128> = Map::new("total_power_voting"); -// TRANCHE_MAP: key(tranche_id) -> Tranche { -// tranche_id: u64, -// metadata: String -// } +// TRANCHE_MAP: key(tranche_id) -> Tranche pub const TRANCHE_MAP: Map = Map::new("tranche_map"); #[cw_serde] pub struct Tranche {