SRI-CSL / solidity

This is solc-verify, a modular verifier for Solidity.
https://github.com/SRI-CSL/solidity/blob/boogie/SOLC-VERIFY-README.md
GNU General Public License v3.0
50 stars 14 forks source link

Constants should not be indexed in packing/unpacking #134

Closed dddejan closed 4 years ago

dddejan commented 4 years ago
pragma solidity >=0.5.0;

contract A {

  string constant public s1 = "N1";
  string s2 = "N2";

  string title;

  function f(string storage str) internal {
    require(bytes(str).length > 0);
    title = str;
  }

  constructor() public {
    f(s2);
  }
}

Currently gives

$ solc-verify.py issue.sol --output .
Error while running verifier, details:
Parsing ./issue.sol.bpl
./issue.sol.bpl(27,147): Error: undeclared identifier: s1#4
1 name resolution errors detected in ./issue.sol.bpl
hajduakos commented 4 years ago

Fixed in 21c9123ad3dc83d9dedda10b97ac28bc380ae75a