Skip to content

Commit

Permalink
transfer ZETA to recipient
Browse files Browse the repository at this point in the history
  • Loading branch information
fadeev committed May 9, 2024
1 parent d0a4fc6 commit 740718c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions omnichain/swap/contracts/SwapToZeta.sol
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ contract SwapToZeta is zContract {
to = recipient;
}

bool isTargetZeta = target == systemContract.wZetaContractAddress();
address wzeta = systemContract.wZetaContractAddress();
bool isTargetZeta = target == wzeta;
uint256 inputForGas;
address gasZRC20;
uint256 gasFee;
Expand All @@ -70,7 +71,9 @@ contract SwapToZeta is zContract {
0
);

if (!isTargetZeta) {
if (isTargetZeta) {
IERC20(wzeta).transfer(address(uint160(bytes20(to))), outputAmount);
} else {
IZRC20(gasZRC20).approve(target, gasFee);
IZRC20(target).withdraw(to, outputAmount);
}
Expand Down

0 comments on commit 740718c

Please sign in to comment.