MATIC Price: $0.592891 (-1.93%)
Gas: 30 GWei
 

Overview

MATIC Balance

Polygon PoS Chain LogoPolygon PoS Chain LogoPolygon PoS Chain Logo0 MATIC

MATIC Value

$0.00

Sponsored

Transaction Hash
Method
Block
From
To
Value
Transfer Ownersh...267336082022-04-04 12:19:39802 days ago1649074779IN
Aave: Treasury Controller V3
0 MATIC0.0010143835.47436594

Latest 1 internal transaction

Parent Transaction Hash Block From To Value
258243732022-03-11 9:03:33826 days ago1646989413  Contract Creation0 MATIC
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
CollectorController

Compiler Version
v0.8.10+commit.fc410830

Optimization Enabled:
Yes with 100000 runs

Other Settings:
default evmVersion, GNU AGPLv3 license
File 1 of 5 : CollectorController.sol
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.8.10;

import {Ownable} from '@aave/core-v3/contracts/dependencies/openzeppelin/contracts/Ownable.sol';
import {IERC20} from '@aave/core-v3/contracts/dependencies/openzeppelin/contracts/IERC20.sol';
import {ICollector} from './interfaces/ICollector.sol';

/**
 * @title CollectorController
 * @notice The CollectorController contracts allows the owner of the contract
           to approve or transfer tokens from the collector proxy contract.
           The admin of the Collector proxy can't be the same as the fundsAdmin address.
           This is needed due the usage of transparent proxy pattern.
 * @author Aave
 **/
contract CollectorController is Ownable {
  ICollector public immutable COLLECTOR;

  /**
   * @dev Constructor setups the ownership of the contract and the collector proxy
   * @param owner The address of the owner of the CollectorController
   * @param collectorProxy The address of the Collector transparent proxy
   */
  constructor(address owner, address collectorProxy) {
    transferOwnership(owner);
    COLLECTOR = ICollector(collectorProxy);
  }

  /**
   * @dev Transfer an amount of tokens to the recipient.
   * @param token The address of the asset
   * @param recipient The address of the entity to transfer the tokens.
   * @param amount The amount to be transferred.
   */
  function approve(
    IERC20 token,
    address recipient,
    uint256 amount
  ) external onlyOwner {
    COLLECTOR.approve(token, recipient, amount);
  }

  /**
   * @dev Transfer an amount of tokens to the recipient.
   * @param token The address of the asset
   * @param recipient The address of the entity to transfer the tokens.
   * @param amount The amount to be transferred.
   */
  function transfer(
    IERC20 token,
    address recipient,
    uint256 amount
  ) external onlyOwner {
    COLLECTOR.transfer(token, recipient, amount);
  }
}

File 2 of 5 : Context.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.10;

/*
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with GSN meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
  function _msgSender() internal view virtual returns (address payable) {
    return payable(msg.sender);
  }

  function _msgData() internal view virtual returns (bytes memory) {
    this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
    return msg.data;
  }
}

File 3 of 5 : IERC20.sol
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.8.10;

/**
 * @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 4 of 5 : Ownable.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.10;

import './Context.sol';

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
contract Ownable is Context {
  address private _owner;

  event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

  /**
   * @dev Initializes the contract setting the deployer as the initial owner.
   */
  constructor() {
    address msgSender = _msgSender();
    _owner = msgSender;
    emit OwnershipTransferred(address(0), msgSender);
  }

  /**
   * @dev Returns the address of the current owner.
   */
  function owner() public view returns (address) {
    return _owner;
  }

  /**
   * @dev Throws if called by any account other than the owner.
   */
  modifier onlyOwner() {
    require(_owner == _msgSender(), 'Ownable: caller is not the owner');
    _;
  }

  /**
   * @dev Leaves the contract without owner. It will not be possible to call
   * `onlyOwner` functions anymore. Can only be called by the current owner.
   *
   * NOTE: Renouncing ownership will leave the contract without an owner,
   * thereby removing any functionality that is only available to the owner.
   */
  function renounceOwnership() public virtual onlyOwner {
    emit OwnershipTransferred(_owner, address(0));
    _owner = address(0);
  }

  /**
   * @dev Transfers ownership of the contract to a new account (`newOwner`).
   * Can only be called by the current owner.
   */
  function transferOwnership(address newOwner) public virtual onlyOwner {
    require(newOwner != address(0), 'Ownable: new owner is the zero address');
    emit OwnershipTransferred(_owner, newOwner);
    _owner = newOwner;
  }
}

File 5 of 5 : ICollector.sol
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.8.10;

import {IERC20} from '@aave/core-v3/contracts/dependencies/openzeppelin/contracts/IERC20.sol';

/**
 * @title ICollector
 * @notice Defines the interface of the Collector contract
 * @author Aave
 **/
interface ICollector {
  /**
   * @dev Emitted during the transfer of ownership of the funds administrator address
   * @param fundsAdmin The new funds administrator address
   **/
  event NewFundsAdmin(address indexed fundsAdmin);

  /**
   * @dev Retrieve the current implementation Revision of the proxy
   * @return The revision version
   */
  function REVISION() external view returns (uint256);

  /**
   * @dev Retrieve the current funds administrator
   * @return The address of the funds administrator
   */
  function getFundsAdmin() external view returns (address);

  /**
   * @dev Approve an amount of tokens to be pulled by the recipient.
   * @param token The address of the asset
   * @param recipient The address of the entity allowed to pull tokens
   * @param amount The amount allowed to be pulled. If zero it will revoke the approval.
   */
  function approve(
    IERC20 token,
    address recipient,
    uint256 amount
  ) external;

  /**
   * @dev Transfer an amount of tokens to the recipient.
   * @param token The address of the asset
   * @param recipient The address of the entity to transfer the tokens.
   * @param amount The amount to be transferred.
   */
  function transfer(
    IERC20 token,
    address recipient,
    uint256 amount
  ) external;

  /**
   * @dev Transfer the ownership of the funds administrator role.
          This function should only be callable by the current funds administrator.
   * @param admin The address of the new funds administrator
   */
  function setFundsAdmin(address admin) external;
}

Settings
{
  "evmVersion": "berlin",
  "libraries": {},
  "metadata": {
    "bytecodeHash": "ipfs",
    "useLiteralContent": true
  },
  "optimizer": {
    "enabled": true,
    "runs": 100000
  },
  "remappings": [],
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  }
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"collectorProxy","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"COLLECTOR","outputs":[{"internalType":"contract ICollector","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60a060405234801561001057600080fd5b506040516108e63803806108e683398101604081905261002f916101a2565b600080546001600160a01b031916339081178255604051909182916000805160206108c6833981519152908290a35061006782610079565b6001600160a01b0316608052506101d5565b6000546001600160a01b031633146100d85760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b6001600160a01b03811661013d5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016100cf565b600080546040516001600160a01b03808516939216916000805160206108c683398151915291a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b80516001600160a01b038116811461019d57600080fd5b919050565b600080604083850312156101b557600080fd5b6101be83610186565b91506101cc60208401610186565b90509250929050565b6080516106c96101fd60003960008181607c015281816102f2015261042901526106c96000f3fe608060405234801561001057600080fd5b50600436106100725760003560e01c8063beabacc811610050578063beabacc8146100ef578063e1f21c6714610102578063f2fde38b1461011557600080fd5b80633cbadf7814610077578063715018a6146100c75780638da5cb5b146100d1575b600080fd5b61009e7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b6100cf610128565b005b60005473ffffffffffffffffffffffffffffffffffffffff1661009e565b6100cf6100fd36600461062e565b61021d565b6100cf61011036600461062e565b610354565b6100cf61012336600461066f565b610458565b60005473ffffffffffffffffffffffffffffffffffffffff1633146101ae576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b6000805460405173ffffffffffffffffffffffffffffffffffffffff909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055565b60005473ffffffffffffffffffffffffffffffffffffffff16331461029e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016101a5565b6040517fbeabacc800000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff84811660048301528381166024830152604482018390527f0000000000000000000000000000000000000000000000000000000000000000169063beabacc8906064015b600060405180830381600087803b15801561033757600080fd5b505af115801561034b573d6000803e3d6000fd5b50505050505050565b60005473ffffffffffffffffffffffffffffffffffffffff1633146103d5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016101a5565b6040517fe1f21c6700000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff84811660048301528381166024830152604482018390527f0000000000000000000000000000000000000000000000000000000000000000169063e1f21c679060640161031d565b60005473ffffffffffffffffffffffffffffffffffffffff1633146104d9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016101a5565b73ffffffffffffffffffffffffffffffffffffffff811661057c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084016101a5565b6000805460405173ffffffffffffffffffffffffffffffffffffffff808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b73ffffffffffffffffffffffffffffffffffffffff8116811461062b57600080fd5b50565b60008060006060848603121561064357600080fd5b833561064e81610609565b9250602084013561065e81610609565b929592945050506040919091013590565b60006020828403121561068157600080fd5b813561068c81610609565b939250505056fea2646970667358221220f96bbee5b7b60295e745d1464386088aa3626a444481d32220ef3901d502ac3b64736f6c634300080a00338be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e000000000000000000000000092392382203ec3ed086963350d617f9a376be430000000000000000000000000e8599f3cc5d38a9ad6f3684cd5cea72f10dbc383

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106100725760003560e01c8063beabacc811610050578063beabacc8146100ef578063e1f21c6714610102578063f2fde38b1461011557600080fd5b80633cbadf7814610077578063715018a6146100c75780638da5cb5b146100d1575b600080fd5b61009e7f000000000000000000000000e8599f3cc5d38a9ad6f3684cd5cea72f10dbc38381565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b6100cf610128565b005b60005473ffffffffffffffffffffffffffffffffffffffff1661009e565b6100cf6100fd36600461062e565b61021d565b6100cf61011036600461062e565b610354565b6100cf61012336600461066f565b610458565b60005473ffffffffffffffffffffffffffffffffffffffff1633146101ae576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b6000805460405173ffffffffffffffffffffffffffffffffffffffff909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055565b60005473ffffffffffffffffffffffffffffffffffffffff16331461029e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016101a5565b6040517fbeabacc800000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff84811660048301528381166024830152604482018390527f000000000000000000000000e8599f3cc5d38a9ad6f3684cd5cea72f10dbc383169063beabacc8906064015b600060405180830381600087803b15801561033757600080fd5b505af115801561034b573d6000803e3d6000fd5b50505050505050565b60005473ffffffffffffffffffffffffffffffffffffffff1633146103d5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016101a5565b6040517fe1f21c6700000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff84811660048301528381166024830152604482018390527f000000000000000000000000e8599f3cc5d38a9ad6f3684cd5cea72f10dbc383169063e1f21c679060640161031d565b60005473ffffffffffffffffffffffffffffffffffffffff1633146104d9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016101a5565b73ffffffffffffffffffffffffffffffffffffffff811661057c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084016101a5565b6000805460405173ffffffffffffffffffffffffffffffffffffffff808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b73ffffffffffffffffffffffffffffffffffffffff8116811461062b57600080fd5b50565b60008060006060848603121561064357600080fd5b833561064e81610609565b9250602084013561065e81610609565b929592945050506040919091013590565b60006020828403121561068157600080fd5b813561068c81610609565b939250505056fea2646970667358221220f96bbee5b7b60295e745d1464386088aa3626a444481d32220ef3901d502ac3b64736f6c634300080a0033

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

00000000000000000000000092392382203ec3ed086963350d617f9a376be430000000000000000000000000e8599f3cc5d38a9ad6f3684cd5cea72f10dbc383

-----Decoded View---------------
Arg [0] : owner (address): 0x92392382203ec3Ed086963350d617F9A376bE430
Arg [1] : collectorProxy (address): 0xe8599F3cc5D38a9aD6F3684cd5CEa72f10Dbc383

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 00000000000000000000000092392382203ec3ed086963350d617f9a376be430
Arg [1] : 000000000000000000000000e8599f3cc5d38a9ad6f3684cd5cea72f10dbc383


Block Transaction Gas Used Reward
view all blocks produced

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