Repository navigation
Expand file tree
/
Copy pathfoundry.toml
More file actions
269 lines (248 loc) · 14.5 KB
/
Copy pathfoundry.toml
File metadata and controls
269 lines (248 loc) · 14.5 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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
# ---------------------------------------------------------------------------
# Profiles (only two):
# default — hermetic / unit / integration; skips all **/fork/** tests (no RPC)
# fork — only **/fork/** tests (requires RPC endpoints below)
# ---------------------------------------------------------------------------
[profile.default]
src = 'contracts'
out = 'out'
libs = ['node_modules', 'lib']
test = 'test'
cache_path = 'cache_forge'
fs_permissions = [
{ access = "read", path = "./" },
# Scripts export JSON under script/output.
{ access = "read-write", path = "./script/output" },
# BattleChain Wave A promo writes address book for the docs site (Script_Promo_BC_Launch).
{ access = "read-write", path = "./docs/deployment/addresses" },
# Aave V4 deployment-procedure and Logger tests write reports under ./output.
{ access = "read-write", path = "./output" },
# Aave V4 vm.eip712HashType / vm.eip712HashStruct reads the generated EIP-712 bindings file.
{ access = "read", path = "./test/foundry/spec/protocols/lending/aave/v4/helpers/mocks/JsonBindings.sol" },
# Liquity Bold NFTMetadata tests read trove SVG/font assets and write generated test_output HTML.
{ access = "read", path = "./utils/assets/" },
{ access = "read-write", path = "./utils/assets/test_output" },
{ access = "read-write", path = "./" },
{ access = "write", path = "./reports" },
{ access = "read", path = "./out" },
{ access = "read", path = "./config" },
]
solc = "0.8.35"
sizes = true
optimizer = true
# optimizer_runs = 1 keeps many protocol ports under EIP-170 when size is tight
optimizer_runs = 1
# viaIR disabled - use structs to avoid "stack too deep" errors
viaIR = false
# Allow vm.expectRevert() for internal/library function calls (Foundry v1.0+ changed depth requirements)
allow_internal_expect_revert = true
# Olympus and some ports use FFI / AST in tests
ffi = true
ast = true
remappings = [
"forge-std/=lib/forge-std/src/",
"@openzeppelin/contracts/=contracts/external/openzeppelin-contracts/",
"@crane/contracts/=contracts/",
"@crane/test/=test/",
"battlechain-lib/=lib/battlechain-lib/src/",
"@battlechain-contracts/=lib/battlechain-lib/lib/battlechain-safe-harbor-contracts/src/",
"@oz/=lib/openzeppelin-contracts/",
"@ozu/=contracts/external/openzeppelin-upgradeable/",
# Protocol ports (Morpho / Olympus / V4 deps) — previously only on port-specific profiles
"solmate/=contracts/external/solmate/",
"clones/=contracts/external/clones-with-immutable-args/",
"erc4626-tests/=contracts/external/erc4626-tests/",
]
ignored_error_codes = [
2394,
3860,
5574,
2072,
1878,
# Unreachable code
5740,
# will be promoted to keyword in the future and will not be allowed as an identifier anymore
6335,
# Virtual modifiers are deprecated and scheduled for removal
8429,
# Natspec @return missing name (vendored Frax etc.)
5856,
# Tuple type conversion issues in vendored/generated protocol code (Liquity, Aerodrome)
7407,
# Documented parameter not found in function (natspec mismatch in core DFPkgs)
3881,
]
# Default: do not run fork tests (no RPC required for local/CI hermetic runs).
no_match_path = "**/fork/**"
skip = [
# Vendor inventory under contracts/external: not primary sources for monorepo solc 0.8.35.
# Foundry still compiles files that production/test code imports.
# Multi-pragma 0.4/0.6/0.7 trees, dual OZ pins, and dead vendor tests force this inventory skip.
"contracts/external/**",
# Aave V3.6 upstream formal-verification trees that are not required for runtime compilation.
"contracts/protocols/lending/aave/v3.6/dependencies/openzeppelin-contracts/certora/**",
"contracts/protocols/lending/aave/v3.6/dependencies/openzeppelin-contracts-upgradeable/certora/**",
# Aave V4 generated EIP-712 bindings file (kept out of test compilation; read at runtime via vm.eip712HashType).
"test/foundry/spec/protocols/lending/aave/v4/helpers/mocks/JsonBindings.sol",
# Liquity Bold upstream submodule — port lives in contracts/protocols/cdps/liquity/v2/.
"lib/bold/**",
# Frax upstream submodule — ported tree lives under contracts/protocols/tokens/stable/frax/.
"lib/frax-solidity/**",
]
[bind_json]
out = "test/foundry/spec/protocols/lending/aave/v4/helpers/mocks/JsonBindings.sol"
include = ["test/foundry/spec/protocols/lending/aave/v4/helpers/mocks/EIP712Types.sol"]
[invariant]
runs = 50
depth = 5
[profile.default.fmt]
# Vendored / protocol-port trees: do not require forge-fmt churn across huge imports.
skip = [
"lib/**",
"contracts/external/**",
]
[lint]
exclude_lints = [
"erc20-unchecked-transfer",
"unused-import",
"mixed-case-variable",
"mixed-case-function",
"unaliased-plain-import",
"screaming-snake-case-immutable",
"screaming-snake-case-const",
"pascal-case-struct",
"incorrect-shift",
"divide-before-multiply",
"modifier-style",
"unsafe-typecast",
"unwrapped-modifier-logic",
"unsafe-cheatcode",
"named-struct-fields",
]
ignore = [
"contracts/test/stubs/greeter/OperableGreeter.sol",
"contracts/protocols/dexes/balancer/v3/test/bases/TestBase_BalancerV3_WeightedPool.sol",
"contracts/constants/protocols/dexes/balancer/v3/BalancerV3_CONSTANTS.sol",
"contracts/external/balancer/v3/vault/test/foundry/RouterCommon.t.sol",
"contracts/external/balancer/v3/pool-stable/contracts/test/HardhatImports.sol",
"contracts/interfaces/protocols/dexes/aerodrome/IVotingEscrow.sol",
"contracts/interfaces/protocols/dexes/aerodrome/IEpochGovernor.sol",
"contracts/interfaces/protocols/dexes/aerodrome/IAirdropDistributor.sol",
"contracts/interfaces/protocols/dexes/aerodrome/IAero.sol",
"contracts/interfaces/protocols/dexes/aerodrome/IFactoryRegistry.sol",
"contracts/interfaces/protocols/dexes/aerodrome/IVotingRewardsFactory.sol",
"contracts/interfaces/protocols/dexes/aerodrome/IGaugeFactory.sol",
"contracts/interfaces/protocols/dexes/aerodrome/IPoolCallee.sol",
"contracts/interfaces/protocols/dexes/aerodrome/IRewardsDistributor.sol",
"contracts/interfaces/protocols/dexes/aerodrome/IVoter.sol",
"contracts/interfaces/protocols/dexes/aerodrome/IMinter.sol",
"contracts/interfaces/protocols/dexes/aerodrome/IVotes.sol",
"contracts/interfaces/protocols/dexes/aerodrome/IGauge.sol",
"contracts/interfaces/protocols/dexes/aerodrome/IReward.sol",
"contracts/interfaces/protocols/dexes/aerodrome/IManagedRewardsFactory.sol",
"contracts/interfaces/protocols/dexes/aerodrome/IVeArtProxy.sol",
"contracts/interfaces/protocols/dexes/balancer/v3/IBatchRouter.sol",
"contracts/interfaces/protocols/dexes/balancer/v3/IBasePool.sol",
"contracts/interfaces/IERC20MinterFacade.sol",
"contracts/interfaces/protocols/dexes/balancer/v3/IPoolLiquidity.sol",
"contracts/interfaces/protocols/dexes/balancer/v3/IBufferRouter.sol",
"contracts/interfaces/protocols/dexes/balancer/v3/IRouter.sol",
"contracts/interfaces/protocols/dexes/balancer/v3/ISenderGuard.sol",
"contracts/interfaces/protocols/dexes/balancer/v3/RouterTypes.sol",
"contracts/interfaces/protocols/dexes/balancer/v3/IWeightedPool.sol",
"contracts/interfaces/protocols/dexes/balancer/v3/IRouterCommon.sol",
"contracts/external/balancer/v3/pool-weighted/contracts/test/HardhatImports.sol",
"test/foundry/spec/tokens/ERC20/ERC20DFPkg_IDiamondLoupe.t.sol",
"contracts/protocols/dexes/balancer/v3/test/bases/TestBase_BalancerV3_WeightedPool.sol",
"contracts/protocols/dexes/balancer/v3/vault/VaultGuardModifiers.sol",
"test/foundry/spec/introspection/ERC2535/DiamondLoupeFacet.t.sol",
"contracts/external/balancer/v3/pool-cow/contracts/test/HardhatImports.sol",
"contracts/external/balancer/v3/pool-hooks/contracts/test/HardhatImports.sol",
"contracts/external/balancer/v3/pool-gyro/contracts/test/HardhatImports.sol",
"contracts/registries/package/DiamondFactoryPackageRegistry.sol",
"contracts/external/openzeppelin-contracts/interfaces/IERC777Recipient.sol",
"contracts/external/openzeppelin-contracts/interfaces/IERC721Enumerable.sol",
"contracts/external/openzeppelin-contracts/interfaces/IERC721Metadata.sol",
"contracts/external/openzeppelin-contracts/interfaces/IERC777Sender.sol",
"contracts/external/openzeppelin-contracts/interfaces/IERC1155Receiver.sol",
"contracts/external/openzeppelin-contracts/interfaces/IERC721Receiver.sol",
"contracts/external/openzeppelin-contracts/interfaces/IERC1820Registry.sol",
"contracts/external/openzeppelin-contracts/interfaces/IERC1155.sol",
"contracts/external/openzeppelin-contracts/interfaces/IERC1820Implementer.sol",
"contracts/external/openzeppelin-contracts/interfaces/IERC3156.sol",
"contracts/external/openzeppelin-contracts/interfaces/IERC1155MetadataURI.sol",
"contracts/external/openzeppelin-contracts/interfaces/IERC20Metadata.sol",
"contracts/external/openzeppelin-contracts/interfaces/draft-IERC2612.sol",
"contracts/external/openzeppelin-contracts/interfaces/IERC777.sol",
"contracts/external/openzeppelin-contracts/token/ERC20/extensions/draft-IERC20Permit.sol",
"contracts/external/openzeppelin-contracts/token/ERC20/extensions/draft-ERC20Permit.sol",
"contracts/protocols/launchpads/uniswap/continuous-clearing/dependencies/openzeppelin-contracts/contracts/interfaces/IERC721Enumerable.sol",
"contracts/protocols/launchpads/uniswap/continuous-clearing/dependencies/openzeppelin-contracts/contracts/interfaces/IERC721Metadata.sol",
"contracts/protocols/launchpads/uniswap/continuous-clearing/dependencies/openzeppelin-contracts/contracts/interfaces/IERC1155Receiver.sol",
"contracts/protocols/launchpads/uniswap/continuous-clearing/dependencies/openzeppelin-contracts/contracts/interfaces/IERC721Receiver.sol",
"contracts/protocols/launchpads/uniswap/continuous-clearing/dependencies/openzeppelin-contracts/contracts/interfaces/IERC1155.sol",
"contracts/protocols/launchpads/uniswap/continuous-clearing/dependencies/openzeppelin-contracts/contracts/interfaces/IERC1155MetadataURI.sol",
"contracts/protocols/launchpads/uniswap/continuous-clearing/dependencies/openzeppelin-contracts/contracts/interfaces/IERC20Metadata.sol",
"contracts/protocols/lending/aave/v3.6/dependencies/openzeppelin-contracts/contracts/token/ERC20/extensions/IERC20Metadata.sol",
"contracts/protocols/lending/aave/v3.6/dependencies/openzeppelin-contracts/contracts/interfaces/IERC721Enumerable.sol",
"contracts/protocols/lending/aave/v3.6/dependencies/openzeppelin-contracts/contracts/interfaces/IERC721Metadata.sol",
"contracts/protocols/lending/aave/v3.6/dependencies/openzeppelin-contracts/contracts/interfaces/IERC1155Receiver.sol",
"contracts/protocols/lending/aave/v3.6/dependencies/openzeppelin-contracts/contracts/interfaces/IERC721Receiver.sol",
"contracts/protocols/lending/aave/v3.6/dependencies/openzeppelin-contracts/contracts/interfaces/IERC1155.sol",
"contracts/protocols/lending/aave/v3.6/dependencies/openzeppelin-contracts/contracts/interfaces/IERC1155MetadataURI.sol",
"contracts/interfaces/IMultiStepOwnableView.sol",
]
# Shared by default and fork (profiles auto-inherit top-level keys in this Foundry version).
[rpc_endpoints]
local = "http://127.0.0.1:8545"
# BattleChain testnet (chain 627) settles to Ethereum Sepolia — preferred alias name
"battlechain-sepolia" = "https://testnet.battlechain.com"
battlechain_testnet = "https://testnet.battlechain.com"
battlechain_mainnet = "https://mainnet.battlechain.com"
ethereum_mainnet_infura = "https://mainnet.infura.io/v3/${INFURA_KEY}"
ethereum_mainnet_alchemy = "https://eth-mainnet.g.alchemy.com/v2/${ALCHEMY_KEY}"
ethereum_mainnet_public = "https://ethereum-rpc.publicnode.com"
ethereum_sepolia_infura = "https://sepolia.infura.io/v3/${INFURA_KEY}"
sepolia_infura = "https://sepolia.infura.io/v3/${INFURA_KEY}"
ethereum_sepolia_alchemy = "https://eth-sepolia.g.alchemy.com/v2/${ALCHEMY_KEY}"
sepolia_alchemy = "https://eth-sepolia.g.alchemy.com/v2/${ALCHEMY_KEY}"
# Public Sepolia fallback for L1→BattleChain bridge scripts
sepolia_public = "https://ethereum-sepolia-rpc.publicnode.com"
base_mainnet_infura = "https://base-mainnet.infura.io/v3/${INFURA_KEY}"
base_mainnet_alchemy = "https://base-mainnet.g.alchemy.com/v2/${ALCHEMY_KEY}"
base_sepolia_infura = "https://base-sepolia.infura.io/v3/${INFURA_KEY}"
base_sepolia_alchemy = "https://base-sepolia.g.alchemy.com/v2/${ALCHEMY_KEY}"
optimism_mainnet = "https://opt-mainnet.g.alchemy.com/v2/${ALCHEMY_KEY}"
optimism_mainnet_alchemy = "https://opt-mainnet.g.alchemy.com/v2/${ALCHEMY_KEY}"
arbitrum_mainnet_alchemy = "https://arb-mainnet.g.alchemy.com/v2/${ALCHEMY_KEY}"
arbitrum_mainnet_infura = "https://arbitrum-mainnet.infura.io/v3/${INFURA_KEY}"
avalanche_mainnet_alchemy = "https://avax-mainnet.g.alchemy.com/v2/${ALCHEMY_KEY}"
avalanche_mainnet_infura = "https://avalanche-mainnet.infura.io/v3/${INFURA_KEY}"
bsc_mainnet_alchemy = "https://bnb-mainnet.g.alchemy.com/v2/${ALCHEMY_KEY}"
polygon_mainnet_alchemy = "https://polygon-mainnet.g.alchemy.com/v2/${ALCHEMY_KEY}"
polygon_mainnet_infura = "https://polygon-mainnet.infura.io/v3/${INFURA_KEY}"
fantom_mainnet = "https://fantom.drpc.org"
# No Alchemy tier — public / drpc fallbacks for Frax fork tests
aurora_mainnet = "https://mainnet.aurora.dev"
harmony_mainnet = "https://api.harmony.one"
moonbeam_mainnet = "https://rpc.api.moonbeam.network"
moonriver_mainnet = "https://rpc.api.moonriver.moonbeam.network"
apeChain_rpc = "https://rpc.apechain.com"
apeChain_drpc = "https://apechain.drpc.org"
apeChain_curtis_rpc = "https://rpc.curtis.apechain.com"
# Robinhood Chain (Arbitrum Orbit L2) — chain 4663 mainnet / 46630 testnet
# Public RPCs are rate-limited; Alchemy recommended for production forks.
robinhood_mainnet = "https://rpc.mainnet.chain.robinhood.com"
robinhood_mainnet_public = "https://rpc.mainnet.chain.robinhood.com"
robinhood_mainnet_alchemy = "https://robinhood-mainnet.g.alchemy.com/v2/${ALCHEMY_KEY}"
robinhood_testnet = "https://rpc.testnet.chain.robinhood.com"
robinhood_testnet_public = "https://rpc.testnet.chain.robinhood.com"
robinhood_testnet_alchemy = "https://robinhood-testnet.g.alchemy.com/v2/${ALCHEMY_KEY}"
# ---------------------------------------------------------------------------
# Fork profile — only RPC fork tests (**/fork/**).
# ---------------------------------------------------------------------------
[profile.fork]
# Only execute tests under a fork/ directory (top-level or protocol-local).
match_path = "**/fork/**"
# Clear default's no_match so the positive match_path is not also excluded.
no_match_path = ""