Skip to content

Conversation

@tamlut-modnys
Copy link
Collaborator

In the advanced-oracle-example, utils.rs:52, the size of the seeds vector should be feed_ids.len() + 2 to account for queue key + feed_ids + bump seed rather than feed_ids.len() + 1.

In the coin flip randomness example, lib.rs:65-72, there is a check to make sure the randomness is fresh (from the last round), but should make sure the randomness is not already revealed, because this might allow an attack where the player reveals the randomness and then decides whether to commit their coin flip bet.

- Fix seeds vector capacity in advanced-oracle-example utils.rs:52
  Changed from feed_ids.len() + 1 to feed_ids.len() + 2 to account for
  queue key + feed_ids + bump seed

- Fix randomness validation in sb-randomness lib.rs:65-72
  Add proper check for randomness expiration vs already revealed
  Distinguish between expired randomness and already revealed randomness

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
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.

1 participant