🗞️ add MintBurnOFTAdapter to oft-evm package #1054
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.