Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom errors #821

Merged
merged 8 commits into from
Nov 22, 2023
Merged

Custom errors #821

merged 8 commits into from
Nov 22, 2023

Conversation

zajck
Copy link
Member

@zajck zajck commented Nov 7, 2023

Close #818

Whenever it makes sense, old string revert reasons were replaced with custom errors, which are more gas-efficient.

Some of the errors are now less verbose than before. The mapping between old errors and new ones can be found by comparing values in scripts/config/revert-reasons-old.js and `scripts/config/revert-reasons.js

There were some inconsistencies in the error naming style, especially with the ones containing the word "invalid". The majority of them had "invalid" as a prefix, while some had it as a suffix. This was now unified, so all have "invalid" at the beginning.

Size change:
image

@coveralls
Copy link

coveralls commented Nov 7, 2023

Coverage Status

coverage: 98.627% (-0.2%) from 98.86%
when pulling d5004e9 on custom-errors
into d331983 on main.

Copy link
Member

@levalleux-ludo levalleux-ludo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding NatSpec comments in contracts/domain/BosonErrors.sol could make sense

levalleux-ludo
levalleux-ludo previously approved these changes Nov 14, 2023
Copy link
Member

@levalleux-ludo levalleux-ludo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

contracts/domain/BosonErrors.sol Dismissed Show dismissed Hide dismissed
@zajck zajck added the v2.4.0 label Nov 22, 2023
@zajck zajck merged commit f685df3 into main Nov 22, 2023
11 checks passed
@zajck zajck deleted the custom-errors branch November 22, 2023 12:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Replace revert reasons with custom errors
4 participants