Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to enable compiler optimization in Solidity.
Blockchain / Solidity
pragma solidity ^0.8.0; contract OptimizedContract { // Enable optimization with [1] }
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using '=' instead of ':' in the optimizer setting.
Using incorrect keywords like 'optimization' or 'optimize'.
✗ Incorrect
In Solidity, compiler optimization is enabled in the configuration using 'optimizer: true'.
2fill in blank
mediumComplete the code to set the optimizer runs to 200.
Blockchain / Solidity
pragma solidity ^0.8.0; contract OptimizedContract { // Set optimizer runs to [1] }
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using '=' instead of ':' for runs.
Setting runs to 100 instead of 200.
✗ Incorrect
The optimizer runs are set using 'runs: 200' in the compiler configuration.
3fill in blank
hardFix the error in the optimizer configuration line.
Blockchain / Solidity
optimizer: [1] true, runs: 200
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using '=' or '==' instead of ':'.
Using '=>' which is not valid here.
✗ Incorrect
The correct syntax uses a colon ':' to assign values in Solidity compiler settings.
4fill in blank
hardFill both blanks to complete the optimizer configuration object.
Blockchain / Solidity
{ optimizer: [1], runs: [2] } Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Disabling optimizer by setting false.
Setting runs to 100 instead of 200.
✗ Incorrect
The optimizer is enabled with 'true' and runs set to 200 for better optimization.
5fill in blank
hardFill all three blanks to complete the Solidity compiler optimization settings.
Blockchain / Solidity
settings = { optimizer: [1], runs: [2], details: { [3]: true } } Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Setting optimizer to false disables optimization.
Using runs less than 300 for this example.
Missing 'yul' detail option.
✗ Incorrect
Optimizer is enabled (true), runs set to 300 for more optimization, and 'yul' enabled in details for advanced optimization.