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

replace big.Int and add test #16

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

replace big.Int and add test #16

wants to merge 2 commits into from

Conversation

it4rb
Copy link
Member

@it4rb it4rb commented Jan 19, 2024

This PR rename the package from github.com/daoleno/uniswapv3-sdk to github.com/KyberNetwork/uniswapv3-sdk-uint256, the reason is that we still want to use both version in dex-lib, after this get merged we can replace them later. All the changes for this are in the 1st commit, so in order to be easier to review please ignore it if and only review the 2nd one

Most of the changes are for replacing big.Int with uint256.Int and int256.Int in code related to swap (leave others as is, for example position/trade...)

Also there is some small differents:

  • Add(x, constant.One) -> AddUint64(x, 1)
  • x.Cmp(constants.Zero) != 0 -> !x.IsZero()
  • x.Cmp(constants.Zero) >= 0 -> x.Sign() >= 0
  • MulDivRoundingUp(x, 1, y) -> DivRoundingUp(x, y)
  • multiplyIn256 and addIn256 was changed to update the result in-place instead of allocating new one

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