Skip to content

Commit

Permalink
Add missing accrueExcess
Browse files Browse the repository at this point in the history
  • Loading branch information
toninorair committed Jun 7, 2024
1 parent 2656ce6 commit 79b97f3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/WM.sol
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,8 @@ contract WM is IERC20, ERC20Extended {
function _startEarning(address account_) internal {
if (_isEarning[account_]) return;

_accrueExcessOfM();

_isEarning[account_] = true;
_lastAccrueIndices[account_] = currentIndex();

Expand Down Expand Up @@ -221,6 +223,7 @@ contract WM is IERC20, ERC20Extended {
function _transfer(address sender_, address recipient_, uint256 amount_) internal override {
_accrueRewards(sender_);
_accrueRewards(recipient_);
_accrueExcessOfM();

if (_isEarning[sender_]) {
_subtractEarningAmount(sender_, amount_);
Expand Down

0 comments on commit 79b97f3

Please sign in to comment.