Skip to content

Instantly share code, notes, and snippets.

@RobertoC27
Last active October 25, 2018 02:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RobertoC27/13219e48ae2bc743edf2ebb2db9bb6a6 to your computer and use it in GitHub Desktop.
Save RobertoC27/13219e48ae2bc743edf2ebb2db9bb6a6 to your computer and use it in GitHub Desktop.
metamask balance issue
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);
}
}
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