Open webthethird opened 1 year ago
What are you using is_protected
to do?
When auto-generating my differential fuzz testing contract, I'm using it to determine whether or not hevm.prank(msg.sender)
should be used before calls to the contracts-under-test. For protected functions I don't want to, since the test contract is the admin.
Describe the false alarm that Slither raise and how you know it's inaccurate:
Not a detector FP, but a FP from the
Function.is_protected
function.In Compound's CErc20 contract. The
mint(uint mintAmount)
function is being incorrectly flagged as protected. I think it is because line 1489 of function.py seesmsg.sender
in the arguments being passed into themintFresh(address minter, uint mintAmount)
internal function on line 389 of CToken.sol. Yet there are no conditional statements inmintFresh
which depend on the minter, so it should not be considered protected.Interestingly, the
redeem
,redeemUnderlying
andborrow
functions are not flagged as protected, apparently because they all castmsg.sender
to a payable address, i.e.,borrowFresh(payable(msg.sender), borrowAmount)
vs.mintFresh(msg.sender, mintAmount)
.Frequency
Very Frequently
Code example to reproduce the issue:
CErc20.sol CToken.sol