mirror of https://github.com/crytic/slither
add support for enum max/min members, fix min member on elementary (#1276)
parent
63a154fbb0
commit
98e6d8c13e
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,5 +1,3 @@ |
||||
{ |
||||
"C": { |
||||
"f()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: NEW VARIABLE 1\n\"];\n}\n" |
||||
} |
||||
"MinMax": {} |
||||
} |
@ -1,5 +1,3 @@ |
||||
{ |
||||
"C": { |
||||
"f()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: NEW VARIABLE 1\n\"];\n}\n" |
||||
} |
||||
"MinMax": {} |
||||
} |
@ -1,5 +1,3 @@ |
||||
{ |
||||
"C": { |
||||
"f()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: NEW VARIABLE 1\n\"];\n}\n" |
||||
} |
||||
"MinMax": {} |
||||
} |
@ -1,5 +1,3 @@ |
||||
{ |
||||
"C": { |
||||
"f()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: NEW VARIABLE 1\n\"];\n}\n" |
||||
} |
||||
"MinMax": {} |
||||
} |
@ -1,5 +1,3 @@ |
||||
{ |
||||
"C": { |
||||
"f()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: NEW VARIABLE 1\n\"];\n}\n" |
||||
} |
||||
"MinMax": {} |
||||
} |
@ -1,5 +1,3 @@ |
||||
{ |
||||
"C": { |
||||
"f()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: NEW VARIABLE 1\n\"];\n}\n" |
||||
} |
||||
"MinMax": {} |
||||
} |
@ -1,5 +1,3 @@ |
||||
{ |
||||
"C": { |
||||
"f()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: NEW VARIABLE 1\n\"];\n}\n" |
||||
} |
||||
"MinMax": {} |
||||
} |
@ -1,5 +1,3 @@ |
||||
{ |
||||
"C": { |
||||
"f()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: NEW VARIABLE 1\n\"];\n}\n" |
||||
} |
||||
"MinMax": {} |
||||
} |
@ -1,5 +1,3 @@ |
||||
{ |
||||
"C": { |
||||
"f()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: NEW VARIABLE 1\n\"];\n}\n" |
||||
} |
||||
"MinMax": {} |
||||
} |
@ -1,5 +1,3 @@ |
||||
{ |
||||
"C": { |
||||
"f()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: NEW VARIABLE 1\n\"];\n}\n" |
||||
} |
||||
"MinMax": {} |
||||
} |
@ -1,5 +1,3 @@ |
||||
{ |
||||
"C": { |
||||
"f()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: NEW VARIABLE 1\n\"];\n}\n" |
||||
} |
||||
"MinMax": {} |
||||
} |
@ -1,5 +1,3 @@ |
||||
{ |
||||
"C": { |
||||
"f()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: NEW VARIABLE 1\n\"];\n}\n" |
||||
} |
||||
"MinMax": {} |
||||
} |
@ -1,5 +1,3 @@ |
||||
{ |
||||
"C": { |
||||
"f()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: NEW VARIABLE 1\n\"];\n}\n" |
||||
} |
||||
"MinMax": {} |
||||
} |
@ -1,5 +1,3 @@ |
||||
{ |
||||
"C": { |
||||
"f()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: NEW VARIABLE 1\n\"];\n}\n" |
||||
} |
||||
"MinMax": {} |
||||
} |
@ -1,5 +1,3 @@ |
||||
{ |
||||
"C": { |
||||
"f()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: NEW VARIABLE 1\n\"];\n}\n" |
||||
} |
||||
"MinMax": {} |
||||
} |
@ -1,5 +1,3 @@ |
||||
{ |
||||
"C": { |
||||
"f()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: NEW VARIABLE 1\n\"];\n}\n" |
||||
} |
||||
"MinMax": {} |
||||
} |
@ -1,5 +1,3 @@ |
||||
{ |
||||
"C": { |
||||
"f()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: NEW VARIABLE 1\n\"];\n}\n" |
||||
} |
||||
"MinMax": {} |
||||
} |
@ -1,5 +1,3 @@ |
||||
{ |
||||
"C": { |
||||
"f()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: NEW VARIABLE 1\n\"];\n}\n" |
||||
} |
||||
"MinMax": {} |
||||
} |
@ -1,5 +1,3 @@ |
||||
{ |
||||
"C": { |
||||
"f()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: NEW VARIABLE 1\n\"];\n}\n" |
||||
} |
||||
"MinMax": {} |
||||
} |
@ -1,5 +1,3 @@ |
||||
{ |
||||
"C": { |
||||
"f()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: NEW VARIABLE 1\n\"];\n}\n" |
||||
} |
||||
"MinMax": {} |
||||
} |
@ -1,5 +1,3 @@ |
||||
{ |
||||
"C": { |
||||
"f()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: NEW VARIABLE 1\n\"];\n}\n" |
||||
} |
||||
"MinMax": {} |
||||
} |
@ -1,5 +1,3 @@ |
||||
{ |
||||
"C": { |
||||
"f()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: NEW VARIABLE 1\n\"];\n}\n" |
||||
} |
||||
"MinMax": {} |
||||
} |
@ -1,5 +1,3 @@ |
||||
{ |
||||
"C": { |
||||
"f()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: NEW VARIABLE 1\n\"];\n}\n" |
||||
} |
||||
"MinMax": {} |
||||
} |
@ -1,5 +1,3 @@ |
||||
{ |
||||
"C": { |
||||
"f()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: NEW VARIABLE 1\n\"];\n}\n" |
||||
} |
||||
"MinMax": {} |
||||
} |
@ -1,5 +1,3 @@ |
||||
{ |
||||
"C": { |
||||
"f()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: NEW VARIABLE 1\n\"];\n}\n" |
||||
} |
||||
"MinMax": {} |
||||
} |
@ -1,5 +1,3 @@ |
||||
{ |
||||
"C": { |
||||
"f()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: NEW VARIABLE 1\n\"];\n}\n" |
||||
} |
||||
"MinMax": {} |
||||
} |
@ -1,5 +1,3 @@ |
||||
{ |
||||
"C": { |
||||
"f()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: NEW VARIABLE 1\n\"];\n}\n" |
||||
} |
||||
"MinMax": {} |
||||
} |
@ -1,5 +1,3 @@ |
||||
{ |
||||
"C": { |
||||
"f()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: NEW VARIABLE 1\n\"];\n}\n" |
||||
} |
||||
"MinMax": {} |
||||
} |
@ -1,5 +1,3 @@ |
||||
{ |
||||
"C": { |
||||
"f()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: NEW VARIABLE 1\n\"];\n}\n" |
||||
} |
||||
"MinMax": {} |
||||
} |
@ -1,5 +1,3 @@ |
||||
{ |
||||
"C": { |
||||
"f()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: NEW VARIABLE 1\n\"];\n}\n" |
||||
} |
||||
"MinMax": {} |
||||
} |
@ -1,5 +1,3 @@ |
||||
{ |
||||
"C": { |
||||
"f()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: NEW VARIABLE 1\n\"];\n}\n" |
||||
} |
||||
"MinMax": {} |
||||
} |
@ -0,0 +1,7 @@ |
||||
{ |
||||
"MinMax": { |
||||
"constructor()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: EXPRESSION 1\n\"];\n1->2;\n2[label=\"Node Type: EXPRESSION 2\n\"];\n2->3;\n3[label=\"Node Type: EXPRESSION 3\n\"];\n3->4;\n4[label=\"Node Type: EXPRESSION 4\n\"];\n}\n", |
||||
"min()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: RETURN 1\n\"];\n}\n", |
||||
"max()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: RETURN 1\n\"];\n}\n" |
||||
} |
||||
} |
@ -0,0 +1,7 @@ |
||||
{ |
||||
"MinMax": { |
||||
"constructor()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: EXPRESSION 1\n\"];\n1->2;\n2[label=\"Node Type: EXPRESSION 2\n\"];\n2->3;\n3[label=\"Node Type: EXPRESSION 3\n\"];\n3->4;\n4[label=\"Node Type: EXPRESSION 4\n\"];\n}\n", |
||||
"min()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: RETURN 1\n\"];\n}\n", |
||||
"max()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: RETURN 1\n\"];\n}\n" |
||||
} |
||||
} |
@ -0,0 +1,7 @@ |
||||
{ |
||||
"MinMax": { |
||||
"constructor()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: EXPRESSION 1\n\"];\n1->2;\n2[label=\"Node Type: EXPRESSION 2\n\"];\n2->3;\n3[label=\"Node Type: EXPRESSION 3\n\"];\n3->4;\n4[label=\"Node Type: EXPRESSION 4\n\"];\n}\n", |
||||
"min()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: RETURN 1\n\"];\n}\n", |
||||
"max()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: RETURN 1\n\"];\n}\n" |
||||
} |
||||
} |
@ -0,0 +1,7 @@ |
||||
{ |
||||
"MinMax": { |
||||
"constructor()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: EXPRESSION 1\n\"];\n1->2;\n2[label=\"Node Type: EXPRESSION 2\n\"];\n2->3;\n3[label=\"Node Type: EXPRESSION 3\n\"];\n3->4;\n4[label=\"Node Type: EXPRESSION 4\n\"];\n}\n", |
||||
"min()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: RETURN 1\n\"];\n}\n", |
||||
"max()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: RETURN 1\n\"];\n}\n" |
||||
} |
||||
} |
@ -0,0 +1,7 @@ |
||||
{ |
||||
"MinMax": { |
||||
"constructor()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: EXPRESSION 1\n\"];\n1->2;\n2[label=\"Node Type: EXPRESSION 2\n\"];\n2->3;\n3[label=\"Node Type: EXPRESSION 3\n\"];\n3->4;\n4[label=\"Node Type: EXPRESSION 4\n\"];\n}\n", |
||||
"min()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: RETURN 1\n\"];\n}\n", |
||||
"max()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: RETURN 1\n\"];\n}\n" |
||||
} |
||||
} |
@ -0,0 +1,7 @@ |
||||
{ |
||||
"MinMax": { |
||||
"constructor()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: EXPRESSION 1\n\"];\n1->2;\n2[label=\"Node Type: EXPRESSION 2\n\"];\n2->3;\n3[label=\"Node Type: EXPRESSION 3\n\"];\n3->4;\n4[label=\"Node Type: EXPRESSION 4\n\"];\n}\n", |
||||
"min()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: RETURN 1\n\"];\n}\n", |
||||
"max()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: RETURN 1\n\"];\n}\n" |
||||
} |
||||
} |
@ -0,0 +1,7 @@ |
||||
{ |
||||
"MinMax": { |
||||
"constructor()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: EXPRESSION 1\n\"];\n1->2;\n2[label=\"Node Type: EXPRESSION 2\n\"];\n2->3;\n3[label=\"Node Type: EXPRESSION 3\n\"];\n3->4;\n4[label=\"Node Type: EXPRESSION 4\n\"];\n}\n", |
||||
"min()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: RETURN 1\n\"];\n}\n", |
||||
"max()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: RETURN 1\n\"];\n}\n" |
||||
} |
||||
} |
@ -0,0 +1,7 @@ |
||||
{ |
||||
"MinMax": { |
||||
"constructor()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: EXPRESSION 1\n\"];\n1->2;\n2[label=\"Node Type: EXPRESSION 2\n\"];\n2->3;\n3[label=\"Node Type: EXPRESSION 3\n\"];\n3->4;\n4[label=\"Node Type: EXPRESSION 4\n\"];\n}\n", |
||||
"min()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: RETURN 1\n\"];\n}\n", |
||||
"max()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: RETURN 1\n\"];\n}\n" |
||||
} |
||||
} |
@ -1,9 +1,13 @@ |
||||
contract C{ |
||||
|
||||
function f() public{ |
||||
|
||||
contract MinMax { |
||||
uint a = type(uint).max; |
||||
uint b = type(uint).min; |
||||
|
||||
} |
||||
int constant c = type(int).max; |
||||
int constant d = type(int).min; |
||||
|
||||
uint8 immutable i =type(uint8).max; |
||||
uint8 immutable j = type(uint8).min; |
||||
|
||||
} |
||||
|
@ -0,0 +1,29 @@ |
||||
enum Enum { A, B, C, D } |
||||
|
||||
contract MinMax { |
||||
uint a = type(uint).max; |
||||
uint b = type(uint).min; |
||||
uint c = uint(type(Enum).min); |
||||
uint d = uint(type(Enum).max); |
||||
|
||||
int constant e = type(int).max; |
||||
int constant f = type(int).min; |
||||
uint constant g = uint(type(Enum).max); |
||||
uint constant h = uint(type(Enum).min); |
||||
|
||||
uint8 immutable i; |
||||
uint8 immutable j; |
||||
uint immutable k; |
||||
uint immutable l; |
||||
|
||||
constructor() { |
||||
i = type(uint8).max; |
||||
j = type(uint8).min; |
||||
k = uint(type(Enum).max); |
||||
l = uint(type(Enum).min); |
||||
} |
||||
|
||||
function min() public returns(uint) { return uint(type(Enum).min); } |
||||
function max() public returns(uint) { return uint(type(Enum).max); } |
||||
} |
||||
|
Loading…
Reference in new issue