* Clean examples/evm, add a new one integer_overflow.py -> simple_int_overflow.sol simple_functions.py -> simple_multi_func.sol simple_transaction.py -> simple_value_check.sol * Add umd example
31 lines
620 B
Solidity
31 lines
620 B
Solidity
// Smart contract based on a classic symbolic execution example from slides
|
|
// by Michael Hicks, University of Maryland.
|
|
// https://www.cs.umd.edu/~mwh/se-tutorial/symbolic-exec.pdf
|
|
|
|
pragma solidity ^0.4.15;
|
|
|
|
contract SymExExample {
|
|
|
|
|
|
function test_me(int a, int b, int c) public pure {
|
|
int x = 0;
|
|
int y = 0;
|
|
int z = 0;
|
|
|
|
if (a != 0) {
|
|
x = -2;
|
|
}
|
|
|
|
if (b < 5) {
|
|
if (a == 0 && c != 0) {
|
|
y = 1;
|
|
}
|
|
z = 2;
|
|
}
|
|
|
|
// will fail when: a == 0 && b < 5 && c != 0
|
|
assert(x + y + z != 3);
|
|
}
|
|
|
|
}
|