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

Fiat Token v2.2 #425

Merged
merged 25 commits into from
Nov 9, 2023
Merged

Fiat Token v2.2 #425

merged 25 commits into from
Nov 9, 2023

Conversation

yvonnezhangc
Copy link
Contributor

@yvonnezhangc yvonnezhangc commented Nov 9, 2023

Summary

This PR contains a series of backwards-compatible changes for version 2.2 of the Fiat Token smart contracts. Over the upcoming months, the new implementation will be deployed to all Circle-issued stablecoins, including USDC and EURC, across all EVM-compatible blockchains currently supported by Circle.

Please reference the CHANGELOG to get a brief overview of the proposed improvements. For more comprehensive insights into each of these changes and the rationale behind them, we invite you to read the v2.2 launch blog post.

circle-aloychan and others added 25 commits October 19, 2023 13:05
* Setup and test CI

* Fix new line

* Lock node version

* Fix new line and add PR template

* Address feedback

* Remove unused files
* Add test to make sure DOMAIN_SEPARATOR slot stays at 15

* Override DOMAIN_SEPARATOR to detect when chainid has changed

* Add contract size plugin

* Add mock fiat token class to test all branches

* Reduce solc warnings and update license

* Add contract size command

* Minor edits with husky

* Update yarn.lock

* Update contract version in comments

* Recalculate domain separator every time

---------

Co-authored-by: Erik Tierney <[email protected]>
* Add V2_2Upgrader

* Fixed tests

* Fix typecheck and update CI

* Fix yarn check

* Update upgrader and tests

* Add domainSeparator to check

* Update comment

* Address feedback

* Also check rescuer, paused and totalSupply

* Rename to checkFiatTokenMetadataEqual

* Add description to upgrader

* Remove withdrawUSDC and update test

* Update docs to reference a yarn script instead
* Remove references to USDC

* Fix solhint

* Create AbstractV2Upgrader

* Refactor tearDown

* Update comments

* Remove migrate scripts

* Update docs

* Update natspec and remove unused import

* Update helpers

* Remove V2_1UpgraderHelper
* Add EIP-1271 related utility contracts

* Update package.json

* Clarify documentation and address minor PR comments

* Include the magic value in IERC1271 return value description

* Add test case to demonstrate behavior of state modifying wallet

* Modify test description

* Rename MockMaliciousERC1271Wallet

* Rename wallet variables

* Address nits
* Re-route EIP-2612 and EIP-3009 functions to use SignatureChecker

* Add @dev docs to specify signature packing order
* Add unified interface for EOA and contract wallet signatures

* Modify comment
* Rename blacklist mapping to _deprecatedBlacklisted

* Rename balances to balanceAndBlacklistStates

* Rename balances to balanceAndBlacklistStates

* Replace _deprecatedBlacklisted
* Update Blacklistable methods

* Update FiatTokenV1 implementations

* Rename and refactor methods

* Update storageSlots test

* Update misc test

* Update unit tests

* Add FiatTokenV2_2 tests

* Fix test

* Fix ci

* Allow unlimited contract size on Ganache

* Update contract size check

* Change blacklist file and add comment about test file

* Fix copyright headers in PR

* Update NatSpec docs

* Also remove proxy from deprecatedBlacklisted

* Update _setBalance
* Remove unused imports

* Fix additional solhint warnings
* Remove blacklist modifier from approve, permit, and increase/decreaseAllowance

* Update unit tests

* Update comments

* Address nits

* Update documentations
* Update/add NatSpec comments

* Replace references to USDC

* Address comment

* Tiny grammar fixes
* Centralize ganache accounts initialization

* Delete unnecessary exports from TokenTestUtils

* Improve import
* Add script to get blacklisted accounts

* Update files to JSON instead of JS

* Output to .remote.json instead

* Update doc and add script to get contract creation block number

* Fix script

* Use Blacklistable abi instead
* Centralize static hex values in constants

* Organize hex and bn values

* Remove the rest of the TODOs

* Remove redundant import/export
* Add script to call read-only functions on a contract

* Update upgrader doc

* Move address definition out and remove redundant func abstraction

* Update JSDoc

* kebab-ify script args
* Create script to deploy MockERC1271Wallet

* Modify config.js

* Update documentation for testing sample ERC1271 wallet

* Update v2.2 doc
* Update LICENSE

* Update licenser format

* Update licence headers

---

Co-authored-by: Aloysius Chan <[email protected]>
* Update centrehq to circlefin

* Update centre-tokens references

* Remove typo

* Update more docs

* Organize README

* Add more content

* Add reference to OZ Proxy Upgrade Pattern
* Add migration option to directly deploy v2.2 token

* Minor modification to migration script

* Update copyright headers for new files

* Minor changes to deploy scripts
* Update validateAccountsToBlacklist

* Add rebase script

* Add diff checker

* Update validateAccountsToBlacklist

* Update validateAccountsToBlacklist

* Address feedback

* Tiny fix to duplicate validation
* Add changelog
@yvonnezhangc yvonnezhangc requested a review from a team November 9, 2023 12:57
@yvonnezhangc yvonnezhangc merged commit 405efc1 into circlefin:master Nov 9, 2023
1 check passed
@yvonnezhangc yvonnezhangc deleted the release_v2_2 branch November 9, 2023 13:55
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.

7 participants