-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Closed
Labels
A-compilerArea: compilerArea: compilerA-configArea: configArea: configT-featureType: featureType: feature
Milestone
Description
Component
Forge
Describe the feature you would like
The main use case for this is when one contract is close to the size limit—compile the large contract with 1 optimizer run (which minimizes code size) and compile the rest with larger values of optimizer runs.
In #3062 we were tracking this and had a potential UX but that issue was closed by the inline config PR, so I think we lost track of this feature request? Either way, the idea was :
# In our default solidity profile we apply 10M optimizer runs.
[profile.default.solidity]
optimizer = true
optimizer-runs = 10_000_000
# But we have one really big contract, so we use 1 optimizer run to minimize
# its size.
[profile.default.solidity.minimize_size]
optimizer = true
optimizer-runs = 1
match-contract = "MyBigContract" # all match flags supportedHardhat has supported this for a long time, as seen here:
module.exports = {
solidity: {
compilers: [...],
overrides: {
"contracts/Foo.sol": {
version: "0.5.5",
settings: { }
}
}
}
}Additional context
No response
sebastianst, jubeira, RensR, mendesfabio, EndymionJkb and 9 more
Metadata
Metadata
Assignees
Labels
A-compilerArea: compilerArea: compilerA-configArea: configArea: configT-featureType: featureType: feature