-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathline14.sol
More file actions
34 lines (25 loc) · 744 Bytes
/
line14.sol
File metadata and controls
34 lines (25 loc) · 744 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
// SPDX-License-Identifier: MIT
//SPDX-License-Idetifier: Unlicensed
// Solidity Events
pragma solidity >=0.7.0;
contract events {
uint public val = 4; //state variable
event ValueChanged(uint _val);
function set(uint _val) public {
val = _val;
emit ValueChanged(_val);
}
}
contract events2 {
event transfer(address _from, address _to, uint _amount);
function send(address _to, uint _amount) public {
emit transfer(msg.sender, _to, _amount);
}
}
//indexed
contract events3 {
event transfer(address indexed _from, address indexed _to, uint _amount);
function send(address _to, uint _amount) public {
emit transfer(msg.sender, _to, _amount);
}
}