-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathfoundry.toml
More file actions
118 lines (101 loc) · 2.79 KB
/
foundry.toml
File metadata and controls
118 lines (101 loc) · 2.79 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
# Foundry Configuration for SecBrain
# This is a template for Solidity projects
# Copy and customize for specific exploit attempt directories
[profile.default]
src = "src"
out = "out"
libs = ["lib"]
test = "test"
cache_path = "cache"
# Compiler settings
solc_version = "0.8.23"
evm_version = "paris"
optimizer = true
optimizer_runs = 200
via_ir = false
# Additional model checker settings for security
model_checker_engine = "all"
model_checker_targets = [
"assert",
"constantCondition",
"divByZero",
"outOfBounds",
"overflow",
"underflow",
]
# Verbosity
verbosity = 3
# Test settings
fuzz_runs = 256
fuzz_max_test_rejects = 65536
invariant_runs = 256
invariant_depth = 15
# Advanced fuzzing configuration
[fuzz]
runs = 10000 # Increased runs for better coverage
max_test_rejects = 65536 # Higher rejection threshold
seed = "0x0" # Deterministic fuzzing seed
dictionary_weight = 40 # Weight for dictionary-based fuzzing
include_storage = true # Include storage in fuzzing
include_push_bytes = true # Include push bytes in fuzzing
# Invariant testing configuration
[invariant]
runs = 256 # Number of invariant test runs
depth = 15 # Maximum call depth for invariants
fail_on_revert = false # Continue testing even if a call reverts
call_override = false # Don't override calls during invariant testing
dictionary_weight = 80 # Higher weight for dictionary in invariant tests
shrink_run_limit = 5000 # Limit for shrinking failing tests
# Gas reporting
gas_reports = ["*"]
# Formatting
line_length = 100
tab_width = 4
bracket_spacing = true
int_types = "long"
quote_style = "double"
number_underscore = "thousands"
# Remappings (customize as needed)
remappings = [
"@openzeppelin/=lib/openzeppelin-contracts/",
"forge-std/=lib/forge-std/src/",
"ds-test/=lib/ds-test/src/",
]
# Libraries
libraries = []
# Build info
build_info = true
extra_output = ["storageLayout", "metadata"]
extra_output_files = ["metadata"]
# RPC endpoints
[rpc_endpoints]
mainnet = "${MAINNET_RPC_URL}"
sepolia = "${SEPOLIA_RPC_URL}"
holesky = "${HOLESKY_RPC_URL}"
arbitrum = "${ARBITRUM_RPC_URL}"
optimism = "${OPTIMISM_RPC_URL}"
polygon = "${POLYGON_RPC_URL}"
# Etherscan API keys
[etherscan]
mainnet = { key = "${ETHERSCAN_API_KEY}" }
sepolia = { key = "${ETHERSCAN_API_KEY}" }
holesky = { key = "${ETHERSCAN_API_KEY}" }
arbitrum = { key = "${ARBISCAN_API_KEY}" }
optimism = { key = "${OPTIMISTIC_ETHERSCAN_API_KEY}" }
polygon = { key = "${POLYGONSCAN_API_KEY}" }
# Profile for CI with higher fuzz runs
[profile.ci]
fuzz_runs = 10000
invariant_runs = 1000
invariant_depth = 20
# Profile for intense fuzzing
[profile.intense]
fuzz_runs = 50000
invariant_runs = 5000
invariant_depth = 50
fuzz_max_test_rejects = 1000000
# Profile for quick testing
[profile.quick]
fuzz_runs = 32
invariant_runs = 32
invariant_depth = 5