Skip to content

Instantly share code, notes, and snippets.

@JGcarv
Last active October 17, 2018 20:10
Show Gist options
  • Save JGcarv/1a5f703c07558bf08052e5280e475bb8 to your computer and use it in GitHub Desktop.
Save JGcarv/1a5f703c07558bf08052e5280e475bb8 to your computer and use it in GitHub Desktop.
Secret Variable
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