ETH Price: $3,147.76 (-6.97%)

Contract

0x79eF6d28C41e47A588E2F2ffB4140Eb6d952AEc4
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Deposit And Borr...211564692024-11-10 9:48:112 days ago1731232091IN
0x79eF6d28...6d952AEc4
0 ETH0.0030117912.57293634
Repay And Withdr...211426222024-11-08 11:27:474 days ago1731065267IN
0x79eF6d28...6d952AEc4
0 ETH0.0018208613.82157143
Borrow211335972024-11-07 5:10:356 days ago1730956235IN
0x79eF6d28...6d952AEc4
0 ETH0.0017804711.05175386
Borrow211335532024-11-07 5:01:476 days ago1730955707IN
0x79eF6d28...6d952AEc4
0 ETH0.0024034413.4871172
Deposit And Borr...211333462024-11-07 4:20:236 days ago1730953223IN
0x79eF6d28...6d952AEc4
0 ETH0.0028639212.2
Borrow211114772024-11-04 3:04:479 days ago1730689487IN
0x79eF6d28...6d952AEc4
0 ETH0.001054355.398606
Force Replenish ...211094872024-11-03 20:25:119 days ago1730665511IN
0x79eF6d28...6d952AEc4
0 ETH0.000779364.32008647
Repay And Withdr...210838432024-10-31 6:32:3512 days ago1730356355IN
0x79eF6d28...6d952AEc4
0 ETH0.000969187.03146344
Repay And Withdr...210838232024-10-31 6:28:3512 days ago1730356115IN
0x79eF6d28...6d952AEc4
0 ETH0.001271917.07325838
Repay And Withdr...210838062024-10-31 6:24:5913 days ago1730355899IN
0x79eF6d28...6d952AEc4
0 ETH0.001331927.4069727
Repay And Withdr...210837872024-10-31 6:21:1113 days ago1730355671IN
0x79eF6d28...6d952AEc4
0 ETH0.001351387.51521633
Repay And Withdr...210837612024-10-31 6:15:3513 days ago1730355335IN
0x79eF6d28...6d952AEc4
0 ETH0.001514578.42274153
Repay And Withdr...210837462024-10-31 6:12:3513 days ago1730355155IN
0x79eF6d28...6d952AEc4
0 ETH0.001417747.88531426
Repay And Withdr...210837232024-10-31 6:07:5913 days ago1730354879IN
0x79eF6d28...6d952AEc4
0 ETH0.001406267.82041518
Repay And Withdr...210837052024-10-31 6:04:2313 days ago1730354663IN
0x79eF6d28...6d952AEc4
0 ETH0.001448598.05582114
Repay And Withdr...210836912024-10-31 6:01:1113 days ago1730354471IN
0x79eF6d28...6d952AEc4
0 ETH0.001459598.11698734
Repay And Withdr...210836602024-10-31 5:54:5913 days ago1730354099IN
0x79eF6d28...6d952AEc4
0 ETH0.001651238.19821778
Borrow210530792024-10-26 23:28:1117 days ago1729985291IN
0x79eF6d28...6d952AEc4
0 ETH0.000673013.08831779
Deposit And Borr...210366082024-10-24 16:19:1119 days ago1729786751IN
0x79eF6d28...6d952AEc4
0 ETH0.0038837721.7
Deposit And Borr...210365892024-10-24 16:15:2319 days ago1729786523IN
0x79eF6d28...6d952AEc4
0 ETH0.0036354218.1
Deposit And Borr...210364642024-10-24 15:50:2319 days ago1729785023IN
0x79eF6d28...6d952AEc4
0 ETH0.004753413.44851626
Deposit And Borr...210349052024-10-24 10:37:2319 days ago1729766243IN
0x79eF6d28...6d952AEc4
0 ETH0.001611289.0028104
Borrow210348972024-10-24 10:35:4719 days ago1729766147IN
0x79eF6d28...6d952AEc4
0 ETH0.001346458.30425224
Deposit And Borr...210348612024-10-24 10:28:3519 days ago1729765715IN
0x79eF6d28...6d952AEc4
0 ETH0.003127648.61571341
Deposit And Borr...210317672024-10-24 0:06:4720 days ago1729728407IN
0x79eF6d28...6d952AEc4
0 ETH0.001537426.55387359
View all transactions

Latest 17 internal transactions

Advanced mode:
Parent Transaction Hash Block From To
211665542024-11-11 19:33:2334 hrs ago1731353603
0x79eF6d28...6d952AEc4
 Contract Creation0 ETH
211657342024-11-11 16:48:1137 hrs ago1731343691
0x79eF6d28...6d952AEc4
 Contract Creation0 ETH
210756362024-10-30 2:59:4714 days ago1730257187
0x79eF6d28...6d952AEc4
 Contract Creation0 ETH
210671002024-10-28 22:25:2315 days ago1730154323
0x79eF6d28...6d952AEc4
 Contract Creation0 ETH
210408242024-10-25 6:25:5919 days ago1729837559
0x79eF6d28...6d952AEc4
 Contract Creation0 ETH
210385962024-10-24 22:57:5919 days ago1729810679
0x79eF6d28...6d952AEc4
 Contract Creation0 ETH
210384052024-10-24 22:19:4719 days ago1729808387
0x79eF6d28...6d952AEc4
 Contract Creation0 ETH
210364642024-10-24 15:50:2319 days ago1729785023
0x79eF6d28...6d952AEc4
 Contract Creation0 ETH
210348612024-10-24 10:28:3519 days ago1729765715
0x79eF6d28...6d952AEc4
 Contract Creation0 ETH
209963262024-10-19 1:27:3525 days ago1729301255
0x79eF6d28...6d952AEc4
 Contract Creation0 ETH
209878462024-10-17 21:02:5926 days ago1729198979
0x79eF6d28...6d952AEc4
 Contract Creation0 ETH
209876162024-10-17 20:16:4726 days ago1729196207
0x79eF6d28...6d952AEc4
 Contract Creation0 ETH
209520562024-10-12 20:58:2331 days ago1728766703
0x79eF6d28...6d952AEc4
 Contract Creation0 ETH
209321492024-10-10 2:13:5934 days ago1728526439
0x79eF6d28...6d952AEc4
 Contract Creation0 ETH
208883862024-10-03 23:52:1140 days ago1727999531
0x79eF6d28...6d952AEc4
 Contract Creation0 ETH
208660522024-09-30 21:06:3543 days ago1727730395
0x79eF6d28...6d952AEc4
 Contract Creation0 ETH
206769102024-09-04 11:26:1169 days ago1725449171
0x79eF6d28...6d952AEc4
 Contract Creation0 ETH
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Market

Compiler Version
v0.8.21+commit.d9974bed

Optimization Enabled:
Yes with 200 runs

Other Settings:
paris EvmVersion
File 1 of 1 : Market.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;

// Caution. We assume all failed transfers cause reverts and ignore the returned bool.
interface IERC20 {
    function transfer(address,uint) external returns (bool);
    function transferFrom(address,address,uint) external returns (bool);
    function balanceOf(address) external view returns (uint);
}

interface IOracle {
    function getPrice(address,uint) external returns (uint);
    function viewPrice(address,uint) external view returns (uint);
}

interface IEscrow {
    function initialize(IERC20 _token, address beneficiary) external;
    function onDeposit() external;
    function pay(address recipient, uint amount) external;
    function balance() external view returns (uint);
}

interface IDolaBorrowingRights {
    function onBorrow(address user, uint additionalDebt) external;
    function onRepay(address user, uint repaidDebt) external;
    function onForceReplenish(address user, address replenisher, uint amount, uint replenisherReward) external;
    function balanceOf(address user) external view returns (uint);
    function deficitOf(address user) external view returns (uint);
    function replenishmentPriceBps() external view returns (uint);
}

interface IBorrowController {
    function borrowAllowed(address msgSender, address borrower, uint amount) external returns (bool);
    function onRepay(uint amount) external;
}

contract Market {

    address public gov;
    address public lender;
    address public pauseGuardian;
    address public immutable escrowImplementation;
    IDolaBorrowingRights public immutable dbr;
    IBorrowController public borrowController;
    IERC20 public immutable dola = IERC20(0x865377367054516e17014CcdED1e7d814EDC9ce4);
    IERC20 public immutable collateral;
    IOracle public oracle;
    uint public collateralFactorBps;
    uint public replenishmentIncentiveBps;
    uint public liquidationIncentiveBps;
    uint public liquidationFeeBps;
    uint public liquidationFactorBps = 5000; // 50% by default
    bool immutable callOnDepositCallback;
    bool public borrowPaused;
    uint public totalDebt;
    uint256 internal immutable INITIAL_CHAIN_ID;
    bytes32 internal immutable INITIAL_DOMAIN_SEPARATOR;
    mapping (address => IEscrow) public escrows; // user => escrow
    mapping (address => uint) public debts; // user => debt
    mapping(address => uint256) public nonces; // user => nonce

    constructor (
        address _gov,
        address _lender,
        address _pauseGuardian,
        address _escrowImplementation,
        IDolaBorrowingRights _dbr,
        IERC20 _collateral,
        IOracle _oracle,
        uint _collateralFactorBps,
        uint _replenishmentIncentiveBps,
        uint _liquidationIncentiveBps,
        bool _callOnDepositCallback
    ) {
        require(_collateralFactorBps < 10000, "Invalid collateral factor");
        require(_liquidationIncentiveBps > 0 && _liquidationIncentiveBps < 10000, "Invalid liquidation incentive");
        require(_replenishmentIncentiveBps < 10000, "Replenishment incentive must be less than 100%");
        gov = _gov;
        lender = _lender;
        pauseGuardian = _pauseGuardian;
        escrowImplementation = _escrowImplementation;
        dbr = _dbr;
        collateral = _collateral;
        oracle = _oracle;
        collateralFactorBps = _collateralFactorBps;
        replenishmentIncentiveBps = _replenishmentIncentiveBps;
        liquidationIncentiveBps = _liquidationIncentiveBps;
        callOnDepositCallback = _callOnDepositCallback;
        INITIAL_CHAIN_ID = block.chainid;
        INITIAL_DOMAIN_SEPARATOR = computeDomainSeparator();
        if(collateralFactorBps > 0){
            uint unsafeLiquidationIncentive = (10000 - collateralFactorBps) * (liquidationFeeBps + 10000) / collateralFactorBps;
            require(liquidationIncentiveBps < unsafeLiquidationIncentive,  "Liquidation param allow profitable self liquidation");
        }
    }
    
    modifier onlyGov {
        require(msg.sender == gov, "Only gov can call this function");
        _;
    }

    modifier liquidationParamChecker {
        _;
        if(collateralFactorBps > 0){
            uint unsafeLiquidationIncentive = (10000 - collateralFactorBps) * (liquidationFeeBps + 10000) / collateralFactorBps;
            require(liquidationIncentiveBps < unsafeLiquidationIncentive,  "New liquidation param allow profitable self liquidation");
        }
    }

    function DOMAIN_SEPARATOR() public view virtual returns (bytes32) {
        return block.chainid == INITIAL_CHAIN_ID ? INITIAL_DOMAIN_SEPARATOR : computeDomainSeparator();
    }

    function computeDomainSeparator() internal view virtual returns (bytes32) {
        return
            keccak256(
                abi.encode(
                    keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"),
                    keccak256(bytes("DBR MARKET")),
                    keccak256("1"),
                    block.chainid,
                    address(this)
                )
            );
    }

    /**
    @notice sets the oracle to a new oracle. Only callable by governance.
    @param _oracle The new oracle conforming to the IOracle interface.
    */
    function setOracle(IOracle _oracle) public onlyGov { oracle = _oracle; }

    /**
    @notice sets the borrow controller to a new borrow controller. Only callable by governance.
    @param _borrowController The new borrow controller conforming to the IBorrowController interface.
    */
    function setBorrowController(IBorrowController _borrowController) public onlyGov { borrowController = _borrowController; }

    /**
    @notice sets the address of governance. Only callable by governance.
    @param _gov Address of the new governance.
    */
    function setGov(address _gov) public onlyGov { gov = _gov; }

    /**
    @notice sets the lender to a new lender. The lender is allowed to recall dola from the contract. Only callable by governance.
    @param _lender Address of the new lender.
    */
    function setLender(address _lender) public onlyGov { lender = _lender; }

    /**
    @notice sets the pause guardian. The pause guardian can pause borrowing. Only callable by governance.
    @param _pauseGuardian Address of the new pauseGuardian.
    */
    function setPauseGuardian(address _pauseGuardian) public onlyGov { pauseGuardian = _pauseGuardian; }
    
    /**
    @notice sets the Collateral Factor requirement of the market as measured in basis points. 1 = 0.01%. Only callable by governance.
    @dev Collateral factor mus be set below 100%
    @param _collateralFactorBps The new collateral factor as measured in basis points. 
    */
    function setCollateralFactorBps(uint _collateralFactorBps) public onlyGov liquidationParamChecker {
        require(_collateralFactorBps < 10000, "Invalid collateral factor");
        collateralFactorBps = _collateralFactorBps;
    }
    
    /**
    @notice sets the Liquidation Factor of the market as denoted in basis points.
     The liquidation Factor denotes the maximum amount of debt that can be liquidated in basis points.
     At 5000, 50% of of a borrower's underwater debt can be liquidated. Only callable by governance.
    @dev Must be set between 1 and 10000.
    @param _liquidationFactorBps The new liquidation factor in basis points. 1 = 0.01%/
    */
    function setLiquidationFactorBps(uint _liquidationFactorBps) public onlyGov {
        require(_liquidationFactorBps > 0 && _liquidationFactorBps <= 10000, "Invalid liquidation factor");
        liquidationFactorBps = _liquidationFactorBps;
    }

    /**
    @notice sets the Replenishment Incentive of the market as denoted in basis points.
     The Replenishment Incentive is the percentage paid out to replenishers on a successful forceReplenish call, denoted in basis points.
    @dev Must be set between 1 and 10000.
    @param _replenishmentIncentiveBps The new replenishment incentive set in basis points. 1 = 0.01%
    */
    function setReplenismentIncentiveBps(uint _replenishmentIncentiveBps) public onlyGov {
        require(_replenishmentIncentiveBps > 0 && _replenishmentIncentiveBps < 10000, "Invalid replenishment incentive");
        replenishmentIncentiveBps = _replenishmentIncentiveBps;
    }

    /**
    @notice sets the Liquidation Incentive of the market as denoted in basis points.
     The Liquidation Incentive is the percentage paid out to liquidators of a borrower's debt when successfully liquidated.
    @dev Must be set between 0 and 10000 - liquidation fee.
    @param _liquidationIncentiveBps The new liqudation incentive set in basis points. 1 = 0.01% 
    */
    function setLiquidationIncentiveBps(uint _liquidationIncentiveBps) public onlyGov liquidationParamChecker {
        require(_liquidationIncentiveBps > 0 && _liquidationIncentiveBps + liquidationFeeBps < 10000, "Invalid liquidation incentive");
        liquidationIncentiveBps = _liquidationIncentiveBps;
    }

    /**
    @notice sets the Liquidation Fee of the market as denoted in basis points.
     The Liquidation Fee is the percentage paid out to governance of a borrower's debt when successfully liquidated.
    @dev Must be set between 0 and 10000 - liquidation factor.
    @param _liquidationFeeBps The new liquidation fee set in basis points. 1 = 0.01%
    */
    function setLiquidationFeeBps(uint _liquidationFeeBps) public onlyGov liquidationParamChecker {
        require(_liquidationFeeBps > 0 && _liquidationFeeBps + liquidationIncentiveBps < 10000, "Invalid liquidation fee");
        liquidationFeeBps = _liquidationFeeBps;
    }

    /**
    @notice Recalls amount of DOLA to the lender.
    @param amount The amount od DOLA to recall to the the lender.
    */
    function recall(uint amount) public {
        require(msg.sender == lender, "Only lender can recall");
        dola.transfer(msg.sender, amount);
    }

    /**
    @notice Pauses or unpauses borrowing for the market. Only gov can unpause a market, while gov and pauseGuardian can pause it.
    @param _value Boolean representing the state pause state of borrows. true = paused, false = unpaused.
    */
    function pauseBorrows(bool _value) public {
        if(_value) {
            require(msg.sender == pauseGuardian || msg.sender == gov, "Only pause guardian or governance can pause");
        } else {
            require(msg.sender == gov, "Only governance can unpause");
        }
        borrowPaused = _value;
    }

    /**
    @notice Internal function for creating an escrow for users to deposit collateral in.
    @dev Uses create2 and minimal proxies to create the escrow at a deterministic address
    @param user The address of the user to create an escrow for.
    */
    function createEscrow(address user) internal returns (IEscrow instance) {
        address implementation = escrowImplementation;
        /// @solidity memory-safe-assembly
        assembly {
            let ptr := mload(0x40)
            mstore(ptr, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000)
            mstore(add(ptr, 0x14), shl(0x60, implementation))
            mstore(add(ptr, 0x28), 0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000)
            instance := create2(0, ptr, 0x37, user)
        }
        require(instance != IEscrow(address(0)), "ERC1167: create2 failed");
        emit CreateEscrow(user, address(instance));
    }

    /**
    @notice Internal function for getting the escrow of a user.
    @dev If the escrow doesn't exist, an escrow contract is deployed.
    @param user The address of the user owning the escrow.
    */
    function getEscrow(address user) internal returns (IEscrow) {
        if(escrows[user] != IEscrow(address(0))) return escrows[user];
        IEscrow escrow = createEscrow(user);
        escrow.initialize(collateral, user);
        escrows[user] = escrow;
        return escrow;
    }

    /**
    @notice Deposit amount of collateral into escrow
    @dev Will deposit the amount into the escrow contract.
    @param amount Amount of collateral token to deposit.
    */
    function deposit(uint amount) public {
        deposit(msg.sender, amount);
    }

    /**
    @notice Deposit and borrow in a single transaction.
    @param amountDeposit Amount of collateral token to deposit into escrow.
    @param amountBorrow Amount of DOLA to borrow.
    */
    function depositAndBorrow(uint amountDeposit, uint amountBorrow) public {
        deposit(amountDeposit);
        borrow(amountBorrow);
    }

    /**
    @notice Deposit amount of collateral into escrow on behalf of msg.sender
    @dev Will deposit the amount into the escrow contract.
    @param user User to deposit on behalf of.
    @param amount Amount of collateral token to deposit.
    */
    function deposit(address user, uint amount) public {
        IEscrow escrow = getEscrow(user);
        collateral.transferFrom(msg.sender, address(escrow), amount);
        if(callOnDepositCallback) {
            escrow.onDeposit();
        }
        emit Deposit(user, amount);
    }

    /**
    @notice View function for predicting the deterministic escrow address of a user.
    @dev Only use deposit() function for deposits and NOT the predicted escrow address unless you know what you're doing
    @param user Address of the user owning the escrow.
    */
    function predictEscrow(address user) public view returns (IEscrow predicted) {
        address implementation = escrowImplementation;
        address deployer = address(this);
        /// @solidity memory-safe-assembly
        assembly {
            let ptr := mload(0x40)
            mstore(ptr, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000)
            mstore(add(ptr, 0x14), shl(0x60, implementation))
            mstore(add(ptr, 0x28), 0x5af43d82803e903d91602b57fd5bf3ff00000000000000000000000000000000)
            mstore(add(ptr, 0x38), shl(0x60, deployer))
            mstore(add(ptr, 0x4c), user)
            mstore(add(ptr, 0x6c), keccak256(ptr, 0x37))
            predicted := keccak256(add(ptr, 0x37), 0x55)
        }
    }

    /**
    @notice View function for getting the dollar value of the user's collateral in escrow for the market.
    @param user Address of the user.
    */
    function getCollateralValue(address user) public view returns (uint) {
        IEscrow escrow = predictEscrow(user);
        uint collateralBalance = escrow.balance();
        return collateralBalance * oracle.viewPrice(address(collateral), collateralFactorBps) / 1 ether;
    }

    /**
    @notice Internal function for getting the dollar value of the user's collateral in escrow for the market.
    @dev Updates the lowest price comparisons of the pessimistic oracle
    @param user Address of the user.
    */
    function getCollateralValueInternal(address user) internal returns (uint) {
        IEscrow escrow = predictEscrow(user);
        uint collateralBalance = escrow.balance();
        return collateralBalance * oracle.getPrice(address(collateral), collateralFactorBps) / 1 ether;
    }

    /**
    @notice View function for getting the credit limit of a user.
    @dev To calculate the available credit, subtract user debt from credit limit.
    @param user Address of the user.
    */
    function getCreditLimit(address user) public view returns (uint) {
        uint collateralValue = getCollateralValue(user);
        return collateralValue * collateralFactorBps / 10000;
    }

    /**
    @notice Internal function for getting the credit limit of a user.
    @dev To calculate the available credit, subtract user debt from credit limit. Updates the pessimistic oracle.
    @param user Address of the user.
    */
    function getCreditLimitInternal(address user) internal returns (uint) {
        uint collateralValue = getCollateralValueInternal(user);
        return collateralValue * collateralFactorBps / 10000;
    }
    /**
    @notice Internal function for getting the withdrawal limit of a user.
     The withdrawal limit is how much collateral a user can withdraw before their loan would be underwater. Updates the pessimistic oracle.
    @param user Address of the user.
    */
    function getWithdrawalLimitInternal(address user) internal returns (uint) {
        IEscrow escrow = predictEscrow(user);
        uint collateralBalance = escrow.balance();
        if(collateralBalance == 0) return 0;
        uint debt = debts[user];
        if(debt == 0) return collateralBalance;
        if(collateralFactorBps == 0) return 0;
        uint minimumCollateral = debt * 1 ether / oracle.getPrice(address(collateral), collateralFactorBps) * 10000 / collateralFactorBps;
        if(collateralBalance <= minimumCollateral) return 0;
        return collateralBalance - minimumCollateral;
    }

    /**
    @notice View function for getting the withdrawal limit of a user.
     The withdrawal limit is how much collateral a user can withdraw before their loan would be underwater.
    @param user Address of the user.
    */
    function getWithdrawalLimit(address user) public view returns (uint) {
        IEscrow escrow = predictEscrow(user);
        uint collateralBalance = escrow.balance();
        if(collateralBalance == 0) return 0;
        uint debt = debts[user];
        if(debt == 0) return collateralBalance;
        if(collateralFactorBps == 0) return 0;
        uint minimumCollateral = debt * 1 ether / oracle.viewPrice(address(collateral), collateralFactorBps) * 10000 / collateralFactorBps;
        if(collateralBalance <= minimumCollateral) return 0;
        return collateralBalance - minimumCollateral;
    }

    /**
    @notice Internal function for borrowing DOLA against collateral.
    @dev This internal function is shared between the borrow and borrowOnBehalf function
    @param borrower The address of the borrower that debt will be accrued to.
    @param to The address that will receive the borrowed DOLA
    @param amount The amount of DOLA to be borrowed
    */
    function borrowInternal(address borrower, address to, uint amount) internal {
        require(!borrowPaused, "Borrowing is paused");
        if(borrowController != IBorrowController(address(0))) {
            require(borrowController.borrowAllowed(msg.sender, borrower, amount), "Denied by borrow controller");
        }
        uint credit = getCreditLimitInternal(borrower);
        debts[borrower] += amount;
        require(credit >= debts[borrower], "Exceeded credit limit");
        totalDebt += amount;
        dbr.onBorrow(borrower, amount);
        dola.transfer(to, amount);
        emit Borrow(borrower, amount);
    }

    /**
    @notice Function for borrowing DOLA.
    @dev Will borrow to msg.sender
    @param amount The amount of DOLA to be borrowed.
    */
    function borrow(uint amount) public {
        borrowInternal(msg.sender, msg.sender, amount);
    }

    /**
    @notice Function for using a signed message to borrow on behalf of an address owning an escrow with collateral.
    @dev Signed messaged can be invalidated by incrementing the nonce. Will always borrow to the msg.sender.
    @param from The address of the user being borrowed from
    @param amount The amount to be borrowed
    @param deadline Timestamp after which the signed message will be invalid
    @param v The v param of the ECDSA signature
    @param r The r param of the ECDSA signature
    @param s The s param of the ECDSA signature
    */
    function borrowOnBehalf(address from, uint amount, uint deadline, uint8 v, bytes32 r, bytes32 s) public {
        require(deadline >= block.timestamp, "DEADLINE_EXPIRED");
        unchecked {
            address recoveredAddress = ecrecover(
                keccak256(
                    abi.encodePacked(
                        "\x19\x01",
                        DOMAIN_SEPARATOR(),
                        keccak256(
                            abi.encode(
                                keccak256(
                                    "BorrowOnBehalf(address caller,address from,uint256 amount,uint256 nonce,uint256 deadline)"
                                ),
                                msg.sender,
                                from,
                                amount,
                                nonces[from]++,
                                deadline
                            )
                        )
                    )
                ),
                v,
                r,
                s
            );
            require(recoveredAddress != address(0) && recoveredAddress == from, "INVALID_SIGNER");
            borrowInternal(from, msg.sender, amount);
        }
    }

    /**
    @notice Internal function for withdrawing from the escrow
    @dev The internal function is shared by the withdraw function and withdrawOnBehalf function
    @param from The address owning the escrow to withdraw from.
    @param to The address receiving the tokens
    @param amount The amount being withdrawn.
    */
    function withdrawInternal(address from, address to, uint amount) internal {
        uint limit = getWithdrawalLimitInternal(from);
        require(limit >= amount, "Insufficient withdrawal limit");
        require(dbr.deficitOf(from) == 0, "Can't withdraw with DBR deficit");
        IEscrow escrow = getEscrow(from);
        escrow.pay(to, amount);
        emit Withdraw(from, to, amount);
    }

    /**
    @notice Function for withdrawing to msg.sender.
    @param amount Amount to withdraw.
    */
    function withdraw(uint amount) public {
        withdrawInternal(msg.sender, msg.sender, amount);
    }

    /**
    @notice Function for using a signed message to withdraw on behalf of an address owning an escrow with collateral.
    @dev Signed messaged can be invalidated by incrementing the nonce. Will always withdraw to the msg.sender.
    @param from The address of the user owning the escrow being withdrawn from
    @param amount The amount to be withdrawn
    @param deadline Timestamp after which the signed message will be invalid
    @param v The v param of the ECDSA signature
    @param r The r param of the ECDSA signature
    @param s The s param of the ECDSA signature
    */
    function withdrawOnBehalf(address from, uint amount, uint deadline, uint8 v, bytes32 r, bytes32 s) public {
        require(deadline >= block.timestamp, "DEADLINE_EXPIRED");
        unchecked {
            address recoveredAddress = ecrecover(
                keccak256(
                    abi.encodePacked(
                        "\x19\x01",
                        DOMAIN_SEPARATOR(),
                        keccak256(
                            abi.encode(
                                keccak256(
                                    "WithdrawOnBehalf(address caller,address from,uint256 amount,uint256 nonce,uint256 deadline)"
                                ),
                                msg.sender,
                                from,
                                amount,
                                nonces[from]++,
                                deadline
                            )
                        )
                    )
                ),
                v,
                r,
                s
            );
            require(recoveredAddress != address(0) && recoveredAddress == from, "INVALID_SIGNER");
            withdrawInternal(from, msg.sender, amount);
        }
    }

    /**
    @notice Function for incrementing the nonce of the msg.sender, making their latest signed message unusable.
    */
    function invalidateNonce() public {
        nonces[msg.sender]++;
    }
    
    /**
    @notice Function for repaying debt on behalf of user. Debt must be repaid in DOLA.
    @dev If the user has a DBR deficit, they risk initial debt being accrued by forced replenishments.
    @param user Address of the user whose debt is being repaid
    @param amount DOLA amount to be repaid. If set to max uint debt will be repaid in full.
    */
    function repay(address user, uint amount) public {
        uint debt = debts[user];
        if(amount == type(uint).max){
            amount = debt;
        }
        require(debt >= amount, "Repayment greater than debt");
        debts[user] -= amount;
        totalDebt -= amount;
        dbr.onRepay(user, amount);
        if(address(borrowController) != address(0)){
            borrowController.onRepay(amount);
        }
        dola.transferFrom(msg.sender, address(this), amount);
        emit Repay(user, msg.sender, amount);
    }

    /**
    @notice Bundles repayment and withdrawal into a single function call.
    @param repayAmount Amount of DOLA to be repaid
    @param withdrawAmount Amount of underlying to be withdrawn from the escrow
    */
    function repayAndWithdraw(uint repayAmount, uint withdrawAmount) public {
        repay(msg.sender, repayAmount);
        withdraw(withdrawAmount);
    }

    /**
    @notice Function for forcing a user to replenish their DBR deficit at a pre-determined price.
     The replenishment will accrue additional DOLA debt.
     On a successful call, the caller will be paid a replenishment incentive.
    @dev The function will only top the user back up to 0, meaning that the user will have a DBR deficit again in the next block.
    @param user The address of the user being forced to replenish DBR
    @param amount The amount of DBR the user will be replenished.
    */
    function forceReplenish(address user, uint amount) public {
        uint deficit = dbr.deficitOf(user);
        require(deficit > 0, "No DBR deficit");
        require(deficit >= amount, "Amount > deficit");
        uint replenishmentCost = amount * dbr.replenishmentPriceBps() / 10000;
        uint replenisherReward = replenishmentCost * replenishmentIncentiveBps / 10000;
        debts[user] += replenishmentCost;
        uint collateralValue = getCollateralValueInternal(user) * (10000 - liquidationIncentiveBps - liquidationFeeBps) / 10000;
        require(collateralValue >= debts[user], "Exceeded collateral value");
        totalDebt += replenishmentCost;
        dbr.onForceReplenish(user, msg.sender, amount, replenisherReward);
        dola.transfer(msg.sender, replenisherReward);
    }
    /**
    @notice Function for forcing a user to replenish all of their DBR deficit at a pre-determined price.
     The replenishment will accrue additional DOLA debt.
     On a successful call, the caller will be paid a replenishment incentive.
    @dev The function will only top the user back up to 0, meaning that the user will have a DBR deficit again in the next block.
    @param user The address of the user being forced to replenish DBR
    */
    function forceReplenishAll(address user) public {
        uint deficit = dbr.deficitOf(user);
        forceReplenish(user, deficit);
    }

    /**
    @notice Function for liquidating a user's under water debt. Debt is under water when the value of a user's debt is above their collateral factor.
    @param user The user to be liquidated
    @param repaidDebt Th amount of user user debt to liquidate.
    */
    function liquidate(address user, uint repaidDebt) public {
        require(repaidDebt > 0, "Must repay positive debt");
        uint debt = debts[user];
        require(getCreditLimitInternal(user) < debt, "User debt is healthy");
        require(repaidDebt <= debt * liquidationFactorBps / 10000, "Exceeded liquidation factor");
        uint price = oracle.getPrice(address(collateral), collateralFactorBps);
        uint liquidatorReward = repaidDebt * 1 ether / price;
        liquidatorReward += liquidatorReward * liquidationIncentiveBps / 10000;
        debts[user] -= repaidDebt;
        totalDebt -= repaidDebt;
        dbr.onRepay(user, repaidDebt);
        dola.transferFrom(msg.sender, address(this), repaidDebt);
        IEscrow escrow = predictEscrow(user);
        escrow.pay(msg.sender, liquidatorReward);
        if(liquidationFeeBps > 0) {
            uint liquidationFee = repaidDebt * 1 ether / price * liquidationFeeBps / 10000;
            uint balance = escrow.balance();
            if(balance >= liquidationFee) {
                escrow.pay(gov, liquidationFee);
            } else if(balance > 0) {
                escrow.pay(gov, balance);
            }
        }
        emit Liquidate(user, msg.sender, repaidDebt, liquidatorReward);
    }
    
    event Deposit(address indexed account, uint amount);
    event Borrow(address indexed account, uint amount);
    event Withdraw(address indexed account, address indexed to, uint amount);
    event Repay(address indexed account, address indexed repayer, uint amount);
    event Liquidate(address indexed account, address indexed liquidator, uint repaidDebt, uint liquidatorReward);
    event CreateEscrow(address indexed user, address escrow);
}

Settings
{
  "remappings": [
    "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
    "ds-test/=lib/solmate/lib/ds-test/src/",
    "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
    "forge-std/=lib/forge-std/src/",
    "openzeppelin-contracts/=lib/openzeppelin-contracts/",
    "solmate/=lib/solmate/src/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "metadata": {
    "useLiteralContent": false,
    "bytecodeHash": "ipfs",
    "appendCBOR": true
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "paris",
  "viaIR": false,
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_gov","type":"address"},{"internalType":"address","name":"_lender","type":"address"},{"internalType":"address","name":"_pauseGuardian","type":"address"},{"internalType":"address","name":"_escrowImplementation","type":"address"},{"internalType":"contract IDolaBorrowingRights","name":"_dbr","type":"address"},{"internalType":"contract IERC20","name":"_collateral","type":"address"},{"internalType":"contract IOracle","name":"_oracle","type":"address"},{"internalType":"uint256","name":"_collateralFactorBps","type":"uint256"},{"internalType":"uint256","name":"_replenishmentIncentiveBps","type":"uint256"},{"internalType":"uint256","name":"_liquidationIncentiveBps","type":"uint256"},{"internalType":"bool","name":"_callOnDepositCallback","type":"bool"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Borrow","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"address","name":"escrow","type":"address"}],"name":"CreateEscrow","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"liquidator","type":"address"},{"indexed":false,"internalType":"uint256","name":"repaidDebt","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"liquidatorReward","type":"uint256"}],"name":"Liquidate","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"repayer","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Repay","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdraw","type":"event"},{"inputs":[],"name":"DOMAIN_SEPARATOR","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"borrow","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"borrowController","outputs":[{"internalType":"contract IBorrowController","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"borrowOnBehalf","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"borrowPaused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"collateral","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"collateralFactorBps","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"dbr","outputs":[{"internalType":"contract IDolaBorrowingRights","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"debts","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountDeposit","type":"uint256"},{"internalType":"uint256","name":"amountBorrow","type":"uint256"}],"name":"depositAndBorrow","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"dola","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"escrowImplementation","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"escrows","outputs":[{"internalType":"contract IEscrow","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"forceReplenish","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"forceReplenishAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"getCollateralValue","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"getCreditLimit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"getWithdrawalLimit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"gov","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"invalidateNonce","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"lender","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"repaidDebt","type":"uint256"}],"name":"liquidate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"liquidationFactorBps","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"liquidationFeeBps","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"liquidationIncentiveBps","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"nonces","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"oracle","outputs":[{"internalType":"contract IOracle","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bool","name":"_value","type":"bool"}],"name":"pauseBorrows","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"pauseGuardian","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"predictEscrow","outputs":[{"internalType":"contract IEscrow","name":"predicted","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"recall","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"repay","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"repayAmount","type":"uint256"},{"internalType":"uint256","name":"withdrawAmount","type":"uint256"}],"name":"repayAndWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"replenishmentIncentiveBps","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IBorrowController","name":"_borrowController","type":"address"}],"name":"setBorrowController","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_collateralFactorBps","type":"uint256"}],"name":"setCollateralFactorBps","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_gov","type":"address"}],"name":"setGov","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_lender","type":"address"}],"name":"setLender","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_liquidationFactorBps","type":"uint256"}],"name":"setLiquidationFactorBps","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_liquidationFeeBps","type":"uint256"}],"name":"setLiquidationFeeBps","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_liquidationIncentiveBps","type":"uint256"}],"name":"setLiquidationIncentiveBps","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IOracle","name":"_oracle","type":"address"}],"name":"setOracle","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_pauseGuardian","type":"address"}],"name":"setPauseGuardian","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_replenishmentIncentiveBps","type":"uint256"}],"name":"setReplenismentIncentiveBps","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"totalDebt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"withdrawOnBehalf","outputs":[],"stateMutability":"nonpayable","type":"function"}]

61016060405273865377367054516e17014ccded1e7d814edc9ce460c0526113886009553480156200003057600080fd5b50604051620036b7380380620036b78339810160408190526200005391620003a0565b6127108410620000aa5760405162461bcd60e51b815260206004820152601960248201527f496e76616c696420636f6c6c61746572616c20666163746f720000000000000060448201526064015b60405180910390fd5b600082118015620000bc575061271082105b6200010a5760405162461bcd60e51b815260206004820152601d60248201527f496e76616c6964206c69717569646174696f6e20696e63656e746976650000006044820152606401620000a1565b6127108310620001745760405162461bcd60e51b815260206004820152602e60248201527f5265706c656e6973686d656e7420696e63656e74697665206d7573742062652060448201526d6c657373207468616e203130302560901b6064820152608401620000a1565b600080546001600160a01b03808e166001600160a01b031992831617909255600180548d8416908316179055600280548c841690831617905589821660805288821660a05287821660e0526004805492881692909116919091179055600584905560068390556007829055801515610100524661012052620002ac604080518082018252600a8152691110948813505492d15560b21b60209182015281517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f818301527f4fdd2304dc9d5c5a62691d8e7e6cf5fe56e23281f4652fb6b06b133c9c2b03b4818401527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a0808301919091528351808303909101815260c0909101909252815191012090565b610140526005541562000376576000600554600854612710620002d091906200049c565b600554620002e190612710620004b8565b620002ed9190620004ce565b620002f99190620004e8565b90508060075410620003745760405162461bcd60e51b815260206004820152603360248201527f4c69717569646174696f6e20706172616d20616c6c6f772070726f666974616260448201527f6c652073656c66206c69717569646174696f6e000000000000000000000000006064820152608401620000a1565b505b50505050505050505050506200050b565b6001600160a01b03811681146200039d57600080fd5b50565b60008060008060008060008060008060006101608c8e031215620003c357600080fd5b8b51620003d08162000387565b60208d0151909b50620003e38162000387565b60408d0151909a50620003f68162000387565b60608d0151909950620004098162000387565b60808d01519098506200041c8162000387565b60a08d01519097506200042f8162000387565b60c08d0151909650620004428162000387565b8095505060e08c015193506101008c015192506101208c015191506101408c015180151581146200047257600080fd5b809150509295989b509295989b9093969950565b634e487b7160e01b600052601160045260246000fd5b80820180821115620004b257620004b262000486565b92915050565b81810381811115620004b257620004b262000486565b8082028115828204841417620004b257620004b262000486565b6000826200050657634e487b7160e01b600052601260045260246000fd5b500490565b60805160a05160c05160e0516101005161012051610140516130b762000600600039600061106101526000610f7b01526000611173015260008181610647015281816110f401528181611abd01528181611cae0152818161220901528181612a3901528181612b870152612cce01526000818161068a01528181610b0901528181611689015281816118e201528181611e3f015261271a0152600081816105e7015281816106ea01528181610a1701528181611346015281816114400152818161161801528181611dc10152818161269c015261285c0152600081816104430152818161129e0152612d3401526130b76000f3fe608060405234801561001057600080fd5b50600436106102bb5760003560e01c80637164695a11610182578063bcead63e116100e9578063d1220a3c116100a2578063e031a8241161007c578063e031a8241461067c578063ea0593e414610685578063ebc9b94d146106ac578063fc7b9c18146106bf57600080fd5b8063d1220a3c1461062f578063d8dfeb4514610642578063e00f0a991461066957600080fd5b8063bcead63e146105a9578063c5ebeaec146105bc578063c74e6d80146105cf578063c7ed69cd146105e2578063c801861914610609578063cfad57a21461061c57600080fd5b80638951b0541161013b5780638951b0541461052d57806397904e4214610540578063b6b55f2514610553578063b75061bb14610566578063bcb4bbea14610579578063bcbaf4871461059657600080fd5b80637164695a146104b85780637adbf973146104cb5780637d32e793146104de5780637dc0d1d0146104f15780637ecebe00146105045780637f5007ed1461052457600080fd5b80633e553756116102265780634ef64ee7116101df5780634ef64ee7146104655780635a57b46f14610478578063651afe83146104805780636f1c4839146104935780636f48fbb61461049c5780636f8dd24c146104af57600080fd5b80633e553756146103d357806346e368d4146103dc578063477230b2146103ef57806347e7ef241461041857806348bde20c1461042b5780634ca8ff5a1461043e57600080fd5b80632c333e25116102785780632c333e25146103515780632e1a7d4d146103725780632ecd4e7d1461038557806334734dd3146103a55780633525f591146103b85780633644e515146103cb57600080fd5b80630e81c403146102c057806312d43a51146102d55780631ef08b751461030557806322867d7814610318578063236331e91461032b57806324a3d6221461033e575b600080fd5b6102d36102ce366004612e32565b6106c8565b005b6000546102e8906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b6102d3610313366004612e4f565b610767565b6102d3610326366004612eb1565b610945565b6102d3610339366004612e32565b610bcb565b6002546102e8906001600160a01b031681565b61036461035f366004612e32565b610c17565b6040519081526020016102fc565b6102d3610380366004612edd565b610c47565b610364610393366004612e32565b600d6020526000908152604090205481565b6102d36103b3366004612edd565b610c55565b6102d36103c6366004612e4f565b610da7565b610364610f77565b61036460065481565b6102d36103ea366004612e32565b611083565b6102e86103fd366004612e32565b600c602052600090815260409020546001600160a01b031681565b6102d3610426366004612eb1565b6110cf565b6102d3610439366004612e32565b611233565b6102e87f000000000000000000000000000000000000000000000000000000000000000081565b6102e8610473366004612e32565b61127f565b6102d3611302565b6102d361048e366004612eb1565b611324565b61036460095481565b6102d36104aa366004612edd565b611705565b61036460075481565b6102d36104c6366004612edd565b611791565b6102d36104d9366004612e32565b61182c565b6102d36104ec366004612edd565b611878565b6004546102e8906001600160a01b031681565b610364610512366004612e32565b600e6020526000908152604090205481565b61036460055481565b6102d361053b366004612edd565b61195c565b61036461054e366004612e32565b611a12565b6102d3610561366004612edd565b611b42565b6102d3610574366004612ef6565b611b4c565b600a546105869060ff1681565b60405190151581526020016102fc565b6102d36105a4366004612eb1565b611b5e565b6001546102e8906001600160a01b031681565b6102d36105ca366004612edd565b61210a565b6103646105dd366004612e32565b612115565b6102e87f000000000000000000000000000000000000000000000000000000000000000081565b6102d3610617366004612f26565b6122cd565b6102d361062a366004612e32565b6123c8565b6102d361063d366004612edd565b612414565b6102e87f000000000000000000000000000000000000000000000000000000000000000081565b6003546102e8906001600160a01b031681565b61036460085481565b6102e87f000000000000000000000000000000000000000000000000000000000000000081565b6102d36106ba366004612ef6565b6124a1565b610364600b5481565b604051630d9167c160e21b81526001600160a01b0382811660048301526000917f0000000000000000000000000000000000000000000000000000000000000000909116906336459f0490602401602060405180830381865afa158015610733573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107579190612f43565b90506107638282611324565b5050565b428410156107af5760405162461bcd60e51b815260206004820152601060248201526f111150511312539157d156141254915160821b60448201526064015b60405180910390fd5b600060016107bb610f77565b6001600160a01b0389166000818152600e602090815260409182902080546001810190915582517f1f0bc49e000c018ca72680800f3b2f7ce61e76471cce3756387071d004b0eee98184015233818501526060810194909452608084018c905260a084015260c08084018b90528251808503909101815260e08401909252815191012061190160f01b6101008301526101028201929092526101228101919091526101420160408051601f198184030181528282528051602091820120600084529083018083525260ff871690820152606081018590526080810184905260a0016020604051602081039080840390855afa1580156108be573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116158015906108f45750866001600160a01b0316816001600160a01b0316145b6109315760405162461bcd60e51b815260206004820152600e60248201526d24a72b20a624a22fa9a4a3a722a960911b60448201526064016107a6565b61093c8733886124b4565b50505050505050565b6001600160a01b0382166000908152600d60205260409020546001820161096a578091505b818110156109ba5760405162461bcd60e51b815260206004820152601b60248201527f52657061796d656e742067726561746572207468616e2064656274000000000060448201526064016107a6565b6001600160a01b0383166000908152600d6020526040812080548492906109e2908490612f72565b9250508190555081600b60008282546109fb9190612f72565b9091555050604051631b1a58c960e31b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063d8d2c64890610a4e9086908690600401612f8b565b600060405180830381600087803b158015610a6857600080fd5b505af1158015610a7c573d6000803e3d6000fd5b50506003546001600160a01b0316159150610af290505760035460405163081e664160e01b8152600481018490526001600160a01b039091169063081e664190602401600060405180830381600087803b158015610ad957600080fd5b505af1158015610aed573d6000803e3d6000fd5b505050505b6040516323b872dd60e01b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906323b872dd90610b4290339030908790600401612fa4565b6020604051808303816000875af1158015610b61573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b859190612fc8565b5060405182815233906001600160a01b038516907f05f2eeda0e08e4b437f487c8d7d29b14537d15e3488170dc3de5dbdf8dac46849060200160405180910390a3505050565b6000546001600160a01b03163314610bf55760405162461bcd60e51b81526004016107a690612fe5565b600380546001600160a01b0319166001600160a01b0392909216919091179055565b600080610c2383611a12565b905061271060055482610c36919061301c565b610c409190613033565b9392505050565b610c523333836127e0565b50565b6000546001600160a01b03163314610c7f5760405162461bcd60e51b81526004016107a690612fe5565b600081118015610c9d575061271060085482610c9b9190613055565b105b610ce95760405162461bcd60e51b815260206004820152601d60248201527f496e76616c6964206c69717569646174696f6e20696e63656e7469766500000060448201526064016107a6565b600781905560055415610c52576000600554600854612710610d0b9190613055565b600554610d1a90612710612f72565b610d24919061301c565b610d2e9190613033565b905080600754106107635760405162461bcd60e51b815260206004820152603760248201527f4e6577206c69717569646174696f6e20706172616d20616c6c6f772070726f6660448201527f697461626c652073656c66206c69717569646174696f6e00000000000000000060648201526084016107a6565b42841015610dea5760405162461bcd60e51b815260206004820152601060248201526f111150511312539157d156141254915160821b60448201526064016107a6565b60006001610df6610f77565b6001600160a01b0389166000818152600e602090815260409182902080546001810190915582517f7dbda1635348f4206be1d85078da9f4a74703081e4fa6e174f3fd066c56189658184015233818501526060810194909452608084018c905260a084015260c08084018b90528251808503909101815260e08401909252815191012061190160f01b6101008301526101028201929092526101228101919091526101420160408051601f198184030181528282528051602091820120600084529083018083525260ff871690820152606081018590526080810184905260a0016020604051602081039080840390855afa158015610ef9573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811615801590610f2f5750866001600160a01b0316816001600160a01b0316145b610f6c5760405162461bcd60e51b815260206004820152600e60248201526d24a72b20a624a22fa9a4a3a722a960911b60448201526064016107a6565b61093c8733886127e0565b60007f0000000000000000000000000000000000000000000000000000000000000000461461105e5750604080518082018252600a8152691110948813505492d15560b21b60209182015281517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f818301527f4fdd2304dc9d5c5a62691d8e7e6cf5fe56e23281f4652fb6b06b133c9c2b03b4818401527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a0808301919091528351808303909101815260c0909101909252815191012090565b507f000000000000000000000000000000000000000000000000000000000000000090565b6000546001600160a01b031633146110ad5760405162461bcd60e51b81526004016107a690612fe5565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b60006110da836129d6565b6040516323b872dd60e01b81529091506001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906323b872dd9061112d90339085908790600401612fa4565b6020604051808303816000875af115801561114c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111709190612fc8565b507f0000000000000000000000000000000000000000000000000000000000000000156111eb57806001600160a01b03166312c93f596040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156111d257600080fd5b505af11580156111e6573d6000803e3d6000fd5b505050505b826001600160a01b03167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c8360405161122691815260200190565b60405180910390a2505050565b6000546001600160a01b0316331461125d5760405162461bcd60e51b81526004016107a690612fe5565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b604051733d602d80600a3d3981f3363d3d373d3d3d363d7360601b81527f0000000000000000000000000000000000000000000000000000000000000000606090811b60148301526f5af43d82803e903d91602b57fd5bf3ff60801b602883015230901b6038820152604c8101919091526037808220606c830152605591012090565b336000908152600e6020526040812080549161131d83613068565b9190505550565b604051630d9167c160e21b81526001600160a01b0383811660048301526000917f0000000000000000000000000000000000000000000000000000000000000000909116906336459f0490602401602060405180830381865afa15801561138f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113b39190612f43565b9050600081116113f65760405162461bcd60e51b815260206004820152600e60248201526d139bc8111094881919599a58da5d60921b60448201526064016107a6565b818110156114395760405162461bcd60e51b815260206004820152601060248201526f105b5bdd5b9d080f881919599a58da5d60821b60448201526064016107a6565b60006127107f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663a10f84cb6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561149c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114c09190612f43565b6114ca908561301c565b6114d49190613033565b90506000612710600654836114e9919061301c565b6114f39190613033565b6001600160a01b0386166000908152600d6020526040812080549293508492909190611520908490613055565b90915550506008546007546000916127109161153c9083612f72565b6115469190612f72565b61154f88612adc565b611559919061301c565b6115639190613033565b6001600160a01b0387166000908152600d60205260409020549091508110156115ce5760405162461bcd60e51b815260206004820152601960248201527f457863656564656420636f6c6c61746572616c2076616c75650000000000000060448201526064016107a6565b82600b60008282546115e09190613055565b909155505060405163b2c0877560e01b81526001600160a01b03878116600483015233602483015260448201879052606482018490527f0000000000000000000000000000000000000000000000000000000000000000169063b2c0877590608401600060405180830381600087803b15801561165c57600080fd5b505af1158015611670573d6000803e3d6000fd5b505060405163a9059cbb60e01b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016925063a9059cbb91506116c29033908690600401612f8b565b6020604051808303816000875af11580156116e1573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061093c9190612fc8565b6000546001600160a01b0316331461172f5760405162461bcd60e51b81526004016107a690612fe5565b600081118015611740575061271081105b61178c5760405162461bcd60e51b815260206004820152601f60248201527f496e76616c6964207265706c656e6973686d656e7420696e63656e746976650060448201526064016107a6565b600655565b6000546001600160a01b031633146117bb5760405162461bcd60e51b81526004016107a690612fe5565b612710811061180c5760405162461bcd60e51b815260206004820152601960248201527f496e76616c696420636f6c6c61746572616c20666163746f720000000000000060448201526064016107a6565b60058190558015610c52576000600554600854612710610d0b9190613055565b6000546001600160a01b031633146118565760405162461bcd60e51b81526004016107a690612fe5565b600480546001600160a01b0319166001600160a01b0392909216919091179055565b6001546001600160a01b031633146118cb5760405162461bcd60e51b815260206004820152601660248201527513db9b1e481b195b99195c8818d85b881c9958d85b1b60521b60448201526064016107a6565b60405163a9059cbb60e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063a9059cbb906119199033908590600401612f8b565b6020604051808303816000875af1158015611938573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107639190612fc8565b6000546001600160a01b031633146119865760405162461bcd60e51b81526004016107a690612fe5565b6000811180156119a45750612710600754826119a29190613055565b105b6119f05760405162461bcd60e51b815260206004820152601760248201527f496e76616c6964206c69717569646174696f6e2066656500000000000000000060448201526064016107a6565b600881905560055415610c52576000600554600854612710610d0b9190613055565b600080611a1e8361127f565b90506000816001600160a01b031663b69ef8a86040518163ffffffff1660e01b8152600401602060405180830381865afa158015611a60573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a849190612f43565b6004805460055460405163949c4fa360e01b8152939450670de0b6b3a7640000936001600160a01b039092169263949c4fa392611ae5927f000000000000000000000000000000000000000000000000000000000000000092909101612f8b565b602060405180830381865afa158015611b02573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b269190612f43565b611b30908361301c565b611b3a9190613033565b949350505050565b610c5233826110cf565b611b5582611b42565b6107638161210a565b60008111611bae5760405162461bcd60e51b815260206004820152601860248201527f4d75737420726570617920706f7369746976652064656274000000000000000060448201526064016107a6565b6001600160a01b0382166000908152600d602052604090205480611bd184612bce565b10611c155760405162461bcd60e51b8152602060048201526014602482015273557365722064656274206973206865616c74687960601b60448201526064016107a6565b61271060095482611c26919061301c565b611c309190613033565b821115611c7f5760405162461bcd60e51b815260206004820152601b60248201527f4578636565646564206c69717569646174696f6e20666163746f72000000000060448201526064016107a6565b6004805460055460405163449e815d60e01b81526000936001600160a01b039093169263449e815d92611cd4927f00000000000000000000000000000000000000000000000000000000000000009201612f8b565b6020604051808303816000875af1158015611cf3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d179190612f43565b9050600081611d2e85670de0b6b3a764000061301c565b611d389190613033565b905061271060075482611d4b919061301c565b611d559190613033565b611d5f9082613055565b6001600160a01b0386166000908152600d6020526040812080549293508692909190611d8c908490612f72565b9250508190555083600b6000828254611da59190612f72565b9091555050604051631b1a58c960e31b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063d8d2c64890611df89088908890600401612f8b565b600060405180830381600087803b158015611e1257600080fd5b505af1158015611e26573d6000803e3d6000fd5b50506040516323b872dd60e01b81526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001692506323b872dd9150611e7a90339030908990600401612fa4565b6020604051808303816000875af1158015611e99573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ebd9190612fc8565b506000611ec98661127f565b604051636203b43b60e11b81529091506001600160a01b0382169063c407687690611efa9033908690600401612f8b565b600060405180830381600087803b158015611f1457600080fd5b505af1158015611f28573d6000803e3d6000fd5b50505050600060085411156120bc5760006127106008548588670de0b6b3a7640000611f54919061301c565b611f5e9190613033565b611f68919061301c565b611f729190613033565b90506000826001600160a01b031663b69ef8a86040518163ffffffff1660e01b8152600401602060405180830381865afa158015611fb4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fd89190612f43565b905081811061204c57600054604051636203b43b60e11b81526001600160a01b038581169263c40768769261201592909116908690600401612f8b565b600060405180830381600087803b15801561202f57600080fd5b505af1158015612043573d6000803e3d6000fd5b505050506120b9565b80156120b957600054604051636203b43b60e11b81526001600160a01b038581169263c40768769261208692909116908590600401612f8b565b600060405180830381600087803b1580156120a057600080fd5b505af11580156120b4573d6000803e3d6000fd5b505050505b50505b604080518681526020810184905233916001600160a01b038916917ff3fa0eaee8f258c23b013654df25d1527f98a5c7ccd5e951dd77caca400ef972910160405180910390a3505050505050565b610c523333836124b4565b6000806121218361127f565b90506000816001600160a01b031663b69ef8a86040518163ffffffff1660e01b8152600401602060405180830381865afa158015612163573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121879190612f43565b90508060000361219b575060009392505050565b6001600160a01b0384166000908152600d6020526040812054908190036121c457509392505050565b6005546000036121d957506000949350505050565b6005546004805460405163949c4fa360e01b8152600093926001600160a01b039092169163949c4fa391612231917f000000000000000000000000000000000000000000000000000000000000000091869101612f8b565b602060405180830381865afa15801561224e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122729190612f43565b61228484670de0b6b3a764000061301c565b61228e9190613033565b61229a9061271061301c565b6122a49190613033565b90508083116122b95750600095945050505050565b6122c38184612f72565b9695505050505050565b801561235b576002546001600160a01b03163314806122f657506000546001600160a01b031633145b6123565760405162461bcd60e51b815260206004820152602b60248201527f4f6e6c7920706175736520677561726469616e206f7220676f7665726e616e6360448201526a652063616e20706175736560a81b60648201526084016107a6565b6123b5565b6000546001600160a01b031633146123b55760405162461bcd60e51b815260206004820152601b60248201527f4f6e6c7920676f7665726e616e63652063616e20756e7061757365000000000060448201526064016107a6565b600a805460ff1916911515919091179055565b6000546001600160a01b031633146123f25760405162461bcd60e51b81526004016107a690612fe5565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b0316331461243e5760405162461bcd60e51b81526004016107a690612fe5565b60008111801561245057506127108111155b61249c5760405162461bcd60e51b815260206004820152601a60248201527f496e76616c6964206c69717569646174696f6e20666163746f7200000000000060448201526064016107a6565b600955565b6124ab3383610945565b61076381610c47565b600a5460ff16156124fd5760405162461bcd60e51b8152602060048201526013602482015272109bdc9c9bddda5b99c81a5cc81c185d5cd959606a1b60448201526064016107a6565b6003546001600160a01b0316156125d15760035460405163368f515360e21b81526001600160a01b039091169063da3d454c9061254290339087908690600401612fa4565b6020604051808303816000875af1158015612561573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125859190612fc8565b6125d15760405162461bcd60e51b815260206004820152601b60248201527f44656e69656420627920626f72726f7720636f6e74726f6c6c6572000000000060448201526064016107a6565b60006125dc84612bce565b6001600160a01b0385166000908152600d6020526040812080549293508492909190612609908490613055565b90915550506001600160a01b0384166000908152600d602052604090205481101561266e5760405162461bcd60e51b8152602060048201526015602482015274115e18d9595919590818dc99591a5d081b1a5b5a5d605a1b60448201526064016107a6565b81600b60008282546126809190613055565b909155505060405163f7f11fb760e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063f7f11fb7906126d39087908690600401612f8b565b600060405180830381600087803b1580156126ed57600080fd5b505af1158015612701573d6000803e3d6000fd5b505060405163a9059cbb60e01b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016925063a9059cbb91506127539086908690600401612f8b565b6020604051808303816000875af1158015612772573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127969190612fc8565b50836001600160a01b03167fcbc04eca7e9da35cb1393a6135a199ca52e450d5e9251cbd99f7847d33a36750836040516127d291815260200190565b60405180910390a250505050565b60006127eb84612bda565b90508181101561283d5760405162461bcd60e51b815260206004820152601d60248201527f496e73756666696369656e74207769746864726177616c206c696d697400000060448201526064016107a6565b604051630d9167c160e21b81526001600160a01b0385811660048301527f000000000000000000000000000000000000000000000000000000000000000016906336459f0490602401602060405180830381865afa1580156128a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128c79190612f43565b156129145760405162461bcd60e51b815260206004820152601f60248201527f43616e277420776974686472617720776974682044425220646566696369740060448201526064016107a6565b600061291f856129d6565b604051636203b43b60e11b81529091506001600160a01b0382169063c4076876906129509087908790600401612f8b565b600060405180830381600087803b15801561296a57600080fd5b505af115801561297e573d6000803e3d6000fd5b50505050836001600160a01b0316856001600160a01b03167f9b1bfa7fa9ee420a16e124f794c35ac9f90472acc99140eb2f6447c714cad8eb856040516129c791815260200190565b60405180910390a35050505050565b6001600160a01b038181166000908152600c602052604081205490911615612a1757506001600160a01b039081166000908152600c60205260409020541690565b6000612a2283612d15565b60405163485cc95560e01b81526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116600483015285811660248301529192509082169063485cc95590604401600060405180830381600087803b158015612a9157600080fd5b505af1158015612aa5573d6000803e3d6000fd5b505050506001600160a01b039283166000908152600c6020526040902080546001600160a01b031916938216939093179092555090565b600080612ae88361127f565b90506000816001600160a01b031663b69ef8a86040518163ffffffff1660e01b8152600401602060405180830381865afa158015612b2a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b4e9190612f43565b6004805460055460405163449e815d60e01b8152939450670de0b6b3a7640000936001600160a01b039092169263449e815d92612baf927f000000000000000000000000000000000000000000000000000000000000000092909101612f8b565b6020604051808303816000875af1158015611b02573d6000803e3d6000fd5b600080610c2383612adc565b600080612be68361127f565b90506000816001600160a01b031663b69ef8a86040518163ffffffff1660e01b8152600401602060405180830381865afa158015612c28573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c4c9190612f43565b905080600003612c60575060009392505050565b6001600160a01b0384166000908152600d602052604081205490819003612c8957509392505050565b600554600003612c9e57506000949350505050565b6005546004805460405163449e815d60e01b8152600093926001600160a01b039092169163449e815d91612cf6917f000000000000000000000000000000000000000000000000000000000000000091869101612f8b565b6020604051808303816000875af115801561224e573d6000803e3d6000fd5b604051733d602d80600a3d3981f3363d3d373d3d3d363d7360601b81527f0000000000000000000000000000000000000000000000000000000000000000606081901b60148301526e5af43d82803e903d91602b57fd5bf360881b60288301526000918360378285f59250506001600160a01b038216612dd75760405162461bcd60e51b815260206004820152601760248201527f455243313136373a2063726561746532206661696c656400000000000000000060448201526064016107a6565b6040516001600160a01b0383811682528416907f1cfd6e6fe6d92716198ef80381fd40e4338b9a461cc4fc235c51b152f7f830159060200160405180910390a250919050565b6001600160a01b0381168114610c5257600080fd5b600060208284031215612e4457600080fd5b8135610c4081612e1d565b60008060008060008060c08789031215612e6857600080fd5b8635612e7381612e1d565b95506020870135945060408701359350606087013560ff81168114612e9757600080fd5b9598949750929560808101359460a0909101359350915050565b60008060408385031215612ec457600080fd5b8235612ecf81612e1d565b946020939093013593505050565b600060208284031215612eef57600080fd5b5035919050565b60008060408385031215612f0957600080fd5b50508035926020909101359150565b8015158114610c5257600080fd5b600060208284031215612f3857600080fd5b8135610c4081612f18565b600060208284031215612f5557600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b81810381811115612f8557612f85612f5c565b92915050565b6001600160a01b03929092168252602082015260400190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b600060208284031215612fda57600080fd5b8151610c4081612f18565b6020808252601f908201527f4f6e6c7920676f762063616e2063616c6c20746869732066756e6374696f6e00604082015260600190565b8082028115828204841417612f8557612f85612f5c565b60008261305057634e487b7160e01b600052601260045260246000fd5b500490565b80820180821115612f8557612f85612f5c565b60006001820161307a5761307a612f5c565b506001019056fea264697066735822122074819157a6661430f7eaf8441460b523d91a86e7128e7a53f3709e6e2afcc12c64736f6c63430008150033000000000000000000000000926df14a23be491164dcf93f4c468a50ef659d5b0000000000000000000000002b34548b865ad66a2b046cb82e59ee43f75b90fd000000000000000000000000e3ed95e130ad9e15643f5a5f232a3dae980784cd000000000000000000000000c06053fcad0a0df7cc32289a135bbea9030c010f000000000000000000000000ad038eb671c44b853887a7e32528fab35dc5d7100000000000000000000000009d39a5de30e57443bff2a8307a4256c8797a3497000000000000000000000000abe146cf570fd27ddd985895ce9b138a7110cce80000000000000000000000000000000000000000000000000000000000001f40000000000000000000000000000000000000000000000000000000000000138800000000000000000000000000000000000000000000000000000000000003e80000000000000000000000000000000000000000000000000000000000000000

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106102bb5760003560e01c80637164695a11610182578063bcead63e116100e9578063d1220a3c116100a2578063e031a8241161007c578063e031a8241461067c578063ea0593e414610685578063ebc9b94d146106ac578063fc7b9c18146106bf57600080fd5b8063d1220a3c1461062f578063d8dfeb4514610642578063e00f0a991461066957600080fd5b8063bcead63e146105a9578063c5ebeaec146105bc578063c74e6d80146105cf578063c7ed69cd146105e2578063c801861914610609578063cfad57a21461061c57600080fd5b80638951b0541161013b5780638951b0541461052d57806397904e4214610540578063b6b55f2514610553578063b75061bb14610566578063bcb4bbea14610579578063bcbaf4871461059657600080fd5b80637164695a146104b85780637adbf973146104cb5780637d32e793146104de5780637dc0d1d0146104f15780637ecebe00146105045780637f5007ed1461052457600080fd5b80633e553756116102265780634ef64ee7116101df5780634ef64ee7146104655780635a57b46f14610478578063651afe83146104805780636f1c4839146104935780636f48fbb61461049c5780636f8dd24c146104af57600080fd5b80633e553756146103d357806346e368d4146103dc578063477230b2146103ef57806347e7ef241461041857806348bde20c1461042b5780634ca8ff5a1461043e57600080fd5b80632c333e25116102785780632c333e25146103515780632e1a7d4d146103725780632ecd4e7d1461038557806334734dd3146103a55780633525f591146103b85780633644e515146103cb57600080fd5b80630e81c403146102c057806312d43a51146102d55780631ef08b751461030557806322867d7814610318578063236331e91461032b57806324a3d6221461033e575b600080fd5b6102d36102ce366004612e32565b6106c8565b005b6000546102e8906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b6102d3610313366004612e4f565b610767565b6102d3610326366004612eb1565b610945565b6102d3610339366004612e32565b610bcb565b6002546102e8906001600160a01b031681565b61036461035f366004612e32565b610c17565b6040519081526020016102fc565b6102d3610380366004612edd565b610c47565b610364610393366004612e32565b600d6020526000908152604090205481565b6102d36103b3366004612edd565b610c55565b6102d36103c6366004612e4f565b610da7565b610364610f77565b61036460065481565b6102d36103ea366004612e32565b611083565b6102e86103fd366004612e32565b600c602052600090815260409020546001600160a01b031681565b6102d3610426366004612eb1565b6110cf565b6102d3610439366004612e32565b611233565b6102e87f000000000000000000000000c06053fcad0a0df7cc32289a135bbea9030c010f81565b6102e8610473366004612e32565b61127f565b6102d3611302565b6102d361048e366004612eb1565b611324565b61036460095481565b6102d36104aa366004612edd565b611705565b61036460075481565b6102d36104c6366004612edd565b611791565b6102d36104d9366004612e32565b61182c565b6102d36104ec366004612edd565b611878565b6004546102e8906001600160a01b031681565b610364610512366004612e32565b600e6020526000908152604090205481565b61036460055481565b6102d361053b366004612edd565b61195c565b61036461054e366004612e32565b611a12565b6102d3610561366004612edd565b611b42565b6102d3610574366004612ef6565b611b4c565b600a546105869060ff1681565b60405190151581526020016102fc565b6102d36105a4366004612eb1565b611b5e565b6001546102e8906001600160a01b031681565b6102d36105ca366004612edd565b61210a565b6103646105dd366004612e32565b612115565b6102e87f000000000000000000000000ad038eb671c44b853887a7e32528fab35dc5d71081565b6102d3610617366004612f26565b6122cd565b6102d361062a366004612e32565b6123c8565b6102d361063d366004612edd565b612414565b6102e87f0000000000000000000000009d39a5de30e57443bff2a8307a4256c8797a349781565b6003546102e8906001600160a01b031681565b61036460085481565b6102e87f000000000000000000000000865377367054516e17014ccded1e7d814edc9ce481565b6102d36106ba366004612ef6565b6124a1565b610364600b5481565b604051630d9167c160e21b81526001600160a01b0382811660048301526000917f000000000000000000000000ad038eb671c44b853887a7e32528fab35dc5d710909116906336459f0490602401602060405180830381865afa158015610733573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107579190612f43565b90506107638282611324565b5050565b428410156107af5760405162461bcd60e51b815260206004820152601060248201526f111150511312539157d156141254915160821b60448201526064015b60405180910390fd5b600060016107bb610f77565b6001600160a01b0389166000818152600e602090815260409182902080546001810190915582517f1f0bc49e000c018ca72680800f3b2f7ce61e76471cce3756387071d004b0eee98184015233818501526060810194909452608084018c905260a084015260c08084018b90528251808503909101815260e08401909252815191012061190160f01b6101008301526101028201929092526101228101919091526101420160408051601f198184030181528282528051602091820120600084529083018083525260ff871690820152606081018590526080810184905260a0016020604051602081039080840390855afa1580156108be573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116158015906108f45750866001600160a01b0316816001600160a01b0316145b6109315760405162461bcd60e51b815260206004820152600e60248201526d24a72b20a624a22fa9a4a3a722a960911b60448201526064016107a6565b61093c8733886124b4565b50505050505050565b6001600160a01b0382166000908152600d60205260409020546001820161096a578091505b818110156109ba5760405162461bcd60e51b815260206004820152601b60248201527f52657061796d656e742067726561746572207468616e2064656274000000000060448201526064016107a6565b6001600160a01b0383166000908152600d6020526040812080548492906109e2908490612f72565b9250508190555081600b60008282546109fb9190612f72565b9091555050604051631b1a58c960e31b81526001600160a01b037f000000000000000000000000ad038eb671c44b853887a7e32528fab35dc5d710169063d8d2c64890610a4e9086908690600401612f8b565b600060405180830381600087803b158015610a6857600080fd5b505af1158015610a7c573d6000803e3d6000fd5b50506003546001600160a01b0316159150610af290505760035460405163081e664160e01b8152600481018490526001600160a01b039091169063081e664190602401600060405180830381600087803b158015610ad957600080fd5b505af1158015610aed573d6000803e3d6000fd5b505050505b6040516323b872dd60e01b81526001600160a01b037f000000000000000000000000865377367054516e17014ccded1e7d814edc9ce416906323b872dd90610b4290339030908790600401612fa4565b6020604051808303816000875af1158015610b61573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b859190612fc8565b5060405182815233906001600160a01b038516907f05f2eeda0e08e4b437f487c8d7d29b14537d15e3488170dc3de5dbdf8dac46849060200160405180910390a3505050565b6000546001600160a01b03163314610bf55760405162461bcd60e51b81526004016107a690612fe5565b600380546001600160a01b0319166001600160a01b0392909216919091179055565b600080610c2383611a12565b905061271060055482610c36919061301c565b610c409190613033565b9392505050565b610c523333836127e0565b50565b6000546001600160a01b03163314610c7f5760405162461bcd60e51b81526004016107a690612fe5565b600081118015610c9d575061271060085482610c9b9190613055565b105b610ce95760405162461bcd60e51b815260206004820152601d60248201527f496e76616c6964206c69717569646174696f6e20696e63656e7469766500000060448201526064016107a6565b600781905560055415610c52576000600554600854612710610d0b9190613055565b600554610d1a90612710612f72565b610d24919061301c565b610d2e9190613033565b905080600754106107635760405162461bcd60e51b815260206004820152603760248201527f4e6577206c69717569646174696f6e20706172616d20616c6c6f772070726f6660448201527f697461626c652073656c66206c69717569646174696f6e00000000000000000060648201526084016107a6565b42841015610dea5760405162461bcd60e51b815260206004820152601060248201526f111150511312539157d156141254915160821b60448201526064016107a6565b60006001610df6610f77565b6001600160a01b0389166000818152600e602090815260409182902080546001810190915582517f7dbda1635348f4206be1d85078da9f4a74703081e4fa6e174f3fd066c56189658184015233818501526060810194909452608084018c905260a084015260c08084018b90528251808503909101815260e08401909252815191012061190160f01b6101008301526101028201929092526101228101919091526101420160408051601f198184030181528282528051602091820120600084529083018083525260ff871690820152606081018590526080810184905260a0016020604051602081039080840390855afa158015610ef9573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811615801590610f2f5750866001600160a01b0316816001600160a01b0316145b610f6c5760405162461bcd60e51b815260206004820152600e60248201526d24a72b20a624a22fa9a4a3a722a960911b60448201526064016107a6565b61093c8733886127e0565b60007f0000000000000000000000000000000000000000000000000000000000000001461461105e5750604080518082018252600a8152691110948813505492d15560b21b60209182015281517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f818301527f4fdd2304dc9d5c5a62691d8e7e6cf5fe56e23281f4652fb6b06b133c9c2b03b4818401527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a0808301919091528351808303909101815260c0909101909252815191012090565b507f7e22f111d860cb2f040be7beb286a2416474a11c51faed26a030a66357ff5b1690565b6000546001600160a01b031633146110ad5760405162461bcd60e51b81526004016107a690612fe5565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b60006110da836129d6565b6040516323b872dd60e01b81529091506001600160a01b037f0000000000000000000000009d39a5de30e57443bff2a8307a4256c8797a349716906323b872dd9061112d90339085908790600401612fa4565b6020604051808303816000875af115801561114c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111709190612fc8565b507f0000000000000000000000000000000000000000000000000000000000000000156111eb57806001600160a01b03166312c93f596040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156111d257600080fd5b505af11580156111e6573d6000803e3d6000fd5b505050505b826001600160a01b03167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c8360405161122691815260200190565b60405180910390a2505050565b6000546001600160a01b0316331461125d5760405162461bcd60e51b81526004016107a690612fe5565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b604051733d602d80600a3d3981f3363d3d373d3d3d363d7360601b81527f000000000000000000000000c06053fcad0a0df7cc32289a135bbea9030c010f606090811b60148301526f5af43d82803e903d91602b57fd5bf3ff60801b602883015230901b6038820152604c8101919091526037808220606c830152605591012090565b336000908152600e6020526040812080549161131d83613068565b9190505550565b604051630d9167c160e21b81526001600160a01b0383811660048301526000917f000000000000000000000000ad038eb671c44b853887a7e32528fab35dc5d710909116906336459f0490602401602060405180830381865afa15801561138f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113b39190612f43565b9050600081116113f65760405162461bcd60e51b815260206004820152600e60248201526d139bc8111094881919599a58da5d60921b60448201526064016107a6565b818110156114395760405162461bcd60e51b815260206004820152601060248201526f105b5bdd5b9d080f881919599a58da5d60821b60448201526064016107a6565b60006127107f000000000000000000000000ad038eb671c44b853887a7e32528fab35dc5d7106001600160a01b031663a10f84cb6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561149c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114c09190612f43565b6114ca908561301c565b6114d49190613033565b90506000612710600654836114e9919061301c565b6114f39190613033565b6001600160a01b0386166000908152600d6020526040812080549293508492909190611520908490613055565b90915550506008546007546000916127109161153c9083612f72565b6115469190612f72565b61154f88612adc565b611559919061301c565b6115639190613033565b6001600160a01b0387166000908152600d60205260409020549091508110156115ce5760405162461bcd60e51b815260206004820152601960248201527f457863656564656420636f6c6c61746572616c2076616c75650000000000000060448201526064016107a6565b82600b60008282546115e09190613055565b909155505060405163b2c0877560e01b81526001600160a01b03878116600483015233602483015260448201879052606482018490527f000000000000000000000000ad038eb671c44b853887a7e32528fab35dc5d710169063b2c0877590608401600060405180830381600087803b15801561165c57600080fd5b505af1158015611670573d6000803e3d6000fd5b505060405163a9059cbb60e01b81526001600160a01b037f000000000000000000000000865377367054516e17014ccded1e7d814edc9ce416925063a9059cbb91506116c29033908690600401612f8b565b6020604051808303816000875af11580156116e1573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061093c9190612fc8565b6000546001600160a01b0316331461172f5760405162461bcd60e51b81526004016107a690612fe5565b600081118015611740575061271081105b61178c5760405162461bcd60e51b815260206004820152601f60248201527f496e76616c6964207265706c656e6973686d656e7420696e63656e746976650060448201526064016107a6565b600655565b6000546001600160a01b031633146117bb5760405162461bcd60e51b81526004016107a690612fe5565b612710811061180c5760405162461bcd60e51b815260206004820152601960248201527f496e76616c696420636f6c6c61746572616c20666163746f720000000000000060448201526064016107a6565b60058190558015610c52576000600554600854612710610d0b9190613055565b6000546001600160a01b031633146118565760405162461bcd60e51b81526004016107a690612fe5565b600480546001600160a01b0319166001600160a01b0392909216919091179055565b6001546001600160a01b031633146118cb5760405162461bcd60e51b815260206004820152601660248201527513db9b1e481b195b99195c8818d85b881c9958d85b1b60521b60448201526064016107a6565b60405163a9059cbb60e01b81526001600160a01b037f000000000000000000000000865377367054516e17014ccded1e7d814edc9ce4169063a9059cbb906119199033908590600401612f8b565b6020604051808303816000875af1158015611938573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107639190612fc8565b6000546001600160a01b031633146119865760405162461bcd60e51b81526004016107a690612fe5565b6000811180156119a45750612710600754826119a29190613055565b105b6119f05760405162461bcd60e51b815260206004820152601760248201527f496e76616c6964206c69717569646174696f6e2066656500000000000000000060448201526064016107a6565b600881905560055415610c52576000600554600854612710610d0b9190613055565b600080611a1e8361127f565b90506000816001600160a01b031663b69ef8a86040518163ffffffff1660e01b8152600401602060405180830381865afa158015611a60573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a849190612f43565b6004805460055460405163949c4fa360e01b8152939450670de0b6b3a7640000936001600160a01b039092169263949c4fa392611ae5927f0000000000000000000000009d39a5de30e57443bff2a8307a4256c8797a349792909101612f8b565b602060405180830381865afa158015611b02573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b269190612f43565b611b30908361301c565b611b3a9190613033565b949350505050565b610c5233826110cf565b611b5582611b42565b6107638161210a565b60008111611bae5760405162461bcd60e51b815260206004820152601860248201527f4d75737420726570617920706f7369746976652064656274000000000000000060448201526064016107a6565b6001600160a01b0382166000908152600d602052604090205480611bd184612bce565b10611c155760405162461bcd60e51b8152602060048201526014602482015273557365722064656274206973206865616c74687960601b60448201526064016107a6565b61271060095482611c26919061301c565b611c309190613033565b821115611c7f5760405162461bcd60e51b815260206004820152601b60248201527f4578636565646564206c69717569646174696f6e20666163746f72000000000060448201526064016107a6565b6004805460055460405163449e815d60e01b81526000936001600160a01b039093169263449e815d92611cd4927f0000000000000000000000009d39a5de30e57443bff2a8307a4256c8797a34979201612f8b565b6020604051808303816000875af1158015611cf3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d179190612f43565b9050600081611d2e85670de0b6b3a764000061301c565b611d389190613033565b905061271060075482611d4b919061301c565b611d559190613033565b611d5f9082613055565b6001600160a01b0386166000908152600d6020526040812080549293508692909190611d8c908490612f72565b9250508190555083600b6000828254611da59190612f72565b9091555050604051631b1a58c960e31b81526001600160a01b037f000000000000000000000000ad038eb671c44b853887a7e32528fab35dc5d710169063d8d2c64890611df89088908890600401612f8b565b600060405180830381600087803b158015611e1257600080fd5b505af1158015611e26573d6000803e3d6000fd5b50506040516323b872dd60e01b81526001600160a01b037f000000000000000000000000865377367054516e17014ccded1e7d814edc9ce41692506323b872dd9150611e7a90339030908990600401612fa4565b6020604051808303816000875af1158015611e99573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ebd9190612fc8565b506000611ec98661127f565b604051636203b43b60e11b81529091506001600160a01b0382169063c407687690611efa9033908690600401612f8b565b600060405180830381600087803b158015611f1457600080fd5b505af1158015611f28573d6000803e3d6000fd5b50505050600060085411156120bc5760006127106008548588670de0b6b3a7640000611f54919061301c565b611f5e9190613033565b611f68919061301c565b611f729190613033565b90506000826001600160a01b031663b69ef8a86040518163ffffffff1660e01b8152600401602060405180830381865afa158015611fb4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fd89190612f43565b905081811061204c57600054604051636203b43b60e11b81526001600160a01b038581169263c40768769261201592909116908690600401612f8b565b600060405180830381600087803b15801561202f57600080fd5b505af1158015612043573d6000803e3d6000fd5b505050506120b9565b80156120b957600054604051636203b43b60e11b81526001600160a01b038581169263c40768769261208692909116908590600401612f8b565b600060405180830381600087803b1580156120a057600080fd5b505af11580156120b4573d6000803e3d6000fd5b505050505b50505b604080518681526020810184905233916001600160a01b038916917ff3fa0eaee8f258c23b013654df25d1527f98a5c7ccd5e951dd77caca400ef972910160405180910390a3505050505050565b610c523333836124b4565b6000806121218361127f565b90506000816001600160a01b031663b69ef8a86040518163ffffffff1660e01b8152600401602060405180830381865afa158015612163573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121879190612f43565b90508060000361219b575060009392505050565b6001600160a01b0384166000908152600d6020526040812054908190036121c457509392505050565b6005546000036121d957506000949350505050565b6005546004805460405163949c4fa360e01b8152600093926001600160a01b039092169163949c4fa391612231917f0000000000000000000000009d39a5de30e57443bff2a8307a4256c8797a349791869101612f8b565b602060405180830381865afa15801561224e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122729190612f43565b61228484670de0b6b3a764000061301c565b61228e9190613033565b61229a9061271061301c565b6122a49190613033565b90508083116122b95750600095945050505050565b6122c38184612f72565b9695505050505050565b801561235b576002546001600160a01b03163314806122f657506000546001600160a01b031633145b6123565760405162461bcd60e51b815260206004820152602b60248201527f4f6e6c7920706175736520677561726469616e206f7220676f7665726e616e6360448201526a652063616e20706175736560a81b60648201526084016107a6565b6123b5565b6000546001600160a01b031633146123b55760405162461bcd60e51b815260206004820152601b60248201527f4f6e6c7920676f7665726e616e63652063616e20756e7061757365000000000060448201526064016107a6565b600a805460ff1916911515919091179055565b6000546001600160a01b031633146123f25760405162461bcd60e51b81526004016107a690612fe5565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b0316331461243e5760405162461bcd60e51b81526004016107a690612fe5565b60008111801561245057506127108111155b61249c5760405162461bcd60e51b815260206004820152601a60248201527f496e76616c6964206c69717569646174696f6e20666163746f7200000000000060448201526064016107a6565b600955565b6124ab3383610945565b61076381610c47565b600a5460ff16156124fd5760405162461bcd60e51b8152602060048201526013602482015272109bdc9c9bddda5b99c81a5cc81c185d5cd959606a1b60448201526064016107a6565b6003546001600160a01b0316156125d15760035460405163368f515360e21b81526001600160a01b039091169063da3d454c9061254290339087908690600401612fa4565b6020604051808303816000875af1158015612561573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125859190612fc8565b6125d15760405162461bcd60e51b815260206004820152601b60248201527f44656e69656420627920626f72726f7720636f6e74726f6c6c6572000000000060448201526064016107a6565b60006125dc84612bce565b6001600160a01b0385166000908152600d6020526040812080549293508492909190612609908490613055565b90915550506001600160a01b0384166000908152600d602052604090205481101561266e5760405162461bcd60e51b8152602060048201526015602482015274115e18d9595919590818dc99591a5d081b1a5b5a5d605a1b60448201526064016107a6565b81600b60008282546126809190613055565b909155505060405163f7f11fb760e01b81526001600160a01b037f000000000000000000000000ad038eb671c44b853887a7e32528fab35dc5d710169063f7f11fb7906126d39087908690600401612f8b565b600060405180830381600087803b1580156126ed57600080fd5b505af1158015612701573d6000803e3d6000fd5b505060405163a9059cbb60e01b81526001600160a01b037f000000000000000000000000865377367054516e17014ccded1e7d814edc9ce416925063a9059cbb91506127539086908690600401612f8b565b6020604051808303816000875af1158015612772573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127969190612fc8565b50836001600160a01b03167fcbc04eca7e9da35cb1393a6135a199ca52e450d5e9251cbd99f7847d33a36750836040516127d291815260200190565b60405180910390a250505050565b60006127eb84612bda565b90508181101561283d5760405162461bcd60e51b815260206004820152601d60248201527f496e73756666696369656e74207769746864726177616c206c696d697400000060448201526064016107a6565b604051630d9167c160e21b81526001600160a01b0385811660048301527f000000000000000000000000ad038eb671c44b853887a7e32528fab35dc5d71016906336459f0490602401602060405180830381865afa1580156128a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128c79190612f43565b156129145760405162461bcd60e51b815260206004820152601f60248201527f43616e277420776974686472617720776974682044425220646566696369740060448201526064016107a6565b600061291f856129d6565b604051636203b43b60e11b81529091506001600160a01b0382169063c4076876906129509087908790600401612f8b565b600060405180830381600087803b15801561296a57600080fd5b505af115801561297e573d6000803e3d6000fd5b50505050836001600160a01b0316856001600160a01b03167f9b1bfa7fa9ee420a16e124f794c35ac9f90472acc99140eb2f6447c714cad8eb856040516129c791815260200190565b60405180910390a35050505050565b6001600160a01b038181166000908152600c602052604081205490911615612a1757506001600160a01b039081166000908152600c60205260409020541690565b6000612a2283612d15565b60405163485cc95560e01b81526001600160a01b037f0000000000000000000000009d39a5de30e57443bff2a8307a4256c8797a34978116600483015285811660248301529192509082169063485cc95590604401600060405180830381600087803b158015612a9157600080fd5b505af1158015612aa5573d6000803e3d6000fd5b505050506001600160a01b039283166000908152600c6020526040902080546001600160a01b031916938216939093179092555090565b600080612ae88361127f565b90506000816001600160a01b031663b69ef8a86040518163ffffffff1660e01b8152600401602060405180830381865afa158015612b2a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b4e9190612f43565b6004805460055460405163449e815d60e01b8152939450670de0b6b3a7640000936001600160a01b039092169263449e815d92612baf927f0000000000000000000000009d39a5de30e57443bff2a8307a4256c8797a349792909101612f8b565b6020604051808303816000875af1158015611b02573d6000803e3d6000fd5b600080610c2383612adc565b600080612be68361127f565b90506000816001600160a01b031663b69ef8a86040518163ffffffff1660e01b8152600401602060405180830381865afa158015612c28573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c4c9190612f43565b905080600003612c60575060009392505050565b6001600160a01b0384166000908152600d602052604081205490819003612c8957509392505050565b600554600003612c9e57506000949350505050565b6005546004805460405163449e815d60e01b8152600093926001600160a01b039092169163449e815d91612cf6917f0000000000000000000000009d39a5de30e57443bff2a8307a4256c8797a349791869101612f8b565b6020604051808303816000875af115801561224e573d6000803e3d6000fd5b604051733d602d80600a3d3981f3363d3d373d3d3d363d7360601b81527f000000000000000000000000c06053fcad0a0df7cc32289a135bbea9030c010f606081901b60148301526e5af43d82803e903d91602b57fd5bf360881b60288301526000918360378285f59250506001600160a01b038216612dd75760405162461bcd60e51b815260206004820152601760248201527f455243313136373a2063726561746532206661696c656400000000000000000060448201526064016107a6565b6040516001600160a01b0383811682528416907f1cfd6e6fe6d92716198ef80381fd40e4338b9a461cc4fc235c51b152f7f830159060200160405180910390a250919050565b6001600160a01b0381168114610c5257600080fd5b600060208284031215612e4457600080fd5b8135610c4081612e1d565b60008060008060008060c08789031215612e6857600080fd5b8635612e7381612e1d565b95506020870135945060408701359350606087013560ff81168114612e9757600080fd5b9598949750929560808101359460a0909101359350915050565b60008060408385031215612ec457600080fd5b8235612ecf81612e1d565b946020939093013593505050565b600060208284031215612eef57600080fd5b5035919050565b60008060408385031215612f0957600080fd5b50508035926020909101359150565b8015158114610c5257600080fd5b600060208284031215612f3857600080fd5b8135610c4081612f18565b600060208284031215612f5557600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b81810381811115612f8557612f85612f5c565b92915050565b6001600160a01b03929092168252602082015260400190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b600060208284031215612fda57600080fd5b8151610c4081612f18565b6020808252601f908201527f4f6e6c7920676f762063616e2063616c6c20746869732066756e6374696f6e00604082015260600190565b8082028115828204841417612f8557612f85612f5c565b60008261305057634e487b7160e01b600052601260045260246000fd5b500490565b80820180821115612f8557612f85612f5c565b60006001820161307a5761307a612f5c565b506001019056fea264697066735822122074819157a6661430f7eaf8441460b523d91a86e7128e7a53f3709e6e2afcc12c64736f6c63430008150033

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

000000000000000000000000926df14a23be491164dcf93f4c468a50ef659d5b0000000000000000000000002b34548b865ad66a2b046cb82e59ee43f75b90fd000000000000000000000000e3ed95e130ad9e15643f5a5f232a3dae980784cd000000000000000000000000c06053fcad0a0df7cc32289a135bbea9030c010f000000000000000000000000ad038eb671c44b853887a7e32528fab35dc5d7100000000000000000000000009d39a5de30e57443bff2a8307a4256c8797a3497000000000000000000000000abe146cf570fd27ddd985895ce9b138a7110cce80000000000000000000000000000000000000000000000000000000000001f40000000000000000000000000000000000000000000000000000000000000138800000000000000000000000000000000000000000000000000000000000003e80000000000000000000000000000000000000000000000000000000000000000

-----Decoded View---------------
Arg [0] : _gov (address): 0x926dF14a23BE491164dCF93f4c468A50ef659D5B
Arg [1] : _lender (address): 0x2b34548b865ad66A2B046cb82e59eE43F75B90fd
Arg [2] : _pauseGuardian (address): 0xE3eD95e130ad9E15643f5A5f232a3daE980784cd
Arg [3] : _escrowImplementation (address): 0xc06053FcAd0A0Df7cC32289A135bBEA9030C010f
Arg [4] : _dbr (address): 0xAD038Eb671c44b853887A7E32528FaB35dC5D710
Arg [5] : _collateral (address): 0x9D39A5DE30e57443BfF2A8307A4256c8797A3497
Arg [6] : _oracle (address): 0xaBe146CF570FD27ddD985895ce9B138a7110cce8
Arg [7] : _collateralFactorBps (uint256): 8000
Arg [8] : _replenishmentIncentiveBps (uint256): 5000
Arg [9] : _liquidationIncentiveBps (uint256): 1000
Arg [10] : _callOnDepositCallback (bool): False

-----Encoded View---------------
11 Constructor Arguments found :
Arg [0] : 000000000000000000000000926df14a23be491164dcf93f4c468a50ef659d5b
Arg [1] : 0000000000000000000000002b34548b865ad66a2b046cb82e59ee43f75b90fd
Arg [2] : 000000000000000000000000e3ed95e130ad9e15643f5a5f232a3dae980784cd
Arg [3] : 000000000000000000000000c06053fcad0a0df7cc32289a135bbea9030c010f
Arg [4] : 000000000000000000000000ad038eb671c44b853887a7e32528fab35dc5d710
Arg [5] : 0000000000000000000000009d39a5de30e57443bff2a8307a4256c8797a3497
Arg [6] : 000000000000000000000000abe146cf570fd27ddd985895ce9b138a7110cce8
Arg [7] : 0000000000000000000000000000000000000000000000000000000000001f40
Arg [8] : 0000000000000000000000000000000000000000000000000000000000001388
Arg [9] : 00000000000000000000000000000000000000000000000000000000000003e8
Arg [10] : 0000000000000000000000000000000000000000000000000000000000000000


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

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

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