Skip to main content

EVM Compatibility

Mersennet implements an EVM-compatible execution environment, allowing developers to deploy and run existing Ethereum smart contracts with minimal or no modification. This document describes the EVM implementation, supported features, and differences from Ethereum mainnet.

Overview​

AspectMersennet
EVM VersionShanghai
Chain ID7919
TokenPRIM (18 decimals)
Block Time~1 second

Shanghai EVM​

Mersennet targets the Shanghai EVM specification, which includes:

  • All pre-Shanghai opcodes and semantics
  • PUSH0 (EIP-3855) β€” Push constant 0 onto the stack
  • EVM Object Format (EOF) support for future contract upgrades

This ensures compatibility with the vast majority of Solidity contracts and tooling (Hardhat, Foundry, Remix, and standard wallets).

Supported Opcodes​

Mersennet supports the standard Ethereum opcodes defined in the Shanghai spec, including:

  • Arithmetic: ADD, SUB, MUL, DIV, MOD, etc.
  • Comparison: LT, GT, SLT, SGT, EQ, etc.
  • Bitwise: AND, OR, XOR, NOT, SHL, SHR, SAR
  • Crypto: KECCAK256, ECRE cover, ECRECOVER
  • Memory/Storage: MSTORE, MLOAD, SLOAD, SSTORE
  • Control flow: JUMP, JUMPI, PC, JUMPDEST
  • System: CALL, DELEGATECALL, STATICCALL, CREATE, CREATE2
  • Block/Context: BLOCKHASH, TIMESTAMP, NUMBER, etc.

Precompiles​

Standard Ethereum Precompiles​

Mersennet supports all standard Ethereum precompiles:

AddressPrecompileDescription
0x01ecRecoverECDSA signature recovery
0x02SHA256SHA-256 hash
0x03RIPEMD160RIPEMD-160 hash
0x04identityIdentity (copy input to output)
0x05modexpModular exponentiation
0x06ecAddElliptic curve point addition
0x07ecMulElliptic curve scalar multiplication
0x08ecPairingBN254 pairing

Mersennet Extension: PrimeOrders​

Mersennet adds a custom precompile for the native order matching engine:

AddressPrecompileDescription
0x0100PrimeOrdersNative on-chain CLOB

See PrimeOrders (On-chain CLOB) for full documentation.

Gas Metering​

Mersennet uses gas metering consistent with Ethereum:

  • Each opcode has a cost (e.g. ADD = 3, SSTORE = 20,000 for cold)
  • Transactions specify a gasLimit; execution stops if gas is exhausted
  • Gas is paid in PRIM (converted at the current gas price)

Gas costs align with Ethereum's Shanghai spec for predictable behavior when porting contracts.

Differences from Ethereum Mainnet​

Transaction Format​

Mersennet may use a custom transaction format that differs from Ethereum's legacy or EIP-1559 formats. Key points:

  • Transactions still include: from, to, value, data, gasLimit, gasPrice (or equivalent)
  • EIP-1559 (dynamic base fee + priority fee) may not be fully implemented yetβ€”check the current network configuration
  • Chain ID 7919 is used for replay protection

No EIP-1559 Dynamic Fees (Yet)​

As of the current implementation, Mersennet may not support EIP-1559's dynamic base fee:

  • Ethereum: Base fee adjusts per block based on target utilization
  • Mersennet: May use a fixed or simpler fee model

Validators earn primarily from block rewards, not transaction fees. Fee market parameters can be updated via governance.

Block Structure​

Mersennet blocks include additional fields beyond standard Ethereum:

  • Rewards: Per-validator block reward distribution
  • PrimeOrders events: Order submissions, trades, liquidations (if applicable)

The RPC and block structure expose these for explorers and indexers.

Native Token​

  • Ethereum: ETH (18 decimals)
  • Mersennet: PRIM (18 decimals)

Same decimal precision, so contract logic that assumes 18 decimals works unchanged.

Summary​

FeatureStatus
Shanghai EVMβœ… Supported
Standard opcodesβœ… Supported
Standard precompilesβœ… Supported
PrimeOrders precompile (0x0100)βœ… Supported
Custom tx format⚠️ May differ
EIP-1559⚠️ Check network config
Gas meteringβœ… Ethereum-compatible

Mersennet is designed for EVM ecosystem compatibilityβ€”deploy your contracts, use your tools, and leverage the native PrimeOrders precompile for advanced DeFi strategies.