Skip to content

Instantly share code, notes, and snippets.

Created February 5, 2016 13:36
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 anonymous/e210a052b6b4c86337c2 to your computer and use it in GitHub Desktop.
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=
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