You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
solc run with optimizer turned on from the command line compiles my contract to 9k. Without the optimizer, solc compiles to 25k. Regardless of settings, hardhat compiles to 26k.
I can ignore warnings during the development cycle, but this makes testing and deployment impossible.
Minimal reproduction steps
$ npx hardhat compile
Warning: Contract code size is 26036 bytes and exceeds 24576 bytes (a limit introduced in Spurious Dragon). This contract may not be deployable on Mainnet. Consider enabling the optimizer (with a low "runs" value!), turning off revert strings, or using libraries.
--> contracts/Rewards.sol:12:1:
|
12 | contract Rewards {
| ^ (Relevant source part starts here and spans across multiple lines).
$ solc --optimize --combined-json bin Rewards.sol | jq '.contracts["Rewards.sol:Rewards"].bin'| wc -c | awk '{print ($1 - 3) / 2}'
--> Rewards.sol
9210
$ solc --combined-json bin Rewards.sol | jq '.contracts["Rewards.sol:Rewards"].bin'| wc -c | awk '{print ($1 - 3) / 2}'
--> Rewards.sol
Warning: Contract code size is 25299 bytes and exceeds 24576 bytes (a limit introduced in Spurious Dragon). This contract may not be deployable on Mainnet. Consider enabling the optimizer (with a low "runs" value!), turning off revert strings, or using libraries.
--> Rewards.sol:12:1:
|
12 | contract Rewards {
| ^ (Relevant source part starts here and spans across multiple lines).
25393
Version of Hardhat
2.20.1
What happened?
solc run with optimizer turned on from the command line compiles my contract to 9k. Without the optimizer, solc compiles to 25k. Regardless of settings, hardhat compiles to 26k.
I can ignore warnings during the development cycle, but this makes testing and deployment impossible.
Minimal reproduction steps
my config:
Search terms
compile optimizer size solidity
The text was updated successfully, but these errors were encountered: