ETH Price: $2,324.96 (-5.22%)

Contract

0x9abf798f5314BFd793A9E57A654BEd35af4A1D60

Overview

ETH Balance

0 ETH

ETH Value

$0.00

Sponsored

Transaction Hash
Method
Block
From
To
Transfer*461040662022-12-06 16:23:08667 days ago1670343788IN
0x9abf798f...5af4A1D60
0 ETH0.0000739154940.001

Latest 1 internal transaction

Advanced mode:
Parent Transaction Hash Block From To
461039852022-12-06 16:22:38667 days ago1670343758  Contract Creation0 ETH

Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
AaveParaswapFeeClaimer

Compiler Version
v0.8.16+commit.07a7930e

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 3 : AaveParaswapFeeClaimer.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import {IFeeClaimer} from '../interfaces/IFeeClaimer.sol';
import {IERC20} from '../interfaces/IERC20.sol';

/**
 * @title AaveParaswapFeeClaimer
 * @author BGD Labs
 * @dev Helper contract that allows claiming paraswap partner fee to the collector on the respective network.
 */
contract AaveParaswapFeeClaimer {
  address public aaveCollector;
  IFeeClaimer public paraswapFeeClaimer;

  /**
   * @dev initializes the collector so that the respective treasury receives the rewards
   */
  function initialize(address _aaveCollector, IFeeClaimer _paraswapFeeClaimer)
    public
  {
    require(
      address(_paraswapFeeClaimer) != address(0),
      'PARASWAP_FEE_CLAIMER_REQUIRED'
    );
    require(_aaveCollector != address(0), 'COLLECTOR_REQUIRED');
    require(aaveCollector == address(0), 'ALREADY_INITIALIZED');
    aaveCollector = _aaveCollector;
    paraswapFeeClaimer = _paraswapFeeClaimer;
  }

  /**
   * @dev returns claimable balance for a specified asset
   * @param asset The asset to fetch claimable balance of
   */
  function getClaimable(address asset) public view returns (uint256) {
    return paraswapFeeClaimer.getBalance(IERC20(asset), address(this));
  }

  /**
   * @dev returns claimable balances for specified assets
   * @param assets The assets to fetch claimable balances of
   */
  function batchGetClaimable(address[] memory assets)
    public
    view
    returns (uint256[] memory)
  {
    return paraswapFeeClaimer.batchGetBalance(assets, address(this));
  }

  /**
   * @dev withdraws a single asset to the collector
   * @notice will revert when there's nothing to claim
   * @param asset The asset to claim rewards of
   */
  function claimToCollector(IERC20 asset) external {
    paraswapFeeClaimer.withdrawAllERC20(asset, aaveCollector);
  }

  /**
   * @dev withdraws all asset to the collector
   * @notice will revert when there's nothing to claim on a single supplied asset
   * @param assets The assets to claim rewards of
   */
  function batchClaimToCollector(address[] memory assets) external {
    paraswapFeeClaimer.batchWithdrawAllERC20(assets, aaveCollector);
  }
}

File 2 of 3 : IERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
  /**
   * @dev Returns the amount of tokens in existence.
   */
  function totalSupply() external view returns (uint256);

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

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

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

  /**
   * @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);
}

File 3 of 3 : IFeeClaimer.sol
// SPDX-License-Identifier: ISC
pragma solidity ^0.8.0;

import {IERC20} from './IERC20.sol';

interface IFeeClaimer {
  /**
   * @notice register partner's, affiliate's and PP's fee
   * @dev only callable by AugustusSwapper contract
   * @param _account account address used to withdraw fees
   * @param _token token address
   * @param _fee fee amount in token
   */
  function registerFee(
    address _account,
    IERC20 _token,
    uint256 _fee
  ) external;

  /**
   * @notice claim partner share fee in ERC20 token
   * @dev transfers ERC20 token balance to the caller's account
   *      the call will fail if withdrawer have zero balance in the contract
   * @param _token address of the ERC20 token
   * @param _recipient address
   * @return true if the withdraw was successfull
   */
  function withdrawAllERC20(IERC20 _token, address _recipient)
    external
    returns (bool);

  /**
   * @notice batch claim whole balance of fee share amount
   * @dev transfers ERC20 token balance to the caller's account
   *      the call will fail if withdrawer have zero balance in the contract
   * @param _tokens list of addresses of the ERC20 token
   * @param _recipient address of recipient
   * @return true if the withdraw was successfull
   */
  function batchWithdrawAllERC20(address[] calldata _tokens, address _recipient)
    external
    returns (bool);

  /**
   * @notice claim some partner share fee in ERC20 token
   * @dev transfers ERC20 token amount to the caller's account
   *      the call will fail if withdrawer have zero balance in the contract
   * @param _token address of the ERC20 token
   * @param _recipient address
   * @return true if the withdraw was successfull
   */
  function withdrawSomeERC20(
    IERC20 _token,
    uint256 _tokenAmount,
    address _recipient
  ) external returns (bool);

  /**
   * @notice batch claim some amount of fee share in ERC20 token
   * @dev transfers ERC20 token balance to the caller's account
   *      the call will fail if withdrawer have zero balance in the contract
   * @param _tokens address of the ERC20 tokens
   * @param _tokenAmounts array of amounts
   * @param _recipient destination account addresses
   * @return true if the withdraw was successfull
   */
  function batchWithdrawSomeERC20(
    IERC20[] calldata _tokens,
    uint256[] calldata _tokenAmounts,
    address _recipient
  ) external returns (bool);

  /**
   * @notice compute unallocated fee in token
   * @param _token address of the ERC20 token
   * @return amount of unallocated token in fees
   */
  function getUnallocatedFees(IERC20 _token) external view returns (uint256);

  /**
   * @notice returns unclaimed fee amount given the token
   * @dev retrieves the balance of ERC20 token fee amount for a partner
   * @param _token address of the ERC20 token
   * @param _partner account address of the partner
   * @return amount of balance
   */
  function getBalance(IERC20 _token, address _partner)
    external
    view
    returns (uint256);

  /**
   * @notice returns unclaimed fee amount given the token in batch
   * @dev retrieves the balance of ERC20 token fee amount for a partner in batch
   * @param _tokens list of ERC20 token addresses
   * @param _partner account address of the partner
   * @return _fees array of the token amount
   */
  function batchGetBalance(address[] calldata _tokens, address _partner)
    external
    view
    returns (uint256[] memory _fees);
}

Settings
{
  "remappings": [
    "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/",
    "governance-crosschain-bridges/=lib/governance-crosschain-bridges/",
    "solidity-utils/=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":"aaveCollector","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"assets","type":"address[]"}],"name":"batchClaimToCollector","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"assets","type":"address[]"}],"name":"batchGetClaimable","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"asset","type":"address"}],"name":"claimToCollector","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"asset","type":"address"}],"name":"getClaimable","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_aaveCollector","type":"address"},{"internalType":"contract IFeeClaimer","name":"_paraswapFeeClaimer","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paraswapFeeClaimer","outputs":[{"internalType":"contract IFeeClaimer","name":"","type":"address"}],"stateMutability":"view","type":"function"}]

608060405234801561001057600080fd5b50610724806100206000396000f3fe608060405234801561001057600080fd5b506004361061007d5760003560e01c8063485cc9551161005b578063485cc955146100da57806359c7dc7a146100ed578063a583024b14610100578063ebdb0e831461012157600080fd5b806301bb0de514610082578063080dba3a146100b2578063274af2a9146100c7575b600080fd5b600154610095906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b6100c56100c0366004610425565b610141565b005b6100c56100d53660046104b4565b6101c0565b6100c56100e8366004610553565b6101f7565b600054610095906001600160a01b031681565b61011361010e366004610425565b61031a565b6040519081526020016100a9565b61013461012f3660046104b4565b610395565b6040516100a9919061058c565b6001546000546040516315c238ff60e31b81526001600160a01b038481166004830152918216602482015291169063ae11c7f8906044015b6020604051808303816000875af1158015610198573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101bc91906105d0565b5050565b6001546000546040516302efb73160e61b81526001600160a01b039283169263bbedcc4092610179928692909116906004016105f2565b6001600160a01b0381166102525760405162461bcd60e51b815260206004820152601d60248201527f50415241535741505f4645455f434c41494d45525f524551554952454400000060448201526064015b60405180910390fd5b6001600160a01b03821661029d5760405162461bcd60e51b815260206004820152601260248201527110d3d3131150d513d497d49154555254915160721b6044820152606401610249565b6000546001600160a01b0316156102ec5760405162461bcd60e51b81526020600482015260136024820152721053149150511657d253925512505312569151606a1b6044820152606401610249565b600080546001600160a01b039384166001600160a01b03199182161790915560018054929093169116179055565b60015460405163d4fac45d60e01b81526001600160a01b038381166004830152306024830152600092169063d4fac45d90604401602060405180830381865afa15801561036b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061038f919061064f565b92915050565b60015460405163b0a65b1760e01b81526060916001600160a01b03169063b0a65b17906103c890859030906004016105f2565b600060405180830381865afa1580156103e5573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261038f9190810190610668565b6001600160a01b038116811461042257600080fd5b50565b60006020828403121561043757600080fd5b81356104428161040d565b9392505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561048857610488610449565b604052919050565b600067ffffffffffffffff8211156104aa576104aa610449565b5060051b60200190565b600060208083850312156104c757600080fd5b823567ffffffffffffffff8111156104de57600080fd5b8301601f810185136104ef57600080fd5b80356105026104fd82610490565b61045f565b81815260059190911b8201830190838101908783111561052157600080fd5b928401925b828410156105485783356105398161040d565b82529284019290840190610526565b979650505050505050565b6000806040838503121561056657600080fd5b82356105718161040d565b915060208301356105818161040d565b809150509250929050565b6020808252825182820181905260009190848201906040850190845b818110156105c4578351835292840192918401916001016105a8565b50909695505050505050565b6000602082840312156105e257600080fd5b8151801515811461044257600080fd5b604080825283519082018190526000906020906060840190828701845b828110156106345781516001600160a01b03168452928401929084019060010161060f565b5050506001600160a01b039490941692019190915250919050565b60006020828403121561066157600080fd5b5051919050565b6000602080838503121561067b57600080fd5b825167ffffffffffffffff81111561069257600080fd5b8301601f810185136106a357600080fd5b80516106b16104fd82610490565b81815260059190911b820183019083810190878311156106d057600080fd5b928401925b82841015610548578351825292840192908401906106d556fea2646970667358221220088d2d4409447193f59d140db054e08f91b236cff6c8e285b44eb7dccec244e764736f6c63430008100033

Deployed Bytecode

0x608060405234801561001057600080fd5b506004361061007d5760003560e01c8063485cc9551161005b578063485cc955146100da57806359c7dc7a146100ed578063a583024b14610100578063ebdb0e831461012157600080fd5b806301bb0de514610082578063080dba3a146100b2578063274af2a9146100c7575b600080fd5b600154610095906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b6100c56100c0366004610425565b610141565b005b6100c56100d53660046104b4565b6101c0565b6100c56100e8366004610553565b6101f7565b600054610095906001600160a01b031681565b61011361010e366004610425565b61031a565b6040519081526020016100a9565b61013461012f3660046104b4565b610395565b6040516100a9919061058c565b6001546000546040516315c238ff60e31b81526001600160a01b038481166004830152918216602482015291169063ae11c7f8906044015b6020604051808303816000875af1158015610198573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101bc91906105d0565b5050565b6001546000546040516302efb73160e61b81526001600160a01b039283169263bbedcc4092610179928692909116906004016105f2565b6001600160a01b0381166102525760405162461bcd60e51b815260206004820152601d60248201527f50415241535741505f4645455f434c41494d45525f524551554952454400000060448201526064015b60405180910390fd5b6001600160a01b03821661029d5760405162461bcd60e51b815260206004820152601260248201527110d3d3131150d513d497d49154555254915160721b6044820152606401610249565b6000546001600160a01b0316156102ec5760405162461bcd60e51b81526020600482015260136024820152721053149150511657d253925512505312569151606a1b6044820152606401610249565b600080546001600160a01b039384166001600160a01b03199182161790915560018054929093169116179055565b60015460405163d4fac45d60e01b81526001600160a01b038381166004830152306024830152600092169063d4fac45d90604401602060405180830381865afa15801561036b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061038f919061064f565b92915050565b60015460405163b0a65b1760e01b81526060916001600160a01b03169063b0a65b17906103c890859030906004016105f2565b600060405180830381865afa1580156103e5573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261038f9190810190610668565b6001600160a01b038116811461042257600080fd5b50565b60006020828403121561043757600080fd5b81356104428161040d565b9392505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561048857610488610449565b604052919050565b600067ffffffffffffffff8211156104aa576104aa610449565b5060051b60200190565b600060208083850312156104c757600080fd5b823567ffffffffffffffff8111156104de57600080fd5b8301601f810185136104ef57600080fd5b80356105026104fd82610490565b61045f565b81815260059190911b8201830190838101908783111561052157600080fd5b928401925b828410156105485783356105398161040d565b82529284019290840190610526565b979650505050505050565b6000806040838503121561056657600080fd5b82356105718161040d565b915060208301356105818161040d565b809150509250929050565b6020808252825182820181905260009190848201906040850190845b818110156105c4578351835292840192918401916001016105a8565b50909695505050505050565b6000602082840312156105e257600080fd5b8151801515811461044257600080fd5b604080825283519082018190526000906020906060840190828701845b828110156106345781516001600160a01b03168452928401929084019060010161060f565b5050506001600160a01b039490941692019190915250919050565b60006020828403121561066157600080fd5b5051919050565b6000602080838503121561067b57600080fd5b825167ffffffffffffffff81111561069257600080fd5b8301601f810185136106a357600080fd5b80516106b16104fd82610490565b81815260059190911b820183019083810190878311156106d057600080fd5b928401925b82841015610548578351825292840192908401906106d556fea2646970667358221220088d2d4409447193f59d140db054e08f91b236cff6c8e285b44eb7dccec244e764736f6c63430008100033

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
[ 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.