Skip to main content

Faucet

Git Source

Title: Faucet — YELLOW testnet token faucet

Dispenses a fixed amount of YELLOW per call with a per-address cooldown.

State Variables​

TOKEN​

IERC20 public immutable TOKEN

owner​

address public owner

dripAmount​

uint256 public dripAmount

cooldown​

uint256 public cooldown

lastDrip​

mapping(address => uint256) public lastDrip

Functions​

onlyOwner​

modifier onlyOwner() ;

_onlyOwner​

function _onlyOwner() internal view;

constructor​

constructor(IERC20 _token, uint256 _dripAmount, uint256 _cooldown) ;

Parameters

NameTypeDescription
_tokenIERC20YELLOW token address
_dripAmountuint256Amount dispensed per drip (in wei)
_cooldownuint256Seconds between drips per address

drip​

Drip YELLOW to msg.sender.

function drip() external;

dripTo​

Drip YELLOW to a specified address (for batch use).

function dripTo(address recipient) external;

_dripTo​

function _dripTo(address recipient) internal;

setDripAmount​

Owner can update the drip amount.

function setDripAmount(uint256 _dripAmount) external onlyOwner;

setCooldown​

Owner can update the cooldown period.

function setCooldown(uint256 _cooldown) external onlyOwner;

setOwner​

Owner can transfer ownership.

function setOwner(address _owner) external onlyOwner;

withdraw​

Owner can withdraw remaining tokens.

function withdraw(uint256 amount) external onlyOwner;

Events​

Dripped​

event Dripped(address indexed recipient, uint256 amount);

DripAmountUpdated​

event DripAmountUpdated(uint256 newAmount);

CooldownUpdated​

event CooldownUpdated(uint256 newCooldown);

OwnerUpdated​

event OwnerUpdated(address indexed newOwner);