A toy that is also a real router

Hold what you
cannot afford.

EIP1153 lets you borrow a million dollars, spend it across four different venues, and put it back, all inside a single transaction. Snap the steps together like blocks and press run.

If the books do not balance by the last block, none of it happened.

$EIP11530x7749892e2f00bc06a494af76a3201e55af094366explorer

Watch the meter go under

The bar on the right is a running count of what EIP1153 is holding minus what it owes. Borrow money and it drops below the line straight away, because now you owe more than you have. Trade well and it climbs back.

Below the line is fine in the middle of a strip. It is not fine at the end. That single rule is the whole game, and it turns out to be the whole point of a piece of Ethereum plumbing called EIP-1153.

Push the slider too far and you will move the price against yourself and fail to pay the loan back. Nothing bad happens to you. The attempt simply never existed.

Try itnothing to install, no wallet
borrow this much, with none of your own money100,000 USDC
sold the WETH for 99,934 USDC
undone

Borrowing that much moves the price against you, so you cannot pay it back. The transaction fails and every step is erased. You are out the gas and nothing else.

Two rules

Rule onethe suspension

You can hold things you do not own.

For the length of one transaction, the chain will let you carry money you never had, as long as every balance is settled before it ends. Cinderella terms. Take the whole vault, put it back before midnight.

Nobody has to trust you, because if the clock runs out with anything missing, the transaction is thrown away and the money was never yours to begin with.

Rule twofailure un-happens

A failed attempt costs gas and nothing else.

When a transaction fails, the chain unwinds it completely. Not partially. There is no half executed trade to clean up, no tokens stranded in a contract, no embarrassing position to unwind on Monday.

Consequence free attempts are rare in games and almost unheard of in finance. Here you get to be wrong as many times as you like.

If you have never touched a blockchain

You do not need to know anything. Here is the entire vocabulary, and then you can go play.

01transaction

One instruction sent to a shared computer that thousands of people run at once. It either finishes completely or it does not happen. There is no middle.

02token

A number in a spreadsheet that says who owns how much of something. USDC is meant to track a dollar. WETH tracks an ether. Both are just rows.

03pool

A vending machine holding two piles of tokens. It swaps one for the other at a rate set by the size of each pile. Take a lot and the rate gets worse as you go.

04flash loan

A loan with no collateral that must be repaid in the same transaction it was taken. Safe to give out, because if you fail to repay, the loan never happened.

05gas

What you pay for the computer's time. Longer strips cost more. This is why the leaderboard scores profit per unit of gas and not profit alone.

06the game

Two pools disagree about the price of the same thing. Borrow, buy from the cheap one, sell to the expensive one, repay, keep the difference.

The plumbing

Why this needed a new instruction

While your strip runs, it hands control to other people's contracts. The pool, the desk, the lender. Two of them call straight back into EIP1153 to collect payment, which means your bookkeeping has to happen inside somebody else's function while your own has been paused.

A contract has two places to keep a number. Scratch paper, which is wiped the moment your function returns and cannot be seen from inside those other frames. Or permanent storage, which every node on earth keeps forever and charges you accordingly, for a running total that stops meaning anything the second the transaction ends.

EIP-1153 added a third place. It lasts exactly one transaction, every frame can reach it, and it disappears on failure without anybody cleaning up. EIP1153's meter lives there. That is the entire trick.

See it step by step
Where a number can live
PlaceLives forSeen by other contracts
Scratch paperone function callno
Transientone transactionyes
Permanentforever, and billedyes

EIP1153 uses the middle row for the meter, for the price it looked up once, and for the position it has reached in your strip. Everything else would either vanish too early or cost too much.

Three doors