freecoding.school100% FREE · NO SIGNUP
Ledger LandISSUE #39 of 90

erc-4626 · tokenized vaults

BlockyVSDouble-Spend Dan
Blocky saysERC-4626 standardizes tokenized vaults — yield-bearing deposits as shares.

ERC-4626 is a standard interface for vaults: you deposit an ERC-20 asset and receive shares representing your stake plus accrued yield. It unifies deposit/withdraw/convert functions so aggregators and protocols can integrate any vault the same way. It tamed a messy corner of DeFi where every yield vault had a bespoke interface.

Power-ups you unlock

Double-Spend Dan attacks — common mistakes

Boss battleExplain how vault shares represent both principal and yield.

Example code

<!doctype html><html><head><meta charset="utf-8"></head>
<body style="background:#06040d;color:#e6e0ff;font-family:monospace;padding:20px"><pre>deposit 100 USDC → 100 shares
yield accrues → 100 shares now worth 105 USDC
withdraw shares → asset + yield</pre></body></html>
▶ Open the interactive comic issue
‹ Erc-1155 · Multi-Token StandardErc-4337 · Account Abstraction ›