Created
May 14, 2018 10:10
-
-
Save maxaleks/4dbcf72a5b05c293968feb6f2c56cc91 to your computer and use it in GitHub Desktop.
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.23+commit.124ca40d.js&optimize=false&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
pragma solidity ^0.4.21; | |
contract Random { | |
function random() external view returns (uint256) { | |
return uint256(keccak256(keccak256(blockhash(block.number), 0), now)); | |
} | |
} | |
contract Test { | |
Random random; | |
uint256 public savedRandom; | |
constructor() { | |
random = new Random(); | |
} | |
function test() external { | |
savedRandom = random.random(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment