-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtautological-compare.sol
More file actions
36 lines (33 loc) · 902 Bytes
/
Copy pathtautological-compare.sol
File metadata and controls
36 lines (33 loc) · 902 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
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.24;
contract Test {
//rule-id:tautological-compare
function check1(uint a) external returns(bool){
return (a >= a);
}
//rule-id:tautological-compare
function check2(uint a) external returns(bool){
return (a == a);
}
//rule-id:ok
function check3(uint a, uint b) external returns(bool){
return (a <= b);
}
//rule-id:tautological-compare
function check4(uint a) external returns(bool){
return (a < a);
}
//rule-id:tautological-compare
function check5(uint a) external returns(bool){
return (a > a);
}
//rule-id:tautological-compare
function check6(uint a) external returns(bool){
return (a != a);
}
//rule-id:tautological-compare
function check7 (uint a) external {
if (a > a) {
}
}
}