Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add optimized-build profile #36

Merged
merged 1 commit into from
Jan 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Foundry build and cache directories
out/
out-optimized/
cache/
node_modules/

Expand All @@ -8,4 +9,4 @@ report/
lcov.info

# secret
.env
.env
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ forge build

# or use the lite profile to reduce compilation time
FOUNDRY_PROFILE=lite forge build

# for faster IR builds (to check contract sizes)
FOUNDRY_PROFILE=optimized-build forge build --sizes
```

## Syntax check
Expand Down
8 changes: 7 additions & 1 deletion foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ runs=500
fail_on_revert = true
depth = 10

[profile.optimized-build]
via_ir = true
script = 'src'
test = 'src'
out = 'out-optimized'

[profile.lite]
solc = '0.8.21'
via_ir = false
Expand Down Expand Up @@ -44,4 +50,4 @@ goerli = "${GOERLI_RPC_URL}"
mainnet = { key = "${ETHERSCAN_API_KEY}" }
goerli = { key = "${ETHERSCAN_API_KEY}" }

# See more config options https://github.com/foundry-rs/foundry/tree/master/config
# See more config options https://github.com/foundry-rs/foundry/tree/master/config