protocol
protocol copied to clipboard
Replace require functions with custom errors
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.