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.sol to oft-evm package #1116

Merged
merged 3 commits into from
Dec 10, 2024

Conversation

St0rmBr3w
Copy link
Contributor

@St0rmBr3w St0rmBr3w commented Dec 7, 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 Add MintBurnOFTAdapter.sol from feat/add-mint-burn-oft-adapter branch Add MintBurnOFTAdapter.sol to oft-evm package Dec 7, 2024
@St0rmBr3w St0rmBr3w changed the title Add MintBurnOFTAdapter.sol to oft-evm package 🗞️ Add MintBurnOFTAdapter.sol to oft-evm package Dec 7, 2024
Copy link
Contributor

@shankars99 shankars99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@St0rmBr3w St0rmBr3w merged commit 5c47a41 into main Dec 10, 2024
10 checks passed
@St0rmBr3w St0rmBr3w deleted the feat/add-mint-and-burn-oft-adapter branch December 10, 2024 17:19
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.

3 participants