Skip to content

Mint self burn adapter - #1573

Closed
AlexanderLiteplo wants to merge 3 commits into
mainfrom
mint-self-burn-adapter
Closed

Mint self burn adapter#1573
AlexanderLiteplo wants to merge 3 commits into
mainfrom
mint-self-burn-adapter

Conversation

@AlexanderLiteplo

@AlexanderLiteplo AlexanderLiteplo commented Jun 18, 2025

Copy link
Copy Markdown
Contributor

Add Generic Mint-Self-Burn OFT Adapter for Audit

Overview

This PR introduces a generic OFT adapter implementation designed for tokens with a specific burn pattern, created to be audit-ready without any project-specific references.

What's Added

New Contracts:

  • IMintSelfBurnToken.sol - Interface for tokens with mint and self-burn functionality
  • MintSelfBurnToken.sol - Generic ERC20 implementation with access-controlled mint/burn
  • MintSelfBurnOFTAdapter.sol - OFT adapter for self-burn pattern tokens

Key Technical Feature: Self-Burn Pattern

This adapter is designed for tokens where the burn function has a specific signature:

function burn(uint256 amount) public onlyRole(BURNER_ROLE) {
    _burn(msg.sender, amount); // Always burns from caller, never from other addresses
}

This is different from typical burnable tokens that might allow burnFrom(address, amount) with approval.

How It Works

  • Sending: Transfers tokens from user to adapter → adapter burns its own tokens (self-burn)
  • Receiving: Mints new tokens directly to recipient
  • Access Control: Uses OpenZeppelin's AccessControl with MINTER_ROLE and BURNER_ROLE

File Organization

Files placed in standard LayerZero package structure:

  • Interface: packages/oft-evm/contracts/interfaces/IMintSelfBurnToken.sol
  • Contracts: packages/oft-evm/contracts/MintSelfBurnToken.sol & MintSelfBurnOFTAdapter.sol

Usage

Any token implementing IMintSelfBurnToken can use this adapter. The adapter requires MINTER_ROLE and BURNER_ROLE permissions on the token contract.


This adapter pattern is particularly useful for projects that need cross-chain functionality with tokens that have self-burn semantics rather than delegated burning patterns.

@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Added@​layerzerolabs/​metadata-tools@​0.4.1731009690100
Added@​openzeppelin/​contracts@​4.9.6100100989390

View full report

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