agents/skills/evm/economic-design-audit/SKILL.md
Trigger Pattern MONETARY_PARAMETER flag (required) - Inject Into Breadth agents (merged via M6 hierarchy)
npx skillsauth add plamentsv/plamen economic-design-auditInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Trigger Pattern: MONETARY_PARAMETER flag (required) Inject Into: Breadth agents (merged via M6 hierarchy)
For every monetary parameter setter (rate, rebase, supply, mint, burn, emission, inflation, peg, price cap/floor, fee, reward rate) in the protocol:
| Parameter | Setter | Min Value | Max Value | Enforced? | Impact at Min | Impact at Max | |-----------|--------|-----------|-----------|-----------|---------------|---------------|
For each parameter: substitute min and max into ALL consuming functions. Tag: [BOUNDARY:param=val -> outcome]
List all economic invariants the protocol must maintain: | Invariant | Parameters Involved | Can Admin Break It? | Functions That Assume It |
For each setter: can changing this parameter break an invariant that user-facing functions depend on? If yes -> finding.
For protocols with multiple monetary parameters that interact: | Parameter A | Parameter B | Interaction | Can A*B Produce Extreme Output? |
Check: can two independently-valid parameter settings combine to create an extreme or invalid economic state? (Rule 14 constraint coherence)
For every fee-related computation (fee calculation, fee deduction, fee distribution):
Pick 3 representative fee rates (e.g., 1% = 100 BPS, 5% = 500 BPS, 10% = 1000 BPS) and trace through the actual code formula:
| Fee Param | Value | Formula | Input Amount | Expected Output | Actual Output | Match? | |-----------|-------|---------|-------------|----------------|---------------|--------| | {fee_bps} | 100 | {code formula} | 1e18 | {expected} | {computed} | YES/NO | | {fee_bps} | 500 | {code formula} | 1e18 | {expected} | {computed} | YES/NO | | {fee_bps} | 1000 | {code formula} | 1e18 | {expected} | {computed} | YES/NO |
Tag: [BOUNDARY:fee_bps={val} → effective_rate={computed_rate}]
Red flags:
amount * MAX / (MAX - fee) charges effective rate of fee/(MAX-fee), not fee/MAX. At 5% this is 5.26%, not 5%. Document whether this is intentional.mulDivUp or equivalent) favors the protocol.uint256 math at 1e18 scale, do intermediate products overflow or lose precision? Check mulDiv ordering.For every fee computation, trace the base amount (the value the fee is computed on) through ALL subsequent code paths:
| Fee Site | Base Amount Variable | Modified After Fee? | Modified How | Fee Recomputed? | Overcharge? | |----------|---------------------|--------------------:|-------------|-----------------|-------------|
Methodology:
amount, depositAmount)fee = amount * feeRate / MAX, then amount is reduced to leftover (e.g., remaining allocation), the user paid fee on amount but only leftover was processed - overcharge of fee * (1 - leftover/amount)For protocols with multiple fee types:
| Fee A | Fee B | A Output Feeds B Input? | Combined Effective Rate | Independent Rate Sum | Discrepancy? | |-------|-------|------------------------|------------------------|---------------------|-------------|
If the protocol uses share-based accounting (ERC4626 vaults, LP tokens):
For protocols with emission/inflation/rebase mechanics:
| Section | Required | Completed? | |---------|----------|------------| | 1. Parameter Boundary Analysis | YES | Y/N/? | | 2. Economic Invariant Identification | YES | Y/N/? | | 3. Rate/Supply Interaction Matrix | IF >1 monetary param | Y/N(N/A)/? | | 4. Fee Formula Verification at Normal Values | IF fee parameters detected | Y/N(N/A)/? | | 5. Emission/Inflation Sustainability | IF emission/rebase detected | Y/N(N/A)/? |
data-ai
Trigger Pattern Always (run during recon TASK 0, not breadth) - Inject Into Recon agent only (meta_buffer.md enrichment)
data-ai
Trigger Pattern Always (run during recon TASK 0, not breadth) - Inject Into Recon agent only (meta_buffer.md enrichment)
data-ai
Trigger Pattern Always (run during recon TASK 0, not breadth) - Inject Into Recon agent only (meta_buffer.md enrichment)
data-ai
Trigger STABLESWAP_FORK flag (fork-ancestry detects Curve/StableSwap parent via get_d/get_y/ramp_a/StableSwap patterns) - Agent Type general-purpose (standalone niche agent, 1 budget slot)