ETH Price: $2,638.58 (+2.84%)

Contract

0x22e7170c305298fe6A0132cBad6E3c0691B016De
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
0x60806040181894652023-09-22 5:59:59403 days ago1695362399IN
 Create: FeeCollector
0 ETH0.014034737.55381511

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
FeeCollector

Compiler Version
v0.8.19+commit.7dd6d404

Optimization Enabled:
Yes with 200 runs

Other Settings:
paris EvmVersion, MIT license
File 1 of 12 : FeeCollector.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.19;

import {NATIVE_TOKEN} from "./constants/Tokens.sol";
import {
    ARBITRUM_GOERLI_CHAINID,
    ARBITRUM_CHAINID
} from "./constants/ChainIds.sol";
import {Proxied} from "./vendor/hardhat-deploy/Proxied.sol";
import {
    IERC20,
    SafeERC20
} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import {Address} from "@openzeppelin/contracts/utils/Address.sol";
import {
    EnumerableSetUpgradeable
} from "@openzeppelin/contracts-upgradeable/utils/structs/EnumerableSetUpgradeable.sol";
import {
    Initializable
} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import {ArbSys} from "@arbitrum/nitro-contracts/src/precompiles/ArbSys.sol";

contract FeeCollector is Proxied, Initializable {
    using SafeERC20 for IERC20;
    using Address for address payable;
    using EnumerableSetUpgradeable for EnumerableSetUpgradeable.AddressSet;

    /// @dev _managers is a list of addresses that can call functions to move funds
    EnumerableSetUpgradeable.AddressSet private _managers;

    /**
     @dev confirmations is the number of blocks that have to be included between endBlock
     and the current block number. Used to avoid refunding transactions that may be reorg'd.
     */
    uint256 public confirmations;

    /**
     @dev prevRefundEndBlockByExecutor stores the end block of the previous refund for each
     executor. Used to track settled refunds and avoid any duplicates or unrefunded blocks.
     */
    mapping(address executor => uint256 prevRefundEndBlock)
        public prevRefundEndBlockByExecutor;

    event LogBridge(
        address token,
        uint256 srcChainId,
        uint256 dstChainId,
        uint256 amount
    );

    event LogGasRefund(
        uint256 startBlock,
        uint256 endBlock,
        address recipient,
        uint256 amount
    );

    event LogTransfer(
        address[] tokens,
        address[] recipients,
        uint256[] amounts
    );

    event LogTransferAll(address[] tokens, address[] recipients);

    /**
     @dev senderIsOwnerOrManager is a modifier to restrict access to any function that moves
     funds to only owner or an approved list of managers.
     */
    modifier senderIsOwnerOrManager() {
        require(
            (msg.sender == _proxyAdmin() || isManager(msg.sender)),
            "FeeCollector.senderIsOwnerOrManager"
        );
        _;
    }

    function initialize(
        uint256 _confirmations
    ) external onlyProxyAdmin initializer {
        confirmations = _confirmations;
    }

    function setConfirmations(uint256 _confirmations) external onlyProxyAdmin {
        confirmations = _confirmations;
    }

    /**
     @dev Triggers a bridge/swap using LI.FI. Calldata is obtained off-chain by calling
     the LI.FI API. Moves funds so only callable by owner or a manger.
     */
    function bridgeViaLifi(
        address _srcToken,
        uint256 _srcChainId,
        uint256 _dstChainId,
        uint256 _amount,
        address _lifiDiamond,
        uint256 _bridgeFee,
        bytes calldata _data
    ) external senderIsOwnerOrManager {
        require(
            address(_lifiDiamond) != address(0),
            "FeeCollector.bridgeViaLifi: zero address"
        );

        bool isNative = _srcToken == NATIVE_TOKEN;
        if (!isNative) {
            IERC20(_srcToken).safeIncreaseAllowance(
                address(_lifiDiamond),
                _amount
            );
        }

        (bool success, ) = _lifiDiamond.call{
            value: isNative ? _amount : _bridgeFee
        }(_data);

        require(success, "FeeCollector.bridgeViaLifi: call failed");

        emit LogBridge(_srcToken, _srcChainId, _dstChainId, _amount);
    }

    /**
     @dev revokeUnspentAllowances disables allowance for any passed token.
     Needed as operations through LI.FI may lead to leftover allowances which may
     grow over time.
     */
    function revokeUnspentAllowances(
        address[] calldata _tokens,
        address _lifiDiamond
    ) external senderIsOwnerOrManager {
        for (uint256 i; i < _tokens.length; i++) {
            IERC20(_tokens[i]).safeApprove(address(_lifiDiamond), 0);
        }
    }

    /**
    @dev gasRefund takes care of refunding gas spending for a given
    block range (from startBlock to endBlock, including these 2).
    The refund replay protection is only safe due to access modifier.
    Without it an attacker can submit bogus startBlock and endBlock to bypass
    block-based settlements. But it prevents refund replay racing conditions by using
    endBlock as a refund checkpoint.
    Moves funds so only callable by owner or a manger.
    */
    // solhint-disable-next-line function-max-lines
    function gasRefund(
        uint256[] calldata _startBlocks,
        uint256[] calldata _endBlocks,
        address[] calldata _recipients,
        uint256[] calldata _amounts
    ) external senderIsOwnerOrManager {
        // Checks

        for (uint256 i; i < _recipients.length; i++) {
            uint256 startBlock = _startBlocks[i];
            uint256 endBlock = _endBlocks[i];

            require(
                endBlock > startBlock,
                "FeeCollector.gasRefund: endBlock > startBlock"
            );

            if (confirmations > 0) {
                uint256 currentBlock = block.chainid == ARBITRUM_CHAINID ||
                    block.chainid == ARBITRUM_GOERLI_CHAINID
                    ? ArbSys(address(100)).arbBlockNumber()
                    : block.number;

                require(
                    currentBlock > endBlock + confirmations,
                    "FeeCollector.gasRefund: confirmations"
                );
            }

            uint256 prevRefundEndBlock = prevRefundEndBlockByExecutor[
                _recipients[i]
            ];

            if (prevRefundEndBlock > 0) {
                require(
                    startBlock == prevRefundEndBlock + 1,
                    "FeeCollector.gasRefund: already settled or missing blocks"
                );
            }

            // Effects
            prevRefundEndBlockByExecutor[_recipients[i]] = endBlock;

            // Interactions
            // If a single recipient reverts in the receive function, it would block the whole list
            payable(_recipients[i]).sendValue(_amounts[i]);

            emit LogGasRefund(
                startBlock,
                endBlock,
                _recipients[i],
                _amounts[i]
            );
        }
    }

    /**
    @dev transfer is used to transfer one or more tokens to one or more recipients.
    Tokens, recipients and amounts list lengths have to be equal except recipients
    which is allowed to also contain a recipient.
    Moves funds so only callable by owner or a manger.
    */
    function transfer(
        address[] calldata _tokens,
        address[] calldata _recipients,
        uint256[] calldata _amounts
    ) external senderIsOwnerOrManager {
        bool isSingle = _recipients.length == 1;

        require(
            isSingle || _recipients.length == _tokens.length,
            "FeeCollector.transfer: recipients length"
        );

        for (uint256 i; i < _tokens.length; i++) {
            address recipient = isSingle ? _recipients[0] : _recipients[i];

            _tokens[i] == NATIVE_TOKEN
                ? payable(recipient).sendValue(_amounts[i])
                : IERC20(_tokens[i]).safeTransfer(recipient, _amounts[i]);
        }

        emit LogTransfer(_tokens, _recipients, _amounts);
    }

    /**
    @dev transferAll is the same as transfer but transfers the total available amount.
    Moves funds so only callable by owner or a manger.
    */
    function transferAll(
        address[] calldata _tokens,
        address[] calldata _recipients
    ) external senderIsOwnerOrManager {
        bool isSingle = _recipients.length == 1;

        require(
            isSingle || _recipients.length == _tokens.length,
            "FeeCollector.transferAll: recipients length"
        );

        for (uint256 i; i < _tokens.length; i++) {
            address recipient = isSingle ? _recipients[0] : _recipients[i];

            _tokens[i] == NATIVE_TOKEN
                ? payable(recipient).sendValue(address(this).balance)
                : IERC20(_tokens[i]).safeTransfer(
                    recipient,
                    IERC20(_tokens[i]).balanceOf(address(this))
                );
        }

        emit LogTransferAll(_tokens, _recipients);
    }

    /// @dev Only the owner can add a manager
    function addManager(
        address _manager
    ) external onlyProxyAdmin returns (bool) {
        return _managers.add(_manager);
    }

    /// @dev Only the owner can remove a manager
    function removeManager(
        address _manager
    ) external onlyProxyAdmin returns (bool) {
        return _managers.remove(_manager);
    }

    function managerAt(uint256 _index) external view returns (address) {
        return _managers.at(_index);
    }

    function managers() external view returns (address[] memory) {
        return _managers.values();
    }

    function numberOfManagers() external view returns (uint256) {
        return _managers.length();
    }

    function isManager(address _manager) public view returns (bool) {
        return _managers.contains(_manager);
    }

    /**
     @dev getUnspentAllowances computes the leftover allowances on the given list
     of tokens.
     */
    function getUnspentAllowances(
        address[] calldata _tokens,
        address _lifiDiamond
    ) public view returns (uint256[] memory) {
        uint256[] memory unspentAllowances = new uint256[](_tokens.length);
        for (uint256 i; i < _tokens.length; i++) {
            unspentAllowances[i] = IERC20(_tokens[i]).allowance(
                address(this),
                address(_lifiDiamond)
            );
        }
        return unspentAllowances;
    }
}

File 2 of 12 : ArbSys.sol
// Copyright 2021-2022, Offchain Labs, Inc.
// For license information, see https://github.com/nitro/blob/master/LICENSE
// SPDX-License-Identifier: BUSL-1.1

pragma solidity >=0.4.21 <0.9.0;

/**
 * @title System level functionality
 * @notice For use by contracts to interact with core L2-specific functionality.
 * Precompiled contract that exists in every Arbitrum chain at address(100), 0x0000000000000000000000000000000000000064.
 */
interface ArbSys {
    /**
     * @notice Get Arbitrum block number (distinct from L1 block number; Arbitrum genesis block has block number 0)
     * @return block number as int
     */
    function arbBlockNumber() external view returns (uint256);

    /**
     * @notice Get Arbitrum block hash (reverts unless currentBlockNum-256 <= arbBlockNum < currentBlockNum)
     * @return block hash
     */
    function arbBlockHash(uint256 arbBlockNum) external view returns (bytes32);

    /**
     * @notice Gets the rollup's unique chain identifier
     * @return Chain identifier as int
     */
    function arbChainID() external view returns (uint256);

    /**
     * @notice Get internal version number identifying an ArbOS build
     * @return version number as int
     */
    function arbOSVersion() external view returns (uint256);

    /**
     * @notice Returns 0 since Nitro has no concept of storage gas
     * @return uint 0
     */
    function getStorageGasAvailable() external view returns (uint256);

    /**
     * @notice (deprecated) check if current call is top level (meaning it was triggered by an EoA or a L1 contract)
     * @dev this call has been deprecated and may be removed in a future release
     * @return true if current execution frame is not a call by another L2 contract
     */
    function isTopLevelCall() external view returns (bool);

    /**
     * @notice map L1 sender contract address to its L2 alias
     * @param sender sender address
     * @param unused argument no longer used
     * @return aliased sender address
     */
    function mapL1SenderContractAddressToL2Alias(address sender, address unused)
        external
        pure
        returns (address);

    /**
     * @notice check if the caller (of this caller of this) is an aliased L1 contract address
     * @return true iff the caller's address is an alias for an L1 contract address
     */
    function wasMyCallersAddressAliased() external view returns (bool);

    /**
     * @notice return the address of the caller (of this caller of this), without applying L1 contract address aliasing
     * @return address of the caller's caller, without applying L1 contract address aliasing
     */
    function myCallersAddressWithoutAliasing() external view returns (address);

    /**
     * @notice Send given amount of Eth to dest from sender.
     * This is a convenience function, which is equivalent to calling sendTxToL1 with empty data.
     * @param destination recipient address on L1
     * @return unique identifier for this L2-to-L1 transaction.
     */
    function withdrawEth(address destination) external payable returns (uint256);

    /**
     * @notice Send a transaction to L1
     * @dev it is not possible to execute on the L1 any L2-to-L1 transaction which contains data
     * to a contract address without any code (as enforced by the Bridge contract).
     * @param destination recipient address on L1
     * @param data (optional) calldata for L1 contract call
     * @return a unique identifier for this L2-to-L1 transaction.
     */
    function sendTxToL1(address destination, bytes calldata data)
        external
        payable
        returns (uint256);

    /**
     * @notice Get send Merkle tree state
     * @return size number of sends in the history
     * @return root root hash of the send history
     * @return partials hashes of partial subtrees in the send history tree
     */
    function sendMerkleTreeState()
        external
        view
        returns (
            uint256 size,
            bytes32 root,
            bytes32[] memory partials
        );

    /**
     * @notice creates a send txn from L2 to L1
     * @param position = (level << 192) + leaf = (0 << 192) + leaf = leaf
     */
    event L2ToL1Tx(
        address caller,
        address indexed destination,
        uint256 indexed hash,
        uint256 indexed position,
        uint256 arbBlockNum,
        uint256 ethBlockNum,
        uint256 timestamp,
        uint256 callvalue,
        bytes data
    );

    /// @dev DEPRECATED in favour of the new L2ToL1Tx event above after the nitro upgrade
    event L2ToL1Transaction(
        address caller,
        address indexed destination,
        uint256 indexed uniqueId,
        uint256 indexed batchNumber,
        uint256 indexInBatch,
        uint256 arbBlockNum,
        uint256 ethBlockNum,
        uint256 timestamp,
        uint256 callvalue,
        bytes data
    );

    /**
     * @notice logs a merkle branch for proof synthesis
     * @param reserved an index meant only to align the 4th index with L2ToL1Transaction's 4th event
     * @param hash the merkle hash
     * @param position = (level << 192) + leaf
     */
    event SendMerkleUpdate(
        uint256 indexed reserved,
        bytes32 indexed hash,
        uint256 indexed position
    );

    error InvalidBlockNumber(uint256 requested, uint256 current);
}

File 3 of 12 : Initializable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.1) (proxy/utils/Initializable.sol)

pragma solidity ^0.8.2;

import "../../utils/AddressUpgradeable.sol";

/**
 * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
 * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an
 * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
 * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
 *
 * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be
 * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in
 * case an upgrade adds a module that needs to be initialized.
 *
 * For example:
 *
 * [.hljs-theme-light.nopadding]
 * ```
 * contract MyToken is ERC20Upgradeable {
 *     function initialize() initializer public {
 *         __ERC20_init("MyToken", "MTK");
 *     }
 * }
 * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {
 *     function initializeV2() reinitializer(2) public {
 *         __ERC20Permit_init("MyToken");
 *     }
 * }
 * ```
 *
 * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
 * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
 *
 * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
 * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
 *
 * [CAUTION]
 * ====
 * Avoid leaving a contract uninitialized.
 *
 * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
 * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke
 * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:
 *
 * [.hljs-theme-light.nopadding]
 * ```
 * /// @custom:oz-upgrades-unsafe-allow constructor
 * constructor() {
 *     _disableInitializers();
 * }
 * ```
 * ====
 */
abstract contract Initializable {
    /**
     * @dev Indicates that the contract has been initialized.
     * @custom:oz-retyped-from bool
     */
    uint8 private _initialized;

    /**
     * @dev Indicates that the contract is in the process of being initialized.
     */
    bool private _initializing;

    /**
     * @dev Triggered when the contract has been initialized or reinitialized.
     */
    event Initialized(uint8 version);

    /**
     * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,
     * `onlyInitializing` functions can be used to initialize parent contracts.
     *
     * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a
     * constructor.
     *
     * Emits an {Initialized} event.
     */
    modifier initializer() {
        bool isTopLevelCall = !_initializing;
        require(
            (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),
            "Initializable: contract is already initialized"
        );
        _initialized = 1;
        if (isTopLevelCall) {
            _initializing = true;
        }
        _;
        if (isTopLevelCall) {
            _initializing = false;
            emit Initialized(1);
        }
    }

    /**
     * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the
     * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be
     * used to initialize parent contracts.
     *
     * A reinitializer may be used after the original initialization step. This is essential to configure modules that
     * are added through upgrades and that require initialization.
     *
     * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`
     * cannot be nested. If one is invoked in the context of another, execution will revert.
     *
     * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in
     * a contract, executing them in the right order is up to the developer or operator.
     *
     * WARNING: setting the version to 255 will prevent any future reinitialization.
     *
     * Emits an {Initialized} event.
     */
    modifier reinitializer(uint8 version) {
        require(!_initializing && _initialized < version, "Initializable: contract is already initialized");
        _initialized = version;
        _initializing = true;
        _;
        _initializing = false;
        emit Initialized(version);
    }

    /**
     * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
     * {initializer} and {reinitializer} modifiers, directly or indirectly.
     */
    modifier onlyInitializing() {
        require(_initializing, "Initializable: contract is not initializing");
        _;
    }

    /**
     * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.
     * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized
     * to any version. It is recommended to use this to lock implementation contracts that are designed to be called
     * through proxies.
     *
     * Emits an {Initialized} event the first time it is successfully executed.
     */
    function _disableInitializers() internal virtual {
        require(!_initializing, "Initializable: contract is initializing");
        if (_initialized < type(uint8).max) {
            _initialized = type(uint8).max;
            emit Initialized(type(uint8).max);
        }
    }

    /**
     * @dev Returns the highest version that has been initialized. See {reinitializer}.
     */
    function _getInitializedVersion() internal view returns (uint8) {
        return _initialized;
    }

    /**
     * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.
     */
    function _isInitializing() internal view returns (bool) {
        return _initializing;
    }
}

File 4 of 12 : AddressUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @dev Collection of functions related to the address type
 */
library AddressUpgradeable {
    /**
     * @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
     * ====
     *
     * [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://diligence.consensys.net/posts/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.5.11/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 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 5 of 12 : EnumerableSetUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/structs/EnumerableSet.sol)
// This file was procedurally generated from scripts/generate/templates/EnumerableSet.js.

pragma solidity ^0.8.0;

/**
 * @dev Library for managing
 * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
 * types.
 *
 * Sets have the following properties:
 *
 * - Elements are added, removed, and checked for existence in constant time
 * (O(1)).
 * - Elements are enumerated in O(n). No guarantees are made on the ordering.
 *
 * ```
 * contract Example {
 *     // Add the library methods
 *     using EnumerableSet for EnumerableSet.AddressSet;
 *
 *     // Declare a set state variable
 *     EnumerableSet.AddressSet private mySet;
 * }
 * ```
 *
 * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)
 * and `uint256` (`UintSet`) are supported.
 *
 * [WARNING]
 * ====
 * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure
 * unusable.
 * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.
 *
 * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an
 * array of EnumerableSet.
 * ====
 */
library EnumerableSetUpgradeable {
    // To implement this library for multiple types with as little code
    // repetition as possible, we write it in terms of a generic Set type with
    // bytes32 values.
    // The Set implementation uses private functions, and user-facing
    // implementations (such as AddressSet) are just wrappers around the
    // underlying Set.
    // This means that we can only create new EnumerableSets for types that fit
    // in bytes32.

    struct Set {
        // Storage of set values
        bytes32[] _values;
        // Position of the value in the `values` array, plus 1 because index 0
        // means a value is not in the set.
        mapping(bytes32 => uint256) _indexes;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function _add(Set storage set, bytes32 value) private returns (bool) {
        if (!_contains(set, value)) {
            set._values.push(value);
            // The value is stored at length-1, but we add 1 to all indexes
            // and use 0 as a sentinel value
            set._indexes[value] = set._values.length;
            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function _remove(Set storage set, bytes32 value) private returns (bool) {
        // We read and store the value's index to prevent multiple reads from the same storage slot
        uint256 valueIndex = set._indexes[value];

        if (valueIndex != 0) {
            // Equivalent to contains(set, value)
            // To delete an element from the _values array in O(1), we swap the element to delete with the last one in
            // the array, and then remove the last element (sometimes called as 'swap and pop').
            // This modifies the order of the array, as noted in {at}.

            uint256 toDeleteIndex = valueIndex - 1;
            uint256 lastIndex = set._values.length - 1;

            if (lastIndex != toDeleteIndex) {
                bytes32 lastValue = set._values[lastIndex];

                // Move the last value to the index where the value to delete is
                set._values[toDeleteIndex] = lastValue;
                // Update the index for the moved value
                set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex
            }

            // Delete the slot where the moved value was stored
            set._values.pop();

            // Delete the index for the deleted slot
            delete set._indexes[value];

            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function _contains(Set storage set, bytes32 value) private view returns (bool) {
        return set._indexes[value] != 0;
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function _length(Set storage set) private view returns (uint256) {
        return set._values.length;
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function _at(Set storage set, uint256 index) private view returns (bytes32) {
        return set._values[index];
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function _values(Set storage set) private view returns (bytes32[] memory) {
        return set._values;
    }

    // Bytes32Set

    struct Bytes32Set {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _add(set._inner, value);
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _remove(set._inner, value);
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {
        return _contains(set._inner, value);
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(Bytes32Set storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {
        return _at(set._inner, index);
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {
        bytes32[] memory store = _values(set._inner);
        bytes32[] memory result;

        /// @solidity memory-safe-assembly
        assembly {
            result := store
        }

        return result;
    }

    // AddressSet

    struct AddressSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(AddressSet storage set, address value) internal returns (bool) {
        return _add(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(AddressSet storage set, address value) internal returns (bool) {
        return _remove(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(AddressSet storage set, address value) internal view returns (bool) {
        return _contains(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(AddressSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(AddressSet storage set, uint256 index) internal view returns (address) {
        return address(uint160(uint256(_at(set._inner, index))));
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(AddressSet storage set) internal view returns (address[] memory) {
        bytes32[] memory store = _values(set._inner);
        address[] memory result;

        /// @solidity memory-safe-assembly
        assembly {
            result := store
        }

        return result;
    }

    // UintSet

    struct UintSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(UintSet storage set, uint256 value) internal returns (bool) {
        return _add(set._inner, bytes32(value));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(UintSet storage set, uint256 value) internal returns (bool) {
        return _remove(set._inner, bytes32(value));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(UintSet storage set, uint256 value) internal view returns (bool) {
        return _contains(set._inner, bytes32(value));
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(UintSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(UintSet storage set, uint256 index) internal view returns (uint256) {
        return uint256(_at(set._inner, index));
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(UintSet storage set) internal view returns (uint256[] memory) {
        bytes32[] memory store = _values(set._inner);
        uint256[] memory result;

        /// @solidity memory-safe-assembly
        assembly {
            result := store
        }

        return result;
    }
}

File 6 of 12 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.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 7 of 12 : draft-IERC20Permit.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-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 8 of 12 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";
import "../extensions/draft-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;

    function safeTransfer(
        IERC20 token,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

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

    function safeIncreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        uint256 newAllowance = token.allowance(address(this), spender) + value;
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    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");
            uint256 newAllowance = oldAllowance - value;
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
        }
    }

    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");
        if (returndata.length > 0) {
            // Return data is optional
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}

File 9 of 12 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.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
     * ====
     *
     * [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://diligence.consensys.net/posts/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.5.11/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 10 of 12 : ChainIds.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.19;

uint256 constant ARBITRUM_GOERLI_CHAINID = 421613;
uint256 constant ARBITRUM_CHAINID = 42161;

File 11 of 12 : Tokens.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.19;

address constant NATIVE_TOKEN = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;

File 12 of 12 : Proxied.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.19;

abstract contract Proxied {
    // solhint-disable-next-line max-line-length
    /// @notice to be used by initialisation / postUpgrade function so that only the proxy's admin can execute them
    /// It also allows these functions to be called inside a contructor
    /// even if the contract is meant to be used without proxy
    modifier proxied() {
        address proxyAdminAddress = _proxyAdmin();
        // With hardhat-deploy proxies
        // the proxyAdminAddress is zero only for the implementation contract
        // if the implementation contract want to be used as a standalone/immutable contract
        // it simply has to execute the `proxied` function
        // This ensure the proxyAdminAddress is never zero post deployment
        // And allow you to keep the same code for both proxied contract and immutable contract
        if (proxyAdminAddress == address(0)) {
            // ensure can not be called twice when used outside of proxy : no admin
            // solhint-disable-next-line security/no-inline-assembly
            assembly {
                sstore(
                    0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103,
                    0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
                )
            }
        } else {
            require(msg.sender == proxyAdminAddress);
        }
        _;
    }

    modifier onlyProxyAdmin() {
        require(msg.sender == _proxyAdmin(), "NOT_AUTHORIZED");
        _;
    }

    function _proxyAdmin() internal view returns (address ownerAddress) {
        // solhint-disable-next-line security/no-inline-assembly
        assembly {
            ownerAddress := sload(
                0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103
            )
        }
    }
}

Settings
{
  "evmVersion": "paris",
  "libraries": {},
  "metadata": {
    "bytecodeHash": "ipfs",
    "useLiteralContent": true
  },
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "remappings": [],
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  }
}

Contract Security Audit

Contract ABI

[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"srcChainId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"dstChainId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"LogBridge","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"startBlock","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"endBlock","type":"uint256"},{"indexed":false,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"LogGasRefund","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address[]","name":"tokens","type":"address[]"},{"indexed":false,"internalType":"address[]","name":"recipients","type":"address[]"},{"indexed":false,"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"name":"LogTransfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address[]","name":"tokens","type":"address[]"},{"indexed":false,"internalType":"address[]","name":"recipients","type":"address[]"}],"name":"LogTransferAll","type":"event"},{"inputs":[{"internalType":"address","name":"_manager","type":"address"}],"name":"addManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_srcToken","type":"address"},{"internalType":"uint256","name":"_srcChainId","type":"uint256"},{"internalType":"uint256","name":"_dstChainId","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address","name":"_lifiDiamond","type":"address"},{"internalType":"uint256","name":"_bridgeFee","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"bridgeViaLifi","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"confirmations","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_startBlocks","type":"uint256[]"},{"internalType":"uint256[]","name":"_endBlocks","type":"uint256[]"},{"internalType":"address[]","name":"_recipients","type":"address[]"},{"internalType":"uint256[]","name":"_amounts","type":"uint256[]"}],"name":"gasRefund","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_tokens","type":"address[]"},{"internalType":"address","name":"_lifiDiamond","type":"address"}],"name":"getUnspentAllowances","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_confirmations","type":"uint256"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_manager","type":"address"}],"name":"isManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_index","type":"uint256"}],"name":"managerAt","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"managers","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"numberOfManagers","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"executor","type":"address"}],"name":"prevRefundEndBlockByExecutor","outputs":[{"internalType":"uint256","name":"prevRefundEndBlock","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_manager","type":"address"}],"name":"removeManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_tokens","type":"address[]"},{"internalType":"address","name":"_lifiDiamond","type":"address"}],"name":"revokeUnspentAllowances","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_confirmations","type":"uint256"}],"name":"setConfirmations","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_tokens","type":"address[]"},{"internalType":"address[]","name":"_recipients","type":"address[]"},{"internalType":"uint256[]","name":"_amounts","type":"uint256[]"}],"name":"transfer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_tokens","type":"address[]"},{"internalType":"address[]","name":"_recipients","type":"address[]"}],"name":"transferAll","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405234801561001057600080fd5b506120a3806100206000396000f3fe608060405234801561001057600080fd5b50600436106101005760003560e01c80639a392ef911610097578063d14faf2c11610066578063d14faf2c14610215578063d75d711114610240578063f3ae241514610253578063fe4b84df1461026657600080fd5b80639a392ef9146101de5780639cf5d607146101e6578063ac18de43146101ef578063adc82ce61461020257600080fd5b806356f99cba116100d357806356f99cba146101905780637111a994146101a357806372311705146101b65780638ac553b1146101cb57600080fd5b80630684f25314610105578063122fe812146101385780632d06177a1461014d5780633ed25c6714610170575b600080fd5b6101256101133660046119df565b60046020526000908152604090205481565b6040519081526020015b60405180910390f35b61014b610146366004611a46565b610279565b005b61016061015b3660046119df565b610331565b604051901515815260200161012f565b61018361017e366004611a46565b61038c565b60405161012f9190611a9a565b61014b61019e366004611ade565b6104b1565b61014b6101b1366004611af7565b6104f6565b6101be61074e565b60405161012f9190611b91565b61014b6101d9366004611bd2565b61075f565b610125610977565b61012560035481565b6101606101fd3660046119df565b610983565b61014b610210366004611c8c565b6109d6565b610228610223366004611ade565b610de7565b6040516001600160a01b03909116815260200161012f565b61014b61024e366004611d50565b610df4565b6101606102613660046119df565b61107b565b61014b610274366004611ade565b611088565b60008051602061204e833981519152546001600160a01b0316336001600160a01b031614806102ac57506102ac3361107b565b6102d15760405162461bcd60e51b81526004016102c890611dbc565b60405180910390fd5b60005b8281101561032b576103198260008686858181106102f4576102f4611dff565b905060200201602081019061030991906119df565b6001600160a01b031691906111d7565b8061032381611e2b565b9150506102d4565b50505050565b600061034960008051602061204e8339815191525490565b6001600160a01b0316336001600160a01b0316146103795760405162461bcd60e51b81526004016102c890611e44565b610384600183611324565b90505b919050565b606060008367ffffffffffffffff8111156103a9576103a9611e6c565b6040519080825280602002602001820160405280156103d2578160200160208202803683370190505b50905060005b848110156104a8578585828181106103f2576103f2611dff565b905060200201602081019061040791906119df565b604051636eb1769f60e11b81523060048201526001600160a01b038681166024830152919091169063dd62ed3e90604401602060405180830381865afa158015610455573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104799190611e82565b82828151811061048b5761048b611dff565b6020908102919091010152806104a081611e2b565b9150506103d8565b50949350505050565b60008051602061204e833981519152546001600160a01b0316336001600160a01b0316146104f15760405162461bcd60e51b81526004016102c890611e44565b600355565b60008051602061204e833981519152546001600160a01b0316336001600160a01b0316148061052957506105293361107b565b6105455760405162461bcd60e51b81526004016102c890611dbc565b60018314808061055457508386145b6105b15760405162461bcd60e51b815260206004820152602860248201527f466565436f6c6c6563746f722e7472616e736665723a20726563697069656e746044820152670e640d8cadccee8d60c31b60648201526084016102c8565b60005b86811015610703576000826105ef578686838181106105d5576105d5611dff565b90506020020160208101906105ea91906119df565b610617565b8686600081811061060257610602611dff565b905060200201602081019061061791906119df565b905073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee89898481811061064057610640611dff565b905060200201602081019061065591906119df565b6001600160a01b0316146106bc576106b78186868581811061067957610679611dff565b905060200201358b8b8681811061069257610692611dff565b90506020020160208101906106a791906119df565b6001600160a01b03169190611342565b6106f0565b6106f08585848181106106d1576106d1611dff565b90506020020135826001600160a01b031661137290919063ffffffff16565b50806106fb81611e2b565b9150506105b4565b507f8ecdde7571dcec5678a7037857bdcc0e44aa64ce654b2d97305fa79f71eaf71b87878787878760405161073d96959493929190611ee2565b60405180910390a150505050505050565b606061075a600161148b565b905090565b60008051602061204e833981519152546001600160a01b0316336001600160a01b0316148061079257506107923361107b565b6107ae5760405162461bcd60e51b81526004016102c890611dbc565b6001600160a01b0384166108155760405162461bcd60e51b815260206004820152602860248201527f466565436f6c6c6563746f722e6272696467655669614c6966693a207a65726f604482015267206164647265737360c01b60648201526084016102c8565b6001600160a01b03881673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee148061084e5761084e6001600160a01b038a16868861149f565b6000856001600160a01b0316826108655785610867565b875b8585604051610877929190611f45565b60006040518083038185875af1925050503d80600081146108b4576040519150601f19603f3d011682016040523d82523d6000602084013e6108b9565b606091505b505090508061091a5760405162461bcd60e51b815260206004820152602760248201527f466565436f6c6c6563746f722e6272696467655669614c6966693a2063616c6c6044820152660819985a5b195960ca1b60648201526084016102c8565b604080516001600160a01b038c168152602081018b9052908101899052606081018890527fed26373d969e2f9fa3dc6a220dac4aafd2d33c3ea01f0aff1329538ef98ca2e89060800160405180910390a150505050505050505050565b600061075a6001611551565b600061099b60008051602061204e8339815191525490565b6001600160a01b0316336001600160a01b0316146109cb5760405162461bcd60e51b81526004016102c890611e44565b61038460018361155b565b60008051602061204e833981519152546001600160a01b0316336001600160a01b03161480610a095750610a093361107b565b610a255760405162461bcd60e51b81526004016102c890611dbc565b60005b83811015610ddc576000898983818110610a4457610a44611dff565b9050602002013590506000888884818110610a6157610a61611dff565b905060200201359050818111610acf5760405162461bcd60e51b815260206004820152602d60248201527f466565436f6c6c6563746f722e676173526566756e643a20656e64426c6f636b60448201526c203e207374617274426c6f636b60981b60648201526084016102c8565b60035415610bc657600061a4b1461480610aeb575062066eed46145b610af55743610b58565b60646001600160a01b031663a3b1b31d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b34573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b589190611e82565b905060035482610b689190611f55565b8111610bc45760405162461bcd60e51b815260206004820152602560248201527f466565436f6c6c6563746f722e676173526566756e643a20636f6e6669726d6160448201526474696f6e7360d81b60648201526084016102c8565b505b600060046000898987818110610bde57610bde611dff565b9050602002016020810190610bf391906119df565b6001600160a01b0316815260208101919091526040016000205490508015610c9457610c20816001611f55565b8314610c945760405162461bcd60e51b815260206004820152603960248201527f466565436f6c6c6563746f722e676173526566756e643a20616c72656164792060448201527f736574746c6564206f72206d697373696e6720626c6f636b730000000000000060648201526084016102c8565b81600460008a8a88818110610cab57610cab611dff565b9050602002016020810190610cc091906119df565b6001600160a01b03168152602081019190915260400160002055610d2c868686818110610cef57610cef611dff565b90506020020135898987818110610d0857610d08611dff565b9050602002016020810190610d1d91906119df565b6001600160a01b031690611372565b7f6569974c4bb346f46d6536e1505a53ad0e8e63a6a21e3d33eb6ca334f2d5c7ca83838a8a88818110610d6157610d61611dff565b9050602002016020810190610d7691906119df565b898989818110610d8857610d88611dff565b90506020020135604051610dbe949392919093845260208401929092526001600160a01b03166040830152606082015260800190565b60405180910390a15050508080610dd490611e2b565b915050610a28565b505050505050505050565b6000610384600183611570565b60008051602061204e833981519152546001600160a01b0316336001600160a01b03161480610e275750610e273361107b565b610e435760405162461bcd60e51b81526004016102c890611dbc565b600181148080610e5257508184145b610eb25760405162461bcd60e51b815260206004820152602b60248201527f466565436f6c6c6563746f722e7472616e73666572416c6c3a2072656369706960448201526a0cadce8e640d8cadccee8d60ab1b60648201526084016102c8565b60005b8481101561103657600082610ef057848483818110610ed657610ed6611dff565b9050602002016020810190610eeb91906119df565b610f18565b84846000818110610f0357610f03611dff565b9050602002016020810190610f1891906119df565b905073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee878784818110610f4157610f41611dff565b9050602002016020810190610f5691906119df565b6001600160a01b0316146110105761100b81888885818110610f7a57610f7a611dff565b9050602002016020810190610f8f91906119df565b6040516370a0823160e01b81523060048201526001600160a01b0391909116906370a0823190602401602060405180830381865afa158015610fd5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ff99190611e82565b89898681811061069257610692611dff565b611023565b6110236001600160a01b03821647611372565b508061102e81611e2b565b915050610eb5565b507f38db5c942c15ef725780f2eacdaa5a98eb35839ee1bd3e092c77c63479668ba08585858560405161106c9493929190611f68565b60405180910390a15050505050565b600061038460018361157c565b60008051602061204e833981519152546001600160a01b0316336001600160a01b0316146110c85760405162461bcd60e51b81526004016102c890611e44565b600054610100900460ff16158080156110e85750600054600160ff909116105b806111025750303b158015611102575060005460ff166001145b6111655760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016102c8565b6000805460ff191660011790558015611188576000805461ff0019166101001790555b600382905580156111d3576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050565b8015806112515750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e90604401602060405180830381865afa15801561122b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061124f9190611e82565b155b6112bc5760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b60648201526084016102c8565b6040516001600160a01b03831660248201526044810182905261131f90849063095ea7b360e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915261159e565b505050565b6000611339836001600160a01b038416611670565b90505b92915050565b6040516001600160a01b03831660248201526044810182905261131f90849063a9059cbb60e01b906064016112e8565b804710156113c25760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e636500000060448201526064016102c8565b6000826001600160a01b03168260405160006040518083038185875af1925050503d806000811461140f576040519150601f19603f3d011682016040523d82523d6000602084013e611414565b606091505b505090508061131f5760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d6179206861766520726576657274656400000000000060648201526084016102c8565b60606000611498836116bf565b9392505050565b604051636eb1769f60e11b81523060048201526001600160a01b038381166024830152600091839186169063dd62ed3e90604401602060405180830381865afa1580156114f0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115149190611e82565b61151e9190611f55565b6040516001600160a01b03851660248201526044810182905290915061032b90859063095ea7b360e01b906064016112e8565b6000610384825490565b6000611339836001600160a01b03841661171b565b6000611339838361180e565b6001600160a01b03811660009081526001830160205260408120541515611339565b60006115f3826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166118389092919063ffffffff16565b80519091501561131f57808060200190518101906116119190611f8f565b61131f5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016102c8565b60008181526001830160205260408120546116b75750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915561133c565b50600061133c565b60608160000180548060200260200160405190810160405280929190818152602001828054801561170f57602002820191906000526020600020905b8154815260200190600101908083116116fb575b50505050509050919050565b6000818152600183016020526040812054801561180457600061173f600183611fb1565b855490915060009061175390600190611fb1565b90508181146117b857600086600001828154811061177357611773611dff565b906000526020600020015490508087600001848154811061179657611796611dff565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806117c9576117c9611fc4565b60019003818190600052602060002001600090559055856001016000868152602001908152602001600020600090556001935050505061133c565b600091505061133c565b600082600001828154811061182557611825611dff565b9060005260206000200154905092915050565b6060611847848460008561184f565b949350505050565b6060824710156118b05760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016102c8565b600080866001600160a01b031685876040516118cc9190611ffe565b60006040518083038185875af1925050503d8060008114611909576040519150601f19603f3d011682016040523d82523d6000602084013e61190e565b606091505b509150915061191f8783838761192a565b979650505050505050565b60608315611999578251600003611992576001600160a01b0385163b6119925760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016102c8565b5081611847565b61184783838151156119ae5781518083602001fd5b8060405162461bcd60e51b81526004016102c8919061201a565b80356001600160a01b038116811461038757600080fd5b6000602082840312156119f157600080fd5b611339826119c8565b60008083601f840112611a0c57600080fd5b50813567ffffffffffffffff811115611a2457600080fd5b6020830191508360208260051b8501011115611a3f57600080fd5b9250929050565b600080600060408486031215611a5b57600080fd5b833567ffffffffffffffff811115611a7257600080fd5b611a7e868287016119fa565b9094509250611a919050602085016119c8565b90509250925092565b6020808252825182820181905260009190848201906040850190845b81811015611ad257835183529284019291840191600101611ab6565b50909695505050505050565b600060208284031215611af057600080fd5b5035919050565b60008060008060008060608789031215611b1057600080fd5b863567ffffffffffffffff80821115611b2857600080fd5b611b348a838b016119fa565b90985096506020890135915080821115611b4d57600080fd5b611b598a838b016119fa565b90965094506040890135915080821115611b7257600080fd5b50611b7f89828a016119fa565b979a9699509497509295939492505050565b6020808252825182820181905260009190848201906040850190845b81811015611ad25783516001600160a01b031683529284019291840191600101611bad565b60008060008060008060008060e0898b031215611bee57600080fd5b611bf7896119c8565b9750602089013596506040890135955060608901359450611c1a60808a016119c8565b935060a0890135925060c089013567ffffffffffffffff80821115611c3e57600080fd5b818b0191508b601f830112611c5257600080fd5b813581811115611c6157600080fd5b8c6020828501011115611c7357600080fd5b6020830194508093505050509295985092959890939650565b6000806000806000806000806080898b031215611ca857600080fd5b883567ffffffffffffffff80821115611cc057600080fd5b611ccc8c838d016119fa565b909a50985060208b0135915080821115611ce557600080fd5b611cf18c838d016119fa565b909850965060408b0135915080821115611d0a57600080fd5b611d168c838d016119fa565b909650945060608b0135915080821115611d2f57600080fd5b50611d3c8b828c016119fa565b999c989b5096995094979396929594505050565b60008060008060408587031215611d6657600080fd5b843567ffffffffffffffff80821115611d7e57600080fd5b611d8a888389016119fa565b90965094506020870135915080821115611da357600080fd5b50611db0878288016119fa565b95989497509550505050565b60208082526023908201527f466565436f6c6c6563746f722e73656e64657249734f776e65724f724d616e6160408201526233b2b960e91b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201611e3d57611e3d611e15565b5060010190565b6020808252600e908201526d1393d517d055551213d49256915160921b604082015260600190565b634e487b7160e01b600052604160045260246000fd5b600060208284031215611e9457600080fd5b5051919050565b8183526000602080850194508260005b85811015611ed7576001600160a01b03611ec4836119c8565b1687529582019590820190600101611eab565b509495945050505050565b606081526000611ef660608301888a611e9b565b8281036020840152611f09818789611e9b565b838103604085015284815290506001600160fb1b03841115611f2a57600080fd5b8360051b808660208401370160200198975050505050505050565b8183823760009101908152919050565b8082018082111561133c5761133c611e15565b604081526000611f7c604083018688611e9b565b828103602084015261191f818587611e9b565b600060208284031215611fa157600080fd5b8151801515811461149857600080fd5b8181038181111561133c5761133c611e15565b634e487b7160e01b600052603160045260246000fd5b60005b83811015611ff5578181015183820152602001611fdd565b50506000910152565b60008251612010818460208701611fda565b9190910192915050565b6020815260008251806020840152612039816040850160208701611fda565b601f01601f1916919091016040019291505056feb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103a2646970667358221220138eea6de393be993e2d8ee677cd83661417043ec289d83da13f1bfbabf6fa8264736f6c63430008130033

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101005760003560e01c80639a392ef911610097578063d14faf2c11610066578063d14faf2c14610215578063d75d711114610240578063f3ae241514610253578063fe4b84df1461026657600080fd5b80639a392ef9146101de5780639cf5d607146101e6578063ac18de43146101ef578063adc82ce61461020257600080fd5b806356f99cba116100d357806356f99cba146101905780637111a994146101a357806372311705146101b65780638ac553b1146101cb57600080fd5b80630684f25314610105578063122fe812146101385780632d06177a1461014d5780633ed25c6714610170575b600080fd5b6101256101133660046119df565b60046020526000908152604090205481565b6040519081526020015b60405180910390f35b61014b610146366004611a46565b610279565b005b61016061015b3660046119df565b610331565b604051901515815260200161012f565b61018361017e366004611a46565b61038c565b60405161012f9190611a9a565b61014b61019e366004611ade565b6104b1565b61014b6101b1366004611af7565b6104f6565b6101be61074e565b60405161012f9190611b91565b61014b6101d9366004611bd2565b61075f565b610125610977565b61012560035481565b6101606101fd3660046119df565b610983565b61014b610210366004611c8c565b6109d6565b610228610223366004611ade565b610de7565b6040516001600160a01b03909116815260200161012f565b61014b61024e366004611d50565b610df4565b6101606102613660046119df565b61107b565b61014b610274366004611ade565b611088565b60008051602061204e833981519152546001600160a01b0316336001600160a01b031614806102ac57506102ac3361107b565b6102d15760405162461bcd60e51b81526004016102c890611dbc565b60405180910390fd5b60005b8281101561032b576103198260008686858181106102f4576102f4611dff565b905060200201602081019061030991906119df565b6001600160a01b031691906111d7565b8061032381611e2b565b9150506102d4565b50505050565b600061034960008051602061204e8339815191525490565b6001600160a01b0316336001600160a01b0316146103795760405162461bcd60e51b81526004016102c890611e44565b610384600183611324565b90505b919050565b606060008367ffffffffffffffff8111156103a9576103a9611e6c565b6040519080825280602002602001820160405280156103d2578160200160208202803683370190505b50905060005b848110156104a8578585828181106103f2576103f2611dff565b905060200201602081019061040791906119df565b604051636eb1769f60e11b81523060048201526001600160a01b038681166024830152919091169063dd62ed3e90604401602060405180830381865afa158015610455573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104799190611e82565b82828151811061048b5761048b611dff565b6020908102919091010152806104a081611e2b565b9150506103d8565b50949350505050565b60008051602061204e833981519152546001600160a01b0316336001600160a01b0316146104f15760405162461bcd60e51b81526004016102c890611e44565b600355565b60008051602061204e833981519152546001600160a01b0316336001600160a01b0316148061052957506105293361107b565b6105455760405162461bcd60e51b81526004016102c890611dbc565b60018314808061055457508386145b6105b15760405162461bcd60e51b815260206004820152602860248201527f466565436f6c6c6563746f722e7472616e736665723a20726563697069656e746044820152670e640d8cadccee8d60c31b60648201526084016102c8565b60005b86811015610703576000826105ef578686838181106105d5576105d5611dff565b90506020020160208101906105ea91906119df565b610617565b8686600081811061060257610602611dff565b905060200201602081019061061791906119df565b905073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee89898481811061064057610640611dff565b905060200201602081019061065591906119df565b6001600160a01b0316146106bc576106b78186868581811061067957610679611dff565b905060200201358b8b8681811061069257610692611dff565b90506020020160208101906106a791906119df565b6001600160a01b03169190611342565b6106f0565b6106f08585848181106106d1576106d1611dff565b90506020020135826001600160a01b031661137290919063ffffffff16565b50806106fb81611e2b565b9150506105b4565b507f8ecdde7571dcec5678a7037857bdcc0e44aa64ce654b2d97305fa79f71eaf71b87878787878760405161073d96959493929190611ee2565b60405180910390a150505050505050565b606061075a600161148b565b905090565b60008051602061204e833981519152546001600160a01b0316336001600160a01b0316148061079257506107923361107b565b6107ae5760405162461bcd60e51b81526004016102c890611dbc565b6001600160a01b0384166108155760405162461bcd60e51b815260206004820152602860248201527f466565436f6c6c6563746f722e6272696467655669614c6966693a207a65726f604482015267206164647265737360c01b60648201526084016102c8565b6001600160a01b03881673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee148061084e5761084e6001600160a01b038a16868861149f565b6000856001600160a01b0316826108655785610867565b875b8585604051610877929190611f45565b60006040518083038185875af1925050503d80600081146108b4576040519150601f19603f3d011682016040523d82523d6000602084013e6108b9565b606091505b505090508061091a5760405162461bcd60e51b815260206004820152602760248201527f466565436f6c6c6563746f722e6272696467655669614c6966693a2063616c6c6044820152660819985a5b195960ca1b60648201526084016102c8565b604080516001600160a01b038c168152602081018b9052908101899052606081018890527fed26373d969e2f9fa3dc6a220dac4aafd2d33c3ea01f0aff1329538ef98ca2e89060800160405180910390a150505050505050505050565b600061075a6001611551565b600061099b60008051602061204e8339815191525490565b6001600160a01b0316336001600160a01b0316146109cb5760405162461bcd60e51b81526004016102c890611e44565b61038460018361155b565b60008051602061204e833981519152546001600160a01b0316336001600160a01b03161480610a095750610a093361107b565b610a255760405162461bcd60e51b81526004016102c890611dbc565b60005b83811015610ddc576000898983818110610a4457610a44611dff565b9050602002013590506000888884818110610a6157610a61611dff565b905060200201359050818111610acf5760405162461bcd60e51b815260206004820152602d60248201527f466565436f6c6c6563746f722e676173526566756e643a20656e64426c6f636b60448201526c203e207374617274426c6f636b60981b60648201526084016102c8565b60035415610bc657600061a4b1461480610aeb575062066eed46145b610af55743610b58565b60646001600160a01b031663a3b1b31d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b34573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b589190611e82565b905060035482610b689190611f55565b8111610bc45760405162461bcd60e51b815260206004820152602560248201527f466565436f6c6c6563746f722e676173526566756e643a20636f6e6669726d6160448201526474696f6e7360d81b60648201526084016102c8565b505b600060046000898987818110610bde57610bde611dff565b9050602002016020810190610bf391906119df565b6001600160a01b0316815260208101919091526040016000205490508015610c9457610c20816001611f55565b8314610c945760405162461bcd60e51b815260206004820152603960248201527f466565436f6c6c6563746f722e676173526566756e643a20616c72656164792060448201527f736574746c6564206f72206d697373696e6720626c6f636b730000000000000060648201526084016102c8565b81600460008a8a88818110610cab57610cab611dff565b9050602002016020810190610cc091906119df565b6001600160a01b03168152602081019190915260400160002055610d2c868686818110610cef57610cef611dff565b90506020020135898987818110610d0857610d08611dff565b9050602002016020810190610d1d91906119df565b6001600160a01b031690611372565b7f6569974c4bb346f46d6536e1505a53ad0e8e63a6a21e3d33eb6ca334f2d5c7ca83838a8a88818110610d6157610d61611dff565b9050602002016020810190610d7691906119df565b898989818110610d8857610d88611dff565b90506020020135604051610dbe949392919093845260208401929092526001600160a01b03166040830152606082015260800190565b60405180910390a15050508080610dd490611e2b565b915050610a28565b505050505050505050565b6000610384600183611570565b60008051602061204e833981519152546001600160a01b0316336001600160a01b03161480610e275750610e273361107b565b610e435760405162461bcd60e51b81526004016102c890611dbc565b600181148080610e5257508184145b610eb25760405162461bcd60e51b815260206004820152602b60248201527f466565436f6c6c6563746f722e7472616e73666572416c6c3a2072656369706960448201526a0cadce8e640d8cadccee8d60ab1b60648201526084016102c8565b60005b8481101561103657600082610ef057848483818110610ed657610ed6611dff565b9050602002016020810190610eeb91906119df565b610f18565b84846000818110610f0357610f03611dff565b9050602002016020810190610f1891906119df565b905073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee878784818110610f4157610f41611dff565b9050602002016020810190610f5691906119df565b6001600160a01b0316146110105761100b81888885818110610f7a57610f7a611dff565b9050602002016020810190610f8f91906119df565b6040516370a0823160e01b81523060048201526001600160a01b0391909116906370a0823190602401602060405180830381865afa158015610fd5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ff99190611e82565b89898681811061069257610692611dff565b611023565b6110236001600160a01b03821647611372565b508061102e81611e2b565b915050610eb5565b507f38db5c942c15ef725780f2eacdaa5a98eb35839ee1bd3e092c77c63479668ba08585858560405161106c9493929190611f68565b60405180910390a15050505050565b600061038460018361157c565b60008051602061204e833981519152546001600160a01b0316336001600160a01b0316146110c85760405162461bcd60e51b81526004016102c890611e44565b600054610100900460ff16158080156110e85750600054600160ff909116105b806111025750303b158015611102575060005460ff166001145b6111655760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016102c8565b6000805460ff191660011790558015611188576000805461ff0019166101001790555b600382905580156111d3576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050565b8015806112515750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e90604401602060405180830381865afa15801561122b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061124f9190611e82565b155b6112bc5760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b60648201526084016102c8565b6040516001600160a01b03831660248201526044810182905261131f90849063095ea7b360e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915261159e565b505050565b6000611339836001600160a01b038416611670565b90505b92915050565b6040516001600160a01b03831660248201526044810182905261131f90849063a9059cbb60e01b906064016112e8565b804710156113c25760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e636500000060448201526064016102c8565b6000826001600160a01b03168260405160006040518083038185875af1925050503d806000811461140f576040519150601f19603f3d011682016040523d82523d6000602084013e611414565b606091505b505090508061131f5760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d6179206861766520726576657274656400000000000060648201526084016102c8565b60606000611498836116bf565b9392505050565b604051636eb1769f60e11b81523060048201526001600160a01b038381166024830152600091839186169063dd62ed3e90604401602060405180830381865afa1580156114f0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115149190611e82565b61151e9190611f55565b6040516001600160a01b03851660248201526044810182905290915061032b90859063095ea7b360e01b906064016112e8565b6000610384825490565b6000611339836001600160a01b03841661171b565b6000611339838361180e565b6001600160a01b03811660009081526001830160205260408120541515611339565b60006115f3826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166118389092919063ffffffff16565b80519091501561131f57808060200190518101906116119190611f8f565b61131f5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016102c8565b60008181526001830160205260408120546116b75750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915561133c565b50600061133c565b60608160000180548060200260200160405190810160405280929190818152602001828054801561170f57602002820191906000526020600020905b8154815260200190600101908083116116fb575b50505050509050919050565b6000818152600183016020526040812054801561180457600061173f600183611fb1565b855490915060009061175390600190611fb1565b90508181146117b857600086600001828154811061177357611773611dff565b906000526020600020015490508087600001848154811061179657611796611dff565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806117c9576117c9611fc4565b60019003818190600052602060002001600090559055856001016000868152602001908152602001600020600090556001935050505061133c565b600091505061133c565b600082600001828154811061182557611825611dff565b9060005260206000200154905092915050565b6060611847848460008561184f565b949350505050565b6060824710156118b05760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016102c8565b600080866001600160a01b031685876040516118cc9190611ffe565b60006040518083038185875af1925050503d8060008114611909576040519150601f19603f3d011682016040523d82523d6000602084013e61190e565b606091505b509150915061191f8783838761192a565b979650505050505050565b60608315611999578251600003611992576001600160a01b0385163b6119925760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016102c8565b5081611847565b61184783838151156119ae5781518083602001fd5b8060405162461bcd60e51b81526004016102c8919061201a565b80356001600160a01b038116811461038757600080fd5b6000602082840312156119f157600080fd5b611339826119c8565b60008083601f840112611a0c57600080fd5b50813567ffffffffffffffff811115611a2457600080fd5b6020830191508360208260051b8501011115611a3f57600080fd5b9250929050565b600080600060408486031215611a5b57600080fd5b833567ffffffffffffffff811115611a7257600080fd5b611a7e868287016119fa565b9094509250611a919050602085016119c8565b90509250925092565b6020808252825182820181905260009190848201906040850190845b81811015611ad257835183529284019291840191600101611ab6565b50909695505050505050565b600060208284031215611af057600080fd5b5035919050565b60008060008060008060608789031215611b1057600080fd5b863567ffffffffffffffff80821115611b2857600080fd5b611b348a838b016119fa565b90985096506020890135915080821115611b4d57600080fd5b611b598a838b016119fa565b90965094506040890135915080821115611b7257600080fd5b50611b7f89828a016119fa565b979a9699509497509295939492505050565b6020808252825182820181905260009190848201906040850190845b81811015611ad25783516001600160a01b031683529284019291840191600101611bad565b60008060008060008060008060e0898b031215611bee57600080fd5b611bf7896119c8565b9750602089013596506040890135955060608901359450611c1a60808a016119c8565b935060a0890135925060c089013567ffffffffffffffff80821115611c3e57600080fd5b818b0191508b601f830112611c5257600080fd5b813581811115611c6157600080fd5b8c6020828501011115611c7357600080fd5b6020830194508093505050509295985092959890939650565b6000806000806000806000806080898b031215611ca857600080fd5b883567ffffffffffffffff80821115611cc057600080fd5b611ccc8c838d016119fa565b909a50985060208b0135915080821115611ce557600080fd5b611cf18c838d016119fa565b909850965060408b0135915080821115611d0a57600080fd5b611d168c838d016119fa565b909650945060608b0135915080821115611d2f57600080fd5b50611d3c8b828c016119fa565b999c989b5096995094979396929594505050565b60008060008060408587031215611d6657600080fd5b843567ffffffffffffffff80821115611d7e57600080fd5b611d8a888389016119fa565b90965094506020870135915080821115611da357600080fd5b50611db0878288016119fa565b95989497509550505050565b60208082526023908201527f466565436f6c6c6563746f722e73656e64657249734f776e65724f724d616e6160408201526233b2b960e91b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201611e3d57611e3d611e15565b5060010190565b6020808252600e908201526d1393d517d055551213d49256915160921b604082015260600190565b634e487b7160e01b600052604160045260246000fd5b600060208284031215611e9457600080fd5b5051919050565b8183526000602080850194508260005b85811015611ed7576001600160a01b03611ec4836119c8565b1687529582019590820190600101611eab565b509495945050505050565b606081526000611ef660608301888a611e9b565b8281036020840152611f09818789611e9b565b838103604085015284815290506001600160fb1b03841115611f2a57600080fd5b8360051b808660208401370160200198975050505050505050565b8183823760009101908152919050565b8082018082111561133c5761133c611e15565b604081526000611f7c604083018688611e9b565b828103602084015261191f818587611e9b565b600060208284031215611fa157600080fd5b8151801515811461149857600080fd5b8181038181111561133c5761133c611e15565b634e487b7160e01b600052603160045260246000fd5b60005b83811015611ff5578181015183820152602001611fdd565b50506000910152565b60008251612010818460208701611fda565b9190910192915050565b6020815260008251806020840152612039816040850160208701611fda565b601f01601f1916919091016040019291505056feb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103a2646970667358221220138eea6de393be993e2d8ee677cd83661417043ec289d83da13f1bfbabf6fa8264736f6c63430008130033

Block Transaction Difficulty 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
Loading...
Loading
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.