You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I had originally believed that these typecasts were necessary. However, I was disproven in issues #9, #11, #13, #14.
There are nine unnecessary typecasts to uint256. If you would prefer to keep them, then there are four places where they are missing.
It would improve readability of code to either consistently include or remove these typecasts.
Scenario
It appears that typecasting smaller uint's into uint256 is unnecessary. In issues #9, #11, #13, #14, I pointed out four places where Offers.sol failed to typecast uint128 and uint64 variables into uint256. However, it was pointed out that these are unnecessary, because:
Such cast is not required as it's converting from a smaller magnitude to a bigger one
If this is so, then there are nine unnecessary uint256 typecast conversions in Offers.sol.
Impact
Low/Note:
(1) Better consistency/readability of code.
(2) I do not know if removing unnecessary typecasts in this circumstance saves any gas. If it does, there's an additional benefit there, but I do not think that it does.
Reproduction
The following nine lines have unnecessary typecasts up to uint256:
Description
I had originally believed that these typecasts were necessary. However, I was disproven in issues #9, #11, #13, #14.
There are nine unnecessary typecasts to uint256. If you would prefer to keep them, then there are four places where they are missing.
It would improve readability of code to either consistently include or remove these typecasts.
Scenario
It appears that typecasting smaller uint's into uint256 is unnecessary. In issues #9, #11, #13, #14, I pointed out four places where
Offers.sol
failed to typecast uint128 and uint64 variables into uint256. However, it was pointed out that these are unnecessary, because:If this is so, then there are nine unnecessary uint256 typecast conversions in
Offers.sol
.Impact
Low/Note:
(1) Better consistency/readability of code.
(2) I do not know if removing unnecessary typecasts in this circumstance saves any gas. If it does, there's an additional benefit there, but I do not think that it does.
Reproduction
The following nine lines have unnecessary typecasts up to uint256:
If you would prefer to keep them, there are four missing typecasts to uint256:
Fix
If you would prefer to remove the unnecessary uint256 typecasts, remove them like so:
If you would like to keep all uint256 typecasts where they are not strictly needed, add them like so:
The text was updated successfully, but these errors were encountered: