andrecronje / rarity

d20srd reference implementation codified in solidity
Other
612 stars 121 forks source link

[secure dice] Expansion ecosystem request #56

Open BlinkyStitt opened 3 years ago

BlinkyStitt commented 3 years ago

The current dice contract can be manipulated by miners. It also returns the same roll on every call inside a transaction. This works fine for the current adventures, but I think there are more advanced adventures that will want truly random dice.

I think using Chainlink's VRF would work well. As far as I can tell, it is currently in Fantom's testnet but is not yet on mainnet. If anyone knows the mainnet launch date (or addresses), that would be appreciated.

In addition to the smart contract for dice. I will write a best-practices guide for using the dice in your adventures.

murderteeth commented 3 years ago

I will write a best-practices guide for using the dice in your adventures ...even without a better dice contract or link vrf, a README somewhere on rarity dice would have saved me a lot of time! fwiw

BlinkyStitt commented 2 years ago

Interesting post on random in solidity: https://xtremetom.medium.com/solidity-random-numbers-f54e1272c7dd