-
Notifications
You must be signed in to change notification settings - Fork 47
Open
Description
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
| 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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels