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

Document additional_compiler_profiles and compilation_restrictions #1389

Open
moh-eulith opened this issue Jan 19, 2025 · 2 comments
Open

Document additional_compiler_profiles and compilation_restrictions #1389

moh-eulith opened this issue Jan 19, 2025 · 2 comments

Comments

@moh-eulith
Copy link

Component

Forge

Describe the feature you would like

In a largish solidity project, I have to use different optimization levels for different contracts, due to size restrictions. Currently, I'm doing that via a plain shell script invoking solc. I do, however, use forge for various things (test, bind, etc). Needless to say, that reduces the utility I get from forge's build (gas values are incorrect, the binaries are different, etc).

It would be ideal if we could have per contract build flags in the toml.

Additional context

No response

@yash-atreya
Copy link
Member

yash-atreya commented Jan 20, 2025

@moh-eulith You can use compilation_restrictions for this. See foundry-rs/foundry#8668. Set different optimization_runs for different paths.

@moh-eulith
Copy link
Author

Thanks @yash-atreya . If I'm not mistaken, that's not documented, so maybe we can change this issue to a doc issue.

@grandizzy grandizzy changed the title Per contract build flags Document additional_compiler_profiles and compilation_restrictions Jan 20, 2025
@grandizzy grandizzy transferred this issue from foundry-rs/foundry Jan 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Todo
Status: No status
Development

No branches or pull requests

2 participants