skills/vulnerability-patterns/shadowing-state-variables/SKILL.md
- Contract inherits from one or more parent contracts
npx skillsauth add apegurus/solidity-argus shadowing-state-variablesInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
contract Base {
address public owner;
constructor() {
owner = msg.sender;
}
}
// Solidity <0.6.0: this compiles without error
contract Child is Base {
address public owner; // Shadows Base.owner — creates a NEW variable
function setOwner(address _owner) external {
owner = _owner; // Sets Child.owner, NOT Base.owner
}
// Base's functions still read Base.owner (the original)
// Child's functions read Child.owner (the shadow)
// These are two different storage variables!
}
// Local variable shadowing (any version)
contract Example {
uint256 public value = 100;
function getValue() public view returns (uint256) {
uint256 value = 0; // Shadows state variable
return value; // Returns 0, not 100
}
}
owner, admin, and other access-control variables being shadowed_ for parameters)contract Child is Base {
// Don't redeclare — use Base.owner directly
function setOwner(address _newOwner) external {
owner = _newOwner; // Modifies Base.owner
}
}
testing
Specialist profile for mechanically applying the attack-vector deck and classifying vectors as skip, drop, or investigate.
tools
Specialist profile for libraries, helpers, base contracts, adapters, encoders, wrappers, and integration glue.
testing
Specialist profile for rounding, scale, decimal, downcast, and arithmetic accounting edge cases.
testing
Specialist profile for extracting conservation laws and state couplings, then searching for violating paths.