Skip to content

fix: guard learn-token arithmetic - #681

Merged
DeFiVC merged 1 commit into
ChainLearnOfficial:mainfrom
manoahLinks:fix/issues-554-557
Oct 21, 2026
Merged

DeFiVC merged 1 commit into
ChainLearnOfficial:mainfrom
manoahLinks:fix/issues-554-557

Conversation

@manoahLinks

Copy link
Copy Markdown
Contributor

Add checked balance and reward arithmetic and define progress-tracker error variants.
Closes #555
Closes #556
Closes #557
Closes #554
(typed error variants added; public Result conversion remains incomplete).

Pull Request

Summary

Changes

Testing

  • cargo build --release --target wasm32-unknown-unknown
  • cargo test --workspace
  • cargo clippy --workspace --all-targets -- -D warnings
  • cargo fmt --all -- --check

Security Considerations

  • Authorization is preserved and require_auth() is called before any state read/write on every state-changing entrypoint
  • Role-based access control (Admin/Minter/Pauser) is enforced and revocation takes effect immediately
  • Initialization/re-initialization guards are intact (rejects double-initialization)
  • Arithmetic uses checked or saturating operations; supply and reward bounds hold
  • Cross-contract calls remain read-only and resolve the progress-tracker address once per batch
  • Storage layout changes are documented with a migration/upgrade plan (see docs/upgrade-guide.md)
  • Transfer restrictions and soulbound credential rules are unchanged
  • All state-changing operations emit appropriate events
  • No hardcoded addresses or private keys; no unsafe; #[no_std] preserved
  • New/changed public functions have doc comments and test coverage for error conditions

Breaking Changes

None

Checklist

  • One focused change; no unrelated formatting, generated files, secrets, or deployment keys
  • Branch is created from the current main
  • Documentation and CHANGELOG.md updated (including a Breaking Changes entry when applicable)
  • Required local checks above pass with no failures
  • Linked issue(s) referenced in the Summary
  • All testable acceptance criteria in the linked issue(s) are met

Add checked balance and reward arithmetic and define progress-tracker error variants.\n\nCloses ChainLearnOfficial#555\nCloses ChainLearnOfficial#556\nCloses ChainLearnOfficial#557\nRefs ChainLearnOfficial#554 (typed error variants added; public Result conversion remains incomplete).
@drips-wave

drips-wave Bot commented Oct 21, 2026

Copy link
Copy Markdown

@manoahLinks 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

@DeFiVC
DeFiVC merged commit 4b12cec into ChainLearnOfficial:main Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants