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

Add transfer support #218

Merged
merged 30 commits into from
Jul 31, 2024
Merged

Add transfer support #218

merged 30 commits into from
Jul 31, 2024

Conversation

snreynolds
Copy link
Member

@snreynolds snreynolds commented Jul 27, 2024

Decide what the final "resolve" actions are & share the FULL_DELTA logic with router
opening into actions router since this builds on that

src/PositionManager.sol Outdated Show resolved Hide resolved
src/PositionManager.sol Outdated Show resolved Hide resolved
src/interfaces/IPositionManager.sol Outdated Show resolved Hide resolved
@snreynolds snreynolds marked this pull request as ready for review July 30, 2024 01:40
Copy link
Contributor

@hensha256 hensha256 left a 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 Show resolved Hide resolved
@@ -50,6 +50,8 @@ contract PositionManager is

IAllowanceTransfer public immutable permit2;

uint256 public constant FULL_DELTA = type(uint256).max;
Copy link
Contributor

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

Copy link
Member Author

Choose a reason for hiding this comment

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

lemme check!

Copy link
Member Author

Choose a reason for hiding this comment

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

went down by ~700

Copy link
Member Author

Choose a reason for hiding this comment

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

Base automatically changed from use-actions-router to main July 30, 2024 17:32
src/PositionManager.sol Outdated Show resolved Hide resolved
@@ -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);
Copy link
Contributor

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

Copy link
Contributor

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

Copy link
Member Author

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 {
Copy link
Contributor

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()

@hensha256 hensha256 merged commit b065dcd into main Jul 31, 2024
3 checks passed
@hensha256 hensha256 deleted the add-transfer-support branch July 31, 2024 11:25
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.

3 participants