Last active
October 25, 2018 02:29
-
-
Save RobertoC27/13219e48ae2bc743edf2ebb2db9bb6a6 to your computer and use it in GitHub Desktop.
metamask balance issue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.4.18; | |
contract Faucet { | |
address public owner; | |
address public owner2; | |
bool public available; | |
mapping (address => bool) fundedAccounts; | |
modifier onlyOwner() { | |
if(msg.sender != owner) | |
revert("Only owner can change availability"); | |
_; | |
} | |
modifier duringAvailable() { | |
if(!available) | |
revert("Contract not ready to send ether"); | |
_; | |
} | |
constructor() public payable { | |
owner = msg.sender; | |
available = false; | |
} | |
function updateAvailable() onlyOwner public { | |
available = !available; | |
} | |
function fundAccount(address _reciever) duringAvailable public payable { | |
require(fundedAccounts[_reciever] == false); | |
fundedAccounts[_reciever] = true; | |
_reciever.transfer(0.5 ether); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Geth/nodo maquina 1/v1.8.6-stable-12683fec/linux-amd64/go1.10" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment