creation_sourcecode: {{
    "language": "Solidity",
    "sources": {
      "contracts/payloads/IGP19/PayloadIGP19.sol": {
        "content": "pragma solidity ^0.7.0;\npragma experimental ABIEncoderV2;\n\ninterface IGovernorBravo {\n    function _acceptAdmin() external;\n\n    function _setVotingDelay(uint newVotingDelay) external;\n\n    function _setVotingPeriod(uint newVotingPeriod) external;\n\n    function _acceptAdminOnTimelock() external;\n\n    function _setImplementation(address implementation_) external;\n\n    function propose(\n        address[] memory targets,\n        uint[] memory values,\n        string[] memory signatures,\n        bytes[] memory calldatas,\n        string memory description\n    ) external returns (uint);\n\n    function admin() external view returns (address);\n\n    function pendingAdmin() external view returns (address);\n\n    function timelock() external view returns (address);\n\n    function votingDelay() external view returns (uint256);\n\n    function votingPeriod() external view returns (uint256);\n}\n\ninterface ITimelock {\n    function acceptAdmin() external;\n\n    function setDelay(uint delay_) external;\n\n    function setPendingAdmin(address pendingAdmin_) external;\n\n    function queueTransaction(\n        address target,\n        uint value,\n        string memory signature,\n        bytes memory data,\n        uint eta\n    ) external returns (bytes32);\n\n    function executeTransaction(\n        address target,\n        uint value,\n        string memory signature,\n        bytes memory data,\n        uint eta\n    ) external payable returns (bytes memory);\n\n    function pendingAdmin() external view returns (address);\n\n    function admin() external view returns (address);\n\n    function delay() external view returns (uint256);\n}\n\ninterface AdminModuleStructs {\n    struct AddressBool {\n        address addr;\n        bool value;\n    }\n\n    struct AddressUint256 {\n        address addr;\n        uint256 value;\n    }\n\n    struct RateDataV1Params {\n        address token;\n        uint256 kink;\n        uint256 rateAtUtilizationZero;\n        uint256 rateAtUtilizationKink;\n        uint256 rateAtUtilizationMax;\n    }\n\n    struct RateDataV2Params {\n        address token;\n        uint256 kink1;\n        uint256 kink2;\n        uint256 rateAtUtilizationZero;\n        uint256 rateAtUtilizationKink1;\n        uint256 rateAtUtilizationKink2;\n        uint256 rateAtUtilizationMax;\n    }\n\n    struct TokenConfig {\n        address token;\n        uint256 fee;\n        uint256 threshold;\n    }\n\n    struct UserSupplyConfig {\n        address user;\n        address token;\n        uint8 mode;\n        uint256 expandPercent;\n        uint256 expandDuration;\n        uint256 baseWithdrawalLimit;\n    }\n\n    struct UserBorrowConfig {\n        address user;\n        address token;\n        uint8 mode;\n        uint256 expandPercent;\n        uint256 expandDuration;\n        uint256 baseDebtCeiling;\n        uint256 maxDebtCeiling;\n    }\n}\n\ninterface IProxy {\n    function setAdmin(address newAdmin_) external;\n\n    function setDummyImplementation(address newDummyImplementation_) external;\n\n    function addImplementation(address implementation_, bytes4[] calldata sigs_) external;\n\n    function removeImplementation(address implementation_) external;\n\n    function getAdmin() external view returns (address);\n\n    function getDummyImplementation() external view returns (address);\n\n    function getImplementationSigs(address impl_) external view returns (bytes4[] memory);\n\n    function getSigsImplementation(bytes4 sig_) external view returns (address);\n\n    function readFromStorage(bytes32 slot_) external view returns (uint256 result_);\n}\n\ninterface IFluidLiquidityAdmin {\n    /// @notice adds/removes auths. Auths generally could be contracts which can have restricted actions defined on contract.\n    ///         auths can be helpful in reducing governance overhead where it's not needed.\n    /// @param authsStatus_ array of structs setting allowed status for an address.\n    ///                     status true => add auth, false => remove auth\n    function updateAuths(\n        AdminModuleStructs.AddressBool[] calldata authsStatus_\n    ) external;\n\n    /// @notice adds/removes guardians. Only callable by Governance.\n    /// @param guardiansStatus_ array of structs setting allowed status for an address.\n    ///                         status true => add guardian, false => remove guardian\n    function updateGuardians(\n        AdminModuleStructs.AddressBool[] calldata guardiansStatus_\n    ) external;\n\n    /// @notice changes the revenue collector address (contract that is sent revenue). Only callable by Governance.\n    /// @param revenueCollector_  new revenue collector address\n    function updateRevenueCollector(address revenueCollector_) external;\n\n    /// @notice changes current status, e.g. for pausing or unpausing all user operations. Only callable by Auths.\n    /// @param newStatus_ new status\n    ///        status = 2 -> pause, status = 1 -> resume.\n    function changeStatus(uint256 newStatus_) external;\n\n    /// @notice                  update tokens rate data version 1. Only callable by Auths.\n    /// @param tokensRateData_   array of RateDataV1Params with rate data to set for each token\n    function updateRateDataV1s(\n        AdminModuleStructs.RateDataV1Params[] calldata tokensRateData_\n    ) external;\n\n    /// @notice                  update tokens rate data version 2. Only callable by Auths.\n    /// @param tokensRateData_   array of RateDataV2Params with rate data to set for each token\n    function updateRateDataV2s(\n        AdminModuleStructs.RateDataV2Params[] calldata tokensRateData_\n    ) external;\n\n    /// @notice updates token configs: fee charge on borrowers interest & storage update utilization threshold.\n    ///         Only callable by Auths.\n    /// @param tokenConfigs_ contains token address, fee & utilization threshold\n    function updateTokenConfigs(\n        AdminModuleStructs.TokenConfig[] calldata tokenConfigs_\n    ) external;\n\n    /// @notice updates user classes: 0 is for new protocols, 1 is for established protocols.\n    ///         Only callable by Auths.\n    /// @param userClasses_ struct array of uint256 value to assign for each user address\n    function updateUserClasses(\n        AdminModuleStructs.AddressUint256[] calldata userClasses_\n    ) external;\n\n    /// @notice sets user supply configs per token basis. Eg: with interest or interest-free and automated limits.\n    ///         Only callable by Auths.\n    /// @param userSupplyConfigs_ struct array containing user supply config, see `UserSupplyConfig` struct for more info\n    function updateUserSupplyConfigs(\n        AdminModuleStructs.UserSupplyConfig[] memory userSupplyConfigs_\n    ) external;\n\n    /// @notice setting user borrow configs per token basis. Eg: with interest or interest-free and automated limits.\n    ///         Only callable by Auths.\n    /// @param userBorrowConfigs_ struct array containing user borrow config, see `UserBorrowConfig` struct for more info\n    function updateUserBorrowConfigs(\n        AdminModuleStructs.UserBorrowConfig[] memory userBorrowConfigs_\n    ) external;\n\n    /// @notice pause operations for a particular user in class 0 (class 1 users can't be paused by guardians).\n    /// Only callable by Guardians.\n    /// @param user_          address of user to pause operations for\n    /// @param supplyTokens_  token addresses to pause withdrawals for\n    /// @param borrowTokens_  token addresses to pause borrowings for\n    function pauseUser(\n        address user_,\n        address[] calldata supplyTokens_,\n        address[] calldata borrowTokens_\n    ) external;\n\n    /// @notice unpause operations for a particular user in class 0 (class 1 users can't be paused by guardians).\n    /// Only callable by Guardians.\n    /// @param user_          address of user to unpause operations for\n    /// @param supplyTokens_  token addresses to unpause withdrawals for\n    /// @param borrowTokens_  token addresses to unpause borrowings for\n    function unpauseUser(\n        address user_,\n        address[] calldata supplyTokens_,\n        address[] calldata borrowTokens_\n    ) external;\n\n    /// @notice         collects revenue for tokens to configured revenueCollector address.\n    /// @param tokens_  array of tokens to collect revenue for\n    /// @dev            Note that this can revert if token balance is < revenueAmount (utilization > 100%)\n    function collectRevenue(address[] calldata tokens_) external;\n\n    /// @notice gets the current updated exchange prices for n tokens and updates all prices, rates related data in storage.\n    /// @param tokens_ tokens to update exchange prices for\n    /// @return supplyExchangePrices_ new supply rates of overall system for each token\n    /// @return borrowExchangePrices_ new borrow rates of overall system for each token\n    function updateExchangePrices(\n        address[] calldata tokens_\n    )\n        external\n        returns (\n            uint256[] memory supplyExchangePrices_,\n            uint256[] memory borrowExchangePrices_\n        );\n}\n\ninterface IFluidLiquidityWeETHTransferModule {\n    function depositZircuit() external;\n}\n\ncontract PayloadIGP19 {\n    uint256 public constant PROPOSAL_ID = 19;\n\n    address public constant PROPOSER =\n        0xA45f7bD6A5Ff45D31aaCE6bCD3d426D9328cea01;\n\n    address public constant PROPOSER_AVO_MULTISIG =\n        0x059A94A72951c0ae1cc1CE3BF0dB52421bbE8210;\n\n    IGovernorBravo public constant GOVERNOR =\n        IGovernorBravo(0x0204Cd037B2ec03605CFdFe482D8e257C765fA1B);\n    ITimelock public immutable TIMELOCK =\n        ITimelock(0x2386DC45AdDed673317eF068992F19421B481F4c);\n\n    address public immutable ADDRESS_THIS;\n\n    address public constant TEAM_MULTISIG =\n        0x4F6F977aCDD1177DCD81aB83074855EcB9C2D49e;\n\n    IFluidLiquidityAdmin public constant LIQUIDITY =\n        IFluidLiquidityAdmin(0x52Aa899454998Be5b000Ad077a46Bbe360F4e497);\n\n\n    constructor() {\n        ADDRESS_THIS = address(this);\n    }\n\n    function propose(string memory description) external {\n        require(\n            msg.sender == PROPOSER ||\n                msg.sender == TEAM_MULTISIG ||\n                address(this) == PROPOSER_AVO_MULTISIG,\n            \"msg.sender-not-allowed\"\n        );\n\n        uint256 totalActions = 1;\n        address[] memory targets = new address[](totalActions);\n        uint256[] memory values = new uint256[](totalActions);\n        string[] memory signatures = new string[](totalActions);\n        bytes[] memory calldatas = new bytes[](totalActions);\n\n        // Action 1: call executePayload on timelock contract to execute payload related to Fluid\n        targets[0] = address(TIMELOCK);\n        values[0] = 0;\n        signatures[0] = \"executePayload(address,string,bytes)\";\n        calldatas[0] = abi.encode(ADDRESS_THIS, \"execute()\", abi.encode());\n\n        uint256 proposedId = GOVERNOR.propose(\n            targets,\n            values,\n            signatures,\n            calldatas,\n            description\n        );\n\n        require(proposedId == PROPOSAL_ID, \"PROPOSAL_IS_NOT_SAME\");\n    }\n\n    function execute() external {\n        require(address(this) == address(TIMELOCK), \"not-valid-caller\");\n\n        // Action 1: Remove old UserModule from Liquidity infiniteProxy.\n        action1();\n\n        // Action 2:Add new UserModule to Liquidity infiniteProxy.\n        action2();\n\n        // Action 3: Add new WeETHTransferModule to Liquidity infiniteProxy.\n        action3();\n\n        // Action 4: call WeETHTransferModule depositZircuit() on Liquidity\n        action4();\n    }\n\n    function verifyProposal() external view {}\n\n    /***********************************|\n    |     Proposal Payload Actions      |\n    |__________________________________*/\n\n    /// @notice Action 1: Remove old UserModule from Liquidity infiniteProxy.\n    function action1() internal {\n       IProxy(address(LIQUIDITY)).removeImplementation(0xfB45BC79e01b4e92706412A54e011db251104C74);\n    }\n\n    /// @notice Action 2: Add new UserModule to Liquidity infiniteProxy.\n    function action2() internal {\n        bytes4[] memory sigs_ = new bytes4[](1);\n\n        sigs_[0] = \n            bytes4(keccak256(\"operate(address,int256,int256,address,address,bytes)\"));\n\n        IProxy(address(LIQUIDITY)).addImplementation(\n            0x968738c127f91b560bD614487F859999D5D02d9c,\n            sigs_\n        );\n    }\n\n    /// @notice Action 3: Add new WeETHTransferModule to Liquidity infiniteProxy \n    function action3() internal {\n        bytes4[] memory sigs_ = new bytes4[](2);\n\n        sigs_[0] = bytes4(keccak256(\"depositZircuit()\"));\n        sigs_[1] = bytes4(keccak256(\"withdrawZircuit()\"));\n\n        IProxy(address(LIQUIDITY)).addImplementation(\n            0xaD99E8416f505aCE0A087C5dAB7214F15aE3D1d1,\n            sigs_\n        );\n    }\n\n    /// @notice Action 4: call WeETHTransferModule depositZircuit() on Liquidity\n    function action4() internal {\n        IFluidLiquidityWeETHTransferModule(address(LIQUIDITY)).depositZircuit();\n    }\n}\n"
      }
    },
    "settings": {
      "optimizer": {
        "enabled": true,
        "runs": 200
      },
      "outputSelection": {
        "*": {
          "*": [
            "evm.bytecode",
            "evm.deployedBytecode",
            "devdoc",
            "userdoc",
            "metadata",
            "abi"
          ]
        }
      },
      "libraries": {}
    }
  }}