Skip to content

Commit

Permalink
refactor: implement non-zero checks for token_1_liquidity and token_2…
Browse files Browse the repository at this point in the history
…_liquidity
  • Loading branch information
joemonem committed May 31, 2024
1 parent 5c3b19a commit 889cf84
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion contracts/liquidity/factory/src/execute.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use cosmwasm_std::{
to_json_binary, CosmosMsg, DepsMut, Env, IbcMsg, IbcTimeout, MessageInfo, Response, Uint128,
ensure, to_json_binary, CosmosMsg, DepsMut, Env, IbcMsg, IbcTimeout, MessageInfo, Response,
Uint128,
};
use euclid::{
error::ContractError,
Expand Down Expand Up @@ -101,6 +102,10 @@ pub fn execute_add_liquidity(
liquidity_id: String,
timeout: Option<u64>,
) -> Result<Response, ContractError> {
ensure!(
!token_1_liquidity.is_zero() && !token_2_liquidity.is_zero(),
ContractError::ZeroAssetAmount {}
);
// Load the state
let state = STATE.load(deps.storage)?;

Expand Down

0 comments on commit 889cf84

Please sign in to comment.