EIPs Explained

ERC-7770 · Draft · ERC · 2024-09-17

ERC-7770: Fractional Reserve Token

An ERC-20 extension for synthetic tokens that are fully collateralised but only partly redeemable for their underlying, with standard mint/burn hooks for lenders and on-chain reserve-ratio data so holders can see the risk.

What problem does it solve?

Bridged assets such as ETH on an L2 are already synthetic: they track the mainnet asset and are fully backed by it. ERC-7770 generalises this to tokens that can also be minted by borrowing, against other collateral, not just by depositing the underlying. The spec's example is frDAI: deposit 1 DAI to get 1 frDAI, or post collateral worth more than 1 DAI and borrow 1 frDAI.

That expands supply in an ecosystem, but it means not every token can be redeemed for the underlying at once, the same trade-off as fractional reserve banking. Several lending markets or risk curators might share minting rights, so they need a common interface, and holders need a standard way to see how much of the supply is actually backed by cash.

How it works

The token must be ERC-20 compatible (ERC-20) and adds:

Member Purpose
fractionalReserveMint(to, amount) Mint borrowed supply; increases totalSupply, totalBorrowedSupply and to's balance
fractionalReserveBurn(from, amount) Reverse of the above when debt is repaid
totalBorrowedSupply() Supply created via borrowing
requiredReserveRatio() Minimum reserve ratio, scaled by 1e18
segregatedAccount(a) / totalSegregatedSupply() Accounts whose balances are not counted as reserve

Events MintFractionalReserve, BurnFractionalReserve and SetSegregatedAccount let indexers follow all of this.

The reserve ratio is roughly "redeemable cash ÷ total supply":

(totalSupply − totalBorrowedSupply − Σ segregated balances) / totalSupply

New fractional-reserve mints must not push it below requiredReserveRatio(). Mint/burn should be restricted to permissioned parties (lending markets, risk curators) who only mint to borrowers that have locked collateral.

Segregated accounts exist for cases like DAO treasuries or vote-escrow contracts: their tokens are excluded from the reserve so nobody can borrow against them. Some interest from borrowers should flow to non-segregated holders, but the spec leaves the mechanism open (rebasing, staking, airdrops).

Sample code

Checking reserve health from a frontend (ethers v6):

import { Contract, formatUnits } from "ethers";

const abi = [
  "function totalSupply() view returns (uint256)",
  "function totalBorrowedSupply() view returns (uint256)",
  "function totalSegregatedSupply() view returns (uint256)",
  "function requiredReserveRatio() view returns (uint256)",
];
const fr = new Contract(tokenAddress, abi, provider);

const [supply, borrowed, segregated, required] = await Promise.all([
  fr.totalSupply(), fr.totalBorrowedSupply(), fr.totalSegregatedSupply(), fr.requiredReserveRatio(),
]);
const ratio = supply === 0n ? 0n : ((supply - borrowed - segregated) * 10n ** 18n) / supply;
console.log("reserve ratio:", formatUnits(ratio, 18), "required:", formatUnits(required, 18));

Things to know

  • Status: Draft.
  • The spec text is not fully consistent: it gives two different reserve-ratio formulas and in places says mint must revert when the ratio "exceeds" the requirement. The reference implementation reverts when the ratio falls below requiredReserveRatio, which matches the stated intent.
  • The standard only reports risk; it does not manage it. A low reserve ratio raises the chance of a depeg or a "bank run" where holders cannot redeem immediately.
  • Minting credentials are a trust point: the token owner is responsible for who can call fractionalReserveMint.
  • The reference code in the spec is marked "DO NOT use it in production".

#token #erc-20 #lending #stablecoin #defi #draft

Details

Authors
Yaron Velner (@yaronvel)
Status
Draft
Type
Standards Track / ERC
Created
2024-09-17
Requires

Machine-readable: Markdown · JSON