Skip to content

fix: validate FiatTokenUtil target contract - #686

Open
Kewe63 wants to merge 1 commit into
circlefin:masterfrom
Kewe63:fix/fiat-token-util-target-validation
Open

Kewe63 wants to merge 1 commit into
circlefin:masterfrom
Kewe63:fix/fiat-token-util-target-validation

Conversation

@Kewe63

@Kewe63 Kewe63 commented Oct 19, 2026

Copy link
Copy Markdown

Summary

Detail

transferWithMultipleAuthorizations uses a low-level call and treats the EVM success bit as a successful transfer. Calls to addresses without deployed code return success with empty data, so a utility configured with such a target can report successful transfers without executing FiatToken logic.

The constructor now uses OpenZeppelin's Address.isContract to require that the immutable target already has deployed code. Correctly configured instances retain the same runtime behavior; the change only rejects invalid deployments earlier.

Because isContract relies on deployed bytecode, the target must already be deployed when constructing FiatTokenUtil. Existing proxy-based deployments satisfy this requirement.

Testing

  • Confirmed the new invalid-target tests fail against the previous constructor behavior.
  • yarn compile
  • yarn static-check
  • yarn hardhat test test/v2/FiatTokenUtil.test.ts --no-compile — 3 passing
  • forge test -vvv — 8 passing
  • Full Hardhat CI matrix — a local broad-group attempt was OOM-killed under a 3.7 GiB WSL environment; the focused regression suite and repository compile/static checks pass.

Documentation

Issue #685 was updated with the repository-native regression test path. No user-facing documentation changes are required.


Requested Reviewers: Maintainers

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.

FiatTokenUtil can report successful transfers when configured with a no-code target

1 participant