Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use SafeTransferLib for ETH transfers [GasZipFacet v2.0.1,LibAsset v1.0.2,FeeCollector v1.0.1,GasZipPeriphery v1.0.1,LiFiDEXAggregator v1.5.1,LiFuelFeeCollector v1.0.2,Permit2Proxy v1.0.2,Receiver v2.0.3,ReceiverAcrossV3 v1.0.3,ReceiverStargateV2 v1.0.1,RelayerCelerIM v2.0.1,TokenWrapper v1.0.1] #912

Merged
merged 15 commits into from
Jan 10, 2025
Merged
Prev Previous commit
Next Next commit
Revert unintentional change to RelayFacet
  • Loading branch information
ezynda3 committed Jan 3, 2025
commit a8bde0f655cdb958a2b01a8240682b9e33361fbe
13 changes: 7 additions & 6 deletions src/Facets/RelayFacet.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,11 @@ import { ReentrancyGuard } from "../Helpers/ReentrancyGuard.sol";
import { SwapperV2 } from "../Helpers/SwapperV2.sol";
import { Validatable } from "../Helpers/Validatable.sol";
import { ECDSA } from "solady/utils/ECDSA.sol";
import { SafeTransferLib } from "solady/utils/SafeTransferLib.sol";

/// @title Relay Facet
/// @author LI.FI (https://li.fi)
/// @notice Provides functionality for bridging through Relay Protocol
/// @custom:version 1.0.1
/// @custom:version 1.0.0
contract RelayFacet is ILiFi, ReentrancyGuard, SwapperV2, Validatable {
// Receiver for native transfers
address public immutable relayReceiver;
Expand Down Expand Up @@ -172,10 +171,12 @@ contract RelayFacet is ILiFi, ReentrancyGuard, SwapperV2, Validatable {
// Native

// Send Native to relayReceiver along with requestId as extra data
SafeTransferLib.safeTransferETH(
relayReceiver,
_bridgeData.minAmount
);
(bool success, bytes memory reason) = relayReceiver.call{
value: _bridgeData.minAmount
}(abi.encode(_relayData.requestId));
if (!success) {
revert(LibUtil.getRevertMsg(reason));
}
} else {
// ERC20

Expand Down
Loading