Skip to content

Instantly share code, notes, and snippets.

@viswanathkgp12
Created July 28, 2018 08:34
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 viswanathkgp12/b34485bc00636d98c5a5bb6b86369149 to your computer and use it in GitHub Desktop.
Save viswanathkgp12/b34485bc00636d98c5a5bb6b86369149 to your computer and use it in GitHub Desktop.
pragma solidity ^0.4.23;
contract FlawedStorageContract
{
uint256 private randomNumber;
address owner = msg.sender;
struct GameHistory
{
address player;
uint256 number;
}
GameHistory[] public log;
function StoreLogs(uint256 _number)
public
payable
{
GameHistory gameHistory;
// RandomNumber Changes to Non-Zero in this line of code
gameHistory.player = msg.sender;
gameHistory.number = _number;
log.push(gameHistory);
}
function checkRandomNumber() public view returns(uint) {
return randomNumber;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment