pat0contracttoken
market
price
market cap
fully diluted
liquidity
volume 24h
trades 24h
holders
change 24h
docs9 of 14
pat0the contract
the functions

the public surface is small. the table lists every external function, who may call it, and what it does.

functioncallereffect
mint() payableanyonesettle pressure, price, cap, budget check, issue, record lastMintBlock
burn(uint256 amount)anyone past cooldownpay book less fee, destroy tokens
quoteMint(uint256 v) viewanyonereturns (issued, c, r) for a hypothetical v at the current block after simulated settlement
quoteBurn(uint256 amount) viewanyonereturns pay
state() viewanyonereturns (totalSupply, cistern, position, pressure, pressureBlock, usedInBlock, budget, target, curvePrice, book)
lastMintBlock(address) viewanyoneblock of the wallet's last mint
name()anyonereturns pat0
decimals()anyonereturns 18
totalSupply()anyonesupply in base units
balanceOf(address)anyonebalance in base units
transfer, approve, transferFrom, allowanceanyonestandard

mint, line by line

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.

burn, line by line

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.

events

Mint(address indexed who, uint256 paid, uint256 entered, uint256 surcharge, uint256 issued, uint256 pressureAfter)
Burn(address indexed who, uint256 amount, uint256 paid, uint256 fee)