From 09f93697147fcb26a3155ec528609afe3e27bcf1 Mon Sep 17 00:00:00 2001 From: srdtrk Date: Tue, 9 Jul 2024 00:32:14 +0800 Subject: [PATCH] works --- contracts/ics20-transfer/src/ibc/relay.rs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/contracts/ics20-transfer/src/ibc/relay.rs b/contracts/ics20-transfer/src/ibc/relay.rs index 5f858f6..0460c63 100644 --- a/contracts/ics20-transfer/src/ibc/relay.rs +++ b/contracts/ics20-transfer/src/ibc/relay.rs @@ -198,16 +198,10 @@ mod on_acknowledgement_packet { return Err(TransferError::unexpected_port_id(port_id, packet.source_port).into()); } - let base_denom = utils::transfer::parse_voucher_denom( - &ics20_packet.denom, - port_id.as_str(), - packet.source_channel.as_str(), - )?; - // Refund the escrowed balance. state::ESCROW.update( deps.storage, - (packet.source_channel.as_str(), base_denom), + (packet.source_channel.as_str(), &ics20_packet.denom), |escrowed_bal| -> Result<_, ContractError> { let mut escrowed_bal = escrowed_bal.unwrap_or_default(); escrowed_bal = escrowed_bal.checked_sub(ics20_packet.amount).map_err(|_| { @@ -218,7 +212,7 @@ mod on_acknowledgement_packet { )?; let cw20_msg: CosmosMsg = WasmMsg::Execute { - contract_addr: base_denom.to_string(), + contract_addr: ics20_packet.denom, msg: cosmwasm_std::to_json_binary(&cw20::Cw20ExecuteMsg::Transfer { recipient: ics20_packet.sender, amount: ics20_packet.amount,