Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add support for PancakeSwapV3 #29

Merged
merged 9 commits into from
Mar 23, 2024
Merged

Add support for PancakeSwapV3 #29

merged 9 commits into from
Mar 23, 2024

Conversation

gnarlycow
Copy link
Contributor

@gnarlycow gnarlycow commented Mar 23, 2024

This change adds two libraries PoolAddressPancakeSwapV3 and CallbackValidationPancakeSwapV3 that support PCSV3; all existing contract code remains unchanged except for moving the PoolKey struct definition to a separate PoolKey.sol file.

Tests have been refactored to test against both UniV3 and PCSV3 implementations where applicable.

Notable differences between UniV3 and PCSV3:

  • PCSV3 uses the deployer contract address instead of the factory when computing pool addresses. The two added libraries reflect this difference.
  • PCSV3 pool slot0's feeProtocol is uint32 instead of uint8. A PCSV3 counterpart of the PoolCaller library has NOT been created because Aperture doesn't have an immediate need for this. However, all other functions in the PoolCaller library should also work for PCSV3.
  • PCSV3 pool's swap callback is named pancakeV3SwapCallback instead of uniswapV3SwapCallback. This is reflected in the PoolCaller swap test (PoolCaller.t.sol).

@gnarlycow gnarlycow merged commit 1a3c2f1 into main Mar 23, 2024
2 checks passed
@gnarlycow gnarlycow deleted the pcs-dev branch March 23, 2024 22:09
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants