Sovryn-smart-contracts icon indicating copy to clipboard operation
Sovryn-smart-contracts copied to clipboard

Remove unused variables

Open tjcloa opened this issue 3 years ago • 2 comments

such as the mapping underlyingAsset -> loanPool suggestion: use static analysis tools to discover those

tjcloa avatar Jun 30 '21 08:06 tjcloa

$ find . -type f ! -path '*node_modules/*' -print0 | xargs -0 egrep -inH "underlyingAsset"
./oracle-based-amm/rbtcwrapperproxy/contracts/RBTCWrapperProxy.sol:465:        IERC20Token underlyingAsset = IERC20Token(loanToken.loanTokenAddress());
./oracle-based-amm/rbtcwrapperproxy/contracts/RBTCWrapperProxy.sol:468:        require(underlyingAsset.transferFrom(msg.sender, address(this), depositAmount), "Failed to transfer tokens to the wrapper proxy");
./oracle-based-amm/rbtcwrapperproxy/contracts/RBTCWrapperProxy.sol:471:        underlyingAsset.approve(loanTokenAddress, depositAmount);

computerphysicslab avatar Jul 05 '21 10:07 computerphysicslab

I'm trying to use slither to perform solidity static analysis to discover unused variables but it is failing due to an old syntax on the pragma:

# old, fails w/ slither
pragma solidity ^0.5.17;

# new, Ok w/ slither
pragma solidity >=0.5.17;

computerphysicslab avatar Jul 05 '21 10:07 computerphysicslab