40 lines
1.3 KiB
Plaintext
40 lines
1.3 KiB
Plaintext
|
@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.
|
|||
|
|
|||
|
|
|||
|
@table @dfn
|
|||
|
@item ERC165 Interface identifier
|
|||
|
@include ../../build/Faucet.interface
|
|||
|
@item Solidity interface definition
|
|||
|
@include ../../build/contract_Faucet.texi
|
|||
|
@item Reference implementations
|
|||
|
@itemize
|
|||
|
@item
|
|||
|
@uref{git://holbrook.no/erc20-faucet.git,}
|
|||
|
@item
|
|||
|
@uref{git://holbrook.no/eth-faucet.git,}
|
|||
|
@end itemize
|
|||
|
@end table
|