You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
616 B
30 lines
616 B
6 years ago
|
pragma solidity ^0.5.0;
|
||
8 years ago
|
|
||
|
contract Events {
|
||
|
uint x = 0;
|
||
7 years ago
|
bool a;
|
||
|
bool b;
|
||
8 years ago
|
event LogEventOne( uint x, address y);
|
||
|
event LogEventTwo( uint x, address y);
|
||
|
|
||
6 years ago
|
function test(uint val) public {
|
||
7 years ago
|
// Assert / Require events
|
||
|
require(true);
|
||
|
|
||
|
// Contract Events
|
||
6 years ago
|
emit LogEventOne(100, msg.sender);
|
||
8 years ago
|
x = x + val;
|
||
6 years ago
|
emit LogEventTwo(200, msg.sender);
|
||
7 years ago
|
|
||
|
// Branch events
|
||
|
if (true) {
|
||
|
a = false;
|
||
|
} else {
|
||
|
b = false;
|
||
|
}
|
||
8 years ago
|
}
|
||
|
|
||
6 years ago
|
function getX() public view returns (uint){
|
||
8 years ago
|
return x;
|
||
|
}
|
||
|
}
|