Skip to content

feat: detect unsafe randomness and repeated storage reads#427

Merged
mijinummi merged 3 commits into
MDTechLabs:mainfrom
Leothosine:fix/unsafe-randomness-storage-reads
Jun 1, 2026
Merged

feat: detect unsafe randomness and repeated storage reads#427
mijinummi merged 3 commits into
MDTechLabs:mainfrom
Leothosine:fix/unsafe-randomness-storage-reads

Conversation

@Leothosine
Copy link
Copy Markdown
Contributor

Summary

  • Added UnsafeRandomnessRule that flags use of blockhash/block.timestamp as randomness sources and suggests VRF or commit-reveal alternatives.
  • Added MultipleStorageReadsRule that detects repeated reads from the same storage slot and suggests local variable caching.

Changes

  • packages/rules/src/security/randomness/unsafe_randomness.rs
  • packages/rules/src/security/randomness/mod.rs
  • packages/rules/src/optimization/storage/multiple_storage_reads.rs

closes #314
closes #315

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented Jun 1, 2026

@Leothosine Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@mijinummi mijinummi merged commit 857c9ce into MDTechLabs:main Jun 1, 2026
1 of 6 checks passed
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.

Detect Multiple Storage Reads Detect Unsafe Randomness Patterns

2 participants