code-423n4 / 2022-10-traderjoe-findings

2 stars 0 forks source link

Upgraded Q -> M from #407 [1668467735071] #509

Closed c4-judge closed 1 year ago

c4-judge commented 1 year ago

Judge has assessed an item in Issue #407 as M risk. The relevant finding follows:

Incorrect parameters for _beforeTokenTransfer() hook In LBToken.sol, the _beforeTokenTransfer()` hook has the following parameters:

317: /// @param from The address of the owner of the token 318: /// @param to The address of the recipient of the token 319: /// @param id The id of the token 320: /// @param amount The amount of token of type id 321: function _beforeTokenTransfer( 322: address from, 323: address to, 324: uint256 id, 325: uint256 amount 326: ) internal virtual {} Howver, in _burn(), it is called with the following parameters:

src/LBToken.sol: 237: _beforeTokenTransfer(address(0), _account, _id, _amount); This is incorrect as the positions of address(0) and _account should be swapped.

Although this currently does not have any impact, it could potentially cause bugs to occur should _beforeTokenTransfer() overidden in future contracts.

c4-judge commented 1 year ago

GalloDaSballo marked the issue as duplicate of #108

Simon-Busch commented 1 year ago

Marked this issue as Satisfactory as requested by @GalloDaSballo