Skip to main content
Solidity Code Completion Medium +20 XP

Require Message

Complete the require with an error message.

SolidityFill in the blank
require(balance >= amount, ___("Insufficient balance"));

Type the missing code

Show answer and explanation

Answer: string

require(condition, message) reverts with the message if the condition is false. The message is a string type.

Hint: What type is the error message in require()?

What this challenge tests

Code Completion in Solidity: require, errors.

Related challenges