Repository navigation
Expand file tree
/
Copy pathfoundry.toml
More file actions
128 lines (122 loc) · 7.03 KB
/
Copy pathfoundry.toml
File metadata and controls
128 lines (122 loc) · 7.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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
# `evm_version` is the repo-wide DEFAULT, and in Foundry it configures two things at once: the compile
# target for bytecode this repo deploys, AND the local EVM that `forge test` and every `forge script`
# simulation runs in. `shanghai` is the floor for a current toolchain - the `PUSH0` opcode (0x5f) it
# introduced is emitted by any recent solc, and a `paris` interpreter halts on it with
# `EvmError: NotActivated`, so a paris-pinned run cannot read an operator's BYO token at all.
#
# A handful of CCIP chains never activated shanghai and reject PUSH0 bytecode. They are handled per
# chain, in data, not by lowering this default: `config/chains/<selectorName>.json` carries an optional
# `"evmVersion"` key, and the make targets forward it as `--evm-version` for that chain's runs. See
# docs/config-schema.md ("Per-chain EVM version") and docs/gotchas/index.md#evm-version-push0.
#
# `ignored_error_codes` EXTENDS nothing - it REPLACES Foundry's defaults, so all six of them are
# repeated here (`forge config` prints the list on a tree that does not set the key). Naming only the
# ones this repo cares about would silently un-ignore the rest. `too-many-warnings` (solc 4591) is the
# addition: shanghai activates EIP-3860, whose ~107 extra initcode-size warnings push the total past
# solc's 256-warning print cap, and solc then emits 4591 to say it truncated. Dropping `code-size` or
# `init-code-size` would surface 64+ size warnings on test and script contracts that never leave the
# local EVM.
[profile.default]
src = "src"
out = "out"
libs = ["node_modules"]
solc_version = "0.8.24"
evm_version = "shanghai"
optimizer = true
optimizer_runs = 200
ignored_error_codes = [
"license",
"code-size",
"init-code-size",
"transient-storage",
"transfer-deprecated",
"natspec-memory-safe-assembly-deprecated",
"too-many-warnings",
]
remappings = [
"forge-std/=node_modules/@chainlink/contracts/src/v0.8/vendor/forge-std/src/",
"@chainlink/contracts-ccip/contracts/=node_modules/@chainlink/contracts-ccip/contracts/",
"@chainlink/contracts-ccip-1.6.0/=node_modules/@chainlink/contracts-ccip-1.6.0/",
"@chainlink/contracts-ccip-1.6.1/=node_modules/@chainlink/contracts-ccip-1.6.1/",
"node_modules/@chainlink/contracts-ccip-1.6.0/:@chainlink/contracts/=node_modules/@chainlink/contracts-ccip-1.6.0/node_modules/@chainlink/contracts/",
"node_modules/@chainlink/contracts-ccip-1.6.1/:@chainlink/contracts/=node_modules/@chainlink/contracts-ccip-1.6.1/node_modules/@chainlink/contracts/",
"@chainlink/contracts@1.4.0/=node_modules/@chainlink/contracts/",
"@chainlink/contracts/=node_modules/@chainlink/contracts/",
"@chainlink/policy-management/=node_modules/@chainlink/ace/packages/policy-management/src/",
"@openzeppelin/contracts@4.8.3/=node_modules/@openzeppelin/contracts-4.8.3/",
"@openzeppelin/contracts@5.3.0/=node_modules/@openzeppelin/contracts-5.3.0/",
"@openzeppelin/contracts/=node_modules/@openzeppelin/contracts-5.3.0/"
]
fs_permissions = [{ access = "read-write", path = "./" }]
# The `sync` profile runs the chain-config tooling (script/config/*.s.sol): it needs `ffi` to fetch
# the live CCIP API via curl + jq (Foundry cannot HTTP-GET directly). Named profiles do not inherit
# from [profile.default], so the build settings are repeated here.
# FOUNDRY_PROFILE=sync forge script script/config/SyncCcipConfig.s.sol --sig "run(string)" ethereum-sepolia
[profile.sync]
src = "src"
out = "out"
libs = ["node_modules"]
solc_version = "0.8.24"
evm_version = "shanghai"
optimizer = true
optimizer_runs = 200
ignored_error_codes = [
"license",
"code-size",
"init-code-size",
"transient-storage",
"transfer-deprecated",
"natspec-memory-safe-assembly-deprecated",
"too-many-warnings",
]
ffi = true
remappings = [
"forge-std/=node_modules/@chainlink/contracts/src/v0.8/vendor/forge-std/src/",
"@chainlink/contracts-ccip/contracts/=node_modules/@chainlink/contracts-ccip/contracts/",
"@chainlink/contracts-ccip-1.6.0/=node_modules/@chainlink/contracts-ccip-1.6.0/",
"@chainlink/contracts-ccip-1.6.1/=node_modules/@chainlink/contracts-ccip-1.6.1/",
"node_modules/@chainlink/contracts-ccip-1.6.0/:@chainlink/contracts/=node_modules/@chainlink/contracts-ccip-1.6.0/node_modules/@chainlink/contracts/",
"node_modules/@chainlink/contracts-ccip-1.6.1/:@chainlink/contracts/=node_modules/@chainlink/contracts-ccip-1.6.1/node_modules/@chainlink/contracts/",
"@chainlink/contracts@1.4.0/=node_modules/@chainlink/contracts/",
"@chainlink/contracts/=node_modules/@chainlink/contracts/",
"@chainlink/policy-management/=node_modules/@chainlink/ace/packages/policy-management/src/",
"@openzeppelin/contracts@4.8.3/=node_modules/@openzeppelin/contracts-4.8.3/",
"@openzeppelin/contracts@5.3.0/=node_modules/@openzeppelin/contracts-5.3.0/",
"@openzeppelin/contracts/=node_modules/@openzeppelin/contracts-5.3.0/"
]
fs_permissions = [{ access = "read-write", path = "./" }]
[lint]
# `forge build` gained a post-build lint step in 1.8.x, so `forge build --deny warnings` - the gate
# that has always meant "zero COMPILER warnings" - started failing on 760 lint warnings from that
# release's new rule set (calls-loop, unused-return, literal-instead-of-constant, boolean-cst and
# others, almost all in script/ and test/). Keep the two gates separate: this restores `forge build`
# to compiling, and `forge lint` stays the lint gate. Note `forge lint` currently EXITS 0 whatever it
# finds, so it reports rather than enforces; making it enforce means triaging that rule set first and
# then adding `--deny warning`, which is tracked work, not a config flip.
lint_on_build = false
# The four below are 1.8.x rules that fire on things this repo does deliberately. Each was checked
# against real sites before being excluded, not waved through by rule name:
# calls-loop - every configure primitive loops over chains/lanes/pools making calls; that
# IS the work. It also misfires interprocedurally, flagging sites that are in
# no loop at all (e.g. `new bytes(...)` in ChainConfig, a memory allocation).
# boolean-cst - flags the tolerant-read tuple idiom `return (false, ...)`, which is how
# every guarded read here reports "did not answer" without reverting.
# reentrancy-no-eth - deploy and configure scripts, which have no reentrancy surface to protect.
# require-revert-in-loop- deliberate fail-fast: a batch that hits a bad entry must stop, not carry on.
# Everything else stays on. `arbitrary-send-eth` and `encode-packed-collision` are deliberately NOT
# excluded - both are correct-by-design here but would matter elsewhere, so they get per-site comments
# when the time comes rather than a global off switch.
exclude_lints = [
"calls-loop",
"boolean-cst",
"reentrancy-no-eth",
"require-revert-in-loop",
"mixed-case-variable",
"pascal-case-struct",
"mixed-case-function",
"screaming-snake-case-const",
"screaming-snake-case-immutable",
"unsafe-cheatcode",
"unsafe-typecast"
]
# See more config options https://github.com/foundry-rs/foundry/blob/master/crates/config/README.md#all-options