It is recommended to always use OpenZeppelin's SafeERC20 library, for example :
Swivel/Swivel.sol:359: Safe.safeTransfer(uToken, o.maker, a - premiumFilled);
Use two-step transfer pattern for access controls
Contracts that implement access control, e.g. admin, should consider implementing a two-step transfer pattern.
Otherwise, it is possible that the role mistakenly transfers ownership to the wrong address, resulting in losing the role.
It is recommended separate the ownership transfer into 2 functions, first to set a pending owner, and second to approve the pending admin set using the first function and actually implementing the change of the ownership.
Unspecific compiler version pragma
Information : L003 - Unspecific Compiler Version Pragma Consensys Audit of 1inch Solidity docs
Instances include :
Recommendation
It is recommended to use a concrete compiler version, for example :
Unsafe ERC20 Operation(s)
Information : L001 - Unsafe ERC20 Operation(s)
Instances include :
Recommendation
It is recommended to always use OpenZeppelin's
SafeERC20
library, for example :Use two-step transfer pattern for access controls
Contracts that implement access control, e.g.
admin
, should consider implementing a two-step transfer pattern. Otherwise, it is possible that the role mistakenly transfers ownership to the wrong address, resulting in losing the role.Instances include :
https://github.com/code-423n4/2022-07-swivel/blob/main/Marketplace/MarketPlace.sol#L53-L56 https://github.com/code-423n4/2022-07-swivel/blob/main/Swivel/Swivel.sol#L428-L432 https://github.com/code-423n4/2022-07-swivel/blob/main/Creator/Creator.sol#L47-L50
Recommendation
It is recommended separate the ownership transfer into 2 functions, first to set a pending owner, and second to approve the pending admin set using the first function and actually implementing the change of the ownership.