weak-sources-randomness

Detect weak randomness vulnerabilities in Solidity smart contracts and suggest secure alternatives.

1|1|Updated Feb 18, 2026
One-click install
npx skills add https://github.com/Apegurus/solidity-argus --skill weak-sources-randomness
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: weak-sources-randomness
Source: https://github.com/Apegurus/solidity-argus/tree/main/skills/vulnerability-patterns/weak-sources-randomness
Command: npx skills add https://github.com/Apegurus/solidity-argus --skill weak-sources-randomness

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill identifies and helps remediate vulnerabilities in smart contracts where predictable or manipulable on-chain data is used to generate random numbers, potentially leading to economic exploits.

Core Features & Use Cases

  • Vulnerability Detection: Pinpoints the use of deterministic on-chain data like block.timestamp, blockhash, block.number, and block.prevrandao for generating random values.
  • Exploit Analysis: Provides examples of how attackers can exploit weak randomness and details detection heuristics.
  • Remediation Guidance: Offers solutions such as using Chainlink VRF or implementing commit-reveal schemes.
  • Use Case: Auditing a decentralized lottery smart contract to ensure the winner selection is truly random and not influenced by miners or other network participants.

Quick Start

Analyze the provided Solidity code for weak sources of randomness.

Frequently Asked Questions about weak-sources-randomness

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I detect weak randomness vulnerabilities in Solidity smart contracts?

Detect weak randomness vulnerabilities in Solidity by analyzing code patterns for deterministic on-chain data like block.timestamp, blockhash, or block.number used in random number generation. This Skill pinpoints insecure patterns and provides remediation guidance.

Why is using block.timestamp or blockhash for randomness an exploit risk?

Using block.timestamp or blockhash for randomness is an exploit risk because these on-chain values are predictable and manipulable by miners. Attackers can influence block attributes to control outcomes in critical economic functions like lotteries.

What are secure alternatives to on-chain random number generation in smart contracts?

Secure alternatives to on-chain random number generation include integrating Chainlink VRF for verifiable randomness or implementing commit-reveal schemes. This Skill suggests these solutions to replace deterministic block attributes in Solidity code.

How do I audit a decentralized lottery smart contract for randomness exploits?

Audit a decentralized lottery smart contract for randomness exploits by scanning the Solidity code for insecure random number generation. This Skill identifies exploitable deterministic data usage and offers secure remediation strategies.

Does this Skill require prior knowledge of smart contract security to use?

Using this Skill requires understanding of Solidity, common smart contract exploits, and blockchain-specific data. This foundational knowledge is necessary to interpret the vulnerability detection results and apply the suggested remediation effectively.