mirror of https://github.com/crytic/slither
parent
1c869df9e9
commit
2ee6d0a4c8
Binary file not shown.
Binary file not shown.
@ -0,0 +1,8 @@ |
||||
{ |
||||
"Lib": { |
||||
"a(Data,uint256)": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: RETURN 1\n\"];\n}\n" |
||||
}, |
||||
"C": { |
||||
"libCall(uint256)": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: EXPRESSION 1\n\"];\n}\n" |
||||
} |
||||
} |
@ -0,0 +1,8 @@ |
||||
{ |
||||
"Lib": { |
||||
"f(St,uint256)": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: RETURN 1\n\"];\n}\n" |
||||
}, |
||||
"C": { |
||||
"libCall(uint16)": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: RETURN 1\n\"];\n}\n" |
||||
} |
||||
} |
@ -0,0 +1,27 @@ |
||||
using {a} for Data; |
||||
|
||||
struct Data { mapping(uint => bool) flags; } |
||||
|
||||
function a(Data storage self, uint value, uint value2) returns(bool){ |
||||
return false; |
||||
} |
||||
|
||||
library Lib { |
||||
function a(Data storage self, uint value) public |
||||
view |
||||
returns (bool) |
||||
{ |
||||
return true; |
||||
} |
||||
|
||||
} |
||||
|
||||
contract C { |
||||
using Lib for Data; |
||||
Data knownValues; |
||||
|
||||
function libCall(uint value) public { |
||||
require(knownValues.a(value)); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,25 @@ |
||||
using {f} for St; |
||||
struct St { uint field; } |
||||
|
||||
|
||||
function f(St storage self, uint8 v) view returns(uint){ |
||||
return 0; |
||||
} |
||||
|
||||
|
||||
library Lib { |
||||
function f(St storage self, uint256 v) public view returns (uint) { |
||||
return 1; |
||||
} |
||||
|
||||
} |
||||
|
||||
contract C { |
||||
using Lib for St; |
||||
St st; |
||||
|
||||
function libCall(uint16 v) public view returns(uint){ |
||||
return st.f(v); // return 1 |
||||
} |
||||
|
||||
} |
Loading…
Reference in new issue