Token hash will never be set incase of a failed randomness callback #866
Labels
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
bug
Something isn't working
duplicate-1464
unsatisfactory
does not satisfy C4 submission criteria; not eligible for awards
Lines of code
https://github.com/code-423n4/2023-10-nextgen/blob/8b518196629faa37eae39736837b24926fd3c07c/smart-contracts/NextGenCore.sol#L299
Vulnerability details
Impact
In any case if the chainlink or ArrngConsumer fails to callback the fulfillRandomWords the token hash for that token will never be set.
Proof of Concept
When minting a new token the randomness request is also called in the process and that request is callback by the
randomizerContract for the particular collection if the collection's randomizerContract is chainlink or arrng and if they ever fail to callback the
setTokenHash
function will never be called for the minted token and the token hash will never be set for that token.Tools Used
manual
Recommended Mitigation Steps
add a function to manually add a token hash if it is not set in a given time. Or split the request randomness and the minting of token and give another function where only the token owner can call to ask for randomness if the first one failed.
Assessed type
Oracle
The text was updated successfully, but these errors were encountered: