mirror of https://github.com/crytic/slither
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
580 B
30 lines
580 B
pragma solidity ^0.4.24;
|
|
|
|
library SafeMath{
|
|
function add(uint a, uint b) public returns(uint){
|
|
return a+b;
|
|
}
|
|
}
|
|
|
|
contract Target{
|
|
function f() returns(uint);
|
|
}
|
|
|
|
contract User{
|
|
|
|
using SafeMath for uint;
|
|
|
|
function test(Target t){
|
|
t.f();
|
|
|
|
// example with library usage
|
|
uint a;
|
|
a.add(0);
|
|
|
|
// The value is not used
|
|
// But the detector should not detect it
|
|
// As the value returned by the call is stored
|
|
// (unused local variable should be another issue)
|
|
uint b = a.add(1);
|
|
}
|
|
}
|
|
|