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. |
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.