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

Update ERC20 Token with Decimals & Permit support #220

Merged
merged 8 commits into from
Mar 17, 2023
Merged

Conversation

seaona
Copy link
Contributor

@seaona seaona commented Mar 15, 2023

Context: the old ERC20 token contract didn't allow for changing the decimals, when passed on the contract deployment. This has been showcasted here even if it looks like we pass a value, it always defaults to 4. This problematic, as we need the ability to set the decimals in order to test different cases (i.e. tokens with 0 decimals).

Furthermore, having an ERC20 with Permit support, will allow us to test the Permit signature flow end-to-end. The previous Permit signature work has already been done here.

Lastly, since we didn't have the source contract, we could not actually see any of these missing properties, until it has been manually checked. So, having the contract source is convenient.

What: this PR updates the ERC20 token contract with 3 improvements:

  • Allowing to input decimals on the constructor, so 4decimals are not hardcoded anymore
  • Adding Permit support. This will allow us to test end-to-end the Permit Signature, by grabbing the r, s and v values. Introduced already here
  • Adding the contract source on the contracts folder

How: the ERC20 with Permit support has been created using the Open Zeppelin wizard, to make sure we are following the standards.
The decimal support on the constructor has been modified on the ERC20 contract base from open-zeppelin.

image

@seaona seaona requested a review from a team as a code owner March 15, 2023 10:45
Copy link
Contributor

@PeterYinusa PeterYinusa left a comment

Choose a reason for hiding this comment

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

LGTM!

@seaona seaona merged commit 9947689 into main Mar 17, 2023
@seaona seaona deleted the erc20-decimals-permit branch March 17, 2023 09:20
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.

2 participants