-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pay portion of interest to SP depositors #167
Conversation
69e9807
to
aff2ce7
Compare
7a8b7ce
to
6dfb30c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will have a look at tests, but this looks good to me!
contracts/src/StabilityPool.sol
Outdated
uint256 stashedETHGain = stashedETH[_depositor]; | ||
uint256 totalETHGain = stashedETHGain + _currentETHGain; | ||
|
||
// TODO: Gas - saves gas when stashedETHGain == 0? | ||
if (stashedETHGain > 0) stashedETH[_depositor] = 0; | ||
if (stashedETHGain > 0) {stashedETH[_depositor] = 0;} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’m fine either way, but I think forge fmt
removes this, so if we keep using it I’m afraid this will be reverted.
boldLoss = initialDeposit - compoundedBoldDeposit; // Needed only for event log | ||
assert(stashedETH[msg.sender] == 0); | ||
assert(getDepositorETHGain(msg.sender) == 0); | ||
assert(getDepositorYieldGain(msg.sender) == 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice one!
Closes #47