Solidity theorytheory 0/50 · 0%
Security · hard

46. Auditing mindset

Reading code the way an attacker does.

Start with the money: which functions move value, and who can call them? Then map trust boundaries, external calls and assumptions. Ask what happens with zero amounts, the same address twice, a reentering token, or a paused oracle.

// checklist: access control, CEI, arithmetic, external calls,
// initialisation, upgrade safety, oracle freshness, event coverage

Write the invariant in a sentence — "the contract always holds at least the sum of stakes" — then try to break it.

Check your understanding

  1. 1. Where should a review start?

  2. 2. What is an invariant?

  3. 3. Which edge case is commonly missed?