ETH Price: $2,241.10 (+0.71%)
Gas: 76 Gwei

Contract

0x0e2d46fe246eb926d939A10efA96fB7d4EB14bB3
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Sponsored

Transaction Hash
Method
Block
From
To
Value
0x60e06040157291322022-10-12 2:45:35419 days 13 hrs ago1665542735IN
 Create: StkAaveRetrieval
0 ETH0.0097203925.10873685

Advanced mode:
Parent Txn Hash Block From To Value
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
StkAaveRetrieval

Compiler Version
v0.8.15+commit.e14f2714

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 3 : StkAaveRetrieval.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity ^0.8.15;

import "./external/aave/IStaticATokenLM.sol";
import "./external/aave/IAaveIncentivesController.sol";

/**
 * @title StkAaveRetrieval
 * @author Llama
 * @notice This contract is used to claim stkAave rewards on behalf of the Balancer DAO contract
 * @notice It sends those funds to the Balancer Multisig
 * @notice Aave proposal to whitelist this contract:
 * @notice https://governance.aave.com/t/arc-whitelist-balancer-s-liquidity-mining-claim/9724
 * @dev The Balancer Multisig should call retrieve()
 */
contract StkAaveRetrieval {
    /// @dev this is msg.sender
    address public constant BALANCER_MULTISIG = 0x10A19e7eE7d7F8a52822f6817de8ea18204F2e4f;

    /// @dev this is the address we're claiming on behalf of
    address public constant BALANCER_DAO = 0xBA12222222228d8Ba445958a75a0704d566BF2C8;

    /// @dev this is the address of the Aave Incentives Controller, which manages and stores the claimers
    address public constant INCENTIVES_CONTROLLER = 0xd784927Ff2f95ba542BfC824c8a8a98F3495f6b5;

    /// @dev these are the tokens which have accrued LM rewards
    address public constant WRAPPED_ADAI = 0x02d60b84491589974263d922D9cC7a3152618Ef6;
    address public constant WRAPPED_AUSDC = 0xd093fA4Fb80D09bB30817FDcd442d4d02eD3E5de;
    address public constant WRAPPED_AUSDT = 0xf8Fd466F12e236f4c96F7Cce6c79EAdB819abF58;
    address[] public WRAPPED_TOKENS = [WRAPPED_ADAI, WRAPPED_AUSDC, WRAPPED_AUSDT];

    /**
     * @dev This is the core function. We check that only the multisig can execute this and that proper whitelisting has been set up.
     * @notice We call this function to claim the rewards and send them to the multisig
     */
    function retrieve() external {
        require(msg.sender == BALANCER_MULTISIG, "Only Balancer Multisig");
        require(
            IAaveIncentivesController(INCENTIVES_CONTROLLER).getClaimer(BALANCER_DAO) == address(this),
            "Contract not set as claimer"
        );
        for (uint256 i = 0; i < WRAPPED_TOKENS.length; i++) {
            IStaticATokenLM(WRAPPED_TOKENS[i]).claimRewardsOnBehalf(BALANCER_DAO, BALANCER_MULTISIG, true);
        }
    }
}

File 2 of 3 : IStaticATokenLM.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity ^0.8.15;

// relevant functions from https://etherscan.io/address/0x1dc16f168b0a2bb3fbda0fe1a1787f8b22c0aed8#code

interface IStaticATokenLM {
    /**
     * @notice Claim rewards on behalf of a user and send them to a receiver
     * @dev Only callable by if sender is onBehalfOf or sender is approved claimer
     * @param onBehalfOf The address to claim on behalf of
     * @param receiver The address to receive the rewards
     * @param forceUpdate Flag to retrieve latest rewards from `INCENTIVES_CONTROLLER`
     */
    function claimRewardsOnBehalf(
        address onBehalfOf,
        address receiver,
        bool forceUpdate
    ) external;

    /**
     * @notice The unclaimed rewards for a user in WAD
     * @param user The address of the user
     * @return The unclaimed amount of rewards in WAD
     */
    function getUnclaimedRewards(address user) external view returns (uint256);
}

File 3 of 3 : IAaveIncentivesController.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity ^0.8.15;

// relevant function from https://etherscan.io/address/0xd9ed413bcf58c266f95fe6ba63b13cf79299ce31#code

interface IAaveIncentivesController {
    /**
     * @dev Whitelists an address to claim the rewards on behalf of another address
     * @param user The address of the user
     * @param claimer The address of the claimer
     */
    function setClaimer(address user, address claimer) external;

    /**
     * @dev Returns the whitelisted claimer for a certain address (0x0 if not set)
     * @param user The address of the user
     * @return The claimer address
     */
    function getClaimer(address user) external view returns (address);
}

Settings
{
  "remappings": [
    "@aave-address-book/=lib/aave-address-book/src/",
    "@aave-helpers/=lib/aave-helpers/src/",
    "@forge-std/=lib/forge-std/src/",
    "@openzeppelin/=lib/openzeppelin-contracts/contracts/",
    "aave-address-book/=lib/aave-address-book/src/",
    "aave-helpers/=lib/aave-helpers/src/",
    "ds-test/=lib/forge-std/lib/ds-test/src/",
    "forge-std/=lib/forge-std/src/",
    "openzeppelin-contracts/=lib/openzeppelin-contracts/contracts/",
    "solidity-utils/=lib/aave-helpers/lib/solidity-utils/src/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "metadata": {
    "bytecodeHash": "ipfs"
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "london",
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[],"name":"BALANCER_DAO","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"BALANCER_MULTISIG","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"INCENTIVES_CONTROLLER","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WRAPPED_ADAI","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WRAPPED_AUSDC","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WRAPPED_AUSDT","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"WRAPPED_TOKENS","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"retrieve","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60e06040527302d60b84491589974263d922d9cc7a3152618ef6608090815273d093fa4fb80d09bb30817fdcd442d4d02ed3e5de60a05273f8fd466f12e236f4c96f7cce6c79eadb819abf5860c05261005c90600090600361006f565b5034801561006957600080fd5b506100e9565b8280548282559060005260206000209081019282156100c4579160200282015b828111156100c457825182546001600160a01b0319166001600160a01b0390911617825560209092019160019091019061008f565b506100d09291506100d4565b5090565b5b808211156100d057600081556001016100d5565b61045f806100f86000396000f3fe608060405234801561001057600080fd5b50600436106100885760003560e01c80638cf7540c1161005b5780638cf7540c146100fc5780639e463f0214610117578063a3a0e61214610132578063f2fba89b1461014d57600080fd5b806310d0ab221461008d57806318c1798d146100c45780632e64cec1146100df57806363525f71146100e9575b600080fd5b6100a873d784927ff2f95ba542bfc824c8a8a98f3495f6b581565b6040516001600160a01b03909116815260200160405180910390f35b6100a873d093fa4fb80d09bb30817fdcd442d4d02ed3e5de81565b6100e7610168565b005b6100a86100f73660046103a3565b610379565b6100a873f8fd466f12e236f4c96f7cce6c79eadb819abf5881565b6100a873ba12222222228d8ba445958a75a0704d566bf2c881565b6100a87310a19e7ee7d7f8a52822f6817de8ea18204f2e4f81565b6100a87302d60b84491589974263d922d9cc7a3152618ef681565b337310a19e7ee7d7f8a52822f6817de8ea18204f2e4f146101c95760405162461bcd60e51b81526020600482015260166024820152754f6e6c792042616c616e636572204d756c746973696760501b60448201526064015b60405180910390fd5b604051631d36517b60e21b815273ba12222222228d8ba445958a75a0704d566bf2c86004820152309073d784927ff2f95ba542bfc824c8a8a98f3495f6b5906374d945ec90602401602060405180830381865afa15801561022e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061025291906103bc565b6001600160a01b0316146102a85760405162461bcd60e51b815260206004820152601b60248201527f436f6e7472616374206e6f742073657420617320636c61696d6572000000000060448201526064016101c0565b60005b60005481101561037657600081815481106102c8576102c86103ec565b600091825260209091200154604051636e82d50960e11b815273ba12222222228d8ba445958a75a0704d566bf2c860048201527310a19e7ee7d7f8a52822f6817de8ea18204f2e4f6024820152600160448201526001600160a01b039091169063dd05aa1290606401600060405180830381600087803b15801561034b57600080fd5b505af115801561035f573d6000803e3d6000fd5b50505050808061036e90610402565b9150506102ab565b50565b6000818154811061038957600080fd5b6000918252602090912001546001600160a01b0316905081565b6000602082840312156103b557600080fd5b5035919050565b6000602082840312156103ce57600080fd5b81516001600160a01b03811681146103e557600080fd5b9392505050565b634e487b7160e01b600052603260045260246000fd5b60006001820161042257634e487b7160e01b600052601160045260246000fd5b506001019056fea26469706673582212203044dbb70a9f1305e684d8feec96ea418335961b86b975b59c1f8d8aab21006664736f6c634300080f0033

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106100885760003560e01c80638cf7540c1161005b5780638cf7540c146100fc5780639e463f0214610117578063a3a0e61214610132578063f2fba89b1461014d57600080fd5b806310d0ab221461008d57806318c1798d146100c45780632e64cec1146100df57806363525f71146100e9575b600080fd5b6100a873d784927ff2f95ba542bfc824c8a8a98f3495f6b581565b6040516001600160a01b03909116815260200160405180910390f35b6100a873d093fa4fb80d09bb30817fdcd442d4d02ed3e5de81565b6100e7610168565b005b6100a86100f73660046103a3565b610379565b6100a873f8fd466f12e236f4c96f7cce6c79eadb819abf5881565b6100a873ba12222222228d8ba445958a75a0704d566bf2c881565b6100a87310a19e7ee7d7f8a52822f6817de8ea18204f2e4f81565b6100a87302d60b84491589974263d922d9cc7a3152618ef681565b337310a19e7ee7d7f8a52822f6817de8ea18204f2e4f146101c95760405162461bcd60e51b81526020600482015260166024820152754f6e6c792042616c616e636572204d756c746973696760501b60448201526064015b60405180910390fd5b604051631d36517b60e21b815273ba12222222228d8ba445958a75a0704d566bf2c86004820152309073d784927ff2f95ba542bfc824c8a8a98f3495f6b5906374d945ec90602401602060405180830381865afa15801561022e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061025291906103bc565b6001600160a01b0316146102a85760405162461bcd60e51b815260206004820152601b60248201527f436f6e7472616374206e6f742073657420617320636c61696d6572000000000060448201526064016101c0565b60005b60005481101561037657600081815481106102c8576102c86103ec565b600091825260209091200154604051636e82d50960e11b815273ba12222222228d8ba445958a75a0704d566bf2c860048201527310a19e7ee7d7f8a52822f6817de8ea18204f2e4f6024820152600160448201526001600160a01b039091169063dd05aa1290606401600060405180830381600087803b15801561034b57600080fd5b505af115801561035f573d6000803e3d6000fd5b50505050808061036e90610402565b9150506102ab565b50565b6000818154811061038957600080fd5b6000918252602090912001546001600160a01b0316905081565b6000602082840312156103b557600080fd5b5035919050565b6000602082840312156103ce57600080fd5b81516001600160a01b03811681146103e557600080fd5b9392505050565b634e487b7160e01b600052603260045260246000fd5b60006001820161042257634e487b7160e01b600052601160045260246000fd5b506001019056fea26469706673582212203044dbb70a9f1305e684d8feec96ea418335961b86b975b59c1f8d8aab21006664736f6c634300080f0033

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.

Validator Index Block Amount
View All Withdrawals

Txn Hash Block Value Eth2 PubKey Valid
View All Deposits
[ 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.