Skip to content

Latest commit

 

History

History
54 lines (38 loc) · 2.1 KB

File metadata and controls

54 lines (38 loc) · 2.1 KB

Solidity

Compatibility

XDPoSChain compatibility is determined by the target EVM version, not by a single Solidity compiler version.

Current network activation block numbers:

Network Cancun Prague Osaka
mainnet 98802000 TBD TBD
testnet 71551800 TBD TBD
devnet 43200 TBD TBD

Recommended compiler settings:

Solidity version Default target EVM Deploying to current mainnet/testnet/devnet
0.8.25 to 0.8.29 cancun default settings are fine
0.8.30 prague generally compatible (see note 2)
0.8.31 and later osaka pin evmVersion (see note 3)

Notes:

  1. evmVersion mainly affects opcode availability and code generation strategy, not Solidity language syntax itself.
  2. (0.8.30) pin evmVersion: "cancun" only if you need reproducible outputs with existing Cancun-targeted artifacts.
  3. (0.8.31+) set evmVersion to cancun (or prague after Prague activation) unless your target network has Osaka.
  4. The repository contains fixtures generated by solc 0.8.28, but that is not a hard upper bound for supported Solidity versions.
  5. If Prague is activated on XDPoSChain in the future, Solidity 0.8.30 and later can target it by setting evmVersion: "prague" explicitly.
  6. Solidity 0.8.31 introduced support for the CLZ opcode (EIP-7939), which is part of Osaka, not Prague. The strong pinning warning applies to Osaka-only features (such as CLZ), not to 0.8.30's default prague target by itself.

Special variables

block.prevrandao

The value of block.prevrandao is keccak256(block.number) in our current implemention. It is predictable and unsafe.

NOTICE: do not use it in real business.

block.basefee

The value of block.basefee is always 12.5 GWei in our EIP-1559 implemention.

block.blobbasefee

The value of block.blobbasefee is always 0 in our EIP-7516 implemention.