Skip to content

Commit

Permalink
Tidy up comments
Browse files Browse the repository at this point in the history
  • Loading branch information
RickGriff committed May 6, 2024
1 parent c087ca6 commit 49dcb77
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 13 deletions.
11 changes: 2 additions & 9 deletions contracts/src/StabilityPool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,7 @@ contract StabilityPool is LiquityBase, Ownable, CheckContract, IStabilityPool {
assert(getDepositorETHGain(msg.sender) == 0);
}

// TODO: Make this also claim BOlD gains when they are implemented
function claimAllETHGains() external {
// We don't require they have a deposit: they may have stashed gains and no deposit
uint256 initialDeposit = deposits[msg.sender].initialValue;
Expand All @@ -401,7 +402,7 @@ contract StabilityPool is LiquityBase, Ownable, CheckContract, IStabilityPool {

// If they have a deposit, update it and update its snapshots
if (initialDeposit > 0) {
currentETHGain = getDepositorETHGain(msg.sender); // Only active deposits can only have a current ETH gai
currentETHGain = getDepositorETHGain(msg.sender); // Only active deposits can only have a current ETH gain

uint256 compoundedBoldDeposit = getCompoundedBoldDeposit(msg.sender);
boldLoss = initialDeposit - compoundedBoldDeposit; // Needed only for event log
Expand All @@ -419,14 +420,6 @@ contract StabilityPool is LiquityBase, Ownable, CheckContract, IStabilityPool {
_sendETHGainToDepositor(ETHToSend);
assert(getDepositorETHGain(msg.sender) == 0);
}

// T ODO: should claim both rewards (BOLD and ETH) since it updates snapshots
// -mintAggInterest
// -calc current gains
// -calc new deposit
// -updateDepositAndSnapshots
// -Send (current + stashed) total gains to depositor
// -Zero stashed gains

// --- Liquidation functions ---

Expand Down
9 changes: 5 additions & 4 deletions contracts/src/test/stabilityPool.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,8 @@ contract SPTest is DevTestSetup {
}

// TODO:
// 1) tests for withdrawETHGainToTrove (if we don't remove it)
// 2) tests claimAllETHGains (requires deposit data & getter refactor):
// - updates recorded deposit value
// - updates deposit snapshots
// 1) claim tests for withdrawETHGainToTrove (if we don't remove it)
//
// 2) tests for claimAllETHGains (requires deposit data & getter refactor):
// - updates recorded deposit value
// - updates deposit snapshots

0 comments on commit 49dcb77

Please sign in to comment.