While loop

While loop on Logic

Ethereum
Ethereum
Base
Base

Acts onchain

Ready to run on Base

Opens a loop that repeats while a boolean, wired from an earlier step, stays true. The condition is re-read at the top of each iteration, so it must be a coil that a step inside the body rewrites; a literal true never exits. Use the predicate's for or until verb to evaluate a comparison inline instead. Reach for it to repeat a step until a stored or computed flag flips, such as looping a borrow-swap-supply cycle while a comparison of health factor against a target still passes.

Plug lets you combine onchain actions like this one into a single transaction, without writing a smart contract. Use in App opens a new plug with this action already in it.

More plugs on Base

Dollar-cost average on Base · 4 plugs

More on Logic · 4