ETH Price: $2,488.67 (-1.16%)

Contract

0x9E911C88d918463A58d3A32551FCbE2E012Ffa19
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Dough Call202774392024-07-10 16:57:35114 days ago1720630655IN
0x9E911C88...E012Ffa19
0 ETH0.005146019.08964361
Dough Call202774322024-07-10 16:56:11114 days ago1720630571IN
0x9E911C88...E012Ffa19
0 ETH0.009351339.45501097
Dough Call202774202024-07-10 16:53:47114 days ago1720630427IN
0x9E911C88...E012Ffa19
0 ETH0.009659679.75280979
Dough Call202773762024-07-10 16:44:59114 days ago1720629899IN
0x9E911C88...E012Ffa19
0.4 ETH0.00218089.86595348
Dough Call202773052024-07-10 16:30:47114 days ago1720629047IN
0x9E911C88...E012Ffa19
0.6 ETH0.0022788210.75829164
Dough Call202212332024-07-02 20:32:35122 days ago1719952355IN
0x9E911C88...E012Ffa19
0.5 ETH0.001476346.37831501
Dough Call201918842024-06-28 18:09:59126 days ago1719598199IN
0x9E911C88...E012Ffa19
0 ETH0.003282056.79449513
Dough Call201629882024-06-24 17:18:59130 days ago1719249539IN
0x9E911C88...E012Ffa19
0 ETH0.0089679719.33894431
Dough Call200791162024-06-12 23:46:11142 days ago1718235971IN
0x9E911C88...E012Ffa19
0 ETH0.00832738.05138531
Dough Call200568502024-06-09 21:07:59145 days ago1717967279IN
0x9E911C88...E012Ffa19
0 ETH0.002341246.07152336
Dough Call200568372024-06-09 21:05:11145 days ago1717967111IN
0x9E911C88...E012Ffa19
0 ETH0.00755076.37742597
Dough Call200011462024-06-02 2:26:35153 days ago1717295195IN
0x9E911C88...E012Ffa19
0 ETH0.001939445.03680273
Dough Call200011302024-06-02 2:23:23153 days ago1717295003IN
0x9E911C88...E012Ffa19
0 ETH0.005191955.10718219
Dough Call199508332024-05-26 1:41:23160 days ago1716687683IN
0x9E911C88...E012Ffa19
0 ETH0.002802263.13626643
Dough Call198778742024-05-15 20:49:23170 days ago1715806163IN
0x9E911C88...E012Ffa19
0 ETH0.0093926710.12133444
Dough Call198778532024-05-15 20:45:11170 days ago1715805911IN
0x9E911C88...E012Ffa19
0 ETH0.009557019.6605722
Dough Call198769122024-05-15 17:35:47170 days ago1715794547IN
0x9E911C88...E012Ffa19
0 ETH0.005519446.72758074
Dough Call198768972024-05-15 17:32:47170 days ago1715794367IN
0x9E911C88...E012Ffa19
1 ETH0.001708038.00249746
Dough Call198266292024-05-08 16:48:23177 days ago1715186903IN
0x9E911C88...E012Ffa19
0.4 ETH0.001309636.135888
Dough Call197988432024-05-04 19:30:59181 days ago1714851059IN
0x9E911C88...E012Ffa19
0 ETH0.004552095.0781413
Dough Call197988232024-05-04 19:26:59181 days ago1714850819IN
0x9E911C88...E012Ffa19
0.25 ETH0.000985014.61498748
Dough Call197984722024-05-04 18:16:35181 days ago1714846595IN
0x9E911C88...E012Ffa19
0 ETH0.004116914.42909515
Dough Call197983322024-05-04 17:48:35181 days ago1714844915IN
0x9E911C88...E012Ffa19
0 ETH0.005257225.60562317
Dough Call197706842024-04-30 21:03:47185 days ago1714511027IN
0x9E911C88...E012Ffa19
0 ETH0.008045999.81641675
Dough Call197706802024-04-30 21:02:59185 days ago1714510979IN
0x9E911C88...E012Ffa19
0 ETH0.009052399.65230127
View all transactions

Latest 18 internal transactions

Advanced mode:
Parent Transaction Hash Block From To
202774392024-07-10 16:57:35114 days ago1720630655
0x9E911C88...E012Ffa19
0.81214795 ETH
202774392024-07-10 16:57:35114 days ago1720630655
0x9E911C88...E012Ffa19
0.81214795 ETH
202773762024-07-10 16:44:59114 days ago1720629899
0x9E911C88...E012Ffa19
0.4 ETH
202773052024-07-10 16:30:47114 days ago1720629047
0x9E911C88...E012Ffa19
0.6 ETH
202212332024-07-02 20:32:35122 days ago1719952355
0x9E911C88...E012Ffa19
0.5 ETH
201918842024-06-28 18:09:59126 days ago1719598199
0x9E911C88...E012Ffa19
1.44496252 ETH
201918842024-06-28 18:09:59126 days ago1719598199
0x9E911C88...E012Ffa19
1.44496252 ETH
201629882024-06-24 17:18:59130 days ago1719249539
0x9E911C88...E012Ffa19
0.25 ETH
201629882024-06-24 17:18:59130 days ago1719249539
0x9E911C88...E012Ffa19
0.25 ETH
200568502024-06-09 21:07:59145 days ago1717967279
0x9E911C88...E012Ffa19
0.25 ETH
200568502024-06-09 21:07:59145 days ago1717967279
0x9E911C88...E012Ffa19
0.25 ETH
200011462024-06-02 2:26:35153 days ago1717295195
0x9E911C88...E012Ffa19
0.25 ETH
200011462024-06-02 2:26:35153 days ago1717295195
0x9E911C88...E012Ffa19
0.25 ETH
198768972024-05-15 17:32:47170 days ago1715794367
0x9E911C88...E012Ffa19
1 ETH
198266292024-05-08 16:48:23177 days ago1715186903
0x9E911C88...E012Ffa19
0.4 ETH
197988232024-05-04 19:26:59181 days ago1714850819
0x9E911C88...E012Ffa19
0.25 ETH
197694492024-04-30 16:54:35185 days ago1714496075
0x9E911C88...E012Ffa19
0.15 ETH
197691492024-04-30 15:54:23186 days ago1714492463  Contract Creation0 ETH
Loading...
Loading

Minimal Proxy Contract for 0x8a3f35e9eb756ad10242655bf5075178bcb7b59f

Contract Name:
DoughDsa

Compiler Version
v0.8.24+commit.e11b9ed9

Optimization Enabled:
Yes with 200 runs

Other Settings:
paris EvmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 3 : DoughDsa.sol
// SPDX-License-Identifier: BUSL-1.1
pragma solidity =0.8.24;
import { IDoughIndex, CustomError } from "./Interfaces.sol";

/**
* $$$$$$$\                                $$\             $$$$$$$$\ $$\                                                   
* $$  __$$\                               $$ |            $$  _____|\__|                                                  
* $$ |  $$ | $$$$$$\  $$\   $$\  $$$$$$\  $$$$$$$\        $$ |      $$\ $$$$$$$\   $$$$$$\  $$$$$$$\   $$$$$$$\  $$$$$$\  
* $$ |  $$ |$$  __$$\ $$ |  $$ |$$  __$$\ $$  __$$\       $$$$$\    $$ |$$  __$$\  \____$$\ $$  __$$\ $$  _____|$$  __$$\ 
* $$ |  $$ |$$ /  $$ |$$ |  $$ |$$ /  $$ |$$ |  $$ |      $$  __|   $$ |$$ |  $$ | $$$$$$$ |$$ |  $$ |$$ /      $$$$$$$$ |
* $$ |  $$ |$$ |  $$ |$$ |  $$ |$$ |  $$ |$$ |  $$ |      $$ |      $$ |$$ |  $$ |$$  __$$ |$$ |  $$ |$$ |      $$   ____|
* $$$$$$$  |\$$$$$$  |\$$$$$$  |\$$$$$$$ |$$ |  $$ |      $$ |      $$ |$$ |  $$ |\$$$$$$$ |$$ |  $$ |\$$$$$$$\ \$$$$$$$\ 
* \_______/  \______/  \______/  \____$$ |\__|  \__|      \__|      \__|\__|  \__| \_______|\__|  \__| \_______| \_______|
*                               $$\   $$ |                                                                                
*                               \$$$$$$  |                                                                                
*                                \______/                                                                                 
* 
* @title DoughDsa
* @notice This contract is used to delegate the call to the respective connectors
* @custom:version 1.0 - Initial release
* @author Liberalite https://github.com/liberalite
* @custom:coauthor 0xboga https://github.com/0xboga
*/
contract DoughDsa {
    /* ========== LAYOUT ========== */
    address public dsaOwner;
    address public doughIndex;

    /**
    * @notice Initializes the DoughDsa contract
    * @param _dsaOwner: The DSA owner address of the DSA contract
    * @param _doughIndex: The DoughIndex contract address
    */
    function initialize(address _dsaOwner, address _doughIndex) external {
        if (dsaOwner != address(0) || _dsaOwner == address(0)) revert CustomError("invalid dsaOwner");
        if (doughIndex != address(0) || _doughIndex == address(0)) revert CustomError("invalid doughIndex");
        doughIndex = _doughIndex;
        dsaOwner = _dsaOwner;
    }

    /**
    * @notice Delegates the call to the respective connector
    * @param _connectorId: The connector ID to call
    * @param _actionId: The action ID to call
    * @param _token: The token address to call
    * @param _amount: The amount to call
    * @param _opt: The optional boolean value
    * @param _swapData: The swap data to call
    */
    function doughCall(uint256 _connectorId, uint256 _actionId, address _token, uint256 _amount, bool _opt, bytes[] calldata _swapData) external payable {
        // _connectorId:  0-dsa  1-aave  2-paraswap  3-uniV3  4-deleveraging-uniV3  4-deleveraging-paraswap  5-shield  6-vault
        address _contract = IDoughIndex(doughIndex).getDoughConnector(_connectorId);
        if (_contract == address(0)) revert CustomError("Unregistered Connector");

        if (_connectorId < 21) {
            // only the DSA Owner can run supply, withdraw, repay, swap, loop, deloop, etc
            if (msg.sender != dsaOwner) revert CustomError("Caller not dsaOwner");
        } else if (_connectorId == 21 || _connectorId == 22) {
            if (msg.sender != IDoughIndex(doughIndex).deleverageAutomation()) revert CustomError("Only Deleveraging Automation");
        } else if (_connectorId == 23) {
            if (msg.sender != IDoughIndex(doughIndex).shieldAutomation()) revert CustomError("Only Shield Automation");
        } else if (_connectorId == 24) {
            if (msg.sender != IDoughIndex(doughIndex).vaultAutomation()) revert CustomError("Only Vault Automation");
        } else {
            // future connectors will only be available to the DSA Owner
            if (msg.sender != dsaOwner) revert CustomError("Caller not dsaOwner");
        }

        (bool success, bytes memory data) = _contract.delegatecall(abi.encodeWithSignature("delegateDoughCall(uint256,address,uint256,bool,bytes[])", _actionId, _token, _amount, _opt, _swapData));
        if (!success) {
            if (data.length == 0) revert CustomError("Invalid doughcall error length");
            if (data.length > 0) {
                assembly {
                    revert(add(32, data), mload(data))
                }
            }
        }

    }

    /**
    * @notice Executes an action from and to the Flashloan Connector
    * @param _connectorId: The connector ID
    * @param _tokenIn: The token address to get in
    * @param _inAmount: The amount to get in
    * @param _tokenOut: The token address to get out
    * @param _outAmount: The amount to get out
    * @param _actionId: The action ID to call
    */
    function executeAction(uint256 _connectorId, address _tokenIn, uint256 _inAmount, address _tokenOut, uint256 _outAmount, uint256 _actionId) external payable {
        address _connector = IDoughIndex(doughIndex).getDoughConnector(_connectorId);
        if(msg.sender != address(this) && msg.sender != _connector) revert CustomError("Caller not owner or DSA");

        address aaveActions = IDoughIndex(doughIndex).aaveActionsAddress();

        (bool success, bytes memory data) = aaveActions.delegatecall(abi.encodeWithSignature("executeAaveAction(uint256,address,uint256,address,uint256,uint256)", _connectorId, _tokenIn, _inAmount, _tokenOut, _outAmount, _actionId));
        if (!success) {
            if (data.length == 0) revert CustomError("Invalid Aave error length");
            if (data.length > 0) {
                assembly {
                    revert(add(32, data), mload(data))
                }
            }
        }

    }

    /**
    * @notice allows DSA Owner to deposit and withdraw ETH
    */
    receive() external payable {}
    fallback() external payable {}
}

File 2 of 3 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.20;

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

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

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

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

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

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

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

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

File 3 of 3 : Interfaces.sol
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.10;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";

error CustomError(string errorMsg);

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

interface AaveActionsConnector {
    function executeAaveAction(address _dsaAddress, uint256 _connectorId, address _tokenIn, uint256 _inAmount, address _tokenOut, uint256 _outAmount, uint256 _actionId) external payable;
}

interface IDoughDsa {
    function doughCall(uint256 _connectorId, uint256 _actionId, address _token, uint256 _amount, bool _opt, bytes[] calldata _swapData) external payable;
    function executeAction(uint256 _connectorId, address tokenIn, uint256 inAmount, address tokenOut, uint256 outAmount, uint256 actionId) external payable;
    function dsaOwner() external view returns (address);
    function doughIndex() external view returns (address);
}

interface IDoughIndex {
    function aaveActionsAddress() external view returns (address);
    function setDsaMasterClone(address _dsaMasterCopy) external;
    function setNewBorrowFormula(address _newBorrowFormula) external;
    function setNewAaveActions(address _newAaveActions) external;
    function apyFee() external view returns (uint256);
    function getFlashBorrowers(address _flashBorrower) external view returns (bool);
    function deleverageAutomation() external view returns (address);
    function shieldAutomation() external view returns (address);
    function vaultAutomation() external view returns (address);
    function getWhitelistedTokenList() external view returns (address[] memory);
    function multisig() external view returns (address);
    function treasury() external view returns (address);
    function deleverageAsset() external view returns (address);
    function getDoughConnector (uint256 _connectorId) external view returns (address);
    function getOwnerOfDoughDsa(address dsaAddress) external view returns (address);
    function getDoughDsa(address dsaAddress) external view returns (address);
    function getTokenDecimals(address _token) external view returns (uint8);
    function getTokenMinInterest(address _token) external view returns (uint256);
    function getTokenIndex(address _token) external view returns (uint256);
    function borrowFormula (address _token, address _dsaAddress) external returns (uint256, uint256, uint256, uint256);
    function borrowFormulaInterest (address _token, address _dsaAddress) external returns (uint256);
    function getDsaBorrowStartDate (address _dsaAddress, address _token) external view returns (uint256);
    function updateBorrowDate(uint256 _connectorID, uint256 _time, address _dsaAddress, address _token) external;
    function minDeleveragingRatio() external view returns (uint256);
    function minHealthFactor() external view returns (uint256);
}

interface IBorrowManagementConnector {
    function borrowFormula(address _token, address _dsaAddress) external view returns (uint256, uint256, uint256, uint256);
    function borrowFormulaInterest(address _token, address _dsaAddress) external view returns (uint256);
}

interface IConnectorMultiFlashloan {
    function flashloanReq(address[] memory flashloanTokens, uint256[] memory flashloanAmounts, uint256[] memory flashLoanInterestRateModes, bytes[] memory swapData) external;
}

interface IConnectorMultiFlashloanOnchain {
    function flashloanReq(address[] memory flashloanTokens, uint256[] memory flashloanAmount, uint256[] memory flashLoanInterestRateModes, address[] memory flashLoanTokensCollateral, uint256[] memory flashLoanAmountsCollateral) external;
}

interface IConnectorFlashloan {
    function flashloanReq(address dsaOwnerAddress, address flashloanToken, uint256 flashloanAmount, uint256 flashActionId, bytes calldata _swapData) external;
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "evmVersion": "paris",
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract ABI

[{"inputs":[{"internalType":"string","name":"errorMsg","type":"string"}],"name":"CustomError","type":"error"},{"stateMutability":"payable","type":"fallback"},{"inputs":[{"internalType":"uint256","name":"_connectorId","type":"uint256"},{"internalType":"uint256","name":"_actionId","type":"uint256"},{"internalType":"address","name":"_token","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"bool","name":"_opt","type":"bool"},{"internalType":"bytes[]","name":"_swapData","type":"bytes[]"}],"name":"doughCall","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"doughIndex","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"dsaOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_connectorId","type":"uint256"},{"internalType":"address","name":"_tokenIn","type":"address"},{"internalType":"uint256","name":"_inAmount","type":"uint256"},{"internalType":"address","name":"_tokenOut","type":"address"},{"internalType":"uint256","name":"_outAmount","type":"uint256"},{"internalType":"uint256","name":"_actionId","type":"uint256"}],"name":"executeAction","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_dsaOwner","type":"address"},{"internalType":"address","name":"_doughIndex","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]

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.