EVM Compatibility

Overview

OPN Chain provides full Ethereum Virtual Machine (EVM) compatibility, allowing developers to deploy existing Ethereum smart contracts without modification. This compatibility extends beyond basic functionality to include the latest Ethereum improvements, development tools, and ecosystem standards.

Compatibility Levels

1. Binary Compatibility

Complete Bytecode Support:

  • All EVM opcodes supported

  • Identical gas costs for operations

  • Same execution semantics

  • Bit-for-bit compatibility

Example:

// This Ethereum contract works identically on OPN Chain
contract Example {
    mapping(address => uint256) public balances;
    
    function deposit() public payable {
        balances[msg.sender] += msg.value;
    }
    
    function withdraw(uint256 amount) public {
        require(balances[msg.sender] >= amount, "Insufficient balance");
        balances[msg.sender] -= amount;
        payable(msg.sender).transfer(amount);
    }
}

2. API Compatibility

JSON-RPC Compliance:

Supported Method Namespaces:

  • web3_* - Client version, SHA3

  • net_* - Network ID, peer count, listening status

  • eth_* - All standard Ethereum methods

  • debug_* - Debugging and tracing

  • txpool_* - Transaction pool inspection

3. Tool Compatibility

Development Frameworks:

Tool
Compatibility
Notes

Hardhat

✅ Full

No modifications needed

Truffle

✅ Full

Standard config works

Foundry

✅ Full

Native support

Remix

✅ Full

Direct deployment

Brownie

✅ Full

Python framework

Ape

✅ Full

Modern Python tool

Example Hardhat Config:

4. Library Compatibility

Web3 Libraries:

Smart Contract Standards

ERC Standards Support

Standard
Description
Support

ERC-20

Fungible tokens

✅ Full

ERC-721

Non-fungible tokens

✅ Full

ERC-1155

Multi tokens

✅ Full

ERC-165

Interface detection

✅ Full

ERC-2981

NFT royalties

✅ Full

ERC-4626

Tokenized vaults

✅ Full

ERC-4337

Account abstraction

✅ Full

Example Implementations

ERC-20 Token:

ERC-721 NFT:

Address System

Address Format

OPN Chain uses the standard Ethereum address format:

  • 20-byte addresses (40 hex characters)

  • Checksummed addresses supported

  • Same derivation paths as Ethereum

Key Derivation

HD Wallet Compatibility:

Transaction Format

Transaction Types

OPN Chain supports all Ethereum transaction types:

Legacy Transactions (Type 0):

EIP-2930 Access List Transactions (Type 1):

EIP-1559 Transactions (Type 2):

Gas Compatibility

Gas Costs

OPN Chain uses Ethereum-compatible gas costs:

Gas Estimation

Event System

Event Emission

Event Filtering

State Management

Storage Layout

Storage layout matches Ethereum exactly:

State Access

Precompiled Contracts

All Ethereum precompiled contracts are available:

Differences from Ethereum

Block Time

The main difference is block time:

Finality Model

Gas Price Stability

Migration Guide

From Ethereum

  1. Update RPC Endpoint:

  1. Update Chain ID:

  1. Adjust Block Timing:

That's it! Everything else remains the same.

Testing Compatibility

Best Practices

1. Use Standard Tools

Stick to standard Ethereum development tools:

  • OpenZeppelin for contracts

  • Hardhat/Foundry for development

  • Ethers.js/Web3.js for integration

2. Test Thoroughly

3. Monitor Differences

Conclusion

OPN Chain's EVM compatibility means you can bring your entire Ethereum toolkit, knowledge, and existing contracts to a faster, more efficient blockchain. The few differences (like block time) are easy to account for, while the benefits of instant finality and low, stable gas costs make development simpler and more predictable.


Last updated