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

Refactor ActivePool interest tracker calls into one mintAggInterest call #93

Merged
merged 6 commits into from
Apr 10, 2024

Conversation

RickGriff
Copy link
Collaborator

@RickGriff RickGriff commented Apr 4, 2024

No description provided.

@RickGriff RickGriff changed the base branch from main to apply_and_mint_interest_rebase April 4, 2024 10:41
@RickGriff RickGriff requested a review from bingen April 4, 2024 11:53
@RickGriff RickGriff changed the base branch from apply_and_mint_interest_rebase to main April 5, 2024 03:53
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 have one doubt (see inline). Other than that, this looks really nice!

@@ -596,14 +611,9 @@ contract BorrowerOperations is LiquityBase, Ownable, CheckContract, IBorrowerOpe
internal
{
if (_isDebtIncrease) {
_activePool.increaseRecordedDebtSum(_boldChange + _accruedTroveInterest);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we change the comments in the header now?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good call. And we also actually don't need the _accruedTroveInterest param now.

@@ -866,9 +869,7 @@ contract TroveManager is ERC721, LiquityBase, Ownable, CheckContract, ITroveMana
* Any surplus ETH left in the trove, is sent to the Coll surplus pool, and can be later claimed by the borrower.
*/
function _redeemCloseTrove(ContractsCache memory _contractsCache, uint256 _troveId, uint _bold, uint _ETH) internal {
_contractsCache.boldToken.burn(gasPoolAddress, _bold);
// Update Active Pool Bold, and send ETH to account
_contractsCache.activePool.decreaseRecordedDebtSum(_bold);
Copy link
Collaborator

Choose a reason for hiding this comment

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

I guess we are aggregating this outside the loop in the external function redeemCollateral? But I can find its replacement.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Right, this is now handled in the redemption interest PR:
#101

@@ -209,8 +209,10 @@ contract InterestRateAggregate is DevTestSetup {
priceFeed.setPrice(2000e18);
assertEq(activePool.aggRecordedDebt(), 0);

console.log("here 1");
Copy link
Collaborator

Choose a reason for hiding this comment

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

If this works maybe we can remove this now ;-)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

haha, yes!

@RickGriff RickGriff merged commit 128a2cc into main Apr 10, 2024
6 of 7 checks passed
@danielattilasimon danielattilasimon deleted the refactor_active_pool_calls branch April 12, 2024 06:15
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.

2 participants