Reference
Program
The Plinth program's address, accounts, instructions, events and error codes.
Address
G9kuqsqDRbrr9vt1Q7Ub7CkscKPpEjt9aaYPaLBQLJDFThe app's footer and every token page's Launch terms show the program it is connected to.
Accounts
Every account a launch uses is a program-derived address:
| Account | Seeds | Holds |
|---|---|---|
| Launch | "launch", creator, nonce (u64, little-endian) | Settings, sale state, the token's name and ticker |
| Token mint | "mint", launch | The launch token: 6 decimals, minted only by the launch, no freeze authority |
| Treasury vault | "vault", launch | The treasury's USDC, owned by the launch |
| Receipt | "receipt", launch, actor, request (16 bytes) | A permanent record of one operation |
| Protocol | "protocol" | No data. Owns the protocol's USDC account, its associated token account, which receives the protocol share of every purchase |
| Fund shares | "shares", launch | The treasury's test fund shares, on the local test network |
Instructions
| Instruction | Signed by | Arguments |
|---|---|---|
create_launch | the creator | nonce, name, symbol, team wallet, price, end price, allocation, opens, closes, team share, redemption fee, yield share |
buy | the buyer | request, tokens, maximum cost, deadline. Pays the protocol share, then the team share, then the treasury |
redeem | the holder | request, tokens, minimum payout, deadline |
follow_on | the creator | request, price, end price, allocation, opens, closes, deadline |
donate_yield | anyone | request, USDC amount, deadline |
rebalance_local | anyone | request, deadline. Local test network only. |
Prices are USDC atoms per whole token. Shares and fees are basis points: 10,000 is 100%.
Events
LaunchCreated records a new launch, its creator, its mint and its quote mint.
OperationConfirmed records each operation with its receipt fields:
| Field | |
|---|---|
| operation | 1 buy, 2 redeem, 3 follow-on, 4 yield, 5 rebalance |
| token_atoms, quote_atoms | the amounts moved |
| team_atoms | the team's part |
| fee_atoms | on a purchase, the 1% protocol share; on a redemption, the fee kept in the treasury |
| treasury_after, supply_after | the treasury and supply once it ran |
Error codes
| Code | Name | What it means |
|---|---|---|
| 6000 | InvalidConfiguration | A launch or sale setting is outside what the program accepts. |
| 6001 | InvalidQuoteMint | The launch is not priced in USDC. |
| 6002 | ArithmeticOverflow | An amount is too large for the program's arithmetic. |
| 6003 | ZeroSupply | The launch has no tokens in circulation. |
| 6004 | InvalidAmount | The amount is zero. |
| 6005 | ClosedLaunch | The launch has closed, or has no tokens in circulation. |
| 6006 | SaleInactive | The sale has not opened or has ended. |
| 6007 | AllocationExceeded | The purchase is larger than what the sale has left. |
| 6008 | SlippageExceeded | The cost rose above the maximum, or the payout fell below the minimum. |
| 6009 | FloorDilution | The purchase or follow-on price would lower the floor. |
| 6010 | InsufficientTokens | The holder holds fewer tokens than the redemption burns. |
| 6011 | SaleStillActive | A follow-on cannot open while the current sale is selling. |
| 6012 | ExpiredTransaction | The deadline has passed, or is more than five minutes away. |
| 6013 | LocalnetOnly | The instruction runs only on the local test network. |
| 6014 | InvalidLocalFund | The fund position does not match the launch. |
| 6015 | InsufficientLiquidity | The buffer and fund cannot cover the redemption in this transaction. |
The app turns these into plain sentences in the transaction panel.