ETH Price: $3,073.81 (+2.71%)
Gas: 8 Gwei

Contract

0x4D9079Bb4165aeb4084c526a32695dCfd2F77381
 
Transaction Hash
Method
Block
From
To
Value
Deposit184302752023-10-25 22:38:23190 days ago1698273503IN
Across Protocol: Old Ethereum Spoke Pool V2
0.0079 ETH0.0006706521.8354507
Deposit177387822023-07-21 3:16:23287 days ago1689909383IN
Across Protocol: Old Ethereum Spoke Pool V2
0.008 ETH0.0007008322.81807033
Deposit174525152023-06-10 21:44:35327 days ago1686433475IN
Across Protocol: Old Ethereum Spoke Pool V2
0.00346822 ETH0.0004632414.85420906
Transfer171892132023-05-04 18:54:59364 days ago1683226499IN
Across Protocol: Old Ethereum Spoke Pool V2
0.08 ETH0.0016732979.47237534
Execute Relayer ...171255482023-04-25 20:07:59373 days ago1682453279IN
Across Protocol: Old Ethereum Spoke Pool V2
0 ETH0.006664738.8173466
Fill Relay171238412023-04-25 14:22:59374 days ago1682432579IN
Across Protocol: Old Ethereum Spoke Pool V2
0 ETH0.0043687747.14026775
Fill Relay171238112023-04-25 14:16:59374 days ago1682432219IN
Across Protocol: Old Ethereum Spoke Pool V2
0 ETH0.004254145.90297473
Fill Relay171237802023-04-25 14:10:47374 days ago1682431847IN
Across Protocol: Old Ethereum Spoke Pool V2
0 ETH0.0038947142.0304567
Fill Relay171237162023-04-25 13:57:47374 days ago1682431067IN
Across Protocol: Old Ethereum Spoke Pool V2
0 ETH0.0036564639.45432614
Deposit171236422023-04-25 13:42:59374 days ago1682430179IN
Across Protocol: Old Ethereum Spoke Pool V2
0.5 ETH0.0020704937.93924946
Deposit171236262023-04-25 13:39:47374 days ago1682429987IN
Across Protocol: Old Ethereum Spoke Pool V2
0 ETH0.002940141.56036776
Fill Relay171236032023-04-25 13:35:11374 days ago1682429711IN
Across Protocol: Old Ethereum Spoke Pool V2
0 ETH0.0038042541.05430485
Deposit171235822023-04-25 13:30:47374 days ago1682429447IN
Across Protocol: Old Ethereum Spoke Pool V2
0.84759551 ETH0.0023153842.41727919
Fill Relay171235772023-04-25 13:29:47374 days ago1682429387IN
Across Protocol: Old Ethereum Spoke Pool V2
0 ETH0.0035355838.1549099
Fill Relay171235752023-04-25 13:29:23374 days ago1682429363IN
Across Protocol: Old Ethereum Spoke Pool V2
0 ETH0.0035870938.68574482
Deposit171235192023-04-25 13:18:11374 days ago1682428691IN
Across Protocol: Old Ethereum Spoke Pool V2
0 ETH0.0029693145.01216865
Fill Relay171235162023-04-25 13:17:35374 days ago1682428655IN
Across Protocol: Old Ethereum Spoke Pool V2
0 ETH0.0044787848.30235691
Fill Relay171235062023-04-25 13:15:35374 days ago1682428535IN
Across Protocol: Old Ethereum Spoke Pool V2
0 ETH0.0045480349.08729861
Fill Relay171234982023-04-25 13:13:59374 days ago1682428439IN
Across Protocol: Old Ethereum Spoke Pool V2
0 ETH0.0049928751.89185691
Fill Relay171234912023-04-25 13:12:35374 days ago1682428355IN
Across Protocol: Old Ethereum Spoke Pool V2
0 ETH0.007293461.95978251
Fill Relay171234402023-04-25 13:02:11374 days ago1682427731IN
Across Protocol: Old Ethereum Spoke Pool V2
0 ETH0.0036523339.4250756
Multicall171234282023-04-25 12:59:47374 days ago1682427587IN
Across Protocol: Old Ethereum Spoke Pool V2
0 ETH0.0013309534.36308818
Multicall171234282023-04-25 12:59:47374 days ago1682427587IN
Across Protocol: Old Ethereum Spoke Pool V2
0 ETH0.0061963434.37808818
Fill Relay171234212023-04-25 12:58:23374 days ago1682427503IN
Across Protocol: Old Ethereum Spoke Pool V2
0 ETH0.0032612135.19402292
Fill Relay171234172023-04-25 12:57:35374 days ago1682427455IN
Across Protocol: Old Ethereum Spoke Pool V2
0 ETH0.0035207337.97002402
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block From To Value
171724822023-05-02 10:25:47367 days ago1683023147
Across Protocol: Old Ethereum Spoke Pool V2
0.1994 ETH
171724232023-05-02 10:13:47367 days ago1683022427
Across Protocol: Old Ethereum Spoke Pool V2
0.054835 ETH
171724162023-05-02 10:12:11367 days ago1683022331
Across Protocol: Old Ethereum Spoke Pool V2
0.1994 ETH
171723582023-05-02 10:00:23367 days ago1683021623
Across Protocol: Old Ethereum Spoke Pool V2
0.1994 ETH
171628722023-05-01 1:59:11368 days ago1682906351
Across Protocol: Old Ethereum Spoke Pool V2
0.05187 ETH
171628302023-05-01 1:50:35368 days ago1682905835
Across Protocol: Old Ethereum Spoke Pool V2
0.05985 ETH
171628192023-05-01 1:48:23368 days ago1682905703
Across Protocol: Old Ethereum Spoke Pool V2
0.0728175 ETH
171627582023-05-01 1:35:47368 days ago1682904947
Across Protocol: Old Ethereum Spoke Pool V2
0.08309175 ETH
171627192023-05-01 1:27:59368 days ago1682904479
Across Protocol: Old Ethereum Spoke Pool V2
0.07938044 ETH
171608732023-04-30 19:14:23368 days ago1682882063
Across Protocol: Old Ethereum Spoke Pool V2
0.349125 ETH
171607962023-04-30 18:58:23368 days ago1682881103
Across Protocol: Old Ethereum Spoke Pool V2
0.0798 ETH
171607692023-04-30 18:52:59368 days ago1682880779
Across Protocol: Old Ethereum Spoke Pool V2
0.09975 ETH
171607512023-04-30 18:49:23368 days ago1682880563
Across Protocol: Old Ethereum Spoke Pool V2
0.8349075 ETH
171607422023-04-30 18:47:35368 days ago1682880455
Across Protocol: Old Ethereum Spoke Pool V2
0.09975 ETH
171607402023-04-30 18:47:11368 days ago1682880431
Across Protocol: Old Ethereum Spoke Pool V2
0.1047375 ETH
171607222023-04-30 18:43:35368 days ago1682880215
Across Protocol: Old Ethereum Spoke Pool V2
0.1047375 ETH
171238412023-04-25 14:22:59374 days ago1682432579
Across Protocol: Old Ethereum Spoke Pool V2
2.33193527 ETH
171238412023-04-25 14:22:59374 days ago1682432579
Across Protocol: Old Ethereum Spoke Pool V2
2.33193527 ETH
171238112023-04-25 14:16:59374 days ago1682432219
Across Protocol: Old Ethereum Spoke Pool V2
0.09312882 ETH
171238112023-04-25 14:16:59374 days ago1682432219
Across Protocol: Old Ethereum Spoke Pool V2
0.09312882 ETH
171237802023-04-25 14:10:47374 days ago1682431847
Across Protocol: Old Ethereum Spoke Pool V2
0.03468924 ETH
171237802023-04-25 14:10:47374 days ago1682431847
Across Protocol: Old Ethereum Spoke Pool V2
0.03468924 ETH
171237162023-04-25 13:57:47374 days ago1682431067
Across Protocol: Old Ethereum Spoke Pool V2
0.17396566 ETH
171237162023-04-25 13:57:47374 days ago1682431067
Across Protocol: Old Ethereum Spoke Pool V2
0.17396566 ETH
171236422023-04-25 13:42:59374 days ago1682430179
Across Protocol: Old Ethereum Spoke Pool V2
0.5 ETH
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Ethereum_SpokePool

Compiler Version
v0.8.13+commit.abaa5c0e

Optimization Enabled:
Yes with 1000000 runs

Other Settings:
default evmVersion, GNU GPLv3 license
File 1 of 19 : Ethereum_SpokePool.sol
// SPDX-License-Identifier: GPL-3.0-only
pragma solidity ^0.8.0;

import "./SpokePool.sol";
import "@openzeppelin/contracts/access/Ownable.sol";

/**
 * @notice Ethereum L1 specific SpokePool. Used on Ethereum L1 to facilitate L2->L1 transfers.
 */
contract Ethereum_SpokePool is SpokePool, Ownable {
    /**
     * @notice Construct the Ethereum SpokePool.
     * @param _hubPool Hub pool address to set. Can be changed by admin.
     * @param _wethAddress Weth address for this network to set.
     * @param timerAddress Timer address to set.
     */
    constructor(
        address _hubPool,
        address _wethAddress,
        address timerAddress
    ) SpokePool(msg.sender, _hubPool, _wethAddress, timerAddress) {}

    /**************************************
     *          INTERNAL FUNCTIONS           *
     **************************************/

    function _bridgeTokensToHubPool(RelayerRefundLeaf memory relayerRefundLeaf) internal override {
        IERC20(relayerRefundLeaf.l2TokenAddress).transfer(hubPool, relayerRefundLeaf.amountToReturn);
    }

    // Admin is simply owner which should be same account that owns the HubPool deployed on this network. A core
    // assumption of this contract system is that the HubPool is deployed on Ethereum.
    function _requireAdminSender() internal override onlyOwner {}
}

File 2 of 19 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)

pragma solidity ^0.8.0;

import "../utils/Context.sol";

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
    address private _owner;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _transferOwnership(_msgSender());
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
        _;
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

File 3 of 19 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @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);

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

File 4 of 19 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

import "../IERC20.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));
        }
    }

    /**
     * @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 5 of 19 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.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 functionCall(target, data, "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");
        require(isContract(target), "Address: call to non-contract");

        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResult(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) {
        require(isContract(target), "Address: static call to non-contract");

        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResult(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) {
        require(isContract(target), "Address: delegate call to non-contract");

        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason 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 {
            // 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

                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

File 6 of 19 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;

/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }
}

File 7 of 19 : Strings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Strings.sol)

pragma solidity ^0.8.0;

/**
 * @dev String operations.
 */
library Strings {
    bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        // Inspired by OraclizeAPI's implementation - MIT licence
        // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol

        if (value == 0) {
            return "0";
        }
        uint256 temp = value;
        uint256 digits;
        while (temp != 0) {
            digits++;
            temp /= 10;
        }
        bytes memory buffer = new bytes(digits);
        while (value != 0) {
            digits -= 1;
            buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
            value /= 10;
        }
        return string(buffer);
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        if (value == 0) {
            return "0x00";
        }
        uint256 temp = value;
        uint256 length = 0;
        while (temp != 0) {
            length++;
            temp >>= 8;
        }
        return toHexString(value, length);
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
     */
    function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
        bytes memory buffer = new bytes(2 * length + 2);
        buffer[0] = "0";
        buffer[1] = "x";
        for (uint256 i = 2 * length + 1; i > 1; --i) {
            buffer[i] = _HEX_SYMBOLS[value & 0xf];
            value >>= 4;
        }
        require(value == 0, "Strings: hex length insufficient");
        return string(buffer);
    }
}

File 8 of 19 : ECDSA.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (utils/cryptography/ECDSA.sol)

pragma solidity ^0.8.0;

import "../Strings.sol";

/**
 * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.
 *
 * These functions can be used to verify that a message was signed by the holder
 * of the private keys of a given address.
 */
library ECDSA {
    enum RecoverError {
        NoError,
        InvalidSignature,
        InvalidSignatureLength,
        InvalidSignatureS,
        InvalidSignatureV
    }

    function _throwError(RecoverError error) private pure {
        if (error == RecoverError.NoError) {
            return; // no error: do nothing
        } else if (error == RecoverError.InvalidSignature) {
            revert("ECDSA: invalid signature");
        } else if (error == RecoverError.InvalidSignatureLength) {
            revert("ECDSA: invalid signature length");
        } else if (error == RecoverError.InvalidSignatureS) {
            revert("ECDSA: invalid signature 's' value");
        } else if (error == RecoverError.InvalidSignatureV) {
            revert("ECDSA: invalid signature 'v' value");
        }
    }

    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature` or error string. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     * this is by receiving a hash of the original message (which may otherwise
     * be too long), and then calling {toEthSignedMessageHash} on it.
     *
     * Documentation for signature generation:
     * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]
     * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]
     *
     * _Available since v4.3._
     */
    function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {
        // Check the signature length
        // - case 65: r,s,v signature (standard)
        // - case 64: r,vs signature (cf https://eips.ethereum.org/EIPS/eip-2098) _Available since v4.1._
        if (signature.length == 65) {
            bytes32 r;
            bytes32 s;
            uint8 v;
            // ecrecover takes the signature parameters, and the only way to get them
            // currently is to use assembly.
            assembly {
                r := mload(add(signature, 0x20))
                s := mload(add(signature, 0x40))
                v := byte(0, mload(add(signature, 0x60)))
            }
            return tryRecover(hash, v, r, s);
        } else if (signature.length == 64) {
            bytes32 r;
            bytes32 vs;
            // ecrecover takes the signature parameters, and the only way to get them
            // currently is to use assembly.
            assembly {
                r := mload(add(signature, 0x20))
                vs := mload(add(signature, 0x40))
            }
            return tryRecover(hash, r, vs);
        } else {
            return (address(0), RecoverError.InvalidSignatureLength);
        }
    }

    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature`. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     * this is by receiving a hash of the original message (which may otherwise
     * be too long), and then calling {toEthSignedMessageHash} on it.
     */
    function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, signature);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.
     *
     * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]
     *
     * _Available since v4.3._
     */
    function tryRecover(
        bytes32 hash,
        bytes32 r,
        bytes32 vs
    ) internal pure returns (address, RecoverError) {
        bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);
        uint8 v = uint8((uint256(vs) >> 255) + 27);
        return tryRecover(hash, v, r, s);
    }

    /**
     * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.
     *
     * _Available since v4.2._
     */
    function recover(
        bytes32 hash,
        bytes32 r,
        bytes32 vs
    ) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, r, vs);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Overload of {ECDSA-tryRecover} that receives the `v`,
     * `r` and `s` signature fields separately.
     *
     * _Available since v4.3._
     */
    function tryRecover(
        bytes32 hash,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal pure returns (address, RecoverError) {
        // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature
        // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines
        // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most
        // signatures from current libraries generate a unique signature with an s-value in the lower half order.
        //
        // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value
        // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or
        // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept
        // these malleable signatures as well.
        if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {
            return (address(0), RecoverError.InvalidSignatureS);
        }
        if (v != 27 && v != 28) {
            return (address(0), RecoverError.InvalidSignatureV);
        }

        // If the signature is valid (and not malleable), return the signer address
        address signer = ecrecover(hash, v, r, s);
        if (signer == address(0)) {
            return (address(0), RecoverError.InvalidSignature);
        }

        return (signer, RecoverError.NoError);
    }

    /**
     * @dev Overload of {ECDSA-recover} that receives the `v`,
     * `r` and `s` signature fields separately.
     */
    function recover(
        bytes32 hash,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, v, r, s);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Returns an Ethereum Signed Message, created from a `hash`. This
     * produces hash corresponding to the one signed with the
     * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
     * JSON-RPC method as part of EIP-191.
     *
     * See {recover}.
     */
    function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {
        // 32 is the length in bytes of hash,
        // enforced by the type signature above
        return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash));
    }

    /**
     * @dev Returns an Ethereum Signed Message, created from `s`. This
     * produces hash corresponding to the one signed with the
     * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
     * JSON-RPC method as part of EIP-191.
     *
     * See {recover}.
     */
    function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", Strings.toString(s.length), s));
    }

    /**
     * @dev Returns an Ethereum Signed Typed Data, created from a
     * `domainSeparator` and a `structHash`. This produces hash corresponding
     * to the one signed with the
     * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]
     * JSON-RPC method as part of EIP-712.
     *
     * See {recover}.
     */
    function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash));
    }
}

File 9 of 19 : MerkleProof.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (utils/cryptography/MerkleProof.sol)

pragma solidity ^0.8.0;

/**
 * @dev These functions deal with verification of Merkle Trees proofs.
 *
 * The proofs can be generated using the JavaScript library
 * https://github.com/miguelmota/merkletreejs[merkletreejs].
 * Note: the hashing algorithm should be keccak256 and pair sorting should be enabled.
 *
 * See `test/utils/cryptography/MerkleProof.test.js` for some examples.
 */
library MerkleProof {
    /**
     * @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree
     * defined by `root`. For this, a `proof` must be provided, containing
     * sibling hashes on the branch from the leaf to the root of the tree. Each
     * pair of leaves and each pair of pre-images are assumed to be sorted.
     */
    function verify(
        bytes32[] memory proof,
        bytes32 root,
        bytes32 leaf
    ) internal pure returns (bool) {
        return processProof(proof, leaf) == root;
    }

    /**
     * @dev Returns the rebuilt hash obtained by traversing a Merklee tree up
     * from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt
     * hash matches the root of the tree. When processing the proof, the pairs
     * of leafs & pre-images are assumed to be sorted.
     *
     * _Available since v4.4._
     */
    function processProof(bytes32[] memory proof, bytes32 leaf) internal pure returns (bytes32) {
        bytes32 computedHash = leaf;
        for (uint256 i = 0; i < proof.length; i++) {
            bytes32 proofElement = proof[i];
            if (computedHash <= proofElement) {
                // Hash(current computed hash + current element of the proof)
                computedHash = _efficientHash(computedHash, proofElement);
            } else {
                // Hash(current element of the proof + current computed hash)
                computedHash = _efficientHash(proofElement, computedHash);
            }
        }
        return computedHash;
    }

    function _efficientHash(bytes32 a, bytes32 b) private pure returns (bytes32 value) {
        assembly {
            mstore(0x00, a)
            mstore(0x20, b)
            value := keccak256(0x00, 0x40)
        }
    }
}

File 10 of 19 : MultiCaller.sol
// This contract is taken from Uniswaps's multi call implementation (https://github.com/Uniswap/uniswap-v3-periphery/blob/main/contracts/base/Multicall.sol)
// and was modified to be solidity 0.8 compatible. Additionally, the method was restricted to only work with msg.value
// set to 0 to avoid any nasty attack vectors on function calls that use value sent with deposits.
pragma solidity ^0.8.0;

/// @title MultiCaller
/// @notice Enables calling multiple methods in a single call to the contract
contract MultiCaller {
    function multicall(bytes[] calldata data) external payable returns (bytes[] memory results) {
        require(msg.value == 0, "Only multicall with 0 value");
        results = new bytes[](data.length);
        for (uint256 i = 0; i < data.length; i++) {
            (bool success, bytes memory result) = address(this).delegatecall(data[i]);

            if (!success) {
                // Next 5 lines from https://ethereum.stackexchange.com/a/83577
                if (result.length < 68) revert();
                assembly {
                    result := add(result, 0x04)
                }
                revert(abi.decode(result, (string)));
            }

            results[i] = result;
        }
    }
}

File 11 of 19 : Testable.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity ^0.8.0;

import "./Timer.sol";

/**
 * @title Base class that provides time overrides, but only if being run in test mode.
 */
abstract contract Testable {
    // If the contract is being run in production, then `timerAddress` will be the 0x0 address.
    // Note: this variable should be set on construction and never modified.
    address public timerAddress;

    /**
     * @notice Constructs the Testable contract. Called by child contracts.
     * @param _timerAddress Contract that stores the current time in a testing environment.
     * Must be set to 0x0 for production environments that use live time.
     */
    constructor(address _timerAddress) {
        timerAddress = _timerAddress;
    }

    /**
     * @notice Reverts if not running in test mode.
     */
    modifier onlyIfTest {
        require(timerAddress != address(0x0));
        _;
    }

    /**
     * @notice Sets the current time.
     * @dev Will revert if not running in test mode.
     * @param time timestamp to set current Testable time to.
     */
    function setCurrentTime(uint256 time) external onlyIfTest {
        Timer(timerAddress).setCurrentTime(time);
    }

    /**
     * @notice Gets the current time. Will return the last time set in `setCurrentTime` if running in test mode.
     * Otherwise, it will return the block timestamp.
     * @return uint for the current Testable timestamp.
     */
    function getCurrentTime() public view virtual returns (uint256) {
        if (timerAddress != address(0x0)) {
            return Timer(timerAddress).getCurrentTime();
        } else {
            return block.timestamp; // solhint-disable-line not-rely-on-time
        }
    }
}

File 12 of 19 : Timer.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity ^0.8.0;

/**
 * @title Universal store of current contract time for testing environments.
 */
contract Timer {
    uint256 private currentTime;

    constructor() {
        currentTime = block.timestamp; // solhint-disable-line not-rely-on-time
    }

    /**
     * @notice Sets the current time.
     * @dev Will revert if not running in test mode.
     * @param time timestamp to set `currentTime` to.
     */
    function setCurrentTime(uint256 time) external {
        currentTime = time;
    }

    /**
     * @notice Gets the currentTime variable set in the Timer.
     * @return uint256 for the current Testable timestamp.
     */
    function getCurrentTime() public view returns (uint256) {
        return currentTime;
    }
}

File 14 of 19 : HubPoolInterface.sol
// SPDX-License-Identifier: GPL-3.0-only
pragma solidity ^0.8.0;

import "./interfaces/AdapterInterface.sol";

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";

/**
 * @notice Concise list of functions in HubPool implementation.
 */
interface HubPoolInterface {
    // This leaf is meant to be decoded in the HubPool to rebalance tokens between HubPool and SpokePool.
    struct PoolRebalanceLeaf {
        // This is used to know which chain to send cross-chain transactions to (and which SpokePool to send to).
        uint256 chainId;
        // Total LP fee amount per token in this bundle, encompassing all associated bundled relays.
        uint256[] bundleLpFees;
        // Represents the amount to push to or pull from the SpokePool. If +, the pool pays the SpokePool. If negative
        // the SpokePool pays the HubPool. There can be arbitrarily complex rebalancing rules defined offchain. This
        // number is only nonzero when the rules indicate that a rebalancing action should occur. When a rebalance does
        // occur, runningBalances must be set to zero for this token and netSendAmounts should be set to the previous
        // runningBalances + relays - deposits in this bundle. If non-zero then it must be set on the SpokePool's
        // RelayerRefundLeaf amountToReturn as -1 * this value to show if funds are being sent from or to the SpokePool.
        int256[] netSendAmounts;
        // This is only here to be emitted in an event to track a running unpaid balance between the L2 pool and the L1
        // pool. A positive number indicates that the HubPool owes the SpokePool funds. A negative number indicates that
        // the SpokePool owes the HubPool funds. See the comment above for the dynamics of this and netSendAmounts.
        int256[] runningBalances;
        // Used by data worker to mark which leaves should relay roots to SpokePools, and to otherwise organize leaves.
        // For example, each leaf should contain all the rebalance information for a single chain, but in the case where
        // the list of l1Tokens is very large such that they all can't fit into a single leaf that can be executed under
        // the block gas limit, then the data worker can use this groupIndex to organize them. Any leaves with
        // a groupIndex equal to 0 will relay roots to the SpokePool, so the data worker should ensure that only one
        // leaf for a specific chainId should have a groupIndex equal to 0.
        uint256 groupIndex;
        // Used as the index in the bitmap to track whether this leaf has been executed or not.
        uint8 leafId;
        // The bundleLpFees, netSendAmounts, and runningBalances are required to be the same length. They are parallel
        // arrays for the given chainId and should be ordered by the l1Tokens field. All whitelisted tokens with nonzero
        // relays on this chain in this bundle in the order of whitelisting.
        address[] l1Tokens;
    }

    // A data worker can optimistically store several merkle roots on this contract by staking a bond and calling
    // proposeRootBundle. By staking a bond, the data worker is alleging that the merkle roots all contain valid leaves
    // that can be executed later to:
    // - Send funds from this contract to a SpokePool or vice versa
    // - Send funds from a SpokePool to Relayer as a refund for a relayed deposit
    // - Send funds from a SpokePool to a deposit recipient to fulfill a "slow" relay
    // Anyone can dispute this struct if the merkle roots contain invalid leaves before the
    // challengePeriodEndTimestamp. Once the expiration timestamp is passed, executeRootBundle to execute a leaf
    // from the poolRebalanceRoot on this contract and it will simultaneously publish the relayerRefundRoot and
    // slowRelayRoot to a SpokePool. The latter two roots, once published to the SpokePool, contain
    // leaves that can be executed on the SpokePool to pay relayers or recipients.
    struct RootBundle {
        // Contains leaves instructing this contract to send funds to SpokePools.
        bytes32 poolRebalanceRoot;
        // Relayer refund merkle root to be published to a SpokePool.
        bytes32 relayerRefundRoot;
        // Slow relay merkle root to be published to a SpokePool.
        bytes32 slowRelayRoot;
        // This is a 1D bitmap, with max size of 256 elements, limiting us to 256 chainsIds.
        uint256 claimedBitMap;
        // Proposer of this root bundle.
        address proposer;
        // Number of pool rebalance leaves to execute in the poolRebalanceRoot. After this number
        // of leaves are executed, a new root bundle can be proposed
        uint8 unclaimedPoolRebalanceLeafCount;
        // When root bundle challenge period passes and this root bundle becomes executable.
        uint32 challengePeriodEndTimestamp;
    }

    // Each whitelisted L1 token has an associated pooledToken struct that contains all information used to track the
    // cumulative LP positions and if this token is enabled for deposits.
    struct PooledToken {
        // LP token given to LPs of a specific L1 token.
        address lpToken;
        // True if accepting new LP's.
        bool isEnabled;
        // Timestamp of last LP fee update.
        uint32 lastLpFeeUpdate;
        // Number of LP funds sent via pool rebalances to SpokePools and are expected to be sent
        // back later.
        int256 utilizedReserves;
        // Number of LP funds held in contract less utilized reserves.
        uint256 liquidReserves;
        // Number of LP funds reserved to pay out to LPs as fees.
        uint256 undistributedLpFees;
    }

    // Helper contracts to facilitate cross chain actions between HubPool and SpokePool for a specific network.
    struct CrossChainContract {
        address adapter;
        address spokePool;
    }

    function setPaused(bool pause) external;

    function emergencyDeleteProposal() external;

    function relaySpokePoolAdminFunction(uint256 chainId, bytes memory functionData) external;

    function setProtocolFeeCapture(address newProtocolFeeCaptureAddress, uint256 newProtocolFeeCapturePct) external;

    function setBond(IERC20 newBondToken, uint256 newBondAmount) external;

    function setLiveness(uint32 newLiveness) external;

    function setIdentifier(bytes32 newIdentifier) external;

    function setCrossChainContracts(
        uint256 l2ChainId,
        address adapter,
        address spokePool
    ) external;

    function enableL1TokenForLiquidityProvision(address l1Token) external;

    function disableL1TokenForLiquidityProvision(address l1Token) external;

    function addLiquidity(address l1Token, uint256 l1TokenAmount) external payable;

    function removeLiquidity(
        address l1Token,
        uint256 lpTokenAmount,
        bool sendEth
    ) external;

    function exchangeRateCurrent(address l1Token) external returns (uint256);

    function liquidityUtilizationCurrent(address l1Token) external returns (uint256);

    function liquidityUtilizationPostRelay(address l1Token, uint256 relayedAmount) external returns (uint256);

    function sync(address l1Token) external;

    function proposeRootBundle(
        uint256[] memory bundleEvaluationBlockNumbers,
        uint8 poolRebalanceLeafCount,
        bytes32 poolRebalanceRoot,
        bytes32 relayerRefundRoot,
        bytes32 slowRelayRoot
    ) external;

    function executeRootBundle(
        uint256 chainId,
        uint256 groupIndex,
        uint256[] memory bundleLpFees,
        int256[] memory netSendAmounts,
        int256[] memory runningBalances,
        uint8 leafId,
        address[] memory l1Tokens,
        bytes32[] memory proof
    ) external;

    function disputeRootBundle() external;

    function claimProtocolFeesCaptured(address l1Token) external;

    function setPoolRebalanceRoute(
        uint256 destinationChainId,
        address l1Token,
        address destinationToken
    ) external;

    function setDepositRoute(
        uint256 originChainId,
        uint256 destinationChainId,
        address originToken,
        bool depositsEnabled
    ) external;

    function poolRebalanceRoute(uint256 destinationChainId, address l1Token)
        external
        view
        returns (address destinationToken);

    function loadEthForL2Calls() external payable;
}

File 15 of 19 : Lockable.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity ^0.8.0;

/**
 * @title A contract that provides modifiers to prevent reentrancy to state-changing and view-only methods. This contract
 * is inspired by https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/ReentrancyGuard.sol
 * and https://github.com/balancer-labs/balancer-core/blob/master/contracts/BPool.sol.
 * @dev The reason why we use this local contract instead of importing from uma/contracts is because of the addition
 * of the internal method `functionCallStackOriginatesFromOutsideThisContract` which doesn't exist in the one exported
 * by uma/contracts.
 */
contract Lockable {
    bool internal _notEntered;

    constructor() {
        // Storing an initial non-zero value makes deployment a bit more expensive, but in exchange the refund on every
        // call to nonReentrant will be lower in amount. Since refunds are capped to a percentage of the total
        // transaction's gas, it is best to keep them low in cases like this one, to increase the likelihood of the full
        // refund coming into effect.
        _notEntered = true;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a nonReentrant function from another nonReentrant function is not supported. It is possible to
     * prevent this from happening by making the nonReentrant function external, and making it call a private
     * function that does the actual state modification.
     */
    modifier nonReentrant() {
        _preEntranceCheck();
        _preEntranceSet();
        _;
        _postEntranceReset();
    }

    /**
     * @dev Designed to prevent a view-only method from being re-entered during a call to a nonReentrant() state-changing method.
     */
    modifier nonReentrantView() {
        _preEntranceCheck();
        _;
    }

    /**
     * @dev Returns true if the contract is currently in a non-entered state, meaning that the origination of the call
     * came from outside the contract. This is relevant with fallback/receive methods to see if the call came from ETH
     * being dropped onto the contract externally or due to ETH dropped on the the contract from within a method in this
     * contract, such as unwrapping WETH to ETH within the contract.
     */
    function functionCallStackOriginatesFromOutsideThisContract() internal view returns (bool) {
        return _notEntered;
    }

    // Internal methods are used to avoid copying the require statement's bytecode to every nonReentrant() method.
    // On entry into a function, _preEntranceCheck() should always be called to check if the function is being
    // re-entered. Then, if the function modifies state, it should call _postEntranceSet(), perform its logic, and
    // then call _postEntranceReset().
    // View-only methods can simply call _preEntranceCheck() to make sure that it is not being re-entered.
    function _preEntranceCheck() internal view {
        // On the first call to nonReentrant, _notEntered will be true
        require(_notEntered, "ReentrancyGuard: reentrant call");
    }

    function _preEntranceSet() internal {
        // Any calls to nonReentrant after this point will fail
        _notEntered = false;
    }

    function _postEntranceReset() internal {
        // By storing the original value once again, a refund is triggered (see
        // https://eips.ethereum.org/EIPS/eip-2200)
        _notEntered = true;
    }
}

File 16 of 19 : MerkleLib.sol
// SPDX-License-Identifier: GPL-3.0-only
pragma solidity ^0.8.0;

import "./SpokePoolInterface.sol";
import "./HubPoolInterface.sol";

import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";

/**
 * @notice Library to help with merkle roots, proofs, and claims.
 */
library MerkleLib {
    /**
     * @notice Verifies that a repayment is contained within a merkle root.
     * @param root the merkle root.
     * @param rebalance the rebalance struct.
     * @param proof the merkle proof.
     * @return bool to signal if the pool rebalance proof correctly shows inclusion of the rebalance within the tree.
     */
    function verifyPoolRebalance(
        bytes32 root,
        HubPoolInterface.PoolRebalanceLeaf memory rebalance,
        bytes32[] memory proof
    ) internal pure returns (bool) {
        return MerkleProof.verify(proof, root, keccak256(abi.encode(rebalance)));
    }

    /**
     * @notice Verifies that a relayer refund is contained within a merkle root.
     * @param root the merkle root.
     * @param refund the refund struct.
     * @param proof the merkle proof.
     * @return bool to signal if the relayer refund proof correctly shows inclusion of the refund within the tree.
     */
    function verifyRelayerRefund(
        bytes32 root,
        SpokePoolInterface.RelayerRefundLeaf memory refund,
        bytes32[] memory proof
    ) internal pure returns (bool) {
        return MerkleProof.verify(proof, root, keccak256(abi.encode(refund)));
    }

    /**
     * @notice Verifies that a distribution is contained within a merkle root.
     * @param root the merkle root.
     * @param slowRelayFulfillment the relayData fulfillment struct.
     * @param proof the merkle proof.
     * @return bool to signal if the slow relay's proof correctly shows inclusion of the slow relay within the tree.
     */
    function verifySlowRelayFulfillment(
        bytes32 root,
        SpokePoolInterface.RelayData memory slowRelayFulfillment,
        bytes32[] memory proof
    ) internal pure returns (bool) {
        return MerkleProof.verify(proof, root, keccak256(abi.encode(slowRelayFulfillment)));
    }

    // The following functions are primarily copied from
    // https://github.com/Uniswap/merkle-distributor/blob/master/contracts/MerkleDistributor.sol with minor changes.

    /**
     * @notice Tests whether a claim is contained within a claimedBitMap mapping.
     * @param claimedBitMap a simple uint256 mapping in storage used as a bitmap.
     * @param index the index to check in the bitmap.
     * @return bool indicating if the index within the claimedBitMap has been marked as claimed.
     */
    function isClaimed(mapping(uint256 => uint256) storage claimedBitMap, uint256 index) internal view returns (bool) {
        uint256 claimedWordIndex = index / 256;
        uint256 claimedBitIndex = index % 256;
        uint256 claimedWord = claimedBitMap[claimedWordIndex];
        uint256 mask = (1 << claimedBitIndex);
        return claimedWord & mask == mask;
    }

    /**
     * @notice Marks an index in a claimedBitMap as claimed.
     * @param claimedBitMap a simple uint256 mapping in storage used as a bitmap.
     * @param index the index to mark in the bitmap.
     */
    function setClaimed(mapping(uint256 => uint256) storage claimedBitMap, uint256 index) internal {
        uint256 claimedWordIndex = index / 256;
        uint256 claimedBitIndex = index % 256;
        claimedBitMap[claimedWordIndex] = claimedBitMap[claimedWordIndex] | (1 << claimedBitIndex);
    }

    /**
     * @notice Tests whether a claim is contained within a 1D claimedBitMap mapping.
     * @param claimedBitMap a simple uint256 value, encoding a 1D bitmap.
     * @param index the index to check in the bitmap. Uint8 type enforces that index can't be > 255.
     * @return bool indicating if the index within the claimedBitMap has been marked as claimed.
     */
    function isClaimed1D(uint256 claimedBitMap, uint8 index) internal pure returns (bool) {
        uint256 mask = (1 << index);
        return claimedBitMap & mask == mask;
    }

    /**
     * @notice Marks an index in a claimedBitMap as claimed.
     * @param claimedBitMap a simple uint256 mapping in storage used as a bitmap. Uint8 type enforces that index
     * can't be > 255.
     * @param index the index to mark in the bitmap.
     * @return uint256 representing the modified input claimedBitMap with the index set to true.
     */
    function setClaimed1D(uint256 claimedBitMap, uint8 index) internal pure returns (uint256) {
        return claimedBitMap | (1 << index % 256);
    }
}

File 17 of 19 : SpokePool.sol
// SPDX-License-Identifier: GPL-3.0-only
pragma solidity ^0.8.0;

import "./MerkleLib.sol";
import "./interfaces/WETH9.sol";
import "./Lockable.sol";
import "./SpokePoolInterface.sol";

import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/utils/Address.sol";

import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import "@uma/core/contracts/common/implementation/Testable.sol";
import "@uma/core/contracts/common/implementation/MultiCaller.sol";

/**
 * @title SpokePool
 * @notice Base contract deployed on source and destination chains enabling depositors to transfer assets from source to
 * destination. Deposit orders are fulfilled by off-chain relayers who also interact with this contract. Deposited
 * tokens are locked on the source chain and relayers send the recipient the desired token currency and amount
 * on the destination chain. Locked source chain tokens are later sent over the canonical token bridge to L1 HubPool.
 * Relayers are refunded with destination tokens out of this contract after another off-chain actor, a "data worker",
 * submits a proof that the relayer correctly submitted a relay on this SpokePool.
 */
abstract contract SpokePool is SpokePoolInterface, Testable, Lockable, MultiCaller {
    using SafeERC20 for IERC20;
    using Address for address;

    // Address of the L1 contract that acts as the owner of this SpokePool. If this contract is deployed on Ethereum,
    // then this address should be set to the same owner as the HubPool and the whole system.
    address public crossDomainAdmin;

    // Address of the L1 contract that will send tokens to and receive tokens from this contract to fund relayer
    // refunds and slow relays.
    address public hubPool;

    // Address of wrappedNativeToken contract for this network. If an origin token matches this, then the caller can
    // optionally instruct this contract to wrap native tokens when depositing (ie ETH->WETH or MATIC->WMATIC).
    WETH9 public immutable wrappedNativeToken;

    // Any deposit quote times greater than or less than this value to the current contract time is blocked. Forces
    // caller to use an approximately "current" realized fee. Defaults to 10 minutes.
    uint32 public depositQuoteTimeBuffer = 600;

    // Count of deposits is used to construct a unique deposit identifier for this spoke pool.
    uint32 public numberOfDeposits;

    // This contract can store as many root bundles as the HubPool chooses to publish here.
    RootBundle[] public rootBundles;

    // Origin token to destination token routings can be turned on or off, which can enable or disable deposits.
    mapping(address => mapping(uint256 => bool)) public enabledDepositRoutes;

    // Each relay is associated with the hash of parameters that uniquely identify the original deposit and a relay
    // attempt for that deposit. The relay itself is just represented as the amount filled so far. The total amount to
    // relay, the fees, and the agents are all parameters included in the hash key.
    mapping(bytes32 => uint256) public relayFills;

    /****************************************
     *                EVENTS                *
     ****************************************/
    event SetXDomainAdmin(address indexed newAdmin);
    event SetHubPool(address indexed newHubPool);
    event EnabledDepositRoute(address indexed originToken, uint256 indexed destinationChainId, bool enabled);
    event SetDepositQuoteTimeBuffer(uint32 newBuffer);
    event FundsDeposited(
        uint256 amount,
        uint256 originChainId,
        uint256 destinationChainId,
        uint64 relayerFeePct,
        uint32 indexed depositId,
        uint32 quoteTimestamp,
        address indexed originToken,
        address recipient,
        address indexed depositor
    );
    event RequestedSpeedUpDeposit(
        uint64 newRelayerFeePct,
        uint32 indexed depositId,
        address indexed depositor,
        bytes depositorSignature
    );
    event FilledRelay(
        uint256 amount,
        uint256 totalFilledAmount,
        uint256 fillAmount,
        uint256 repaymentChainId,
        uint256 originChainId,
        uint256 destinationChainId,
        uint64 relayerFeePct,
        uint64 appliedRelayerFeePct,
        uint64 realizedLpFeePct,
        uint32 depositId,
        address destinationToken,
        address indexed relayer,
        address indexed depositor,
        address recipient,
        bool isSlowRelay
    );
    event RelayedRootBundle(
        uint32 indexed rootBundleId,
        bytes32 indexed relayerRefundRoot,
        bytes32 indexed slowRelayRoot
    );
    event ExecutedRelayerRefundRoot(
        uint256 amountToReturn,
        uint256 indexed chainId,
        uint256[] refundAmounts,
        uint32 indexed rootBundleId,
        uint32 indexed leafId,
        address l2TokenAddress,
        address[] refundAddresses,
        address caller
    );
    event TokensBridged(
        uint256 amountToReturn,
        uint256 indexed chainId,
        uint32 indexed leafId,
        address indexed l2TokenAddress,
        address caller
    );
    event EmergencyDeleteRootBundle(uint256 indexed rootBundleId);

    /**
     * @notice Construct the base SpokePool.
     * @param _crossDomainAdmin Cross domain admin to set. Can be changed by admin.
     * @param _hubPool Hub pool address to set. Can be changed by admin.
     * @param _wrappedNativeTokenAddress wrappedNativeToken address for this network to set.
     * @param timerAddress Timer address to set.
     */
    constructor(
        address _crossDomainAdmin,
        address _hubPool,
        address _wrappedNativeTokenAddress,
        address timerAddress
    ) Testable(timerAddress) {
        _setCrossDomainAdmin(_crossDomainAdmin);
        _setHubPool(_hubPool);
        wrappedNativeToken = WETH9(_wrappedNativeTokenAddress);
    }

    /****************************************
     *               MODIFIERS              *
     ****************************************/

    // Implementing contract needs to override _requireAdminSender() to ensure that admin functions are protected
    // appropriately.
    modifier onlyAdmin() {
        _requireAdminSender();
        _;
    }

    /**************************************
     *          ADMIN FUNCTIONS           *
     **************************************/

    /**
     * @notice Change cross domain admin address. Callable by admin only.
     * @param newCrossDomainAdmin New cross domain admin.
     */
    function setCrossDomainAdmin(address newCrossDomainAdmin) public override onlyAdmin nonReentrant {
        _setCrossDomainAdmin(newCrossDomainAdmin);
    }

    /**
     * @notice Change L1 hub pool address. Callable by admin only.
     * @param newHubPool New hub pool.
     */
    function setHubPool(address newHubPool) public override onlyAdmin nonReentrant {
        _setHubPool(newHubPool);
    }

    /**
     * @notice Enable/Disable an origin token => destination chain ID route for deposits. Callable by admin only.
     * @param originToken Token that depositor can deposit to this contract.
     * @param destinationChainId Chain ID for where depositor wants to receive funds.
     * @param enabled True to enable deposits, False otherwise.
     */
    function setEnableRoute(
        address originToken,
        uint256 destinationChainId,
        bool enabled
    ) public override onlyAdmin nonReentrant {
        enabledDepositRoutes[originToken][destinationChainId] = enabled;
        emit EnabledDepositRoute(originToken, destinationChainId, enabled);
    }

    /**
     * @notice Change allowance for deposit quote time to differ from current block time. Callable by admin only.
     * @param newDepositQuoteTimeBuffer New quote time buffer.
     */
    function setDepositQuoteTimeBuffer(uint32 newDepositQuoteTimeBuffer) public override onlyAdmin nonReentrant {
        depositQuoteTimeBuffer = newDepositQuoteTimeBuffer;
        emit SetDepositQuoteTimeBuffer(newDepositQuoteTimeBuffer);
    }

    /**
     * @notice This method stores a new root bundle in this contract that can be executed to refund relayers, fulfill
     * slow relays, and send funds back to the HubPool on L1. This method can only be called by the admin and is
     * designed to be called as part of a cross-chain message from the HubPool's executeRootBundle method.
     * @param relayerRefundRoot Merkle root containing relayer refund leaves that can be individually executed via
     * executeRelayerRefundLeaf().
     * @param slowRelayRoot Merkle root containing slow relay fulfillment leaves that can be individually executed via
     * executeSlowRelayLeaf().
     */
    function relayRootBundle(bytes32 relayerRefundRoot, bytes32 slowRelayRoot) public override onlyAdmin nonReentrant {
        uint32 rootBundleId = uint32(rootBundles.length);
        RootBundle storage rootBundle = rootBundles.push();
        rootBundle.relayerRefundRoot = relayerRefundRoot;
        rootBundle.slowRelayRoot = slowRelayRoot;
        emit RelayedRootBundle(rootBundleId, relayerRefundRoot, slowRelayRoot);
    }

    /**
     * @notice This method is intended to only be used in emergencies where a bad root bundle has reached the
     * SpokePool.
     * @param rootBundleId Index of the root bundle that needs to be deleted. Note: this is intentionally a uint256
     * to ensure that a small input range doesn't limit which indices this method is able to reach.
     */
    function emergencyDeleteRootBundle(uint256 rootBundleId) public override onlyAdmin nonReentrant {
        delete rootBundles[rootBundleId];
        emit EmergencyDeleteRootBundle(rootBundleId);
    }

    /**************************************
     *         DEPOSITOR FUNCTIONS        *
     **************************************/

    /**
     * @notice Called by user to bridge funds from origin to destination chain. Depositor will effectively lock
     * tokens in this contract and receive a destination token on the destination chain. The origin => destination
     * token mapping is stored on the L1 HubPool.
     * @notice The caller must first approve this contract to spend amount of originToken.
     * @notice The originToken => destinationChainId must be enabled.
     * @notice This method is payable because the caller is able to deposit native token if the originToken is
     * wrappedNativeToken and this function will handle wrapping the native token to wrappedNativeToken.
     * @param recipient Address to receive funds at on destination chain.
     * @param originToken Token to lock into this contract to initiate deposit.
     * @param amount Amount of tokens to deposit. Will be amount of tokens to receive less fees.
     * @param destinationChainId Denotes network where user will receive funds from SpokePool by a relayer.
     * @param relayerFeePct % of deposit amount taken out to incentivize a fast relayer.
     * @param quoteTimestamp Timestamp used by relayers to compute this deposit's realizedLPFeePct which is paid
     * to LP pool on HubPool.
     */
    function deposit(
        address recipient,
        address originToken,
        uint256 amount,
        uint256 destinationChainId,
        uint64 relayerFeePct,
        uint32 quoteTimestamp
    ) public payable override nonReentrant {
        // Check that deposit route is enabled.
        require(enabledDepositRoutes[originToken][destinationChainId], "Disabled route");

        // We limit the relay fees to prevent the user spending all their funds on fees.
        require(relayerFeePct < 0.5e18, "invalid relayer fee");
        // This function assumes that L2 timing cannot be compared accurately and consistently to L1 timing. Therefore,
        // block.timestamp is different from the L1 EVM's. Therefore, the quoteTimestamp must be within a configurable
        // buffer of this contract's block time to allow for this variance.
        // Note also that quoteTimestamp cannot be less than the buffer otherwise the following arithmetic can result
        // in underflow. This isn't a problem as the deposit will revert, but the error might be unexpected for clients.
        require(
            getCurrentTime() >= quoteTimestamp - depositQuoteTimeBuffer &&
                getCurrentTime() <= quoteTimestamp + depositQuoteTimeBuffer,
            "invalid quote time"
        );
        // If the address of the origin token is a wrappedNativeToken contract and there is a msg.value with the
        // transaction then the user is sending ETH. In this case, the ETH should be deposited to wrappedNativeToken.
        if (originToken == address(wrappedNativeToken) && msg.value > 0) {
            require(msg.value == amount, "msg.value must match amount");
            wrappedNativeToken.deposit{ value: msg.value }();
            // Else, it is a normal ERC20. In this case pull the token from the user's wallet as per normal.
            // Note: this includes the case where the L2 user has WETH (already wrapped ETH) and wants to bridge them.
            // In this case the msg.value will be set to 0, indicating a "normal" ERC20 bridging action.
        } else IERC20(originToken).safeTransferFrom(msg.sender, address(this), amount);

        _emitDeposit(
            amount,
            chainId(),
            destinationChainId,
            relayerFeePct,
            numberOfDeposits,
            quoteTimestamp,
            originToken,
            recipient,
            msg.sender
        );

        // Increment count of deposits so that deposit ID for this spoke pool is unique.
        // @dev: Use pre-increment to save gas:
        // i++ --> Load, Store, Add, Store
        // ++i --> Load, Add, Store
        ++numberOfDeposits;
    }

    /**
     * @notice Convenience method that depositor can use to signal to relayer to use updated fee.
     * @notice Relayer should only use events emitted by this function to submit fills with updated fees, otherwise they
     * risk their fills getting disputed for being invalid, for example if the depositor never actually signed the
     * update fee message.
     * @notice This function will revert if the depositor did not sign a message containing the updated fee for the
     * deposit ID stored in this contract. If the deposit ID is for another contract, or the depositor address is
     * incorrect, or the updated fee is incorrect, then the signature will not match and this function will revert.
     * @param depositor Signer of the update fee message who originally submitted the deposit. If the deposit doesn't
     * exist, then the relayer will not be able to fill any relay, so the caller should validate that the depositor
     * did in fact submit a relay.
     * @param newRelayerFeePct New relayer fee that relayers can use.
     * @param depositId Deposit to update fee for that originated in this contract.
     * @param depositorSignature Signed message containing the depositor address, this contract chain ID, the updated
     * relayer fee %, and the deposit ID. This signature is produced by signing a hash of data according to the
     * EIP-1271 standard. See more in the _verifyUpdateRelayerFeeMessage() comments.
     */
    function speedUpDeposit(
        address depositor,
        uint64 newRelayerFeePct,
        uint32 depositId,
        bytes memory depositorSignature
    ) public override nonReentrant {
        require(newRelayerFeePct < 0.5e18, "invalid relayer fee");

        _verifyUpdateRelayerFeeMessage(depositor, chainId(), newRelayerFeePct, depositId, depositorSignature);

        // Assuming the above checks passed, a relayer can take the signature and the updated relayer fee information
        // from the following event to submit a fill with an updated fee %.
        emit RequestedSpeedUpDeposit(newRelayerFeePct, depositId, depositor, depositorSignature);
    }

    /**************************************
     *         RELAYER FUNCTIONS          *
     **************************************/

    /**
     * @notice Called by relayer to fulfill part of a deposit by sending destination tokens to the recipient.
     * Relayer is expected to pass in unique identifying information for deposit that they want to fulfill, and this
     * relay submission will be validated by off-chain data workers who can dispute this relay if any part is invalid.
     * If the relay is valid, then the relayer will be refunded on their desired repayment chain. If relay is invalid,
     * then relayer will not receive any refund.
     * @notice All of the deposit data can be found via on-chain events from the origin SpokePool, except for the
     * realizedLpFeePct which is a function of the HubPool's utilization at the deposit quote time. This fee %
     * is deterministic based on the quote time, so the relayer should just compute it using the canonical algorithm
     * as described in a UMIP linked to the HubPool's identifier.
     * @param depositor Depositor on origin chain who set this chain as the destination chain.
     * @param recipient Specified recipient on this chain.
     * @param destinationToken Token to send to recipient. Should be mapped to the origin token, origin chain ID
     * and this chain ID via a mapping on the HubPool.
     * @param amount Full size of the deposit.
     * @param maxTokensToSend Max amount of tokens to send recipient. If higher than amount, then caller will
     * send recipient the full relay amount.
     * @param repaymentChainId Chain of SpokePool where relayer wants to be refunded after the challenge window has
     * passed.
     * @param originChainId Chain of SpokePool where deposit originated.
     * @param realizedLpFeePct Fee % based on L1 HubPool utilization at deposit quote time. Deterministic based on
     * quote time.
     * @param relayerFeePct Fee % to keep as relayer, specified by depositor.
     * @param depositId Unique deposit ID on origin spoke pool.
     */
    function fillRelay(
        address depositor,
        address recipient,
        address destinationToken,
        uint256 amount,
        uint256 maxTokensToSend,
        uint256 repaymentChainId,
        uint256 originChainId,
        uint64 realizedLpFeePct,
        uint64 relayerFeePct,
        uint32 depositId
    ) public nonReentrant {
        // Each relay attempt is mapped to the hash of data uniquely identifying it, which includes the deposit data
        // such as the origin chain ID and the deposit ID, and the data in a relay attempt such as who the recipient
        // is, which chain and currency the recipient wants to receive funds on, and the relay fees.
        SpokePoolInterface.RelayData memory relayData = SpokePoolInterface.RelayData({
            depositor: depositor,
            recipient: recipient,
            destinationToken: destinationToken,
            amount: amount,
            realizedLpFeePct: realizedLpFeePct,
            relayerFeePct: relayerFeePct,
            depositId: depositId,
            originChainId: originChainId,
            destinationChainId: chainId()
        });
        bytes32 relayHash = _getRelayHash(relayData);

        uint256 fillAmountPreFees = _fillRelay(relayHash, relayData, maxTokensToSend, relayerFeePct, false);

        _emitFillRelay(relayHash, fillAmountPreFees, repaymentChainId, relayerFeePct, relayData, false);
    }

    /**
     * @notice Called by relayer to execute same logic as calling fillRelay except that relayer is using an updated
     * relayer fee %. The fee % must have been emitted in a message cryptographically signed by the depositor.
     * @notice By design, the depositor probably emitted the message with the updated fee by calling speedUpRelay().
     * @param depositor Depositor on origin chain who set this chain as the destination chain.
     * @param recipient Specified recipient on this chain.
     * @param destinationToken Token to send to recipient. Should be mapped to the origin token, origin chain ID
     * and this chain ID via a mapping on the HubPool.
     * @param amount Full size of the deposit.
     * @param maxTokensToSend Max amount of tokens to send recipient. If higher than amount, then caller will
     * send recipient the full relay amount.
     * @param repaymentChainId Chain of SpokePool where relayer wants to be refunded after the challenge window has
     * passed.
     * @param originChainId Chain of SpokePool where deposit originated.
     * @param realizedLpFeePct Fee % based on L1 HubPool utilization at deposit quote time. Deterministic based on
     * quote time.
     * @param relayerFeePct Original fee % to keep as relayer set by depositor.
     * @param newRelayerFeePct New fee % to keep as relayer also specified by depositor.
     * @param depositId Unique deposit ID on origin spoke pool.
     * @param depositorSignature Depositor-signed message containing updated fee %.
     */
    function fillRelayWithUpdatedFee(
        address depositor,
        address recipient,
        address destinationToken,
        uint256 amount,
        uint256 maxTokensToSend,
        uint256 repaymentChainId,
        uint256 originChainId,
        uint64 realizedLpFeePct,
        uint64 relayerFeePct,
        uint64 newRelayerFeePct,
        uint32 depositId,
        bytes memory depositorSignature
    ) public override nonReentrant {
        _verifyUpdateRelayerFeeMessage(depositor, originChainId, newRelayerFeePct, depositId, depositorSignature);

        // Now follow the default fillRelay flow with the updated fee and the original relay hash.
        RelayData memory relayData = RelayData({
            depositor: depositor,
            recipient: recipient,
            destinationToken: destinationToken,
            amount: amount,
            realizedLpFeePct: realizedLpFeePct,
            relayerFeePct: relayerFeePct,
            depositId: depositId,
            originChainId: originChainId,
            destinationChainId: chainId()
        });
        bytes32 relayHash = _getRelayHash(relayData);
        uint256 fillAmountPreFees = _fillRelay(relayHash, relayData, maxTokensToSend, newRelayerFeePct, false);

        _emitFillRelay(relayHash, fillAmountPreFees, repaymentChainId, newRelayerFeePct, relayData, false);
    }

    /**************************************
     *         DATA WORKER FUNCTIONS      *
     **************************************/

    /**
     * @notice Executes a slow relay leaf stored as part of a root bundle. Will send the full amount remaining in the
     * relay to the recipient, less fees.
     * @dev This function assumes that the relay's destination chain ID is the current chain ID, which prevents
     * the caller from executing a slow relay intended for another chain on this chain.
     * @param depositor Depositor on origin chain who set this chain as the destination chain.
     * @param recipient Specified recipient on this chain.
     * @param destinationToken Token to send to recipient. Should be mapped to the origin token, origin chain ID
     * and this chain ID via a mapping on the HubPool.
     * @param amount Full size of the deposit.
     * @param originChainId Chain of SpokePool where deposit originated.
     * @param realizedLpFeePct Fee % based on L1 HubPool utilization at deposit quote time. Deterministic based on
     * quote time.
     * @param relayerFeePct Original fee % to keep as relayer set by depositor.
     * @param depositId Unique deposit ID on origin spoke pool.
     * @param rootBundleId Unique ID of root bundle containing slow relay root that this leaf is contained in.
     * @param proof Inclusion proof for this leaf in slow relay root in root bundle.
     */
    function executeSlowRelayLeaf(
        address depositor,
        address recipient,
        address destinationToken,
        uint256 amount,
        uint256 originChainId,
        uint64 realizedLpFeePct,
        uint64 relayerFeePct,
        uint32 depositId,
        uint32 rootBundleId,
        bytes32[] memory proof
    ) public virtual override nonReentrant {
        _executeSlowRelayLeaf(
            depositor,
            recipient,
            destinationToken,
            amount,
            originChainId,
            chainId(),
            realizedLpFeePct,
            relayerFeePct,
            depositId,
            rootBundleId,
            proof
        );
    }

    /**
     * @notice Executes a relayer refund leaf stored as part of a root bundle. Will send the relayer the amount they
     * sent to the recipient plus a relayer fee.
     * @param rootBundleId Unique ID of root bundle containing relayer refund root that this leaf is contained in.
     * @param relayerRefundLeaf Contains all data necessary to reconstruct leaf contained in root bundle and to
     * refund relayer. This data structure is explained in detail in the SpokePoolInterface.
     * @param proof Inclusion proof for this leaf in relayer refund root in root bundle.
     */
    function executeRelayerRefundLeaf(
        uint32 rootBundleId,
        SpokePoolInterface.RelayerRefundLeaf memory relayerRefundLeaf,
        bytes32[] memory proof
    ) public virtual override nonReentrant {
        _executeRelayerRefundLeaf(rootBundleId, relayerRefundLeaf, proof);
    }

    /**************************************
     *           VIEW FUNCTIONS           *
     **************************************/

    /**
     * @notice Returns chain ID for this network.
     * @dev Some L2s like ZKSync don't support the CHAIN_ID opcode so we allow the implementer to override this.
     */
    function chainId() public view virtual override returns (uint256) {
        return block.chainid;
    }

    /**************************************
     *         INTERNAL FUNCTIONS         *
     **************************************/

    // Verifies inclusion proof of leaf in root, sends relayer their refund, and sends to HubPool any rebalance
    // transfers.
    function _executeRelayerRefundLeaf(
        uint32 rootBundleId,
        SpokePoolInterface.RelayerRefundLeaf memory relayerRefundLeaf,
        bytes32[] memory proof
    ) internal {
        // Check integrity of leaf structure:
        require(relayerRefundLeaf.chainId == chainId(), "Invalid chainId");
        require(relayerRefundLeaf.refundAddresses.length == relayerRefundLeaf.refundAmounts.length, "invalid leaf");

        RootBundle storage rootBundle = rootBundles[rootBundleId];

        // Check that inclusionProof proves that relayerRefundLeaf is contained within the relayer refund root.
        // Note: This should revert if the relayerRefundRoot is uninitialized.
        require(MerkleLib.verifyRelayerRefund(rootBundle.relayerRefundRoot, relayerRefundLeaf, proof), "Bad Proof");

        // Verify the leafId in the leaf has not yet been claimed.
        require(!MerkleLib.isClaimed(rootBundle.claimedBitmap, relayerRefundLeaf.leafId), "Already claimed");

        // Set leaf as claimed in bitmap. This is passed by reference to the storage rootBundle.
        MerkleLib.setClaimed(rootBundle.claimedBitmap, relayerRefundLeaf.leafId);

        // Send each relayer refund address the associated refundAmount for the L2 token address.
        // Note: Even if the L2 token is not enabled on this spoke pool, we should still refund relayers.
        uint256 length = relayerRefundLeaf.refundAmounts.length;
        for (uint256 i = 0; i < length; ) {
            uint256 amount = relayerRefundLeaf.refundAmounts[i];
            if (amount > 0)
                IERC20(relayerRefundLeaf.l2TokenAddress).safeTransfer(relayerRefundLeaf.refundAddresses[i], amount);

            // OK because we assume refund array length won't be > types(uint256).max.
            // Based on the stress test results in /test/gas-analytics/SpokePool.RelayerRefundLeaf.ts, the UMIP should
            // limit the refund count in valid proposals to be ~800 so any RelayerRefundLeaves with > 800 refunds should
            // not make it to this stage.

            unchecked {
                ++i;
            }
        }

        // If leaf's amountToReturn is positive, then send L2 --> L1 message to bridge tokens back via
        // chain-specific bridging method.
        if (relayerRefundLeaf.amountToReturn > 0) {
            _bridgeTokensToHubPool(relayerRefundLeaf);

            emit TokensBridged(
                relayerRefundLeaf.amountToReturn,
                relayerRefundLeaf.chainId,
                relayerRefundLeaf.leafId,
                relayerRefundLeaf.l2TokenAddress,
                msg.sender
            );
        }

        emit ExecutedRelayerRefundRoot(
            relayerRefundLeaf.amountToReturn,
            relayerRefundLeaf.chainId,
            relayerRefundLeaf.refundAmounts,
            rootBundleId,
            relayerRefundLeaf.leafId,
            relayerRefundLeaf.l2TokenAddress,
            relayerRefundLeaf.refundAddresses,
            msg.sender
        );
    }

    // Verifies inclusion proof of leaf in root and sends recipient remainder of relay. Marks relay as filled.
    function _executeSlowRelayLeaf(
        address depositor,
        address recipient,
        address destinationToken,
        uint256 amount,
        uint256 originChainId,
        uint256 destinationChainId,
        uint64 realizedLpFeePct,
        uint64 relayerFeePct,
        uint32 depositId,
        uint32 rootBundleId,
        bytes32[] memory proof
    ) internal {
        RelayData memory relayData = RelayData({
            depositor: depositor,
            recipient: recipient,
            destinationToken: destinationToken,
            amount: amount,
            originChainId: originChainId,
            destinationChainId: destinationChainId,
            realizedLpFeePct: realizedLpFeePct,
            relayerFeePct: relayerFeePct,
            depositId: depositId
        });

        require(
            MerkleLib.verifySlowRelayFulfillment(rootBundles[rootBundleId].slowRelayRoot, relayData, proof),
            "Invalid proof"
        );

        bytes32 relayHash = _getRelayHash(relayData);

        // Note: use relayAmount as the max amount to send, so the relay is always completely filled by the contract's
        // funds in all cases. As this is a slow relay we set the relayerFeePct to 0. This effectively refunds the
        // relayer component of the relayerFee thereby only charging the depositor the LpFee.
        uint256 fillAmountPreFees = _fillRelay(relayHash, relayData, relayData.amount, 0, true);

        // Note: Set repayment chain ID to 0 to indicate that there is no repayment to be made. The off-chain data
        // worker can use repaymentChainId=0 as a signal to ignore such relays for refunds. Also, set the relayerFeePct
        // to 0 as slow relays do not pay the caller of this method (depositor is refunded this fee).
        _emitFillRelay(relayHash, fillAmountPreFees, 0, 0, relayData, true);
    }

    function _setCrossDomainAdmin(address newCrossDomainAdmin) internal {
        require(newCrossDomainAdmin != address(0), "Bad bridge router address");
        crossDomainAdmin = newCrossDomainAdmin;
        emit SetXDomainAdmin(newCrossDomainAdmin);
    }

    function _setHubPool(address newHubPool) internal {
        require(newHubPool != address(0), "Bad hub pool address");
        hubPool = newHubPool;
        emit SetHubPool(newHubPool);
    }

    // Should be overriden by implementing contract depending on how L2 handles sending tokens to L1.
    function _bridgeTokensToHubPool(SpokePoolInterface.RelayerRefundLeaf memory relayerRefundLeaf) internal virtual;

    function _verifyUpdateRelayerFeeMessage(
        address depositor,
        uint256 originChainId,
        uint64 newRelayerFeePct,
        uint32 depositId,
        bytes memory depositorSignature
    ) internal view {
        // A depositor can request to speed up an un-relayed deposit by signing a hash containing the relayer
        // fee % to update to and information uniquely identifying the deposit to relay. This information ensures
        // that this signature cannot be re-used for other deposits. The version string is included as a precaution
        // in case this contract is upgraded.
        // Note: we use encode instead of encodePacked because it is more secure, more in the "warning" section
        // here: https://docs.soliditylang.org/en/v0.8.11/abi-spec.html#non-standard-packed-mode
        bytes32 expectedDepositorMessageHash = keccak256(
            abi.encode("ACROSS-V2-FEE-1.0", newRelayerFeePct, depositId, originChainId)
        );

        // Check the hash corresponding to the https://eth.wiki/json-rpc/API#eth_sign[eth_sign]
        // If the depositor signed a message with a different updated fee (or any other param included in the
        // above keccak156 hash), then this will revert.
        bytes32 ethSignedMessageHash = ECDSA.toEthSignedMessageHash(expectedDepositorMessageHash);

        _verifyDepositorUpdateFeeMessage(depositor, ethSignedMessageHash, depositorSignature);
    }

    // This function is isolated and made virtual to allow different L2's to implement chain specific recovery of
    // signers from signatures because some L2s might not support ecrecover. To be safe, consider always reverting
    // this function for L2s where ecrecover is different from how it works on Ethereum, otherwise there is the
    // potential to forge a signature from the depositor using a different private key than the original depositor's.
    function _verifyDepositorUpdateFeeMessage(
        address depositor,
        bytes32 ethSignedMessageHash,
        bytes memory depositorSignature
    ) internal view virtual {
        // Note: We purposefully do not support EIP-1271 signatures (meaning that multisigs and smart contract wallets
        // like Argent are not supported) because of the possibility that a multisig that signed a message on the origin
        // chain does not have a parallel on this destination chain.
        require(depositor == ECDSA.recover(ethSignedMessageHash, depositorSignature), "invalid signature");
    }

    function _computeAmountPreFees(uint256 amount, uint64 feesPct) private pure returns (uint256) {
        return (1e18 * amount) / (1e18 - feesPct);
    }

    function _computeAmountPostFees(uint256 amount, uint64 feesPct) private pure returns (uint256) {
        return (amount * (1e18 - feesPct)) / 1e18;
    }

    function _getRelayHash(SpokePoolInterface.RelayData memory relayData) private pure returns (bytes32) {
        return keccak256(abi.encode(relayData));
    }

    // Unwraps ETH and does a transfer to a recipient address. If the recipient is a smart contract then sends wrappedNativeToken.
    function _unwrapwrappedNativeTokenTo(address payable to, uint256 amount) internal {
        if (address(to).isContract()) {
            IERC20(address(wrappedNativeToken)).safeTransfer(to, amount);
        } else {
            wrappedNativeToken.withdraw(amount);
            to.transfer(amount);
        }
    }

    /**
     * @notice Caller specifies the max amount of tokens to send to user. Based on this amount and the amount of the
     * relay remaining (as stored in the relayFills mapping), pull the amount of tokens from the caller
     * and send to the recipient.
     * @dev relayFills keeps track of pre-fee fill amounts as a convenience to relayers who want to specify round
     * numbers for the maxTokensToSend parameter or convenient numbers like 100 (i.e. relayers who will fully
     * fill any relay up to 100 tokens, and partial fill with 100 tokens for larger relays).
     * @dev Caller must approve this contract to transfer up to maxTokensToSend of the relayData.destinationToken.
     * The amount to be sent might end up less if there is insufficient relay amount remaining to be sent.
     */
    function _fillRelay(
        bytes32 relayHash,
        RelayData memory relayData,
        uint256 maxTokensToSend,
        uint64 updatableRelayerFeePct,
        bool useContractFunds
    ) internal returns (uint256 fillAmountPreFees) {
        // We limit the relay fees to prevent the user spending all their funds on fees. Note that 0.5e18 (i.e. 50%)
        // fees are just magic numbers. The important point is to prevent the total fee from being 100%, otherwise
        // computing the amount pre fees runs into divide-by-0 issues.
        require(updatableRelayerFeePct < 0.5e18 && relayData.realizedLpFeePct < 0.5e18, "invalid fees");

        // Check that the relay has not already been completely filled. Note that the relays mapping will point to
        // the amount filled so far for a particular relayHash, so this will start at 0 and increment with each fill.
        require(relayFills[relayHash] < relayData.amount, "relay filled");

        // Stores the equivalent amount to be sent by the relayer before fees have been taken out.
        if (maxTokensToSend == 0) return 0;

        // Derive the amount of the relay filled if the caller wants to send exactly maxTokensToSend tokens to
        // the recipient. For example, if the user wants to send 10 tokens to the recipient, the full relay amount
        // is 100, and the fee %'s total 5%, then this computation would return ~10.5, meaning that to fill 10.5/100
        // of the full relay size, the caller would need to send 10 tokens to the user.
        fillAmountPreFees = _computeAmountPreFees(
            maxTokensToSend,
            (relayData.realizedLpFeePct + updatableRelayerFeePct)
        );
        // If user's specified max amount to send is greater than the amount of the relay remaining pre-fees,
        // we'll pull exactly enough tokens to complete the relay.
        uint256 amountToSend = maxTokensToSend;
        uint256 amountRemainingInRelay = relayData.amount - relayFills[relayHash];
        if (amountRemainingInRelay < fillAmountPreFees) {
            fillAmountPreFees = amountRemainingInRelay;

            // The user will fulfill the remainder of the relay, so we need to compute exactly how many tokens post-fees
            // that they need to send to the recipient. Note that if the relayer is filled using contract funds then
            // this is a slow relay.
            amountToSend = _computeAmountPostFees(
                fillAmountPreFees,
                relayData.realizedLpFeePct + updatableRelayerFeePct
            );
        }

        // relayFills keeps track of pre-fee fill amounts as a convenience to relayers who want to specify round
        // numbers for the maxTokensToSend parameter or convenient numbers like 100 (i.e. relayers who will fully
        // fill any relay up to 100 tokens, and partial fill with 100 tokens for larger relays).
        relayFills[relayHash] += fillAmountPreFees;

        // If relay token is wrappedNativeToken then unwrap and send native token.
        if (relayData.destinationToken == address(wrappedNativeToken)) {
            // Note: useContractFunds is True if we want to send funds to the recipient directly out of this contract,
            // otherwise we expect the caller to send funds to the recipient. If useContractFunds is True and the
            // recipient wants wrappedNativeToken, then we can assume that wrappedNativeToken is already in the
            // contract, otherwise we'll need the user to send wrappedNativeToken to this contract. Regardless, we'll
            // need to unwrap it to native token before sending to the user.
            if (!useContractFunds)
                IERC20(relayData.destinationToken).safeTransferFrom(msg.sender, address(this), amountToSend);
            _unwrapwrappedNativeTokenTo(payable(relayData.recipient), amountToSend);
            // Else, this is a normal ERC20 token. Send to recipient.
        } else {
            // Note: Similar to note above, send token directly from the contract to the user in the slow relay case.
            if (!useContractFunds)
                IERC20(relayData.destinationToken).safeTransferFrom(msg.sender, relayData.recipient, amountToSend);
            else IERC20(relayData.destinationToken).safeTransfer(relayData.recipient, amountToSend);
        }
    }

    // The following internal methods emit events with many params to overcome solidity stack too deep issues.
    function _emitFillRelay(
        bytes32 relayHash,
        uint256 fillAmount,
        uint256 repaymentChainId,
        uint64 appliedRelayerFeePct,
        RelayData memory relayData,
        bool isSlowRelay
    ) internal {
        emit FilledRelay(
            relayData.amount,
            relayFills[relayHash],
            fillAmount,
            repaymentChainId,
            relayData.originChainId,
            relayData.destinationChainId,
            relayData.relayerFeePct,
            appliedRelayerFeePct,
            relayData.realizedLpFeePct,
            relayData.depositId,
            relayData.destinationToken,
            msg.sender,
            relayData.depositor,
            relayData.recipient,
            isSlowRelay
        );
    }

    function _emitDeposit(
        uint256 amount,
        uint256 originChainId,
        uint256 destinationChainId,
        uint64 relayerFeePct,
        uint32 depositId,
        uint32 quoteTimestamp,
        address originToken,
        address recipient,
        address depositor
    ) internal {
        emit FundsDeposited(
            amount,
            originChainId,
            destinationChainId,
            relayerFeePct,
            depositId,
            quoteTimestamp,
            originToken,
            recipient,
            depositor
        );
    }

    // Implementing contract needs to override this to ensure that only the appropriate cross chain admin can execute
    // certain admin functions. For L2 contracts, the cross chain admin refers to some L1 address or contract, and for
    // L1, this would just be the same admin of the HubPool.
    function _requireAdminSender() internal virtual;

    // Added to enable the this contract to receive native token (ETH). Used when unwrapping wrappedNativeToken.
    receive() external payable {}
}

File 18 of 19 : SpokePoolInterface.sol
// SPDX-License-Identifier: GPL-3.0-only
pragma solidity ^0.8.0;

/**
 * @notice Contains common data structures and functions used by all SpokePool implementations.
 */
interface SpokePoolInterface {
    // This leaf is meant to be decoded in the SpokePool to pay out successful relayers.
    struct RelayerRefundLeaf {
        // This is the amount to return to the HubPool. This occurs when there is a PoolRebalanceLeaf netSendAmount that
        // is negative. This is just the negative of this value.
        uint256 amountToReturn;
        // Used to verify that this is being executed on the correct destination chainId.
        uint256 chainId;
        // This array designates how much each of those addresses should be refunded.
        uint256[] refundAmounts;
        // Used as the index in the bitmap to track whether this leaf has been executed or not.
        uint32 leafId;
        // The associated L2TokenAddress that these claims apply to.
        address l2TokenAddress;
        // Must be same length as refundAmounts and designates each address that must be refunded.
        address[] refundAddresses;
    }

    // This struct represents the data to fully specify a relay. If any portion of this data differs, the relay is
    // considered to be completely distinct. Only one relay for a particular depositId, chainId pair should be
    // considered valid and repaid. This data is hashed and inserted into the slow relay merkle root so that an off
    // chain validator can choose when to refund slow relayers.
    struct RelayData {
        // The address that made the deposit on the origin chain.
        address depositor;
        // The recipient address on the destination chain.
        address recipient;
        // The corresponding token address on the destination chain.
        address destinationToken;
        // The total relay amount before fees are taken out.
        uint256 amount;
        // Origin chain id.
        uint256 originChainId;
        // Destination chain id.
        uint256 destinationChainId;
        // The LP Fee percentage computed by the relayer based on the deposit's quote timestamp
        // and the HubPool's utilization.
        uint64 realizedLpFeePct;
        // The relayer fee percentage specified in the deposit.
        uint64 relayerFeePct;
        // The id uniquely identifying this deposit on the origin chain.
        uint32 depositId;
    }

    // Stores collection of merkle roots that can be published to this contract from the HubPool, which are referenced
    // by "data workers" via inclusion proofs to execute leaves in the roots.
    struct RootBundle {
        // Merkle root of slow relays that were not fully filled and whose recipient is still owed funds from the LP pool.
        bytes32 slowRelayRoot;
        // Merkle root of relayer refunds for successful relays.
        bytes32 relayerRefundRoot;
        // This is a 2D bitmap tracking which leaves in the relayer refund root have been claimed, with max size of
        // 256x(2^248) leaves per root.
        mapping(uint256 => uint256) claimedBitmap;
    }

    function setCrossDomainAdmin(address newCrossDomainAdmin) external;

    function setHubPool(address newHubPool) external;

    function setEnableRoute(
        address originToken,
        uint256 destinationChainId,
        bool enable
    ) external;

    function setDepositQuoteTimeBuffer(uint32 buffer) external;

    function relayRootBundle(bytes32 relayerRefundRoot, bytes32 slowRelayRoot) external;

    function emergencyDeleteRootBundle(uint256 rootBundleId) external;

    function deposit(
        address recipient,
        address originToken,
        uint256 amount,
        uint256 destinationChainId,
        uint64 relayerFeePct,
        uint32 quoteTimestamp
    ) external payable;

    function speedUpDeposit(
        address depositor,
        uint64 newRelayerFeePct,
        uint32 depositId,
        bytes memory depositorSignature
    ) external;

    function fillRelay(
        address depositor,
        address recipient,
        address destinationToken,
        uint256 amount,
        uint256 maxTokensToSend,
        uint256 repaymentChainId,
        uint256 originChainId,
        uint64 realizedLpFeePct,
        uint64 relayerFeePct,
        uint32 depositId
    ) external;

    function fillRelayWithUpdatedFee(
        address depositor,
        address recipient,
        address destinationToken,
        uint256 amount,
        uint256 maxTokensToSend,
        uint256 repaymentChainId,
        uint256 originChainId,
        uint64 realizedLpFeePct,
        uint64 relayerFeePct,
        uint64 newRelayerFeePct,
        uint32 depositId,
        bytes memory depositorSignature
    ) external;

    function executeSlowRelayLeaf(
        address depositor,
        address recipient,
        address destinationToken,
        uint256 amount,
        uint256 originChainId,
        uint64 realizedLpFeePct,
        uint64 relayerFeePct,
        uint32 depositId,
        uint32 rootBundleId,
        bytes32[] memory proof
    ) external;

    function executeRelayerRefundLeaf(
        uint32 rootBundleId,
        SpokePoolInterface.RelayerRefundLeaf memory relayerRefundLeaf,
        bytes32[] memory proof
    ) external;

    function chainId() external view returns (uint256);
}

File 19 of 19 : AdapterInterface.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity ^0.8.0;

/**
 * @notice Sends cross chain messages and tokens to contracts on a specific L2 network.
 */

interface AdapterInterface {
    event MessageRelayed(address target, bytes message);

    event TokensRelayed(address l1Token, address l2Token, uint256 amount, address to);

    function relayMessage(address target, bytes calldata message) external payable;

    function relayTokens(
        address l1Token,
        address l2Token,
        uint256 amount,
        address to
    ) external payable;
}

File 20 of 19 : WETH9.sol
// SPDX-License-Identifier: GPL-3.0-only
pragma solidity ^0.8.0;

interface WETH9 {
    function withdraw(uint256 wad) external;

    function deposit() external payable;

    function balanceOf(address guy) external view returns (uint256 wad);

    function transfer(address guy, uint256 wad) external;
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_hubPool","type":"address"},{"internalType":"address","name":"_wethAddress","type":"address"},{"internalType":"address","name":"timerAddress","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"rootBundleId","type":"uint256"}],"name":"EmergencyDeleteRootBundle","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"originToken","type":"address"},{"indexed":true,"internalType":"uint256","name":"destinationChainId","type":"uint256"},{"indexed":false,"internalType":"bool","name":"enabled","type":"bool"}],"name":"EnabledDepositRoute","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amountToReturn","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"chainId","type":"uint256"},{"indexed":false,"internalType":"uint256[]","name":"refundAmounts","type":"uint256[]"},{"indexed":true,"internalType":"uint32","name":"rootBundleId","type":"uint32"},{"indexed":true,"internalType":"uint32","name":"leafId","type":"uint32"},{"indexed":false,"internalType":"address","name":"l2TokenAddress","type":"address"},{"indexed":false,"internalType":"address[]","name":"refundAddresses","type":"address[]"},{"indexed":false,"internalType":"address","name":"caller","type":"address"}],"name":"ExecutedRelayerRefundRoot","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"totalFilledAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"fillAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"repaymentChainId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"originChainId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"destinationChainId","type":"uint256"},{"indexed":false,"internalType":"uint64","name":"relayerFeePct","type":"uint64"},{"indexed":false,"internalType":"uint64","name":"appliedRelayerFeePct","type":"uint64"},{"indexed":false,"internalType":"uint64","name":"realizedLpFeePct","type":"uint64"},{"indexed":false,"internalType":"uint32","name":"depositId","type":"uint32"},{"indexed":false,"internalType":"address","name":"destinationToken","type":"address"},{"indexed":true,"internalType":"address","name":"relayer","type":"address"},{"indexed":true,"internalType":"address","name":"depositor","type":"address"},{"indexed":false,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"bool","name":"isSlowRelay","type":"bool"}],"name":"FilledRelay","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"originChainId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"destinationChainId","type":"uint256"},{"indexed":false,"internalType":"uint64","name":"relayerFeePct","type":"uint64"},{"indexed":true,"internalType":"uint32","name":"depositId","type":"uint32"},{"indexed":false,"internalType":"uint32","name":"quoteTimestamp","type":"uint32"},{"indexed":true,"internalType":"address","name":"originToken","type":"address"},{"indexed":false,"internalType":"address","name":"recipient","type":"address"},{"indexed":true,"internalType":"address","name":"depositor","type":"address"}],"name":"FundsDeposited","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint32","name":"rootBundleId","type":"uint32"},{"indexed":true,"internalType":"bytes32","name":"relayerRefundRoot","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"slowRelayRoot","type":"bytes32"}],"name":"RelayedRootBundle","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint64","name":"newRelayerFeePct","type":"uint64"},{"indexed":true,"internalType":"uint32","name":"depositId","type":"uint32"},{"indexed":true,"internalType":"address","name":"depositor","type":"address"},{"indexed":false,"internalType":"bytes","name":"depositorSignature","type":"bytes"}],"name":"RequestedSpeedUpDeposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint32","name":"newBuffer","type":"uint32"}],"name":"SetDepositQuoteTimeBuffer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"newHubPool","type":"address"}],"name":"SetHubPool","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"newAdmin","type":"address"}],"name":"SetXDomainAdmin","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amountToReturn","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"chainId","type":"uint256"},{"indexed":true,"internalType":"uint32","name":"leafId","type":"uint32"},{"indexed":true,"internalType":"address","name":"l2TokenAddress","type":"address"},{"indexed":false,"internalType":"address","name":"caller","type":"address"}],"name":"TokensBridged","type":"event"},{"inputs":[],"name":"chainId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"crossDomainAdmin","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"address","name":"originToken","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"destinationChainId","type":"uint256"},{"internalType":"uint64","name":"relayerFeePct","type":"uint64"},{"internalType":"uint32","name":"quoteTimestamp","type":"uint32"}],"name":"deposit","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"depositQuoteTimeBuffer","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"rootBundleId","type":"uint256"}],"name":"emergencyDeleteRootBundle","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"enabledDepositRoutes","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"rootBundleId","type":"uint32"},{"components":[{"internalType":"uint256","name":"amountToReturn","type":"uint256"},{"internalType":"uint256","name":"chainId","type":"uint256"},{"internalType":"uint256[]","name":"refundAmounts","type":"uint256[]"},{"internalType":"uint32","name":"leafId","type":"uint32"},{"internalType":"address","name":"l2TokenAddress","type":"address"},{"internalType":"address[]","name":"refundAddresses","type":"address[]"}],"internalType":"struct SpokePoolInterface.RelayerRefundLeaf","name":"relayerRefundLeaf","type":"tuple"},{"internalType":"bytes32[]","name":"proof","type":"bytes32[]"}],"name":"executeRelayerRefundLeaf","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"depositor","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"address","name":"destinationToken","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"originChainId","type":"uint256"},{"internalType":"uint64","name":"realizedLpFeePct","type":"uint64"},{"internalType":"uint64","name":"relayerFeePct","type":"uint64"},{"internalType":"uint32","name":"depositId","type":"uint32"},{"internalType":"uint32","name":"rootBundleId","type":"uint32"},{"internalType":"bytes32[]","name":"proof","type":"bytes32[]"}],"name":"executeSlowRelayLeaf","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"depositor","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"address","name":"destinationToken","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"maxTokensToSend","type":"uint256"},{"internalType":"uint256","name":"repaymentChainId","type":"uint256"},{"internalType":"uint256","name":"originChainId","type":"uint256"},{"internalType":"uint64","name":"realizedLpFeePct","type":"uint64"},{"internalType":"uint64","name":"relayerFeePct","type":"uint64"},{"internalType":"uint32","name":"depositId","type":"uint32"}],"name":"fillRelay","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"depositor","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"address","name":"destinationToken","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"maxTokensToSend","type":"uint256"},{"internalType":"uint256","name":"repaymentChainId","type":"uint256"},{"internalType":"uint256","name":"originChainId","type":"uint256"},{"internalType":"uint64","name":"realizedLpFeePct","type":"uint64"},{"internalType":"uint64","name":"relayerFeePct","type":"uint64"},{"internalType":"uint64","name":"newRelayerFeePct","type":"uint64"},{"internalType":"uint32","name":"depositId","type":"uint32"},{"internalType":"bytes","name":"depositorSignature","type":"bytes"}],"name":"fillRelayWithUpdatedFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getCurrentTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"hubPool","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes[]","name":"data","type":"bytes[]"}],"name":"multicall","outputs":[{"internalType":"bytes[]","name":"results","type":"bytes[]"}],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"numberOfDeposits","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"relayFills","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"relayerRefundRoot","type":"bytes32"},{"internalType":"bytes32","name":"slowRelayRoot","type":"bytes32"}],"name":"relayRootBundle","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"rootBundles","outputs":[{"internalType":"bytes32","name":"slowRelayRoot","type":"bytes32"},{"internalType":"bytes32","name":"relayerRefundRoot","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newCrossDomainAdmin","type":"address"}],"name":"setCrossDomainAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"time","type":"uint256"}],"name":"setCurrentTime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"newDepositQuoteTimeBuffer","type":"uint32"}],"name":"setDepositQuoteTimeBuffer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"originToken","type":"address"},{"internalType":"uint256","name":"destinationChainId","type":"uint256"},{"internalType":"bool","name":"enabled","type":"bool"}],"name":"setEnableRoute","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newHubPool","type":"address"}],"name":"setHubPool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"depositor","type":"address"},{"internalType":"uint64","name":"newRelayerFeePct","type":"uint64"},{"internalType":"uint32","name":"depositId","type":"uint32"},{"internalType":"bytes","name":"depositorSignature","type":"bytes"}],"name":"speedUpDeposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"timerAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"wrappedNativeToken","outputs":[{"internalType":"contract WETH9","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]

60a06040526002805463ffffffff60a01b1916604b60a31b1790553480156200002757600080fd5b506040516200466b3803806200466b8339810160408190526200004a9162000260565b600080546001600160a81b0319166001600160a01b03831617600160a01b179055338383836200007a84620000a9565b62000085836200014f565b506001600160a01b031660805250620000a0905033620001f1565b505050620002aa565b6001600160a01b038116620001055760405162461bcd60e51b815260206004820152601960248201527f4261642062726964676520726f7574657220616464726573730000000000000060448201526064015b60405180910390fd5b600180546001600160a01b0319166001600160a01b0383169081179091556040517fa9e8c42c9e7fca7f62755189a16b2f5314d43d8fb24e91ba54e6d65f9314e84990600090a250565b6001600160a01b038116620001a75760405162461bcd60e51b815260206004820152601460248201527f4261642068756220706f6f6c20616464726573730000000000000000000000006044820152606401620000fc565b600280546001600160a01b0319166001600160a01b0383169081179091556040517f1f17a88f67b0f49060a34bec1a4723a563620e6aa265eb640b5046dcee0759a090600090a250565b600680546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b80516001600160a01b03811681146200025b57600080fd5b919050565b6000806000606084860312156200027657600080fd5b620002818462000243565b9250620002916020850162000243565b9150620002a16040850162000243565b90509250925092565b608051614382620002e9600039600081816101d901528181610ce601528181610daf0152818161234d01528181612bd30152612c2901526143826000f3fe6080604052600436106101bb5760003560e01c806389a153cc116100ec578063de7eba781161008a578063ee2a53f811610064578063ee2a53f814610585578063f06850f6146105ba578063f2fde38b146105e7578063ffc351a31461060757600080fd5b8063de7eba7814610518578063e190440214610538578063e282d5b91461056557600080fd5b80639a8a0592116100c65780639a8a05921461048c578063a1244c671461049f578063ac9650d8146104d8578063be3576ee146104f857600080fd5b806389a153cc146104215780638a7860ce146104415780638da5cb5b1461046157600080fd5b806329cb924d116101595780635249fef1116101335780635249fef11461034a5780635285e0581461039557806357f6dcb8146103c2578063715018a61461040c57600080fd5b806329cb924d146102f45780634922897814610317578063493a4f841461032a57600080fd5b80631dfb2d02116101955780631dfb2d021461027457806322f8e56614610294578063272751c7146102b45780632752042e146102d457600080fd5b806317fcb39b146101c75780631b3d5559146102255780631c39c38d1461024757600080fd5b366101c257005b600080fd5b3480156101d357600080fd5b506101fb7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b34801561023157600080fd5b5061024561024036600461366d565b610627565b005b34801561025357600080fd5b506000546101fb9073ffffffffffffffffffffffffffffffffffffffff1681565b34801561028057600080fd5b5061024561028f366004613769565b6106b0565b3480156102a057600080fd5b506102456102af366004613784565b61073d565b3480156102c057600080fd5b506102456102cf3660046137ab565b6107e6565b3480156102e057600080fd5b506102456102ef3660046137eb565b6108f8565b34801561030057600080fd5b506103096109f9565b60405190815260200161021c565b61024561032536600461381e565b610ab1565b34801561033657600080fd5b50610245610345366004613884565b610f28565b34801561035657600080fd5b506103856103653660046138a6565b600460209081526000928352604080842090915290825290205460ff1681565b604051901515815260200161021c565b3480156103a157600080fd5b506001546101fb9073ffffffffffffffffffffffffffffffffffffffff1681565b3480156103ce57600080fd5b506002546103f79074010000000000000000000000000000000000000000900463ffffffff1681565b60405163ffffffff909116815260200161021c565b34801561041857600080fd5b50610245611042565b34801561042d57600080fd5b5061024561043c3660046138d0565b6110cf565b34801561044d57600080fd5b5061024561045c366004613784565b61122b565b34801561046d57600080fd5b5060065473ffffffffffffffffffffffffffffffffffffffff166101fb565b34801561049857600080fd5b5046610309565b3480156104ab57600080fd5b506002546103f7907801000000000000000000000000000000000000000000000000900463ffffffff1681565b6104eb6104e636600461396e565b6112ff565b60405161021c9190613a59565b34801561050457600080fd5b50610245610513366004613ad9565b6114d9565b34801561052457600080fd5b50610245610533366004613769565b611565565b34801561054457600080fd5b506002546101fb9073ffffffffffffffffffffffffffffffffffffffff1681565b34801561057157600080fd5b50610245610580366004613c37565b6115ab565b34801561059157600080fd5b506105a56105a0366004613784565b611709565b6040805192835260208301919091520161021c565b3480156105c657600080fd5b506103096105d5366004613784565b60056020526000908152604090205481565b3480156105f357600080fd5b50610245610602366004613769565b611737565b34801561061357600080fd5b50610245610622366004613ca6565b611864565b61062f6119cf565b61065c600080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff169055565b610667838383611a53565b6106ab600080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1674010000000000000000000000000000000000000000179055565b505050565b6106b8611dff565b6106c06119cf565b6106ed600080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff169055565b6106f681611e80565b61073a600080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1674010000000000000000000000000000000000000000179055565b50565b60005473ffffffffffffffffffffffffffffffffffffffff1661075f57600080fd5b6000546040517f22f8e5660000000000000000000000000000000000000000000000000000000081526004810183905273ffffffffffffffffffffffffffffffffffffffff909116906322f8e56690602401600060405180830381600087803b1580156107cb57600080fd5b505af11580156107df573d6000803e3d6000fd5b5050505050565b6107ee611dff565b6107f66119cf565b610823600080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff169055565b73ffffffffffffffffffffffffffffffffffffffff8316600081815260046020908152604080832086845282529182902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001685151590811790915591519182528492917f0a21fdd43d0ad0c62689ee7230a47309a050755bcc52eba00310add65297692a910160405180910390a36106ab600080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1674010000000000000000000000000000000000000000179055565b610900611dff565b6109086119cf565b610935600080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff169055565b600280547fffffffffffffffff00000000ffffffffffffffffffffffffffffffffffffffff167401000000000000000000000000000000000000000063ffffffff8416908102919091179091556040519081527f0e55dd180fa793d9036c804d0a116e6a7617a48e72cee1f83d92793a793fcc039060200160405180910390a161073a600080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1674010000000000000000000000000000000000000000179055565b6000805473ffffffffffffffffffffffffffffffffffffffff1615610aac5760008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166329cb924d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a83573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aa79190613d84565b905090565b504290565b610ab96119cf565b610ae6600080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff169055565b73ffffffffffffffffffffffffffffffffffffffff8516600090815260046020908152604080832086845290915290205460ff16610b85576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f44697361626c656420726f75746500000000000000000000000000000000000060448201526064015b60405180910390fd5b6706f05b59d3b200008267ffffffffffffffff1610610c00576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f696e76616c69642072656c6179657220666565000000000000000000000000006044820152606401610b7c565b600254610c2b9074010000000000000000000000000000000000000000900463ffffffff1682613dcc565b63ffffffff16610c396109f9565b10158015610c7e5750600254610c6d9074010000000000000000000000000000000000000000900463ffffffff1682613df1565b63ffffffff16610c7b6109f9565b11155b610ce4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f696e76616c69642071756f74652074696d6500000000000000000000000000006044820152606401610b7c565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16148015610d3f5750600034115b15610e3357833414610dad576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f6d73672e76616c7565206d757374206d6174636820616d6f756e7400000000006044820152606401610b7c565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663d0e30db0346040518263ffffffff1660e01b81526004016000604051808303818588803b158015610e1557600080fd5b505af1158015610e29573d6000803e3d6000fd5b5050505050610e55565b610e5573ffffffffffffffffffffffffffffffffffffffff8616333087611f6c565b610e8c8446600254869086907801000000000000000000000000000000000000000000000000900463ffffffff16868b8d33612048565b60028054601890610ebe907801000000000000000000000000000000000000000000000000900463ffffffff16613e19565b91906101000a81548163ffffffff021916908363ffffffff160217905550610f20600080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1674010000000000000000000000000000000000000000179055565b505050505050565b610f30611dff565b610f386119cf565b610f65600080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff169055565b6003805460018101825560008281529181027fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85c81018590557fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b01838155604051919290918491869163ffffffff8616917fc86ba04c55bc5eb2f2876b91c438849a296dbec7b08751c3074d92e04f0a77af91a4505061103e600080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1674010000000000000000000000000000000000000000179055565b5050565b60065473ffffffffffffffffffffffffffffffffffffffff1633146110c3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610b7c565b6110cd60006120d9565b565b6110d76119cf565b611104600080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff169055565b60006040518061012001604052808c73ffffffffffffffffffffffffffffffffffffffff1681526020018b73ffffffffffffffffffffffffffffffffffffffff1681526020018a73ffffffffffffffffffffffffffffffffffffffff1681526020018981526020018681526020016111794690565b81526020018567ffffffffffffffff1681526020018467ffffffffffffffff1681526020018363ffffffff16815250905060006111b582612150565b905060006111c782848b886000612180565b90506111d882828a8887600061242d565b50505061121f600080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1674010000000000000000000000000000000000000000179055565b50505050505050505050565b611233611dff565b61123b6119cf565b611268600080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff169055565b6003818154811061127b5761127b613e3c565b60009182526020822060039091020181815560010181905560405182917f3569b846531b754c99cb80df3f49cd72fa6fe106aaee5ab8e0caf35a9d7ce88d91a261073a600080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1674010000000000000000000000000000000000000000179055565b60603415611369576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f4f6e6c79206d756c746963616c6c207769746820302076616c756500000000006044820152606401610b7c565b8167ffffffffffffffff811115611382576113826134b1565b6040519080825280602002602001820160405280156113b557816020015b60608152602001906001900390816113a05790505b50905060005b828110156114d257600080308686858181106113d9576113d9613e3c565b90506020028101906113eb9190613e6b565b6040516113f9929190613ed0565b600060405180830381855af49150503d8060008114611434576040519150601f19603f3d011682016040523d82523d6000602084013e611439565b606091505b50915091508161149f5760448151101561145257600080fd5b6004810190508080602001905181019061146c9190613ee0565b6040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b7c9190613f4e565b808484815181106114b2576114b2613e3c565b6020026020010181905250505080806114ca90613f61565b9150506113bb565b5092915050565b6114e16119cf565b61150e600080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff169055565b6115218a8a8a8a8a468b8b8b8b8b61256f565b61121f600080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1674010000000000000000000000000000000000000000179055565b61156d611dff565b6115756119cf565b6115a2600080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff169055565b6106f6816126ee565b6115b36119cf565b6115e0600080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff169055565b6706f05b59d3b200008367ffffffffffffffff161061165b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f696e76616c69642072656c6179657220666565000000000000000000000000006044820152606401610b7c565b61166884468585856127da565b8373ffffffffffffffffffffffffffffffffffffffff168263ffffffff167fb9de16bf376724405019a10ef4fedac57fecd292bf86c08d81d7c42d394d5d3785846040516116b7929190613f99565b60405180910390a3611703600080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1674010000000000000000000000000000000000000000179055565b50505050565b6003818154811061171957600080fd5b60009182526020909120600390910201805460019091015490915082565b60065473ffffffffffffffffffffffffffffffffffffffff1633146117b8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610b7c565b73ffffffffffffffffffffffffffffffffffffffff811661185b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610b7c565b61073a816120d9565b61186c6119cf565b611899600080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff169055565b6118a68c878585856127da565b60006040518061012001604052808e73ffffffffffffffffffffffffffffffffffffffff1681526020018d73ffffffffffffffffffffffffffffffffffffffff1681526020018c73ffffffffffffffffffffffffffffffffffffffff1681526020018b815260200188815260200161191b4690565b81526020018767ffffffffffffffff1681526020018667ffffffffffffffff1681526020018463ffffffff168152509050600061195782612150565b9050600061196982848d896000612180565b905061197a82828c8987600061242d565b5050506119c1600080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1674010000000000000000000000000000000000000000179055565b505050505050505050505050565b60005474010000000000000000000000000000000000000000900460ff166110cd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610b7c565b46826020015114611ac0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f496e76616c696420636861696e496400000000000000000000000000000000006044820152606401610b7c565b8160400151518260a001515114611b33576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f696e76616c6964206c65616600000000000000000000000000000000000000006044820152606401610b7c565b600060038463ffffffff1681548110611b4e57611b4e613e3c565b90600052602060002090600302019050611b6d81600101548484612877565b611bd3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f4261642050726f6f6600000000000000000000000000000000000000000000006044820152606401610b7c565b611bea81600201846060015163ffffffff166128b4565b15611c51576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f416c726561647920636c61696d656400000000000000000000000000000000006044820152606401610b7c565b611c6881600201846060015163ffffffff166128f5565b60408301515160005b81811015611cf957600085604001518281518110611c9157611c91613e3c565b602002602001015190506000811115611cf057611cf08660a001518381518110611cbd57611cbd613e3c565b602002602001015182886080015173ffffffffffffffffffffffffffffffffffffffff166129339092919063ffffffff16565b50600101611c71565b50835115611d9257611d0a84612989565b836080015173ffffffffffffffffffffffffffffffffffffffff16846060015163ffffffff1685602001517f828fc203220356df8f072a91681caee7d5c75095e2a95e80ed5a14b384697f71876000015133604051611d8992919091825273ffffffffffffffffffffffffffffffffffffffff16602082015260400190565b60405180910390a45b836060015163ffffffff168563ffffffff1685602001517ff8bd640004bcec1b89657020f561d0b070cbdf662d0b158db9dccb0a8301bfab8760000151886040015189608001518a60a0015133604051611df095949392919061403d565b60405180910390a45050505050565b60065473ffffffffffffffffffffffffffffffffffffffff1633146110cd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610b7c565b73ffffffffffffffffffffffffffffffffffffffff8116611efd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f4261642068756220706f6f6c20616464726573730000000000000000000000006044820152606401610b7c565b600280547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83169081179091556040517f1f17a88f67b0f49060a34bec1a4723a563620e6aa265eb640b5046dcee0759a090600090a250565b60405173ffffffffffffffffffffffffffffffffffffffff808516602483015283166044820152606481018290526117039085907f23b872dd00000000000000000000000000000000000000000000000000000000906084015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152612a2d565b604080518a8152602081018a905290810188905267ffffffffffffffff8716606082015263ffffffff858116608083015273ffffffffffffffffffffffffffffffffffffffff84811660a084015280841692908616918816907f4a4fc49abd237bfd7f4ac82d6c7a284c69daaea5154430cff04ad7482c6c42549060c00160405180910390a4505050505050505050565b6006805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600081604051602001612163919061409b565b604051602081830303815290604052805190602001209050919050565b60006706f05b59d3b200008367ffffffffffffffff161080156121b857506706f05b59d3b200008560c0015167ffffffffffffffff16105b61221e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f696e76616c6964206665657300000000000000000000000000000000000000006044820152606401610b7c565b606085015160008781526005602052604090205410612299576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f72656c61792066696c6c656400000000000000000000000000000000000000006044820152606401610b7c565b836000036122a957506000612424565b6122c284848760c001516122bd9190614142565b612b39565b600087815260056020526040812054606088015192935086926122e59190614165565b90508281101561230e5780925061230b83868960c001516123069190614142565b612b73565b91505b6000888152600560205260408120805485929061232c90849061417c565b9091555050604087015173ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000081169116036123b457836123a15760408701516123a19073ffffffffffffffffffffffffffffffffffffffff16333085611f6c565b6123af876020015183612b9c565b612421565b836123ee576123af338860200151848a6040015173ffffffffffffffffffffffffffffffffffffffff16611f6c909392919063ffffffff16565b612421876020015183896040015173ffffffffffffffffffffffffffffffffffffffff166129339092919063ffffffff16565b50505b95945050505050565b816000015173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f56450a30040c51955338a4a9fbafcf94f7ca4b75f4cd83c2f5e29ef77fbe0a3a8460600151600560008b815260200190815260200160002054898988608001518960a001518a60e001518c8c60c001518d61010001518e604001518f602001518f60405161255f9d9c9b9a999897969594939291909c8d5260208d019b909b5260408c019990995260608b019790975260808a019590955260a089019390935267ffffffffffffffff91821660c0890152811660e08801521661010086015263ffffffff1661012085015273ffffffffffffffffffffffffffffffffffffffff9081166101408501521661016083015215156101808201526101a00190565b60405180910390a3505050505050565b60006040518061012001604052808d73ffffffffffffffffffffffffffffffffffffffff1681526020018c73ffffffffffffffffffffffffffffffffffffffff1681526020018b73ffffffffffffffffffffffffffffffffffffffff1681526020018a81526020018981526020018881526020018767ffffffffffffffff1681526020018667ffffffffffffffff1681526020018563ffffffff16815250905061264460038463ffffffff168154811061262b5761262b613e3c565b9060005260206000209060030201600001548284612cdd565b6126aa576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600d60248201527f496e76616c69642070726f6f66000000000000000000000000000000000000006044820152606401610b7c565b60006126b582612150565b905060006126cc8284856060015160006001612180565b90506126de828260008087600161242d565b5050505050505050505050505050565b73ffffffffffffffffffffffffffffffffffffffff811661276b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f4261642062726964676520726f757465722061646472657373000000000000006044820152606401610b7c565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83169081179091556040517fa9e8c42c9e7fca7f62755189a16b2f5314d43d8fb24e91ba54e6d65f9314e84990600090a250565b60408051608060208201819052601160a08301527f4143524f53532d56322d4645452d312e3000000000000000000000000000000060c083015267ffffffffffffffff86169282019290925263ffffffff8416606082015290810185905260009060e001604051602081830303815290604052805190602001209050600061286182612cf5565b905061286e878285612d30565b50505050505050565b60006128aa82858560405160200161288f9190614194565b60405160208183030381529060405280519060200120612dce565b90505b9392505050565b6000806128c36101008461425e565b905060006128d361010085614272565b6000928352602095909552506040902054600190931b92831690921492915050565b60006129036101008361425e565b9050600061291361010084614272565b600092835260209490945250604090208054600190931b90921790915550565b60405173ffffffffffffffffffffffffffffffffffffffff83166024820152604481018290526106ab9084907fa9059cbb0000000000000000000000000000000000000000000000000000000090606401611fc6565b608081015160025482516040517fa9059cbb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9283166004820152602481019190915291169063a9059cbb906044016020604051808303816000875af1158015612a09573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061103e9190614286565b6000612a8f826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16612de49092919063ffffffff16565b8051909150156106ab5780806020019051810190612aad9190614286565b6106ab576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610b7c565b6000612b4d82670de0b6b3a76400006142a3565b67ffffffffffffffff16612b6984670de0b6b3a76400006142c4565b6128ad919061425e565b6000670de0b6b3a7640000612b8883826142a3565b612b699067ffffffffffffffff16856142c4565b73ffffffffffffffffffffffffffffffffffffffff82163b15612bfa5761103e73ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168383612933565b6040517f2e1a7d4d000000000000000000000000000000000000000000000000000000008152600481018290527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1690632e1a7d4d90602401600060405180830381600087803b158015612c8257600080fd5b505af1158015612c96573d6000803e3d6000fd5b505060405173ffffffffffffffffffffffffffffffffffffffff8516925083156108fc02915083906000818181858888f193505050501580156106ab573d6000803e3d6000fd5b60006128aa82858560405160200161288f919061409b565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01612163565b612d3a8282612df3565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16146106ab576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f696e76616c6964207369676e61747572650000000000000000000000000000006044820152606401610b7c565b600082612ddb8584612e17565b14949350505050565b60606128aa8484600085612e83565b6000806000612e028585613019565b91509150612e0f81613087565b509392505050565b600081815b8451811015612e0f576000858281518110612e3957612e39613e3c565b60200260200101519050808311612e5f5760008381526020829052604090209250612e70565b600081815260208490526040902092505b5080612e7b81613f61565b915050612e1c565b606082471015612f15576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610b7c565b73ffffffffffffffffffffffffffffffffffffffff85163b612f93576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610b7c565b6000808673ffffffffffffffffffffffffffffffffffffffff168587604051612fbc9190614301565b60006040518083038185875af1925050503d8060008114612ff9576040519150601f19603f3d011682016040523d82523d6000602084013e612ffe565b606091505b509150915061300e8282866132db565b979650505050505050565b600080825160410361304f5760208301516040840151606085015160001a6130438782858561332e565b94509450505050613080565b8251604003613078576020830151604084015161306d868383613446565b935093505050613080565b506000905060025b9250929050565b600081600481111561309b5761309b61431d565b036130a35750565b60018160048111156130b7576130b761431d565b0361311e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610b7c565b60028160048111156131325761313261431d565b03613199576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610b7c565b60038160048111156131ad576131ad61431d565b0361323a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610b7c565b600481600481111561324e5761324e61431d565b0361073a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610b7c565b606083156132ea5750816128ad565b8251156132fa5782518084602001fd5b816040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b7c9190613f4e565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115613365575060009050600361343d565b8460ff16601b1415801561337d57508460ff16601c14155b1561338e575060009050600461343d565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156133e2573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff81166134365760006001925092505061343d565b9150600090505b94509492505050565b6000807f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff83168161347c60ff86901c601b61417c565b905061348a8782888561332e565b935093505050935093915050565b803563ffffffff811681146134ac57600080fd5b919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60405160c0810167ffffffffffffffff81118282101715613503576135036134b1565b60405290565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715613550576135506134b1565b604052919050565b600067ffffffffffffffff821115613572576135726134b1565b5060051b60200190565b600082601f83011261358d57600080fd5b813560206135a261359d83613558565b613509565b82815260059290921b840181019181810190868411156135c157600080fd5b8286015b848110156135dc57803583529183019183016135c5565b509695505050505050565b803573ffffffffffffffffffffffffffffffffffffffff811681146134ac57600080fd5b600082601f83011261361c57600080fd5b8135602061362c61359d83613558565b82815260059290921b8401810191818101908684111561364b57600080fd5b8286015b848110156135dc57613660816135e7565b835291830191830161364f565b60008060006060848603121561368257600080fd5b61368b84613498565b9250602084013567ffffffffffffffff808211156136a857600080fd5b9085019060c082880312156136bc57600080fd5b6136c46134e0565b82358152602083013560208201526040830135828111156136e457600080fd5b6136f08982860161357c565b60408301525061370260608401613498565b6060820152613713608084016135e7565b608082015260a08301358281111561372a57600080fd5b6137368982860161360b565b60a0830152509350604086013591508082111561375257600080fd5b5061375f8682870161357c565b9150509250925092565b60006020828403121561377b57600080fd5b6128ad826135e7565b60006020828403121561379657600080fd5b5035919050565b801515811461073a57600080fd5b6000806000606084860312156137c057600080fd5b6137c9846135e7565b92506020840135915060408401356137e08161379d565b809150509250925092565b6000602082840312156137fd57600080fd5b6128ad82613498565b803567ffffffffffffffff811681146134ac57600080fd5b60008060008060008060c0878903121561383757600080fd5b613840876135e7565b955061384e602088016135e7565b9450604087013593506060870135925061386a60808801613806565b915061387860a08801613498565b90509295509295509295565b6000806040838503121561389757600080fd5b50508035926020909101359150565b600080604083850312156138b957600080fd5b6138c2836135e7565b946020939093013593505050565b6000806000806000806000806000806101408b8d0312156138f057600080fd5b6138f98b6135e7565b995061390760208c016135e7565b985061391560408c016135e7565b975060608b0135965060808b0135955060a08b0135945060c08b0135935061393f60e08c01613806565b925061394e6101008c01613806565b915061395d6101208c01613498565b90509295989b9194979a5092959850565b6000806020838503121561398157600080fd5b823567ffffffffffffffff8082111561399957600080fd5b818501915085601f8301126139ad57600080fd5b8135818111156139bc57600080fd5b8660208260051b85010111156139d157600080fd5b60209290920196919550909350505050565b60005b838110156139fe5781810151838201526020016139e6565b838111156117035750506000910152565b60008151808452613a278160208601602086016139e3565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b82811015613acc577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0888603018452613aba858351613a0f565b94509285019290850190600101613a80565b5092979650505050505050565b6000806000806000806000806000806101408b8d031215613af957600080fd5b613b028b6135e7565b9950613b1060208c016135e7565b9850613b1e60408c016135e7565b975060608b0135965060808b01359550613b3a60a08c01613806565b9450613b4860c08c01613806565b9350613b5660e08c01613498565b9250613b656101008c01613498565b91506101208b013567ffffffffffffffff811115613b8257600080fd5b613b8e8d828e0161357c565b9150509295989b9194979a5092959850565b600067ffffffffffffffff821115613bba57613bba6134b1565b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b600082601f830112613bf757600080fd5b8135613c0561359d82613ba0565b818152846020838601011115613c1a57600080fd5b816020850160208301376000918101602001919091529392505050565b60008060008060808587031215613c4d57600080fd5b613c56856135e7565b9350613c6460208601613806565b9250613c7260408601613498565b9150606085013567ffffffffffffffff811115613c8e57600080fd5b613c9a87828801613be6565b91505092959194509250565b6000806000806000806000806000806000806101808d8f031215613cc957600080fd5b613cd28d6135e7565b9b50613ce060208e016135e7565b9a50613cee60408e016135e7565b995060608d0135985060808d0135975060a08d0135965060c08d01359550613d1860e08e01613806565b9450613d276101008e01613806565b9350613d366101208e01613806565b9250613d456101408e01613498565b915067ffffffffffffffff6101608e01351115613d6157600080fd5b613d728e6101608f01358f01613be6565b90509295989b509295989b509295989b565b600060208284031215613d9657600080fd5b5051919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600063ffffffff83811690831681811015613de957613de9613d9d565b039392505050565b600063ffffffff808316818516808303821115613e1057613e10613d9d565b01949350505050565b600063ffffffff808316818103613e3257613e32613d9d565b6001019392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112613ea057600080fd5b83018035915067ffffffffffffffff821115613ebb57600080fd5b60200191503681900382131561308057600080fd5b8183823760009101908152919050565b600060208284031215613ef257600080fd5b815167ffffffffffffffff811115613f0957600080fd5b8201601f81018413613f1a57600080fd5b8051613f2861359d82613ba0565b818152856020838501011115613f3d57600080fd5b6124248260208301602086016139e3565b6020815260006128ad6020830184613a0f565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203613f9257613f92613d9d565b5060010190565b67ffffffffffffffff831681526040602082015260006128aa6040830184613a0f565b600081518084526020808501945080840160005b83811015613fec57815187529582019590820190600101613fd0565b509495945050505050565b600081518084526020808501945080840160005b83811015613fec57815173ffffffffffffffffffffffffffffffffffffffff168752958201959082019060010161400b565b85815260a06020820152600061405660a0830187613fbc565b73ffffffffffffffffffffffffffffffffffffffff808716604085015283820360608501526140858287613ff7565b9250808516608085015250509695505050505050565b815173ffffffffffffffffffffffffffffffffffffffff90811682526020808401518216908301526040808401519182169083015261012082019050606083015160608301526080830151608083015260a083015160a083015260c083015161411060c084018267ffffffffffffffff169052565b5060e083015161412c60e084018267ffffffffffffffff169052565b506101009283015163ffffffff16919092015290565b600067ffffffffffffffff808316818516808303821115613e1057613e10613d9d565b60008282101561417757614177613d9d565b500390565b6000821982111561418f5761418f613d9d565b500190565b6020815281516020820152602082015160408201526000604083015160c060608401526141c460e0840182613fbc565b905063ffffffff606085015116608084015273ffffffffffffffffffffffffffffffffffffffff60808501511660a084015260a08401517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08483030160c08501526124248282613ff7565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60008261426d5761426d61422f565b500490565b6000826142815761428161422f565b500690565b60006020828403121561429857600080fd5b81516128ad8161379d565b600067ffffffffffffffff83811690831681811015613de957613de9613d9d565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156142fc576142fc613d9d565b500290565b600082516143138184602087016139e3565b9190910192915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fdfea264697066735822122080ae738e10313af516a74677485d3f63d3712d15f7ab22875bb8d6465468b97064736f6c634300080d00330000000000000000000000000541f7536dc9f86708ae6e98ab35cc351b0d1289000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000000000000000000000000000000000000000000000

Deployed Bytecode

0x6080604052600436106101bb5760003560e01c806389a153cc116100ec578063de7eba781161008a578063ee2a53f811610064578063ee2a53f814610585578063f06850f6146105ba578063f2fde38b146105e7578063ffc351a31461060757600080fd5b8063de7eba7814610518578063e190440214610538578063e282d5b91461056557600080fd5b80639a8a0592116100c65780639a8a05921461048c578063a1244c671461049f578063ac9650d8146104d8578063be3576ee146104f857600080fd5b806389a153cc146104215780638a7860ce146104415780638da5cb5b1461046157600080fd5b806329cb924d116101595780635249fef1116101335780635249fef11461034a5780635285e0581461039557806357f6dcb8146103c2578063715018a61461040c57600080fd5b806329cb924d146102f45780634922897814610317578063493a4f841461032a57600080fd5b80631dfb2d02116101955780631dfb2d021461027457806322f8e56614610294578063272751c7146102b45780632752042e146102d457600080fd5b806317fcb39b146101c75780631b3d5559146102255780631c39c38d1461024757600080fd5b366101c257005b600080fd5b3480156101d357600080fd5b506101fb7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc281565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b34801561023157600080fd5b5061024561024036600461366d565b610627565b005b34801561025357600080fd5b506000546101fb9073ffffffffffffffffffffffffffffffffffffffff1681565b34801561028057600080fd5b5061024561028f366004613769565b6106b0565b3480156102a057600080fd5b506102456102af366004613784565b61073d565b3480156102c057600080fd5b506102456102cf3660046137ab565b6107e6565b3480156102e057600080fd5b506102456102ef3660046137eb565b6108f8565b34801561030057600080fd5b506103096109f9565b60405190815260200161021c565b61024561032536600461381e565b610ab1565b34801561033657600080fd5b50610245610345366004613884565b610f28565b34801561035657600080fd5b506103856103653660046138a6565b600460209081526000928352604080842090915290825290205460ff1681565b604051901515815260200161021c565b3480156103a157600080fd5b506001546101fb9073ffffffffffffffffffffffffffffffffffffffff1681565b3480156103ce57600080fd5b506002546103f79074010000000000000000000000000000000000000000900463ffffffff1681565b60405163ffffffff909116815260200161021c565b34801561041857600080fd5b50610245611042565b34801561042d57600080fd5b5061024561043c3660046138d0565b6110cf565b34801561044d57600080fd5b5061024561045c366004613784565b61122b565b34801561046d57600080fd5b5060065473ffffffffffffffffffffffffffffffffffffffff166101fb565b34801561049857600080fd5b5046610309565b3480156104ab57600080fd5b506002546103f7907801000000000000000000000000000000000000000000000000900463ffffffff1681565b6104eb6104e636600461396e565b6112ff565b60405161021c9190613a59565b34801561050457600080fd5b50610245610513366004613ad9565b6114d9565b34801561052457600080fd5b50610245610533366004613769565b611565565b34801561054457600080fd5b506002546101fb9073ffffffffffffffffffffffffffffffffffffffff1681565b34801561057157600080fd5b50610245610580366004613c37565b6115ab565b34801561059157600080fd5b506105a56105a0366004613784565b611709565b6040805192835260208301919091520161021c565b3480156105c657600080fd5b506103096105d5366004613784565b60056020526000908152604090205481565b3480156105f357600080fd5b50610245610602366004613769565b611737565b34801561061357600080fd5b50610245610622366004613ca6565b611864565b61062f6119cf565b61065c600080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff169055565b610667838383611a53565b6106ab600080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1674010000000000000000000000000000000000000000179055565b505050565b6106b8611dff565b6106c06119cf565b6106ed600080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff169055565b6106f681611e80565b61073a600080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1674010000000000000000000000000000000000000000179055565b50565b60005473ffffffffffffffffffffffffffffffffffffffff1661075f57600080fd5b6000546040517f22f8e5660000000000000000000000000000000000000000000000000000000081526004810183905273ffffffffffffffffffffffffffffffffffffffff909116906322f8e56690602401600060405180830381600087803b1580156107cb57600080fd5b505af11580156107df573d6000803e3d6000fd5b5050505050565b6107ee611dff565b6107f66119cf565b610823600080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff169055565b73ffffffffffffffffffffffffffffffffffffffff8316600081815260046020908152604080832086845282529182902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001685151590811790915591519182528492917f0a21fdd43d0ad0c62689ee7230a47309a050755bcc52eba00310add65297692a910160405180910390a36106ab600080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1674010000000000000000000000000000000000000000179055565b610900611dff565b6109086119cf565b610935600080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff169055565b600280547fffffffffffffffff00000000ffffffffffffffffffffffffffffffffffffffff167401000000000000000000000000000000000000000063ffffffff8416908102919091179091556040519081527f0e55dd180fa793d9036c804d0a116e6a7617a48e72cee1f83d92793a793fcc039060200160405180910390a161073a600080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1674010000000000000000000000000000000000000000179055565b6000805473ffffffffffffffffffffffffffffffffffffffff1615610aac5760008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166329cb924d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a83573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aa79190613d84565b905090565b504290565b610ab96119cf565b610ae6600080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff169055565b73ffffffffffffffffffffffffffffffffffffffff8516600090815260046020908152604080832086845290915290205460ff16610b85576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f44697361626c656420726f75746500000000000000000000000000000000000060448201526064015b60405180910390fd5b6706f05b59d3b200008267ffffffffffffffff1610610c00576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f696e76616c69642072656c6179657220666565000000000000000000000000006044820152606401610b7c565b600254610c2b9074010000000000000000000000000000000000000000900463ffffffff1682613dcc565b63ffffffff16610c396109f9565b10158015610c7e5750600254610c6d9074010000000000000000000000000000000000000000900463ffffffff1682613df1565b63ffffffff16610c7b6109f9565b11155b610ce4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f696e76616c69642071756f74652074696d6500000000000000000000000000006044820152606401610b7c565b7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc273ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16148015610d3f5750600034115b15610e3357833414610dad576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f6d73672e76616c7565206d757374206d6174636820616d6f756e7400000000006044820152606401610b7c565b7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc273ffffffffffffffffffffffffffffffffffffffff1663d0e30db0346040518263ffffffff1660e01b81526004016000604051808303818588803b158015610e1557600080fd5b505af1158015610e29573d6000803e3d6000fd5b5050505050610e55565b610e5573ffffffffffffffffffffffffffffffffffffffff8616333087611f6c565b610e8c8446600254869086907801000000000000000000000000000000000000000000000000900463ffffffff16868b8d33612048565b60028054601890610ebe907801000000000000000000000000000000000000000000000000900463ffffffff16613e19565b91906101000a81548163ffffffff021916908363ffffffff160217905550610f20600080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1674010000000000000000000000000000000000000000179055565b505050505050565b610f30611dff565b610f386119cf565b610f65600080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff169055565b6003805460018101825560008281529181027fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85c81018590557fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b01838155604051919290918491869163ffffffff8616917fc86ba04c55bc5eb2f2876b91c438849a296dbec7b08751c3074d92e04f0a77af91a4505061103e600080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1674010000000000000000000000000000000000000000179055565b5050565b60065473ffffffffffffffffffffffffffffffffffffffff1633146110c3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610b7c565b6110cd60006120d9565b565b6110d76119cf565b611104600080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff169055565b60006040518061012001604052808c73ffffffffffffffffffffffffffffffffffffffff1681526020018b73ffffffffffffffffffffffffffffffffffffffff1681526020018a73ffffffffffffffffffffffffffffffffffffffff1681526020018981526020018681526020016111794690565b81526020018567ffffffffffffffff1681526020018467ffffffffffffffff1681526020018363ffffffff16815250905060006111b582612150565b905060006111c782848b886000612180565b90506111d882828a8887600061242d565b50505061121f600080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1674010000000000000000000000000000000000000000179055565b50505050505050505050565b611233611dff565b61123b6119cf565b611268600080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff169055565b6003818154811061127b5761127b613e3c565b60009182526020822060039091020181815560010181905560405182917f3569b846531b754c99cb80df3f49cd72fa6fe106aaee5ab8e0caf35a9d7ce88d91a261073a600080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1674010000000000000000000000000000000000000000179055565b60603415611369576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f4f6e6c79206d756c746963616c6c207769746820302076616c756500000000006044820152606401610b7c565b8167ffffffffffffffff811115611382576113826134b1565b6040519080825280602002602001820160405280156113b557816020015b60608152602001906001900390816113a05790505b50905060005b828110156114d257600080308686858181106113d9576113d9613e3c565b90506020028101906113eb9190613e6b565b6040516113f9929190613ed0565b600060405180830381855af49150503d8060008114611434576040519150601f19603f3d011682016040523d82523d6000602084013e611439565b606091505b50915091508161149f5760448151101561145257600080fd5b6004810190508080602001905181019061146c9190613ee0565b6040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b7c9190613f4e565b808484815181106114b2576114b2613e3c565b6020026020010181905250505080806114ca90613f61565b9150506113bb565b5092915050565b6114e16119cf565b61150e600080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff169055565b6115218a8a8a8a8a468b8b8b8b8b61256f565b61121f600080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1674010000000000000000000000000000000000000000179055565b61156d611dff565b6115756119cf565b6115a2600080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff169055565b6106f6816126ee565b6115b36119cf565b6115e0600080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff169055565b6706f05b59d3b200008367ffffffffffffffff161061165b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f696e76616c69642072656c6179657220666565000000000000000000000000006044820152606401610b7c565b61166884468585856127da565b8373ffffffffffffffffffffffffffffffffffffffff168263ffffffff167fb9de16bf376724405019a10ef4fedac57fecd292bf86c08d81d7c42d394d5d3785846040516116b7929190613f99565b60405180910390a3611703600080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1674010000000000000000000000000000000000000000179055565b50505050565b6003818154811061171957600080fd5b60009182526020909120600390910201805460019091015490915082565b60065473ffffffffffffffffffffffffffffffffffffffff1633146117b8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610b7c565b73ffffffffffffffffffffffffffffffffffffffff811661185b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610b7c565b61073a816120d9565b61186c6119cf565b611899600080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff169055565b6118a68c878585856127da565b60006040518061012001604052808e73ffffffffffffffffffffffffffffffffffffffff1681526020018d73ffffffffffffffffffffffffffffffffffffffff1681526020018c73ffffffffffffffffffffffffffffffffffffffff1681526020018b815260200188815260200161191b4690565b81526020018767ffffffffffffffff1681526020018667ffffffffffffffff1681526020018463ffffffff168152509050600061195782612150565b9050600061196982848d896000612180565b905061197a82828c8987600061242d565b5050506119c1600080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1674010000000000000000000000000000000000000000179055565b505050505050505050505050565b60005474010000000000000000000000000000000000000000900460ff166110cd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610b7c565b46826020015114611ac0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f496e76616c696420636861696e496400000000000000000000000000000000006044820152606401610b7c565b8160400151518260a001515114611b33576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f696e76616c6964206c65616600000000000000000000000000000000000000006044820152606401610b7c565b600060038463ffffffff1681548110611b4e57611b4e613e3c565b90600052602060002090600302019050611b6d81600101548484612877565b611bd3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f4261642050726f6f6600000000000000000000000000000000000000000000006044820152606401610b7c565b611bea81600201846060015163ffffffff166128b4565b15611c51576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f416c726561647920636c61696d656400000000000000000000000000000000006044820152606401610b7c565b611c6881600201846060015163ffffffff166128f5565b60408301515160005b81811015611cf957600085604001518281518110611c9157611c91613e3c565b602002602001015190506000811115611cf057611cf08660a001518381518110611cbd57611cbd613e3c565b602002602001015182886080015173ffffffffffffffffffffffffffffffffffffffff166129339092919063ffffffff16565b50600101611c71565b50835115611d9257611d0a84612989565b836080015173ffffffffffffffffffffffffffffffffffffffff16846060015163ffffffff1685602001517f828fc203220356df8f072a91681caee7d5c75095e2a95e80ed5a14b384697f71876000015133604051611d8992919091825273ffffffffffffffffffffffffffffffffffffffff16602082015260400190565b60405180910390a45b836060015163ffffffff168563ffffffff1685602001517ff8bd640004bcec1b89657020f561d0b070cbdf662d0b158db9dccb0a8301bfab8760000151886040015189608001518a60a0015133604051611df095949392919061403d565b60405180910390a45050505050565b60065473ffffffffffffffffffffffffffffffffffffffff1633146110cd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610b7c565b73ffffffffffffffffffffffffffffffffffffffff8116611efd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f4261642068756220706f6f6c20616464726573730000000000000000000000006044820152606401610b7c565b600280547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83169081179091556040517f1f17a88f67b0f49060a34bec1a4723a563620e6aa265eb640b5046dcee0759a090600090a250565b60405173ffffffffffffffffffffffffffffffffffffffff808516602483015283166044820152606481018290526117039085907f23b872dd00000000000000000000000000000000000000000000000000000000906084015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152612a2d565b604080518a8152602081018a905290810188905267ffffffffffffffff8716606082015263ffffffff858116608083015273ffffffffffffffffffffffffffffffffffffffff84811660a084015280841692908616918816907f4a4fc49abd237bfd7f4ac82d6c7a284c69daaea5154430cff04ad7482c6c42549060c00160405180910390a4505050505050505050565b6006805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600081604051602001612163919061409b565b604051602081830303815290604052805190602001209050919050565b60006706f05b59d3b200008367ffffffffffffffff161080156121b857506706f05b59d3b200008560c0015167ffffffffffffffff16105b61221e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f696e76616c6964206665657300000000000000000000000000000000000000006044820152606401610b7c565b606085015160008781526005602052604090205410612299576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f72656c61792066696c6c656400000000000000000000000000000000000000006044820152606401610b7c565b836000036122a957506000612424565b6122c284848760c001516122bd9190614142565b612b39565b600087815260056020526040812054606088015192935086926122e59190614165565b90508281101561230e5780925061230b83868960c001516123069190614142565b612b73565b91505b6000888152600560205260408120805485929061232c90849061417c565b9091555050604087015173ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc281169116036123b457836123a15760408701516123a19073ffffffffffffffffffffffffffffffffffffffff16333085611f6c565b6123af876020015183612b9c565b612421565b836123ee576123af338860200151848a6040015173ffffffffffffffffffffffffffffffffffffffff16611f6c909392919063ffffffff16565b612421876020015183896040015173ffffffffffffffffffffffffffffffffffffffff166129339092919063ffffffff16565b50505b95945050505050565b816000015173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f56450a30040c51955338a4a9fbafcf94f7ca4b75f4cd83c2f5e29ef77fbe0a3a8460600151600560008b815260200190815260200160002054898988608001518960a001518a60e001518c8c60c001518d61010001518e604001518f602001518f60405161255f9d9c9b9a999897969594939291909c8d5260208d019b909b5260408c019990995260608b019790975260808a019590955260a089019390935267ffffffffffffffff91821660c0890152811660e08801521661010086015263ffffffff1661012085015273ffffffffffffffffffffffffffffffffffffffff9081166101408501521661016083015215156101808201526101a00190565b60405180910390a3505050505050565b60006040518061012001604052808d73ffffffffffffffffffffffffffffffffffffffff1681526020018c73ffffffffffffffffffffffffffffffffffffffff1681526020018b73ffffffffffffffffffffffffffffffffffffffff1681526020018a81526020018981526020018881526020018767ffffffffffffffff1681526020018667ffffffffffffffff1681526020018563ffffffff16815250905061264460038463ffffffff168154811061262b5761262b613e3c565b9060005260206000209060030201600001548284612cdd565b6126aa576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600d60248201527f496e76616c69642070726f6f66000000000000000000000000000000000000006044820152606401610b7c565b60006126b582612150565b905060006126cc8284856060015160006001612180565b90506126de828260008087600161242d565b5050505050505050505050505050565b73ffffffffffffffffffffffffffffffffffffffff811661276b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f4261642062726964676520726f757465722061646472657373000000000000006044820152606401610b7c565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83169081179091556040517fa9e8c42c9e7fca7f62755189a16b2f5314d43d8fb24e91ba54e6d65f9314e84990600090a250565b60408051608060208201819052601160a08301527f4143524f53532d56322d4645452d312e3000000000000000000000000000000060c083015267ffffffffffffffff86169282019290925263ffffffff8416606082015290810185905260009060e001604051602081830303815290604052805190602001209050600061286182612cf5565b905061286e878285612d30565b50505050505050565b60006128aa82858560405160200161288f9190614194565b60405160208183030381529060405280519060200120612dce565b90505b9392505050565b6000806128c36101008461425e565b905060006128d361010085614272565b6000928352602095909552506040902054600190931b92831690921492915050565b60006129036101008361425e565b9050600061291361010084614272565b600092835260209490945250604090208054600190931b90921790915550565b60405173ffffffffffffffffffffffffffffffffffffffff83166024820152604481018290526106ab9084907fa9059cbb0000000000000000000000000000000000000000000000000000000090606401611fc6565b608081015160025482516040517fa9059cbb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9283166004820152602481019190915291169063a9059cbb906044016020604051808303816000875af1158015612a09573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061103e9190614286565b6000612a8f826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16612de49092919063ffffffff16565b8051909150156106ab5780806020019051810190612aad9190614286565b6106ab576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610b7c565b6000612b4d82670de0b6b3a76400006142a3565b67ffffffffffffffff16612b6984670de0b6b3a76400006142c4565b6128ad919061425e565b6000670de0b6b3a7640000612b8883826142a3565b612b699067ffffffffffffffff16856142c4565b73ffffffffffffffffffffffffffffffffffffffff82163b15612bfa5761103e73ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2168383612933565b6040517f2e1a7d4d000000000000000000000000000000000000000000000000000000008152600481018290527f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc273ffffffffffffffffffffffffffffffffffffffff1690632e1a7d4d90602401600060405180830381600087803b158015612c8257600080fd5b505af1158015612c96573d6000803e3d6000fd5b505060405173ffffffffffffffffffffffffffffffffffffffff8516925083156108fc02915083906000818181858888f193505050501580156106ab573d6000803e3d6000fd5b60006128aa82858560405160200161288f919061409b565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01612163565b612d3a8282612df3565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16146106ab576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f696e76616c6964207369676e61747572650000000000000000000000000000006044820152606401610b7c565b600082612ddb8584612e17565b14949350505050565b60606128aa8484600085612e83565b6000806000612e028585613019565b91509150612e0f81613087565b509392505050565b600081815b8451811015612e0f576000858281518110612e3957612e39613e3c565b60200260200101519050808311612e5f5760008381526020829052604090209250612e70565b600081815260208490526040902092505b5080612e7b81613f61565b915050612e1c565b606082471015612f15576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610b7c565b73ffffffffffffffffffffffffffffffffffffffff85163b612f93576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610b7c565b6000808673ffffffffffffffffffffffffffffffffffffffff168587604051612fbc9190614301565b60006040518083038185875af1925050503d8060008114612ff9576040519150601f19603f3d011682016040523d82523d6000602084013e612ffe565b606091505b509150915061300e8282866132db565b979650505050505050565b600080825160410361304f5760208301516040840151606085015160001a6130438782858561332e565b94509450505050613080565b8251604003613078576020830151604084015161306d868383613446565b935093505050613080565b506000905060025b9250929050565b600081600481111561309b5761309b61431d565b036130a35750565b60018160048111156130b7576130b761431d565b0361311e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610b7c565b60028160048111156131325761313261431d565b03613199576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610b7c565b60038160048111156131ad576131ad61431d565b0361323a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610b7c565b600481600481111561324e5761324e61431d565b0361073a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610b7c565b606083156132ea5750816128ad565b8251156132fa5782518084602001fd5b816040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b7c9190613f4e565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115613365575060009050600361343d565b8460ff16601b1415801561337d57508460ff16601c14155b1561338e575060009050600461343d565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156133e2573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff81166134365760006001925092505061343d565b9150600090505b94509492505050565b6000807f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff83168161347c60ff86901c601b61417c565b905061348a8782888561332e565b935093505050935093915050565b803563ffffffff811681146134ac57600080fd5b919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60405160c0810167ffffffffffffffff81118282101715613503576135036134b1565b60405290565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715613550576135506134b1565b604052919050565b600067ffffffffffffffff821115613572576135726134b1565b5060051b60200190565b600082601f83011261358d57600080fd5b813560206135a261359d83613558565b613509565b82815260059290921b840181019181810190868411156135c157600080fd5b8286015b848110156135dc57803583529183019183016135c5565b509695505050505050565b803573ffffffffffffffffffffffffffffffffffffffff811681146134ac57600080fd5b600082601f83011261361c57600080fd5b8135602061362c61359d83613558565b82815260059290921b8401810191818101908684111561364b57600080fd5b8286015b848110156135dc57613660816135e7565b835291830191830161364f565b60008060006060848603121561368257600080fd5b61368b84613498565b9250602084013567ffffffffffffffff808211156136a857600080fd5b9085019060c082880312156136bc57600080fd5b6136c46134e0565b82358152602083013560208201526040830135828111156136e457600080fd5b6136f08982860161357c565b60408301525061370260608401613498565b6060820152613713608084016135e7565b608082015260a08301358281111561372a57600080fd5b6137368982860161360b565b60a0830152509350604086013591508082111561375257600080fd5b5061375f8682870161357c565b9150509250925092565b60006020828403121561377b57600080fd5b6128ad826135e7565b60006020828403121561379657600080fd5b5035919050565b801515811461073a57600080fd5b6000806000606084860312156137c057600080fd5b6137c9846135e7565b92506020840135915060408401356137e08161379d565b809150509250925092565b6000602082840312156137fd57600080fd5b6128ad82613498565b803567ffffffffffffffff811681146134ac57600080fd5b60008060008060008060c0878903121561383757600080fd5b613840876135e7565b955061384e602088016135e7565b9450604087013593506060870135925061386a60808801613806565b915061387860a08801613498565b90509295509295509295565b6000806040838503121561389757600080fd5b50508035926020909101359150565b600080604083850312156138b957600080fd5b6138c2836135e7565b946020939093013593505050565b6000806000806000806000806000806101408b8d0312156138f057600080fd5b6138f98b6135e7565b995061390760208c016135e7565b985061391560408c016135e7565b975060608b0135965060808b0135955060a08b0135945060c08b0135935061393f60e08c01613806565b925061394e6101008c01613806565b915061395d6101208c01613498565b90509295989b9194979a5092959850565b6000806020838503121561398157600080fd5b823567ffffffffffffffff8082111561399957600080fd5b818501915085601f8301126139ad57600080fd5b8135818111156139bc57600080fd5b8660208260051b85010111156139d157600080fd5b60209290920196919550909350505050565b60005b838110156139fe5781810151838201526020016139e6565b838111156117035750506000910152565b60008151808452613a278160208601602086016139e3565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b82811015613acc577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0888603018452613aba858351613a0f565b94509285019290850190600101613a80565b5092979650505050505050565b6000806000806000806000806000806101408b8d031215613af957600080fd5b613b028b6135e7565b9950613b1060208c016135e7565b9850613b1e60408c016135e7565b975060608b0135965060808b01359550613b3a60a08c01613806565b9450613b4860c08c01613806565b9350613b5660e08c01613498565b9250613b656101008c01613498565b91506101208b013567ffffffffffffffff811115613b8257600080fd5b613b8e8d828e0161357c565b9150509295989b9194979a5092959850565b600067ffffffffffffffff821115613bba57613bba6134b1565b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b600082601f830112613bf757600080fd5b8135613c0561359d82613ba0565b818152846020838601011115613c1a57600080fd5b816020850160208301376000918101602001919091529392505050565b60008060008060808587031215613c4d57600080fd5b613c56856135e7565b9350613c6460208601613806565b9250613c7260408601613498565b9150606085013567ffffffffffffffff811115613c8e57600080fd5b613c9a87828801613be6565b91505092959194509250565b6000806000806000806000806000806000806101808d8f031215613cc957600080fd5b613cd28d6135e7565b9b50613ce060208e016135e7565b9a50613cee60408e016135e7565b995060608d0135985060808d0135975060a08d0135965060c08d01359550613d1860e08e01613806565b9450613d276101008e01613806565b9350613d366101208e01613806565b9250613d456101408e01613498565b915067ffffffffffffffff6101608e01351115613d6157600080fd5b613d728e6101608f01358f01613be6565b90509295989b509295989b509295989b565b600060208284031215613d9657600080fd5b5051919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600063ffffffff83811690831681811015613de957613de9613d9d565b039392505050565b600063ffffffff808316818516808303821115613e1057613e10613d9d565b01949350505050565b600063ffffffff808316818103613e3257613e32613d9d565b6001019392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112613ea057600080fd5b83018035915067ffffffffffffffff821115613ebb57600080fd5b60200191503681900382131561308057600080fd5b8183823760009101908152919050565b600060208284031215613ef257600080fd5b815167ffffffffffffffff811115613f0957600080fd5b8201601f81018413613f1a57600080fd5b8051613f2861359d82613ba0565b818152856020838501011115613f3d57600080fd5b6124248260208301602086016139e3565b6020815260006128ad6020830184613a0f565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203613f9257613f92613d9d565b5060010190565b67ffffffffffffffff831681526040602082015260006128aa6040830184613a0f565b600081518084526020808501945080840160005b83811015613fec57815187529582019590820190600101613fd0565b509495945050505050565b600081518084526020808501945080840160005b83811015613fec57815173ffffffffffffffffffffffffffffffffffffffff168752958201959082019060010161400b565b85815260a06020820152600061405660a0830187613fbc565b73ffffffffffffffffffffffffffffffffffffffff808716604085015283820360608501526140858287613ff7565b9250808516608085015250509695505050505050565b815173ffffffffffffffffffffffffffffffffffffffff90811682526020808401518216908301526040808401519182169083015261012082019050606083015160608301526080830151608083015260a083015160a083015260c083015161411060c084018267ffffffffffffffff169052565b5060e083015161412c60e084018267ffffffffffffffff169052565b506101009283015163ffffffff16919092015290565b600067ffffffffffffffff808316818516808303821115613e1057613e10613d9d565b60008282101561417757614177613d9d565b500390565b6000821982111561418f5761418f613d9d565b500190565b6020815281516020820152602082015160408201526000604083015160c060608401526141c460e0840182613fbc565b905063ffffffff606085015116608084015273ffffffffffffffffffffffffffffffffffffffff60808501511660a084015260a08401517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08483030160c08501526124248282613ff7565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60008261426d5761426d61422f565b500490565b6000826142815761428161422f565b500690565b60006020828403121561429857600080fd5b81516128ad8161379d565b600067ffffffffffffffff83811690831681811015613de957613de9613d9d565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156142fc576142fc613d9d565b500290565b600082516143138184602087016139e3565b9190910192915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fdfea264697066735822122080ae738e10313af516a74677485d3f63d3712d15f7ab22875bb8d6465468b97064736f6c634300080d0033

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

0000000000000000000000000541f7536dc9f86708ae6e98ab35cc351b0d1289000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000000000000000000000000000000000000000000000

-----Decoded View---------------
Arg [0] : _hubPool (address): 0x0541f7536dc9f86708aE6e98aB35cc351B0D1289
Arg [1] : _wethAddress (address): 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2
Arg [2] : timerAddress (address): 0x0000000000000000000000000000000000000000

-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 0000000000000000000000000541f7536dc9f86708ae6e98ab35cc351b0d1289
Arg [1] : 000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000000


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  ]
[ 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.