You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
uint256 randomIndex = i + entropy % (raffleEntries.length- i);
I suspect that reuse of the same entropy will introduce other biases, but how the affect the implementation is less immediately obvious. My initial thoughts are that you need to use the entropy from VRF in a construction like keccak256(abi.encode(vrf_entropy, counter)) so that each selection is independent. However this becomes expensive.
FWIW I'm @divergence_art in the NFT world should you want to chat on Twitter.
The text was updated successfully, but these errors were encountered:
This is a great initiative, thanks for starting it.
Your Fisher–Yates implementation biases selection of early entrants by use of modulus (Wiki explanation).
MultiRaffle/src/MultiRaffle.sol
Line 177 in 55c4c4a
I suspect that reuse of the same entropy will introduce other biases, but how the affect the implementation is less immediately obvious. My initial thoughts are that you need to use the entropy from VRF in a construction like
keccak256(abi.encode(vrf_entropy, counter))
so that each selection is independent. However this becomes expensive.FWIW I'm @divergence_art in the NFT world should you want to chat on Twitter.
The text was updated successfully, but these errors were encountered: