Source Code
Overview
ETH Balance
0 ETH
ETH Value
$0.00| Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
|---|---|---|---|---|---|---|---|---|---|
Latest 1 internal transaction
Advanced mode:
| Parent Transaction Hash | Block | From | To | |||
|---|---|---|---|---|---|---|
| 5106246 | 156 days ago | Contract Creation | 0 ETH |
Cross-Chain Transactions
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
GlacisFacet
Compiler Version
v0.8.29+commit.ab55807c
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: LGPL-3.0-only
pragma solidity ^0.8.17;
import { ILiFi } from "../Interfaces/ILiFi.sol";
import { LibAsset, IERC20 } from "../Libraries/LibAsset.sol";
import { LibSwap } from "../Libraries/LibSwap.sol";
import { ReentrancyGuard } from "../Helpers/ReentrancyGuard.sol";
import { SwapperV2 } from "../Helpers/SwapperV2.sol";
import { Validatable } from "../Helpers/Validatable.sol";
import { IGlacisAirlift } from "../Interfaces/IGlacisAirlift.sol";
import { InvalidConfig } from "../Errors/GenericErrors.sol";
/// @title Glacis Facet
/// @author LI.FI (https://li.fi/)
/// @notice Integration of the Glacis airlift (wrapper for native token bridging standards)
/// @custom:version 1.0.0
contract GlacisFacet is ILiFi, ReentrancyGuard, SwapperV2, Validatable {
/// Storage ///
/// @notice The contract address of the glacis airlift on the source chain.
// solhint-disable-next-line immutable-vars-naming
IGlacisAirlift public immutable airlift;
/// Types ///
/// @param refundAddress The address that would receive potential refunds on source chain
/// @param nativeFee The fee amount in native token required by the Glacis Airlift
struct GlacisData {
address refundAddress;
uint256 nativeFee;
}
/// Constructor ///
/// @notice Initializes the GlacisFacet contract
/// @param _airlift The address of Glacis Airlift contract.
constructor(IGlacisAirlift _airlift) {
if (address(_airlift) == address(0)) {
revert InvalidConfig();
}
airlift = _airlift;
}
/// Errors ///
error InvalidRefundAddress();
/// External Methods ///
/// @notice Bridges tokens via Glacis
/// @param _bridgeData The core information needed for bridging
/// @param _glacisData Data specific to Glacis
function startBridgeTokensViaGlacis(
ILiFi.BridgeData memory _bridgeData,
GlacisData calldata _glacisData
)
external
payable
nonReentrant
refundExcessNative(payable(msg.sender))
validateBridgeData(_bridgeData)
doesNotContainSourceSwaps(_bridgeData)
doesNotContainDestinationCalls(_bridgeData)
noNativeAsset(_bridgeData)
{
LibAsset.depositAsset(
_bridgeData.sendingAssetId,
_bridgeData.minAmount
);
_startBridge(_bridgeData, _glacisData);
}
/// @notice Performs a swap before bridging via Glacis
/// @param _bridgeData The core information needed for bridging
/// @param _swapData An array of swap related data for performing swaps before bridging
/// @param _glacisData Data specific to Glacis
function swapAndStartBridgeTokensViaGlacis(
ILiFi.BridgeData memory _bridgeData,
LibSwap.SwapData[] calldata _swapData,
GlacisData calldata _glacisData
)
external
payable
nonReentrant
refundExcessNative(payable(msg.sender))
containsSourceSwaps(_bridgeData)
doesNotContainDestinationCalls(_bridgeData)
validateBridgeData(_bridgeData)
noNativeAsset(_bridgeData)
{
_bridgeData.minAmount = _depositAndSwap(
_bridgeData.transactionId,
_bridgeData.minAmount,
_swapData,
payable(msg.sender),
_glacisData.nativeFee
);
_startBridge(_bridgeData, _glacisData);
}
/// Internal Methods ///
/// @dev Contains the business logic for the bridge via Glacis
/// @param _bridgeData The core information needed for bridging
/// @param _glacisData Data specific to Glacis
function _startBridge(
ILiFi.BridgeData memory _bridgeData,
GlacisData calldata _glacisData
) internal {
if (_glacisData.refundAddress == address(0))
revert InvalidRefundAddress();
// Approve the Airlift contract to spend the required amount of tokens.
// The `send` function assumes that the caller has already approved the token transfer,
// ensuring that the cross-chain transaction and token transfer happen atomically.
LibAsset.maxApproveERC20(
IERC20(_bridgeData.sendingAssetId),
address(airlift),
_bridgeData.minAmount
);
// solhint detects this as an Ether `send` call, but this is a function from GlacisAirlift
// that does not return a value, so checking the return value is unnecessary.
// solhint-disable-next-line check-send-result
airlift.send{ value: _glacisData.nativeFee }(
_bridgeData.sendingAssetId,
_bridgeData.minAmount,
bytes32(uint256(uint160(_bridgeData.receiver))),
_bridgeData.destinationChainId,
_glacisData.refundAddress
);
emit LiFiTransferStarted(_bridgeData);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `from` to `to` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address from, address to, uint256 amount) external returns (bool);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
/// @notice Safe ETH and ERC20 transfer library that gracefully handles missing return values.
/// @author Solady (https://github.com/vectorized/solady/blob/main/src/utils/SafeTransferLib.sol)
/// @author Modified from Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/SafeTransferLib.sol)
/// @author Permit2 operations from (https://github.com/Uniswap/permit2/blob/main/src/libraries/Permit2Lib.sol)
///
/// @dev Note:
/// - For ETH transfers, please use `forceSafeTransferETH` for DoS protection.
/// - For ERC20s, this implementation won't check that a token has code,
/// responsibility is delegated to the caller.
library SafeTransferLib {
/*´:°•.°+.*•´.*:°.°*.°•´.°:°•.°•.*•´.*:°.°*.°•´.°:°•.°+.*•´.*:*/
/* CUSTOM ERRORS */
/*.•°:°.´+°.*°.°:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•°°.*°.°:*.´+°.•*/
/// @dev The ETH transfer has failed.
error ETHTransferFailed();
/// @dev The ERC20 `transferFrom` has failed.
error TransferFromFailed();
/// @dev The ERC20 `transfer` has failed.
error TransferFailed();
/// @dev The ERC20 `approve` has failed.
error ApproveFailed();
/// @dev The Permit2 operation has failed.
error Permit2Failed();
/// @dev The Permit2 amount must be less than `2**160 - 1`.
error Permit2AmountOverflow();
/*´:°•.°+.*•´.*:°.°*.°•´.°:°•.°•.*•´.*:°.°*.°•´.°:°•.°+.*•´.*:*/
/* CONSTANTS */
/*.•°:°.´+°.*°.°:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•°°.*°.°:*.´+°.•*/
/// @dev Suggested gas stipend for contract receiving ETH that disallows any storage writes.
uint256 internal constant GAS_STIPEND_NO_STORAGE_WRITES = 2300;
/// @dev Suggested gas stipend for contract receiving ETH to perform a few
/// storage reads and writes, but low enough to prevent griefing.
uint256 internal constant GAS_STIPEND_NO_GRIEF = 100000;
/// @dev The unique EIP-712 domain domain separator for the DAI token contract.
bytes32 internal constant DAI_DOMAIN_SEPARATOR =
0xdbb8cf42e1ecb028be3f3dbc922e1d878b963f411dc388ced501601c60f7c6f7;
/// @dev The address for the WETH9 contract on Ethereum mainnet.
address internal constant WETH9 = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;
/// @dev The canonical Permit2 address.
/// [Github](https://github.com/Uniswap/permit2)
/// [Etherscan](https://etherscan.io/address/0x000000000022D473030F116dDEE9F6B43aC78BA3)
address internal constant PERMIT2 = 0x000000000022D473030F116dDEE9F6B43aC78BA3;
/*´:°•.°+.*•´.*:°.°*.°•´.°:°•.°•.*•´.*:°.°*.°•´.°:°•.°+.*•´.*:*/
/* ETH OPERATIONS */
/*.•°:°.´+°.*°.°:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•°°.*°.°:*.´+°.•*/
// If the ETH transfer MUST succeed with a reasonable gas budget, use the force variants.
//
// The regular variants:
// - Forwards all remaining gas to the target.
// - Reverts if the target reverts.
// - Reverts if the current contract has insufficient balance.
//
// The force variants:
// - Forwards with an optional gas stipend
// (defaults to `GAS_STIPEND_NO_GRIEF`, which is sufficient for most cases).
// - If the target reverts, or if the gas stipend is exhausted,
// creates a temporary contract to force send the ETH via `SELFDESTRUCT`.
// Future compatible with `SENDALL`: https://eips.ethereum.org/EIPS/eip-4758.
// - Reverts if the current contract has insufficient balance.
//
// The try variants:
// - Forwards with a mandatory gas stipend.
// - Instead of reverting, returns whether the transfer succeeded.
/// @dev Sends `amount` (in wei) ETH to `to`.
function safeTransferETH(address to, uint256 amount) internal {
/// @solidity memory-safe-assembly
assembly {
if iszero(call(gas(), to, amount, codesize(), 0x00, codesize(), 0x00)) {
mstore(0x00, 0xb12d13eb) // `ETHTransferFailed()`.
revert(0x1c, 0x04)
}
}
}
/// @dev Sends all the ETH in the current contract to `to`.
function safeTransferAllETH(address to) internal {
/// @solidity memory-safe-assembly
assembly {
// Transfer all the ETH and check if it succeeded or not.
if iszero(call(gas(), to, selfbalance(), codesize(), 0x00, codesize(), 0x00)) {
mstore(0x00, 0xb12d13eb) // `ETHTransferFailed()`.
revert(0x1c, 0x04)
}
}
}
/// @dev Force sends `amount` (in wei) ETH to `to`, with a `gasStipend`.
function forceSafeTransferETH(address to, uint256 amount, uint256 gasStipend) internal {
/// @solidity memory-safe-assembly
assembly {
if lt(selfbalance(), amount) {
mstore(0x00, 0xb12d13eb) // `ETHTransferFailed()`.
revert(0x1c, 0x04)
}
if iszero(call(gasStipend, to, amount, codesize(), 0x00, codesize(), 0x00)) {
mstore(0x00, to) // Store the address in scratch space.
mstore8(0x0b, 0x73) // Opcode `PUSH20`.
mstore8(0x20, 0xff) // Opcode `SELFDESTRUCT`.
if iszero(create(amount, 0x0b, 0x16)) { revert(codesize(), codesize()) } // For gas estimation.
}
}
}
/// @dev Force sends all the ETH in the current contract to `to`, with a `gasStipend`.
function forceSafeTransferAllETH(address to, uint256 gasStipend) internal {
/// @solidity memory-safe-assembly
assembly {
if iszero(call(gasStipend, to, selfbalance(), codesize(), 0x00, codesize(), 0x00)) {
mstore(0x00, to) // Store the address in scratch space.
mstore8(0x0b, 0x73) // Opcode `PUSH20`.
mstore8(0x20, 0xff) // Opcode `SELFDESTRUCT`.
if iszero(create(selfbalance(), 0x0b, 0x16)) { revert(codesize(), codesize()) } // For gas estimation.
}
}
}
/// @dev Force sends `amount` (in wei) ETH to `to`, with `GAS_STIPEND_NO_GRIEF`.
function forceSafeTransferETH(address to, uint256 amount) internal {
/// @solidity memory-safe-assembly
assembly {
if lt(selfbalance(), amount) {
mstore(0x00, 0xb12d13eb) // `ETHTransferFailed()`.
revert(0x1c, 0x04)
}
if iszero(call(GAS_STIPEND_NO_GRIEF, to, amount, codesize(), 0x00, codesize(), 0x00)) {
mstore(0x00, to) // Store the address in scratch space.
mstore8(0x0b, 0x73) // Opcode `PUSH20`.
mstore8(0x20, 0xff) // Opcode `SELFDESTRUCT`.
if iszero(create(amount, 0x0b, 0x16)) { revert(codesize(), codesize()) } // For gas estimation.
}
}
}
/// @dev Force sends all the ETH in the current contract to `to`, with `GAS_STIPEND_NO_GRIEF`.
function forceSafeTransferAllETH(address to) internal {
/// @solidity memory-safe-assembly
assembly {
// forgefmt: disable-next-item
if iszero(call(GAS_STIPEND_NO_GRIEF, to, selfbalance(), codesize(), 0x00, codesize(), 0x00)) {
mstore(0x00, to) // Store the address in scratch space.
mstore8(0x0b, 0x73) // Opcode `PUSH20`.
mstore8(0x20, 0xff) // Opcode `SELFDESTRUCT`.
if iszero(create(selfbalance(), 0x0b, 0x16)) { revert(codesize(), codesize()) } // For gas estimation.
}
}
}
/// @dev Sends `amount` (in wei) ETH to `to`, with a `gasStipend`.
function trySafeTransferETH(address to, uint256 amount, uint256 gasStipend)
internal
returns (bool success)
{
/// @solidity memory-safe-assembly
assembly {
success := call(gasStipend, to, amount, codesize(), 0x00, codesize(), 0x00)
}
}
/// @dev Sends all the ETH in the current contract to `to`, with a `gasStipend`.
function trySafeTransferAllETH(address to, uint256 gasStipend)
internal
returns (bool success)
{
/// @solidity memory-safe-assembly
assembly {
success := call(gasStipend, to, selfbalance(), codesize(), 0x00, codesize(), 0x00)
}
}
/*´:°•.°+.*•´.*:°.°*.°•´.°:°•.°•.*•´.*:°.°*.°•´.°:°•.°+.*•´.*:*/
/* ERC20 OPERATIONS */
/*.•°:°.´+°.*°.°:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•°°.*°.°:*.´+°.•*/
/// @dev Sends `amount` of ERC20 `token` from `from` to `to`.
/// Reverts upon failure.
///
/// The `from` account must have at least `amount` approved for
/// the current contract to manage.
function safeTransferFrom(address token, address from, address to, uint256 amount) internal {
/// @solidity memory-safe-assembly
assembly {
let m := mload(0x40) // Cache the free memory pointer.
mstore(0x60, amount) // Store the `amount` argument.
mstore(0x40, to) // Store the `to` argument.
mstore(0x2c, shl(96, from)) // Store the `from` argument.
mstore(0x0c, 0x23b872dd000000000000000000000000) // `transferFrom(address,address,uint256)`.
// Perform the transfer, reverting upon failure.
if iszero(
and( // The arguments of `and` are evaluated from right to left.
or(eq(mload(0x00), 1), iszero(returndatasize())), // Returned 1 or nothing.
call(gas(), token, 0, 0x1c, 0x64, 0x00, 0x20)
)
) {
mstore(0x00, 0x7939f424) // `TransferFromFailed()`.
revert(0x1c, 0x04)
}
mstore(0x60, 0) // Restore the zero slot to zero.
mstore(0x40, m) // Restore the free memory pointer.
}
}
/// @dev Sends `amount` of ERC20 `token` from `from` to `to`.
///
/// The `from` account must have at least `amount` approved for the current contract to manage.
function trySafeTransferFrom(address token, address from, address to, uint256 amount)
internal
returns (bool success)
{
/// @solidity memory-safe-assembly
assembly {
let m := mload(0x40) // Cache the free memory pointer.
mstore(0x60, amount) // Store the `amount` argument.
mstore(0x40, to) // Store the `to` argument.
mstore(0x2c, shl(96, from)) // Store the `from` argument.
mstore(0x0c, 0x23b872dd000000000000000000000000) // `transferFrom(address,address,uint256)`.
success :=
and( // The arguments of `and` are evaluated from right to left.
or(eq(mload(0x00), 1), iszero(returndatasize())), // Returned 1 or nothing.
call(gas(), token, 0, 0x1c, 0x64, 0x00, 0x20)
)
mstore(0x60, 0) // Restore the zero slot to zero.
mstore(0x40, m) // Restore the free memory pointer.
}
}
/// @dev Sends all of ERC20 `token` from `from` to `to`.
/// Reverts upon failure.
///
/// The `from` account must have their entire balance approved for the current contract to manage.
function safeTransferAllFrom(address token, address from, address to)
internal
returns (uint256 amount)
{
/// @solidity memory-safe-assembly
assembly {
let m := mload(0x40) // Cache the free memory pointer.
mstore(0x40, to) // Store the `to` argument.
mstore(0x2c, shl(96, from)) // Store the `from` argument.
mstore(0x0c, 0x70a08231000000000000000000000000) // `balanceOf(address)`.
// Read the balance, reverting upon failure.
if iszero(
and( // The arguments of `and` are evaluated from right to left.
gt(returndatasize(), 0x1f), // At least 32 bytes returned.
staticcall(gas(), token, 0x1c, 0x24, 0x60, 0x20)
)
) {
mstore(0x00, 0x7939f424) // `TransferFromFailed()`.
revert(0x1c, 0x04)
}
mstore(0x00, 0x23b872dd) // `transferFrom(address,address,uint256)`.
amount := mload(0x60) // The `amount` is already at 0x60. We'll need to return it.
// Perform the transfer, reverting upon failure.
if iszero(
and( // The arguments of `and` are evaluated from right to left.
or(eq(mload(0x00), 1), iszero(returndatasize())), // Returned 1 or nothing.
call(gas(), token, 0, 0x1c, 0x64, 0x00, 0x20)
)
) {
mstore(0x00, 0x7939f424) // `TransferFromFailed()`.
revert(0x1c, 0x04)
}
mstore(0x60, 0) // Restore the zero slot to zero.
mstore(0x40, m) // Restore the free memory pointer.
}
}
/// @dev Sends `amount` of ERC20 `token` from the current contract to `to`.
/// Reverts upon failure.
function safeTransfer(address token, address to, uint256 amount) internal {
/// @solidity memory-safe-assembly
assembly {
mstore(0x14, to) // Store the `to` argument.
mstore(0x34, amount) // Store the `amount` argument.
mstore(0x00, 0xa9059cbb000000000000000000000000) // `transfer(address,uint256)`.
// Perform the transfer, reverting upon failure.
if iszero(
and( // The arguments of `and` are evaluated from right to left.
or(eq(mload(0x00), 1), iszero(returndatasize())), // Returned 1 or nothing.
call(gas(), token, 0, 0x10, 0x44, 0x00, 0x20)
)
) {
mstore(0x00, 0x90b8ec18) // `TransferFailed()`.
revert(0x1c, 0x04)
}
mstore(0x34, 0) // Restore the part of the free memory pointer that was overwritten.
}
}
/// @dev Sends all of ERC20 `token` from the current contract to `to`.
/// Reverts upon failure.
function safeTransferAll(address token, address to) internal returns (uint256 amount) {
/// @solidity memory-safe-assembly
assembly {
mstore(0x00, 0x70a08231) // Store the function selector of `balanceOf(address)`.
mstore(0x20, address()) // Store the address of the current contract.
// Read the balance, reverting upon failure.
if iszero(
and( // The arguments of `and` are evaluated from right to left.
gt(returndatasize(), 0x1f), // At least 32 bytes returned.
staticcall(gas(), token, 0x1c, 0x24, 0x34, 0x20)
)
) {
mstore(0x00, 0x90b8ec18) // `TransferFailed()`.
revert(0x1c, 0x04)
}
mstore(0x14, to) // Store the `to` argument.
amount := mload(0x34) // The `amount` is already at 0x34. We'll need to return it.
mstore(0x00, 0xa9059cbb000000000000000000000000) // `transfer(address,uint256)`.
// Perform the transfer, reverting upon failure.
if iszero(
and( // The arguments of `and` are evaluated from right to left.
or(eq(mload(0x00), 1), iszero(returndatasize())), // Returned 1 or nothing.
call(gas(), token, 0, 0x10, 0x44, 0x00, 0x20)
)
) {
mstore(0x00, 0x90b8ec18) // `TransferFailed()`.
revert(0x1c, 0x04)
}
mstore(0x34, 0) // Restore the part of the free memory pointer that was overwritten.
}
}
/// @dev Sets `amount` of ERC20 `token` for `to` to manage on behalf of the current contract.
/// Reverts upon failure.
function safeApprove(address token, address to, uint256 amount) internal {
/// @solidity memory-safe-assembly
assembly {
mstore(0x14, to) // Store the `to` argument.
mstore(0x34, amount) // Store the `amount` argument.
mstore(0x00, 0x095ea7b3000000000000000000000000) // `approve(address,uint256)`.
// Perform the approval, reverting upon failure.
if iszero(
and( // The arguments of `and` are evaluated from right to left.
or(eq(mload(0x00), 1), iszero(returndatasize())), // Returned 1 or nothing.
call(gas(), token, 0, 0x10, 0x44, 0x00, 0x20)
)
) {
mstore(0x00, 0x3e3f8f73) // `ApproveFailed()`.
revert(0x1c, 0x04)
}
mstore(0x34, 0) // Restore the part of the free memory pointer that was overwritten.
}
}
/// @dev Sets `amount` of ERC20 `token` for `to` to manage on behalf of the current contract.
/// If the initial attempt to approve fails, attempts to reset the approved amount to zero,
/// then retries the approval again (some tokens, e.g. USDT, requires this).
/// Reverts upon failure.
function safeApproveWithRetry(address token, address to, uint256 amount) internal {
/// @solidity memory-safe-assembly
assembly {
mstore(0x14, to) // Store the `to` argument.
mstore(0x34, amount) // Store the `amount` argument.
mstore(0x00, 0x095ea7b3000000000000000000000000) // `approve(address,uint256)`.
// Perform the approval, retrying upon failure.
if iszero(
and( // The arguments of `and` are evaluated from right to left.
or(eq(mload(0x00), 1), iszero(returndatasize())), // Returned 1 or nothing.
call(gas(), token, 0, 0x10, 0x44, 0x00, 0x20)
)
) {
mstore(0x34, 0) // Store 0 for the `amount`.
mstore(0x00, 0x095ea7b3000000000000000000000000) // `approve(address,uint256)`.
pop(call(gas(), token, 0, 0x10, 0x44, codesize(), 0x00)) // Reset the approval.
mstore(0x34, amount) // Store back the original `amount`.
// Retry the approval, reverting upon failure.
if iszero(
and(
or(eq(mload(0x00), 1), iszero(returndatasize())), // Returned 1 or nothing.
call(gas(), token, 0, 0x10, 0x44, 0x00, 0x20)
)
) {
mstore(0x00, 0x3e3f8f73) // `ApproveFailed()`.
revert(0x1c, 0x04)
}
}
mstore(0x34, 0) // Restore the part of the free memory pointer that was overwritten.
}
}
/// @dev Returns the amount of ERC20 `token` owned by `account`.
/// Returns zero if the `token` does not exist.
function balanceOf(address token, address account) internal view returns (uint256 amount) {
/// @solidity memory-safe-assembly
assembly {
mstore(0x14, account) // Store the `account` argument.
mstore(0x00, 0x70a08231000000000000000000000000) // `balanceOf(address)`.
amount :=
mul( // The arguments of `mul` are evaluated from right to left.
mload(0x20),
and( // The arguments of `and` are evaluated from right to left.
gt(returndatasize(), 0x1f), // At least 32 bytes returned.
staticcall(gas(), token, 0x10, 0x24, 0x20, 0x20)
)
)
}
}
/// @dev Sends `amount` of ERC20 `token` from `from` to `to`.
/// If the initial attempt fails, try to use Permit2 to transfer the token.
/// Reverts upon failure.
///
/// The `from` account must have at least `amount` approved for the current contract to manage.
function safeTransferFrom2(address token, address from, address to, uint256 amount) internal {
if (!trySafeTransferFrom(token, from, to, amount)) {
permit2TransferFrom(token, from, to, amount);
}
}
/// @dev Sends `amount` of ERC20 `token` from `from` to `to` via Permit2.
/// Reverts upon failure.
function permit2TransferFrom(address token, address from, address to, uint256 amount)
internal
{
/// @solidity memory-safe-assembly
assembly {
let m := mload(0x40)
mstore(add(m, 0x74), shr(96, shl(96, token)))
mstore(add(m, 0x54), amount)
mstore(add(m, 0x34), to)
mstore(add(m, 0x20), shl(96, from))
// `transferFrom(address,address,uint160,address)`.
mstore(m, 0x36c78516000000000000000000000000)
let p := PERMIT2
let exists := eq(chainid(), 1)
if iszero(exists) { exists := iszero(iszero(extcodesize(p))) }
if iszero(and(call(gas(), p, 0, add(m, 0x10), 0x84, codesize(), 0x00), exists)) {
mstore(0x00, 0x7939f4248757f0fd) // `TransferFromFailed()` or `Permit2AmountOverflow()`.
revert(add(0x18, shl(2, iszero(iszero(shr(160, amount))))), 0x04)
}
}
}
/// @dev Permit a user to spend a given amount of
/// another user's tokens via native EIP-2612 permit if possible, falling
/// back to Permit2 if native permit fails or is not implemented on the token.
function permit2(
address token,
address owner,
address spender,
uint256 amount,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) internal {
bool success;
/// @solidity memory-safe-assembly
assembly {
for {} shl(96, xor(token, WETH9)) {} {
mstore(0x00, 0x3644e515) // `DOMAIN_SEPARATOR()`.
if iszero(
and( // The arguments of `and` are evaluated from right to left.
lt(iszero(mload(0x00)), eq(returndatasize(), 0x20)), // Returns 1 non-zero word.
// Gas stipend to limit gas burn for tokens that don't refund gas when
// an non-existing function is called. 5K should be enough for a SLOAD.
staticcall(5000, token, 0x1c, 0x04, 0x00, 0x20)
)
) { break }
// After here, we can be sure that token is a contract.
let m := mload(0x40)
mstore(add(m, 0x34), spender)
mstore(add(m, 0x20), shl(96, owner))
mstore(add(m, 0x74), deadline)
if eq(mload(0x00), DAI_DOMAIN_SEPARATOR) {
mstore(0x14, owner)
mstore(0x00, 0x7ecebe00000000000000000000000000) // `nonces(address)`.
mstore(add(m, 0x94), staticcall(gas(), token, 0x10, 0x24, add(m, 0x54), 0x20))
mstore(m, 0x8fcbaf0c000000000000000000000000) // `IDAIPermit.permit`.
// `nonces` is already at `add(m, 0x54)`.
// `1` is already stored at `add(m, 0x94)`.
mstore(add(m, 0xb4), and(0xff, v))
mstore(add(m, 0xd4), r)
mstore(add(m, 0xf4), s)
success := call(gas(), token, 0, add(m, 0x10), 0x104, codesize(), 0x00)
break
}
mstore(m, 0xd505accf000000000000000000000000) // `IERC20Permit.permit`.
mstore(add(m, 0x54), amount)
mstore(add(m, 0x94), and(0xff, v))
mstore(add(m, 0xb4), r)
mstore(add(m, 0xd4), s)
success := call(gas(), token, 0, add(m, 0x10), 0xe4, codesize(), 0x00)
break
}
}
if (!success) simplePermit2(token, owner, spender, amount, deadline, v, r, s);
}
/// @dev Simple permit on the Permit2 contract.
function simplePermit2(
address token,
address owner,
address spender,
uint256 amount,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) internal {
/// @solidity memory-safe-assembly
assembly {
let m := mload(0x40)
mstore(m, 0x927da105) // `allowance(address,address,address)`.
{
let addressMask := shr(96, not(0))
mstore(add(m, 0x20), and(addressMask, owner))
mstore(add(m, 0x40), and(addressMask, token))
mstore(add(m, 0x60), and(addressMask, spender))
mstore(add(m, 0xc0), and(addressMask, spender))
}
let p := mul(PERMIT2, iszero(shr(160, amount)))
if iszero(
and( // The arguments of `and` are evaluated from right to left.
gt(returndatasize(), 0x5f), // Returns 3 words: `amount`, `expiration`, `nonce`.
staticcall(gas(), p, add(m, 0x1c), 0x64, add(m, 0x60), 0x60)
)
) {
mstore(0x00, 0x6b836e6b8757f0fd) // `Permit2Failed()` or `Permit2AmountOverflow()`.
revert(add(0x18, shl(2, iszero(p))), 0x04)
}
mstore(m, 0x2b67b570) // `Permit2.permit` (PermitSingle variant).
// `owner` is already `add(m, 0x20)`.
// `token` is already at `add(m, 0x40)`.
mstore(add(m, 0x60), amount)
mstore(add(m, 0x80), 0xffffffffffff) // `expiration = type(uint48).max`.
// `nonce` is already at `add(m, 0xa0)`.
// `spender` is already at `add(m, 0xc0)`.
mstore(add(m, 0xe0), deadline)
mstore(add(m, 0x100), 0x100) // `signature` offset.
mstore(add(m, 0x120), 0x41) // `signature` length.
mstore(add(m, 0x140), r)
mstore(add(m, 0x160), s)
mstore(add(m, 0x180), shl(248, v))
if iszero(call(gas(), p, 0, add(m, 0x1c), 0x184, codesize(), 0x00)) {
mstore(0x00, 0x6b836e6b) // `Permit2Failed()`.
revert(0x1c, 0x04)
}
}
}
}// SPDX-License-Identifier: LGPL-3.0-only /// @custom:version 1.0.1 pragma solidity ^0.8.17; error AlreadyInitialized(); error CannotAuthoriseSelf(); error CannotBridgeToSameNetwork(); error ContractCallNotAllowed(); error CumulativeSlippageTooHigh(uint256 minAmount, uint256 receivedAmount); error DiamondIsPaused(); error ETHTransferFailed(); error ExternalCallFailed(); error FunctionDoesNotExist(); error InformationMismatch(); error InsufficientBalance(uint256 required, uint256 balance); error InvalidAmount(); error InvalidCallData(); error InvalidConfig(); error InvalidContract(); error InvalidDestinationChain(); error InvalidFallbackAddress(); error InvalidReceiver(); error InvalidSendingToken(); error NativeAssetNotSupported(); error NativeAssetTransferFailed(); error NoSwapDataProvided(); error NoSwapFromZeroBalance(); error NotAContract(); error NotInitialized(); error NoTransferToNullAddress(); error NullAddrIsNotAnERC20Token(); error NullAddrIsNotAValidSpender(); error OnlyContractOwner(); error RecoveryAddressCannotBeZero(); error ReentrancyError(); error TokenNotSupported(); error TransferFromFailed(); error UnAuthorized(); error UnsupportedChainId(uint256 chainId); error WithdrawFailed(); error ZeroAmount();
// SPDX-License-Identifier: UNLICENSED
/// @custom:version 1.0.0
pragma solidity ^0.8.17;
/// @title Reentrancy Guard
/// @author LI.FI (https://li.fi)
/// @notice Abstract contract to provide protection against reentrancy
abstract contract ReentrancyGuard {
/// Storage ///
bytes32 private constant NAMESPACE = keccak256("com.lifi.reentrancyguard");
/// Types ///
struct ReentrancyStorage {
uint256 status;
}
/// Errors ///
error ReentrancyError();
/// Constants ///
uint256 private constant _NOT_ENTERED = 0;
uint256 private constant _ENTERED = 1;
/// Modifiers ///
modifier nonReentrant() {
ReentrancyStorage storage s = reentrancyStorage();
if (s.status == _ENTERED) revert ReentrancyError();
s.status = _ENTERED;
_;
s.status = _NOT_ENTERED;
}
/// Private Methods ///
/// @dev fetch local storage
function reentrancyStorage()
private
pure
returns (ReentrancyStorage storage data)
{
bytes32 position = NAMESPACE;
// solhint-disable-next-line no-inline-assembly
assembly {
data.slot := position
}
}
}// SPDX-License-Identifier: LGPL-3.0-only
/// @custom:version 1.0.0
pragma solidity ^0.8.17;
import { ILiFi } from "../Interfaces/ILiFi.sol";
import { LibSwap } from "../Libraries/LibSwap.sol";
import { LibAsset } from "../Libraries/LibAsset.sol";
import { LibAllowList } from "../Libraries/LibAllowList.sol";
import { ContractCallNotAllowed, NoSwapDataProvided, CumulativeSlippageTooHigh } from "../Errors/GenericErrors.sol";
/// @title Swapper
/// @author LI.FI (https://li.fi)
/// @notice Abstract contract to provide swap functionality
contract SwapperV2 is ILiFi {
/// Types ///
/// @dev only used to get around "Stack Too Deep" errors
struct ReserveData {
bytes32 transactionId;
address payable leftoverReceiver;
uint256 nativeReserve;
}
/// Modifiers ///
/// @dev Sends any leftover balances back to the user
/// @notice Sends any leftover balances to the user
/// @param _swaps Swap data array
/// @param _leftoverReceiver Address to send leftover tokens to
/// @param _initialBalances Array of initial token balances
modifier noLeftovers(
LibSwap.SwapData[] calldata _swaps,
address payable _leftoverReceiver,
uint256[] memory _initialBalances
) {
uint256 numSwaps = _swaps.length;
if (numSwaps != 1) {
address finalAsset = _swaps[numSwaps - 1].receivingAssetId;
uint256 curBalance;
_;
for (uint256 i = 0; i < numSwaps - 1; ) {
address curAsset = _swaps[i].receivingAssetId;
// Handle multi-to-one swaps
if (curAsset != finalAsset) {
curBalance =
LibAsset.getOwnBalance(curAsset) -
_initialBalances[i];
if (curBalance > 0) {
LibAsset.transferAsset(
curAsset,
_leftoverReceiver,
curBalance
);
}
}
unchecked {
++i;
}
}
} else {
_;
}
}
/// @dev Sends any leftover balances back to the user reserving native tokens
/// @notice Sends any leftover balances to the user
/// @param _swaps Swap data array
/// @param _leftoverReceiver Address to send leftover tokens to
/// @param _initialBalances Array of initial token balances
modifier noLeftoversReserve(
LibSwap.SwapData[] calldata _swaps,
address payable _leftoverReceiver,
uint256[] memory _initialBalances,
uint256 _nativeReserve
) {
uint256 numSwaps = _swaps.length;
if (numSwaps != 1) {
address finalAsset = _swaps[numSwaps - 1].receivingAssetId;
uint256 curBalance;
_;
for (uint256 i = 0; i < numSwaps - 1; ) {
address curAsset = _swaps[i].receivingAssetId;
// Handle multi-to-one swaps
if (curAsset != finalAsset) {
curBalance =
LibAsset.getOwnBalance(curAsset) -
_initialBalances[i];
uint256 reserve = LibAsset.isNativeAsset(curAsset)
? _nativeReserve
: 0;
if (curBalance > 0) {
LibAsset.transferAsset(
curAsset,
_leftoverReceiver,
curBalance - reserve
);
}
}
unchecked {
++i;
}
}
} else {
_;
}
}
/// @dev Refunds any excess native asset sent to the contract after the main function
/// @notice Refunds any excess native asset sent to the contract after the main function
/// @param _refundReceiver Address to send refunds to
modifier refundExcessNative(address payable _refundReceiver) {
uint256 initialBalance = address(this).balance - msg.value;
_;
uint256 finalBalance = address(this).balance;
if (finalBalance > initialBalance) {
LibAsset.transferAsset(
LibAsset.NATIVE_ASSETID,
_refundReceiver,
finalBalance - initialBalance
);
}
}
/// Internal Methods ///
/// @dev Deposits value, executes swaps, and performs minimum amount check
/// @param _transactionId the transaction id associated with the operation
/// @param _minAmount the minimum amount of the final asset to receive
/// @param _swaps Array of data used to execute swaps
/// @param _leftoverReceiver The address to send leftover funds to
/// @return uint256 result of the swap
function _depositAndSwap(
bytes32 _transactionId,
uint256 _minAmount,
LibSwap.SwapData[] calldata _swaps,
address payable _leftoverReceiver
) internal returns (uint256) {
uint256 numSwaps = _swaps.length;
if (numSwaps == 0) {
revert NoSwapDataProvided();
}
address finalTokenId = _swaps[numSwaps - 1].receivingAssetId;
uint256 initialBalance = LibAsset.getOwnBalance(finalTokenId);
if (LibAsset.isNativeAsset(finalTokenId)) {
initialBalance -= msg.value;
}
uint256[] memory initialBalances = _fetchBalances(_swaps);
LibAsset.depositAssets(_swaps);
_executeSwaps(
_transactionId,
_swaps,
_leftoverReceiver,
initialBalances
);
uint256 newBalance = LibAsset.getOwnBalance(finalTokenId) -
initialBalance;
if (newBalance < _minAmount) {
revert CumulativeSlippageTooHigh(_minAmount, newBalance);
}
return newBalance;
}
/// @dev Deposits value, executes swaps, and performs minimum amount check and reserves native token for fees
/// @param _transactionId the transaction id associated with the operation
/// @param _minAmount the minimum amount of the final asset to receive
/// @param _swaps Array of data used to execute swaps
/// @param _leftoverReceiver The address to send leftover funds to
/// @param _nativeReserve Amount of native token to prevent from being swept back to the caller
function _depositAndSwap(
bytes32 _transactionId,
uint256 _minAmount,
LibSwap.SwapData[] calldata _swaps,
address payable _leftoverReceiver,
uint256 _nativeReserve
) internal returns (uint256) {
uint256 numSwaps = _swaps.length;
if (numSwaps == 0) {
revert NoSwapDataProvided();
}
address finalTokenId = _swaps[numSwaps - 1].receivingAssetId;
uint256 initialBalance = LibAsset.getOwnBalance(finalTokenId);
if (LibAsset.isNativeAsset(finalTokenId)) {
initialBalance -= msg.value;
}
uint256[] memory initialBalances = _fetchBalances(_swaps);
LibAsset.depositAssets(_swaps);
ReserveData memory rd = ReserveData(
_transactionId,
_leftoverReceiver,
_nativeReserve
);
_executeSwaps(rd, _swaps, initialBalances);
uint256 newBalance = LibAsset.getOwnBalance(finalTokenId) -
initialBalance;
if (LibAsset.isNativeAsset(finalTokenId)) {
newBalance -= _nativeReserve;
}
if (newBalance < _minAmount) {
revert CumulativeSlippageTooHigh(_minAmount, newBalance);
}
return newBalance;
}
/// Private Methods ///
/// @dev Executes swaps and checks that DEXs used are in the allowList
/// @param _transactionId the transaction id associated with the operation
/// @param _swaps Array of data used to execute swaps
/// @param _leftoverReceiver Address to send leftover tokens to
/// @param _initialBalances Array of initial balances
function _executeSwaps(
bytes32 _transactionId,
LibSwap.SwapData[] calldata _swaps,
address payable _leftoverReceiver,
uint256[] memory _initialBalances
) internal noLeftovers(_swaps, _leftoverReceiver, _initialBalances) {
uint256 numSwaps = _swaps.length;
for (uint256 i = 0; i < numSwaps; ) {
LibSwap.SwapData calldata currentSwap = _swaps[i];
if (
!((LibAsset.isNativeAsset(currentSwap.sendingAssetId) ||
LibAllowList.contractIsAllowed(currentSwap.approveTo)) &&
LibAllowList.contractIsAllowed(currentSwap.callTo) &&
LibAllowList.selectorIsAllowed(
bytes4(currentSwap.callData[:4])
))
) revert ContractCallNotAllowed();
LibSwap.swap(_transactionId, currentSwap);
unchecked {
++i;
}
}
}
/// @dev Executes swaps and checks that DEXs used are in the allowList
/// @param _reserveData Data passed used to reserve native tokens
/// @param _swaps Array of data used to execute swaps
function _executeSwaps(
ReserveData memory _reserveData,
LibSwap.SwapData[] calldata _swaps,
uint256[] memory _initialBalances
)
internal
noLeftoversReserve(
_swaps,
_reserveData.leftoverReceiver,
_initialBalances,
_reserveData.nativeReserve
)
{
uint256 numSwaps = _swaps.length;
for (uint256 i = 0; i < numSwaps; ) {
LibSwap.SwapData calldata currentSwap = _swaps[i];
if (
!((LibAsset.isNativeAsset(currentSwap.sendingAssetId) ||
LibAllowList.contractIsAllowed(currentSwap.approveTo)) &&
LibAllowList.contractIsAllowed(currentSwap.callTo) &&
LibAllowList.selectorIsAllowed(
bytes4(currentSwap.callData[:4])
))
) revert ContractCallNotAllowed();
LibSwap.swap(_reserveData.transactionId, currentSwap);
unchecked {
++i;
}
}
}
/// @dev Fetches balances of tokens to be swapped before swapping.
/// @param _swaps Array of data used to execute swaps
/// @return uint256[] Array of token balances.
function _fetchBalances(
LibSwap.SwapData[] calldata _swaps
) private view returns (uint256[] memory) {
uint256 numSwaps = _swaps.length;
uint256[] memory balances = new uint256[](numSwaps);
address asset;
for (uint256 i = 0; i < numSwaps; ) {
asset = _swaps[i].receivingAssetId;
balances[i] = LibAsset.getOwnBalance(asset);
if (LibAsset.isNativeAsset(asset)) {
balances[i] -= msg.value;
}
unchecked {
++i;
}
}
return balances;
}
}// SPDX-License-Identifier: UNLICENSED
/// @custom:version 1.0.0
pragma solidity ^0.8.17;
import { LibAsset } from "../Libraries/LibAsset.sol";
import { LibUtil } from "../Libraries/LibUtil.sol";
import { InvalidReceiver, InformationMismatch, InvalidSendingToken, InvalidAmount, NativeAssetNotSupported, InvalidDestinationChain, CannotBridgeToSameNetwork } from "../Errors/GenericErrors.sol";
import { ILiFi } from "../Interfaces/ILiFi.sol";
import { LibSwap } from "../Libraries/LibSwap.sol";
contract Validatable {
modifier validateBridgeData(ILiFi.BridgeData memory _bridgeData) {
if (LibUtil.isZeroAddress(_bridgeData.receiver)) {
revert InvalidReceiver();
}
if (_bridgeData.minAmount == 0) {
revert InvalidAmount();
}
if (_bridgeData.destinationChainId == block.chainid) {
revert CannotBridgeToSameNetwork();
}
_;
}
modifier noNativeAsset(ILiFi.BridgeData memory _bridgeData) {
if (LibAsset.isNativeAsset(_bridgeData.sendingAssetId)) {
revert NativeAssetNotSupported();
}
_;
}
modifier onlyAllowSourceToken(
ILiFi.BridgeData memory _bridgeData,
address _token
) {
if (_bridgeData.sendingAssetId != _token) {
revert InvalidSendingToken();
}
_;
}
modifier onlyAllowDestinationChain(
ILiFi.BridgeData memory _bridgeData,
uint256 _chainId
) {
if (_bridgeData.destinationChainId != _chainId) {
revert InvalidDestinationChain();
}
_;
}
modifier containsSourceSwaps(ILiFi.BridgeData memory _bridgeData) {
if (!_bridgeData.hasSourceSwaps) {
revert InformationMismatch();
}
_;
}
modifier doesNotContainSourceSwaps(ILiFi.BridgeData memory _bridgeData) {
if (_bridgeData.hasSourceSwaps) {
revert InformationMismatch();
}
_;
}
modifier doesNotContainDestinationCalls(
ILiFi.BridgeData memory _bridgeData
) {
if (_bridgeData.hasDestinationCall) {
revert InformationMismatch();
}
_;
}
}// SPDX-License-Identifier: LGPL-3.0-only
/// @custom:version 1.0.0
pragma solidity ^0.8.17;
struct QuoteSendInfo {
Fee gmpFee;
uint256 amountSent;
uint256 valueSent;
AirliftFeeInfo airliftFeeInfo;
}
struct AirliftFeeInfo {
Fee airliftFee;
uint256 correctedAmount;
uint256 correctedValue;
}
struct Fee {
uint256 nativeFee;
uint256 tokenFee;
}
interface IGlacisAirlift {
/// Use to send a token from chain A to chain B after approving this contract with the token.
/// This function should only be used when a smart contract calls it, so that the token's transfer
/// and the cross-chain send are atomic within a single transaction.
/// @param token The address of the token sending across chains.
/// @param amount The amount of the token you want to send across chains.
/// @param receiver The target address that should receive the funds on the destination chain.
/// @param destinationChainId The Ethereum chain ID of the destination chain.
/// @param refundAddress The address that should receive any funds in the case the cross-chain gas value is too high.
function send(
address token,
uint256 amount,
bytes32 receiver,
uint256 destinationChainId,
address refundAddress
) external payable;
/// Use to quote the send a token from chain A to chain B.
/// @param token The address of the token sending across chains.
/// @param amount The amount of the token you want to send across chains.
/// @param receiver The target address that should receive the funds on the destination chain.
/// @param destinationChainId The Ethereum chain ID of the destination chain.
/// @param refundAddress The address that should receive any funds in the case the cross-chain gas value is too high.
/// @return The amount of token and value fees required to send the token across chains.
function quoteSend(
address token,
uint256 amount,
bytes32 receiver,
uint256 destinationChainId,
address refundAddress,
uint256 msgValue
) external returns (QuoteSendInfo memory);
}// SPDX-License-Identifier: LGPL-3.0-only
pragma solidity ^0.8.17;
/// @title LIFI Interface
/// @author LI.FI (https://li.fi)
/// @custom:version 1.0.0
interface ILiFi {
/// Structs ///
struct BridgeData {
bytes32 transactionId;
string bridge;
string integrator;
address referrer;
address sendingAssetId;
address receiver;
uint256 minAmount;
uint256 destinationChainId;
bool hasSourceSwaps;
bool hasDestinationCall;
}
/// Events ///
event LiFiTransferStarted(ILiFi.BridgeData bridgeData);
event LiFiTransferCompleted(
bytes32 indexed transactionId,
address receivingAssetId,
address receiver,
uint256 amount,
uint256 timestamp
);
event LiFiTransferRecovered(
bytes32 indexed transactionId,
address receivingAssetId,
address receiver,
uint256 amount,
uint256 timestamp
);
event LiFiGenericSwapCompleted(
bytes32 indexed transactionId,
string integrator,
string referrer,
address receiver,
address fromAssetId,
address toAssetId,
uint256 fromAmount,
uint256 toAmount
);
// Deprecated but kept here to include in ABI to parse historic events
event LiFiSwappedGeneric(
bytes32 indexed transactionId,
string integrator,
string referrer,
address fromAssetId,
address toAssetId,
uint256 fromAmount,
uint256 toAmount
);
}// SPDX-License-Identifier: LGPL-3.0-only
/// @custom:version 1.0.0
pragma solidity ^0.8.17;
import { InvalidContract } from "../Errors/GenericErrors.sol";
/// @title Lib Allow List
/// @author LI.FI (https://li.fi)
/// @notice Library for managing and accessing the conract address allow list
library LibAllowList {
/// Storage ///
bytes32 internal constant NAMESPACE =
keccak256("com.lifi.library.allow.list");
struct AllowListStorage {
mapping(address => bool) allowlist;
mapping(bytes4 => bool) selectorAllowList;
address[] contracts;
}
/// @dev Adds a contract address to the allow list
/// @param _contract the contract address to add
function addAllowedContract(address _contract) internal {
_checkAddress(_contract);
AllowListStorage storage als = _getStorage();
if (als.allowlist[_contract]) return;
als.allowlist[_contract] = true;
als.contracts.push(_contract);
}
/// @dev Checks whether a contract address has been added to the allow list
/// @param _contract the contract address to check
function contractIsAllowed(
address _contract
) internal view returns (bool) {
return _getStorage().allowlist[_contract];
}
/// @dev Remove a contract address from the allow list
/// @param _contract the contract address to remove
function removeAllowedContract(address _contract) internal {
AllowListStorage storage als = _getStorage();
if (!als.allowlist[_contract]) {
return;
}
als.allowlist[_contract] = false;
uint256 length = als.contracts.length;
// Find the contract in the list
for (uint256 i = 0; i < length; i++) {
if (als.contracts[i] == _contract) {
// Move the last element into the place to delete
als.contracts[i] = als.contracts[length - 1];
// Remove the last element
als.contracts.pop();
break;
}
}
}
/// @dev Fetch contract addresses from the allow list
function getAllowedContracts() internal view returns (address[] memory) {
return _getStorage().contracts;
}
/// @dev Add a selector to the allow list
/// @param _selector the selector to add
function addAllowedSelector(bytes4 _selector) internal {
_getStorage().selectorAllowList[_selector] = true;
}
/// @dev Removes a selector from the allow list
/// @param _selector the selector to remove
function removeAllowedSelector(bytes4 _selector) internal {
_getStorage().selectorAllowList[_selector] = false;
}
/// @dev Returns if selector has been added to the allow list
/// @param _selector the selector to check
function selectorIsAllowed(bytes4 _selector) internal view returns (bool) {
return _getStorage().selectorAllowList[_selector];
}
/// @dev Fetch local storage struct
function _getStorage()
internal
pure
returns (AllowListStorage storage als)
{
bytes32 position = NAMESPACE;
// solhint-disable-next-line no-inline-assembly
assembly {
als.slot := position
}
}
/// @dev Contains business logic for validating a contract address.
/// @param _contract address of the dex to check
function _checkAddress(address _contract) private view {
if (_contract == address(0)) revert InvalidContract();
if (_contract.code.length == 0) revert InvalidContract();
}
}// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.17;
import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import { LibSwap } from "./LibSwap.sol";
import { SafeTransferLib } from "solady/utils/SafeTransferLib.sol";
import { InvalidReceiver, NullAddrIsNotAValidSpender, InvalidAmount, NullAddrIsNotAnERC20Token } from "../Errors/GenericErrors.sol";
/// @title LibAsset
/// @custom:version 2.1.0
/// @notice This library contains helpers for dealing with onchain transfers
/// of assets, including accounting for the native asset `assetId`
/// conventions and any noncompliant ERC20 transfers
library LibAsset {
using SafeTransferLib for address;
using SafeTransferLib for address payable;
address internal constant NULL_ADDRESS = address(0);
address internal constant NON_EVM_ADDRESS =
0x11f111f111f111F111f111f111F111f111f111F1;
/// @dev All native assets use the empty address for their asset id
/// by convention
address internal constant NATIVE_ASSETID = NULL_ADDRESS;
/// @dev EIP-7702 delegation designator prefix for Account Abstraction
bytes3 internal constant DELEGATION_DESIGNATOR = 0xef0100;
/// @notice Gets the balance of the inheriting contract for the given asset
/// @param assetId The asset identifier to get the balance of
/// @return Balance held by contracts using this library (returns 0 if assetId does not exist)
function getOwnBalance(address assetId) internal view returns (uint256) {
return
isNativeAsset(assetId)
? address(this).balance
: assetId.balanceOf(address(this));
}
/// @notice Wrapper function to transfer a given asset (native or erc20) to
/// some recipient. Should handle all non-compliant return value
/// tokens as well by using the SafeERC20 contract by open zeppelin.
/// @param assetId Asset id for transfer (address(0) for native asset,
/// token address for erc20s)
/// @param recipient Address to send asset to
/// @param amount Amount to send to given recipient
function transferAsset(
address assetId,
address payable recipient,
uint256 amount
) internal {
if (isNativeAsset(assetId)) {
transferNativeAsset(recipient, amount);
} else {
transferERC20(assetId, recipient, amount);
}
}
/// @notice Transfers ether from the inheriting contract to a given
/// recipient
/// @param recipient Address to send ether to
/// @param amount Amount to send to given recipient
function transferNativeAsset(
address payable recipient,
uint256 amount
) private {
// make sure a meaningful receiver address was provided
if (recipient == NULL_ADDRESS) revert InvalidReceiver();
// transfer native asset (will revert if target reverts or contract has insufficient balance)
recipient.safeTransferETH(amount);
}
/// @notice Transfers tokens from the inheriting contract to a given recipient
/// @param assetId Token address to transfer
/// @param recipient Address to send tokens to
/// @param amount Amount to send to given recipient
function transferERC20(
address assetId,
address recipient,
uint256 amount
) private {
// make sure a meaningful receiver address was provided
if (recipient == NULL_ADDRESS) {
revert InvalidReceiver();
}
// transfer ERC20 assets (will revert if target reverts or contract has insufficient balance)
assetId.safeTransfer(recipient, amount);
}
/// @notice Transfers tokens from a sender to a given recipient
/// @param assetId Token address to transfer
/// @param from Address of sender/owner
/// @param recipient Address of recipient/spender
/// @param amount Amount to transfer from owner to spender
function transferFromERC20(
address assetId,
address from,
address recipient,
uint256 amount
) internal {
// check if native asset
if (isNativeAsset(assetId)) {
revert NullAddrIsNotAnERC20Token();
}
// make sure a meaningful receiver address was provided
if (recipient == NULL_ADDRESS) {
revert InvalidReceiver();
}
// transfer ERC20 assets (will revert if target reverts or contract has insufficient balance)
assetId.safeTransferFrom(from, recipient, amount);
}
/// @notice Pulls tokens from msg.sender
/// @param assetId Token address to transfer
/// @param amount Amount to transfer from owner
function depositAsset(address assetId, uint256 amount) internal {
// make sure a meaningful amount was provided
if (amount == 0) revert InvalidAmount();
// check if native asset
if (isNativeAsset(assetId)) {
// ensure msg.value is equal or greater than amount
if (msg.value < amount) revert InvalidAmount();
} else {
// transfer ERC20 assets (will revert if target reverts or contract has insufficient balance)
assetId.safeTransferFrom(msg.sender, address(this), amount);
}
}
function depositAssets(LibSwap.SwapData[] calldata swaps) internal {
for (uint256 i = 0; i < swaps.length; ) {
LibSwap.SwapData calldata swap = swaps[i];
if (swap.requiresDeposit) {
depositAsset(swap.sendingAssetId, swap.fromAmount);
}
unchecked {
i++;
}
}
}
/// @notice If the current allowance is insufficient, the allowance for a given spender
/// is set to MAX_UINT.
/// @param assetId Token address to transfer
/// @param spender Address to give spend approval to
/// @param amount allowance amount required for current transaction
function maxApproveERC20(
IERC20 assetId,
address spender,
uint256 amount
) internal {
approveERC20(assetId, spender, amount, type(uint256).max);
}
/// @notice If the current allowance is insufficient, the allowance for a given spender
/// is set to the amount provided
/// @param assetId Token address to transfer
/// @param spender Address to give spend approval to
/// @param requiredAllowance Allowance required for current transaction
/// @param setAllowanceTo The amount the allowance should be set to if current allowance is insufficient
function approveERC20(
IERC20 assetId,
address spender,
uint256 requiredAllowance,
uint256 setAllowanceTo
) internal {
if (isNativeAsset(address(assetId))) {
return;
}
// make sure a meaningful spender address was provided
if (spender == NULL_ADDRESS) {
revert NullAddrIsNotAValidSpender();
}
// check if allowance is sufficient, otherwise set allowance to provided amount
// If the initial attempt to approve fails, attempts to reset the approved amount to zero,
// then retries the approval again (some tokens, e.g. USDT, requires this).
// Reverts upon failure
if (assetId.allowance(address(this), spender) < requiredAllowance) {
address(assetId).safeApproveWithRetry(spender, setAllowanceTo);
}
}
/// @notice Determines whether the given assetId is the native asset
/// @param assetId The asset identifier to evaluate
/// @return Boolean indicating if the asset is the native asset
function isNativeAsset(address assetId) internal pure returns (bool) {
return assetId == NATIVE_ASSETID;
}
/// @notice Checks if the given address is a contract
/// Returns true for any account with runtime code (excluding EIP-7702 accounts).
/// For EIP-7702 accounts, checks if code size is exactly 23 bytes (delegation format).
/// Limitations:
/// - Cannot distinguish between EOA and self-destructed contract
/// @param account The address to be checked
function isContract(address account) internal view returns (bool) {
uint256 size;
assembly {
size := extcodesize(account)
}
// Return true only for regular contracts (size > 23)
// EIP-7702 delegated accounts (size == 23) are still EOAs, not contracts
return size > 23;
}
}// SPDX-License-Identifier: LGPL-3.0-only
/// @custom:version 1.0.0
pragma solidity ^0.8.17;
library LibBytes {
// solhint-disable no-inline-assembly
// LibBytes specific errors
error SliceOverflow();
error SliceOutOfBounds();
error AddressOutOfBounds();
bytes16 private constant _SYMBOLS = "0123456789abcdef";
// -------------------------
function slice(
bytes memory _bytes,
uint256 _start,
uint256 _length
) internal pure returns (bytes memory) {
if (_length + 31 < _length) revert SliceOverflow();
if (_bytes.length < _start + _length) revert SliceOutOfBounds();
bytes memory tempBytes;
assembly {
switch iszero(_length)
case 0 {
// Get a location of some free memory and store it in tempBytes as
// Solidity does for memory variables.
tempBytes := mload(0x40)
// The first word of the slice result is potentially a partial
// word read from the original array. To read it, we calculate
// the length of that partial word and start copying that many
// bytes into the array. The first word we copy will start with
// data we don't care about, but the last `lengthmod` bytes will
// land at the beginning of the contents of the new array. When
// we're done copying, we overwrite the full first word with
// the actual length of the slice.
let lengthmod := and(_length, 31)
// The multiplication in the next line is necessary
// because when slicing multiples of 32 bytes (lengthmod == 0)
// the following copy loop was copying the origin's length
// and then ending prematurely not copying everything it should.
let mc := add(
add(tempBytes, lengthmod),
mul(0x20, iszero(lengthmod))
)
let end := add(mc, _length)
for {
// The multiplication in the next line has the same exact purpose
// as the one above.
let cc := add(
add(
add(_bytes, lengthmod),
mul(0x20, iszero(lengthmod))
),
_start
)
} lt(mc, end) {
mc := add(mc, 0x20)
cc := add(cc, 0x20)
} {
mstore(mc, mload(cc))
}
mstore(tempBytes, _length)
//update free-memory pointer
//allocating the array padded to 32 bytes like the compiler does now
mstore(0x40, and(add(mc, 31), not(31)))
}
//if we want a zero-length slice let's just return a zero-length array
default {
tempBytes := mload(0x40)
//zero out the 32 bytes slice we are about to return
//we need to do it because Solidity does not garbage collect
mstore(tempBytes, 0)
mstore(0x40, add(tempBytes, 0x20))
}
}
return tempBytes;
}
function toAddress(
bytes memory _bytes,
uint256 _start
) internal pure returns (address) {
if (_bytes.length < _start + 20) {
revert AddressOutOfBounds();
}
address tempAddress;
assembly {
tempAddress := div(
mload(add(add(_bytes, 0x20), _start)),
0x1000000000000000000000000
)
}
return tempAddress;
}
/// Copied from OpenZeppelin's `Strings.sol` utility library.
/// https://github.com/OpenZeppelin/openzeppelin-contracts/blob/8335676b0e99944eef6a742e16dcd9ff6e68e609/contracts/utils/Strings.sol
function toHexString(
uint256 value,
uint256 length
) internal pure returns (string memory) {
bytes memory buffer = new bytes(2 * length + 2);
buffer[0] = "0";
buffer[1] = "x";
for (uint256 i = 2 * length + 1; i > 1; --i) {
buffer[i] = _SYMBOLS[value & 0xf];
value >>= 4;
}
// solhint-disable-next-line gas-custom-errors
require(value == 0, "Strings: hex length insufficient");
return string(buffer);
}
}// SPDX-License-Identifier: LGPL-3.0-only
pragma solidity ^0.8.17;
import { LibAsset } from "./LibAsset.sol";
import { LibUtil } from "./LibUtil.sol";
import { InvalidContract, NoSwapFromZeroBalance } from "../Errors/GenericErrors.sol";
import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
/// @title LibSwap
/// @custom:version 1.1.0
/// @notice This library contains functionality to execute mostly swaps but also
/// other calls such as fee collection, token wrapping/unwrapping or
/// sending gas to destination chain
library LibSwap {
/// @notice Struct containing all necessary data to execute a swap or generic call
/// @param callTo The address of the contract to call for executing the swap
/// @param approveTo The address that will receive token approval (can be different than callTo for some DEXs)
/// @param sendingAssetId The address of the token being sent
/// @param receivingAssetId The address of the token expected to be received
/// @param fromAmount The exact amount of the sending asset to be used in the call
/// @param callData Encoded function call data to be sent to the `callTo` contract
/// @param requiresDeposit A flag indicating whether the tokens must be deposited (pulled) before the call
struct SwapData {
address callTo;
address approveTo;
address sendingAssetId;
address receivingAssetId;
uint256 fromAmount;
bytes callData;
bool requiresDeposit;
}
/// @notice Emitted after a successful asset swap or related operation
/// @param transactionId The unique identifier associated with the swap operation
/// @param dex The address of the DEX or contract that handled the swap
/// @param fromAssetId The address of the token that was sent
/// @param toAssetId The address of the token that was received
/// @param fromAmount The amount of `fromAssetId` sent
/// @param toAmount The amount of `toAssetId` received
/// @param timestamp The timestamp when the swap was executed
event AssetSwapped(
bytes32 transactionId,
address dex,
address fromAssetId,
address toAssetId,
uint256 fromAmount,
uint256 toAmount,
uint256 timestamp
);
function swap(bytes32 transactionId, SwapData calldata _swap) internal {
// make sure callTo is a contract
if (!LibAsset.isContract(_swap.callTo)) revert InvalidContract();
// make sure that fromAmount is not 0
uint256 fromAmount = _swap.fromAmount;
if (fromAmount == 0) revert NoSwapFromZeroBalance();
// determine how much native value to send with the swap call
uint256 nativeValue = LibAsset.isNativeAsset(_swap.sendingAssetId)
? _swap.fromAmount
: 0;
// store initial balance (required for event emission)
uint256 initialReceivingAssetBalance = LibAsset.getOwnBalance(
_swap.receivingAssetId
);
// max approve (if ERC20)
if (nativeValue == 0) {
LibAsset.maxApproveERC20(
IERC20(_swap.sendingAssetId),
_swap.approveTo,
_swap.fromAmount
);
}
// we used to have a sending asset balance check here (initialSendingAssetBalance >= _swap.fromAmount)
// this check was removed to allow for more flexibility with rebasing/fee-taking tokens
// the general assumption is that if not enough tokens are available to execute the calldata, the transaction will fail anyway
// the error message might not be as explicit though
// execute the swap
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory res) = _swap.callTo.call{
value: nativeValue
}(_swap.callData);
if (!success) {
LibUtil.revertWith(res);
}
// get post-swap balance
uint256 newBalance = LibAsset.getOwnBalance(_swap.receivingAssetId);
// emit event
emit AssetSwapped(
transactionId,
_swap.callTo,
_swap.sendingAssetId,
_swap.receivingAssetId,
_swap.fromAmount,
newBalance > initialReceivingAssetBalance
? newBalance - initialReceivingAssetBalance
: newBalance,
block.timestamp
);
}
}// SPDX-License-Identifier: LGPL-3.0-only
/// @custom:version 1.0.0
pragma solidity ^0.8.17;
// solhint-disable-next-line no-global-import
import "./LibBytes.sol";
library LibUtil {
using LibBytes for bytes;
function getRevertMsg(
bytes memory _res
) internal pure returns (string memory) {
// If the _res length is less than 68, then the transaction failed silently (without a revert message)
if (_res.length < 68) return "Transaction reverted silently";
bytes memory revertData = _res.slice(4, _res.length - 4); // Remove the selector which is the first 4 bytes
return abi.decode(revertData, (string)); // All that remains is the revert string
}
/// @notice Determines whether the given address is the zero address
/// @param addr The address to verify
/// @return Boolean indicating if the address is the zero address
function isZeroAddress(address addr) internal pure returns (bool) {
return addr == address(0);
}
function revertWith(bytes memory data) internal pure {
assembly {
let dataSize := mload(data) // Load the size of the data
let dataPtr := add(data, 0x20) // Advance data pointer to the next word
revert(dataPtr, dataSize) // Revert with the given data
}
}
}{
"evmVersion": "cancun",
"metadata": {
"appendCBOR": true,
"bytecodeHash": "ipfs",
"useLiteralContent": false
},
"optimizer": {
"enabled": true,
"runs": 1000000
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"abi"
]
}
},
"remappings": [
"@eth-optimism/=node_modules/@hop-protocol/sdk/node_modules/@eth-optimism/",
"@uniswap/=node_modules/@uniswap/",
"eth-gas-reporter/=node_modules/eth-gas-reporter/",
"@openzeppelin/=lib/openzeppelin-contracts/",
"celer-network/=lib/sgn-v2-contracts/",
"create3-factory/=lib/create3-factory/src/",
"solmate/=lib/solmate/src/",
"solady/=lib/solady/src/",
"permit2/=lib/Permit2/src/",
"ds-test/=lib/ds-test/src/",
"forge-std/=lib/forge-std/src/",
"lifi/=src/",
"test/=test/",
"Permit2/=lib/Permit2/",
"erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
"forge-gas-snapshot/=lib/Permit2/lib/forge-gas-snapshot/src/",
"hardhat/=node_modules/hardhat/",
"openzeppelin-contracts/=lib/openzeppelin-contracts/",
"openzeppelin/=lib/openzeppelin-contracts/contracts/",
"sgn-v2-contracts/=lib/sgn-v2-contracts/contracts/"
],
"viaIR": false
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"contract IGlacisAirlift","name":"_airlift","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"CannotBridgeToSameNetwork","type":"error"},{"inputs":[],"name":"ContractCallNotAllowed","type":"error"},{"inputs":[{"internalType":"uint256","name":"minAmount","type":"uint256"},{"internalType":"uint256","name":"receivedAmount","type":"uint256"}],"name":"CumulativeSlippageTooHigh","type":"error"},{"inputs":[],"name":"InformationMismatch","type":"error"},{"inputs":[],"name":"InvalidAmount","type":"error"},{"inputs":[],"name":"InvalidConfig","type":"error"},{"inputs":[],"name":"InvalidContract","type":"error"},{"inputs":[],"name":"InvalidReceiver","type":"error"},{"inputs":[],"name":"InvalidRefundAddress","type":"error"},{"inputs":[],"name":"NativeAssetNotSupported","type":"error"},{"inputs":[],"name":"NoSwapDataProvided","type":"error"},{"inputs":[],"name":"NoSwapFromZeroBalance","type":"error"},{"inputs":[],"name":"NullAddrIsNotAValidSpender","type":"error"},{"inputs":[],"name":"ReentrancyError","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"transactionId","type":"bytes32"},{"indexed":false,"internalType":"address","name":"dex","type":"address"},{"indexed":false,"internalType":"address","name":"fromAssetId","type":"address"},{"indexed":false,"internalType":"address","name":"toAssetId","type":"address"},{"indexed":false,"internalType":"uint256","name":"fromAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"toAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"AssetSwapped","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"transactionId","type":"bytes32"},{"indexed":false,"internalType":"string","name":"integrator","type":"string"},{"indexed":false,"internalType":"string","name":"referrer","type":"string"},{"indexed":false,"internalType":"address","name":"receiver","type":"address"},{"indexed":false,"internalType":"address","name":"fromAssetId","type":"address"},{"indexed":false,"internalType":"address","name":"toAssetId","type":"address"},{"indexed":false,"internalType":"uint256","name":"fromAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"toAmount","type":"uint256"}],"name":"LiFiGenericSwapCompleted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"transactionId","type":"bytes32"},{"indexed":false,"internalType":"string","name":"integrator","type":"string"},{"indexed":false,"internalType":"string","name":"referrer","type":"string"},{"indexed":false,"internalType":"address","name":"fromAssetId","type":"address"},{"indexed":false,"internalType":"address","name":"toAssetId","type":"address"},{"indexed":false,"internalType":"uint256","name":"fromAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"toAmount","type":"uint256"}],"name":"LiFiSwappedGeneric","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"transactionId","type":"bytes32"},{"indexed":false,"internalType":"address","name":"receivingAssetId","type":"address"},{"indexed":false,"internalType":"address","name":"receiver","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"LiFiTransferCompleted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"transactionId","type":"bytes32"},{"indexed":false,"internalType":"address","name":"receivingAssetId","type":"address"},{"indexed":false,"internalType":"address","name":"receiver","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"LiFiTransferRecovered","type":"event"},{"anonymous":false,"inputs":[{"components":[{"internalType":"bytes32","name":"transactionId","type":"bytes32"},{"internalType":"string","name":"bridge","type":"string"},{"internalType":"string","name":"integrator","type":"string"},{"internalType":"address","name":"referrer","type":"address"},{"internalType":"address","name":"sendingAssetId","type":"address"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"minAmount","type":"uint256"},{"internalType":"uint256","name":"destinationChainId","type":"uint256"},{"internalType":"bool","name":"hasSourceSwaps","type":"bool"},{"internalType":"bool","name":"hasDestinationCall","type":"bool"}],"indexed":false,"internalType":"struct ILiFi.BridgeData","name":"bridgeData","type":"tuple"}],"name":"LiFiTransferStarted","type":"event"},{"inputs":[],"name":"airlift","outputs":[{"internalType":"contract IGlacisAirlift","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"bytes32","name":"transactionId","type":"bytes32"},{"internalType":"string","name":"bridge","type":"string"},{"internalType":"string","name":"integrator","type":"string"},{"internalType":"address","name":"referrer","type":"address"},{"internalType":"address","name":"sendingAssetId","type":"address"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"minAmount","type":"uint256"},{"internalType":"uint256","name":"destinationChainId","type":"uint256"},{"internalType":"bool","name":"hasSourceSwaps","type":"bool"},{"internalType":"bool","name":"hasDestinationCall","type":"bool"}],"internalType":"struct ILiFi.BridgeData","name":"_bridgeData","type":"tuple"},{"components":[{"internalType":"address","name":"refundAddress","type":"address"},{"internalType":"uint256","name":"nativeFee","type":"uint256"}],"internalType":"struct GlacisFacet.GlacisData","name":"_glacisData","type":"tuple"}],"name":"startBridgeTokensViaGlacis","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"bytes32","name":"transactionId","type":"bytes32"},{"internalType":"string","name":"bridge","type":"string"},{"internalType":"string","name":"integrator","type":"string"},{"internalType":"address","name":"referrer","type":"address"},{"internalType":"address","name":"sendingAssetId","type":"address"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"minAmount","type":"uint256"},{"internalType":"uint256","name":"destinationChainId","type":"uint256"},{"internalType":"bool","name":"hasSourceSwaps","type":"bool"},{"internalType":"bool","name":"hasDestinationCall","type":"bool"}],"internalType":"struct ILiFi.BridgeData","name":"_bridgeData","type":"tuple"},{"components":[{"internalType":"address","name":"callTo","type":"address"},{"internalType":"address","name":"approveTo","type":"address"},{"internalType":"address","name":"sendingAssetId","type":"address"},{"internalType":"address","name":"receivingAssetId","type":"address"},{"internalType":"uint256","name":"fromAmount","type":"uint256"},{"internalType":"bytes","name":"callData","type":"bytes"},{"internalType":"bool","name":"requiresDeposit","type":"bool"}],"internalType":"struct LibSwap.SwapData[]","name":"_swapData","type":"tuple[]"},{"components":[{"internalType":"address","name":"refundAddress","type":"address"},{"internalType":"uint256","name":"nativeFee","type":"uint256"}],"internalType":"struct GlacisFacet.GlacisData","name":"_glacisData","type":"tuple"}],"name":"swapAndStartBridgeTokensViaGlacis","outputs":[],"stateMutability":"payable","type":"function"}]Contract Creation Code
60a060405234801561000f575f5ffd5b50604051611d59380380611d5983398101604081905261002e91610066565b6001600160a01b038116610055576040516306b7c75960e31b815260040160405180910390fd5b6001600160a01b0316608052610093565b5f60208284031215610076575f5ffd5b81516001600160a01b038116811461008c575f5ffd5b9392505050565b608051611ca16100b85f395f8181605d015281816106dc01526107070152611ca15ff3fe608060405260043610610033575f3560e01c8063753cbab61461003757806382a3279b1461004c578063e10c04c1146100a8575b5f5ffd5b61004a61004536600461181e565b6100bb565b005b348015610057575f5ffd5b5061007f7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b61004a6100b636600461186a565b61033b565b7fa65bb2f450488ab0858c00edc14abc5297769bf42adb48cfb77752890e8b697b80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01610136576040517f29f745a700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60018155335f6101463447611917565b90508461016b8160a0015173ffffffffffffffffffffffffffffffffffffffff161590565b156101a2576040517f1e4ec46b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8060c001515f036101df576040517f2c5211c600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b468160e001510361021c576040517f4ac09ad300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b858061010001511561025a576040517f50dc905c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8680610120015115610298576040517f50dc905c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b876102bb816080015173ffffffffffffffffffffffffffffffffffffffff161590565b156102f2576040517f5ded599700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61030489608001518a60c001516105c3565b61030e8989610677565b50479250505081811115610330576103305f8461032b8585611917565b610856565b50505f909155505050565b7fa65bb2f450488ab0858c00edc14abc5297769bf42adb48cfb77752890e8b697b80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff016103b6576040517f29f745a700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60018155335f6103c63447611917565b905086806101000151610405576040517f50dc905c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8780610120015115610443576040517f50dc905c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b886104668160a0015173ffffffffffffffffffffffffffffffffffffffff161590565b1561049d576040517f1e4ec46b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8060c001515f036104da576040517f2c5211c600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b468160e0015103610517576040517f4ac09ad300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8961053a816080015173ffffffffffffffffffffffffffffffffffffffff161590565b15610571576040517f5ded599700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61058a8b5f01518c60c001518c8c338d6020013561088b565b60c08c01526105998b89610677565b504792505050818111156105b6576105b65f8461032b8585611917565b50505f9091555050505050565b805f036105fc576040517f2c5211c600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff82166106555780341015610651576040517f2c5211c600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5050565b61065173ffffffffffffffffffffffffffffffffffffffff8316333084610a25565b5f610685602083018361194f565b73ffffffffffffffffffffffffffffffffffffffff16036106d2576040517fe2fe272600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61070582608001517f00000000000000000000000000000000000000000000000000000000000000008460c00151610a7d565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166398242b3f826020013584608001518560c001518660a0015173ffffffffffffffffffffffffffffffffffffffff165f1b8760e00151875f016020810190610784919061194f565b60405160e088901b7fffffffff0000000000000000000000000000000000000000000000000000000016815273ffffffffffffffffffffffffffffffffffffffff9586166004820152602481019490945260448401929092526064830152909116608482015260a4015f604051808303818588803b158015610804575f5ffd5b505af1158015610816573d5f5f3e3d5ffd5b50505050507fcba69f43792f9f399347222505213b55af8e0b0b54b893085c2e27ecbe1644f18260405161084a91906119bb565b60405180910390a15050565b73ffffffffffffffffffffffffffffffffffffffff83166108805761087b8282610aa9565b505050565b61087b838383610b16565b5f838082036108c6576040517f0503c3ed00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f86866108d4600185611917565b8181106108e3576108e3611ace565b90506020028101906108f59190611afb565b61090690608081019060600161194f565b90505f61091282610b84565b905073ffffffffffffffffffffffffffffffffffffffff821661093c576109393482611917565b90505b5f6109478989610bce565b90506109538989610cd8565b604080516060810182528c815273ffffffffffffffffffffffffffffffffffffffff8916602082015290810187905261098e818b8b85610d44565b5f8361099986610b84565b6109a39190611917565b905073ffffffffffffffffffffffffffffffffffffffff85166109cd576109ca8882611917565b90505b8b811015610a15576040517f275c273c000000000000000000000000000000000000000000000000000000008152600481018d90526024810182905260440160405180910390fd5b9c9b505050505050505050505050565b60405181606052826040528360601b602c526f23b872dd000000000000000000000000600c5260205f6064601c5f895af13d1560015f51141716610a7057637939f4245f526004601cfd5b5f60605260405250505050565b61087b8383837fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff61112c565b73ffffffffffffffffffffffffffffffffffffffff8216610af6576040517f1e4ec46b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61065173ffffffffffffffffffffffffffffffffffffffff831682611259565b73ffffffffffffffffffffffffffffffffffffffff8216610b63576040517f1e4ec46b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61087b73ffffffffffffffffffffffffffffffffffffffff84168383611272565b5f73ffffffffffffffffffffffffffffffffffffffff821615610bc657610bc173ffffffffffffffffffffffffffffffffffffffff8316306112bb565b610bc8565b475b92915050565b6060815f8167ffffffffffffffff811115610beb57610beb6115e9565b604051908082528060200260200182016040528015610c14578160200160208202803683370190505b5090505f805b83811015610ccd57868682818110610c3457610c34611ace565b9050602002810190610c469190611afb565b610c5790608081019060600161194f565b9150610c6282610b84565b838281518110610c7457610c74611ace565b602090810291909101015273ffffffffffffffffffffffffffffffffffffffff8216610cc55734838281518110610cad57610cad611ace565b60200260200101818151610cc19190611917565b9052505b600101610c1a565b509095945050505050565b5f5b8181101561087b5736838383818110610cf557610cf5611ace565b9050602002810190610d079190611afb565b9050610d1960e0820160c08301611b37565b15610d3b57610d3b610d31606083016040840161194f565b82608001356105c3565b50600101610cda565b602084015160408501518491849184908360018114611046575f8686610d6b600185611917565b818110610d7a57610d7a611ace565b9050602002810190610d8c9190611afb565b610d9d90608081019060600161194f565b90505f89815b81811015610f4657368d8d83818110610dbe57610dbe611ace565b9050602002810190610dd09190611afb565b9050610dff610de5606083016040840161194f565b73ffffffffffffffffffffffffffffffffffffffff161590565b80610e615750610e61610e18604083016020840161194f565b73ffffffffffffffffffffffffffffffffffffffff165f9081527f7a8ac5d3b7183f220a0602439da45ea337311d699902d1ed11a3725a714e7f1e602052604090205460ff1690565b8015610e785750610e78610e18602083018361194f565b8015610efb5750610efb610e8f60a0830183611b50565b610e9d916004915f91611bb8565b610ea691611bdf565b7fffffffff00000000000000000000000000000000000000000000000000000000165f9081527f7a8ac5d3b7183f220a0602439da45ea337311d699902d1ed11a3725a714e7f1f602052604090205460ff1690565b610f31576040517f9453980400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8e51610f3d90826112ee565b50600101610da3565b505f90505b610f56600185611917565b81101561103e575f898983818110610f7057610f70611ace565b9050602002810190610f829190611afb565b610f9390608081019060600161194f565b90508373ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161461103557868281518110610fda57610fda611ace565b6020026020010151610feb82610b84565b610ff59190611917565b92505f73ffffffffffffffffffffffffffffffffffffffff82161561101a575f61101c565b865b9050831561103357611033828a61032b8488611917565b505b50600101610f4b565b505050611120565b875f5b8181101561111d57368b8b8381811061106457611064611ace565b90506020028101906110769190611afb565b905061108b610de5606083016040840161194f565b806110a457506110a4610e18604083016020840161194f565b80156110bb57506110bb610e18602083018361194f565b80156110d257506110d2610e8f60a0830183611b50565b611108576040517f9453980400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8c5161111490826112ee565b50600101611049565b50505b50505050505050505050565b73ffffffffffffffffffffffffffffffffffffffff8416156112535773ffffffffffffffffffffffffffffffffffffffff8316611195576040517f63ba9bff00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517fdd62ed3e00000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff848116602483015283919086169063dd62ed3e90604401602060405180830381865afa158015611208573d5f5f3e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061122c9190611c45565b10156112535761125373ffffffffffffffffffffffffffffffffffffffff85168483611561565b50505050565b5f385f3884865af16106515763b12d13eb5f526004601cfd5b81601452806034526fa9059cbb0000000000000000000000005f5260205f604460105f875af13d1560015f511417166112b2576390b8ec185f526004601cfd5b5f603452505050565b5f816014526f70a082310000000000000000000000005f5260208060246010865afa601f3d111660205102905092915050565b6113066112fe602083018361194f565b6017903b1190565b61133c576040517f6eefed2000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60808101355f81900361137b576040517fe46e079c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f61138f610de5606085016040860161194f565b611399575f61139f565b82608001355b90505f6113ba6113b5608086016060870161194f565b610b84565b9050815f036113f0576113f06113d6606086016040870161194f565b6113e6604087016020880161194f565b8660800135610a7d565b5f806113ff602087018761194f565b73ffffffffffffffffffffffffffffffffffffffff168461142360a0890189611b50565b604051611431929190611c5c565b5f6040518083038185875af1925050503d805f811461146b576040519150601f19603f3d011682016040523d82523d5f602084013e611470565b606091505b50915091508161148357611483816115df565b5f6114976113b56080890160608a0161194f565b90507f7bfdfdb5e3a3776976e53cb0607060f54c5312701c8cba1155cc4d5394440b38886114c860208a018a61194f565b6114d860608b0160408c0161194f565b6114e860808c0160608d0161194f565b8b608001358987116114fa5786611504565b6115048a88611917565b6040805196875273ffffffffffffffffffffffffffffffffffffffff95861660208801529385169386019390935292166060840152608083019190915260a08201524260c082015260e00160405180910390a15050505050505050565b81601452806034526f095ea7b30000000000000000000000005f5260205f604460105f875af13d1560015f511417166112b2575f6034526f095ea7b30000000000000000000000005f525f38604460105f875af1508060345260205f604460105f875af13d1560015f511417166112b257633e3f8f735f526004601cfd5b8051602082018181fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b604051610140810167ffffffffffffffff8111828210171561163a5761163a6115e9565b60405290565b5f82601f83011261164f575f5ffd5b813567ffffffffffffffff811115611669576116696115e9565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810167ffffffffffffffff811182821017156116b6576116b66115e9565b6040528181528382016020018510156116cd575f5ffd5b816020850160208301375f918101602001919091529392505050565b803573ffffffffffffffffffffffffffffffffffffffff8116811461170c575f5ffd5b919050565b8035801515811461170c575f5ffd5b5f6101408284031215611731575f5ffd5b611739611616565b823581529050602082013567ffffffffffffffff811115611758575f5ffd5b61176484828501611640565b602083015250604082013567ffffffffffffffff811115611783575f5ffd5b61178f84828501611640565b6040830152506117a1606083016116e9565b60608201526117b2608083016116e9565b60808201526117c360a083016116e9565b60a082015260c0828101359082015260e080830135908201526117e96101008301611711565b6101008201526117fc6101208301611711565b61012082015292915050565b5f60408284031215611818575f5ffd5b50919050565b5f5f6060838503121561182f575f5ffd5b823567ffffffffffffffff811115611845575f5ffd5b61185185828601611720565b9250506118618460208501611808565b90509250929050565b5f5f5f5f6080858703121561187d575f5ffd5b843567ffffffffffffffff811115611893575f5ffd5b61189f87828801611720565b945050602085013567ffffffffffffffff8111156118bb575f5ffd5b8501601f810187136118cb575f5ffd5b803567ffffffffffffffff8111156118e1575f5ffd5b8760208260051b84010111156118f5575f5ffd5b6020919091019350915061190c8660408701611808565b905092959194509250565b81810381811115610bc8577f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f6020828403121561195f575f5ffd5b611968826116e9565b9392505050565b5f81518084528060208401602086015e5f6020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b60208152815160208201525f602083015161014060408401526119e261016084018261196f565b905060408401517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0848303016060850152611a1d828261196f565b9150506060840151611a47608085018273ffffffffffffffffffffffffffffffffffffffff169052565b50608084015173ffffffffffffffffffffffffffffffffffffffff811660a08501525060a084015173ffffffffffffffffffffffffffffffffffffffff811660c08501525060c084015160e084015260e0840151610100840152610100840151611ab661012085018215159052565b50610120840151801515610140850152509392505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f82357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff21833603018112611b2d575f5ffd5b9190910192915050565b5f60208284031215611b47575f5ffd5b61196882611711565b5f5f83357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112611b83575f5ffd5b83018035915067ffffffffffffffff821115611b9d575f5ffd5b602001915036819003821315611bb1575f5ffd5b9250929050565b5f5f85851115611bc6575f5ffd5b83861115611bd2575f5ffd5b5050820193919092039150565b80357fffffffff000000000000000000000000000000000000000000000000000000008116906004841015611c3e577fffffffff00000000000000000000000000000000000000000000000000000000808560040360031b1b82161691505b5092915050565b5f60208284031215611c55575f5ffd5b5051919050565b818382375f910190815291905056fea26469706673582212206b379775157fb7ff24fcede99546888bcd2eabdd5a0246e2850d84f33f2ac03164736f6c634300081d0033000000000000000000000000290d54179960984599f16f77dcda81320301b158
Deployed Bytecode
0x608060405260043610610033575f3560e01c8063753cbab61461003757806382a3279b1461004c578063e10c04c1146100a8575b5f5ffd5b61004a61004536600461181e565b6100bb565b005b348015610057575f5ffd5b5061007f7f000000000000000000000000290d54179960984599f16f77dcda81320301b15881565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b61004a6100b636600461186a565b61033b565b7fa65bb2f450488ab0858c00edc14abc5297769bf42adb48cfb77752890e8b697b80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01610136576040517f29f745a700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60018155335f6101463447611917565b90508461016b8160a0015173ffffffffffffffffffffffffffffffffffffffff161590565b156101a2576040517f1e4ec46b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8060c001515f036101df576040517f2c5211c600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b468160e001510361021c576040517f4ac09ad300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b858061010001511561025a576040517f50dc905c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8680610120015115610298576040517f50dc905c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b876102bb816080015173ffffffffffffffffffffffffffffffffffffffff161590565b156102f2576040517f5ded599700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61030489608001518a60c001516105c3565b61030e8989610677565b50479250505081811115610330576103305f8461032b8585611917565b610856565b50505f909155505050565b7fa65bb2f450488ab0858c00edc14abc5297769bf42adb48cfb77752890e8b697b80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff016103b6576040517f29f745a700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60018155335f6103c63447611917565b905086806101000151610405576040517f50dc905c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8780610120015115610443576040517f50dc905c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b886104668160a0015173ffffffffffffffffffffffffffffffffffffffff161590565b1561049d576040517f1e4ec46b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8060c001515f036104da576040517f2c5211c600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b468160e0015103610517576040517f4ac09ad300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8961053a816080015173ffffffffffffffffffffffffffffffffffffffff161590565b15610571576040517f5ded599700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61058a8b5f01518c60c001518c8c338d6020013561088b565b60c08c01526105998b89610677565b504792505050818111156105b6576105b65f8461032b8585611917565b50505f9091555050505050565b805f036105fc576040517f2c5211c600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff82166106555780341015610651576040517f2c5211c600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5050565b61065173ffffffffffffffffffffffffffffffffffffffff8316333084610a25565b5f610685602083018361194f565b73ffffffffffffffffffffffffffffffffffffffff16036106d2576040517fe2fe272600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61070582608001517f000000000000000000000000290d54179960984599f16f77dcda81320301b1588460c00151610a7d565b7f000000000000000000000000290d54179960984599f16f77dcda81320301b15873ffffffffffffffffffffffffffffffffffffffff166398242b3f826020013584608001518560c001518660a0015173ffffffffffffffffffffffffffffffffffffffff165f1b8760e00151875f016020810190610784919061194f565b60405160e088901b7fffffffff0000000000000000000000000000000000000000000000000000000016815273ffffffffffffffffffffffffffffffffffffffff9586166004820152602481019490945260448401929092526064830152909116608482015260a4015f604051808303818588803b158015610804575f5ffd5b505af1158015610816573d5f5f3e3d5ffd5b50505050507fcba69f43792f9f399347222505213b55af8e0b0b54b893085c2e27ecbe1644f18260405161084a91906119bb565b60405180910390a15050565b73ffffffffffffffffffffffffffffffffffffffff83166108805761087b8282610aa9565b505050565b61087b838383610b16565b5f838082036108c6576040517f0503c3ed00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f86866108d4600185611917565b8181106108e3576108e3611ace565b90506020028101906108f59190611afb565b61090690608081019060600161194f565b90505f61091282610b84565b905073ffffffffffffffffffffffffffffffffffffffff821661093c576109393482611917565b90505b5f6109478989610bce565b90506109538989610cd8565b604080516060810182528c815273ffffffffffffffffffffffffffffffffffffffff8916602082015290810187905261098e818b8b85610d44565b5f8361099986610b84565b6109a39190611917565b905073ffffffffffffffffffffffffffffffffffffffff85166109cd576109ca8882611917565b90505b8b811015610a15576040517f275c273c000000000000000000000000000000000000000000000000000000008152600481018d90526024810182905260440160405180910390fd5b9c9b505050505050505050505050565b60405181606052826040528360601b602c526f23b872dd000000000000000000000000600c5260205f6064601c5f895af13d1560015f51141716610a7057637939f4245f526004601cfd5b5f60605260405250505050565b61087b8383837fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff61112c565b73ffffffffffffffffffffffffffffffffffffffff8216610af6576040517f1e4ec46b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61065173ffffffffffffffffffffffffffffffffffffffff831682611259565b73ffffffffffffffffffffffffffffffffffffffff8216610b63576040517f1e4ec46b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61087b73ffffffffffffffffffffffffffffffffffffffff84168383611272565b5f73ffffffffffffffffffffffffffffffffffffffff821615610bc657610bc173ffffffffffffffffffffffffffffffffffffffff8316306112bb565b610bc8565b475b92915050565b6060815f8167ffffffffffffffff811115610beb57610beb6115e9565b604051908082528060200260200182016040528015610c14578160200160208202803683370190505b5090505f805b83811015610ccd57868682818110610c3457610c34611ace565b9050602002810190610c469190611afb565b610c5790608081019060600161194f565b9150610c6282610b84565b838281518110610c7457610c74611ace565b602090810291909101015273ffffffffffffffffffffffffffffffffffffffff8216610cc55734838281518110610cad57610cad611ace565b60200260200101818151610cc19190611917565b9052505b600101610c1a565b509095945050505050565b5f5b8181101561087b5736838383818110610cf557610cf5611ace565b9050602002810190610d079190611afb565b9050610d1960e0820160c08301611b37565b15610d3b57610d3b610d31606083016040840161194f565b82608001356105c3565b50600101610cda565b602084015160408501518491849184908360018114611046575f8686610d6b600185611917565b818110610d7a57610d7a611ace565b9050602002810190610d8c9190611afb565b610d9d90608081019060600161194f565b90505f89815b81811015610f4657368d8d83818110610dbe57610dbe611ace565b9050602002810190610dd09190611afb565b9050610dff610de5606083016040840161194f565b73ffffffffffffffffffffffffffffffffffffffff161590565b80610e615750610e61610e18604083016020840161194f565b73ffffffffffffffffffffffffffffffffffffffff165f9081527f7a8ac5d3b7183f220a0602439da45ea337311d699902d1ed11a3725a714e7f1e602052604090205460ff1690565b8015610e785750610e78610e18602083018361194f565b8015610efb5750610efb610e8f60a0830183611b50565b610e9d916004915f91611bb8565b610ea691611bdf565b7fffffffff00000000000000000000000000000000000000000000000000000000165f9081527f7a8ac5d3b7183f220a0602439da45ea337311d699902d1ed11a3725a714e7f1f602052604090205460ff1690565b610f31576040517f9453980400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8e51610f3d90826112ee565b50600101610da3565b505f90505b610f56600185611917565b81101561103e575f898983818110610f7057610f70611ace565b9050602002810190610f829190611afb565b610f9390608081019060600161194f565b90508373ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161461103557868281518110610fda57610fda611ace565b6020026020010151610feb82610b84565b610ff59190611917565b92505f73ffffffffffffffffffffffffffffffffffffffff82161561101a575f61101c565b865b9050831561103357611033828a61032b8488611917565b505b50600101610f4b565b505050611120565b875f5b8181101561111d57368b8b8381811061106457611064611ace565b90506020028101906110769190611afb565b905061108b610de5606083016040840161194f565b806110a457506110a4610e18604083016020840161194f565b80156110bb57506110bb610e18602083018361194f565b80156110d257506110d2610e8f60a0830183611b50565b611108576040517f9453980400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8c5161111490826112ee565b50600101611049565b50505b50505050505050505050565b73ffffffffffffffffffffffffffffffffffffffff8416156112535773ffffffffffffffffffffffffffffffffffffffff8316611195576040517f63ba9bff00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517fdd62ed3e00000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff848116602483015283919086169063dd62ed3e90604401602060405180830381865afa158015611208573d5f5f3e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061122c9190611c45565b10156112535761125373ffffffffffffffffffffffffffffffffffffffff85168483611561565b50505050565b5f385f3884865af16106515763b12d13eb5f526004601cfd5b81601452806034526fa9059cbb0000000000000000000000005f5260205f604460105f875af13d1560015f511417166112b2576390b8ec185f526004601cfd5b5f603452505050565b5f816014526f70a082310000000000000000000000005f5260208060246010865afa601f3d111660205102905092915050565b6113066112fe602083018361194f565b6017903b1190565b61133c576040517f6eefed2000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60808101355f81900361137b576040517fe46e079c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f61138f610de5606085016040860161194f565b611399575f61139f565b82608001355b90505f6113ba6113b5608086016060870161194f565b610b84565b9050815f036113f0576113f06113d6606086016040870161194f565b6113e6604087016020880161194f565b8660800135610a7d565b5f806113ff602087018761194f565b73ffffffffffffffffffffffffffffffffffffffff168461142360a0890189611b50565b604051611431929190611c5c565b5f6040518083038185875af1925050503d805f811461146b576040519150601f19603f3d011682016040523d82523d5f602084013e611470565b606091505b50915091508161148357611483816115df565b5f6114976113b56080890160608a0161194f565b90507f7bfdfdb5e3a3776976e53cb0607060f54c5312701c8cba1155cc4d5394440b38886114c860208a018a61194f565b6114d860608b0160408c0161194f565b6114e860808c0160608d0161194f565b8b608001358987116114fa5786611504565b6115048a88611917565b6040805196875273ffffffffffffffffffffffffffffffffffffffff95861660208801529385169386019390935292166060840152608083019190915260a08201524260c082015260e00160405180910390a15050505050505050565b81601452806034526f095ea7b30000000000000000000000005f5260205f604460105f875af13d1560015f511417166112b2575f6034526f095ea7b30000000000000000000000005f525f38604460105f875af1508060345260205f604460105f875af13d1560015f511417166112b257633e3f8f735f526004601cfd5b8051602082018181fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b604051610140810167ffffffffffffffff8111828210171561163a5761163a6115e9565b60405290565b5f82601f83011261164f575f5ffd5b813567ffffffffffffffff811115611669576116696115e9565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810167ffffffffffffffff811182821017156116b6576116b66115e9565b6040528181528382016020018510156116cd575f5ffd5b816020850160208301375f918101602001919091529392505050565b803573ffffffffffffffffffffffffffffffffffffffff8116811461170c575f5ffd5b919050565b8035801515811461170c575f5ffd5b5f6101408284031215611731575f5ffd5b611739611616565b823581529050602082013567ffffffffffffffff811115611758575f5ffd5b61176484828501611640565b602083015250604082013567ffffffffffffffff811115611783575f5ffd5b61178f84828501611640565b6040830152506117a1606083016116e9565b60608201526117b2608083016116e9565b60808201526117c360a083016116e9565b60a082015260c0828101359082015260e080830135908201526117e96101008301611711565b6101008201526117fc6101208301611711565b61012082015292915050565b5f60408284031215611818575f5ffd5b50919050565b5f5f6060838503121561182f575f5ffd5b823567ffffffffffffffff811115611845575f5ffd5b61185185828601611720565b9250506118618460208501611808565b90509250929050565b5f5f5f5f6080858703121561187d575f5ffd5b843567ffffffffffffffff811115611893575f5ffd5b61189f87828801611720565b945050602085013567ffffffffffffffff8111156118bb575f5ffd5b8501601f810187136118cb575f5ffd5b803567ffffffffffffffff8111156118e1575f5ffd5b8760208260051b84010111156118f5575f5ffd5b6020919091019350915061190c8660408701611808565b905092959194509250565b81810381811115610bc8577f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f6020828403121561195f575f5ffd5b611968826116e9565b9392505050565b5f81518084528060208401602086015e5f6020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b60208152815160208201525f602083015161014060408401526119e261016084018261196f565b905060408401517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0848303016060850152611a1d828261196f565b9150506060840151611a47608085018273ffffffffffffffffffffffffffffffffffffffff169052565b50608084015173ffffffffffffffffffffffffffffffffffffffff811660a08501525060a084015173ffffffffffffffffffffffffffffffffffffffff811660c08501525060c084015160e084015260e0840151610100840152610100840151611ab661012085018215159052565b50610120840151801515610140850152509392505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f82357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff21833603018112611b2d575f5ffd5b9190910192915050565b5f60208284031215611b47575f5ffd5b61196882611711565b5f5f83357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112611b83575f5ffd5b83018035915067ffffffffffffffff821115611b9d575f5ffd5b602001915036819003821315611bb1575f5ffd5b9250929050565b5f5f85851115611bc6575f5ffd5b83861115611bd2575f5ffd5b5050820193919092039150565b80357fffffffff000000000000000000000000000000000000000000000000000000008116906004841015611c3e577fffffffff00000000000000000000000000000000000000000000000000000000808560040360031b1b82161691505b5092915050565b5f60208284031215611c55575f5ffd5b5051919050565b818382375f910190815291905056fea26469706673582212206b379775157fb7ff24fcede99546888bcd2eabdd5a0246e2850d84f33f2ac03164736f6c634300081d0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000290d54179960984599f16f77dcda81320301b158
-----Decoded View---------------
Arg [0] : _airlift (address): 0x290D54179960984599F16F77DCDA81320301b158
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000290d54179960984599f16f77dcda81320301b158
Deployed Bytecode Sourcemap
715:4162:3:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1841:579;;;;;;:::i;:::-;;:::i;:::-;;948:39;;;;;;;;;;;;;;;;;;3803:42:14;3791:55;;;3773:74;;3761:2;3746:18;948:39:3;;;;;;;2696:735;;;;;;:::i;:::-;;:::i;1841:579::-;322:37:4;731:8;;:20;;727:50;;760:17;;;;;;;;;;;;;;727:50;603:1;787:19;;2058:10:3::1;787:8:4::0;4164:33:5::1;4188:9;4164:21;:33;:::i;:::-;4139:58;;2098:11:3::2;602:43:6;624:11;:20;;;980:18:13::0;;;;897:108;602:43:6::2;598:98;;;668:17;;;;;;;;;;;;;;598:98;709:11;:21;;;734:1;709:26:::0;705:79:::2;;758:15;;;;;;;;;;;;;;705:79;831:13;797:11;:30;;;:47:::0;793:112:::2;;867:27;;;;;;;;;;;;;;793:112;2145:11:3::3;1888::6;:26;;;1884:85;;;1937:21;;;;;;;;;;;;;;1884:85;2197:11:3::4;2097::6;:30;;;2093:89;;;2150:21;;;;;;;;;;;;;;2093:89;2232:11:3::5;1002:50:6;1025:11;:26;;;980:18:13::0;;;;897:108;1002:50:6::5;998:113;;;1075:25;;;;;;;;;;;;;;998:113;2259:106:3::6;2294:11;:26;;;2334:11;:21;;;2259;:106::i;:::-;2375:38;2388:11;2401;2375:12;:38::i;:::-;-1:-1:-1::0;4241:21:5::1;::::0;-1:-1:-1;;;4277:29:5;;::::1;4273:217;;;4322:157;799:1:10;4403:15:5::0;4436:29:::1;4451:14:::0;4436:12;:29:::1;:::i;:::-;4322:22;:157::i;:::-;-1:-1:-1::0;;560:1:4;827:23;;;-1:-1:-1;;;1841:579:3:o;2696:735::-;322:37:4;731:8;;:20;;727:50;;760:17;;;;;;;;;;;;;;727:50;603:1;787:19;;2967:10:3::1;787:8:4::0;4164:33:5::1;4188:9;4164:21;:33;:::i;:::-;4139:58;;3008:11:3::2;1698::6;:26;;;1693:86;;1747:21;;;;;;;;;;;;;;1693:86;3060:11:3::3;2097::6;:30;;;2093:89;;;2150:21;;;;;;;;;;;;;;2093:89;3100:11:3::4;602:43:6;624:11;:20;;;980:18:13::0;;;;897:108;602:43:6::4;598:98;;;668:17;;;;;;;;;;;;;;598:98;709:11;:21;;;734:1;709:26:::0;705:79:::4;;758:15;;;;;;;;;;;;;;705:79;831:13;797:11;:30;;;:47:::0;793:112:::4;;867:27;;;;;;;;;;;;;;793:112;3135:11:3::5;1002:50:6;1025:11;:26;;;980:18:13::0;;;;897:108;1002:50:6::5;998:113;;;1075:25;;;;;;;;;;;;;;998:113;3186:190:3::6;3215:11;:25;;;3254:11;:21;;;3289:9;;3320:10;3345:11;:21;;;3186:15;:190::i;:::-;3162:21;::::0;::::6;:214:::0;3386:38:::6;3162:11:::0;3412;3386:12:::6;:38::i;:::-;-1:-1:-1::0;4241:21:5::1;::::0;-1:-1:-1;;;4277:29:5;;::::1;4273:217;;;4322:157;799:1:10;4403:15:5::0;4436:29:::1;4451:14:::0;4436:12;:29:::1;:::i;4322:157::-;-1:-1:-1::0;;560:1:4;827:23;;;-1:-1:-1;;;;;2696:735:3:o;4743:576:10:-;4875:6;4885:1;4875:11;4871:39;;4895:15;;;;;;;;;;;;;;4871:39;980:18:13;;;4954:359:10;;5076:6;5064:9;:18;5060:46;;;5091:15;;;;;;;;;;;;;;5060:46;4743:576;;:::o;4954:359::-;5243:59;:24;;;5268:10;5288:4;5295:6;5243:24;:59::i;3653:1222:3:-;3827:1;3790:25;;;;:11;:25;:::i;:::-;:39;;;3786:86;;3850:22;;;;;;;;;;;;;;3786:86;4149:147;4194:11;:26;;;4243:7;4265:11;:21;;;4149:24;:147::i;:::-;4547:7;:12;;;4568:11;:21;;;4605:11;:26;;;4645:11;:21;;;4704:11;:20;;;4688:38;;4680:47;;4741:11;:30;;;4785:11;:25;;;;;;;;;;:::i;:::-;4547:273;;;;;;;;;;5777:42:14;5765:55;;;4547:273:3;;;5747:74:14;5837:18;;;5830:34;;;;5880:18;;;5873:34;;;;5923:18;;;5916:34;5987:55;;;5966:19;;;5959:84;5719:19;;4547:273:3;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4836:32;4856:11;4836:32;;;;;;:::i;:::-;;;;;;;;3653:1222;;:::o;2150:301:10:-;980:18:13;;;2282:163:10;;2324:38;2344:9;2355:6;2324:19;:38::i;:::-;2150:301;;;:::o;2282:163::-;2393:41;2407:7;2416:9;2427:6;2393:13;:41::i;6516:1266:5:-;6744:7;6782:6;6810:13;;;6806:71;;6846:20;;;;;;;;;;;;;;6806:71;6887:20;6910:6;;6917:12;6928:1;6917:8;:12;:::i;:::-;6910:20;;;;;;;:::i;:::-;;;;;;;;;;;;:::i;:::-;:37;;;;;;;;;:::i;:::-;6887:60;;6957:22;6982:36;7005:12;6982:22;:36::i;:::-;6957:61;-1:-1:-1;980:18:13;;;7029:94:5;;7085:27;7103:9;7085:27;;:::i;:::-;;;7029:94;7133:32;7168:22;7183:6;;7168:14;:22::i;:::-;7133:57;;7201:30;7224:6;;7201:22;:30::i;:::-;7265:108;;;;;;;;;;;;;;;;;;;;;;;;7383:42;7265:108;7401:6;;7409:15;7383:13;:42::i;:::-;7436:18;7508:14;7457:36;7480:12;7457:22;:36::i;:::-;:65;;;;:::i;:::-;7436:86;-1:-1:-1;980:18:13;;;7533:95:5;;7589:28;7603:14;7589:28;;:::i;:::-;;;7533:95;7655:10;7642;:23;7638:110;;;7688:49;;;;;;;;8653:25:14;;;8694:18;;;8687:34;;;8626:18;;7688:49:5;;;;;;;7638:110;7765:10;6516:1266;-1:-1:-1;;;;;;;;;;;;6516:1266:5:o;9109:1139:1:-;9292:4;9286:11;9357:6;9351:4;9344:20;9422:2;9416:4;9409:16;9487:4;9483:2;9479:13;9473:4;9466:27;9549:34;9543:4;9536:48;9950:4;9944;9938;9932;9929:1;9922:5;9915;9910:45;9844:16;9837:24;9833:1;9826:4;9820:11;9817:18;9814:48;9729:244;9702:404;;10019:10;10013:4;10006:24;10087:4;10081;10074:18;9702:404;10132:1;10126:4;10119:15;10188:4;10181:15;-1:-1:-1;;;;9109:1139:1:o;6007:187:10:-;6130:57;6143:7;6152;6161:6;6169:17;6130:12;:57::i;2661:384::-;2841:25;;;2837:55;;2875:17;;;;;;;;;;;;;;2837:55;3005:33;:25;;;3031:6;3005:25;:33::i;3290:425::-;3481:25;;;3477:80;;3529:17;;;;;;;;;;;;;;3477:80;3669:39;:20;;;3690:9;3701:6;3669:20;:39::i;1455:221::-;1518:7;980:18:13;;;;1556:113:10;;1637:32;:17;;;1663:4;1637:17;:32::i;:::-;1556:113;;;1597:21;1556:113;1537:132;1455:221;-1:-1:-1;;1455:221:10:o;10579:600:5:-;10675:16;10722:6;10703:16;10722:6;10773:23;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;10773:23:5;-1:-1:-1;10745:51:5;-1:-1:-1;10806:13:5;;10829:318;10853:8;10849:1;:12;10829:318;;;10887:6;;10894:1;10887:9;;;;;;;:::i;:::-;;;;;;;;;;;;:::i;:::-;:26;;;;;;;;;:::i;:::-;10879:34;;10941:29;10964:5;10941:22;:29::i;:::-;10927:8;10936:1;10927:11;;;;;;;;:::i;:::-;;;;;;;;;;:43;980:18:13;;;10985:92:5;;11053:9;11038:8;11047:1;11038:11;;;;;;;;:::i;:::-;;;;;;:24;;;;;;;:::i;:::-;;;-1:-1:-1;10985:92:5;11119:3;;10829:318;;;-1:-1:-1;11164:8:5;;10579:600;-1:-1:-1;;;;;10579:600:5:o;5325:370:10:-;5407:9;5402:287;5422:16;;;5402:287;;;5456:30;5489:5;;5495:1;5489:8;;;;;;;:::i;:::-;;;;;;;;;;;;:::i;:::-;5456:41;-1:-1:-1;5515:20:10;;;;;;;;:::i;:::-;5511:109;;;5555:50;5568:19;;;;;;;;:::i;:::-;5589:4;:15;;;5555:12;:50::i;:::-;-1:-1:-1;5661:3:10;;5402:287;;9327:1066:5;9561:29;;;;9634:26;;;;9541:6;;;;9604:16;;9541:6;2786:1;2774:13;;2770:1045;;2803:18;2824:6;;2831:12;2842:1;2831:8;:12;:::i;:::-;2824:20;;;;;;;:::i;:::-;;;;;;;;;;;;:::i;:::-;:37;;;;;;;;;:::i;:::-;2803:58;-1:-1:-1;2875:18:5;9704:6;2875:18;9727:660:::1;9751:8;9747:1;:12;9727:660;;;9777:37;9817:6;;9824:1;9817:9;;;;;;;:::i;:::-;;;;;;;;;;;;:::i;:::-;9777:49:::0;-1:-1:-1;9865:50:5::1;9888:26;::::0;;;::::1;::::0;::::1;;:::i;:::-;980:18:13::0;;;;897:108;9865:50:5::1;:127;;;-1:-1:-1::0;9939:53:5::1;9970:21;::::0;;;::::1;::::0;::::1;;:::i;:::-;1232:34:9::0;;1209:4;1232:34;;;389:40;1232:34;;;;;;;;;1126:147;9939:53:5::1;9864:203;;;;-1:-1:-1::0;10017:50:5::1;10048:18;;::::0;::::1;:11:::0;:18:::1;:::i;10017:50::-;9864:337;;;;-1:-1:-1::0;10091:110:5::1;10154:20;;::::0;::::1;:11:::0;:20:::1;:::i;:::-;:24;::::0;10176:1:::1;::::0;10154:24:::1;::::0;::::1;:::i;:::-;10147:32;::::0;::::1;:::i;:::-;2911:42:9::0;;2888:4;2911:42;;;:31;:42;;;;;;;;;2820:140;10091:110:5::1;9841:407;;10224:24;;;;;;;;;;;;;;9841:407;10276:26:::0;;10263:53:::1;::::0;10304:11;10263:12:::1;:53::i;:::-;-1:-1:-1::0;10359:3:5::1;;9727:660;;;-1:-1:-1::0;2929:9:5;;-1:-1:-1;2924:849:5;2948:12;2959:1;2948:8;:12;:::i;:::-;2944:1;:16;2924:849;;;2982:16;3001:6;;3008:1;3001:9;;;;;;;:::i;:::-;;;;;;;;;;;;:::i;:::-;:26;;;;;;;;;:::i;:::-;2982:45;;3106:10;3094:22;;:8;:22;;;3090:598;;3236:16;3253:1;3236:19;;;;;;;;:::i;:::-;;;;;;;3177:32;3200:8;3177:22;:32::i;:::-;:78;;;;:::i;:::-;3140:115;-1:-1:-1;3277:15:5;980:18:13;;;;3295:101:5;;3395:1;3295:101;;;3354:14;3295:101;3277:119;-1:-1:-1;3422:14:5;;3418:252;;3464:183;3516:8;3554:17;3601:20;3614:7;3601:10;:20;:::i;3464:183::-;3118:570;3090:598;-1:-1:-1;3737:3:5;;2924:849;;;;2789:994;;2770:1045;;;9704:6;9685:16:::1;9727:660;9751:8;9747:1;:12;9727:660;;;9777:37;9817:6;;9824:1;9817:9;;;;;;;:::i;:::-;;;;;;;;;;;;:::i;:::-;9777:49:::0;-1:-1:-1;9865:50:5::1;9888:26;::::0;;;::::1;::::0;::::1;;:::i;9865:50::-;:127;;;-1:-1:-1::0;9939:53:5::1;9970:21;::::0;;;::::1;::::0;::::1;;:::i;9939:53::-;9864:203;;;;-1:-1:-1::0;10017:50:5::1;10048:18;;::::0;::::1;:11:::0;:18:::1;:::i;10017:50::-;9864:337;;;;-1:-1:-1::0;10091:110:5::1;10154:20;;::::0;::::1;:11:::0;:20:::1;:::i;10091:110::-;9841:407;;10224:24;;;;;;;;;;;;;;9841:407;10276:26:::0;;10263:53:::1;::::0;10304:11;10263:12:::1;:53::i;:::-;-1:-1:-1::0;10359:3:5::1;;9727:660;;;;9675:718;2770:1045:::0;2718:1103;9327:1066;;;;;;;;;:::o;6629:866:10:-;980:18:13;;;;6843:7:10;6792:68;6937:23;;;6933:89;;6983:28;;;;;;;;;;;;;;6933:89;7339:41;;;;;7365:4;7339:41;;;10493:74:14;7339:17:10;10603:55:14;;;10583:18;;;10576:83;7383:17:10;;7339;;;;;;10466:18:14;;7339:41:10;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;:61;7335:154;;;7416:62;:37;;;7454:7;7463:14;7416:37;:62::i;:::-;6629:866;;;;:::o;4031:342:1:-;4233:4;4221:10;4215:4;4203:10;4195:6;4191:2;4184:5;4179:59;4169:188;;4271:10;4265:4;4258:24;4338:4;4332;4325:18;13466:939;13629:2;13623:4;13616:16;13686:6;13680:4;13673:20;13751:34;13745:4;13738:48;14140:4;14134;14128;14122;14119:1;14112:5;14105;14100:45;14034:16;14027:24;14023:1;14016:4;14010:11;14007:18;14004:48;13919:244;13892:400;;14209:10;14203:4;14196:24;14273:4;14267;14260:18;13892:400;14318:1;14312:4;14305:15;13466:939;;;:::o;19260:739::-;19334:14;19439:7;19433:4;19426:21;19506:34;19500:4;19493:48;19938:4;19932;19926;19920;19913:5;19906;19895:48;19833:4;19815:16;19812:26;19723:242;19696:4;19690:11;19605:378;19579:404;;19260:739;;;;:::o;2349:2146:12:-;2477:33;2497:12;;;;:5;:12;:::i;:::-;8557:2:10;8359:20;;8550:9;;8230:336;2477:33:12;2472:64;;2519:17;;;;;;;;;;;;;;2472:64;2614:16;;;;2593:18;2644:15;;;2640:51;;2668:23;;;;;;;;;;;;;;2640:51;2772:19;2794:44;2817:20;;;;;;;;:::i;2794:44::-;:91;;2884:1;2794:91;;;2853:5;:16;;;2794:91;2772:113;-1:-1:-1;2959:36:12;2998:68;3034:22;;;;;;;;:::i;:::-;2998;:68::i;:::-;2959:107;;3115:11;3130:1;3115:16;3111:198;;3147:151;3196:20;;;;;;;;:::i;:::-;3235:15;;;;;;;;:::i;:::-;3268:5;:16;;;3147:24;:151::i;:::-;3811:12;;3845;;;;:5;:12;:::i;:::-;:17;;3883:11;3905:14;;;;:5;:14;:::i;:::-;3845:75;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3810:110;;;;3935:7;3930:62;;3958:23;3977:3;3958:18;:23::i;:::-;4035:18;4056:46;4079:22;;;;;;;;:::i;4056:46::-;4035:67;-1:-1:-1;4140:348:12;4166:13;4193:12;;;;:5;:12;:::i;:::-;4219:20;;;;;;;;:::i;:::-;4253:22;;;;;;;;:::i;:::-;4289:5;:16;;;4332:28;4319:10;:41;:130;;4439:10;4319:130;;;4379:41;4392:28;4379:10;:41;:::i;:::-;4140:348;;;11450:25:14;;;11523:42;11511:55;;;11506:2;11491:18;;11484:83;11603:55;;;11583:18;;;11576:83;;;;11695:55;;11690:2;11675:18;;11668:83;11782:3;11767:19;;11760:35;;;;11826:3;11811:19;;11804:35;4463:15:12;11870:3:14;11855:19;;11848:35;11437:3;11422:19;4140:348:12;;;;;;;2420:2075;;;;;;2349:2146;;:::o;17509:1624:1:-;17680:2;17674:4;17667:16;17737:6;17731:4;17724:20;17802:34;17796:4;17789:48;18189:4;18183;18177;18171;18168:1;18161:5;18154;18149:45;18083:16;18076:24;18072:1;18065:4;18059:11;18056:18;18053:48;17968:244;17941:1079;;18258:1;18252:4;18245:15;18319:34;18313:4;18306:48;18452:4;18440:10;18434:4;18428;18425:1;18418:5;18411;18406:51;18402:56;18511:6;18505:4;18498:20;18835:4;18829;18823;18817;18814:1;18807:5;18800;18795:45;18725:16;18718:24;18714:1;18707:4;18701:11;18698:18;18695:48;18666:196;18635:371;;18916:10;18910:4;18903:24;18983:4;18977;18970:18;1011:310:13;1119:4;1113:11;1191:4;1185;1181:15;1266:8;1257:7;1250:25;14:184:14;66:77;63:1;56:88;163:4;160:1;153:15;187:4;184:1;177:15;203:250;270:2;264:9;312:6;300:19;;349:18;334:34;;370:22;;;331:62;328:88;;;396:18;;:::i;:::-;432:2;425:22;203:250;:::o;458:864::-;501:5;554:3;547:4;539:6;535:17;531:27;521:55;;572:1;569;562:12;521:55;612:6;599:20;642:18;634:6;631:30;628:56;;;664:18;;:::i;:::-;733:2;727:9;799:4;787:17;;880:66;783:90;;;875:2;779:99;775:172;763:185;;978:18;963:34;;999:22;;;960:62;957:88;;;1025:18;;:::i;:::-;1061:2;1054:22;1085;;;1126:19;;;1147:4;1122:30;1119:39;-1:-1:-1;1116:59:14;;;1171:1;1168;1161:12;1116:59;1235:6;1228:4;1220:6;1216:17;1209:4;1201:6;1197:17;1184:58;1290:1;1262:19;;;1283:4;1258:30;1251:41;;;;1266:6;458:864;-1:-1:-1;;;458:864:14:o;1327:196::-;1395:20;;1455:42;1444:54;;1434:65;;1424:93;;1513:1;1510;1503:12;1424:93;1327:196;;;:::o;1528:160::-;1593:20;;1649:13;;1642:21;1632:32;;1622:60;;1678:1;1675;1668:12;1693:1256;1750:5;1798:6;1786:9;1781:3;1777:19;1773:32;1770:52;;;1818:1;1815;1808:12;1770:52;1840:17;;:::i;:::-;1902:23;;1934:22;;1831:26;-1:-1:-1;2007:2:14;1992:18;;1979:32;2034:18;2023:30;;2020:50;;;2066:1;2063;2056:12;2020:50;2102:46;2144:3;2135:6;2124:9;2120:22;2102:46;:::i;:::-;2097:2;2090:5;2086:14;2079:70;;2202:2;2191:9;2187:18;2174:32;2231:18;2221:8;2218:32;2215:52;;;2263:1;2260;2253:12;2215:52;2299:48;2343:3;2332:8;2321:9;2317:24;2299:48;:::i;:::-;2294:2;2287:5;2283:14;2276:72;;2380:38;2414:2;2403:9;2399:18;2380:38;:::i;:::-;2375:2;2368:5;2364:14;2357:62;2452:39;2486:3;2475:9;2471:19;2452:39;:::i;:::-;2446:3;2439:5;2435:15;2428:64;2525:39;2559:3;2548:9;2544:19;2525:39;:::i;:::-;2519:3;2508:15;;2501:64;2638:3;2623:19;;;2610:33;2659:15;;;2652:32;2757:3;2742:19;;;2729:33;2778:15;;;2771:32;2836:36;2867:3;2852:19;;2836:36;:::i;:::-;2830:3;2823:5;2819:15;2812:61;2906:36;2937:3;2926:9;2922:19;2906:36;:::i;:::-;2900:3;2893:5;2889:15;2882:61;1693:1256;;;;:::o;2954:158::-;3017:5;3062:2;3053:6;3048:3;3044:16;3040:25;3037:45;;;3078:1;3075;3068:12;3037:45;-1:-1:-1;3100:6:14;2954:158;-1:-1:-1;2954:158:14:o;3117:482::-;3242:6;3250;3303:2;3291:9;3282:7;3278:23;3274:32;3271:52;;;3319:1;3316;3309:12;3271:52;3359:9;3346:23;3392:18;3384:6;3381:30;3378:50;;;3424:1;3421;3414:12;3378:50;3447:61;3500:7;3491:6;3480:9;3476:22;3447:61;:::i;:::-;3437:71;;;3527:66;3585:7;3580:2;3569:9;3565:18;3527:66;:::i;:::-;3517:76;;3117:482;;;;;:::o;3858:1015::-;4047:6;4055;4063;4071;4124:3;4112:9;4103:7;4099:23;4095:33;4092:53;;;4141:1;4138;4131:12;4092:53;4181:9;4168:23;4214:18;4206:6;4203:30;4200:50;;;4246:1;4243;4236:12;4200:50;4269:61;4322:7;4313:6;4302:9;4298:22;4269:61;:::i;:::-;4259:71;;;4383:2;4372:9;4368:18;4355:32;4412:18;4402:8;4399:32;4396:52;;;4444:1;4441;4434:12;4396:52;4467:24;;4522:4;4514:13;;4510:27;-1:-1:-1;4500:55:14;;4551:1;4548;4541:12;4500:55;4591:2;4578:16;4617:18;4609:6;4606:30;4603:50;;;4649:1;4646;4639:12;4603:50;4702:7;4697:2;4687:6;4684:1;4680:14;4676:2;4672:23;4668:32;4665:45;4662:65;;;4723:1;4720;4713:12;4662:65;4754:2;4746:11;;;;;-1:-1:-1;4776:6:14;-1:-1:-1;4801:66:14;4859:7;4854:2;4839:18;;4801:66;:::i;:::-;4791:76;;3858:1015;;;;;;;:::o;4878:282::-;4945:9;;;4966:11;;;4963:191;;;5010:77;5007:1;5000:88;5111:4;5108:1;5101:15;5139:4;5136:1;5129:15;5165:186;5224:6;5277:2;5265:9;5256:7;5252:23;5248:32;5245:52;;;5293:1;5290;5283:12;5245:52;5316:29;5335:9;5316:29;:::i;:::-;5306:39;5165:186;-1:-1:-1;;;5165:186:14:o;6054:348::-;6096:3;6134:5;6128:12;6161:6;6156:3;6149:19;6217:6;6210:4;6203:5;6199:16;6192:4;6187:3;6183:14;6177:47;6269:1;6262:4;6253:6;6248:3;6244:16;6240:27;6233:38;6391:4;6321:66;6316:2;6308:6;6304:15;6300:88;6295:3;6291:98;6287:109;6280:116;;;6054:348;;;;:::o;6503:1393::-;6688:2;6677:9;6670:21;6733:6;6727:13;6722:2;6711:9;6707:18;6700:41;6651:4;6788:2;6780:6;6776:15;6770:22;6828:6;6823:2;6812:9;6808:18;6801:34;6858:52;6905:3;6894:9;6890:19;6876:12;6858:52;:::i;:::-;6844:66;;6959:2;6951:6;6947:15;6941:22;7027:66;7015:9;7007:6;7003:22;6999:95;6994:2;6983:9;6979:18;6972:123;7118:41;7152:6;7136:14;7118:41;:::i;:::-;7104:55;;;7208:2;7200:6;7196:15;7190:22;7221:55;7271:3;7260:9;7256:19;7240:14;5433:42;5422:54;5410:67;;5356:127;7221:55;-1:-1:-1;7325:3:14;7313:16;;7307:23;5433:42;5422:54;;7389:3;7374:19;;5410:67;-1:-1:-1;7443:3:14;7431:16;;7425:23;5433:42;5422:54;;7507:3;7492:19;;5410:67;7457:55;7567:3;7559:6;7555:16;7549:23;7543:3;7532:9;7528:19;7521:52;7628:3;7620:6;7616:16;7610:23;7604:3;7593:9;7589:19;7582:52;7683:3;7675:6;7671:16;7665:23;7697:52;7744:3;7733:9;7729:19;7713:14;6477:13;6470:21;6458:34;;6407:91;7697:52;-1:-1:-1;7798:3:14;7786:16;;7780:23;6477:13;;6470:21;7859:6;7844:22;;6458:34;-1:-1:-1;7884:6:14;6503:1393;-1:-1:-1;;;6503:1393:14:o;7901:184::-;7953:77;7950:1;7943:88;8050:4;8047:1;8040:15;8074:4;8071:1;8064:15;8090:384;8184:4;8242:11;8229:25;8332:66;8321:8;8305:14;8301:29;8297:102;8277:18;8273:127;8263:155;;8414:1;8411;8404:12;8263:155;8435:33;;;;;8090:384;-1:-1:-1;;8090:384:14:o;8732:180::-;8788:6;8841:2;8829:9;8820:7;8816:23;8812:32;8809:52;;;8857:1;8854;8847:12;8809:52;8880:26;8896:9;8880:26;:::i;8917:580::-;8994:4;9000:6;9060:11;9047:25;9150:66;9139:8;9123:14;9119:29;9115:102;9095:18;9091:127;9081:155;;9232:1;9229;9222:12;9081:155;9259:33;;9311:20;;;-1:-1:-1;9354:18:14;9343:30;;9340:50;;;9386:1;9383;9376:12;9340:50;9419:4;9407:17;;-1:-1:-1;9450:14:14;9446:27;;;9436:38;;9433:58;;;9487:1;9484;9477:12;9433:58;8917:580;;;;;:::o;9502:331::-;9607:9;9618;9660:8;9648:10;9645:24;9642:44;;;9682:1;9679;9672:12;9642:44;9711:6;9701:8;9698:20;9695:40;;;9731:1;9728;9721:12;9695:40;-1:-1:-1;;9757:23:14;;;9802:25;;;;;-1:-1:-1;9502:331:14:o;9838:476::-;9958:19;;10003:66;9995:75;;;10090:1;10082:10;;10079:229;;;10231:66;10161;10154:3;10151:1;10147:11;10144:1;10140:19;10136:92;10132:2;10128:101;10124:174;10115:183;;10079:229;;9838:476;;;;:::o;10670:184::-;10740:6;10793:2;10781:9;10772:7;10768:23;10764:32;10761:52;;;10809:1;10806;10799:12;10761:52;-1:-1:-1;10832:16:14;;10670:184;-1:-1:-1;10670:184:14:o;10859:271::-;11042:6;11034;11029:3;11016:33;10998:3;11068:16;;11093:13;;;11068:16;10859:271;-1:-1:-1;10859:271:14:o
Swarm Source
ipfs://6b379775157fb7ff24fcede99546888bcd2eabdd5a0246e2850d84f33f2ac031
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 34 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.