creation_sourcecode: {{
    "language": "Solidity",
    "sources": {
      "contracts/payloads/IGP29/PayloadIGP29.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        uint256 maxUtilization;\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(\n        address implementation_,\n        bytes4[] calldata sigs_\n    ) 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(\n        address impl_\n    ) external view returns (bytes4[] memory);\n\n    function getSigsImplementation(bytes4 sig_) external view returns (address);\n\n    function readFromStorage(\n        bytes32 slot_\n    ) 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 IFluidVaultT1 {\n    /// @notice updates the Vault oracle to `newOracle_`. Must implement the FluidOracle interface.\n    function updateOracle(address newOracle_) external;\n\n    /// @notice updates the all Vault core settings according to input params.\n    /// All input values are expected in 1e2 (1% = 100, 100% = 10_000).\n    function updateCoreSettings(\n        uint256 supplyRateMagnifier_,\n        uint256 borrowRateMagnifier_,\n        uint256 collateralFactor_,\n        uint256 liquidationThreshold_,\n        uint256 liquidationMaxLimit_,\n        uint256 withdrawGap_,\n        uint256 liquidationPenalty_,\n        uint256 borrowFee_\n    ) external;\n\n    /// @notice updates the allowed rebalancer to `newRebalancer_`.\n    function updateRebalancer(address newRebalancer_) external;\n\n    /// @notice updates the supply rate magnifier to `supplyRateMagnifier_`. Input in 1e2 (1% = 100, 100% = 10_000).\n    function updateSupplyRateMagnifier(uint supplyRateMagnifier_) external;\n\n    /// @notice updates the collateral factor to `collateralFactor_`. Input in 1e2 (1% = 100, 100% = 10_000).\n    function updateCollateralFactor(uint collateralFactor_) external;\n}\n\ninterface IFluidReserveContract {\n    function isRebalancer(address user) external returns (bool);\n\n    function rebalanceFToken(address protocol_) external;\n\n    function rebalanceVault(address protocol_) external;\n\n    function transferFunds(address token_) external;\n\n    function getProtocolTokens(address protocol_) external;\n\n    function updateAuth(address auth_, bool isAuth_) external;\n\n    function updateRebalancer(address rebalancer_, bool isRebalancer_) external;\n\n    function approve(\n        address[] memory protocols_,\n        address[] memory tokens_,\n        uint256[] memory amounts_\n    ) external;\n\n    function revoke(\n        address[] memory protocols_,\n        address[] memory tokens_\n    ) external;\n}\n\ninterface IDSAV2 {\n    function cast(\n        string[] memory _targetNames,\n        bytes[] memory _datas,\n        address _origin\n    )\n    external\n    payable \n    returns (bytes32);\n\n    function isAuth(address user) external view returns (bool);\n}\n\ninterface IFluidVaultT1Factory {\n    function deployVault(\n        address vaultDeploymentLogic_,\n        bytes calldata vaultDeploymentData_\n    ) external returns (address vault_);\n\n    function setVaultAuth(\n        address vault_,\n        address vaultAuth_,\n        bool allowed_\n    ) external;\n}\n\ncontract PayloadIGP29 {\n    uint256 public constant PROPOSAL_ID = 29;\n\n    address public constant PROPOSER =\n        0xA45f7bD6A5Ff45D31aaCE6bCD3d426D9328cea01;\n\n    address public constant PROPOSER_AVO_MULTISIG =\n        0x059A94A72951c0ae1cc1CE3BF0dB52421bbE8210;\n\n    address public constant PROPOSER_AVO_MULTISIG_2 =\n        0x9efdE135CA4832AbF0408c44c6f5f370eB0f35e8;\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    IFluidReserveContract public constant FLUID_RESERVE =\n        IFluidReserveContract(0x264786EF916af64a1DB19F513F24a3681734ce92);\n    IFluidVaultT1Factory public constant VAULT_T1_FACTORY =\n        IFluidVaultT1Factory(0x324c5Dc1fC42c7a4D43d92df1eBA58a54d13Bf2d);\n\n    IDSAV2 public constant TREASURY = IDSAV2(0x28849D2b63fA8D361e5fc15cB8aBB13019884d09);\n\n    address public constant F_USDT = 0x5C20B550819128074FD538Edf79791733ccEdd18;\n    address public constant F_USDC = 0x9Fb7b4477576Fe5B32be4C1843aFB1e55F251B33;\n\n    address public constant USDC_ADDRESS =\n        0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48;\n    address public constant USDT_ADDRESS =\n        0xdAC17F958D2ee523a2206206994597C13D831ec7;\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                address(this) == PROPOSER_AVO_MULTISIG_2,\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: Approve fUSDC and fUSDT protocols to spend the reserves tokens\n        action1();\n\n       /// Action 2: Add config handler on liquidity layer for sUSDe/USDC & sUSDe/USDT vault.\n       action2();\n\n       /// Action 3: call cast() - transfer 100 stETH to Team Multisig from treasury.\n        action3();\n    }\n\n    function verifyProposal() external view {}\n\n    /***********************************|\n    |     Proposal Payload Actions      |\n    |__________________________________*/\n\n    /// @notice Action 1: Approve fUSDC and fUSDT protocols to spend the reserves tokens\n    function action1() internal {\n        address[] memory protocols = new address[](2);\n        address[] memory tokens = new address[](2);\n        uint256[] memory amounts = new uint256[](2);\n\n        // fUSDC\n        protocols[0] = F_USDC;\n        tokens[0] = USDC_ADDRESS;\n        amounts[0] = 290_000 * 1e6; // 290k USDC\n\n        // fUSDT\n        protocols[1] = F_USDT;\n        tokens[1] = USDT_ADDRESS;\n        amounts[1] = 290_000 * 1e6; // 290k USDT\n\n        FLUID_RESERVE.approve(protocols, tokens, amounts);\n    }\n\n    /// @notice Action 2: Add config handler on liquidity layer for sUSDe/USDC & sUSDe/USDT vault.\n    function action2() internal {\n        {\n            address VAULT_sUSDe_USDC = address(0x3996464c0fCCa8183e13ea5E5e74375e2c8744Dd);\n            address VAULT_sUSDe_USDC_CONFIG_HANDLER = address(0xa7C805988f04f0e841504761E5aa8387600e430b);\n\n            VAULT_T1_FACTORY.setVaultAuth(\n                VAULT_sUSDe_USDC,\n                VAULT_sUSDe_USDC_CONFIG_HANDLER,\n                true\n            );\n        }\n\n        {\n            address VAULT_sUSDe_USDT = address(0xBc345229C1b52e4c30530C614BB487323BA38Da5);\n            address VAULT_sUSDe_USDT_CONFIG_HANDLER = address(0x7607968F40d7Ac4Ef39E809F29fADDe34C00A0A6);\n\n            VAULT_T1_FACTORY.setVaultAuth(\n                VAULT_sUSDe_USDT,\n                VAULT_sUSDe_USDT_CONFIG_HANDLER,\n                true\n            );\n        }\n\n    }\n\n    /// @notice Action 3: call cast() - transfer 100 stETH to Team Multisig from treasury.\n    function action3() internal {\n        string[] memory targets = new string[](1);\n        bytes[] memory encodedSpells = new bytes[](1);\n\n        string memory withdrawSignature = \"withdraw(address,uint256,address,uint256,uint256)\";\n\n        // Spell 1: Transfer stETH\n        {   \n            address STETH_ADDRESS = 0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84;\n            uint256 STETH_AMOUNT = 100 * 1e18; // 100 stETH\n            targets[0] = \"BASIC-A\";\n            encodedSpells[0] = abi.encodeWithSignature(withdrawSignature, STETH_ADDRESS, STETH_AMOUNT, TEAM_MULTISIG, 0, 0);\n        }\n\n        IDSAV2(TREASURY).cast(targets, encodedSpells, address(this));\n    }\n}\n"
      }
    },
    "settings": {
      "optimizer": {
        "enabled": true,
        "runs": 200
      },
      "outputSelection": {
        "*": {
          "*": [
            "evm.bytecode",
            "evm.deployedBytecode",
            "devdoc",
            "userdoc",
            "metadata",
            "abi"
          ]
        }
      },
      "libraries": {}
    }
  }}