Coding task · Blockchain and Web3 course · Module 6: Solidity Basics

Error Handling

Simulate require() in JavaScript using if and throw.

Task

Write a withdraw function that checks whether balance >= amount and throws an error if not