ERC-7776 · Review · ERC · 2024-09-20
ERC-7776: Transparent Financial Statements
A standard set of view functions for a token-issuing protocol to publish income-statement and balance-sheet figures onchain, valued in a stablecoin, like a simplified 10-Q.
What problem does it solve?
Investors in a listed company get quarterly filings with revenue, costs and earnings per share in a fixed format. Investors in a protocol's token usually get blog posts and dashboards in whatever shape the team chooses, if anything.
ERC-7776 proposes a common onchain API so a protocol can expose its financial statements directly from contracts. Any frontend, analyst or other contract can then read the same figures in the same structure, across protocols that adopt it.
How it works
The implementing contract must also be an ERC-20 token (with name/symbol metadata) representing shares, and must declare one stablecoin in which every figure is denominated (stablecoinAddress()).
Each reporting function takes (startTimestamp, endTimestamp):
start == endreturns a balance-sheet snapshot at that moment.start < endreturns an income statement for that period.start > endis invalid.
Instead of a single number, each function returns a struct whose first field is the headline value, optionally followed by extra detail fields:
| Function | Headline field |
|---|---|
revenue |
grossRevenue |
cogs |
totalCOGS |
operatingExpenses |
totalOperatingExpenses |
operatingIncome |
totalOperatingIncome |
ebitda |
totalEBITDA |
otherIncomeExpenses |
totalOtherIncome, totalOtherExpenses |
netIncome |
totalNetIncome |
earningsPerShare |
basicEPS, dilutedEPS |
fullFinancialReport |
all of the above in one struct |
If the numbers are computed from other contracts the protocol owns, those contracts must be source-verified on a block explorer.
Sample code
Reading a period's figures with ethers v6:
import { Contract, JsonRpcProvider, formatUnits } from "ethers";
const provider = new JsonRpcProvider(process.env.RPC_URL);
const fs = new Contract(protocolAddr, [
"function stablecoinAddress() view returns (address)",
"function revenue(uint256,uint256) view returns (tuple(uint256 grossRevenue, uint256 d1, uint256 dN))",
"function netIncome(uint256,uint256) view returns (tuple(uint256 totalNetIncome, uint256 d1, uint256 dN))",
], provider);
const usd = new Contract(await fs.stablecoinAddress(),
["function decimals() view returns (uint8)"], provider);
const dec = await usd.decimals();
const q3Start = 1719792000n, q3End = 1727740799n; // 2024-07-01 .. 2024-09-30 UTC
const rev = await fs.revenue(q3Start, q3End);
const net = await fs.netIncome(q3Start, q3End);
console.log("revenue", formatUnits(rev.grossRevenue, dec), "net", formatUnits(net.totalNetIncome, dec));
Things to know
- Status: Review. Struct layouts and names may still change; the reference implementation even names the currency getter
currency()instead ofstablecoinAddress(). - All values are
uint256, so losses (negative income or EPS) have no obvious representation in the current draft. - The standard defines a format, not truth. Figures are whatever the contract reports; nothing in the ERC audits them. Treat them like unaudited self-reported numbers.
- It does not make a token a legal share or give holders any rights; that depends on the issuer and jurisdiction.