ETH Price: $3,103.12 (-0.78%)
Gas: 4 Gwei

Contract

0x43298F9f91a4545dF64748e78a2c777c580573d6
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Value
Add Liquidity194347122024-03-14 17:26:4765 days ago1710437207IN
Across Protocol: Badger Bridge Pool
0 ETH0.0099713855.6709437
Remove Liquidity193879902024-03-08 4:13:2372 days ago1709871203IN
Across Protocol: Badger Bridge Pool
0 ETH0.007202949.09150416
Sync With Bridge...158850402022-11-02 21:33:11563 days ago1667424791IN
Across Protocol: Badger Bridge Pool
0 ETH0.0010004523.12987848
Settle Relay149807302022-06-17 18:50:33701 days ago1655491833IN
Across Protocol: Badger Bridge Pool
0 ETH0.0096359556.24764354
Relay And Speed ...149802382022-06-17 16:48:59701 days ago1655484539IN
Across Protocol: Badger Bridge Pool
0 ETH0.0144103751.04358608
Settle Relay149785542022-06-17 9:56:22701 days ago1655459782IN
Across Protocol: Badger Bridge Pool
0 ETH0.0042976125.08809657
Relay And Speed ...149780622022-06-17 7:54:43702 days ago1655452483IN
Across Protocol: Badger Bridge Pool
0 ETH0.0062134422.00985619
Settle Relay149745372022-06-16 17:20:41702 days ago1655400041IN
Across Protocol: Badger Bridge Pool
0 ETH0.0061492535.89488196
Relay And Speed ...149740162022-06-16 15:18:38702 days ago1655392718IN
Across Protocol: Badger Bridge Pool
0 ETH0.0185600165.74222049
Settle Relay149672412022-06-15 11:24:30703 days ago1655292270IN
Across Protocol: Badger Bridge Pool
0 ETH0.0075992244.35873678
Relay And Speed ...149667662022-06-15 9:22:41704 days ago1655284961IN
Across Protocol: Badger Bridge Pool
0 ETH0.0272578496.55116949
Settle Relay149619942022-06-14 13:31:59704 days ago1655213519IN
Across Protocol: Badger Bridge Pool
0 ETH0.0053046830.96486317
Relay And Speed ...149615022022-06-14 11:30:30704 days ago1655206230IN
Across Protocol: Badger Bridge Pool
0 ETH0.0103847336.78421874
Settle Relay149563522022-06-13 14:01:17705 days ago1655128877IN
Across Protocol: Badger Bridge Pool
0 ETH0.0137158780.06326598
Relay And Speed ...149558822022-06-13 12:00:53705 days ago1655121653IN
Across Protocol: Badger Bridge Pool
0 ETH0.022627380.14914458
Settle Relay149442132022-06-11 12:20:49707 days ago1654950049IN
Across Protocol: Badger Bridge Pool
0 ETH0.0070970641.39941822
Relay And Speed ...149437222022-06-11 10:18:44707 days ago1654942724IN
Across Protocol: Badger Bridge Pool
0 ETH0.0055010419.48549487
Remove Liquidity148823582022-06-01 2:34:12718 days ago1654050852IN
Across Protocol: Badger Bridge Pool
0 ETH0.0095572860.73165883
Settle Relay148532352022-05-27 9:00:38723 days ago1653642038IN
Across Protocol: Badger Bridge Pool
0 ETH0.008337948.6706118
Relay And Speed ...148527192022-05-27 6:58:51723 days ago1653634731IN
Across Protocol: Badger Bridge Pool
0 ETH0.0095141833.70059097
Settle Relay148487412022-05-26 15:30:36723 days ago1653579036IN
Across Protocol: Badger Bridge Pool
0 ETH0.0095155455.54480031
Relay And Speed ...148482062022-05-26 13:28:50723 days ago1653571730IN
Across Protocol: Badger Bridge Pool
0 ETH0.0218258777.31035921
Settle Relay148416482022-05-25 11:34:33724 days ago1653478473IN
Across Protocol: Badger Bridge Pool
0 ETH0.0036563821.34328517
Relay And Speed ...148411192022-05-25 9:34:04725 days ago1653471244IN
Across Protocol: Badger Bridge Pool
0 ETH0.0051621518.28509539
Settle Relay148192392022-05-21 20:06:44728 days ago1653163604IN
Across Protocol: Badger Bridge Pool
0 ETH0.0034345620.04985801
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
BridgePoolProd

Compiler Version
v0.8.9+commit.e5eed63a

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, GNU AGPLv3 license
File 1 of 22 : BridgePool.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity ^0.8.0;

import "./interfaces/BridgeAdminInterface.sol";
import "./interfaces/BridgePoolInterface.sol";

import "../oracle/interfaces/SkinnyOptimisticOracleInterface.sol";
import "../oracle/interfaces/StoreInterface.sol";
import "../oracle/interfaces/FinderInterface.sol";
import "../oracle/implementation/Constants.sol";

import "../common/implementation/AncillaryData.sol";
import "../common/implementation/Testable.sol";
import "../common/implementation/FixedPoint.sol";
import "../common/implementation/Lockable.sol";
import "../common/implementation/MultiCaller.sol";

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

interface WETH9Like {
    function withdraw(uint256 wad) external;

    function deposit() external payable;
}

/**
 * @notice Contract deployed on L1 that provides methods for "Relayers" to fulfill deposit orders that originated on L2.
 * The Relayers can either post capital to fulfill the deposit (instant relay), or request that the funds are taken out
 * of a passive liquidity provider pool following a challenge period (slow relay). This contract ingests liquidity from
 * passive liquidity providers and returns them claims to withdraw their funds. Liquidity providers are incentivized
 * to post collateral by earning a fee per fulfilled deposit order.
 * @dev A "Deposit" is an order to send capital from L2 to L1, and a "Relay" is a fulfillment attempt of that order.
 */
contract BridgePool is MultiCaller, Testable, BridgePoolInterface, ERC20, Lockable {
    using SafeERC20 for IERC20;
    using FixedPoint for FixedPoint.Unsigned;
    using Address for address;

    // Token that this contract receives as LP deposits.
    IERC20 public override l1Token;

    // Track the total number of relays and uniquely identifies relays.
    uint32 public numberOfRelays;

    // Reserves that are unutilized and withdrawable.
    uint256 public liquidReserves;

    // Reserves currently utilized due to L2-L1 transactions in flight.
    int256 public utilizedReserves;

    // Reserves that are not yet utilized but are pre-allocated for a pending relay.
    uint256 public pendingReserves;

    // True If this pool houses WETH. If the withdrawn token is WETH then unwrap and send ETH when finalizing
    // withdrawal.
    bool public isWethPool;

    // Exponential decay exchange rate to accumulate fees to LPs over time.
    uint64 public lpFeeRatePerSecond;

    // Last timestamp that LP fees were updated.
    uint32 public lastLpFeeUpdate;

    // Store local instances of contract params to save gas relaying.
    uint64 public proposerBondPct;
    uint32 public optimisticOracleLiveness;

    // Store local instance of the reserve currency final fee. This is a gas optimization to not re-call the store.
    uint256 l1TokenFinalFee;

    // Cumulative undistributed LP fees. As fees accumulate, they are subtracted from this number.
    uint256 public undistributedLpFees;

    // Total bond amount held for pending relays. Bonds are released following a successful relay or after a dispute.
    uint256 public bonds;

    // Administrative contract that deployed this contract and also houses all state variables needed to relay deposits.
    BridgeAdminInterface public bridgeAdmin;

    // Store local instances of the contract instances to save gas relaying. Can be sync with the Finder at any time via
    // the syncUmaEcosystemParams() public function.
    StoreInterface public store;
    SkinnyOptimisticOracleInterface public optimisticOracle;

    // DVM price request identifier that is resolved based on the validity of a relay attempt.
    bytes32 public identifier;

    // A Relay represents an attempt to finalize a cross-chain transfer that originated on an L2 DepositBox contract.
    // The flow chart between states is as follows:
    // - Begin at Uninitialized.
    // - When relayDeposit() is called, a new relay is created with state Pending and mapped to the L2 deposit hash.
    // - If the relay is disputed, the RelayData gets deleted and the L2 deposit hash has no relay mapped to it anymore.
    // - The above statements enable state to transfer between the Uninitialized and Pending states.
    // - When settleRelay() is successfully called, the relay state gets set to Finalized and cannot change from there.
    // - It is impossible for a relay to be deleted when in Finalized state (and have its state set to Uninitialized)
    //   because the only way for settleRelay() to succeed is if the price has resolved on the OptimisticOracle.
    // - You cannot dispute an already resolved request on the OptimisticOracle. Moreover, the mapping from
    //   a relay's ancillary data hash to its deposit hash is deleted after a successful settleRelay() call.
    enum RelayState { Uninitialized, Pending, Finalized }

    // Data from L2 deposit transaction.
    struct DepositData {
        uint256 chainId;
        uint64 depositId;
        address payable l1Recipient;
        address l2Sender;
        uint256 amount;
        uint64 slowRelayFeePct;
        uint64 instantRelayFeePct;
        uint32 quoteTimestamp;
    }

    // Each L2 Deposit can have one Relay attempt at any one time. A Relay attempt is characterized by its RelayData.
    struct RelayData {
        RelayState relayState;
        address slowRelayer;
        uint32 relayId;
        uint64 realizedLpFeePct;
        uint32 priceRequestTime;
        uint256 proposerBond;
        uint256 finalFee;
    }

    // Associate deposits with pending relay data. When the mapped relay hash is empty, new relay attempts can be made
    // for this deposit. The relay data contains information necessary to pay out relayers on successful relay.
    // Relay hashes are deleted when they are disputed on the OptimisticOracle.
    mapping(bytes32 => bytes32) public relays;

    // Map hash of deposit and realized-relay fee to instant relayers. This mapping is checked at settlement time
    // to determine if there was a valid instant relayer.
    mapping(bytes32 => address) public instantRelays;

    event LiquidityAdded(uint256 amount, uint256 lpTokensMinted, address indexed liquidityProvider);
    event LiquidityRemoved(uint256 amount, uint256 lpTokensBurnt, address indexed liquidityProvider);
    event DepositRelayed(
        bytes32 indexed depositHash,
        DepositData depositData,
        RelayData relay,
        bytes32 relayAncillaryDataHash
    );
    event RelaySpedUp(bytes32 indexed depositHash, address indexed instantRelayer, RelayData relay);

    // Note: the difference between a dispute and a cancellation is that a cancellation happens in the case where
    // something changes in the OO between request and dispute that causes calls to it to fail. The most common
    // case would be an increase in final fee. However, things like whitelisting can also cause problems.
    event RelayDisputed(bytes32 indexed depositHash, bytes32 indexed relayHash, address indexed disputer);
    event RelayCanceled(bytes32 indexed depositHash, bytes32 indexed relayHash, address indexed disputer);
    event RelaySettled(bytes32 indexed depositHash, address indexed caller, RelayData relay);
    event BridgePoolAdminTransferred(address oldAdmin, address newAdmin);

    /**
     * @notice Construct the Bridge Pool.
     * @param _lpTokenName Name of the LP token to be deployed by this contract.
     * @param _lpTokenSymbol Symbol of the LP token to be deployed by this contract.
     * @param _bridgeAdmin Admin contract deployed alongside on L1. Stores global variables and has owner control.
     * @param _l1Token Address of the L1 token that this bridgePool holds. This is the token LPs deposit and is bridged.
     * @param _lpFeeRatePerSecond Interest rate payment that scales the amount of pending fees per second paid to LPs.
     * @param _isWethPool Toggles if this is the WETH pool. If it is then can accept ETH and wrap to WETH for the user.
     * @param _timer Timer used to synchronize contract time in testing. Set to 0x000... in production.
     */
    constructor(
        string memory _lpTokenName,
        string memory _lpTokenSymbol,
        address _bridgeAdmin,
        address _l1Token,
        uint64 _lpFeeRatePerSecond,
        bool _isWethPool,
        address _timer
    ) Testable(_timer) ERC20(_lpTokenName, _lpTokenSymbol) {
        require(bytes(_lpTokenName).length != 0 && bytes(_lpTokenSymbol).length != 0, "Bad LP token name or symbol");
        bridgeAdmin = BridgeAdminInterface(_bridgeAdmin);
        l1Token = IERC20(_l1Token);
        lastLpFeeUpdate = uint32(getCurrentTime());
        lpFeeRatePerSecond = _lpFeeRatePerSecond;
        isWethPool = _isWethPool;

        syncUmaEcosystemParams(); // Fetch OptimisticOracle and Store addresses and L1Token finalFee.
        syncWithBridgeAdminParams(); // Fetch ProposerBondPct OptimisticOracleLiveness, Identifier from the BridgeAdmin.
    }

    /*************************************************
     *          LIQUIDITY PROVIDER FUNCTIONS         *
     *************************************************/

    /**
     * @notice Add liquidity to the bridge pool. Pulls l1Token from the caller's wallet. The caller is sent back a
     * commensurate number of LP tokens (minted to their address) at the prevailing exchange rate.
     * @dev The caller must approve this contract to transfer `l1TokenAmount` amount of l1Token if depositing ERC20.
     * @dev The caller can deposit ETH which is auto wrapped to WETH. This can only be done if: a) this is the Weth pool
     * and b) the l1TokenAmount matches to the transaction msg.value.
     * @dev Reentrancy guard not added to this function because this indirectly calls sync() which is guarded.
     * @param l1TokenAmount Number of l1Token to add as liquidity.
     */
    function addLiquidity(uint256 l1TokenAmount) public payable nonReentrant() {
        // If this is the weth pool and the caller sends msg.value then the msg.value must match the l1TokenAmount.
        // Else, msg.value must be set to 0.
        require((isWethPool && msg.value == l1TokenAmount) || msg.value == 0, "Bad add liquidity Eth value");

        // Since `exchangeRateCurrent()` reads this contract's balance and updates contract state using it,
        // we must call it first before transferring any tokens to this contract.
        uint256 lpTokensToMint = (l1TokenAmount * 1e18) / _exchangeRateCurrent();
        _mint(msg.sender, lpTokensToMint);
        liquidReserves += l1TokenAmount;

        if (msg.value > 0 && isWethPool) WETH9Like(address(l1Token)).deposit{ value: msg.value }();
        else l1Token.safeTransferFrom(msg.sender, address(this), l1TokenAmount);

        emit LiquidityAdded(l1TokenAmount, lpTokensToMint, msg.sender);
    }

    /**
     * @notice Removes liquidity from the bridge pool. Burns lpTokenAmount LP tokens from the caller's wallet. The caller
     * is sent back a commensurate number of l1Tokens at the prevailing exchange rate.
     * @dev The caller does not need to approve the spending of LP tokens as this method directly uses the burn logic.
     * @dev Reentrancy guard not added to this function because this indirectly calls sync() which is guarded.
     * @param lpTokenAmount Number of lpTokens to redeem for underlying.
     * @param sendEth Enable the liquidity provider to remove liquidity in ETH, if this is the WETH pool.
     */
    function removeLiquidity(uint256 lpTokenAmount, bool sendEth) public nonReentrant() {
        // Can only send eth on withdrawing liquidity iff this is the WETH pool.
        require(!sendEth || isWethPool, "Cant send eth");
        uint256 l1TokensToReturn = (lpTokenAmount * _exchangeRateCurrent()) / 1e18;

        // Check that there is enough liquid reserves to withdraw the requested amount.
        require(liquidReserves >= (pendingReserves + l1TokensToReturn), "Utilization too high to remove");

        _burn(msg.sender, lpTokenAmount);
        liquidReserves -= l1TokensToReturn;

        if (sendEth) _unwrapWETHTo(payable(msg.sender), l1TokensToReturn);
        else l1Token.safeTransfer(msg.sender, l1TokensToReturn);

        emit LiquidityRemoved(l1TokensToReturn, lpTokenAmount, msg.sender);
    }

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

    /**
     * @notice Called by Relayer to execute a slow + fast relay from L2 to L1, fulfilling a corresponding deposit order.
     * @dev There can only be one pending relay for a deposit. This method is effectively the relayDeposit and
     * speedUpRelay methods concatenated. This could be refactored to just call each method, but there
     * are some gas savings in combining the transfers and hash computations.
     * @dev Caller must have approved this contract to spend the total bond + amount - fees for `l1Token`.
     * @param depositData the deposit data struct containing all the user's deposit information.
     * @param realizedLpFeePct LP fee calculated off-chain considering the L1 pool liquidity at deposit time, before
     *      quoteTimestamp. The OO acts to verify the correctness of this realized fee. Cannot exceed 50%.
     */
    function relayAndSpeedUp(DepositData memory depositData, uint64 realizedLpFeePct) public nonReentrant() {
        // If no pending relay for this deposit, then associate the caller's relay attempt with it.
        uint32 priceRequestTime = uint32(getCurrentTime());

        // The realizedLPFeePct should never be greater than 0.5e18 and the slow and instant relay fees should never be
        // more than 0.25e18 each. Therefore, the sum of all fee types can never exceed 1e18 (or 100%).
        require(
            depositData.slowRelayFeePct <= 0.25e18 &&
                depositData.instantRelayFeePct <= 0.25e18 &&
                realizedLpFeePct <= 0.5e18,
            "Invalid fees"
        );

        // Check if there is a pending relay for this deposit.
        bytes32 depositHash = _getDepositHash(depositData);

        // Note: A disputed relay deletes the stored relay hash and enables this require statement to pass.
        require(relays[depositHash] == bytes32(0), "Pending relay exists");

        uint256 proposerBond = _getProposerBond(depositData.amount);

        // Save hash of new relay attempt parameters.
        // Note: The liveness for this relay can be changed in the BridgeAdmin, which means that each relay has a
        // potentially variable liveness time. This should not provide any exploit opportunities, especially because
        // the BridgeAdmin state (including the liveness value) is permissioned to the cross domained owner.
        RelayData memory relayData =
            RelayData({
                relayState: RelayState.Pending,
                slowRelayer: msg.sender,
                relayId: numberOfRelays++, // Note: Increment numberOfRelays at the same time as setting relayId to its current value.
                realizedLpFeePct: realizedLpFeePct,
                priceRequestTime: priceRequestTime,
                proposerBond: proposerBond,
                finalFee: l1TokenFinalFee
            });
        bytes32 relayHash = _getRelayHash(depositData, relayData);
        relays[depositHash] = _getRelayDataHash(relayData);

        bytes32 instantRelayHash = _getInstantRelayHash(depositHash, relayData);
        require(
            // Can only speed up a pending relay without an existing instant relay associated with it.
            instantRelays[instantRelayHash] == address(0),
            "Relay cannot be sped up"
        );

        // Sanity check that pool has enough balance to cover relay amount + proposer reward. Reward amount will be
        // paid on settlement after the OptimisticOracle price request has passed the challenge period.
        // Note: liquidReserves should always be <= balance - bonds.
        require(liquidReserves - pendingReserves >= depositData.amount, "Insufficient pool balance");

        // Compute total proposal bond and pull from caller so that the OptimisticOracle can pull it from here.
        uint256 totalBond = proposerBond + l1TokenFinalFee;

        // Pull relay amount minus fees from caller and send to the deposit l1Recipient. The total fees paid is the sum
        // of the LP fees, the relayer fees and the instant relay fee.
        uint256 feesTotal =
            _getAmountFromPct(
                relayData.realizedLpFeePct + depositData.slowRelayFeePct + depositData.instantRelayFeePct,
                depositData.amount
            );
        // If the L1 token is WETH then: a) pull WETH from instant relayer b) unwrap WETH c) send ETH to recipient.
        uint256 recipientAmount = depositData.amount - feesTotal;

        bonds += totalBond;
        pendingReserves += depositData.amount; // Book off maximum liquidity used by this relay in the pending reserves.

        instantRelays[instantRelayHash] = msg.sender;

        l1Token.safeTransferFrom(msg.sender, address(this), recipientAmount + totalBond);

        // If this is a weth pool then unwrap and send eth.
        if (isWethPool) {
            _unwrapWETHTo(depositData.l1Recipient, recipientAmount);
            // Else, this is a normal ERC20 token. Send to recipient.
        } else l1Token.safeTransfer(depositData.l1Recipient, recipientAmount);

        emit DepositRelayed(depositHash, depositData, relayData, relayHash);
        emit RelaySpedUp(depositHash, msg.sender, relayData);
    }

    /**
     * @notice Called by Disputer to dispute an ongoing relay.
     * @dev The result of this method is to always throw out the relay, providing an opportunity for another relay for
     * the same deposit. Between the disputer and proposer, whoever is incorrect loses their bond. Whoever is correct
     * gets it back + a payout.
     * @dev Caller must have approved this contract to spend the total bond + amount - fees for `l1Token`.
     * @param depositData the deposit data struct containing all the user's deposit information.
     * @param relayData RelayData logged in the disputed relay.
     */
    function disputeRelay(DepositData memory depositData, RelayData memory relayData) public nonReentrant() {
        require(relayData.priceRequestTime + optimisticOracleLiveness > getCurrentTime(), "Past liveness");
        require(relayData.relayState == RelayState.Pending, "Not disputable");
        // Validate the input data.
        bytes32 depositHash = _getDepositHash(depositData);
        _validateRelayDataHash(depositHash, relayData);

        // Submit the proposal and dispute to the OO.
        bytes32 relayHash = _getRelayHash(depositData, relayData);

        // Note: in some cases this will fail due to changes in the OO and the method will refund the relayer.
        bool success =
            _requestProposeDispute(
                relayData.slowRelayer,
                msg.sender,
                relayData.proposerBond,
                relayData.finalFee,
                _getRelayAncillaryData(relayHash)
            );

        // Drop the relay and remove the bond from the tracked bonds.
        bonds -= relayData.finalFee + relayData.proposerBond;
        pendingReserves -= depositData.amount;
        delete relays[depositHash];
        if (success) emit RelayDisputed(depositHash, _getRelayDataHash(relayData), msg.sender);
        else emit RelayCanceled(depositHash, _getRelayDataHash(relayData), msg.sender);
    }

    /**
     * @notice Called by Relayer to execute a slow relay from L2 to L1, fulfilling a corresponding deposit order.
     * @dev There can only be one pending relay for a deposit.
     * @dev Caller must have approved this contract to spend the total bond + amount - fees for `l1Token`.
     * @param depositData the deposit data struct containing all the user's deposit information.
     * @param realizedLpFeePct LP fee calculated off-chain considering the L1 pool liquidity at deposit time, before
     *      quoteTimestamp. The OO acts to verify the correctness of this realized fee. Cannot exceed 50%.
     */
    function relayDeposit(DepositData memory depositData, uint64 realizedLpFeePct) public nonReentrant() {
        // The realizedLPFeePct should never be greater than 0.5e18 and the slow and instant relay fees should never be
        // more than 0.25e18 each. Therefore, the sum of all fee types can never exceed 1e18 (or 100%).
        require(
            depositData.slowRelayFeePct <= 0.25e18 &&
                depositData.instantRelayFeePct <= 0.25e18 &&
                realizedLpFeePct <= 0.5e18,
            "Invalid fees"
        );

        // Check if there is a pending relay for this deposit.
        bytes32 depositHash = _getDepositHash(depositData);

        // Note: A disputed relay deletes the stored relay hash and enables this require statement to pass.
        require(relays[depositHash] == bytes32(0), "Pending relay exists");

        // If no pending relay for this deposit, then associate the caller's relay attempt with it.
        uint32 priceRequestTime = uint32(getCurrentTime());

        uint256 proposerBond = _getProposerBond(depositData.amount);

        // Save hash of new relay attempt parameters.
        // Note: The liveness for this relay can be changed in the BridgeAdmin, which means that each relay has a
        // potentially variable liveness time. This should not provide any exploit opportunities, especially because
        // the BridgeAdmin state (including the liveness value) is permissioned to the cross domained owner.
        RelayData memory relayData =
            RelayData({
                relayState: RelayState.Pending,
                slowRelayer: msg.sender,
                relayId: numberOfRelays++, // Note: Increment numberOfRelays at the same time as setting relayId to its current value.
                realizedLpFeePct: realizedLpFeePct,
                priceRequestTime: priceRequestTime,
                proposerBond: proposerBond,
                finalFee: l1TokenFinalFee
            });
        relays[depositHash] = _getRelayDataHash(relayData);

        bytes32 relayHash = _getRelayHash(depositData, relayData);

        // Sanity check that pool has enough balance to cover relay amount + proposer reward. Reward amount will be
        // paid on settlement after the OptimisticOracle price request has passed the challenge period.
        // Note: liquidReserves should always be <= balance - bonds.
        require(liquidReserves - pendingReserves >= depositData.amount, "Insufficient pool balance");

        // Compute total proposal bond and pull from caller so that the OptimisticOracle can pull it from here.
        uint256 totalBond = proposerBond + l1TokenFinalFee;
        pendingReserves += depositData.amount; // Book off maximum liquidity used by this relay in the pending reserves.
        bonds += totalBond;

        l1Token.safeTransferFrom(msg.sender, address(this), totalBond);
        emit DepositRelayed(depositHash, depositData, relayData, relayHash);
    }

    /**
     * @notice Instantly relay a deposit amount minus fees to the l1Recipient. Instant relayer earns a reward following
     * the pending relay challenge period.
     * @dev We assume that the caller has performed an off-chain check that the deposit data they are attempting to
     * relay is valid. If the deposit data is invalid, then the instant relayer has no recourse to receive their funds
     * back after the invalid deposit data is disputed. Moreover, no one will be able to resubmit a relay for the
     * invalid deposit data because they know it will get disputed again. On the other hand, if the deposit data is
     * valid, then even if it is falsely disputed, the instant relayer will eventually get reimbursed because someone
     * else will be incentivized to resubmit the relay to earn slow relayer rewards. Once the valid relay is finalized,
     * the instant relayer will be reimbursed. Therefore, the caller has the same responsibility as the disputer in
     * validating the relay data.
     * @dev Caller must have approved this contract to spend the deposit amount of L1 tokens to relay. There can only
     * be one instant relayer per relay attempt. You cannot speed up a relay that is past liveness.
     * @param depositData Unique set of L2 deposit data that caller is trying to instantly relay.
     * @param relayData Parameters of Relay that caller is attempting to speedup. Must hash to the stored relay hash
     * for this deposit or this method will revert.
     */
    function speedUpRelay(DepositData memory depositData, RelayData memory relayData) public nonReentrant() {
        bytes32 depositHash = _getDepositHash(depositData);
        _validateRelayDataHash(depositHash, relayData);
        bytes32 instantRelayHash = _getInstantRelayHash(depositHash, relayData);
        require(
            // Can only speed up a pending relay without an existing instant relay associated with it.
            getCurrentTime() < relayData.priceRequestTime + optimisticOracleLiveness &&
                relayData.relayState == RelayState.Pending &&
                instantRelays[instantRelayHash] == address(0),
            "Relay cannot be sped up"
        );
        instantRelays[instantRelayHash] = msg.sender;

        // Pull relay amount minus fees from caller and send to the deposit l1Recipient. The total fees paid is the sum
        // of the LP fees, the relayer fees and the instant relay fee.
        uint256 feesTotal =
            _getAmountFromPct(
                relayData.realizedLpFeePct + depositData.slowRelayFeePct + depositData.instantRelayFeePct,
                depositData.amount
            );
        // If the L1 token is WETH then: a) pull WETH from instant relayer b) unwrap WETH c) send ETH to recipient.
        uint256 recipientAmount = depositData.amount - feesTotal;
        if (isWethPool) {
            l1Token.safeTransferFrom(msg.sender, address(this), recipientAmount);
            _unwrapWETHTo(depositData.l1Recipient, recipientAmount);
            // Else, this is a normal ERC20 token. Send to recipient.
        } else l1Token.safeTransferFrom(msg.sender, depositData.l1Recipient, recipientAmount);

        emit RelaySpedUp(depositHash, msg.sender, relayData);
    }

    /**
     * @notice Reward relayers if a pending relay price request has a price available on the OptimisticOracle. Mark
     * the relay as complete.
     * @dev We use the relayData and depositData to compute the ancillary data that the relay price request is uniquely
     * associated with on the OptimisticOracle. If the price request passed in does not match the pending relay price
     * request, then this will revert.
     * @param depositData Unique set of L2 deposit data that caller is trying to settle a relay for.
     * @param relayData Parameters of Relay that caller is attempting to settle. Must hash to the stored relay hash
     * for this deposit.
     */
    function settleRelay(DepositData memory depositData, RelayData memory relayData) public nonReentrant() {
        bytes32 depositHash = _getDepositHash(depositData);
        _validateRelayDataHash(depositHash, relayData);
        require(relayData.relayState == RelayState.Pending, "Already settled");
        uint32 expirationTime = relayData.priceRequestTime + optimisticOracleLiveness;
        require(expirationTime <= getCurrentTime(), "Not settleable yet");

        // Note: this check is to give the relayer a small, but reasonable amount of time to complete the relay before
        // before it can be "stolen" by someone else. This is to ensure there is an incentive to settle relays quickly.
        require(
            msg.sender == relayData.slowRelayer || getCurrentTime() > expirationTime + 15 minutes,
            "Not slow relayer"
        );

        // Update the relay state to Finalized. This prevents any re-settling of a relay.
        relays[depositHash] = _getRelayDataHash(
            RelayData({
                relayState: RelayState.Finalized,
                slowRelayer: relayData.slowRelayer,
                relayId: relayData.relayId,
                realizedLpFeePct: relayData.realizedLpFeePct,
                priceRequestTime: relayData.priceRequestTime,
                proposerBond: relayData.proposerBond,
                finalFee: relayData.finalFee
            })
        );

        // Reward relayers and pay out l1Recipient.
        // At this point there are two possible cases:
        // - This was a slow relay: In this case, a) pay the slow relayer their reward and b) pay the l1Recipient of the
        //      amount minus the realized LP fee and the slow Relay fee. The transfer was not sped up so no instant fee.
        // - This was an instant relay: In this case, a) pay the slow relayer their reward and b) pay the instant relayer
        //      the full bridging amount, minus the realized LP fee and minus the slow relay fee. When the instant
        //      relayer called speedUpRelay they were docked this same amount, minus the instant relayer fee. As a
        //      result, they are effectively paid what they spent when speeding up the relay + the instantRelayFee.

        uint256 instantRelayerOrRecipientAmount =
            depositData.amount -
                _getAmountFromPct(relayData.realizedLpFeePct + depositData.slowRelayFeePct, depositData.amount);

        // Refund the instant relayer iff the instant relay params match the approved relay.
        bytes32 instantRelayHash = _getInstantRelayHash(depositHash, relayData);
        address instantRelayer = instantRelays[instantRelayHash];

        // If this is the WETH pool and the instant relayer is is address 0x0 (i.e the relay was not sped up) then:
        // a) withdraw WETH to ETH and b) send the ETH to the recipient.
        if (isWethPool && instantRelayer == address(0)) {
            _unwrapWETHTo(depositData.l1Recipient, instantRelayerOrRecipientAmount);
            // Else, this is a normal slow relay being finalizes where the contract sends ERC20 to the recipient OR this
            // is the finalization of an instant relay where we need to reimburse the instant relayer in WETH.
        } else
            l1Token.safeTransfer(
                instantRelayer != address(0) ? instantRelayer : depositData.l1Recipient,
                instantRelayerOrRecipientAmount
            );

        // There is a fee and a bond to pay out. The fee goes to whoever settles. The bond always goes back to the
        // slow relayer.
        // Note: for gas efficiency, we use an if so we can combine these transfers in the event that they are the same
        // address.
        uint256 slowRelayerReward = _getAmountFromPct(depositData.slowRelayFeePct, depositData.amount);
        uint256 totalBond = relayData.finalFee + relayData.proposerBond;
        if (relayData.slowRelayer == msg.sender)
            l1Token.safeTransfer(relayData.slowRelayer, slowRelayerReward + totalBond);
        else {
            l1Token.safeTransfer(relayData.slowRelayer, totalBond);
            l1Token.safeTransfer(msg.sender, slowRelayerReward);
        }

        uint256 totalReservesSent = instantRelayerOrRecipientAmount + slowRelayerReward;

        // Update reserves by amounts changed and allocated LP fees.
        pendingReserves -= depositData.amount;
        liquidReserves -= totalReservesSent;
        utilizedReserves += int256(totalReservesSent);
        bonds -= totalBond;
        _updateAccumulatedLpFees();
        _allocateLpFees(_getAmountFromPct(relayData.realizedLpFeePct, depositData.amount));

        emit RelaySettled(depositHash, msg.sender, relayData);

        // Clean up state storage and receive gas refund. This also prevents `priceDisputed()` from being able to reset
        // this newly Finalized relay state.
        delete instantRelays[instantRelayHash];
    }

    /**
     * @notice Synchronize any balance changes in this contract with the utilized & liquid reserves. This would be done
     * at the conclusion of an L2 -> L1 token transfer via the canonical token bridge.
     */
    function sync() public nonReentrant() {
        _sync();
    }

    /**
     * @notice Computes the exchange rate between LP tokens and L1Tokens. Used when adding/removing liquidity.
     * @return The updated exchange rate between LP tokens and L1 tokens.
     */
    function exchangeRateCurrent() public nonReentrant() returns (uint256) {
        return _exchangeRateCurrent();
    }

    /**
     * @notice Computes the current liquidity utilization ratio.
     * @dev Used in computing realizedLpFeePct off-chain.
     * @return The current utilization ratio.
     */
    function liquidityUtilizationCurrent() public nonReentrant() returns (uint256) {
        return _liquidityUtilizationPostRelay(0);
    }

    /**
     * @notice Computes the liquidity utilization ratio post a relay of known size.
     * @dev Used in computing realizedLpFeePct off-chain.
     * @param relayedAmount Size of the relayed deposit to factor into the utilization calculation.
     * @return The updated utilization ratio accounting for a new `relayedAmount`.
     */
    function liquidityUtilizationPostRelay(uint256 relayedAmount) public nonReentrant() returns (uint256) {
        return _liquidityUtilizationPostRelay(relayedAmount);
    }

    /**
     * @notice Return both the current utilization value and liquidity utilization post the relay.
     * @dev Used in computing realizedLpFeePct off-chain.
     * @param relayedAmount Size of the relayed deposit to factor into the utilization calculation.
     * @return utilizationCurrent The current utilization ratio.
     * @return utilizationPostRelay The updated utilization ratio accounting for a new `relayedAmount`.
     */
    function getLiquidityUtilization(uint256 relayedAmount)
        public
        nonReentrant()
        returns (uint256 utilizationCurrent, uint256 utilizationPostRelay)
    {
        return (_liquidityUtilizationPostRelay(0), _liquidityUtilizationPostRelay(relayedAmount));
    }

    /**
     * @notice Updates the address stored in this contract for the OptimisticOracle and the Store to the latest versions
     * set in the the Finder. Also pull finalFee Store these as local variables to make relay methods gas efficient.
     * @dev There is no risk of leaving this function public for anyone to call as in all cases we want the addresses
     * in this contract to map to the latest version in the Finder and store the latest final fee.
     */
    function syncUmaEcosystemParams() public nonReentrant() {
        FinderInterface finder = FinderInterface(bridgeAdmin.finder());
        optimisticOracle = SkinnyOptimisticOracleInterface(
            finder.getImplementationAddress(OracleInterfaces.SkinnyOptimisticOracle)
        );

        store = StoreInterface(finder.getImplementationAddress(OracleInterfaces.Store));
        l1TokenFinalFee = store.computeFinalFee(address(l1Token)).rawValue;
    }

    /**
     * @notice Updates the values of stored constants for the proposerBondPct, optimisticOracleLiveness and identifier
     * to that set in the bridge Admin. We store these as local variables to make the relay methods more gas efficient.
     * @dev There is no risk of leaving this function public for anyone to call as in all cases we want these values
     * in this contract to map to the latest version set in the BridgeAdmin.
     */
    function syncWithBridgeAdminParams() public nonReentrant() {
        proposerBondPct = bridgeAdmin.proposerBondPct();
        optimisticOracleLiveness = bridgeAdmin.optimisticOracleLiveness();
        identifier = bridgeAdmin.identifier();
    }

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

    /**
     * @notice Enable the current bridge admin to transfer admin to to a new address.
     * @param _newAdmin Admin address of the new admin.
     */
    function changeAdmin(address _newAdmin) public override nonReentrant() {
        require(msg.sender == address(bridgeAdmin));
        bridgeAdmin = BridgeAdminInterface(_newAdmin);
        emit BridgePoolAdminTransferred(msg.sender, _newAdmin);
    }

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

    /**
     * @notice Computes the current amount of unallocated fees that have accumulated from the previous time this the
     * contract was called.
     */
    function getAccumulatedFees() public view nonReentrantView() returns (uint256) {
        return _getAccumulatedFees();
    }

    /**
     * @notice Returns ancillary data containing all relevant Relay data that voters can format into UTF8 and use to
     * determine if the relay is valid.
     * @dev Helpful method to test that ancillary data is constructed properly. We should consider removing if we don't
     * anticipate off-chain bots or users to call this method.
     * @param depositData Contains L2 deposit information used by off-chain validators to validate relay.
     * @param relayData Contains relay information used by off-chain validators to validate relay.
     * @return bytes New ancillary data that can be decoded into UTF8.
     */
    function getRelayAncillaryData(DepositData memory depositData, RelayData memory relayData)
        public
        view
        nonReentrantView()
        returns (bytes memory)
    {
        return _getRelayAncillaryData(_getRelayHash(depositData, relayData));
    }

    /**************************************
     *    INTERNAL & PRIVATE FUNCTIONS    *
     **************************************/

    function _liquidityUtilizationPostRelay(uint256 relayedAmount) internal returns (uint256) {
        _sync(); // Fetch any balance changes due to token bridging finalization and factor them in.

        // liquidityUtilizationRatio :=
        // (relayedAmount + pendingReserves + max(utilizedReserves,0)) / (liquidReserves + max(utilizedReserves,0))
        // UtilizedReserves has a dual meaning: if it's greater than zero then it represents funds pending in the bridge
        // that will flow from L2 to L1. In this case, we can use it normally in the equation. However, if it is
        // negative, then it is already counted in liquidReserves. This occurs if tokens are transferred directly to the
        // contract. In this case, ignore it as it is captured in liquid reserves and has no meaning in the numerator.
        uint256 flooredUtilizedReserves = utilizedReserves > 0 ? uint256(utilizedReserves) : 0;
        uint256 numerator = relayedAmount + pendingReserves + flooredUtilizedReserves;
        uint256 denominator = liquidReserves + flooredUtilizedReserves;

        // If the denominator equals zero, return 1e18 (max utilization).
        if (denominator == 0) return 1e18;

        // In all other cases, return the utilization ratio.
        return (numerator * 1e18) / denominator;
    }

    function _sync() internal {
        // Check if the l1Token balance of the contract is greater than the liquidReserves. If it is then the bridging
        // action from L2 -> L1 has concluded and the local accounting can be updated.
        uint256 l1TokenBalance = l1Token.balanceOf(address(this)) - bonds;
        if (l1TokenBalance > liquidReserves) {
            // utilizedReserves can go to less than zero. This will happen if the accumulated fees exceeds the current
            // outstanding utilization. In other words, if outstanding bridging transfers are 0 then utilizedReserves
            // will equal the total LP fees accumulated over all time.
            utilizedReserves -= int256(l1TokenBalance - liquidReserves);
            liquidReserves = l1TokenBalance;
        }
    }

    function _exchangeRateCurrent() internal returns (uint256) {
        if (totalSupply() == 0) return 1e18; // initial rate is 1 pre any mint action.

        // First, update fee counters and local accounting of finalized transfers from L2 -> L1.
        _updateAccumulatedLpFees(); // Accumulate all allocated fees from the last time this method was called.
        _sync(); // Fetch any balance changes due to token bridging finalization and factor them in.

        // ExchangeRate := (liquidReserves + utilizedReserves - undistributedLpFees) / lpTokenSupply
        uint256 numerator = liquidReserves - undistributedLpFees;
        if (utilizedReserves > 0) numerator += uint256(utilizedReserves);
        else numerator -= uint256(utilizedReserves * -1);
        return (numerator * 1e18) / totalSupply();
    }

    // Return UTF8-decodable ancillary data for relay price request associated with relay hash.
    function _getRelayAncillaryData(bytes32 relayHash) private pure returns (bytes memory) {
        return AncillaryData.appendKeyValueBytes32("", "relayHash", relayHash);
    }

    // Returns hash of unique relay and deposit event. This is added to the relay request's ancillary data.
    function _getRelayHash(DepositData memory depositData, RelayData memory relayData) private view returns (bytes32) {
        return keccak256(abi.encode(depositData, relayData.relayId, relayData.realizedLpFeePct, address(l1Token)));
    }

    // Return hash of relay data, which is stored in state and mapped to a deposit hash.
    function _getRelayDataHash(RelayData memory relayData) private pure returns (bytes32) {
        return keccak256(abi.encode(relayData));
    }

    // Reverts if the stored relay data hash for `depositHash` does not match `_relayData`.
    function _validateRelayDataHash(bytes32 depositHash, RelayData memory relayData) private view {
        require(
            relays[depositHash] == _getRelayDataHash(relayData),
            "Hashed relay params do not match existing relay hash for deposit"
        );
    }

    // Return hash of unique instant relay and deposit event. This is stored in state and mapped to a deposit hash.
    function _getInstantRelayHash(bytes32 depositHash, RelayData memory relayData) private pure returns (bytes32) {
        // Only include parameters that affect the "correctness" of an instant relay. For example, the realized LP fee
        // % directly affects how many tokens the instant relayer needs to send to the user, whereas the address of the
        // instant relayer does not matter for determining whether an instant relay is "correct".
        return keccak256(abi.encode(depositHash, relayData.realizedLpFeePct));
    }

    function _getAccumulatedFees() internal view returns (uint256) {
        // UnallocatedLpFees := min(undistributedLpFees*lpFeeRatePerSecond*timeFromLastInteraction,undistributedLpFees)
        // The min acts to pay out all fees in the case the equation returns more than the remaining a fees.
        uint256 possibleUnpaidFees =
            (undistributedLpFees * lpFeeRatePerSecond * (getCurrentTime() - lastLpFeeUpdate)) / (1e18);
        return possibleUnpaidFees < undistributedLpFees ? possibleUnpaidFees : undistributedLpFees;
    }

    // Update internal fee counters by adding in any accumulated fees from the last time this logic was called.
    function _updateAccumulatedLpFees() internal {
        // Calculate the unallocatedAccumulatedFees from the last time the contract was called.
        uint256 unallocatedAccumulatedFees = _getAccumulatedFees();

        // Decrement the undistributedLpFees by the amount of accumulated fees.
        undistributedLpFees = undistributedLpFees - unallocatedAccumulatedFees;

        lastLpFeeUpdate = uint32(getCurrentTime());
    }

    // Allocate fees to the LPs by incrementing counters.
    function _allocateLpFees(uint256 allocatedLpFees) internal {
        // Add to the total undistributed LP fees and the utilized reserves. Adding it to the utilized reserves acts to
        // track the fees while they are in transit.
        undistributedLpFees += allocatedLpFees;
        utilizedReserves += int256(allocatedLpFees);
    }

    function _getAmountFromPct(uint64 percent, uint256 amount) private pure returns (uint256) {
        return (percent * amount) / 1e18;
    }

    function _getProposerBond(uint256 amount) private view returns (uint256) {
        return _getAmountFromPct(proposerBondPct, amount);
    }

    function _getDepositHash(DepositData memory depositData) private view returns (bytes32) {
        return keccak256(abi.encode(depositData, address(l1Token)));
    }

    // Proposes new price of True for relay event associated with `customAncillaryData` to optimistic oracle. If anyone
    // disagrees with the relay parameters and whether they map to an L2 deposit, they can dispute with the oracle.
    function _requestProposeDispute(
        address proposer,
        address disputer,
        uint256 proposerBond,
        uint256 finalFee,
        bytes memory customAncillaryData
    ) private returns (bool) {
        uint256 totalBond = finalFee + proposerBond;
        l1Token.safeApprove(address(optimisticOracle), totalBond);
        try
            optimisticOracle.requestAndProposePriceFor(
                identifier,
                uint32(getCurrentTime()),
                customAncillaryData,
                IERC20(l1Token),
                // Set reward to 0, since we'll settle proposer reward payouts directly from this contract after a relay
                // proposal has passed the challenge period.
                0,
                // Set the Optimistic oracle proposer bond for the price request.
                proposerBond,
                // Set the Optimistic oracle liveness for the price request.
                optimisticOracleLiveness,
                proposer,
                // Canonical value representing "True"; i.e. the proposed relay is valid.
                int256(1e18)
            )
        returns (uint256 bondSpent) {
            if (bondSpent < totalBond) {
                // If the OO pulls less (due to a change in final fee), refund the proposer.
                uint256 refund = totalBond - bondSpent;
                l1Token.safeTransfer(proposer, refund);
                l1Token.safeApprove(address(optimisticOracle), 0);
                totalBond = bondSpent;
            }
        } catch {
            // If there's an error in the OO, this means something has changed to make this request undisputable.
            // To ensure the request does not go through by default, refund the proposer and return early, allowing
            // the calling method to delete the request, but with no additional recourse by the OO.
            l1Token.safeTransfer(proposer, totalBond);
            l1Token.safeApprove(address(optimisticOracle), 0);

            // Return early noting that the attempt at a proposal + dispute did not succeed.
            return false;
        }

        SkinnyOptimisticOracleInterface.Request memory request =
            SkinnyOptimisticOracleInterface.Request({
                proposer: proposer,
                disputer: address(0),
                currency: IERC20(l1Token),
                settled: false,
                proposedPrice: int256(1e18),
                resolvedPrice: 0,
                expirationTime: getCurrentTime() + optimisticOracleLiveness,
                reward: 0,
                finalFee: totalBond - proposerBond,
                bond: proposerBond,
                customLiveness: uint256(optimisticOracleLiveness)
            });

        // Note: don't pull funds until here to avoid any transfers that aren't needed.
        l1Token.safeTransferFrom(msg.sender, address(this), totalBond);
        l1Token.safeApprove(address(optimisticOracle), totalBond);
        // Dispute the request that we just sent.
        optimisticOracle.disputePriceFor(
            identifier,
            uint32(getCurrentTime()),
            customAncillaryData,
            request,
            disputer,
            address(this)
        );

        // Return true to denote that the proposal + dispute calls succeeded.
        return true;
    }

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

    // Added to enable the BridgePool to receive ETH. used when unwrapping Weth.
    receive() external payable {}
}

/**
 * @notice This is the BridgePool contract that should be deployed on live networks. It is exactly the same as the
 * regular BridgePool contract, but it overrides getCurrentTime to make the call a simply return block.timestamp with
 * no branching or storage queries. This is done to save gas.
 */
contract BridgePoolProd is BridgePool {
    constructor(
        string memory _lpTokenName,
        string memory _lpTokenSymbol,
        address _bridgeAdmin,
        address _l1Token,
        uint64 _lpFeeRatePerSecond,
        bool _isWethPool,
        address _timer
    ) BridgePool(_lpTokenName, _lpTokenSymbol, _bridgeAdmin, _l1Token, _lpFeeRatePerSecond, _isWethPool, _timer) {}

    function getCurrentTime() public view virtual override returns (uint256) {
        return block.timestamp;
    }
}

File 3 of 22 : BridgeAdminInterface.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity ^0.8.0;

/**
 * @notice Helper view methods designed to be called by BridgePool contracts.
 */
interface BridgeAdminInterface {
    event SetDepositContracts(
        uint256 indexed chainId,
        address indexed l2DepositContract,
        address indexed l2MessengerContract
    );
    event SetCrossDomainAdmin(uint256 indexed chainId, address indexed newAdmin);
    event SetRelayIdentifier(bytes32 indexed identifier);
    event SetOptimisticOracleLiveness(uint32 indexed liveness);
    event SetProposerBondPct(uint64 indexed proposerBondPct);
    event WhitelistToken(uint256 chainId, address indexed l1Token, address indexed l2Token, address indexed bridgePool);
    event SetMinimumBridgingDelay(uint256 indexed chainId, uint64 newMinimumBridgingDelay);
    event DepositsEnabled(uint256 indexed chainId, address indexed l2Token, bool depositsEnabled);
    event BridgePoolsAdminTransferred(address[] bridgePools, address indexed newAdmin);

    function finder() external view returns (address);

    struct DepositUtilityContracts {
        address depositContract; // L2 deposit contract where cross-chain relays originate.
        address messengerContract; // L1 helper contract that can send a message to the L2 with the mapped network ID.
    }

    function depositContracts(uint256) external view returns (DepositUtilityContracts memory);

    struct L1TokenRelationships {
        mapping(uint256 => address) l2Tokens; // L2 Chain Id to l2Token address.
        address bridgePool;
    }

    function whitelistedTokens(address, uint256) external view returns (address l2Token, address bridgePool);

    function optimisticOracleLiveness() external view returns (uint32);

    function proposerBondPct() external view returns (uint64);

    function identifier() external view returns (bytes32);
}

File 4 of 22 : BridgePoolInterface.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity ^0.8.0;

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

interface BridgePoolInterface {
    function l1Token() external view returns (IERC20);

    function changeAdmin(address newAdmin) external;
}

File 5 of 22 : SkinnyOptimisticOracleInterface.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity ^0.8.0;

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

/**
 * @title Interface for the gas-cost-reduced version of the OptimisticOracle.
 * @notice Differences from normal OptimisticOracle:
 * - refundOnDispute: flag is removed, by default there are no refunds on disputes.
 * - customizing request parameters: In the OptimisticOracle, parameters like `bond` and `customLiveness` can be reset
 *   after a request is already made via `requestPrice`. In the SkinnyOptimisticOracle, these parameters can only be
 *   set in `requestPrice`, which has an expanded input set.
 * - settleAndGetPrice: Replaced by `settle`, which can only be called once per settleable request. The resolved price
 *   can be fetched via the `Settle` event or the return value of `settle`.
 * - general changes to interface: Functions that interact with existing requests all require the parameters of the
 *   request to modify to be passed as input. These parameters must match with the existing request parameters or the
 *   function will revert. This change reflects the internal refactor to store hashed request parameters instead of the
 *   full request struct.
 * @dev Interface used by financial contracts to interact with the Oracle. Voters will use a different interface.
 */
abstract contract SkinnyOptimisticOracleInterface {
    // Struct representing a price request. Note that this differs from the OptimisticOracleInterface's Request struct
    // in that refundOnDispute is removed.
    struct Request {
        address proposer; // Address of the proposer.
        address disputer; // Address of the disputer.
        IERC20 currency; // ERC20 token used to pay rewards and fees.
        bool settled; // True if the request is settled.
        int256 proposedPrice; // Price that the proposer submitted.
        int256 resolvedPrice; // Price resolved once the request is settled.
        uint256 expirationTime; // Time at which the request auto-settles without a dispute.
        uint256 reward; // Amount of the currency to pay to the proposer on settlement.
        uint256 finalFee; // Final fee to pay to the Store upon request to the DVM.
        uint256 bond; // Bond that the proposer and disputer must pay on top of the final fee.
        uint256 customLiveness; // Custom liveness value set by the requester.
    }

    // This value must be <= the Voting contract's `ancillaryBytesLimit` value otherwise it is possible
    // that a price can be requested to this contract successfully, but cannot be disputed because the DVM refuses
    // to accept a price request made with ancillary data length over a certain size.
    uint256 public constant ancillaryBytesLimit = 8192;

    /**
     * @notice Requests a new price.
     * @param identifier price identifier being requested.
     * @param timestamp timestamp of the price being requested.
     * @param ancillaryData ancillary data representing additional args being passed with the price request.
     * @param currency ERC20 token used for payment of rewards and fees. Must be approved for use with the DVM.
     * @param reward reward offered to a successful proposer. Will be pulled from the caller. Note: this can be 0,
     *               which could make sense if the contract requests and proposes the value in the same call or
     *               provides its own reward system.
     * @param bond custom proposal bond to set for request. If set to 0, defaults to the final fee.
     * @param customLiveness custom proposal liveness to set for request.
     * @return totalBond default bond + final fee that the proposer and disputer will be required to pay.
     */
    function requestPrice(
        bytes32 identifier,
        uint32 timestamp,
        bytes memory ancillaryData,
        IERC20 currency,
        uint256 reward,
        uint256 bond,
        uint256 customLiveness
    ) external virtual returns (uint256 totalBond);

    /**
     * @notice Proposes a price value on another address' behalf. Note: this address will receive any rewards that come
     * from this proposal. However, any bonds are pulled from the caller.
     * @param requester sender of the initial price request.
     * @param identifier price identifier to identify the existing request.
     * @param timestamp timestamp to identify the existing request.
     * @param ancillaryData ancillary data of the price being requested.
     * @param request price request parameters whose hash must match the request that the caller wants to
     * propose a price for.
     * @param proposer address to set as the proposer.
     * @param proposedPrice price being proposed.
     * @return totalBond the amount that's pulled from the caller's wallet as a bond. The bond will be returned to
     * the proposer once settled if the proposal is correct.
     */
    function proposePriceFor(
        address requester,
        bytes32 identifier,
        uint32 timestamp,
        bytes memory ancillaryData,
        Request memory request,
        address proposer,
        int256 proposedPrice
    ) public virtual returns (uint256 totalBond);

    /**
     * @notice Proposes a price value where caller is the proposer.
     * @param requester sender of the initial price request.
     * @param identifier price identifier to identify the existing request.
     * @param timestamp timestamp to identify the existing request.
     * @param ancillaryData ancillary data of the price being requested.
     * @param request price request parameters whose hash must match the request that the caller wants to
     * propose a price for.
     * @param proposedPrice price being proposed.
     * @return totalBond the amount that's pulled from the caller's wallet as a bond. The bond will be returned to
     * the proposer once settled if the proposal is correct.
     */
    function proposePrice(
        address requester,
        bytes32 identifier,
        uint32 timestamp,
        bytes memory ancillaryData,
        Request memory request,
        int256 proposedPrice
    ) external virtual returns (uint256 totalBond);

    /**
     * @notice Combines logic of requestPrice and proposePrice while taking advantage of gas savings from not having to
     * overwrite Request params that a normal requestPrice() => proposePrice() flow would entail. Note: The proposer
     * will receive any rewards that come from this proposal. However, any bonds are pulled from the caller.
     * @dev The caller is the requester, but the proposer can be customized.
     * @param identifier price identifier to identify the existing request.
     * @param timestamp timestamp to identify the existing request.
     * @param ancillaryData ancillary data of the price being requested.
     * @param currency ERC20 token used for payment of rewards and fees. Must be approved for use with the DVM.
     * @param reward reward offered to a successful proposer. Will be pulled from the caller. Note: this can be 0,
     *               which could make sense if the contract requests and proposes the value in the same call or
     *               provides its own reward system.
     * @param bond custom proposal bond to set for request. If set to 0, defaults to the final fee.
     * @param customLiveness custom proposal liveness to set for request.
     * @param proposer address to set as the proposer.
     * @param proposedPrice price being proposed.
     * @return totalBond the amount that's pulled from the caller's wallet as a bond. The bond will be returned to
     * the proposer once settled if the proposal is correct.
     */
    function requestAndProposePriceFor(
        bytes32 identifier,
        uint32 timestamp,
        bytes memory ancillaryData,
        IERC20 currency,
        uint256 reward,
        uint256 bond,
        uint256 customLiveness,
        address proposer,
        int256 proposedPrice
    ) external virtual returns (uint256 totalBond);

    /**
     * @notice Disputes a price request with an active proposal on another address' behalf. Note: this address will
     * receive any rewards that come from this dispute. However, any bonds are pulled from the caller.
     * @param identifier price identifier to identify the existing request.
     * @param timestamp timestamp to identify the existing request.
     * @param ancillaryData ancillary data of the price being requested.
     * @param request price request parameters whose hash must match the request that the caller wants to
     * dispute.
     * @param disputer address to set as the disputer.
     * @param requester sender of the initial price request.
     * @return totalBond the amount that's pulled from the caller's wallet as a bond. The bond will be returned to
     * the disputer once settled if the dispute was valid (the proposal was incorrect).
     */
    function disputePriceFor(
        bytes32 identifier,
        uint32 timestamp,
        bytes memory ancillaryData,
        Request memory request,
        address disputer,
        address requester
    ) public virtual returns (uint256 totalBond);

    /**
     * @notice Disputes a price request with an active proposal where caller is the disputer.
     * @param requester sender of the initial price request.
     * @param identifier price identifier to identify the existing request.
     * @param timestamp timestamp to identify the existing request.
     * @param ancillaryData ancillary data of the price being requested.
     * @param request price request parameters whose hash must match the request that the caller wants to
     * dispute.
     * @return totalBond the amount that's pulled from the caller's wallet as a bond. The bond will be returned to
     * the disputer once settled if the dispute was valid (the proposal was incorrect).
     */
    function disputePrice(
        address requester,
        bytes32 identifier,
        uint32 timestamp,
        bytes memory ancillaryData,
        Request memory request
    ) external virtual returns (uint256 totalBond);

    /**
     * @notice Attempts to settle an outstanding price request. Will revert if it isn't settleable.
     * @param requester sender of the initial price request.
     * @param identifier price identifier to identify the existing request.
     * @param timestamp timestamp to identify the existing request.
     * @param ancillaryData ancillary data of the price being requested.
     * @param request price request parameters whose hash must match the request that the caller wants to
     * settle.
     * @return payout the amount that the "winner" (proposer or disputer) receives on settlement. This amount includes
     * the returned bonds as well as additional rewards.
     * @return resolvedPrice the price that the request settled to.
     */
    function settle(
        address requester,
        bytes32 identifier,
        uint32 timestamp,
        bytes memory ancillaryData,
        Request memory request
    ) external virtual returns (uint256 payout, int256 resolvedPrice);

    /**
     * @notice Computes the current state of a price request. See the State enum for more details.
     * @param requester sender of the initial price request.
     * @param identifier price identifier to identify the existing request.
     * @param timestamp timestamp to identify the existing request.
     * @param ancillaryData ancillary data of the price being requested.
     * @param request price request parameters.
     * @return the State.
     */
    function getState(
        address requester,
        bytes32 identifier,
        uint32 timestamp,
        bytes memory ancillaryData,
        Request memory request
    ) external virtual returns (OptimisticOracleInterface.State);

    /**
     * @notice Checks if a given request has resolved, expired or been settled (i.e the optimistic oracle has a price).
     * @param requester sender of the initial price request.
     * @param identifier price identifier to identify the existing request.
     * @param timestamp timestamp to identify the existing request.
     * @param ancillaryData ancillary data of the price being requested.
     * @param request price request parameters. The hash of these parameters must match with the request hash that is
     * associated with the price request unique ID {requester, identifier, timestamp, ancillaryData}, or this method
     * will revert.
     * @return boolean indicating true if price exists and false if not.
     */
    function hasPrice(
        address requester,
        bytes32 identifier,
        uint32 timestamp,
        bytes memory ancillaryData,
        Request memory request
    ) public virtual returns (bool);

    /**
     * @notice Generates stamped ancillary data in the format that it would be used in the case of a price dispute.
     * @param ancillaryData ancillary data of the price being requested.
     * @param requester sender of the initial price request.
     * @return the stamped ancillary bytes.
     */
    function stampAncillaryData(bytes memory ancillaryData, address requester)
        public
        pure
        virtual
        returns (bytes memory);
}

File 6 of 22 : StoreInterface.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity ^0.8.0;

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

/**
 * @title Interface that allows financial contracts to pay oracle fees for their use of the system.
 */
interface StoreInterface {
    /**
     * @notice Pays Oracle fees in ETH to the store.
     * @dev To be used by contracts whose margin currency is ETH.
     */
    function payOracleFees() external payable;

    /**
     * @notice Pays oracle fees in the margin currency, erc20Address, to the store.
     * @dev To be used if the margin currency is an ERC20 token rather than ETH.
     * @param erc20Address address of the ERC20 token used to pay the fee.
     * @param amount number of tokens to transfer. An approval for at least this amount must exist.
     */
    function payOracleFeesErc20(address erc20Address, FixedPoint.Unsigned calldata amount) external;

    /**
     * @notice Computes the regular oracle fees that a contract should pay for a period.
     * @param startTime defines the beginning time from which the fee is paid.
     * @param endTime end time until which the fee is paid.
     * @param pfc "profit from corruption", or the maximum amount of margin currency that a
     * token sponsor could extract from the contract through corrupting the price feed in their favor.
     * @return regularFee amount owed for the duration from start to end time for the given pfc.
     * @return latePenalty for paying the fee after the deadline.
     */
    function computeRegularFee(
        uint256 startTime,
        uint256 endTime,
        FixedPoint.Unsigned calldata pfc
    ) external view returns (FixedPoint.Unsigned memory regularFee, FixedPoint.Unsigned memory latePenalty);

    /**
     * @notice Computes the final oracle fees that a contract should pay at settlement.
     * @param currency token used to pay the final fee.
     * @return finalFee amount due.
     */
    function computeFinalFee(address currency) external view returns (FixedPoint.Unsigned memory);
}

File 7 of 22 : FinderInterface.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity ^0.8.0;

/**
 * @title Provides addresses of the live contracts implementing certain interfaces.
 * @dev Examples are the Oracle or Store interfaces.
 */
interface FinderInterface {
    /**
     * @notice Updates the address of the contract that implements `interfaceName`.
     * @param interfaceName bytes32 encoding of the interface name that is either changed or registered.
     * @param implementationAddress address of the deployed contract that implements the interface.
     */
    function changeImplementationAddress(bytes32 interfaceName, address implementationAddress) external;

    /**
     * @notice Gets the address of the contract that implements the given `interfaceName`.
     * @param interfaceName queried interface.
     * @return implementationAddress address of the deployed contract that implements the interface.
     */
    function getImplementationAddress(bytes32 interfaceName) external view returns (address);
}

File 8 of 22 : Constants.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity ^0.8.0;

/**
 * @title Stores common interface names used throughout the DVM by registration in the Finder.
 */
library OracleInterfaces {
    bytes32 public constant Oracle = "Oracle";
    bytes32 public constant IdentifierWhitelist = "IdentifierWhitelist";
    bytes32 public constant Store = "Store";
    bytes32 public constant FinancialContractsAdmin = "FinancialContractsAdmin";
    bytes32 public constant Registry = "Registry";
    bytes32 public constant CollateralWhitelist = "CollateralWhitelist";
    bytes32 public constant OptimisticOracle = "OptimisticOracle";
    bytes32 public constant Bridge = "Bridge";
    bytes32 public constant GenericHandler = "GenericHandler";
    bytes32 public constant SkinnyOptimisticOracle = "SkinnyOptimisticOracle";
}

/**
 * @title Commonly re-used values for contracts associated with the OptimisticOracle.
 */
library OptimisticOracleConstraints {
    // Any price request submitted to the OptimisticOracle must contain ancillary data no larger than this value.
    // This value must be <= the Voting contract's `ancillaryBytesLimit` constant value otherwise it is possible
    // that a price can be requested to the OptimisticOracle successfully, but cannot be resolved by the DVM which
    // refuses to accept a price request made with ancillary data length over a certain size.
    uint256 public constant ancillaryBytesLimit = 8192;
}

File 9 of 22 : AncillaryData.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity ^0.8.0;

/**
 * @title Library for encoding and decoding ancillary data for DVM price requests.
 * @notice  We assume that on-chain ancillary data can be formatted directly from bytes to utf8 encoding via
 * web3.utils.hexToUtf8, and that clients will parse the utf8-encoded ancillary data as a comma-delimitted key-value
 * dictionary. Therefore, this library provides internal methods that aid appending to ancillary data from Solidity
 * smart contracts. More details on UMA's ancillary data guidelines below:
 * https://docs.google.com/document/d/1zhKKjgY1BupBGPPrY_WOJvui0B6DMcd-xDR8-9-SPDw/edit
 */
library AncillaryData {
    // This converts the bottom half of a bytes32 input to hex in a highly gas-optimized way.
    // Source: the brilliant implementation at https://gitter.im/ethereum/solidity?at=5840d23416207f7b0ed08c9b.
    function toUtf8Bytes32Bottom(bytes32 bytesIn) private pure returns (bytes32) {
        unchecked {
            uint256 x = uint256(bytesIn);

            // Nibble interleave
            x = x & 0x00000000000000000000000000000000ffffffffffffffffffffffffffffffff;
            x = (x | (x * 2**64)) & 0x0000000000000000ffffffffffffffff0000000000000000ffffffffffffffff;
            x = (x | (x * 2**32)) & 0x00000000ffffffff00000000ffffffff00000000ffffffff00000000ffffffff;
            x = (x | (x * 2**16)) & 0x0000ffff0000ffff0000ffff0000ffff0000ffff0000ffff0000ffff0000ffff;
            x = (x | (x * 2**8)) & 0x00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff;
            x = (x | (x * 2**4)) & 0x0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f;

            // Hex encode
            uint256 h = (x & 0x0808080808080808080808080808080808080808080808080808080808080808) / 8;
            uint256 i = (x & 0x0404040404040404040404040404040404040404040404040404040404040404) / 4;
            uint256 j = (x & 0x0202020202020202020202020202020202020202020202020202020202020202) / 2;
            x = x + (h & (i | j)) * 0x27 + 0x3030303030303030303030303030303030303030303030303030303030303030;

            // Return the result.
            return bytes32(x);
        }
    }

    /**
     * @notice Returns utf8-encoded bytes32 string that can be read via web3.utils.hexToUtf8.
     * @dev Will return bytes32 in all lower case hex characters and without the leading 0x.
     * This has minor changes from the toUtf8BytesAddress to control for the size of the input.
     * @param bytesIn bytes32 to encode.
     * @return utf8 encoded bytes32.
     */
    function toUtf8Bytes(bytes32 bytesIn) internal pure returns (bytes memory) {
        return abi.encodePacked(toUtf8Bytes32Bottom(bytesIn >> 128), toUtf8Bytes32Bottom(bytesIn));
    }

    /**
     * @notice Returns utf8-encoded address that can be read via web3.utils.hexToUtf8.
     * Source: https://ethereum.stackexchange.com/questions/8346/convert-address-to-string/8447#8447
     * @dev Will return address in all lower case characters and without the leading 0x.
     * @param x address to encode.
     * @return utf8 encoded address bytes.
     */
    function toUtf8BytesAddress(address x) internal pure returns (bytes memory) {
        return
            abi.encodePacked(toUtf8Bytes32Bottom(bytes32(bytes20(x)) >> 128), bytes8(toUtf8Bytes32Bottom(bytes20(x))));
    }

    /**
     * @notice Converts a uint into a base-10, UTF-8 representation stored in a `string` type.
     * @dev This method is based off of this code: https://stackoverflow.com/a/65707309.
     */
    function toUtf8BytesUint(uint256 x) internal pure returns (bytes memory) {
        if (x == 0) {
            return "0";
        }
        uint256 j = x;
        uint256 len;
        while (j != 0) {
            len++;
            j /= 10;
        }
        bytes memory bstr = new bytes(len);
        uint256 k = len;
        while (x != 0) {
            k = k - 1;
            uint8 temp = (48 + uint8(x - (x / 10) * 10));
            bytes1 b1 = bytes1(temp);
            bstr[k] = b1;
            x /= 10;
        }
        return bstr;
    }

    function appendKeyValueBytes32(
        bytes memory currentAncillaryData,
        bytes memory key,
        bytes32 value
    ) internal pure returns (bytes memory) {
        bytes memory prefix = constructPrefix(currentAncillaryData, key);
        return abi.encodePacked(currentAncillaryData, prefix, toUtf8Bytes(value));
    }

    /**
     * @notice Adds "key:value" to `currentAncillaryData` where `value` is an address that first needs to be converted
     * to utf8 bytes. For example, if `utf8(currentAncillaryData)="k1:v1"`, then this function will return
     * `utf8(k1:v1,key:value)`, and if `currentAncillaryData` is blank, then this will return `utf8(key:value)`.
     * @param currentAncillaryData This bytes data should ideally be able to be utf8-decoded, but its OK if not.
     * @param key Again, this bytes data should ideally be able to be utf8-decoded, but its OK if not.
     * @param value An address to set as the value in the key:value pair to append to `currentAncillaryData`.
     * @return Newly appended ancillary data.
     */
    function appendKeyValueAddress(
        bytes memory currentAncillaryData,
        bytes memory key,
        address value
    ) internal pure returns (bytes memory) {
        bytes memory prefix = constructPrefix(currentAncillaryData, key);
        return abi.encodePacked(currentAncillaryData, prefix, toUtf8BytesAddress(value));
    }

    /**
     * @notice Adds "key:value" to `currentAncillaryData` where `value` is a uint that first needs to be converted
     * to utf8 bytes. For example, if `utf8(currentAncillaryData)="k1:v1"`, then this function will return
     * `utf8(k1:v1,key:value)`, and if `currentAncillaryData` is blank, then this will return `utf8(key:value)`.
     * @param currentAncillaryData This bytes data should ideally be able to be utf8-decoded, but its OK if not.
     * @param key Again, this bytes data should ideally be able to be utf8-decoded, but its OK if not.
     * @param value A uint to set as the value in the key:value pair to append to `currentAncillaryData`.
     * @return Newly appended ancillary data.
     */
    function appendKeyValueUint(
        bytes memory currentAncillaryData,
        bytes memory key,
        uint256 value
    ) internal pure returns (bytes memory) {
        bytes memory prefix = constructPrefix(currentAncillaryData, key);
        return abi.encodePacked(currentAncillaryData, prefix, toUtf8BytesUint(value));
    }

    /**
     * @notice Helper method that returns the left hand side of a "key:value" pair plus the colon ":" and a leading
     * comma "," if the `currentAncillaryData` is not empty. The return value is intended to be prepended as a prefix to
     * some utf8 value that is ultimately added to a comma-delimited, key-value dictionary.
     */
    function constructPrefix(bytes memory currentAncillaryData, bytes memory key) internal pure returns (bytes memory) {
        if (currentAncillaryData.length > 0) {
            return abi.encodePacked(",", key, ":");
        } else {
            return abi.encodePacked(key, ":");
        }
    }
}

File 10 of 22 : 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 11 of 22 : FixedPoint.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity ^0.8.0;

import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/utils/math/SignedSafeMath.sol";

/**
 * @title Library for fixed point arithmetic on uints
 */
library FixedPoint {
    using SafeMath for uint256;
    using SignedSafeMath for int256;

    // Supports 18 decimals. E.g., 1e18 represents "1", 5e17 represents "0.5".
    // For unsigned values:
    //   This can represent a value up to (2^256 - 1)/10^18 = ~10^59. 10^59 will be stored internally as uint256 10^77.
    uint256 private constant FP_SCALING_FACTOR = 10**18;

    // --------------------------------------- UNSIGNED -----------------------------------------------------------------------------
    struct Unsigned {
        uint256 rawValue;
    }

    /**
     * @notice Constructs an `Unsigned` from an unscaled uint, e.g., `b=5` gets stored internally as `5*(10**18)`.
     * @param a uint to convert into a FixedPoint.
     * @return the converted FixedPoint.
     */
    function fromUnscaledUint(uint256 a) internal pure returns (Unsigned memory) {
        return Unsigned(a.mul(FP_SCALING_FACTOR));
    }

    /**
     * @notice Whether `a` is equal to `b`.
     * @param a a FixedPoint.
     * @param b a uint256.
     * @return True if equal, or False.
     */
    function isEqual(Unsigned memory a, uint256 b) internal pure returns (bool) {
        return a.rawValue == fromUnscaledUint(b).rawValue;
    }

    /**
     * @notice Whether `a` is equal to `b`.
     * @param a a FixedPoint.
     * @param b a FixedPoint.
     * @return True if equal, or False.
     */
    function isEqual(Unsigned memory a, Unsigned memory b) internal pure returns (bool) {
        return a.rawValue == b.rawValue;
    }

    /**
     * @notice Whether `a` is greater than `b`.
     * @param a a FixedPoint.
     * @param b a FixedPoint.
     * @return True if `a > b`, or False.
     */
    function isGreaterThan(Unsigned memory a, Unsigned memory b) internal pure returns (bool) {
        return a.rawValue > b.rawValue;
    }

    /**
     * @notice Whether `a` is greater than `b`.
     * @param a a FixedPoint.
     * @param b a uint256.
     * @return True if `a > b`, or False.
     */
    function isGreaterThan(Unsigned memory a, uint256 b) internal pure returns (bool) {
        return a.rawValue > fromUnscaledUint(b).rawValue;
    }

    /**
     * @notice Whether `a` is greater than `b`.
     * @param a a uint256.
     * @param b a FixedPoint.
     * @return True if `a > b`, or False.
     */
    function isGreaterThan(uint256 a, Unsigned memory b) internal pure returns (bool) {
        return fromUnscaledUint(a).rawValue > b.rawValue;
    }

    /**
     * @notice Whether `a` is greater than or equal to `b`.
     * @param a a FixedPoint.
     * @param b a FixedPoint.
     * @return True if `a >= b`, or False.
     */
    function isGreaterThanOrEqual(Unsigned memory a, Unsigned memory b) internal pure returns (bool) {
        return a.rawValue >= b.rawValue;
    }

    /**
     * @notice Whether `a` is greater than or equal to `b`.
     * @param a a FixedPoint.
     * @param b a uint256.
     * @return True if `a >= b`, or False.
     */
    function isGreaterThanOrEqual(Unsigned memory a, uint256 b) internal pure returns (bool) {
        return a.rawValue >= fromUnscaledUint(b).rawValue;
    }

    /**
     * @notice Whether `a` is greater than or equal to `b`.
     * @param a a uint256.
     * @param b a FixedPoint.
     * @return True if `a >= b`, or False.
     */
    function isGreaterThanOrEqual(uint256 a, Unsigned memory b) internal pure returns (bool) {
        return fromUnscaledUint(a).rawValue >= b.rawValue;
    }

    /**
     * @notice Whether `a` is less than `b`.
     * @param a a FixedPoint.
     * @param b a FixedPoint.
     * @return True if `a < b`, or False.
     */
    function isLessThan(Unsigned memory a, Unsigned memory b) internal pure returns (bool) {
        return a.rawValue < b.rawValue;
    }

    /**
     * @notice Whether `a` is less than `b`.
     * @param a a FixedPoint.
     * @param b a uint256.
     * @return True if `a < b`, or False.
     */
    function isLessThan(Unsigned memory a, uint256 b) internal pure returns (bool) {
        return a.rawValue < fromUnscaledUint(b).rawValue;
    }

    /**
     * @notice Whether `a` is less than `b`.
     * @param a a uint256.
     * @param b a FixedPoint.
     * @return True if `a < b`, or False.
     */
    function isLessThan(uint256 a, Unsigned memory b) internal pure returns (bool) {
        return fromUnscaledUint(a).rawValue < b.rawValue;
    }

    /**
     * @notice Whether `a` is less than or equal to `b`.
     * @param a a FixedPoint.
     * @param b a FixedPoint.
     * @return True if `a <= b`, or False.
     */
    function isLessThanOrEqual(Unsigned memory a, Unsigned memory b) internal pure returns (bool) {
        return a.rawValue <= b.rawValue;
    }

    /**
     * @notice Whether `a` is less than or equal to `b`.
     * @param a a FixedPoint.
     * @param b a uint256.
     * @return True if `a <= b`, or False.
     */
    function isLessThanOrEqual(Unsigned memory a, uint256 b) internal pure returns (bool) {
        return a.rawValue <= fromUnscaledUint(b).rawValue;
    }

    /**
     * @notice Whether `a` is less than or equal to `b`.
     * @param a a uint256.
     * @param b a FixedPoint.
     * @return True if `a <= b`, or False.
     */
    function isLessThanOrEqual(uint256 a, Unsigned memory b) internal pure returns (bool) {
        return fromUnscaledUint(a).rawValue <= b.rawValue;
    }

    /**
     * @notice The minimum of `a` and `b`.
     * @param a a FixedPoint.
     * @param b a FixedPoint.
     * @return the minimum of `a` and `b`.
     */
    function min(Unsigned memory a, Unsigned memory b) internal pure returns (Unsigned memory) {
        return a.rawValue < b.rawValue ? a : b;
    }

    /**
     * @notice The maximum of `a` and `b`.
     * @param a a FixedPoint.
     * @param b a FixedPoint.
     * @return the maximum of `a` and `b`.
     */
    function max(Unsigned memory a, Unsigned memory b) internal pure returns (Unsigned memory) {
        return a.rawValue > b.rawValue ? a : b;
    }

    /**
     * @notice Adds two `Unsigned`s, reverting on overflow.
     * @param a a FixedPoint.
     * @param b a FixedPoint.
     * @return the sum of `a` and `b`.
     */
    function add(Unsigned memory a, Unsigned memory b) internal pure returns (Unsigned memory) {
        return Unsigned(a.rawValue.add(b.rawValue));
    }

    /**
     * @notice Adds an `Unsigned` to an unscaled uint, reverting on overflow.
     * @param a a FixedPoint.
     * @param b a uint256.
     * @return the sum of `a` and `b`.
     */
    function add(Unsigned memory a, uint256 b) internal pure returns (Unsigned memory) {
        return add(a, fromUnscaledUint(b));
    }

    /**
     * @notice Subtracts two `Unsigned`s, reverting on overflow.
     * @param a a FixedPoint.
     * @param b a FixedPoint.
     * @return the difference of `a` and `b`.
     */
    function sub(Unsigned memory a, Unsigned memory b) internal pure returns (Unsigned memory) {
        return Unsigned(a.rawValue.sub(b.rawValue));
    }

    /**
     * @notice Subtracts an unscaled uint256 from an `Unsigned`, reverting on overflow.
     * @param a a FixedPoint.
     * @param b a uint256.
     * @return the difference of `a` and `b`.
     */
    function sub(Unsigned memory a, uint256 b) internal pure returns (Unsigned memory) {
        return sub(a, fromUnscaledUint(b));
    }

    /**
     * @notice Subtracts an `Unsigned` from an unscaled uint256, reverting on overflow.
     * @param a a uint256.
     * @param b a FixedPoint.
     * @return the difference of `a` and `b`.
     */
    function sub(uint256 a, Unsigned memory b) internal pure returns (Unsigned memory) {
        return sub(fromUnscaledUint(a), b);
    }

    /**
     * @notice Multiplies two `Unsigned`s, reverting on overflow.
     * @dev This will "floor" the product.
     * @param a a FixedPoint.
     * @param b a FixedPoint.
     * @return the product of `a` and `b`.
     */
    function mul(Unsigned memory a, Unsigned memory b) internal pure returns (Unsigned memory) {
        // There are two caveats with this computation:
        // 1. Max output for the represented number is ~10^41, otherwise an intermediate value overflows. 10^41 is
        // stored internally as a uint256 ~10^59.
        // 2. Results that can't be represented exactly are truncated not rounded. E.g., 1.4 * 2e-18 = 2.8e-18, which
        // would round to 3, but this computation produces the result 2.
        // No need to use SafeMath because FP_SCALING_FACTOR != 0.
        return Unsigned(a.rawValue.mul(b.rawValue) / FP_SCALING_FACTOR);
    }

    /**
     * @notice Multiplies an `Unsigned` and an unscaled uint256, reverting on overflow.
     * @dev This will "floor" the product.
     * @param a a FixedPoint.
     * @param b a uint256.
     * @return the product of `a` and `b`.
     */
    function mul(Unsigned memory a, uint256 b) internal pure returns (Unsigned memory) {
        return Unsigned(a.rawValue.mul(b));
    }

    /**
     * @notice Multiplies two `Unsigned`s and "ceil's" the product, reverting on overflow.
     * @param a a FixedPoint.
     * @param b a FixedPoint.
     * @return the product of `a` and `b`.
     */
    function mulCeil(Unsigned memory a, Unsigned memory b) internal pure returns (Unsigned memory) {
        uint256 mulRaw = a.rawValue.mul(b.rawValue);
        uint256 mulFloor = mulRaw / FP_SCALING_FACTOR;
        uint256 mod = mulRaw.mod(FP_SCALING_FACTOR);
        if (mod != 0) {
            return Unsigned(mulFloor.add(1));
        } else {
            return Unsigned(mulFloor);
        }
    }

    /**
     * @notice Multiplies an `Unsigned` and an unscaled uint256 and "ceil's" the product, reverting on overflow.
     * @param a a FixedPoint.
     * @param b a FixedPoint.
     * @return the product of `a` and `b`.
     */
    function mulCeil(Unsigned memory a, uint256 b) internal pure returns (Unsigned memory) {
        // Since b is an uint, there is no risk of truncation and we can just mul it normally
        return Unsigned(a.rawValue.mul(b));
    }

    /**
     * @notice Divides one `Unsigned` by an `Unsigned`, reverting on overflow or division by 0.
     * @dev This will "floor" the quotient.
     * @param a a FixedPoint numerator.
     * @param b a FixedPoint denominator.
     * @return the quotient of `a` divided by `b`.
     */
    function div(Unsigned memory a, Unsigned memory b) internal pure returns (Unsigned memory) {
        // There are two caveats with this computation:
        // 1. Max value for the number dividend `a` represents is ~10^41, otherwise an intermediate value overflows.
        // 10^41 is stored internally as a uint256 10^59.
        // 2. Results that can't be represented exactly are truncated not rounded. E.g., 2 / 3 = 0.6 repeating, which
        // would round to 0.666666666666666667, but this computation produces the result 0.666666666666666666.
        return Unsigned(a.rawValue.mul(FP_SCALING_FACTOR).div(b.rawValue));
    }

    /**
     * @notice Divides one `Unsigned` by an unscaled uint256, reverting on overflow or division by 0.
     * @dev This will "floor" the quotient.
     * @param a a FixedPoint numerator.
     * @param b a uint256 denominator.
     * @return the quotient of `a` divided by `b`.
     */
    function div(Unsigned memory a, uint256 b) internal pure returns (Unsigned memory) {
        return Unsigned(a.rawValue.div(b));
    }

    /**
     * @notice Divides one unscaled uint256 by an `Unsigned`, reverting on overflow or division by 0.
     * @dev This will "floor" the quotient.
     * @param a a uint256 numerator.
     * @param b a FixedPoint denominator.
     * @return the quotient of `a` divided by `b`.
     */
    function div(uint256 a, Unsigned memory b) internal pure returns (Unsigned memory) {
        return div(fromUnscaledUint(a), b);
    }

    /**
     * @notice Divides one `Unsigned` by an `Unsigned` and "ceil's" the quotient, reverting on overflow or division by 0.
     * @param a a FixedPoint numerator.
     * @param b a FixedPoint denominator.
     * @return the quotient of `a` divided by `b`.
     */
    function divCeil(Unsigned memory a, Unsigned memory b) internal pure returns (Unsigned memory) {
        uint256 aScaled = a.rawValue.mul(FP_SCALING_FACTOR);
        uint256 divFloor = aScaled.div(b.rawValue);
        uint256 mod = aScaled.mod(b.rawValue);
        if (mod != 0) {
            return Unsigned(divFloor.add(1));
        } else {
            return Unsigned(divFloor);
        }
    }

    /**
     * @notice Divides one `Unsigned` by an unscaled uint256 and "ceil's" the quotient, reverting on overflow or division by 0.
     * @param a a FixedPoint numerator.
     * @param b a uint256 denominator.
     * @return the quotient of `a` divided by `b`.
     */
    function divCeil(Unsigned memory a, uint256 b) internal pure returns (Unsigned memory) {
        // Because it is possible that a quotient gets truncated, we can't just call "Unsigned(a.rawValue.div(b))"
        // similarly to mulCeil with a uint256 as the second parameter. Therefore we need to convert b into an Unsigned.
        // This creates the possibility of overflow if b is very large.
        return divCeil(a, fromUnscaledUint(b));
    }

    /**
     * @notice Raises an `Unsigned` to the power of an unscaled uint256, reverting on overflow. E.g., `b=2` squares `a`.
     * @dev This will "floor" the result.
     * @param a a FixedPoint numerator.
     * @param b a uint256 denominator.
     * @return output is `a` to the power of `b`.
     */
    function pow(Unsigned memory a, uint256 b) internal pure returns (Unsigned memory output) {
        output = fromUnscaledUint(1);
        for (uint256 i = 0; i < b; i = i.add(1)) {
            output = mul(output, a);
        }
    }

    // ------------------------------------------------- SIGNED -------------------------------------------------------------
    // Supports 18 decimals. E.g., 1e18 represents "1", 5e17 represents "0.5".
    // For signed values:
    //   This can represent a value up (or down) to +-(2^255 - 1)/10^18 = ~10^58. 10^58 will be stored internally as int256 10^76.
    int256 private constant SFP_SCALING_FACTOR = 10**18;

    struct Signed {
        int256 rawValue;
    }

    function fromSigned(Signed memory a) internal pure returns (Unsigned memory) {
        require(a.rawValue >= 0, "Negative value provided");
        return Unsigned(uint256(a.rawValue));
    }

    function fromUnsigned(Unsigned memory a) internal pure returns (Signed memory) {
        require(a.rawValue <= uint256(type(int256).max), "Unsigned too large");
        return Signed(int256(a.rawValue));
    }

    /**
     * @notice Constructs a `Signed` from an unscaled int, e.g., `b=5` gets stored internally as `5*(10**18)`.
     * @param a int to convert into a FixedPoint.Signed.
     * @return the converted FixedPoint.Signed.
     */
    function fromUnscaledInt(int256 a) internal pure returns (Signed memory) {
        return Signed(a.mul(SFP_SCALING_FACTOR));
    }

    /**
     * @notice Whether `a` is equal to `b`.
     * @param a a FixedPoint.Signed.
     * @param b a int256.
     * @return True if equal, or False.
     */
    function isEqual(Signed memory a, int256 b) internal pure returns (bool) {
        return a.rawValue == fromUnscaledInt(b).rawValue;
    }

    /**
     * @notice Whether `a` is equal to `b`.
     * @param a a FixedPoint.Signed.
     * @param b a FixedPoint.Signed.
     * @return True if equal, or False.
     */
    function isEqual(Signed memory a, Signed memory b) internal pure returns (bool) {
        return a.rawValue == b.rawValue;
    }

    /**
     * @notice Whether `a` is greater than `b`.
     * @param a a FixedPoint.Signed.
     * @param b a FixedPoint.Signed.
     * @return True if `a > b`, or False.
     */
    function isGreaterThan(Signed memory a, Signed memory b) internal pure returns (bool) {
        return a.rawValue > b.rawValue;
    }

    /**
     * @notice Whether `a` is greater than `b`.
     * @param a a FixedPoint.Signed.
     * @param b an int256.
     * @return True if `a > b`, or False.
     */
    function isGreaterThan(Signed memory a, int256 b) internal pure returns (bool) {
        return a.rawValue > fromUnscaledInt(b).rawValue;
    }

    /**
     * @notice Whether `a` is greater than `b`.
     * @param a an int256.
     * @param b a FixedPoint.Signed.
     * @return True if `a > b`, or False.
     */
    function isGreaterThan(int256 a, Signed memory b) internal pure returns (bool) {
        return fromUnscaledInt(a).rawValue > b.rawValue;
    }

    /**
     * @notice Whether `a` is greater than or equal to `b`.
     * @param a a FixedPoint.Signed.
     * @param b a FixedPoint.Signed.
     * @return True if `a >= b`, or False.
     */
    function isGreaterThanOrEqual(Signed memory a, Signed memory b) internal pure returns (bool) {
        return a.rawValue >= b.rawValue;
    }

    /**
     * @notice Whether `a` is greater than or equal to `b`.
     * @param a a FixedPoint.Signed.
     * @param b an int256.
     * @return True if `a >= b`, or False.
     */
    function isGreaterThanOrEqual(Signed memory a, int256 b) internal pure returns (bool) {
        return a.rawValue >= fromUnscaledInt(b).rawValue;
    }

    /**
     * @notice Whether `a` is greater than or equal to `b`.
     * @param a an int256.
     * @param b a FixedPoint.Signed.
     * @return True if `a >= b`, or False.
     */
    function isGreaterThanOrEqual(int256 a, Signed memory b) internal pure returns (bool) {
        return fromUnscaledInt(a).rawValue >= b.rawValue;
    }

    /**
     * @notice Whether `a` is less than `b`.
     * @param a a FixedPoint.Signed.
     * @param b a FixedPoint.Signed.
     * @return True if `a < b`, or False.
     */
    function isLessThan(Signed memory a, Signed memory b) internal pure returns (bool) {
        return a.rawValue < b.rawValue;
    }

    /**
     * @notice Whether `a` is less than `b`.
     * @param a a FixedPoint.Signed.
     * @param b an int256.
     * @return True if `a < b`, or False.
     */
    function isLessThan(Signed memory a, int256 b) internal pure returns (bool) {
        return a.rawValue < fromUnscaledInt(b).rawValue;
    }

    /**
     * @notice Whether `a` is less than `b`.
     * @param a an int256.
     * @param b a FixedPoint.Signed.
     * @return True if `a < b`, or False.
     */
    function isLessThan(int256 a, Signed memory b) internal pure returns (bool) {
        return fromUnscaledInt(a).rawValue < b.rawValue;
    }

    /**
     * @notice Whether `a` is less than or equal to `b`.
     * @param a a FixedPoint.Signed.
     * @param b a FixedPoint.Signed.
     * @return True if `a <= b`, or False.
     */
    function isLessThanOrEqual(Signed memory a, Signed memory b) internal pure returns (bool) {
        return a.rawValue <= b.rawValue;
    }

    /**
     * @notice Whether `a` is less than or equal to `b`.
     * @param a a FixedPoint.Signed.
     * @param b an int256.
     * @return True if `a <= b`, or False.
     */
    function isLessThanOrEqual(Signed memory a, int256 b) internal pure returns (bool) {
        return a.rawValue <= fromUnscaledInt(b).rawValue;
    }

    /**
     * @notice Whether `a` is less than or equal to `b`.
     * @param a an int256.
     * @param b a FixedPoint.Signed.
     * @return True if `a <= b`, or False.
     */
    function isLessThanOrEqual(int256 a, Signed memory b) internal pure returns (bool) {
        return fromUnscaledInt(a).rawValue <= b.rawValue;
    }

    /**
     * @notice The minimum of `a` and `b`.
     * @param a a FixedPoint.Signed.
     * @param b a FixedPoint.Signed.
     * @return the minimum of `a` and `b`.
     */
    function min(Signed memory a, Signed memory b) internal pure returns (Signed memory) {
        return a.rawValue < b.rawValue ? a : b;
    }

    /**
     * @notice The maximum of `a` and `b`.
     * @param a a FixedPoint.Signed.
     * @param b a FixedPoint.Signed.
     * @return the maximum of `a` and `b`.
     */
    function max(Signed memory a, Signed memory b) internal pure returns (Signed memory) {
        return a.rawValue > b.rawValue ? a : b;
    }

    /**
     * @notice Adds two `Signed`s, reverting on overflow.
     * @param a a FixedPoint.Signed.
     * @param b a FixedPoint.Signed.
     * @return the sum of `a` and `b`.
     */
    function add(Signed memory a, Signed memory b) internal pure returns (Signed memory) {
        return Signed(a.rawValue.add(b.rawValue));
    }

    /**
     * @notice Adds an `Signed` to an unscaled int, reverting on overflow.
     * @param a a FixedPoint.Signed.
     * @param b an int256.
     * @return the sum of `a` and `b`.
     */
    function add(Signed memory a, int256 b) internal pure returns (Signed memory) {
        return add(a, fromUnscaledInt(b));
    }

    /**
     * @notice Subtracts two `Signed`s, reverting on overflow.
     * @param a a FixedPoint.Signed.
     * @param b a FixedPoint.Signed.
     * @return the difference of `a` and `b`.
     */
    function sub(Signed memory a, Signed memory b) internal pure returns (Signed memory) {
        return Signed(a.rawValue.sub(b.rawValue));
    }

    /**
     * @notice Subtracts an unscaled int256 from an `Signed`, reverting on overflow.
     * @param a a FixedPoint.Signed.
     * @param b an int256.
     * @return the difference of `a` and `b`.
     */
    function sub(Signed memory a, int256 b) internal pure returns (Signed memory) {
        return sub(a, fromUnscaledInt(b));
    }

    /**
     * @notice Subtracts an `Signed` from an unscaled int256, reverting on overflow.
     * @param a an int256.
     * @param b a FixedPoint.Signed.
     * @return the difference of `a` and `b`.
     */
    function sub(int256 a, Signed memory b) internal pure returns (Signed memory) {
        return sub(fromUnscaledInt(a), b);
    }

    /**
     * @notice Multiplies two `Signed`s, reverting on overflow.
     * @dev This will "floor" the product.
     * @param a a FixedPoint.Signed.
     * @param b a FixedPoint.Signed.
     * @return the product of `a` and `b`.
     */
    function mul(Signed memory a, Signed memory b) internal pure returns (Signed memory) {
        // There are two caveats with this computation:
        // 1. Max output for the represented number is ~10^41, otherwise an intermediate value overflows. 10^41 is
        // stored internally as an int256 ~10^59.
        // 2. Results that can't be represented exactly are truncated not rounded. E.g., 1.4 * 2e-18 = 2.8e-18, which
        // would round to 3, but this computation produces the result 2.
        // No need to use SafeMath because SFP_SCALING_FACTOR != 0.
        return Signed(a.rawValue.mul(b.rawValue) / SFP_SCALING_FACTOR);
    }

    /**
     * @notice Multiplies an `Signed` and an unscaled int256, reverting on overflow.
     * @dev This will "floor" the product.
     * @param a a FixedPoint.Signed.
     * @param b an int256.
     * @return the product of `a` and `b`.
     */
    function mul(Signed memory a, int256 b) internal pure returns (Signed memory) {
        return Signed(a.rawValue.mul(b));
    }

    /**
     * @notice Multiplies two `Signed`s and "ceil's" the product, reverting on overflow.
     * @param a a FixedPoint.Signed.
     * @param b a FixedPoint.Signed.
     * @return the product of `a` and `b`.
     */
    function mulAwayFromZero(Signed memory a, Signed memory b) internal pure returns (Signed memory) {
        int256 mulRaw = a.rawValue.mul(b.rawValue);
        int256 mulTowardsZero = mulRaw / SFP_SCALING_FACTOR;
        // Manual mod because SignedSafeMath doesn't support it.
        int256 mod = mulRaw % SFP_SCALING_FACTOR;
        if (mod != 0) {
            bool isResultPositive = isLessThan(a, 0) == isLessThan(b, 0);
            int256 valueToAdd = isResultPositive ? int256(1) : int256(-1);
            return Signed(mulTowardsZero.add(valueToAdd));
        } else {
            return Signed(mulTowardsZero);
        }
    }

    /**
     * @notice Multiplies an `Signed` and an unscaled int256 and "ceil's" the product, reverting on overflow.
     * @param a a FixedPoint.Signed.
     * @param b a FixedPoint.Signed.
     * @return the product of `a` and `b`.
     */
    function mulAwayFromZero(Signed memory a, int256 b) internal pure returns (Signed memory) {
        // Since b is an int, there is no risk of truncation and we can just mul it normally
        return Signed(a.rawValue.mul(b));
    }

    /**
     * @notice Divides one `Signed` by an `Signed`, reverting on overflow or division by 0.
     * @dev This will "floor" the quotient.
     * @param a a FixedPoint numerator.
     * @param b a FixedPoint denominator.
     * @return the quotient of `a` divided by `b`.
     */
    function div(Signed memory a, Signed memory b) internal pure returns (Signed memory) {
        // There are two caveats with this computation:
        // 1. Max value for the number dividend `a` represents is ~10^41, otherwise an intermediate value overflows.
        // 10^41 is stored internally as an int256 10^59.
        // 2. Results that can't be represented exactly are truncated not rounded. E.g., 2 / 3 = 0.6 repeating, which
        // would round to 0.666666666666666667, but this computation produces the result 0.666666666666666666.
        return Signed(a.rawValue.mul(SFP_SCALING_FACTOR).div(b.rawValue));
    }

    /**
     * @notice Divides one `Signed` by an unscaled int256, reverting on overflow or division by 0.
     * @dev This will "floor" the quotient.
     * @param a a FixedPoint numerator.
     * @param b an int256 denominator.
     * @return the quotient of `a` divided by `b`.
     */
    function div(Signed memory a, int256 b) internal pure returns (Signed memory) {
        return Signed(a.rawValue.div(b));
    }

    /**
     * @notice Divides one unscaled int256 by an `Signed`, reverting on overflow or division by 0.
     * @dev This will "floor" the quotient.
     * @param a an int256 numerator.
     * @param b a FixedPoint denominator.
     * @return the quotient of `a` divided by `b`.
     */
    function div(int256 a, Signed memory b) internal pure returns (Signed memory) {
        return div(fromUnscaledInt(a), b);
    }

    /**
     * @notice Divides one `Signed` by an `Signed` and "ceil's" the quotient, reverting on overflow or division by 0.
     * @param a a FixedPoint numerator.
     * @param b a FixedPoint denominator.
     * @return the quotient of `a` divided by `b`.
     */
    function divAwayFromZero(Signed memory a, Signed memory b) internal pure returns (Signed memory) {
        int256 aScaled = a.rawValue.mul(SFP_SCALING_FACTOR);
        int256 divTowardsZero = aScaled.div(b.rawValue);
        // Manual mod because SignedSafeMath doesn't support it.
        int256 mod = aScaled % b.rawValue;
        if (mod != 0) {
            bool isResultPositive = isLessThan(a, 0) == isLessThan(b, 0);
            int256 valueToAdd = isResultPositive ? int256(1) : int256(-1);
            return Signed(divTowardsZero.add(valueToAdd));
        } else {
            return Signed(divTowardsZero);
        }
    }

    /**
     * @notice Divides one `Signed` by an unscaled int256 and "ceil's" the quotient, reverting on overflow or division by 0.
     * @param a a FixedPoint numerator.
     * @param b an int256 denominator.
     * @return the quotient of `a` divided by `b`.
     */
    function divAwayFromZero(Signed memory a, int256 b) internal pure returns (Signed memory) {
        // Because it is possible that a quotient gets truncated, we can't just call "Signed(a.rawValue.div(b))"
        // similarly to mulCeil with an int256 as the second parameter. Therefore we need to convert b into an Signed.
        // This creates the possibility of overflow if b is very large.
        return divAwayFromZero(a, fromUnscaledInt(b));
    }

    /**
     * @notice Raises an `Signed` to the power of an unscaled uint256, reverting on overflow. E.g., `b=2` squares `a`.
     * @dev This will "floor" the result.
     * @param a a FixedPoint.Signed.
     * @param b a uint256 (negative exponents are not allowed).
     * @return output is `a` to the power of `b`.
     */
    function pow(Signed memory a, uint256 b) internal pure returns (Signed memory output) {
        output = fromUnscaledInt(1);
        for (uint256 i = 0; i < b; i = i.add(1)) {
            output = mul(output, a);
        }
    }
}

File 12 of 22 : 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.
 */
contract Lockable {
    bool private _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();
        _;
    }

    // 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 13 of 22 : 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 14 of 22 : IERC20.sol
// SPDX-License-Identifier: MIT

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 `recipient`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address recipient, 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 `sender` to `recipient` 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 sender,
        address recipient,
        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 15 of 22 : ERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "./IERC20.sol";
import "./extensions/IERC20Metadata.sol";
import "../../utils/Context.sol";

/**
 * @dev Implementation of the {IERC20} interface.
 *
 * This implementation is agnostic to the way tokens are created. This means
 * that a supply mechanism has to be added in a derived contract using {_mint}.
 * For a generic mechanism see {ERC20PresetMinterPauser}.
 *
 * TIP: For a detailed writeup see our guide
 * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
 * to implement supply mechanisms].
 *
 * We have followed general OpenZeppelin Contracts guidelines: functions revert
 * instead returning `false` on failure. This behavior is nonetheless
 * conventional and does not conflict with the expectations of ERC20
 * applications.
 *
 * Additionally, an {Approval} event is emitted on calls to {transferFrom}.
 * This allows applications to reconstruct the allowance for all accounts just
 * by listening to said events. Other implementations of the EIP may not emit
 * these events, as it isn't required by the specification.
 *
 * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
 * functions have been added to mitigate the well-known issues around setting
 * allowances. See {IERC20-approve}.
 */
contract ERC20 is Context, IERC20, IERC20Metadata {
    mapping(address => uint256) private _balances;

    mapping(address => mapping(address => uint256)) private _allowances;

    uint256 private _totalSupply;

    string private _name;
    string private _symbol;

    /**
     * @dev Sets the values for {name} and {symbol}.
     *
     * The default value of {decimals} is 18. To select a different value for
     * {decimals} you should overload it.
     *
     * All two of these values are immutable: they can only be set once during
     * construction.
     */
    constructor(string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
    }

    /**
     * @dev Returns the name of the token.
     */
    function name() public view virtual override returns (string memory) {
        return _name;
    }

    /**
     * @dev Returns the symbol of the token, usually a shorter version of the
     * name.
     */
    function symbol() public view virtual override returns (string memory) {
        return _symbol;
    }

    /**
     * @dev Returns the number of decimals used to get its user representation.
     * For example, if `decimals` equals `2`, a balance of `505` tokens should
     * be displayed to a user as `5.05` (`505 / 10 ** 2`).
     *
     * Tokens usually opt for a value of 18, imitating the relationship between
     * Ether and Wei. This is the value {ERC20} uses, unless this function is
     * overridden;
     *
     * NOTE: This information is only used for _display_ purposes: it in
     * no way affects any of the arithmetic of the contract, including
     * {IERC20-balanceOf} and {IERC20-transfer}.
     */
    function decimals() public view virtual override returns (uint8) {
        return 18;
    }

    /**
     * @dev See {IERC20-totalSupply}.
     */
    function totalSupply() public view virtual override returns (uint256) {
        return _totalSupply;
    }

    /**
     * @dev See {IERC20-balanceOf}.
     */
    function balanceOf(address account) public view virtual override returns (uint256) {
        return _balances[account];
    }

    /**
     * @dev See {IERC20-transfer}.
     *
     * Requirements:
     *
     * - `recipient` cannot be the zero address.
     * - the caller must have a balance of at least `amount`.
     */
    function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
        _transfer(_msgSender(), recipient, amount);
        return true;
    }

    /**
     * @dev See {IERC20-allowance}.
     */
    function allowance(address owner, address spender) public view virtual override returns (uint256) {
        return _allowances[owner][spender];
    }

    /**
     * @dev See {IERC20-approve}.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function approve(address spender, uint256 amount) public virtual override returns (bool) {
        _approve(_msgSender(), spender, amount);
        return true;
    }

    /**
     * @dev See {IERC20-transferFrom}.
     *
     * Emits an {Approval} event indicating the updated allowance. This is not
     * required by the EIP. See the note at the beginning of {ERC20}.
     *
     * Requirements:
     *
     * - `sender` and `recipient` cannot be the zero address.
     * - `sender` must have a balance of at least `amount`.
     * - the caller must have allowance for ``sender``'s tokens of at least
     * `amount`.
     */
    function transferFrom(
        address sender,
        address recipient,
        uint256 amount
    ) public virtual override returns (bool) {
        _transfer(sender, recipient, amount);

        uint256 currentAllowance = _allowances[sender][_msgSender()];
        require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance");
        unchecked {
            _approve(sender, _msgSender(), currentAllowance - amount);
        }

        return true;
    }

    /**
     * @dev Atomically increases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
        _approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue);
        return true;
    }

    /**
     * @dev Atomically decreases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `spender` must have allowance for the caller of at least
     * `subtractedValue`.
     */
    function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
        uint256 currentAllowance = _allowances[_msgSender()][spender];
        require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
        unchecked {
            _approve(_msgSender(), spender, currentAllowance - subtractedValue);
        }

        return true;
    }

    /**
     * @dev Moves `amount` of tokens from `sender` to `recipient`.
     *
     * This internal function is equivalent to {transfer}, and can be used to
     * e.g. implement automatic token fees, slashing mechanisms, etc.
     *
     * Emits a {Transfer} event.
     *
     * Requirements:
     *
     * - `sender` cannot be the zero address.
     * - `recipient` cannot be the zero address.
     * - `sender` must have a balance of at least `amount`.
     */
    function _transfer(
        address sender,
        address recipient,
        uint256 amount
    ) internal virtual {
        require(sender != address(0), "ERC20: transfer from the zero address");
        require(recipient != address(0), "ERC20: transfer to the zero address");

        _beforeTokenTransfer(sender, recipient, amount);

        uint256 senderBalance = _balances[sender];
        require(senderBalance >= amount, "ERC20: transfer amount exceeds balance");
        unchecked {
            _balances[sender] = senderBalance - amount;
        }
        _balances[recipient] += amount;

        emit Transfer(sender, recipient, amount);

        _afterTokenTransfer(sender, recipient, amount);
    }

    /** @dev Creates `amount` tokens and assigns them to `account`, increasing
     * the total supply.
     *
     * Emits a {Transfer} event with `from` set to the zero address.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     */
    function _mint(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: mint to the zero address");

        _beforeTokenTransfer(address(0), account, amount);

        _totalSupply += amount;
        _balances[account] += amount;
        emit Transfer(address(0), account, amount);

        _afterTokenTransfer(address(0), account, amount);
    }

    /**
     * @dev Destroys `amount` tokens from `account`, reducing the
     * total supply.
     *
     * Emits a {Transfer} event with `to` set to the zero address.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     * - `account` must have at least `amount` tokens.
     */
    function _burn(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: burn from the zero address");

        _beforeTokenTransfer(account, address(0), amount);

        uint256 accountBalance = _balances[account];
        require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
        unchecked {
            _balances[account] = accountBalance - amount;
        }
        _totalSupply -= amount;

        emit Transfer(account, address(0), amount);

        _afterTokenTransfer(account, address(0), amount);
    }

    /**
     * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
     *
     * This internal function is equivalent to `approve`, and can be used to
     * e.g. set automatic allowances for certain subsystems, etc.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `owner` cannot be the zero address.
     * - `spender` cannot be the zero address.
     */
    function _approve(
        address owner,
        address spender,
        uint256 amount
    ) internal virtual {
        require(owner != address(0), "ERC20: approve from the zero address");
        require(spender != address(0), "ERC20: approve to the zero address");

        _allowances[owner][spender] = amount;
        emit Approval(owner, spender, amount);
    }

    /**
     * @dev Hook that is called before any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * will be transferred to `to`.
     * - when `from` is zero, `amount` tokens will be minted for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens will be burned.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(
        address from,
        address to,
        uint256 amount
    ) internal virtual {}

    /**
     * @dev Hook that is called after any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * has been transferred to `to`.
     * - when `from` is zero, `amount` tokens have been minted for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens have been burned.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _afterTokenTransfer(
        address from,
        address to,
        uint256 amount
    ) internal virtual {}
}

File 16 of 22 : SafeERC20.sol
// SPDX-License-Identifier: MIT

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 17 of 22 : Address.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @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
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        uint256 size;
        assembly {
            size := extcodesize(account)
        }
        return size > 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 18 of 22 : OptimisticOracleInterface.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity ^0.8.0;

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

/**
 * @title Financial contract facing Oracle interface.
 * @dev Interface used by financial contracts to interact with the Oracle. Voters will use a different interface.
 */
abstract contract OptimisticOracleInterface {
    // Struct representing the state of a price request.
    enum State {
        Invalid, // Never requested.
        Requested, // Requested, no other actions taken.
        Proposed, // Proposed, but not expired or disputed yet.
        Expired, // Proposed, not disputed, past liveness.
        Disputed, // Disputed, but no DVM price returned yet.
        Resolved, // Disputed and DVM price is available.
        Settled // Final price has been set in the contract (can get here from Expired or Resolved).
    }

    // Struct representing a price request.
    struct Request {
        address proposer; // Address of the proposer.
        address disputer; // Address of the disputer.
        IERC20 currency; // ERC20 token used to pay rewards and fees.
        bool settled; // True if the request is settled.
        bool refundOnDispute; // True if the requester should be refunded their reward on dispute.
        int256 proposedPrice; // Price that the proposer submitted.
        int256 resolvedPrice; // Price resolved once the request is settled.
        uint256 expirationTime; // Time at which the request auto-settles without a dispute.
        uint256 reward; // Amount of the currency to pay to the proposer on settlement.
        uint256 finalFee; // Final fee to pay to the Store upon request to the DVM.
        uint256 bond; // Bond that the proposer and disputer must pay on top of the final fee.
        uint256 customLiveness; // Custom liveness value set by the requester.
    }

    // This value must be <= the Voting contract's `ancillaryBytesLimit` value otherwise it is possible
    // that a price can be requested to this contract successfully, but cannot be disputed because the DVM refuses
    // to accept a price request made with ancillary data length over a certain size.
    uint256 public constant ancillaryBytesLimit = 8192;

    /**
     * @notice Requests a new price.
     * @param identifier price identifier being requested.
     * @param timestamp timestamp of the price being requested.
     * @param ancillaryData ancillary data representing additional args being passed with the price request.
     * @param currency ERC20 token used for payment of rewards and fees. Must be approved for use with the DVM.
     * @param reward reward offered to a successful proposer. Will be pulled from the caller. Note: this can be 0,
     *               which could make sense if the contract requests and proposes the value in the same call or
     *               provides its own reward system.
     * @return totalBond default bond (final fee) + final fee that the proposer and disputer will be required to pay.
     * This can be changed with a subsequent call to setBond().
     */
    function requestPrice(
        bytes32 identifier,
        uint256 timestamp,
        bytes memory ancillaryData,
        IERC20 currency,
        uint256 reward
    ) external virtual returns (uint256 totalBond);

    /**
     * @notice Set the proposal bond associated with a price request.
     * @param identifier price identifier to identify the existing request.
     * @param timestamp timestamp to identify the existing request.
     * @param ancillaryData ancillary data of the price being requested.
     * @param bond custom bond amount to set.
     * @return totalBond new bond + final fee that the proposer and disputer will be required to pay. This can be
     * changed again with a subsequent call to setBond().
     */
    function setBond(
        bytes32 identifier,
        uint256 timestamp,
        bytes memory ancillaryData,
        uint256 bond
    ) external virtual returns (uint256 totalBond);

    /**
     * @notice Sets the request to refund the reward if the proposal is disputed. This can help to "hedge" the caller
     * in the event of a dispute-caused delay. Note: in the event of a dispute, the winner still receives the other's
     * bond, so there is still profit to be made even if the reward is refunded.
     * @param identifier price identifier to identify the existing request.
     * @param timestamp timestamp to identify the existing request.
     * @param ancillaryData ancillary data of the price being requested.
     */
    function setRefundOnDispute(
        bytes32 identifier,
        uint256 timestamp,
        bytes memory ancillaryData
    ) external virtual;

    /**
     * @notice Sets a custom liveness value for the request. Liveness is the amount of time a proposal must wait before
     * being auto-resolved.
     * @param identifier price identifier to identify the existing request.
     * @param timestamp timestamp to identify the existing request.
     * @param ancillaryData ancillary data of the price being requested.
     * @param customLiveness new custom liveness.
     */
    function setCustomLiveness(
        bytes32 identifier,
        uint256 timestamp,
        bytes memory ancillaryData,
        uint256 customLiveness
    ) external virtual;

    /**
     * @notice Proposes a price value on another address' behalf. Note: this address will receive any rewards that come
     * from this proposal. However, any bonds are pulled from the caller.
     * @param proposer address to set as the proposer.
     * @param requester sender of the initial price request.
     * @param identifier price identifier to identify the existing request.
     * @param timestamp timestamp to identify the existing request.
     * @param ancillaryData ancillary data of the price being requested.
     * @param proposedPrice price being proposed.
     * @return totalBond the amount that's pulled from the caller's wallet as a bond. The bond will be returned to
     * the proposer once settled if the proposal is correct.
     */
    function proposePriceFor(
        address proposer,
        address requester,
        bytes32 identifier,
        uint256 timestamp,
        bytes memory ancillaryData,
        int256 proposedPrice
    ) public virtual returns (uint256 totalBond);

    /**
     * @notice Proposes a price value for an existing price request.
     * @param requester sender of the initial price request.
     * @param identifier price identifier to identify the existing request.
     * @param timestamp timestamp to identify the existing request.
     * @param ancillaryData ancillary data of the price being requested.
     * @param proposedPrice price being proposed.
     * @return totalBond the amount that's pulled from the proposer's wallet as a bond. The bond will be returned to
     * the proposer once settled if the proposal is correct.
     */
    function proposePrice(
        address requester,
        bytes32 identifier,
        uint256 timestamp,
        bytes memory ancillaryData,
        int256 proposedPrice
    ) external virtual returns (uint256 totalBond);

    /**
     * @notice Disputes a price request with an active proposal on another address' behalf. Note: this address will
     * receive any rewards that come from this dispute. However, any bonds are pulled from the caller.
     * @param disputer address to set as the disputer.
     * @param requester sender of the initial price request.
     * @param identifier price identifier to identify the existing request.
     * @param timestamp timestamp to identify the existing request.
     * @param ancillaryData ancillary data of the price being requested.
     * @return totalBond the amount that's pulled from the caller's wallet as a bond. The bond will be returned to
     * the disputer once settled if the dispute was value (the proposal was incorrect).
     */
    function disputePriceFor(
        address disputer,
        address requester,
        bytes32 identifier,
        uint256 timestamp,
        bytes memory ancillaryData
    ) public virtual returns (uint256 totalBond);

    /**
     * @notice Disputes a price value for an existing price request with an active proposal.
     * @param requester sender of the initial price request.
     * @param identifier price identifier to identify the existing request.
     * @param timestamp timestamp to identify the existing request.
     * @param ancillaryData ancillary data of the price being requested.
     * @return totalBond the amount that's pulled from the disputer's wallet as a bond. The bond will be returned to
     * the disputer once settled if the dispute was valid (the proposal was incorrect).
     */
    function disputePrice(
        address requester,
        bytes32 identifier,
        uint256 timestamp,
        bytes memory ancillaryData
    ) external virtual returns (uint256 totalBond);

    /**
     * @notice Retrieves a price that was previously requested by a caller. Reverts if the request is not settled
     * or settleable. Note: this method is not view so that this call may actually settle the price request if it
     * hasn't been settled.
     * @param identifier price identifier to identify the existing request.
     * @param timestamp timestamp to identify the existing request.
     * @param ancillaryData ancillary data of the price being requested.
     * @return resolved price.
     */
    function settleAndGetPrice(
        bytes32 identifier,
        uint256 timestamp,
        bytes memory ancillaryData
    ) external virtual returns (int256);

    /**
     * @notice Attempts to settle an outstanding price request. Will revert if it isn't settleable.
     * @param requester sender of the initial price request.
     * @param identifier price identifier to identify the existing request.
     * @param timestamp timestamp to identify the existing request.
     * @param ancillaryData ancillary data of the price being requested.
     * @return payout the amount that the "winner" (proposer or disputer) receives on settlement. This amount includes
     * the returned bonds as well as additional rewards.
     */
    function settle(
        address requester,
        bytes32 identifier,
        uint256 timestamp,
        bytes memory ancillaryData
    ) external virtual returns (uint256 payout);

    /**
     * @notice Gets the current data structure containing all information about a price request.
     * @param requester sender of the initial price request.
     * @param identifier price identifier to identify the existing request.
     * @param timestamp timestamp to identify the existing request.
     * @param ancillaryData ancillary data of the price being requested.
     * @return the Request data structure.
     */
    function getRequest(
        address requester,
        bytes32 identifier,
        uint256 timestamp,
        bytes memory ancillaryData
    ) public view virtual returns (Request memory);

    /**
     * @notice Returns the state of a price request.
     * @param requester sender of the initial price request.
     * @param identifier price identifier to identify the existing request.
     * @param timestamp timestamp to identify the existing request.
     * @param ancillaryData ancillary data of the price being requested.
     * @return the State enum value.
     */
    function getState(
        address requester,
        bytes32 identifier,
        uint256 timestamp,
        bytes memory ancillaryData
    ) public view virtual returns (State);

    /**
     * @notice Checks if a given request has resolved or been settled (i.e the optimistic oracle has a price).
     * @param requester sender of the initial price request.
     * @param identifier price identifier to identify the existing request.
     * @param timestamp timestamp to identify the existing request.
     * @param ancillaryData ancillary data of the price being requested.
     * @return true if price has resolved or settled, false otherwise.
     */
    function hasPrice(
        address requester,
        bytes32 identifier,
        uint256 timestamp,
        bytes memory ancillaryData
    ) public view virtual returns (bool);

    function stampAncillaryData(bytes memory ancillaryData, address requester)
        public
        view
        virtual
        returns (bytes memory);
}

File 19 of 22 : SafeMath.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

// CAUTION
// This version of SafeMath should only be used with Solidity 0.8 or later,
// because it relies on the compiler's built in overflow checks.

/**
 * @dev Wrappers over Solidity's arithmetic operations.
 *
 * NOTE: `SafeMath` is no longer needed starting with Solidity 0.8. The compiler
 * now has built in overflow checking.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            uint256 c = a + b;
            if (c < a) return (false, 0);
            return (true, c);
        }
    }

    /**
     * @dev Returns the substraction of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b > a) return (false, 0);
            return (true, a - b);
        }
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
            // benefit is lost if 'b' is also tested.
            // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
            if (a == 0) return (true, 0);
            uint256 c = a * b;
            if (c / a != b) return (false, 0);
            return (true, c);
        }
    }

    /**
     * @dev Returns the division of two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a / b);
        }
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a % b);
        }
    }

    /**
     * @dev Returns the addition of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     *
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        return a + b;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        return a - b;
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     *
     * - Multiplication cannot overflow.
     */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        return a * b;
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator.
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        return a / b;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b) internal pure returns (uint256) {
        return a % b;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {trySub}.
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        unchecked {
            require(b <= a, errorMessage);
            return a - b;
        }
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting with custom message on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        unchecked {
            require(b > 0, errorMessage);
            return a / b;
        }
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting with custom message when dividing by zero.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryMod}.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        unchecked {
            require(b > 0, errorMessage);
            return a % b;
        }
    }
}

File 20 of 22 : SignedSafeMath.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev Wrappers over Solidity's arithmetic operations.
 *
 * NOTE: `SignedSafeMath` is no longer needed starting with Solidity 0.8. The compiler
 * now has built in overflow checking.
 */
library SignedSafeMath {
    /**
     * @dev Returns the multiplication of two signed integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     *
     * - Multiplication cannot overflow.
     */
    function mul(int256 a, int256 b) internal pure returns (int256) {
        return a * b;
    }

    /**
     * @dev Returns the integer division of two signed integers. Reverts on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator.
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(int256 a, int256 b) internal pure returns (int256) {
        return a / b;
    }

    /**
     * @dev Returns the subtraction of two signed integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(int256 a, int256 b) internal pure returns (int256) {
        return a - b;
    }

    /**
     * @dev Returns the addition of two signed integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     *
     * - Addition cannot overflow.
     */
    function add(int256 a, int256 b) internal pure returns (int256) {
        return a + b;
    }
}

File 21 of 22 : 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 22 of 22 : IERC20Metadata.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "../IERC20.sol";

/**
 * @dev Interface for the optional metadata functions from the ERC20 standard.
 *
 * _Available since v4.1._
 */
interface IERC20Metadata is IERC20 {
    /**
     * @dev Returns the name of the token.
     */
    function name() external view returns (string memory);

    /**
     * @dev Returns the symbol of the token.
     */
    function symbol() external view returns (string memory);

    /**
     * @dev Returns the decimals places of the token.
     */
    function decimals() external view returns (uint8);
}

File 23 of 22 : Context.sol
// SPDX-License-Identifier: MIT

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

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "abi"
      ]
    }
  }
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"string","name":"_lpTokenName","type":"string"},{"internalType":"string","name":"_lpTokenSymbol","type":"string"},{"internalType":"address","name":"_bridgeAdmin","type":"address"},{"internalType":"address","name":"_l1Token","type":"address"},{"internalType":"uint64","name":"_lpFeeRatePerSecond","type":"uint64"},{"internalType":"bool","name":"_isWethPool","type":"bool"},{"internalType":"address","name":"_timer","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldAdmin","type":"address"},{"indexed":false,"internalType":"address","name":"newAdmin","type":"address"}],"name":"BridgePoolAdminTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"depositHash","type":"bytes32"},{"components":[{"internalType":"uint256","name":"chainId","type":"uint256"},{"internalType":"uint64","name":"depositId","type":"uint64"},{"internalType":"address payable","name":"l1Recipient","type":"address"},{"internalType":"address","name":"l2Sender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint64","name":"slowRelayFeePct","type":"uint64"},{"internalType":"uint64","name":"instantRelayFeePct","type":"uint64"},{"internalType":"uint32","name":"quoteTimestamp","type":"uint32"}],"indexed":false,"internalType":"struct BridgePool.DepositData","name":"depositData","type":"tuple"},{"components":[{"internalType":"enum BridgePool.RelayState","name":"relayState","type":"uint8"},{"internalType":"address","name":"slowRelayer","type":"address"},{"internalType":"uint32","name":"relayId","type":"uint32"},{"internalType":"uint64","name":"realizedLpFeePct","type":"uint64"},{"internalType":"uint32","name":"priceRequestTime","type":"uint32"},{"internalType":"uint256","name":"proposerBond","type":"uint256"},{"internalType":"uint256","name":"finalFee","type":"uint256"}],"indexed":false,"internalType":"struct BridgePool.RelayData","name":"relay","type":"tuple"},{"indexed":false,"internalType":"bytes32","name":"relayAncillaryDataHash","type":"bytes32"}],"name":"DepositRelayed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"lpTokensMinted","type":"uint256"},{"indexed":true,"internalType":"address","name":"liquidityProvider","type":"address"}],"name":"LiquidityAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"lpTokensBurnt","type":"uint256"},{"indexed":true,"internalType":"address","name":"liquidityProvider","type":"address"}],"name":"LiquidityRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"depositHash","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"relayHash","type":"bytes32"},{"indexed":true,"internalType":"address","name":"disputer","type":"address"}],"name":"RelayCanceled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"depositHash","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"relayHash","type":"bytes32"},{"indexed":true,"internalType":"address","name":"disputer","type":"address"}],"name":"RelayDisputed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"depositHash","type":"bytes32"},{"indexed":true,"internalType":"address","name":"caller","type":"address"},{"components":[{"internalType":"enum BridgePool.RelayState","name":"relayState","type":"uint8"},{"internalType":"address","name":"slowRelayer","type":"address"},{"internalType":"uint32","name":"relayId","type":"uint32"},{"internalType":"uint64","name":"realizedLpFeePct","type":"uint64"},{"internalType":"uint32","name":"priceRequestTime","type":"uint32"},{"internalType":"uint256","name":"proposerBond","type":"uint256"},{"internalType":"uint256","name":"finalFee","type":"uint256"}],"indexed":false,"internalType":"struct BridgePool.RelayData","name":"relay","type":"tuple"}],"name":"RelaySettled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"depositHash","type":"bytes32"},{"indexed":true,"internalType":"address","name":"instantRelayer","type":"address"},{"components":[{"internalType":"enum BridgePool.RelayState","name":"relayState","type":"uint8"},{"internalType":"address","name":"slowRelayer","type":"address"},{"internalType":"uint32","name":"relayId","type":"uint32"},{"internalType":"uint64","name":"realizedLpFeePct","type":"uint64"},{"internalType":"uint32","name":"priceRequestTime","type":"uint32"},{"internalType":"uint256","name":"proposerBond","type":"uint256"},{"internalType":"uint256","name":"finalFee","type":"uint256"}],"indexed":false,"internalType":"struct BridgePool.RelayData","name":"relay","type":"tuple"}],"name":"RelaySpedUp","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[{"internalType":"uint256","name":"l1TokenAmount","type":"uint256"}],"name":"addLiquidity","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"bonds","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"bridgeAdmin","outputs":[{"internalType":"contract BridgeAdminInterface","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_newAdmin","type":"address"}],"name":"changeAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"chainId","type":"uint256"},{"internalType":"uint64","name":"depositId","type":"uint64"},{"internalType":"address payable","name":"l1Recipient","type":"address"},{"internalType":"address","name":"l2Sender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint64","name":"slowRelayFeePct","type":"uint64"},{"internalType":"uint64","name":"instantRelayFeePct","type":"uint64"},{"internalType":"uint32","name":"quoteTimestamp","type":"uint32"}],"internalType":"struct BridgePool.DepositData","name":"depositData","type":"tuple"},{"components":[{"internalType":"enum BridgePool.RelayState","name":"relayState","type":"uint8"},{"internalType":"address","name":"slowRelayer","type":"address"},{"internalType":"uint32","name":"relayId","type":"uint32"},{"internalType":"uint64","name":"realizedLpFeePct","type":"uint64"},{"internalType":"uint32","name":"priceRequestTime","type":"uint32"},{"internalType":"uint256","name":"proposerBond","type":"uint256"},{"internalType":"uint256","name":"finalFee","type":"uint256"}],"internalType":"struct BridgePool.RelayData","name":"relayData","type":"tuple"}],"name":"disputeRelay","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"exchangeRateCurrent","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getAccumulatedFees","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getCurrentTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"relayedAmount","type":"uint256"}],"name":"getLiquidityUtilization","outputs":[{"internalType":"uint256","name":"utilizationCurrent","type":"uint256"},{"internalType":"uint256","name":"utilizationPostRelay","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"chainId","type":"uint256"},{"internalType":"uint64","name":"depositId","type":"uint64"},{"internalType":"address payable","name":"l1Recipient","type":"address"},{"internalType":"address","name":"l2Sender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint64","name":"slowRelayFeePct","type":"uint64"},{"internalType":"uint64","name":"instantRelayFeePct","type":"uint64"},{"internalType":"uint32","name":"quoteTimestamp","type":"uint32"}],"internalType":"struct BridgePool.DepositData","name":"depositData","type":"tuple"},{"components":[{"internalType":"enum BridgePool.RelayState","name":"relayState","type":"uint8"},{"internalType":"address","name":"slowRelayer","type":"address"},{"internalType":"uint32","name":"relayId","type":"uint32"},{"internalType":"uint64","name":"realizedLpFeePct","type":"uint64"},{"internalType":"uint32","name":"priceRequestTime","type":"uint32"},{"internalType":"uint256","name":"proposerBond","type":"uint256"},{"internalType":"uint256","name":"finalFee","type":"uint256"}],"internalType":"struct BridgePool.RelayData","name":"relayData","type":"tuple"}],"name":"getRelayAncillaryData","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"identifier","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"instantRelays","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isWethPool","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"l1Token","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastLpFeeUpdate","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"liquidReserves","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"liquidityUtilizationCurrent","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"relayedAmount","type":"uint256"}],"name":"liquidityUtilizationPostRelay","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"lpFeeRatePerSecond","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"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":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"numberOfRelays","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"optimisticOracle","outputs":[{"internalType":"contract SkinnyOptimisticOracleInterface","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"optimisticOracleLiveness","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingReserves","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"proposerBondPct","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"chainId","type":"uint256"},{"internalType":"uint64","name":"depositId","type":"uint64"},{"internalType":"address payable","name":"l1Recipient","type":"address"},{"internalType":"address","name":"l2Sender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint64","name":"slowRelayFeePct","type":"uint64"},{"internalType":"uint64","name":"instantRelayFeePct","type":"uint64"},{"internalType":"uint32","name":"quoteTimestamp","type":"uint32"}],"internalType":"struct BridgePool.DepositData","name":"depositData","type":"tuple"},{"internalType":"uint64","name":"realizedLpFeePct","type":"uint64"}],"name":"relayAndSpeedUp","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"chainId","type":"uint256"},{"internalType":"uint64","name":"depositId","type":"uint64"},{"internalType":"address payable","name":"l1Recipient","type":"address"},{"internalType":"address","name":"l2Sender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint64","name":"slowRelayFeePct","type":"uint64"},{"internalType":"uint64","name":"instantRelayFeePct","type":"uint64"},{"internalType":"uint32","name":"quoteTimestamp","type":"uint32"}],"internalType":"struct BridgePool.DepositData","name":"depositData","type":"tuple"},{"internalType":"uint64","name":"realizedLpFeePct","type":"uint64"}],"name":"relayDeposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"relays","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"lpTokenAmount","type":"uint256"},{"internalType":"bool","name":"sendEth","type":"bool"}],"name":"removeLiquidity","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"time","type":"uint256"}],"name":"setCurrentTime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"chainId","type":"uint256"},{"internalType":"uint64","name":"depositId","type":"uint64"},{"internalType":"address payable","name":"l1Recipient","type":"address"},{"internalType":"address","name":"l2Sender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint64","name":"slowRelayFeePct","type":"uint64"},{"internalType":"uint64","name":"instantRelayFeePct","type":"uint64"},{"internalType":"uint32","name":"quoteTimestamp","type":"uint32"}],"internalType":"struct BridgePool.DepositData","name":"depositData","type":"tuple"},{"components":[{"internalType":"enum BridgePool.RelayState","name":"relayState","type":"uint8"},{"internalType":"address","name":"slowRelayer","type":"address"},{"internalType":"uint32","name":"relayId","type":"uint32"},{"internalType":"uint64","name":"realizedLpFeePct","type":"uint64"},{"internalType":"uint32","name":"priceRequestTime","type":"uint32"},{"internalType":"uint256","name":"proposerBond","type":"uint256"},{"internalType":"uint256","name":"finalFee","type":"uint256"}],"internalType":"struct BridgePool.RelayData","name":"relayData","type":"tuple"}],"name":"settleRelay","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"chainId","type":"uint256"},{"internalType":"uint64","name":"depositId","type":"uint64"},{"internalType":"address payable","name":"l1Recipient","type":"address"},{"internalType":"address","name":"l2Sender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint64","name":"slowRelayFeePct","type":"uint64"},{"internalType":"uint64","name":"instantRelayFeePct","type":"uint64"},{"internalType":"uint32","name":"quoteTimestamp","type":"uint32"}],"internalType":"struct BridgePool.DepositData","name":"depositData","type":"tuple"},{"components":[{"internalType":"enum BridgePool.RelayState","name":"relayState","type":"uint8"},{"internalType":"address","name":"slowRelayer","type":"address"},{"internalType":"uint32","name":"relayId","type":"uint32"},{"internalType":"uint64","name":"realizedLpFeePct","type":"uint64"},{"internalType":"uint32","name":"priceRequestTime","type":"uint32"},{"internalType":"uint256","name":"proposerBond","type":"uint256"},{"internalType":"uint256","name":"finalFee","type":"uint256"}],"internalType":"struct BridgePool.RelayData","name":"relayData","type":"tuple"}],"name":"speedUpRelay","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"store","outputs":[{"internalType":"contract StoreInterface","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"sync","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"syncUmaEcosystemParams","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"syncWithBridgeAdminParams","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"timerAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"undistributedLpFees","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"utilizedReserves","outputs":[{"internalType":"int256","name":"","type":"int256"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]

60806040523480156200001157600080fd5b506040516200520c3803806200520c833981016040819052620000349162000864565b600080546001600160a01b0319166001600160a01b038316179055865187908790879087908790879087908790879062000076906004906020850190620006ab565b5080516200008c906005906020840190620006ab565b50506006805460ff1916600117905550865115801590620000ad5750855115155b620000ff5760405162461bcd60e51b815260206004820152601b60248201527f426164204c5020746f6b656e206e616d65206f722073796d626f6c000000000060448201526064015b60405180910390fd5b600e80546001600160a01b0319166001600160a01b038781169190911790915560068054610100600160a81b03191661010092871692909202919091179055620001464290565b600a8054610100600160681b031916690100000000000000000063ffffffff9390931692909202610100600160481b031916919091176101006001600160401b038616021760ff19168315151790556200019f620001bd565b620001a962000443565b505050505050505050505050505062000a38565b620001c762000657565b620001d76006805460ff19169055565b600e5460408051632e68f21360e21b815290516000926001600160a01b03169163b9a3c84c916004808301926020929190829003018186803b1580156200021d57600080fd5b505afa15801562000232573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000258919062000931565b6040516302abf57960e61b81527f536b696e6e794f7074696d69737469634f7261636c650000000000000000000060048201529091506001600160a01b0382169063aafd5e409060240160206040518083038186803b158015620002bb57600080fd5b505afa158015620002d0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620002f6919062000931565b601080546001600160a01b0319166001600160a01b039283161790556040516302abf57960e61b81526453746f726560d81b60048201529082169063aafd5e409060240160206040518083038186803b1580156200035357600080fd5b505afa15801562000368573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200038e919062000931565b600f80546001600160a01b0319166001600160a01b03928316908117909155600654604051635b97aadd60e01b8152610100909104909216600483015290635b97aadd9060240160206040518083038186803b158015620003ee57600080fd5b505afa15801562000403573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000429919062000956565b51600b5550620004416006805460ff19166001179055565b565b6200044d62000657565b6200045d6006805460ff19169055565b600e60009054906101000a90046001600160a01b03166001600160a01b031663c73a32c36040518163ffffffff1660e01b815260040160206040518083038186803b158015620004ac57600080fd5b505afa158015620004c1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620004e791906200099b565b600a600d6101000a8154816001600160401b0302191690836001600160401b03160217905550600e60009054906101000a90046001600160a01b03166001600160a01b031663173684c56040518163ffffffff1660e01b815260040160206040518083038186803b1580156200055c57600080fd5b505afa15801562000571573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620005979190620009b9565b600a60156101000a81548163ffffffff021916908363ffffffff160217905550600e60009054906101000a90046001600160a01b03166001600160a01b0316637998a1c46040518163ffffffff1660e01b815260040160206040518083038186803b1580156200060657600080fd5b505afa1580156200061b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620006419190620009e1565b601155620004416006805460ff19166001179055565b60065460ff16620004415760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401620000f6565b828054620006b990620009fb565b90600052602060002090601f016020900481019282620006dd576000855562000728565b82601f10620006f857805160ff191683800117855562000728565b8280016001018555821562000728579182015b82811115620007285782518255916020019190600101906200070b565b50620007369291506200073a565b5090565b5b808211156200073657600081556001016200073b565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b038111828210171562000792576200079262000751565b604052919050565b600082601f830112620007ac57600080fd5b81516001600160401b03811115620007c857620007c862000751565b6020620007de601f8301601f1916820162000767565b8281528582848701011115620007f357600080fd5b60005b8381101562000813578581018301518282018401528201620007f6565b83811115620008255760008385840101525b5095945050505050565b80516001600160a01b03811681146200084757600080fd5b919050565b80516001600160401b03811681146200084757600080fd5b600080600080600080600060e0888a0312156200088057600080fd5b87516001600160401b03808211156200089857600080fd5b620008a68b838c016200079a565b985060208a0151915080821115620008bd57600080fd5b50620008cc8a828b016200079a565b965050620008dd604089016200082f565b9450620008ed606089016200082f565b9350620008fd608089016200084c565b925060a088015180151581146200091357600080fd5b91506200092360c089016200082f565b905092959891949750929550565b6000602082840312156200094457600080fd5b6200094f826200082f565b9392505050565b6000602082840312156200096957600080fd5b604051602081016001600160401b03811182821017156200098e576200098e62000751565b6040529151825250919050565b600060208284031215620009ae57600080fd5b6200094f826200084c565b600060208284031215620009cc57600080fd5b815163ffffffff811681146200094f57600080fd5b600060208284031215620009f457600080fd5b5051919050565b600181811c9082168062000a1057607f821691505b6020821081141562000a3257634e487b7160e01b600052602260045260246000fd5b50919050565b6147c48062000a486000396000f3fe6080604052600436106102cd5760003560e01c8063753b91bb11610175578063b5351ee2116100dc578063cefed55f11610095578063df738fc81161006f578063df738fc8146108c7578063ed4de3a3146108f4578063f1d24bab14610929578063fff6cae91461094d57600080fd5b8063cefed55f1461083d578063d412f5a41461085d578063dd62ed3e1461088157600080fd5b8063b5351ee21461078d578063bd6d894d146107a2578063bec73ade146107b7578063c01e1bd6146107d7578063c73a32c3146107fc578063cc2c929e1461082357600080fd5b8063a457c2d71161012e578063a457c2d7146106c1578063a6af2dfe146106e1578063a9059cbb14610701578063ac9650d814610721578063b208420214610741578063b454e3261461075757600080fd5b8063753b91bb146106205780637998a1c41461064057806387a515d3146106565780638f2839701461066c57806395d89b411461068c578063975057e7146106a157600080fd5b806323b872dd116102345780634464fae4116101ed5780635df45a37116101c75780635df45a371461059f57806362822d34146105b457806366db5240146105d457806370a08231146105ea57600080fd5b80634464fae4146105565780634f52fd171461056c57806351c6590a1461058c57600080fd5b806323b872dd146104b257806329cb924d146104d2578063313ce567146104e557806339509351146105015780633cc400b3146105215780633fa856c91461053657600080fd5b806318160ddd1161028657806318160ddd146103f057806319e9d894146104055780631bf71c381461041a5780631c39c38d1461043a578063223029221461047257806322f8e5661461049257600080fd5b806306fdde03146102d9578063095ea7b31461030457806311cfc159146103345780631311172514610371578063135c404e14610393578063173684c5146103b757600080fd5b366102d457005b600080fd5b3480156102e557600080fd5b506102ee610962565b6040516102fb9190613b2d565b60405180910390f35b34801561031057600080fd5b5061032461031f366004613b60565b6109f4565b60405190151581526020016102fb565b34801561034057600080fd5b50600a546103599061010090046001600160401b031681565b6040516001600160401b0390911681526020016102fb565b34801561037d57600080fd5b5061039161038c366004613cc5565b610a0b565b005b34801561039f57600080fd5b506103a9600d5481565b6040519081526020016102fb565b3480156103c357600080fd5b50600a546103db90600160a81b900463ffffffff1681565b60405163ffffffff90911681526020016102fb565b3480156103fc57600080fd5b506003546103a9565b34801561041157600080fd5b506103a9610cfd565b34801561042657600080fd5b506102ee610435366004613cff565b610d26565b34801561044657600080fd5b5060005461045a906001600160a01b031681565b6040516001600160a01b0390911681526020016102fb565b34801561047e57600080fd5b5060105461045a906001600160a01b031681565b34801561049e57600080fd5b506103916104ad366004613db6565b610d49565b3480156104be57600080fd5b506103246104cd366004613dcf565b610dbf565b3480156104de57600080fd5b50426103a9565b3480156104f157600080fd5b50604051601281526020016102fb565b34801561050d57600080fd5b5061032461051c366004613b60565b610e69565b34801561052d57600080fd5b50610391610ea5565b34801561054257600080fd5b50610391610551366004613cff565b61109a565b34801561056257600080fd5b506103a9600c5481565b34801561057857600080fd5b50610391610587366004613e1e565b6114f7565b61039161059a366004613db6565b611670565b3480156105ab57600080fd5b506103a9611817565b3480156105c057600080fd5b506103a96105cf366004613db6565b61182e565b3480156105e057600080fd5b506103a960085481565b3480156105f657600080fd5b506103a9610605366004613e43565b6001600160a01b031660009081526001602052604090205490565b34801561062c57600080fd5b5061039161063b366004613cc5565b611858565b34801561064c57600080fd5b506103a960115481565b34801561066257600080fd5b506103a960095481565b34801561067857600080fd5b50610391610687366004613e43565b611ca7565b34801561069857600080fd5b506102ee611d2e565b3480156106ad57600080fd5b50600f5461045a906001600160a01b031681565b3480156106cd57600080fd5b506103246106dc366004613b60565b611d3d565b3480156106ed57600080fd5b50600e5461045a906001600160a01b031681565b34801561070d57600080fd5b5061032461071c366004613b60565b611dd6565b61073461072f366004613e60565b611de3565b6040516102fb9190613ed4565b34801561074d57600080fd5b506103a960075481565b34801561076357600080fd5b5061045a610772366004613db6565b6013602052600090815260409020546001600160a01b031681565b34801561079957600080fd5b50610391611f88565b3480156107ae57600080fd5b506103a96121e0565b3480156107c357600080fd5b506103916107d2366004613cff565b6121fa565b3480156107e357600080fd5b5060065461045a9061010090046001600160a01b031681565b34801561080857600080fd5b50600a5461035990600160681b90046001600160401b031681565b34801561082f57600080fd5b50600a546103249060ff1681565b34801561084957600080fd5b50610391610858366004613cff565b6123e7565b34801561086957600080fd5b506006546103db90600160a81b900463ffffffff1681565b34801561088d57600080fd5b506103a961089c366004613f36565b6001600160a01b03918216600090815260026020908152604080832093909416825291909152205490565b3480156108d357600080fd5b506103a96108e2366004613db6565b60126020526000908152604090205481565b34801561090057600080fd5b5061091461090f366004613db6565b6125cd565b604080519283526020830191909152016102fb565b34801561093557600080fd5b50600a546103db90600160481b900463ffffffff1681565b34801561095957600080fd5b50610391612604565b60606004805461097190613f64565b80601f016020809104026020016040519081016040528092919081815260200182805461099d90613f64565b80156109ea5780601f106109bf576101008083540402835291602001916109ea565b820191906000526020600020905b8154815290600101906020018083116109cd57829003601f168201915b5050505050905090565b6000610a01338484612624565b5060015b92915050565b610a13612748565b610a1b61279a565b6703782dace9d900008260a001516001600160401b031611158015610a5557506703782dace9d900008260c001516001600160401b031611155b8015610a7257506706f05b59d3b20000816001600160401b031611155b610ab25760405162461bcd60e51b815260206004820152600c60248201526b496e76616c6964206665657360a01b60448201526064015b60405180910390fd5b6000610abd836127a6565b60008181526012602052604090205490915015610b135760405162461bcd60e51b815260206004820152601460248201527350656e64696e672072656c61792065786973747360601b6044820152606401610aa9565b60004290506000610b2785608001516127e9565b905060006040518060e0016040528060016002811115610b4957610b49613f9f565b815233602082015260068054604090920191600160a81b900463ffffffff16906015610b7483613fcb565b91906101000a81548163ffffffff021916908363ffffffff16021790555063ffffffff168152602001866001600160401b031681526020018463ffffffff168152602001838152602001600b548152509050610bcf81612809565b600085815260126020526040812091909155610beb878361281c565b90508660800151600954600754610c029190613fef565b1015610c4c5760405162461bcd60e51b8152602060048201526019602482015278496e73756666696369656e7420706f6f6c2062616c616e636560381b6044820152606401610aa9565b6000600b5484610c5c9190614006565b9050876080015160096000828254610c749190614006565b9250508190555080600d6000828254610c8d9190614006565b9091555050600654610caf9061010090046001600160a01b0316333084612870565b857fa4ca36d112520cced74325c72711f376fe4015665829d879ba21590cb8130be0898585604051610ce393929190614128565b60405180910390a2505050505050610cf96128e1565b5050565b6000610d07612748565b610d0f61279a565b610d1960006128f0565b9050610d236128e1565b90565b6060610d30612748565b610d42610d3d848461281c565b61297e565b9392505050565b6000546001600160a01b0316610d5e57600080fd5b60005460405163117c72b360e11b8152600481018390526001600160a01b03909116906322f8e56690602401600060405180830381600087803b158015610da457600080fd5b505af1158015610db8573d6000803e3d6000fd5b5050505050565b6000610dcc8484846129bb565b6001600160a01b038416600090815260026020908152604080832033845290915290205482811015610e515760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b6064820152608401610aa9565b610e5e8533858403612624565b506001949350505050565b3360008181526002602090815260408083206001600160a01b03871684529091528120549091610a01918590610ea0908690614006565b612624565b610ead612748565b610eb561279a565b600e60009054906101000a90046001600160a01b03166001600160a01b031663c73a32c36040518163ffffffff1660e01b815260040160206040518083038186803b158015610f0357600080fd5b505afa158015610f17573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f3b9190614154565b600a600d6101000a8154816001600160401b0302191690836001600160401b03160217905550600e60009054906101000a90046001600160a01b03166001600160a01b031663173684c56040518163ffffffff1660e01b815260040160206040518083038186803b158015610faf57600080fd5b505afa158015610fc3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fe79190614171565b600a60156101000a81548163ffffffff021916908363ffffffff160217905550600e60009054906101000a90046001600160a01b03166001600160a01b0316637998a1c46040518163ffffffff1660e01b815260040160206040518083038186803b15801561105557600080fd5b505afa158015611069573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061108d919061418e565b6011556110986128e1565b565b6110a2612748565b6110aa61279a565b60006110b5836127a6565b90506110c18183612b89565b6001825160028111156110d6576110d6613f9f565b146111155760405162461bcd60e51b815260206004820152600f60248201526e105b1c9958591e481cd95d1d1b1959608a1b6044820152606401610aa9565b6000600a60159054906101000a900463ffffffff16836080015161113991906141a7565b9050428163ffffffff1611156111865760405162461bcd60e51b8152602060048201526012602482015271139bdd081cd95d1d1b1958589b19481e595d60721b6044820152606401610aa9565b82602001516001600160a01b0316336001600160a01b031614806111ba57506111b1816103846141a7565b63ffffffff1642115b6111f95760405162461bcd60e51b815260206004820152601060248201526f2737ba1039b637bb903932b630bcb2b960811b6044820152606401610aa9565b6040805160e0810190915261126d90806002815260200185602001516001600160a01b03168152602001856040015163ffffffff16815260200185606001516001600160401b03168152602001856080015163ffffffff1681526020018560a0015181526020018560c00151815250612809565b60008381526012602052604081209190915560a085015160608501516112a091611296916141cf565b8660800151612c16565b85608001516112af9190613fef565b905060006112bd8486612c3e565b600081815260136020526040902054600a549192506001600160a01b03169060ff1680156112f257506001600160a01b038116155b1561130a57611305876040015184612c69565b61133f565b61133f6001600160a01b038216611325578760400151611327565b815b60065461010090046001600160a01b03169085612d32565b60006113538860a001518960800151612c16565b905060008760a001518860c0015161136b9190614006565b60208901519091506001600160a01b03163314156113b35760208801516113ae906113968385614006565b60065461010090046001600160a01b03169190612d32565b6113f1565b60208801516006546113d5916101009091046001600160a01b03169083612d32565b6006546113f19061010090046001600160a01b03163384612d32565b60006113fd8387614006565b90508960800151600960008282546114159190613fef565b92505081905550806007600082825461142e9190613fef565b92505081905550806008600082825461144791906141f1565b9250508190555081600d60008282546114609190613fef565b9091555061146e9050612d62565b6114886114838a606001518c60800151612c16565b612da6565b336001600160a01b0316887fcfdda74fce9fedb259e0f0a1ab1550e19b338488ece64976a4639e7fce0293a78b6040516114c29190614232565b60405180910390a350505060009182525060136020526040902080546001600160a01b031916905550610cf991506128e19050565b6114ff612748565b61150761279a565b8015806115165750600a5460ff165b6115525760405162461bcd60e51b815260206004820152600d60248201526c086c2dce840e6cadcc840cae8d609b1b6044820152606401610aa9565b6000670de0b6b3a7640000611565612dd9565b61156f9085614240565b6115799190614275565b9050806009546115899190614006565b60075410156115da5760405162461bcd60e51b815260206004820152601e60248201527f5574696c697a6174696f6e20746f6f206869676820746f2072656d6f766500006044820152606401610aa9565b6115e43384612e79565b80600760008282546115f69190613fef565b909155505081156116105761160b3382612c69565b61162c565b60065461162c9061010090046001600160a01b03163383612d32565b604080518281526020810185905233917f0c54fc223ffd1a8f36652b5e83db4fff50f5ae151b11ceb56d5499b9f6e1fa18910160405180910390a250610cf96128e1565b611678612748565b61168061279a565b600a5460ff16801561169157508034145b8061169a575034155b6116e65760405162461bcd60e51b815260206004820152601b60248201527f42616420616464206c6971756964697479204574682076616c756500000000006044820152606401610aa9565b60006116f0612dd9565b61170283670de0b6b3a7640000614240565b61170c9190614275565b90506117183382612fc7565b816007600082825461172a9190614006565b909155505034158015906117405750600a5460ff165b156117b357600660019054906101000a90046001600160a01b03166001600160a01b031663d0e30db0346040518263ffffffff1660e01b81526004016000604051808303818588803b15801561179557600080fd5b505af11580156117a9573d6000803e3d6000fd5b50505050506117d0565b6006546117d09061010090046001600160a01b0316333085612870565b604080518381526020810183905233917f0351f600ef1e31e5e13b4dc27bff4cbde3e9269f0ffc666629ae6cac573eb220910160405180910390a2506118146128e1565b50565b6000611821612748565b6118296130a6565b905090565b6000611838612748565b61184061279a565b611849826128f0565b90506118536128e1565b919050565b611860612748565b61186861279a565b60004290506703782dace9d900008360a001516001600160401b0316111580156118a757506703782dace9d900008360c001516001600160401b031611155b80156118c457506706f05b59d3b20000826001600160401b031611155b6118ff5760405162461bcd60e51b815260206004820152600c60248201526b496e76616c6964206665657360a01b6044820152606401610aa9565b600061190a846127a6565b600081815260126020526040902054909150156119605760405162461bcd60e51b815260206004820152601460248201527350656e64696e672072656c61792065786973747360601b6044820152606401610aa9565b600061196f85608001516127e9565b905060006040518060e001604052806001600281111561199157611991613f9f565b815233602082015260068054604090920191600160a81b900463ffffffff169060156119bc83613fcb565b91906101000a81548163ffffffff021916908363ffffffff16021790555063ffffffff168152602001866001600160401b031681526020018563ffffffff168152602001838152602001600b5481525090506000611a1a878361281c565b9050611a2582612809565b600085815260126020526040812091909155611a418584612c3e565b6000818152601360205260409020549091506001600160a01b031615611aa35760405162461bcd60e51b8152602060048201526017602482015276052656c61792063616e6e6f74206265207370656420757604c1b6044820152606401610aa9565b8760800151600954600754611ab89190613fef565b1015611b025760405162461bcd60e51b8152602060048201526019602482015278496e73756666696369656e7420706f6f6c2062616c616e636560381b6044820152606401610aa9565b6000600b5485611b129190614006565b90506000611b468a60c001518b60a001518760600151611b3291906141cf565b611b3c91906141cf565b8b60800151612c16565b90506000818b60800151611b5a9190613fef565b905082600d6000828254611b6e9190614006565b909155505060808b015160098054600090611b8a908490614006565b9091555050600084815260136020526040902080546001600160a01b03191633908117909155611bd89030611bbf8685614006565b60065461010090046001600160a01b0316929190612870565b600a5460ff1615611bf657611bf18b6040015182612c69565b611c18565b60408b0151600654611c18916101009091046001600160a01b03169083612d32565b877fa4ca36d112520cced74325c72711f376fe4015665829d879ba21590cb8130be08c8888604051611c4c93929190614128565b60405180910390a2336001600160a01b0316887ff98cddc88bc965917007822b05056cb92bc9ddf0f8bcc61678400cb78313bb4b88604051611c8e9190614232565b60405180910390a3505050505050505050610cf96128e1565b611caf612748565b611cb761279a565b600e546001600160a01b03163314611cce57600080fd5b600e80546001600160a01b0319166001600160a01b0383169081179091556040805133815260208101929092527f485a12424bd0c2c66a131c2681cb6c743b9573af3ae5f3014ef6ce7f55ab0192910160405180910390a16118146128e1565b60606005805461097190613f64565b3360009081526002602090815260408083206001600160a01b038616845290915281205482811015611dbf5760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401610aa9565b611dcc3385858403612624565b5060019392505050565b6000610a013384846129bb565b60603415611e335760405162461bcd60e51b815260206004820152601b60248201527f4f6e6c79206d756c746963616c6c207769746820302076616c756500000000006044820152606401610aa9565b816001600160401b03811115611e4b57611e4b613b8c565b604051908082528060200260200182016040528015611e7e57816020015b6060815260200190600190039081611e695790505b50905060005b82811015611f815760008030868685818110611ea257611ea2614297565b9050602002810190611eb491906142ad565b604051611ec29291906142fa565b600060405180830381855af49150503d8060008114611efd576040519150601f19603f3d011682016040523d82523d6000602084013e611f02565b606091505b509150915081611f4e57604481511015611f1b57600080fd5b60048101905080806020019051810190611f35919061430a565b60405162461bcd60e51b8152600401610aa99190613b2d565b80848481518110611f6157611f61614297565b602002602001018190525050508080611f79906143ab565b915050611e84565b5092915050565b611f90612748565b611f9861279a565b600e5460408051632e68f21360e21b815290516000926001600160a01b03169163b9a3c84c916004808301926020929190829003018186803b158015611fdd57600080fd5b505afa158015611ff1573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061201591906143c6565b6040516302abf57960e61b815275536b696e6e794f7074696d69737469634f7261636c6560501b60048201529091506001600160a01b0382169063aafd5e409060240160206040518083038186803b15801561207057600080fd5b505afa158015612084573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120a891906143c6565b601080546001600160a01b0319166001600160a01b039283161790556040516302abf57960e61b81526453746f726560d81b60048201529082169063aafd5e409060240160206040518083038186803b15801561210457600080fd5b505afa158015612118573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061213c91906143c6565b600f80546001600160a01b0319166001600160a01b03928316908117909155600654604051635b97aadd60e01b8152610100909104909216600483015290635b97aadd9060240160206040518083038186803b15801561219b57600080fd5b505afa1580156121af573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121d391906143e3565b51600b55506110986128e1565b60006121ea612748565b6121f261279a565b610d19612dd9565b612202612748565b61220a61279a565b6000612215836127a6565b90506122218183612b89565b600061222d8284612c3e565b9050600a60159054906101000a900463ffffffff16836080015161225191906141a7565b63ffffffff1642108015612277575060018351600281111561227557612275613f9f565b145b801561229857506000818152601360205260409020546001600160a01b0316155b6122de5760405162461bcd60e51b8152602060048201526017602482015276052656c61792063616e6e6f74206265207370656420757604c1b6044820152606401610aa9565b600081815260136020526040812080546001600160a01b0319163317905560c085015160a086015160608601516123239291612319916141cf565b61129691906141cf565b905060008186608001516123379190613fef565b600a5490915060ff1615612375576006546123629061010090046001600160a01b0316333084612870565b612370866040015182612c69565b612399565b6040860151600654612399916101009091046001600160a01b031690339084612870565b336001600160a01b0316847ff98cddc88bc965917007822b05056cb92bc9ddf0f8bcc61678400cb78313bb4b876040516123d39190614232565b60405180910390a350505050610cf96128e1565b6123ef612748565b6123f761279a565b42600a54608083015161241791600160a81b900463ffffffff16906141a7565b63ffffffff161161245a5760405162461bcd60e51b815260206004820152600d60248201526c50617374206c6976656e65737360981b6044820152606401610aa9565b60018151600281111561246f5761246f613f9f565b146124ad5760405162461bcd60e51b815260206004820152600e60248201526d4e6f742064697370757461626c6560901b6044820152606401610aa9565b60006124b8836127a6565b90506124c48183612b89565b60006124d0848461281c565b905060006124f58460200151338660a001518760c001516124f08761297e565b613115565b90508360a001518460c0015161250b9190614006565b600d600082825461251c9190613fef565b9091555050608085015160098054600090612538908490613fef565b9091555050600083815260126020526040812055801561258c573361255c85612809565b60405185907f29751133c2d0a0ea7a9da312248b12ef10ac4c20f4e3ab5eebbb80d853b3836790600090a46125c2565b3361259685612809565b60405185907f14173c4d3bd95e34f5c8f78729323444c9272bd21051e70045b64ed48f65818390600090a45b505050610cf96128e1565b6000806125d8612748565b6125e061279a565b6125ea60006128f0565b6125f3846128f0565b915091506125ff6128e1565b915091565b61260c612748565b61261461279a565b61261c61343a565b6110986128e1565b6001600160a01b0383166126865760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610aa9565b6001600160a01b0382166126e75760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610aa9565b6001600160a01b0383811660008181526002602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b60065460ff166110985760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610aa9565b6006805460ff19169055565b6006546040516000916127cc91849161010090046001600160a01b031690602001614424565b604051602081830303815290604052805190602001209050919050565b600a54600090610a0590600160681b90046001600160401b031683612c16565b6000816040516020016127cc9190614232565b60008282604001518360600151600660019054906101000a90046001600160a01b0316604051602001612852949392919061444c565b60405160208183030381529060405280519060200120905092915050565b6040516001600160a01b03808516602483015283166044820152606481018290526128db9085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526134fd565b50505050565b6006805460ff19166001179055565b60006128fa61343a565b6000806008541361290c576000612910565b6008545b9050600081600954856129239190614006565b61292d9190614006565b905060008260075461293f9190614006565b9050806129585750670de0b6b3a7640000949350505050565b8061296b83670de0b6b3a7640000614240565b6129759190614275565b95945050505050565b6060610a0560405180602001604052806000815250604051806040016040528060098152602001680e4cad8c2f290c2e6d60bb1b815250846135cf565b6001600160a01b038316612a1f5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610aa9565b6001600160a01b038216612a815760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610aa9565b6001600160a01b03831660009081526001602052604090205481811015612af95760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610aa9565b6001600160a01b03808516600090815260016020526040808220858503905591851681529081208054849290612b30908490614006565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051612b7c91815260200190565b60405180910390a36128db565b612b9281612809565b60008381526012602052604090205414610cf9576040805162461bcd60e51b81526020600482015260248101919091527f4861736865642072656c617920706172616d7320646f206e6f74206d6174636860448201527f206578697374696e672072656c6179206861736820666f72206465706f7369746064820152608401610aa9565b6000670de0b6b3a7640000612c34836001600160401b038616614240565b610d429190614275565b60008282606001516040516020016128529291909182526001600160401b0316602082015260400190565b6001600160a01b0382163b15612c9557600654610cf99061010090046001600160a01b03168383612d32565b600654604051632e1a7d4d60e01b8152600481018390526101009091046001600160a01b031690632e1a7d4d90602401600060405180830381600087803b158015612cdf57600080fd5b505af1158015612cf3573d6000803e3d6000fd5b50506040516001600160a01b038516925083156108fc02915083906000818181858888f19350505050158015612d2d573d6000803e3d6000fd5b505050565b6040516001600160a01b038316602482015260448101829052612d2d90849063a9059cbb60e01b906064016128a4565b6000612d6c6130a6565b905080600c54612d7c9190613fef565b600c5550600a80546cffffffff0000000000000000001916600160481b4263ffffffff1602179055565b80600c6000828254612db89190614006565b925050819055508060086000828254612dd191906141f1565b909155505050565b6000612de460035490565b612df55750670de0b6b3a764000090565b612dfd612d62565b612e0561343a565b6000600c54600754612e179190613fef565b905060006008541315612e3857600854612e319082614006565b9050612e54565b600854612e4790600019614491565b612e519082613fef565b90505b600354612e6982670de0b6b3a7640000614240565b612e739190614275565b91505090565b6001600160a01b038216612ed95760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b6064820152608401610aa9565b6001600160a01b03821660009081526001602052604090205481811015612f4d5760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b6064820152608401610aa9565b6001600160a01b0383166000908152600160205260408120838303905560038054849290612f7c908490613fef565b90915550506040518281526000906001600160a01b038516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a3505050565b6001600160a01b03821661301d5760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610aa9565b806003600082825461302f9190614006565b90915550506001600160a01b0382166000908152600160205260408120805483929061305c908490614006565b90915550506040518181526001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b600a546000908190670de0b6b3a764000090600160481b900463ffffffff16426130d09190613fef565b600a54600c546130ee9161010090046001600160401b031690614240565b6130f89190614240565b6131029190614275565b9050600c54811061185357600c54612e73565b6000806131228585614006565b6010546006549192506131479161010090046001600160a01b03908116911683613615565b6010546011546001600160a01b039091169063af355d1e904286600660019054906101000a90046001600160a01b031660008b600a60159054906101000a900463ffffffff168f670de0b6b3a76400006040518a63ffffffff1660e01b81526004016131bb99989796959493929190614516565b602060405180830381600087803b1580156131d557600080fd5b505af1925050508015613205575060408051601f3d908101601f191682019092526132029181019061418e565b60015b613252576006546132259061010090046001600160a01b03168883612d32565b601054600654613248916001600160a01b03610100909204821691166000613615565b6000915050612975565b818110156132ad5760006132668284613fef565b6006549091506132859061010090046001600160a01b03168a83612d32565b6010546006546132a8916001600160a01b03610100909204821691166000613615565b819250505b5060408051610160810182526001600160a01b03898116825260006020830181905260065461010090049091169282019290925260608101829052670de0b6b3a7640000608082015260a08101829052600a5460c0820190600160a81b900463ffffffff164261331d9190614006565b8152600060208201526040016133338885613fef565b815260208101889052600a54600160a81b900463ffffffff90811660409092019190915260065491925061337c9161010090046001600160a01b03169033903090869061287016565b60105460065461339e916001600160a01b036101009092048216911684613615565b60105460115460405163139c641960e31b81526001600160a01b0390921691639ce320c8916133d9914290899087908e903090600401614581565b602060405180830381600087803b1580156133f357600080fd5b505af1158015613407573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061342b919061418e565b50600198975050505050505050565b600d546006546040516370a0823160e01b81523060048201526000929161010090046001600160a01b0316906370a082319060240160206040518083038186803b15801561348757600080fd5b505afa15801561349b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906134bf919061418e565b6134c99190613fef565b9050600754811115611814576007546134e29082613fef565b600860008282546134f3919061467a565b9091555050600755565b6000613552826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166137399092919063ffffffff16565b805190915015612d2d578080602001905181019061357091906146b9565b612d2d5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610aa9565b606060006135dd8585613750565b905084816135ea85613792565b6040516020016135fc939291906146d6565b6040516020818303038152906040529150509392505050565b80158061369e5750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e9060440160206040518083038186803b15801561366457600080fd5b505afa158015613678573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061369c919061418e565b155b6137095760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b6064820152608401610aa9565b6040516001600160a01b038316602482015260448101829052612d2d90849063095ea7b360e01b906064016128a4565b606061374884846000856137d2565b949350505050565b815160609015613781578160405160200161376b9190614719565b6040516020818303038152906040529050610a05565b8160405160200161376b919061474d565b60606137a1608083901c6138fa565b6137aa836138fa565b6040805160208101939093528201526060016040516020818303038152906040529050919050565b6060824710156138335760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610aa9565b843b6138815760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610aa9565b600080866001600160a01b0316858760405161389d9190614772565b60006040518083038185875af1925050503d80600081146138da576040519150601f19603f3d011682016040523d82523d6000602084013e6138df565b606091505b50915091506138ef828286613a9c565b979650505050505050565b6000808260001c9050806fffffffffffffffffffffffffffffffff169050806801000000000000000002811777ffffffffffffffff0000000000000000ffffffffffffffff169050806401000000000281177bffffffff00000000ffffffff00000000ffffffff00000000ffffffff16905080620100000281177dffff0000ffff0000ffff0000ffff0000ffff0000ffff0000ffff0000ffff169050806101000281177eff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff1690508060100281177f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f16905060006008827f08080808080808080808080808080808080808080808080808080808080808081681613a1e57613a1e61425f565b0460047f040404040404040404040404040404040404040404040404040404040404040484160460027f020202020202020202020202020202020202020202020202020202020202020285160417166027029091017f3030303030303030303030303030303030303030303030303030303030303030019392505050565b60608315613aab575081610d42565b825115613abb5782518084602001fd5b8160405162461bcd60e51b8152600401610aa99190613b2d565b60005b83811015613af0578181015183820152602001613ad8565b838111156128db5750506000910152565b60008151808452613b19816020860160208601613ad5565b601f01601f19169290920160200192915050565b602081526000610d426020830184613b01565b6001600160a01b038116811461181457600080fd5b803561185381613b40565b60008060408385031215613b7357600080fd5b8235613b7e81613b40565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b60405160e081016001600160401b0381118282101715613bc457613bc4613b8c565b60405290565b6001600160401b038116811461181457600080fd5b803561185381613bca565b63ffffffff8116811461181457600080fd5b803561185381613bea565b6000610100808385031215613c1b57600080fd5b604051908101906001600160401b0382118183101715613c3d57613c3d613b8c565b816040528092508335815260208401359150613c5882613bca565b816020820152613c6a60408501613b55565b6040820152613c7b60608501613b55565b606082015260808401356080820152613c9660a08501613bdf565b60a0820152613ca760c08501613bdf565b60c0820152613cb860e08501613bfc565b60e0820152505092915050565b6000806101208385031215613cd957600080fd5b613ce38484613c07565b9150610100830135613cf481613bca565b809150509250929050565b6000808284036101e0811215613d1457600080fd5b613d1e8585613c07565b925060e060ff1982011215613d3257600080fd5b50613d3b613ba2565b61010084013560038110613d4e57600080fd5b8152613d5d6101208501613b55565b6020820152613d6f6101408501613bfc565b6040820152613d816101608501613bdf565b6060820152613d936101808501613bfc565b60808201526101a084013560a08201526101c09093013560c08401525092909150565b600060208284031215613dc857600080fd5b5035919050565b600080600060608486031215613de457600080fd5b8335613def81613b40565b92506020840135613dff81613b40565b929592945050506040919091013590565b801515811461181457600080fd5b60008060408385031215613e3157600080fd5b823591506020830135613cf481613e10565b600060208284031215613e5557600080fd5b8135610d4281613b40565b60008060208385031215613e7357600080fd5b82356001600160401b0380821115613e8a57600080fd5b818501915085601f830112613e9e57600080fd5b813581811115613ead57600080fd5b8660208260051b8501011115613ec257600080fd5b60209290920196919550909350505050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b82811015613f2957603f19888603018452613f17858351613b01565b94509285019290850190600101613efb565b5092979650505050505050565b60008060408385031215613f4957600080fd5b8235613f5481613b40565b91506020830135613cf481613b40565b600181811c90821680613f7857607f821691505b60208210811415613f9957634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600063ffffffff80831681811415613fe557613fe5613fb5565b6001019392505050565b60008282101561400157614001613fb5565b500390565b6000821982111561401957614019613fb5565b500190565b8051825260208101516001600160401b0380821660208501526040830151915060018060a01b03808316604086015280606085015116606086015250608083015160808501528060a08401511660a08501528060c08401511660c0850152505063ffffffff60e08201511660e08301525050565b8051600381106140b257634e487b7160e01b600052602160045260246000fd5b82526020818101516001600160a01b031690830152604080820151906140df9084018263ffffffff169052565b5060608101516140fa60608401826001600160401b03169052565b506080810151614112608084018263ffffffff169052565b5060a0818101519083015260c090810151910152565b6102008101614137828661401e565b614145610100830185614092565b826101e0830152949350505050565b60006020828403121561416657600080fd5b8151610d4281613bca565b60006020828403121561418357600080fd5b8151610d4281613bea565b6000602082840312156141a057600080fd5b5051919050565b600063ffffffff8083168185168083038211156141c6576141c6613fb5565b01949350505050565b60006001600160401b038083168185168083038211156141c6576141c6613fb5565b600080821280156001600160ff1b038490038513161561421357614213613fb5565b600160ff1b839003841281161561422c5761422c613fb5565b50500190565b60e08101610a058284614092565b600081600019048311821515161561425a5761425a613fb5565b500290565b634e487b7160e01b600052601260045260246000fd5b60008261429257634e487b7160e01b600052601260045260246000fd5b500490565b634e487b7160e01b600052603260045260246000fd5b6000808335601e198436030181126142c457600080fd5b8301803591506001600160401b038211156142de57600080fd5b6020019150368190038213156142f357600080fd5b9250929050565b8183823760009101908152919050565b60006020828403121561431c57600080fd5b81516001600160401b038082111561433357600080fd5b818401915084601f83011261434757600080fd5b81518181111561435957614359613b8c565b604051601f8201601f19908116603f0116810190838211818310171561438157614381613b8c565b8160405282815287602084870101111561439a57600080fd5b6138ef836020830160208801613ad5565b60006000198214156143bf576143bf613fb5565b5060010190565b6000602082840312156143d857600080fd5b8151610d4281613b40565b6000602082840312156143f557600080fd5b604051602081018181106001600160401b038211171561441757614417613b8c565b6040529151825250919050565b6101208101614433828561401e565b6001600160a01b03929092166101009190910152919050565b610160810161445b828761401e565b63ffffffff949094166101008201526001600160401b03929092166101208301526001600160a01b031661014090910152919050565b60006001600160ff1b03818413828413808216868404861116156144b7576144b7613fb5565b600160ff1b60008712828116878305891216156144d6576144d6613fb5565b600087129250878205871284841616156144f2576144f2613fb5565b8785058712818416161561450857614508613fb5565b505050929093029392505050565b60006101208b835263ffffffff808c16602085015281604085015261453d8285018c613b01565b6001600160a01b039a8b166060860152608085019990995260a084019790975250509290931660c083015290931660e0840152610100909201919091529392505050565b600061020088835263ffffffff881660208401528060408401526145a781840188613b01565b9150506145c06060830186516001600160a01b03169052565b60208501516001600160a01b03811660808401525060408501516001600160a01b03811660a084015250606085015180151560c084015250608085015160e083015260a0850151610100818185015260c08701519150610120828186015260e0880151925061014083818701528289015161016087015281890151610180870152808901516101a0870152505050506146656101c08301856001600160a01b03169052565b6001600160a01b0383166101e08301526138ef565b60008083128015600160ff1b85018412161561469857614698613fb5565b6001600160ff1b03840183138116156146b3576146b3613fb5565b50500390565b6000602082840312156146cb57600080fd5b8151610d4281613e10565b600084516146e8818460208901613ad5565b8451908301906146fc818360208901613ad5565b845191019061470f818360208801613ad5565b0195945050505050565b600b60fa1b815260008251614735816001850160208701613ad5565b601d60f91b6001939091019283015250600201919050565b6000825161475f818460208701613ad5565b601d60f91b920191825250600101919050565b60008251614784818460208701613ad5565b919091019291505056fea26469706673582212201f04c228f886a983407214f2df4617e028d34cc5290037ac60c579286c59f2d564736f6c6343000809003300000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000030b44c676a05f1264d1de9cc31db5f2a945186b60000000000000000000000003472a5a71965499acd81997a54bba8d852c6e53d0000000000000000000000000000000000000000000000000000015d3ef798000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000104163726f737320426164676572204c5000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000b412d4241444745522d4c50000000000000000000000000000000000000000000

Deployed Bytecode

0x6080604052600436106102cd5760003560e01c8063753b91bb11610175578063b5351ee2116100dc578063cefed55f11610095578063df738fc81161006f578063df738fc8146108c7578063ed4de3a3146108f4578063f1d24bab14610929578063fff6cae91461094d57600080fd5b8063cefed55f1461083d578063d412f5a41461085d578063dd62ed3e1461088157600080fd5b8063b5351ee21461078d578063bd6d894d146107a2578063bec73ade146107b7578063c01e1bd6146107d7578063c73a32c3146107fc578063cc2c929e1461082357600080fd5b8063a457c2d71161012e578063a457c2d7146106c1578063a6af2dfe146106e1578063a9059cbb14610701578063ac9650d814610721578063b208420214610741578063b454e3261461075757600080fd5b8063753b91bb146106205780637998a1c41461064057806387a515d3146106565780638f2839701461066c57806395d89b411461068c578063975057e7146106a157600080fd5b806323b872dd116102345780634464fae4116101ed5780635df45a37116101c75780635df45a371461059f57806362822d34146105b457806366db5240146105d457806370a08231146105ea57600080fd5b80634464fae4146105565780634f52fd171461056c57806351c6590a1461058c57600080fd5b806323b872dd146104b257806329cb924d146104d2578063313ce567146104e557806339509351146105015780633cc400b3146105215780633fa856c91461053657600080fd5b806318160ddd1161028657806318160ddd146103f057806319e9d894146104055780631bf71c381461041a5780631c39c38d1461043a578063223029221461047257806322f8e5661461049257600080fd5b806306fdde03146102d9578063095ea7b31461030457806311cfc159146103345780631311172514610371578063135c404e14610393578063173684c5146103b757600080fd5b366102d457005b600080fd5b3480156102e557600080fd5b506102ee610962565b6040516102fb9190613b2d565b60405180910390f35b34801561031057600080fd5b5061032461031f366004613b60565b6109f4565b60405190151581526020016102fb565b34801561034057600080fd5b50600a546103599061010090046001600160401b031681565b6040516001600160401b0390911681526020016102fb565b34801561037d57600080fd5b5061039161038c366004613cc5565b610a0b565b005b34801561039f57600080fd5b506103a9600d5481565b6040519081526020016102fb565b3480156103c357600080fd5b50600a546103db90600160a81b900463ffffffff1681565b60405163ffffffff90911681526020016102fb565b3480156103fc57600080fd5b506003546103a9565b34801561041157600080fd5b506103a9610cfd565b34801561042657600080fd5b506102ee610435366004613cff565b610d26565b34801561044657600080fd5b5060005461045a906001600160a01b031681565b6040516001600160a01b0390911681526020016102fb565b34801561047e57600080fd5b5060105461045a906001600160a01b031681565b34801561049e57600080fd5b506103916104ad366004613db6565b610d49565b3480156104be57600080fd5b506103246104cd366004613dcf565b610dbf565b3480156104de57600080fd5b50426103a9565b3480156104f157600080fd5b50604051601281526020016102fb565b34801561050d57600080fd5b5061032461051c366004613b60565b610e69565b34801561052d57600080fd5b50610391610ea5565b34801561054257600080fd5b50610391610551366004613cff565b61109a565b34801561056257600080fd5b506103a9600c5481565b34801561057857600080fd5b50610391610587366004613e1e565b6114f7565b61039161059a366004613db6565b611670565b3480156105ab57600080fd5b506103a9611817565b3480156105c057600080fd5b506103a96105cf366004613db6565b61182e565b3480156105e057600080fd5b506103a960085481565b3480156105f657600080fd5b506103a9610605366004613e43565b6001600160a01b031660009081526001602052604090205490565b34801561062c57600080fd5b5061039161063b366004613cc5565b611858565b34801561064c57600080fd5b506103a960115481565b34801561066257600080fd5b506103a960095481565b34801561067857600080fd5b50610391610687366004613e43565b611ca7565b34801561069857600080fd5b506102ee611d2e565b3480156106ad57600080fd5b50600f5461045a906001600160a01b031681565b3480156106cd57600080fd5b506103246106dc366004613b60565b611d3d565b3480156106ed57600080fd5b50600e5461045a906001600160a01b031681565b34801561070d57600080fd5b5061032461071c366004613b60565b611dd6565b61073461072f366004613e60565b611de3565b6040516102fb9190613ed4565b34801561074d57600080fd5b506103a960075481565b34801561076357600080fd5b5061045a610772366004613db6565b6013602052600090815260409020546001600160a01b031681565b34801561079957600080fd5b50610391611f88565b3480156107ae57600080fd5b506103a96121e0565b3480156107c357600080fd5b506103916107d2366004613cff565b6121fa565b3480156107e357600080fd5b5060065461045a9061010090046001600160a01b031681565b34801561080857600080fd5b50600a5461035990600160681b90046001600160401b031681565b34801561082f57600080fd5b50600a546103249060ff1681565b34801561084957600080fd5b50610391610858366004613cff565b6123e7565b34801561086957600080fd5b506006546103db90600160a81b900463ffffffff1681565b34801561088d57600080fd5b506103a961089c366004613f36565b6001600160a01b03918216600090815260026020908152604080832093909416825291909152205490565b3480156108d357600080fd5b506103a96108e2366004613db6565b60126020526000908152604090205481565b34801561090057600080fd5b5061091461090f366004613db6565b6125cd565b604080519283526020830191909152016102fb565b34801561093557600080fd5b50600a546103db90600160481b900463ffffffff1681565b34801561095957600080fd5b50610391612604565b60606004805461097190613f64565b80601f016020809104026020016040519081016040528092919081815260200182805461099d90613f64565b80156109ea5780601f106109bf576101008083540402835291602001916109ea565b820191906000526020600020905b8154815290600101906020018083116109cd57829003601f168201915b5050505050905090565b6000610a01338484612624565b5060015b92915050565b610a13612748565b610a1b61279a565b6703782dace9d900008260a001516001600160401b031611158015610a5557506703782dace9d900008260c001516001600160401b031611155b8015610a7257506706f05b59d3b20000816001600160401b031611155b610ab25760405162461bcd60e51b815260206004820152600c60248201526b496e76616c6964206665657360a01b60448201526064015b60405180910390fd5b6000610abd836127a6565b60008181526012602052604090205490915015610b135760405162461bcd60e51b815260206004820152601460248201527350656e64696e672072656c61792065786973747360601b6044820152606401610aa9565b60004290506000610b2785608001516127e9565b905060006040518060e0016040528060016002811115610b4957610b49613f9f565b815233602082015260068054604090920191600160a81b900463ffffffff16906015610b7483613fcb565b91906101000a81548163ffffffff021916908363ffffffff16021790555063ffffffff168152602001866001600160401b031681526020018463ffffffff168152602001838152602001600b548152509050610bcf81612809565b600085815260126020526040812091909155610beb878361281c565b90508660800151600954600754610c029190613fef565b1015610c4c5760405162461bcd60e51b8152602060048201526019602482015278496e73756666696369656e7420706f6f6c2062616c616e636560381b6044820152606401610aa9565b6000600b5484610c5c9190614006565b9050876080015160096000828254610c749190614006565b9250508190555080600d6000828254610c8d9190614006565b9091555050600654610caf9061010090046001600160a01b0316333084612870565b857fa4ca36d112520cced74325c72711f376fe4015665829d879ba21590cb8130be0898585604051610ce393929190614128565b60405180910390a2505050505050610cf96128e1565b5050565b6000610d07612748565b610d0f61279a565b610d1960006128f0565b9050610d236128e1565b90565b6060610d30612748565b610d42610d3d848461281c565b61297e565b9392505050565b6000546001600160a01b0316610d5e57600080fd5b60005460405163117c72b360e11b8152600481018390526001600160a01b03909116906322f8e56690602401600060405180830381600087803b158015610da457600080fd5b505af1158015610db8573d6000803e3d6000fd5b5050505050565b6000610dcc8484846129bb565b6001600160a01b038416600090815260026020908152604080832033845290915290205482811015610e515760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b6064820152608401610aa9565b610e5e8533858403612624565b506001949350505050565b3360008181526002602090815260408083206001600160a01b03871684529091528120549091610a01918590610ea0908690614006565b612624565b610ead612748565b610eb561279a565b600e60009054906101000a90046001600160a01b03166001600160a01b031663c73a32c36040518163ffffffff1660e01b815260040160206040518083038186803b158015610f0357600080fd5b505afa158015610f17573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f3b9190614154565b600a600d6101000a8154816001600160401b0302191690836001600160401b03160217905550600e60009054906101000a90046001600160a01b03166001600160a01b031663173684c56040518163ffffffff1660e01b815260040160206040518083038186803b158015610faf57600080fd5b505afa158015610fc3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fe79190614171565b600a60156101000a81548163ffffffff021916908363ffffffff160217905550600e60009054906101000a90046001600160a01b03166001600160a01b0316637998a1c46040518163ffffffff1660e01b815260040160206040518083038186803b15801561105557600080fd5b505afa158015611069573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061108d919061418e565b6011556110986128e1565b565b6110a2612748565b6110aa61279a565b60006110b5836127a6565b90506110c18183612b89565b6001825160028111156110d6576110d6613f9f565b146111155760405162461bcd60e51b815260206004820152600f60248201526e105b1c9958591e481cd95d1d1b1959608a1b6044820152606401610aa9565b6000600a60159054906101000a900463ffffffff16836080015161113991906141a7565b9050428163ffffffff1611156111865760405162461bcd60e51b8152602060048201526012602482015271139bdd081cd95d1d1b1958589b19481e595d60721b6044820152606401610aa9565b82602001516001600160a01b0316336001600160a01b031614806111ba57506111b1816103846141a7565b63ffffffff1642115b6111f95760405162461bcd60e51b815260206004820152601060248201526f2737ba1039b637bb903932b630bcb2b960811b6044820152606401610aa9565b6040805160e0810190915261126d90806002815260200185602001516001600160a01b03168152602001856040015163ffffffff16815260200185606001516001600160401b03168152602001856080015163ffffffff1681526020018560a0015181526020018560c00151815250612809565b60008381526012602052604081209190915560a085015160608501516112a091611296916141cf565b8660800151612c16565b85608001516112af9190613fef565b905060006112bd8486612c3e565b600081815260136020526040902054600a549192506001600160a01b03169060ff1680156112f257506001600160a01b038116155b1561130a57611305876040015184612c69565b61133f565b61133f6001600160a01b038216611325578760400151611327565b815b60065461010090046001600160a01b03169085612d32565b60006113538860a001518960800151612c16565b905060008760a001518860c0015161136b9190614006565b60208901519091506001600160a01b03163314156113b35760208801516113ae906113968385614006565b60065461010090046001600160a01b03169190612d32565b6113f1565b60208801516006546113d5916101009091046001600160a01b03169083612d32565b6006546113f19061010090046001600160a01b03163384612d32565b60006113fd8387614006565b90508960800151600960008282546114159190613fef565b92505081905550806007600082825461142e9190613fef565b92505081905550806008600082825461144791906141f1565b9250508190555081600d60008282546114609190613fef565b9091555061146e9050612d62565b6114886114838a606001518c60800151612c16565b612da6565b336001600160a01b0316887fcfdda74fce9fedb259e0f0a1ab1550e19b338488ece64976a4639e7fce0293a78b6040516114c29190614232565b60405180910390a350505060009182525060136020526040902080546001600160a01b031916905550610cf991506128e19050565b6114ff612748565b61150761279a565b8015806115165750600a5460ff165b6115525760405162461bcd60e51b815260206004820152600d60248201526c086c2dce840e6cadcc840cae8d609b1b6044820152606401610aa9565b6000670de0b6b3a7640000611565612dd9565b61156f9085614240565b6115799190614275565b9050806009546115899190614006565b60075410156115da5760405162461bcd60e51b815260206004820152601e60248201527f5574696c697a6174696f6e20746f6f206869676820746f2072656d6f766500006044820152606401610aa9565b6115e43384612e79565b80600760008282546115f69190613fef565b909155505081156116105761160b3382612c69565b61162c565b60065461162c9061010090046001600160a01b03163383612d32565b604080518281526020810185905233917f0c54fc223ffd1a8f36652b5e83db4fff50f5ae151b11ceb56d5499b9f6e1fa18910160405180910390a250610cf96128e1565b611678612748565b61168061279a565b600a5460ff16801561169157508034145b8061169a575034155b6116e65760405162461bcd60e51b815260206004820152601b60248201527f42616420616464206c6971756964697479204574682076616c756500000000006044820152606401610aa9565b60006116f0612dd9565b61170283670de0b6b3a7640000614240565b61170c9190614275565b90506117183382612fc7565b816007600082825461172a9190614006565b909155505034158015906117405750600a5460ff165b156117b357600660019054906101000a90046001600160a01b03166001600160a01b031663d0e30db0346040518263ffffffff1660e01b81526004016000604051808303818588803b15801561179557600080fd5b505af11580156117a9573d6000803e3d6000fd5b50505050506117d0565b6006546117d09061010090046001600160a01b0316333085612870565b604080518381526020810183905233917f0351f600ef1e31e5e13b4dc27bff4cbde3e9269f0ffc666629ae6cac573eb220910160405180910390a2506118146128e1565b50565b6000611821612748565b6118296130a6565b905090565b6000611838612748565b61184061279a565b611849826128f0565b90506118536128e1565b919050565b611860612748565b61186861279a565b60004290506703782dace9d900008360a001516001600160401b0316111580156118a757506703782dace9d900008360c001516001600160401b031611155b80156118c457506706f05b59d3b20000826001600160401b031611155b6118ff5760405162461bcd60e51b815260206004820152600c60248201526b496e76616c6964206665657360a01b6044820152606401610aa9565b600061190a846127a6565b600081815260126020526040902054909150156119605760405162461bcd60e51b815260206004820152601460248201527350656e64696e672072656c61792065786973747360601b6044820152606401610aa9565b600061196f85608001516127e9565b905060006040518060e001604052806001600281111561199157611991613f9f565b815233602082015260068054604090920191600160a81b900463ffffffff169060156119bc83613fcb565b91906101000a81548163ffffffff021916908363ffffffff16021790555063ffffffff168152602001866001600160401b031681526020018563ffffffff168152602001838152602001600b5481525090506000611a1a878361281c565b9050611a2582612809565b600085815260126020526040812091909155611a418584612c3e565b6000818152601360205260409020549091506001600160a01b031615611aa35760405162461bcd60e51b8152602060048201526017602482015276052656c61792063616e6e6f74206265207370656420757604c1b6044820152606401610aa9565b8760800151600954600754611ab89190613fef565b1015611b025760405162461bcd60e51b8152602060048201526019602482015278496e73756666696369656e7420706f6f6c2062616c616e636560381b6044820152606401610aa9565b6000600b5485611b129190614006565b90506000611b468a60c001518b60a001518760600151611b3291906141cf565b611b3c91906141cf565b8b60800151612c16565b90506000818b60800151611b5a9190613fef565b905082600d6000828254611b6e9190614006565b909155505060808b015160098054600090611b8a908490614006565b9091555050600084815260136020526040902080546001600160a01b03191633908117909155611bd89030611bbf8685614006565b60065461010090046001600160a01b0316929190612870565b600a5460ff1615611bf657611bf18b6040015182612c69565b611c18565b60408b0151600654611c18916101009091046001600160a01b03169083612d32565b877fa4ca36d112520cced74325c72711f376fe4015665829d879ba21590cb8130be08c8888604051611c4c93929190614128565b60405180910390a2336001600160a01b0316887ff98cddc88bc965917007822b05056cb92bc9ddf0f8bcc61678400cb78313bb4b88604051611c8e9190614232565b60405180910390a3505050505050505050610cf96128e1565b611caf612748565b611cb761279a565b600e546001600160a01b03163314611cce57600080fd5b600e80546001600160a01b0319166001600160a01b0383169081179091556040805133815260208101929092527f485a12424bd0c2c66a131c2681cb6c743b9573af3ae5f3014ef6ce7f55ab0192910160405180910390a16118146128e1565b60606005805461097190613f64565b3360009081526002602090815260408083206001600160a01b038616845290915281205482811015611dbf5760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401610aa9565b611dcc3385858403612624565b5060019392505050565b6000610a013384846129bb565b60603415611e335760405162461bcd60e51b815260206004820152601b60248201527f4f6e6c79206d756c746963616c6c207769746820302076616c756500000000006044820152606401610aa9565b816001600160401b03811115611e4b57611e4b613b8c565b604051908082528060200260200182016040528015611e7e57816020015b6060815260200190600190039081611e695790505b50905060005b82811015611f815760008030868685818110611ea257611ea2614297565b9050602002810190611eb491906142ad565b604051611ec29291906142fa565b600060405180830381855af49150503d8060008114611efd576040519150601f19603f3d011682016040523d82523d6000602084013e611f02565b606091505b509150915081611f4e57604481511015611f1b57600080fd5b60048101905080806020019051810190611f35919061430a565b60405162461bcd60e51b8152600401610aa99190613b2d565b80848481518110611f6157611f61614297565b602002602001018190525050508080611f79906143ab565b915050611e84565b5092915050565b611f90612748565b611f9861279a565b600e5460408051632e68f21360e21b815290516000926001600160a01b03169163b9a3c84c916004808301926020929190829003018186803b158015611fdd57600080fd5b505afa158015611ff1573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061201591906143c6565b6040516302abf57960e61b815275536b696e6e794f7074696d69737469634f7261636c6560501b60048201529091506001600160a01b0382169063aafd5e409060240160206040518083038186803b15801561207057600080fd5b505afa158015612084573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120a891906143c6565b601080546001600160a01b0319166001600160a01b039283161790556040516302abf57960e61b81526453746f726560d81b60048201529082169063aafd5e409060240160206040518083038186803b15801561210457600080fd5b505afa158015612118573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061213c91906143c6565b600f80546001600160a01b0319166001600160a01b03928316908117909155600654604051635b97aadd60e01b8152610100909104909216600483015290635b97aadd9060240160206040518083038186803b15801561219b57600080fd5b505afa1580156121af573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121d391906143e3565b51600b55506110986128e1565b60006121ea612748565b6121f261279a565b610d19612dd9565b612202612748565b61220a61279a565b6000612215836127a6565b90506122218183612b89565b600061222d8284612c3e565b9050600a60159054906101000a900463ffffffff16836080015161225191906141a7565b63ffffffff1642108015612277575060018351600281111561227557612275613f9f565b145b801561229857506000818152601360205260409020546001600160a01b0316155b6122de5760405162461bcd60e51b8152602060048201526017602482015276052656c61792063616e6e6f74206265207370656420757604c1b6044820152606401610aa9565b600081815260136020526040812080546001600160a01b0319163317905560c085015160a086015160608601516123239291612319916141cf565b61129691906141cf565b905060008186608001516123379190613fef565b600a5490915060ff1615612375576006546123629061010090046001600160a01b0316333084612870565b612370866040015182612c69565b612399565b6040860151600654612399916101009091046001600160a01b031690339084612870565b336001600160a01b0316847ff98cddc88bc965917007822b05056cb92bc9ddf0f8bcc61678400cb78313bb4b876040516123d39190614232565b60405180910390a350505050610cf96128e1565b6123ef612748565b6123f761279a565b42600a54608083015161241791600160a81b900463ffffffff16906141a7565b63ffffffff161161245a5760405162461bcd60e51b815260206004820152600d60248201526c50617374206c6976656e65737360981b6044820152606401610aa9565b60018151600281111561246f5761246f613f9f565b146124ad5760405162461bcd60e51b815260206004820152600e60248201526d4e6f742064697370757461626c6560901b6044820152606401610aa9565b60006124b8836127a6565b90506124c48183612b89565b60006124d0848461281c565b905060006124f58460200151338660a001518760c001516124f08761297e565b613115565b90508360a001518460c0015161250b9190614006565b600d600082825461251c9190613fef565b9091555050608085015160098054600090612538908490613fef565b9091555050600083815260126020526040812055801561258c573361255c85612809565b60405185907f29751133c2d0a0ea7a9da312248b12ef10ac4c20f4e3ab5eebbb80d853b3836790600090a46125c2565b3361259685612809565b60405185907f14173c4d3bd95e34f5c8f78729323444c9272bd21051e70045b64ed48f65818390600090a45b505050610cf96128e1565b6000806125d8612748565b6125e061279a565b6125ea60006128f0565b6125f3846128f0565b915091506125ff6128e1565b915091565b61260c612748565b61261461279a565b61261c61343a565b6110986128e1565b6001600160a01b0383166126865760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610aa9565b6001600160a01b0382166126e75760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610aa9565b6001600160a01b0383811660008181526002602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b60065460ff166110985760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610aa9565b6006805460ff19169055565b6006546040516000916127cc91849161010090046001600160a01b031690602001614424565b604051602081830303815290604052805190602001209050919050565b600a54600090610a0590600160681b90046001600160401b031683612c16565b6000816040516020016127cc9190614232565b60008282604001518360600151600660019054906101000a90046001600160a01b0316604051602001612852949392919061444c565b60405160208183030381529060405280519060200120905092915050565b6040516001600160a01b03808516602483015283166044820152606481018290526128db9085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526134fd565b50505050565b6006805460ff19166001179055565b60006128fa61343a565b6000806008541361290c576000612910565b6008545b9050600081600954856129239190614006565b61292d9190614006565b905060008260075461293f9190614006565b9050806129585750670de0b6b3a7640000949350505050565b8061296b83670de0b6b3a7640000614240565b6129759190614275565b95945050505050565b6060610a0560405180602001604052806000815250604051806040016040528060098152602001680e4cad8c2f290c2e6d60bb1b815250846135cf565b6001600160a01b038316612a1f5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610aa9565b6001600160a01b038216612a815760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610aa9565b6001600160a01b03831660009081526001602052604090205481811015612af95760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610aa9565b6001600160a01b03808516600090815260016020526040808220858503905591851681529081208054849290612b30908490614006565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051612b7c91815260200190565b60405180910390a36128db565b612b9281612809565b60008381526012602052604090205414610cf9576040805162461bcd60e51b81526020600482015260248101919091527f4861736865642072656c617920706172616d7320646f206e6f74206d6174636860448201527f206578697374696e672072656c6179206861736820666f72206465706f7369746064820152608401610aa9565b6000670de0b6b3a7640000612c34836001600160401b038616614240565b610d429190614275565b60008282606001516040516020016128529291909182526001600160401b0316602082015260400190565b6001600160a01b0382163b15612c9557600654610cf99061010090046001600160a01b03168383612d32565b600654604051632e1a7d4d60e01b8152600481018390526101009091046001600160a01b031690632e1a7d4d90602401600060405180830381600087803b158015612cdf57600080fd5b505af1158015612cf3573d6000803e3d6000fd5b50506040516001600160a01b038516925083156108fc02915083906000818181858888f19350505050158015612d2d573d6000803e3d6000fd5b505050565b6040516001600160a01b038316602482015260448101829052612d2d90849063a9059cbb60e01b906064016128a4565b6000612d6c6130a6565b905080600c54612d7c9190613fef565b600c5550600a80546cffffffff0000000000000000001916600160481b4263ffffffff1602179055565b80600c6000828254612db89190614006565b925050819055508060086000828254612dd191906141f1565b909155505050565b6000612de460035490565b612df55750670de0b6b3a764000090565b612dfd612d62565b612e0561343a565b6000600c54600754612e179190613fef565b905060006008541315612e3857600854612e319082614006565b9050612e54565b600854612e4790600019614491565b612e519082613fef565b90505b600354612e6982670de0b6b3a7640000614240565b612e739190614275565b91505090565b6001600160a01b038216612ed95760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b6064820152608401610aa9565b6001600160a01b03821660009081526001602052604090205481811015612f4d5760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b6064820152608401610aa9565b6001600160a01b0383166000908152600160205260408120838303905560038054849290612f7c908490613fef565b90915550506040518281526000906001600160a01b038516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a3505050565b6001600160a01b03821661301d5760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610aa9565b806003600082825461302f9190614006565b90915550506001600160a01b0382166000908152600160205260408120805483929061305c908490614006565b90915550506040518181526001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b600a546000908190670de0b6b3a764000090600160481b900463ffffffff16426130d09190613fef565b600a54600c546130ee9161010090046001600160401b031690614240565b6130f89190614240565b6131029190614275565b9050600c54811061185357600c54612e73565b6000806131228585614006565b6010546006549192506131479161010090046001600160a01b03908116911683613615565b6010546011546001600160a01b039091169063af355d1e904286600660019054906101000a90046001600160a01b031660008b600a60159054906101000a900463ffffffff168f670de0b6b3a76400006040518a63ffffffff1660e01b81526004016131bb99989796959493929190614516565b602060405180830381600087803b1580156131d557600080fd5b505af1925050508015613205575060408051601f3d908101601f191682019092526132029181019061418e565b60015b613252576006546132259061010090046001600160a01b03168883612d32565b601054600654613248916001600160a01b03610100909204821691166000613615565b6000915050612975565b818110156132ad5760006132668284613fef565b6006549091506132859061010090046001600160a01b03168a83612d32565b6010546006546132a8916001600160a01b03610100909204821691166000613615565b819250505b5060408051610160810182526001600160a01b03898116825260006020830181905260065461010090049091169282019290925260608101829052670de0b6b3a7640000608082015260a08101829052600a5460c0820190600160a81b900463ffffffff164261331d9190614006565b8152600060208201526040016133338885613fef565b815260208101889052600a54600160a81b900463ffffffff90811660409092019190915260065491925061337c9161010090046001600160a01b03169033903090869061287016565b60105460065461339e916001600160a01b036101009092048216911684613615565b60105460115460405163139c641960e31b81526001600160a01b0390921691639ce320c8916133d9914290899087908e903090600401614581565b602060405180830381600087803b1580156133f357600080fd5b505af1158015613407573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061342b919061418e565b50600198975050505050505050565b600d546006546040516370a0823160e01b81523060048201526000929161010090046001600160a01b0316906370a082319060240160206040518083038186803b15801561348757600080fd5b505afa15801561349b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906134bf919061418e565b6134c99190613fef565b9050600754811115611814576007546134e29082613fef565b600860008282546134f3919061467a565b9091555050600755565b6000613552826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166137399092919063ffffffff16565b805190915015612d2d578080602001905181019061357091906146b9565b612d2d5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610aa9565b606060006135dd8585613750565b905084816135ea85613792565b6040516020016135fc939291906146d6565b6040516020818303038152906040529150509392505050565b80158061369e5750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e9060440160206040518083038186803b15801561366457600080fd5b505afa158015613678573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061369c919061418e565b155b6137095760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b6064820152608401610aa9565b6040516001600160a01b038316602482015260448101829052612d2d90849063095ea7b360e01b906064016128a4565b606061374884846000856137d2565b949350505050565b815160609015613781578160405160200161376b9190614719565b6040516020818303038152906040529050610a05565b8160405160200161376b919061474d565b60606137a1608083901c6138fa565b6137aa836138fa565b6040805160208101939093528201526060016040516020818303038152906040529050919050565b6060824710156138335760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610aa9565b843b6138815760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610aa9565b600080866001600160a01b0316858760405161389d9190614772565b60006040518083038185875af1925050503d80600081146138da576040519150601f19603f3d011682016040523d82523d6000602084013e6138df565b606091505b50915091506138ef828286613a9c565b979650505050505050565b6000808260001c9050806fffffffffffffffffffffffffffffffff169050806801000000000000000002811777ffffffffffffffff0000000000000000ffffffffffffffff169050806401000000000281177bffffffff00000000ffffffff00000000ffffffff00000000ffffffff16905080620100000281177dffff0000ffff0000ffff0000ffff0000ffff0000ffff0000ffff0000ffff169050806101000281177eff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff1690508060100281177f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f16905060006008827f08080808080808080808080808080808080808080808080808080808080808081681613a1e57613a1e61425f565b0460047f040404040404040404040404040404040404040404040404040404040404040484160460027f020202020202020202020202020202020202020202020202020202020202020285160417166027029091017f3030303030303030303030303030303030303030303030303030303030303030019392505050565b60608315613aab575081610d42565b825115613abb5782518084602001fd5b8160405162461bcd60e51b8152600401610aa99190613b2d565b60005b83811015613af0578181015183820152602001613ad8565b838111156128db5750506000910152565b60008151808452613b19816020860160208601613ad5565b601f01601f19169290920160200192915050565b602081526000610d426020830184613b01565b6001600160a01b038116811461181457600080fd5b803561185381613b40565b60008060408385031215613b7357600080fd5b8235613b7e81613b40565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b60405160e081016001600160401b0381118282101715613bc457613bc4613b8c565b60405290565b6001600160401b038116811461181457600080fd5b803561185381613bca565b63ffffffff8116811461181457600080fd5b803561185381613bea565b6000610100808385031215613c1b57600080fd5b604051908101906001600160401b0382118183101715613c3d57613c3d613b8c565b816040528092508335815260208401359150613c5882613bca565b816020820152613c6a60408501613b55565b6040820152613c7b60608501613b55565b606082015260808401356080820152613c9660a08501613bdf565b60a0820152613ca760c08501613bdf565b60c0820152613cb860e08501613bfc565b60e0820152505092915050565b6000806101208385031215613cd957600080fd5b613ce38484613c07565b9150610100830135613cf481613bca565b809150509250929050565b6000808284036101e0811215613d1457600080fd5b613d1e8585613c07565b925060e060ff1982011215613d3257600080fd5b50613d3b613ba2565b61010084013560038110613d4e57600080fd5b8152613d5d6101208501613b55565b6020820152613d6f6101408501613bfc565b6040820152613d816101608501613bdf565b6060820152613d936101808501613bfc565b60808201526101a084013560a08201526101c09093013560c08401525092909150565b600060208284031215613dc857600080fd5b5035919050565b600080600060608486031215613de457600080fd5b8335613def81613b40565b92506020840135613dff81613b40565b929592945050506040919091013590565b801515811461181457600080fd5b60008060408385031215613e3157600080fd5b823591506020830135613cf481613e10565b600060208284031215613e5557600080fd5b8135610d4281613b40565b60008060208385031215613e7357600080fd5b82356001600160401b0380821115613e8a57600080fd5b818501915085601f830112613e9e57600080fd5b813581811115613ead57600080fd5b8660208260051b8501011115613ec257600080fd5b60209290920196919550909350505050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b82811015613f2957603f19888603018452613f17858351613b01565b94509285019290850190600101613efb565b5092979650505050505050565b60008060408385031215613f4957600080fd5b8235613f5481613b40565b91506020830135613cf481613b40565b600181811c90821680613f7857607f821691505b60208210811415613f9957634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600063ffffffff80831681811415613fe557613fe5613fb5565b6001019392505050565b60008282101561400157614001613fb5565b500390565b6000821982111561401957614019613fb5565b500190565b8051825260208101516001600160401b0380821660208501526040830151915060018060a01b03808316604086015280606085015116606086015250608083015160808501528060a08401511660a08501528060c08401511660c0850152505063ffffffff60e08201511660e08301525050565b8051600381106140b257634e487b7160e01b600052602160045260246000fd5b82526020818101516001600160a01b031690830152604080820151906140df9084018263ffffffff169052565b5060608101516140fa60608401826001600160401b03169052565b506080810151614112608084018263ffffffff169052565b5060a0818101519083015260c090810151910152565b6102008101614137828661401e565b614145610100830185614092565b826101e0830152949350505050565b60006020828403121561416657600080fd5b8151610d4281613bca565b60006020828403121561418357600080fd5b8151610d4281613bea565b6000602082840312156141a057600080fd5b5051919050565b600063ffffffff8083168185168083038211156141c6576141c6613fb5565b01949350505050565b60006001600160401b038083168185168083038211156141c6576141c6613fb5565b600080821280156001600160ff1b038490038513161561421357614213613fb5565b600160ff1b839003841281161561422c5761422c613fb5565b50500190565b60e08101610a058284614092565b600081600019048311821515161561425a5761425a613fb5565b500290565b634e487b7160e01b600052601260045260246000fd5b60008261429257634e487b7160e01b600052601260045260246000fd5b500490565b634e487b7160e01b600052603260045260246000fd5b6000808335601e198436030181126142c457600080fd5b8301803591506001600160401b038211156142de57600080fd5b6020019150368190038213156142f357600080fd5b9250929050565b8183823760009101908152919050565b60006020828403121561431c57600080fd5b81516001600160401b038082111561433357600080fd5b818401915084601f83011261434757600080fd5b81518181111561435957614359613b8c565b604051601f8201601f19908116603f0116810190838211818310171561438157614381613b8c565b8160405282815287602084870101111561439a57600080fd5b6138ef836020830160208801613ad5565b60006000198214156143bf576143bf613fb5565b5060010190565b6000602082840312156143d857600080fd5b8151610d4281613b40565b6000602082840312156143f557600080fd5b604051602081018181106001600160401b038211171561441757614417613b8c565b6040529151825250919050565b6101208101614433828561401e565b6001600160a01b03929092166101009190910152919050565b610160810161445b828761401e565b63ffffffff949094166101008201526001600160401b03929092166101208301526001600160a01b031661014090910152919050565b60006001600160ff1b03818413828413808216868404861116156144b7576144b7613fb5565b600160ff1b60008712828116878305891216156144d6576144d6613fb5565b600087129250878205871284841616156144f2576144f2613fb5565b8785058712818416161561450857614508613fb5565b505050929093029392505050565b60006101208b835263ffffffff808c16602085015281604085015261453d8285018c613b01565b6001600160a01b039a8b166060860152608085019990995260a084019790975250509290931660c083015290931660e0840152610100909201919091529392505050565b600061020088835263ffffffff881660208401528060408401526145a781840188613b01565b9150506145c06060830186516001600160a01b03169052565b60208501516001600160a01b03811660808401525060408501516001600160a01b03811660a084015250606085015180151560c084015250608085015160e083015260a0850151610100818185015260c08701519150610120828186015260e0880151925061014083818701528289015161016087015281890151610180870152808901516101a0870152505050506146656101c08301856001600160a01b03169052565b6001600160a01b0383166101e08301526138ef565b60008083128015600160ff1b85018412161561469857614698613fb5565b6001600160ff1b03840183138116156146b3576146b3613fb5565b50500390565b6000602082840312156146cb57600080fd5b8151610d4281613e10565b600084516146e8818460208901613ad5565b8451908301906146fc818360208901613ad5565b845191019061470f818360208801613ad5565b0195945050505050565b600b60fa1b815260008251614735816001850160208701613ad5565b601d60f91b6001939091019283015250600201919050565b6000825161475f818460208701613ad5565b601d60f91b920191825250600101919050565b60008251614784818460208701613ad5565b919091019291505056fea26469706673582212201f04c228f886a983407214f2df4617e028d34cc5290037ac60c579286c59f2d564736f6c63430008090033

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

00000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000030b44c676a05f1264d1de9cc31db5f2a945186b60000000000000000000000003472a5a71965499acd81997a54bba8d852c6e53d0000000000000000000000000000000000000000000000000000015d3ef798000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000104163726f737320426164676572204c5000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000b412d4241444745522d4c50000000000000000000000000000000000000000000

-----Decoded View---------------
Arg [0] : _lpTokenName (string): Across Badger LP
Arg [1] : _lpTokenSymbol (string): A-BADGER-LP
Arg [2] : _bridgeAdmin (address): 0x30B44C676A05F1264d1dE9cC31dB5F2A945186b6
Arg [3] : _l1Token (address): 0x3472A5A71965499acd81997a54BBA8D852C6E53d
Arg [4] : _lpFeeRatePerSecond (uint64): 1500000000000
Arg [5] : _isWethPool (bool): False
Arg [6] : _timer (address): 0x0000000000000000000000000000000000000000

-----Encoded View---------------
11 Constructor Arguments found :
Arg [0] : 00000000000000000000000000000000000000000000000000000000000000e0
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000120
Arg [2] : 00000000000000000000000030b44c676a05f1264d1de9cc31db5f2a945186b6
Arg [3] : 0000000000000000000000003472a5a71965499acd81997a54bba8d852c6e53d
Arg [4] : 0000000000000000000000000000000000000000000000000000015d3ef79800
Arg [5] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [6] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [7] : 0000000000000000000000000000000000000000000000000000000000000010
Arg [8] : 4163726f737320426164676572204c5000000000000000000000000000000000
Arg [9] : 000000000000000000000000000000000000000000000000000000000000000b
Arg [10] : 412d4241444745522d4c50000000000000000000000000000000000000000000


Deployed Bytecode Sourcemap

49244:507:14:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2084:98:0;;;;;;;;;;;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;4181:166;;;;;;;;;;-1:-1:-1;4181:166:0;;;;;:::i;:::-;;:::i;:::-;;;1621:14:22;;1614:22;1596:41;;1584:2;1569:18;4181:166:0;1456:187:22;2602:32:14;;;;;;;;;;-1:-1:-1;2602:32:14;;;;;;;-1:-1:-1;;;;;2602:32:14;;;;;;-1:-1:-1;;;;;1917:31:22;;;1899:50;;1887:2;1872:18;2602:32:14;1755:200:22;20358:2964:14;;;;;;;;;;-1:-1:-1;20358:2964:14;;;;;:::i;:::-;;:::i;:::-;;3280:20;;;;;;;;;;;;;;;;;;;4405:25:22;;;4393:2;4378:18;3280:20:14;4259:177:22;2831:38:14;;;;;;;;;;-1:-1:-1;2831:38:14;;;;-1:-1:-1;;;2831:38:14;;;;;;;;;4714:10:22;4702:23;;;4684:42;;4672:2;4657:18;2831:38:14;4540:192:22;3172:106:0;;;;;;;;;;-1:-1:-1;3259:12:0;;3172:106;;33018:136:14;;;;;;;;;;;;;:::i;37632:266::-;;;;;;;;;;-1:-1:-1;37632:266:14;;;;;:::i;:::-;;:::i;391:27:12:-;;;;;;;;;;-1:-1:-1;391:27:12;;;;-1:-1:-1;;;;;391:27:12;;;;;;-1:-1:-1;;;;;6218:32:22;;;6200:51;;6188:2;6173:18;391:27:12;6054:203:22;3681:55:14;;;;;;;;;;-1:-1:-1;3681:55:14;;;;-1:-1:-1;;;;;3681:55:14;;;1097:115:12;;;;;;;;;;-1:-1:-1;1097:115:12;;;;;:::i;:::-;;:::i;4814:478:0:-;;;;;;;;;;-1:-1:-1;4814:478:0;;;;;:::i;:::-;;:::i;49637:112:14:-;;;;;;;;;;-1:-1:-1;49727:15:14;49637:112;;3021:91:0;;;;;;;;;;-1:-1:-1;3021:91:0;;3103:2;7298:36:22;;7286:2;7271:18;3021:91:0;7156:184:22;5687:212:0;;;;;;;;;;-1:-1:-1;5687:212:0;;;;;:::i;:::-;;:::i;35788:245:14:-;;;;;;;;;;;;;:::i;27271:4941::-;;;;;;;;;;-1:-1:-1;27271:4941:14;;;;;:::i;:::-;;:::i;3121:34::-;;;;;;;;;;;;;;;;11638:815;;;;;;;;;;-1:-1:-1;11638:815:14;;;;;:::i;:::-;;:::i;10033:965::-;;;;;;:::i;:::-;;:::i;36870:124::-;;;;;;;;;;;;;:::i;33501:171::-;;;;;;;;;;-1:-1:-1;33501:171:14;;;;;:::i;:::-;;:::i;2209:30::-;;;;;;;;;;;;;;;;3336:125:0;;;;;;;;;;-1:-1:-1;3336:125:0;;;;;:::i;:::-;-1:-1:-1;;;;;3436:18:0;3410:7;3436:18;;;:9;:18;;;;;;;3336:125;13450:4308:14;;;;;;;;;;-1:-1:-1;13450:4308:14;;;;;:::i;:::-;;:::i;3838:25::-;;;;;;;;;;;;;;;;2331:30;;;;;;;;;;;;;;;;36325:250;;;;;;;;;;-1:-1:-1;36325:250:14;;;;;:::i;:::-;;:::i;2295:102:0:-;;;;;;;;;;;;;:::i;3648:27:14:-;;;;;;;;;;-1:-1:-1;3648:27:14;;;;-1:-1:-1;;;;;3648:27:14;;;6386:405:0;;;;;;;;;;-1:-1:-1;6386:405:0;;;;;:::i;:::-;;:::i;3428:39:14:-;;;;;;;;;;-1:-1:-1;3428:39:14;;;;-1:-1:-1;;;;;3428:39:14;;;3664:172:0;;;;;;;;;;-1:-1:-1;3664:172:0;;;;;:::i;:::-;;:::i;528:710:11:-;;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;2101:29:14:-;;;;;;;;;;;;;;;;6233:48;;;;;;;;;;-1:-1:-1;6233:48:14;;;;;:::i;:::-;;;;;;;;;;;;-1:-1:-1;;;;;6233:48:14;;;34876:457;;;;;;;;;;;;;:::i;32710:117::-;;;;;;;;;;;;;:::i;24845:1739::-;;;;;;;;;;-1:-1:-1;24845:1739:14;;;;;:::i;:::-;;:::i;1903:30::-;;;;;;;;;;-1:-1:-1;1903:30:14;;;;;;;-1:-1:-1;;;;;1903:30:14;;;2796:29;;;;;;;;;;-1:-1:-1;2796:29:14;;;;-1:-1:-1;;;2796:29:14;;-1:-1:-1;;;;;2796:29:14;;;2497:22;;;;;;;;;;-1:-1:-1;2497:22:14;;;;;;;;18380:1351;;;;;;;;;;-1:-1:-1;18380:1351:14;;;;;:::i;:::-;;:::i;2012:28::-;;;;;;;;;;-1:-1:-1;2012:28:14;;;;-1:-1:-1;;;2012:28:14;;;;;;3894:149:0;;;;;;;;;;-1:-1:-1;3894:149:0;;;;;:::i;:::-;-1:-1:-1;;;;;4009:18:0;;;3983:7;4009:18;;;:11;:18;;;;;;;;:27;;;;;;;;;;;;;3894:149;6013:41:14;;;;;;;;;;-1:-1:-1;6013:41:14;;;;;:::i;:::-;;;;;;;;;;;;;;34120:279;;;;;;;;;;-1:-1:-1;34120:279:14;;;;;:::i;:::-;;:::i;:::-;;;;11275:25:22;;;11331:2;11316:18;;11309:34;;;;11248:18;34120:279:14;11101:248:22;2690:29:14;;;;;;;;;;-1:-1:-1;2690:29:14;;;;-1:-1:-1;;;2690:29:14;;;;;;32441:62;;;;;;;;;;;;;:::i;2084:98:0:-;2138:13;2170:5;2163:12;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2084:98;:::o;4181:166::-;4264:4;4280:39;666:10:5;4303:7:0;4312:6;4280:8;:39::i;:::-;-1:-1:-1;4336:4:0;4181:166;;;;;:::o;20358:2964:14:-;1317:19:10;:17;:19::i;:::-;1346:17;:15;:17::i;:::-;20745:7:14::1;20714:11;:27;;;-1:-1:-1::0;;;;;20714:38:14::1;;;:99;;;;;20806:7;20772:11;:30;;;-1:-1:-1::0;;;;;20772:41:14::1;;;20714:99;:145;;;;;20853:6;20833:16;-1:-1:-1::0;;;;;20833:26:14::1;;;20714:145;20693:204;;;::::0;-1:-1:-1;;;20693:204:14;;11941:2:22;20693:204:14::1;::::0;::::1;11923:21:22::0;11980:2;11960:18;;;11953:30;-1:-1:-1;;;11999:18:22;;;11992:42;12051:18;;20693:204:14::1;;;;;;;;;20971:19;20993:28;21009:11;20993:15;:28::i;:::-;21179:1;21148:19:::0;;;:6:::1;:19;::::0;;;;;20971:50;;-1:-1:-1;21148:33:14;21140:66:::1;;;::::0;-1:-1:-1;;;21140:66:14;;12282:2:22;21140:66:14::1;::::0;::::1;12264:21:22::0;12321:2;12301:18;;;12294:30;-1:-1:-1;;;12340:18:22;;;12333:50;12400:18;;21140:66:14::1;12080:344:22::0;21140:66:14::1;21317:23;49727:15:::0;21317:50:::1;;21378:20;21401:36;21418:11;:18;;;21401:16;:36::i;:::-;21378:59;;21842:26;21883:440;;;;;;;;21923:18;21883:440;;;;;;;;:::i;:::-;::::0;;21972:10:::1;21883:440;::::0;::::1;::::0;22009:14:::1;:16:::0;;21883:440;;;;;-1:-1:-1;;;22009:16:14;::::1;;;::::0;:14:::1;:16;::::0;::::1;:::i;:::-;;;;;;;;;;;;;;;;;;;;;21883:440;;;;;;22153:16;-1:-1:-1::0;;;;;21883:440:14::1;;;;;22205:16;21883:440;;;;;;22253:12;21883:440;;;;22293:15;;21883:440;;::::0;21842:481:::1;;22355:28;22373:9;22355:17;:28::i;:::-;22333:19;::::0;;;:6:::1;:19;::::0;;;;:50;;;;22414:37:::1;22428:11:::0;22441:9;22414:13:::1;:37::i;:::-;22394:57;;22795:11;:18;;;22776:15;;22759:14;;:32;;;;:::i;:::-;:54;;22751:92;;;::::0;-1:-1:-1;;;22751:92:14;;13231:2:22;22751:92:14::1;::::0;::::1;13213:21:22::0;13270:2;13250:18;;;13243:30;-1:-1:-1;;;13289:18:22;;;13282:55;13354:18;;22751:92:14::1;13029:349:22::0;22751:92:14::1;22966:17;23001:15;;22986:12;:30;;;;:::i;:::-;22966:50;;23045:11;:18;;;23026:15;;:37;;;;;;;:::i;:::-;;;;;;;;23156:9;23147:5;;:18;;;;;;;:::i;:::-;::::0;;;-1:-1:-1;;23176:7:14::1;::::0;:62:::1;::::0;:7:::1;::::0;::::1;-1:-1:-1::0;;;;;23176:7:14::1;23201:10;23221:4;23228:9:::0;23176:24:::1;:62::i;:::-;23268:11;23253:62;23281:11;23294:9;23305;23253:62;;;;;;;;:::i;:::-;;;;;;;;20459:2863;;;;;;1384:20:10::0;:18;:20::i;:::-;20358:2964:14;;:::o;33018:136::-;33088:7;1317:19:10;:17;:19::i;:::-;1346:17;:15;:17::i;:::-;33114:33:14::1;33145:1;33114:30;:33::i;:::-;33107:40;;1384:20:10::0;:18;:20::i;:::-;33018:136:14;:::o;37632:266::-;37795:12;1603:19:10;:17;:19::i;:::-;37830:61:14::1;37853:37;37867:11;37880:9;37853:13;:37::i;:::-;37830:22;:61::i;:::-;37823:68:::0;37632:266;-1:-1:-1;;;37632:266:14:o;1097:115:12:-;899:3;875:12;-1:-1:-1;;;;;875:12:12;867:37;;;;;;1171:12:::1;::::0;1165:40:::1;::::0;-1:-1:-1;;;1165:40:12;;::::1;::::0;::::1;4405:25:22::0;;;-1:-1:-1;;;;;1171:12:12;;::::1;::::0;1165:34:::1;::::0;4378:18:22;;1165:40:12::1;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;1097:115:::0;:::o;4814:478:0:-;4950:4;4966:36;4976:6;4984:9;4995:6;4966:9;:36::i;:::-;-1:-1:-1;;;;;5040:19:0;;5013:24;5040:19;;;:11;:19;;;;;;;;666:10:5;5040:33:0;;;;;;;;5091:26;;;;5083:79;;;;-1:-1:-1;;;5083:79:0;;15712:2:22;5083:79:0;;;15694:21:22;15751:2;15731:18;;;15724:30;15790:34;15770:18;;;15763:62;-1:-1:-1;;;15841:18:22;;;15834:38;15889:19;;5083:79:0;15510:404:22;5083:79:0;5196:57;5205:6;666:10:5;5246:6:0;5227:16;:25;5196:8;:57::i;:::-;-1:-1:-1;5281:4:0;;4814:478;-1:-1:-1;;;;4814:478:0:o;5687:212::-;666:10:5;5775:4:0;5823:25;;;:11;:25;;;;;;;;-1:-1:-1;;;;;5823:34:0;;;;;;;;;;5775:4;;5791:80;;5814:7;;5823:47;;5860:10;;5823:47;:::i;:::-;5791:8;:80::i;35788:245:14:-;1317:19:10;:17;:19::i;:::-;1346:17;:15;:17::i;:::-;35875:11:14::1;;;;;;;;;-1:-1:-1::0;;;;;35875:11:14::1;-1:-1:-1::0;;;;;35875:27:14::1;;:29;;;;;;;;;;;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;35857:15;;:47;;;;;-1:-1:-1::0;;;;;35857:47:14::1;;;;;-1:-1:-1::0;;;;;35857:47:14::1;;;;;;35941:11;;;;;;;;;-1:-1:-1::0;;;;;35941:11:14::1;-1:-1:-1::0;;;;;35941:36:14::1;;:38;;;;;;;;;;;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;35914:24;;:65;;;;;;;;;;;;;;;;;;36002:11;;;;;;;;;-1:-1:-1::0;;;;;36002:11:14::1;-1:-1:-1::0;;;;;36002:22:14::1;;:24;;;;;;;;;;;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;35989:10;:37:::0;1384:20:10;:18;:20::i;:::-;35788:245:14:o;27271:4941::-;1317:19:10;:17;:19::i;:::-;1346:17;:15;:17::i;:::-;27384:19:14::1;27406:28;27422:11;27406:15;:28::i;:::-;27384:50;;27444:46;27467:11;27480:9;27444:22;:46::i;:::-;27532:18;27508:20:::0;;:42:::1;::::0;::::1;;;;;;:::i;:::-;;27500:70;;;::::0;-1:-1:-1;;;27500:70:14;;16818:2:22;27500:70:14::1;::::0;::::1;16800:21:22::0;16857:2;16837:18;;;16830:30;-1:-1:-1;;;16876:18:22;;;16869:45;16931:18;;27500:70:14::1;16616:339:22::0;27500:70:14::1;27580:21;27633:24;;;;;;;;;;;27604:9;:26;;;:53;;;;:::i;:::-;27580:77:::0;-1:-1:-1;49727:15:14;27675:14:::1;:34;;;;27667:65;;;::::0;-1:-1:-1;;;27667:65:14;;17395:2:22;27667:65:14::1;::::0;::::1;17377:21:22::0;17434:2;17414:18;;;17407:30;-1:-1:-1;;;17453:18:22;;;17446:48;17511:18;;27667:65:14::1;17193:342:22::0;27667:65:14::1;28017:9;:21;;;-1:-1:-1::0;;;;;28003:35:14::1;:10;-1:-1:-1::0;;;;;28003:35:14::1;;:85;;;-1:-1:-1::0;28061:27:14::1;:14:::0;28078:10:::1;28061:27;:::i;:::-;28042:46;;49727:15:::0;28042:46:::1;28003:85;27982:148;;;::::0;-1:-1:-1;;;27982:148:14;;17742:2:22;27982:148:14::1;::::0;::::1;17724:21:22::0;17781:2;17761:18;;;17754:30;-1:-1:-1;;;17800:18:22;;;17793:46;17856:18;;27982:148:14::1;17540:340:22::0;27982:148:14::1;28284:395;::::0;;::::1;::::0;::::1;::::0;;;28253:436:::1;::::0;28284:395;28324:20:::1;28284:395;;;;28375:9;:21;;;-1:-1:-1::0;;;;;28284:395:14::1;;;;;28423:9;:17;;;28284:395;;;;;;28476:9;:26;;;-1:-1:-1::0;;;;;28284:395:14::1;;;;;28538:9;:26;;;28284:395;;;;;;28596:9;:22;;;28284:395;;;;28646:9;:18;;;28284:395;;::::0;28253:17:::1;:436::i;:::-;28231:19;::::0;;;:6:::1;:19;::::0;;;;:458;;;;29656:27:::1;::::0;::::1;::::0;29627:26:::1;::::0;::::1;::::0;29609:95:::1;::::0;29627:56:::1;::::0;::::1;:::i;:::-;29685:11;:18;;;29609:17;:95::i;:::-;29572:11;:18;;;:132;;;;:::i;:::-;29518:186;;29808:24;29835:44;29856:11;29869:9;29835:20;:44::i;:::-;29889:22;29914:31:::0;;;:13:::1;:31;::::0;;;;;30149:10:::1;::::0;29808:71;;-1:-1:-1;;;;;;29914:31:14::1;::::0;30149:10:::1;;:42:::0;::::1;;;-1:-1:-1::0;;;;;;30163:28:14;::::1;::::0;30149:42:::1;30145:566;;;30207:71;30221:11;:23;;;30246:31;30207:13;:71::i;:::-;30145:566;;;30539:172;-1:-1:-1::0;;;;;30577:28:14;::::1;:71;;30625:11;:23;;;30577:71;;;30608:14;30577:71;30539:7;::::0;::::1;::::0;::::1;-1:-1:-1::0;;;;;30539:7:14::1;::::0;30666:31;30539:20:::1;:172::i;:::-;31002:25;31030:66;31048:11;:27;;;31077:11;:18;;;31030:17;:66::i;:::-;31002:94;;31106:17;31147:9;:22;;;31126:9;:18;;;:43;;;;:::i;:::-;31183:21;::::0;::::1;::::0;31106:63;;-1:-1:-1;;;;;;31183:35:14::1;31208:10;31183:35;31179:286;;;31253:21;::::0;::::1;::::0;31232:74:::1;::::0;31276:29:::1;31296:9:::0;31276:17;:29:::1;:::i;:::-;31232:7;::::0;::::1;::::0;::::1;-1:-1:-1::0;;;;;31232:7:14::1;::::0;;:20:::1;:74::i;:::-;31179:286;;;31356:21;::::0;::::1;::::0;31335:7:::1;::::0;:54:::1;::::0;:7:::1;::::0;;::::1;-1:-1:-1::0;;;;;31335:7:14::1;::::0;31379:9;31335:20:::1;:54::i;:::-;31403:7;::::0;:51:::1;::::0;:7:::1;::::0;::::1;-1:-1:-1::0;;;;;31403:7:14::1;31424:10;31436:17:::0;31403:20:::1;:51::i;:::-;31475:25;31503:51;31537:17:::0;31503:31;:51:::1;:::i;:::-;31475:79;;31653:11;:18;;;31634:15;;:37;;;;;;;:::i;:::-;;;;;;;;31699:17;31681:14;;:35;;;;;;;:::i;:::-;;;;;;;;31753:17;31726:16;;:45;;;;;;;:::i;:::-;;;;;;;;31790:9;31781:5;;:18;;;;;;;:::i;:::-;::::0;;;-1:-1:-1;31809:26:14::1;::::0;-1:-1:-1;31809:24:14::1;:26::i;:::-;31845:82;31861:65;31879:9;:26;;;31907:11;:18;;;31861:17;:65::i;:::-;31845:15;:82::i;:::-;31969:10;-1:-1:-1::0;;;;;31943:48:14::1;31956:11;31943:48;31981:9;31943:48;;;;;;:::i;:::-;;;;;;;;-1:-1:-1::0;;;32174:31:14::1;::::0;;;-1:-1:-1;32174:13:14::1;:31;::::0;;;;32167:38;;-1:-1:-1;;;;;;32167:38:14::1;::::0;;-1:-1:-1;1384:20:10;;-1:-1:-1;1384:18:10;;-1:-1:-1;1384:20:10:i;11638:815:14:-;1317:19:10;:17;:19::i;:::-;1346:17;:15;:17::i;:::-;11822:7:14::1;11821:8;:22;;;-1:-1:-1::0;11833:10:14::1;::::0;::::1;;11821:22;11813:48;;;::::0;-1:-1:-1;;;11813:48:14;;18856:2:22;11813:48:14::1;::::0;::::1;18838:21:22::0;18895:2;18875:18;;;18868:30;-1:-1:-1;;;18914:18:22;;;18907:43;18967:18;;11813:48:14::1;18654:337:22::0;11813:48:14::1;11871:24;11941:4;11915:22;:20;:22::i;:::-;11899:38;::::0;:13;:38:::1;:::i;:::-;11898:47;;;;:::i;:::-;11871:74;;12089:16;12071:15;;:34;;;;:::i;:::-;12052:14;;:54;;12044:97;;;::::0;-1:-1:-1;;;12044:97:14;;19725:2:22;12044:97:14::1;::::0;::::1;19707:21:22::0;19764:2;19744:18;;;19737:30;19803:32;19783:18;;;19776:60;19853:18;;12044:97:14::1;19523:354:22::0;12044:97:14::1;12152:32;12158:10;12170:13;12152:5;:32::i;:::-;12212:16;12194:14;;:34;;;;;;;:::i;:::-;::::0;;;-1:-1:-1;;12239:130:14;::::1;;;12252:52;12274:10;12287:16;12252:13;:52::i;:::-;12239:130;;;12319:7;::::0;:50:::1;::::0;:7:::1;::::0;::::1;-1:-1:-1::0;;;;;12319:7:14::1;12340:10;12352:16:::0;12319:20:::1;:50::i;:::-;12385:61;::::0;;11275:25:22;;;11331:2;11316:18;;11309:34;;;12435:10:14::1;::::0;12385:61:::1;::::0;11248:18:22;12385:61:14::1;;;;;;;11722:731;1384:20:10::0;:18;:20::i;10033:965:14:-;1317:19:10;:17;:19::i;:::-;1346:17;:15;:17::i;:::-;10288:10:14::1;::::0;::::1;;:40:::0;::::1;;;;10315:13;10302:9;:26;10288:40;10287:60;;;-1:-1:-1::0;10333:9:14::1;:14:::0;10287:60:::1;10279:100;;;::::0;-1:-1:-1;;;10279:100:14;;20084:2:22;10279:100:14::1;::::0;::::1;20066:21:22::0;20123:2;20103:18;;;20096:30;20162:29;20142:18;;;20135:57;20209:18;;10279:100:14::1;19882:351:22::0;10279:100:14::1;10580:22;10630;:20;:22::i;:::-;10606:20;:13:::0;10622:4:::1;10606:20;:::i;:::-;10605:47;;;;:::i;:::-;10580:72;;10662:33;10668:10;10680:14;10662:5;:33::i;:::-;10723:13;10705:14;;:31;;;;;;;:::i;:::-;::::0;;;-1:-1:-1;;10751:9:14::1;:13:::0;;;;:27:::1;;-1:-1:-1::0;10768:10:14::1;::::0;::::1;;10751:27;10747:171;;;10798:7;;;;;;;;;-1:-1:-1::0;;;;;10798:7:14::1;-1:-1:-1::0;;;;;10780:35:14::1;;10824:9;10780:57;;;;;;;;;;;;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;;10747:171;;;10852:7;::::0;:66:::1;::::0;:7:::1;::::0;::::1;-1:-1:-1::0;;;;;10852:7:14::1;10877:10;10897:4;10904:13:::0;10852:24:::1;:66::i;:::-;10934:57;::::0;;11275:25:22;;;11331:2;11316:18;;11309:34;;;10980:10:14::1;::::0;10934:57:::1;::::0;11248:18:22;10934:57:14::1;;;;;;;10108:890;1384:20:10::0;:18;:20::i;:::-;10033:965:14;:::o;36870:124::-;36940:7;1603:19:10;:17;:19::i;:::-;36966:21:14::1;:19;:21::i;:::-;36959:28;;36870:124:::0;:::o;33501:171::-;33594:7;1317:19:10;:17;:19::i;:::-;1346:17;:15;:17::i;:::-;33620:45:14::1;33651:13;33620:30;:45::i;:::-;33613:52;;1384:20:10::0;:18;:20::i;:::-;33501:171:14;;;:::o;13450:4308::-;1317:19:10;:17;:19::i;:::-;1346:17;:15;:17::i;:::-;13664:23:14::1;49727:15:::0;13664:50:::1;;14001:7;13970:11;:27;;;-1:-1:-1::0;;;;;13970:38:14::1;;;:99;;;;;14062:7;14028:11;:30;;;-1:-1:-1::0;;;;;14028:41:14::1;;;13970:99;:145;;;;;14109:6;14089:16;-1:-1:-1::0;;;;;14089:26:14::1;;;13970:145;13949:204;;;::::0;-1:-1:-1;;;13949:204:14;;11941:2:22;13949:204:14::1;::::0;::::1;11923:21:22::0;11980:2;11960:18;;;11953:30;-1:-1:-1;;;11999:18:22;;;11992:42;12051:18;;13949:204:14::1;11739:336:22::0;13949:204:14::1;14227:19;14249:28;14265:11;14249:15;:28::i;:::-;14435:1;14404:19:::0;;;:6:::1;:19;::::0;;;;;14227:50;;-1:-1:-1;14404:33:14;14396:66:::1;;;::::0;-1:-1:-1;;;14396:66:14;;12282:2:22;14396:66:14::1;::::0;::::1;12264:21:22::0;12321:2;12301:18;;;12294:30;-1:-1:-1;;;12340:18:22;;;12333:50;12400:18;;14396:66:14::1;12080:344:22::0;14396:66:14::1;14473:20;14496:36;14513:11;:18;;;14496:16;:36::i;:::-;14473:59;;14937:26;14978:440;;;;;;;;15018:18;14978:440;;;;;;;;:::i;:::-;::::0;;15067:10:::1;14978:440;::::0;::::1;::::0;15104:14:::1;:16:::0;;14978:440;;;;;-1:-1:-1;;;15104:16:14;::::1;;;::::0;:14:::1;:16;::::0;::::1;:::i;:::-;;;;;;;;;;;;;;;;;;;;;14978:440;;;;;;15248:16;-1:-1:-1::0;;;;;14978:440:14::1;;;;;15300:16;14978:440;;;;;;15348:12;14978:440;;;;15388:15;;14978:440;;::::0;14937:481:::1;;15428:17;15448:37;15462:11;15475:9;15448:13;:37::i;:::-;15428:57;;15517:28;15535:9;15517:17;:28::i;:::-;15495:19;::::0;;;:6:::1;:19;::::0;;;;:50;;;;15583:44:::1;15502:11:::0;15617:9;15583:20:::1;:44::i;:::-;15804:1;15761:31:::0;;;:13:::1;:31;::::0;;;;;15556:71;;-1:-1:-1;;;;;;15761:31:14::1;:45:::0;15637:218:::1;;;::::0;-1:-1:-1;;;15637:218:14;;20440:2:22;15637:218:14::1;::::0;::::1;20422:21:22::0;20479:2;20459:18;;;20452:30;-1:-1:-1;;;20498:18:22;;;20491:53;20561:18;;15637:218:14::1;20238:347:22::0;15637:218:14::1;16199:11;:18;;;16180:15;;16163:14;;:32;;;;:::i;:::-;:54;;16155:92;;;::::0;-1:-1:-1;;;16155:92:14;;13231:2:22;16155:92:14::1;::::0;::::1;13213:21:22::0;13270:2;13250:18;;;13243:30;-1:-1:-1;;;13289:18:22;;;13282:55;13354:18;;16155:92:14::1;13029:349:22::0;16155:92:14::1;16370:17;16405:15;;16390:12;:30;;;;:::i;:::-;16370:50;;16622:17;16654:174;16748:11;:30;;;16718:11;:27;;;16689:9;:26;;;:56;;;;:::i;:::-;:89;;;;:::i;:::-;16796:11;:18;;;16654:17;:174::i;:::-;16622:206;;16954:23;17001:9;16980:11;:18;;;:30;;;;:::i;:::-;16954:56;;17030:9;17021:5;;:18;;;;;;;:::i;:::-;::::0;;;-1:-1:-1;;17068:18:14::1;::::0;::::1;::::0;17049:15:::1;:37:::0;;:15:::1;::::0;:37:::1;::::0;17068:18;;17049:37:::1;:::i;:::-;::::0;;;-1:-1:-1;;17171:31:14::1;::::0;;;:13:::1;:31;::::0;;;;:44;;-1:-1:-1;;;;;;17171:44:14::1;17205:10;17171:44:::0;;::::1;::::0;;;17226:80:::1;::::0;17271:4:::1;17278:27;17296:9:::0;17278:15;:27:::1;:::i;:::-;17226:7;::::0;::::1;::::0;::::1;-1:-1:-1::0;;;;;17226:7:14::1;::::0;;:80;:24:::1;:80::i;:::-;17381:10;::::0;::::1;;17377:234;;;17407:55;17421:11;:23;;;17446:15;17407:13;:55::i;:::-;17377:234;;;17570:23;::::0;::::1;::::0;17549:7:::1;::::0;:62:::1;::::0;:7:::1;::::0;;::::1;-1:-1:-1::0;;;;;17549:7:14::1;::::0;17595:15;17549:20:::1;:62::i;:::-;17642:11;17627:62;17655:11;17668:9;17679;17627:62;;;;;;;;:::i;:::-;;;;;;;;17729:10;-1:-1:-1::0;;;;;17704:47:14::1;17716:11;17704:47;17741:9;17704:47;;;;;;:::i;:::-;;;;;;;;13554:4204;;;;;;;;;1384:20:10::0;:18;:20::i;36325:250:14:-;1317:19:10;:17;:19::i;:::-;1346:17;:15;:17::i;:::-;36436:11:14::1;::::0;-1:-1:-1;;;;;36436:11:14::1;36414:10;:34;36406:43;;;::::0;::::1;;36459:11;:45:::0;;-1:-1:-1;;;;;;36459:45:14::1;-1:-1:-1::0;;;;;36459:45:14;::::1;::::0;;::::1;::::0;;;36519:49:::1;::::0;;36546:10:::1;20802:34:22::0;;20867:2;20852:18;;20845:43;;;;36519:49:14::1;::::0;20737:18:22;36519:49:14::1;;;;;;;1384:20:10::0;:18;:20::i;2295:102:0:-;2351:13;2383:7;2376:14;;;;;:::i;6386:405::-;666:10:5;6479:4:0;6522:25;;;:11;:25;;;;;;;;-1:-1:-1;;;;;6522:34:0;;;;;;;;;;6574:35;;;;6566:85;;;;-1:-1:-1;;;6566:85:0;;21101:2:22;6566:85:0;;;21083:21:22;21140:2;21120:18;;;21113:30;21179:34;21159:18;;;21152:62;-1:-1:-1;;;21230:18:22;;;21223:35;21275:19;;6566:85:0;20899:401:22;6566:85:0;6685:67;666:10:5;6708:7:0;6736:15;6717:16;:34;6685:8;:67::i;:::-;-1:-1:-1;6780:4:0;;6386:405;-1:-1:-1;;;6386:405:0:o;3664:172::-;3750:4;3766:42;666:10:5;3790:9:0;3801:6;3766:9;:42::i;528:710:11:-;596:22;638:9;:14;630:54;;;;-1:-1:-1;;;630:54:11;;21507:2:22;630:54:11;;;21489:21:22;21546:2;21526:18;;;21519:30;21585:29;21565:18;;;21558:57;21632:18;;630:54:11;21305:351:22;630:54:11;716:4;-1:-1:-1;;;;;704:24:11;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;694:34;;743:9;738:494;758:15;;;738:494;;;795:12;;840:4;859;;864:1;859:7;;;;;;;:::i;:::-;;;;;;;;;;;;:::i;:::-;832:35;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;794:73;;;;887:7;882:306;;1014:2;998:6;:13;:18;994:32;;;1018:8;;;994:32;1097:4;1089:6;1085:17;1075:27;;1155:6;1144:28;;;;;;;;;;;;:::i;:::-;1137:36;;-1:-1:-1;;;1137:36:11;;;;;;;;:::i;882:306::-;1215:6;1202:7;1210:1;1202:10;;;;;;;;:::i;:::-;;;;;;:19;;;;780:452;;775:3;;;;;:::i;:::-;;;;738:494;;;;528:710;;;;:::o;34876:457:14:-;1317:19:10;:17;:19::i;:::-;1346:17;:15;:17::i;:::-;34983:11:14::1;::::0;:20:::1;::::0;;-1:-1:-1;;;34983:20:14;;;;34942:22:::1;::::0;-1:-1:-1;;;;;34983:11:14::1;::::0;:18:::1;::::0;:20:::1;::::0;;::::1;::::0;::::1;::::0;;;;;;;;:11;:20;::::1;;::::0;::::1;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;35078:72;::::0;-1:-1:-1;;;35078:72:14;;-1:-1:-1;;;35078:72:14::1;::::0;::::1;4405:25:22::0;34942:62:14;;-1:-1:-1;;;;;;35078:31:14;::::1;::::0;::::1;::::0;4378:18:22;;35078:72:14::1;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;35014:16;:146:::0;;-1:-1:-1;;;;;;35014:146:14::1;-1:-1:-1::0;;;;;35014:146:14;;::::1;;::::0;;35194:55:::1;::::0;-1:-1:-1;;;35194:55:14;;-1:-1:-1;;;35194:55:14::1;::::0;::::1;4405:25:22::0;35194:31:14;;::::1;::::0;::::1;::::0;4378:18:22;;35194:55:14::1;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;35171:5;:79:::0;;-1:-1:-1;;;;;;35171:79:14::1;-1:-1:-1::0;;;;;35171:79:14;;::::1;::::0;;::::1;::::0;;;35308:7:::1;::::0;35278:39:::1;::::0;-1:-1:-1;;;35278:39:14;;35171:79:::1;35308:7:::0;;::::1;::::0;;::::1;35278:39;::::0;::::1;6200:51:22::0;35171:79:14;35278:21:::1;::::0;6173:18:22;;35278:39:14::1;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;:48:::0;35260:15:::1;:66:::0;-1:-1:-1;1384:20:10;:18;:20::i;32710:117:14:-;32772:7;1317:19:10;:17;:19::i;:::-;1346:17;:15;:17::i;:::-;32798:22:14::1;:20;:22::i;24845:1739::-:0;1317:19:10;:17;:19::i;:::-;1346:17;:15;:17::i;:::-;24959:19:14::1;24981:28;24997:11;24981:15;:28::i;:::-;24959:50;;25019:46;25042:11;25055:9;25019:22;:46::i;:::-;25075:24;25102:44;25123:11;25136:9;25102:20;:44::i;:::-;25075:71;;25328:24;;;;;;;;;;;25299:9;:26;;;:53;;;;:::i;:::-;25280:72;;49727:15:::0;25280:72:::1;:134;;;;-1:-1:-1::0;25396:18:14::1;25372:20:::0;;:42:::1;::::0;::::1;;;;;;:::i;:::-;;25280:134;:199;;;;-1:-1:-1::0;25477:1:14::1;25434:31:::0;;;:13:::1;:31;::::0;;;;;-1:-1:-1;;;;;25434:31:14::1;:45:::0;25280:199:::1;25156:372;;;::::0;-1:-1:-1;;;25156:372:14;;20440:2:22;25156:372:14::1;::::0;::::1;20422:21:22::0;20479:2;20459:18;;;20452:30;-1:-1:-1;;;20498:18:22;;;20491:53;20561:18;;25156:372:14::1;20238:347:22::0;25156:372:14::1;25538:31;::::0;;;:13:::1;:31;::::0;;;;:44;;-1:-1:-1;;;;;;25538:44:14::1;25572:10;25538:44;::::0;;25910:30:::1;::::0;::::1;::::0;25880:27:::1;::::0;::::1;::::0;25851:26:::1;::::0;::::1;::::0;25816:174:::1;::::0;25910:30;25851:56:::1;::::0;::::1;:::i;:::-;:89;;;;:::i;25816:174::-;25784:206;;26116:23;26163:9;26142:11;:18;;;:30;;;;:::i;:::-;26186:10;::::0;26116:56;;-1:-1:-1;26186:10:14::1;;26182:332;;;26212:7;::::0;:68:::1;::::0;:7:::1;::::0;::::1;-1:-1:-1::0;;;;;26212:7:14::1;26237:10;26257:4;26264:15:::0;26212:24:::1;:68::i;:::-;26294:55;26308:11;:23;;;26333:15;26294:13;:55::i;:::-;26182:332;;;26473:23;::::0;::::1;::::0;26436:7:::1;::::0;:78:::1;::::0;:7:::1;::::0;;::::1;-1:-1:-1::0;;;;;26436:7:14::1;::::0;26461:10:::1;::::0;26498:15;26436:24:::1;:78::i;:::-;26555:10;-1:-1:-1::0;;;;;26530:47:14::1;26542:11;26530:47;26567:9;26530:47;;;;;;:::i;:::-;;;;;;;;24949:1635;;;;1384:20:10::0;:18;:20::i;18380:1351:14:-;1317:19:10;:17;:19::i;:::-;1346:17;:15;:17::i;:::-;49727:15:14;18531:24:::1;::::0;18502:26:::1;::::0;::::1;::::0;:53:::1;::::0;-1:-1:-1;;;18531:24:14;::::1;;;::::0;18502:53:::1;:::i;:::-;:72;;;18494:98;;;::::0;-1:-1:-1;;;18494:98:14;;24530:2:22;18494:98:14::1;::::0;::::1;24512:21:22::0;24569:2;24549:18;;;24542:30;-1:-1:-1;;;24588:18:22;;;24581:43;24641:18;;18494:98:14::1;24328:337:22::0;18494:98:14::1;18634:18;18610:20:::0;;:42:::1;::::0;::::1;;;;;;:::i;:::-;;18602:69;;;::::0;-1:-1:-1;;;18602:69:14;;24872:2:22;18602:69:14::1;::::0;::::1;24854:21:22::0;24911:2;24891:18;;;24884:30;-1:-1:-1;;;24930:18:22;;;24923:44;24984:18;;18602:69:14::1;24670:338:22::0;18602:69:14::1;18717:19;18739:28;18755:11;18739:15;:28::i;:::-;18717:50;;18777:46;18800:11;18813:9;18777:22;:46::i;:::-;18888:17;18908:37;18922:11;18935:9;18908:13;:37::i;:::-;18888:57;;19067:12;19094:230;19134:9;:21;;;19173:10;19201:9;:22;;;19241:9;:18;;;19277:33;19300:9;19277:22;:33::i;:::-;19094:22;:230::i;:::-;19067:257;;19435:9;:22;;;19414:9;:18;;;:43;;;;:::i;:::-;19405:5;;:52;;;;;;;:::i;:::-;::::0;;;-1:-1:-1;;19486:18:14::1;::::0;::::1;::::0;19467:15:::1;:37:::0;;:15:::1;::::0;:37:::1;::::0;19486:18;;19467:37:::1;:::i;:::-;::::0;;;-1:-1:-1;;19521:19:14::1;::::0;;;:6:::1;:19;::::0;;;;19514:26;19550:174;::::1;;;19625:10;19595:28;19613:9:::0;19595:17:::1;:28::i;:::-;19568:68;::::0;19582:11;;19568:68:::1;::::0;;;::::1;19550:174;;;19713:10;19683:28;19701:9:::0;19683:17:::1;:28::i;:::-;19656:68;::::0;19670:11;;19656:68:::1;::::0;;;::::1;19550:174;18484:1247;;;1384:20:10::0;:18;:20::i;34120:279:14:-;34231:26;34259:28;1317:19:10;:17;:19::i;:::-;1346:17;:15;:17::i;:::-;34311:33:14::1;34342:1;34311:30;:33::i;:::-;34346:45;34377:13;34346:30;:45::i;:::-;34303:89;;;;1384:20:10::0;:18;:20::i;:::-;34120:279:14;;;:::o;32441:62::-;1317:19:10;:17;:19::i;:::-;1346:17;:15;:17::i;:::-;32489:7:14::1;:5;:7::i;:::-;1384:20:10::0;:18;:20::i;9962:370:0:-;-1:-1:-1;;;;;10093:19:0;;10085:68;;;;-1:-1:-1;;;10085:68:0;;25215:2:22;10085:68:0;;;25197:21:22;25254:2;25234:18;;;25227:30;25293:34;25273:18;;;25266:62;-1:-1:-1;;;25344:18:22;;;25337:34;25388:19;;10085:68:0;25013:400:22;10085:68:0;-1:-1:-1;;;;;10171:21:0;;10163:68;;;;-1:-1:-1;;;10163:68:0;;25620:2:22;10163:68:0;;;25602:21:22;25659:2;25639:18;;;25632:30;25698:34;25678:18;;;25671:62;-1:-1:-1;;;25749:18:22;;;25742:32;25791:19;;10163:68:0;25418:398:22;10163:68:0;-1:-1:-1;;;;;10242:18:0;;;;;;;:11;:18;;;;;;;;:27;;;;;;;;;;;;;:36;;;10293:32;;4405:25:22;;;10293:32:0;;4378:18:22;10293:32:0;;;;;;;9962:370;;;:::o;2143:186:10:-;2275:11;;;;2267:55;;;;-1:-1:-1;;;2267:55:10;;26023:2:22;2267:55:10;;;26005:21:22;26062:2;26042:18;;;26035:30;26101:33;26081:18;;;26074:61;26152:18;;2267:55:10;25821:355:22;2335:136:10;2445:11;:19;;-1:-1:-1;;2445:19:10;;;2335:136::o;44659:164:14:-;44806:7;;44774:41;;44738:7;;44774:41;;44785:11;;44806:7;;;-1:-1:-1;;;;;44806:7:14;;44774:41;;;:::i;:::-;;;;;;;;;;;;;44764:52;;;;;;44757:59;;44659:164;;;:::o;44514:139::-;44622:15;;44578:7;;44604:42;;-1:-1:-1;;;44622:15:14;;-1:-1:-1;;;;;44622:15:14;44639:6;44604:17;:42::i;41697:142::-;41774:7;41821:9;41810:21;;;;;;;;:::i;41365:237::-;41470:7;41517:11;41530:9;:17;;;41549:9;:26;;;41585:7;;;;;;;;;-1:-1:-1;;;;;41585:7:14;41506:88;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;41496:99;;;;;;41489:106;;41365:237;;;;:::o;845:241:3:-;1010:68;;-1:-1:-1;;;;;27345:15:22;;;1010:68:3;;;27327:34:22;27397:15;;27377:18;;;27370:43;27429:18;;;27422:34;;;983:96:3;;1003:5;;-1:-1:-1;;;1033:27:3;27262:18:22;;1010:68:3;;;;-1:-1:-1;;1010:68:3;;;;;;;;;;;;;;-1:-1:-1;;;;;1010:68:3;-1:-1:-1;;;;;;1010:68:3;;;;;;;;;;983:19;:96::i;:::-;845:241;;;;:::o;2477:206:10:-;2658:11;:18;;-1:-1:-1;;2658:18:10;2672:4;2658:18;;;2477:206::o;38038:1313:14:-;38119:7;38138;:5;:7::i;:::-;38870:31;38923:1;38904:16;;:20;:52;;38955:1;38904:52;;;38935:16;;38904:52;38870:86;;38966:17;39020:23;39002:15;;38986:13;:31;;;;:::i;:::-;:57;;;;:::i;:::-;38966:77;;39053:19;39092:23;39075:14;;:40;;;;:::i;:::-;39053:62;-1:-1:-1;39204:16:14;39200:33;;-1:-1:-1;39229:4:14;;38038:1313;-1:-1:-1;;;;38038:1313:14:o;39200:33::-;39333:11;39313:16;:9;39325:4;39313:16;:::i;:::-;39312:32;;;;:::i;:::-;39305:39;38038:1313;-1:-1:-1;;;;;38038:1313:14:o;41077:174::-;41150:12;41181:63;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;41181:63:14;;;41234:9;41181:35;:63::i;7265:713:0:-;-1:-1:-1;;;;;7400:20:0;;7392:70;;;;-1:-1:-1;;;7392:70:0;;27669:2:22;7392:70:0;;;27651:21:22;27708:2;27688:18;;;27681:30;27747:34;27727:18;;;27720:62;-1:-1:-1;;;27798:18:22;;;27791:35;27843:19;;7392:70:0;27467:401:22;7392:70:0;-1:-1:-1;;;;;7480:23:0;;7472:71;;;;-1:-1:-1;;;7472:71:0;;28075:2:22;7472:71:0;;;28057:21:22;28114:2;28094:18;;;28087:30;28153:34;28133:18;;;28126:62;-1:-1:-1;;;28204:18:22;;;28197:33;28247:19;;7472:71:0;27873:399:22;7472:71:0;-1:-1:-1;;;;;7636:17:0;;7612:21;7636:17;;;:9;:17;;;;;;7671:23;;;;7663:74;;;;-1:-1:-1;;;7663:74:0;;28479:2:22;7663:74:0;;;28461:21:22;28518:2;28498:18;;;28491:30;28557:34;28537:18;;;28530:62;-1:-1:-1;;;28608:18:22;;;28601:36;28654:19;;7663:74:0;28277:402:22;7663:74:0;-1:-1:-1;;;;;7771:17:0;;;;;;;:9;:17;;;;;;7791:22;;;7771:42;;7833:20;;;;;;;;:30;;7807:6;;7771:17;7833:30;;7807:6;;7833:30;:::i;:::-;;;;;;;;7896:9;-1:-1:-1;;;;;7879:35:0;7888:6;-1:-1:-1;;;;;7879:35:0;;7907:6;7879:35;;;;4405:25:22;;4393:2;4378:18;;4259:177;7879:35:0;;;;;;;;7925:46;48542:279:14;41937:273;42085:28;42103:9;42085:17;:28::i;:::-;42062:19;;;;:6;:19;;;;;;:51;42041:162;;;;;-1:-1:-1;;;42041:162:14;;28886:2:22;42041:162:14;;;28868:21:22;28905:18;;;28898:30;;;;28964:34;28944:18;;;28937:62;29035:34;29015:18;;;29008:62;29087:19;;42041:162:14;28684:428:22;44369:139:14;44450:7;44497:4;44477:16;44487:6;-1:-1:-1;;;;;44477:16:14;;;:::i;:::-;44476:25;;;;:::i;42332:533::-;42433:7;42817:11;42830:9;:26;;;42806:51;;;;;;;;29289:25:22;;;-1:-1:-1;;;;;29350:31:22;29345:2;29330:18;;29323:59;29277:2;29262:18;;29117:271;48542:279:14;-1:-1:-1;;;;;48624:22:14;;1034:20:4;1080:8;48620:195:14;;48664:7;;:32;;:7;;;-1:-1:-1;;;;;48664:7:14;48685:2;48689:6;48664:20;:32::i;48620:195::-;48745:7;;48727:44;;-1:-1:-1;;;48727:44:14;;;;;4405:25:22;;;48745:7:14;;;;-1:-1:-1;;;;;48745:7:14;;48727:36;;4378:18:22;;48727:44:14;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;48785:19:14;;-1:-1:-1;;;;;48785:11:14;;;-1:-1:-1;48785:19:14;;;;;-1:-1:-1;48797:6:14;;48785:19;;;;48797:6;48785:11;:19;;;;;;;;;;;;;;;;;;;;;48542:279;;:::o;634:205:3:-;773:58;;-1:-1:-1;;;;;29585:32:22;;773:58:3;;;29567:51:22;29634:18;;;29627:34;;;746:86:3;;766:5;;-1:-1:-1;;;796:23:3;29540:18:22;;773:58:3;29393:274:22;43529:430:14;43680:34;43717:21;:19;:21::i;:::-;43680:58;;43873:26;43851:19;;:48;;;;:::i;:::-;43829:19;:70;-1:-1:-1;43910:15:14;:42;;-1:-1:-1;;43910:42:14;-1:-1:-1;;;49727:15:14;43910:42;;;;;;43529:430::o;44023:340::-;44288:15;44265:19;;:38;;;;;;;:::i;:::-;;;;;;;;44340:15;44313:16;;:43;;;;;;;:::i;:::-;;;;-1:-1:-1;;;44023:340:14:o;40160:815::-;40210:7;40233:13;3259:12:0;;;3172:106;40233:13:14;40229:35;;-1:-1:-1;40260:4:14;;40160:815::o;40229:35::-;40414:26;:24;:26::i;:::-;40526:7;:5;:7::i;:::-;40729:17;40766:19;;40749:14;;:36;;;;:::i;:::-;40729:56;;40818:1;40799:16;;:20;40795:122;;;40842:16;;40821:38;;;;:::i;:::-;;;40795:122;;;40895:16;;:21;;-1:-1:-1;;40895:21:14;:::i;:::-;40874:43;;;;:::i;:::-;;;40795:122;3259:12:0;;40935:16:14;:9;40947:4;40935:16;:::i;:::-;40934:34;;;;:::i;:::-;40927:41;;;40160:815;:::o;8963:576:0:-;-1:-1:-1;;;;;9046:21:0;;9038:67;;;;-1:-1:-1;;;9038:67:0;;30432:2:22;9038:67:0;;;30414:21:22;30471:2;30451:18;;;30444:30;30510:34;30490:18;;;30483:62;-1:-1:-1;;;30561:18:22;;;30554:31;30602:19;;9038:67:0;30230:397:22;9038:67:0;-1:-1:-1;;;;;9201:18:0;;9176:22;9201:18;;;:9;:18;;;;;;9237:24;;;;9229:71;;;;-1:-1:-1;;;9229:71:0;;30834:2:22;9229:71:0;;;30816:21:22;30873:2;30853:18;;;30846:30;30912:34;30892:18;;;30885:62;-1:-1:-1;;;30963:18:22;;;30956:32;31005:19;;9229:71:0;30632:398:22;9229:71:0;-1:-1:-1;;;;;9334:18:0;;;;;;:9;:18;;;;;9355:23;;;9334:44;;9398:12;:22;;9372:6;;9334:18;9398:22;;9372:6;;9398:22;:::i;:::-;;;;-1:-1:-1;;9436:37:0;;4405:25:22;;;9462:1:0;;-1:-1:-1;;;;;9436:37:0;;;;;4393:2:22;4378:18;9436:37:0;;;;;;;48785:19:14;48542:279;;:::o;8254:389:0:-;-1:-1:-1;;;;;8337:21:0;;8329:65;;;;-1:-1:-1;;;8329:65:0;;31237:2:22;8329:65:0;;;31219:21:22;31276:2;31256:18;;;31249:30;31315:33;31295:18;;;31288:61;31366:18;;8329:65:0;31035:355:22;8329:65:0;8481:6;8465:12;;:22;;;;;;;:::i;:::-;;;;-1:-1:-1;;;;;;;8497:18:0;;;;;;:9;:18;;;;;:28;;8519:6;;8497:18;:28;;8519:6;;8497:28;:::i;:::-;;;;-1:-1:-1;;8540:37:0;;4405:25:22;;;-1:-1:-1;;;;;8540:37:0;;;8557:1;;8540:37;;4393:2:22;4378:18;8540:37:0;;;;;;;20358:2964:14;;:::o;42871:540::-;43278:15;;42925:7;;;;43299:4;;-1:-1:-1;;;43278:15:14;;;;49727;43259:34;;;;:::i;:::-;43237:18;;43215:19;;:40;;43237:18;;;-1:-1:-1;;;;;43237:18:14;;43215:40;:::i;:::-;:79;;;;:::i;:::-;43214:90;;;;:::i;:::-;43173:131;;43342:19;;43321:18;:40;:83;;43385:19;;43321:83;;45065:3354;45270:4;;45306:23;45317:12;45306:8;:23;:::i;:::-;45367:16;;45339:7;;45286:43;;-1:-1:-1;45339:57:14;;45367:16;45339:7;;-1:-1:-1;;;;;45339:7:14;;;;45367:16;45286:43;45339:19;:57::i;:::-;45422:16;;45482:10;;-1:-1:-1;;;;;45422:16:14;;;;:42;;49727:15;45552:19;45596:7;;;;;;;;;-1:-1:-1;;;;;45596:7:14;45804:1;45905:12;46012:24;;;;;;;;;;;46054:8;46177:4;45422:774;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;45422:774:14;;;;;;;;-1:-1:-1;;45422:774:14;;;;;;;;;;;;:::i;:::-;;;45406:1790;;46961:7;;:41;;:7;;;-1:-1:-1;;;;;46961:7:14;46982:8;46992:9;46961:20;:41::i;:::-;47044:16;;47016:7;;:49;;-1:-1:-1;;;;;47044:16:14;47016:7;;;;;;47044:16;;47016:19;:49::i;:::-;47180:5;47173:12;;;;;45406:1790;46263:9;46251;:21;46247:353;;;46385:14;46402:21;46414:9;46402;:21;:::i;:::-;46441:7;;46385:38;;-1:-1:-1;46441:38:14;;:7;;;-1:-1:-1;;;;;46441:7:14;46462:8;46385:38;46441:20;:38::i;:::-;46525:16;;46497:7;;:49;;-1:-1:-1;;;;;46525:16:14;46497:7;;;;;;46525:16;;46497:19;:49::i;:::-;46576:9;46564:21;;46274:326;46247:353;-1:-1:-1;47275:542:14;;;;;;;;-1:-1:-1;;;;;47275:542:14;;;;;-1:-1:-1;47275:542:14;;;;;;47424:7;;;;;;;;47275:542;;;;;;;;;;;;;47504:4;47275:542;;;;;;;;;;47596:24;;47275:542;;;;-1:-1:-1;;;47596:24:14;;;;49727:15;47577:43;;;;:::i;:::-;47275:542;;47646:1;47275:542;;;;;;47675:24;47687:12;47675:9;:24;:::i;:::-;47275:542;;;;;;;;47777:24;;-1:-1:-1;;;47777:24:14;;;;;;47275:542;;;;;;;;47916:7;;47206:611;;-1:-1:-1;47916:62:14;;47777:24;47916:7;;-1:-1:-1;;;;;47916:7:14;;47941:10;;47961:4;;47968:9;;47916:24;:62;:::i;:::-;48016:16;;47988:7;;:57;;-1:-1:-1;;;;;48016:16:14;47988:7;;;;;;48016:16;48035:9;47988:19;:57::i;:::-;48105:16;;48151:10;;48105:207;;-1:-1:-1;;;48105:207:14;;-1:-1:-1;;;;;48105:16:14;;;;:32;;:207;;49727:15;;48213:19;;48246:7;;48267:8;;48297:4;;48105:207;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;-1:-1:-1;48408:4:14;;45065:3354;-1:-1:-1;;;;;;;;45065:3354:14:o;39357:797::-;39659:5;;39624:7;;:32;;-1:-1:-1;;;39624:32:14;;39650:4;39624:32;;;6200:51:22;39599:22:14;;39659:5;39624:7;;;-1:-1:-1;;;;;39624:7:14;;:17;;6173:18:22;;39624:32:14;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;:40;;;;:::i;:::-;39599:65;;39695:14;;39678;:31;39674:474;;;40077:14;;40060:31;;:14;:31;:::i;:::-;40033:16;;:59;;;;;;;:::i;:::-;;;;-1:-1:-1;;40106:14:14;:31;39357:797::o;3140:706:3:-;3559:23;3585:69;3613:4;3585:69;;;;;;;;;;;;;;;;;3593:5;-1:-1:-1;;;;;3585:27:3;;;:69;;;;;:::i;:::-;3668:17;;3559:95;;-1:-1:-1;3668:21:3;3664:176;;3763:10;3752:30;;;;;;;;;;;;:::i;:::-;3744:85;;;;-1:-1:-1;;;3744:85:3;;34850:2:22;3744:85:3;;;34832:21:22;34889:2;34869:18;;;34862:30;34928:34;34908:18;;;34901:62;-1:-1:-1;;;34979:18:22;;;34972:40;35029:19;;3744:85:3;34648:406:22;4121:330:8;4273:12;4297:19;4319:42;4335:20;4357:3;4319:15;:42::i;:::-;4297:64;;4395:20;4417:6;4425:18;4437:5;4425:11;:18::i;:::-;4378:66;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;4371:73;;;4121:330;;;;;:::o;1346:603:3:-;1701:10;;;1700:62;;-1:-1:-1;1717:39:3;;-1:-1:-1;;;1717:39:3;;1741:4;1717:39;;;20802:34:22;-1:-1:-1;;;;;20872:15:22;;;20852:18;;;20845:43;1717:15:3;;;;;20737:18:22;;1717:39:3;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;:44;1700:62;1679:163;;;;-1:-1:-1;;;1679:163:3;;35924:2:22;1679:163:3;;;35906:21:22;35963:2;35943:18;;;35936:30;36002:34;35982:18;;;35975:62;-1:-1:-1;;;36053:18:22;;;36046:52;36115:19;;1679:163:3;35722:418:22;1679:163:3;1879:62;;-1:-1:-1;;;;;29585:32:22;;1879:62:3;;;29567:51:22;29634:18;;;29627:34;;;1852:90:3;;1872:5;;-1:-1:-1;;;1902:22:3;29540:18:22;;1879:62:3;29393:274:22;3461:223:4;3594:12;3625:52;3647:6;3655:4;3661:1;3664:12;3625:21;:52::i;:::-;3618:59;3461:223;-1:-1:-1;;;;3461:223:4:o;6928:295:8:-;7057:27;;7029:12;;7057:31;7053:164;;7133:3;7111:31;;;;;;;;:::i;:::-;;;;;;;;;;;;;7104:38;;;;7053:164;7197:3;7180:26;;;;;;;;:::i;2586:182::-;2647:12;2695:35;2726:3;2715:7;:14;;2695:19;:35::i;:::-;2732:28;2752:7;2732:19;:28::i;:::-;2678:83;;;;;;37319:19:22;;;;37354:12;;37347:28;37391:12;;2678:83:8;;;;;;;;;;;;2671:90;;2586:182;;;:::o;4548:499:4:-;4713:12;4770:5;4745:21;:30;;4737:81;;;;-1:-1:-1;;;4737:81:4;;37616:2:22;4737:81:4;;;37598:21:22;37655:2;37635:18;;;37628:30;37694:34;37674:18;;;37667:62;-1:-1:-1;;;37745:18:22;;;37738:36;37791:19;;4737:81:4;37414:402:22;4737:81:4;1034:20;;4828:60;;;;-1:-1:-1;;;4828:60:4;;38023:2:22;4828:60:4;;;38005:21:22;38062:2;38042:18;;;38035:30;38101:31;38081:18;;;38074:59;38150:18;;4828:60:4;37821:353:22;4828:60:4;4900:12;4914:23;4941:6;-1:-1:-1;;;;;4941:11:4;4960:5;4967:4;4941:31;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4899:73;;;;4989:51;5006:7;5015:10;5027:12;4989:16;:51::i;:::-;4982:58;4548:499;-1:-1:-1;;;;;;;4548:499:4:o;897:1306:8:-;965:7;1008:9;1028:7;1020:16;;1008:28;;1088:1;1092:66;1088:70;1084:74;;1182:1;1186:5;1182:9;1177:1;:15;1196:66;1176:86;1172:90;;1286:1;1290:5;1286:9;1281:1;:15;1300:66;1280:86;1276:90;;1390:1;1394:5;1390:9;1385:1;:15;1404:66;1384:86;1380:90;;1494:1;1498:4;1494:8;1489:1;:14;1507:66;1488:85;1484:89;;1597:1;1601:4;1597:8;1592:1;:14;1610:66;1591:85;1587:89;;1717:9;1804:1;1730;1734:66;1730:70;1729:76;;;;;:::i;:::-;;1906:1;1836:66;1832:70;;1831:76;2008:1;1938:66;1934:70;;1933:76;2037:5;2032:11;2047:4;2031:20;2027:24;;;2054:66;2027:93;;;-1:-1:-1;;;897:1306:8:o;7161:692:4:-;7307:12;7335:7;7331:516;;;-1:-1:-1;7365:10:4;7358:17;;7331:516;7476:17;;:21;7472:365;;7670:10;7664:17;7730:15;7717:10;7713:2;7709:19;7702:44;7472:365;7809:12;7802:20;;-1:-1:-1;;;7802:20:4;;;;;;;;:::i;14:258:22:-;86:1;96:113;110:6;107:1;104:13;96:113;;;186:11;;;180:18;167:11;;;160:39;132:2;125:10;96:113;;;227:6;224:1;221:13;218:48;;;-1:-1:-1;;262:1:22;244:16;;237:27;14:258::o;277:::-;319:3;357:5;351:12;384:6;379:3;372:19;400:63;456:6;449:4;444:3;440:14;433:4;426:5;422:16;400:63;:::i;:::-;517:2;496:15;-1:-1:-1;;492:29:22;483:39;;;;524:4;479:50;;277:258;-1:-1:-1;;277:258:22:o;540:220::-;689:2;678:9;671:21;652:4;709:45;750:2;739:9;735:18;727:6;709:45;:::i;765:131::-;-1:-1:-1;;;;;840:31:22;;830:42;;820:70;;886:1;883;876:12;901:134;969:20;;998:31;969:20;998:31;:::i;1040:315::-;1108:6;1116;1169:2;1157:9;1148:7;1144:23;1140:32;1137:52;;;1185:1;1182;1175:12;1137:52;1224:9;1211:23;1243:31;1268:5;1243:31;:::i;:::-;1293:5;1345:2;1330:18;;;;1317:32;;-1:-1:-1;;;1040:315:22:o;1960:127::-;2021:10;2016:3;2012:20;2009:1;2002:31;2052:4;2049:1;2042:15;2076:4;2073:1;2066:15;2092:248;2159:2;2153:9;2201:4;2189:17;;-1:-1:-1;;;;;2221:34:22;;2257:22;;;2218:62;2215:88;;;2283:18;;:::i;:::-;2319:2;2312:22;2092:248;:::o;2345:129::-;-1:-1:-1;;;;;2423:5:22;2419:30;2412:5;2409:41;2399:69;;2464:1;2461;2454:12;2479:132;2546:20;;2575:30;2546:20;2575:30;:::i;2616:121::-;2701:10;2694:5;2690:22;2683:5;2680:33;2670:61;;2727:1;2724;2717:12;2742:132;2809:20;;2838:30;2809:20;2838:30;:::i;2879:1000::-;2937:5;2967:6;3010:2;2998:9;2993:3;2989:19;2985:28;2982:48;;;3026:1;3023;3016:12;2982:48;3059:2;3053:9;3089:15;;;;-1:-1:-1;;;;;3119:34:22;;3155:22;;;3116:62;3113:88;;;3181:18;;:::i;:::-;3221:10;3217:2;3210:22;3250:6;3241:15;;3293:9;3280:23;3272:6;3265:39;3356:2;3345:9;3341:18;3328:32;3313:47;;3369:32;3393:7;3369:32;:::i;:::-;3434:7;3429:2;3421:6;3417:15;3410:32;3475:38;3509:2;3498:9;3494:18;3475:38;:::i;:::-;3470:2;3462:6;3458:15;3451:63;3547:38;3581:2;3570:9;3566:18;3547:38;:::i;:::-;3542:2;3534:6;3530:15;3523:63;3648:3;3637:9;3633:19;3620:33;3614:3;3606:6;3602:16;3595:59;3688:38;3721:3;3710:9;3706:19;3688:38;:::i;:::-;3682:3;3674:6;3670:16;3663:64;3761:38;3794:3;3783:9;3779:19;3761:38;:::i;:::-;3755:3;3747:6;3743:16;3736:64;3834:38;3867:3;3856:9;3852:19;3834:38;:::i;:::-;3828:3;3820:6;3816:16;3809:64;;;2879:1000;;;;:::o;3884:370::-;3980:6;3988;4041:3;4029:9;4020:7;4016:23;4012:33;4009:53;;;4058:1;4055;4048:12;4009:53;4081:49;4122:7;4111:9;4081:49;:::i;:::-;4071:59;;4180:3;4169:9;4165:19;4152:33;4194:30;4218:5;4194:30;:::i;:::-;4243:5;4233:15;;;3884:370;;;;;:::o;4737:980::-;4861:6;4869;4913:9;4904:7;4900:23;4943:3;4939:2;4935:12;4932:32;;;4960:1;4957;4950:12;4932:32;4983:49;5024:7;5013:9;4983:49;:::i;:::-;4973:59;-1:-1:-1;5067:4:22;-1:-1:-1;;5048:17:22;;5044:28;5041:48;;;5085:1;5082;5075:12;5041:48;;5111:17;;:::i;:::-;5180:3;5169:9;5165:19;5152:33;5216:1;5207:7;5204:14;5194:42;;5232:1;5229;5222:12;5194:42;5245:22;;5299:39;5333:3;5318:19;;5299:39;:::i;:::-;5294:2;5287:5;5283:14;5276:63;5371:38;5404:3;5393:9;5389:19;5371:38;:::i;:::-;5366:2;5359:5;5355:14;5348:62;5442:38;5475:3;5464:9;5460:19;5442:38;:::i;:::-;5437:2;5430:5;5426:14;5419:62;5514:38;5547:3;5536:9;5532:19;5514:38;:::i;:::-;5508:3;5497:15;;5490:63;5614:3;5599:19;;5586:33;5580:3;5569:15;;5562:58;5681:3;5666:19;;;5653:33;5647:3;5636:15;;5629:58;-1:-1:-1;4737:980:22;5501:5;;-1:-1:-1;4737:980:22:o;6510:180::-;6569:6;6622:2;6610:9;6601:7;6597:23;6593:32;6590:52;;;6638:1;6635;6628:12;6590:52;-1:-1:-1;6661:23:22;;6510:180;-1:-1:-1;6510:180:22:o;6695:456::-;6772:6;6780;6788;6841:2;6829:9;6820:7;6816:23;6812:32;6809:52;;;6857:1;6854;6847:12;6809:52;6896:9;6883:23;6915:31;6940:5;6915:31;:::i;:::-;6965:5;-1:-1:-1;7022:2:22;7007:18;;6994:32;7035:33;6994:32;7035:33;:::i;:::-;6695:456;;7087:7;;-1:-1:-1;;;7141:2:22;7126:18;;;;7113:32;;6695:456::o;7345:118::-;7431:5;7424:13;7417:21;7410:5;7407:32;7397:60;;7453:1;7450;7443:12;7468:309;7533:6;7541;7594:2;7582:9;7573:7;7569:23;7565:32;7562:52;;;7610:1;7607;7600:12;7562:52;7646:9;7633:23;7623:33;;7706:2;7695:9;7691:18;7678:32;7719:28;7741:5;7719:28;:::i;7962:247::-;8021:6;8074:2;8062:9;8053:7;8049:23;8045:32;8042:52;;;8090:1;8087;8080:12;8042:52;8129:9;8116:23;8148:31;8173:5;8148:31;:::i;8864:626::-;8961:6;8969;9022:2;9010:9;9001:7;8997:23;8993:32;8990:52;;;9038:1;9035;9028:12;8990:52;9078:9;9065:23;-1:-1:-1;;;;;9148:2:22;9140:6;9137:14;9134:34;;;9164:1;9161;9154:12;9134:34;9202:6;9191:9;9187:22;9177:32;;9247:7;9240:4;9236:2;9232:13;9228:27;9218:55;;9269:1;9266;9259:12;9218:55;9309:2;9296:16;9335:2;9327:6;9324:14;9321:34;;;9351:1;9348;9341:12;9321:34;9404:7;9399:2;9389:6;9386:1;9382:14;9378:2;9374:23;9370:32;9367:45;9364:65;;;9425:1;9422;9415:12;9364:65;9456:2;9448:11;;;;;9478:6;;-1:-1:-1;8864:626:22;;-1:-1:-1;;;;8864:626:22:o;9495:801::-;9655:4;9684:2;9724;9713:9;9709:18;9754:2;9743:9;9736:21;9777:6;9812;9806:13;9843:6;9835;9828:22;9881:2;9870:9;9866:18;9859:25;;9943:2;9933:6;9930:1;9926:14;9915:9;9911:30;9907:39;9893:53;;9981:2;9973:6;9969:15;10002:1;10012:255;10026:6;10023:1;10020:13;10012:255;;;10119:2;10115:7;10103:9;10095:6;10091:22;10087:36;10082:3;10075:49;10147:40;10180:6;10171;10165:13;10147:40;:::i;:::-;10137:50;-1:-1:-1;10245:12:22;;;;10210:15;;;;10048:1;10041:9;10012:255;;;-1:-1:-1;10284:6:22;;9495:801;-1:-1:-1;;;;;;;9495:801:22:o;10708:388::-;10776:6;10784;10837:2;10825:9;10816:7;10812:23;10808:32;10805:52;;;10853:1;10850;10843:12;10805:52;10892:9;10879:23;10911:31;10936:5;10911:31;:::i;:::-;10961:5;-1:-1:-1;11018:2:22;11003:18;;10990:32;11031:33;10990:32;11031:33;:::i;11354:380::-;11433:1;11429:12;;;;11476;;;11497:61;;11551:4;11543:6;11539:17;11529:27;;11497:61;11604:2;11596:6;11593:14;11573:18;11570:38;11567:161;;;11650:10;11645:3;11641:20;11638:1;11631:31;11685:4;11682:1;11675:15;11713:4;11710:1;11703:15;11567:161;;11354:380;;;:::o;12429:127::-;12490:10;12485:3;12481:20;12478:1;12471:31;12521:4;12518:1;12511:15;12545:4;12542:1;12535:15;12561:127;12622:10;12617:3;12613:20;12610:1;12603:31;12653:4;12650:1;12643:15;12677:4;12674:1;12667:15;12693:201;12731:3;12759:10;12804:2;12797:5;12793:14;12831:2;12822:7;12819:15;12816:41;;;12837:18;;:::i;:::-;12886:1;12873:15;;12693:201;-1:-1:-1;;;12693:201:22:o;12899:125::-;12939:4;12967:1;12964;12961:8;12958:34;;;12972:18;;:::i;:::-;-1:-1:-1;13009:9:22;;12899:125::o;13383:128::-;13423:3;13454:1;13450:6;13447:1;13444:13;13441:39;;;13460:18;;:::i;:::-;-1:-1:-1;13496:9:22;;13383:128::o;13516:711::-;13599:5;13593:12;13588:3;13581:25;13652:4;13645:5;13641:16;13635:23;-1:-1:-1;;;;;13745:2:22;13731:12;13727:21;13720:4;13715:3;13711:14;13704:45;13797:4;13790:5;13786:16;13780:23;13758:45;;13839:1;13835;13830:3;13826:11;13822:19;13893:2;13877:14;13873:23;13866:4;13861:3;13857:14;13850:47;13958:2;13950:4;13943:5;13939:16;13933:23;13929:32;13922:4;13917:3;13913:14;13906:56;;14011:4;14004:5;14000:16;13994:23;13987:4;13982:3;13978:14;13971:47;14079:2;14071:4;14064:5;14060:16;14054:23;14050:32;14043:4;14038:3;14034:14;14027:56;14144:2;14136:4;14129:5;14125:16;14119:23;14115:32;14108:4;14103:3;14099:14;14092:56;;;14209:10;14201:4;14194:5;14190:16;14184:23;14180:40;14173:4;14168:3;14164:14;14157:64;13516:711;;:::o;14232:790::-;14311:5;14305:12;14343:1;14339:2;14336:9;14326:140;;14388:10;14383:3;14379:20;14376:1;14369:31;14423:4;14420:1;14413:15;14451:4;14448:1;14441:15;14326:140;14475:15;;14543:4;14532:16;;;14526:23;-1:-1:-1;;;;;14522:49:22;14506:14;;;14499:73;14618:4;14607:16;;;14601:23;;14633:47;;14665:14;;14601:23;4517:10;4506:22;4494:35;;4441:94;14633:47;;14728:4;14721:5;14717:16;14711:23;14743:49;14786:4;14781:3;14777:14;14761;-1:-1:-1;;;;;1713:30:22;1701:43;;1648:102;14743:49;;14840:4;14833:5;14829:16;14823:23;14855:49;14898:4;14893:3;14889:14;14873;4517:10;4506:22;4494:35;;4441:94;14855:49;-1:-1:-1;14953:4:22;14942:16;;;14936:23;14920:14;;;14913:47;15009:4;14998:16;;;14992:23;14976:14;;14969:47;14232:790::o;15027:478::-;15329:3;15314:19;;15342:48;15318:9;15372:6;15342:48;:::i;:::-;15399:56;15450:3;15439:9;15435:19;15427:6;15399:56;:::i;:::-;15492:6;15486:3;15475:9;15471:19;15464:35;15027:478;;;;;;:::o;15919:249::-;15988:6;16041:2;16029:9;16020:7;16016:23;16012:32;16009:52;;;16057:1;16054;16047:12;16009:52;16089:9;16083:16;16108:30;16132:5;16108:30;:::i;16173:249::-;16242:6;16295:2;16283:9;16274:7;16270:23;16266:32;16263:52;;;16311:1;16308;16301:12;16263:52;16343:9;16337:16;16362:30;16386:5;16362:30;:::i;16427:184::-;16497:6;16550:2;16538:9;16529:7;16525:23;16521:32;16518:52;;;16566:1;16563;16556:12;16518:52;-1:-1:-1;16589:16:22;;16427:184;-1:-1:-1;16427:184:22:o;16960:228::-;16999:3;17027:10;17064:2;17061:1;17057:10;17094:2;17091:1;17087:10;17125:3;17121:2;17117:12;17112:3;17109:21;17106:47;;;17133:18;;:::i;:::-;17169:13;;16960:228;-1:-1:-1;;;;16960:228:22:o;17885:236::-;17924:3;-1:-1:-1;;;;;17997:2:22;17994:1;17990:10;18027:2;18024:1;18020:10;18058:3;18054:2;18050:12;18045:3;18042:21;18039:47;;;18066:18;;:::i;18126:265::-;18165:3;18193:9;;;18218:10;;-1:-1:-1;;;;;18237:27:22;;;18230:35;;18214:52;18211:78;;;18269:18;;:::i;:::-;-1:-1:-1;;;18316:19:22;;;18309:27;;18301:36;;18298:62;;;18340:18;;:::i;:::-;-1:-1:-1;;18376:9:22;;18126:265::o;18396:253::-;18584:3;18569:19;;18597:46;18573:9;18625:6;18597:46;:::i;18996:168::-;19036:7;19102:1;19098;19094:6;19090:14;19087:1;19084:21;19079:1;19072:9;19065:17;19061:45;19058:71;;;19109:18;;:::i;:::-;-1:-1:-1;19149:9:22;;18996:168::o;19169:127::-;19230:10;19225:3;19221:20;19218:1;19211:31;19261:4;19258:1;19251:15;19285:4;19282:1;19275:15;19301:217;19341:1;19367;19357:132;;19411:10;19406:3;19402:20;19399:1;19392:31;19446:4;19443:1;19436:15;19474:4;19471:1;19464:15;19357:132;-1:-1:-1;19503:9:22;;19301:217::o;21661:127::-;21722:10;21717:3;21713:20;21710:1;21703:31;21753:4;21750:1;21743:15;21777:4;21774:1;21767:15;21793:521;21870:4;21876:6;21936:11;21923:25;22030:2;22026:7;22015:8;21999:14;21995:29;21991:43;21971:18;21967:68;21957:96;;22049:1;22046;22039:12;21957:96;22076:33;;22128:20;;;-1:-1:-1;;;;;;22160:30:22;;22157:50;;;22203:1;22200;22193:12;22157:50;22236:4;22224:17;;-1:-1:-1;22267:14:22;22263:27;;;22253:38;;22250:58;;;22304:1;22301;22294:12;22250:58;21793:521;;;;;:::o;22319:271::-;22502:6;22494;22489:3;22476:33;22458:3;22528:16;;22553:13;;;22528:16;22319:271;-1:-1:-1;22319:271:22:o;22595:884::-;22675:6;22728:2;22716:9;22707:7;22703:23;22699:32;22696:52;;;22744:1;22741;22734:12;22696:52;22777:9;22771:16;-1:-1:-1;;;;;22847:2:22;22839:6;22836:14;22833:34;;;22863:1;22860;22853:12;22833:34;22901:6;22890:9;22886:22;22876:32;;22946:7;22939:4;22935:2;22931:13;22927:27;22917:55;;22968:1;22965;22958:12;22917:55;22997:2;22991:9;23019:2;23015;23012:10;23009:36;;;23025:18;;:::i;:::-;23100:2;23094:9;23068:2;23154:13;;-1:-1:-1;;23150:22:22;;;23174:2;23146:31;23142:40;23130:53;;;23198:18;;;23218:22;;;23195:46;23192:72;;;23244:18;;:::i;:::-;23284:10;23280:2;23273:22;23319:2;23311:6;23304:18;23359:7;23354:2;23349;23345;23341:11;23337:20;23334:33;23331:53;;;23380:1;23377;23370:12;23331:53;23393:55;23445:2;23440;23432:6;23428:15;23423:2;23419;23415:11;23393:55;:::i;23484:135::-;23523:3;-1:-1:-1;;23544:17:22;;23541:43;;;23564:18;;:::i;:::-;-1:-1:-1;23611:1:22;23600:13;;23484:135::o;23624:251::-;23694:6;23747:2;23735:9;23726:7;23722:23;23718:32;23715:52;;;23763:1;23760;23753:12;23715:52;23795:9;23789:16;23814:31;23839:5;23814:31;:::i;23880:443::-;23976:6;24029:2;24017:9;24008:7;24004:23;24000:32;23997:52;;;24045:1;24042;24035:12;23997:52;24078:2;24072:9;24120:2;24112:6;24108:15;24189:6;24177:10;24174:22;-1:-1:-1;;;;;24141:10:22;24138:34;24135:62;24132:88;;;24200:18;;:::i;:::-;24236:2;24229:22;24275:16;;24260:32;;-1:-1:-1;24267:6:22;23880:443;-1:-1:-1;23880:443:22:o;26181:357::-;26401:3;26386:19;;26414:48;26390:9;26444:6;26414:48;:::i;:::-;-1:-1:-1;;;;;26499:32:22;;;;26493:3;26478:19;;;;26471:61;26181:357;;-1:-1:-1;26181:357:22:o;26543:539::-;26815:3;26800:19;;26828:48;26804:9;26858:6;26828:48;:::i;:::-;26925:10;26913:23;;;;26907:3;26892:19;;26885:52;-1:-1:-1;;;;;26974:31:22;;;;26968:3;26953:19;;26946:60;-1:-1:-1;;;;;27043:32:22;27037:3;27022:19;;;27015:61;26543:539;;-1:-1:-1;26543:539:22:o;29672:553::-;29711:7;-1:-1:-1;;;;;29781:9:22;;;29809;;;29834:11;;;29853:10;;;29847:17;;29830:35;29827:61;;;29868:18;;:::i;:::-;-1:-1:-1;;;29944:1:22;29937:9;;29962:11;;;29982;;;29975:19;;29958:37;29955:63;;;29998:18;;:::i;:::-;30044:1;30041;30037:9;30027:19;;30091:1;30087:2;30082:11;30079:1;30075:19;30070:2;30066;30062:11;30058:37;30055:63;;;30098:18;;:::i;:::-;30163:1;30159:2;30154:11;30151:1;30147:19;30142:2;30138;30134:11;30130:37;30127:63;;;30170:18;;:::i;:::-;-1:-1:-1;;;30210:9:22;;;;;29672:553;-1:-1:-1;;;29672:553:22:o;31395:933::-;31746:4;31775:3;31805:6;31794:9;31787:25;31831:10;31889:2;31881:6;31877:15;31872:2;31861:9;31857:18;31850:43;31929:2;31924;31913:9;31909:18;31902:30;31949:45;31990:2;31979:9;31975:18;31967:6;31949:45;:::i;:::-;-1:-1:-1;;;;;32068:15:22;;;32063:2;32048:18;;32041:43;32115:3;32100:19;;32093:35;;;;32021:3;32144:19;;32137:35;;;;-1:-1:-1;;32209:15:22;;;;32203:3;32188:19;;32181:44;32262:15;;;32256:3;32241:19;;32234:44;32309:3;32294:19;;;32287:35;;;;31941:53;31395:933;-1:-1:-1;;;31395:933:22:o;32522:1599::-;32820:4;32849:3;32879:6;32868:9;32861:25;32934:10;32926:6;32922:23;32917:2;32906:9;32902:18;32895:51;32982:2;32977;32966:9;32962:18;32955:30;33002:45;33043:2;33032:9;33028:18;33020:6;33002:45;:::i;:::-;32994:53;;;33056;33105:2;33094:9;33090:18;33081:6;33075:13;-1:-1:-1;;;;;6011:31:22;5999:44;;5945:104;33056:53;33156:2;33144:15;;33138:22;-1:-1:-1;;;;;6011:31:22;;33217:3;33202:19;;5999:44;-1:-1:-1;33271:2:22;33259:15;;33253:22;-1:-1:-1;;;;;6011:31:22;;33334:3;33319:19;;5999:44;-1:-1:-1;33388:2:22;33376:15;;33370:22;1430:13;;1423:21;33448:3;33433:19;;1411:34;33401:52;33508:3;33500:6;33496:16;33490:23;33484:3;33473:9;33469:19;33462:52;33551:3;33543:6;33539:16;33533:23;33575:3;33614:2;33609;33598:9;33594:18;33587:30;33654:3;33646:6;33642:16;33636:23;33626:33;;33678:3;33717:2;33712;33701:9;33697:18;33690:30;33757:3;33749:6;33745:16;33739:23;33729:33;;33781:3;33820:2;33815;33804:9;33800:18;33793:30;33878:2;33870:6;33866:15;33860:22;33854:3;33843:9;33839:19;33832:51;33938:2;33930:6;33926:15;33920:22;33914:3;33903:9;33899:19;33892:51;33998:2;33990:6;33986:15;33980:22;33974:3;33963:9;33959:19;33952:51;;;;;34012:47;34054:3;34043:9;34039:19;34031:6;-1:-1:-1;;;;;6011:31:22;5999:44;;5945:104;34012:47;-1:-1:-1;;;;;6011:31:22;;34110:3;34095:19;;5999:44;34068:47;5945:104;34126:267;34165:4;34194:9;;;34219:10;;-1:-1:-1;;;34238:19:22;;34231:27;;34215:44;34212:70;;;34262:18;;:::i;:::-;-1:-1:-1;;;;;34309:27:22;;34302:35;;34294:44;;34291:70;;;34341:18;;:::i;:::-;-1:-1:-1;;34378:9:22;;34126:267::o;34398:245::-;34465:6;34518:2;34506:9;34497:7;34493:23;34489:32;34486:52;;;34534:1;34531;34524:12;34486:52;34566:9;34560:16;34585:28;34607:5;34585:28;:::i;35059:658::-;35280:3;35318:6;35312:13;35334:53;35380:6;35375:3;35368:4;35360:6;35356:17;35334:53;:::i;:::-;35450:13;;35409:16;;;;35472:57;35450:13;35409:16;35506:4;35494:17;;35472:57;:::i;:::-;35596:13;;35551:20;;;35618:57;35596:13;35551:20;35652:4;35640:17;;35618:57;:::i;:::-;35691:20;;35059:658;-1:-1:-1;;;;;35059:658:22:o;36145:570::-;-1:-1:-1;;;36501:3:22;36494:16;36476:3;36539:6;36533:13;36555:61;36609:6;36605:1;36600:3;36596:11;36589:4;36581:6;36577:17;36555:61;:::i;:::-;-1:-1:-1;;;36675:1:22;36635:16;;;;36667:10;;;36660:23;-1:-1:-1;36707:1:22;36699:10;;36145:570;-1:-1:-1;36145:570:22:o;36720:437::-;36950:3;36988:6;36982:13;37004:53;37050:6;37045:3;37038:4;37030:6;37026:17;37004:53;:::i;:::-;-1:-1:-1;;;37079:16:22;;37104:18;;;-1:-1:-1;37149:1:22;37138:13;;36720:437;-1:-1:-1;36720:437:22:o;38179:274::-;38308:3;38346:6;38340:13;38362:53;38408:6;38403:3;38396:4;38388:6;38384:17;38362:53;:::i;:::-;38431:16;;;;;38179:274;-1:-1:-1;;38179:274:22:o

Swarm Source

ipfs://1f04c228f886a983407214f2df4617e028d34cc5290037ac60c579286c59f2d5

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ Download: CSV Export  ]

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