ETH Price: $3,426.93 (-1.59%)
Gas: 7 Gwei

Contract

0x819064AD78F549DBc88AD5cb74E6Fdb23b84844F
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Dough Call201631712024-06-24 17:55:3523 days ago1719251735IN
0x819064AD...23b84844F
0 ETH0.0030436.30328599
Dough Call201631672024-06-24 17:54:4723 days ago1719251687IN
0x819064AD...23b84844F
0 ETH0.006834676.95067106
Dough Call201217872024-06-18 23:01:4729 days ago1718751707IN
0x819064AD...23b84844F
0 ETH0.002475434.52960527
Dough Call201217792024-06-18 23:00:1129 days ago1718751611IN
0x819064AD...23b84844F
0 ETH0.004431054.61668675
Dough Call201217612024-06-18 22:56:3529 days ago1718751395IN
0x819064AD...23b84844F
0 ETH0.002310234.52881654
Dough Call201217442024-06-18 22:53:1129 days ago1718751191IN
0x819064AD...23b84844F
0 ETH0.002957935.79852398
Dough Call201217392024-06-18 22:52:1129 days ago1718751131IN
0x819064AD...23b84844F
0 ETH0.005706125.93127402
Dough Call201217302024-06-18 22:50:2329 days ago1718751023IN
0x819064AD...23b84844F
0 ETH0.005224295.81695204
Dough Call201217252024-06-18 22:49:2329 days ago1718750963IN
0x819064AD...23b84844F
0 ETH0.002968025.81829907
Dough Call201217182024-06-18 22:47:5929 days ago1718750879IN
0x819064AD...23b84844F
0 ETH0.001422545.85390663
Dough Call201216922024-06-18 22:42:4729 days ago1718750567IN
0x819064AD...23b84844F
0 ETH0.003321256.07729758
Dough Call201216822024-06-18 22:40:4729 days ago1718750447IN
0x819064AD...23b84844F
0 ETH0.006205056.54372787
Dough Call201216762024-06-18 22:39:3529 days ago1718750375IN
0x819064AD...23b84844F
0 ETH0.001713236.83297079
Dough Call199914112024-05-31 17:49:3547 days ago1717177775IN
0x819064AD...23b84844F
0 ETH0.0040603512.0077028
Dough Call199914052024-05-31 17:48:2347 days ago1717177703IN
0x819064AD...23b84844F
0 ETH0.0133767613.02660668
Dough Call199708192024-05-28 20:41:4750 days ago1716928907IN
0x819064AD...23b84844F
0 ETH0.0058653912.53934768
Dough Call199708162024-05-28 20:41:1150 days ago1716928871IN
0x819064AD...23b84844F
0.08 ETH0.0025933912.15057733
Dough Call199700832024-05-28 18:13:3550 days ago1716920015IN
0x819064AD...23b84844F
0 ETH0.0034271214.13358953
Dough Call199700642024-05-28 18:09:4750 days ago1716919787IN
0x819064AD...23b84844F
0 ETH0.0058801314.31222913
Dough Call199700602024-05-28 18:08:5950 days ago1716919739IN
0x819064AD...23b84844F
0 ETH0.0155366115.07993234
Dough Call199700522024-05-28 18:07:2350 days ago1716919643IN
0x819064AD...23b84844F
0 ETH0.0056518214.6775147
Dough Call199350062024-05-23 20:36:2355 days ago1716496583IN
0x819064AD...23b84844F
0 ETH0.0071636514.21703953
Dough Call199349732024-05-23 20:29:4755 days ago1716496187IN
0x819064AD...23b84844F
0 ETH0.0040702917.13774367
Dough Call199345652024-05-23 19:07:3555 days ago1716491255IN
0x819064AD...23b84844F
0 ETH0.008267699.15487795
Dough Call199345542024-05-23 19:05:2355 days ago1716491123IN
0x819064AD...23b84844F
0 ETH0.0052900110.41320621
View all transactions

Latest 13 internal transactions

Advanced mode:
Parent Transaction Hash Block From To
201631712024-06-24 17:55:3523 days ago1719251735
0x819064AD...23b84844F
0.07637667 ETH
201631712024-06-24 17:55:3523 days ago1719251735
0x819064AD...23b84844F
0.07637667 ETH
199914112024-05-31 17:49:3547 days ago1717177775
0x819064AD...23b84844F
0.12472614 ETH
199914112024-05-31 17:49:3547 days ago1717177775
0x819064AD...23b84844F
0.12472614 ETH
199708162024-05-28 20:41:1150 days ago1716928871
0x819064AD...23b84844F
0.08 ETH
199700522024-05-28 18:07:2350 days ago1716919643
0x819064AD...23b84844F
0.1354 ETH
199700522024-05-28 18:07:2350 days ago1716919643
0x819064AD...23b84844F
0.1354 ETH
199345322024-05-23 19:00:5955 days ago1716490859
0x819064AD...23b84844F
0.2271 ETH
199345322024-05-23 19:00:5955 days ago1716490859
0x819064AD...23b84844F
0.2271 ETH
199334482024-05-23 15:22:1155 days ago1716477731
0x819064AD...23b84844F
0.08 ETH
199280842024-05-22 21:24:1156 days ago1716413051
0x819064AD...23b84844F
0.044 ETH
198781362024-05-15 21:41:4763 days ago1715809307
0x819064AD...23b84844F
0.06 ETH
198776392024-05-15 20:01:4763 days ago1715803307  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.