ChainSecurity / deployment_validation

Deployment Validation Files aim to simplify Deployment Validation of Smart Contracts
GNU Affero General Public License v3.0
21 stars 1 forks source link

Support static mapping assignments #17

Open stiefn opened 3 weeks ago

stiefn commented 3 weeks ago

If a value is assigned to a mapping using a constant as key, the compiler optimizes the keccak() opcode out. This means, we cannot find the mapping slot to a given slot the value is assigned to.

Minimal testing case:

contract Test1 {
    mapping(address account => uint256) bla;

    constructor() {
        bla[address(1)] = 500;
    }
}