Skip to content

feat(react): add flash loan guard, split recipient shares hooks and mint layout role gating - #1280

Open
serverlessdomain-hash wants to merge 1 commit into
BCPathway:mainfrom
serverlessdomain-hash:feat/batch-1201-1202-1204
Open

serverlessdomain-hash wants to merge 1 commit into
BCPathway:mainfrom
serverlessdomain-hash:feat/batch-1201-1202-1204

Conversation

@serverlessdomain-hash

Copy link
Copy Markdown

Summary

This pull request implements Phase 3 frontend smart contract hooks and token operations UI layout improvements across the bc-forge workspace.

Resolved Issues

Key Changes

1. Flash Loan Guard Hook (useFlashLoanGuardStatus) - Issue #1201

  • Added getFlashLoanLockStatus(address, guardContractId?) to bcForgeClient and MockBcForgeClient.
  • Implemented useFlashLoanGuardStatus in react/src/hooks.ts returning { isLocked, warning, depositBlock, currentLedger, loading, error, refetch }.
  • Displays contextual warnings when flash loan withdrawal locks are engaged in the same ledger sequence.
  • Added comprehensive unit tests in react/src/hooks.test.tsx.

2. Split Recipient Shares Hook (useSplitRecipientShares) - Issue #1202

  • Added getSplitInvoice(invoiceId, splitContractId?) to bcForgeClient and MockBcForgeClient.
  • Implemented useSplitRecipientShares in react/src/hooks.ts querying split invoice allocations, recipient percentage shares, and unreleased/claimable dividend balances.
  • Added unit tests in react/src/hooks.test.tsx.

3. MintScreen Form Layout & Role Indicator - Issue #1204

  • Added caller minter role check with visual status badge indicator (Minter Authorized vs Not Authorized).
  • Gated submission and disabled submit button when caller lacks Minter/Admin role with clear inline Alert and helper text.
  • Added descriptive helper text for both Recipient Address and Amount input fields.
  • Added unit tests in react/src/screens/MintScreen.test.tsx.

Verification

  • npm run build --workspace @bc-forge/sdk: Successful clean build.
  • npm test --workspace @bc-forge/react: All 16 suites (173 tests) passed.
  • npm run build --workspace @bc-forge/react: Successful CJS, ESM, and DTS bundles generation.

@drips-wave

drips-wave Bot commented Oct 17, 2026

Copy link
Copy Markdown

@serverlessdomain-hash 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

This branch has not been deployed

No deployments
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.

[Phase 3] Build MintScreen Form Layout [Phase 3] Build useSplitRecipientShares Hook [Phase 3] Build useFlashLoanGuardStatus Hook

1 participant