Expand description
Buffer PDA seed and address derivation.
Each buffer is a per-token SPL token account that holds funds controlled by the settlement state PDA. It lives at a PDA keyed by the token mint, so there is exactly one buffer address per token.
The token account stored at this address is initialized by the
CreateBuffer instruction; its SPL owner (token authority) is the
settlement state PDA (see crate::pda::state), the single authority
controlling every buffer.
The seeds start with SETTLEMENT_SEED, which carries
the cargo package major and minor version, so a version bump moves every buffer.
Since only the state PDA can spend a buffer and that address moves too,
buffers must be drained under the old version before a bump ships, or their
contents are stranded.
Unlike the order PDA, which stores its own bump (see
crate::data::order::OrderAccount), a buffer is a fixed-size SPL token
account with no room for one.
Constants§
- BUFFER_
SEED - Trailing seed identifying the buffer PDAs.
Functions§
- buffer_
pda_ seeds - Canonical seed components for the buffer PDA holding the specified
minttoken. - buffer_
pda_ signer_ seeds - Canonical seeds for re-deriving the buffer PDA for
mintwithbump. - find_
buffer_ pda - Derive the canonical buffer PDA address (and bump) for the token
mint. - validate_
buffer_ pda - Confirm
buffermatches the derived buffer PDA formintandbump.