/ test / common / samples / ChangeInterestRateProposal.t.sol
ChangeInterestRateProposal.t.sol
 1  pragma solidity >=0.6.0;
 2  
 3  import "../../../contracts/governance/Proposal.sol";
 4  import "../../../contracts/interfaces/IProposalWrapper.sol";
 5  import "../../../contracts/interfaces/IProtocolSettings.sol";
 6  
 7  contract ChangeInterestRateProposal is Proposal {
 8  
 9      uint interestRate;
10      uint interestRateBase;
11      
12      function setInterestRate(uint ir, uint b) public {
13  
14          require(ir > 0);
15          require(interestRate == 0);
16  
17          interestRate = ir;
18          interestRateBase = b;
19      }
20  
21      function getName() public override view returns (string memory) {
22  
23          return "Change Debt Interest Rate";
24      }
25  
26      function execute(IProtocolSettings settings) public override {
27          
28          require(interestRate > 0, "interest rate value not set");
29          settings.setDebtInterestRate(interestRate, interestRateBase);
30      }
31  
32      function executePool(IERC20 _llp) public override {}
33  }