[package]
name = "evm2"
description = "Fast, customizable EVM implementation"

version.workspace = true
edition.workspace = true
rust-version.workspace = true
authors.workspace = true
license.workspace = true
homepage.workspace = true
repository.workspace = true
categories.workspace = true
keywords.workspace = true

[lints]
workspace = true

[dependencies]
evm2-macros.workspace = true

alloy-consensus.workspace = true
alloy-eip7928.workspace = true
alloy-eips = { workspace = true, features = ["k256"] }
alloy-primitives.workspace = true
auto_impl.workspace = true
bitvec = { workspace = true, features = ["alloc"] }
derive-where.workspace = true
thiserror.workspace = true
typeid.workspace = true
cfg-if.workspace = true

# no_std
once_cell = { workspace = true, features = ["alloc"] }
paste = { workspace = true, optional = true }
phf = { workspace = true, features = ["macros"], optional = true }

# "serde"
serde = { workspace = true, features = ["derive", "alloc"], optional = true }

# "async"
corosensei = { workspace = true, optional = true }

# ecrecover
k256 = { workspace = true, features = ["ecdsa"] }
secp256k1 = { workspace = true, features = [
    "alloc",
    "recovery",
    "rand",
    "global-context",
], optional = true }

# sha256
sha2.workspace = true

# ripemd160
ripemd.workspace = true

# modexp
aurora-engine-modexp.workspace = true
gmp-mpfr-sys = { workspace = true, default-features = false, optional = true }

# bn254
bn = { workspace = true, optional = true }
mcl_rust = { workspace = true, optional = true }
ark-bn254 = { workspace = true, features = ["curve"] }
ark-ec = { workspace = true }
ark-ff = { workspace = true, features = ["asm"] }
ark-serialize = { workspace = true }

# blake2f
arrayref = "0.3.6"

# kzg point evaluation
c-kzg = { workspace = true, optional = true, features = [
    "ethereum_kzg_settings",
] }

# bls12-381
blst = { workspace = true, optional = true }
ark-bls12-381 = { workspace = true, features = ["curve"] }

# p256verify
p256 = { workspace = true, features = ["ecdsa"] }
aws-lc-rs = { workspace = true, optional = true }

[dev-dependencies]
alloy-primitives = { workspace = true, features = ["serde", "std"] }
serde = { workspace = true, features = ["derive", "std"] }
serde_json = { workspace = true, features = ["std"] }
postcard = { workspace = true, features = ["alloc"] }
rand = { workspace = true, features = ["std"] }
ark-std = { workspace = true }
rstest.workspace = true

[[example]]
name = "custom_evm"
path = "examples/custom_evm/main.rs"
doc-scrape-examples = true

[features]
default = [
    "std",
    "map-foldhash",
    "parse",
    "asm-keccak",
    # Precompiles
    "gmp",
    "secp256k1",
    "blst",
    "portable",
    "bn254-mcl",
    "p256-aws-lc-rs",
]
std = [
    "alloy-consensus/std",
    "alloy-eip7928/std",
    "alloy-eips/std",
    "alloy-primitives/std",
    "bitvec/std",
    "ark-bls12-381/std",
    "ark-bn254/std",
    "ark-ec/std",
    "ark-ff/std",
    "ark-serialize/std",
    "ark-std/std",
    "aurora-engine-modexp/std",
    "k256/std",
    "once_cell/std",
    "p256/std",
    "phf?/std",
    "thiserror/std",
    "c-kzg?/std",
    "secp256k1?/std",
    "serde?/std",
]

async = ["std", "dep:corosensei"]

serde = [
    "dep:serde",
    "alloy-consensus/serde",
    "alloy-eip7928/serde",
    "alloy-eips/serde",
    "alloy-primitives/serde",
    "ark-serialize/serde",
    "bitvec/serde",
    "derive-where/serde",
    "k256/serde",
    "p256/serde",
    "phf?/serde",
    "blst?/serde",
    "c-kzg?/serde",
    "secp256k1?/serde",
]
arbitrary = [
    "alloy-consensus/arbitrary",
    "alloy-eips/arbitrary",
    "alloy-primitives/arbitrary",
]

map-hashbrown = ["alloy-primitives/map-hashbrown"]
map-foldhash = ["alloy-primitives/map-foldhash"]
asm-keccak = ["alloy-primitives/asm-keccak"]
sha3-keccak = ["alloy-primitives/sha3-keccak"]

secp256k1 = ["dep:secp256k1"]
gmp = ["dep:gmp-mpfr-sys"]
bn = ["dep:bn"]
c-kzg = ["dep:c-kzg"]
blst = ["dep:blst"]
bn254-mcl = ["std", "dep:mcl_rust"]
portable = ["c-kzg?/portable", "blst?/portable"]
p256-aws-lc-rs = ["dep:aws-lc-rs"]
parse = ["dep:paste", "dep:phf"]

nightly = []
no-tco = []
