Skip to content
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 randomness demo. Add section about splitting consumption and reveal of random number. #50

Merged
merged 4 commits into from
Nov 5, 2024

Conversation

architect-dev
Copy link
Contributor

Randomness demo: https://github.com/FhenixProtocol/rng-binary-guessing-game-demo

Sorry about the formatting changes my ide gets a little overzealous 👍

@eshelB
Copy link
Contributor

eshelB commented Oct 31, 2024

Interesting idea with the split between consumption and reveal, hadn't thought about it.

However, I think maybe there has to be another mechanic to prevent this: a contract calls both consume and reveal in the same transaction, and then reverts it if the result is undesirable.

maybe something like saving the current block in the consume, and then checking the reveal didn't occur in the same block

@architect-dev
Copy link
Contributor Author

Yeah you're absolutely right it needs to check that the block has progressed. I've just committed an update that fixes it.

@Cashmaney Cashmaney merged commit 6654cff into nitrogen Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants