For a function, when multiple inputs are arrays, and their items correspond to each other, the lengths of these arrays should be checked to be the same.
[L-04] MISSING CHECK FOR TRANSFERFROM RETURN VALUE OR SAFETRANSFERFROM CAN BE USED INSTEAD
To monitor token transfers that may fail silently, the return value of transferFrom can be checked. Alternatively, safeTransferFrom can be used instead of transferFrom.
To improve readability and maintainability, the same code that are used in multiple functions can be in a reusable modifier.
src\modules\Buyout.sol:318-326 ->
src\modules\Buyout.sol:350-358 ->
src\modules\Buyout.sol:386-394 ->
src\modules\Buyout.sol:423-431 ->
// Reverts if address is not a registered vault
(, uint256 id) = IVaultRegistry(registry).vaultToToken(_vault);
if (id == 0) revert NotVault(_vault);
// Reverts if auction state is not successful
(, address proposer, State current, , , ) = this.buyoutInfo(_vault);
State required = State.SUCCESS;
if (current != required) revert InvalidState(required, current);
// Reverts if caller is not the auction winner
if (msg.sender != proposer) revert NotWinner();
[L-01] MISSING CHECKS FOR INPUT ARRAY LENGTHS
For a function, when multiple inputs are arrays, and their items correspond to each other, the lengths of these arrays should be checked to be the same.
[L-02] MISSING ZERO-ADDRESS CHECK
Addresses should be checked against address(0).
[L-03] CONSTANTS CAN BE USED INSTEAD OF MAGIC NUMBERS
To improve readability and maintainability, constants can be used instead of magic numbers.
[L-04] MISSING CHECK FOR TRANSFERFROM RETURN VALUE OR SAFETRANSFERFROM CAN BE USED INSTEAD
To monitor token transfers that may fail silently, the return value of
transferFrom
can be checked. Alternatively,safeTransferFrom
can be used instead oftransferFrom
.[L-05] SAME CODE CAN BE IN REUSABLE MODIFIER
To improve readability and maintainability, the same code that are used in multiple functions can be in a reusable modifier.
[N-01] MISSING INDEXED EVENT FIELDS
The following event is missing indexed fields:
[N-02] LOWER CASE LETTERS ARE USED FOR CONSTANTS
As a best practice, only capital letters should be used for constants.