[N-05] Use Custom Errors Instead of Revert Strings #247
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR addresses issue N-05 from the audit report.
In particular this PR changes the Safe 4337 module contract to use custom error codes instead of revert messages. This has a positive impact on the code size of the contracts.
That being said, the 4337 entry point contract v0.6.0 has special support for revert strings, and as such I do not believe this to be a positive change in the context that the 4337 module is designed to work for the v0.6.0 contracts. In particular, we believe that prioritizing debuggability is more important than contract code size improvements or potential gas savings in the error paths. With that in mind, I would recommend this change to not be included for the module supporting the v0.6.0 version of the entry point contract.
However, the special support in the entry point contract with revert string was removed in recent versions of the contract. As of yet, v0.7.0 is unreleased, but these changes should be included when the module is upgraded to v0.7.0 of the contracts once released.