Skip to content
This repository has been archived by the owner on Feb 24, 2023. It is now read-only.

Latest commit

 

History

History
11 lines (9 loc) · 657 Bytes

File metadata and controls

11 lines (9 loc) · 657 Bytes

Variable Shadowing

Variable shadowing occurs when a variable declared within a certain scope (decision block, method, or inner class) has the same name as a variable declared in an outer scope.

Attack

This depends a lot on the code of the contract itself. For instance, in the this example, variable shadowing prevents the owner of contract C from performing self destruct

Mitigation

The solidity compiler has some checks to emit warnings when it detects this kind of issue, but it has known examples where it fails.