You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
557 B
19 lines
557 B
6 years ago
|
pragma solidity >=0.4.22 <0.6.0;
|
||
|
contract Faucet {
|
||
|
mapping(address => bool) processed;
|
||
|
uint quota = 0.5 ether;
|
||
|
address owner;
|
||
|
constructor() public payable {
|
||
|
owner = msg.sender;
|
||
|
}
|
||
|
function request(address payable requestor) public {
|
||
|
require(msg.sender == owner);
|
||
|
require(quota <= address(this).balance);
|
||
|
require(!processed[requestor]);
|
||
|
processed[requestor] = true;
|
||
|
requestor.transfer(quota);
|
||
|
}
|
||
|
function money() public view returns(uint) {
|
||
|
return address(this).balance;
|
||
|
}
|
||
|
}
|