Skip to content

Commit

Permalink
Merge pull request #237 from multiversx/native-tokens-skip-unwrap
Browse files Browse the repository at this point in the history
fix unwrap_token if native token
  • Loading branch information
dragos-rebegea authored Oct 22, 2024
2 parents 202a8b2 + 0802c22 commit c572288
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions bridge-proxy/src/bridge-proxy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,15 @@ pub trait BridgeProxyContract:
fn unwrap_token(&self, requested_token: &TokenIdentifier, tx_id: usize) -> EsdtTokenPayment {
let payment = self.payments(tx_id).get();
let bridged_tokens_wrapper_address = self.bridged_tokens_wrapper_address().get();


if requested_token == &payment.token_identifier {
return payment;
}

let transfers = self
.tx()
.to(bridged_tokens_wrapper_address) .typed(bridged_tokens_wrapper_proxy::BridgedTokensWrapperProxy)
.to(&bridged_tokens_wrapper_address)
.typed(bridged_tokens_wrapper_proxy::BridgedTokensWrapperProxy)
.unwrap_token(requested_token)
.single_esdt(
&payment.token_identifier,
Expand Down

0 comments on commit c572288

Please sign in to comment.