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

Support for solidity global variables #119

Open beillahi opened 4 years ago

beillahi commented 4 years ago
pragma solidity ^0.5.0;

contract test {

    function g() public returns (uint) {

       return block.timestamp;
    }
}
-----------------
test::[implicit_constructor]: OK
test::g: SKIPPED
Use --show-warnings to see 2 warnings.
Some functions were skipped. Use --verbose to see details.
No errors found.

and

pragma solidity ^0.5.0;

contract test {

    function g() public returns (uint) {

       return block.difficulty;
    }
}
-----------------
test::[implicit_constructor]: OK
test::g: SKIPPED
Use --show-warnings to see 2 warnings.
Some functions were skipped. Use --verbose to see details.
No errors found.
hajduakos commented 4 years ago

Can we treat these special members as nondeterministic variables (so that there is no error)? Or do you need some special assumptions on them?

beillahi commented 4 years ago

Giving these variables nondeterministic values should be fine