Skip to content

Commit

Permalink
fix tests to fuzz with different pool configs and fix distributeFlow …
Browse files Browse the repository at this point in the history
…blocked liquidation issue
  • Loading branch information
0xdavinchee committed Nov 6, 2023
1 parent 081415f commit 50c3ccf
Show file tree
Hide file tree
Showing 2 changed files with 242 additions and 179 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,10 @@ contract GeneralDistributionAgreementV1 is AgreementBase, TokenMonad, IGeneralDi

newCtx = ctx;

if (!pool.distributionFromAnyAddress()) {
// we must check if the requestedFlowRate is greater than 0 here
// otherwise we will block liquidators from closing streams in pools
// where the pool config has distributionFromAnyAddress set to false
if (requestedFlowRate > 0 && !pool.distributionFromAnyAddress()) {
if (pool.admin() != flowVars.currentContext.msgSender) {
revert GDA_DISTRIBUTE_FROM_ANY_ADDRESS_NOT_ALLOWED();
}
Expand Down
Loading

0 comments on commit 50c3ccf

Please sign in to comment.