Created
February 5, 2016 13:36
-
-
Save anonymous/e210a052b6b4c86337c2 to your computer and use it in GitHub Desktop.
Created using soleditor: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://chriseth.github.io/browser-solidity/?gist=
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
contract random{ | |
/* Define variable owner of the type address*/ | |
address owner; | |
/* this function is executed at initialization and sets the owner of the contract */ | |
function Random() { owner = msg.sender; } | |
/* Function to recover the funds on the contract */ | |
function kill() { if (msg.sender == owner) suicide(owner); } | |
//generate random number | |
function rand( uint256 seedB ) returns (uint256){ | |
//define seedA variable | |
uint256 seedA = 1; | |
uint amount = 1 finney; | |
if (seedA == seedB) { | |
msg.sender.send(amount); | |
} | |
return seedA + seedB; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment