Fix TokenMutation V2 from_address and event type mapping - #49
Open
sausagee wants to merge 3 commits into
Open
Conversation
0x4::token::Mutation stored the token object as from_address and relabeled the row as 0x4::collection::MutationEvent. Use the txn sender (same as MutationEvent) and remap to 0x4::token::MutationEvent. Co-authored-by: Young Yang Liauw <sausagee@users.noreply.github.com>
sausagee
marked this pull request as ready for review
September 6, 2026 12:49
This was referenced Sep 6, 2026
CI Lint: apply cargo +nightly fmt so rustfmt --check passes.
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.
Bug
0x4::token::Mutation(V2 module event) writes a corruptedtoken_activities_v2row:from_addressis set toinner.token_address— the token object being mutated, not the account that submitted the mutation.type_is hardcoded to0x4::collection::MutationEvent— a collection event type — instead of0x4::token::MutationEvent.Account-scoped activity feeds then attribute the mutation to an object ID, and type filters mix token mutations with collection events.
Root cause
Sibling
TokenMutationEvent(0x4::token::MutationEvent) already documents the intended rule (from_address= txn sender) and keepstype_as0x4::token::MutationEvent. The module-event branch copied the Mint/Burn remap pattern but used the collection module name and filledfrom_addressfrom the event’s object field.This is not covered by open PRs #16–#48.
Fix
from_addressto the transaction sender (same asTokenMutationEvent).0x4::token::Mutation→0x4::token::MutationEventso both event styles share one type.Tests
cargo test -p processor --lib token_mutation_v2_uses_sender_not_token_address— passcargo clippy -p processor --lib --tests -- -D warnings— pass