Skip to content
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

Merged
merged 7 commits into from
May 23, 2024
Merged

Conversation

RickGriff
Copy link
Collaborator

@RickGriff RickGriff commented May 10, 2024

Closes #47

Copy link
Collaborator

@bingen bingen left a 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/ActivePool.sol Show resolved Hide resolved
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;}
Copy link
Collaborator

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.

contracts/src/StabilityPool.sol Show resolved Hide resolved
boldLoss = initialDeposit - compoundedBoldDeposit; // Needed only for event log
assert(stashedETH[msg.sender] == 0);
assert(getDepositorETHGain(msg.sender) == 0);
assert(getDepositorYieldGain(msg.sender) == 0);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice one!

contracts/src/StabilityPool.sol Outdated Show resolved Hide resolved
@bingen bingen marked this pull request as ready for review May 22, 2024 14:42
@bingen bingen marked this pull request as draft May 22, 2024 14:42
@RickGriff RickGriff marked this pull request as ready for review May 23, 2024 03:04
@RickGriff RickGriff merged commit 1703acc into main May 23, 2024
6 of 7 checks passed
@danielattilasimon danielattilasimon deleted the bold_sp_rewards_direct_2 branch June 13, 2024 04:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Variable split revenue to the Stability Pool
2 participants