Commit afcc6e55 authored by tre's avatar tre

add tests

parent 629e9bc0
......@@ -21,6 +21,20 @@ contract SafeSend {
* @notice Faucet contract that drips ETH to users.
*/
contract Faucet {
/**
* @notice Emitted on each drip.
* @param authModule The type of authentication that was used for verifying the drip.
* @param userId The id of the user that requested the drip.
* @param amount The amount of funds sent.
* @param recipient The recipient of the drip.
*/
event Drip(
string indexed authModule,
bytes indexed userId,
uint256 amount,
address indexed recipient
);
/**
* @notice Parameters for a drip.
*/
......@@ -147,7 +161,12 @@ contract Faucet {
// Set the next timestamp at which this auth id can be used.
timeouts[_auth.module][_auth.id] = block.timestamp + config.ttl;
// Mark the nonce as used.
usedNonces[_auth.id][_params.nonce] = true;
// Execute a safe transfer of ETH to the recipient account.
new SafeSend{ value: config.amount }(_params.recipient);
emit Drip(config.name, _auth.id, config.amount, _params.recipient);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment