ERC6909 to ERC20 converter using ERC-7511 minimal proxy clones for gas-efficient token wrapping.
This smart contract allows you to wrap ERC6909 tokens into ERC20 tokens using ERC-7511 minimal proxy clones for gas-efficient deployment.
Inspired by the Gnosis 1155-to-20 converter, adapted for the ERC6909 multi-token standard.
- The ERC6909 token must implement
IERC6909Metadatainterface for automatic metadata wrapping
Uses CreateX for deterministic cross-chain deployments.
# Copy environment template
cp .env.example .envFill in your .env file:
PRIVATE_KEY=your_private_key_here
RPC_URL=your_rpc_url_here# Set your desired network RPC URL in .env and run:
./script/deploy.shThe script will deploy the factory contract on the block explorer.
- Gas Efficient: Uses ERC-7511 minimal proxy with PUSH0 optimization (saves 200 gas at deployment, 5 gas at runtime)
- Deterministic Addresses: Predictable wrapper addresses
- Metadata Preservation: Automatically wraps original token metadata
// Wrap ERC6909 tokens (without initial deposit - just creates wrapper)
Wrapped6909Factory factory = new Wrapped6909Factory();
address wrappedToken = factory.wrap6909(erc6909Address, tokenId, 0);
// Wrap ERC6909 tokens with deposit
address wrappedTokenWithDeposit = factory.wrap6909(erc6909Address, tokenId, amount);
// Deposit ERC6909 → mint ERC20
IWrapped6909(wrappedToken).depositFor(recipient, amount);
// Withdraw ERC20 → burn and get ERC6909
IWrapped6909(wrappedToken).withdrawTo(recipient, amount);git clone JhChoy/6909-to-20
cd 6909-to-20
forge testMainnet (1): 0x9050b0A12D92b8ba7369ecc87BcD04643Fa0CfDB
Sepolia (11155111): 0x9050b0A12D92b8ba7369ecc87BcD04643Fa0CfDB
Arbitrum (42161): 0x9050b0A12D92b8ba7369ecc87BcD04643Fa0CfDB
Arbitrum Sepolia (421614): 0x9050b0A12D92b8ba7369ecc87BcD04643Fa0CfDB
Base (8453): 0x9050b0A12D92b8ba7369ecc87BcD04643Fa0CfDB
Monad Mainnet (143) 0x9050b0A12D92b8ba7369ecc87BcD04643Fa0CfDB
Monad Testnet (10143): 0x9050b0A12D92b8ba7369ecc87BcD04643Fa0CfDB
GPL-2.0-or-later