Skip to content

Commit

Permalink
works
Browse files Browse the repository at this point in the history
  • Loading branch information
srdtrk committed Jul 8, 2024
1 parent 4ee44fd commit 09f9369
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions contracts/ics20-transfer/src/ibc/relay.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(|_| {
Expand All @@ -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,
Expand Down

0 comments on commit 09f9369

Please sign in to comment.