Fix burned NFT soulbound flag when ObjectCore is retained - #46
Open
sausagee wants to merge 4 commits into
Open
Conversation
.map().is_some() treated any object_metadatas hit as soulbound, including transferable tokens with untransferable=None (Some(None)). Co-authored-by: Young Yang Liauw <sausagee@users.noreply.github.com>
Co-authored-by: Young Yang Liauw <sausagee@users.noreply.github.com>
sausagee
marked this pull request as ready for review
September 6, 2026 12:12
The fixture already has non_transferrable_by_owner=false. is_soulbound_v2 was true only because of the map().is_some() Option-nesting bug. Co-authored-by: Young Yang Liauw <sausagee@users.noreply.github.com>
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
TokenOwnershipV2::get_burned_nft_v2_from_write_resourcedecidesis_soulbound_v2with:.map()turnsOption<&ObjectAggregatedData>intoOption<Option<&Untransferable>>. Then.is_some()is true whenever the object is in the map, even whenuntransferableisNone.On the production burn path, Loop 1 always inserts ObjectCore into
object_metadatas. So every burned V2 NFT that still has ObjectCore written is stored asis_soulbound_v2 = true, including freely transferable tokens (untransferable = None,allow_ungated_transfer = true).The live ownership path in the same file already uses the correct check:
The
test_token_v2_burn_event_v1golden encoded this:is_soulbound_v2: truenext tonon_transferrable_by_owner: false.Not covered by open PRs #16–#45 (#37 is burned-NFT owner lookup on DB error; #38–#41 are ObjectCore-missing skips).
Root cause
Option nesting:
Some(None).is_some()istrue. The burn path neededand_then, notmap.Fix
Use
.and_then(|obj| obj.untransferable.as_ref()).is_some()so a present object withuntransferable = Nonefalls through to!allow_ungated_transfer. Update the burn-event-v1 golden tois_soulbound_v2: false.Tests run (rustc 1.85.0)
cargo test -p processor --lib burned_— 3 passedcargo test -p processor --lib— 27 passed; 18 failed only on missing Docker/GCS (processor_status_saver / parquet buffer), unrelatedcargo clippy -p processor --lib --tests -- -D warnings— clean (stable 1.85)cargo +nightly fmt -- --checkon the changed file — cleantest_token_v2_burn_event_v1failed on the stale golden (truevsfalse); golden updated. Other token_v2 tests includingtest_token_v2_burn_event_v2passed.cargo +nightly xclippy) fails compilingallocative(Infalliblevs!). Same failure on Fix fee-payer signer omitted from signatures and account_transactions #43–Fix transfer-row non_transferrable_by_owner copying is_soulbound #47; not introduced here.Out of scope (checked, not filed)
is_soulboundintonon_transferrable_by_owneringet_nft_v2_from_token_data(see Fix transfer-row non_transferrable_by_owner copying is_soulbound #47).domainsvsv2_1_domains: intentional Movement nameservice change.