From 617fba4c897218f142dce0f6f38d3940bd3be48c Mon Sep 17 00:00:00 2001 From: Jake Hartnell Date: Mon, 8 Jan 2024 16:52:52 -0800 Subject: [PATCH] Clean up small TODO --- contracts/external/cw-abc/src/commands.rs | 6 +++--- contracts/external/cw-abc/src/error.rs | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/contracts/external/cw-abc/src/commands.rs b/contracts/external/cw-abc/src/commands.rs index 9a3ddf8ca..205f94cfc 100644 --- a/contracts/external/cw-abc/src/commands.rs +++ b/contracts/external/cw-abc/src/commands.rs @@ -262,10 +262,10 @@ fn calculate_exit_fee( CommonsPhase::Closed => return Ok(Uint128::zero()), }; - // TODO more normal check? - debug_assert!( + // Ensure the exit fee is not greater than 100% + ensure!( exit_fee <= StdDecimal::percent(100), - "Exit tax must be <= 100%" + ContractError::InvalidExitFee {} ); // This won't ever overflow because it's checked diff --git a/contracts/external/cw-abc/src/error.rs b/contracts/external/cw-abc/src/error.rs index d62661331..6c343f21b 100644 --- a/contracts/external/cw-abc/src/error.rs +++ b/contracts/external/cw-abc/src/error.rs @@ -28,6 +28,9 @@ pub enum ContractError { #[error("Hatch phase config error {0}")] HatchPhaseConfigError(String), + #[error("Invalid exit fee, must be less than 100%.")] + InvalidExitFee {}, + #[error("Invalid subdenom: {subdenom:?}")] InvalidSubdenom { subdenom: String },