Quiz Entry - updated: 2026.07.30
What do require and revert do in Solidity?
require(condition, "msg") checks a condition and, if false, reverts the transaction; revert triggers that rollback directly with no condition.
A revert undoes every state change made so far, as if nothing happened, and refunds the remaining (unused) gas — though gas already spent before the failure is not returned. require is the standard input/validity guard at the top of a function.