Proof of Commitment
Every save updates a public profile per wallet: periods paid, best streak, missed periods, total saved, circles joined, first and last payment. A month of real weekly payments is expensive to fake, which makes this a strong signal for votes, airdrops, allowlists and reputation.
interface IEqualship {
function isCommitted(
address account,
uint32 minPaid, // periods paid in total
uint32 minStreak, // best streak reached
uint64 maxIdle // seconds since last payment
) external view returns (bool);
}
// only count wallets that saved 4 periods in a row
// and paid within the last 8 days
require(
IEqualship(EQUALSHIP).isCommitted(voter, 4, 4, 8 days),
"not a committed saver"
);Functions
createCircle(name, contribution, bond, period, maxMembers, slashBps, legs)
Start a circle and join it as the first member.
join(circleId) / joinFor(circleId, member)
Bond $WIF to join, or pay a friend's bond.
joinWithETH(circleId, minWifOut) / joinForWithETH
Join with ETH: it buys the $WIF bond on Uniswap and refunds any extra.
contributeWithETH(circleId, minUsdgOut, minOuts)
Save with ETH: it buys the USDG and then the basket, all in one transaction.
setAutoSave(circleId, on) / contributeFor
Opt in to auto-save. Only the keeper can save for you, and only into your wallet.
contribute(circleId, minOuts)
Save for this period. Buys every basket leg into the caller's wallet.
slash(circleId, member)
Settle periods missed past the grace window. Anyone can call it. No-slash circles only reset the streak.
claim(circleId) / leave(circleId)
Take shared rewards, or leave with the rest of your bond.
proposeBasket / vote / executeBasket
Change the basket by burning $WIF as votes.
profileOf(account) / isCommitted(...)
The public Proof of Commitment registry.
buyAndBurn(path, amountIn, minWifOut)
Keeper only. Swaps the fee pool for $WIF and burns it.
Events
Index these to follow every circle in real time:
CircleCreated, Joined, Contributed, Bought, Slashed, RewardClaimed, Left, BasketProposed, Voted, BasketChanged, FeeBurned
Basket legs
A leg is a token, a weight in basis points and a Uniswap v3 path that starts with USDG and ends with the token. These are the routes the app uses:
- NVDA: USDG to NVDA at the 0.05% fee tier
- AAPL: USDG to AAPL at the 0.05% fee tier
- TSLA: USDG to TSLA at the 0.3% fee tier
- MSFT: USDG to MSFT at the 0.3% fee tier
- SPY: USDG to SPY at the 0.05% fee tier
- QQQ: USDG to QQQ at the 0.05% fee tier
- WETH: USDG to WETH at the 0.01% fee tier
Run it yourself
The repository has the Foundry project, a mainnet fork test and the scripts used to deploy and to create the first circle. Clone it, run the tests, and read the README for every command.