Inspiration

In most staking systems, unstaking feels unnecessarily slow.
Even after the lock period ends, users often face delays due to cooldowns, missed timing, or manual intervention.

I wanted to explore whether unstaking could be executed immediately at the first eligible block, without relying on human timing, while still keeping the system secure and deterministic.


What it does

This project implements a staking and unstaking system where:

  • Tokens are locked for a fixed duration
  • Unstaking becomes valid exactly when the lock expires
  • There are no artificial delays or cooldowns
  • Unstake executes immediately at the first valid block
  • Delegated execution removes user-side timing dependency

How I built it

The system is built using:

  • An ERC20 test token for staking
  • A staking smart contract with time-lock enforcement
  • An EIP-7702 style smart account for delegated execution
  • An off-chain automation bot that monitors unlock eligibility

The bot continuously checks the unlock condition and triggers the unstake transaction as soon as the lock expires, ensuring zero-wait execution.


Challenges I ran into

One major challenge was handling time and block progression in a local blockchain environment, where blocks do not advance automatically.

This was solved by explicitly mining blocks during testing to simulate real network behavior.
Another challenge was keeping the unstake logic simple and free from hidden delays.


Accomplishments that I'm proud of

  • Achieved instant unstake execution at the first eligible block
  • Successfully implemented delegated execution using EIP-7702 concepts
  • Built a working auto-unstake bot to remove manual timing
  • Maintained clean, readable, and verifiable smart contract logic

What I learned

  • How time-locked staking works at the smart contract level
  • How block timestamps affect execution timing
  • How delegated execution can improve UX in Web3 systems
  • How automation can safely handle timing-critical actions
  • How to test timing-sensitive logic in local EVM environments

What's next for InstantUnstake7702

Future improvements could include:

  • Deployment on public BSC testnet
  • Bundler or relayer integration
  • A simple UI for one-click unstake
  • MEV-safe execution strategies

Built With

Share this project:

Updates

Submission history