Fix position_manager_permit2_single()#464
Conversation
Greptile SummaryThis PR fixes a bug in
Confidence Score: 5/5Safe to merge — the change directly aligns the permit call with the on-chain ABI and removes arguments that were duplicated inside PermitSingle. The fix is a targeted, well-justified correction. The old code wrapped astuple(permit_single) inside an extra outer tuple and repeated spender and sig_deadline as standalone arguments that were already encoded inside PermitSingle, causing an ABI mismatch that would always revert. The new call matches the ABI exactly: permit(address, PermitSingle, bytes). The change is narrow, the ABI confirms the expected shape, and the parallel batch function already used the correct pattern. No files require special attention; the single changed method in uniswap4.py is straightforward and consistent with position_manager_permit2_batch. Important Files ChangedSequence DiagramsequenceDiagram
participant Caller
participant uniswap4.py
participant PositionManager (on-chain)
participant Permit2 (on-chain)
Caller->>uniswap4.py: position_manager_permit2_single(owner, permit_single, signature, payable_amount)
note over uniswap4.py: astuple(permit_single)<br/>→ ((token, amount, expiration, nonce), spender, sig_deadline)
uniswap4.py->>PositionManager (on-chain): permit(owner, PermitSingle, signature)
PositionManager (on-chain)->>Permit2 (on-chain): forward permit call
Permit2 (on-chain)-->>PositionManager (on-chain): success / err
PositionManager (on-chain)-->>uniswap4.py: tx receipt
uniswap4.py-->>Caller: HexBytes tx hash
Reviews (1): Last reviewed commit: "Fix position_manager_permit2_single()" | Re-trigger Greptile |

No description provided.