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 error with hardhat support #217

Merged
merged 23 commits into from
Aug 29, 2023
Merged

Custom error with hardhat support #217

merged 23 commits into from
Aug 29, 2023

Conversation

rya-sge
Copy link
Collaborator

@rya-sge rya-sge commented Aug 15, 2023

  • For loops and function arguments optimization in SnapshotModule
  • Substitute require statements with custom errors

This task is made of these following subtasks:

Custom errors inside the solidity code (A)

  • A) Substitute require statements with custom errors inside the solidity code

OpenZeppelin (B)

  • B1) Update the OpenZeppelin version to the latest commit
  • B2) Update the Solidity version to 0.8.20, which is a requirement by OpenZeppelin
  • B3) The internal function from OpenZeppelin _beforeTokenTransfer is replaced by _update
  • B3a) SnapshotModule: call ERC20Upgradeable._update at the end of the function inside the surcharge of _update
  • B3b) CMTAT_BASE: call ERC20Upgradeable._update inside the surcharge of update
  • B3c) The internal function from OpenZeppelin _beforeTokenTransfer is replaced by _update
  • B3d) The forwarder from OpenZeppelin used in mock have also several improvements, requiring to update the tests.

Update the tests (C)

  • C1) Update the tests to check the custom errors
  • C2) Fix CMTAT deployment to run the tests with Hardhat
  • C3) Check custom errors with the OpenZeppelin library, works only with Hardhat
  • C4) Change the CLI to run all tests with Hardhat instead of Truffle
  • C5) SnasphotModule: use time of https://docs.openzeppelin.com/test-helpers/0.5/ instead of getTime => reduce the time for the test in a significative way.

Related to #133
Closes #131, #61

For reference: https://blog.openzeppelin.com/defining-industry-standards-for-custom-error-messages-to-improve-the-web3-developer-experience

…est through Hardhat + update SnapshotModule test to support Hardhat and upgrade to the latest OpenZeppelin version
@rya-sge rya-sge added enhancement New feature or request Update Update a library Proxy Issue affecting the proxy part labels Aug 16, 2023
@rya-sge rya-sge requested a review from veorq August 23, 2023 13:35
@rya-sge rya-sge self-assigned this Aug 23, 2023
@rya-sge rya-sge merged commit bc082bb into dev Aug 29, 2023
1 check passed
@rya-sge rya-sge mentioned this pull request Sep 4, 2023
10 tasks
@rya-sge rya-sge deleted the custom-error-hardhat branch January 18, 2024 10:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Proxy Issue affecting the proxy part Update Update a library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants