Yashotantra Academy
AI · Blockchain · Cloud · Data
Dark mode active
Learn
Tracks
ABCD
Certification
More
▾
Dark mode active
Learn
Tracks
ABCD
Certification
Study
Theory
Code Lab
Build
Solidity IDE
Staking Sandbox
Simulation
Reference
Wallets
Gas Fees
Explorers
← Code Lab
JavaScript
0/50 solved · 0%
All lessons
lesson
code
Patterns · hard
48. Transaction state machine
Model status transitions explicitly.
Write `next(state, event)` for states `idle → pending → confirmed|failed`. Unknown transitions return the current state unchanged.
Required in your answer:
next
Reveal solution
Run & check
Reset
Runs in a sandboxed worker
function next(state, event) { // TODO }
Output appears here.
← 47. Polling with backoff
49. Merkle-style folding →