Repository navigation
Expand file tree
/
Copy pathfoundry.toml
More file actions
144 lines (134 loc) · 5.96 KB
/
Copy pathfoundry.toml
File metadata and controls
144 lines (134 loc) · 5.96 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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
[profile.default]
src = "src"
test = "test"
script = "script"
out = "out"
libs = ["lib", "vendor"]
fs_permissions = [
{ access = "read", path = "./test/earn/fixtures/propamm" },
{ access = "read", path = "./test/spend/bridge/harness/fixtures" },
{ access = "read", path = "./test/spend/rain/fixtures" },
{ access = "read-write", path = "./.earn" },
{ access = "read-write", path = "./reports" },
{ access = "read-write", path = "./profiles" },
{ access = "read-write", path = "./e2e/.local" },
{ access = "read-write", path = "./localnet/.local" },
]
# Earn and Zone tests run on the plain EVM with mocked precompiles; spend tests need Tempo's real
# precompiles, so they run only under the spend profile (FOUNDRY_PROFILE=spend forge test).
no_match_path = "test/spend/**"
# Compiled with solar (https://github.com/paradigmxyz/solar) at the revision solar.lock pins, through
# the solar-solc wrapper, which presents it to Forge as solc 0.8.38. Forge resolves this path from its
# working directory, so run it from the repository root or set FOUNDRY_SOLC to the wrapper's absolute path.
# Providers' contracts whose exact pragma does not build here (Rain's 0.8.17, Permit2) are built with
# their own settings and deployed from fixtures under test/spend/<provider>/.
solc = "./solar-solc"
# Forge's cache does not record which compiler built an artifact, so solar output keeps its own
# cache; after bumping solar.lock, rebuild with --force.
cache_path = "cache/solar"
optimizer = true
optimizer_runs = 200
via_ir = true
# Tests and deployments compile for the EVM version Tempo deployments use.
evm_version = "cancun"
auto_detect_remappings = false
remappings = [
"forge-std/=lib/forge-std/src/",
"tempo-std/=lib/tempo-std/src/",
"solady/=lib/solady/src/",
"permit2/=lib/permit2/src/",
"openzeppelin-contracts/=lib/openzeppelin-contracts/contracts/",
"openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/",
"@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
"@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/",
"bridge-spender/=vendor/bridge/",
"tempo-zones/=vendor/tempo-zones/src/runtime/",
]
# Spend tests on Tempo's real precompiles (TIP-20, AccountKeychain, TIP-403, ...), sharing the build.
[profile.spend]
hardfork = "tempo:T8"
match_path = "test/spend/**"
no_match_path = "test/earn/**"
[profile.spend-ci]
hardfork = "tempo:T8"
match_path = "test/spend/**"
no_match_path = "test/earn/**"
fuzz = { runs = 512 }
[profile.ci]
fuzz = { runs = 1024 }
invariant = { runs = 256, depth = 32 }
[profile.audit]
fuzz = { runs = 10000 }
invariant = { runs = 512, depth = 128, fail_on_revert = false }
[profile.coverage]
cache_path = "cache/solar-coverage"
out = "out/coverage"
invariant = { runs = 64, depth = 32 }
# Coverage compiles with minimal IR optimization, under which this test's fuzz entrypoint is too
# deep for the stack; the router it exercises stays covered by the other router suites.
skip = ["SingleZoneEarnRouterAbiFuzz"]
[profile.coverage.coverage]
report = ["summary", "lcov"]
ir_minimum = true
exclude_tests = true
# The deployment lifecycle's profile (FOUNDRY_PROFILE=deploy), with its own artifacts.
[profile.deploy]
cache_path = "cache/solar-deploy"
out = "out/deploy"
[lint]
# `forge lint` runs as its own step in `pnpm verify` and CI.
# Spend tests were never linted (that project linted only its sources), and vendored code is not ours.
lint_on_build = false
ignore = ["test/spend/**", "script/spend/**", "vendor/**"]
# Every finding these produce on the audited contracts was triaged as a false positive or accepted:
# - block-timestamp, unsafe-typecast: timestamps gate oracle staleness, timelocks, and reward windows,
# and `uint40(block.timestamp)` cannot truncate for tens of thousands of years.
# - reentrancy-no-eth, reentrancy-events, non-reentrant-not-first: writes and events after calls
# run inside the reentrancy lock (including the lock's own exit write) against trusted callees,
# and modifiers ahead of the lock are pure access checks.
# - uninitialized-local, unused-return: intended zero defaults, and balance deltas measured
# instead of trusting venue return values.
# - incorrect-strict-equality: exactness checks against balances read in the same transaction.
# - calls-loop: batch loops call trusted engines and venues; a receiver hook can still spend most
# of a batch's gas (see the failure modes in docs/earn/architecture/security-and-privacy.md).
# - missing-zero-check, missing-events-access-control, missing-events-arithmetic: zero checked in a
# helper or deliberately disabling an optional role; events already emitted or demo-only; accrual
# checkpoints are derived accounting state.
# - require-revert-in-loop: batch validation reverts atomically on purpose.
# - encode-packed-collision: standard CREATE2 init-code hashing.
# - arbitrary-send-erc20: only the vault calls it, with itself or its caller as `from`.
# Every other lint stays on, and `forge lint --deny warnings` fails on any new finding.
exclude_lints = [
"arbitrary-send-erc20",
"block-timestamp",
"calls-loop",
"encode-packed-collision",
"incorrect-strict-equality",
"missing-events-access-control",
"missing-events-arithmetic",
"missing-zero-check",
"non-reentrant-not-first",
"reentrancy-events",
"reentrancy-no-eth",
"require-revert-in-loop",
"uninitialized-local",
"unsafe-typecast",
"unused-return",
]
# The Zone router and spend contracts keep the narrower exclusions their own projects had. CI lints
# them again under this profile, over the paths those projects linted (Bridge's TS handler excluded).
[profile.lint-zone-spend.lint]
lint_on_build = false
exclude_lints = [
"encode-packed-collision",
"incorrect-strict-equality",
"reentrancy-events",
"require-revert-in-loop",
"uninitialized-local",
"unused-return",
]
[fmt]
line_length = 120
tab_width = 4
bracket_spacing = true
ignore = ["vendor/**", "lib/**"]