ETH Price: $3,258.87 (+1.24%)

Contract

0x09f5fb29BadCF59d51ad2e64701071b8aB5c4F7A

Overview

ETH Balance

0 ETH

ETH Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To

There are no matching entries

1 Internal Transaction found.

Latest 1 internal transaction

Parent Transaction Hash Block From To
1626202025-01-14 13:02:0316 days ago1736859723  Contract Creation0 ETH
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Receiver

Compiler Version
v0.8.26+commit.8a97fa7a

ZkSolc Version
v1.5.3

Optimization Enabled:
Yes with Mode 3

Other Settings:
shanghai EvmVersion
File 1 of 17 : Receiver.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;

import { IERC20, SafeERC20 } from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import { SafeTransferLib } from "solady/utils/SafeTransferLib.sol";
import { ReentrancyGuard } from "../Helpers/ReentrancyGuard.sol";
import { LibSwap } from "../Libraries/LibSwap.sol";
import { LibAsset } from "../Libraries/LibAsset.sol";
import { ILiFi } from "../Interfaces/ILiFi.sol";
import { IExecutor } from "../Interfaces/IExecutor.sol";
import { WithdrawablePeriphery } from "../Helpers/WithdrawablePeriphery.sol";
import { ExternalCallFailed, UnAuthorized } from "../Errors/GenericErrors.sol";

/// @title Receiver
/// @author LI.FI (https://li.fi)
/// @notice Arbitrary execution contract used for cross-chain swaps and message passing
/// @custom:version 2.1.0
contract Receiver is ILiFi, ReentrancyGuard, WithdrawablePeriphery {
    using SafeERC20 for IERC20;

    /// Storage ///
    address public sgRouter;
    IExecutor public executor;
    uint256 public recoverGas;
    address public amarokRouter;

    /// Events ///
    event StargateRouterSet(address indexed router);
    event AmarokRouterSet(address indexed router);
    event ExecutorSet(address indexed executor);
    event RecoverGasSet(uint256 indexed recoverGas);

    /// Modifiers ///
    modifier onlySGRouter() {
        if (msg.sender != sgRouter) {
            revert UnAuthorized();
        }
        _;
    }
    modifier onlyAmarokRouter() {
        if (msg.sender != amarokRouter) {
            revert UnAuthorized();
        }
        _;
    }

    /// Constructor
    constructor(
        address _owner,
        address _sgRouter,
        address _amarokRouter,
        address _executor,
        uint256 _recoverGas
    ) WithdrawablePeriphery(_owner) {
        sgRouter = _sgRouter;
        amarokRouter = _amarokRouter;
        executor = IExecutor(_executor);
        recoverGas = _recoverGas;
        emit StargateRouterSet(_sgRouter);
        emit AmarokRouterSet(_amarokRouter);
        emit RecoverGasSet(_recoverGas);
    }

    /// External Methods ///

    /// @notice Completes a cross-chain transaction with calldata via Amarok facet on the receiving chain.
    /// @dev This function is called from Amarok Router.
    /// @param _transferId The unique ID of this transaction (assigned by Amarok)
    /// @param _amount the amount of bridged tokens
    /// @param _asset the address of the bridged token
    /// @param * (unused) the sender of the transaction
    /// @param * (unused) the domain ID of the src chain
    /// @param _callData The data to execute
    function xReceive(
        bytes32 _transferId,
        uint256 _amount,
        address _asset,
        address,
        uint32,
        bytes memory _callData
    ) external nonReentrant onlyAmarokRouter {
        (LibSwap.SwapData[] memory swapData, address receiver) = abi.decode(
            _callData,
            (LibSwap.SwapData[], address)
        );

        _swapAndCompleteBridgeTokens(
            _transferId,
            swapData,
            _asset,
            payable(receiver),
            _amount,
            false
        );
    }

    /// @notice Completes a cross-chain transaction on the receiving chain.
    /// @dev This function is called from Stargate Router.
    /// @param * (unused) The remote chainId sending the tokens
    /// @param * (unused) The remote Bridge address
    /// @param * (unused) Nonce
    /// @param _token The token contract on the local chain
    /// @param _amountLD The amount of tokens received through bridging
    /// @param _payload The data to execute
    function sgReceive(
        uint16, // _srcChainId unused
        bytes memory, // _srcAddress unused
        uint256, // _nonce unused
        address _token,
        uint256 _amountLD,
        bytes memory _payload
    ) external nonReentrant onlySGRouter {
        (
            bytes32 transactionId,
            LibSwap.SwapData[] memory swapData,
            ,
            address receiver
        ) = abi.decode(
                _payload,
                (bytes32, LibSwap.SwapData[], address, address)
            );

        _swapAndCompleteBridgeTokens(
            transactionId,
            swapData,
            swapData.length > 0 ? swapData[0].sendingAssetId : _token, // If swapping assume sent token is the first token in swapData
            payable(receiver),
            _amountLD,
            true
        );
    }

    /// @notice Performs a swap before completing a cross-chain transaction
    /// @param _transactionId the transaction id associated with the operation
    /// @param _swapData array of data needed for swaps
    /// @param assetId token received from the other chain
    /// @param receiver address that will receive tokens in the end
    function swapAndCompleteBridgeTokens(
        bytes32 _transactionId,
        LibSwap.SwapData[] memory _swapData,
        address assetId,
        address payable receiver
    ) external payable nonReentrant {
        if (LibAsset.isNativeAsset(assetId)) {
            _swapAndCompleteBridgeTokens(
                _transactionId,
                _swapData,
                assetId,
                receiver,
                msg.value,
                false
            );
        } else {
            uint256 allowance = IERC20(assetId).allowance(
                msg.sender,
                address(this)
            );
            LibAsset.depositAsset(assetId, allowance);
            _swapAndCompleteBridgeTokens(
                _transactionId,
                _swapData,
                assetId,
                receiver,
                allowance,
                false
            );
        }
    }

    /// Private Methods ///

    /// @notice Performs a swap before completing a cross-chain transaction
    /// @param _transactionId the transaction id associated with the operation
    /// @param _swapData array of data needed for swaps
    /// @param assetId token received from the other chain
    /// @param receiver address that will receive tokens in the end
    /// @param amount amount of token
    /// @param reserveRecoverGas whether we need a gas buffer to recover
    function _swapAndCompleteBridgeTokens(
        bytes32 _transactionId,
        LibSwap.SwapData[] memory _swapData,
        address assetId,
        address payable receiver,
        uint256 amount,
        bool reserveRecoverGas
    ) private {
        uint256 _recoverGas = reserveRecoverGas ? recoverGas : 0;

        if (LibAsset.isNativeAsset(assetId)) {
            // case 1: native asset
            uint256 cacheGasLeft = gasleft();
            if (reserveRecoverGas && cacheGasLeft < _recoverGas) {
                // case 1a: not enough gas left to execute calls
                SafeTransferLib.safeTransferETH(receiver, amount);

                emit LiFiTransferRecovered(
                    _transactionId,
                    assetId,
                    receiver,
                    amount,
                    block.timestamp
                );
                return;
            }

            // case 1b: enough gas left to execute calls
            // solhint-disable no-empty-blocks
            try
                executor.swapAndCompleteBridgeTokens{
                    value: amount,
                    gas: cacheGasLeft - _recoverGas
                }(_transactionId, _swapData, assetId, receiver)
            {} catch {
                SafeTransferLib.safeTransferETH(receiver, amount);

                emit LiFiTransferRecovered(
                    _transactionId,
                    assetId,
                    receiver,
                    amount,
                    block.timestamp
                );
            }
        } else {
            // case 2: ERC20 asset
            uint256 cacheGasLeft = gasleft();
            IERC20 token = IERC20(assetId);
            token.safeApprove(address(executor), 0);

            if (reserveRecoverGas && cacheGasLeft < _recoverGas) {
                // case 2a: not enough gas left to execute calls
                token.safeTransfer(receiver, amount);

                emit LiFiTransferRecovered(
                    _transactionId,
                    assetId,
                    receiver,
                    amount,
                    block.timestamp
                );
                return;
            }

            // case 2b: enough gas left to execute calls
            token.safeIncreaseAllowance(address(executor), amount);
            try
                executor.swapAndCompleteBridgeTokens{
                    gas: cacheGasLeft - _recoverGas
                }(_transactionId, _swapData, assetId, receiver)
            {} catch {
                token.safeTransfer(receiver, amount);
                emit LiFiTransferRecovered(
                    _transactionId,
                    assetId,
                    receiver,
                    amount,
                    block.timestamp
                );
            }

            token.safeApprove(address(executor), 0);
        }
    }

    /// @notice Receive native asset directly.
    /// @dev Some bridges may send native asset before execute external calls.
    // solhint-disable-next-line no-empty-blocks
    receive() external payable {}
}

File 2 of 17 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";
import "../extensions/IERC20Permit.sol";
import "../../../utils/Address.sol";

/**
 * @title SafeERC20
 * @dev Wrappers around ERC20 operations that throw on failure (when the token
 * contract returns false). Tokens that return no value (and instead revert or
 * throw on failure) are also supported, non-reverting calls are assumed to be
 * successful.
 * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20 {
    using Address for address;

    /**
     * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeTransfer(IERC20 token, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    /**
     * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the
     * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.
     */
    function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
    }

    /**
     * @dev Deprecated. This function has issues similar to the ones found in
     * {IERC20-approve}, and its usage is discouraged.
     *
     * Whenever possible, use {safeIncreaseAllowance} and
     * {safeDecreaseAllowance} instead.
     */
    function safeApprove(IERC20 token, address spender, uint256 value) internal {
        // safeApprove should only be called when setting an initial allowance,
        // or when resetting it to zero. To increase and decrease it, use
        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
        require(
            (value == 0) || (token.allowance(address(this), spender) == 0),
            "SafeERC20: approve from non-zero to non-zero allowance"
        );
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
    }

    /**
     * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 oldAllowance = token.allowance(address(this), spender);
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value));
    }

    /**
     * @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        unchecked {
            uint256 oldAllowance = token.allowance(address(this), spender);
            require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value));
        }
    }

    /**
     * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful. Compatible with tokens that require the approval to be set to
     * 0 before setting it to a non-zero value.
     */
    function forceApprove(IERC20 token, address spender, uint256 value) internal {
        bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value);

        if (!_callOptionalReturnBool(token, approvalCall)) {
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0));
            _callOptionalReturn(token, approvalCall);
        }
    }

    /**
     * @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`.
     * Revert on invalid signature.
     */
    function safePermit(
        IERC20Permit token,
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal {
        uint256 nonceBefore = token.nonces(owner);
        token.permit(owner, spender, value, deadline, v, r, s);
        uint256 nonceAfter = token.nonces(owner);
        require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     */
    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that
        // the target address contains contract code and also asserts for success in the low-level call.

        bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
        require(returndata.length == 0 || abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     *
     * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.
     */
    function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false
        // and not revert is the subcall reverts.

        (bool success, bytes memory returndata) = address(token).call(data);
        return
            success && (returndata.length == 0 || abi.decode(returndata, (bool))) && Address.isContract(address(token));
    }
}

File 3 of 17 : SafeTransferLib.sol
// 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)
            }
        }
    }
}

File 4 of 17 : ReentrancyGuard.sol
// 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
        }
    }
}

File 5 of 17 : LibSwap.sol
// SPDX-License-Identifier: MIT
/// @custom:version 1.0.0
pragma solidity ^0.8.17;

import { LibAsset } from "./LibAsset.sol";
import { LibUtil } from "./LibUtil.sol";
import { InvalidContract, NoSwapFromZeroBalance, InsufficientBalance } from "../Errors/GenericErrors.sol";
import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";

library LibSwap {
    struct SwapData {
        address callTo;
        address approveTo;
        address sendingAssetId;
        address receivingAssetId;
        uint256 fromAmount;
        bytes callData;
        bool requiresDeposit;
    }

    event AssetSwapped(
        bytes32 transactionId,
        address dex,
        address fromAssetId,
        address toAssetId,
        uint256 fromAmount,
        uint256 toAmount,
        uint256 timestamp
    );

    function swap(bytes32 transactionId, SwapData calldata _swap) internal {
        if (!LibAsset.isContract(_swap.callTo)) revert InvalidContract();
        uint256 fromAmount = _swap.fromAmount;
        if (fromAmount == 0) revert NoSwapFromZeroBalance();
        uint256 nativeValue = LibAsset.isNativeAsset(_swap.sendingAssetId)
            ? _swap.fromAmount
            : 0;
        uint256 initialSendingAssetBalance = LibAsset.getOwnBalance(
            _swap.sendingAssetId
        );
        uint256 initialReceivingAssetBalance = LibAsset.getOwnBalance(
            _swap.receivingAssetId
        );

        if (nativeValue == 0) {
            LibAsset.maxApproveERC20(
                IERC20(_swap.sendingAssetId),
                _swap.approveTo,
                _swap.fromAmount
            );
        }

        if (initialSendingAssetBalance < _swap.fromAmount) {
            revert InsufficientBalance(
                _swap.fromAmount,
                initialSendingAssetBalance
            );
        }

        // 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);
        }

        uint256 newBalance = LibAsset.getOwnBalance(_swap.receivingAssetId);

        emit AssetSwapped(
            transactionId,
            _swap.callTo,
            _swap.sendingAssetId,
            _swap.receivingAssetId,
            _swap.fromAmount,
            newBalance > initialReceivingAssetBalance
                ? newBalance - initialReceivingAssetBalance
                : newBalance,
            block.timestamp
        );
    }
}

File 6 of 17 : LibAsset.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.17;
import { InsufficientBalance, NullAddrIsNotAnERC20Token, NullAddrIsNotAValidSpender, NoTransferToNullAddress, InvalidAmount, NativeAssetTransferFailed } from "../Errors/GenericErrors.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import { LibSwap } from "./LibSwap.sol";

/// @title LibAsset
/// @custom:version 1.0.2
/// @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 {
    uint256 private constant MAX_UINT = type(uint256).max;

    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; //address(0)

    /// @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
    function getOwnBalance(address assetId) internal view returns (uint256) {
        return
            isNativeAsset(assetId)
                ? address(this).balance
                : IERC20(assetId).balanceOf(address(this));
    }

    /// @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 {
        if (recipient == NULL_ADDRESS) revert NoTransferToNullAddress();
        if (amount > address(this).balance)
            revert InsufficientBalance(amount, address(this).balance);
        // solhint-disable-next-line avoid-low-level-calls
        (bool success, ) = recipient.call{ value: amount }("");
        if (!success) revert NativeAssetTransferFailed();
    }

    /// @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 Amount to approve for spending
    function maxApproveERC20(
        IERC20 assetId,
        address spender,
        uint256 amount
    ) internal {
        if (isNativeAsset(address(assetId))) {
            return;
        }
        if (spender == NULL_ADDRESS) {
            revert NullAddrIsNotAValidSpender();
        }

        if (assetId.allowance(address(this), spender) < amount) {
            SafeERC20.forceApprove(IERC20(assetId), spender, MAX_UINT);
        }
    }

    /// @notice Transfers tokens from the inheriting contract to a given
    ///         recipient
    /// @param assetId Token address to transfer
    /// @param recipient Address to send token to
    /// @param amount Amount to send to given recipient
    function transferERC20(
        address assetId,
        address recipient,
        uint256 amount
    ) private {
        if (isNativeAsset(assetId)) {
            revert NullAddrIsNotAnERC20Token();
        }
        if (recipient == NULL_ADDRESS) {
            revert NoTransferToNullAddress();
        }

        uint256 assetBalance = IERC20(assetId).balanceOf(address(this));
        if (amount > assetBalance) {
            revert InsufficientBalance(amount, assetBalance);
        }
        SafeERC20.safeTransfer(IERC20(assetId), 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 to Address of recipient/spender
    /// @param amount Amount to transfer from owner to spender
    function transferFromERC20(
        address assetId,
        address from,
        address to,
        uint256 amount
    ) internal {
        if (isNativeAsset(assetId)) {
            revert NullAddrIsNotAnERC20Token();
        }
        if (to == NULL_ADDRESS) {
            revert NoTransferToNullAddress();
        }

        IERC20 asset = IERC20(assetId);
        uint256 prevBalance = asset.balanceOf(to);
        SafeERC20.safeTransferFrom(asset, from, to, amount);
        if (asset.balanceOf(to) - prevBalance != amount) {
            revert InvalidAmount();
        }
    }

    function depositAsset(address assetId, uint256 amount) internal {
        if (amount == 0) revert InvalidAmount();
        if (isNativeAsset(assetId)) {
            if (msg.value < amount) revert InvalidAmount();
        } else {
            uint256 balance = IERC20(assetId).balanceOf(msg.sender);
            if (balance < amount) revert InsufficientBalance(amount, balance);
            transferFromERC20(assetId, 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 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 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 {
        isNativeAsset(assetId)
            ? transferNativeAsset(recipient, amount)
            : transferERC20(assetId, recipient, amount);
    }

    /// @dev Checks whether the given address is a contract and contains code
    function isContract(address _contractAddr) internal view returns (bool) {
        uint256 size;
        // solhint-disable-next-line no-inline-assembly
        assembly {
            size := extcodesize(_contractAddr)
        }
        return size > 0;
    }
}

File 7 of 17 : ILiFi.sol
// SPDX-License-Identifier: MIT
/// @custom:version 1.0.0
pragma solidity ^0.8.17;

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
    );
}

File 8 of 17 : IExecutor.sol
// SPDX-License-Identifier: MIT
/// @custom:version 1.0.0
pragma solidity ^0.8.17;

import { LibSwap } from "../Libraries/LibSwap.sol";

/// @title Interface for Executor
/// @author LI.FI (https://li.fi)
interface IExecutor {
    /// @notice Performs a swap before completing a cross-chain transaction
    /// @param _transactionId the transaction id associated with the operation
    /// @param _swapData array of data needed for swaps
    /// @param transferredAssetId token received from the other chain
    /// @param receiver address that will receive tokens in the end
    function swapAndCompleteBridgeTokens(
        bytes32 _transactionId,
        LibSwap.SwapData[] calldata _swapData,
        address transferredAssetId,
        address payable receiver
    ) external payable;
}

File 9 of 17 : WithdrawablePeriphery.sol
// SPDX-License-Identifier: MIT
/// @custom:version 1.0.0
pragma solidity ^0.8.17;

import { TransferrableOwnership } from "./TransferrableOwnership.sol";
import { LibAsset } from "../Libraries/LibAsset.sol";
import { ExternalCallFailed } from "../Errors/GenericErrors.sol";
import { SafeTransferLib } from "solady/utils/SafeTransferLib.sol";

abstract contract WithdrawablePeriphery is TransferrableOwnership {
    using SafeTransferLib for address;

    event TokensWithdrawn(
        address assetId,
        address payable receiver,
        uint256 amount
    );

    constructor(address _owner) TransferrableOwnership(_owner) {}

    function withdrawToken(
        address assetId,
        address payable receiver,
        uint256 amount
    ) external onlyOwner {
        if (LibAsset.isNativeAsset(assetId)) {
            // solhint-disable-next-line avoid-low-level-calls
            (bool success, ) = receiver.call{ value: amount }("");
            if (!success) revert ExternalCallFailed();
        } else {
            assetId.safeTransfer(receiver, amount);
        }

        emit TokensWithdrawn(assetId, receiver, amount);
    }
}

File 10 of 17 : GenericErrors.sol
// SPDX-License-Identifier: MIT
/// @custom:version 1.0.0
pragma solidity ^0.8.17;

error AlreadyInitialized();
error CannotAuthoriseSelf();
error CannotBridgeToSameNetwork();
error ContractCallNotAllowed();
error CumulativeSlippageTooHigh(uint256 minAmount, uint256 receivedAmount);
error DiamondIsPaused();
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 UnAuthorized();
error UnsupportedChainId(uint256 chainId);
error WithdrawFailed();
error ZeroAmount();

File 11 of 17 : IERC20.sol
// 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);
}

File 12 of 17 : IERC20Permit.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/IERC20Permit.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
 * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
 *
 * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
 * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
 * need to send a transaction, and thus is not required to hold Ether at all.
 */
interface IERC20Permit {
    /**
     * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
     * given ``owner``'s signed approval.
     *
     * IMPORTANT: The same issues {IERC20-approve} has related to transaction
     * ordering also apply here.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `deadline` must be a timestamp in the future.
     * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
     * over the EIP712-formatted function arguments.
     * - the signature must use ``owner``'s current nonce (see {nonces}).
     *
     * For more information on the signature format, see the
     * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
     * section].
     */
    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;

    /**
     * @dev Returns the current nonce for `owner`. This value must be
     * included whenever a signature is generated for {permit}.
     *
     * Every successful call to {permit} increases ``owner``'s nonce by one. This
     * prevents a signature from being used multiple times.
     */
    function nonces(address owner) external view returns (uint256);

    /**
     * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
     */
    // solhint-disable-next-line func-name-mixedcase
    function DOMAIN_SEPARATOR() external view returns (bytes32);
}

File 13 of 17 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     *
     * Furthermore, `isContract` will also return true if the target contract within
     * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,
     * which only has an effect at the end of a transaction.
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 0;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        (bool success, ) = recipient.call{value: amount}("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain `call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, "Address: low-level call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionDelegateCall(target, data, "Address: low-level delegate call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
     * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
     *
     * _Available since v4.8._
     */
    function verifyCallResultFromTarget(
        address target,
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        if (success) {
            if (returndata.length == 0) {
                // only check isContract if the call was successful and the return data is empty
                // otherwise we already know that it was a contract
                require(isContract(target), "Address: call to non-contract");
            }
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    /**
     * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason or using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    function _revert(bytes memory returndata, string memory errorMessage) private pure {
        // Look for revert reason and bubble it up if present
        if (returndata.length > 0) {
            // The easiest way to bubble the revert reason is using memory via assembly
            /// @solidity memory-safe-assembly
            assembly {
                let returndata_size := mload(returndata)
                revert(add(32, returndata), returndata_size)
            }
        } else {
            revert(errorMessage);
        }
    }
}

File 14 of 17 : LibUtil.sol
// SPDX-License-Identifier: MIT
/// @custom:version 1.0.0
pragma solidity ^0.8.17;

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
        }
    }
}

File 15 of 17 : TransferrableOwnership.sol
// SPDX-License-Identifier: MIT
/// @custom:version 1.0.0
pragma solidity ^0.8.17;

import { IERC173 } from "../Interfaces/IERC173.sol";
import { LibAsset } from "../Libraries/LibAsset.sol";

contract TransferrableOwnership is IERC173 {
    address public owner;
    address public pendingOwner;

    /// Errors ///
    error UnAuthorized();
    error NoNullOwner();
    error NewOwnerMustNotBeSelf();
    error NoPendingOwnershipTransfer();
    error NotPendingOwner();

    /// Events ///
    event OwnershipTransferRequested(
        address indexed _from,
        address indexed _to
    );

    constructor(address initialOwner) {
        owner = initialOwner;
    }

    modifier onlyOwner() {
        if (msg.sender != owner) revert UnAuthorized();
        _;
    }

    /// @notice Initiates transfer of ownership to a new address
    /// @param _newOwner the address to transfer ownership to
    function transferOwnership(address _newOwner) external onlyOwner {
        if (_newOwner == LibAsset.NULL_ADDRESS) revert NoNullOwner();
        if (_newOwner == msg.sender) revert NewOwnerMustNotBeSelf();
        pendingOwner = _newOwner;
        emit OwnershipTransferRequested(msg.sender, pendingOwner);
    }

    /// @notice Cancel transfer of ownership
    function cancelOwnershipTransfer() external onlyOwner {
        if (pendingOwner == LibAsset.NULL_ADDRESS)
            revert NoPendingOwnershipTransfer();
        pendingOwner = LibAsset.NULL_ADDRESS;
    }

    /// @notice Confirms transfer of ownership to the calling address (msg.sender)
    function confirmOwnershipTransfer() external {
        address _pendingOwner = pendingOwner;
        if (msg.sender != _pendingOwner) revert NotPendingOwner();
        emit OwnershipTransferred(owner, _pendingOwner);
        owner = _pendingOwner;
        pendingOwner = LibAsset.NULL_ADDRESS;
    }
}

File 16 of 17 : LibBytes.sol
// SPDX-License-Identifier: MIT
/// @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;
        }
        require(value == 0, "Strings: hex length insufficient");
        return string(buffer);
    }
}

File 17 of 17 : IERC173.sol
// SPDX-License-Identifier: MIT
/// @custom:version 1.0.0
pragma solidity ^0.8.17;

/// @title ERC-173 Contract Ownership Standard
///  Note: the ERC-165 identifier for this interface is 0x7f5828d0
/* is ERC165 */
interface IERC173 {
    /// @dev This emits when ownership of a contract changes.
    event OwnershipTransferred(
        address indexed previousOwner,
        address indexed newOwner
    );

    /// @notice Get the address of the owner
    /// @return owner_ The address of the owner.
    function owner() external view returns (address owner_);

    /// @notice Set the address of the new owner of the contract
    /// @dev Set _newOwner to address(0) to renounce any ownership.
    /// @param _newOwner The address of the new owner of the contract
    function transferOwnership(address _newOwner) external;
}

Settings
{
  "viaIR": false,
  "remappings": [
    "@eth-optimism/=node_modules/@hop-protocol/sdk/node_modules/@eth-optimism/",
    "@uniswap/=node_modules/@uniswap/",
    "eth-gas-reporter/=node_modules/eth-gas-reporter/",
    "hardhat/=node_modules/hardhat/",
    "hardhat-deploy/=node_modules/hardhat-deploy/",
    "@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/",
    "openzeppelin-contracts/=lib/openzeppelin-contracts/",
    "openzeppelin/=lib/openzeppelin-contracts/contracts/",
    "sgn-v2-contracts/=lib/sgn-v2-contracts/contracts/"
  ],
  "evmVersion": "shanghai",
  "outputSelection": {
    "*": {
      "*": [
        "abi"
      ]
    }
  },
  "optimizer": {
    "enabled": true,
    "mode": "3",
    "fallback_to_optimizing_for_size": false,
    "disable_system_request_memoization": true
  },
  "metadata": {},
  "libraries": {},
  "detectMissingLibraries": false,
  "enableEraVMExtensions": false,
  "forceEVMLA": false
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"address","name":"_sgRouter","type":"address"},{"internalType":"address","name":"_amarokRouter","type":"address"},{"internalType":"address","name":"_executor","type":"address"},{"internalType":"uint256","name":"_recoverGas","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ExternalCallFailed","type":"error"},{"inputs":[{"internalType":"uint256","name":"required","type":"uint256"},{"internalType":"uint256","name":"balance","type":"uint256"}],"name":"InsufficientBalance","type":"error"},{"inputs":[],"name":"InvalidAmount","type":"error"},{"inputs":[],"name":"NewOwnerMustNotBeSelf","type":"error"},{"inputs":[],"name":"NoNullOwner","type":"error"},{"inputs":[],"name":"NoPendingOwnershipTransfer","type":"error"},{"inputs":[],"name":"NoTransferToNullAddress","type":"error"},{"inputs":[],"name":"NotPendingOwner","type":"error"},{"inputs":[],"name":"NullAddrIsNotAnERC20Token","type":"error"},{"inputs":[],"name":"ReentrancyError","type":"error"},{"inputs":[],"name":"UnAuthorized","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"router","type":"address"}],"name":"AmarokRouterSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"executor","type":"address"}],"name":"ExecutorSet","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"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_from","type":"address"},{"indexed":true,"internalType":"address","name":"_to","type":"address"}],"name":"OwnershipTransferRequested","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"recoverGas","type":"uint256"}],"name":"RecoverGasSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"router","type":"address"}],"name":"StargateRouterSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"assetId","type":"address"},{"indexed":false,"internalType":"address payable","name":"receiver","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TokensWithdrawn","type":"event"},{"inputs":[],"name":"amarokRouter","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"cancelOwnershipTransfer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"confirmOwnershipTransfer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"executor","outputs":[{"internalType":"contract IExecutor","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"recoverGas","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"","type":"uint16"},{"internalType":"bytes","name":"","type":"bytes"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"_token","type":"address"},{"internalType":"uint256","name":"_amountLD","type":"uint256"},{"internalType":"bytes","name":"_payload","type":"bytes"}],"name":"sgReceive","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"sgRouter","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_transactionId","type":"bytes32"},{"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[]"},{"internalType":"address","name":"assetId","type":"address"},{"internalType":"address payable","name":"receiver","type":"address"}],"name":"swapAndCompleteBridgeTokens","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"assetId","type":"address"},{"internalType":"address payable","name":"receiver","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdrawToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_transferId","type":"bytes32"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address","name":"_asset","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint32","name":"","type":"uint32"},{"internalType":"bytes","name":"_callData","type":"bytes"}],"name":"xReceive","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]

3cda33513ae6c9ccbf2431fa789fbcd32334337f0d23910817a7a887a08c898a12a957e1010003779cf4c86fcd0662bb1c7d04a50a47d725a618afb6d2bfdfbf3db7fc69000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000156cebba59deb2cb23742f70dcb0a11cc775591f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ba3274ff65466bdc217745dc276394da4ffe02b700000000000000000000000000000000000000000000000000000000000186a0

Deployed Bytecode

0x00030000000000020009000000000002000000000801034f00000000030800190000006003300270000003230d3001970002000000d80355000100000008035500000001002001900000001f0000c13d0000008002000039000000400020043f0000000400d0008c0000008a0000413d000000000208043b000000e0022002700000032d0020009c0000008e0000a13d0000032e0020009c000000a60000a13d0000032f0020009c000000bf0000213d000003320020009c0000012b0000613d000003330020009c000003c80000c13d0000000001000416000000000001004b000003c80000c13d0000000101000039000002610000013d0000000002000416000000000002004b000003c80000c13d0000001f02d0003900000324022001970000008002200039000000400020043f0000001f04d0018f0000032505d001980000008002500039000000300000613d0000008003000039000000000608034f000000006706043c0000000003730436000000000023004b0000002c0000c13d000000000004004b0000003d0000613d000000000158034f0000000303400210000000000402043300000000043401cf000000000434022f000000000101043b0000010003300089000000000131022f00000000013101cf000000000141019f0000000000120435000000a000d0008c000003c80000413d000000800200043d000003260020009c000003c80000213d000000a00500043d000003260050009c000003c80000213d000000c00100043d000900000001001d000003260010009c000003c80000213d000000e00100043d000003260010009c000003c80000213d000000000300041a0000032703300197000000000223019f000001000600043d000000000020041b0000000203000039000000000203041a0000032702200197000000000252019f000000000023041b0000000502000039000000000402041a000003270440019700000009044001af000000000042041b0000000302000039000000000402041a0000032704400197000000000114019f000000000012041b0000000401000039000800000006001d000000000061041b0000000001000414000003230010009c0000032301008041000000c00110021000000328011001c70000800d0200003900000329040000410c860c7c0000040f0000000100200190000003c80000613d0000000001000414000003230010009c0000032301008041000000c00110021000000328011001c70000800d0200003900000002030000390000032a0400004100000009050000290c860c7c0000040f0000000100200190000003c80000613d0000000001000414000003230010009c0000032301008041000000c00110021000000328011001c70000800d0200003900000002030000390000032b0400004100000008050000290c860c7c0000040f0000000100200190000003c80000613d0000002001000039000001000010044300000120000004430000032c0100004100000c870001042e00000000000d004b000003c80000c13d000000000100001900000c870001042e000003370020009c000000b40000213d0000033b0020009c0000021e0000613d0000033c0020009c0000025d0000613d0000033d0020009c000003c80000c13d0000000001000416000000000001004b000003c80000c13d000000000100041a00000326011001970000000002000411000000000012004b000002890000c13d0000000101000039000000000201041a0000032600200198000002910000c13d0000036201000041000000000010043f000003440100004100000c8800010430000003340020009c000001440000613d000003350020009c000001490000613d000003360020009c000003c80000c13d0000000001000416000000000001004b000003c80000c13d0000000401000039000000000101041a000000800010043f000003460100004100000c870001042e000003380020009c0000023e0000613d000003390020009c000002660000613d0000033a0020009c000003c80000c13d0000000001000416000000000001004b000003c80000c13d0000000501000039000002610000013d000003300020009c000001300000613d000003310020009c000003c80000c13d000000c400d0008c000003c80000413d0000000002000416000000000002004b000003c80000c13d0000004402800370000000000102043b000900000001001d000003260010009c000003c80000213d0000006402800370000000000202043b000003260020009c000003c80000213d0000008402800370000000000202043b000003230020009c000003c80000213d000000a402800370000000000402043b0000033e0040009c000003c80000213d00000023024000390000000000d2004b000003c80000813d0000000405400039000000000258034f000000000202043b0000033e0020009c000002570000213d0000001f032000390000036b033001970000003f033000390000036b033001970000033f0030009c000002570000213d0000008003300039000000400030043f000000800020043f000000000324001900000024033000390000000000d3004b000003c80000213d0000002003500039000000000338034f0000036b042001980000001f0520018f000000a001400039000000fa0000613d000000a006000039000000000703034f000000007807043c0000000006860436000000000016004b000000f60000c13d000000000005004b000001070000613d000000000343034f0000000304500210000000000501043300000000054501cf000000000545022f000000000303043b0000010004400089000000000343022f00000000034301cf000000000353019f0000000000310435000000a00120003900000000000104350000034001000041000000000201041a000000010020008c000002b30000613d0000000102000039000000000021041b0000000501000039000000000101041a00000326011001970000000002000411000000000012004b000002890000c13d000000800200043d000003410020009c000003c80000213d000000400020008c000003c80000413d000000a00100043d0000033e0010009c000003c80000213d000000a001100039000000a0022000390c8608460000040f0000000002010019000000c00400043d000003260040009c000003c80000213d00000001030003670000000401300370000000000101043b0000002403300370000000000503043b0000000903000029000003ff0000013d0000000001000416000000000001004b000003c80000c13d0000000301000039000002610000013d0000002400d0008c000003c80000413d0000000002000416000000000002004b000003c80000c13d0000000401800370000000000601043b000003260060009c000003c80000213d000000000100041a00000326011001970000000005000411000000000015004b000002890000c13d000000000006004b000002950000c13d0000034501000041000000000010043f000003440100004100000c88000104300000000001000416000000000001004b000003c80000c13d000000000100041a000002620000013d000000c400d0008c000003c80000413d0000000002000416000000000002004b000003c80000c13d0000000402800370000000000202043b0000ffff0020008c000003c80000213d0000002402800370000000000402043b0000033e0040009c000003c80000213d00000023024000390000000000d2004b000003c80000813d0000000405400039000000000258034f000000000202043b0000033e0020009c000002570000213d0000001f032000390000036b033001970000003f033000390000036b033001970000033f0030009c000002570000213d0000008003300039000000400030043f000000800020043f000000000324001900000024033000390000000000d3004b000003c80000213d0000002003500039000000000108034f000000000538034f0000036b062001980000001f0720018f000000a004600039000001780000613d000000a003000039000000000805034f000000008908043c0000000003930436000000000043004b000001740000c13d000000000007004b000001850000613d000000000365034f0000000305700210000000000604043300000000065601cf000000000656022f000000000303043b0000010005500089000000000353022f00000000035301cf000000000363019f0000000000340435000000a00220003900000000000204350000006402100370000000000202043b000900000002001d000003260020009c000003c80000213d000000a402100370000000000502043b0000033e0050009c000003c80000213d00000023025000390000000000d2004b000003c80000813d0000000406500039000000000261034f000000000402043b0000033e0040009c000002570000213d0000001f024000390000036b022001970000003f022000390000036b02200197000000400300043d0000000002230019000800000003001d000000000032004b000000000300003900000001030040390000033e0020009c000002570000213d0000000100300190000002570000c13d000000400020043f00000008020000290000000002420436000000000345001900000024033000390000000000d3004b000003c80000213d0000002003600039000000000331034f0000036b054001980000001f0640018f0000000001520019000001b90000613d000000000703034f0000000008020019000000007907043c0000000008980436000000000018004b000001b50000c13d000000000006004b000001c60000613d000000000353034f0000000305600210000000000601043300000000065601cf000000000656022f000000000303043b0000010005500089000000000353022f00000000035301cf000000000363019f0000000000310435000000000142001900000000000104350000034001000041000000000301041a000000010030008c000002b30000613d0000000103000039000000000031041b0000000201000039000000000101041a00000326011001970000000003000411000000000013004b000002890000c13d00000008010000290000000003010433000003410030009c000003c80000213d000000800030008c000003c80000413d0000000801000029000000400110003900000000010104330000033e0010009c000003c80000213d0000000004020433000600000004001d000000000121001900000000022300190c8608460000040f000700000001001d000000080100002900000060011000390000000001010433000003260010009c000003c80000213d000000080100002900000080011000390000000001010433000800000001001d000003260010009c000003c80000213d00000007010000290000000001010433000000000001004b000001fa0000613d00000007010000290000002001100039000000000101043300000040011000390000000001010433000903260010019b0000000401000039000000000101041a000500000001001d00000084010000390000000101100367000000000101043b000400000001001d000000090000006b0000053e0000c13d00000000010004140000034a0200004100000000002004430009000500100074000005890000813d000000000100041200000004001004430000000001000414000003230010009c0000032301008041000000c0011002100000034b011001c700008002020000390c860c810000040f0000000100200190000008450000613d00000000010004140000000802000029000000040020008c000006a40000613d000003230010009c0000032301008041000000c001100210000000040000006b000006990000c13d00000008020000290000069e0000013d0000006400d0008c000003c80000413d0000000002000416000000000002004b000003c80000c13d0000000402800370000000000202043b000900000002001d000003260020009c000003c80000213d0000002402800370000000000202043b000003260020009c000003c80000213d0000004403800370000000000a03043b000000000300041a00000326033001970000000004000411000000000034004b000002890000c13d000003260b2001970000000909000029000000000009004b000002c50000c13d00000000020004140000000400b0008c000002d10000c13d0000000001d8034f00000001020000390000000003000031000003af0000013d0000008400d0008c000003c80000413d0000000402800370000000000202043b000500000002001d0000002402800370000000000202043b000900000002001d0000033e0020009c000003c80000213d000000090200002900000023022000390000000000d2004b000003c80000813d00000009020000290000000402200039000000000228034f000000000302043b0000033e0030009c000002570000213d00000005023002100000003f0420003900000356044001970000033f0040009c0000029b0000a13d0000035d01000041000000000010043f0000004101000039000000040010043f0000035a0100004100000c88000104300000000001000416000000000001004b000003c80000c13d0000000201000039000000000101041a0000032601100197000000800010043f000003460100004100000c870001042e0000000001000416000000000001004b000003c80000c13d0000000101000039000000000201041a00000326012001970000000006000411000000000016004b0000028d0000c13d000900000002001d000000000200041a0000000001000414000003230010009c0000032301008041000000c00110021000000328011001c7000800000002001d00000326052001970000800d02000039000000030300003900000355040000410c860c7c0000040f0000000100200190000003c80000613d000000080100002900000327011001970000000002000411000000000121019f000000000010041b000000090100002900000327011001970000000102000039000000000012041b000000000100001900000c870001042e0000036301000041000000000010043f000003440100004100000c88000104300000035401000041000000000010043f000003440100004100000c88000104300000032702200197000000000021041b000000000100001900000c870001042e000000000056004b000002b70000c13d0000034301000041000000000010043f000003440100004100000c88000104300000008004400039000000400040043f000000800030043f00000009040000290000002404400039000800000042001d0000000800d0006b000003c80000213d000000000003004b000002da0000c13d0000004402800370000000000202043b000900000002001d000003260020009c000003c80000213d0000006401800370000000000101043b000800000001001d000003260010009c000003c80000213d0000034001000041000000000201041a000000010020008c000003f60000c13d0000036101000041000000000010043f000003440100004100000c88000104300000000101000039000000000201041a0000032702200197000000000262019f000000000021041b0000000001000414000003230010009c0000032301008041000000c00110021000000328011001c70000800d0200003900000003030000390000034204000041000003c50000013d0000001400b0043f0000003400a0043f0000036401000041000000000010043f0000000001000414000000040090008c000003660000c13d0000000102000039000000100100043d000000000010043f0000000003000031000003900000013d000003230020009c0000032302008041000000c00120021000000000000a004b00080000000a001d00070000000b001d000003a10000c13d00000000020b0019000003a60000013d000000a0060000390007002400d00092000000200700008a00060000000d001d000000000248034f000000000202043b0000033e0020009c000003c80000213d000000090b2000290000000702b00069000003410020009c000003c80000213d000000e00020008c000003c80000413d000000400900043d000003570090009c000002570000213d000000e002900039000000400020043f0000002402b00039000000000328034f000000000303043b000003260030009c000003c80000213d00000000033904360000002002200039000000000528034f000000000505043b000003260050009c000003c80000213d00000000005304350000002002200039000000000328034f000000000303043b000003260030009c000003c80000213d000000400590003900000000003504350000002003200039000000000238034f000000000202043b000003260020009c000003c80000213d000000600590003900000000002504350000002002300039000000000228034f000000000202043b00000080059000390000000000250435000000400a3000390000000002a8034f000000000202043b0000033e0020009c000003c80000213d000000000eb200190000004302e000390000000000d2004b000000000300001900000358030080410000035802200197000000000002004b00000000050000190000035805004041000003580020009c000000000503c019000000000005004b000003c80000c13d000000240fe000390000000002f8034f000000000b02043b0000033e00b0009c000002570000213d0000001f02b00039000000000272016f0000003f02200039000000000272016f000000400c00043d00000000022c00190000000000c2004b000000000300003900000001030040390000033e0020009c000002570000213d0000000100300190000002570000c13d000000400020043f0000000005bc04360000000002be001900000044022000390000000000d2004b000003c80000213d0000002002f00039000000000108034f000000000228034f000000000807001900000000037b0170000000000e350019000003430000613d000000000f02034f000000000d05001900000000f70f043c000000000d7d04360000000000ed004b0000033f0000c13d0000001f0db00190000003500000613d000000000232034f0000000303d0021000000000070e043300000000073701cf000000000737022f000000000202043b0000010003300089000000000232022f00000000023201cf000000000272019f00000000002e04350000000002b500190000000000020435000000a0029000390000000000c204350000002002a00039000000000221034f000000000202043b000000000002004b0000000003000039000000010300c039000000000032004b000000060d0000290000000007080019000000000801034f000003c80000c13d000000c003900039000000000023043500000000069604360000002004400039000000080040006c000002de0000413d000002a50000013d00070000000b001d00080000000a001d000003230010009c0000032301008041000000c00110021000000365011001c700000000020900190c860c7c0000040f000000000301001900000060033002700000032303300197000000200030008c000000200400003900000000040340190000001f0540018f00000020044001900000037d0000613d000000000601034f0000000007000019000000006806043c0000000007870436000000000047004b000003790000c13d000000000005004b0000038a0000613d000000000641034f0000000305500210000000000704043300000000075701cf000000000757022f000000000606043b0000010005500089000000000656022f00000000055601cf000000000575019f0000000000540435000000000003001f0002000000010355000000000100043d0000000909000029000000080a000029000000070b000029000000000003004b00000000030000390000000103006039000000010010008c0000000001000039000000010100603900000001002001900000039d0000613d000000000131019f00000001001001900000039d0000613d000000340000043f000003b30000013d0000036601000041000000000010043f000003530100004100000c880001043000000328011001c7000080090200003900000000030a001900000000040b001900000000050000190c860c7c0000040f000000070b000029000000080a000029000200000001035500000000030100190000006003300270000003230030019d00000323033001970000000909000029000000000003004b000003ca0000c13d0000000100200190000003f20000613d000000400100043d00000040021000390000000000a2043500000020021000390000000000b204350000000000910435000003230010009c000003230100804100000040011002100000000002000414000003230020009c0000032302008041000000c002200210000000000112019f00000369011001c70000800d0200003900000001030000390000036a040000410c860c7c0000040f00000001002001900000008c0000c13d000000000100001900000c8800010430000003670030009c000002570000813d0000001f053000390000036b055001970000003f055000390000036b06500197000000400500043d0000000006650019000000000056004b000000000700003900000001070040390000033e0060009c000002570000213d0000000100700190000002570000c13d000000400060043f00000000063504360000036b043001980000001f0530018f0000000003460019000003e40000613d000000000701034f000000007807043c0000000006860436000000000036004b000003e00000c13d000000000005004b000003b10000613d000000000141034f0000000304500210000000000503043300000000054501cf000000000545022f000000000101043b0000010004400089000000000141022f00000000014101cf000000000151019f0000000000130435000003b10000013d0000036801000041000000000010043f000003440100004100000c88000104300000000102000039000000000021041b000000090000006b000004040000c13d000000800200003900000000050004160000000501000029000000000300001900000008040000290c8608f90000040f0000034001000041000000000001041b000000000100001900000c870001042e00000000010004100000032601100197000000400300043d000000240230003900000000001204350000034801000041000000000013043500000000010004110000032601100197000700000003001d0000000402300039000000000012043500000000010004140000000902000029000000040020008c000004190000c13d0000000003000031000000200030008c00000020040000390000000004034019000004450000013d0000000702000029000003230020009c00000323020080410000004002200210000003230010009c0000032301008041000000c001100210000000000121019f00000349011001c700000009020000290c860c810000040f000000000301001900000060033002700000032303300197000000200030008c000000200400003900000000040340190000001f0640018f00000020074001900000000705700029000004340000613d000000000801034f0000000709000029000000008a08043c0000000009a90436000000000059004b000004300000c13d000000000006004b000004410000613d000000000771034f0000000306600210000000000805043300000000086801cf000000000868022f000000000707043b0000010006600089000000000767022f00000000066701cf000000000686019f0000000000650435000000000003001f000200000001035500000001002001900000045d0000613d0000001f01400039000000600110018f0000000704100029000000000014004b00000000020000390000000102004039000600000004001d0000033e0040009c000002570000213d0000000100200190000002570000c13d0000000602000029000000400020043f000000200030008c000003c80000413d00000007020000290000000002020433000700000002001d000000000002004b0000047b0000c13d0000036001000041000000000010043f000003440100004100000c88000104300000001f0530018f0000032506300198000000400200043d0000000004620019000004680000613d000000000701034f0000000008020019000000007907043c0000000008980436000000000048004b000004640000c13d000000000005004b000004750000613d000000000161034f0000000305500210000000000604043300000000065601cf000000000656022f000000000101043b0000010005500089000000000151022f00000000015101cf000000000161019f00000000001404350000006001300210000003230020009c00000323020080410000004002200210000000000112019f00000c880001043000000359020000410000000604000029000000000024043500000004024000390000000004000411000000000042043500000000020004140000000904000029000000040040008c000004b30000613d0000000601000029000003230010009c00000323010080410000004001100210000003230020009c0000032302008041000000c002200210000000000112019f0000035a011001c700000009020000290c860c810000040f000000000301001900000060033002700000032303300197000000200030008c000000200400003900000000040340190000001f0640018f00000020074001900000000605700029000004a00000613d000000000801034f0000000609000029000000008a08043c0000000009a90436000000000059004b0000049c0000c13d000000000006004b000004ad0000613d000000000771034f0000000306600210000000000805043300000000086801cf000000000868022f000000000707043b0000010006600089000000000767022f00000000066701cf000000000686019f0000000000650435000000000003001f00020000000103550000000100200190000004c60000613d0000001f01400039000000600110018f0000000602100029000400000002001d0000033e0020009c000002570000213d0000000402000029000000400020043f000000200030008c000003c80000413d00000006020000290000000002020433000000070020006c000004d20000813d0000035f01000041000000000010043f0000000701000029000000040010043f000000240020043f000003490100004100000c88000104300000001f0530018f0000032506300198000000400200043d0000000004620019000004680000613d000000000701034f0000000008020019000000007907043c0000000008980436000000000048004b000004cd0000c13d000004680000013d0000000002000410000000000002004b000004d90000c13d0000035e01000041000000000010043f000003440100004100000c880001043000000359020000410000000404000029000000000024043500000004024000390000000004000410000000000042043500000000020004140000000904000029000000040040008c000005110000613d0000000401000029000003230010009c00000323010080410000004001100210000003230020009c0000032302008041000000c002200210000000000112019f0000035a011001c700000009020000290c860c810000040f000000000301001900000060033002700000032303300197000000200030008c000000200400003900000000040340190000001f0640018f00000020074001900000000405700029000004fe0000613d000000000801034f0000000409000029000000008a08043c0000000009a90436000000000059004b000004fa0000c13d000000000006004b0000050b0000613d000000000771034f0000000306600210000000000805043300000000086801cf000000000868022f000000000707043b0000010006600089000000000767022f00000000066701cf000000000686019f0000000000650435000000000003001f00020000000103550000000100200190000005c80000613d0000001f01400039000000600110018f00000004021000290000033e0020009c000002570000213d000000400020043f000000200030008c000003c80000413d00000004010000290000000001010433000400000001001d00000020012000390000035b030000410000000000310435000000640120003900000007030000290000000000310435000000440120003900000000030004100000000000310435000000240120003900000000030004110000000000310435000000640100003900000000001204350000035c0020009c000002570000213d000000a001200039000000400010043f00000009010000290c860b6b0000040f0000035901000041000000400200043d0000000000120435000600000002001d00000004012000390000000002000410000000000021043500000000010004140000000902000029000000040020008c000007190000c13d0000000003000031000000200030008c00000020040000390000000004034019000007450000013d0000000001000414000200000001001d0000000301000039000000000101041a000000400200043d00000020032000390000034704000041000000000043043500000326011001970000002403200039000000000013043500000044010000390000000000120435000000440120003900000000000104350000033f0020009c000002570000213d0000008001200039000000400010043f00000009010000290c860b6b0000040f000000400100043d000300000001001d000000240110003900000002030000290005000500300074000005d40000813d000000030400002900000020024000390000034d03000041000000000032043500000008020000290000000000210435000000440140003900000004020000290000000000210435000000440100003900000000001404350000033f0040009c000002570000213d00000003020000290000008001200039000000400010043f00000009010000290c860b6b0000040f000000400100043d000700000001001d0000034e0100004100000000001004430000000001000414000003230010009c0000032301008041000000c0011002100000034f011001c70000800b020000390c860c810000040f0000000100200190000008450000613d000000000101043b00000007030000290000006002300039000000000012043500000040013000390000000402000029000000000021043500000020013000390000000802000029000000000021043500000009010000290000000000130435000003230030009c000003230300804100000040013002100000000002000414000006c00000013d0000000301000039000000000101041a0000032601100197000500000001001d00000004001004430000000001000414000003230010009c0000032301008041000000c0011002100000034b011001c700008002020000390c860c810000040f0000000100200190000008450000613d000000000101043b000000000001004b000003c80000613d000000400300043d0000002401300039000000800200003900000000002104350000034c0100004100000000001304350000000401300039000000060200002900000000002104350000000701000029000000000201043300000084013000390000000000210435000300000003001d000000a40330003900000005012002100000000001310019000000000002004b000006cd0000c13d000000030f0000290000006402f00039000000080300002900000000003204350000004402f0003900000000000204350000000502000029000000040020008c000007670000613d00000003020000290000000001210049000003230010009c00000323010080410000006001100210000003230020009c00000323020080410000004002200210000000000121019f0000000902000029000003230020009c0000032302008041000000c002200210000000000121019f000000040000006b0000075c0000c13d0000000502000029000007610000013d0000001f0530018f0000032506300198000000400200043d0000000004620019000004680000613d000000000701034f0000000008020019000000007907043c0000000008980436000000000048004b000005cf0000c13d000004680000013d0000000302000039000000000202041a00000348030000410000000304000029000000000034043500000000030004100000032603300197000000040440003900000000003404350000032602200197000200000002001d000000000021043500000000010004140000000902000029000000040020008c000005e90000c13d0000000003000031000000200030008c00000020040000390000000004034019000006150000013d0000000302000029000003230020009c00000323020080410000004002200210000003230010009c0000032301008041000000c001100210000000000121019f00000349011001c700000009020000290c860c810000040f000000000301001900000060033002700000032303300197000000200030008c000000200400003900000000040340190000001f0640018f00000020074001900000000305700029000006040000613d000000000801034f0000000309000029000000008a08043c0000000009a90436000000000059004b000006000000c13d000000000006004b000006110000613d000000000771034f0000000306600210000000000805043300000000086801cf000000000868022f000000000707043b0000010006600089000000000767022f00000000066701cf000000000686019f0000000000650435000000000003001f000200000001035500000001002001900000070d0000613d0000001f01400039000000600110018f0000000302100029000000000012004b000000000100003900000001010040390000033e0020009c000002570000213d0000000100100190000002570000c13d000000400020043f000000200030008c000003c80000413d00000003010000290000000001010433000000040010002a000007560000413d000000040110002900000020032000390000034704000041000000000043043500000044032000390000000000130435000000240120003900000002030000290000000000310435000000440100003900000000001204350000033f0020009c000002570000213d0000008001200039000000400010043f00000009010000290c860b6b0000040f0000000301000039000000000101041a0000034a0200004100000000002004430000032601100197000300000001001d00000004001004430000000001000414000003230010009c0000032301008041000000c0011002100000034b011001c700008002020000390c860c810000040f0000000100200190000008450000613d000000000101043b000000000001004b000003c80000613d000000400300043d0000034c01000041000000000013043500000004013000390000000602000029000000000021043500000024023000390000008001000039000100000002001d00000000001204350000000701000029000000000201043300000084013000390000000000210435000200000003001d000000a40330003900000005012002100000000001310019000000000002004b000007c50000c13d000000020f0000290000006402f00039000000080300002900000000003204350000004403f000390000000902000029000700000003001d00000000002304350000000302000029000000040020008c0000067f0000613d00000002020000290000000001210049000003230010009c00000323010080410000006001100210000003230020009c00000323020080410000004002200210000000000121019f0000000502000029000003230020009c0000032302008041000000c002200210000000000121019f00000003020000290c860c7c0000040f00000000030100190000006003300270000003230030019d00020000000103550000000100200190000008050000613d00000002010000290000033e0010009c000002570000213d0000000201000029000000400010043f0000000301000039000000000101041a000000020400002900000020024000390000034703000041000000000032043500000326011001970000000102000029000000000012043500000007010000290000000000010435000000440100003900000000001404350000033f0040009c000002570000213d00000002020000290000008001200039000000400010043f00000009010000290c860b6b0000040f000004000000013d00000328011001c700008009020000390000000403000029000000080400002900000000050000190c860c7c0000040f00020000000103550000006001100270000003230010019d0000000100200190000007c10000613d000000400100043d000900000001001d0000034e0100004100000000001004430000000001000414000003230010009c0000032301008041000000c0011002100000034f011001c70000800b020000390c860c810000040f0000000100200190000008450000613d000000000101043b0000000903000029000000600230003900000000001204350000004001300039000000040200002900000000002104350000002001300039000000080200002900000000002104350000000000030435000003230030009c000003230300804100000040013002100000000002000414000003230020009c0000032302008041000000c002200210000000000112019f00000350011001c70000800d020000390000000203000039000003510400004100000006050000290c860c7c0000040f0000000100200190000003c80000613d000004000000013d000000e0040000390000000005000019000000070e000029000000030f000029000006e10000013d00000000098700190000000000090435000000c001100039000000c0066000390000000006060433000000000006004b0000000006000039000000010600c03900000000006104350000001f017000390000036b0110019700000000018100190000000105500039000000000025004b000005ae0000813d0000000006f10049000000a40660008a0000000003630436000000200ee0003900000000060e043300000000870604340000032607700197000000000771043600000000080804330000032608800197000000000087043500000040076000390000000007070433000003260770019700000040081000390000000000780435000000600760003900000000070704330000032607700197000000600810003900000000007804350000008007600039000000000707043300000080081000390000000000780435000000a0076000390000000007070433000000a0081000390000000000480435000000e008100039000000009707043400000000007804350000010008100039000000000007004b000006d20000613d000000000a000019000000000b8a0019000000000ca90019000000000c0c04330000000000cb0435000000200aa0003900000000007a004b000007050000413d000006d20000013d0000001f0530018f0000032506300198000000400200043d0000000004620019000004680000613d000000000701034f0000000008020019000000007907043c0000000008980436000000000048004b000007140000c13d000004680000013d0000000602000029000003230020009c00000323020080410000004002200210000003230010009c0000032301008041000000c001100210000000000121019f0000035a011001c700000009020000290c860c810000040f000000000301001900000060033002700000032303300197000000200030008c000000200400003900000000040340190000001f0640018f00000020074001900000000605700029000007340000613d000000000801034f0000000609000029000000008a08043c0000000009a90436000000000059004b000007300000c13d000000000006004b000007410000613d000000000771034f0000000306600210000000000805043300000000086801cf000000000868022f000000000707043b0000010006600089000000000767022f00000000066701cf000000000686019f0000000000650435000000000003001f00020000000103550000000100200190000007850000613d0000001f01400039000000600210018f0000000601200029000000000021004b000000000200003900000001020040390000033e0010009c000002570000213d0000000100200190000002570000c13d000000400010043f000000200030008c000003c80000413d00000006010000290000000001010433000000040110006c000007910000813d0000035d01000041000000000010043f0000001101000039000000040010043f0000035a0100004100000c880001043000000328011001c700008009020000390000000403000029000000050400002900000000050000190c860c7c0000040f00020000000103550000006001100270000003230010019d00000001002001900000076d0000613d00000003010000290000033e0010009c000002570000213d0000000301000029000000400010043f000004000000013d0000034a010000410000000000100443000000000100041200000004001004430000000001000414000003230010009c0000032301008041000000c0011002100000034b011001c700008002020000390c860c810000040f0000000100200190000008450000613d00000000010004140000000802000029000000040020008c000007a40000613d000003230010009c0000032301008041000000c001100210000000040000006b000007990000c13d00000008020000290000079e0000013d0000001f0530018f0000032506300198000000400200043d0000000004620019000004680000613d000000000701034f0000000008020019000000007907043c0000000008980436000000000048004b0000078c0000c13d000004680000013d000000070010006c000004590000c13d00000080020000390000000501000029000000090300002900000008040000290000000705000029000003ff0000013d00000328011001c700008009020000390000000403000029000000080400002900000000050000190c860c7c0000040f00020000000103550000006001100270000003230010019d0000000100200190000007c10000613d000000400100043d000900000001001d0000034e0100004100000000001004430000000001000414000003230010009c0000032301008041000000c0011002100000034f011001c70000800b020000390c860c810000040f0000000100200190000008450000613d000000000101043b0000000903000029000000600230003900000000001204350000004001300039000000040200002900000000002104350000002001300039000000080200002900000000002104350000000000030435000003230030009c000003230300804100000040013002100000000002000414000006c00000013d0000035201000041000000000010043f000003530100004100000c8800010430000000e0040000390000000005000019000000070e000029000000020f000029000007d90000013d00000000098700190000000000090435000000c001100039000000c0066000390000000006060433000000000006004b0000000006000039000000010600c03900000000006104350000001f017000390000036b0110019700000000018100190000000105500039000000000025004b0000065f0000813d0000000006f10049000000a40660008a0000000003630436000000200ee0003900000000060e043300000000870604340000032607700197000000000771043600000000080804330000032608800197000000000087043500000040076000390000000007070433000003260770019700000040081000390000000000780435000000600760003900000000070704330000032607700197000000600810003900000000007804350000008007600039000000000707043300000080081000390000000000780435000000a0076000390000000007070433000000a0081000390000000000480435000000e008100039000000009707043400000000007804350000010008100039000000000007004b000007ca0000613d000000000a000019000000000b8a0019000000000ca90019000000000c0c04330000000000cb0435000000200aa0003900000000007a004b000007fd0000413d000007ca0000013d000000400200043d00000020012000390000034d030000410000000000310435000000440120003900000004030000290000000000310435000000240120003900000008030000290000000000310435000000440100003900000000001204350000033f0020009c000002570000213d0000008001200039000000400010043f00000009010000290c860b6b0000040f000000400100043d000700000001001d0000034e0100004100000000001004430000000001000414000003230010009c0000032301008041000000c0011002100000034f011001c70000800b020000390c860c810000040f0000000100200190000008450000613d000000000101043b00000007030000290000006002300039000000000012043500000040013000390000000402000029000000000021043500000020013000390000000802000029000000000021043500000009010000290000000000130435000003230030009c000003230300804100000040013002100000000002000414000003230020009c0000032302008041000000c002200210000000000112019f00000350011001c70000800d020000390000000203000039000003510400004100000006050000290c860c7c0000040f0000000100200190000003c80000613d000000400100043d000700440010003d000200000001001d000100240010003d000006840000013d000000000001042f0002000000000002000200000001001d0000001f03100039000000000023004b0000000005000019000003580500404100000358042001970000035803300197000000000643013f000000000043004b00000000030000190000035803002041000003580060009c000000000305c019000000000003004b000008df0000613d00000002010000290000000056010434000003670060009c000008e10000813d00000005076002100000003f037000390000035603300197000000400100043d0000000003310019000100000001001d000000000013004b000000000800003900000001080040390000033e0030009c000008e10000213d0000000100800190000008e10000c13d000000400030043f000000010100002900000000006104350000000006750019000000000026004b000008df0000213d000000000065004b000008dd0000813d000000200720008a000000010900002900000000530504340000033e0030009c000008df0000213d000000020b3000290000000003b70049000003410030009c000008df0000213d000000e00030008c000008df0000413d000000400a00043d0000035700a0009c000008e10000213d000000e003a00039000000400030043f0000002003b000390000000003030433000003260030009c000008df0000213d00000000033a0436000000400cb00039000000000c0c04330000032600c0009c000008df0000213d0000000000c304350000006003b000390000000003030433000003260030009c000008df0000213d000000400ca0003900000000003c04350000008003b000390000000003030433000003260030009c000008df0000213d000000600ca0003900000000003c04350000008003a00039000000a00cb00039000000000c0c04330000000000c30435000000c003b0003900000000030304330000033e0030009c000008df0000213d000000000eb300190000003f03e00039000000000023004b000000000c000019000003580c0080410000035803300197000000000d43013f000000000043004b000000000300001900000358030040410000035800d0009c00000000030cc019000000000003004b000008df0000c13d0000002003e00039000000000c0304330000033e00c0009c000008e10000213d0000001f03c000390000036b033001970000003f033000390000036b03300197000000400d00043d00000000033d00190000000000d3004b000000000f000039000000010f0040390000033e0030009c000008e10000213d0000000100f00190000008e10000c13d000000400030043f000000000fcd0436000000400ee000390000000003ce0019000000000023004b000008df0000213d00000000000c004b000008cc0000613d00000000030000190000000008f3001900000000013e00190000000001010433000000000018043500000020033000390000000000c3004b000008c50000413d0000000001cf00190000000000010435000000a001a000390000000000d10435000000e001b000390000000003010433000000000003004b0000000001000039000000010100c039000000000013004b000008df0000c13d0000002009900039000000c001a0003900000000003104350000000000a90435000000000065004b000008710000413d0000000101000029000000000001042d000000000100001900000c88000104300000035d01000041000000000010043f0000004101000039000000040010043f0000035a0100004100000c880001043000000000430104340000000001320436000000000003004b000008f30000613d000000000200001900000000051200190000000006240019000000000606043300000000006504350000002002200039000000000032004b000008ec0000413d000000000213001900000000000204350000001f023000390000036b022001970000000001210019000000000001042d0008000000000002000700000005001d000400000004001d000500000002001d000600000001001d000003260130019800000003020000390000092a0000613d0000000003000414000100000003001d000000000502041a000000400200043d00000020032000390000034704000041000000000043043500000326045001970000002403200039000000000043043500000044030000390000000000320435000000440320003900000000000304350000036c0020009c00000b3c0000813d0000008003200039000000400030043f000800000001001d0c860b6b0000040f00000008050000290000000301000039000000000101041a000000400b00043d000003480200004100000000002b0435000000000200041000000326022001970000000403b00039000000000023043500000326061001970000002401b0003900000000006104350000000001000414000000040050008c000009b00000c13d0000000003000031000000200030008c00000020040000390000000004034019000009e10000013d0000000001000414000300000001001d000000000102041a0000034a0200004100000000002004430000032601100197000800000001001d00000004001004430000000001000414000003230010009c0000032301008041000000c0011002100000034b011001c700008002020000390c860c810000040f000000010020019000000b420000613d000000000101043b000000000001004b000000050f00002900000b3a0000613d000000400700043d0000002401700039000000800200003900000000002104350000034c01000041000000000017043500000004017000390000000602000029000000000021043500000000020f043300000084017000390000000000210435000000a40370003900000005012002100000000001310019000000000002004b000009900000613d000000e0040000390000000006000019000009630000013d000000000a98001900000000000a0435000000c001100039000000c0077000390000000007070433000000000007004b0000000007000039000000010700c03900000000007104350000001f018000390000036b0110019700000000019100190000000106600039000000000026004b00000000070e0019000009900000813d000000000e0700190000000007710049000000a40770008a0000000003730436000000200ff0003900000000070f043300000000980704340000032608800197000000000881043600000000090904330000032609900197000000000098043500000040087000390000000008080433000003260880019700000040091000390000000000890435000000600870003900000000080804330000032608800197000000600910003900000000008904350000008008700039000000000808043300000080091000390000000000890435000000a0087000390000000008080433000000a0091000390000000000490435000000e00910003900000000a808043400000000008904350000010009100039000000000008004b000009530000613d000000000b000019000000000c9b0019000000000dba0019000000000d0d04330000000000dc0435000000200bb0003900000000008b004b000009880000413d000009530000013d000000040200002900000326032001970000006402700039000500000003001d0000000000320435000000440270003900000000000204350000000804000029000000040040008c00000aeb0000613d0000000001710049000003230010009c00000323010080410000006001100210000003230070009c000400000007001d000003230200004100000000020740190000004002200210000000000121019f0000000302000029000003230020009c0000032302008041000000c002200210000000000121019f0000000703000029000000000003004b00000ae30000613d00000328011001c70000800902000039000000000500001900000ae40000013d000200000006001d0000032300b0009c000003230200004100000000020b40190000004002200210000003230010009c0000032301008041000000c001100210000000000121019f00000349011001c7000000000205001900030000000b001d0c860c810000040f000000030b000029000000000301001900000060033002700000032303300197000000200030008c000000200400003900000000040340190000001f0640018f000000200740019000000000057b0019000009ce0000613d000000000801034f00000000090b0019000000008a08043c0000000009a90436000000000059004b000009ca0000c13d000000000006004b000009db0000613d000000000771034f0000000306600210000000000805043300000000086801cf000000000868022f000000000707043b0000010006600089000000000767022f00000000066701cf000000000686019f0000000000650435000000000003001f00020000000103550000000100200190000000080500002900000b430000613d00000002060000290000001f01400039000000600110018f0000000002b10019000000000012004b000000000100003900000001010040390000033e0020009c00000b3c0000213d000000010010019000000b3c0000c13d000000400020043f000000200030008c00000b3a0000413d00000000010b04330000000703000029000000000031001a00000b650000413d00000000013100190000002003200039000003470400004100000000004304350000004403200039000000000013043500000024012000390000000000610435000000440100003900000000001204350000033f0020009c00000b3c0000213d0000008001200039000000400010043f00000000010500190c860b6b0000040f0000000301000039000000000101041a0000034a0200004100000000002004430000032601100197000300000001001d00000004001004430000000001000414000003230010009c0000032301008041000000c0011002100000034b011001c700008002020000390c860c810000040f000000010020019000000b420000613d000000000101043b000000000001004b000000050f00002900000b3a0000613d000000400700043d0000034c01000041000000000017043500000004017000390000000602000029000000000021043500000024027000390000008001000039000200000002001d000000000012043500000000020f043300000084017000390000000000210435000000a40370003900000005012002100000000001310019000000000002004b00000a680000613d000000e004000039000000000600001900000a3b0000013d000000000a98001900000000000a0435000000c001100039000000c0077000390000000007070433000000000007004b0000000007000039000000010700c03900000000007104350000001f018000390000036b0110019700000000019100190000000106600039000000000026004b00000000070e001900000a680000813d000000000e0700190000000007710049000000a40770008a0000000003730436000000200ff0003900000000070f043300000000980704340000032608800197000000000881043600000000090904330000032609900197000000000098043500000040087000390000000008080433000003260880019700000040091000390000000000890435000000600870003900000000080804330000032608800197000000600910003900000000008904350000008008700039000000000808043300000080091000390000000000890435000000a0087000390000000008080433000000a0091000390000000000490435000000e00910003900000000a808043400000000008904350000010009100039000000000008004b00000a2b0000613d000000000b000019000000000c9b0019000000000dba0019000000000d0d04330000000000dc0435000000200bb0003900000000008b004b00000a600000413d00000a2b0000013d00000004020000290000032605200197000000640270003900000000005204350000004406700039000000080400002900000000004604350000000302000029000000040020008c00000a8e0000613d0000000001710049000003230010009c00000323010080410000006001100210000003230070009c000003230300004100000000030740190000004003300210000000000131019f0000000103000029000003230030009c0000032303008041000000c003300210000000000131019f000400000007001d000500000005001d000300000006001d0c860c7c0000040f000000030600002900000005050000290000000407000029000000080400002900000000030100190000006003300270000003230030019d0002000000010355000000010020019000000a930000613d0000033e0070009c00000b3c0000213d000000400070043f000000020500002900000ad10000013d000000400200043d00000020012000390000034d03000041000000000031043500000044012000390000000703000029000000000031043500000024012000390000000000510435000000440100003900000000001204350000033f0020009c00000b3c0000213d0000008001200039000000400010043f00000000010400190c860b6b0000040f000000400100043d000400000001001d0000034e0100004100000000001004430000000001000414000003230010009c0000032301008041000000c0011002100000034f011001c70000800b020000390c860c810000040f000000010020019000000b420000613d000000000101043b00000004030000290000006002300039000000000012043500000040013000390000000702000029000000000021043500000020013000390000000502000029000000000021043500000008010000290000000000130435000003230030009c000003230300804100000040013002100000000002000414000003230020009c0000032302008041000000c002200210000000000112019f00000350011001c70000800d020000390000000203000039000003510400004100000006050000290c860c7c0000040f0000000804000029000000010020019000000b3a0000613d000000400700043d000000440670003900000024057000390000000301000039000000000101041a000000200270003900000347030000410000000000320435000003260110019700000000001504350000000000060435000000440100003900000000001704350000033f0070009c00000b3c0000213d0000008001700039000000400010043f000000000104001900000000020700190c860b6b0000040f000000000001042d00000000020400190c860c7c0000040f00020000000103550000006001100270000003230010019d0000000100200190000000040700002900000aef0000613d0000033e0070009c00000b3c0000213d000000400070043f000000000001042d0000034a010000410000000000100443000000000100041200000004001004430000000001000414000003230010009c0000032301008041000000c0011002100000034b011001c700008002020000390c860c810000040f000000010020019000000b420000613d00000000010004140000000502000029000000040020008c00000b120000613d000003230010009c0000032301008041000000c0011002100000000703000029000000000003004b00000b0b0000613d00000328011001c700008009020000390000000504000029000000000500001900000b0c0000013d00000005020000290c860c7c0000040f00020000000103550000006001100270000003230010019d000000010020019000000b610000613d000000400100043d000800000001001d0000034e0100004100000000001004430000000001000414000003230010009c0000032301008041000000c0011002100000034f011001c70000800b020000390c860c810000040f000000010020019000000b420000613d000000000101043b0000000803000029000000600230003900000000001204350000004001300039000000070200002900000000002104350000002001300039000000050200002900000000002104350000000000030435000003230030009c000003230300804100000040013002100000000002000414000003230020009c0000032302008041000000c002200210000000000112019f00000350011001c70000800d020000390000000203000039000003510400004100000006050000290c860c7c0000040f000000010020019000000ae20000c13d000000000100001900000c88000104300000035d01000041000000000010043f0000004101000039000000040010043f0000035a0100004100000c8800010430000000000001042f0000001f0530018f0000032506300198000000400200043d000000000462001900000b4e0000613d000000000701034f0000000008020019000000007907043c0000000008980436000000000048004b00000b4a0000c13d000000000005004b00000b5b0000613d000000000161034f0000000305500210000000000604043300000000065601cf000000000656022f000000000101043b0000010005500089000000000151022f00000000015101cf000000000161019f00000000001404350000006001300210000003230020009c00000323020080410000004002200210000000000121019f00000c88000104300000035201000041000000000010043f000003530100004100000c88000104300000035d01000041000000000010043f0000001101000039000000040010043f0000035a0100004100000c88000104300004000000000002000000400400043d0000036d0040009c00000c2f0000813d00000326051001970000004001400039000000400010043f00000020014000390000036e0300004100000000003104350000002001000039000000000014043500000000230204340000000001000414000000040050008c00000ba60000c13d000000000100003200000be20000613d0000033e0010009c00000c2f0000213d0000001f031000390000036b033001970000003f033000390000036b03300197000000400a00043d00000000033a00190000000000a3004b000000000400003900000001040040390000033e0030009c00000c2f0000213d000000010040019000000c2f0000c13d000000400030043f00000000051a04360000036b021001980000001f0310018f0000000001250019000000020400036700000b980000613d000000000604034f000000006706043c0000000005750436000000000015004b00000b940000c13d000000000003004b00000be30000613d000000000224034f0000000303300210000000000401043300000000043401cf000000000434022f000000000202043b0000010003300089000000000232022f00000000023201cf000000000242019f000000000021043500000be30000013d000200000004001d000003230030009c00000323030080410000006003300210000003230020009c00000323020080410000004002200210000000000223019f000003230010009c0000032301008041000000c001100210000000000112019f000100000005001d00000000020500190c860c7c0000040f000200000001035500000000030100190000006003300270000003230030019d000003230430019800000bfa0000613d0000001f0340003900000324033001970000003f033000390000036f03300197000000400a00043d00000000033a00190000000000a3004b000000000500003900000001050040390000033e0030009c00000c2f0000213d000000010050019000000c2f0000c13d000000400030043f0000001f0540018f00000000034a04360000032506400198000000000463001900000bd40000613d000000000701034f0000000008030019000000007907043c0000000008980436000000000048004b00000bd00000c13d000000000005004b00000bfc0000613d000000000161034f0000000305500210000000000604043300000000065601cf000000000656022f000000000101043b0000010005500089000000000151022f00000000015101cf000000000161019f000000000014043500000bfc0000013d000000600a0000390000000002000415000000040220008a000000050220021000000000010a0433000000000001004b00000c040000c13d00020000000a001d0000034a010000410000000000100443000000040100003900000004001004430000000001000414000003230010009c0000032301008041000000c0011002100000034b011001c700008002020000390c860c810000040f000000010020019000000c610000613d0000000002000415000000040220008a00000c170000013d000000600a000039000000800300003900000000010a0433000000010020019000000c4b0000613d0000000002000415000000030220008a0000000502200210000000000001004b00000c070000613d000000050220027000000000020a001f00000c210000013d00020000000a001d0000034a010000410000000000100443000000010100002900000004001004430000000001000414000003230010009c0000032301008041000000c0011002100000034b011001c700008002020000390c860c810000040f000000010020019000000c610000613d0000000002000415000000030220008a0000000502200210000000000101043b000000000001004b000000020a00002900000c620000613d00000000010a0433000000050220027000000000020a001f000000000001004b00000c2e0000613d000003410010009c00000c350000213d000000200010008c00000c350000413d0000002001a000390000000001010433000000000001004b0000000002000039000000010200c039000000000021004b00000c350000c13d000000000001004b00000c370000613d000000000001042d0000035d01000041000000000010043f0000004101000039000000040010043f0000035a0100004100000c8800010430000000000100001900000c8800010430000000400100043d00000064021000390000037103000041000000000032043500000044021000390000037203000041000000000032043500000024021000390000002a03000039000000000032043500000370020000410000000000210435000000040210003900000020030000390000000000320435000003230010009c0000032301008041000000400110021000000373011001c700000c8800010430000000000001004b00000c730000c13d000000400300043d000100000003001d00000370010000410000000000130435000000040130003900000020020000390000000000210435000000240230003900000002010000290c8608e70000040f00000001020000290000000001210049000003230010009c0000032301008041000003230020009c000003230200804100000060011002100000004002200210000000000121019f00000c8800010430000000000001042f000000400100043d00000044021000390000037403000041000000000032043500000024021000390000001d03000039000000000032043500000370020000410000000000210435000000040210003900000020030000390000000000320435000003230010009c0000032301008041000000400110021000000375011001c700000c8800010430000003230030009c00000323030080410000004002300210000003230010009c00000323010080410000006001100210000000000121019f00000c8800010430000000000001042f00000c7f002104210000000102000039000000000001042d0000000002000019000000000001042d00000c84002104230000000102000039000000000001042d0000000002000019000000000001042d00000c860000043200000c870001042e00000c880001043000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffff00000000000000000000000000000000000000000000000000000001ffffffe000000000000000000000000000000000000000000000000000000000ffffffe0000000000000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000806d08432293677cc7e3e0f9443dcf0459f82567573d5094da6e9e6129dea4abcc6aaf791b8b7c6167981db821320441082903e27343e380dca76afd5807577dfd178559652d65eca585044f34f8688859896a9bebaa7530dbe97c5c527320d50000000200000000000000000000000000000040000001000000000000000000000000000000000000000000000000000000000000000000000000008da5cb5a00000000000000000000000000000000000000000000000000000000c34c08e400000000000000000000000000000000000000000000000000000000f2fde38a00000000000000000000000000000000000000000000000000000000f2fde38b00000000000000000000000000000000000000000000000000000000fd614f4100000000000000000000000000000000000000000000000000000000c34c08e500000000000000000000000000000000000000000000000000000000e30c3978000000000000000000000000000000000000000000000000000000008da5cb5b00000000000000000000000000000000000000000000000000000000ab8236f300000000000000000000000000000000000000000000000000000000bcf225e6000000000000000000000000000000000000000000000000000000004f91bc2a000000000000000000000000000000000000000000000000000000004f91bc2b000000000000000000000000000000000000000000000000000000007200b829000000000000000000000000000000000000000000000000000000007aacd8f80000000000000000000000000000000000000000000000000000000001e33667000000000000000000000000000000000000000000000000000000000517cb760000000000000000000000000000000000000000000000000000000023452b9c000000000000000000000000000000000000000000000000ffffffffffffffff000000000000000000000000000000000000000000000000ffffffffffffff7fa65bb2f450488ab0858c00edc14abc5297769bf42adb48cfb77752890e8b697b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae1278bf1ea9fb0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000001beca374000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000800000000000000000095ea7b300000000000000000000000000000000000000000000000000000000dd62ed3e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000440000000000000000000000001806aa1896bbf26568e884a7374b41e002500962caba6a15023a8d90e8508b8302000002000000000000000000000000000000240000000000000000000000004f91bc2b00000000000000000000000000000000000000000000000000000000a9059cbb00000000000000000000000000000000000000000000000000000000796b89b91644bc98cd93958e4c9038275d622183e25ac5af08cc6b5d95539132020000020000000000000000000000000000000400000000000000000000000002000000000000000000000000000000000000800000000000000000000000001fbfa988fd46deed0de12c94c7b5dcb537d51b804246d0083f245f7a8997d17000000000000000000000000000000000000000000000000000000000b12d13eb00000000000000000000000000000000000000040000001c00000000000000001853971c000000000000000000000000000000000000000000000000000000008be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e07fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0000000000000000000000000000000000000000000000000ffffffffffffff1f800000000000000000000000000000000000000000000000000000000000000070a0823100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002400000000000000000000000023b872dd00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffff5f4e487b710000000000000000000000000000000000000000000000000000000021f7434500000000000000000000000000000000000000000000000000000000cf479181000000000000000000000000000000000000000000000000000000002c5211c60000000000000000000000000000000000000000000000000000000029f745a70000000000000000000000000000000000000000000000000000000075cdea1200000000000000000000000000000000000000000000000000000000be2459830000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a9059cbb00000000000000000000000000000000000000000000000000000000000000440000001000000000000000000000000000000000000000000000000000000000000000000000000090b8ec180000000000000000000000000000000000000000000000010000000000000000350c20f10000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000600000000000000000000000006337ed398c0e8467698c581374fdce4db14922df487b5a39483079f5f59b60a4ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0000000000000000000000000000000000000000000000000ffffffffffffff80000000000000000000000000000000000000000000000000ffffffffffffffc05361666545524332303a206c6f772d6c6576656c2063616c6c206661696c656400000000000000000000000000000000000000000000000000000003ffffffe008c379a0000000000000000000000000000000000000000000000000000000006f742073756363656564000000000000000000000000000000000000000000005361666545524332303a204552433230206f7065726174696f6e20646964206e0000000000000000000000000000000000000084000000000000000000000000416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000000000000000000000000000000000000000000064000000000000000000000000e175faa0876799f3751bebc5edb334272cd393af5219925c03b9e51448d70f3d

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

000000000000000000000000156cebba59deb2cb23742f70dcb0a11cc775591f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ba3274ff65466bdc217745dc276394da4ffe02b700000000000000000000000000000000000000000000000000000000000186a0

-----Decoded View---------------
Arg [0] : _owner (address): 0x156CeBba59DEB2cB23742F70dCb0a11cC775591F
Arg [1] : _sgRouter (address): 0x0000000000000000000000000000000000000000
Arg [2] : _amarokRouter (address): 0x0000000000000000000000000000000000000000
Arg [3] : _executor (address): 0xbA3274Ff65466bDC217745dC276394da4Ffe02b7
Arg [4] : _recoverGas (uint256): 100000

-----Encoded View---------------
5 Constructor Arguments found :
Arg [0] : 000000000000000000000000156cebba59deb2cb23742f70dcb0a11cc775591f
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [3] : 000000000000000000000000ba3274ff65466bdc217745dc276394da4ffe02b7
Arg [4] : 00000000000000000000000000000000000000000000000000000000000186a0


Block Transaction Gas Used Reward
view all blocks produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
[ 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.