← all simulations

slide 23 · contracts

Smart contract automation

oracle
condition
keeper
payout

An that releases itself — conditions, triggers, and oracles.

  1. 1Fund the escrow
  2. 2Let the oracle report
  3. 3See the payout fire by itself
live · 0 players in this room

send coins to another player

10.0000 BTC10.0000 ETH
recipient

waiting for another player to join this room… open this page in a second tab or share the link with the class.

fee 0.0005 · total 0.5005 BTC
live transfers in this room
room ledger · tap a row to replay its steps
  • no transfers yet — be the first to pay a classmate.
Escrow state
empty
Locked in contract
0 ETH
Simulated day
0 / 5
Trusted middleman
none

Escrow.sol

1contract Escrow {
2 address buyer; address seller;
3 uint256 public deadline;
4 bool public delivered;
5
6 function deposit() external payable { /* funds locked */ }
7
8 function confirmDelivery() external {
9 require(msg.sender == oracle, "only oracle");
10 delivered = true;
11 payable(seller).transfer(address(this).balance);
12 }
13
14 function refundIfLate() external {
15 require(block.timestamp > deadline, "too early");
16 require(!delivered, "already delivered");
17 payable(buyer).transfer(address(this).balance);
18 }
19}

Drive the automation

Conditionblock.timestamp > deadline
Triggerexternal keeper transaction
Data sourceoracle-signed delivery event
Outcomefunds move with no human approval

Event log

waiting…

The catch nobody mentions

Contracts are passive

There is no cron on Ethereum. Something must send a transaction — a keeper network like Chainlink Automation, or any user who benefits from calling it.

Oracles are the weak link

The chain cannot see a delivery, a price, or the weather. Whoever feeds that data in is trusted; a compromised oracle drains the escrow legitimately.

Automation is not judgement

The code executes exactly as written, including when written wrongly. There is no dispute process unless you build one in.

Automation's real value is removing the settlement middleman: the buyer does not have to trust the seller, and the seller does not have to trust the buyer — both trust code that neither can change once deployed.