Last active
October 17, 2018 20:10
-
-
Save JGcarv/1a5f703c07558bf08052e5280e475bb8 to your computer and use it in GitHub Desktop.
Secret Variable
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.24; | |
contract SecretVariable { | |
uint256 secret; | |
uint256 public guess; | |
constructor(uint256 _secret) { | |
secret = _secret; | |
} | |
function guess(uint256 value) public { | |
guess = value; | |
} | |
function check() public returns (bool, uint) { | |
if(guess == secret) return (true, 50); | |
return (false, 0); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment