Skip to content

fix(#326): add role-based auth and daily spending limits to institutional wallet#529

Open
danieloche635-bit wants to merge 1 commit into
Smartdevs17:mainfrom
danieloche635-bit:fix/326-institutional-multisig-spending-limits
Open

fix(#326): add role-based auth and daily spending limits to institutional wallet#529
danieloche635-bit wants to merge 1 commit into
Smartdevs17:mainfrom
danieloche635-bit:fix/326-institutional-multisig-spending-limits

Conversation

@danieloche635-bit

Copy link
Copy Markdown
Contributor

Summary

Implements role-based authorization and daily spending limits for the institutional-grade multisig wallet, completing the remaining acceptance criteria for issue #326.

Changes

New Features

  • WalletRole enum (Admin, Approver, Executor, Viewer) with role-based access control
  • DailySpendingLimit per-asset spending cap configuration
  • Role enforcement in propose(), approve(), and execute() entrypoints
  • Spending limit enforcement in execute() using the new Transaction.spend_amount and Transaction.spend_asset fields

New Entrypoints

  • assign_role(addr, role) - Assign a role to an address (admin only, via multisig)
  • revoke_role(addr) - Remove a role assignment
  • set_daily_spending_limit(asset, daily_limit) - Set per-asset daily spending cap
  • set_default_spending_limit(daily_limit) - Set default spending cap for all assets
  • get_role(addr), get_daily_spending_limit(asset), get_default_spending_limit() - View functions

Bug Fix

  • Fixed test.rs: added missing Symbol import for Symbol::new usage in recovery tests
  • Updated Transaction struct with spend_amount and spend_asset optional fields

Files Changed

  • stellar-lend/contracts/institutional-wallet/src/types.rs - Added WalletRole, DailySpendingLimit, new errors, Transaction fields
  • stellar-lend/contracts/institutional-wallet/src/storage.rs - Added role limit storage functions
  • stellar-lend/contracts/institutional-wallet/src/lib.rs - Role limit entrypoints
  • stellar-lend/contracts/institutional-wallet/src/test.rs - Fixed Symbol import

@vercel

vercel Bot commented Jun 23, 2026

Copy link
Copy Markdown

@danieloche635-bit is attempting to deploy a commit to the smartdevs17's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Jun 23, 2026

Copy link
Copy Markdown

Hey @danieloche635-bit! 👋 It looks like this PR isn't linked to any issue.

If this PR is for one of the issues assigned to you as part of a Wave, please link it to ensure your contribution is tracked properly. You can do this by adding a keyword to the PR description (e.g., Closes #123), or by clicking a button below:

Issue Title
#327 Add rebalancing engine for autonomous portfolio management Link to this issue
#328 Implement commitment-based lending with forward rate agreements Link to this issue
#326 Build institutional-grade multisig wallet with spending limits Link to this issue

ℹ️ Learn more about linking PRs to issues

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.

1 participant