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

OFT v2 Refactoring to support uint256 amount #53

Closed
wants to merge 7 commits into from

Conversation

0xIryna
Copy link
Contributor

@0xIryna 0xIryna commented Dec 13, 2022

The scope of this PR:

  1. Remove type(uint64).max limit for amount from OFTV2Core, ProxyOFTV2 and ProxyOFTWithFee
  2. Introduce OFTV2Aptos, ProxyOFTV2Aptos, ProxyOFTWithFeeAptos that allow no more than 6 shared decimals and have type(uint64).max limit for amount
  3. Replace abi.encodePacked with abi.encode in OFTV2Core and derived contracts
    Using abi.encodePacked makes encoding inconsistent with previous versions and decoding ugly. Additionally, abi.encodePacked will be removed in a future version of Solidity (see Remove abi.encodePacked ethereum/solidity#11593)

NOTE: there isn't a good way to extract all Aptos overrides in one contract (diamond inheritance problem), thus the same code is duplicated in OFTV2Aptos, ProxyOFTV2Aptos, and ProxyOFTWithFeeAptos contracts. The same issue is present in ProxyOFTV2 and ProxyOFTWithFee

@0xIryna 0xIryna self-assigned this Dec 13, 2022
@0xIryna 0xIryna closed this Oct 6, 2023
@TRileySchwarz TRileySchwarz deleted the oft-v2-refactoring branch October 25, 2023 22:18
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.

1 participant