DistributedCollective / Sovryn-smart-contracts

Smart contracts for the Sovryn protocol and external integrations
https://live.sovryn.app/
Apache License 2.0
124 stars 46 forks source link

Remove unused variables #302

Open tjcloa opened 3 years ago

tjcloa commented 3 years ago

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

computerphysicslab commented 3 years ago
$ 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 commented 3 years ago

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;