Skip to content
This repository has been archived by the owner on May 24, 2024. It is now read-only.

Exec upgrade (defer liquidity for multiple accounts, max amount support on pToken wrap/unwrap) #163

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

kasperpawlowski
Copy link
Collaborator

No description provided.

Copy link
Contributor

@hoytech hoytech left a comment

Choose a reason for hiding this comment

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

Excellent, great work on the testing, especially adding specific tests for the deferred liquidity callbacks!

In the future I suggest working on uncoupled features in separate branches and using separate PRs, so that comments on one of the features doesn't delay the merging of the other. Don't worryy about splitting this one apart though, they both look fine to me.

/// @notice Defer liquidity checking for an array of accounts, to perform rebalancing, flash loans, etc. msg.sender must implement IDeferredLiquidityCheck
/// @param accounts The array of accounts to defer liquidity for
/// @param data Passed through to the onDeferredLiquidityCheck() callback, so contracts don't need to store transient data in storage
function deferLiquidityCheckExtended(address[] memory accounts, bytes memory data) external reentrantOK {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think better name might be deferLiquidityChecks or deferLiquidityCheckMulti or something, to make clear how it was extended.


if (status == DEFERLIQUIDITY__DIRTY) checkLiquidity(account);
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Looking at it here, I think it would make sense to re-use the code between the single and multi-versions by having the single call the multi. Technically it would cost a bit more gas, but I think it's worth it to keep the code clean.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants