Difference Between Ethereum and Mantle
Mantle is developed based on the OP Stack architecture. While it shares many design similarities with Ethereum, there are differences when transitioning from Ethereum to Mantle.
Key Differences
Opcodes
While Mantle aims for Ethereum compatibility, there may be differences in supported opcode sets or their specific implementations. Developers transitioning from Ethereum should review and adjust their smart contracts accordingly. Refer to the table below for detailed information:
Opcode | Solidity equivalent | Behavior |
---|---|---|
COINBASE | block.coinbase | In mantle-V2 Tectonic, block coinbase is the SequencerFeeVault , which address is 0x4200000000000000000000000000000000000011 |
DIFFICULTY | block.difficulty | Random value. As this value is set by the sequencer, it is not as reliably random as the L1 equivalent. |
NUMBER | block.number | L2 block number |
TIMESTAMP | block.timestamp | Timestamp of the L2 block |
ORIGIN | tx.origin | If the transaction is an L1 ⇒ L2 transaction, then tx.origin is set to the aliased address of the address that triggered the L1 ⇒ L2 transaction. Otherwise, this opcode behaves normally. |
CALLER | msg.sender | If the transaction is an L1 ⇒ L2 transaction, and this is the initial call (rather than an internal transaction from one contract to another), the same address aliasing behavior applies. |
Unsupported Opcodes
The following opcodes are not supported in Mantle:
Opcode | Implementation Info | Behavior |
---|---|---|
TLOAD 、TSTORE | Introduced in EIP-1153 | Manipulate state that behaves almost identically to storage but is discarded after every transaction |
MCOPY | Introduced in EIP-5656 | An efficient EVM instruction for copying memory areas, enabled in Cancun upgrade |
BLOBHASH | Introduced in EIP-4844 | Opcode to get versioned hashes, enabled in Cancun upgrade |
BLOBBASEFEE | Introduced in EIP-7516 | Instruction that returns the current data-blob base-fee, enabled in Cancun upgrade |
Blocks
As a rollup, Mantle's block structure may differ from Ethereum, including block construction time, block size, and more. Developers should familiarize themselves with Mantle's block specifications for optimal integration. Refer to this for more details.
Network Specifications
Mantle has distinct network specifications compared to Ethereum, particularly in JSON-RPC differences. Understanding these variances is crucial for a smooth transition to Mantle. Refer to this for more details.
Transaction Costs
As a rollup on Ethereum, Mantle's transaction cost composition differs from L1. Developers should understand Mantle's fee structure to optimize their applications' performance on Mantle Network. Refer to this for more details.
Solidity Support
Currently Mantle doesn't support the latest version of the Solidity. Make sure your Solidity compiler version is lower than v0.8.23 when you deploy the contract.