MATIC Price: $0.91 (-1.26%)
Gas: 70 Gwei
 

Overview

MATIC Balance

Polygon PoS Chain LogoPolygon PoS Chain LogoPolygon PoS Chain Logo0 MATIC

MATIC Value

$0.00

Multi Chain

Multichain Addresses

Transaction Hash
Method
Block
From
To
Value
0x61012060411707012023-04-05 11:35:30248 days 19 hrs ago1680694530IN
 Create: UpgradeAaveCollectorPayload
0 MATIC0.03939249151.42400204

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

Contract Source Code Verified (Exact Match)

Contract Name:
UpgradeAaveCollectorPayload

Compiler Version
v0.8.17+commit.8df45f5f

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 2 of 4 : UpgradeAaveCollectorPayload.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import {IInitializableAdminUpgradeabilityProxy} from '../../interfaces/IInitializableAdminUpgradeabilityProxy.sol';
import {ICollector} from '../../interfaces/ICollector.sol';

contract UpgradeAaveCollectorPayload {
  // v3 collector proxy address
  IInitializableAdminUpgradeabilityProxy public immutable COLLECTOR_PROXY;

  // new collector impl
  address public immutable COLLECTOR;

  // short executor or guardian address
  address public immutable NEW_FUNDS_ADMIN;

  // proxy admin
  address public immutable PROXY_ADMIN;

  // streamId
  uint256 public immutable STREAM_ID;

  constructor(
    address proxy,
    address collector,
    address proxyAdmin,
    address newFundsAdmin,
    uint256 streamId
  ) {
    COLLECTOR_PROXY = IInitializableAdminUpgradeabilityProxy(proxy);
    COLLECTOR = collector;
    PROXY_ADMIN = proxyAdmin;
    NEW_FUNDS_ADMIN = newFundsAdmin;
    STREAM_ID = streamId;
  }

  function execute() external {
    // Upgrade of collector implementation
    COLLECTOR_PROXY.upgradeToAndCall(
      address(COLLECTOR),
      abi.encodeWithSelector(ICollector.initialize.selector, NEW_FUNDS_ADMIN, STREAM_ID)
    );

    // Update proxy admin
    COLLECTOR_PROXY.changeAdmin(PROXY_ADMIN);
  }
}

File 2 of 4 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)
// From commit https://github.com/OpenZeppelin/openzeppelin-contracts/commit/a035b235b4f2c9af4ba88edc4447f02e37f8d124

pragma solidity ^0.8.0;

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

File 3 of 4 : ICollector.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import {IERC20} from 'solidity-utils/contracts/oz-common/interfaces/IERC20.sol';

interface ICollector {
  struct Stream {
    uint256 deposit;
    uint256 ratePerSecond;
    uint256 remainingBalance;
    uint256 startTime;
    uint256 stopTime;
    address recipient;
    address sender;
    address tokenAddress;
    bool isEntity;
  }

  /** @notice Emitted when the funds admin changes
   * @param fundsAdmin The new funds admin.
   **/
  event NewFundsAdmin(address indexed fundsAdmin);

  /** @notice Emitted when the new stream is created
   * @param streamId The identifier of the stream.
   * @param sender The address of the collector.
   * @param recipient The address towards which the money is streamed.
   * @param deposit The amount of money to be streamed.
   * @param tokenAddress The ERC20 token to use as streaming currency.
   * @param startTime The unix timestamp for when the stream starts.
   * @param stopTime The unix timestamp for when the stream stops.
   **/
  event CreateStream(
    uint256 indexed streamId,
    address indexed sender,
    address indexed recipient,
    uint256 deposit,
    address tokenAddress,
    uint256 startTime,
    uint256 stopTime
  );

  /**
   * @notice Emmitted when withdraw happens from the contract to the recipient's account.
   * @param streamId The id of the stream to withdraw tokens from.
   * @param recipient The address towards which the money is streamed.
   * @param amount The amount of tokens to withdraw.
   */
  event WithdrawFromStream(uint256 indexed streamId, address indexed recipient, uint256 amount);

  /**
   * @notice Emmitted when the stream is canceled.
   * @param streamId The id of the stream to withdraw tokens from.
   * @param sender The address of the collector.
   * @param recipient The address towards which the money is streamed.
   * @param senderBalance The sender's balance at the moment of cancelling.
   * @param recipientBalance The recipient's balance at the moment of cancelling.
   */
  event CancelStream(
    uint256 indexed streamId,
    address indexed sender,
    address indexed recipient,
    uint256 senderBalance,
    uint256 recipientBalance
  );

  /** @notice Returns the mock ETH reference address
   * @return address The address
   **/
  function ETH_MOCK_ADDRESS() external pure returns (address);

  /** @notice Initializes the contracts
   * @param fundsAdmin Funds admin address
   * @param nextStreamId StreamId to set, applied if greater than 0
   **/
  function initialize(address fundsAdmin, uint256 nextStreamId) external;

  /**
   * @notice Return the funds admin, only entity to be able to interact with this contract (controller of reserve)
   * @return address The address of the funds admin
   **/
  function getFundsAdmin() external view returns (address);

  /**
   * @notice Returns the available funds for the given stream id and address.
   * @param streamId The id of the stream for which to query the balance.
   * @param who The address for which to query the balance.
   * @notice Returns the total funds allocated to `who` as uint256.
   */
  function balanceOf(uint256 streamId, address who) external view returns (uint256 balance);

  /**
   * @dev Function for the funds admin to give ERC20 allowance to other parties
   * @param token The address of the token to give allowance from
   * @param recipient Allowance's recipient
   * @param amount Allowance to approve
   **/
  function approve(IERC20 token, address recipient, uint256 amount) external;

  /**
   * @notice Function for the funds admin to transfer ERC20 tokens to other parties
   * @param token The address of the token to transfer
   * @param recipient Transfer's recipient
   * @param amount Amount to transfer
   **/
  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;

  /**
   * @notice Creates a new stream funded by this contracts itself and paid towards `recipient`.
   * @param recipient The address towards which the money is streamed.
   * @param deposit The amount of money to be streamed.
   * @param tokenAddress The ERC20 token to use as streaming currency.
   * @param startTime The unix timestamp for when the stream starts.
   * @param stopTime The unix timestamp for when the stream stops.
   * @return streamId the uint256 id of the newly created stream.
   */
  function createStream(
    address recipient,
    uint256 deposit,
    address tokenAddress,
    uint256 startTime,
    uint256 stopTime
  ) external returns (uint256 streamId);

  /**
   * @notice Returns the stream with all its properties.
   * @dev Throws if the id does not point to a valid stream.
   * @param streamId The id of the stream to query.
   * @notice Returns the stream object.
   */
  function getStream(
    uint256 streamId
  )
    external
    view
    returns (
      address sender,
      address recipient,
      uint256 deposit,
      address tokenAddress,
      uint256 startTime,
      uint256 stopTime,
      uint256 remainingBalance,
      uint256 ratePerSecond
    );

  /**
   * @notice Withdraws from the contract to the recipient's account.
   * @param streamId The id of the stream to withdraw tokens from.
   * @param amount The amount of tokens to withdraw.
   * @return bool Returns true if successful.
   */
  function withdrawFromStream(uint256 streamId, uint256 amount) external returns (bool);

  /**
   * @notice Cancels the stream and transfers the tokens back on a pro rata basis.
   * @param streamId The id of the stream to cancel.
   * @return bool Returns true if successful.
   */
  function cancelStream(uint256 streamId) external returns (bool);

  /**
   * @notice Returns the next available stream id
   * @return nextStreamId Returns the stream id.
   */
  function getNextStreamId() external view returns (uint256);
}

File 4 of 4 : IInitializableAdminUpgradeabilityProxy.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0;

interface IInitializableAdminUpgradeabilityProxy {
  function upgradeTo(address newImplementation) external;

  function upgradeToAndCall(address newImplementation, bytes calldata data) external payable;

  function admin() external returns (address);

  function changeAdmin(address newAdmin) external;

  function implementation() external returns (address);
}

Settings
{
  "remappings": [
    "@aave/core-v2/=lib/protocol-v2/",
    "@aave/core-v3/=lib/aave-address-book/lib/aave-v3-core/",
    "@aave/periphery-v3/=lib/aave-address-book/lib/aave-v3-periphery/",
    "aave-address-book/=lib/aave-address-book/src/",
    "aave-helpers/=lib/aave-helpers/src/",
    "aave-v3-core/=lib/aave-address-book/lib/aave-v3-core/",
    "aave-v3-periphery/=lib/aave-address-book/lib/aave-v3-periphery/",
    "ds-test/=lib/forge-std/lib/ds-test/src/",
    "forge-std/=lib/forge-std/src/",
    "protocol-v2/=lib/protocol-v2/",
    "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":[{"internalType":"address","name":"proxy","type":"address"},{"internalType":"address","name":"collector","type":"address"},{"internalType":"address","name":"proxyAdmin","type":"address"},{"internalType":"address","name":"newFundsAdmin","type":"address"},{"internalType":"uint256","name":"streamId","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"COLLECTOR","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"COLLECTOR_PROXY","outputs":[{"internalType":"contract IInitializableAdminUpgradeabilityProxy","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"NEW_FUNDS_ADMIN","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PROXY_ADMIN","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"STREAM_ID","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"execute","outputs":[],"stateMutability":"nonpayable","type":"function"}]

61012060405234801561001157600080fd5b506040516104f03803806104f083398101604081905261003091610075565b6001600160a01b0394851660805292841660a05290831660e05290911660c052610100526100d3565b80516001600160a01b038116811461007057600080fd5b919050565b600080600080600060a0868803121561008d57600080fd5b61009686610059565b94506100a460208701610059565b93506100b260408701610059565b92506100c060608701610059565b9150608086015190509295509295909350565b60805160a05160c05160e051610100516103b261013e6000396000818160b0015261019601526000818161013d015261029601526000818160ef0152610165015260008181606c0152610226015260008181610116015281816101f701526102be01526103b26000f3fe608060405234801561001057600080fd5b50600436106100625760003560e01c80633cbadf78146100675780634831b98d146100ab57806361461954146100e0578063afeb8e02146100ea578063b471e33714610111578063ed9bc82a14610138575b600080fd5b61008e7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020015b60405180910390f35b6100d27f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020016100a2565b6100e861015f565b005b61008e7f000000000000000000000000000000000000000000000000000000000000000081565b61008e7f000000000000000000000000000000000000000000000000000000000000000081565b61008e7f000000000000000000000000000000000000000000000000000000000000000081565b604080517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811660248301527f000000000000000000000000000000000000000000000000000000000000000060448084019190915283518084039091018152606490920183526020820180516001600160e01b031663cd6dc68760e01b179052915163278f794360e11b81527f000000000000000000000000000000000000000000000000000000000000000090921691634f1ef2869161024f917f0000000000000000000000000000000000000000000000000000000000000000919060040161031e565b600060405180830381600087803b15801561026957600080fd5b505af115801561027d573d6000803e3d6000fd5b50506040516308f2839760e41b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000811660048301527f0000000000000000000000000000000000000000000000000000000000000000169250638f2839709150602401600060405180830381600087803b15801561030457600080fd5b505af1158015610318573d6000803e3d6000fd5b50505050565b60018060a01b038316815260006020604081840152835180604085015260005b8181101561035a5785810183015185820160600152820161033e565b506000606082860101526060601f19601f83011685010192505050939250505056fea2646970667358221220a9812febc78aeacd5a4221a8bee956c2c99f77c25c0c0c0659158f7db245764364736f6c63430008110033000000000000000000000000e8599f3cc5d38a9ad6f3684cd5cea72f10dbc383000000000000000000000000230e0321cf38f09e247e50afc7801ea2351fe56f000000000000000000000000d3cf979e676265e4f6379749dece4708b9a22476000000000000000000000000dc9a35b16db4e126cfedc41322b3a36454b1f77200000000000000000000000000000000000000000000000000000000000186a0

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106100625760003560e01c80633cbadf78146100675780634831b98d146100ab57806361461954146100e0578063afeb8e02146100ea578063b471e33714610111578063ed9bc82a14610138575b600080fd5b61008e7f000000000000000000000000230e0321cf38f09e247e50afc7801ea2351fe56f81565b6040516001600160a01b0390911681526020015b60405180910390f35b6100d27f00000000000000000000000000000000000000000000000000000000000186a081565b6040519081526020016100a2565b6100e861015f565b005b61008e7f000000000000000000000000dc9a35b16db4e126cfedc41322b3a36454b1f77281565b61008e7f000000000000000000000000e8599f3cc5d38a9ad6f3684cd5cea72f10dbc38381565b61008e7f000000000000000000000000d3cf979e676265e4f6379749dece4708b9a2247681565b604080517f000000000000000000000000dc9a35b16db4e126cfedc41322b3a36454b1f7726001600160a01b0390811660248301527f00000000000000000000000000000000000000000000000000000000000186a060448084019190915283518084039091018152606490920183526020820180516001600160e01b031663cd6dc68760e01b179052915163278f794360e11b81527f000000000000000000000000e8599f3cc5d38a9ad6f3684cd5cea72f10dbc38390921691634f1ef2869161024f917f000000000000000000000000230e0321cf38f09e247e50afc7801ea2351fe56f919060040161031e565b600060405180830381600087803b15801561026957600080fd5b505af115801561027d573d6000803e3d6000fd5b50506040516308f2839760e41b81526001600160a01b037f000000000000000000000000d3cf979e676265e4f6379749dece4708b9a22476811660048301527f000000000000000000000000e8599f3cc5d38a9ad6f3684cd5cea72f10dbc383169250638f2839709150602401600060405180830381600087803b15801561030457600080fd5b505af1158015610318573d6000803e3d6000fd5b50505050565b60018060a01b038316815260006020604081840152835180604085015260005b8181101561035a5785810183015185820160600152820161033e565b506000606082860101526060601f19601f83011685010192505050939250505056fea2646970667358221220a9812febc78aeacd5a4221a8bee956c2c99f77c25c0c0c0659158f7db245764364736f6c63430008110033

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

000000000000000000000000e8599f3cc5d38a9ad6f3684cd5cea72f10dbc383000000000000000000000000230e0321cf38f09e247e50afc7801ea2351fe56f000000000000000000000000d3cf979e676265e4f6379749dece4708b9a22476000000000000000000000000dc9a35b16db4e126cfedc41322b3a36454b1f77200000000000000000000000000000000000000000000000000000000000186a0

-----Decoded View---------------
Arg [0] : proxy (address): 0xe8599F3cc5D38a9aD6F3684cd5CEa72f10Dbc383
Arg [1] : collector (address): 0x230E0321Cf38F09e247e50Afc7801EA2351fe56F
Arg [2] : proxyAdmin (address): 0xD3cF979e676265e4f6379749DECe4708B9A22476
Arg [3] : newFundsAdmin (address): 0xdc9A35B16DB4e126cFeDC41322b3a36454B1F772
Arg [4] : streamId (uint256): 100000

-----Encoded View---------------
5 Constructor Arguments found :
Arg [0] : 000000000000000000000000e8599f3cc5d38a9ad6f3684cd5cea72f10dbc383
Arg [1] : 000000000000000000000000230e0321cf38f09e247e50afc7801ea2351fe56f
Arg [2] : 000000000000000000000000d3cf979e676265e4f6379749dece4708b9a22476
Arg [3] : 000000000000000000000000dc9a35b16db4e126cfedc41322b3a36454b1f772
Arg [4] : 00000000000000000000000000000000000000000000000000000000000186a0


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.