-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathline17.sol
More file actions
41 lines (31 loc) · 716 Bytes
/
line17.sol
File metadata and controls
41 lines (31 loc) · 716 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
40
41
// SPDX-License-Identifier: MIT
//SPDX-License-Idetifier: Unlicensed
// Function Modifiers
pragma solidity >=0.7.0;
contract FunctionModifiers {
address public owner;
uint public count;
constructor() {
owner = msg.sender;
}
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
function increment() public onlyOwner {
count++;
}
}
contract modifiers {
address public owner;
constructor() {
owner = msg.sender;
}
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
function sendMoney() public onlyOwner {
payable(msg.sender).transfer(address(this).balance);
}
}