Curriculum·G301 Solidity Mental Models·about 33 min
Access control: who is allowed to call this
By the end of this lesson you can
- →Explain that every privileged function needs an explicit, correct check on who may call it
- →Describe how a flawed initialization let an attacker seize Audius governance and move treasury funds
- →Reason that access control is the code that answers 'who,' and a missing or defeatable check answers 'anyone'
- →Identify the privileged functions in a contract and ask what guards each one
Graduate · enrolled learners
This lesson opens with Audius governance takeover, July 2022.
- What happened
- Audius ran its governance on upgradeable contracts, and the code that was supposed to set up and lock down those contracts, the initialization, was flawed: because of how its storage and initializers were configured, an attacker was able to re-run initialization and install themselves in a privileged role over governance. With that role they submitted and passed a malicious governance proposal that transferred millions of the project's own treasury tokens to themselves, which they then sold. The contracts were not broken cryptographically and no signing key was stolen; the access control, the code that decides who is allowed to perform privileged actions, was defeatable, so the answer to 'who may control governance' turned out to be 'whoever exploits the initializer,' rather than 'only the project.' The privileged doors existed as intended, but the lock on them could be picked from the code, and once through, the attacker could do everything the project itself could do.
- The decision point
- Access control is the code that answers the question 'who is allowed to call this,' and every function that can move funds, change parameters, mint, upgrade or govern needs an explicit and correct check, because a function without a working guard answers 'anyone.' Audius is the case: its privileged governance role was meant for the project, but a flaw in initialization let an attacker install themselves in that role, and from there they passed a proposal that drained the treasury, because once the guard on 'who' failed, the attacker inherited every privilege the project had. The mental model from the prior lesson, that the machine executes the literal code, applies sharply here: a privileged function is protected only by the check actually written on it, so 'only the owner can call this' is true only if the code verifies the caller is the owner, and a check that can be bypassed, through a re-runnable initializer, an unset variable, a wrong comparison, is a check that is not there. So the discipline is to enumerate every privileged function in a contract and, for each, find the exact code that restricts who may call it, confirm that restriction cannot be re-run or bypassed, and treat any privileged function whose guard is missing, defeatable or merely intended as open to anyone, because access control is not a property a contract has by default; it is code that must be written, correct, and impossible to reset, and Audius is what a privileged door with a pickable lock hands to whoever tries the handle.
- Recorded loss
- $6,000,000
What you will be able to answer
- →How was Audius governance taken over (July 2022)?
- →What does access control answer, and how?
- →What does a privileged function without a working guard permit?
- →How to check a contract's access control
Orientation and Year One are open: anyone can read them without an account. From Year Two onward the lessons are for enrolled learners, because progress through the later years only means anything if it is tracked against a record.
It is free. We do not sell the list and there is nothing to buy at the end of it.
Sources and review
Confidence high·Volatility low·Reviewed 2026-09-17·Owner unassigned
Contested
The roughly 6 million dollar figure is the approximate notional value of the treasury tokens the attacker transferred and sold; the amount realized in the sale was lower, and the project mitigated further impact. The lesson uses the access-control mechanism, not a precise loss.
The exact technical root cause is described by Audius as a storage and initialization flaw in its upgradeable governance contracts; this lesson summarizes it as a defeatable guard on a privileged role, which is the transferable point rather than the specific storage detail.
