slide 23 · contracts
Smart contract automation
An that releases itself — conditions, triggers, and oracles.
- 1Fund the escrow
- 2Let the oracle report
- 3See the payout fire by itself
send coins to another player
waiting for another player to join this room… open this page in a second tab or share the link with the class.
- no transfers yet — be the first to pay a classmate.
Escrow.sol
1contract Escrow {2 address buyer; address seller;3 uint256 public deadline;4 bool public delivered;56 function deposit() external payable { /* funds locked */ }78 function confirmDelivery() external {9 require(msg.sender == oracle, "only oracle");10 delivered = true;11 payable(seller).transfer(address(this).balance);12 }1314 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
Event log
The catch nobody mentions
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.
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.
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.