staking

Audit DeFi staking and reward distribution mechanisms for vulnerabilities.

60|18|Updated Jan 21, 2026
One-click install
npx skills add https://github.com/PurpleAILAB/Vigilo --skill staking
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: staking
Source: https://github.com/PurpleAILAB/Vigilo/tree/main/packages/opencode/skills/staking
Command: npx skills add https://github.com/PurpleAILAB/Vigilo --skill staking

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides comprehensive knowledge and patterns for auditing Decentralized Finance (DeFi) staking and reward distribution mechanisms, identifying critical vulnerabilities.

Core Features & Use Cases

  • Pattern Library: Offers code examples and explanations for common staking patterns like reward-per-token accumulators, lock periods, and boosted staking.
  • Vulnerability Identification: Highlights common pitfalls such as precision loss, reentrancy, lock bypass, and dilution attacks.
  • Audit Checklist: Provides a structured checklist to ensure thorough review of staking contracts.
  • Use Case: An auditor can use this Skill to quickly reference best practices and known vulnerabilities when reviewing a new staking contract, ensuring all critical aspects are covered.

Quick Start

Use the staking skill to identify potential precision loss vulnerabilities in reward calculations.

Frequently Asked Questions about staking

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

FAQPage Schema
How do I audit DeFi staking contracts for reward distribution vulnerabilities?

Known staking vulnerabilities include precision loss in reward calculations, first staker advantage, late staker dilution, unstake reentrancy, lock bypass, and LSD depeg risks. A pattern library and audit checklist help identify these critical flaws during contract review.

How does precision loss affect reward-per-token accumulators in staking mechanisms?

Precision loss in reward-per-token accumulators occurs when division operations truncate token amounts, causing stakers to receive fewer rewards than expected. Auditing involves reviewing calculation order and scaling factors to prevent this distribution vulnerability.

What are the risks of liquid staking derivatives depegging during DeFi audits?

Auditing multi-reward token staking requires verifying that reward-per-token accumulators correctly handle multiple distribution streams simultaneously, checking for dilution attacks, and ensuring late stakers are not unfairly penalized by accumulators.

What vulnerabilities should I check for in boosted staking and lock period mechanisms?

When auditing boosted staking and lock periods, check for lock bypass vulnerabilities, reentrancy during unstaking, and manipulation of boosting parameters. A pattern library helps identify these common pitfalls in reward distribution contracts.

Why does first staker advantage occur in DeFi reward distribution contracts?

First staker advantage occurs when the initial staker can manipulate reward-per-token accumulators by depositing and immediately withdrawing, stealing rewards meant for future stakers. Auditing requires validating accumulator initialization and deposit logic.