SMTChecker
Setup
Compiler Setup
- solc-select installation - the link includes a number of ways to download and install, but the easiest is probably
pip3 install solc-select
- Run
solc --version
- If you see
Version: 0.8.0
you can skip the next step
solc-select install 0.8.0 && solc-select use 0.8.0
- Run
solc --version
you should see Version: 0.8.0
Download files
- Download this file
tutorial1.sol
- run
solc tutorial1.sol
- You should seeā¦
Compiler run successful, no output requested.
Instructions
- Uncomment line 3 in
tutorial1.sol
- run
solc tutorial.sol
- The model checker should return a
Warning
that the Overflow
property could not be verified. It also includes a counterexample and the line number where it found the overflow.
- Add one or more
require
statements to prevent the code from overflowing.
- Hint:
type(uint).max
returns the max value for a uint