Skip to content

Commit

Permalink
Fix: fix fin transfer for EVM native token. (#166)
Browse files Browse the repository at this point in the history
* Fix fin transfer for EVM native token.

* Use custome error instead of string
  • Loading branch information
karim-en authored Dec 25, 2024
1 parent cf7f8c7 commit 3d16aed
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion evm/src/omni-bridge/contracts/OmniBridge.sol
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ contract OmniBridge is
error InvalidSignature();
error NonceAlreadyUsed(uint64 nonce);
error InvalidFee();
error FailedToSendEther();

function initialize(
address tokenImplementationAddress_,
Expand Down Expand Up @@ -194,7 +195,11 @@ contract OmniBridge is
revert InvalidSignature();
}

if (customMinters[payload.tokenAddress] != address(0)) {
if (payload.tokenAddress == address(0)) {
(bool success, ) = payload.recipient.call{value: payload.amount}("");
if (!success) revert FailedToSendEther();
}
else if (customMinters[payload.tokenAddress] != address(0)) {
ICustomMinter(customMinters[payload.tokenAddress]).mint(payload.tokenAddress, payload.recipient, payload.amount);
} else if (isBridgeToken[payload.tokenAddress]) {
BridgeToken(payload.tokenAddress).mint(payload.recipient, payload.amount);
Expand Down

0 comments on commit 3d16aed

Please sign in to comment.