the public surface is small. the table lists every external function, who may call it, and what it does.
| function | caller | effect |
|---|---|---|
| mint() payable | anyone | settle pressure, price, cap, budget check, issue, record lastMintBlock |
| burn(uint256 amount) | anyone past cooldown | pay book less fee, destroy tokens |
| quoteMint(uint256 v) view | anyone | returns (issued, c, r) for a hypothetical v at the current block after simulated settlement |
| quoteBurn(uint256 amount) view | anyone | returns pay |
| state() view | anyone | returns (totalSupply, cistern, position, pressure, pressureBlock, usedInBlock, budget, target, curvePrice, book) |
| lastMintBlock(address) view | anyone | block of the wallet's last mint |
| name() | anyone | returns pat0 |
| decimals() | anyone | returns 18 |
| totalSupply() | anyone | supply in base units |
| balanceOf(address) | anyone | balance in base units |
| transfer, approve, transferFrom, allowance | anyone | standard |
settle pressure to the current block. compute c and r from the value sent. revert if c is zero or above two eth. compute supply before and after. revert if the block's issued total plus the difference exceeds the budget. add the value sent to the cistern. add c to position. add the difference to the block's issued total. mint the difference to the caller. stamp the caller's block. emit.
revert if the caller's stamped block plus sixty four is above the current block. compute gross, fee, and pay. subtract pay from the cistern. burn the amount from the caller. send pay to the caller. emit.
Mint(address indexed who, uint256 paid, uint256 entered, uint256 surcharge, uint256 issued, uint256 pressureAfter) Burn(address indexed who, uint256 amount, uint256 paid, uint256 fee)