Skip to content

Conversation

@pegahcarter
Copy link
Collaborator

@pegahcarter pegahcarter commented Dec 1, 2025

Key Changes

1. EIP-3009 Support added - Adds EIP-3009 (Transfer with Authorization) functionality to:

  • Fraxtal sfrxUSD
  • Fraxtal frxUSD
  • Ethereum frxUSD
  • Ethereum sfrxUSD

Copilot AI mentioned this pull request Dec 5, 2025
@pegahcarter pegahcarter marked this pull request as ready for review December 7, 2025 17:15
Copilot AI review requested due to automatic review settings December 7, 2025 17:15
Copy link

Copilot AI left a 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, and cancelAuthorization methods with ERC-1271 signature support
  • Adds isFreezer mapping 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.

Comment on lines +44 to +53
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);
Copy link

Copilot AI Dec 7, 2025

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.

Suggested change
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);

Copilot uses AI. Check for mistakes.
);
}

function getReceivewithAuthorizationStructHash(
Copy link

Copilot AI Dec 7, 2025

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.

Copilot uses AI. Check for mistakes.
@pegahcarter pegahcarter changed the base branch from master to feat/freeze-array December 18, 2025 20:45
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.

3 participants