PoolManagementProposal.sol
1 pragma solidity >=0.6.0; 2 pragma experimental ABIEncoderV2; 3 4 import "../governance/Proposal.sol"; 5 import "../interfaces/IERC20.sol"; 6 import "../interfaces/IProtocolSettings.sol"; 7 import "../utils/OpenZeppelinOwnable.sol"; 8 9 10 contract PoolManagementProposal is Proposal, OpenZeppelinOwnable { 11 12 bytes[] executionBytes; 13 14 function setExecutionBytes(bytes[] memory _executionBytes) onlyOwner public { 15 executionBytes = _executionBytes; 16 } 17 18 function getExecutionBytes() public view returns (bytes[] memory) { 19 return executionBytes; 20 } 21 22 function getExecutionBytesSize() public view returns (uint) { 23 return executionBytes.length; 24 } 25 26 function getName() public override view returns (string memory) { 27 28 return "Pool Management Operation"; 29 } 30 31 function execute(IProtocolSettings _settings) public override { 32 33 } 34 35 function executePool(IERC20 pool) public override { 36 require(executionBytes.length > 0, "no functions to call"); 37 for (uint i=0; i< executionBytes.length; i++) { 38 (bool success, ) = address(pool).call(executionBytes[i]); 39 require(success == true, "failed to sucessfully execute"); 40 } 41 } 42 }