Problem Statement
The codebase has unwrap_or, unwrap_or_else, and unwrap strewn
across the file — some fire panic_with_error, others silently
default to 0 or false. There's no shared helper.
Why it matters
Silent defaults are dangerous. .unwrap_or(0) on a balance is
distinguishable from "balance genuinely zero" only by checking the
key.
Acceptance Criteria
- All
unwrap_or(0) on persistent storage reads replaced by explicit
get::<_, i128> checks that distinguish "missing" from "zero".
- All
unwrap_or(false) on Paused distinguished from "key missing
vs key unset".
Files/Modules Affected
Difficulty Medium. Estimated Effort S.
Labels
area:code-quality, area:smart-contract-safety,
priority:medium
Imported from docs/open-issues-draft.md as draft issue #59 (commit 7becd4b). Original draft-order cross-references in this body have been remapped to current GitHub issue numbers at import time.
Problem Statement
The codebase has
unwrap_or,unwrap_or_else, andunwrapstrewnacross the file — some fire
panic_with_error, others silentlydefault to
0orfalse. There's no shared helper.Why it matters
Silent defaults are dangerous.
.unwrap_or(0)on a balance isdistinguishable from "balance genuinely zero" only by checking the
key.
Acceptance Criteria
unwrap_or(0)on persistent storage reads replaced by explicitget::<_, i128>checks that distinguish "missing" from "zero".unwrap_or(false)onPauseddistinguished from "key missingvs key unset".
Files/Modules Affected
src/lib.rssrc/test.rsDifficulty Medium. Estimated Effort S.
Labels
area:code-quality,area:smart-contract-safety,priority:mediumImported from
docs/open-issues-draft.mdas draft issue #59 (commit7becd4b). Original draft-order cross-references in this body have been remapped to current GitHub issue numbers at import time.