ETH Price: $3,259.27 (+1.13%)
Gas: 3.3 Gwei

Contract

0x406B4C4C7A8BA64220AA483de7fcf310779EA2B0
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To

There are no matching entries

Please try again later

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
DebtLocker

Compiler Version
v0.8.7+commit.e28d00a7

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 18 : DebtLocker.sol
// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity 0.8.7;

import { ERC20Helper }           from "../modules/erc20-helper/src/ERC20Helper.sol";
import { Liquidator }            from "../modules/liquidations/contracts/Liquidator.sol";
import { IMapleProxyFactory }    from "../modules/maple-proxy-factory/contracts/interfaces/IMapleProxyFactory.sol";
import { MapleProxiedInternals } from "../modules/maple-proxy-factory/contracts/MapleProxiedInternals.sol";

import { IDebtLocker }                                                                from "./interfaces/IDebtLocker.sol";
import { IERC20Like, IMapleGlobalsLike, IMapleLoanLike, IPoolLike, IPoolFactoryLike } from "./interfaces/Interfaces.sol";

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

/// @title DebtLocker interacts with Loans on behalf of PoolV1.
contract DebtLocker is IDebtLocker, DebtLockerStorage, MapleProxiedInternals {

    /*****************/
    /*** Modifiers ***/
    /*****************/

    modifier whenProtocolNotPaused() {
        require(!IMapleGlobalsLike(_getGlobals()).protocolPaused(), "DL:PROTOCOL_PAUSED");
        _;
    }

    /********************************/
    /*** Administrative Functions ***/
    /********************************/

    function migrate(address migrator_, bytes calldata arguments_) external override {
        require(msg.sender == _factory(),        "DL:M:NOT_FACTORY");
        require(_migrate(migrator_, arguments_), "DL:M:FAILED");
    }

    function setImplementation(address newImplementation_) external override {
        require(msg.sender == _factory(),               "DL:SI:NOT_FACTORY");
        require(_setImplementation(newImplementation_), "DL:SI:FAILED");
    }

    function upgrade(uint256 toVersion_, bytes calldata arguments_) external override {
        require(msg.sender == _getPoolDelegate(), "DL:U:NOT_POOL_DELEGATE");

        emit Upgraded(toVersion_, arguments_);

        IMapleProxyFactory(_factory()).upgradeInstance(toVersion_, arguments_);
    }

    /*******************************/
    /*** Pool Delegate Functions ***/
    /*******************************/

    function acceptNewTerms(address refinancer_, uint256 deadline_, bytes[] calldata calls_, uint256 amount_) external override whenProtocolNotPaused {
        require(msg.sender == _getPoolDelegate(), "DL:ANT:NOT_PD");

        address loanAddress = _loan;

        require(
            (IMapleLoanLike(loanAddress).claimableFunds() + _fundsToCapture == uint256(0)) &&
            (IMapleLoanLike(loanAddress).principal() == _principalRemainingAtLastClaim),
            "DL:ANT:NEED_TO_CLAIM"
        );

        require(
            amount_ == uint256(0) || ERC20Helper.transfer(IMapleLoanLike(loanAddress).fundsAsset(), loanAddress, amount_),
            "DL:ANT:TRANSFER_FAILED"
        );

        IMapleLoanLike(loanAddress).acceptNewTerms(refinancer_, deadline_, calls_, uint256(0));

        // NOTE: This must be set after accepting the new terms, which affects the loan principal.
        _principalRemainingAtLastClaim = IMapleLoanLike(loanAddress).principal();
    }

    function claim() external override whenProtocolNotPaused returns (uint256[7] memory details_) {
        require(msg.sender == _pool, "DL:C:NOT_POOL");

        return _repossessed ? _handleClaimOfRepossessed(msg.sender, _loan) : _handleClaim(msg.sender, _loan);
    }

    function pullFundsFromLiquidator(address liquidator_, address token_, address destination_, uint256 amount_) external override {
        require(msg.sender == _getPoolDelegate(), "DL:SA:NOT_PD");

        Liquidator(liquidator_).pullFunds(token_, destination_, amount_);
    }

    function rejectNewTerms(address refinancer_, uint256 deadline_, bytes[] calldata calls_) external override {
        require(msg.sender == _getPoolDelegate(), "DL:ANT:NOT_PD");

        IMapleLoanLike(_loan).rejectNewTerms(refinancer_, deadline_, calls_);
    }

    function setAllowedSlippage(uint256 allowedSlippage_) external override whenProtocolNotPaused {
        require(msg.sender == _getPoolDelegate(),    "DL:SAS:NOT_PD");
        require(allowedSlippage_ <= uint256(10_000), "DL:SAS:INVALID_SLIPPAGE");

        emit AllowedSlippageSet(_allowedSlippage = allowedSlippage_);
    }

    function setAuctioneer(address auctioneer_) external override whenProtocolNotPaused {
        require(msg.sender == _getPoolDelegate(), "DL:SA:NOT_PD");

        emit AuctioneerSet(auctioneer_);

        Liquidator(_liquidator).setAuctioneer(auctioneer_);
    }

    function setFundsToCapture(uint256 amount_) override external whenProtocolNotPaused {
        require(msg.sender == _getPoolDelegate(), "DL:SFTC:NOT_PD");

        emit FundsToCaptureSet(_fundsToCapture = amount_);
    }

    function setMinRatio(uint256 minRatio_) external override whenProtocolNotPaused {
        require(msg.sender == _getPoolDelegate(), "DL:SMR:NOT_PD");

        emit MinRatioSet(_minRatio = minRatio_);
    }

    // Pool delegate can prematurely stop liquidation when there's still significant amount to be liquidated.
    function stopLiquidation() external override {
        require(msg.sender == _getPoolDelegate(), "DL:SL:NOT_PD");

        _liquidator = address(0);

        emit LiquidationStopped();
    }

    function triggerDefault() external override whenProtocolNotPaused {
        require(msg.sender == _pool, "DL:TD:NOT_POOL");

        address loanAddress = _loan;

        require(
            (IMapleLoanLike(loanAddress).claimableFunds() == uint256(0)) &&
            (IMapleLoanLike(loanAddress).principal() == _principalRemainingAtLastClaim),
            "DL:TD:NEED_TO_CLAIM"
        );

        _repossessed = true;

        // Ensure that principal is always up to date, claim function will clear out all payments, but on refinance we need to ensure that
        // accounting is updated properly when principal is updated and there are no claimable funds.

        // Repossess collateral and funds from Loan.
        ( uint256 collateralAssetAmount, ) = IMapleLoanLike(loanAddress).repossess(address(this));

        address collateralAsset = IMapleLoanLike(loanAddress).collateralAsset();
        address fundsAsset      = IMapleLoanLike(loanAddress).fundsAsset();

        if (collateralAsset == fundsAsset || collateralAssetAmount == uint256(0)) return;

        // Deploy Liquidator contract and transfer collateral.
        require(
            ERC20Helper.transfer(
                collateralAsset,
                _liquidator = address(new Liquidator(address(this), collateralAsset, fundsAsset, address(this), address(this), _getGlobals())),
                collateralAssetAmount
            ),
            "DL:TD:TRANSFER"
       );
    }

    /**************************/
    /*** Internal Functions ***/
    /**************************/

    function _handleClaim(address pool_, address loan_) internal returns (uint256[7] memory details_) {
        // Get loan state variables needed
        uint256 claimableFunds = IMapleLoanLike(loan_).claimableFunds();

        require(claimableFunds > uint256(0), "DL:HC:NOTHING_TO_CLAIM");

        // Send funds to pool
        IMapleLoanLike(loan_).claimFunds(claimableFunds, pool_);

        uint256 currentPrincipalRemaining = IMapleLoanLike(loan_).principal();

        // Determine how much of `claimableFunds` is principal
        uint256 principalPortion = _principalRemainingAtLastClaim - currentPrincipalRemaining;

        // Update state variables
        _principalRemainingAtLastClaim = currentPrincipalRemaining;

        // Set return values
        // Note: All fees get deducted and transferred during `loan.fundLoan()` that omits the need to
        // return the fees distribution to the pool.
        details_[0] = claimableFunds;
        details_[1] = claimableFunds - principalPortion;
        details_[2] = principalPortion;

        uint256 amountOfFundsToCapture = _fundsToCapture;

        if (amountOfFundsToCapture > uint256(0)) {
            details_[0] += amountOfFundsToCapture;
            details_[2] += amountOfFundsToCapture;

            _fundsToCapture = uint256(0);

            require(ERC20Helper.transfer(IMapleLoanLike(loan_).fundsAsset(), pool_, amountOfFundsToCapture), "DL:HC:CAPTURE_FAILED");
        }
    }

    function _handleClaimOfRepossessed(address pool_, address loan_) internal returns (uint256[7] memory details_) {
        require(!_isLiquidationActive(), "DL:HCOR:LIQ_NOT_FINISHED");

        address fundsAsset       = IMapleLoanLike(loan_).fundsAsset();
        uint256 principalToCover = _principalRemainingAtLastClaim;      // Principal remaining at time of liquidation
        uint256 fundsCaptured    = _fundsToCapture;

        // Funds recovered from liquidation and any unclaimed previous payment amounts
        uint256 recoveredFunds = IERC20Like(fundsAsset).balanceOf(address(this)) - fundsCaptured;

        uint256 totalClaimed = recoveredFunds + fundsCaptured;

        // If `recoveredFunds` is greater than `principalToCover`, the remaining amount is treated as interest in the context of the pool.
        // If `recoveredFunds` is less than `principalToCover`, the difference is registered as a shortfall.
        details_[0] = totalClaimed;
        details_[1] = recoveredFunds > principalToCover ? recoveredFunds - principalToCover : uint256(0);
        details_[2] = fundsCaptured;
        details_[5] = recoveredFunds > principalToCover ? principalToCover : recoveredFunds;
        details_[6] = principalToCover > recoveredFunds ? principalToCover - recoveredFunds : uint256(0);

        _fundsToCapture = uint256(0);
        _repossessed    = false;

        require(ERC20Helper.transfer(fundsAsset, pool_, totalClaimed), "DL:HCOR:TRANSFER");
    }

    /**********************/
    /*** View Functions ***/
    /**********************/

    function allowedSlippage() external view override returns (uint256 allowedSlippage_) {
        return _allowedSlippage;
    }

    function amountRecovered() external view override returns (uint256 amountRecovered_) {
        return _amountRecovered;
    }

    function factory() external view override returns (address factory_) {
        return _factory();
    }

    function fundsToCapture() external view override returns (uint256 fundsToCapture_) {
        return _fundsToCapture;
    }

    function getExpectedAmount(uint256 swapAmount_) external view override whenProtocolNotPaused returns (uint256 returnAmount_) {
        address loanAddress     = _loan;
        address collateralAsset = IMapleLoanLike(loanAddress).collateralAsset();
        address fundsAsset      = IMapleLoanLike(loanAddress).fundsAsset();
        address globals         = _getGlobals();

        uint8 collateralAssetDecimals = IERC20Like(collateralAsset).decimals();

        uint256 oracleAmount =
            swapAmount_
                * IMapleGlobalsLike(globals).getLatestPrice(collateralAsset)  // Convert from `fromAsset` value.
                * uint256(10) ** uint256(IERC20Like(fundsAsset).decimals())   // Convert to `toAsset` decimal precision.
                * (uint256(10_000) - _allowedSlippage)                        // Multiply by allowed slippage basis points
                / IMapleGlobalsLike(globals).getLatestPrice(fundsAsset)       // Convert to `toAsset` value.
                / uint256(10) ** uint256(collateralAssetDecimals)             // Convert from `fromAsset` decimal precision.
                / uint256(10_000);                                            // Divide basis points for slippage.

        uint256 minRatioAmount = (swapAmount_ * _minRatio) / (uint256(10) ** collateralAssetDecimals);

        return oracleAmount > minRatioAmount ? oracleAmount : minRatioAmount;
    }

    function implementation() external view override returns (address implementation_) {
        return _implementation();
    }

    function liquidator() external view override returns (address liquidator_) {
        return _liquidator;
    }

    function loan() external view override returns (address loan_) {
        return _loan;
    }

    function minRatio() external view override returns (uint256 minRatio_) {
        return _minRatio;
    }

    function pool() external view override returns (address pool_) {
        return _pool;
    }

    function poolDelegate() external override view returns (address poolDelegate_) {
        return _getPoolDelegate();
    }

    function principalRemainingAtLastClaim() external view override returns (uint256 principalRemainingAtLastClaim_) {
        return _principalRemainingAtLastClaim;
    }

    function repossessed() external view override returns (bool repossessed_) {
        return _repossessed;
    }

    /*******************************/
    /*** Internal View Functions ***/
    /*******************************/

    function _getGlobals() internal view returns (address globals_) {
        return IPoolFactoryLike(IPoolLike(_pool).superFactory()).globals();
    }

    function _getPoolDelegate() internal view returns(address poolDelegate_) {
        return IPoolLike(_pool).poolDelegate();
    }

    function _isLiquidationActive() internal view returns (bool isActive_) {
        address liquidatorAddress = _liquidator;

        return (liquidatorAddress != address(0)) && (IERC20Like(IMapleLoanLike(_loan).collateralAsset()).balanceOf(liquidatorAddress) != uint256(0));
    }

}

File 2 of 18 : ERC20Helper.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity ^0.8.7;

import { IERC20Like } from "./interfaces/IERC20Like.sol";

/**
 * @title Small Library to standardize erc20 token interactions.
 */
library ERC20Helper {

    /**************************/
    /*** Internal Functions ***/
    /**************************/

    function transfer(address token_, address to_, uint256 amount_) internal returns (bool success_) {
        return _call(token_, abi.encodeWithSelector(IERC20Like.transfer.selector, to_, amount_));
    }

    function transferFrom(address token_, address from_, address to_, uint256 amount_) internal returns (bool success_) {
        return _call(token_, abi.encodeWithSelector(IERC20Like.transferFrom.selector, from_, to_, amount_));
    }

    function approve(address token_, address spender_, uint256 amount_) internal returns (bool success_) {
        // If setting approval to zero fails, return false.
        if (!_call(token_, abi.encodeWithSelector(IERC20Like.approve.selector, spender_, uint256(0)))) return false;

        // If `amount_` is zero, return true as the previous step already did this.
        if (amount_ == uint256(0)) return true;

        // Return the result of setting the approval to `amount_`.
        return _call(token_, abi.encodeWithSelector(IERC20Like.approve.selector, spender_, amount_));
    }

    function _call(address token_, bytes memory data_) private returns (bool success_) {
        if (token_.code.length == uint256(0)) return false;

        bytes memory returnData;
        ( success_, returnData ) = token_.call(data_);

        return success_ && (returnData.length == uint256(0) || abi.decode(returnData, (bool)));
    }

}

File 3 of 18 : Liquidator.sol
// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity 0.8.7;

import { ERC20Helper } from "../modules/erc20-helper/src/ERC20Helper.sol";

import { ILiquidator }                        from "./interfaces/ILiquidator.sol";
import { IAuctioneerLike, IMapleGlobalsLike } from "./interfaces/Interfaces.sol";

contract Liquidator is ILiquidator {

    uint256 private constant NOT_LOCKED = uint256(0);
    uint256 private constant LOCKED     = uint256(1);

    uint256 internal _locked;

    address public override immutable collateralAsset;
    address public override immutable destination;
    address public override immutable fundsAsset;
    address public override immutable globals;
    address public override immutable owner;

    address public override auctioneer;

    /*****************/
    /*** Modifiers ***/
    /*****************/

    modifier whenProtocolNotPaused() {
        require(!IMapleGlobalsLike(globals).protocolPaused(), "LIQ:PROTOCOL_PAUSED");
        _;
    }

    modifier lock() {
        require(_locked == NOT_LOCKED, "LIQ:LOCKED");
        _locked = LOCKED;
        _;
        _locked = NOT_LOCKED;
    }

    /**
     * @param owner_           The address of an account that will have administrative privileges on this contract.
     * @param collateralAsset_ The address of the collateral asset being liquidated.
     * @param fundsAsset_      The address of the funds asset.
     * @param auctioneer_      The address of an Auctioneer.
     * @param destination_     The address to send funds asset after liquidation.
     * @param globals_         The address of a Maple Globals contract.
     */
    constructor(address owner_, address collateralAsset_, address fundsAsset_, address auctioneer_, address destination_, address globals_) {
        require((owner           = owner_)           != address(0), "LIQ:C:INVALID_OWNER");
        require((collateralAsset = collateralAsset_) != address(0), "LIQ:C:INVALID_COL_ASSET");
        require((fundsAsset      = fundsAsset_)      != address(0), "LIQ:C:INVALID_FUNDS_ASSET");
        require((destination     = destination_)     != address(0), "LIQ:C:INVALID_DEST");

        require(!IMapleGlobalsLike(globals = globals_).protocolPaused(), "LIQ:C:INVALID_GLOBALS");

        // NOTE: Auctioneer of zero is valid, since it is starting the contract off in a paused state.
        auctioneer = auctioneer_;
    }

    function setAuctioneer(address auctioneer_) external override {
        require(msg.sender == owner, "LIQ:SA:NOT_OWNER");

        emit AuctioneerSet(auctioneer = auctioneer_);
    }

    function pullFunds(address token_, address destination_, uint256 amount_) external override {
        require(msg.sender == owner, "LIQ:PF:NOT_OWNER");

        emit FundsPulled(token_, destination_, amount_);

        require(ERC20Helper.transfer(token_, destination_, amount_), "LIQ:PF:TRANSFER");
    }

    function getExpectedAmount(uint256 swapAmount_) public view override returns (uint256 expectedAmount_) {
        return IAuctioneerLike(auctioneer).getExpectedAmount(swapAmount_);
    }

    function liquidatePortion(uint256 collateralAmount_, uint256 maxReturnAmount_, bytes calldata data_) external override whenProtocolNotPaused lock {
        // Transfer a requested amount of collateralAsset to the borrwer.
        require(ERC20Helper.transfer(collateralAsset, msg.sender, collateralAmount_), "LIQ:LP:TRANSFER");

        // Perform a low-level call to msg.sender, allowing a swap strategy to be executed with the transferred collateral.
        msg.sender.call(data_);

        // Calculate the amount of fundsAsset required based on the amount of collateralAsset borrowed.
        uint256 returnAmount = getExpectedAmount(collateralAmount_);
        require(returnAmount <= maxReturnAmount_, "LIQ:LP:MAX_RETURN_EXCEEDED");

        emit PortionLiquidated(collateralAmount_, returnAmount);

        // Pull required amount of fundsAsset from the borrower, if this amount of funds cannot be recovered atomically, revert.
        require(ERC20Helper.transferFrom(fundsAsset, msg.sender, destination, returnAmount), "LIQ:LP:TRANSFER_FROM");
    }

}

File 4 of 18 : IMapleProxyFactory.sol
// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity 0.8.7;

import { IDefaultImplementationBeacon } from "../../modules/proxy-factory/contracts/interfaces/IDefaultImplementationBeacon.sol";

/// @title A Maple factory for Proxy contracts that proxy MapleProxied implementations.
interface IMapleProxyFactory is IDefaultImplementationBeacon {

    /**************/
    /*** Events ***/
    /**************/

    /**
     *  @dev   A default version was set.
     *  @param version_ The default version.
     */
    event DefaultVersionSet(uint256 indexed version_);

    /**
     *  @dev   A version of an implementation, at some address, was registered, with an optional initializer.
     *  @param version_               The version registered.
     *  @param implementationAddress_ The address of the implementation.
     *  @param initializer_           The address of the initializer, if any.
     */
    event ImplementationRegistered(uint256 indexed version_, address indexed implementationAddress_, address indexed initializer_);

    /**
     *  @dev   A proxy contract was deployed with some initialization arguments.
     *  @param version_                 The version of the implementation being proxied by the deployed proxy contract.
     *  @param instance_                The address of the proxy contract deployed.
     *  @param initializationArguments_ The arguments used to initialize the proxy contract, if any.
     */
    event InstanceDeployed(uint256 indexed version_, address indexed instance_, bytes initializationArguments_);

    /**
     *  @dev   A instance has upgraded by proxying to a new implementation, with some migration arguments.
     *  @param instance_           The address of the proxy contract.
     *  @param fromVersion_        The initial implementation version being proxied.
     *  @param toVersion_          The new implementation version being proxied.
     *  @param migrationArguments_ The arguments used to migrate, if any.
     */
    event InstanceUpgraded(address indexed instance_, uint256 indexed fromVersion_, uint256 indexed toVersion_, bytes migrationArguments_);

    /**
     *  @dev   The MapleGlobals was set.
     *  @param mapleGlobals_ The address of a Maple Globals contract.
     */
    event MapleGlobalsSet(address indexed mapleGlobals_);

    /**
     *  @dev   An upgrade path was disabled, with an optional migrator contract.
     *  @param fromVersion_ The starting version of the upgrade path.
     *  @param toVersion_   The destination version of the upgrade path.
     */
    event UpgradePathDisabled(uint256 indexed fromVersion_, uint256 indexed toVersion_);

    /**
     *  @dev   An upgrade path was enabled, with an optional migrator contract.
     *  @param fromVersion_ The starting version of the upgrade path.
     *  @param toVersion_   The destination version of the upgrade path.
     *  @param migrator_    The address of the migrator, if any.
     */
    event UpgradePathEnabled(uint256 indexed fromVersion_, uint256 indexed toVersion_, address indexed migrator_);

    /***********************/
    /*** State Variables ***/
    /***********************/

    /**
     *  @dev The default version.
     */
    function defaultVersion() external view returns (uint256 defaultVersion_);

    /**
     *  @dev The address of the MapleGlobals contract.
     */
    function mapleGlobals() external view returns (address mapleGlobals_);

    /**
     *  @dev    Whether the upgrade is enabled for a path from a version to another version.
     *  @param  toVersion_   The initial version.
     *  @param  fromVersion_ The destination version.
     *  @return allowed_     Whether the upgrade is enabled.
     */
    function upgradeEnabledForPath(uint256 toVersion_, uint256 fromVersion_) external view returns (bool allowed_);

    /********************************/
    /*** State Changing Functions ***/
    /********************************/

    /**
     *  @dev    Deploys a new instance proxying the default implementation version, with some initialization arguments.
     *          Uses a nonce and `msg.sender` as a salt for the CREATE2 opcode during instantiation to produce deterministic addresses.
     *  @param  arguments_ The initialization arguments to use for the instance deployment, if any.
     *  @param  salt_      The salt to use in the contract creation process.
     *  @return instance_  The address of the deployed proxy contract.
     */
    function createInstance(bytes calldata arguments_, bytes32 salt_) external returns (address instance_);

    /**
     *  @dev   Enables upgrading from a version to a version of an implementation, with an optional migrator.
     *         Only the Governor can call this function.
     *  @param fromVersion_ The starting version of the upgrade path.
     *  @param toVersion_   The destination version of the upgrade path.
     *  @param migrator_    The address of the migrator, if any.
     */
    function enableUpgradePath(uint256 fromVersion_, uint256 toVersion_, address migrator_) external;

    /**
     *  @dev   Disables upgrading from a version to a version of a implementation.
     *         Only the Governor can call this function.
     *  @param fromVersion_ The starting version of the upgrade path.
     *  @param toVersion_   The destination version of the upgrade path.
     */
    function disableUpgradePath(uint256 fromVersion_, uint256 toVersion_) external;

    /**
     *  @dev   Registers the address of an implementation contract as a version, with an optional initializer.
     *         Only the Governor can call this function.
     *  @param version_               The version to register.
     *  @param implementationAddress_ The address of the implementation.
     *  @param initializer_           The address of the initializer, if any.
     */
    function registerImplementation(uint256 version_, address implementationAddress_, address initializer_) external;

    /**
     *  @dev   Sets the default version.
     *         Only the Governor can call this function.
     *  @param version_ The implementation version to set as the default.
     */
    function setDefaultVersion(uint256 version_) external;

    /**
     *  @dev   Sets the Maple Globals contract.
     *         Only the Governor can call this function.
     *  @param mapleGlobals_ The address of a Maple Globals contract.
     */
    function setGlobals(address mapleGlobals_) external;

    /**
     *  @dev   Upgrades the calling proxy contract's implementation, with some migration arguments.
     *  @param toVersion_ The implementation version to upgrade the proxy contract to.
     *  @param arguments_ The migration arguments, if any.
     */
    function upgradeInstance(uint256 toVersion_, bytes calldata arguments_) external;

    /**********************/
    /*** View Functions ***/
    /**********************/

    /**
     *  @dev    Returns the deterministic address of a potential proxy, given some arguments and salt.
     *  @param  arguments_       The initialization arguments to be used when deploying the proxy.
     *  @param  salt_            The salt to be used when deploying the proxy.
     *  @return instanceAddress_ The deterministic address of a potential proxy.
     */
    function getInstanceAddress(bytes calldata arguments_, bytes32 salt_) external view returns (address instanceAddress_);

    /**
     *  @dev    Returns the address of an implementation version.
     *  @param  version_        The implementation version.
     *  @return implementation_ The address of the implementation.
     */
    function implementationOf(uint256 version_) external view returns (address implementation_);

    /**
     *  @dev    Returns the address of a migrator contract for a migration path (from version, to version).
     *          If oldVersion_ == newVersion_, the migrator is an initializer.
     *  @param  oldVersion_ The old version.
     *  @param  newVersion_ The new version.
     *  @return migrator_   The address of a migrator contract.
     */
    function migratorForPath(uint256 oldVersion_, uint256 newVersion_) external view returns (address migrator_);

    /**
     *  @dev    Returns the version of an implementation contract.
     *  @param  implementation_ The address of an implementation contract.
     *  @return version_        The version of the implementation contract.
     */
    function versionOf(address implementation_) external view returns (uint256 version_);

}

File 5 of 18 : MapleProxiedInternals.sol
// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity 0.8.7;

import { ProxiedInternals } from "../modules/proxy-factory/contracts/ProxiedInternals.sol";

/// @title A Maple implementation that is to be proxied, will need MapleProxiedInternals.
abstract contract MapleProxiedInternals is ProxiedInternals {}

File 6 of 18 : IDebtLocker.sol
// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity 0.8.7;

import { IMapleProxied } from "../../modules/maple-proxy-factory/contracts/interfaces/IMapleProxied.sol";

/// @title DebtLocker interacts with Loans on behalf of PoolV1.
interface IDebtLocker is IMapleProxied {

    /**************/
    /*** Events ***/
    /**************/

    /**
     * @dev   Emitted when `setAllowedSlippage` is called.
     * @param newSlippage_ New value for `allowedSlippage`.
     */
    event AllowedSlippageSet(uint256 newSlippage_);

    /**
     * @dev   Emitted when `setAuctioneer` is called.
     * @param newAuctioneer_ New value for `auctioneer` in Liquidator.
     */
    event AuctioneerSet(address newAuctioneer_);

    /**
     * @dev   Emitted when `fundsToCapture` is set.
     * @param amount_ The amount of funds that will be captured next claim.
     */
    event FundsToCaptureSet(uint256 amount_);

    /**
     * @dev Emitted when `stopLiquidation` is called.
     */
    event LiquidationStopped();

    /**
     * @dev   Emitted when `setMinRatio` is called.
     * @param newMinRatio_ New value for `minRatio`.
     */
    event MinRatioSet(uint256 newMinRatio_);

    /*****************/
    /*** Functions ***/
    /*****************/

    /**
     * @dev   Accept the new loan terms and trigger a refinance.
     * @param refinancer_ The address of the refinancer contract.
     * @param deadline_   The deadline of the new terms proposal.
     * @param calls_      The array of encoded data that are to be executed as delegatecalls by the refinancer.
     * @param amount_     The amount of `fundsAsset` that is to be sent to the Loan as part of the transaction.
     */
    function acceptNewTerms(address refinancer_, uint256 deadline_, bytes[] calldata calls_, uint256 amount_) external;

    /**
     *  @dev    Claims funds to send to Pool. Handles funds from payments and liquidations.
     *          Only the Pool can call this function.
     *  @return details_
     *              [0] => Total Claimed.
     *              [1] => Interest Claimed.
     *              [2] => Principal Claimed.
     *              [3] => Pool Delegate Fees Claimed.
     *              [4] => Excess Returned Claimed.
     *              [5] => Amount Recovered (from Liquidation).
     *              [6] => Default Suffered.
     */
    function claim() external returns (uint256[7] memory details_);

    /**
     * @dev   Allows the poolDelegate to pull some funds from liquidator contract.
     * @param liquidator_  The liquidator to which pull funds from.
     * @param token_       The token address of the funds.
     * @param destination_ The destination address of captured funds.
     * @param amount_      The amount to pull.
     */
    function pullFundsFromLiquidator(address liquidator_, address token_, address destination_, uint256 amount_) external;

    /**
     * @dev Returns the address of the Pool Delegate that has control of the DebtLocker.
     */
    function poolDelegate() external view returns (address poolDelegate_);

    /**
     * @dev Repossesses funds and collateral from a loan and transfers them to the Liquidator.
     */
    function triggerDefault() external;

    /**
     * @dev   Reject the new loan terms.
     * @param refinancer_ The address of the refinancer contract.
     * @param deadline_   The deadline of the new terms proposal.
     * @param calls_      The array of encoded data that are to be executed as delegatecalls by the refinancer.
     */
    function rejectNewTerms(address refinancer_, uint256 deadline_, bytes[] calldata calls_) external;

    /**
     * @dev   Sets the allowed slippage for auctioneer (used to determine expected amount to be returned in flash loan).
     * @param allowedSlippage_ Basis points representation of allowed percent slippage from market price.
     */
    function setAllowedSlippage(uint256 allowedSlippage_) external;

    /**
     * @dev   Sets the auctioneer contract for the liquidator.
     * @param auctioneer_ Address of auctioneer contract.
     */
    function setAuctioneer(address auctioneer_) external;

    /**
     * @dev   Sets the minimum "price" for auctioneer (used to determine expected amount to be returned in flash loan).
     * @param minRatio_ Price in fundsAsset precision (e.g., 10 * 10 ** 6 for $10 price for USDC).
     */
    function setMinRatio(uint256 minRatio_) external;

    /**
     * @dev    Returns the expected amount to be returned to the liquidator during a flash borrower liquidation.
     * @param  swapAmount_   Amount of collateralAsset being swapped.
     * @return returnAmount_ Amount of fundsAsset that must be returned in the same transaction.
     */
    function getExpectedAmount(uint256 swapAmount_) external view returns (uint256 returnAmount_);

    /**
     * @dev   Returns the expected amount to be returned to the liquidator during a flash borrower liquidation.
     * @param amount_ The amount of funds that should be captured next claim.
     */
    function setFundsToCapture(uint256 amount_) external;

    /**
     * @dev Called by the PoolDelegate in case of a DoS, where a user transfers small amounts of collateralAsset into the Liquidator
     *      to make `_isLiquidationActive` remain true.
     *      CALLING THIS MAY RESULT IN RECOGNIZED LOSSES IN POOL ACCOUNTING. CONSULT MAPLE TEAM FOR GUIDANCE.
     */
    function stopLiquidation() external;

    /*************/
    /*** State ***/
    /*************/

    /**
     * @dev The Loan contract this locker is holding tokens for.
     */
    function loan() external view returns (address loan_);

    /**
     * @dev The address of the liquidator.
     */
    function liquidator() external view returns (address liquidator_);

    /**
     * @dev The owner of this Locker (the Pool).
     */
    function pool() external view returns (address pool_);

    /**
     * @dev The maximum slippage allowed during liquidations.
     */
    function allowedSlippage() external view returns (uint256 allowedSlippage_);

    /**
     * @dev The amount in funds asset recovered during liquidations.
     */
    function amountRecovered() external view returns (uint256 amountRecovered_);

    /**
     * @dev The minimum exchange ration between funds asset and collateral asset.
     */
    function minRatio() external view returns (uint256 minRatio_);

    /**
     * @dev Returns the principal that was present at the time of last claim.
     */
    function principalRemainingAtLastClaim() external view returns (uint256 principalRemainingAtLastClaim_);

    /**
     * @dev Returns if the funds have been repossessed.
     */
    function repossessed() external view returns (bool repossessed_);

    /**
     * @dev Returns the amount of funds that will be captured next claim.
     */
    function fundsToCapture() external view returns (uint256 fundsToCapture_);

}

File 7 of 18 : Interfaces.sol
// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity 0.8.7;

interface IERC20Like {

    function decimals() external view returns (uint8 decimals_);

    function balanceOf(address account_) external view returns (uint256 balanceOf_);

}

interface ILiquidatorLike {

    function auctioneer() external view returns (address auctioneer_);
}

interface IMapleGlobalsLike {

   function defaultUniswapPath(address fromAsset_, address toAsset_) external view returns (address intermediateAsset_);

   function getLatestPrice(address asset_) external view returns (uint256 price_);

   function investorFee() external view returns (uint256 investorFee_);

   function isValidCollateralAsset(address asset_) external view returns (bool isValid_);

   function isValidLiquidityAsset(address asset_) external view returns (bool isValid_);

   function mapleTreasury() external view returns (address mapleTreasury_);

   function protocolPaused() external view returns (bool protocolPaused_);

   function treasuryFee() external view returns (uint256 treasuryFee_);

}

interface IMapleLoanLike {

    function acceptNewTerms(address refinancer_, uint256 deadline_, bytes[] calldata calls_, uint256 amount_) external;

    function claimableFunds() external view returns (uint256 claimableFunds_);

    function claimFunds(uint256 amount_, address destination_) external;

    function collateralAsset() external view returns (address collateralAsset_);

    function fundsAsset() external view returns (address fundsAsset_);

    function lender() external view returns (address lender_);

    function principal() external view returns (uint256 principal_);

    function principalRequested() external view returns (uint256 principalRequested_);

    function repossess(address destination_) external returns (uint256 collateralAssetAmount_, uint256 fundsAssetAmount_);

    function refinanceCommitment() external view returns (bytes32 refinanceCommitment_);

    function rejectNewTerms(address refinancer_, uint256 deadline_, bytes[] calldata calls_) external;

}

interface IPoolLike {

    function poolDelegate() external view returns (address poolDelegate_);

    function superFactory() external view returns (address superFactory_);

}

interface IPoolFactoryLike {

    function globals() external pure returns (address globals_);

}

interface IUniswapRouterLike {

    function swapExactTokensForTokens(
        uint amountIn_,
        uint amountOutMin_,
        address[] calldata path_,
        address to_,
        uint deadline_
    ) external returns (uint[] memory amounts_);

}

File 8 of 18 : DebtLockerStorage.sol
// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity 0.8.7;

/// @title DebtLockerStorage maps the storage layout of a DebtLocker.
contract DebtLockerStorage {

    address internal _liquidator;
    address internal _loan;
    address internal _pool;

    bool internal _repossessed;

    uint256 internal _allowedSlippage;
    uint256 internal _amountRecovered;
    uint256 internal _fundsToCapture;
    uint256 internal _minRatio;
    uint256 internal _principalRemainingAtLastClaim;

}

File 9 of 18 : IERC20Like.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity ^0.8.7;

/// @title Interface of the ERC20 standard as needed by ERC20Helper.
interface IERC20Like {

    function approve(address spender_, uint256 amount_) external returns (bool success_);

    function transfer(address recipient_, uint256 amount_) external returns (bool success_);

    function transferFrom(address owner_, address recipient_, uint256 amount_) external returns (bool success_);

}

File 10 of 18 : ERC20Helper.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity ^0.8.7;

import { IERC20Like } from "./interfaces/IERC20Like.sol";

/**
 * @title Small Library to standardize erc20 token interactions.
 */
library ERC20Helper {

    /**************************/
    /*** Internal Functions ***/
    /**************************/

    function transfer(address token_, address to_, uint256 amount_) internal returns (bool success_) {
        return _call(token_, abi.encodeWithSelector(IERC20Like.transfer.selector, to_, amount_));
    }

    function transferFrom(address token_, address from_, address to_, uint256 amount_) internal returns (bool success_) {
        return _call(token_, abi.encodeWithSelector(IERC20Like.transferFrom.selector, from_, to_, amount_));
    }

    function approve(address token_, address spender_, uint256 amount_) internal returns (bool success_) {
        // If setting approval to zero fails, return false.
        if (!_call(token_, abi.encodeWithSelector(IERC20Like.approve.selector, spender_, uint256(0)))) return false;

        // If `amount_` is zero, return true as the previous step already did this.
        if (amount_ == uint256(0)) return true;

        // Return the result of setting the approval to `amount_`.
        return _call(token_, abi.encodeWithSelector(IERC20Like.approve.selector, spender_, amount_));
    }

    function _call(address token_, bytes memory data_) private returns (bool success_) {
        if (token_.code.length == uint256(0)) return false;

        bytes memory returnData;
        ( success_, returnData ) = token_.call(data_);

        return success_ && (returnData.length == uint256(0) || abi.decode(returnData, (bool)));
    }

}

File 11 of 18 : ILiquidator.sol
// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity 0.8.7;

interface ILiquidator {

    /**
     * @dev   Auctioneer was set.
     * @param auctioneer_ Address of the auctioneer.
     */
    event AuctioneerSet(address auctioneer_);

    /**
     * @dev   Funds were withdrawn from the liquidator.
     * @param token_       Address of the token that was withdrawn.
     * @param destination_ Address of where tokens were sent.
     * @param amount_      Amount of tokens that were sent.
     */
    event FundsPulled(address token_, address destination_, uint256 amount_);

    /**
     * @dev   Portion of collateral was liquidated.
     * @param swapAmount_     Amount of collateralAsset that was liquidated.
     * @param returnedAmount_ Amount of fundsAsset that was returned.
     */
    event PortionLiquidated(uint256 swapAmount_, uint256 returnedAmount_);

    /**
     * @dev Getter function that returns `collateralAsset`.
     */
    function collateralAsset() external view returns (address collateralAsset_);

    /**
     * @dev Getter function that returns `destination` - address that liquidated funds are sent to.
     */
    function destination() external view returns (address destination_);

    /**
     * @dev Getter function that returns `auctioneer`.
     */
    function auctioneer() external view returns (address auctioneer_);

    /**
     * @dev Getter function that returns `fundsAsset`.
     */
    function fundsAsset() external view returns (address fundsAsset_);

    /**
     * @dev Getter function that returns `globals`.
     */
    function globals() external view returns (address);

    /**
     * @dev Getter function that returns `owner`.
     */
    function owner() external view returns (address owner_);

    /**
     * @dev   Set the auctioneer contract address, which is used to pull the `getExpectedAmount`.
     *        Can only be set by `owner`.
     * @param auctioneer_ The auctioneer contract address.
     */
    function setAuctioneer(address auctioneer_) external;

    /**
     * @dev   Pulls a specified amount of ERC-20 tokens from the contract.
     *        Can only be called by `owner`.
     * @param token_       The ERC-20 token contract address.
     * @param destination_ The destination of the transfer.
     * @param amount_      The amount to transfer.
     */
    function pullFunds(address token_, address destination_, uint256 amount_) external;

    /**
     * @dev    Returns the expected amount to be returned from a flash loan given a certain amount of `collateralAsset`.
     * @param  swapAmount_     Amount of `collateralAsset` to be flash-borrowed.
     * @return expectedAmount_ Amount of `fundsAsset` that must be returned in the same transaction.
     */
    function getExpectedAmount(uint256 swapAmount_) external returns (uint256 expectedAmount_);

    /**
     * @dev   Flash loan function that:
     *        1. Transfers a specified amount of `collateralAsset` to `msg.sender`.
     *        2. Performs an arbitrary call to `msg.sender`, to trigger logic necessary to get `fundsAsset` (e.g., AMM swap).
     *        3. Performs a `transferFrom`, taking the corresponding amount of `fundsAsset` from the user.
     *        If the required amount of `fundsAsset` is not returned in step 3, the entire transaction reverts.
     * @param swapAmount_      Amount of `collateralAsset` that is to be borrowed in the flash loan.
     * @param maxReturnAmount_ Max amount of `fundsAsset` that can be returned to the liquidator contract.
     * @param data_            ABI-encoded arguments to be used in the low-level call to perform step 2.
     */
    function liquidatePortion(uint256 swapAmount_, uint256 maxReturnAmount_, bytes calldata data_) external;

}

File 12 of 18 : Interfaces.sol
// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity 0.8.7;

interface IAuctioneerLike {

    function getExpectedAmount(uint256 swapAmount_) external view returns (uint256 expectedAmount_);

}

interface IERC20Like {

    function allowance(address account_, address spender_) external view returns (uint256 allowance_);

    function approve(address account_, uint256 amount_) external;

    function balanceOf(address account_) external view returns (uint256 balance_);

    function decimals() external view returns (uint256 decimals_);

}

interface ILiquidatorLike {

    function getExpectedAmount(uint256 swapAmount_) external returns (uint256 expectedAmount_);

    function liquidatePortion(uint256 swapAmount_, uint256 maxReturnAmount_, bytes calldata data_) external;

}

interface IMapleGlobalsLike {

    function getLatestPrice(address asset_) external view returns (uint256 price_);

    function protocolPaused() external view returns (bool protocolPaused_);

}

interface IOracleLike {

    function latestRoundData() external view returns (
        uint80  roundId_,
        int256  answer_,
        uint256 startedAt_,
        uint256 updatedAt_,
        uint80  answeredInRound_
    );

}

interface IUniswapRouterLike {

    function swapExactTokensForTokens(
        uint256 amountIn_,
        uint256 amountOutMin_,
        address[] calldata path_,
        address to_,
        uint256 deadline_
    ) external returns (uint256[] memory amounts_);

    function swapTokensForExactTokens(
        uint256 amountOut_,
        uint256 amountInMax_,
        address[] calldata path_,
        address to_,
        uint256 deadline_
    ) external returns (uint[] memory amounts_);

}

File 13 of 18 : IDefaultImplementationBeacon.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity ^0.8.7;

/// @title An beacon that provides a default implementation for proxies, must implement IDefaultImplementationBeacon.
interface IDefaultImplementationBeacon {

    /// @dev The address of an implementation for proxies.
    function defaultImplementation() external view returns (address defaultImplementation_);

}

File 14 of 18 : ProxiedInternals.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity ^0.8.7;

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

/// @title An implementation that is to be proxied, will need ProxiedInternals.
abstract contract ProxiedInternals is SlotManipulatable {

    /// @dev Storage slot with the address of the current factory. `keccak256('eip1967.proxy.factory') - 1`.
    bytes32 private constant FACTORY_SLOT = bytes32(0x7a45a402e4cb6e08ebc196f20f66d5d30e67285a2a8aa80503fa409e727a4af1);

    /// @dev Storage slot with the address of the current factory. `keccak256('eip1967.proxy.implementation') - 1`.
    bytes32 private constant IMPLEMENTATION_SLOT = bytes32(0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc);

    /// @dev Delegatecalls to a migrator contract to manipulate storage during an initialization or migration.
    function _migrate(address migrator_, bytes calldata arguments_) internal virtual returns (bool success_) {
        uint256 size;

        assembly {
            size := extcodesize(migrator_)
        }

        if (size == uint256(0)) return false;

        ( success_, ) = migrator_.delegatecall(arguments_);
    }

    /// @dev Sets the factory address in storage.
    function _setFactory(address factory_) internal virtual returns (bool success_) {
        _setSlotValue(FACTORY_SLOT, bytes32(uint256(uint160(factory_))));
        return true;
    }

    /// @dev Sets the implementation address in storage.
    function _setImplementation(address implementation_) internal virtual returns (bool success_) {
        _setSlotValue(IMPLEMENTATION_SLOT, bytes32(uint256(uint160(implementation_))));
        return true;
    }

    /// @dev Returns the factory address.
    function _factory() internal view virtual returns (address factory_) {
        return address(uint160(uint256(_getSlotValue(FACTORY_SLOT))));
    }

    /// @dev Returns the implementation address.
    function _implementation() internal view virtual returns (address implementation_) {
        return address(uint160(uint256(_getSlotValue(IMPLEMENTATION_SLOT))));
    }

}

File 15 of 18 : IMapleProxied.sol
// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity 0.8.7;

import { IProxied } from "../../modules/proxy-factory/contracts/interfaces/IProxied.sol";

/// @title A Maple implementation that is to be proxied, must implement IMapleProxied.
interface IMapleProxied is IProxied {

    /**
     *  @dev   The instance was upgraded.
     *  @param toVersion_ The new version of the loan.
     *  @param arguments_ The upgrade arguments, if any.
     */
    event Upgraded(uint256 toVersion_, bytes arguments_);

    /**
     *  @dev   Upgrades a contract implementation to a specific version.
     *         Access control logic critical since caller can force a selfdestruct via a malicious `migrator_` which is delegatecalled.
     *  @param toVersion_ The version to upgrade to.
     *  @param arguments_ Some encoded arguments to use for the upgrade.
     */
    function upgrade(uint256 toVersion_, bytes calldata arguments_) external;

}

File 16 of 18 : IERC20Like.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity ^0.8.7;

/// @title Interface of the ERC20 standard as needed by ERC20Helper.
interface IERC20Like {

    function approve(address spender_, uint256 amount_) external returns (bool success_);

    function transfer(address recipient_, uint256 amount_) external returns (bool success_);

    function transferFrom(address owner_, address recipient_, uint256 amount_) external returns (bool success_);

}

File 17 of 18 : SlotManipulatable.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity ^0.8.7;

abstract contract SlotManipulatable {

    function _getReferenceTypeSlot(bytes32 slot_, bytes32 key_) internal pure returns (bytes32 value_) {
        return keccak256(abi.encodePacked(key_, slot_));
    }

    function _getSlotValue(bytes32 slot_) internal view returns (bytes32 value_) {
        assembly {
            value_ := sload(slot_)
        }
    }

    function _setSlotValue(bytes32 slot_, bytes32 value_) internal {
        assembly {
            sstore(slot_, value_)
        }
    }

}

File 18 of 18 : IProxied.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity ^0.8.7;

/// @title An implementation that is to be proxied, must implement IProxied.
interface IProxied {

    /**
     *  @dev The address of the proxy factory.
     */
    function factory() external view returns (address factory_);

    /**
     *  @dev The address of the implementation contract being proxied.
     */
    function implementation() external view returns (address implementation_);

    /**
     *  @dev   Modifies the proxy's implementation address.
     *  @param newImplementation_ The address of an implementation contract.
     */
    function setImplementation(address newImplementation_) external;

    /**
     *  @dev   Modifies the proxy's storage by delegate-calling a migrator contract with some arguments.
     *         Access control logic critical since caller can force a selfdestruct via a malicious `migrator_` which is delegatecalled.
     *  @param migrator_  The address of a migrator contract.
     *  @param arguments_ Some encoded arguments to use for the migration.
     */
    function migrate(address migrator_, bytes calldata arguments_) external;

}

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

Contract Security Audit

Contract ABI

[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newSlippage_","type":"uint256"}],"name":"AllowedSlippageSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newAuctioneer_","type":"address"}],"name":"AuctioneerSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount_","type":"uint256"}],"name":"FundsToCaptureSet","type":"event"},{"anonymous":false,"inputs":[],"name":"LiquidationStopped","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newMinRatio_","type":"uint256"}],"name":"MinRatioSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"toVersion_","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"arguments_","type":"bytes"}],"name":"Upgraded","type":"event"},{"inputs":[{"internalType":"address","name":"refinancer_","type":"address"},{"internalType":"uint256","name":"deadline_","type":"uint256"},{"internalType":"bytes[]","name":"calls_","type":"bytes[]"},{"internalType":"uint256","name":"amount_","type":"uint256"}],"name":"acceptNewTerms","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"allowedSlippage","outputs":[{"internalType":"uint256","name":"allowedSlippage_","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"amountRecovered","outputs":[{"internalType":"uint256","name":"amountRecovered_","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claim","outputs":[{"internalType":"uint256[7]","name":"details_","type":"uint256[7]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"factory","outputs":[{"internalType":"address","name":"factory_","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"fundsToCapture","outputs":[{"internalType":"uint256","name":"fundsToCapture_","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"swapAmount_","type":"uint256"}],"name":"getExpectedAmount","outputs":[{"internalType":"uint256","name":"returnAmount_","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"implementation","outputs":[{"internalType":"address","name":"implementation_","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"liquidator","outputs":[{"internalType":"address","name":"liquidator_","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"loan","outputs":[{"internalType":"address","name":"loan_","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"migrator_","type":"address"},{"internalType":"bytes","name":"arguments_","type":"bytes"}],"name":"migrate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"minRatio","outputs":[{"internalType":"uint256","name":"minRatio_","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pool","outputs":[{"internalType":"address","name":"pool_","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"poolDelegate","outputs":[{"internalType":"address","name":"poolDelegate_","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"principalRemainingAtLastClaim","outputs":[{"internalType":"uint256","name":"principalRemainingAtLastClaim_","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"liquidator_","type":"address"},{"internalType":"address","name":"token_","type":"address"},{"internalType":"address","name":"destination_","type":"address"},{"internalType":"uint256","name":"amount_","type":"uint256"}],"name":"pullFundsFromLiquidator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"refinancer_","type":"address"},{"internalType":"uint256","name":"deadline_","type":"uint256"},{"internalType":"bytes[]","name":"calls_","type":"bytes[]"}],"name":"rejectNewTerms","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"repossessed","outputs":[{"internalType":"bool","name":"repossessed_","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"allowedSlippage_","type":"uint256"}],"name":"setAllowedSlippage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"auctioneer_","type":"address"}],"name":"setAuctioneer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount_","type":"uint256"}],"name":"setFundsToCapture","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation_","type":"address"}],"name":"setImplementation","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"minRatio_","type":"uint256"}],"name":"setMinRatio","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"stopLiquidation","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"triggerDefault","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"toVersion_","type":"uint256"},{"internalType":"bytes","name":"arguments_","type":"bytes"}],"name":"upgrade","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405234801561001057600080fd5b50613b83806100206000396000f3fe60806040523480156200001157600080fd5b5060043610620001ae5760003560e01c80634e71d92d11620000f0578063acb522b411620000a3578063c45a0155116200007a578063c45a01551462000356578063d285b7b41462000360578063d784d4261462000372578063ec029a44146200038957600080fd5b8063acb522b4146200031f578063bca93e761462000336578063c3fbb6fd146200033f57600080fd5b80634e71d92d14620002ae57806350acb4ee14620002c75780635b9df3c314620002de5780635c60da1b14620002f557806386d8745b14620002ff5780638bf44049146200030857600080fd5b806323ef42ab11620001665780634046af2b116200013d5780634046af2b146200026b5780634046ebae1462000275578063431f244514620002875780634387ebce146200029057600080fd5b806323ef42ab146200023857806339c02899146200024b5780633b99bcee146200025457600080fd5b8062ede7e414620001b357806307a08bdd14620001cc5780630d51ac0e14620001e357806316f0115b14620001ed578063175f832914620002175780632365faea1462000221575b600080fd5b620001ca620001c43660046200266c565b620003a0565b005b620001ca620001dd366004620026ac565b62000540565b620001ca6200060e565b6002546001600160a01b03165b6040516001600160a01b0390911681526020015b60405180910390f35b620001ca620006a2565b620001ca620002323660046200284f565b62000b6a565b6005545b6040519081526020016200020e565b6004546200023c565b620001ca6200026536600462002883565b62000cf4565b620001fa62000e0a565b6000546001600160a01b0316620001fa565b6003546200023c565b600254600160a01b900460ff1660405190151581526020016200020e565b620002b862000e1b565b6040516200020e919062002a81565b620001ca620002d8366004620027c1565b62000f53565b6200023c620002ef3660046200284f565b62001371565b620001fa620017d2565b6006546200023c565b620001ca620003193660046200284f565b620017de565b620001ca620003303660046200275f565b6200190f565b6007546200023c565b620001ca6200035036600462002704565b620019a3565b620001fa62001a50565b6001546001600160a01b0316620001fa565b620001ca620003833660046200266c565b62001a5c565b620001ca6200039a3660046200284f565b62001aec565b620003aa62001c1c565b6001600160a01b031663425fad586040518163ffffffff1660e01b815260040160206040518083038186803b158015620003e357600080fd5b505afa158015620003f8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200041e91906200282b565b15620004475760405162461bcd60e51b81526004016200043e9062002ab4565b60405180910390fd5b6200045162001d11565b6001600160a01b0316336001600160a01b031614620004a25760405162461bcd60e51b815260206004820152600c60248201526b11130e94d04e9393d517d41160a21b60448201526064016200043e565b6040516001600160a01b03821681527f4ee0985a129917c72eab0afe7ec6060bf6c6e0796bedc42de903d9dbbadfc51d9060200160405180910390a1600054604051623b79f960e21b81526001600160a01b0383811660048301529091169062ede7e490602401600060405180830381600087803b1580156200052457600080fd5b505af115801562000539573d6000803e3d6000fd5b5050505050565b6200054a62001d11565b6001600160a01b0316336001600160a01b0316146200059b5760405162461bcd60e51b815260206004820152600c60248201526b11130e94d04e9393d517d41160a21b60448201526064016200043e565b60405163201add9b60e01b81526001600160a01b03848116600483015283811660248301526044820183905285169063201add9b906064015b600060405180830381600087803b158015620005ef57600080fd5b505af115801562000604573d6000803e3d6000fd5b5050505050505050565b6200061862001d11565b6001600160a01b0316336001600160a01b031614620006695760405162461bcd60e51b815260206004820152600c60248201526b11130e94d30e9393d517d41160a21b60448201526064016200043e565b600080546001600160a01b03191681556040517f767c4ee457713bfdaea0f801e4e07a6072d2d31e4dbdf4b0c20a9c02b3d0576a9190a1565b620006ac62001c1c565b6001600160a01b031663425fad586040518163ffffffff1660e01b815260040160206040518083038186803b158015620006e557600080fd5b505afa158015620006fa573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200072091906200282b565b15620007405760405162461bcd60e51b81526004016200043e9062002ab4565b6002546001600160a01b031633146200078d5760405162461bcd60e51b815260206004820152600e60248201526d11130e95110e9393d517d413d3d360921b60448201526064016200043e565b6001546040805163e44b387560e01b815290516001600160a01b0390921691600091839163e44b387591600480820192602092909190829003018186803b158015620007d857600080fd5b505afa158015620007ed573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000813919062002869565b148015620008965750600754816001600160a01b031663ba5d30786040518163ffffffff1660e01b815260040160206040518083038186803b1580156200085957600080fd5b505afa1580156200086e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000894919062002869565b145b620008da5760405162461bcd60e51b8152602060048201526013602482015272444c3a54443a4e4545445f544f5f434c41494d60681b60448201526064016200043e565b6002805460ff60a01b1916600160a01b1790556040516347350e9f60e01b81523060048201526000906001600160a01b038316906347350e9f906024016040805180830381600087803b1580156200093157600080fd5b505af115801562000946573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200096c9190620028b8565b5090506000826001600160a01b031663aabaecd66040518163ffffffff1660e01b815260040160206040518083038186803b158015620009ab57600080fd5b505afa158015620009c0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620009e691906200268c565b90506000836001600160a01b03166339ba9f866040518163ffffffff1660e01b815260040160206040518083038186803b15801562000a2457600080fd5b505afa15801562000a39573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000a5f91906200268c565b9050806001600160a01b0316826001600160a01b0316148062000a80575082155b1562000a8c5750505050565b62000b2582308484303062000aa062001c1c565b60405162000aae90620025ac565b6001600160a01b0396871681529486166020860152928516604085015290841660608401528316608083015290911660a082015260c001604051809103906000f08015801562000b02573d6000803e3d6000fd5b50600080546001600160a01b0319166001600160a01b0383161790558562001d57565b62000b645760405162461bcd60e51b815260206004820152600e60248201526d22261d2a221d2a2920a729a322a960911b60448201526064016200043e565b50505050565b62000b7462001c1c565b6001600160a01b031663425fad586040518163ffffffff1660e01b815260040160206040518083038186803b15801562000bad57600080fd5b505afa15801562000bc2573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000be891906200282b565b1562000c085760405162461bcd60e51b81526004016200043e9062002ab4565b62000c1262001d11565b6001600160a01b0316336001600160a01b03161462000c645760405162461bcd60e51b815260206004820152600d60248201526c11130e94d054ce9393d517d411609a1b60448201526064016200043e565b61271081111562000cb85760405162461bcd60e51b815260206004820152601760248201527f444c3a5341533a494e56414c49445f534c49505041474500000000000000000060448201526064016200043e565b60038190556040518181527f636f9afe9f0a5626690aeed6de8a54d55c9e43e78e05693189ec83a048418394906020015b60405180910390a150565b62000cfe62001d11565b6001600160a01b0316336001600160a01b03161462000d595760405162461bcd60e51b8152602060048201526016602482015275444c3a553a4e4f545f504f4f4c5f44454c454741544560501b60448201526064016200043e565b7faaaa7ee6b0c2f4ee1fa7312c7d5b3623a434da5a1a9ce3cb6e629caa23454ab683838360405162000d8e9392919062002ae0565b60405180910390a162000da062001db8565b6001600160a01b031663fe69f7088484846040518463ffffffff1660e01b815260040162000dd19392919062002ae0565b600060405180830381600087803b15801562000dec57600080fd5b505af115801562000e01573d6000803e3d6000fd5b50505050505050565b600062000e1662001d11565b905090565b62000e25620025ba565b62000e2f62001c1c565b6001600160a01b031663425fad586040518163ffffffff1660e01b815260040160206040518083038186803b15801562000e6857600080fd5b505afa15801562000e7d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000ea391906200282b565b1562000ec35760405162461bcd60e51b81526004016200043e9062002ab4565b6002546001600160a01b0316331462000f0f5760405162461bcd60e51b815260206004820152600d60248201526c11130e90ce9393d517d413d3d3609a1b60448201526064016200043e565b600254600160a01b900460ff1662000f3a5760015462000e169033906001600160a01b031662001de8565b60015462000e169033906001600160a01b0316620020dd565b62000f5d62001c1c565b6001600160a01b031663425fad586040518163ffffffff1660e01b815260040160206040518083038186803b15801562000f9657600080fd5b505afa15801562000fab573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000fd191906200282b565b1562000ff15760405162461bcd60e51b81526004016200043e9062002ab4565b62000ffb62001d11565b6001600160a01b0316336001600160a01b0316146200104d5760405162461bcd60e51b815260206004820152600d60248201526c11130e9053950e9393d517d411609a1b60448201526064016200043e565b6000600160009054906101000a90046001600160a01b031690506000600554826001600160a01b031663e44b38756040518163ffffffff1660e01b815260040160206040518083038186803b158015620010a657600080fd5b505afa158015620010bb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620010e1919062002869565b620010ed919062002b05565b148015620011705750600754816001600160a01b031663ba5d30786040518163ffffffff1660e01b815260040160206040518083038186803b1580156200113357600080fd5b505afa15801562001148573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200116e919062002869565b145b620011b55760405162461bcd60e51b8152602060048201526014602482015273444c3a414e543a4e4545445f544f5f434c41494d60601b60448201526064016200043e565b8115806200123f57506200123f816001600160a01b03166339ba9f866040518163ffffffff1660e01b815260040160206040518083038186803b158015620011fc57600080fd5b505afa15801562001211573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200123791906200268c565b828462001d57565b620012865760405162461bcd60e51b815260206004820152601660248201527511130e9053950e9514905394d1915497d1905253115160521b60448201526064016200043e565b6040516328565a7760e11b81526001600160a01b038216906350acb4ee90620012bd90899089908990899060009060040162002a45565b600060405180830381600087803b158015620012d857600080fd5b505af1158015620012ed573d6000803e3d6000fd5b50505050806001600160a01b031663ba5d30786040518163ffffffff1660e01b815260040160206040518083038186803b1580156200132b57600080fd5b505afa15801562001340573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062001366919062002869565b600755505050505050565b60006200137d62001c1c565b6001600160a01b031663425fad586040518163ffffffff1660e01b815260040160206040518083038186803b158015620013b657600080fd5b505afa158015620013cb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620013f191906200282b565b15620014115760405162461bcd60e51b81526004016200043e9062002ab4565b6001546040805163555d766b60e11b815290516001600160a01b0390921691600091839163aabaecd691600480820192602092909190829003018186803b1580156200145c57600080fd5b505afa15801562001471573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200149791906200268c565b90506000826001600160a01b03166339ba9f866040518163ffffffff1660e01b815260040160206040518083038186803b158015620014d557600080fd5b505afa158015620014ea573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200151091906200268c565b905060006200151e62001c1c565b90506000836001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b1580156200155c57600080fd5b505afa15801562001571573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620015979190620028dd565b90506000612710620015ae60ff8416600a62002b8c565b6040516302c68be360e31b81526001600160a01b0387811660048301528616906316345f189060240160206040518083038186803b158015620015f057600080fd5b505afa15801562001605573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200162b919062002869565b6003546200163c9061271062002c7c565b876001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b1580156200167657600080fd5b505afa1580156200168b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620016b19190620028dd565b620016c19060ff16600a62002b8c565b6040516302c68be360e31b81526001600160a01b038b811660048301528916906316345f189060240160206040518083038186803b1580156200170357600080fd5b505afa15801562001718573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200173e919062002869565b6200174a908e62002c5a565b62001756919062002c5a565b62001762919062002c5a565b6200176e919062002b20565b6200177a919062002b20565b62001786919062002b20565b905060006200179783600a62002b9a565b600654620017a6908b62002c5a565b620017b2919062002b20565b9050808211620017c35780620017c5565b815b9998505050505050505050565b600062000e166200232d565b620017e862001c1c565b6001600160a01b031663425fad586040518163ffffffff1660e01b815260040160206040518083038186803b1580156200182157600080fd5b505afa15801562001836573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200185c91906200282b565b156200187c5760405162461bcd60e51b81526004016200043e9062002ab4565b6200188662001d11565b6001600160a01b0316336001600160a01b031614620018d95760405162461bcd60e51b815260206004820152600e60248201526d11130e94d19510ce9393d517d41160921b60448201526064016200043e565b60058190556040518181527f8ccff2aca87e7b7a31cb5b584d52e51d06e76ba01d4c23d271cacad157e0842a9060200162000ce9565b6200191962001d11565b6001600160a01b0316336001600160a01b0316146200196b5760405162461bcd60e51b815260206004820152600d60248201526c11130e9053950e9393d517d411609a1b60448201526064016200043e565b600154604051632b2d48ad60e21b81526001600160a01b039091169063acb522b490620005d490879087908790879060040162002a11565b620019ad62001db8565b6001600160a01b0316336001600160a01b03161462001a025760405162461bcd60e51b815260206004820152601060248201526f444c3a4d3a4e4f545f464143544f525960801b60448201526064016200043e565b62001a0f83838362002358565b62001a4b5760405162461bcd60e51b815260206004820152600b60248201526a11130e934e91905253115160aa1b60448201526064016200043e565b505050565b600062000e1662001db8565b62001a6662001db8565b6001600160a01b0316336001600160a01b03161462001abc5760405162461bcd60e51b8152602060048201526011602482015270444c3a53493a4e4f545f464143544f525960781b60448201526064016200043e565b6001600160a01b03167f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc55565b50565b62001af662001c1c565b6001600160a01b031663425fad586040518163ffffffff1660e01b815260040160206040518083038186803b15801562001b2f57600080fd5b505afa15801562001b44573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062001b6a91906200282b565b1562001b8a5760405162461bcd60e51b81526004016200043e9062002ab4565b62001b9462001d11565b6001600160a01b0316336001600160a01b03161462001be65760405162461bcd60e51b815260206004820152600d60248201526c11130e94d3548e9393d517d411609a1b60448201526064016200043e565b60068190556040518181527fe81e0b5dcee898d284000b5e607cdc9bbb72c4c46fb4bbce2d99f95c0a0d39289060200162000ce9565b600254604080516303526ce360e21b815290516000926001600160a01b031691630d49b38c916004808301926020929190829003018186803b15801562001c6257600080fd5b505afa15801562001c77573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062001c9d91906200268c565b6001600160a01b031663c31245256040518163ffffffff1660e01b815260040160206040518083038186803b15801562001cd657600080fd5b505afa15801562001ceb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000e1691906200268c565b60025460408051634046af2b60e01b815290516000926001600160a01b031691634046af2b916004808301926020929190829003018186803b15801562001cd657600080fd5b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b17905260009062001dae908590620023d7565b90505b9392505050565b600062001de37f7a45a402e4cb6e08ebc196f20f66d5d30e67285a2a8aa80503fa409e727a4af15490565b919050565b62001df2620025ba565b6000826001600160a01b031663e44b38756040518163ffffffff1660e01b815260040160206040518083038186803b15801562001e2e57600080fd5b505afa15801562001e43573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062001e69919062002869565b90506000811162001eb65760405162461bcd60e51b8152602060048201526016602482015275444c3a48433a4e4f5448494e475f544f5f434c41494d60501b60448201526064016200043e565b60405163390d685560e01b8152600481018290526001600160a01b03858116602483015284169063390d685590604401600060405180830381600087803b15801562001f0157600080fd5b505af115801562001f16573d6000803e3d6000fd5b505050506000836001600160a01b031663ba5d30786040518163ffffffff1660e01b815260040160206040518083038186803b15801562001f5657600080fd5b505afa15801562001f6b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062001f91919062002869565b905060008160075462001fa5919062002c7c565b6007839055838552905062001fbb818462002c7c565b6020850152604084018190526005548015620020d35784518190869062001fe490839062002b05565b905250808560026020020181815162001ffe919062002b05565b9150818152505060006005819055506200208e866001600160a01b03166339ba9f866040518163ffffffff1660e01b815260040160206040518083038186803b1580156200204b57600080fd5b505afa15801562002060573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200208691906200268c565b888362001d57565b620020d35760405162461bcd60e51b815260206004820152601460248201527311130e9210ce90d0541515549157d1905253115160621b60448201526064016200043e565b5050505092915050565b620020e7620025ba565b620020f16200248b565b15620021405760405162461bcd60e51b815260206004820152601860248201527f444c3a48434f523a4c49515f4e4f545f46494e4953484544000000000000000060448201526064016200043e565b6000826001600160a01b03166339ba9f866040518163ffffffff1660e01b815260040160206040518083038186803b1580156200217c57600080fd5b505afa15801562002191573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620021b791906200268c565b6007546005546040516370a0823160e01b8152306004820152929350909160009082906001600160a01b038616906370a082319060240160206040518083038186803b1580156200220757600080fd5b505afa1580156200221c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062002242919062002869565b6200224e919062002c7c565b905060006200225e838362002b05565b8087529050838211620022735760006200227f565b6200227f848362002c7c565b6020870152604086018390528382116200229a57816200229c565b835b60a0870152818411620022b1576000620022bd565b620022bd828562002c7c565b60c087015260006005556002805460ff60a01b19169055620022e185898362001d57565b620023225760405162461bcd60e51b815260206004820152601060248201526f22261d2421a7a91d2a2920a729a322a960811b60448201526064016200043e565b505050505092915050565b600062001de37f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6000833b806200236d57600091505062001db1565b846001600160a01b0316848460405162002389929190620029c3565b600060405180830381855af49150503d8060008114620023c6576040519150601f19603f3d011682016040523d82523d6000602084013e620023cb565b606091505b50909695505050505050565b60006001600160a01b0383163b620023f25750600062002485565b6060836001600160a01b0316836040516200240e9190620029d3565b6000604051808303816000865af19150503d80600081146200244d576040519150601f19603f3d011682016040523d82523d6000602084013e62002452565b606091505b50909250905081801562002481575080511580620024815750808060200190518101906200248191906200282b565b9150505b92915050565b600080546001600160a01b03168015801590620025a657506001546040805163555d766b60e11b815290516000926001600160a01b03169163aabaecd6916004808301926020929190829003018186803b158015620024e957600080fd5b505afa158015620024fe573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200252491906200268c565b6040516370a0823160e01b81526001600160a01b03848116600483015291909116906370a082319060240160206040518083038186803b1580156200256857600080fd5b505afa1580156200257d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620025a3919062002869565b14155b91505090565b610e8b8062002cc383390190565b6040518060e001604052806007906020820280368337509192915050565b60008083601f840112620025eb57600080fd5b50813567ffffffffffffffff8111156200260457600080fd5b6020830191508360208260051b85010111156200262057600080fd5b9250929050565b60008083601f8401126200263a57600080fd5b50813567ffffffffffffffff8111156200265357600080fd5b6020830191508360208285010111156200262057600080fd5b6000602082840312156200267f57600080fd5b813562001db18162002cac565b6000602082840312156200269f57600080fd5b815162001db18162002cac565b60008060008060808587031215620026c357600080fd5b8435620026d08162002cac565b93506020850135620026e28162002cac565b92506040850135620026f48162002cac565b9396929550929360600135925050565b6000806000604084860312156200271a57600080fd5b8335620027278162002cac565b9250602084013567ffffffffffffffff8111156200274457600080fd5b620027528682870162002627565b9497909650939450505050565b600080600080606085870312156200277657600080fd5b8435620027838162002cac565b935060208501359250604085013567ffffffffffffffff811115620027a757600080fd5b620027b587828801620025d8565b95989497509550505050565b600080600080600060808688031215620027da57600080fd5b8535620027e78162002cac565b945060208601359350604086013567ffffffffffffffff8111156200280b57600080fd5b6200281988828901620025d8565b96999598509660600135949350505050565b6000602082840312156200283e57600080fd5b8151801515811462001db157600080fd5b6000602082840312156200286257600080fd5b5035919050565b6000602082840312156200287c57600080fd5b5051919050565b6000806000604084860312156200289957600080fd5b83359250602084013567ffffffffffffffff8111156200274457600080fd5b60008060408385031215620028cc57600080fd5b505080516020909101519092909150565b600060208284031215620028f057600080fd5b815160ff8116811462001db157600080fd5b81835260006020808501808196508560051b810191508460005b878110156200298d5782840389528135601e198836030181126200293f57600080fd5b8701803567ffffffffffffffff8111156200295957600080fd5b8036038913156200296957600080fd5b6200297886828985016200299a565b9a87019a95505050908401906001016200291c565b5091979650505050505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b8183823760009101908152919050565b6000825160005b81811015620029f65760208186018101518583015201620029da565b8181111562002a06576000828501525b509190910192915050565b60018060a01b038516815283602082015260606040820152600062002a3b60608301848662002902565b9695505050505050565b60018060a01b038616815284602082015260806040820152600062002a6f60808301858762002902565b90508260608301529695505050505050565b60e08101818360005b600781101562002aab57815183526020928301929091019060010162002a8a565b50505092915050565b60208082526012908201527111130e941493d513d0d3d317d4105554d15160721b604082015260600190565b83815260406020820152600062002afc6040830184866200299a565b95945050505050565b6000821982111562002b1b5762002b1b62002c96565b500190565b60008262002b3e57634e487b7160e01b600052601260045260246000fd5b500490565b600181815b8085111562002b8457816000190482111562002b685762002b6862002c96565b8085161562002b7657918102915b93841c939080029062002b48565b509250929050565b600062001db1838362002ba6565b600062001db160ff8416835b60008262002bb75750600162002485565b8162002bc65750600062002485565b816001811462002bdf576002811462002bea5762002c0a565b600191505062002485565b60ff84111562002bfe5762002bfe62002c96565b50506001821b62002485565b5060208310610133831016604e8410600b841016171562002c2f575081810a62002485565b62002c3b838362002b43565b806000190482111562002c525762002c5262002c96565b029392505050565b600081600019048311821515161562002c775762002c7762002c96565b500290565b60008282101562002c915762002c9162002c96565b500390565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b038116811462001ae957600080fdfe6101206040523480156200001257600080fd5b5060405162000e8b38038062000e8b8339810160408190526200003591620002ff565b6001600160601b0319606087901b16610100526001600160a01b038616620000a45760405162461bcd60e51b815260206004820152601360248201527f4c49513a433a494e56414c49445f4f574e45520000000000000000000000000060448201526064015b60405180910390fd5b6001600160601b0319606086901b166080526001600160a01b0385166200010e5760405162461bcd60e51b815260206004820152601760248201527f4c49513a433a494e56414c49445f434f4c5f415353455400000000000000000060448201526064016200009b565b6001600160601b0319606085901b1660c0526001600160a01b038416620001785760405162461bcd60e51b815260206004820152601960248201527f4c49513a433a494e56414c49445f46554e44535f41535345540000000000000060448201526064016200009b565b6001600160601b0319606083901b1660a0526001600160a01b038216620001d75760405162461bcd60e51b81526020600482015260126024820152711312544e90ce9253959053125117d11154d560721b60448201526064016200009b565b806001600160a01b031660e0816001600160a01b031660601b8152506001600160a01b031663425fad586040518163ffffffff1660e01b815260040160206040518083038186803b1580156200022c57600080fd5b505afa15801562000241573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000267919062000380565b15620002b65760405162461bcd60e51b815260206004820152601560248201527f4c49513a433a494e56414c49445f474c4f42414c53000000000000000000000060448201526064016200009b565b5050600180546001600160a01b0319166001600160a01b039290921691909117905550620003ab915050565b80516001600160a01b0381168114620002fa57600080fd5b919050565b60008060008060008060c087890312156200031957600080fd5b6200032487620002e2565b95506200033460208801620002e2565b94506200034460408801620002e2565b93506200035460608801620002e2565b92506200036460808801620002e2565b91506200037460a08801620002e2565b90509295509295509295565b6000602082840312156200039357600080fd5b81518015158114620003a457600080fd5b9392505050565b60805160601c60a05160601c60c05160601c60e05160601c6101005160601c610a63620004286000396000818161015a015281816101fc01526102c00152600081816101cf01526103bb01526000818160cf015261062a0152600081816101a8015261064c01526000818161018101526104d40152610a636000f3fe608060405234801561001057600080fd5b506004361061009d5760003560e01c80635ec2c7bf116100665780635ec2c7bf146101425780638da5cb5b14610155578063aabaecd61461017c578063b269681d146101a3578063c3124525146101ca57600080fd5b8062ede7e4146100a2578063201add9b146100b757806339ba9f86146100ca5780633ba29db31461010e5780635b9df3c314610121575b600080fd5b6100b56100b03660046108b0565b6101f1565b005b6100b56100c53660046108d2565b6102b5565b6100f17f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020015b60405180910390f35b6100b561011c366004610962565b6103b9565b61013461012f366004610930565b6106bf565b604051908152602001610105565b6001546100f1906001600160a01b031681565b6100f17f000000000000000000000000000000000000000000000000000000000000000081565b6100f17f000000000000000000000000000000000000000000000000000000000000000081565b6100f17f000000000000000000000000000000000000000000000000000000000000000081565b6100f17f000000000000000000000000000000000000000000000000000000000000000081565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146102615760405162461bcd60e51b815260206004820152601060248201526f2624a89d29a09d2727aa2fa7aba722a960811b60448201526064015b60405180910390fd5b600180546001600160a01b0319166001600160a01b0383169081179091556040519081527f4ee0985a129917c72eab0afe7ec6060bf6c6e0796bedc42de903d9dbbadfc51d9060200160405180910390a150565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146103205760405162461bcd60e51b815260206004820152601060248201526f2624a89d28231d2727aa2fa7aba722a960811b6044820152606401610258565b604080516001600160a01b038086168252841660208201529081018290527fe9bfec84ab7c3ab810debd9559b5e87a967d87138053250aa788ef1e0464fd429060600160405180910390a1610376838383610742565b6103b45760405162461bcd60e51b815260206004820152600f60248201526e2624a89d28231d2a2920a729a322a960891b6044820152606401610258565b505050565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663425fad586040518163ffffffff1660e01b815260040160206040518083038186803b15801561041257600080fd5b505afa158015610426573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061044a919061090e565b1561048d5760405162461bcd60e51b81526020600482015260136024820152721312544e941493d513d0d3d317d4105554d151606a1b6044820152606401610258565b600054156104ca5760405162461bcd60e51b815260206004820152600a6024820152691312544e9313d0d2d15160b21b6044820152606401610258565b60016000556104fa7f00000000000000000000000000000000000000000000000000000000000000003386610742565b6105385760405162461bcd60e51b815260206004820152600f60248201526e2624a89d26281d2a2920a729a322a960891b6044820152606401610258565b604051339061054a90849084906109e2565b6000604051808303816000865af19150503d8060008114610587576040519150601f19603f3d011682016040523d82523d6000602084013e61058c565b606091505b505050600061059a856106bf565b9050838111156105ec5760405162461bcd60e51b815260206004820152601a60248201527f4c49513a4c503a4d41585f52455455524e5f45584345454445440000000000006044820152606401610258565b60408051868152602081018390527fbe5ff6ed515f1d56105466ed671dfae9b960e38088c6dbe958dc2eab14898fd1910160405180910390a16106717f0000000000000000000000000000000000000000000000000000000000000000337f0000000000000000000000000000000000000000000000000000000000000000846107b0565b6106b45760405162461bcd60e51b81526020600482015260146024820152734c49513a4c503a5452414e534645525f46524f4d60601b6044820152606401610258565b505060008055505050565b600154604051635b9df3c360e01b8152600481018390526000916001600160a01b031690635b9df3c39060240160206040518083038186803b15801561070457600080fd5b505afa158015610718573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061073c9190610949565b92915050565b6040516001600160a01b0383166024820152604481018290526000906107a890859063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526107f4565b949350505050565b6040516001600160a01b03808516602483015283166044820152606481018290526000906107eb9086906323b872dd60e01b90608401610771565b95945050505050565b60006001600160a01b0383163b61080d5750600061073c565b6060836001600160a01b03168360405161082791906109f2565b6000604051808303816000865af19150503d8060008114610864576040519150601f19603f3d011682016040523d82523d6000602084013e610869565b606091505b5090925090508180156107a85750805115806107a85750808060200190518101906107a8919061090e565b80356001600160a01b03811681146108ab57600080fd5b919050565b6000602082840312156108c257600080fd5b6108cb82610894565b9392505050565b6000806000606084860312156108e757600080fd5b6108f084610894565b92506108fe60208501610894565b9150604084013590509250925092565b60006020828403121561092057600080fd5b815180151581146108cb57600080fd5b60006020828403121561094257600080fd5b5035919050565b60006020828403121561095b57600080fd5b5051919050565b6000806000806060858703121561097857600080fd5b8435935060208501359250604085013567ffffffffffffffff8082111561099e57600080fd5b818701915087601f8301126109b257600080fd5b8135818111156109c157600080fd5b8860208285010111156109d357600080fd5b95989497505060200194505050565b8183823760009101908152919050565b6000825160005b81811015610a1357602081860181015185830152016109f9565b81811115610a22576000828501525b50919091019291505056fea26469706673582212209e62636e64f35eee877b48f6cdb1585074762d88eb77acc4d35cecc0f1656af764736f6c63430008070033a26469706673582212206c71fc8537b36cb91450ca4a62fba1777066797d32723873195cdd93d6c3b20f64736f6c63430008070033

Deployed Bytecode

0x60806040523480156200001157600080fd5b5060043610620001ae5760003560e01c80634e71d92d11620000f0578063acb522b411620000a3578063c45a0155116200007a578063c45a01551462000356578063d285b7b41462000360578063d784d4261462000372578063ec029a44146200038957600080fd5b8063acb522b4146200031f578063bca93e761462000336578063c3fbb6fd146200033f57600080fd5b80634e71d92d14620002ae57806350acb4ee14620002c75780635b9df3c314620002de5780635c60da1b14620002f557806386d8745b14620002ff5780638bf44049146200030857600080fd5b806323ef42ab11620001665780634046af2b116200013d5780634046af2b146200026b5780634046ebae1462000275578063431f244514620002875780634387ebce146200029057600080fd5b806323ef42ab146200023857806339c02899146200024b5780633b99bcee146200025457600080fd5b8062ede7e414620001b357806307a08bdd14620001cc5780630d51ac0e14620001e357806316f0115b14620001ed578063175f832914620002175780632365faea1462000221575b600080fd5b620001ca620001c43660046200266c565b620003a0565b005b620001ca620001dd366004620026ac565b62000540565b620001ca6200060e565b6002546001600160a01b03165b6040516001600160a01b0390911681526020015b60405180910390f35b620001ca620006a2565b620001ca620002323660046200284f565b62000b6a565b6005545b6040519081526020016200020e565b6004546200023c565b620001ca6200026536600462002883565b62000cf4565b620001fa62000e0a565b6000546001600160a01b0316620001fa565b6003546200023c565b600254600160a01b900460ff1660405190151581526020016200020e565b620002b862000e1b565b6040516200020e919062002a81565b620001ca620002d8366004620027c1565b62000f53565b6200023c620002ef3660046200284f565b62001371565b620001fa620017d2565b6006546200023c565b620001ca620003193660046200284f565b620017de565b620001ca620003303660046200275f565b6200190f565b6007546200023c565b620001ca6200035036600462002704565b620019a3565b620001fa62001a50565b6001546001600160a01b0316620001fa565b620001ca620003833660046200266c565b62001a5c565b620001ca6200039a3660046200284f565b62001aec565b620003aa62001c1c565b6001600160a01b031663425fad586040518163ffffffff1660e01b815260040160206040518083038186803b158015620003e357600080fd5b505afa158015620003f8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200041e91906200282b565b15620004475760405162461bcd60e51b81526004016200043e9062002ab4565b60405180910390fd5b6200045162001d11565b6001600160a01b0316336001600160a01b031614620004a25760405162461bcd60e51b815260206004820152600c60248201526b11130e94d04e9393d517d41160a21b60448201526064016200043e565b6040516001600160a01b03821681527f4ee0985a129917c72eab0afe7ec6060bf6c6e0796bedc42de903d9dbbadfc51d9060200160405180910390a1600054604051623b79f960e21b81526001600160a01b0383811660048301529091169062ede7e490602401600060405180830381600087803b1580156200052457600080fd5b505af115801562000539573d6000803e3d6000fd5b5050505050565b6200054a62001d11565b6001600160a01b0316336001600160a01b0316146200059b5760405162461bcd60e51b815260206004820152600c60248201526b11130e94d04e9393d517d41160a21b60448201526064016200043e565b60405163201add9b60e01b81526001600160a01b03848116600483015283811660248301526044820183905285169063201add9b906064015b600060405180830381600087803b158015620005ef57600080fd5b505af115801562000604573d6000803e3d6000fd5b5050505050505050565b6200061862001d11565b6001600160a01b0316336001600160a01b031614620006695760405162461bcd60e51b815260206004820152600c60248201526b11130e94d30e9393d517d41160a21b60448201526064016200043e565b600080546001600160a01b03191681556040517f767c4ee457713bfdaea0f801e4e07a6072d2d31e4dbdf4b0c20a9c02b3d0576a9190a1565b620006ac62001c1c565b6001600160a01b031663425fad586040518163ffffffff1660e01b815260040160206040518083038186803b158015620006e557600080fd5b505afa158015620006fa573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200072091906200282b565b15620007405760405162461bcd60e51b81526004016200043e9062002ab4565b6002546001600160a01b031633146200078d5760405162461bcd60e51b815260206004820152600e60248201526d11130e95110e9393d517d413d3d360921b60448201526064016200043e565b6001546040805163e44b387560e01b815290516001600160a01b0390921691600091839163e44b387591600480820192602092909190829003018186803b158015620007d857600080fd5b505afa158015620007ed573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000813919062002869565b148015620008965750600754816001600160a01b031663ba5d30786040518163ffffffff1660e01b815260040160206040518083038186803b1580156200085957600080fd5b505afa1580156200086e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000894919062002869565b145b620008da5760405162461bcd60e51b8152602060048201526013602482015272444c3a54443a4e4545445f544f5f434c41494d60681b60448201526064016200043e565b6002805460ff60a01b1916600160a01b1790556040516347350e9f60e01b81523060048201526000906001600160a01b038316906347350e9f906024016040805180830381600087803b1580156200093157600080fd5b505af115801562000946573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200096c9190620028b8565b5090506000826001600160a01b031663aabaecd66040518163ffffffff1660e01b815260040160206040518083038186803b158015620009ab57600080fd5b505afa158015620009c0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620009e691906200268c565b90506000836001600160a01b03166339ba9f866040518163ffffffff1660e01b815260040160206040518083038186803b15801562000a2457600080fd5b505afa15801562000a39573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000a5f91906200268c565b9050806001600160a01b0316826001600160a01b0316148062000a80575082155b1562000a8c5750505050565b62000b2582308484303062000aa062001c1c565b60405162000aae90620025ac565b6001600160a01b0396871681529486166020860152928516604085015290841660608401528316608083015290911660a082015260c001604051809103906000f08015801562000b02573d6000803e3d6000fd5b50600080546001600160a01b0319166001600160a01b0383161790558562001d57565b62000b645760405162461bcd60e51b815260206004820152600e60248201526d22261d2a221d2a2920a729a322a960911b60448201526064016200043e565b50505050565b62000b7462001c1c565b6001600160a01b031663425fad586040518163ffffffff1660e01b815260040160206040518083038186803b15801562000bad57600080fd5b505afa15801562000bc2573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000be891906200282b565b1562000c085760405162461bcd60e51b81526004016200043e9062002ab4565b62000c1262001d11565b6001600160a01b0316336001600160a01b03161462000c645760405162461bcd60e51b815260206004820152600d60248201526c11130e94d054ce9393d517d411609a1b60448201526064016200043e565b61271081111562000cb85760405162461bcd60e51b815260206004820152601760248201527f444c3a5341533a494e56414c49445f534c49505041474500000000000000000060448201526064016200043e565b60038190556040518181527f636f9afe9f0a5626690aeed6de8a54d55c9e43e78e05693189ec83a048418394906020015b60405180910390a150565b62000cfe62001d11565b6001600160a01b0316336001600160a01b03161462000d595760405162461bcd60e51b8152602060048201526016602482015275444c3a553a4e4f545f504f4f4c5f44454c454741544560501b60448201526064016200043e565b7faaaa7ee6b0c2f4ee1fa7312c7d5b3623a434da5a1a9ce3cb6e629caa23454ab683838360405162000d8e9392919062002ae0565b60405180910390a162000da062001db8565b6001600160a01b031663fe69f7088484846040518463ffffffff1660e01b815260040162000dd19392919062002ae0565b600060405180830381600087803b15801562000dec57600080fd5b505af115801562000e01573d6000803e3d6000fd5b50505050505050565b600062000e1662001d11565b905090565b62000e25620025ba565b62000e2f62001c1c565b6001600160a01b031663425fad586040518163ffffffff1660e01b815260040160206040518083038186803b15801562000e6857600080fd5b505afa15801562000e7d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000ea391906200282b565b1562000ec35760405162461bcd60e51b81526004016200043e9062002ab4565b6002546001600160a01b0316331462000f0f5760405162461bcd60e51b815260206004820152600d60248201526c11130e90ce9393d517d413d3d3609a1b60448201526064016200043e565b600254600160a01b900460ff1662000f3a5760015462000e169033906001600160a01b031662001de8565b60015462000e169033906001600160a01b0316620020dd565b62000f5d62001c1c565b6001600160a01b031663425fad586040518163ffffffff1660e01b815260040160206040518083038186803b15801562000f9657600080fd5b505afa15801562000fab573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000fd191906200282b565b1562000ff15760405162461bcd60e51b81526004016200043e9062002ab4565b62000ffb62001d11565b6001600160a01b0316336001600160a01b0316146200104d5760405162461bcd60e51b815260206004820152600d60248201526c11130e9053950e9393d517d411609a1b60448201526064016200043e565b6000600160009054906101000a90046001600160a01b031690506000600554826001600160a01b031663e44b38756040518163ffffffff1660e01b815260040160206040518083038186803b158015620010a657600080fd5b505afa158015620010bb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620010e1919062002869565b620010ed919062002b05565b148015620011705750600754816001600160a01b031663ba5d30786040518163ffffffff1660e01b815260040160206040518083038186803b1580156200113357600080fd5b505afa15801562001148573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200116e919062002869565b145b620011b55760405162461bcd60e51b8152602060048201526014602482015273444c3a414e543a4e4545445f544f5f434c41494d60601b60448201526064016200043e565b8115806200123f57506200123f816001600160a01b03166339ba9f866040518163ffffffff1660e01b815260040160206040518083038186803b158015620011fc57600080fd5b505afa15801562001211573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200123791906200268c565b828462001d57565b620012865760405162461bcd60e51b815260206004820152601660248201527511130e9053950e9514905394d1915497d1905253115160521b60448201526064016200043e565b6040516328565a7760e11b81526001600160a01b038216906350acb4ee90620012bd90899089908990899060009060040162002a45565b600060405180830381600087803b158015620012d857600080fd5b505af1158015620012ed573d6000803e3d6000fd5b50505050806001600160a01b031663ba5d30786040518163ffffffff1660e01b815260040160206040518083038186803b1580156200132b57600080fd5b505afa15801562001340573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062001366919062002869565b600755505050505050565b60006200137d62001c1c565b6001600160a01b031663425fad586040518163ffffffff1660e01b815260040160206040518083038186803b158015620013b657600080fd5b505afa158015620013cb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620013f191906200282b565b15620014115760405162461bcd60e51b81526004016200043e9062002ab4565b6001546040805163555d766b60e11b815290516001600160a01b0390921691600091839163aabaecd691600480820192602092909190829003018186803b1580156200145c57600080fd5b505afa15801562001471573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200149791906200268c565b90506000826001600160a01b03166339ba9f866040518163ffffffff1660e01b815260040160206040518083038186803b158015620014d557600080fd5b505afa158015620014ea573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200151091906200268c565b905060006200151e62001c1c565b90506000836001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b1580156200155c57600080fd5b505afa15801562001571573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620015979190620028dd565b90506000612710620015ae60ff8416600a62002b8c565b6040516302c68be360e31b81526001600160a01b0387811660048301528616906316345f189060240160206040518083038186803b158015620015f057600080fd5b505afa15801562001605573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200162b919062002869565b6003546200163c9061271062002c7c565b876001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b1580156200167657600080fd5b505afa1580156200168b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620016b19190620028dd565b620016c19060ff16600a62002b8c565b6040516302c68be360e31b81526001600160a01b038b811660048301528916906316345f189060240160206040518083038186803b1580156200170357600080fd5b505afa15801562001718573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200173e919062002869565b6200174a908e62002c5a565b62001756919062002c5a565b62001762919062002c5a565b6200176e919062002b20565b6200177a919062002b20565b62001786919062002b20565b905060006200179783600a62002b9a565b600654620017a6908b62002c5a565b620017b2919062002b20565b9050808211620017c35780620017c5565b815b9998505050505050505050565b600062000e166200232d565b620017e862001c1c565b6001600160a01b031663425fad586040518163ffffffff1660e01b815260040160206040518083038186803b1580156200182157600080fd5b505afa15801562001836573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200185c91906200282b565b156200187c5760405162461bcd60e51b81526004016200043e9062002ab4565b6200188662001d11565b6001600160a01b0316336001600160a01b031614620018d95760405162461bcd60e51b815260206004820152600e60248201526d11130e94d19510ce9393d517d41160921b60448201526064016200043e565b60058190556040518181527f8ccff2aca87e7b7a31cb5b584d52e51d06e76ba01d4c23d271cacad157e0842a9060200162000ce9565b6200191962001d11565b6001600160a01b0316336001600160a01b0316146200196b5760405162461bcd60e51b815260206004820152600d60248201526c11130e9053950e9393d517d411609a1b60448201526064016200043e565b600154604051632b2d48ad60e21b81526001600160a01b039091169063acb522b490620005d490879087908790879060040162002a11565b620019ad62001db8565b6001600160a01b0316336001600160a01b03161462001a025760405162461bcd60e51b815260206004820152601060248201526f444c3a4d3a4e4f545f464143544f525960801b60448201526064016200043e565b62001a0f83838362002358565b62001a4b5760405162461bcd60e51b815260206004820152600b60248201526a11130e934e91905253115160aa1b60448201526064016200043e565b505050565b600062000e1662001db8565b62001a6662001db8565b6001600160a01b0316336001600160a01b03161462001abc5760405162461bcd60e51b8152602060048201526011602482015270444c3a53493a4e4f545f464143544f525960781b60448201526064016200043e565b6001600160a01b03167f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc55565b50565b62001af662001c1c565b6001600160a01b031663425fad586040518163ffffffff1660e01b815260040160206040518083038186803b15801562001b2f57600080fd5b505afa15801562001b44573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062001b6a91906200282b565b1562001b8a5760405162461bcd60e51b81526004016200043e9062002ab4565b62001b9462001d11565b6001600160a01b0316336001600160a01b03161462001be65760405162461bcd60e51b815260206004820152600d60248201526c11130e94d3548e9393d517d411609a1b60448201526064016200043e565b60068190556040518181527fe81e0b5dcee898d284000b5e607cdc9bbb72c4c46fb4bbce2d99f95c0a0d39289060200162000ce9565b600254604080516303526ce360e21b815290516000926001600160a01b031691630d49b38c916004808301926020929190829003018186803b15801562001c6257600080fd5b505afa15801562001c77573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062001c9d91906200268c565b6001600160a01b031663c31245256040518163ffffffff1660e01b815260040160206040518083038186803b15801562001cd657600080fd5b505afa15801562001ceb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000e1691906200268c565b60025460408051634046af2b60e01b815290516000926001600160a01b031691634046af2b916004808301926020929190829003018186803b15801562001cd657600080fd5b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b17905260009062001dae908590620023d7565b90505b9392505050565b600062001de37f7a45a402e4cb6e08ebc196f20f66d5d30e67285a2a8aa80503fa409e727a4af15490565b919050565b62001df2620025ba565b6000826001600160a01b031663e44b38756040518163ffffffff1660e01b815260040160206040518083038186803b15801562001e2e57600080fd5b505afa15801562001e43573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062001e69919062002869565b90506000811162001eb65760405162461bcd60e51b8152602060048201526016602482015275444c3a48433a4e4f5448494e475f544f5f434c41494d60501b60448201526064016200043e565b60405163390d685560e01b8152600481018290526001600160a01b03858116602483015284169063390d685590604401600060405180830381600087803b15801562001f0157600080fd5b505af115801562001f16573d6000803e3d6000fd5b505050506000836001600160a01b031663ba5d30786040518163ffffffff1660e01b815260040160206040518083038186803b15801562001f5657600080fd5b505afa15801562001f6b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062001f91919062002869565b905060008160075462001fa5919062002c7c565b6007839055838552905062001fbb818462002c7c565b6020850152604084018190526005548015620020d35784518190869062001fe490839062002b05565b905250808560026020020181815162001ffe919062002b05565b9150818152505060006005819055506200208e866001600160a01b03166339ba9f866040518163ffffffff1660e01b815260040160206040518083038186803b1580156200204b57600080fd5b505afa15801562002060573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200208691906200268c565b888362001d57565b620020d35760405162461bcd60e51b815260206004820152601460248201527311130e9210ce90d0541515549157d1905253115160621b60448201526064016200043e565b5050505092915050565b620020e7620025ba565b620020f16200248b565b15620021405760405162461bcd60e51b815260206004820152601860248201527f444c3a48434f523a4c49515f4e4f545f46494e4953484544000000000000000060448201526064016200043e565b6000826001600160a01b03166339ba9f866040518163ffffffff1660e01b815260040160206040518083038186803b1580156200217c57600080fd5b505afa15801562002191573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620021b791906200268c565b6007546005546040516370a0823160e01b8152306004820152929350909160009082906001600160a01b038616906370a082319060240160206040518083038186803b1580156200220757600080fd5b505afa1580156200221c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062002242919062002869565b6200224e919062002c7c565b905060006200225e838362002b05565b8087529050838211620022735760006200227f565b6200227f848362002c7c565b6020870152604086018390528382116200229a57816200229c565b835b60a0870152818411620022b1576000620022bd565b620022bd828562002c7c565b60c087015260006005556002805460ff60a01b19169055620022e185898362001d57565b620023225760405162461bcd60e51b815260206004820152601060248201526f22261d2421a7a91d2a2920a729a322a960811b60448201526064016200043e565b505050505092915050565b600062001de37f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6000833b806200236d57600091505062001db1565b846001600160a01b0316848460405162002389929190620029c3565b600060405180830381855af49150503d8060008114620023c6576040519150601f19603f3d011682016040523d82523d6000602084013e620023cb565b606091505b50909695505050505050565b60006001600160a01b0383163b620023f25750600062002485565b6060836001600160a01b0316836040516200240e9190620029d3565b6000604051808303816000865af19150503d80600081146200244d576040519150601f19603f3d011682016040523d82523d6000602084013e62002452565b606091505b50909250905081801562002481575080511580620024815750808060200190518101906200248191906200282b565b9150505b92915050565b600080546001600160a01b03168015801590620025a657506001546040805163555d766b60e11b815290516000926001600160a01b03169163aabaecd6916004808301926020929190829003018186803b158015620024e957600080fd5b505afa158015620024fe573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200252491906200268c565b6040516370a0823160e01b81526001600160a01b03848116600483015291909116906370a082319060240160206040518083038186803b1580156200256857600080fd5b505afa1580156200257d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620025a3919062002869565b14155b91505090565b610e8b8062002cc383390190565b6040518060e001604052806007906020820280368337509192915050565b60008083601f840112620025eb57600080fd5b50813567ffffffffffffffff8111156200260457600080fd5b6020830191508360208260051b85010111156200262057600080fd5b9250929050565b60008083601f8401126200263a57600080fd5b50813567ffffffffffffffff8111156200265357600080fd5b6020830191508360208285010111156200262057600080fd5b6000602082840312156200267f57600080fd5b813562001db18162002cac565b6000602082840312156200269f57600080fd5b815162001db18162002cac565b60008060008060808587031215620026c357600080fd5b8435620026d08162002cac565b93506020850135620026e28162002cac565b92506040850135620026f48162002cac565b9396929550929360600135925050565b6000806000604084860312156200271a57600080fd5b8335620027278162002cac565b9250602084013567ffffffffffffffff8111156200274457600080fd5b620027528682870162002627565b9497909650939450505050565b600080600080606085870312156200277657600080fd5b8435620027838162002cac565b935060208501359250604085013567ffffffffffffffff811115620027a757600080fd5b620027b587828801620025d8565b95989497509550505050565b600080600080600060808688031215620027da57600080fd5b8535620027e78162002cac565b945060208601359350604086013567ffffffffffffffff8111156200280b57600080fd5b6200281988828901620025d8565b96999598509660600135949350505050565b6000602082840312156200283e57600080fd5b8151801515811462001db157600080fd5b6000602082840312156200286257600080fd5b5035919050565b6000602082840312156200287c57600080fd5b5051919050565b6000806000604084860312156200289957600080fd5b83359250602084013567ffffffffffffffff8111156200274457600080fd5b60008060408385031215620028cc57600080fd5b505080516020909101519092909150565b600060208284031215620028f057600080fd5b815160ff8116811462001db157600080fd5b81835260006020808501808196508560051b810191508460005b878110156200298d5782840389528135601e198836030181126200293f57600080fd5b8701803567ffffffffffffffff8111156200295957600080fd5b8036038913156200296957600080fd5b6200297886828985016200299a565b9a87019a95505050908401906001016200291c565b5091979650505050505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b8183823760009101908152919050565b6000825160005b81811015620029f65760208186018101518583015201620029da565b8181111562002a06576000828501525b509190910192915050565b60018060a01b038516815283602082015260606040820152600062002a3b60608301848662002902565b9695505050505050565b60018060a01b038616815284602082015260806040820152600062002a6f60808301858762002902565b90508260608301529695505050505050565b60e08101818360005b600781101562002aab57815183526020928301929091019060010162002a8a565b50505092915050565b60208082526012908201527111130e941493d513d0d3d317d4105554d15160721b604082015260600190565b83815260406020820152600062002afc6040830184866200299a565b95945050505050565b6000821982111562002b1b5762002b1b62002c96565b500190565b60008262002b3e57634e487b7160e01b600052601260045260246000fd5b500490565b600181815b8085111562002b8457816000190482111562002b685762002b6862002c96565b8085161562002b7657918102915b93841c939080029062002b48565b509250929050565b600062001db1838362002ba6565b600062001db160ff8416835b60008262002bb75750600162002485565b8162002bc65750600062002485565b816001811462002bdf576002811462002bea5762002c0a565b600191505062002485565b60ff84111562002bfe5762002bfe62002c96565b50506001821b62002485565b5060208310610133831016604e8410600b841016171562002c2f575081810a62002485565b62002c3b838362002b43565b806000190482111562002c525762002c5262002c96565b029392505050565b600081600019048311821515161562002c775762002c7762002c96565b500290565b60008282101562002c915762002c9162002c96565b500390565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b038116811462001ae957600080fdfe6101206040523480156200001257600080fd5b5060405162000e8b38038062000e8b8339810160408190526200003591620002ff565b6001600160601b0319606087901b16610100526001600160a01b038616620000a45760405162461bcd60e51b815260206004820152601360248201527f4c49513a433a494e56414c49445f4f574e45520000000000000000000000000060448201526064015b60405180910390fd5b6001600160601b0319606086901b166080526001600160a01b0385166200010e5760405162461bcd60e51b815260206004820152601760248201527f4c49513a433a494e56414c49445f434f4c5f415353455400000000000000000060448201526064016200009b565b6001600160601b0319606085901b1660c0526001600160a01b038416620001785760405162461bcd60e51b815260206004820152601960248201527f4c49513a433a494e56414c49445f46554e44535f41535345540000000000000060448201526064016200009b565b6001600160601b0319606083901b1660a0526001600160a01b038216620001d75760405162461bcd60e51b81526020600482015260126024820152711312544e90ce9253959053125117d11154d560721b60448201526064016200009b565b806001600160a01b031660e0816001600160a01b031660601b8152506001600160a01b031663425fad586040518163ffffffff1660e01b815260040160206040518083038186803b1580156200022c57600080fd5b505afa15801562000241573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000267919062000380565b15620002b65760405162461bcd60e51b815260206004820152601560248201527f4c49513a433a494e56414c49445f474c4f42414c53000000000000000000000060448201526064016200009b565b5050600180546001600160a01b0319166001600160a01b039290921691909117905550620003ab915050565b80516001600160a01b0381168114620002fa57600080fd5b919050565b60008060008060008060c087890312156200031957600080fd5b6200032487620002e2565b95506200033460208801620002e2565b94506200034460408801620002e2565b93506200035460608801620002e2565b92506200036460808801620002e2565b91506200037460a08801620002e2565b90509295509295509295565b6000602082840312156200039357600080fd5b81518015158114620003a457600080fd5b9392505050565b60805160601c60a05160601c60c05160601c60e05160601c6101005160601c610a63620004286000396000818161015a015281816101fc01526102c00152600081816101cf01526103bb01526000818160cf015261062a0152600081816101a8015261064c01526000818161018101526104d40152610a636000f3fe608060405234801561001057600080fd5b506004361061009d5760003560e01c80635ec2c7bf116100665780635ec2c7bf146101425780638da5cb5b14610155578063aabaecd61461017c578063b269681d146101a3578063c3124525146101ca57600080fd5b8062ede7e4146100a2578063201add9b146100b757806339ba9f86146100ca5780633ba29db31461010e5780635b9df3c314610121575b600080fd5b6100b56100b03660046108b0565b6101f1565b005b6100b56100c53660046108d2565b6102b5565b6100f17f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020015b60405180910390f35b6100b561011c366004610962565b6103b9565b61013461012f366004610930565b6106bf565b604051908152602001610105565b6001546100f1906001600160a01b031681565b6100f17f000000000000000000000000000000000000000000000000000000000000000081565b6100f17f000000000000000000000000000000000000000000000000000000000000000081565b6100f17f000000000000000000000000000000000000000000000000000000000000000081565b6100f17f000000000000000000000000000000000000000000000000000000000000000081565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146102615760405162461bcd60e51b815260206004820152601060248201526f2624a89d29a09d2727aa2fa7aba722a960811b60448201526064015b60405180910390fd5b600180546001600160a01b0319166001600160a01b0383169081179091556040519081527f4ee0985a129917c72eab0afe7ec6060bf6c6e0796bedc42de903d9dbbadfc51d9060200160405180910390a150565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146103205760405162461bcd60e51b815260206004820152601060248201526f2624a89d28231d2727aa2fa7aba722a960811b6044820152606401610258565b604080516001600160a01b038086168252841660208201529081018290527fe9bfec84ab7c3ab810debd9559b5e87a967d87138053250aa788ef1e0464fd429060600160405180910390a1610376838383610742565b6103b45760405162461bcd60e51b815260206004820152600f60248201526e2624a89d28231d2a2920a729a322a960891b6044820152606401610258565b505050565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663425fad586040518163ffffffff1660e01b815260040160206040518083038186803b15801561041257600080fd5b505afa158015610426573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061044a919061090e565b1561048d5760405162461bcd60e51b81526020600482015260136024820152721312544e941493d513d0d3d317d4105554d151606a1b6044820152606401610258565b600054156104ca5760405162461bcd60e51b815260206004820152600a6024820152691312544e9313d0d2d15160b21b6044820152606401610258565b60016000556104fa7f00000000000000000000000000000000000000000000000000000000000000003386610742565b6105385760405162461bcd60e51b815260206004820152600f60248201526e2624a89d26281d2a2920a729a322a960891b6044820152606401610258565b604051339061054a90849084906109e2565b6000604051808303816000865af19150503d8060008114610587576040519150601f19603f3d011682016040523d82523d6000602084013e61058c565b606091505b505050600061059a856106bf565b9050838111156105ec5760405162461bcd60e51b815260206004820152601a60248201527f4c49513a4c503a4d41585f52455455524e5f45584345454445440000000000006044820152606401610258565b60408051868152602081018390527fbe5ff6ed515f1d56105466ed671dfae9b960e38088c6dbe958dc2eab14898fd1910160405180910390a16106717f0000000000000000000000000000000000000000000000000000000000000000337f0000000000000000000000000000000000000000000000000000000000000000846107b0565b6106b45760405162461bcd60e51b81526020600482015260146024820152734c49513a4c503a5452414e534645525f46524f4d60601b6044820152606401610258565b505060008055505050565b600154604051635b9df3c360e01b8152600481018390526000916001600160a01b031690635b9df3c39060240160206040518083038186803b15801561070457600080fd5b505afa158015610718573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061073c9190610949565b92915050565b6040516001600160a01b0383166024820152604481018290526000906107a890859063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526107f4565b949350505050565b6040516001600160a01b03808516602483015283166044820152606481018290526000906107eb9086906323b872dd60e01b90608401610771565b95945050505050565b60006001600160a01b0383163b61080d5750600061073c565b6060836001600160a01b03168360405161082791906109f2565b6000604051808303816000865af19150503d8060008114610864576040519150601f19603f3d011682016040523d82523d6000602084013e610869565b606091505b5090925090508180156107a85750805115806107a85750808060200190518101906107a8919061090e565b80356001600160a01b03811681146108ab57600080fd5b919050565b6000602082840312156108c257600080fd5b6108cb82610894565b9392505050565b6000806000606084860312156108e757600080fd5b6108f084610894565b92506108fe60208501610894565b9150604084013590509250925092565b60006020828403121561092057600080fd5b815180151581146108cb57600080fd5b60006020828403121561094257600080fd5b5035919050565b60006020828403121561095b57600080fd5b5051919050565b6000806000806060858703121561097857600080fd5b8435935060208501359250604085013567ffffffffffffffff8082111561099e57600080fd5b818701915087601f8301126109b257600080fd5b8135818111156109c157600080fd5b8860208285010111156109d357600080fd5b95989497505060200194505050565b8183823760009101908152919050565b6000825160005b81811015610a1357602081860181015185830152016109f9565b81811115610a22576000828501525b50919091019291505056fea26469706673582212209e62636e64f35eee877b48f6cdb1585074762d88eb77acc4d35cecc0f1656af764736f6c63430008070033a26469706673582212206c71fc8537b36cb91450ca4a62fba1777066797d32723873195cdd93d6c3b20f64736f6c63430008070033

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading

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