Skip to content

Commit

Permalink
gas optimization (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
SamBorisov authored Apr 25, 2024
1 parent a737dac commit c3f016e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion contracts/RewardPool/modules/Vesting.sol
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ abstract contract Vesting is APR {
uint256 divider = DENOMINATOR;
if (rsi) {
bonus = bonus * position.rsiBonus;
divider *= DENOMINATOR;
divider *= divider;
}

return (reward * bonus) / divider / EPOCHS_YEAR;
Expand Down
2 changes: 1 addition & 1 deletion test/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ export async function applyCustomReward(
let divider = DENOMINATOR;
if (rsi) {
bonus = bonus.mul(position.rsiBonus);
divider *= DENOMINATOR;
divider **= 2;
}

return reward.mul(bonus).div(divider).div(EPOCHS_YEAR);
Expand Down

0 comments on commit c3f016e

Please sign in to comment.