-
Notifications
You must be signed in to change notification settings - Fork 2
(s)frxUSD Upgrades #11
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
base: feat/freeze-array
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds EIP-3009 (Transfer with Authorization) support to frxUSD and sfrxUSD on both Ethereum and Fraxtal, and introduces a new multi-freezer role system for frxUSD. The changes enable gasless transfers via meta-transactions and allow designated freezer addresses (not just the owner) to freeze user accounts.
Key Changes:
- Implements EIP-3009 functionality including
transferWithAuthorization,receiveWithAuthorization, andcancelAuthorizationmethods with ERC-1271 signature support - Adds
isFreezermapping to frxUSD allowing multiple addresses to freeze accounts (unfreezing remains owner-only) - Introduces versioned contract architecture with new module-based design for signature validation
Reviewed changes
Copilot reviewed 29 out of 30 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| src/test/utils/SigUtils.sol | New test utility for generating EIP-712 signatures for permit and EIP-3009 functions |
| src/contracts/shared/core/modules/*.sol | New modular contracts implementing signature validation, permit, and EIP-3009 functionality |
| src/contracts/ethereum/frxUSD/* | Ethereum frxUSD upgraded to v3.0.0 with EIP-3009 support and freezer role |
| src/contracts/ethereum/sfrxUSD/* | Ethereum sfrxUSD upgraded to v3.0.0 with EIP-3009 support |
| src/contracts/fraxtal/frxUSD/* | Fraxtal frxUSD upgraded to v3.0.0 with EIP-3009 support and freezer role |
| src/contracts/fraxtal/sfrxUSD/* | Fraxtal sfrxUSD upgraded to v2.0.0 with EIP-3009 support |
| src/test/*/SignatureTests.t.sol | Comprehensive test suites for EIP-3009 and permit functionality across all deployments |
| src/test/*/CompilanceTests.t.sol | Updated compliance tests to reflect new freezer role permissions |
| src/script//Deploy.s.sol | Deployment scripts for upgrading contracts on both chains |
| foundry.toml | Enabled FFI and filesystem permissions for deployment script functionality |
| package.json | Updated frax-standard-solidity dependency to v1.1.3 |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| function __transfer(address owner, address spender, uint256 amount) internal override returns (bool) { | ||
| balanceOf[owner] -= amount; | ||
|
|
||
| // Cannot overflow because the sum of all user | ||
| // balances can't exceed the max uint256 value. | ||
| unchecked { | ||
| balanceOf[spender] += amount; | ||
| } | ||
|
|
||
| emit Transfer(owner, spender, amount); |
Copilot
AI
Dec 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Misleading parameter names. The parameters are named owner and spender, but this is a transfer function where the parameters should semantically represent from and to addresses. While this doesn't affect functionality, it makes the code harder to understand. Consider renaming to from and to for clarity.
| function __transfer(address owner, address spender, uint256 amount) internal override returns (bool) { | |
| balanceOf[owner] -= amount; | |
| // Cannot overflow because the sum of all user | |
| // balances can't exceed the max uint256 value. | |
| unchecked { | |
| balanceOf[spender] += amount; | |
| } | |
| emit Transfer(owner, spender, amount); | |
| function __transfer(address from, address to, uint256 amount) internal override returns (bool) { | |
| balanceOf[from] -= amount; | |
| // Cannot overflow because the sum of all user | |
| // balances can't exceed the max uint256 value. | |
| unchecked { | |
| balanceOf[to] += amount; | |
| } | |
| emit Transfer(from, to, amount); |
| ); | ||
| } | ||
|
|
||
| function getReceivewithAuthorizationStructHash( |
Copilot
AI
Dec 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function name has inconsistent capitalization. It should be getReceiveWithAuthorizationStructHash to match the naming pattern used in getTransferWithAuthorizationStructHash.
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Key Changes
1. EIP-3009 Support added - Adds EIP-3009 (Transfer with Authorization) functionality to: