Last active
June 1, 2022 00:58
-
-
Save Z-M-Huang/3d36d4e48b0d340ac6e36ff7563028e6 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
contract Random is RandomClient { | |
string public _serverSeed; | |
string public _clientSeed; | |
uint64 public _nonce; | |
uint64 public _value; | |
bool public verifiedResult; | |
constructor() RandomClient() { | |
_clientSeed = "123123123"; | |
} | |
function getRandom() public { | |
getRandomNumber(_clientSeed); | |
} | |
function verifyRandom() public { | |
verifyRandomNumber(_serverSeed, _clientSeed, _nonce, _value); | |
} | |
function randomNumberReceivedCallback(bytes32, string memory serverSeed, string memory clientSeed, | |
uint64 nonce, uint64 value) internal override { | |
_serverSeed = serverSeed; | |
_clientSeed = clientSeed; | |
_nonce = nonce; | |
_value = value; | |
} | |
function verifyRandomReceivedCallback(bytes32, bool value) internal override { | |
verifiedResult = value; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment