ETH Price: $2,050.24 (-1.22%)
Gas: 0.29 Gwei

Contract

0x0aBb47c564296D34B0F5B068361985f507fe123c
 

More Info

Private Name Tags

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Buy Dbr And Borr...238719472025-11-24 23:24:47106 days ago1764026687IN
0x0aBb47c5...507fe123c
0 ETH0.000036190.08080823
Buy Dbr And Borr...238719362025-11-24 23:22:35106 days ago1764026555IN
0x0aBb47c5...507fe123c
0 ETH0.000043840.09120357
Buy Dbr And Borr...238719302025-11-24 23:21:23106 days ago1764026483IN
0x0aBb47c5...507fe123c
0 ETH0.000049550.11007502
Deposit Buy Dbr ...238534642025-11-22 9:00:59109 days ago1763802059IN
0x0aBb47c5...507fe123c
0 ETH0.000107070.09
Buy Dbr And Borr...238532402025-11-22 8:15:47109 days ago1763799347IN
0x0aBb47c5...507fe123c
0 ETH0.000041260.08076278
Deposit Buy Dbr ...238292552025-11-18 23:25:23112 days ago1763508323IN
0x0aBb47c5...507fe123c
0 ETH0.000601750.56312912
Deposit Buy Dbr ...238292042025-11-18 23:15:11112 days ago1763507711IN
0x0aBb47c5...507fe123c
0 ETH0.000756750.58454735
Buy Dbr And Borr...238117932025-11-16 12:37:23115 days ago1763296643IN
0x0aBb47c5...507fe123c
0 ETH0.000038010.08437905
Buy Dbr And Borr...238115522025-11-16 11:48:59115 days ago1763293739IN
0x0aBb47c5...507fe123c
0 ETH0.000034690.07389569
Deposit Buy Dbr ...238055012025-11-15 15:31:47115 days ago1763220707IN
0x0aBb47c5...507fe123c
0 ETH0.000049540.07393287
Buy Dbr And Borr...238036152025-11-15 9:11:47116 days ago1763197907IN
0x0aBb47c5...507fe123c
0 ETH0.000032560.06983581
Buy Dbr And Borr...238035822025-11-15 9:05:11116 days ago1763197511IN
0x0aBb47c5...507fe123c
0 ETH0.00004790.0939425
Buy Dbr And Borr...237888532025-11-13 7:40:11118 days ago1763019611IN
0x0aBb47c5...507fe123c
0 ETH0.000055760.11760006
Buy Dbr And Borr...237712712025-11-10 20:34:23120 days ago1762806863IN
0x0aBb47c5...507fe123c
0 ETH0.000063040.13965647
Buy Dbr And Borr...237712682025-11-10 20:33:47120 days ago1762806827IN
0x0aBb47c5...507fe123c
0 ETH0.000063090.13946311
Deposit Buy Dbr ...237619822025-11-09 13:24:47122 days ago1762694687IN
0x0aBb47c5...507fe123c
0 ETH0.000975232.07550195
Buy Dbr And Borr...237370352025-11-06 1:42:47125 days ago1762393367IN
0x0aBb47c5...507fe123c
0 ETH0.000136390.30458519
Buy Dbr And Borr...237370222025-11-06 1:40:11125 days ago1762393211IN
0x0aBb47c5...507fe123c
0 ETH0.000143510.28705215
Deposit Buy Dbr ...237247712025-11-04 8:29:23127 days ago1762244963IN
0x0aBb47c5...507fe123c
0 ETH0.0010741.5247007
Deposit Buy Dbr ...237206742025-11-03 18:45:59127 days ago1762195559IN
0x0aBb47c5...507fe123c
0 ETH0.003441942.74960996
Buy Dbr And Borr...237165332025-11-03 4:53:11128 days ago1762145591IN
0x0aBb47c5...507fe123c
0 ETH0.000046620.10074158
Buy Dbr And Borr...237153542025-11-03 0:55:23128 days ago1762131323IN
0x0aBb47c5...507fe123c
0 ETH0.001010932.07362362
Buy Dbr And Borr...237153002025-11-03 0:44:35128 days ago1762130675IN
0x0aBb47c5...507fe123c
0 ETH0.001189922.07838333
Deposit Native E...237053952025-11-01 15:30:35129 days ago1762011035IN
0x0aBb47c5...507fe123c
450 ETH0.000041320.09144184
Buy Dbr And Borr...236990462025-10-31 18:12:47130 days ago1761934367IN
0x0aBb47c5...507fe123c
0 ETH0.000200430.39280707
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Method Block
From
To
Deposit237053952025-11-01 15:30:35129 days ago1762011035
0x0aBb47c5...507fe123c
450 ETH
Transfer236903292025-10-30 12:53:47132 days ago1761828827
0x0aBb47c5...507fe123c
500 ETH
Transfer236903292025-10-30 12:53:47132 days ago1761828827
0x0aBb47c5...507fe123c
500 ETH
Deposit236902292025-10-30 12:33:47132 days ago1761827627
0x0aBb47c5...507fe123c
500 ETH
Transfer231468042025-08-15 13:42:47208 days ago1755265367
0x0aBb47c5...507fe123c
1 ETH
Transfer231468042025-08-15 13:42:47208 days ago1755265367
0x0aBb47c5...507fe123c
1 ETH
Transfer230628192025-08-03 20:06:47219 days ago1754251607
0x0aBb47c5...507fe123c
1.51304596 ETH
Transfer230628192025-08-03 20:06:47219 days ago1754251607
0x0aBb47c5...507fe123c
1.51304596 ETH
Transfer226834402025-06-11 19:34:47272 days ago1749670487
0x0aBb47c5...507fe123c
5 ETH
Transfer226834402025-06-11 19:34:47272 days ago1749670487
0x0aBb47c5...507fe123c
5 ETH
Deposit224611292025-05-11 15:57:23303 days ago1746979043
0x0aBb47c5...507fe123c
1 ETH
Deposit222373802025-04-10 8:38:11335 days ago1744274291
0x0aBb47c5...507fe123c
1 ETH
Deposit222119332025-04-06 19:23:23338 days ago1743967403
0x0aBb47c5...507fe123c
9 ETH
Deposit220790002025-03-19 6:02:47357 days ago1742364167
0x0aBb47c5...507fe123c
2.2 ETH
Transfer220698232025-03-17 23:15:47358 days ago1742253347
0x0aBb47c5...507fe123c
59 ETH
Transfer220698232025-03-17 23:15:47358 days ago1742253347
0x0aBb47c5...507fe123c
59 ETH
Deposit220167432025-03-10 13:22:35366 days ago1741612955
0x0aBb47c5...507fe123c
59 ETH
Transfer216769012025-01-22 1:59:59413 days ago1737511199
0x0aBb47c5...507fe123c
200 ETH
Transfer216769012025-01-22 1:59:59413 days ago1737511199
0x0aBb47c5...507fe123c
200 ETH
Transfer213704162024-12-10 6:48:47456 days ago1733813327
0x0aBb47c5...507fe123c
11 ETH
Transfer213704162024-12-10 6:48:47456 days ago1733813327
0x0aBb47c5...507fe123c
11 ETH
Transfer213480932024-12-07 4:00:47459 days ago1733544047
0x0aBb47c5...507fe123c
11 ETH
Transfer213480932024-12-07 4:00:47459 days ago1733544047
0x0aBb47c5...507fe123c
11 ETH
Transfer213480482024-12-07 3:51:47459 days ago1733543507
0x0aBb47c5...507fe123c
11 ETH
Transfer213480482024-12-07 3:51:47459 days ago1733543507
0x0aBb47c5...507fe123c
11 ETH
View All Internal Transactions
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Validator Index Block Amount
View All Withdrawals

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

Contract Source Code Verified (Exact Match)

Contract Name:
CurveHelper

Compiler Version
v0.8.20+commit.a1b79de6

Optimization Enabled:
Yes with 200 runs

Other Settings:
shanghai EvmVersion
pragma solidity ^0.8.13;
import "src/util/OffchainAbstractHelper.sol";

interface ICurvePool {
    function coins(uint index) external view returns(address);
    function get_dy(uint i, uint j, uint dx) external view returns(uint);
    function exchange(uint i, uint j, uint dx, uint min_dy, bool use_eth) external payable returns(uint);
    function exchange(uint i, uint j, uint dx, uint min_dy, bool use_eth, address receiver) external payable returns(uint);
}

contract CurveHelper is OffchainAbstractHelper{

    ICurvePool public immutable curvePool;
    uint dbrIndex;
    uint dolaIndex;

    constructor(address _pool, uint tokens) {
        curvePool = ICurvePool(_pool);
        DOLA.approve(_pool, type(uint).max);
        DBR.approve(_pool, type(uint).max);
        for(uint i; i < tokens; ++i){
            if(ICurvePool(_pool).coins(i) == address(DOLA)){
                dolaIndex = i;
            }
            else if(ICurvePool(_pool).coins(i) == address(DBR)){
                dbrIndex = i;
            }
        }
    }

    /**
    @notice Sells an exact amount of DBR for DOLA in a curve pool
    @param amount Amount of DBR to sell
    @param minOut minimum amount of DOLA to receive
    */
    function _sellDbr(uint amount, uint minOut) internal override {
        if(amount > 0){
            curvePool.exchange(dbrIndex, dolaIndex, amount, minOut, false);
        }
    }

    /**
    @notice Buys an exact amount of DBR for DOLA in a curve pool
    @param amount Amount of DOLA to sell
    @param minOut minimum amount of DBR out
    */
    function _buyDbr(uint amount, uint minOut, address receiver) internal override {
        if(amount > 0) {
            curvePool.exchange(dolaIndex, dbrIndex, amount, minOut, false, receiver);
        }
    }
    
    /**
    @notice Approximates the total amount of dola and dbr needed to borrow a dolaBorrowAmount while also borrowing enough to buy the DBR needed to cover for the borrowing period
    @dev Uses a binary search to approximate the amounts needed. Should only be called as part of generating transaction parameters.
    @param dolaBorrowAmount Amount of dola the user wishes to end up with
    @param period Amount of time in seconds the loan will last
    @param iterations Number of approximation iterations. The higher the more precise the result
    */
    function approximateDolaAndDbrNeeded(uint dolaBorrowAmount, uint period, uint iterations) public view override returns(uint dolaForDbr, uint dbrNeeded){
        uint amountIn = dolaBorrowAmount;
        uint stepSize = amountIn / 2;
        uint dbrReceived = curvePool.get_dy(dolaIndex, dbrIndex, amountIn);
        uint dbrToBuy = (amountIn + dolaBorrowAmount) * period / 365 days;
        uint dist = dbrReceived > dbrToBuy ? dbrReceived - dbrToBuy : dbrToBuy - dbrReceived;
        for(uint i; i < iterations; ++i){
            uint newAmountIn = amountIn;
            if(dbrReceived > dbrToBuy){
                newAmountIn -= stepSize;
            } else {
                newAmountIn += stepSize;
            }
            uint newDbrReceived = curvePool.get_dy(dolaIndex, dbrIndex, newAmountIn);
            uint newDbrToBuy = (newAmountIn + dolaBorrowAmount) * period / 365 days;
            uint newDist = newDbrReceived > newDbrToBuy ? newDbrReceived - newDbrToBuy : newDbrToBuy - newDbrReceived;
            if(newDist < dist){
                dbrReceived = newDbrReceived;
                dbrToBuy = newDbrToBuy;
                dist = newDist;
                amountIn = newAmountIn;
            }
            stepSize /= 2;
        }
        return (amountIn, (dolaBorrowAmount + amountIn) * period / 365 days);
    }
}

pragma solidity ^0.8.13;
import "../interfaces/IMarket.sol";
interface IERC20 {
    function transfer(address to, uint amount) external;
    function transferFrom(address from, address to, uint amount) external;
    function approve(address to, uint amount) external;
    function balanceOf(address user) external view returns(uint);
}

interface IWETH is IERC20 {
    function withdraw(uint wad) external;
    function deposit() external payable;
}

abstract contract OffchainAbstractHelper {

    IERC20 constant DOLA = IERC20(0x865377367054516e17014CcdED1e7d814EDC9ce4);
    IERC20 constant DBR = IERC20(0xAD038Eb671c44b853887A7E32528FaB35dC5D710);
    IWETH constant WETH = IWETH(0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2);
    
    /**
    Virtual functions implemented by the AMM interfacing part of the Helper contract
    */

    /**
    @notice Buys DBR for an amount of Dola
    @param amount Amount of Dola to spend on DBR
    @param minOut minimum amount of DBR to receive
    */
    function _buyDbr(uint amount, uint minOut, address receiver) internal virtual;

    /**
    @notice Sells an exact amount of DBR for DOLA
    @param amount Amount of DBR to sell
    @param minOut minimum amount of DOLA to receive
    */
    function _sellDbr(uint amount, uint minOut) internal virtual;

    /**
    @notice Approximates the amount of additional DOLA and DBR needed to sustain dolaBorrowAmount over the period
    @dev Larger number of iterations increases both accuracy of the approximation and gas cost. This method should not be called in smart contract code.
    @param dolaBorrowAmount The amount of DOLA the user wishes to borrow before covering DBR expenses
    @param minDbr The amount of seconds the user wish to borrow the DOLA for
    @param iterations The amount of approximation iterations.
    @return Tuple of (dolaNeeded, dbrNeeded) representing the total dola needed to pay for the DBR and pay out dolaBorrowAmount and the dbrNeeded to sustain the loan over the period
    */
    function approximateDolaAndDbrNeeded(uint dolaBorrowAmount, uint minDbr, uint iterations) public view virtual returns(uint, uint);

    /**
    @notice Borrows on behalf of the caller, buying the necessary DBR to pay for the loan over the period, by borrowing aditional funds to pay for the necessary DBR
    @dev Has to borrow the dolaForDbr amount due to how the market's borrowOnBehalf functions, and repay the excess at the end of the call resulting in a weird repay event
    @param market Market the caller wishes to borrow from
    @param dolaAmount Amount the caller wants to end up with at their disposal
    @param dolaForDbr The max amount of debt the caller is willing to end up with
     This is a sensitive parameter and should be reasonably low to prevent sandwhiching.
     A good estimate can be calculated given the approximateDolaAndDbrNeeded function, though should be set slightly higher.
    @param minDbr The minDbr the caller wish to borrow for
    @param deadline Deadline of the signature
    @param v V parameter of the signature
    @param r R parameter of the signature
    @param s S parameter of the signature
    */
    function buyDbrAndBorrowOnBehalf(
        IMarket market, 
        uint dolaAmount,
        uint dolaForDbr,
        uint minDbr,
        uint deadline, 
        uint8 v, 
        bytes32 r, 
        bytes32 s) 
        public 
    {
        //Borrow Dola
        uint totalBorrow = dolaAmount + dolaForDbr;
        market.borrowOnBehalf(msg.sender, totalBorrow, deadline, v, r, s);
        
        //Buy DBR
        _buyDbr(dolaForDbr, minDbr, msg.sender);

        //Transfer remaining DOLA amount to user
        DOLA.transfer(msg.sender, dolaAmount);
    }

    /**
    @notice Deposits collateral and borrows on behalf of the caller, buying the necessary DBR to pay for the loan over the period, by borrowing aditional funds to pay for the necessary DBR
    @dev Has to borrow the dolaForDbr amount due to how the market's borrowOnBehalf functions, and repay the excess at the end of the call resulting in a weird repay event
    @param market Market the caller wish to deposit to and borrow from
    @param dolaAmount Amount the caller wants to end up with at their disposal
    @param dolaForDbr The max amount of debt the caller is willing to take on to buy dbr
     This is a sensitive parameter and should be reasonably low to prevent sandwhiching.
     A good estimate can be calculated given the approximateDolaAndDbrNeeded function, though should be set slightly higher.
    @param minDbr The minDbr the caller wish to borrow for
    @param deadline Deadline of the signature
    @param v V parameter of the signature
    @param r R parameter of the signature
    @param s S parameter of the signature
    */
    function depositBuyDbrAndBorrowOnBehalf(
        IMarket market, 
        uint collateralAmount, 
        uint dolaAmount,
        uint dolaForDbr,
        uint minDbr,
        uint deadline, 
        uint8 v, 
        bytes32 r, 
        bytes32 s) 
        public 
    {
        IERC20 collateral = IERC20(market.collateral());

        //Deposit collateral
        collateral.transferFrom(msg.sender, address(this), collateralAmount);
        collateral.approve(address(market), collateralAmount);
        market.deposit(msg.sender, collateralAmount);

        //Borrow dola and buy dbr
        buyDbrAndBorrowOnBehalf(market, dolaAmount, dolaForDbr, minDbr, deadline, v, r , s);
    }

    /**
    @notice Deposits native eth as collateral and borrows on behalf of the caller,
    buying the necessary DBR to pay for the loan over the period, by borrowing aditional funds to pay for the necessary DBR
    @dev Has to borrow the dolaForDbr amount due to how the market's borrowOnBehalf functions, and repay the excess at the end of the call resulting in a weird repay event
    @param market Market the caller wish to deposit to and borrow from
    @param dolaAmount Amount the caller wants to end up with at their disposal
    @param dolaForDbr The max amount of debt the caller is willing to end up with
     This is a sensitive parameter and should be reasonably low to prevent sandwhiching.
     A good estimate can be calculated given the approximateDolaAndDbrNeeded function, though should be set slightly higher.
    @param minDbr The minDbr the caller wish to borrow for
    @param deadline Deadline of the signature
    @param v V parameter of the signature
    @param r R parameter of the signature
    @param s S parameter of the signature
    */
    function depositNativeEthBuyDbrAndBorrowOnBehalf(
        IMarket market, 
        uint dolaAmount,
        uint dolaForDbr,
        uint minDbr,
        uint deadline, 
        uint8 v, 
        bytes32 r, 
        bytes32 s) 
        public payable
    {
        IERC20 collateral = IERC20(market.collateral());
        require(address(collateral) == address(WETH), "Market is not an ETH market");
        WETH.deposit{value:msg.value}();

        //Deposit collateral
        collateral.approve(address(market), msg.value);
        market.deposit(msg.sender, msg.value);

        //Borrow dola and buy dbr
        buyDbrAndBorrowOnBehalf(market, dolaAmount, dolaForDbr, minDbr, deadline, v, r , s);
    }

    /**
    @notice Sells DBR on behalf of the caller and uses the proceeds along with DOLA from the caller to repay debt.
    @dev The caller is unlikely to spend all of the DOLA they make available for the function call
    @param market The market the user wishes to repay debt in
    @param dolaAmount The maximum amount of dola debt the user is willing to repay
    @param minDolaFromDbr The minimum amount of DOLA the caller expects to get in return for selling their DBR.
     This is a sensitive parameter and should be provided with reasonably low slippage to prevent sandwhiching.
    @param dbrAmountToSell The amount of DBR the caller wishes to sell
    */
    function sellDbrAndRepayOnBehalf(IMarket market, uint dolaAmount, uint minDolaFromDbr, uint dbrAmountToSell) public {
        uint dbrBal = DBR.balanceOf(msg.sender);

        //If user has less DBR than ordered, sell what's available
        if(dbrAmountToSell > dbrBal){
            DBR.transferFrom(msg.sender, address(this), dbrBal);
            _sellDbr(dbrBal, minDolaFromDbr);
        } else {
            DBR.transferFrom(msg.sender, address(this), dbrAmountToSell);
            _sellDbr(dbrAmountToSell, minDolaFromDbr);
        }

        uint debt = market.debts(msg.sender);
        uint dolaBal = DOLA.balanceOf(address(this));
        
        //If the debt is lower than the dolaAmount, repay debt else repay dolaAmount
        uint repayAmount = debt < dolaAmount ? debt : dolaAmount;

        //If dolaBal is less than repayAmount, transfer remaining DOLA from user, otherwise transfer excess dola to user
        if(dolaBal < repayAmount){
            DOLA.transferFrom(msg.sender, address(this), repayAmount - dolaBal);
        } else {
            DOLA.transfer(msg.sender, dolaBal - repayAmount);
        }

        //Repay repayAmount
        DOLA.approve(address(market), repayAmount);
        market.repay(msg.sender, repayAmount);
    }

    /**
    @notice Sells DBR on behalf of the caller and uses the proceeds along with DOLA from the caller to repay debt, and then withdraws collateral
    @dev The caller is unlikely to spend all of the DOLA they make available for the function call
    @param market Market the user wishes to repay debt in
    @param dolaAmount Maximum amount of dola debt the user is willing to repay
    @param minDolaFromDbr Minimum amount of DOLA the caller expects to get in return for selling their DBR
     This is a sensitive parameter and should be provided with reasonably low slippage to prevent sandwhiching.
    @param dbrAmountToSell Amount of DBR the caller wishes to sell
    @param collateralAmount Amount of collateral to withdraw
    @param deadline Deadline of the signature
    @param v V parameter of the signature
    @param r R parameter of the signature
    @param s S parameter of the signature
    */
    function sellDbrRepayAndWithdrawOnBehalf(
        IMarket market, 
        uint dolaAmount, 
        uint minDolaFromDbr,
        uint dbrAmountToSell, 
        uint collateralAmount, 
        uint deadline, 
        uint8 v, 
        bytes32 r, 
        bytes32 s) 
        external 
    {
        //Repay
        sellDbrAndRepayOnBehalf(market, dolaAmount, minDolaFromDbr, dbrAmountToSell);

        //Withdraw
        market.withdrawOnBehalf(msg.sender, collateralAmount, deadline, v, r, s);

        //Transfer collateral to msg.sender
        IERC20(market.collateral()).transfer(msg.sender, collateralAmount);
    }

    /**
    @notice Sells DBR on behalf of the caller and uses the proceeds along with DOLA from the caller to repay debt, and then withdraws collateral
    @dev The caller is unlikely to spend all of the DOLA they make available for the function call
    @param market Market the user wishes to repay debt in
    @param dolaAmount Maximum amount of dola debt the user is willing to repay
    @param minDolaFromDbr Minimum amount of DOLA the caller expects to get in return for selling their DBR
     This is a sensitive parameter and should be provided with reasonably low slippage to prevent sandwhiching.
    @param dbrAmountToSell Amount of DBR the caller wishes to sell
    @param collateralAmount Amount of collateral to withdraw
    @param deadline Deadline of the signature
    @param v V parameter of the signature
    @param r R parameter of the signature
    @param s S parameter of the signature
    */
    function sellDbrRepayAndWithdrawNativeEthOnBehalf(
        IMarket market, 
        uint dolaAmount, 
        uint minDolaFromDbr,
        uint dbrAmountToSell, 
        uint collateralAmount, 
        uint deadline, 
        uint8 v, 
        bytes32 r, 
        bytes32 s) 
        external 
    {
        //Repay
        sellDbrAndRepayOnBehalf(market, dolaAmount, minDolaFromDbr, dbrAmountToSell);

        //Withdraw
        withdrawNativeEthOnBehalf(market, collateralAmount, deadline, v, r, s);
    }

    /**
    @notice Repays debt, and then withdraws native ETH
    @dev The caller is unlikely to spend all of the DOLA they make available for the function call
    @param market Market the user wishes to repay debt in
    @param dolaAmount Amount of dola debt the user is willing to repay    
    @param collateralAmount Amount of collateral to withdraw
    @param deadline Deadline of the signature
    @param v V parameter of the signature
    @param r R parameter of the signature
    @param s S parameter of the signature
    */
    function repayAndWithdrawNativeEthOnBehalf(
        IMarket market, 
        uint dolaAmount,                 
        uint collateralAmount, 
        uint deadline,
        uint8 v, 
        bytes32 r, 
        bytes32 s) 
        external 
    {        
        // Repay
        DOLA.transferFrom(msg.sender, address(this), dolaAmount);        
        DOLA.approve(address(market), dolaAmount);
        market.repay(msg.sender, dolaAmount);

        // Withdraw
        withdrawNativeEthOnBehalf(market, collateralAmount, deadline, v, r, s);
    }

    /**
    @notice Helper function for depositing native eth to WETH markets
    @param market The WETH market to deposit to
    */
    function depositNativeEthOnBehalf(IMarket market) public payable {
        require(address(market.collateral()) == address(WETH), "Not an ETH market");
        WETH.deposit{value:msg.value}();
        WETH.approve(address(market), msg.value);
        market.deposit(msg.sender, msg.value);
    }

    /**
    @notice Helper function for depositing native eth to WETH markets before borrowing on behalf of the depositor
    @param market The WETH market to deposit to
    @param borrowAmount The amount to borrow on behalf of the depositor
    @param deadline Deadline of the signature
    @param v V parameter of the signature
    @param r R parameter of the signature
    @param s S parameter of the signature
    */
    function depositNativeEthAndBorrowOnBehalf(IMarket market, uint borrowAmount, uint deadline, uint8 v, bytes32 r, bytes32 s) public payable {
        require(address(market.collateral()) == address(WETH), "Not an ETH market");

        //Deposit native eth
        WETH.deposit{value:msg.value}();
        WETH.approve(address(market), msg.value);
        market.deposit(msg.sender, msg.value);

        //Borrow Dola
        market.borrowOnBehalf(msg.sender, borrowAmount, deadline, v, r, s);
        DOLA.transfer(msg.sender, borrowAmount);
    }

    /**
    @notice Helper function for withdrawing to native eth
    @param market WETH market to withdraw collateral from
    @param collateralAmount Amount of collateral to withdraw
    @param deadline Deadline of the signature
    @param v V parameter of the signature
    @param r R parameter of the signature
    @param s S parameter of the signature
    */
    function withdrawNativeEthOnBehalf(
        IMarket market,
        uint collateralAmount,
        uint deadline,
        uint8 v,
        bytes32 r,
        bytes32 s)
        public
    {
        market.withdrawOnBehalf(msg.sender, collateralAmount, deadline, v, r, s);

        IERC20 collateral = IERC20(market.collateral());
        require(address(collateral) == address(WETH), "Not an ETH market");
        WETH.withdraw(collateralAmount);

        (bool success,) = payable(msg.sender).call{value:collateralAmount}("");
        require(success, "Failed to transfer ETH");
    }
    
    //Empty receive function for receiving the native eth sent by the WETH contract
    receive() external payable {}
}

pragma solidity ^0.8.13;

interface IMarket {
    function borrowOnBehalf(address msgSender, uint dolaAmount, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
    function withdrawOnBehalf(address msgSender, uint amount, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
    function deposit(address msgSender, uint collateralAmount) external;
    function repay(address msgSender, uint amount) external;
    function collateral() external returns(address);
    function debts(address user) external returns(uint);
    function recall(uint amount) external;
    function totalDebt() external view returns (uint);
    function borrowPaused() external view returns (bool);
}

Settings
{
  "remappings": [
    "ds-test/=lib/solmate/lib/ds-test/src/",
    "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": "shanghai",
  "libraries": {}
}

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"address","name":"_pool","type":"address"},{"internalType":"uint256","name":"tokens","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"uint256","name":"dolaBorrowAmount","type":"uint256"},{"internalType":"uint256","name":"period","type":"uint256"},{"internalType":"uint256","name":"iterations","type":"uint256"}],"name":"approximateDolaAndDbrNeeded","outputs":[{"internalType":"uint256","name":"dolaForDbr","type":"uint256"},{"internalType":"uint256","name":"dbrNeeded","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IMarket","name":"market","type":"address"},{"internalType":"uint256","name":"dolaAmount","type":"uint256"},{"internalType":"uint256","name":"dolaForDbr","type":"uint256"},{"internalType":"uint256","name":"minDbr","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":"buyDbrAndBorrowOnBehalf","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"curvePool","outputs":[{"internalType":"contract ICurvePool","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IMarket","name":"market","type":"address"},{"internalType":"uint256","name":"collateralAmount","type":"uint256"},{"internalType":"uint256","name":"dolaAmount","type":"uint256"},{"internalType":"uint256","name":"dolaForDbr","type":"uint256"},{"internalType":"uint256","name":"minDbr","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":"depositBuyDbrAndBorrowOnBehalf","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IMarket","name":"market","type":"address"},{"internalType":"uint256","name":"borrowAmount","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":"depositNativeEthAndBorrowOnBehalf","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"contract IMarket","name":"market","type":"address"},{"internalType":"uint256","name":"dolaAmount","type":"uint256"},{"internalType":"uint256","name":"dolaForDbr","type":"uint256"},{"internalType":"uint256","name":"minDbr","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":"depositNativeEthBuyDbrAndBorrowOnBehalf","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"contract IMarket","name":"market","type":"address"}],"name":"depositNativeEthOnBehalf","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"contract IMarket","name":"market","type":"address"},{"internalType":"uint256","name":"dolaAmount","type":"uint256"},{"internalType":"uint256","name":"collateralAmount","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":"repayAndWithdrawNativeEthOnBehalf","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IMarket","name":"market","type":"address"},{"internalType":"uint256","name":"dolaAmount","type":"uint256"},{"internalType":"uint256","name":"minDolaFromDbr","type":"uint256"},{"internalType":"uint256","name":"dbrAmountToSell","type":"uint256"}],"name":"sellDbrAndRepayOnBehalf","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IMarket","name":"market","type":"address"},{"internalType":"uint256","name":"dolaAmount","type":"uint256"},{"internalType":"uint256","name":"minDolaFromDbr","type":"uint256"},{"internalType":"uint256","name":"dbrAmountToSell","type":"uint256"},{"internalType":"uint256","name":"collateralAmount","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":"sellDbrRepayAndWithdrawNativeEthOnBehalf","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IMarket","name":"market","type":"address"},{"internalType":"uint256","name":"dolaAmount","type":"uint256"},{"internalType":"uint256","name":"minDolaFromDbr","type":"uint256"},{"internalType":"uint256","name":"dbrAmountToSell","type":"uint256"},{"internalType":"uint256","name":"collateralAmount","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":"sellDbrRepayAndWithdrawOnBehalf","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IMarket","name":"market","type":"address"},{"internalType":"uint256","name":"collateralAmount","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":"withdrawNativeEthOnBehalf","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]

60a060405234801562000010575f80fd5b5060405162001e9838038062001e9883398101604081905262000033916200028e565b6001600160a01b038216608081905260405163095ea7b360e01b815260048101919091525f19602482015273865377367054516e17014ccded1e7d814edc9ce49063095ea7b3906044015f604051808303815f87803b15801562000095575f80fd5b505af1158015620000a8573d5f803e3d5ffd5b505060405163095ea7b360e01b81526001600160a01b03851660048201525f19602482015273ad038eb671c44b853887a7e32528fab35dc5d710925063095ea7b391506044015f604051808303815f87803b15801562000106575f80fd5b505af115801562000119573d5f803e3d5ffd5b505050505f5b81811015620002695760405163c661065760e01b81526004810182905273865377367054516e17014ccded1e7d814edc9ce4906001600160a01b0385169063c661065790602401602060405180830381865afa15801562000182573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190620001a89190620002bb565b6001600160a01b031603620001c257600181905562000256565b60405163c661065760e01b81526004810182905273ad038eb671c44b853887a7e32528fab35dc5d710906001600160a01b0385169063c661065790602401602060405180830381865afa1580156200021c573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190620002429190620002bb565b6001600160a01b03160362000256575f8190555b6200026181620002de565b90506200011f565b50505062000303565b80516001600160a01b038116811462000289575f80fd5b919050565b5f8060408385031215620002a0575f80fd5b620002ab8362000272565b9150602083015190509250929050565b5f60208284031215620002cc575f80fd5b620002d78262000272565b9392505050565b5f60018201620002fc57634e487b7160e01b5f52601160045260245ffd5b5060010190565b608051611b61620003375f395f818160ec015281816113200152818161143801528181611660015261171b0152611b615ff3fe6080604052600436106100a8575f3560e01c806382ab11b31161006257806382ab11b3146101885780638e5fa59c1461019b578063b56bcd35146101ba578063b86cb7cb146101d9578063b8b71de1146101f8578063e4cb99c01461022c575f80fd5b80630d7fc7bc146100b35780631d0ef6c0146100c8578063218751b2146100db578063459be9861461012b5780634879539f1461014a578063822c088914610169575f80fd5b366100af57005b5f80fd5b6100c66100c13660046117b7565b61024b565b005b6100c66100d636600461180d565b6104ef565b3480156100e6575f80fd5b5061010e7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020015b60405180910390f35b348015610136575f80fd5b506100c661014536600461182f565b6106bc565b348015610155575f80fd5b506100c6610164366004611867565b610ace565b348015610174575f80fd5b506100c66101833660046117b7565b610c56565b6100c66101963660046118da565b610e51565b3480156101a6575f80fd5b506100c66101b5366004611867565b611056565b3480156101c5575f80fd5b506100c66101d4366004611867565b61118b565b3480156101e4575f80fd5b506100c66101f3366004611944565b6111a5565b348015610203575f80fd5b506102176102123660046119a4565b6112e5565b60408051928352602083019190915201610122565b348015610237575f80fd5b506100c66102463660046118da565b611565565b73c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b0316866001600160a01b031663d8dfeb456040518163ffffffff1660e01b81526004016020604051808303815f875af11580156102a6573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906102ca91906119cd565b6001600160a01b0316146102f95760405162461bcd60e51b81526004016102f0906119e8565b60405180910390fd5b73c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b031663d0e30db0346040518263ffffffff1660e01b81526004015f604051808303818588803b158015610346575f80fd5b505af1158015610358573d5f803e3d5ffd5b505060405163095ea7b360e01b815273c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2935063095ea7b39250610396915089903490600401611a13565b5f604051808303815f87803b1580156103ad575f80fd5b505af11580156103bf573d5f803e3d5ffd5b50506040516311f9fbc960e21b81526001600160a01b03891692506347e7ef2491506103f19033903490600401611a13565b5f604051808303815f87803b158015610408575f80fd5b505af115801561041a573d5f803e3d5ffd5b5050604051631ef08b7560e01b81526001600160a01b0389169250631ef08b75915061045490339089908990899089908990600401611a2c565b5f604051808303815f87803b15801561046b575f80fd5b505af115801561047d573d5f803e3d5ffd5b505060405163a9059cbb60e01b815273865377367054516e17014ccded1e7d814edc9ce4925063a9059cbb91506104ba9033908990600401611a13565b5f604051808303815f87803b1580156104d1575f80fd5b505af11580156104e3573d5f803e3d5ffd5b50505050505050505050565b73c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b0316816001600160a01b031663d8dfeb456040518163ffffffff1660e01b81526004016020604051808303815f875af115801561054a573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061056e91906119cd565b6001600160a01b0316146105945760405162461bcd60e51b81526004016102f0906119e8565b73c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b031663d0e30db0346040518263ffffffff1660e01b81526004015f604051808303818588803b1580156105e1575f80fd5b505af11580156105f3573d5f803e3d5ffd5b505060405163095ea7b360e01b815273c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2935063095ea7b39250610631915084903490600401611a13565b5f604051808303815f87803b158015610648575f80fd5b505af115801561065a573d5f803e3d5ffd5b50506040516311f9fbc960e21b81526001600160a01b03841692506347e7ef24915061068c9033903490600401611a13565b5f604051808303815f87803b1580156106a3575f80fd5b505af11580156106b5573d5f803e3d5ffd5b5050505050565b6040516370a0823160e01b81523360048201525f9073ad038eb671c44b853887a7e32528fab35dc5d710906370a0823190602401602060405180830381865afa15801561070b573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061072f9190611a62565b9050808211156107b0576040516323b872dd60e01b815273ad038eb671c44b853887a7e32528fab35dc5d710906323b872dd9061077490339030908690600401611a79565b5f604051808303815f87803b15801561078b575f80fd5b505af115801561079d573d5f803e3d5ffd5b505050506107ab818461161a565b610822565b6040516323b872dd60e01b815273ad038eb671c44b853887a7e32528fab35dc5d710906323b872dd906107eb90339030908790600401611a79565b5f604051808303815f87803b158015610802575f80fd5b505af1158015610814573d5f803e3d5ffd5b50505050610822828461161a565b604051632ecd4e7d60e01b81523360048201525f906001600160a01b03871690632ecd4e7d906024016020604051808303815f875af1158015610867573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061088b9190611a62565b6040516370a0823160e01b81523060048201529091505f9073865377367054516e17014ccded1e7d814edc9ce4906370a0823190602401602060405180830381865afa1580156108dd573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906109019190611a62565b90505f8683106109115786610913565b825b9050808210156109935773865377367054516e17014ccded1e7d814edc9ce46323b872dd33306109438686611ab1565b6040518463ffffffff1660e01b815260040161096193929190611a79565b5f604051808303815f87803b158015610978575f80fd5b505af115801561098a573d5f803e3d5ffd5b50505050610a03565b73865377367054516e17014ccded1e7d814edc9ce463a9059cbb336109b88486611ab1565b6040518363ffffffff1660e01b81526004016109d5929190611a13565b5f604051808303815f87803b1580156109ec575f80fd5b505af11580156109fe573d5f803e3d5ffd5b505050505b60405163095ea7b360e01b815273865377367054516e17014ccded1e7d814edc9ce49063095ea7b390610a3c908b908590600401611a13565b5f604051808303815f87803b158015610a53575f80fd5b505af1158015610a65573d5f803e3d5ffd5b5050604051630450cfaf60e31b81526001600160a01b038b1692506322867d789150610a979033908590600401611a13565b5f604051808303815f87803b158015610aae575f80fd5b505af1158015610ac0573d5f803e3d5ffd5b505050505050505050505050565b5f896001600160a01b031663d8dfeb456040518163ffffffff1660e01b81526004016020604051808303815f875af1158015610b0c573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610b3091906119cd565b6040516323b872dd60e01b81529091506001600160a01b038216906323b872dd90610b6390339030908e90600401611a79565b5f604051808303815f87803b158015610b7a575f80fd5b505af1158015610b8c573d5f803e3d5ffd5b505060405163095ea7b360e01b81526001600160a01b038416925063095ea7b39150610bbe908d908d90600401611a13565b5f604051808303815f87803b158015610bd5575f80fd5b505af1158015610be7573d5f803e3d5ffd5b50506040516311f9fbc960e21b81526001600160a01b038d1692506347e7ef249150610c199033908d90600401611a13565b5f604051808303815f87803b158015610c30575f80fd5b505af1158015610c42573d5f803e3d5ffd5b505050506104e38a89898989898989611565565b604051633525f59160e01b81526001600160a01b03871690633525f59190610c8c90339089908990899089908990600401611a2c565b5f604051808303815f87803b158015610ca3575f80fd5b505af1158015610cb5573d5f803e3d5ffd5b505050505f866001600160a01b031663d8dfeb456040518163ffffffff1660e01b81526004016020604051808303815f875af1158015610cf7573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610d1b91906119cd565b90506001600160a01b03811673c02aaa39b223fe8d0a0e5c4f27ead9083c756cc214610d595760405162461bcd60e51b81526004016102f0906119e8565b604051632e1a7d4d60e01b81526004810187905273c02aaa39b223fe8d0a0e5c4f27ead9083c756cc290632e1a7d4d906024015f604051808303815f87803b158015610da3575f80fd5b505af1158015610db5573d5f803e3d5ffd5b50506040515f925033915088908381818185875af1925050503d805f8114610df8576040519150601f19603f3d011682016040523d82523d5f602084013e610dfd565b606091505b5050905080610e475760405162461bcd60e51b815260206004820152601660248201527508cc2d2d8cac840e8de40e8e4c2dce6cccae4408aa8960531b60448201526064016102f0565b5050505050505050565b5f886001600160a01b031663d8dfeb456040518163ffffffff1660e01b81526004016020604051808303815f875af1158015610e8f573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610eb391906119cd565b90506001600160a01b03811673c02aaa39b223fe8d0a0e5c4f27ead9083c756cc214610f215760405162461bcd60e51b815260206004820152601b60248201527f4d61726b6574206973206e6f7420616e20455448206d61726b6574000000000060448201526064016102f0565b73c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b031663d0e30db0346040518263ffffffff1660e01b81526004015f604051808303818588803b158015610f6e575f80fd5b505af1158015610f80573d5f803e3d5ffd5b505060405163095ea7b360e01b81526001600160a01b038516935063095ea7b39250610fb391508c903490600401611a13565b5f604051808303815f87803b158015610fca575f80fd5b505af1158015610fdc573d5f803e3d5ffd5b50506040516311f9fbc960e21b81526001600160a01b038c1692506347e7ef24915061100e9033903490600401611a13565b5f604051808303815f87803b158015611025575f80fd5b505af1158015611037573d5f803e3d5ffd5b5050505061104b8989898989898989611565565b505050505050505050565b611062898989896106bc565b604051633525f59160e01b81526001600160a01b038a1690633525f5919061109890339089908990899089908990600401611a2c565b5f604051808303815f87803b1580156110af575f80fd5b505af11580156110c1573d5f803e3d5ffd5b50505050886001600160a01b031663d8dfeb456040518163ffffffff1660e01b81526004016020604051808303815f875af1158015611102573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061112691906119cd565b6001600160a01b031663a9059cbb33876040518363ffffffff1660e01b8152600401611153929190611a13565b5f604051808303815f87803b15801561116a575f80fd5b505af115801561117c573d5f803e3d5ffd5b50505050505050505050505050565b611197898989896106bc565b61104b898686868686610c56565b6040516323b872dd60e01b815273865377367054516e17014ccded1e7d814edc9ce4906323b872dd906111e090339030908b90600401611a79565b5f604051808303815f87803b1580156111f7575f80fd5b505af1158015611209573d5f803e3d5ffd5b505060405163095ea7b360e01b815273865377367054516e17014ccded1e7d814edc9ce4925063095ea7b39150611246908a908a90600401611a13565b5f604051808303815f87803b15801561125d575f80fd5b505af115801561126f573d5f803e3d5ffd5b5050604051630450cfaf60e31b81526001600160a01b038a1692506322867d7891506112a19033908a90600401611a13565b5f604051808303815f87803b1580156112b8575f80fd5b505af11580156112ca573d5f803e3d5ffd5b505050506112dc878686868686610c56565b50505050505050565b5f8084816112f4600283611aca565b6001545f805460405163556d6e9f60e01b815260048101939093526024830152604482018590529192507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063556d6e9f90606401602060405180830381865afa15801561136d573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906113919190611a62565b90505f6301e13380886113a48b87611ae9565b6113ae9190611afc565b6113b89190611aca565b90505f8183116113d1576113cc8383611ab1565b6113db565b6113db8284611ab1565b90505f5b8881101561152e578583851115611401576113fa8682611ab1565b905061140e565b61140b8682611ae9565b90505b6001545f805460405163556d6e9f60e01b81526004810193909352602483015260448201839052907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063556d6e9f90606401602060405180830381865afa158015611485573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906114a99190611a62565b90505f6301e133808d8f856114be9190611ae9565b6114c89190611afc565b6114d29190611aca565b90505f8183116114eb576114e68383611ab1565b6114f5565b6114f58284611ab1565b90508581101561150c578297508196508095508399505b61151760028a611aca565b9850505050508061152790611b13565b90506113df565b50846301e133808a611540838e611ae9565b61154a9190611afc565b6115549190611aca565b965096505050505050935093915050565b5f6115708789611ae9565b604051631ef08b7560e01b81529091506001600160a01b038a1690631ef08b75906115a990339085908a908a908a908a90600401611a2c565b5f604051808303815f87803b1580156115c0575f80fd5b505af11580156115d2573d5f803e3d5ffd5b505050506115e18787336116d0565b60405163a9059cbb60e01b815273865377367054516e17014ccded1e7d814edc9ce49063a9059cbb906111539033908c90600401611a13565b81156116cc575f805460015460405163394747c560e01b815260048101929092526024820152604481018490526064810183905260848101919091526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063394747c59060a4016020604051808303815f875af11580156116a6573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906116ca9190611a62565b505b5050565b82156116ca576001545f805460405163ce7d650360e01b815260048101939093526024830152604482018590526064820184905260848201526001600160a01b0382811660a48301527f0000000000000000000000000000000000000000000000000000000000000000169063ce7d65039060c4016020604051808303815f875af1158015611761573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906117859190611a62565b50505050565b6001600160a01b038116811461179f575f80fd5b50565b803560ff811681146117b2575f80fd5b919050565b5f805f805f8060c087890312156117cc575f80fd5b86356117d78161178b565b955060208701359450604087013593506117f3606088016117a2565b92506080870135915060a087013590509295509295509295565b5f6020828403121561181d575f80fd5b81356118288161178b565b9392505050565b5f805f8060808587031215611842575f80fd5b843561184d8161178b565b966020860135965060408601359560600135945092505050565b5f805f805f805f805f6101208a8c031215611880575f80fd5b893561188b8161178b565b985060208a0135975060408a0135965060608a0135955060808a0135945060a08a013593506118bc60c08b016117a2565b925060e08a013591506101008a013590509295985092959850929598565b5f805f805f805f80610100898b0312156118f2575f80fd5b88356118fd8161178b565b97506020890135965060408901359550606089013594506080890135935061192760a08a016117a2565b925060c0890135915060e089013590509295985092959890939650565b5f805f805f805f60e0888a03121561195a575f80fd5b87356119658161178b565b9650602088013595506040880135945060608801359350611988608089016117a2565b925060a0880135915060c0880135905092959891949750929550565b5f805f606084860312156119b6575f80fd5b505081359360208301359350604090920135919050565b5f602082840312156119dd575f80fd5b81516118288161178b565b602080825260119082015270139bdd08185b88115512081b585c9ad95d607a1b604082015260600190565b6001600160a01b03929092168252602082015260400190565b6001600160a01b039690961686526020860194909452604085019290925260ff166060840152608083015260a082015260c00190565b5f60208284031215611a72575f80fd5b5051919050565b6001600160a01b039384168152919092166020820152604081019190915260600190565b634e487b7160e01b5f52601160045260245ffd5b81810381811115611ac457611ac4611a9d565b92915050565b5f82611ae457634e487b7160e01b5f52601260045260245ffd5b500490565b80820180821115611ac457611ac4611a9d565b8082028115828204841417611ac457611ac4611a9d565b5f60018201611b2457611b24611a9d565b506001019056fea26469706673582212207bf9b8dcab257c59333c0ee10e8d3390bcc67af0ca8e647b6b059d3ba98a3e7b64736f6c63430008140033000000000000000000000000c7de47b9ca2fc753d6a2f167d8b3e19c6d18b19a0000000000000000000000000000000000000000000000000000000000000003

Deployed Bytecode

0x6080604052600436106100a8575f3560e01c806382ab11b31161006257806382ab11b3146101885780638e5fa59c1461019b578063b56bcd35146101ba578063b86cb7cb146101d9578063b8b71de1146101f8578063e4cb99c01461022c575f80fd5b80630d7fc7bc146100b35780631d0ef6c0146100c8578063218751b2146100db578063459be9861461012b5780634879539f1461014a578063822c088914610169575f80fd5b366100af57005b5f80fd5b6100c66100c13660046117b7565b61024b565b005b6100c66100d636600461180d565b6104ef565b3480156100e6575f80fd5b5061010e7f000000000000000000000000c7de47b9ca2fc753d6a2f167d8b3e19c6d18b19a81565b6040516001600160a01b0390911681526020015b60405180910390f35b348015610136575f80fd5b506100c661014536600461182f565b6106bc565b348015610155575f80fd5b506100c6610164366004611867565b610ace565b348015610174575f80fd5b506100c66101833660046117b7565b610c56565b6100c66101963660046118da565b610e51565b3480156101a6575f80fd5b506100c66101b5366004611867565b611056565b3480156101c5575f80fd5b506100c66101d4366004611867565b61118b565b3480156101e4575f80fd5b506100c66101f3366004611944565b6111a5565b348015610203575f80fd5b506102176102123660046119a4565b6112e5565b60408051928352602083019190915201610122565b348015610237575f80fd5b506100c66102463660046118da565b611565565b73c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b0316866001600160a01b031663d8dfeb456040518163ffffffff1660e01b81526004016020604051808303815f875af11580156102a6573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906102ca91906119cd565b6001600160a01b0316146102f95760405162461bcd60e51b81526004016102f0906119e8565b60405180910390fd5b73c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b031663d0e30db0346040518263ffffffff1660e01b81526004015f604051808303818588803b158015610346575f80fd5b505af1158015610358573d5f803e3d5ffd5b505060405163095ea7b360e01b815273c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2935063095ea7b39250610396915089903490600401611a13565b5f604051808303815f87803b1580156103ad575f80fd5b505af11580156103bf573d5f803e3d5ffd5b50506040516311f9fbc960e21b81526001600160a01b03891692506347e7ef2491506103f19033903490600401611a13565b5f604051808303815f87803b158015610408575f80fd5b505af115801561041a573d5f803e3d5ffd5b5050604051631ef08b7560e01b81526001600160a01b0389169250631ef08b75915061045490339089908990899089908990600401611a2c565b5f604051808303815f87803b15801561046b575f80fd5b505af115801561047d573d5f803e3d5ffd5b505060405163a9059cbb60e01b815273865377367054516e17014ccded1e7d814edc9ce4925063a9059cbb91506104ba9033908990600401611a13565b5f604051808303815f87803b1580156104d1575f80fd5b505af11580156104e3573d5f803e3d5ffd5b50505050505050505050565b73c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b0316816001600160a01b031663d8dfeb456040518163ffffffff1660e01b81526004016020604051808303815f875af115801561054a573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061056e91906119cd565b6001600160a01b0316146105945760405162461bcd60e51b81526004016102f0906119e8565b73c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b031663d0e30db0346040518263ffffffff1660e01b81526004015f604051808303818588803b1580156105e1575f80fd5b505af11580156105f3573d5f803e3d5ffd5b505060405163095ea7b360e01b815273c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2935063095ea7b39250610631915084903490600401611a13565b5f604051808303815f87803b158015610648575f80fd5b505af115801561065a573d5f803e3d5ffd5b50506040516311f9fbc960e21b81526001600160a01b03841692506347e7ef24915061068c9033903490600401611a13565b5f604051808303815f87803b1580156106a3575f80fd5b505af11580156106b5573d5f803e3d5ffd5b5050505050565b6040516370a0823160e01b81523360048201525f9073ad038eb671c44b853887a7e32528fab35dc5d710906370a0823190602401602060405180830381865afa15801561070b573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061072f9190611a62565b9050808211156107b0576040516323b872dd60e01b815273ad038eb671c44b853887a7e32528fab35dc5d710906323b872dd9061077490339030908690600401611a79565b5f604051808303815f87803b15801561078b575f80fd5b505af115801561079d573d5f803e3d5ffd5b505050506107ab818461161a565b610822565b6040516323b872dd60e01b815273ad038eb671c44b853887a7e32528fab35dc5d710906323b872dd906107eb90339030908790600401611a79565b5f604051808303815f87803b158015610802575f80fd5b505af1158015610814573d5f803e3d5ffd5b50505050610822828461161a565b604051632ecd4e7d60e01b81523360048201525f906001600160a01b03871690632ecd4e7d906024016020604051808303815f875af1158015610867573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061088b9190611a62565b6040516370a0823160e01b81523060048201529091505f9073865377367054516e17014ccded1e7d814edc9ce4906370a0823190602401602060405180830381865afa1580156108dd573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906109019190611a62565b90505f8683106109115786610913565b825b9050808210156109935773865377367054516e17014ccded1e7d814edc9ce46323b872dd33306109438686611ab1565b6040518463ffffffff1660e01b815260040161096193929190611a79565b5f604051808303815f87803b158015610978575f80fd5b505af115801561098a573d5f803e3d5ffd5b50505050610a03565b73865377367054516e17014ccded1e7d814edc9ce463a9059cbb336109b88486611ab1565b6040518363ffffffff1660e01b81526004016109d5929190611a13565b5f604051808303815f87803b1580156109ec575f80fd5b505af11580156109fe573d5f803e3d5ffd5b505050505b60405163095ea7b360e01b815273865377367054516e17014ccded1e7d814edc9ce49063095ea7b390610a3c908b908590600401611a13565b5f604051808303815f87803b158015610a53575f80fd5b505af1158015610a65573d5f803e3d5ffd5b5050604051630450cfaf60e31b81526001600160a01b038b1692506322867d789150610a979033908590600401611a13565b5f604051808303815f87803b158015610aae575f80fd5b505af1158015610ac0573d5f803e3d5ffd5b505050505050505050505050565b5f896001600160a01b031663d8dfeb456040518163ffffffff1660e01b81526004016020604051808303815f875af1158015610b0c573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610b3091906119cd565b6040516323b872dd60e01b81529091506001600160a01b038216906323b872dd90610b6390339030908e90600401611a79565b5f604051808303815f87803b158015610b7a575f80fd5b505af1158015610b8c573d5f803e3d5ffd5b505060405163095ea7b360e01b81526001600160a01b038416925063095ea7b39150610bbe908d908d90600401611a13565b5f604051808303815f87803b158015610bd5575f80fd5b505af1158015610be7573d5f803e3d5ffd5b50506040516311f9fbc960e21b81526001600160a01b038d1692506347e7ef249150610c199033908d90600401611a13565b5f604051808303815f87803b158015610c30575f80fd5b505af1158015610c42573d5f803e3d5ffd5b505050506104e38a89898989898989611565565b604051633525f59160e01b81526001600160a01b03871690633525f59190610c8c90339089908990899089908990600401611a2c565b5f604051808303815f87803b158015610ca3575f80fd5b505af1158015610cb5573d5f803e3d5ffd5b505050505f866001600160a01b031663d8dfeb456040518163ffffffff1660e01b81526004016020604051808303815f875af1158015610cf7573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610d1b91906119cd565b90506001600160a01b03811673c02aaa39b223fe8d0a0e5c4f27ead9083c756cc214610d595760405162461bcd60e51b81526004016102f0906119e8565b604051632e1a7d4d60e01b81526004810187905273c02aaa39b223fe8d0a0e5c4f27ead9083c756cc290632e1a7d4d906024015f604051808303815f87803b158015610da3575f80fd5b505af1158015610db5573d5f803e3d5ffd5b50506040515f925033915088908381818185875af1925050503d805f8114610df8576040519150601f19603f3d011682016040523d82523d5f602084013e610dfd565b606091505b5050905080610e475760405162461bcd60e51b815260206004820152601660248201527508cc2d2d8cac840e8de40e8e4c2dce6cccae4408aa8960531b60448201526064016102f0565b5050505050505050565b5f886001600160a01b031663d8dfeb456040518163ffffffff1660e01b81526004016020604051808303815f875af1158015610e8f573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610eb391906119cd565b90506001600160a01b03811673c02aaa39b223fe8d0a0e5c4f27ead9083c756cc214610f215760405162461bcd60e51b815260206004820152601b60248201527f4d61726b6574206973206e6f7420616e20455448206d61726b6574000000000060448201526064016102f0565b73c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b031663d0e30db0346040518263ffffffff1660e01b81526004015f604051808303818588803b158015610f6e575f80fd5b505af1158015610f80573d5f803e3d5ffd5b505060405163095ea7b360e01b81526001600160a01b038516935063095ea7b39250610fb391508c903490600401611a13565b5f604051808303815f87803b158015610fca575f80fd5b505af1158015610fdc573d5f803e3d5ffd5b50506040516311f9fbc960e21b81526001600160a01b038c1692506347e7ef24915061100e9033903490600401611a13565b5f604051808303815f87803b158015611025575f80fd5b505af1158015611037573d5f803e3d5ffd5b5050505061104b8989898989898989611565565b505050505050505050565b611062898989896106bc565b604051633525f59160e01b81526001600160a01b038a1690633525f5919061109890339089908990899089908990600401611a2c565b5f604051808303815f87803b1580156110af575f80fd5b505af11580156110c1573d5f803e3d5ffd5b50505050886001600160a01b031663d8dfeb456040518163ffffffff1660e01b81526004016020604051808303815f875af1158015611102573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061112691906119cd565b6001600160a01b031663a9059cbb33876040518363ffffffff1660e01b8152600401611153929190611a13565b5f604051808303815f87803b15801561116a575f80fd5b505af115801561117c573d5f803e3d5ffd5b50505050505050505050505050565b611197898989896106bc565b61104b898686868686610c56565b6040516323b872dd60e01b815273865377367054516e17014ccded1e7d814edc9ce4906323b872dd906111e090339030908b90600401611a79565b5f604051808303815f87803b1580156111f7575f80fd5b505af1158015611209573d5f803e3d5ffd5b505060405163095ea7b360e01b815273865377367054516e17014ccded1e7d814edc9ce4925063095ea7b39150611246908a908a90600401611a13565b5f604051808303815f87803b15801561125d575f80fd5b505af115801561126f573d5f803e3d5ffd5b5050604051630450cfaf60e31b81526001600160a01b038a1692506322867d7891506112a19033908a90600401611a13565b5f604051808303815f87803b1580156112b8575f80fd5b505af11580156112ca573d5f803e3d5ffd5b505050506112dc878686868686610c56565b50505050505050565b5f8084816112f4600283611aca565b6001545f805460405163556d6e9f60e01b815260048101939093526024830152604482018590529192507f000000000000000000000000c7de47b9ca2fc753d6a2f167d8b3e19c6d18b19a6001600160a01b03169063556d6e9f90606401602060405180830381865afa15801561136d573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906113919190611a62565b90505f6301e13380886113a48b87611ae9565b6113ae9190611afc565b6113b89190611aca565b90505f8183116113d1576113cc8383611ab1565b6113db565b6113db8284611ab1565b90505f5b8881101561152e578583851115611401576113fa8682611ab1565b905061140e565b61140b8682611ae9565b90505b6001545f805460405163556d6e9f60e01b81526004810193909352602483015260448201839052907f000000000000000000000000c7de47b9ca2fc753d6a2f167d8b3e19c6d18b19a6001600160a01b03169063556d6e9f90606401602060405180830381865afa158015611485573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906114a99190611a62565b90505f6301e133808d8f856114be9190611ae9565b6114c89190611afc565b6114d29190611aca565b90505f8183116114eb576114e68383611ab1565b6114f5565b6114f58284611ab1565b90508581101561150c578297508196508095508399505b61151760028a611aca565b9850505050508061152790611b13565b90506113df565b50846301e133808a611540838e611ae9565b61154a9190611afc565b6115549190611aca565b965096505050505050935093915050565b5f6115708789611ae9565b604051631ef08b7560e01b81529091506001600160a01b038a1690631ef08b75906115a990339085908a908a908a908a90600401611a2c565b5f604051808303815f87803b1580156115c0575f80fd5b505af11580156115d2573d5f803e3d5ffd5b505050506115e18787336116d0565b60405163a9059cbb60e01b815273865377367054516e17014ccded1e7d814edc9ce49063a9059cbb906111539033908c90600401611a13565b81156116cc575f805460015460405163394747c560e01b815260048101929092526024820152604481018490526064810183905260848101919091526001600160a01b037f000000000000000000000000c7de47b9ca2fc753d6a2f167d8b3e19c6d18b19a169063394747c59060a4016020604051808303815f875af11580156116a6573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906116ca9190611a62565b505b5050565b82156116ca576001545f805460405163ce7d650360e01b815260048101939093526024830152604482018590526064820184905260848201526001600160a01b0382811660a48301527f000000000000000000000000c7de47b9ca2fc753d6a2f167d8b3e19c6d18b19a169063ce7d65039060c4016020604051808303815f875af1158015611761573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906117859190611a62565b50505050565b6001600160a01b038116811461179f575f80fd5b50565b803560ff811681146117b2575f80fd5b919050565b5f805f805f8060c087890312156117cc575f80fd5b86356117d78161178b565b955060208701359450604087013593506117f3606088016117a2565b92506080870135915060a087013590509295509295509295565b5f6020828403121561181d575f80fd5b81356118288161178b565b9392505050565b5f805f8060808587031215611842575f80fd5b843561184d8161178b565b966020860135965060408601359560600135945092505050565b5f805f805f805f805f6101208a8c031215611880575f80fd5b893561188b8161178b565b985060208a0135975060408a0135965060608a0135955060808a0135945060a08a013593506118bc60c08b016117a2565b925060e08a013591506101008a013590509295985092959850929598565b5f805f805f805f80610100898b0312156118f2575f80fd5b88356118fd8161178b565b97506020890135965060408901359550606089013594506080890135935061192760a08a016117a2565b925060c0890135915060e089013590509295985092959890939650565b5f805f805f805f60e0888a03121561195a575f80fd5b87356119658161178b565b9650602088013595506040880135945060608801359350611988608089016117a2565b925060a0880135915060c0880135905092959891949750929550565b5f805f606084860312156119b6575f80fd5b505081359360208301359350604090920135919050565b5f602082840312156119dd575f80fd5b81516118288161178b565b602080825260119082015270139bdd08185b88115512081b585c9ad95d607a1b604082015260600190565b6001600160a01b03929092168252602082015260400190565b6001600160a01b039690961686526020860194909452604085019290925260ff166060840152608083015260a082015260c00190565b5f60208284031215611a72575f80fd5b5051919050565b6001600160a01b039384168152919092166020820152604081019190915260600190565b634e487b7160e01b5f52601160045260245ffd5b81810381811115611ac457611ac4611a9d565b92915050565b5f82611ae457634e487b7160e01b5f52601260045260245ffd5b500490565b80820180821115611ac457611ac4611a9d565b8082028115828204841417611ac457611ac4611a9d565b5f60018201611b2457611b24611a9d565b506001019056fea26469706673582212207bf9b8dcab257c59333c0ee10e8d3390bcc67af0ca8e647b6b059d3ba98a3e7b64736f6c63430008140033

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

000000000000000000000000c7de47b9ca2fc753d6a2f167d8b3e19c6d18b19a0000000000000000000000000000000000000000000000000000000000000003

-----Decoded View---------------
Arg [0] : _pool (address): 0xC7DE47b9Ca2Fc753D6a2F167D8b3e19c6D18b19a
Arg [1] : tokens (uint256): 3

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 000000000000000000000000c7de47b9ca2fc753d6a2f167d8b3e19c6d18b19a
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000003


Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading
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.