Skip to content

fix(onchain): structured & safe NFT badge mint failures - #402

Open
temiport25 wants to merge 1 commit into
UnityChainxx:mainfrom
temiport25:feat/temiport25-structured-nft-errors
Open

fix(onchain): structured & safe NFT badge mint failures#402
temiport25 wants to merge 1 commit into
UnityChainxx:mainfrom
temiport25:feat/temiport25-structured-nft-errors

Conversation

@temiport25

Copy link
Copy Markdown

Closes #291

…te safe

Resolve the configured admin before writing any badge state in the NFT
contract's mint_level_badge. If the NFT contract was never initialized
this now surfaces a structured NotInitialized error instead of an opaque
expect("admin not set") panic, and guarantees the badge/badge_data
writes can never be left as a partial state change on a failed mint.

- add NotInitialized error variant to StellarHuntsNft
- read admin up front in mint_level_badge before any storage write
- fix pre-existing broken test_double_mint_rejected (undefined client/long_uri)
- add test_mint_uninitialized_is_structured_and_leaves_no_partial_state
- drop unused receiver imports

Closes UnityChainxx#291
@drips-wave

drips-wave Bot commented Aug 30, 2026

Copy link
Copy Markdown

@temiport25 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

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.

[P1][onchain] Make cross-contract failures observable and recoverable

1 participant