Contract 0xccf14215e0134d6709c7dd7fa172cec40e97bfb1

 
 
Txn Hash Method
Block
From
To
Value [Txn Fee]
0x570dfd4da710340a19e337b8863f9cbb969be06e1a3c0b7f31f686725b7b196d0x60806040327181182022-09-05 10:25:4494 days 16 hrs ago0xdc6d052700a2bb1f45852a65acb61c194ef09b61 IN  Create: PolygonProposalPayload0 MATIC0.018821656
[ Download CSV Export 
Parent Txn Hash Block From To Value
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
PolygonProposalPayload

Compiler Version
v0.8.10+commit.fc410830

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 5 : PolygonProposalPayload.sol
// SPDX-License-Identifier: AGPL-3.0
pragma solidity 0.8.10;

import {IERC20} from './interfaces/IERC20.sol';
import {ICollectorController} from './interfaces/ICollectorController.sol';
import {IInitializableAdminUpgradeabilityProxy} from './interfaces/IInitializableAdminUpgradeabilityProxy.sol';
import {IProposalGenericExecutor} from './IProposalGenericExecutor.sol';

contract PolygonProposalPayload is IProposalGenericExecutor {
  address public constant AAVE_COMPANIES_ADDRESS = 0x48B9e6E865eBff2B76d9a85c10b7FA6772607F0b;

  ICollectorController public constant CONTROLLER_OF_COLLECTOR =
    ICollectorController(0xDB89487A449274478e984665b8692AfC67459deF);

  address public constant COLLECTOR_ADDRESS = 0x7734280A4337F37Fbf4651073Db7c28C80B339e9;
  address public constant COLLECTOR_ADDRESS_V3 = 0xe8599F3cc5D38a9aD6F3684cd5CEa72f10Dbc383;
  address public constant COLLECTOR_IMPLEMENTATION_ADDRESS =
    0xC773bf5a987b29DdEAC77cf1D48a22a4Ce5B0577;

  function execute() external override {
    // 1. Upgrade of Collector V2 and V3
    bytes memory initData = abi.encodeWithSignature('initialize(address)', CONTROLLER_OF_COLLECTOR);
    IInitializableAdminUpgradeabilityProxy(COLLECTOR_ADDRESS).upgradeToAndCall(
      COLLECTOR_IMPLEMENTATION_ADDRESS,
      initData
    );
    IInitializableAdminUpgradeabilityProxy(COLLECTOR_ADDRESS_V3).upgradeToAndCall(
      COLLECTOR_IMPLEMENTATION_ADDRESS,
      initData
    );

    // 2. Transfer Collector assets
    address[2] memory ASSETS_V2 = [
      0x8dF3aad3a84da6b69A4DA8aeC3eA40d9091B2Ac4, // amWMATIC
      0x5c2ed810328349100A66B82b78a1791B101C9D61 // amWBTC
    ];
    uint256[] memory ASSETS_V2_AMOUNTS = new uint256[](2);
    ASSETS_V2_AMOUNTS[0] = 850000000000000000000000; // 850000.000000000000000000 amWMATIC
    ASSETS_V2_AMOUNTS[1] = 1665609037; // 16.65609037 amWBTC

    for (uint256 i = 0; i < ASSETS_V2.length; i++) {
      CONTROLLER_OF_COLLECTOR.transfer(
        COLLECTOR_ADDRESS,
        IERC20(ASSETS_V2[i]),
        AAVE_COMPANIES_ADDRESS,
        ASSETS_V2_AMOUNTS[i]
      );
    }

    emit ProposalExecuted();
  }
}

File 2 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 3 of 5 : ICollectorController.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

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

interface ICollectorController {
  /**
   * @dev Transfer an amount of tokens to the recipient.
   * @param collector The address of the collector contract to retrieve funds from (e.g. Aave ecosystem reserve)
   * @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(
    address collector,
    IERC20 token,
    address recipient,
    uint256 amount
  ) external;
}

File 4 of 5 : IInitializableAdminUpgradeabilityProxy.sol
// SPDX-License-Identifier: AGPL-3.0
pragma solidity ^0.8.0;

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

  function upgradeTo(address newImplementation) external payable;

  function admin() external returns (address);

  function implementation() external returns (address);

  function changeAdmin(address newAdmin) external;
}

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

interface IProposalGenericExecutor {
  function execute() external;

  event ProposalExecuted();
}

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

Contract Security Audit

Contract ABI

[{"anonymous":false,"inputs":[],"name":"ProposalExecuted","type":"event"},{"inputs":[],"name":"AAVE_COMPANIES_ADDRESS","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"COLLECTOR_ADDRESS","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"COLLECTOR_ADDRESS_V3","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"COLLECTOR_IMPLEMENTATION_ADDRESS","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"CONTROLLER_OF_COLLECTOR","outputs":[{"internalType":"contract ICollectorController","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"execute","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405234801561001057600080fd5b5061051e806100206000396000f3fe608060405234801561001057600080fd5b50600436106100625760003560e01c806312394446146100675780632580faca1461009e57806351e615ff146100b957806361461954146100d45780636c0722da146100de578063aef8b6ab146100f9575b600080fd5b61008273c773bf5a987b29ddeac77cf1d48a22a4ce5b057781565b6040516001600160a01b03909116815260200160405180910390f35b61008273e8599f3cc5d38a9ad6f3684cd5cea72f10dbc38381565b6100827348b9e6e865ebff2b76d9a85c10b7fa6772607f0b81565b6100dc610114565b005b61008273db89487a449274478e984665b8692afc67459def81565b610082737734280a4337f37fbf4651073db7c28c80b339e981565b60405173db89487a449274478e984665b8692afc67459def602482015260009060440160408051601f198184030181529181526020820180516001600160e01b031663189acdbd60e31b1790525163278f794360e11b8152909150737734280a4337f37fbf4651073db7c28c80b339e990634f1ef286906101af9073c773bf5a987b29ddeac77cf1d48a22a4ce5b0577908590600401610444565b600060405180830381600087803b1580156101c957600080fd5b505af11580156101dd573d6000803e3d6000fd5b505060405163278f794360e11b815273e8599f3cc5d38a9ad6f3684cd5cea72f10dbc3839250634f1ef286915061022e9073c773bf5a987b29ddeac77cf1d48a22a4ce5b0577908590600401610444565b600060405180830381600087803b15801561024857600080fd5b505af115801561025c573d6000803e3d6000fd5b5050604080518082018252738df3aad3a84da6b69a4da8aec3ea40d9091b2ac48152735c2ed810328349100a66b82b78a1791b101c9d6160208201528151600280825260608201909352909350600092509081602001602082028036833701905050905069b3fe97a2fafd2f400000816000815181106102de576102de6104a9565b6020026020010181815250506363472d4d81600181518110610302576103026104a9565b60200260200101818152505060005b60028110156104155773db89487a449274478e984665b8692afc67459def63f18d03cc737734280a4337f37fbf4651073db7c28c80b339e985846002811061035b5761035b6104a9565b60200201517348b9e6e865ebff2b76d9a85c10b7fa6772607f0b868681518110610387576103876104a9565b60209081029190910101516040516001600160e01b031960e087901b1681526001600160a01b0394851660048201529284166024840152921660448201526064810191909152608401600060405180830381600087803b1580156103ea57600080fd5b505af11580156103fe573d6000803e3d6000fd5b50505050808061040d906104bf565b915050610311565b506040517fcf88c657fb0ecbed2a624b6b4c626e2ceda32ea9ed16ea81de6362a6d965bd0890600090a1505050565b60018060a01b038316815260006020604081840152835180604085015260005b8181101561048057858101830151858201606001528201610464565b81811115610492576000606083870101525b50601f01601f191692909201606001949350505050565b634e487b7160e01b600052603260045260246000fd5b60006000198214156104e157634e487b7160e01b600052601160045260246000fd5b506001019056fea2646970667358221220ad26e04968d7868f07b3fda61870a80713ef2111acf5313e5448ed6dbd4f30f364736f6c634300080a0033

Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.