livepeer / protocol

Livepeer protocol
MIT License
152 stars 45 forks source link

Replace require functions with custom errors #565

Open RiccardoBiosas opened 2 years ago

RiccardoBiosas commented 2 years ago

Context The protocol code-base is currently using require paired with fairly lengthy error strings, which end up being quite expensive from a gas perspective.

Proposal Solidity has introduced custom errors since v0.8.4, which provide a cheaper alternative to throw exceptions. We can consider using them as a replacement to the current require checks.