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

fix: use custom errors to reduce gas consumption #187

Merged
merged 13 commits into from
May 8, 2023

Conversation

nmlinaric
Copy link
Contributor

@nmlinaric nmlinaric commented Apr 21, 2023

Description

Use revert Custom Errro() instead of require across contracts to reduce gas consumption.

Related Issue Or Context

Closes: #179

How Has This Been Tested? Testing details.

unit tests

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation

Checklist:

  • I have commented my code, particularly in hard-to-understand areas.
  • I have ensured that all acceptance criteria (or expected behavior) from issue are met
  • I have updated the documentation locally and in chainbridge-docs.
  • I have added tests to cover my changes.
  • I have ensured that all the checks are passing and green, I've signed the CLA bot

contracts/ERC20Safe.sol Show resolved Hide resolved
@nmlinaric nmlinaric force-pushed the nmlinaric/custom-errors branch from 1214436 to 201c717 Compare April 26, 2023 09:48
@nmlinaric nmlinaric requested a review from lastperson April 26, 2023 10:00
Copy link
Contributor

@lastperson lastperson left a comment

Choose a reason for hiding this comment

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

Tiny style fix.

test/helpers.js Outdated Show resolved Hide resolved
@nmlinaric nmlinaric requested a review from lastperson April 26, 2023 13:45
@nmlinaric nmlinaric force-pushed the nmlinaric/custom-errors branch 4 times, most recently from f2a1173 to 9bf71cb Compare April 28, 2023 06:27
@nmlinaric nmlinaric force-pushed the nmlinaric/custom-errors branch from 9bf71cb to 0513112 Compare May 3, 2023 11:29
@nmlinaric nmlinaric merged commit 51a2eb8 into master May 8, 2023
@nmlinaric nmlinaric deleted the nmlinaric/custom-errors branch May 8, 2023 11:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use Custom Errors To Save Gas
4 participants