Fix missing blacklist checks in NativeFiatTokenV2_2 transfer functions#656
Open
Kewe63 wants to merge 4 commits into
Open
Fix missing blacklist checks in NativeFiatTokenV2_2 transfer functions#656Kewe63 wants to merge 4 commits into
Kewe63 wants to merge 4 commits into
Conversation
- Update @typechain/ethers-v6 from 0.4.3 to 0.5.1 - Update typechain from 8.3.1 to 8.3.2 - Resolves peer dependency conflicts that break project setup
This reverts commit 2c2f3a1.
Add missing notBlacklisted modifiers to transferFrom and transfer functions in NativeFiatTokenV2_2: - transferFrom: add notBlacklisted(from) and notBlacklisted(to) - transfer: add notBlacklisted(msg.sender) and notBlacklisted(to) The parent contract FiatTokenV1 correctly enforces all three blacklist checks on transferFrom (msg.sender, from, to) and both checks on transfer (msg.sender, to). NativeFiatTokenV2_2 dropped these when overriding, allowing blacklisted addresses to send and receive tokens via standard transfer functions.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add missing
notBlacklistedmodifiers totransferFromandtransferfunctions inNativeFiatTokenV2_2to prevent blacklisted addresses from bypassing compliance controls.Detail
The parent contract
FiatTokenV1correctly enforces all blacklist checks ontransferFrom(msg.sender,from,to) andtransfer(msg.sender,to). However,NativeFiatTokenV2_2dropped most of these modifiers when overriding:transferFrom: only hadnotBlacklisted(msg.sender)— missingnotBlacklisted(from)andnotBlacklisted(to)transfer: had no blacklist checks at all — missingnotBlacklisted(msg.sender)andnotBlacklisted(to)Without this fix, blacklisted accounts could transfer tokens via standard ERC-20 functions, completely bypassing the AML/compliance blacklist mechanism. The
transferfunction was particularly critical since it had zero blacklist enforcement.Changes:
transferFrom: addednotBlacklisted(from)andnotBlacklisted(to)transfer: addednotBlacklisted(msg.sender)andnotBlacklisted(to)This restores full parity with the parent contract
FiatTokenV1.Testing
fromaddress is rejected ontransferFromtoaddress is rejected ontransferFrommsg.senderis rejected ontransfertoaddress is rejected ontransferDocumentation
No documentation changes required. The function signatures remain the same; only modifier enforcement is added to match the parent contract behavior.
Requested Reviewers: @Kewe63