What is an access control list in smart contracts?
An access control list, or ACL, is the record a contract keeps of which addresses may perform which privileged actions, checked at the start of each privileged function. In Solidity it is usually a mapping from a role to the addresses that hold it, and a function such as mint or upgrade reverts unless the caller has the right role.
How do Solidity contracts implement access control?
The OpenZeppelin documentation describes three designs (OpenZeppelin):
| Design | How it works | Fits |
|---|---|---|
| Single owner | One address can run every admin function | Small contracts with one admin |
| Roles | Each role is a bytes32 ID with its own members and its own admin role |
Separate powers, such as minting, pausing and upgrading |
| Central manager | One contract holds the permissions for many contracts | Protocols with many contracts and roles |
A minimal role mapping (illustrative, not audited code) RoleList.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.28;
contract RoleList {
bytes32 public constant ADMIN = keccak256("ADMIN");
bytes32 public constant MINTER = keccak256("MINTER");
mapping(bytes32 => mapping(address => bool)) public hasRole;
mapping(address => uint256) public balanceOf;
constructor() {
hasRole[ADMIN][msg.sender] = true;
}
modifier onlyRole(bytes32 role) {
require(hasRole[role][msg.sender], "missing role");
_;
}
function setRole(bytes32 role, address account, bool allowed) external onlyRole(ADMIN) {
hasRole[role][account] = allowed;
}
function mint(address to, uint256 amount) external onlyRole(MINTER) {
balanceOf[to] += amount;
}
}
What do reviewers check in an access control list?
The top role decides the rest, because in OpenZeppelin AccessControl the DEFAULT_ADMIN_ROLE is the default admin of every role and of itself, and OpenZeppelin warns that it carries significant risk (OpenZeppelin).
OpenZeppelin suggests AccessControlDefaultAdminRules for extra safeguards on that role, and Ownable2Step, which transfers ownership in two steps, for contracts with a single owner (OpenZeppelin).
- Every function that moves funds, mints, upgrades or changes a parameter has a role check.
- The top admin role sits behind a multisig and a timelock.
- No deployer or test account still holds a role after launch.
- The caller is identified by
msg.sender, nevertx.origin(Solidity docs).
A missing role check shows up in an audit report as a finding like this one: setOracle() in a lending market has no role check, so any account can point the market at a feed it controls and borrow against a price it picked. The fix adds the role, for example onlyRole(ORACLE_ADMIN), plus a test that calls the function from an outside account and expects a revert. The access control vulnerability page walks through two real losses, at Parity and Poly Network.
Sources
- Access control, OpenZeppelin docs checked 3 December 2026
- Security considerations, Solidity documentation checked 3 December 2026
- Access API: AccessControl, AccessControlDefaultAdminRules and Ownable2Step, OpenZeppelin docs checked 3 December 2026