ProtocolSettingsProposal.sol
1 pragma solidity >=0.6.0; 2 pragma experimental ABIEncoderV2; 3 4 import "./Proposal.sol"; 5 import "../interfaces/IERC20.sol"; 6 import "../interfaces/IProtocolSettings.sol"; 7 import "../utils/OpenZeppelinOwnable.sol"; 8 9 10 contract ProtocolSettingsProposal 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 "Protocol Settings Mangement Operation"; 29 } 30 31 function execute(IProtocolSettings _settings) public override { 32 require(executionBytes.length > 0, "no functions to call"); 33 for (uint i=0; i< executionBytes.length; i++) { 34 (bool success, ) = address(_settings).call(executionBytes[i]); 35 require(success == true, "failed to sucessfully execute"); 36 } 37 } 38 39 function executePool(IERC20 pool) public override { 40 41 } 42 }