ETH Price: $3,589.90 (+3.71%)
 

Overview

Max Total Supply

8,806.255705482134563746 TB-275

Holders

3

Total Transfers

-

Market

Onchain Market Cap

$0.00

Circulating Supply Market Cap

-

Other Info

Token Contract (WITH 18 Decimals)

Loading...
Loading
Loading...
Loading
Loading...
Loading

Click here to update the token information / general information
# Exchange Pair Price  24H Volume % Volume

Contract Source Code Verified (Exact Match)

Contract Name:
TroveBridge

Compiler Version
v0.8.10+commit.fc410830

Optimization Enabled:
Yes with 100000 runs

Other Settings:
default evmVersion
File 1 of 22 : TroveBridge.sol
// SPDX-License-Identifier: Apache-2.0
// Copyright 2022 Aztec.
pragma solidity >=0.8.4;

import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
import {Strings} from "@openzeppelin/contracts/utils/Strings.sol";
import {AztecTypes} from "rollup-encoder/libraries/AztecTypes.sol";
import {IRollupProcessor} from "rollup-encoder/interfaces/IRollupProcessor.sol";
import {BridgeBase} from "../base/BridgeBase.sol";
import {ErrorLib} from "../base/ErrorLib.sol";
import {IWETH} from "../../interfaces/IWETH.sol";
import {IBorrowerOperations} from "../../interfaces/liquity/IBorrowerOperations.sol";
import {ITroveManager} from "../../interfaces/liquity/ITroveManager.sol";
import {ISortedTroves} from "../../interfaces/liquity/ISortedTroves.sol";
import {IUniswapV3SwapCallback} from "../../interfaces/uniswapv3/callback/IUniswapV3SwapCallback.sol";
import {IUniswapV3PoolActions} from "../../interfaces/uniswapv3/pool/IUniswapV3PoolActions.sol";

/**
 * @title Aztec Connect Bridge for opening and closing Liquity's troves
 * @author Jan Benes (@benesjan on Github and Telegram)
 * @notice You can use this contract to borrow and repay LUSD
 * @dev The contract inherits from OpenZeppelin's implementation of ERC20 token because token balances are used to track
 * the depositor's ownership of the assets controlled by the bridge contract. The token is called TroveBridge and
 * the token symbol is TB-[initial ICR] (ICR is an acronym for individual collateral ratio). 1 TB token represents
 * 1 LUSD worth of debt if no redistribution took place (Liquity whitepaper section 4.2). If redistribution took place
 * 1 TB corresponds to more than 1 LUSD. In case the trove is not closed by redemption or liquidation, users can
 * withdraw their collateral by supplying TB and an equal amount of LUSD to the bridge. Alternatively, they supply only
 * TB on input in which case their debt will be repaid with a part their collateral. In case a user supplies both TB and
 * LUSD on input and 1 TB corresponds to more than 1 LUSD part of the ETH collateral withdrawn is swapped to LUSD and
 * the output amount is repaid. This swap is necessary because it's impossible to provide different amounts of
 * _inputAssetA and _inputAssetB. 1 deployment of the bridge contract controls 1 trove. The bridge keeps precise
 * accounting of debt by making sure that no user can change the trove's ICR. This means that when a price goes down
 * the only way how a user can avoid liquidation penalty is to repay their debt.
 *
 * In case the trove gets liquidated, the bridge no longer controls any ETH and all the TB balances are irrelevant.
 * At this point the bridge is defunct (unless owner is the only one who borrowed). If owner is the only who borrowed
 * calling closeTrove() will succeed and owner's balance will get burned, making TB total supply 0.
 *
 * If the trove is closed by redemption, users can withdraw their remaining collateral by supplying their TB.
 *
 * DISCLAIMER: Users are not able to exit the Trove in case the Liquity system is in recovery mode (total CR < 150%).
 * This is because in recovery mode only pure collateral top-up or debt repayment is allowed. This makes exit
 * from this bridge impossible in recovery mode because such exit is always a combination of debt repayment and
 * collateral withdrawal.
 */
contract TroveBridge is BridgeBase, ERC20, Ownable, IUniswapV3SwapCallback {
    using Strings for uint256;

    error NonZeroTotalSupply();
    error InvalidStatus(Status status);
    error InvalidDeltaAmounts();
    error OwnerNotLast();
    error MaxCostExceeded();
    error SwapFailed();

    // Trove status taken from TroveManager.sol
    enum Status {
        nonExistent,
        active,
        closedByOwner,
        closedByLiquidation,
        closedByRedemption
    }

    struct SwapCallbackData {
        uint256 debtToRepay;
        uint256 collToWithdraw;
    }

    address public constant WETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;
    address public constant USDC = 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48;
    address public constant LUSD = 0x5f98805A4E8be255a32880FDeC7F6728C6568bA0;

    IBorrowerOperations public constant BORROWER_OPERATIONS =
        IBorrowerOperations(0x24179CD81c9e782A4096035f7eC97fB8B783e007);
    ITroveManager public constant TROVE_MANAGER = ITroveManager(0xA39739EF8b0231DbFA0DcdA07d7e29faAbCf4bb2);
    ISortedTroves public constant SORTED_TROVES = ISortedTroves(0x8FdD3fbFEb32b28fb73555518f8b361bCeA741A6);

    // Both pools are Uniswap V3 500 bps fee tier pools
    address public constant LUSD_USDC_POOL = 0x4e0924d3a751bE199C426d52fb1f2337fa96f736;
    address public constant USDC_ETH_POOL = 0x88e6A0c2dDD26FEEb64F039a2c41296FcB3f5640;

    // The amount of dust to leave in the contract
    // Optimization based on EIP-1087
    uint256 public constant DUST = 1;

    uint256 public immutable INITIAL_ICR;

    // Price precision
    uint256 public constant PRECISION = 1e18;

    // We are not setting price impact protection and in both swaps zeroForOne is false so sqrtPriceLimitX96
    // is set to TickMath.MAX_SQRT_RATIO - 1 = 1461446703485210103287273052203988822378723970341
    // See https://github.com/Uniswap/v3-periphery/blob/22a7ead071fff53f00d9ddc13434f285f4ed5c7d/contracts/SwapRouter.sol#L187
    // for more information.
    uint160 private constant SQRT_PRICE_LIMIT_X96 = 1461446703485210103287273052203988822378723970341;

    // Used to check whether collateral has already been claimed during redemptions.
    bool private collateralClaimed;

    /**
     * @notice Set the address of RollupProcessor.sol and initial ICR
     * @param _rollupProcessor Address of the RollupProcessor.sol
     * @param _initialICRPerc Collateral ratio denominated in percents to be used when opening the Trove
     */
    constructor(address _rollupProcessor, uint256 _initialICRPerc)
        BridgeBase(_rollupProcessor)
        ERC20("TroveBridge", string(abi.encodePacked("TB-", _initialICRPerc.toString())))
    {
        INITIAL_ICR = _initialICRPerc * 1e16;
        _mint(address(this), DUST);

        // Registering the bridge for subsidy
        uint256[] memory criteria = new uint256[](2);
        uint32[] memory gasUsage = new uint32[](2);
        uint32[] memory minGasPerMinute = new uint32[](2);

        criteria[0] = 0; // Borrow flow
        criteria[1] = 1; // Repay/redeem flow

        gasUsage[0] = 520000;
        gasUsage[1] = 410000;

        // This is approximately 520k / (24 * 60) / 2 --> targeting 1 full subsidized call per 2 days
        minGasPerMinute[0] = 180;

        // This is approximately 410k / (24 * 60) / 4 --> targeting 1 full subsidized call per 4 days
        minGasPerMinute[1] = 70;

        // We set gas usage and minGasPerMinute in the Subsidy contract
        SUBSIDY.setGasUsageAndMinGasPerMinute(criteria, gasUsage, minGasPerMinute);
    }

    receive() external payable {}

    fallback() external payable {}

    /**
     * @notice A function which opens the trove.
     * @param _upperHint Address of a Trove with a position in the sorted list before the correct insert position.
     * @param _lowerHint Address of a Trove with a position in the sorted list after the correct insert position.
     * See https://github.com/liquity/dev#supplying-hints-to-trove-operations for more details about hints.
     * @param _maxFee Maximum borrower fee.
     * @dev Sufficient amount of ETH has to be send so that at least 2000 LUSD gets borrowed. 2000 LUSD is a minimum
     * amount allowed by Liquity.
     */
    function openTrove(address _upperHint, address _lowerHint, uint256 _maxFee) external payable onlyOwner {
        // Checks whether the trove can be safely opened/reopened
        if (totalSupply() != 0) revert NonZeroTotalSupply();

        if (!IERC20(LUSD).approve(ROLLUP_PROCESSOR, type(uint256).max)) revert ErrorLib.ApproveFailed(LUSD);
        if (!this.approve(ROLLUP_PROCESSOR, type(uint256).max)) revert ErrorLib.ApproveFailed(address(this));

        uint256 amtToBorrow = computeAmtToBorrow(msg.value);

        (uint256 debtBefore,,,) = TROVE_MANAGER.getEntireDebtAndColl(address(this));
        BORROWER_OPERATIONS.openTrove{value: msg.value}(_maxFee, amtToBorrow, _upperHint, _lowerHint);
        (uint256 debtAfter,,,) = TROVE_MANAGER.getEntireDebtAndColl(address(this));

        IERC20(LUSD).transfer(msg.sender, IERC20(LUSD).balanceOf(address(this)) - DUST);
        // I mint TB token to msg.sender to be able to track collateral ownership. Minted amount equals debt increase.
        _mint(msg.sender, debtAfter - debtBefore);
    }

    /**
     * @notice A function which allows interaction with this bridge's trove from within Aztec Connect.
     * @dev This method can only be called from the RollupProcessor.sol. If the input asset is ETH, borrowing flow is
     * executed. If TB, repaying. RollupProcessor.sol has to transfer the tokens to the bridge before calling
     * the method. If this is not the case, the function will revert.
     *
     *                            Borrowing        | Repaying        | Repaying (redis.)| Repay. (coll.)| Redeeming
     * @param _inputAssetA -      ETH              | TB              | TB               | TB            | TB
     * @param _inputAssetB -      None             | LUSD            | LUSD             | None          | None
     * @param _outputAssetA -     TB               | ETH             | ETH              | ETH           | ETH
     * @param _outputAssetB -     LUSD             | LUSD            | TB               | None          | None
     * @param _totalInputValue -  ETH amount       | TB and LUSD amt.| TB and LUSD amt. | TB amount     | TB amount
     * @param _interactionNonce - nonce            | nonce           | nonce            | nonce         | nonce
     * @param _auxData -          max borrower fee | 0               | max price        | max price     | 0
     * @param _rollupBeneficiary - Address which receives subsidy if the call is eligible for it
     * @return outputValueA -     TB amount        | ETH amount      | ETH amount       | ETH amount    | ETH amount
     * @return outputValueB -     LUSD amount      | LUSD amount     | TB amount        | 0             | 0
     * @dev The amount of LUSD returned (outputValueB) during repayment will be non-zero only when the trove was
     * partially redeemed.
     */
    function convert(
        AztecTypes.AztecAsset calldata _inputAssetA,
        AztecTypes.AztecAsset calldata _inputAssetB,
        AztecTypes.AztecAsset calldata _outputAssetA,
        AztecTypes.AztecAsset calldata _outputAssetB,
        uint256 _totalInputValue,
        uint256 _interactionNonce,
        uint64 _auxData,
        address _rollupBeneficiary
    ) external payable override(BridgeBase) onlyRollup returns (uint256 outputValueA, uint256 outputValueB, bool) {
        Status troveStatus = Status(TROVE_MANAGER.getTroveStatus(address(this)));

        uint256 subsidyCriteria;

        if (
            _inputAssetA.assetType == AztecTypes.AztecAssetType.ETH
                && _inputAssetB.assetType == AztecTypes.AztecAssetType.NOT_USED
                && _outputAssetA.erc20Address == address(this) && _outputAssetB.erc20Address == LUSD
        ) {
            // Borrowing
            if (troveStatus != Status.active) revert InvalidStatus(troveStatus);
            (outputValueA, outputValueB) = _borrow(_totalInputValue, _auxData);
            subsidyCriteria = 0;
        } else if (
            _inputAssetA.erc20Address == address(this) && _inputAssetB.erc20Address == LUSD
                && _outputAssetA.assetType == AztecTypes.AztecAssetType.ETH
        ) {
            // Repaying
            if (troveStatus != Status.active) revert InvalidStatus(troveStatus);
            if (_outputAssetB.erc20Address == LUSD) {
                // A case when the trove was partially redeemed (1 TB corresponding to less than 1 LUSD of debt) or not
                // redeemed and not touched by redistribution (1 TB corresponding to exactly 1 LUSD of debt)
                (outputValueA, outputValueB) = _repay(_totalInputValue, _interactionNonce);
            } else if (_outputAssetB.erc20Address == address(this)) {
                // A case when the trove was touched by redistribution (1 TB corresponding to more than 1 LUSD of
                // debt). For this reason it was impossible to provide enough LUSD on input since it's not currently
                // allowed to have different input token amounts. Swap part of the collateral to be able to repay
                // the debt in full.
                (outputValueA, outputValueB) = _repayWithCollateral(_totalInputValue, _auxData, _interactionNonce, true);
            } else {
                revert ErrorLib.InvalidOutputB();
            }
            subsidyCriteria = 1;
        } else if (
            _inputAssetA.erc20Address == address(this) && _inputAssetB.assetType == AztecTypes.AztecAssetType.NOT_USED
                && _outputAssetA.assetType == AztecTypes.AztecAssetType.ETH
                && _outputAssetB.assetType == AztecTypes.AztecAssetType.NOT_USED
        ) {
            if (troveStatus == Status.active) {
                // Repaying debt with collateral (using flash swaps)
                (outputValueA,) = _repayWithCollateral(_totalInputValue, _auxData, _interactionNonce, false);
            } else if (troveStatus == Status.closedByRedemption || troveStatus == Status.closedByLiquidation) {
                // Redeeming remaining collateral after the Trove is closed
                outputValueA = _redeem(_totalInputValue, _interactionNonce);
            } else {
                revert InvalidStatus(troveStatus);
            }
            subsidyCriteria = 1;
        } else {
            revert ErrorLib.InvalidInput();
        }

        SUBSIDY.claimSubsidy(subsidyCriteria, _rollupBeneficiary);
    }

    /**
     * @notice A function which closes the trove.
     * @dev LUSD allowance has to be at least (remaining debt - 200 LUSD).
     */
    function closeTrove() external onlyOwner {
        address payable owner = payable(owner());
        uint256 ownerTBBalance = balanceOf(owner);
        if (ownerTBBalance != totalSupply()) revert OwnerNotLast();

        _burn(owner, ownerTBBalance);

        Status troveStatus = Status(TROVE_MANAGER.getTroveStatus(address(this)));
        if (troveStatus == Status.active) {
            (uint256 remainingDebt,,,) = TROVE_MANAGER.getEntireDebtAndColl(address(this));
            // 200e18 is a part of debt which gets repaid from LUSD_GAS_COMPENSATION.
            if (!IERC20(LUSD).transferFrom(owner, address(this), remainingDebt - 200e18)) {
                revert ErrorLib.TransferFailed(LUSD);
            }
            BORROWER_OPERATIONS.closeTrove();
        } else if (troveStatus == Status.closedByRedemption || troveStatus == Status.closedByLiquidation) {
            if (!collateralClaimed) {
                BORROWER_OPERATIONS.claimCollateral();
            } else {
                collateralClaimed = false;
            }
        }

        owner.transfer(address(this).balance);
    }

    // @inheritdoc IUniswapV3SwapCallback
    // @dev See _repayWithCollateral(...) method for more information about how this callback is entered.
    function uniswapV3SwapCallback(int256 _amount0Delta, int256 _amount1Delta, bytes calldata _data)
        external
        override(IUniswapV3SwapCallback)
    {
        // Swaps entirely within 0-liquidity regions are not supported
        if (_amount0Delta <= 0 && _amount1Delta <= 0) revert InvalidDeltaAmounts();
        // Uniswap pools always call callback on msg.sender so this check is enough to prevent malicious behavior
        if (msg.sender == LUSD_USDC_POOL) {
            SwapCallbackData memory data = abi.decode(_data, (SwapCallbackData));
            // Repay debt in full
            (address upperHint, address lowerHint) = _getHints();
            BORROWER_OPERATIONS.adjustTrove(0, data.collToWithdraw, data.debtToRepay, false, upperHint, lowerHint);

            // Pay LUSD_USDC_POOL for the swap by passing it as a recipient to the next swap (WETH -> USDC)
            IUniswapV3PoolActions(USDC_ETH_POOL).swap(
                LUSD_USDC_POOL, // recipient
                false, // zeroForOne
                -_amount1Delta, // amount of USDC to pay to LUSD_USDC_POOL for the swap
                SQRT_PRICE_LIMIT_X96,
                ""
            );
        } else if (msg.sender == USDC_ETH_POOL) {
            // Pay USDC_ETH_POOL for the USDC
            uint256 amountToPay = uint256(_amount1Delta);
            IWETH(WETH).deposit{value: amountToPay}(); // wrap only what is needed to pay
            IWETH(WETH).transfer(address(USDC_ETH_POOL), amountToPay);
        } else {
            revert ErrorLib.InvalidCaller();
        }
    }

    /**
     * @notice Compute how much LUSD to borrow against collateral in order to keep ICR constant and by how much total
     * trove debt will increase.
     * @param _collateral Amount of ETH denominated in Wei
     * @return amtToBorrow Amount of LUSD to borrow to keep ICR constant.
     * + borrowing fee)
     * @dev I don't use view modifier here because the function updates PriceFeed state.
     *
     * Since the Trove opening and adjustment processes have desired amount of LUSD to borrow on the input and not
     * the desired ICR I have to do the computation of borrowing fee "backwards". Here are the operations I did in order
     * to get the final formula:
     *      1) debtIncrease = amtToBorrow + amtToBorrow * BORROWING_RATE / DECIMAL_PRECISION + 200LUSD
     *      2) debtIncrease - 200LUSD = amtToBorrow * (1 + BORROWING_RATE / DECIMAL_PRECISION)
     *      3) amtToBorrow = (debtIncrease - 200LUSD) / (1 + BORROWING_RATE / DECIMAL_PRECISION)
     *      4) amtToBorrow = (debtIncrease - 200LUSD) * DECIMAL_PRECISION / (DECIMAL_PRECISION + BORROWING_RATE)
     * Note1: For trove adjustments (not opening) remove the 200 LUSD fee compensation from the formulas above.
     * Note2: Step 4 is necessary to avoid loss of precision. BORROWING_RATE / DECIMAL_PRECISION was rounded to 0.
     * Note3: The borrowing fee computation is on this line in Liquity code: https://github.com/liquity/dev/blob/cb583ddf5e7de6010e196cfe706bd0ca816ea40e/packages/contracts/contracts/TroveManager.sol#L1433
     */
    function computeAmtToBorrow(uint256 _collateral) public returns (uint256 amtToBorrow) {
        uint256 price = TROVE_MANAGER.priceFeed().fetchPrice();
        if (TROVE_MANAGER.getTroveStatus(address(this)) == 1) {
            // Trove is active - use current ICR and not the initial one
            uint256 icr = TROVE_MANAGER.getCurrentICR(address(this), price);
            amtToBorrow = (_collateral * price) / icr;
        } else {
            // Trove is inactive - I will use initial ICR to compute debt
            // 200e18 - 200 LUSD gas compensation to liquidators
            amtToBorrow = (_collateral * price) / INITIAL_ICR - 200e18;
        }

        if (!TROVE_MANAGER.checkRecoveryMode(price)) {
            // Liquity is not in recovery mode so borrowing fee applies
            uint256 borrowingRate = TROVE_MANAGER.getBorrowingRateWithDecay();
            amtToBorrow = (amtToBorrow * 1e18) / (borrowingRate + 1e18);
        }
    }

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

    /**
     * @notice Borrow LUSD
     * @param _collateral Amount of ETH denominated in Wei
     * @param _maxFee Maximum borrowing fee
     * @return tbMinted Amount of TB minted for borrower.
     * @return lusdBorrowed Amount of LUSD borrowed.
     */
    function _borrow(uint256 _collateral, uint64 _maxFee) private returns (uint256 tbMinted, uint256 lusdBorrowed) {
        lusdBorrowed = computeAmtToBorrow(_collateral); // LUSD amount to borrow
        (uint256 debtBefore,,,) = TROVE_MANAGER.getEntireDebtAndColl(address(this));

        (address upperHint, address lowerHint) = _getHints();
        BORROWER_OPERATIONS.adjustTrove{value: _collateral}(_maxFee, 0, lusdBorrowed, true, upperHint, lowerHint);
        (uint256 debtAfter,,,) = TROVE_MANAGER.getEntireDebtAndColl(address(this));
        // tbMinted = amount of TB to mint = (debtIncrease [LUSD] / debtBefore [LUSD]) * tbTotalSupply
        // debtIncrease = debtAfter - debtBefore
        // In case no redistribution took place (TB/LUSD = 1) then debt_before = TB_total_supply
        // and debt_increase amount of TB is minted.
        // In case there was redistribution, 1 TB corresponds to more than 1 LUSD and the amount of TB minted
        // will be lower than the amount of LUSD borrowed.
        tbMinted = ((debtAfter - debtBefore) * totalSupply()) / debtBefore;
        _mint(address(this), tbMinted);
    }

    /**
     * @notice Repay debt.
     * @param _tbAmount Amount of TB to burn.
     * @param _interactionNonce Same as in convert(...) method.
     * @return collateral Amount of collateral withdrawn.
     * @return lusdReturned Amount of LUSD returned (non-zero only if the trove was partially redeemed)
     */
    function _repay(uint256 _tbAmount, uint256 _interactionNonce)
        private
        returns (uint256 collateral, uint256 lusdReturned)
    {
        (uint256 debtBefore, uint256 collBefore,,) = TROVE_MANAGER.getEntireDebtAndColl(address(this));
        // Compute how much debt to be repay
        uint256 tbTotalSupply = totalSupply(); // SLOAD optimization
        uint256 debtToRepay = (_tbAmount * debtBefore) / tbTotalSupply;
        if (debtToRepay > _tbAmount) revert ErrorLib.InvalidOutputB();

        // Compute how much collateral to withdraw
        uint256 collToWithdraw = (_tbAmount * collBefore) / tbTotalSupply;

        // Repay _totalInputValue of LUSD and withdraw collateral
        (address upperHint, address lowerHint) = _getHints();
        BORROWER_OPERATIONS.adjustTrove(0, collToWithdraw, debtToRepay, false, upperHint, lowerHint);
        lusdReturned = _tbAmount - debtToRepay; // LUSD to return --> 0 unless trove was partially redeemed
        // Burn input TB and return ETH to rollup processor
        collateral = address(this).balance;
        _burn(address(this), _tbAmount);
        IRollupProcessor(ROLLUP_PROCESSOR).receiveEthFromBridge{value: collateral}(_interactionNonce);
    }

    /**
     * @notice Repay debt by selling part of the collateral for LUSD.
     * @param _totalInputValue Amount of TB to burn (and input LUSD to use for repayment if `_lusdInput` param is set
     *                         to true).
     * @param _maxPrice Maximum acceptable price of LUSD denominated in ETH.
     * @param _interactionNonce Same as in convert(...) method.
     * @param _lusdInput If true the debt will be covered by both the LUSD on input and by selling part of the
     *                   collateral. If false the debt will be covered only by selling the collateral.
     * @return collateralReturned Amount of collateral withdrawn.
     * @return tbReturned Amount of TB returned (non-zero only when the flash swap fails)
     * @dev It's important that CR never drops because if the trove was near minimum CR (MCR) the tx would revert.
     *      This would effectively stop users from being able to exit. Unfortunately users are also not able
     *      to exit when Liquity is in recovery mode (total collateral ratio < 150%) because in such a case
     *      only pure collateral top-up or debt repayment is allowed.
     *      To avoid CR from ever dropping bellow MCR I came up with the following construction:
     *        1) Flash swap USDC to LUSD,
     *        2) repay the user's trove debt in full (in the 1st callback),
     *        3) flash swap WETH to USDC with recipient being the LUSD_USDC_POOL - this pays for the first swap,
     *        4) in the 2nd callback deposit part of the withdrawn collateral to WETH and pay for the 2nd swap.
     *      In case the flash swap fails only a part of the debt gets repaid and the remaining TB balance corresponding
     *      to the unpaid debt gets returned.
     *      Note: Since owner is not able to exit until all the TB of everyone else gets burned his funds will be
     *      stuck forever unless the Uniswap pools recover.
     */
    function _repayWithCollateral(
        uint256 _totalInputValue,
        uint256 _maxPrice,
        uint256 _interactionNonce,
        bool _lusdInput
    ) private returns (uint256 collateralReturned, uint256 tbReturned) {
        (uint256 debtBefore, uint256 collBefore,,) = TROVE_MANAGER.getEntireDebtAndColl(address(this));
        // Compute how much debt to be repay
        uint256 tbTotalSupply = totalSupply(); // SLOAD optimization
        uint256 debtToRepay = (_totalInputValue * debtBefore) / tbTotalSupply;
        uint256 collToWithdraw = (_totalInputValue * collBefore) / tbTotalSupply;

        uint256 lusdToBuy;
        if (_lusdInput) {
            // Reverting here because an incorrect flow has been chosen --> there is no reason to be using flash swaps
            // when the amount of LUSD on input is enough to cover the debt
            if (debtToRepay <= _totalInputValue) revert ErrorLib.InvalidOutputB();
            lusdToBuy = debtToRepay - _totalInputValue;
        } else {
            lusdToBuy = debtToRepay;
        }

        // Saving a balance to a local variable to later get a `collateralReturned` value unaffected by a previously
        // held balance --> This is important because if we would set `collateralReturned` to `address(this).balance`
        // the value might be larger than `collToWithdraw` which could cause underflow when computing
        // `collateralSoldToUniswap`
        uint256 ethBalanceBeforeSwap = address(this).balance;

        (bool success,) = LUSD_USDC_POOL.call(
            abi.encodeWithSignature(
                "swap(address,bool,int256,uint160,bytes)",
                address(this), // recipient
                false, // zeroForOne
                -int256(lusdToBuy),
                SQRT_PRICE_LIMIT_X96,
                abi.encode(SwapCallbackData({debtToRepay: debtToRepay, collToWithdraw: collToWithdraw}))
            )
        );

        if (success) {
            // Note: Debt repayment took place in the `uniswapV3SwapCallback(...)` function
            collateralReturned = address(this).balance - ethBalanceBeforeSwap;

            {
                // Check that at most `maxCostInETH` of ETH collateral was sold for `debtToRepay` worth of LUSD
                uint256 maxCostInETH = (lusdToBuy * _maxPrice) / PRECISION;
                uint256 collateralSoldToUniswap = collToWithdraw - collateralReturned;
                if (collateralSoldToUniswap > maxCostInETH) revert MaxCostExceeded();
            }

            // Burn all input TB
            _burn(address(this), _totalInputValue);
        } else if (_lusdInput) {
            // Flash swap failed and some LUSD was provided on input --> repay as much debt as you can with current
            // LUSD balance and return the remaining TB
            debtToRepay = _totalInputValue;
            uint256 tbToBurn = (debtToRepay * tbTotalSupply) / debtBefore;
            collToWithdraw = (tbToBurn * collBefore) / tbTotalSupply;

            {
                // Repay _totalInputValue of LUSD and withdraw collateral
                (address upperHint, address lowerHint) = _getHints();
                BORROWER_OPERATIONS.adjustTrove(0, collToWithdraw, debtToRepay, false, upperHint, lowerHint);
            }

            tbReturned = _totalInputValue - tbToBurn;
            _burn(address(this), tbToBurn);
            collateralReturned = address(this).balance;
        } else {
            revert SwapFailed();
        }

        // Return ETH to rollup processor
        IRollupProcessor(ROLLUP_PROCESSOR).receiveEthFromBridge{value: collateralReturned}(_interactionNonce);
    }

    /**
     * @notice Redeem collateral.
     * @param _tbAmount Amount of TB to burn.
     * @param _interactionNonce Same as in convert(...) method.
     * @return collateral Amount of collateral withdrawn.
     */
    function _redeem(uint256 _tbAmount, uint256 _interactionNonce) private returns (uint256 collateral) {
        if (!collateralClaimed) {
            BORROWER_OPERATIONS.claimCollateral();
            collateralClaimed = true;
        }
        collateral = (address(this).balance * _tbAmount) / totalSupply();
        _burn(address(this), _tbAmount);
        IRollupProcessor(ROLLUP_PROCESSOR).receiveEthFromBridge{value: collateral}(_interactionNonce);
    }

    /**
     * @notice Get lower and upper insertion hints.
     * @return upperHint Upper insertion hint.
     * @return lowerHint Lower insertion hint.
     * @dev See https://github.com/liquity/dev#supplying-hints-to-trove-operations for more details on hints.
     */
    function _getHints() private view returns (address upperHint, address lowerHint) {
        return (SORTED_TROVES.getPrev(address(this)), SORTED_TROVES.getNext(address(this)));
    }
}

File 2 of 22 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)

pragma solidity ^0.8.0;

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

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

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

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

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

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

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
    }

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

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

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

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

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.openzeppelin.com/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:
     *
     * - `to` cannot be the zero address.
     * - the caller must have a balance of at least `amount`.
     */
    function transfer(address to, uint256 amount) public virtual override returns (bool) {
        address owner = _msgSender();
        _transfer(owner, to, 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}.
     *
     * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on
     * `transferFrom`. This is semantically equivalent to an infinite approval.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function approve(address spender, uint256 amount) public virtual override returns (bool) {
        address owner = _msgSender();
        _approve(owner, 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}.
     *
     * NOTE: Does not update the allowance if the current allowance
     * is the maximum `uint256`.
     *
     * Requirements:
     *
     * - `from` and `to` cannot be the zero address.
     * - `from` must have a balance of at least `amount`.
     * - the caller must have allowance for ``from``'s tokens of at least
     * `amount`.
     */
    function transferFrom(
        address from,
        address to,
        uint256 amount
    ) public virtual override returns (bool) {
        address spender = _msgSender();
        _spendAllowance(from, spender, amount);
        _transfer(from, to, 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) {
        address owner = _msgSender();
        _approve(owner, spender, allowance(owner, 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) {
        address owner = _msgSender();
        uint256 currentAllowance = allowance(owner, spender);
        require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
        unchecked {
            _approve(owner, spender, currentAllowance - subtractedValue);
        }

        return true;
    }

    /**
     * @dev Moves `amount` of tokens from `from` to `to`.
     *
     * 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:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `from` must have a balance of at least `amount`.
     */
    function _transfer(
        address from,
        address to,
        uint256 amount
    ) internal virtual {
        require(from != address(0), "ERC20: transfer from the zero address");
        require(to != address(0), "ERC20: transfer to the zero address");

        _beforeTokenTransfer(from, to, amount);

        uint256 fromBalance = _balances[from];
        require(fromBalance >= amount, "ERC20: transfer amount exceeds balance");
        unchecked {
            _balances[from] = fromBalance - amount;
            // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by
            // decrementing then incrementing.
            _balances[to] += amount;
        }

        emit Transfer(from, to, amount);

        _afterTokenTransfer(from, to, 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;
        unchecked {
            // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.
            _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;
            // Overflow not possible: amount <= accountBalance <= totalSupply.
            _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 Updates `owner` s allowance for `spender` based on spent `amount`.
     *
     * Does not update the allowance amount in case of infinite allowance.
     * Revert if not enough allowance is available.
     *
     * Might emit an {Approval} event.
     */
    function _spendAllowance(
        address owner,
        address spender,
        uint256 amount
    ) internal virtual {
        uint256 currentAllowance = allowance(owner, spender);
        if (currentAllowance != type(uint256).max) {
            require(currentAllowance >= amount, "ERC20: insufficient allowance");
            unchecked {
                _approve(owner, spender, currentAllowance - 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 4 of 22 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);

    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the amount of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves `amount` tokens from the caller's account to `to`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address to, uint256 amount) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `from` to `to` using the
     * allowance mechanism. `amount` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address from,
        address to,
        uint256 amount
    ) external returns (bool);
}

File 5 of 22 : IERC20Metadata.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)

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 6 of 22 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;

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

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

File 7 of 22 : Strings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)

pragma solidity ^0.8.0;

import "./math/Math.sol";

/**
 * @dev String operations.
 */
library Strings {
    bytes16 private constant _SYMBOLS = "0123456789abcdef";
    uint8 private constant _ADDRESS_LENGTH = 20;

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        unchecked {
            uint256 length = Math.log10(value) + 1;
            string memory buffer = new string(length);
            uint256 ptr;
            /// @solidity memory-safe-assembly
            assembly {
                ptr := add(buffer, add(32, length))
            }
            while (true) {
                ptr--;
                /// @solidity memory-safe-assembly
                assembly {
                    mstore8(ptr, byte(mod(value, 10), _SYMBOLS))
                }
                value /= 10;
                if (value == 0) break;
            }
            return buffer;
        }
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        unchecked {
            return toHexString(value, Math.log256(value) + 1);
        }
    }

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

    /**
     * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.
     */
    function toHexString(address addr) internal pure returns (string memory) {
        return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);
    }
}

File 8 of 22 : Math.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)

pragma solidity ^0.8.0;

/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library Math {
    enum Rounding {
        Down, // Toward negative infinity
        Up, // Toward infinity
        Zero // Toward zero
    }

    /**
     * @dev Returns the largest of two numbers.
     */
    function max(uint256 a, uint256 b) internal pure returns (uint256) {
        return a > b ? a : b;
    }

    /**
     * @dev Returns the smallest of two numbers.
     */
    function min(uint256 a, uint256 b) internal pure returns (uint256) {
        return a < b ? a : b;
    }

    /**
     * @dev Returns the average of two numbers. The result is rounded towards
     * zero.
     */
    function average(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b) / 2 can overflow.
        return (a & b) + (a ^ b) / 2;
    }

    /**
     * @dev Returns the ceiling of the division of two numbers.
     *
     * This differs from standard division with `/` in that it rounds up instead
     * of rounding down.
     */
    function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b - 1) / b can overflow on addition, so we distribute.
        return a == 0 ? 0 : (a - 1) / b + 1;
    }

    /**
     * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
     * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)
     * with further edits by Uniswap Labs also under MIT license.
     */
    function mulDiv(
        uint256 x,
        uint256 y,
        uint256 denominator
    ) internal pure returns (uint256 result) {
        unchecked {
            // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
            // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
            // variables such that product = prod1 * 2^256 + prod0.
            uint256 prod0; // Least significant 256 bits of the product
            uint256 prod1; // Most significant 256 bits of the product
            assembly {
                let mm := mulmod(x, y, not(0))
                prod0 := mul(x, y)
                prod1 := sub(sub(mm, prod0), lt(mm, prod0))
            }

            // Handle non-overflow cases, 256 by 256 division.
            if (prod1 == 0) {
                return prod0 / denominator;
            }

            // Make sure the result is less than 2^256. Also prevents denominator == 0.
            require(denominator > prod1);

            ///////////////////////////////////////////////
            // 512 by 256 division.
            ///////////////////////////////////////////////

            // Make division exact by subtracting the remainder from [prod1 prod0].
            uint256 remainder;
            assembly {
                // Compute remainder using mulmod.
                remainder := mulmod(x, y, denominator)

                // Subtract 256 bit number from 512 bit number.
                prod1 := sub(prod1, gt(remainder, prod0))
                prod0 := sub(prod0, remainder)
            }

            // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.
            // See https://cs.stackexchange.com/q/138556/92363.

            // Does not overflow because the denominator cannot be zero at this stage in the function.
            uint256 twos = denominator & (~denominator + 1);
            assembly {
                // Divide denominator by twos.
                denominator := div(denominator, twos)

                // Divide [prod1 prod0] by twos.
                prod0 := div(prod0, twos)

                // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
                twos := add(div(sub(0, twos), twos), 1)
            }

            // Shift in bits from prod1 into prod0.
            prod0 |= prod1 * twos;

            // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
            // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
            // four bits. That is, denominator * inv = 1 mod 2^4.
            uint256 inverse = (3 * denominator) ^ 2;

            // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works
            // in modular arithmetic, doubling the correct bits in each step.
            inverse *= 2 - denominator * inverse; // inverse mod 2^8
            inverse *= 2 - denominator * inverse; // inverse mod 2^16
            inverse *= 2 - denominator * inverse; // inverse mod 2^32
            inverse *= 2 - denominator * inverse; // inverse mod 2^64
            inverse *= 2 - denominator * inverse; // inverse mod 2^128
            inverse *= 2 - denominator * inverse; // inverse mod 2^256

            // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
            // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
            // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
            // is no longer required.
            result = prod0 * inverse;
            return result;
        }
    }

    /**
     * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
     */
    function mulDiv(
        uint256 x,
        uint256 y,
        uint256 denominator,
        Rounding rounding
    ) internal pure returns (uint256) {
        uint256 result = mulDiv(x, y, denominator);
        if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {
            result += 1;
        }
        return result;
    }

    /**
     * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.
     *
     * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
     */
    function sqrt(uint256 a) internal pure returns (uint256) {
        if (a == 0) {
            return 0;
        }

        // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
        //
        // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
        // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
        //
        // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
        // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
        // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
        //
        // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
        uint256 result = 1 << (log2(a) >> 1);

        // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
        // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
        // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
        // into the expected uint128 result.
        unchecked {
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            return min(result, a / result);
        }
    }

    /**
     * @notice Calculates sqrt(a), following the selected rounding direction.
     */
    function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = sqrt(a);
            return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 2, rounded down, of a positive value.
     * Returns 0 if given 0.
     */
    function log2(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 128;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 64;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 32;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 16;
            }
            if (value >> 8 > 0) {
                value >>= 8;
                result += 8;
            }
            if (value >> 4 > 0) {
                value >>= 4;
                result += 4;
            }
            if (value >> 2 > 0) {
                value >>= 2;
                result += 2;
            }
            if (value >> 1 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 2, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log2(value);
            return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 10, rounded down, of a positive value.
     * Returns 0 if given 0.
     */
    function log10(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >= 10**64) {
                value /= 10**64;
                result += 64;
            }
            if (value >= 10**32) {
                value /= 10**32;
                result += 32;
            }
            if (value >= 10**16) {
                value /= 10**16;
                result += 16;
            }
            if (value >= 10**8) {
                value /= 10**8;
                result += 8;
            }
            if (value >= 10**4) {
                value /= 10**4;
                result += 4;
            }
            if (value >= 10**2) {
                value /= 10**2;
                result += 2;
            }
            if (value >= 10**1) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 10, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log10(value);
            return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 256, rounded down, of a positive value.
     * Returns 0 if given 0.
     *
     * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
     */
    function log256(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 16;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 8;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 4;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 2;
            }
            if (value >> 8 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 10, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log256(value);
            return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0);
        }
    }
}

File 9 of 22 : IRollupProcessor.sol
// SPDX-License-Identifier: Apache-2.0
// Copyright 2022 Aztec
pragma solidity >=0.8.4;

// @dev For documentation of the functions within this interface see RollupProcessor contract
interface IRollupProcessor {
    /*----------------------------------------
      MUTATING FUNCTIONS
      ----------------------------------------*/

    function pause() external;

    function unpause() external;

    function setRollupProvider(address _provider, bool _valid) external;

    function setVerifier(address _verifier) external;

    function setAllowThirdPartyContracts(bool _allowThirdPartyContracts) external;

    function setDefiBridgeProxy(address _defiBridgeProxy) external;

    function setSupportedAsset(address _token, uint256 _gasLimit) external;

    function setSupportedBridge(address _bridge, uint256 _gasLimit) external;

    function processRollup(bytes calldata _encodedProofData, bytes calldata _signatures) external;

    function receiveEthFromBridge(uint256 _interactionNonce) external payable;

    function approveProof(bytes32 _proofHash) external;

    function depositPendingFunds(uint256 _assetId, uint256 _amount, address _owner, bytes32 _proofHash)
        external
        payable;

    function offchainData(uint256 _rollupId, uint256 _chunk, uint256 _totalChunks, bytes calldata _offchainTxData)
        external;

    function processAsyncDefiInteraction(uint256 _interactionNonce) external returns (bool);

    /*----------------------------------------
      NON-MUTATING FUNCTIONS
      ----------------------------------------*/

    function rollupStateHash() external view returns (bytes32);

    function userPendingDeposits(uint256 _assetId, address _user) external view returns (uint256);

    function defiBridgeProxy() external view returns (address);

    function prevDefiInteractionsHash() external view returns (bytes32);

    function paused() external view returns (bool);

    function verifier() external view returns (address);

    function getDataSize() external view returns (uint256);

    function getPendingDefiInteractionHashesLength() external view returns (uint256);

    function getDefiInteractionHashesLength() external view returns (uint256);

    function getAsyncDefiInteractionHashesLength() external view returns (uint256);

    function getSupportedBridge(uint256 _bridgeAddressId) external view returns (address);

    function getSupportedBridgesLength() external view returns (uint256);

    function getSupportedAssetsLength() external view returns (uint256);

    function getSupportedAsset(uint256 _assetId) external view returns (address);

    function getEscapeHatchStatus() external view returns (bool, uint256);

    function assetGasLimits(uint256 _bridgeAddressId) external view returns (uint256);

    function bridgeGasLimits(uint256 _bridgeAddressId) external view returns (uint256);

    function allowThirdPartyContracts() external view returns (bool);
}

File 10 of 22 : AztecTypes.sol
// SPDX-License-Identifier: Apache-2.0
// Copyright 2022 Aztec
pragma solidity >=0.8.4;

library AztecTypes {
    enum AztecAssetType {
        NOT_USED,
        ETH,
        ERC20,
        VIRTUAL
    }

    struct AztecAsset {
        uint256 id;
        address erc20Address;
        AztecAssetType assetType;
    }
}

File 11 of 22 : IDefiBridge.sol
// SPDX-License-Identifier: Apache-2.0
// Copyright 2022 Aztec
pragma solidity >=0.8.4;

import {AztecTypes} from "rollup-encoder/libraries/AztecTypes.sol";

interface IDefiBridge {
    /**
     * @notice A function which converts input assets to output assets.
     * @param _inputAssetA A struct detailing the first input asset
     * @param _inputAssetB A struct detailing the second input asset
     * @param _outputAssetA A struct detailing the first output asset
     * @param _outputAssetB A struct detailing the second output asset
     * @param _totalInputValue An amount of input assets transferred to the bridge (Note: "total" is in the name
     *                         because the value can represent summed/aggregated token amounts of users actions on L2)
     * @param _interactionNonce A globally unique identifier of this interaction/`convert(...)` call.
     * @param _auxData Bridge specific data to be passed into the bridge contract (e.g. slippage, nftID etc.)
     * @return outputValueA An amount of `_outputAssetA` returned from this interaction.
     * @return outputValueB An amount of `_outputAssetB` returned from this interaction.
     * @return isAsync A flag indicating if the interaction is async.
     * @dev This function is called from the RollupProcessor contract via the DefiBridgeProxy. Before this function is
     *      called _RollupProcessor_ contract will have sent you all the assets defined by the input params. This
     *      function is expected to convert input assets to output assets (e.g. on Uniswap) and return the amounts
     *      of output assets to be received by the _RollupProcessor_. If output assets are ERC20 tokens the bridge has
     *      to _RollupProcessor_ as a spender before the interaction is finished. If some of the output assets is ETH
     *      it has to be sent to _RollupProcessor_ via the `receiveEthFromBridge(uint256 _interactionNonce)` method
     *      inside before the `convert(...)` function call finishes.
     * @dev If there are two input assets, equal amounts of both assets will be transferred to the bridge before this
     *      method is called.
     * @dev **BOTH** output assets could be virtual but since their `assetId` is currently assigned as
     *      `_interactionNonce` it would simply mean that more of the same virtual asset is minted.
     * @dev If this interaction is async the function has to return `(0,0 true)`. Async interaction will be finalised at
     *      a later time and its output assets will be returned in a `IDefiBridge.finalise(...)` call.
     *
     */
    function convert(
        AztecTypes.AztecAsset calldata _inputAssetA,
        AztecTypes.AztecAsset calldata _inputAssetB,
        AztecTypes.AztecAsset calldata _outputAssetA,
        AztecTypes.AztecAsset calldata _outputAssetB,
        uint256 _totalInputValue,
        uint256 _interactionNonce,
        uint64 _auxData,
        address _rollupBeneficiary
    ) external payable returns (uint256 outputValueA, uint256 outputValueB, bool isAsync);

    /**
     * @notice A function that finalises asynchronous interaction.
     * @param _inputAssetA A struct detailing the first input asset
     * @param _inputAssetB A struct detailing the second input asset
     * @param _outputAssetA A struct detailing the first output asset
     * @param _outputAssetB A struct detailing the second output asset
     * @param _interactionNonce A globally unique identifier of this interaction/`convert(...)` call.
     * @param _auxData Bridge specific data to be passed into the bridge contract (e.g. slippage, nftID etc.)
     * @return outputValueA An amount of `_outputAssetA` returned from this interaction.
     * @return outputValueB An amount of `_outputAssetB` returned from this interaction.
     * @dev This function should use the `BridgeBase.onlyRollup()` modifier to ensure it can only be called from
     *      the `RollupProcessor.processAsyncDefiInteraction(uint256 _interactionNonce)` method.
     *
     */
    function finalise(
        AztecTypes.AztecAsset calldata _inputAssetA,
        AztecTypes.AztecAsset calldata _inputAssetB,
        AztecTypes.AztecAsset calldata _outputAssetA,
        AztecTypes.AztecAsset calldata _outputAssetB,
        uint256 _interactionNonce,
        uint64 _auxData
    ) external payable returns (uint256 outputValueA, uint256 outputValueB, bool interactionComplete);
}

File 12 of 22 : ISubsidy.sol
// SPDX-License-Identifier: Apache-2.0
// Copyright 2022 Aztec
pragma solidity >=0.8.4;

// @dev documentation of this interface is in its implementation (Subsidy contract)
interface ISubsidy {
    /**
     * @notice Container for Subsidy related information
     * @member available Amount of ETH remaining to be paid out
     * @member gasUsage Amount of gas the interaction consumes (used to define max possible payout)
     * @member minGasPerMinute Minimum amount of gas per minute the subsidizer has to subsidize
     * @member gasPerMinute Amount of gas per minute the subsidizer is willing to subsidize
     * @member lastUpdated Last time subsidy was paid out or funded (if not subsidy was yet claimed after funding)
     */
    struct Subsidy {
        uint128 available;
        uint32 gasUsage;
        uint32 minGasPerMinute;
        uint32 gasPerMinute;
        uint32 lastUpdated;
    }

    function setGasUsageAndMinGasPerMinute(uint256 _criteria, uint32 _gasUsage, uint32 _minGasPerMinute) external;

    function setGasUsageAndMinGasPerMinute(
        uint256[] calldata _criteria,
        uint32[] calldata _gasUsage,
        uint32[] calldata _minGasPerMinute
    ) external;

    function registerBeneficiary(address _beneficiary) external;

    function subsidize(address _bridge, uint256 _criteria, uint32 _gasPerMinute) external payable;

    function topUp(address _bridge, uint256 _criteria) external payable;

    function claimSubsidy(uint256 _criteria, address _beneficiary) external returns (uint256);

    function withdraw(address _beneficiary) external returns (uint256);

    // solhint-disable-next-line
    function MIN_SUBSIDY_VALUE() external view returns (uint256);

    function claimableAmount(address _beneficiary) external view returns (uint256);

    function isRegistered(address _beneficiary) external view returns (bool);

    function getSubsidy(address _bridge, uint256 _criteria) external view returns (Subsidy memory);

    function getAccumulatedSubsidyAmount(address _bridge, uint256 _criteria) external view returns (uint256);
}

File 13 of 22 : BridgeBase.sol
// SPDX-License-Identifier: Apache-2.0
// Copyright 2022 Aztec.
pragma solidity >=0.8.4;

import {IDefiBridge} from "../../aztec/interfaces/IDefiBridge.sol";
import {ISubsidy} from "../../aztec/interfaces/ISubsidy.sol";
import {AztecTypes} from "rollup-encoder/libraries/AztecTypes.sol";
import {ErrorLib} from "./ErrorLib.sol";

/**
 * @title BridgeBase
 * @notice A base that bridges can be built upon which imports a limited set of features
 * @dev Reverts `convert` with missing implementation, and `finalise` with async disabled
 * @author Lasse Herskind
 */
abstract contract BridgeBase is IDefiBridge {
    error MissingImplementation();

    ISubsidy public constant SUBSIDY = ISubsidy(0xABc30E831B5Cc173A9Ed5941714A7845c909e7fA);
    address public immutable ROLLUP_PROCESSOR;

    constructor(address _rollupProcessor) {
        ROLLUP_PROCESSOR = _rollupProcessor;
    }

    modifier onlyRollup() {
        if (msg.sender != ROLLUP_PROCESSOR) {
            revert ErrorLib.InvalidCaller();
        }
        _;
    }

    function convert(
        AztecTypes.AztecAsset calldata,
        AztecTypes.AztecAsset calldata,
        AztecTypes.AztecAsset calldata,
        AztecTypes.AztecAsset calldata,
        uint256,
        uint256,
        uint64,
        address
    ) external payable virtual override(IDefiBridge) returns (uint256, uint256, bool) {
        revert MissingImplementation();
    }

    function finalise(
        AztecTypes.AztecAsset calldata,
        AztecTypes.AztecAsset calldata,
        AztecTypes.AztecAsset calldata,
        AztecTypes.AztecAsset calldata,
        uint256,
        uint64
    ) external payable virtual override(IDefiBridge) returns (uint256, uint256, bool) {
        revert ErrorLib.AsyncDisabled();
    }

    /**
     * @notice Computes the criteria that is passed on to the subsidy contract when claiming
     * @dev Should be overridden by bridge implementation if intended to limit subsidy.
     * @return The criteria to be passed along
     */
    function computeCriteria(
        AztecTypes.AztecAsset calldata,
        AztecTypes.AztecAsset calldata,
        AztecTypes.AztecAsset calldata,
        AztecTypes.AztecAsset calldata,
        uint64
    ) public view virtual returns (uint256) {
        return 0;
    }
}

File 14 of 22 : ErrorLib.sol
// SPDX-License-Identifier: Apache-2.0
// Copyright 2022 Aztec.
pragma solidity >=0.8.4;

library ErrorLib {
    error InvalidCaller();

    error InvalidInput();
    error InvalidInputA();
    error InvalidInputB();
    error InvalidOutputA();
    error InvalidOutputB();
    error InvalidInputAmount();
    error InvalidAuxData();

    error ApproveFailed(address token);
    error TransferFailed(address token);

    error InvalidNonce();
    error AsyncDisabled();
}

File 15 of 22 : IWETH.sol
// SPDX-License-Identifier: Apache-2.0
// Copyright 2022 Aztec.
pragma solidity >=0.8.4;

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

interface IWETH is IERC20 {
    function deposit() external payable;

    function withdraw(uint256 amount) external;
}

File 16 of 22 : IBorrowerOperations.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.4;

interface IBorrowerOperations {
    function openTrove(uint256 _maxFee, uint256 _LUSDAmount, address _upperHint, address _lowerHint) external payable;

    function closeTrove() external;

    function adjustTrove(
        uint256 _maxFee,
        uint256 _collWithdrawal,
        uint256 _debtChange,
        bool isDebtIncrease,
        address _upperHint,
        address _lowerHint
    ) external payable;

    function withdrawColl(uint256 _amount, address _upperHint, address _lowerHint) external;

    function claimCollateral() external;
}

File 17 of 22 : ILiquityBase.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.4;

import {IPriceFeed} from "./IPriceFeed.sol";

interface ILiquityBase {
    function priceFeed() external view returns (IPriceFeed);
}

File 18 of 22 : IPriceFeed.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.4;

interface IPriceFeed {
    function fetchPrice() external returns (uint256);
}

File 19 of 22 : ISortedTroves.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.4;

interface ISortedTroves {
    function getLast() external view returns (address);

    function getNext(address _id) external view returns (address);

    function getPrev(address _id) external view returns (address);

    function findInsertPosition(uint256 _ICR, address _prevId, address _nextId)
        external
        view
        returns (address, address);
}

File 20 of 22 : ITroveManager.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.4;

import {ILiquityBase} from "./ILiquityBase.sol";

// Common interface for the Trove Manager.
interface ITroveManager is ILiquityBase {
    function getCurrentICR(address _borrower, uint256 _price) external view returns (uint256);

    function liquidate(address _borrower) external;

    function liquidateTroves(uint256 _n) external;

    function redeemCollateral(
        uint256 _LUSDAmount,
        address _firstRedemptionHint,
        address _upperPartialRedemptionHint,
        address _lowerPartialRedemptionHint,
        uint256 _partialRedemptionHintNICR,
        uint256 _maxIterations,
        uint256 _maxFee
    ) external;

    function getEntireDebtAndColl(address _borrower)
        external
        view
        returns (uint256 debt, uint256 coll, uint256 pendingLUSDDebtReward, uint256 pendingETHReward);

    function closeTrove(address _borrower) external;

    function getBorrowingRateWithDecay() external view returns (uint256);

    function getTroveStatus(address _borrower) external view returns (uint256);

    function getTCR(uint256 _price) external view returns (uint256);

    function checkRecoveryMode(uint256 _price) external view returns (bool);
}

File 21 of 22 : IUniswapV3SwapCallback.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;

/// @title Callback for IUniswapV3PoolActions#swap
/// @notice Any contract that calls IUniswapV3PoolActions#swap must implement this interface
interface IUniswapV3SwapCallback {
    /// @notice Called to `msg.sender` after executing a swap via IUniswapV3Pool#swap.
    /// @dev In the implementation you must pay the pool tokens owed for the swap.
    /// The caller of this method must be checked to be a UniswapV3Pool deployed by the canonical UniswapV3Factory.
    /// amount0Delta and amount1Delta can both be 0 if no tokens were swapped.
    /// @param amount0Delta The amount of token0 that was sent (negative) or must be received (positive) by the pool by
    /// the end of the swap. If positive, the callback must send that amount of token0 to the pool.
    /// @param amount1Delta The amount of token1 that was sent (negative) or must be received (positive) by the pool by
    /// the end of the swap. If positive, the callback must send that amount of token1 to the pool.
    /// @param data Any data passed through by the caller via the IUniswapV3PoolActions#swap call
    function uniswapV3SwapCallback(int256 amount0Delta, int256 amount1Delta, bytes calldata data) external;
}

File 22 of 22 : IUniswapV3PoolActions.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;

/// @title Permissionless pool actions
/// @notice Contains pool methods that can be called by anyone
interface IUniswapV3PoolActions {
    /// @notice Sets the initial price for the pool
    /// @dev Price is represented as a sqrt(amountToken1/amountToken0) Q64.96 value
    /// @param sqrtPriceX96 the initial sqrt price of the pool as a Q64.96
    function initialize(uint160 sqrtPriceX96) external;

    /// @notice Adds liquidity for the given recipient/tickLower/tickUpper position
    /// @dev The caller of this method receives a callback in the form of IUniswapV3MintCallback#uniswapV3MintCallback
    /// in which they must pay any token0 or token1 owed for the liquidity. The amount of token0/token1 due depends
    /// on tickLower, tickUpper, the amount of liquidity, and the current price.
    /// @param recipient The address for which the liquidity will be created
    /// @param tickLower The lower tick of the position in which to add liquidity
    /// @param tickUpper The upper tick of the position in which to add liquidity
    /// @param amount The amount of liquidity to mint
    /// @param data Any data that should be passed through to the callback
    /// @return amount0 The amount of token0 that was paid to mint the given amount of liquidity. Matches the value in the callback
    /// @return amount1 The amount of token1 that was paid to mint the given amount of liquidity. Matches the value in the callback
    function mint(address recipient, int24 tickLower, int24 tickUpper, uint128 amount, bytes calldata data)
        external
        returns (uint256 amount0, uint256 amount1);

    /// @notice Collects tokens owed to a position
    /// @dev Does not recompute fees earned, which must be done either via mint or burn of any amount of liquidity.
    /// Collect must be called by the position owner. To withdraw only token0 or only token1, amount0Requested or
    /// amount1Requested may be set to zero. To withdraw all tokens owed, caller may pass any value greater than the
    /// actual tokens owed, e.g. type(uint128).max. Tokens owed may be from accumulated swap fees or burned liquidity.
    /// @param recipient The address which should receive the fees collected
    /// @param tickLower The lower tick of the position for which to collect fees
    /// @param tickUpper The upper tick of the position for which to collect fees
    /// @param amount0Requested How much token0 should be withdrawn from the fees owed
    /// @param amount1Requested How much token1 should be withdrawn from the fees owed
    /// @return amount0 The amount of fees collected in token0
    /// @return amount1 The amount of fees collected in token1
    function collect(
        address recipient,
        int24 tickLower,
        int24 tickUpper,
        uint128 amount0Requested,
        uint128 amount1Requested
    ) external returns (uint128 amount0, uint128 amount1);

    /// @notice Burn liquidity from the sender and account tokens owed for the liquidity to the position
    /// @dev Can be used to trigger a recalculation of fees owed to a position by calling with an amount of 0
    /// @dev Fees must be collected separately via a call to #collect
    /// @param tickLower The lower tick of the position for which to burn liquidity
    /// @param tickUpper The upper tick of the position for which to burn liquidity
    /// @param amount How much liquidity to burn
    /// @return amount0 The amount of token0 sent to the recipient
    /// @return amount1 The amount of token1 sent to the recipient
    function burn(int24 tickLower, int24 tickUpper, uint128 amount)
        external
        returns (uint256 amount0, uint256 amount1);

    /// @notice Swap token0 for token1, or token1 for token0
    /// @dev The caller of this method receives a callback in the form of IUniswapV3SwapCallback#uniswapV3SwapCallback
    /// @param recipient The address to receive the output of the swap
    /// @param zeroForOne The direction of the swap, true for token0 to token1, false for token1 to token0
    /// @param amountSpecified The amount of the swap, which implicitly configures the swap as exact input (positive), or exact output (negative)
    /// @param sqrtPriceLimitX96 The Q64.96 sqrt price limit. If zero for one, the price cannot be less than this
    /// value after the swap. If one for zero, the price cannot be greater than this value after the swap
    /// @param data Any data to be passed through to the callback
    /// @return amount0 The delta of the balance of token0 of the pool, exact when negative, minimum when positive
    /// @return amount1 The delta of the balance of token1 of the pool, exact when negative, minimum when positive
    function swap(
        address recipient,
        bool zeroForOne,
        int256 amountSpecified,
        uint160 sqrtPriceLimitX96,
        bytes calldata data
    ) external returns (int256 amount0, int256 amount1);

    /// @notice Receive token0 and/or token1 and pay it back, plus a fee, in the callback
    /// @dev The caller of this method receives a callback in the form of IUniswapV3FlashCallback#uniswapV3FlashCallback
    /// @dev Can be used to donate underlying tokens pro-rata to currently in-range liquidity providers by calling
    /// with 0 amount{0,1} and sending the donation amount(s) from the callback
    /// @param recipient The address which will receive the token0 and token1 amounts
    /// @param amount0 The amount of token0 to send
    /// @param amount1 The amount of token1 to send
    /// @param data Any data to be passed through to the callback
    function flash(address recipient, uint256 amount0, uint256 amount1, bytes calldata data) external;

    /// @notice Increase the maximum number of price and liquidity observations that this pool will store
    /// @dev This method is no-op if the pool already has an observationCardinalityNext greater than or equal to
    /// the input observationCardinalityNext.
    /// @param observationCardinalityNext The desired minimum number of observations for the pool to store
    function increaseObservationCardinalityNext(uint16 observationCardinalityNext) external;
}

Settings
{
  "remappings": [
    "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
    "ds-test/=lib/forge-std/lib/ds-test/src/",
    "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
    "forge-std/=lib/forge-std/src/",
    "openzeppelin-contracts/=lib/openzeppelin-contracts/contracts/",
    "rollup-encoder/=lib/rollup-encoder/src/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 100000
  },
  "metadata": {
    "bytecodeHash": "ipfs"
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "london",
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_rollupProcessor","type":"address"},{"internalType":"uint256","name":"_initialICRPerc","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"ApproveFailed","type":"error"},{"inputs":[],"name":"AsyncDisabled","type":"error"},{"inputs":[],"name":"InvalidCaller","type":"error"},{"inputs":[],"name":"InvalidDeltaAmounts","type":"error"},{"inputs":[],"name":"InvalidInput","type":"error"},{"inputs":[],"name":"InvalidOutputB","type":"error"},{"inputs":[{"internalType":"enum TroveBridge.Status","name":"status","type":"uint8"}],"name":"InvalidStatus","type":"error"},{"inputs":[],"name":"MaxCostExceeded","type":"error"},{"inputs":[],"name":"MissingImplementation","type":"error"},{"inputs":[],"name":"NonZeroTotalSupply","type":"error"},{"inputs":[],"name":"OwnerNotLast","type":"error"},{"inputs":[],"name":"SwapFailed","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"TransferFailed","type":"error"},{"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":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"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"},{"stateMutability":"payable","type":"fallback"},{"inputs":[],"name":"BORROWER_OPERATIONS","outputs":[{"internalType":"contract IBorrowerOperations","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DUST","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"INITIAL_ICR","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"LUSD","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"LUSD_USDC_POOL","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PRECISION","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ROLLUP_PROCESSOR","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SORTED_TROVES","outputs":[{"internalType":"contract ISortedTroves","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SUBSIDY","outputs":[{"internalType":"contract ISubsidy","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TROVE_MANAGER","outputs":[{"internalType":"contract ITroveManager","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"USDC","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"USDC_ETH_POOL","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WETH","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","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":"closeTrove","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_collateral","type":"uint256"}],"name":"computeAmtToBorrow","outputs":[{"internalType":"uint256","name":"amtToBorrow","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"address","name":"erc20Address","type":"address"},{"internalType":"enum AztecTypes.AztecAssetType","name":"assetType","type":"uint8"}],"internalType":"struct AztecTypes.AztecAsset","name":"","type":"tuple"},{"components":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"address","name":"erc20Address","type":"address"},{"internalType":"enum AztecTypes.AztecAssetType","name":"assetType","type":"uint8"}],"internalType":"struct AztecTypes.AztecAsset","name":"","type":"tuple"},{"components":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"address","name":"erc20Address","type":"address"},{"internalType":"enum AztecTypes.AztecAssetType","name":"assetType","type":"uint8"}],"internalType":"struct AztecTypes.AztecAsset","name":"","type":"tuple"},{"components":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"address","name":"erc20Address","type":"address"},{"internalType":"enum AztecTypes.AztecAssetType","name":"assetType","type":"uint8"}],"internalType":"struct AztecTypes.AztecAsset","name":"","type":"tuple"},{"internalType":"uint64","name":"","type":"uint64"}],"name":"computeCriteria","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"address","name":"erc20Address","type":"address"},{"internalType":"enum AztecTypes.AztecAssetType","name":"assetType","type":"uint8"}],"internalType":"struct AztecTypes.AztecAsset","name":"_inputAssetA","type":"tuple"},{"components":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"address","name":"erc20Address","type":"address"},{"internalType":"enum AztecTypes.AztecAssetType","name":"assetType","type":"uint8"}],"internalType":"struct AztecTypes.AztecAsset","name":"_inputAssetB","type":"tuple"},{"components":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"address","name":"erc20Address","type":"address"},{"internalType":"enum AztecTypes.AztecAssetType","name":"assetType","type":"uint8"}],"internalType":"struct AztecTypes.AztecAsset","name":"_outputAssetA","type":"tuple"},{"components":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"address","name":"erc20Address","type":"address"},{"internalType":"enum AztecTypes.AztecAssetType","name":"assetType","type":"uint8"}],"internalType":"struct AztecTypes.AztecAsset","name":"_outputAssetB","type":"tuple"},{"internalType":"uint256","name":"_totalInputValue","type":"uint256"},{"internalType":"uint256","name":"_interactionNonce","type":"uint256"},{"internalType":"uint64","name":"_auxData","type":"uint64"},{"internalType":"address","name":"_rollupBeneficiary","type":"address"}],"name":"convert","outputs":[{"internalType":"uint256","name":"outputValueA","type":"uint256"},{"internalType":"uint256","name":"outputValueB","type":"uint256"},{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"payable","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":"id","type":"uint256"},{"internalType":"address","name":"erc20Address","type":"address"},{"internalType":"enum AztecTypes.AztecAssetType","name":"assetType","type":"uint8"}],"internalType":"struct AztecTypes.AztecAsset","name":"","type":"tuple"},{"components":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"address","name":"erc20Address","type":"address"},{"internalType":"enum AztecTypes.AztecAssetType","name":"assetType","type":"uint8"}],"internalType":"struct AztecTypes.AztecAsset","name":"","type":"tuple"},{"components":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"address","name":"erc20Address","type":"address"},{"internalType":"enum AztecTypes.AztecAssetType","name":"assetType","type":"uint8"}],"internalType":"struct AztecTypes.AztecAsset","name":"","type":"tuple"},{"components":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"address","name":"erc20Address","type":"address"},{"internalType":"enum AztecTypes.AztecAssetType","name":"assetType","type":"uint8"}],"internalType":"struct AztecTypes.AztecAsset","name":"","type":"tuple"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint64","name":"","type":"uint64"}],"name":"finalise","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"payable","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":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_upperHint","type":"address"},{"internalType":"address","name":"_lowerHint","type":"address"},{"internalType":"uint256","name":"_maxFee","type":"uint256"}],"name":"openTrove","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"int256","name":"_amount0Delta","type":"int256"},{"internalType":"int256","name":"_amount1Delta","type":"int256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"uniswapV3SwapCallback","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]

60c06040523480156200001157600080fd5b5060405162004a6e38038062004a6e833981016040819052620000349162000658565b6040518060400160405280600b81526020016a54726f766542726964676560a81b8152506200006e82620002fc60201b620023231760201c565b60405160200162000080919062000694565b60408051601f198184030181529190526001600160a01b0384166080528151620000b2906003906020850190620005b2565b508051620000c8906004906020840190620005b2565b505050620000e5620000df620003ac60201b60201c565b620003b0565b620000f881662386f26fc10000620006fa565b60a0526200010830600162000402565b60408051600280825260608201835260009260208301908036833750506040805160028082526060820183529394506000939092509060208301908036833750506040805160028082526060820183529394506000939092509060208301908036833701905050905060008360008151811062000189576200018962000732565b602002602001018181525050600183600181518110620001ad57620001ad62000732565b6020026020010181815250506207ef4082600081518110620001d357620001d362000732565b602002602001019063ffffffff16908163ffffffff1681525050620641908260018151811062000207576200020762000732565b602002602001019063ffffffff16908163ffffffff168152505060b48160008151811062000239576200023962000732565b602002602001019063ffffffff16908163ffffffff16815250506046816001815181106200026b576200026b62000732565b63ffffffff909216602092830291909101909101526040516338d8461360e11b815273abc30e831b5cc173a9ed5941714a7845c909e7fa906371b08c2690620002bd908690869086906004016200078b565b600060405180830381600087803b158015620002d857600080fd5b505af1158015620002ed573d6000803e3d6000fd5b50505050505050505062000855565b606060006200031683620004c860201b620023eb1760201c565b60010190506000816001600160401b038111156200033857620003386200071c565b6040519080825280601f01601f19166020018201604052801562000363576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a85049450846200039e57620003a4565b6200036d565b509392505050565b3390565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160a01b0382166200045d5760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015260640160405180910390fd5b8060026000828254620004719190620007fd565b90915550506001600160a01b038216600081815260208181526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b6000807a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000831062000512577a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000830492506040015b6d04ee2d6d415b85acef810000000083106200053f576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc1000083106200055e57662386f26fc10000830492506010015b6305f5e100831062000577576305f5e100830492506008015b61271083106200058c57612710830492506004015b606483106200059f576064830492506002015b600a8310620005ac576001015b92915050565b828054620005c09062000818565b90600052602060002090601f016020900481019282620005e457600085556200062f565b82601f10620005ff57805160ff19168380011785556200062f565b828001600101855582156200062f579182015b828111156200062f57825182559160200191906001019062000612565b506200063d92915062000641565b5090565b5b808211156200063d576000815560010162000642565b600080604083850312156200066c57600080fd5b82516001600160a01b03811681146200068457600080fd5b6020939093015192949293505050565b6254422d60e81b81526000825160005b81811015620006c35760208186018101516003868401015201620006a4565b81811115620006d6576000600383860101525b509190910160030192915050565b634e487b7160e01b600052601160045260246000fd5b6000816000190483118215151615620007175762000717620006e4565b500290565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b600081518084526020808501945080840160005b838110156200078057815163ffffffff16875295820195908201906001016200075c565b509495945050505050565b606080825284519082018190526000906020906080840190828801845b82811015620007c657815184529284019290840190600101620007a8565b50505083810382850152620007dc818762000748565b9150508281036040840152620007f3818562000748565b9695505050505050565b60008219821115620008135762000813620006e4565b500190565b600181811c908216806200082d57607f821691505b602082108114156200084f57634e487b7160e01b600052602260045260246000fd5b50919050565b60805160a0516141c2620008ac6000396000818161042e0152611db40152600081816105b101528181610cfb0152818161144d015281816115830152818161306a0152818161357e015261371d01526141c26000f3fe6080604052600436106101ff5760003560e01c806395d89b411161010e578063ae9467b5116100a7578063dd62ed3e11610079578063f2fde38b11610061578063f2fde38b146106c4578063f4f72c1e146106e4578063fa461e331461070457005b8063dd62ed3e14610649578063ec89947b1461069c57005b8063ae9467b51461059f578063bf9a09da146105d3578063cf59d563146105fb578063dbeacd541461062357005b8063a9059cbb116100e0578063a9059cbb14610513578063a96e874d14610533578063aaf5eb681461055b578063ad5c46481461057757005b806395d89b41146104a35780639b07d342146104b8578063a457c2d7146104cb578063a616236a146104eb57005b80633950935111610198578063715018a61161016a578063825ee67011610152578063825ee6701461041c57806389a30271146104505780638da5cb5b1461047857005b8063715018a6146103f45780637fda3d941461040957005b806339509351146103545780634e0cd799146103745780636508156e1461038957806370a08231146103b157005b806323b872dd116101d157806323b872dd1461029b57806326c3b515146102bb578063313ce567146102eb57806335735c461461030757005b806306fdde0314610208578063095ea7b3146102335780630e704d501461026357806318160ddd1461027857005b3661020657005b005b34801561021457600080fd5b5061021d610724565b60405161022a9190613a9b565b60405180910390f35b34801561023f57600080fd5b5061025361024e366004613ad7565b6107b6565b604051901515815260200161022a565b34801561026f57600080fd5b506102066107ce565b34801561028457600080fd5b5061028d610c9f565b60405190815260200161022a565b3480156102a757600080fd5b506102536102b6366004613b03565b610cbb565b6102ce6102c9366004613b73565b610cdf565b60408051938452602084019290925215159082015260600161022a565b3480156102f757600080fd5b506040516012815260200161022a565b34801561031357600080fd5b5061032f734e0924d3a751be199c426d52fb1f2337fa96f73681565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161022a565b34801561036057600080fd5b5061025361036f366004613ad7565b611369565b34801561038057600080fd5b5061028d600181565b34801561039557600080fd5b5061032f73abc30e831b5cc173a9ed5941714a7845c909e7fa81565b3480156103bd57600080fd5b5061028d6103cc366004613c09565b73ffffffffffffffffffffffffffffffffffffffff1660009081526020819052604090205490565b34801561040057600080fd5b506102066113b5565b610206610417366004613b03565b6113c9565b34801561042857600080fd5b5061028d7f000000000000000000000000000000000000000000000000000000000000000081565b34801561045c57600080fd5b5061032f73a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4881565b34801561048457600080fd5b5060055473ffffffffffffffffffffffffffffffffffffffff1661032f565b3480156104af57600080fd5b5061021d61198a565b6102ce6104c6366004613c26565b611999565b3480156104d757600080fd5b506102536104e6366004613ad7565b6119d0565b3480156104f757600080fd5b5061032f7324179cd81c9e782a4096035f7ec97fb8b783e00781565b34801561051f57600080fd5b5061025361052e366004613ad7565b611aa1565b34801561053f57600080fd5b5061032f73a39739ef8b0231dbfa0dcda07d7e29faabcf4bb281565b34801561056757600080fd5b5061028d670de0b6b3a764000081565b34801561058357600080fd5b5061032f73c02aaa39b223fe8d0a0e5c4f27ead9083c756cc281565b3480156105ab57600080fd5b5061032f7f000000000000000000000000000000000000000000000000000000000000000081565b3480156105df57600080fd5b5061032f738fdd3fbfeb32b28fb73555518f8b361bcea741a681565b34801561060757600080fd5b5061032f735f98805a4e8be255a32880fdec7f6728c6568ba081565b34801561062f57600080fd5b5061028d61063e366004613c9b565b600095945050505050565b34801561065557600080fd5b5061028d610664366004613d07565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260016020908152604080832093909416825291909152205490565b3480156106a857600080fd5b5061032f7388e6a0c2ddd26feeb64f039a2c41296fcb3f564081565b3480156106d057600080fd5b506102066106df366004613c09565b611aaf565b3480156106f057600080fd5b5061028d6106ff366004613d40565b611b66565b34801561071057600080fd5b5061020661071f366004613d59565b611f44565b60606003805461073390613dd9565b80601f016020809104026020016040519081016040528092919081815260200182805461075f90613dd9565b80156107ac5780601f10610781576101008083540402835291602001916107ac565b820191906000526020600020905b81548152906001019060200180831161078f57829003601f168201915b5050505050905090565b6000336107c48185856124ce565b5060019392505050565b6107d6612682565b60006107f760055473ffffffffffffffffffffffffffffffffffffffff1690565b905060006108278273ffffffffffffffffffffffffffffffffffffffff1660009081526020819052604090205490565b9050610831610c9f565b8114610869576040517f73c6573600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6108738282612703565b6040517f21e3780100000000000000000000000000000000000000000000000000000000815230600482015260009073a39739ef8b0231dbfa0dcda07d7e29faabcf4bb2906321e3780190602401602060405180830381865afa1580156108de573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109029190613e27565b600481111561091357610913613e40565b9050600181600481111561092957610929613e40565b1415610b5d576040517fb91af97c00000000000000000000000000000000000000000000000000000000815230600482015260009073a39739ef8b0231dbfa0dcda07d7e29faabcf4bb29063b91af97c90602401608060405180830381865afa15801561099a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109be9190613e6f565b50919250735f98805a4e8be255a32880fdec7f6728c6568ba091506323b872dd905085306109f5680ad78ebc5ac620000086613ed4565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e086901b16815273ffffffffffffffffffffffffffffffffffffffff938416600482015292909116602483015260448201526064016020604051808303816000875af1158015610a6e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a929190613eeb565b610ae3576040517f39f1c8d9000000000000000000000000000000000000000000000000000000008152735f98805a4e8be255a32880fdec7f6728c6568ba060048201526024015b60405180910390fd5b7324179cd81c9e782a4096035f7ec97fb8b783e00773ffffffffffffffffffffffffffffffffffffffff16630e704d506040518163ffffffff1660e01b8152600401600060405180830381600087803b158015610b3f57600080fd5b505af1158015610b53573d6000803e3d6000fd5b5050505050610c57565b6004816004811115610b7157610b71613e40565b1480610b8e57506003816004811115610b8c57610b8c613e40565b145b15610c575760055474010000000000000000000000000000000000000000900460ff16610c2e577324179cd81c9e782a4096035f7ec97fb8b783e00773ffffffffffffffffffffffffffffffffffffffff16636f0b0c1c6040518163ffffffff1660e01b8152600401600060405180830381600087803b158015610c1157600080fd5b505af1158015610c25573d6000803e3d6000fd5b50505050610c57565b600580547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1690555b60405173ffffffffffffffffffffffffffffffffffffffff8416904780156108fc02916000818181858888f19350505050158015610c99573d6000803e3d6000fd5b50505050565b60006001610cac60025490565b610cb69190613ed4565b905090565b600033610cc98582856128bf565b610cd4858585612990565b506001949350505050565b600080803373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614610d52576040517f48f5c3ed00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f21e3780100000000000000000000000000000000000000000000000000000000815230600482015260009073a39739ef8b0231dbfa0dcda07d7e29faabcf4bb2906321e3780190602401602060405180830381865afa158015610dbd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610de19190613e27565b6004811115610df257610df2613e40565b9050600060018d6040016020810190610e0b9190613f0d565b6003811115610e1c57610e1c613e40565b148015610e4957506000610e3660608e0160408f01613f0d565b6003811115610e4757610e47613e40565b145b8015610e79575030610e6160408d0160208e01613c09565b73ffffffffffffffffffffffffffffffffffffffff16145b8015610ebd5750735f98805a4e8be255a32880fdec7f6728c6568ba0610ea560408c0160208d01613c09565b73ffffffffffffffffffffffffffffffffffffffff16145b15610f27576001826004811115610ed657610ed6613e40565b14610f0f57816040517f774f7f12000000000000000000000000000000000000000000000000000000008152600401610ada9190613f2e565b610f198988612bff565b9095509350600090506112ad565b3073ffffffffffffffffffffffffffffffffffffffff168d6020016020810190610f519190613c09565b73ffffffffffffffffffffffffffffffffffffffff16148015610fac5750735f98805a4e8be255a32880fdec7f6728c6568ba0610f9460408e0160208f01613c09565b73ffffffffffffffffffffffffffffffffffffffff16145b8015610fd857506001610fc560608d0160408e01613f0d565b6003811115610fd657610fd6613e40565b145b156110fd576001826004811115610ff157610ff1613e40565b1461102a57816040517f774f7f12000000000000000000000000000000000000000000000000000000008152600401610ada9190613f2e565b735f98805a4e8be255a32880fdec7f6728c6568ba061104f60408c0160208d01613c09565b73ffffffffffffffffffffffffffffffffffffffff16141561107f576110758989612e46565b90955093506110f5565b3061109060408c0160208d01613c09565b73ffffffffffffffffffffffffffffffffffffffff1614156110c357611075898867ffffffffffffffff168a60016130eb565b6040517fc412cb0e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5060016112ad565b3073ffffffffffffffffffffffffffffffffffffffff168d60200160208101906111279190613c09565b73ffffffffffffffffffffffffffffffffffffffff1614801561116a5750600061115760608e0160408f01613f0d565b600381111561116857611168613e40565b145b80156111965750600161118360608d0160408e01613f0d565b600381111561119457611194613e40565b145b80156111c2575060006111af60608c0160408d01613f0d565b60038111156111c0576111c0613e40565b145b1561127b5760018260048111156111db576111db613e40565b1415611200576111f8898867ffffffffffffffff168a60006130eb565b5094506110f5565b600482600481111561121457611214613e40565b14806112315750600382600481111561122f5761122f613e40565b145b156112475761124089896135ed565b94506110f5565b816040517f774f7f12000000000000000000000000000000000000000000000000000000008152600401610ada9190613f2e565b6040517fb4fa3fb300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f0d3b20520000000000000000000000000000000000000000000000000000000081526004810182905273ffffffffffffffffffffffffffffffffffffffff8716602482015273abc30e831b5cc173a9ed5941714a7845c909e7fa90630d3b2052906044016020604051808303816000875af1158015611334573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113589190613e27565b505050985098509895505050505050565b33600081815260016020908152604080832073ffffffffffffffffffffffffffffffffffffffff871684529091528120549091906107c490829086906113b0908790613f6f565b6124ce565b6113bd612682565b6113c76000613796565b565b6113d1612682565b6113d9610c9f565b15611410576040517f5a99cfb200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f095ea7b300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001660048201527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6024820152735f98805a4e8be255a32880fdec7f6728c6568ba09063095ea7b3906044016020604051808303816000875af11580156114d6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114fa9190613eeb565b611546576040517fc90bb86a000000000000000000000000000000000000000000000000000000008152735f98805a4e8be255a32880fdec7f6728c6568ba06004820152602401610ada565b6040517f095ea7b300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001660048201527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6024820152309063095ea7b3906044016020604051808303816000875af11580156115f8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061161c9190613eeb565b611654576040517fc90bb86a000000000000000000000000000000000000000000000000000000008152306004820152602401610ada565b600061165f34611b66565b6040517fb91af97c00000000000000000000000000000000000000000000000000000000815230600482015290915060009073a39739ef8b0231dbfa0dcda07d7e29faabcf4bb29063b91af97c90602401608060405180830381865afa1580156116cd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116f19190613e6f565b50506040517f860665b3000000000000000000000000000000000000000000000000000000008152600481018690526024810185905273ffffffffffffffffffffffffffffffffffffffff8089166044830152871660648201529192507324179cd81c9e782a4096035f7ec97fb8b783e0079163860665b3915034906084016000604051808303818588803b15801561178957600080fd5b505af115801561179d573d6000803e3d6000fd5b50506040517fb91af97c0000000000000000000000000000000000000000000000000000000081523060048201526000935073a39739ef8b0231dbfa0dcda07d7e29faabcf4bb2925063b91af97c9150602401608060405180830381865afa15801561180d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118319190613e6f565b50506040517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152919250735f98805a4e8be255a32880fdec7f6728c6568ba09163a9059cbb9150339060019084906370a0823190602401602060405180830381865afa1580156118ac573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118d09190613e27565b6118da9190613ed4565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b16815273ffffffffffffffffffffffffffffffffffffffff909216600483015260248201526044016020604051808303816000875af115801561194a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061196e9190613eeb565b506119823361197d8484613ed4565b61380d565b505050505050565b60606004805461073390613dd9565b60008060006040517f26d18eab00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b33600081815260016020908152604080832073ffffffffffffffffffffffffffffffffffffffff8716845290915281205490919083811015611a94576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760448201527f207a65726f0000000000000000000000000000000000000000000000000000006064820152608401610ada565b610cd482868684036124ce565b6000336107c4818585612990565b611ab7612682565b73ffffffffffffffffffffffffffffffffffffffff8116611b5a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610ada565b611b6381613796565b50565b60008073a39739ef8b0231dbfa0dcda07d7e29faabcf4bb273ffffffffffffffffffffffffffffffffffffffff1663741bef1a6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611bc8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611bec9190613f87565b73ffffffffffffffffffffffffffffffffffffffff16630fdb11cf6040518163ffffffff1660e01b81526004016020604051808303816000875af1158015611c38573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c5c9190613e27565b6040517f21e3780100000000000000000000000000000000000000000000000000000000815230600482015290915073a39739ef8b0231dbfa0dcda07d7e29faabcf4bb2906321e3780190602401602060405180830381865afa158015611cc7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ceb9190613e27565b60011415611da8576040517fd293c7100000000000000000000000000000000000000000000000000000000081523060048201526024810182905260009073a39739ef8b0231dbfa0dcda07d7e29faabcf4bb29063d293c71090604401602060405180830381865afa158015611d65573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d899190613e27565b905080611d968386613fa4565b611da09190613fe1565b925050611df4565b680ad78ebc5ac62000007f0000000000000000000000000000000000000000000000000000000000000000611ddd8386613fa4565b611de79190613fe1565b611df19190613ed4565b91505b6040517f4e443d9e0000000000000000000000000000000000000000000000000000000081526004810182905273a39739ef8b0231dbfa0dcda07d7e29faabcf4bb290634e443d9e90602401602060405180830381865afa158015611e5d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e819190613eeb565b611f3e57600073a39739ef8b0231dbfa0dcda07d7e29faabcf4bb273ffffffffffffffffffffffffffffffffffffffff166366ca4a216040518163ffffffff1660e01b8152600401602060405180830381865afa158015611ee6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f0a9190613e27565b9050611f1e81670de0b6b3a7640000613f6f565b611f3084670de0b6b3a7640000613fa4565b611f3a9190613fe1565b9250505b50919050565b60008413158015611f56575060008313155b15611f8d576040517fa97dc2bb00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b33734e0924d3a751be199c426d52fb1f2337fa96f73614156121aa576000611fb78284018461404b565b9050600080611fc4613900565b602085015185516040517fc6a6cf2000000000000000000000000000000000000000000000000000000000815260006004820181905260248201939093526044810191909152606481019190915273ffffffffffffffffffffffffffffffffffffffff8084166084830152821660a482015291935091507324179cd81c9e782a4096035f7ec97fb8b783e0079063c6a6cf209060c401600060405180830381600087803b15801561207457600080fd5b505af1158015612088573d6000803e3d6000fd5b505050507388e6a0c2ddd26feeb64f039a2c41296fcb3f564073ffffffffffffffffffffffffffffffffffffffff1663128acb08734e0924d3a751be199c426d52fb1f2337fa96f7366000896120dd906140c1565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e086901b16815273ffffffffffffffffffffffffffffffffffffffff90931660048401529015156024830152604482015273fffd8963efd1fc6a506488495d951d5263988d25606482015260a06084820152600060a482015260c40160408051808303816000875af115801561217c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121a091906140fa565b5050505050610c99565b337388e6a0c2ddd26feeb64f039a2c41296fcb3f564014156122f157600083905073c02aaa39b223fe8d0a0e5c4f27ead9083c756cc273ffffffffffffffffffffffffffffffffffffffff1663d0e30db0826040518263ffffffff1660e01b81526004016000604051808303818588803b15801561222757600080fd5b505af115801561223b573d6000803e3d6000fd5b50506040517fa9059cbb0000000000000000000000000000000000000000000000000000000081527388e6a0c2ddd26feeb64f039a2c41296fcb3f564060048201526024810185905273c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2935063a9059cbb925060440190506020604051808303816000875af11580156122c6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122ea9190613eeb565b5050610c99565b6040517f48f5c3ed00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60606000612330836123eb565b600101905060008167ffffffffffffffff8111156123505761235061401c565b6040519080825280601f01601f19166020018201604052801561237a576020820181803683370190505b5090508181016020015b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff017f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a85049450846123de576123e3565b612384565b509392505050565b6000807a184f03e93ff9f4daa797ed6e38ed64bf6a1f0100000000000000008310612434577a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000830492506040015b6d04ee2d6d415b85acef81000000008310612460576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc10000831061247e57662386f26fc10000830492506010015b6305f5e1008310612496576305f5e100830492506008015b61271083106124aa57612710830492506004015b606483106124bc576064830492506002015b600a83106124c8576001015b92915050565b73ffffffffffffffffffffffffffffffffffffffff8316612570576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460448201527f72657373000000000000000000000000000000000000000000000000000000006064820152608401610ada565b73ffffffffffffffffffffffffffffffffffffffff8216612613576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f20616464726560448201527f73730000000000000000000000000000000000000000000000000000000000006064820152608401610ada565b73ffffffffffffffffffffffffffffffffffffffff83811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b60055473ffffffffffffffffffffffffffffffffffffffff1633146113c7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610ada565b73ffffffffffffffffffffffffffffffffffffffff82166127a6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360448201527f73000000000000000000000000000000000000000000000000000000000000006064820152608401610ada565b73ffffffffffffffffffffffffffffffffffffffff82166000908152602081905260409020548181101561285c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60448201527f63650000000000000000000000000000000000000000000000000000000000006064820152608401610ada565b73ffffffffffffffffffffffffffffffffffffffff83166000818152602081815260408083208686039055600280548790039055518581529192917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9101612675565b73ffffffffffffffffffffffffffffffffffffffff8381166000908152600160209081526040808320938616835292905220547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8114610c995781811015612983576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401610ada565b610c9984848484036124ce565b73ffffffffffffffffffffffffffffffffffffffff8316612a33576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f20616460448201527f64726573730000000000000000000000000000000000000000000000000000006064820152608401610ada565b73ffffffffffffffffffffffffffffffffffffffff8216612ad6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201527f65737300000000000000000000000000000000000000000000000000000000006064820152608401610ada565b73ffffffffffffffffffffffffffffffffffffffff831660009081526020819052604090205481811015612b8c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206260448201527f616c616e636500000000000000000000000000000000000000000000000000006064820152608401610ada565b73ffffffffffffffffffffffffffffffffffffffff848116600081815260208181526040808320878703905593871680835291849020805487019055925185815290927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3610c99565b600080612c0b84611b66565b6040517fb91af97c00000000000000000000000000000000000000000000000000000000815230600482015290915060009073a39739ef8b0231dbfa0dcda07d7e29faabcf4bb29063b91af97c90602401608060405180830381865afa158015612c79573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c9d9190613e6f565b5050509050600080612cad613900565b6040517fc6a6cf2000000000000000000000000000000000000000000000000000000000815267ffffffffffffffff8916600482015260006024820152604481018790526001606482015273ffffffffffffffffffffffffffffffffffffffff8084166084830152821660a482015291935091507324179cd81c9e782a4096035f7ec97fb8b783e0079063c6a6cf2090899060c4016000604051808303818588803b158015612d5b57600080fd5b505af1158015612d6f573d6000803e3d6000fd5b50506040517fb91af97c0000000000000000000000000000000000000000000000000000000081523060048201526000935073a39739ef8b0231dbfa0dcda07d7e29faabcf4bb2925063b91af97c9150602401608060405180830381865afa158015612ddf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e039190613e6f565b505050905083612e11610c9f565b612e1b8684613ed4565b612e259190613fa4565b612e2f9190613fe1565b9550612e3b308761380d565b505050509250929050565b6040517fb91af97c00000000000000000000000000000000000000000000000000000000815230600482015260009081908190819073a39739ef8b0231dbfa0dcda07d7e29faabcf4bb29063b91af97c90602401608060405180830381865afa158015612eb7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612edb9190613e6f565b5050915091506000612eeb610c9f565b9050600081612efa858a613fa4565b612f049190613fe1565b905087811115612f40576040517fc412cb0e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600082612f4d858b613fa4565b612f579190613fe1565b9050600080612f64613900565b6040517fc6a6cf200000000000000000000000000000000000000000000000000000000081526000600482018190526024820187905260448201889052606482015273ffffffffffffffffffffffffffffffffffffffff8084166084830152821660a482015291935091507324179cd81c9e782a4096035f7ec97fb8b783e0079063c6a6cf209060c401600060405180830381600087803b15801561300857600080fd5b505af115801561301c573d6000803e3d6000fd5b50505050838b61302c9190613ed4565b975047985061303b308c612703565b6040517f12a53623000000000000000000000000000000000000000000000000000000008152600481018b90527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16906312a53623908b906024016000604051808303818588803b1580156130c457600080fd5b505af11580156130d8573d6000803e3d6000fd5b5050505050505050505050509250929050565b6040517fb91af97c00000000000000000000000000000000000000000000000000000000815230600482015260009081908190819073a39739ef8b0231dbfa0dcda07d7e29faabcf4bb29063b91af97c90602401608060405180830381865afa15801561315c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131809190613e6f565b5050915091506000613190610c9f565b905060008161319f858c613fa4565b6131a99190613fe1565b90506000826131b8858d613fa4565b6131c29190613fe1565b905060008815613216578b8311613205576040517fc412cb0e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61320f8c84613ed4565b9050613219565b50815b476000734e0924d3a751be199c426d52fb1f2337fa96f736308261323c866140c1565b6040805180820182528a815260209081018a815282519182018c90525181830152815180820383018152606082019092526132929493929173fffd8963efd1fc6a506488495d951d5263988d259160840161411e565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f128acb0800000000000000000000000000000000000000000000000000000000179052516133139190614170565b6000604051808303816000865af19150503d8060008114613350576040519150601f19603f3d011682016040523d82523d6000602084013e613355565b606091505b5050905080156133e5576133698247613ed4565b99506000670de0b6b3a76400006133808f86613fa4565b61338a9190613fe1565b905060006133988c87613ed4565b9050818111156133d4576040517f5fef763a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50506133e0308f612703565b61353a565b8a15613508578d94506000886133fb8888613fa4565b6134059190613fe1565b9050866134128983613fa4565b61341c9190613fe1565b9450600080613429613900565b6040517fc6a6cf20000000000000000000000000000000000000000000000000000000008152600060048201819052602482018b9052604482018c9052606482015273ffffffffffffffffffffffffffffffffffffffff8084166084830152821660a482015291935091507324179cd81c9e782a4096035f7ec97fb8b783e0079063c6a6cf209060c401600060405180830381600087803b1580156134cd57600080fd5b505af11580156134e1573d6000803e3d6000fd5b505050505050808f6134f39190613ed4565b99506134ff3082612703565b479a505061353a565b6040517f81ceff3000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f12a53623000000000000000000000000000000000000000000000000000000008152600481018d905273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016906312a53623908c906024016000604051808303818588803b1580156135c357600080fd5b505af11580156135d7573d6000803e3d6000fd5b5050505050505050505050505094509492505050565b60055460009074010000000000000000000000000000000000000000900460ff166136c6577324179cd81c9e782a4096035f7ec97fb8b783e00773ffffffffffffffffffffffffffffffffffffffff16636f0b0c1c6040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561366e57600080fd5b505af1158015613682573d6000803e3d6000fd5b5050600580547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff167401000000000000000000000000000000000000000017905550505b6136ce610c9f565b6136d88447613fa4565b6136e29190613fe1565b90506136ee3084612703565b6040517f12a53623000000000000000000000000000000000000000000000000000000008152600481018390527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16906312a536239083906024016000604051808303818588803b15801561377757600080fd5b505af115801561378b573d6000803e3d6000fd5b505050505092915050565b6005805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b73ffffffffffffffffffffffffffffffffffffffff821661388a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610ada565b806002600082825461389c9190613f6f565b909155505073ffffffffffffffffffffffffffffffffffffffff8216600081815260208181526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b6040517fb72703ac0000000000000000000000000000000000000000000000000000000081523060048201526000908190738fdd3fbfeb32b28fb73555518f8b361bcea741a69063b72703ac90602401602060405180830381865afa15801561396d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906139919190613f87565b6040517f765e0159000000000000000000000000000000000000000000000000000000008152306004820152738fdd3fbfeb32b28fb73555518f8b361bcea741a69063765e015990602401602060405180830381865afa1580156139f9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613a1d9190613f87565b915091509091565b60005b83811015613a40578181015183820152602001613a28565b83811115610c995750506000910152565b60008151808452613a69816020860160208601613a25565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b602081526000613aae6020830184613a51565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff81168114611b6357600080fd5b60008060408385031215613aea57600080fd5b8235613af581613ab5565b946020939093013593505050565b600080600060608486031215613b1857600080fd5b8335613b2381613ab5565b92506020840135613b3381613ab5565b929592945050506040919091013590565b600060608284031215611f3e57600080fd5b803567ffffffffffffffff81168114613b6e57600080fd5b919050565b600080600080600080600080610200898b031215613b9057600080fd5b613b9a8a8a613b44565b9750613ba98a60608b01613b44565b9650613bb88a60c08b01613b44565b9550613bc88a6101208b01613b44565b945061018089013593506101a08901359250613be76101c08a01613b56565b91506101e0890135613bf881613ab5565b809150509295985092959890939650565b600060208284031215613c1b57600080fd5b8135613aae81613ab5565b6000806000806000806101c08789031215613c4057600080fd5b613c4a8888613b44565b9550613c598860608901613b44565b9450613c688860c08901613b44565b9350613c78886101208901613b44565b92506101808701359150613c8f6101a08801613b56565b90509295509295509295565b60008060008060006101a08688031215613cb457600080fd5b613cbe8787613b44565b9450613ccd8760608801613b44565b9350613cdc8760c08801613b44565b9250613cec876101208801613b44565b9150613cfb6101808701613b56565b90509295509295909350565b60008060408385031215613d1a57600080fd5b8235613d2581613ab5565b91506020830135613d3581613ab5565b809150509250929050565b600060208284031215613d5257600080fd5b5035919050565b60008060008060608587031215613d6f57600080fd5b8435935060208501359250604085013567ffffffffffffffff80821115613d9557600080fd5b818701915087601f830112613da957600080fd5b813581811115613db857600080fd5b886020828501011115613dca57600080fd5b95989497505060200194505050565b600181811c90821680613ded57607f821691505b60208210811415611f3e577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060208284031215613e3957600080fd5b5051919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b60008060008060808587031215613e8557600080fd5b505082516020840151604085015160609095015191969095509092509050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600082821015613ee657613ee6613ea5565b500390565b600060208284031215613efd57600080fd5b81518015158114613aae57600080fd5b600060208284031215613f1f57600080fd5b813560048110613aae57600080fd5b6020810160058310613f69577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b91905290565b60008219821115613f8257613f82613ea5565b500190565b600060208284031215613f9957600080fd5b8151613aae81613ab5565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613fdc57613fdc613ea5565b500290565b600082614017577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60006040828403121561405d57600080fd5b6040516040810181811067ffffffffffffffff821117156140a7577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604052823581526020928301359281019290925250919050565b60007f80000000000000000000000000000000000000000000000000000000000000008214156140f3576140f3613ea5565b5060000390565b6000806040838503121561410d57600080fd5b505080516020909101519092909150565b600073ffffffffffffffffffffffffffffffffffffffff8088168352861515602084015285604084015280851660608401525060a0608083015261416560a0830184613a51565b979650505050505050565b60008251614182818460208701613a25565b919091019291505056fea2646970667358221220660135116eff8bf14ff203845176838e7898dc5627f5a464d1ae7665d0c0134f64736f6c634300080a0033000000000000000000000000ff1f2b4adb9df6fc8eafecdcbf96a2b3516804550000000000000000000000000000000000000000000000000000000000000113

Deployed Bytecode

0x6080604052600436106101ff5760003560e01c806395d89b411161010e578063ae9467b5116100a7578063dd62ed3e11610079578063f2fde38b11610061578063f2fde38b146106c4578063f4f72c1e146106e4578063fa461e331461070457005b8063dd62ed3e14610649578063ec89947b1461069c57005b8063ae9467b51461059f578063bf9a09da146105d3578063cf59d563146105fb578063dbeacd541461062357005b8063a9059cbb116100e0578063a9059cbb14610513578063a96e874d14610533578063aaf5eb681461055b578063ad5c46481461057757005b806395d89b41146104a35780639b07d342146104b8578063a457c2d7146104cb578063a616236a146104eb57005b80633950935111610198578063715018a61161016a578063825ee67011610152578063825ee6701461041c57806389a30271146104505780638da5cb5b1461047857005b8063715018a6146103f45780637fda3d941461040957005b806339509351146103545780634e0cd799146103745780636508156e1461038957806370a08231146103b157005b806323b872dd116101d157806323b872dd1461029b57806326c3b515146102bb578063313ce567146102eb57806335735c461461030757005b806306fdde0314610208578063095ea7b3146102335780630e704d501461026357806318160ddd1461027857005b3661020657005b005b34801561021457600080fd5b5061021d610724565b60405161022a9190613a9b565b60405180910390f35b34801561023f57600080fd5b5061025361024e366004613ad7565b6107b6565b604051901515815260200161022a565b34801561026f57600080fd5b506102066107ce565b34801561028457600080fd5b5061028d610c9f565b60405190815260200161022a565b3480156102a757600080fd5b506102536102b6366004613b03565b610cbb565b6102ce6102c9366004613b73565b610cdf565b60408051938452602084019290925215159082015260600161022a565b3480156102f757600080fd5b506040516012815260200161022a565b34801561031357600080fd5b5061032f734e0924d3a751be199c426d52fb1f2337fa96f73681565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161022a565b34801561036057600080fd5b5061025361036f366004613ad7565b611369565b34801561038057600080fd5b5061028d600181565b34801561039557600080fd5b5061032f73abc30e831b5cc173a9ed5941714a7845c909e7fa81565b3480156103bd57600080fd5b5061028d6103cc366004613c09565b73ffffffffffffffffffffffffffffffffffffffff1660009081526020819052604090205490565b34801561040057600080fd5b506102066113b5565b610206610417366004613b03565b6113c9565b34801561042857600080fd5b5061028d7f0000000000000000000000000000000000000000000000002629f66e0c53000081565b34801561045c57600080fd5b5061032f73a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4881565b34801561048457600080fd5b5060055473ffffffffffffffffffffffffffffffffffffffff1661032f565b3480156104af57600080fd5b5061021d61198a565b6102ce6104c6366004613c26565b611999565b3480156104d757600080fd5b506102536104e6366004613ad7565b6119d0565b3480156104f757600080fd5b5061032f7324179cd81c9e782a4096035f7ec97fb8b783e00781565b34801561051f57600080fd5b5061025361052e366004613ad7565b611aa1565b34801561053f57600080fd5b5061032f73a39739ef8b0231dbfa0dcda07d7e29faabcf4bb281565b34801561056757600080fd5b5061028d670de0b6b3a764000081565b34801561058357600080fd5b5061032f73c02aaa39b223fe8d0a0e5c4f27ead9083c756cc281565b3480156105ab57600080fd5b5061032f7f000000000000000000000000ff1f2b4adb9df6fc8eafecdcbf96a2b35168045581565b3480156105df57600080fd5b5061032f738fdd3fbfeb32b28fb73555518f8b361bcea741a681565b34801561060757600080fd5b5061032f735f98805a4e8be255a32880fdec7f6728c6568ba081565b34801561062f57600080fd5b5061028d61063e366004613c9b565b600095945050505050565b34801561065557600080fd5b5061028d610664366004613d07565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260016020908152604080832093909416825291909152205490565b3480156106a857600080fd5b5061032f7388e6a0c2ddd26feeb64f039a2c41296fcb3f564081565b3480156106d057600080fd5b506102066106df366004613c09565b611aaf565b3480156106f057600080fd5b5061028d6106ff366004613d40565b611b66565b34801561071057600080fd5b5061020661071f366004613d59565b611f44565b60606003805461073390613dd9565b80601f016020809104026020016040519081016040528092919081815260200182805461075f90613dd9565b80156107ac5780601f10610781576101008083540402835291602001916107ac565b820191906000526020600020905b81548152906001019060200180831161078f57829003601f168201915b5050505050905090565b6000336107c48185856124ce565b5060019392505050565b6107d6612682565b60006107f760055473ffffffffffffffffffffffffffffffffffffffff1690565b905060006108278273ffffffffffffffffffffffffffffffffffffffff1660009081526020819052604090205490565b9050610831610c9f565b8114610869576040517f73c6573600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6108738282612703565b6040517f21e3780100000000000000000000000000000000000000000000000000000000815230600482015260009073a39739ef8b0231dbfa0dcda07d7e29faabcf4bb2906321e3780190602401602060405180830381865afa1580156108de573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109029190613e27565b600481111561091357610913613e40565b9050600181600481111561092957610929613e40565b1415610b5d576040517fb91af97c00000000000000000000000000000000000000000000000000000000815230600482015260009073a39739ef8b0231dbfa0dcda07d7e29faabcf4bb29063b91af97c90602401608060405180830381865afa15801561099a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109be9190613e6f565b50919250735f98805a4e8be255a32880fdec7f6728c6568ba091506323b872dd905085306109f5680ad78ebc5ac620000086613ed4565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e086901b16815273ffffffffffffffffffffffffffffffffffffffff938416600482015292909116602483015260448201526064016020604051808303816000875af1158015610a6e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a929190613eeb565b610ae3576040517f39f1c8d9000000000000000000000000000000000000000000000000000000008152735f98805a4e8be255a32880fdec7f6728c6568ba060048201526024015b60405180910390fd5b7324179cd81c9e782a4096035f7ec97fb8b783e00773ffffffffffffffffffffffffffffffffffffffff16630e704d506040518163ffffffff1660e01b8152600401600060405180830381600087803b158015610b3f57600080fd5b505af1158015610b53573d6000803e3d6000fd5b5050505050610c57565b6004816004811115610b7157610b71613e40565b1480610b8e57506003816004811115610b8c57610b8c613e40565b145b15610c575760055474010000000000000000000000000000000000000000900460ff16610c2e577324179cd81c9e782a4096035f7ec97fb8b783e00773ffffffffffffffffffffffffffffffffffffffff16636f0b0c1c6040518163ffffffff1660e01b8152600401600060405180830381600087803b158015610c1157600080fd5b505af1158015610c25573d6000803e3d6000fd5b50505050610c57565b600580547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1690555b60405173ffffffffffffffffffffffffffffffffffffffff8416904780156108fc02916000818181858888f19350505050158015610c99573d6000803e3d6000fd5b50505050565b60006001610cac60025490565b610cb69190613ed4565b905090565b600033610cc98582856128bf565b610cd4858585612990565b506001949350505050565b600080803373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000ff1f2b4adb9df6fc8eafecdcbf96a2b3516804551614610d52576040517f48f5c3ed00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f21e3780100000000000000000000000000000000000000000000000000000000815230600482015260009073a39739ef8b0231dbfa0dcda07d7e29faabcf4bb2906321e3780190602401602060405180830381865afa158015610dbd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610de19190613e27565b6004811115610df257610df2613e40565b9050600060018d6040016020810190610e0b9190613f0d565b6003811115610e1c57610e1c613e40565b148015610e4957506000610e3660608e0160408f01613f0d565b6003811115610e4757610e47613e40565b145b8015610e79575030610e6160408d0160208e01613c09565b73ffffffffffffffffffffffffffffffffffffffff16145b8015610ebd5750735f98805a4e8be255a32880fdec7f6728c6568ba0610ea560408c0160208d01613c09565b73ffffffffffffffffffffffffffffffffffffffff16145b15610f27576001826004811115610ed657610ed6613e40565b14610f0f57816040517f774f7f12000000000000000000000000000000000000000000000000000000008152600401610ada9190613f2e565b610f198988612bff565b9095509350600090506112ad565b3073ffffffffffffffffffffffffffffffffffffffff168d6020016020810190610f519190613c09565b73ffffffffffffffffffffffffffffffffffffffff16148015610fac5750735f98805a4e8be255a32880fdec7f6728c6568ba0610f9460408e0160208f01613c09565b73ffffffffffffffffffffffffffffffffffffffff16145b8015610fd857506001610fc560608d0160408e01613f0d565b6003811115610fd657610fd6613e40565b145b156110fd576001826004811115610ff157610ff1613e40565b1461102a57816040517f774f7f12000000000000000000000000000000000000000000000000000000008152600401610ada9190613f2e565b735f98805a4e8be255a32880fdec7f6728c6568ba061104f60408c0160208d01613c09565b73ffffffffffffffffffffffffffffffffffffffff16141561107f576110758989612e46565b90955093506110f5565b3061109060408c0160208d01613c09565b73ffffffffffffffffffffffffffffffffffffffff1614156110c357611075898867ffffffffffffffff168a60016130eb565b6040517fc412cb0e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5060016112ad565b3073ffffffffffffffffffffffffffffffffffffffff168d60200160208101906111279190613c09565b73ffffffffffffffffffffffffffffffffffffffff1614801561116a5750600061115760608e0160408f01613f0d565b600381111561116857611168613e40565b145b80156111965750600161118360608d0160408e01613f0d565b600381111561119457611194613e40565b145b80156111c2575060006111af60608c0160408d01613f0d565b60038111156111c0576111c0613e40565b145b1561127b5760018260048111156111db576111db613e40565b1415611200576111f8898867ffffffffffffffff168a60006130eb565b5094506110f5565b600482600481111561121457611214613e40565b14806112315750600382600481111561122f5761122f613e40565b145b156112475761124089896135ed565b94506110f5565b816040517f774f7f12000000000000000000000000000000000000000000000000000000008152600401610ada9190613f2e565b6040517fb4fa3fb300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f0d3b20520000000000000000000000000000000000000000000000000000000081526004810182905273ffffffffffffffffffffffffffffffffffffffff8716602482015273abc30e831b5cc173a9ed5941714a7845c909e7fa90630d3b2052906044016020604051808303816000875af1158015611334573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113589190613e27565b505050985098509895505050505050565b33600081815260016020908152604080832073ffffffffffffffffffffffffffffffffffffffff871684529091528120549091906107c490829086906113b0908790613f6f565b6124ce565b6113bd612682565b6113c76000613796565b565b6113d1612682565b6113d9610c9f565b15611410576040517f5a99cfb200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f095ea7b300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000ff1f2b4adb9df6fc8eafecdcbf96a2b3516804551660048201527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6024820152735f98805a4e8be255a32880fdec7f6728c6568ba09063095ea7b3906044016020604051808303816000875af11580156114d6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114fa9190613eeb565b611546576040517fc90bb86a000000000000000000000000000000000000000000000000000000008152735f98805a4e8be255a32880fdec7f6728c6568ba06004820152602401610ada565b6040517f095ea7b300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000ff1f2b4adb9df6fc8eafecdcbf96a2b3516804551660048201527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6024820152309063095ea7b3906044016020604051808303816000875af11580156115f8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061161c9190613eeb565b611654576040517fc90bb86a000000000000000000000000000000000000000000000000000000008152306004820152602401610ada565b600061165f34611b66565b6040517fb91af97c00000000000000000000000000000000000000000000000000000000815230600482015290915060009073a39739ef8b0231dbfa0dcda07d7e29faabcf4bb29063b91af97c90602401608060405180830381865afa1580156116cd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116f19190613e6f565b50506040517f860665b3000000000000000000000000000000000000000000000000000000008152600481018690526024810185905273ffffffffffffffffffffffffffffffffffffffff8089166044830152871660648201529192507324179cd81c9e782a4096035f7ec97fb8b783e0079163860665b3915034906084016000604051808303818588803b15801561178957600080fd5b505af115801561179d573d6000803e3d6000fd5b50506040517fb91af97c0000000000000000000000000000000000000000000000000000000081523060048201526000935073a39739ef8b0231dbfa0dcda07d7e29faabcf4bb2925063b91af97c9150602401608060405180830381865afa15801561180d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118319190613e6f565b50506040517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152919250735f98805a4e8be255a32880fdec7f6728c6568ba09163a9059cbb9150339060019084906370a0823190602401602060405180830381865afa1580156118ac573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118d09190613e27565b6118da9190613ed4565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b16815273ffffffffffffffffffffffffffffffffffffffff909216600483015260248201526044016020604051808303816000875af115801561194a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061196e9190613eeb565b506119823361197d8484613ed4565b61380d565b505050505050565b60606004805461073390613dd9565b60008060006040517f26d18eab00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b33600081815260016020908152604080832073ffffffffffffffffffffffffffffffffffffffff8716845290915281205490919083811015611a94576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760448201527f207a65726f0000000000000000000000000000000000000000000000000000006064820152608401610ada565b610cd482868684036124ce565b6000336107c4818585612990565b611ab7612682565b73ffffffffffffffffffffffffffffffffffffffff8116611b5a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610ada565b611b6381613796565b50565b60008073a39739ef8b0231dbfa0dcda07d7e29faabcf4bb273ffffffffffffffffffffffffffffffffffffffff1663741bef1a6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611bc8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611bec9190613f87565b73ffffffffffffffffffffffffffffffffffffffff16630fdb11cf6040518163ffffffff1660e01b81526004016020604051808303816000875af1158015611c38573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c5c9190613e27565b6040517f21e3780100000000000000000000000000000000000000000000000000000000815230600482015290915073a39739ef8b0231dbfa0dcda07d7e29faabcf4bb2906321e3780190602401602060405180830381865afa158015611cc7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ceb9190613e27565b60011415611da8576040517fd293c7100000000000000000000000000000000000000000000000000000000081523060048201526024810182905260009073a39739ef8b0231dbfa0dcda07d7e29faabcf4bb29063d293c71090604401602060405180830381865afa158015611d65573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d899190613e27565b905080611d968386613fa4565b611da09190613fe1565b925050611df4565b680ad78ebc5ac62000007f0000000000000000000000000000000000000000000000002629f66e0c530000611ddd8386613fa4565b611de79190613fe1565b611df19190613ed4565b91505b6040517f4e443d9e0000000000000000000000000000000000000000000000000000000081526004810182905273a39739ef8b0231dbfa0dcda07d7e29faabcf4bb290634e443d9e90602401602060405180830381865afa158015611e5d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e819190613eeb565b611f3e57600073a39739ef8b0231dbfa0dcda07d7e29faabcf4bb273ffffffffffffffffffffffffffffffffffffffff166366ca4a216040518163ffffffff1660e01b8152600401602060405180830381865afa158015611ee6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f0a9190613e27565b9050611f1e81670de0b6b3a7640000613f6f565b611f3084670de0b6b3a7640000613fa4565b611f3a9190613fe1565b9250505b50919050565b60008413158015611f56575060008313155b15611f8d576040517fa97dc2bb00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b33734e0924d3a751be199c426d52fb1f2337fa96f73614156121aa576000611fb78284018461404b565b9050600080611fc4613900565b602085015185516040517fc6a6cf2000000000000000000000000000000000000000000000000000000000815260006004820181905260248201939093526044810191909152606481019190915273ffffffffffffffffffffffffffffffffffffffff8084166084830152821660a482015291935091507324179cd81c9e782a4096035f7ec97fb8b783e0079063c6a6cf209060c401600060405180830381600087803b15801561207457600080fd5b505af1158015612088573d6000803e3d6000fd5b505050507388e6a0c2ddd26feeb64f039a2c41296fcb3f564073ffffffffffffffffffffffffffffffffffffffff1663128acb08734e0924d3a751be199c426d52fb1f2337fa96f7366000896120dd906140c1565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e086901b16815273ffffffffffffffffffffffffffffffffffffffff90931660048401529015156024830152604482015273fffd8963efd1fc6a506488495d951d5263988d25606482015260a06084820152600060a482015260c40160408051808303816000875af115801561217c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121a091906140fa565b5050505050610c99565b337388e6a0c2ddd26feeb64f039a2c41296fcb3f564014156122f157600083905073c02aaa39b223fe8d0a0e5c4f27ead9083c756cc273ffffffffffffffffffffffffffffffffffffffff1663d0e30db0826040518263ffffffff1660e01b81526004016000604051808303818588803b15801561222757600080fd5b505af115801561223b573d6000803e3d6000fd5b50506040517fa9059cbb0000000000000000000000000000000000000000000000000000000081527388e6a0c2ddd26feeb64f039a2c41296fcb3f564060048201526024810185905273c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2935063a9059cbb925060440190506020604051808303816000875af11580156122c6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122ea9190613eeb565b5050610c99565b6040517f48f5c3ed00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60606000612330836123eb565b600101905060008167ffffffffffffffff8111156123505761235061401c565b6040519080825280601f01601f19166020018201604052801561237a576020820181803683370190505b5090508181016020015b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff017f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a85049450846123de576123e3565b612384565b509392505050565b6000807a184f03e93ff9f4daa797ed6e38ed64bf6a1f0100000000000000008310612434577a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000830492506040015b6d04ee2d6d415b85acef81000000008310612460576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc10000831061247e57662386f26fc10000830492506010015b6305f5e1008310612496576305f5e100830492506008015b61271083106124aa57612710830492506004015b606483106124bc576064830492506002015b600a83106124c8576001015b92915050565b73ffffffffffffffffffffffffffffffffffffffff8316612570576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460448201527f72657373000000000000000000000000000000000000000000000000000000006064820152608401610ada565b73ffffffffffffffffffffffffffffffffffffffff8216612613576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f20616464726560448201527f73730000000000000000000000000000000000000000000000000000000000006064820152608401610ada565b73ffffffffffffffffffffffffffffffffffffffff83811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b60055473ffffffffffffffffffffffffffffffffffffffff1633146113c7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610ada565b73ffffffffffffffffffffffffffffffffffffffff82166127a6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360448201527f73000000000000000000000000000000000000000000000000000000000000006064820152608401610ada565b73ffffffffffffffffffffffffffffffffffffffff82166000908152602081905260409020548181101561285c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60448201527f63650000000000000000000000000000000000000000000000000000000000006064820152608401610ada565b73ffffffffffffffffffffffffffffffffffffffff83166000818152602081815260408083208686039055600280548790039055518581529192917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9101612675565b73ffffffffffffffffffffffffffffffffffffffff8381166000908152600160209081526040808320938616835292905220547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8114610c995781811015612983576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401610ada565b610c9984848484036124ce565b73ffffffffffffffffffffffffffffffffffffffff8316612a33576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f20616460448201527f64726573730000000000000000000000000000000000000000000000000000006064820152608401610ada565b73ffffffffffffffffffffffffffffffffffffffff8216612ad6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201527f65737300000000000000000000000000000000000000000000000000000000006064820152608401610ada565b73ffffffffffffffffffffffffffffffffffffffff831660009081526020819052604090205481811015612b8c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206260448201527f616c616e636500000000000000000000000000000000000000000000000000006064820152608401610ada565b73ffffffffffffffffffffffffffffffffffffffff848116600081815260208181526040808320878703905593871680835291849020805487019055925185815290927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3610c99565b600080612c0b84611b66565b6040517fb91af97c00000000000000000000000000000000000000000000000000000000815230600482015290915060009073a39739ef8b0231dbfa0dcda07d7e29faabcf4bb29063b91af97c90602401608060405180830381865afa158015612c79573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c9d9190613e6f565b5050509050600080612cad613900565b6040517fc6a6cf2000000000000000000000000000000000000000000000000000000000815267ffffffffffffffff8916600482015260006024820152604481018790526001606482015273ffffffffffffffffffffffffffffffffffffffff8084166084830152821660a482015291935091507324179cd81c9e782a4096035f7ec97fb8b783e0079063c6a6cf2090899060c4016000604051808303818588803b158015612d5b57600080fd5b505af1158015612d6f573d6000803e3d6000fd5b50506040517fb91af97c0000000000000000000000000000000000000000000000000000000081523060048201526000935073a39739ef8b0231dbfa0dcda07d7e29faabcf4bb2925063b91af97c9150602401608060405180830381865afa158015612ddf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e039190613e6f565b505050905083612e11610c9f565b612e1b8684613ed4565b612e259190613fa4565b612e2f9190613fe1565b9550612e3b308761380d565b505050509250929050565b6040517fb91af97c00000000000000000000000000000000000000000000000000000000815230600482015260009081908190819073a39739ef8b0231dbfa0dcda07d7e29faabcf4bb29063b91af97c90602401608060405180830381865afa158015612eb7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612edb9190613e6f565b5050915091506000612eeb610c9f565b9050600081612efa858a613fa4565b612f049190613fe1565b905087811115612f40576040517fc412cb0e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600082612f4d858b613fa4565b612f579190613fe1565b9050600080612f64613900565b6040517fc6a6cf200000000000000000000000000000000000000000000000000000000081526000600482018190526024820187905260448201889052606482015273ffffffffffffffffffffffffffffffffffffffff8084166084830152821660a482015291935091507324179cd81c9e782a4096035f7ec97fb8b783e0079063c6a6cf209060c401600060405180830381600087803b15801561300857600080fd5b505af115801561301c573d6000803e3d6000fd5b50505050838b61302c9190613ed4565b975047985061303b308c612703565b6040517f12a53623000000000000000000000000000000000000000000000000000000008152600481018b90527f000000000000000000000000ff1f2b4adb9df6fc8eafecdcbf96a2b35168045573ffffffffffffffffffffffffffffffffffffffff16906312a53623908b906024016000604051808303818588803b1580156130c457600080fd5b505af11580156130d8573d6000803e3d6000fd5b5050505050505050505050509250929050565b6040517fb91af97c00000000000000000000000000000000000000000000000000000000815230600482015260009081908190819073a39739ef8b0231dbfa0dcda07d7e29faabcf4bb29063b91af97c90602401608060405180830381865afa15801561315c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131809190613e6f565b5050915091506000613190610c9f565b905060008161319f858c613fa4565b6131a99190613fe1565b90506000826131b8858d613fa4565b6131c29190613fe1565b905060008815613216578b8311613205576040517fc412cb0e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61320f8c84613ed4565b9050613219565b50815b476000734e0924d3a751be199c426d52fb1f2337fa96f736308261323c866140c1565b6040805180820182528a815260209081018a815282519182018c90525181830152815180820383018152606082019092526132929493929173fffd8963efd1fc6a506488495d951d5263988d259160840161411e565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f128acb0800000000000000000000000000000000000000000000000000000000179052516133139190614170565b6000604051808303816000865af19150503d8060008114613350576040519150601f19603f3d011682016040523d82523d6000602084013e613355565b606091505b5050905080156133e5576133698247613ed4565b99506000670de0b6b3a76400006133808f86613fa4565b61338a9190613fe1565b905060006133988c87613ed4565b9050818111156133d4576040517f5fef763a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50506133e0308f612703565b61353a565b8a15613508578d94506000886133fb8888613fa4565b6134059190613fe1565b9050866134128983613fa4565b61341c9190613fe1565b9450600080613429613900565b6040517fc6a6cf20000000000000000000000000000000000000000000000000000000008152600060048201819052602482018b9052604482018c9052606482015273ffffffffffffffffffffffffffffffffffffffff8084166084830152821660a482015291935091507324179cd81c9e782a4096035f7ec97fb8b783e0079063c6a6cf209060c401600060405180830381600087803b1580156134cd57600080fd5b505af11580156134e1573d6000803e3d6000fd5b505050505050808f6134f39190613ed4565b99506134ff3082612703565b479a505061353a565b6040517f81ceff3000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f12a53623000000000000000000000000000000000000000000000000000000008152600481018d905273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000ff1f2b4adb9df6fc8eafecdcbf96a2b35168045516906312a53623908c906024016000604051808303818588803b1580156135c357600080fd5b505af11580156135d7573d6000803e3d6000fd5b5050505050505050505050505094509492505050565b60055460009074010000000000000000000000000000000000000000900460ff166136c6577324179cd81c9e782a4096035f7ec97fb8b783e00773ffffffffffffffffffffffffffffffffffffffff16636f0b0c1c6040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561366e57600080fd5b505af1158015613682573d6000803e3d6000fd5b5050600580547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff167401000000000000000000000000000000000000000017905550505b6136ce610c9f565b6136d88447613fa4565b6136e29190613fe1565b90506136ee3084612703565b6040517f12a53623000000000000000000000000000000000000000000000000000000008152600481018390527f000000000000000000000000ff1f2b4adb9df6fc8eafecdcbf96a2b35168045573ffffffffffffffffffffffffffffffffffffffff16906312a536239083906024016000604051808303818588803b15801561377757600080fd5b505af115801561378b573d6000803e3d6000fd5b505050505092915050565b6005805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b73ffffffffffffffffffffffffffffffffffffffff821661388a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610ada565b806002600082825461389c9190613f6f565b909155505073ffffffffffffffffffffffffffffffffffffffff8216600081815260208181526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b6040517fb72703ac0000000000000000000000000000000000000000000000000000000081523060048201526000908190738fdd3fbfeb32b28fb73555518f8b361bcea741a69063b72703ac90602401602060405180830381865afa15801561396d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906139919190613f87565b6040517f765e0159000000000000000000000000000000000000000000000000000000008152306004820152738fdd3fbfeb32b28fb73555518f8b361bcea741a69063765e015990602401602060405180830381865afa1580156139f9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613a1d9190613f87565b915091509091565b60005b83811015613a40578181015183820152602001613a28565b83811115610c995750506000910152565b60008151808452613a69816020860160208601613a25565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b602081526000613aae6020830184613a51565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff81168114611b6357600080fd5b60008060408385031215613aea57600080fd5b8235613af581613ab5565b946020939093013593505050565b600080600060608486031215613b1857600080fd5b8335613b2381613ab5565b92506020840135613b3381613ab5565b929592945050506040919091013590565b600060608284031215611f3e57600080fd5b803567ffffffffffffffff81168114613b6e57600080fd5b919050565b600080600080600080600080610200898b031215613b9057600080fd5b613b9a8a8a613b44565b9750613ba98a60608b01613b44565b9650613bb88a60c08b01613b44565b9550613bc88a6101208b01613b44565b945061018089013593506101a08901359250613be76101c08a01613b56565b91506101e0890135613bf881613ab5565b809150509295985092959890939650565b600060208284031215613c1b57600080fd5b8135613aae81613ab5565b6000806000806000806101c08789031215613c4057600080fd5b613c4a8888613b44565b9550613c598860608901613b44565b9450613c688860c08901613b44565b9350613c78886101208901613b44565b92506101808701359150613c8f6101a08801613b56565b90509295509295509295565b60008060008060006101a08688031215613cb457600080fd5b613cbe8787613b44565b9450613ccd8760608801613b44565b9350613cdc8760c08801613b44565b9250613cec876101208801613b44565b9150613cfb6101808701613b56565b90509295509295909350565b60008060408385031215613d1a57600080fd5b8235613d2581613ab5565b91506020830135613d3581613ab5565b809150509250929050565b600060208284031215613d5257600080fd5b5035919050565b60008060008060608587031215613d6f57600080fd5b8435935060208501359250604085013567ffffffffffffffff80821115613d9557600080fd5b818701915087601f830112613da957600080fd5b813581811115613db857600080fd5b886020828501011115613dca57600080fd5b95989497505060200194505050565b600181811c90821680613ded57607f821691505b60208210811415611f3e577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060208284031215613e3957600080fd5b5051919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b60008060008060808587031215613e8557600080fd5b505082516020840151604085015160609095015191969095509092509050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600082821015613ee657613ee6613ea5565b500390565b600060208284031215613efd57600080fd5b81518015158114613aae57600080fd5b600060208284031215613f1f57600080fd5b813560048110613aae57600080fd5b6020810160058310613f69577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b91905290565b60008219821115613f8257613f82613ea5565b500190565b600060208284031215613f9957600080fd5b8151613aae81613ab5565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613fdc57613fdc613ea5565b500290565b600082614017577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60006040828403121561405d57600080fd5b6040516040810181811067ffffffffffffffff821117156140a7577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604052823581526020928301359281019290925250919050565b60007f80000000000000000000000000000000000000000000000000000000000000008214156140f3576140f3613ea5565b5060000390565b6000806040838503121561410d57600080fd5b505080516020909101519092909150565b600073ffffffffffffffffffffffffffffffffffffffff8088168352861515602084015285604084015280851660608401525060a0608083015261416560a0830184613a51565b979650505050505050565b60008251614182818460208701613a25565b919091019291505056fea2646970667358221220660135116eff8bf14ff203845176838e7898dc5627f5a464d1ae7665d0c0134f64736f6c634300080a0033

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

000000000000000000000000ff1f2b4adb9df6fc8eafecdcbf96a2b3516804550000000000000000000000000000000000000000000000000000000000000113

-----Decoded View---------------
Arg [0] : _rollupProcessor (address): 0xFF1F2B4ADb9dF6FC8eAFecDcbF96A2B351680455
Arg [1] : _initialICRPerc (uint256): 275

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 000000000000000000000000ff1f2b4adb9df6fc8eafecdcbf96a2b351680455
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000113


Loading...
Loading
Loading...
Loading
[ Download: CSV Export  ]
[ Download: CSV Export  ]

A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.