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

fix: dynamic fee incorrect encoding #40

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

Conversation

jsy1218
Copy link
Member

@jsy1218 jsy1218 commented Oct 15, 2024

No description provided.

@jsy1218 jsy1218 self-assigned this Oct 15, 2024
@jsy1218 jsy1218 marked this pull request as ready for review October 15, 2024 13:55
@jsy1218
Copy link
Member Author

jsy1218 commented Oct 15, 2024

@hensha256 i did notice, that mixed-quoter lib v4-periphery @ 47e3c30 is 3 weeks ago, and if i were to update v4-periphery import, it would break https://github.com/Uniswap/mixed-quoter/blob/main/src/MixedRouteQuoterV2.sol#L84
https://app.warp.dev/block/W7VIRrdxDVLfYBIb5puIIl

/// for example, a v4 fee 100% is 1000000, or 000011110100001001000000
/// 000011110100001001000000 & 100011111111111111111111 = 000011110100001001000000
/// if v4 fee is dynamic, then it's 100000000000000000000000
/// 100000000000000000000000 & 100011111111111111111111 = 100000000000000000000000
Copy link
Contributor

Choose a reason for hiding this comment

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

would love a comment explaining what the 3 0s are for to explain the mask more clearly

uint24 encodedFee = (uint24(protocolVersion) << v4FeeShift) + fee;
uint8 v3ProtocolVersion = uint8(3);
uint24 encodedV3Fee = (uint24(v3ProtocolVersion) << v4FeeShift) + fee;
console.log(encodedV3Fee);
Copy link
Contributor

Choose a reason for hiding this comment

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

remove?

nonEncodableData[0] = (IMixedRouteQuoterV2.NonEncodableData({hookData: hookData}));
nonEncodableData[1] = (IMixedRouteQuoterV2.NonEncodableData({hookData: hookData}));

// bytes memory path = abi.encodePacked(V4_SEPOLIA_OP_ADDRESS, fee,tickSpacing, hooks, V4_SEPOLIA_USDC_ADDRESS);
Copy link
Contributor

Choose a reason for hiding this comment

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

remove?

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