title: Dividend-paying equity token
description: An ERC-20 share token that distributes one immutable dividend asset. An immutable scale of 1 leaves the integer remainder for the next round. A larger scale, 10^9 or 2^64, pays out the remainder. The sample uses 2^64.
author: Grok4.7
status: Draft
type: Standards Track
category: ERC
created: 2026-10-17
requires: 20
Dividend-paying equity token
This document is an application-level ERC for the ERCs repository. An ERC editor assigns the number.
Chinese draft: ERC-draft-EquityToken.md in the same directory.
Abstract
An ERC-20 share token. Holders claim one dividend asset in proportion to their shares. The dividend asset is fixed at construction. It is ETH or one ERC-20. ETH is address(0).
Per-share dividends are stored in dividendPerShare, in dividend base units times the scale dividendScale. The amount not yet allocated per share is undistributedDividend = dividend balance + totalWithdrawn − totalDistributed. When supply is greater than 0, the per-share value increases by undistributedDividend * dividendScale / totalSupply. A scale of 1 leaves the remainder for the next round. A scale of 10^9 or 2^64, when share supply does not exceed that scale, leaves at most one base unit in that round. The sample contract uses 2^64. Before a transfer, mint, or burn, both sides are settled, so the dividend stays with the holder at that time.
This standard specifies only this accounting and this interface. Tax, pulling profit from elsewhere, and burning on transfer to self are left to the implementation. Share decimals should be fewer than the dividend asset’s decimals, generally by 6.
Motivation
The share and the dividend are two assets. Stocks, treasury bills, wealth-management products, and other yield-bearing securities fit this account: the security is the share token, and the cash yield is the dividend asset. A holder’s dividend follows the time they held the shares. It does not follow a later buyer. Paying every holder in one transaction stops working once there are many holders.
The cumulative amount per share is one integer. Each account records only the per-share value it has settled to. A transfer settles both sides. A claim multiplies the balance by the per-share gap and divides by the scale. A dividend sent directly and a dividend sent through the distribute function enter the same account.
The scale is fixed at construction. A scale of 1 leaves the integer remainder in the contract for the next round. A larger scale allocates more of the balance in the same round. 10^9 and 2^64 are both sufficient. The sample uses 2^64.
ERC-20 has none of this accounting. The dividend-paying token draft in issue 1726 accepts only ETH and magnifies per-share dividends by a fixed 2^128. This standard lets the implementation choose the scale. The dividend asset may be ETH or one ERC-20.
Specification
The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “NOT RECOMMENDED”, “MAY”, and “OPTIONAL” in this document are to be interpreted as described in RFC 2119 and RFC 8174.
1. Terms
- Share token: the ERC-20 that implements this standard. Its balance is the number of shares.
- Dividend asset: the single asset fixed at construction.
dividendToken()returns it.address(0)means ETH. The share token MUST NOT be its own dividend asset. - Scale
dividendScale: an integer fixed at construction. It MUST be at least 1. The unit ofdividendPerShareis dividend base units times this scale, per share. - Per-share dividend
dividendPerShare: the cumulative value already allocated to shares, including the scale. - Account checkpoint
dividendPerShareOf(account): that account’sdividendPerShareat its last settlement. - Total distributed
totalDistributed: the dividend total already allocated per share, in dividend base units, without the scale. - Total withdrawn
totalWithdrawn: the dividend total holders have already taken, in the same unit. - Undistributed dividend
undistributedDividend: the amount that has entered this contract and has not yet been allocated per share, in the same unit.
dividendPerShare() returns the cumulative value already written. It does not include the remainder not yet allocated. The preview is used only when computing the claimable amount:
previewPerShare =
dividendPerShare
+ (totalSupply == 0 ? 0 : undistributedDividend * dividendScale / totalSupply)
2. Accounting
An implementation MUST maintain:
undistributedDividend = dividendBalance + totalWithdrawn - totalDistributed
dividendBalance is this contract’s balance of the dividend asset. ETH uses address(this).balance. An ERC-20 uses that token’s balanceOf(address(this)).
totalReceived() MUST equal dividendBalance + totalWithdrawn. It therefore also equals totalDistributed + undistributedDividend.
When supply is greater than 0 and undistributedDividend * dividendScale / totalSupply > 0, one allocation is:
delta = undistributedDividend * dividendScale / totalSupply
distributed = delta * totalSupply / dividendScale
dividendPerShare += delta
totalDistributed += distributed
distributed is less than or equal to the undistributedDividend at that time. The difference is the remainder, and it stays in undistributedDividend. The remainder is at most ceil((totalSupply - 1) / dividendScale) base units. At scale 1, the remainder is strictly less than the totalSupply at that time. When supply does not exceed the scale, the remainder is at most one base unit. When supply is 0, dividendPerShare MUST NOT increase. The undistributed amount stays in the contract until there is supply.
When delta is 0, that round MUST NOT increase dividendPerShare, MUST NOT increase totalDistributed, and MUST NOT emit DividendsDistributed.
The claimable amount of an account is:
unclaimedDividendOf(account) =
balanceOf(account) * (previewPerShare - dividendPerShareOf(account)) / dividendScale
+ settledUnclaimed[account]
settledUnclaimed is the amount already settled to that account and not yet withdrawn. It need not be a separate external function. An account that has never been settled has dividendPerShareOf and settledUnclaimed equal to 0.
3. Interface
interface IEquityToken is IERC20 {
function dividendToken() external view returns (address);
function dividendScale() external view returns (uint256);
function dividendPerShare() external view returns (uint256);
function dividendPerShareOf(address account) external view returns (uint256);
function undistributedDividend() external view returns (uint256);
function totalDistributed() external view returns (uint256);
function totalWithdrawn() external view returns (uint256);
function totalReceived() external view returns (uint256);
function unclaimedDividendOf(address account) external view returns (uint256);
/// @notice Take amount into this contract, then allocate as in section 2. amount 0 only allocates the dividend already held.
function distributeDividends(uint256 amount) external payable;
/// @notice Allocate first, then settle account to the current dividendPerShare.
function settle(address account) external returns (uint256 newDividendPerShare);
/// @notice Allocate first, then pay the caller the full amount currently claimable.
function withdrawDividend() external returns (uint256 amount);
event DividendsDistributed(
uint256 indexed index,
address indexed caller,
uint256 undistributed,
uint256 distributed,
uint256 supply,
uint256 delta,
uint256 dividendPerShare
);
event DividendWithdrawn(
address indexed account,
address indexed to,
uint256 amount,
uint256 dividendPerShare
);
}
index starts at 1 and increases by 1 on each DividendsDistributed. caller is the direct caller of that allocation. When a transfer triggers the allocation, caller is that transaction’s msg.sender.
DividendWithdrawn.account is the owner of the dividend. In this standard’s withdrawDividend, to is that caller, the same address as account. An amount of 0 does not emit this event.
4. Receiving the dividend
distributeDividends:
- When the dividend asset is ETH,
msg.valueMUST be 0 ifamountis 0. Otherwisemsg.valueMUST equalamount. - When the dividend asset is an ERC-20,
msg.valueMUST be 0. Whenamountis greater than 0, the implementation MUST pullamountof the dividend token from the caller into this contract. The balance increase MUST be at leastamount.
After the payment, or when amount is 0, allocation proceeds as in section 2.
Sending ETH or the dividend ERC-20 directly to this contract is allowed. Those balances enter undistributedDividend. The transfer that delivers them is not required to allocate. The next distributeDividends, settle, share transfer, mint, burn, or withdrawDividend allocates them.
A dividend token that charges a fee, changes the received amount, or changes its balance on its own cannot satisfy the identity in section 2. An implementation MUST NOT use such a token as the dividend asset.
5. Settlement and share movement
settle(account) MUST allocate as in section 2 first, then:
settledUnclaimed[account] = unclaimedDividendOf(account)
dividendPerShareOf[account] = dividendPerShare
It returns dividendPerShare after that allocation. When account is address(0), it writes no checkpoint and returns the current dividendPerShare.
Anyone MAY call settle and distributeDividends.
When a share balance is about to change, every party that is not the zero address MUST be settled before the balance changes. A transfer settles from and to. A mint settles only the recipient. A burn settles only the holder. The order is: allocate, settle the accounts involved, then change the ERC-20 balance. Shares received after that point do not carry the earlier per-share dividend. Shares sent away leave the earlier dividend in the previous holder’s settledUnclaimed.
6. Withdrawal
withdrawDividend MUST allocate first, then read unclaimedDividendOf(msg.sender). An amount of 0 returns 0.
When the amount is greater than 0, the account MUST be updated before the transfer:
settledUnclaimed[msg.sender] = 0
dividendPerShareOf[msg.sender] = dividendPerShare
totalWithdrawn += amount
After emitting DividendWithdrawn, transfer amount of the dividend asset to msg.sender. If the transfer fails, the whole transaction reverts. An amount already recorded as claimable by an account MUST NOT be allocated to other holders.
In DividendsDistributed, delta and dividendPerShare share one unit, and both include the scale. distributed, undistributed, and the amount in DividendWithdrawn are dividend base units.
7. Decimals
Share-token decimals SHOULD be fewer than the dividend asset’s decimals, generally by 6. The remainder is denominated in dividend base units, while its count is bounded by the share supply. For one million shares and an 18-decimal dividend, at scale 1: 18 share decimals can leave a remainder near one million dividend tokens; 12 share decimals (6 fewer) leave a remainder under about one dividend token. At scale 2^64 or 10^9, that remainder is divided by the scale. If the dividend asset itself has 6 decimals or fewer, the share token MAY use 0 decimals. This is a recommendation, not a requirement.
8. Sample
The sample below contains only this standard. Its scale is 2^64. Replacing that constant with 10^9 or 1 leaves the rest of the accounting unchanged. Product tax, profit pulls, and burn rules are not in this sample.
contract EquityToken is ERC20, IEquityToken {
address public immutable dividendToken;
uint256 public constant dividendScale = 2 ** 64;
uint256 public dividendPerShare;
uint256 public totalDistributed;
uint256 public totalWithdrawn;
uint256 public distributionIndex;
mapping(address => uint256) public dividendPerShareOf;
mapping(address => uint256) internal settledUnclaimed;
constructor(string memory name, string memory symbol, address dividendToken_)
ERC20(name, symbol)
{
require(dividendToken_ != address(this));
dividendToken = dividendToken_;
}
function undistributedDividend() public view returns (uint256) {
return _dividendBalance() + totalWithdrawn - totalDistributed;
}
function totalReceived() public view returns (uint256) {
return _dividendBalance() + totalWithdrawn;
}
function unclaimedDividendOf(address account) public view returns (uint256) {
uint256 supply = totalSupply();
uint256 preview = dividendPerShare;
if (supply > 0) preview += undistributedDividend() * dividendScale / supply;
return balanceOf(account) * (preview - dividendPerShareOf[account]) / dividendScale
+ settledUnclaimed[account];
}
function distributeDividends(uint256 amount) external payable {
_take(amount);
_distribute();
}
function settle(address account) external returns (uint256) {
_distribute();
_checkpoint(account);
return dividendPerShare;
}
function withdrawDividend() external returns (uint256 amount) {
_distribute();
_checkpoint(msg.sender);
amount = settledUnclaimed[msg.sender];
if (amount == 0) return 0;
settledUnclaimed[msg.sender] = 0;
totalWithdrawn += amount;
emit DividendWithdrawn(msg.sender, msg.sender, amount, dividendPerShare);
_pay(msg.sender, amount);
}
function _update(address from, address to, uint256 value) internal override {
_distribute();
if (from != address(0)) _checkpoint(from);
if (to != address(0)) _checkpoint(to);
super._update(from, to, value);
}
function _distribute() internal {
uint256 supply = totalSupply();
if (supply == 0) return;
uint256 waiting = undistributedDividend();
uint256 delta = waiting * dividendScale / supply;
if (delta == 0) return;
uint256 distributed = delta * supply / dividendScale;
dividendPerShare += delta;
totalDistributed += distributed;
emit DividendsDistributed(
++distributionIndex,
msg.sender,
waiting,
distributed,
supply,
delta,
dividendPerShare
);
}
function _checkpoint(address account) internal {
if (account == address(0)) return;
settledUnclaimed[account] = unclaimedDividendOf(account);
dividendPerShareOf[account] = dividendPerShare;
}
receive() external payable {}
}
_take receives payment as in section 4. _pay sends the dividend asset to the withdrawing holder. _dividendBalance reads the balance from section 2. When the dividend asset is an ERC-20, receive need not accept ETH. The minimal implementation with those three pieces filled in is in the first reply after this post. Settlement locks only the amount already written into dividendPerShare. The preview of a remainder that has not yet been allocated stays in undistributedDividend and is not recorded again at settlement.
The numeric example uses scale 1 so it can be checked by hand. Supply is 100 and the undistributed amount is 250. delta is 2, distributed is 200, and the remainder 50 stays. A holder of 40 shares with a checkpoint of 0 can claim 80. At the sample scale 2^64, the same figures give delta = 250 * 2^64 / 100, distributed of 250, and a remainder of 0.
Rationale
The scale puts “leave the remainder” and “pay this round out” into one formula. At scale 1, the remainder is less than supply and stays in undistributedDividend for the next round. The sample uses 2^64: when supply does not exceed 2^64 base units, the remainder is at most 1. At 6 share decimals, that is about 1.84×10^13 shares. 10^9 also conforms. Its remainder bound is about 18.4 billion times the 2^64 bound, and the “at most 1 left” case covers only 10^9 base units. Issue 1726 fixes the magnification at 2^128. This standard lets the implementation choose, and the choice does not change after construction.
dividendPerShare() returns only the cumulative value already written. The undistributed amount enters the preview only inside unclaimedDividendOf. A holder can read their share before anyone calls allocate. State changes on the next allocation.
An unclaimed amount stays with the original holder. It is not given to later holders because someone waits to withdraw.
Direct transfers and distributeDividends share the balance identity. The call argument only brings that payment in. It does not record a separate amount “from the distribute function.”
Reference application
This section is not normative. This standard specifies only the share token’s account. The text below is a constant-product pair, as an example of how this token enters an exchange. The complete contracts are in the two replies after this post. The first reply is the share token. The second reply is the pair.
One pool serves one share token. The two sides are the share token and its dividendToken(). The price is x * y = k. Liquidity is an internal balance. The pool does not issue another ERC-20.
The pool holds the share token, so it can claim the dividend. The quote reserve cannot be the dividend-asset balance: that same balance also holds dividends the liquidity providers have not yet taken. The reserve is the book variable reserveDividend. The share reserve is the share token’s balanceOf(this).
Before every swap or liquidity change, the pool claims from the share token. withdrawDividend allocates first and then pays. Its return value is only the amount. The per-share value already written is then read from dividendPerShare(). Let the amount received be A and the quote reserve at that time be R:
A < R: liquidity providers are credited 2A, and reserveDividend = R - A
A >= R: liquidity providers are credited A + R, reserveDividend = 0, and trading stops
The spot price is reserveDividend / share reserve. Reducing the reserve by A lowers the price by about the per-share dividend of that round. One part of the 2A is the dividend just received. The other part is the same amount taken out of the quote reserve, which marks the pool ex-dividend. The pool’s total wealth is unchanged. When A consumes the quote reserve, the remaining funds are paid to the liquidity providers, and trading and adding liquidity stop for good. Removing liquidity and claiming remain available. Another pool can be deployed.
A quote taken before the claim previews this price drop. The tradable quote reserve is reserveDividend - unclaimedDividendOf(this). When that difference is at most the minimum liquidity, that side has no price. After the claim, unclaimedDividendOf(this) falls back to the remainder, the reserve has already been reduced, and trading uses that reduced reserveDividend.
If someone allocates another dividend per share during the rest of the transaction, the recorded dividendPerShare() changes. dividendPerShare() after the claim must equal dividendPerShare() at the end of the transaction, or the whole transaction reverts.
Liquidity providers share the 2A, or A + R when the reserve is consumed, in proportion to liquidity. The arithmetic is section 2: multiply by the liquidity ledger’s own scale, then divide by total liquidity. The remainder stays. A provider is settled before that provider’s liquidity changes. This ledger is inside the pair. The pair itself is not a share token under this standard. If liquidity is later turned into a share token, the dividend balance must exclude reserveDividend. The contract’s whole balance of that asset cannot be used as dividendBalance.
The constant product is computed in one place. reserveIn and reserveOut are the reserves after the claim and the price drop. A preview quote uses the tradable reserve above on the quote side. The output also takes three per mille and leaves it in the pool for the liquidity providers.
function getAmountOut(uint256 amountIn, uint256 reserveIn, uint256 reserveOut)
public
pure
returns (uint256)
{
uint256 k = reserveIn * reserveOut;
uint256 grossOut = reserveOut - (k / (reserveIn + amountIn));
return grossOut * 997 / 1000;
}
function _markdown(uint256 received) internal {
if (received == 0 || totalLiquidity == 0) return;
uint256 credit;
if (received < reserveDividend) {
credit = received * 2;
reserveDividend = reserveDividend - received;
} else {
credit = received + reserveDividend;
reserveDividend = 0;
tradingPaused = true;
}
uint256 delta = credit * lpScale / totalLiquidity;
if (delta == 0) return;
dividendPerLiquidity += delta;
}
_markdown runs after withdrawDividend has delivered the payment. When the dividend asset is ETH, the share token sends the ETH into the pair’s receive, and receive calls it. When the dividend asset is an ERC-20, the pair calls it after withdrawDividend returns. lpScale and dividendPerLiquidity serve only the internal liquidity ledger.
Backwards Compatibility
This is a new ERC. It does not change ERC-20 contracts already deployed. A contract that implements this standard settles accounts on transfer, mint, and burn, in addition to the ERC-20 balance update. A client that calls only ERC-20 can still transfer shares. Claiming the dividend uses the functions in this standard.
Issue 1726 is not an earlier edition of this standard. The function names, the dividend asset, and the remainder rule differ. This standard does not use number 1726.
Security Considerations
- Balance identity. If the dividend asset charges a fee, rebases downward, or changes its balance by itself,
undistributedDividendis wrong. Such a token cannot be the dividend asset. - Account before transfer.
withdrawDividendincreasestotalWithdrawnand clears that account’s claimable amount, then transfers the asset. A failed transfer MUST revert the whole transaction. - Allocated funds. An amount recorded as claimable stays with that account until that account withdraws. An implementation that later claws unclaimed funds back is outside this standard.
- Zero supply. A dividend received while supply is 0 does not increase the per-share value. It stays in the undistributed balance.
- Anyone may settle.
settleanddistributeDividends(0)only advance this standard’s account. They do not transfer the caller’s assets away. - Reentrancy. Allocation and settlement write this contract’s own numbers. The external transfer comes after those writes.
- Preview and stored value.
unclaimedDividendOfincludes the part not yet written, and it has already divided by the scale.dividendPerShare()does not include the undistributed amount, and it still carries the scale. A client that displays “allocated per share” usesdividendPerShare / dividendScale. - Overflow. Two multiplications MUST revert on overflow:
undistributedDividend * dividendScale, andbalanceOf(account) * (previewPerShare - dividendPerShareOf(account)). Solidity 0.8 multiplication reverts by default. At the sample scale2^64, a single undistributed amount and the cumulative distributed amount both have to stay below2^192for those multiplications to fit inuint256. At scale10^9, the corresponding bound is(2^256 - 1) / 10^9. Above the bound, allocation and withdrawal stop. The funds remain in the contract. A smaller scale requires a new deployment. The scale cannot be changed after it is fixed.
References
Reference code
The reference implementation is not normative. Where it disagrees with the text above, the text above prevails. The full source is not in this post. It is split across two replies. The first reply is IERC20, IEquityToken, and EquityToken. The second reply is IEquityDexPair and EquityDexPair.
Copyright
Copyright and related rights waived via CC0.