Created
July 1, 2022 10:10
-
-
Save Ashar2shahid/5d982b04d507d5126e935e97bbe687cd 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
function generateQuantumon(bytes32 requestId, bytes calldata data) | |
public | |
onlyAirnodeRrp | |
{ | |
require( | |
expectingRequestWithIdToBeFulfilled[requestId], | |
"Request ID not known" | |
); | |
expectingRequestWithIdToBeFulfilled[requestId] = false; | |
uint256 qrngUint256 = abi.decode(data, (uint256)); | |
uint256 id = _pickRandomUniqueId(qrngUint256); | |
uint256 tokenId = index - 1; | |
_safeMint(requestToSender[requestId], tokenId); | |
_setTokenURI(tokenId, id.toString()); | |
emit GenerateQuantumon(requestToSender[requestId], tokenId); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment