Skip to content
This repository has been archived by the owner on Sep 1, 2024. It is now read-only.

ptsanev - Address deviation will not work on ZKSync #2

Closed
sherlock-admin2 opened this issue Feb 27, 2024 · 0 comments
Closed

ptsanev - Address deviation will not work on ZKSync #2

sherlock-admin2 opened this issue Feb 27, 2024 · 0 comments
Labels
Non-Reward This issue will not receive a payout Sponsor Disputed The sponsor disputed this issue's validity Won't Fix The sponsor confirmed this issue will not be fixed

Comments

@sherlock-admin2
Copy link

sherlock-admin2 commented Feb 27, 2024

ptsanev

medium

Address deviation will not work on ZKSync

Summary

The functionality used in computePoolAddress uses the exact same calculation method for the pool address, using the tokens and fee, which would not work on ZK.

Vulnerability Detail

Due to different precompilers and bytecodes on ZK, the returned address from the method would be wrong, resulting in the swaps on Uniswapv3 to revert or force overpay.
This issue has been addressed in the past, but has remained unchanged by the team, contrary to their intentions in the README to deploy to ZK.

Impact

Medium. Unlikely to happen but would result in short-term DOS and more fees paid by the borrower.

Code Snippet

https://github.com/sherlock-audit/2024-02-leverage-contracts/blob/main/wagmi-leverage/contracts/abstract/ApproveSwapAndPay.sol#L251-L271

Tool used

Manual Review

Recommendation

Consider calling the Uniswap factory getter getPool() to get the address of the pool.

Duplicate of #35

@sherlock-admin2 sherlock-admin2 added Sponsor Disputed The sponsor disputed this issue's validity Won't Fix The sponsor confirmed this issue will not be fixed labels Feb 29, 2024
@github-actions github-actions bot added the Duplicate A valid issue that is a duplicate of an issue with `Has Duplicates` label label Feb 29, 2024
@sherlock-admin4 sherlock-admin4 changed the title Brief Sandstone Crocodile - Address deviation will not work on ZKSync ptsanev - Address deviation will not work on ZKSync Mar 7, 2024
@sherlock-admin4 sherlock-admin4 added Non-Reward This issue will not receive a payout and removed Duplicate A valid issue that is a duplicate of an issue with `Has Duplicates` label labels Mar 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Non-Reward This issue will not receive a payout Sponsor Disputed The sponsor disputed this issue's validity Won't Fix The sponsor confirmed this issue will not be fixed
Projects
None yet
Development

No branches or pull requests

2 participants