Elastic-Finance-DAO / eefi_contracts

0 stars 0 forks source link

Rebase reward #52

Closed stalker474 closed 1 year ago

stalker474 commented 1 year ago

Closes #51

The issue with this implementation is that we can potentially mint any amount of EEFI so it's a security issue and a decentralization issue. I suggest we add a limit to the reward amount.

davoice-321 commented 1 year ago

Agree with setting a max rebase reward limit, in three steps:

  1. Create a new state variable:

uint256 private maxRebaseReward;

  1. Set maxRebaseReward: == 2 EEFI in constructor

  2. Update setRebaseReward with require statement (as below):

function setRebaseReward(uint256 newRebaseReward) external onlyOwner() { require(newRebaseReward <= maxRebaseReward, "Rebase reward cannot be higher than maxRebaseReward."); rebaseCallerReward = newRebaseReward; emit RebaseRewardChanged(newRebaseReward); }