Quiz Entry - updated: 2026.07.30
What do constant and immutable do in Solidity?
Both mark a variable set once and never changed: constant for a value fixed at compile time, immutable for a value assigned once in the constructor.
They save gas because the value is baked into the contract's bytecode instead of a costlier storage slot. Convention: constant names in ALL_CAPS, immutable names with an i_ prefix.