Skip to content

Commit

Permalink
Add rewards instead of balance increase
Browse files Browse the repository at this point in the history
  • Loading branch information
toninorair committed Jun 10, 2024
1 parent b3f4580 commit aa195ab
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/WM.sol
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,7 @@ contract WM is IERC20, ERC20Extended {
}

uint256 newReward_ = _earningPrincipals[account_] * (currentIndex_ - _lastAccrueIndices[account_]);

// Update only _balances[account_], do not use _mint
_balances[account_] += newReward_;
_rewards[account_] += newReward_;

_lastAccrueIndices[account_] = currentIndex_;
}
Expand Down Expand Up @@ -175,8 +173,6 @@ contract WM is IERC20, ERC20Extended {

_earningPrincipals[account_] += principalAmount_;
principalOfTotalEarningSupply += principalAmount_;

// Update for excess of M vs wM here
}

function _addNonEarningAmount(address account_, uint256 amount_) internal {
Expand All @@ -193,8 +189,6 @@ contract WM is IERC20, ERC20Extended {

// Totals update
principalOfTotalEarningSupply -= principalAmount_;

// Update for excess of M vs wM here
}

function _subtractNonEarningAmount(address account_, uint256 amount_) internal {
Expand Down Expand Up @@ -222,6 +216,15 @@ contract WM is IERC20, ERC20Extended {
}
}

// function _claim(address earner_, uint256 amount_) internal {
// _accrueRewards(earner_);

// address claimer_ = _claimers[earner_];

// // _mint(claimer_, amount_);
// _balances[claimer_] += amount_; // do not update principal if claimer is an earner?
// }

/* ============ Internal View/Pure Functions ============ */

function _isApprovedWEarner(address account_) internal view returns (bool) {
Expand Down

0 comments on commit aa195ab

Please sign in to comment.