code-423n4 / 2022-01-trader-joe-findings

2 stars 0 forks source link

Remove unused variable #286

Closed code423n4 closed 2 years ago

code423n4 commented 2 years ago

Handle

Czar102

Vulnerability details

Impact

In RocketJoeToken, the _beforeTokenTransfer() function declares _amount, but never uses it. This leads to a decrease in code readability and additional, redundant stack operations.

Proof of Concept

    function _beforeTokenTransfer(
        address _from,
        address _to,
        uint256 _amount
    ) internal virtual override

Tools Used

Manual analysis Solidity compiler

Recommended Mitigation Steps

Consider not declaring the variable in the argument list.

cryptofish7 commented 2 years ago

Duplicate of #152

dmvt commented 2 years ago

Invalid. Function signature should match the parent.