-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add example random in range function #21
Comments
Very cool! Thanks for taking the initiative to add a reference method for developers, and very quickly after the feedback 🙏🏼 Before I look at the solidity implementation, I was wondering if an alternative "simpler" way could work: what if we update the EVM arch of
This said, the idea only makes sense if this is an easy add, I have no idea how Arch functions work, and how much effort we need to make the change. My wishful is thinking is that this is "just an argument addition". |
I think this is the ideal solution @tarakby. It would be much easier to implement a "random range" function from the EVM side if it was simply abstracted in Cadence Arch. I'd be curious to hear thoughts from those more familiar with Arch precompile calls - cc @ramtinms @m-Peter While I'm not deeply familiar with Cadence Arch, I'm fairly sure the change would require a network upgrade with the next one slated in the order of months. If that is in fact the case, IMO we should still provide some workable solution for acquiring a random number in range which would fall in the realm of a solidity implementation. |
Description
Recent discussion in onflow/docs#902 reveals the need for a safe demonstration of generating a random number in a range. @tarakby listed a couple of feasible approaches that can be taken for this implementation. This functionality can be added to the existing
CadencRandomConsumer.sol
base contract for easy consumption in the context of randomness.This implementation should then be added to the docs as reference.
The text was updated successfully, but these errors were encountered: