Faucet
The faucet is a testnet-only static Vercel app that mints 100 each of zkUSD, zkEUR, zkGBP, and zkPLN on Base Sepolia to a user-supplied EVM address. It exists for onboarding and demos, not for the main deployment.
User flow
The app serves a single static page:
- The user enters an EVM address or fills it from an injected wallet such as MetaMask.
- The page submits
{ address }toPOST /api/mint. - The API immediately returns
{ success: true, userOpHash }after the bundler accepts the UserOperation.
There is no receipt polling, CAPTCHA, password, rate limit, queue, or user wallet signature. The connected wallet is only an address source.
Mint route
The API route builds one sponsored ERC-4337 UserOperation:
| Field | Value |
|---|---|
| Chain | Base Sepolia (84532) |
| Sender | SharedAccount |
| Target | EBHub |
| Call | publicMint(address ebemt,address to,uint256 amount) |
| Amount | 100_000000 base units per token (100, 6 decimals) |
| Paymaster flow | eb_requestGasAndPaymasterData through createEbBundlerClient |
The route must not fall back to a direct EOA transaction. The server key is only the paymaster partner key used to sign partner context; it is not an EBEMT minter key.
Deployment configuration
Required Vercel environment variables:
| Variable | Purpose |
|---|---|
BASE_SEPOLIA_RPC_URL | Base Sepolia RPC for nonce and chain reads |
PAYMASTER_PARTNER_ID | Partner id registered in the Paymaster Backend |
PAYMASTER_PARTNER_PRIVATE_KEY | Partner signing key for paymaster context |
ENTRYPOINT_ADDRESS | Optional override; defaults come from the SDK path |
Bundler URL, Paymaster URL, SharedAccount address, Hub address, and zk token addresses come from the Base Sepolia deployment manifest in @cardinal-cryptography/core.
On-chain setup:
- Deploy the
EBHuband the testEBEMTtoken contracts (Hub is shared across all tokens). - Ensure the SharedAccount is deployed on Base Sepolia.
- Call
Hub.setMinter(SHARED_ACCOUNT_ADDRESS, true)once — a single enrollment on Hub authorizes the SharedAccount to mint on every EBEMT in the deployment. - Configure the Paymaster Backend to allow the Hub address and selector
0x36fac067. If the same backend sponsors direct token operations, also allow the four faucet token addresses. - Fund and stake the paymaster for EntryPoint.
Do not grant faucet minting rights or the publicMint selector in the main deployment.