Skip to content

feat(token-mint-authority): add testnet faucet mint-authority program - #331

Open
0x-r4bbit wants to merge 1 commit into
mainfrom
feat/token-minter
Open

feat(token-mint-authority): add testnet faucet mint-authority program#331
0x-r4bbit wants to merge 1 commit into
mainfrom
feat/token-minter

Conversation

@0x-r4bbit

Copy link
Copy Markdown
Collaborator

A permissionless faucet that holds the mint authority for faucet token definitions and lets any account self-mint a fixed grant, so testers can fund themselves on testnet. The call chain is user -> token-mint-authority -> token: the program holds no key and delegates every mint to the token program under a PDA seed.

  • FaucetMint (no amount) mints a fixed 10_000e18 to the caller, at most once per 24h per (recipient, token definition), via a chained Token::MintWithAuthority authorized by the mint-authority PDA seed.
  • Rate limiting is a per-(recipient, definition) MintAllowance PDA (last-mint timestamp), claimed on first use and rewritten thereafter.
  • Wall-clock time is read from the system CLOCK_01 account, as the stablecoin program does.

Setup: the faucet token must be created via the token program's NewFungibleDefinition with mint_authority set to compute_mint_authority_pda(<program id>); the program refuses to mint a token whose stored authority is not its PDA.

@0x-r4bbit
0x-r4bbit force-pushed the feat/token-minter branch 2 times, most recently from 9bd9e2e to 66983e1 Compare August 27, 2026 07:04
A permissionless faucet that holds the mint authority for faucet token
definitions and lets any account self-mint a fixed grant, so testers can
fund themselves on testnet. The call chain is user -> token-mint-authority
-> token: the program holds no key and delegates every mint to the token
program under a PDA seed.

- `FaucetMint` (no amount) mints a fixed 10_000e18 to the caller, at most
  once per 24h per (recipient, token definition), via a chained
  `Token::MintWithAuthority` authorized by the mint-authority PDA seed.
- Rate limiting is a per-(recipient, definition) `MintAllowance` PDA
  (last-mint timestamp), claimed on first use and rewritten thereafter.
- Wall-clock time is read from the system CLOCK_01 account, as the
  stablecoin program does.

Setup: the faucet token must be created via the token program's
`NewFungibleDefinition` with `mint_authority` set to
`compute_mint_authority_pda(<program id>)`; the program refuses to mint a
token whose stored authority is not its PDA.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant