Contract API
Fund treasury
The ownerless treasury: withdrawal and burn only.
Loading…
Browse documentation
Contract API
The ownerless treasury: withdrawal and burn only.
Loading…
Contract API
The ownerless treasury: withdrawal and burn only.
This reference is generated from the repository contracts. Check the deployed version before using a signature or constant. The audit covers a specific source revision.
Source: src/core/Fund.sol
Artifact: out/Fund.sol/Fund.json
Holds the protocol's raw token backing and lets Coin holders redeem a selected in-kind basket.
Fund intentionally has no asset registry. Callers select the assets they want to redeem, which keeps a malformed token from blocking every other asset in the treasury. Fund is ownerless and immutable: it has no administrator, upgrade path, or successor. Non-Coin backing moves only through holder redemption; Fund-held Coin may instead be destroyed through permissionless burnCoin calls. Each selected payout rounds down in that token's raw units. Backing assets require standard, non-rebasing ERC-20 accounting and transfers; fee-on-transfer, rebasing and shared-ledger alias tokens are unsupported.
Public ABI: 3 functions, 3 events, 10 custom errors, 1 constructor, 0 receive entries, 0 fallback entries.
constructor(address)constructor(address coin_);Creates the ownerless, registry-free treasury backing coin_.
Parameters
coin_: Nonzero deployed Coin token backed by this Fund.burnCoin(uint256)function burnCoin(uint256 amount) external;Burns Coin already held by Fund, including Coin received from an Auction payment. Permissionless. Burns from Fund's own balance, never from the caller, and requires Fund to hold amount. No backing asset is transferred by this maintenance operation.
Parameters
amount: Nonzero raw Coin amount to burn from Fund's balance.coin()function coin() external view returns (contract ICoin arg0);Canonical Coin token burned by redemptions and permissionless maintenance.
redeem(uint256,address,address[],uint256[],uint256)function redeem(uint256 coinAmount, address receiver, address[] tokens, uint256[] minimumAmounts, uint256 deadline) external;Burns Coin and returns the caller-selected pro-rata share of Fund assets. The caller must hold and approve coinAmount. Every payout is floor(balanceBefore * coinAmount / effectiveSupplyBeforeBurn) in the selected token's raw units. One denominator includes all accrued unminted Mine emission. Balances are read before burning Coin. Selected assets require standard, non-rebasing ERC-20 transfer and accounting semantics; fee-on-transfer, rebasing, and shared-ledger alias tokens are unsupported. Tokens use strictly increasing numeric address order, rejecting duplicates with one comparison per entry. Omitted tokens remain in Fund and the redeemer permanently forfeits their share. The token array has no length cap beyond transaction gas. Every computed payout must meet its paired minimum before Coin is collected or burned. Periphery additionally checks actual receiver balance increases. Any validation, burn, or transfer failure reverts the complete redemption.
Parameters
coinAmount: Nonzero raw Coin amount transferred from and burned for the caller.deadline: Latest Unix timestamp at which redemption may execute, inclusive.minimumAmounts: Minimum computed payouts in raw units, paired with tokens; zero accepts any payout.receiver: Nonzero, non-Fund address receiving every selected asset payout; may differ from the caller.tokens: Nonempty array of nonzero, non-Coin token addresses in strictly increasing numeric order.AssetRedeemed(address,address,address,uint256)event AssetRedeemed(address indexed account, address indexed receiver, address indexed token, uint256 amount);Emitted once per selected asset so offchain indexers can reconstruct nominal redemption payouts.
CoinBurned(address,uint256)event CoinBurned(address indexed caller, uint256 amount);Emitted when Coin held by Fund is permanently burned.
Parameters
amount: Raw Coin amount burned from Fund's balance.caller: Account that triggered the burn.Redeemed(address,address,uint256,uint256)event Redeemed(address indexed account, address indexed receiver, uint256 coinAmount, uint256 tokenCount);Emitted after a holder completes a selective in-kind redemption.
Parameters
account: Account whose Coin was burned.coinAmount: Raw Coin amount burned from account.receiver: Address that received the selected assets.tokenCount: Number of unique selected asset addresses processed.DeadlinePassed(uint256)error DeadlinePassed(uint256 deadline);No additional NatSpec notice is present in the compiled artifact.
EmptyTokenList()error EmptyTokenList();No additional NatSpec notice is present in the compiled artifact.
ForbiddenToken(address)error ForbiddenToken(address token);No additional NatSpec notice is present in the compiled artifact.
InvalidArrayLengths()error InvalidArrayLengths();No additional NatSpec notice is present in the compiled artifact.
InvalidReceiver(address)error InvalidReceiver(address receiver);No additional NatSpec notice is present in the compiled artifact.
InvalidTokenOrder(address,address)error InvalidTokenOrder(address previous, address token);No additional NatSpec notice is present in the compiled artifact.
MinimumAmountNotMet(address,uint256,uint256)error MinimumAmountNotMet(address token, uint256 amount, uint256 minimum);No additional NatSpec notice is present in the compiled artifact.
ReentrancyGuardReentrantCall()error ReentrancyGuardReentrantCall();No additional NatSpec notice is present in the compiled artifact.
SafeERC20FailedOperation(address)error SafeERC20FailedOperation(address token);No additional NatSpec notice is present in the compiled artifact.
ZeroAmount()error ZeroAmount();No additional NatSpec notice is present in the compiled artifact.