Check addresses when using solmate's safeTransferLib
This project makes use of a modified version of a solmate library. The safeTransferLib library does not perform verification on addresses, specifically whether a token address actually contains code. This means that misuse of this function could result in assets being transferred to incompatible accounts. When this occurs, the transaction will not revert and the function call will not return false.
It is advised to manually verify function arguments when using this library.
Developer notes should be removed from production code
Comments in production code should not contain developer discussion or notes about known bugs or problems. These issues should be tracked elsewhere and resolved before being deployed.
Comments of this kind can also indicate potential avenues of attack for an adversary.
The following lines are affected:
2022-07-swivel/Swivel/Swivel.sol:120: // TODO cheaper to assign amount here or keep the ADD?
2022-07-swivel/Swivel/Swivel.sol:157: // TODO assign amount or keep the ADD?
2022-07-swivel/Swivel/Swivel.sol:192: // TODO assign amount or keep the ADD?
2022-07-swivel/Swivel/Swivel.sol:221: // TODO assign amount or keep ADD?
2022-07-swivel/Swivel/Swivel.sol:286: // TODO assign amount or keep the ADD?
2022-07-swivel/Swivel/Swivel.sol:317: // TODO assign amount or keep the ADD?
2022-07-swivel/Swivel/Swivel.sol:33: address public aaveAddr; // TODO immutable?
2022-07-swivel/Swivel/Swivel.sol:347: // TODO assign amount or keep the ADD?
2022-07-swivel/Swivel/Swivel.sol:382: // TODO assign amount or keep the ADD?
2022-07-swivel/Swivel/Swivel.sol:707: // TODO as stated elsewhere, we may choose to simply return true in all and not attempt to measure against any expected return
2022-07-swivel/Swivel/Swivel.sol:716: // TODO explain the Aave deposit args
2022-07-swivel/Swivel/Swivel.sol:721: // TODO explain the 0 (primary account)
2022-07-swivel/Swivel/Swivel.sol:740: // TODO as stated elsewhere, we may choose to simply return true in all and not attempt to measure against any expected return
2022-07-swivel/Swivel/Swivel.sol:741: if (p == uint8(Protocols.Compound)) { // TODO is Rari a drop in here?
2022-07-swivel/Swivel/Swivel.sol:748: // TODO explain the withdraw args
2022-07-swivel/Swivel/Swivel.sol:752: // TODO explain the 0
low hanging "TODO" that may be there in future versions, normally considerations / acknowledgements. It gives people a view into our current thought processes.
Low Severity Findings
Check addresses when using solmate's
safeTransferLib
This project makes use of a modified version of a solmate library. The
safeTransferLib
library does not perform verification on addresses, specifically whether a token address actually contains code. This means that misuse of this function could result in assets being transferred to incompatible accounts. When this occurs, the transaction will not revert and the function call will not return false.It is advised to manually verify function arguments when using this library.
Reference:
The following lines of code are affected. The code proceeding these lines should be modified to include checks before these function calls:
QA
Developer notes should be removed from production code
Comments in production code should not contain developer discussion or notes about known bugs or problems. These issues should be tracked elsewhere and resolved before being deployed.
Comments of this kind can also indicate potential avenues of attack for an adversary.
The following lines are affected: