Skip to content

Educational faucet for simulated funds (faucet.rs) #213

Description

@DevMuhdishaq

Description
As an educational simulator, new users need a way to obtain simulated tokens to start trading. Add a rate-limited faucet.

Direction

  • Create counter/src/faucet.rs with claim_faucet(env, user, asset) minting a fixed simulated amount.
  • Enforce a cooldown per user/asset using the existing rate_limit module.
  • Admin-configurable per-asset drip amount and cooldown.
  • Emit a FaucetClaimed event.

Acceptance criteria

  • First claim mints the configured amount and updates balance.
  • Second claim within cooldown rejects with a rate-limit error.
  • Claim after cooldown succeeds.
  • Admin can set drip amount and cooldown; non-admin cannot.
  • Tests cover cooldown boundaries via ledger timestamp manipulation.

Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial Campaign | FWC26Campaign: Official Campaign | FWC26

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions