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

🗞️ add MintBurnOFTAdapter to oft-evm package #1054

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

Conversation

St0rmBr3w
Copy link
Contributor

@St0rmBr3w St0rmBr3w commented Nov 20, 2024

In this PR:

This PR introduces the audited MintBurnOFTAdapter example to the oft-evm package and updates the relevant tests to ensure its proper functionality. The MintBurnOFTAdapter provides a generic solution for integrating tokens that utilize mint and burn mechanisms into the LayerZero Omnichain Fungible Token (OFT) framework.

Key Changes:

Added MintBurnOFTAdapter Contract:

  • Implemented an abstract contract MintBurnOFTAdapter that inherits from OFTCore.
  • Provides implementations for the _debit and _credit functions using mint and burn operations via a IMintableBurnable interface.
  • Designed to work with tokens that have mintable and burnable capabilities, facilitating cross-chain transfers without the need for token approvals.

Updated Tests:

  • Added new test cases to cover the functionality of the MintBurnOFTAdapter.
  • Ensured existing tests are compatible and pass with the introduction of the new adapter.

Discussion Points:

Discrepancies Between Generic Version and FRAX Implementation:

  • There are noticeable differences between this generic version of the MintBurnOFTAdapter and the specific implementation used by FRAX. Notably:

    • The FRAX implementation uses a direct OFTMinterBurner, whereas the generic version references an ElevatedMinterBurnerMock.
    • Different ERC20 tokens have varying implementations of the _mint and _burn functions, often with guarded access or additional logic. Tokens with unique or restricted mint/burn functions may require custom implementations or extensions of the adapter.

Developers should have clear guidelines on how to adapt the MintBurnOFTAdapter to their specific token logic.

To-Do:

  • Unify Around Intended Developer Experience

  • Decide whether to maintain a generic adapter or create specialized versions for different token types.

  • Consider providing base contracts that can be extended for tokens with custom mint/burn logic.

@St0rmBr3w St0rmBr3w changed the title feat: add MintBurnOFTAdapter to oft-evm package 🗞️ add MintBurnOFTAdapter to oft-evm package Nov 20, 2024
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