-
Notifications
You must be signed in to change notification settings - Fork 504
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
Add transfer support #218
Add transfer support #218
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just 1 thought but generally looks great
src/PositionManager.sol
Outdated
@@ -50,6 +50,8 @@ contract PositionManager is | |||
|
|||
IAllowanceTransfer public immutable permit2; | |||
|
|||
uint256 public constant FULL_DELTA = type(uint256).max; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do think youll find if you make this 0
gas should go down noticeably because of removing non-0 calldata bytes.
It should go down by (16-4) * 32) = 384
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lemme check!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
went down by ~700
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -376,7 +376,13 @@ contract PosMGasTest is Test, PosmTestSetup, GasSnapshot { | |||
|
|||
function test_gas_mint_native_excess() public { | |||
uint256 liquidityToAdd = 10_000 ether; | |||
bytes memory calls = getMintEncoded(configNative, liquidityToAdd, address(this), ZERO_BYTES); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you wanted to keep using the liquidity operations helpers you could always have it check if one of the currencies is native and add a sweep automatically? like in finalizeML
if its a mint/increase
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but dont feel strongly about it if you dnt want to
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
eh its fine for now, can maybe add it later
@@ -338,4 +338,42 @@ contract IncreaseLiquidityTest is Test, PosmTestSetup, Fuzzers { | |||
); | |||
} | |||
} | |||
|
|||
function test_mint_settleWithBalance() public { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you also test test_increaseLiquidity_settleWithBalance()
Decide what the final "resolve" actions are & share the FULL_DELTA logic with router
opening into actions router since this builds on that