Skip to content

Jovay EVM Compatibility

This document outlines the key similarities and differences between the Jovay EVM on the testnet and the Ethereum EVM, specifically in comparison to the Prague version. Understanding these distinctions is crucial for developers building and deploying smart contracts on the Jovay network.

Key Differences with Ethereum EVM (Prague Version)

Though Jovay prioritizes a high degree of compatibility with the Ethereum EVM, its current testnet implementation diverges in several key aspects, notably due to differences in current design choices. These distinctions are largely transparent to most DApp developers, but awareness is crucial when leveraging specific features impacted by these underlying differences.

Opcode Differences

OpcodeSolidity syntaxBehavior on Jovay
COINBASEblock.coinbaseReturns 0. The behavior of this opcode is expected to change in future updates.
PREVRANDAOblock.prevrandaoReturns 0.Currently, Jovay does not support providing pseudo-random numbers via prevrandao
BASEFEEblock.basefeeThe base fee is configured by a system contract. In Ethereum, the base fee is dynamically and automatically set based on block size changes.
BLOBBASEFEEblock.blobbasefeeReturns 0. EIP-4844 is not currently supported.
BLOBHASHblock.blobhash(blobIndex)Returns 0. EIP-4844 is not currently supported.
BLOCKHASHblockhash(block.number)Returns the keccak256 hash of a block number, where the input to the hash is the block number in decimal string format.

Precompiled Contract Differences

The following precompiled contract address has a different implementation on the Jovay testnet.

AddressDescriptionBehavior on Jovay
0x0apoint evaluationNot supported at this time.

Supported Opcodes in Jovay EVM

The following is a comprehensive list of the opcodes supported by the Jovay EVM on the testnet.

OpcodeNameNotesDifference from Ethereum
0x00STOPhalt execution
0x01ADD(u)int256 addition modulo 2**256
0x02MUL(u)int256 multiplication modulo 2**256
0x03SUB(u)int256 addition modulo 2**256
0x04DIVuint256 division
0x05SDIVint256 division
0x06MODuint256 modulus
0x07SMODint256 modulus
0x08ADDMOD(u)int256 addition modulo N
0x09MULMOD(u)int256 multiplication modulo N
0x0AEXPuint256 exponentiation modulo 2**256
0x0BSIGNEXTENDsign extendx from (b+1) bytes to 32 bytes
0x0C-0x0Finvalid
0x10LTuint256 less-than
0x11GTuint256 greater-than
0x12SLTint256 less-than
0x13SGTint256 greater-than
0x14EQ(u)int256 equality
0x15ISZERO(u)int256 iszero
0x16ANDbitwise AND
0x17ORbitwise OR
0x18XORbitwise XOR
0x19NOTbitwise NOT
0x1ABYTEith byte of (u)int256 x, from the left
0x1BSHLshift left
0x1CSHRlogical shift right
0x1DSARarithmetic shift right
0x1E-1Finvalid
0x20KECCAK256keccak256
0x21-0x2Finvalid
0x30ADDRESSaddress of executing contract
0x31BALANCEbalance, in wei
0x32ORIGINaddress that originated the tx
0x33CALLERaddress of msg sender
0x34CALLVALUEmsg value, in wei
0x35CALLDATALOADread word from msg data at index idx
0x36CALLDATASIZElength of msg data, in bytes
0x37CALLDATACOPYcopy msg data
0x38CODESIZElength of executing contract's code, in bytes
0x39CODECOPYmem[dstOst:dstOst+len-1] := this.code[ost:ost+len-1]
0x3AGASPRICEgas price of tx, in wei per unit gas
0x3BEXTCODESIZEsize of code at addr, in bytes
0x3CEXTCODECOPYcopy code from addr
0x3DRETURNDATASIZEsize of returned data from last external call, in bytes
0x3ERETURNDATACOPYcopy returned data from last external call
0x3FEXTCODEHASHhash = addr.exists ? keccak256(addr.code) : 0
0x40BLOCKHASHReturns the keccak256 hash of a block number, where the input to the hash is the block number in decimal string format.
0x41COINBASEaddress of proposer of current blockReturns 0. This behavior will change in the future.
0x42TIMESTAMPtimestamp of current block
0x43NUMBERnumber of current block
0x44PREVRANDAOrandomness beaconReturns 0.Currently, Jovay does not support providing pseudo-random numbers via prevrandao
0x45GASLIMITgas limit of current block
0x46CHAINIDpush current chain id onto stackJovay's chain ID is different from the Ethereum mainnet.
0x47SELFBALANCEbalance of executing contract, in wei
0x48BASEFEEbase fee of current blockThe base fee is configured by a system contract. In Ethereum, the base fee is dynamically and automatically set based on block size changes.
0x49BLOBHASHhttps://eips.ethereum.org/EIPS/eip-4844Returns 0. EIP-4844 is not currently supported.
0x4ABLOBBASEFEEhttps://eips.ethereum.org/EIPS/eip-7516Returns 0. EIP-4844 is not currently supported.
0x4B-0x4Finvalid
0x50POPremove item from top of stack and discard it
0x51MLOADread word from memory at offset ost
0x52MSTOREwrite a word to memory
0x53MSTORE8write a single byte to memory
0x54SLOADread word from storage
0x55SSTOREwrite word to storage
0x56JUMP$pc := dst mark that pc is only assigned if dst is a valid jumpdest
0x57JUMPI$pc := condition ? dst : $pc + 1
0x58PCprogram counter
0x59MSIZEsize of memory in current execution context, in bytes
0x5AGAS
0x5BJUMPDESTa valid jump destination for example a jump destination not inside the push data
0x5CTLOADread word from transient storage
0x5DTSTOREwrite word to transient storage
0x5EMCOPYcopy memory from one area to another
0x5FPUSH0push the constant value 0 onto stack
0x60-0x7FPUSH1-PUSH32push a 1 to 32-byte value onto the stack.
0x80-0x8FDUP1-DUP16clone the 1st to 16th value on the stack.
0x90-0x9FSWAP1-SWAP16wwap the 1st to 16th value with the top of the stack.
0xA0LOG0LOG0(memory[ost:ost+len-1])
0xA1LOG1LOG1(memory[ost:ost+len-1], topic0)
0xA2LOG2LOG2(memory[ost:ost+len-1], topic0, topic1)
0xA3LOG3LOG3(memory[ost:ost+len-1], topic0, topic1, topic2)
0xA4LOG4LOG4(memory[ost:ost+len-1], topic0, topic1, topic2, topic3)
0xA5-0xEFinvalid
0xF0CREATEaddr = keccak256(rlp([address(this), this.nonce]))
0xF1CALL
0xF2CALLCODEsame as DELEGATECALL, but does not propagate original msg.sender and msg.value
0xF3RETURNreturn mem[ost:ost+len-1]
0xF4DELEGATECALL
0xF5CREATE2addr = keccak256(0xff ++ address(this) ++ salt ++ keccak256(mem[ost:ost+len-1]))[12:]
0xF6-0xF9invalid
0xFASTATICCALL
0xFB-0xFCinvalid
0xFDREVERTrevert(mem[ost:ost+len-1])
0xFEINVALID
0xFFSELFDESTRUCT

Note: Opcodes listed as invalid in the provided material are intentionally omitted from this list.

Supported Precompiled Contracts in Jovay EVM

The Jovay EVM supports the following precompiled contracts.

addressnameDifference from Ethereum
0x010x01
0x02sha2-256
0x03ripemd160
0x04identity
0x05modexp
0x06ecAdd
0x07ecMul
0x08ecPairing
0x09blake2f
0x0apoint evaulationNot supported at this time.