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

Additional modifyLiquiditiesWithoutUnlock Tests #274

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

saucepoint
Copy link
Collaborator

@saucepoint saucepoint commented Aug 5, 2024

Related Issue

Some tasks from #265

Description of changes

A new helper function getFuzzySingleEncoded which randomly returns an encoded call for a single operation -- mint, increase, decrease, and burn.

  • modifyLiquiditesWithoutUnlock fails on external calls without PM being unlocked
  • test that all liquidity operations fail for all subscriber re-entrancy -- on-subscribe, on-unsubscribe, on-notifyModifyLiquidity, on-notifyTransferFrom
  • test that all liquidity operations fail for all liquidity hooks -- beforeAdd, beforeRemove, afterAdd, afterRemove

@saucepoint saucepoint marked this pull request as ready for review August 5, 2024 16:30
@saucepoint saucepoint requested a review from snreynolds August 14, 2024 18:07
// subscriber did not modify liquidity
assertEq(lpm.ownerOf(tokenId), address(this)); // owner still owns the position
assertEq(lpm.nextTokenId(), tokenId + 1); // no new token minted
assertEq(lpm.getPositionLiquidity(tokenId, config), 100e18); // liquidity unchanged
Copy link
Member

Choose a reason for hiding this comment

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

assert subscriber is addr 0 and hasSubscriber is false?

}

/// @dev subscribers cannot re-enter posm on-unsubscribe since PM is not unlocked
function test_fuzz_subscriber_unsubscribe_reenter_revert(uint256 seed) public {
Copy link
Member

Choose a reason for hiding this comment

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

not a revert test?

}
}

function notifyModifyLiquidity(uint256, PositionConfig memory, int256) external onlyByPosm {
Copy link
Member

Choose a reason for hiding this comment

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

update interface

@saucepoint saucepoint requested a review from snreynolds August 21, 2024 15:27
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