DEFI SECURITY

16 articles tagged "defi security"

2025-01-15·12 min read

Why Invariant Testing Matters for DeFi Security

Unit tests check what you think of. Invariant tests check what you don't. Here's why every DeFi protocol needs invariant testing and how it has saved millions in real engagements.

By Alex
invariant-testingdefi-securitysmart-contracts
2025-01-27·7 min read

Do you need a smart contract audit?

If your contract holds user funds, controls access to funds, or governs protocol parameters that affect funds, you need an audit. Here's how to decide what type fits your situation.

By Alex
smart-contract-auditsmart-contract-securitydefi-security
2025-02-10·8 min read

How much does a smart contract audit cost in 2025?

A smart contract audit costs between $15,000 and $120,000 for most DeFi protocols. Here's a full breakdown of pricing by audit type, what drives cost, and how to get the most value from your budget.

By Alex
smart-contract-auditsmart-contract-securitydefi-security
2026-01-26·10 min read

Flash loan exploits: how they work and how invariant testing catches them

Flash loans let anyone borrow millions for a single transaction. When combined with reentrancy or oracle manipulation, they drain protocols in one block. Here's how invariant testing catches what unit tests can't.

By Deivitto
flash-loan-attackdefi-securityfuzzing
2026-02-17·9 min read

Access control bugs in Solidity: real hacks and property-based defense

A missing modifier. A delegatecall to an untrusted address. Access control bugs have caused some of the largest losses in DeFi history. Here's how to find them with property-based testing.

By Deivitto
access-controlsmart-contract-securityinvariant-testing
2026-03-14·12 min read

ZK circuit security: constraint bugs, witness leaks, and audit patterns

ZK circuits aren't programs — they're constraint systems. The bugs look different: under-constrained signals, witness malleability, missing range checks. Here's how to audit them.

By Deivitto
smart-contract-securityfuzzinginvariant-testing
2026-02-02·16 min read

Advanced invariant testing techniques for DeFi protocols

Beyond basic property writing. Ghost variables, temporal properties, conditional invariants, bounding inputs, handling oracles, and debugging failing invariants.

By Nican0r
invariant-testingfuzzingproperty-based-testing
2025-12-22·14 min read

AMM and DEX invariant testing: properties every swap protocol needs

Every AMM needs these properties: constant product conservation, fee accounting, LP share math, and sandwich resistance. Here's the complete invariant suite.

By Nican0r
invariant-testingfuzzingdefi-security
2026-02-23·14 min read

Staking and rewards distribution: fuzzing the accounting protocols get wrong

Staking reward math is deceptively tricky. Division-before-multiplication, rounding dust, flash-stake exploits — here are the properties that catch them all.

By Nican0r
invariant-testingfuzzingdefi-security
2025-08-25·14 min read

Governance and timelock security: properties for proposal lifecycle

Governance bugs have led to catastrophic exploits. Here are the properties that protect proposal lifecycles, voting power, timelocks, and execution flow.

By Alex
invariant-testingfuzzingaccess-control
2025-09-22·14 min read

Oracle integration testing: fuzzing price feeds and manipulation resistance

Your protocol trusts an oracle. But does it handle stale prices, sudden deviations, and manipulation attempts correctly? Here's how to fuzz your oracle integration.

By Nican0r
invariant-testingfuzzingoracle
2025-11-24·18 min read

Top 10 DeFi exploits of 2025: the invariants that would have stopped them

Ten exploits, billions lost. For each one, we break down the root cause and write the exact invariant property that would have stopped it.

By Alex
invariant-testingdefi-securityvulnerabilities
2026-03-26·14 min read

Price manipulation attacks: spot prices, TWAPs, and how to fuzz your defenses

Flash loan price manipulation, TWAP gaming, oracle sandwiches — here's how each attack works and the properties that prove your defenses hold.

By Nican0r
oracledefi-securityfuzzing
2026-03-16·14 min read

The ERC-4626 donation attack: first depositor exploit explained and tested

The donation attack lets an attacker steal funds from vault depositors through share inflation. Here's exactly how it works, how to prevent it, and how to test for it.

By Antonio
erc-4626vulnerabilitiesinvariant-testing
2026-04-06·14 min read

Postmortem: The Lending Protocol Reentrancy That Fuzzing Missed — And Invariants Didn't

The dev team ran Echidna for 24 hours: zero findings. The same vulnerability was found by invariant testing in 90 seconds. Here's the exact reentrancy path, why mock ERC20s hide it, and the accounting properties that catch it.

By Antonio
reentrancyinvariant-testingdefi-security
2026-04-06·13 min read

5 Properties Every Smart Contract Auditor Forgets to Test

After 40+ DeFi audits, the same five invariant gaps come up every time. Not the obvious ones — accountants check totalSupply. The ones that require stateful sequences, adversarial tokens, and cross-function composition.

By Antonio
invariant-testingsmart-contract-securityfuzzing

Need help securing your protocol?