Created
July 28, 2018 08:34
-
-
Save viswanathkgp12/b34485bc00636d98c5a5bb6b86369149 to your computer and use it in GitHub Desktop.
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.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