Unsafe delegatecall detector#
Name: unsafe-delegatecall
The unsafe-delegatecall detector reports delegatecall calls to possibly untrusted contracts.
Calls are ignored if they the delegatecall target is trusted (e.g. this) or if the call is protected by an onlyOwner modifier or similar logic.
More precisely, access controls based on msg.sender are checked in the detector.
Addresses set in a constructor or in functions protected by onlyOwner (or similar) are considered trusted.
Example#
- The
delegatecallcall is not protected by any access control condition usingmsg.senderandowner. ThecomputationLogicvariable can be set by anyone, making it possible to call arbitrary code that can modify the storage of theStoragecontract.
Parameters#
| Command-line name | TOML name | Type | Default value | Description |
|---|---|---|---|---|
--proxy/--no-proxy |
proxy |
bool |
false |
Whether to report delegatecall calls in proxy contracts. |