Skip to main content
After compiling your smart contract, you can deploy it to the Hedera network. The deployment payload, or “init code”, contains the constructor logic together with the contract’s runtime bytecode. When deploying, the EVM is expected to be supplied with both the smart contract bytecode and the gas required to execute and deploy the contract. The constructor runs once during deployment and returns the runtime_bytecode, which is what’s stored on-chain for future contract interactions. Hyperledger Besu EVM Pectra Hard Fork Past Hard Forks Solidity Variables and Opcodes

Ethereum Virtual Machine (EVM)

The Ethereum Virtual Machine (EVM) is a run-time environment for executing smart contracts written in EVM native programming languages, like Solidity. The source code must be compiled into bytecode for the EVM to execute a given smart contract. On Hedera, users can interact with the EVM-compatible environment in several ways. They can submit ContractCreate, EthereumTransaction, or make eth_sendRawTransaction RPC calls with the contract bytecode directly. These various paths allow developers to deploy and manage smart contracts efficiently. When the EVM receives the bytecode, it will be further broken down into operation codes (opcodes). The EVM opcodes represent the specific instructions it can perform. Each opcode is one byte and has its own gas cost associated with it. The cost per opcode for the Ethereum Pectra hard fork (Prague EVM execution layer) can be found here.

Smart Contract Opcode Example

PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0x10 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x40 MLOAD PUSH2 0x558 CODESIZE SUB DUP1 PUSH2 0x558 DUP4 CODECOPY DUP2 DUP2 ADD PUSH1 0x40 MSTORE PUSH1 0x20 DUP2 LT ISZERO PUSH2 0x33 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 ADD SWAP1 DUP1 DUP1 MLOAD PUSH1 0x40 MLOAD SWAP4 SWAP3 SWAP2 SWAP1 DUP5 PUSH5 0x100000000 DUP3 GT ISZERO PUSH2 0x53 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP4 DUP3 ADD SWAP2 POP PUSH1 0x20 DUP3 ADD DUP6 DUP2 GT ISZERO PUSH2 0x69 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP3 MLOAD DUP7 PUSH1 0x1 DUP3 MUL DUP4 ADD GT PUSH5 0x100000000 DUP3 GT OR ISZERO PUSH2 0x86 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP1 DUP4 MSTORE PUSH1 0x20 DUP4 ADD SWAP3 POP POP POP SWAP1 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0xBA JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x9F JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0xE7 JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP PUSH1 0x40 MSTORE POP POP POP CALLER PUSH1 0x0 DUP1 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP DUP1 PUSH1 0x1 SWAP1 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 PUSH2 0x144 SWAP3 SWAP2 SWAP1 PUSH2 0x14B JUMP JUMPDEST POP POP PUSH2 0x1E8 JUMP JUMPDEST DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 PUSH1 0x1F ADD PUSH1 0x20 SWAP1 DIV DUP2 ADD SWAP3 DUP3 PUSH1 0x1F LT PUSH2 0x18C JUMPI DUP1 MLOAD PUSH1 0xFF NOT AND DUP4 DUP1 ADD OR DUP6 SSTORE PUSH2 0x1BA JUMP JUMPDEST DUP3 DUP1 ADD PUSH1 0x1 ADD DUP6 SSTORE DUP3 ISZERO PUSH2 0x1BA JUMPI SWAP2 DUP3 ADD JUMPDEST DUP3 DUP2 GT ISZERO PUSH2 0x1B9 JUMPI DUP3 MLOAD DUP3 SSTORE SWAP2 PUSH1 0x20 ADD SWAP2 SWAP1 PUSH1 0x1 ADD SWAP1 PUSH2 0x19E JUMP JUMPDEST JUMPDEST POP SWAP1 POP PUSH2 0x1C7 SWAP2 SWAP1 PUSH2 0x1CB JUMP JUMPDEST POP SWAP1 JUMP JUMPDEST JUMPDEST DUP1 DUP3 GT ISZERO PUSH2 0x1E4 JUMPI PUSH1 0x0 DUP2 PUSH1 0x0 SWAP1 SSTORE POP PUSH1 0x1 ADD PUSH2 0x1CC JUMP JUMPDEST POP SWAP1 JUMP JUMPDEST PUSH2 0x361 DUP1 PUSH2 0x1F7 PUSH1 0x0 CODECOPY PUSH1 0x0 RETURN INVALID PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0x10 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x4 CALLDATASIZE LT PUSH2 0x36 JUMPI PUSH1 0x0 CALLDATALOAD PUSH1 0xE0 SHR DUP1 PUSH4 0x2E982602 EQ PUSH2 0x3B JUMPI DUP1 PUSH4 0x32AF2EDB EQ PUSH2 0xF6 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0xF4 PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH1 0x20 DUP2 LT ISZERO PUSH2 0x51 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 PUSH5 0x100000000 DUP2 GT ISZERO PUSH2 0x6E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP3 ADD DUP4 PUSH1 0x20 DUP3 ADD GT ISZERO PUSH2 0x80 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP2 DUP5 PUSH1 0x1 DUP4 MUL DUP5 ADD GT PUSH5 0x100000000 DUP4 GT OR ISZERO PUSH2 0xA2 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST SWAP2 SWAP1 DUP1 DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP4 DUP1 DUP3 DUP5 CALLDATACOPY PUSH1 0x0 DUP2 DUP5 ADD MSTORE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND SWAP1 POP DUP1 DUP4 ADD SWAP3 POP POP POP POP POP POP POP SWAP2 SWAP3 SWAP2 SWAP3 SWAP1 POP POP POP PUSH2 0x179 JUMP JUMPDEST STOP JUMPDEST PUSH2 0xFE PUSH2 0x1EC JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP1 PUSH1 0x20 ADD DUP3 DUP2 SUB DUP3 MSTORE DUP4 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x13E JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x123 JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0x16B JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP SWAP3 POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH1 0x0 DUP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ PUSH2 0x1D1 JUMPI PUSH2 0x1E9 JUMP JUMPDEST DUP1 PUSH1 0x1 SWAP1 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 PUSH2 0x1E7 SWAP3 SWAP2 SWAP1 PUSH2 0x28E JUMP JUMPDEST POP JUMPDEST POP JUMP JUMPDEST PUSH1 0x60 PUSH1 0x1 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV DUP1 ISZERO PUSH2 0x284 JUMPI DUP1 PUSH1 0x1F LT PUSH2 0x259 JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x284 JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0x267 JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP SWAP1 POP SWAP1 JUMP JUMPDEST DUP3 DUP1 SLOAD PUSH1 0x1 DUP2 PUSH1 0x1 AND ISZERO PUSH2 0x100 MUL SUB AND PUSH1 0x2 SWAP1 DIV SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 PUSH1 0x1F ADD PUSH1 0x20 SWAP1 DIV DUP2 ADD SWAP3 DUP3 PUSH1 0x1F LT PUSH2 0x2CF JUMPI DUP1 MLOAD PUSH1 0xFF NOT AND DUP4 DUP1 ADD OR DUP6 SSTORE PUSH2 0x2FD JUMP JUMPDEST DUP3 DUP1 ADD PUSH1 0x1 ADD DUP6 SSTORE DUP3 ISZERO PUSH2 0x2FD JUMPI SWAP2 DUP3 ADD JUMPDEST DUP3 DUP2 GT ISZERO PUSH2 0x2FC JUMPI DUP3 MLOAD DUP3 SSTORE SWAP2 PUSH1 0x20 ADD SWAP2 SWAP1 PUSH1 0x1 ADD SWAP1 PUSH2 0x2E1 JUMP JUMPDEST JUMPDEST POP SWAP1 POP PUSH2 0x30A SWAP2 SWAP1 PUSH2 0x30E JUMP JUMPDEST POP SWAP1 JUMP JUMPDEST JUMPDEST DUP1 DUP3 GT ISZERO PUSH2 0x327 JUMPI PUSH1 0x0 DUP2 PUSH1 0x0 SWAP1 SSTORE POP PUSH1 0x1 ADD PUSH2 0x30F JUMP JUMPDEST POP SWAP1 JUMP INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 AND DIFFICULTY CHAINID 0x5F 0x5F PUSH20 0xDFD73A518B57770F5ADB27F025842235980D7A0F 0x4E ISZERO 0xB1 0xAC 0xB1 DUP15 PUSH5 0x736F6C6343 STOP SMOD STOP STOP CALLER
Reference: ethervm.io

Deployment Options

SDK You can use a Hedera SDK to deploy your smart contract bytecode to the network. This approach does not require using any EVM tools like Hardhat or an instance of the Hedera JSON-RPC Relay. Hardhat Hardhat can be used to deploy your smart contract by pointing to a community-hosted JSON-RPC Relay. However, EVM tools do not support features that are native to Hiero Contracts like:
  • Admin Key
  • Contract Memo
  • Automatic Token Associations
  • Auto Renew Account ID
  • Staking Node ID or Account ID
  • Decline Staking Rewards
If you need to set any of the above properties for your contract, you will have to call the ContractCreateTransaction API using one of the Hedera SDKs.

Deploy A Smart Contract Using Hardhat Hedera Json Rpc Relay

Deploying Large Contracts

Hedera supports jumbo Ethereum transactions (HIP-1086) for large bytecode payloads, letting you include callData directly in ethereumData without using the File Service (callDataFileId). The exact ceilings are network-configurable parameters, not fixed protocol constants; current values are on the order of ~24KB for contract creation (the EIP-170 code-size limit) and ~128KB for contract calls. Check the active network configuration for the precise limits. However, jumbo transactions:
  • Can’t be included in batch transactions (TransactionList).
  • Are subject to network throttling based on bytes per second and per-node limits.

Bytecode and Gas Essentials

When deploying contracts, gas must cover both intrinsic gas and the cost of executing deployment code. Intrinsic gas includes a base fee (21,000) plus a per-byte cost for callData:
  • 4 gas per zero byte
  • 16 gas per non-zero byte

Example

If your contract bytecode is 10KB, with 20% (2KB) as zero bytes and 80% (8KB) as non-zero bytes:
  • gas for zero bytes: 4 × 2,048 = 8,192
  • gas for non-zero bytes: 16 × 8,192 = 131,072
  • total intrinsic gas = 21,000 + 8,192 + 131,072 = 160,264
Under Pectra, the transaction also has to satisfy the EIP-7623 calldata floor: 21000 + 10 × (zero + 4 × non_zero). For this example that floor is 21,000 + 10 × (2,048 + 4 × 8,192) = 369,160 gas, well above the 160,264 intrinsic figure. The deployment pays whichever is greater: the intrinsic plus execution total, or the floor. In practice deployment execution includes the code-deposit charge (200 gas per byte of runtime bytecode, roughly 2M gas for a 10KB contract), which pushes the standard total far past the floor, so the floor mainly matters for calldata-heavy transactions with little execution work. Ensure you adjust gasLimit (RLP) and maxGasAllowance (wrapper) to cover this total gas.

Hyperledger Besu EVM on Hedera

The Hedera network nodes utilize the HyperLedger Besu EVM Client written in Java as an execution layer for Ethereum-type transactions. The codebase is up to date with the current Ethereum Mainnet hard forks. The Besu EVM client library is used without hooks for Ethereum’s consensus, networking, and storage features. Instead, Hedera hooks into its own Hashgraph consensus, Gossip communication, and Virtual Merkle Trees components for greater fault tolerance, finality, and scalability. The Besu EVM client is configured to support the Pectra hard fork of the Ethereum Mainnet (activated May 7, 2025), with some modifications. Pectra was originally introduced on Hedera under HIP-1340 (EOA Code Delegation) and HIP-1341 (Support for Ethereum Pectra Release).

Pectra Hard Fork

The smart contract platform has been upgraded to support the visible EVM changes introduced in the Pectra hard fork (Prague execution layer + Electra consensus layer). The applicable EIPs adopted on Hedera are:
EIPTitleSummary
EIP-2537BLS12-381 curve precompilesAdds precompiles at addresses 0x0b0x11 for efficient BLS signature/pairing operations.
EIP-7623Increase calldata cost (floor)Introduces a calldata gas floor: 21000 + 10 × (zero_bytes + 4 × non_zero_bytes).
EIP-7702Set EOA account codeAdds a new transaction type (Type 4) allowing EOAs to delegate execution to a contract. See EOA Code Delegation.
The following Pectra EIPs are not applicable to Hedera and are not adopted: EIP-7691, EIP-7840 (blob-related, Hedera does not support blobs), EIP-6110, EIP-7002, EIP-7251, EIP-7685 (Ethereum validator features, no Hedera equivalent), EIP-2935, EIP-7549 (Ethereum 2.0 features), EIP-7642 (informational). Per HIP-1341. As of the Consensus Node 0.22 release (HIP-185), gas and input data costs are charged. The amount of intrinsic gas consumed is a constant charge that occurs before any code executes. The intrinsic gas cost is 21,000. The associated cost of input data is 16 gas for each byte of data that is not zero and 4 gas for each byte of data that is zero. Under Pectra (EIP-7623), an additional floor of 21000 + 10 × (zero + 4 × non_zero) applies to calldata-heavy transactions. The amount of intrinsic gas consumed is charged in relation to the data supplied when making a contract call to the function parameters of external contracts. The gas schedule and the fees table can be found in the gas section of this documentation page.

Supported Ethereum Transaction Types

EthereumTransaction accepts RLP-encoded payloads for all of the following types:
TypeSpecDescription
0Legacy (EIP-155)Pre-Berlin legacy transactions.
1EIP-2930Optional access_list to pre-warm storage slots and addresses.
2EIP-1559max_fee_per_gas + max_priority_fee_per_gas (priority fee is ignored on Hedera; fees are fixed by the network).
4EIP-7702 (Pectra)Adds an authorization_list for EOA code delegation. See EOA Code Delegation.
Type 3 (blob transactions per EIP-4844) is not supported on Hedera (see HIP-866).

Blobs supported on Hedera?

Hedera does not provide blobs under EIP-4844 (Cancun), nor under the Pectra blob-throughput EIPs (EIP-7691, EIP-7840). HIP-866 defines how Hedera behaves without blob support. To preserve compatibility and future design space, Hedera acts as if blobs are not being added. This allows existing contracts that depend on blob behavior to function without blobs. Blobs are prevented from entering the system by prohibiting “Type 3” transactions, which enable blobs. This keeps blobs out of the EVM’s concern without affecting other desirable interactions on Hedera. With jumbo EthereumTransaction support (HIP-1086) on Hedera, large callData payloads are the preferred path for rollup-style data.

Past Hard Forks

Hedera tracks Ethereum mainnet hard forks and adopts the EIPs that apply to the Smart Contract Service. The table below summarizes recent forks and the practical differences between them on Hedera.
Fork (Ethereum activation)First adopted on HederaHeadline changes on Hedera
Pectra (May 7, 2025)HIP-1340, HIP-1341EIP-2537: BLS12-381 precompiles (0x0b0x11).
EIP-7623: calldata gas floor.
EIP-7702: new Type 4 EthereumTransaction and authorization_list enabling EOA code delegation.
Cancun (Mar 13, 2024)Mainnet release v0.50• New opcodes TLOAD/TSTORE (transient storage), MCOPY, BLOBHASH, BLOBBASEFEE.
SELFDESTRUCT semantics updated per EIP-6780.
• Blob support (EIP-4844) not adopted; Type 3 transactions are rejected (HIP-866).
Shanghai (Apr 12, 2023)Mainnet release v0.38PUSH0 opcode.
• Updated INITCODE cost for contract creation.

What changed from Cancun to Pectra?

If you previously targeted Cancun, the practical differences on Hedera are:
  1. New transaction type: Type 4. The EthereumTransaction HAPI message now accepts RLP-encoded Type 4 payloads carrying an authorization_list. Each authorization sets a delegation_address on the signing EOA, causing future EVM calls to that EOA to execute the target contract’s bytecode in the EOA’s storage context (similar to DELEGATECALL). Full details in EOA Code Delegation.
  2. EOA bytecode is no longer always empty. Pre-Pectra, eth_getCode(eoa) always returned empty. After Pectra, an EOA with delegation set returns the Delegation Indicator 0xef0100 || <20-byte target address>. EOAs may now also have non-empty storage slots and emit logs.
  3. Calldata floor (EIP-7623). Calldata-heavy transactions must now pay at least 21000 + 10 × (zero_bytes + 4 × non_zero_bytes). Standard contract calls (where execution gas dominates) are unaffected.
  4. BLS12-381 precompiles (EIP-2537). Seven new precompiles at addresses 0x0b0x11 for G1/G2 add, multi-scalar multiplication, pairing check, and field-to-curve mapping. These make BLS aggregation, threshold signatures, and zk-friendly cryptography native (no Solidity gymnastics).
  5. HTS/HSS facade calls re-implemented as Delegation Indicators. Token and Schedule “proxy” accounts now return a fixed Delegation Indicator pointing at the corresponding system contract instead of dynamic synthesized bytecode. User-visible behavior is unchanged, but tools that inspect the bytecode of these proxy accounts will now see a consistent 0xef0100...-prefixed value rather than a custom DELEGATECALL shim.
  6. HAS precedence rules. When an EOA has a code delegation set, calls whose 4-byte selector matches a Hedera Account Service facade function (hbarAllowance, hbarApprove, setUnlimitedAutomaticAssociations) are routed to HAS and take precedence over the user’s delegation. Be aware of potential selector collisions when designing a smart-account delegate.
Blobs (EIP-4844 / EIP-7691 / EIP-7840) remain unsupported on Hedera. Type 3 transactions are rejected.

Solidity Variables and Opcodes

The table below defines the mapping of Solidity variables and operation codes to Hedera. The full list of supported Opcodes for the Pectra hard fork (Prague EVM execution layer) can be found here.
SolidityOpcodeHedera
addressThe address is a mapping of shard.realm.number (0.0.10) into a 20 byte Solidity address. The address can be a Hedera account ID or contract ID in Solidity format.
block.basefeeBASEFEEThe BASEFEE opcode will return zero. Hedera does not use the Fee Market mechanism this is designed to support.
block.chainidCHAINIDThe CHAINID opcode will return 295(hex 0x0127) for mainnet, 296( hex 0x0128) for testnet, 297( hex 0x0129) for previewnet, and 298 (0x12A) for development networks.
block.coinbaseCOINBASEThe COINBASE operation will return the funding account (Hedera transaction fee collecting account 0.0.98).
block.numberThe index of the record file (not recommended, use block.timestamp).
block.timestampThe transaction consensus timestamp.
block.difficultyAlways zero.
block.gaslimitGASLIMITThe GASLIMIT operation will return the gasLimit of the transaction. The transaction gasLimit will be the lowest of the gas limit requested in the transaction or a global upper gas limit configured for all smart contracts.
msg.senderThe address of the Hedera contract ID or account ID in Solidity format that called this contract. For the root level or for delegate chains that go to the root, it is the account ID paying for the transaction.
msg.valueThe value associated to the transaction associated in tinybar.
tx.originThe account ID paying for the transaction, regardless of depth.
tx.gaspriceFixed (varies with the global fee schedule and exchange rate).
selfdestruct
(address payable recipient)
SELFDESTRUCTAddress will not be reusable due to Hedera’s account numbering policies. On SELFDESTRUCT the contracts HBAR and HTS tokens are transferred to the recipients. If the recipient does not exist or does not have an allowance for any of the HTS tokens, this opcode will fail.
<address>.codePrecompile and system-contract addresses (including the HTS system contract at 0x167) report no code. Under Pectra (HIP-1340), HTS token and HSS schedule proxy addresses, and EOAs with a code delegation set, report a 23-byte 0xef0100… Delegation Indicator instead of empty code. See EOA Code Delegation.
<address>.codehashPrecompile contract addresses will report the empty code hash.
PRNG system contract (0x169)There is no PRNG opcode. Per HIP-351, contracts call getPseudorandomSeed() on the PRNG system contract at 0x169, which returns a 256-bit seed derived from the n-3 record running hash.
delegateCallContracts may no longer use delegateCall() to invoke system contracts. Contracts should instead use the call() method.
blobVersionedHashesAtIndexBLOBHASHThe BLOBHASH operation will return all zeros at all times.
blobBaseFeeBLOBBASEFEEThe BLOBBASEFEE operation will return
1 at all times.
Reference: HIP-866, HIP-868

Limitation on fallback() / receive() Functions in Hiero Contracts

When developing smart contracts on Hedera, it’s important to understand that the fallback() and receive() functions do not get triggered when a contract receives HBAR via a crypto transfer. In Ethereum, these functions act as “catch-all” mechanisms when a contract receives Ether. In Hedera, however, contract balances may change through native HAPI operations, independent of EVM message calls, making it impossible to maintain balance-related invariants with just the fallback() or receive() methods.

Impacted Variables

  • msg.sender: The address initiating the contract call.
  • msg.value: The amount of HBAR sent along with the call.

Key Points

  • Developers should implement explicit functions to handle HBAR transfers.
  • To disable native operations entirely, consider submitting a Hedera Improvement Proposal (HIP).
Understanding these differences is crucial for anyone developing smart contracts on Hedera, particularly those familiar with Ethereum.

FAQs

Yes, you can use Solidity functions directly with the Hedera EVM. However, refer to the Solidity Variables and Opcodes table to understand any modifications to opcode descriptions that better reflect their behavior on the Hedera network.
Yes. Hedera supports jumbo Ethereum transactions (HIP-1086), which carry callData directly in ethereumData and remove the need to upload bytecode to the File Service in most cases. Note that jumbo transactions cannot be included in a TransactionList (batch); each one must be submitted individually. See Deploying Large Contracts for the current size ceilings and throttling details.
Gas covers intrinsic costs (base + per-byte of callData) and execution costs (opcodes run by the EVM). Ensure your gasLimit and maxGasAllowance cover the total. See the gas and fees page for details.
Hedera does not trigger fallback() or receive() functions on HBAR transfers. Balances may change through native operations, so use explicit functions to handle HBAR. Learn more.
Yes, but Hardhat cannot set Hedera-native properties like admin key or token associations. For these, use the Hedera SDK.
Yes, while the Hedera EVM supports the updated opcodes from the Pectra hard fork (including Cancun-era TLOAD/TSTORE/MCOPY and Pectra-era BLS12-381 precompiles), you should know the intrinsic gas costs and input data charges specific to Hedera, including the EIP-7623 calldata floor. Refer to the gas schedule and fees table for more information.
Yes. Hedera supports Type 4 EthereumTransaction payloads under HIP-1340. You can also configure EOA code delegation via native CryptoCreate / CryptoUpdate transactions. See the EOA Code Delegation page for both paths and the HAS precedence rules.