Content pfp
0 reply
0 recast
0 reaction

Mark Tyneway pfp
Mark Tyneway
What are best practices for custom errors? - When should they include arguments? - Should there be many diff error types or more generic errors that accept arguments to differentiate error cases?
1 reply
2 recasts
13 reactions

William pfp
Always favor multiple error types over using an enumeration as an argument. Arguments are for free-form data that can't be known at compile time. Provide information useful to someone who can't see your contract's state or source code. Don't repeat transaction information they already have.
0 reply
0 recast
2 reactions