Closed code423n4 closed 2 years ago
WatchPug
Setting uint variables to 0 is redundant as they default to 0.
uint
0
https://github.com/code-423n4/2021-12-yetifinance/blob/5f5bf61209b722ba568623d8446111b1ea5cb61c/packages/contracts/contracts/AssetWrappers/WJLP/ERC20_8.sol#L12-L12
uint public _totalSupply;
https://github.com/code-423n4/2021-12-yetifinance/blob/5f5bf61209b722ba568623d8446111b1ea5cb61c/packages/contracts/contracts/AssetWrappers/WJLP/WJLP.sol#L82-L100
constructor(string memory ERC20_symbol, string memory ERC20_name, uint8 ERC20_decimals, IERC20 _JLP, IERC20 _JOE, IMasterChefJoeV2 MasterChefJoe, uint256 poolPid) { _symbol = ERC20_symbol; _name = ERC20_name; _decimals = ERC20_decimals; _totalSupply = 0; JLP = _JLP; JOE = _JOE; _MasterChefJoe = MasterChefJoe; _poolPid = poolPid; }
Consider removing _totalSupply = 0;, make the code simpler and save some gas.
_totalSupply = 0;
Duplicate with #87
Handle
WatchPug
Vulnerability details
Setting
uint
variables to0
is redundant as they default to0
.https://github.com/code-423n4/2021-12-yetifinance/blob/5f5bf61209b722ba568623d8446111b1ea5cb61c/packages/contracts/contracts/AssetWrappers/WJLP/ERC20_8.sol#L12-L12
https://github.com/code-423n4/2021-12-yetifinance/blob/5f5bf61209b722ba568623d8446111b1ea5cb61c/packages/contracts/contracts/AssetWrappers/WJLP/WJLP.sol#L82-L100
Recommendation
Consider removing
_totalSupply = 0;
, make the code simpler and save some gas.