Skip to content

Solved! — Added Token Faucet Module with Tests

Key changes:

  • Implemented a new Faucet object with balance and claim tracking.
  • Added entry functions:
    • init — initialize and share faucet.
    • claim — allow one-time token claim per address.
    • add_tokens — add new SUI tokens to the faucet balance.
    • has_claimed — check if an address already claimed.
  • Added test module token_faucet_tests verifying initialization, adding tokens, and claim behavior.
  • Updated Move.toml with address 0x42.

Testing:

  • Built successfully with sui move build.
  • All test cases pass locally (sui move test).

Notes for reviewers:
The faucet logic enforces one-claim-per-address and emits events (TokensClaimed, TokensAdded) for traceability. Please review the claim flow and balance handling for any edge cases or optimization.

Merge request reports

Loading