2023-03-25 12:14:46 +01:00
|
|
|
|
@subsection Faucet
|
|
|
|
|
|
|
|
|
|
Used for dispensing tokens to any address.
|
|
|
|
|
|
|
|
|
|
It can be used for gas tokens and @emph{ERC20} alike.
|
|
|
|
|
|
|
|
|
|
The interface is the same whether the faucet is dispensing from existing balance or minting new tokens.
|
|
|
|
|
|
|
|
|
|
The value dispersed @emph{must} be the same for all addresses.
|
|
|
|
|
|
|
|
|
|
In general, four criteria are expected to exist in any combination for limiting access to the faucet:
|
|
|
|
|
|
|
|
|
|
@table @dfn
|
|
|
|
|
@item Time
|
|
|
|
|
A recipient may only use the faucet again after some time has passed.
|
|
|
|
|
@item Balance threshold
|
|
|
|
|
A recipient may only use the faucet after its balance is below a certain amount.
|
|
|
|
|
@item Membership
|
|
|
|
|
A recipient may only use the faucet if it has been added to an access control list.
|
|
|
|
|
@item Capacity
|
|
|
|
|
The contract has sufficient token funds to dispense the current defined amount to dispense.
|
|
|
|
|
@end table
|
|
|
|
|
|
|
|
|
|
The @emph{check(address)} contract call @emph{must} evaluate all four criteria, and @emph{must} return @code{false} if any of the criteria are not met.
|
|
|
|
|
|
|
|
|
|
|
2023-08-02 11:19:33 +02:00
|
|
|
|
@subsubsection ERC165 Interface identifier
|
|
|
|
|
|
2023-03-25 12:14:46 +01:00
|
|
|
|
@include ../../build/Faucet.interface
|
2023-08-02 11:19:33 +02:00
|
|
|
|
|
|
|
|
|
@subsubsection Solidity interface definition
|
|
|
|
|
|
2023-03-25 12:14:46 +01:00
|
|
|
|
@include ../../build/contract_Faucet.texi
|
2023-08-02 11:19:33 +02:00
|
|
|
|
|
|
|
|
|
@subsubsection Reference implementations
|
|
|
|
|
|
2023-03-25 12:14:46 +01:00
|
|
|
|
@itemize
|
|
|
|
|
@item
|
|
|
|
|
@uref{git://holbrook.no/erc20-faucet.git,}
|
|
|
|
|
@item
|
|
|
|
|
@uref{git://holbrook.no/eth-faucet.git,}
|
|
|
|
|
@end itemize
|