Repository navigation
Expand file tree
/
Copy pathfoundry.toml
More file actions
83 lines (77 loc) · 3.03 KB
/
Copy pathfoundry.toml
File metadata and controls
83 lines (77 loc) · 3.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
[profile.default]
src = 'src'
test = 'test/foundry'
out = 'out'
libs = ['lib']
solc_version = '0.8.38'
# Cancun runs on every network SeaDrop deploys to (PUSH0, MCOPY and TSTORE
# probed with eth_call on 2026-11-07); pin it so the target doesn't drift with
# the compiler's default.
evm_version = 'cancun'
optimizer_runs = 1_000_000
# via_ir = true
# Under Cancun, solc checks EIP-3860's 49,152-byte initcode limit. Only test
# contracts exceed it, and they're never deployed; the deployable contracts
# are far below it (`forge build --sizes`).
ignored_error_codes = ["init-code-size"]
bytecode_hash = "none"
# The upgradeable contracts in src/upgradeable compile with the settings their
# implementations are deployed with (formerly src-upgradeable's Hardhat
# config): via-IR, 1000 optimizer runs, and the default ipfs metadata hash,
# which --verify needs to match. Files that import them (their tests and
# scripts) compile with those settings too, and everything else keeps the
# settings above. Keep regular contracts out of those files' imports, or they
# compile under both profiles and forge verify-contract asks which one.
additional_compiler_profiles = [
{ name = "upgradeable", via_ir = true, optimizer_runs = 1_000, bytecode_hash = "Ipfs" },
]
compilation_restrictions = [
{ paths = "src/upgradeable/**", via_ir = true, optimizer_runs = 1_000, bytecode_hash = "Ipfs" },
]
# Scripts embed the creation code of what they deploy (and the create2
# helpers), so solc flags some as over the EIP-170 size limit. Scripts are
# never deployed; the contracts they deploy are checked as usual.
ignored_warnings_from = ['script']
# forge coverage turns the optimizer and via-IR off, but src/upgradeable keeps
# its restricted settings, so its coverage lands on the wrong lines. Coverage
# runs under this profile instead, which drops the restriction:
# FOUNDRY_PROFILE=coverage forge coverage (npm run coverage sets it).
[profile.coverage]
additional_compiler_profiles = []
compilation_restrictions = []
[profile.ir_inspect]
test = 'src'
[rpc_endpoints]
goerli = '${GOERLI_RPC_URL}'
mainnet = '${ETHEREUM_RPC_URL}'
sepolia = '${SEPOLIA_RPC_URL}'
[fmt]
line_length = 80
tab_width = 4
bracket_spacing = true
int_types = "preserve"
number_underscore = "preserve"
quote_style = "double"
prefer_compact = "none"
ignore = ["src/upgradeable/vendored/**"]
[lint]
lint_on_build = false
# These detectors only flag deliberate, audited patterns in the shipped
# contracts (payouts to configured recipients, external calls in admin loops,
# events after SeaDrop calls, the documented prevrandao offset, vendored
# ERC721A casts). CI runs `forge lint --deny warnings`, so every other rule
# still fails the build.
exclude_lints = [
"arbitrary-send-eth",
"block-timestamp",
"calls-loop",
"encode-packed-collision",
"missing-events-arithmetic",
"missing-zero-check",
"reentrancy-events",
"reentrancy-no-eth",
"require-revert-in-loop",
"unsafe-typecast",
"weak-prng",
]
# See more config options https://github.com/foundry-rs/foundry/tree/master/config