Submitted by Haipls, also found by Udsen, PetarTolev, r0ck3tz, VAD37, gumgumzum, Draiakoo, ast3ros, and 00xSEV
According to documentation and other randomizer implementations, Randomizers are expected to set a random HASH for the minted tokens.
However, the implementation mistakenly uses bytes32 in the format:
The hash is calculated as bytes32 from abi.encodePacked of the random number and tokenId.
Key observations:
Thus, these contracts only pass the random number instead of generating a hash value.
Example:
If _randomWords = [1, 2] and requestToToken = 1000,
the result will be 0x0000000000000000000000000000000000000000000000000000000000000001, which equals only the first provided random number.
HardHat
At a minimum, calculate the hash from the provided data using keccak256.
This change will ensure compliance with documentation and consider all data involved in the hash creation process.
a2rocket (NextGen) confirmed via duplicate issue #1688
aslanbek (warden) commented via duplicate issue #1688:
d3e4 (warden) commented via duplicate issue #1688:
0xsomeone (judge) commented via duplicate issue #1688:
Note: For full discussion, see here.
