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 MintBurnOFTAdapterand 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.
In this PR:
This PR introduces the audited
MintBurnOFTAdapter
example to theoft-evm
package and updates the relevant tests to ensure its proper functionality. TheMintBurnOFTAdapter
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:MintBurnOFTAdapter
that inherits fromOFTCore
._debit
and_credit
functions usingmint
andburn
operations via aIMintableBurnable
interface.Updated Tests:
MintBurnOFTAdapter
.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:OFTMinterBurner
, whereas the generic version references anElevatedMinterBurnerMock
.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.