Static Analyzer for Solidity
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.
 
 
 
 
slither/tests/unused_return.sol

30 lines
596 B

//pragma solidity ^0.4.24;
library SafeMath{
function add(uint a, uint b) public returns(uint){
return a+b;
}
}
contract Target{
function f() public returns(uint);
}
contract User{
using SafeMath for uint;
function test(Target t) public{
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);
}
}