-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: Replace `shr` with `sar` for integer types This commit updates the `shr` instruction to `sar` in the BalanceDelta and Pool contracts, as `sar` is the correct way to shift right when dealing with signed integers. This change ensures that the sign is preserved during bit shifting operations, preventing any potential bugs related to negative amounts or liquidity values. * Add a fuzz test for `Pool.updateTick` This commit introduces a fuzz test for the `Pool.updateTick` function to ensure proper functionality even when fed with diverse/random data. It also includes the creation of a `LiquidityMathRef` contract which houses the helper methods utilized in this fuzz testing. Any occurrence of an arithmetic error during testing is adequately caught and asserted. * Use `signextend` in `BalanceDeltaLibrary.amount1`
- Loading branch information
Showing
2 changed files
with
57 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters