60 lines
2.6 KiB
Nim
60 lines
2.6 KiB
Nim
# Nimbus
|
|
# Copyright (c) 2022 Status Research & Development GmbH
|
|
# Licensed under either of
|
|
# * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE))
|
|
# * MIT license ([LICENSE-MIT](LICENSE-MIT))
|
|
# at your option.
|
|
# This file may not be copied, modified, or distributed except according to
|
|
# those terms.
|
|
|
|
import
|
|
./hardforks
|
|
|
|
#[
|
|
* - [EIP-1153](https://eips.ethereum.org/EIPS/eip-1153) - Transient Storage Opcodes (`experimental`)
|
|
* - [EIP-1559](https://eips.ethereum.org/EIPS/eip-1559) - EIP-1559 Fee Market
|
|
* - [EIP-2315](https://eips.ethereum.org/EIPS/eip-2315) - VM simple subroutines (`experimental`)
|
|
* - [EIP-2537](https://eips.ethereum.org/EIPS/eip-2537) - BLS12-381 precompiles (`experimental`)
|
|
* - [EIP-2565](https://eips.ethereum.org/EIPS/eip-2565) - ModExp Gas Cost
|
|
* - [EIP-2718](https://eips.ethereum.org/EIPS/eip-2718) - Typed Transactions
|
|
* - [EIP-2929](https://eips.ethereum.org/EIPS/eip-2929) - Gas cost increases for state access opcodes
|
|
* - [EIP-2930](https://eips.ethereum.org/EIPS/eip-2930) - Access List Transaction Type
|
|
* - [EIP-3198](https://eips.ethereum.org/EIPS/eip-3198) - BASEFEE opcode
|
|
* - [EIP-3529](https://eips.ethereum.org/EIPS/eip-3529) - Reduction in refunds
|
|
* - [EIP-3540](https://eips.ethereum.org/EIPS/eip-3541) - EVM Object Format (EOF) v1 (`experimental`)
|
|
* - [EIP-3541](https://eips.ethereum.org/EIPS/eip-3541) - Reject new contracts starting with the 0xEF byte
|
|
* [EIP-3651](https://eips.ethereum.org/EIPS/eip-3651) - Warm COINBASE (`experimental`)
|
|
* - [EIP-3670](https://eips.ethereum.org/EIPS/eip-3670) - EOF - Code Validation (`experimental`)
|
|
* - [EIP-3855](https://eips.ethereum.org/EIPS/eip-3855) - PUSH0 instruction (`experimental`)
|
|
* - [EIP-3860](https://eips.ethereum.org/EIPS/eip-3860) - Limit and meter initcode (`experimental`)
|
|
* - [EIP-4399](https://eips.ethereum.org/EIPS/eip-4399) - Supplant DIFFICULTY opcode with PREVRANDAO (Merge)
|
|
* [EIP-4895](https://eips.ethereum.org/EIPS/eip-4895) - Beacon chain push withdrawals as operations (`experimental`)
|
|
* - [EIP-5133](https://eips.ethereum.org/EIPS/eip-5133) - Delaying Difficulty Bomb to mid-September 2022
|
|
]#
|
|
|
|
type
|
|
EIP* = enum
|
|
EIP3541
|
|
EIP3670
|
|
EIP1559
|
|
EIP2537
|
|
EIP4895
|
|
|
|
ForkToEIP* = array[HardFork, set[EIP]]
|
|
|
|
func makeForkToEIP(): ForkToEIP {.compileTime.} =
|
|
var map: ForkToEIP
|
|
|
|
# example:
|
|
# map[London] = {EIP1559}
|
|
# map[Shanghai] = {EIP3541,EIP3670}
|
|
|
|
# the latest fork will accumulate most EIPs
|
|
for fork in HardFork:
|
|
result[fork] = map[fork]
|
|
if fork > Frontier:
|
|
result[fork].incl map[pred(fork)]
|
|
|
|
const
|
|
ForkToEipList* = makeForktoEip()
|