-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathbasic.sol
More file actions
39 lines (33 loc) · 845 Bytes
/
basic.sol
File metadata and controls
39 lines (33 loc) · 845 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
pragma solidity 0.7.6;
contract basic {
uint256 state = 0;
constructor() payable {}
// inspired by https://github.com/crytic/echidna/blob/master/examples/solidity/coverage/single.sol
function first(
uint256 x,
uint256 y,
uint256 z
) public {
require(x == 42424242);
require(y == 8);
require(z == 123);
require(state == 0);
state += 1;
}
function second() public payable {
require(state == 1);
require(msg.value > 0);
if (msg.value == 10000) {
state += 1;
} else {
state -= 1;
}
}
function echidna_state() public view returns (bool) {
return state != 2;
}
function ether_oracle() public {
require(state == 2);
selfdestruct(msg.sender);
}
}