Skip to content

feat(contracts): TestnetFaucet for ad-hoc TOKEN distribution on testnet #636

Description

@alpergundogdu

Motivation

When we open a testnet (Arbitrum Sepolia first; possibly a public testnet later), node operators and devs need TOKEN to stake and to ve-lock. The current onboarding path is "ask the deployer multisig nicely" — that works for a closed group of ~10 nodes but doesn't scale to ad-hoc developer onboarding or community-run nodes.

USDC is not in scope for this issue — Circle runs the canonical USDC faucet on Arbitrum Sepolia (developers.circle.com/stablecoins/docs/usdc-on-testnet). Devs grab USDC from there. If we ever need a public testnet at thousands-of-users scale and Circle's faucet rate-limits become a real bottleneck, we'd revisit with a MockUSDC path then.

Scope

  • New TestnetFaucet contract:

    • Pre-funded with TOKEN at deploy time from the initial holder
    • claim() dispenses a fixed amount per address with cooldown (e.g., 1000 TOKEN per 24h per address)
    • Governance setters: setClaimAmount, setCooldown, withdraw (escape hatch if drained / abused)
    • Standard OZ inheritance: AccessControl + ReentrancyGuard + Pausable
  • Lives under contracts/test-helpers/ or contracts/testnet/, not contracts/src/. The file path should make it impossible to mistake for production code.

  • Never deployed to mainnet. Out of the audited 14-contract surface tracked in Implement unified deCDN contract surface for audit (full 14-contract scope) #452. Documented in deployment runbook as testnet-only.

Acceptance

  • Contract + unit tests + fuzz on claim cooldown
  • Deploy script wired into the testnet forge script (separate target from the production deploy script)
  • Runbook note explaining the testnet-only status and the source of pre-funding
  • CI gate ensures TestnetFaucet is not in the production deploy bundle (e.g., a path-filter check)

Out of scope

  • USDC dispensing — Circle's faucet covers it
  • MockUSDC — defer until/unless a scale need materializes
  • Mainnet integration of any kind

Refs: #452 (parent), #635 (TOKEN — the contract this faucet would dispense)

Activity

  1. added
    kind:feature
    on May 21, 2026
  2. github-actions commented on May 21, 2026

    @github-actions

    🎯 Triage report

    Request to add a TestnetFaucet Solidity contract that dispenses TOKEN on Arbitrum Sepolia for developer/operator onboarding. The issue is well-scoped: USDC is explicitly out of scope (Circle's faucet covers it), mainnet exclusion is called out, and acceptance criteria are concrete. The contract lives outside the audited production surface tracked in #452, with a CI guard to keep it that way.

    📊 Assessment

    Dimension Value Reasoning
    Type Feature New contract deliverable with defined scope and acceptance criteria
    Labels enhancement, technical, poc-blocking New capability; contract implementation; needed before open testnet onboarding
    Coding agent Suitable Requirements are fully specified: contract interface, OZ inheritance, governance setters, file location, deploy script target, CI path-filter gate, and runbook note all defined

    🔗 Similar issues

    No duplicate or closely related open issues found beyond the referenced parent (#452) and sibling PR (#635).

    💡 Notes and suggestions

    Implementation checklist:

    • contracts/testnet/TestnetFaucet.sol — OZ AccessControl + ReentrancyGuard + Pausable; claim() with per-address cooldown mapping; setClaimAmount, setCooldown, withdraw behind DEFAULT_ADMIN_ROLE
    • Unit tests: happy-path claim, double-claim within cooldown reverts, post-cooldown re-claim, withdraw drains balance
    • Fuzz test: arbitrary (address, elapsed_time) pairs verify cooldown invariant holds
    • script/testnet/DeployTestnetFaucet.s.sol — separate from production Deploy.s.sol; seeds faucet from TOKEN_INITIAL_HOLDER
    • CI path-filter check (e.g., a grep/assert in a workflow step) that TestnetFaucet does not appear in the production deploy script or broadcast artifacts
    • Runbook entry: testnet-only status, pre-funding source, expected drain rate at 1000 TOKEN/24h

    Design notes:

    • Consider an allowlist (AccessControl role MINTER_ROLE or a whitelist) if the testnet faucet needs to be restricted during early access, with a governance setter to open it publicly later.
    • The withdraw escape hatch should emit an event for traceability even though it's testnet-only.
    • Cooldown should use block.timestamp; document the known miner-manipulation window (irrelevant on testnet but good practice for auditability).
    • Depends on feat(contracts): add TOKEN — fixed-supply ERC20 with permit and burnable #635 (TOKEN contract) being merged/deployed before this faucet can be wired up in the deploy script.

    Generated by Agentic Triage for issue #636 · ● 1.8M · ◷

    To install this agentic workflow, run

    gh aw add githubnext/agentics/workflows/issue-triage.md@94ec5db57374c5b04a4b8eef8b4413f9af44d63f
    
  3. self-assigned this
    on May 21, 2026
  4. added a commit that references this issue on May 22, 2026
    cdc6d4f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

kind:feature

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions