Web3 DAO | Offchain Labs Logo

Generate compile-time error on div/mod with constant denominator zero

Organization

Offchain Labs

Deadline

N/A

Status

LIVE


INSTRUCTIONS

Currently, if a program divides or mods by a constant zero, the compiler will generate code that leads to a runtime panic. This should be detected at compile time and reported as an error.

(Note that the compiler already does compile-time constant folding, so this should be easy to check for.)