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

2 stars 0 forks source link

Redundant type casting #235

Open code423n4 opened 2 years ago

code423n4 commented 2 years ago

Handle

WatchPug

Vulnerability details

https://github.com/code-423n4/2022-01-trader-joe/blob/a1579f6453bc4bf9fb0db9c627beaa41135438ed/contracts/LaunchEvent.sol#L82-L82

IJoeFactory private factory;

https://github.com/code-423n4/2022-01-trader-joe/blob/a1579f6453bc4bf9fb0db9c627beaa41135438ed/contracts/LaunchEvent.sol#L385-L385

IJoeFactory(factory).getPair(wavaxAddress, tokenAddress)

factory is defined as IJoeFactory already, the type casting is redundant.

cryptofish7 commented 2 years ago

Should be 0.

Fix: https://github.com/traderjoe-xyz/rocket-joe/pull/139

dmvt commented 2 years ago

I'm going to change this to a gas optimization since that's the only real benefit gained by making the change. I'm not sure that the change actually makes the code more clear, so non-critical doesn't really fit.