Skip to content

Commit

Permalink
gas optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
SamBorisov committed Apr 24, 2024
1 parent e5b98fe commit 5fe0f82
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 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 docs/RewardPool/RewardPool.md
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ Keeps the delegation pools
function delegationPositions(address, address) external view returns (uint256 duration, uint256 start, uint256 end, uint256 base, uint256 vestBonus, uint256 rsiBonus)
```

The vesting positions for every delegator.
The vesting positions for every delegator



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 5fe0f82

Please sign in to comment.