Skip to content

Instantly share code, notes, and snippets.

@Ashar2shahid
Created July 1, 2022 10:10
Show Gist options
  • Save Ashar2shahid/5d982b04d507d5126e935e97bbe687cd to your computer and use it in GitHub Desktop.
Save Ashar2shahid/5d982b04d507d5126e935e97bbe687cd to your computer and use it in GitHub Desktop.
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