Summary
src/lib/batchTransaction.ts fabricates confirmation data with Math.random and races between real and fake states, leading to false positives in demos.
Affected area
src/lib/batchTransaction.ts
Steps to reproduce / impact
Inconsistent success/failure branching on confirmation lookup; the transaction can appear confirmed in the UI while the underlying promise hasn't resolved, or vice versa.
Expected behaviour
Use a single awaiting function (e.g. waitForTransaction from viem/ethers) and avoid hand-rolled simulation in production code paths. Move the demo data behind a feature flag.
Acceptance criteria
Summary
src/lib/batchTransaction.tsfabricates confirmation data withMath.randomand races between real and fake states, leading to false positives in demos.Affected area
src/lib/batchTransaction.tsSteps to reproduce / impact
Inconsistent success/failure branching on confirmation lookup; the transaction can appear confirmed in the UI while the underlying promise hasn't resolved, or vice versa.
Expected behaviour
Use a single awaiting function (e.g.
waitForTransactionfrom viem/ethers) and avoid hand-rolled simulation in production code paths. Move the demo data behind a feature flag.Acceptance criteria
NEXT_PUBLIC_DEMO_TXenabling the simulated branch only in dev.