Skip to content

fix: resolve token storage variants, multi-sig recursion, and namespa…#210

Open
oscarj007 wants to merge 1 commit into
BCPathway:mainfrom
oscarj007:feature/issue-162-rbac-system
Open

fix: resolve token storage variants, multi-sig recursion, and namespa…#210
oscarj007 wants to merge 1 commit into
BCPathway:mainfrom
oscarj007:feature/issue-162-rbac-system

Conversation

@oscarj007
Copy link
Copy Markdown

Closes #162

Summary

This PR resolves 17 compilation errors and a critical infinite recursion loop warning within the bc-forge contract workspace. It standardizes storage access patterns, fixes data type comparisons, and corrects contract-to-contract namespace boundaries between the token and access-control modules.

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to change)
  • 📝 Documentation update
  • 🔧 Smart contract improvement
  • 🧪 Test coverage improvement
  • 🏗️ CI/Build improvement

Related Issue

Changes Made

1. bc-forge-token Module

  • Fixed Data Structures: Removed duplicate Allowance variant from DataKey enum and added missing AllowanceExp key.
  • Storage Helper Refactoring: Fixed read_allowance_info signature to properly return AllowanceInfo instead of trailing storage setter fragments.
  • Type-Safety Mismatches: Aligned block/ledger sequence comparisons to use matching integer types (u32 vs u64).
  • Namespace Updates: Migrated all old internal admin:: module references to call the external bc_forge_access primitive crate directly.
  • Code Housekeeping: Cleaned up unused contract imports to ensure a warning-free build profile.

2. bc-forge-access Module

  • Fixed Critical Infinite Loop: Resolved a stack-overflow vulnerability in is_proposal_ready where the function called itself recursively. It now correctly evaluates proposal validity by validating actual unique signatures against the multi-sig Threshold.

Testing

How has this been tested?

  • Rust unit tests pass (cargo test)
  • SDK compiles (npm run build in sdk/)
  • Manual testing against Soroban testnet
  • New tests added for changes

Test commands run:

# Contract build verification
cargo check --target wasm32-unknown-unknown

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 31, 2026

@oscarj007 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.

Implement role-based access control (RBAC) replacing simple admin model

1 participant