Closed code423n4 closed 2 years ago
Yup, good point. We will go with the option to assign return variables in order to keep the function prototype pattern/style consistent. However, this is not a gas optimization, but rather just informational.
Duplicate #2
Handle
WatchPug
Vulnerability details
Unused named returns increase contract size and gas usage at deployment.
https://github.com/XDeFi-tech/xdefi-distribution/blob/3856a42df295183b40c6eee89307308f196612fe/contracts/XDEFIDistribution.sol#L330-L335
newFundsTokenBalance_
is redundant as is never used.Other examples include:
https://github.com/XDeFi-tech/xdefi-distribution/blob/3856a42df295183b40c6eee89307308f196612fe/contracts/XDEFIDistribution.sol#L337-L345
https://github.com/XDeFi-tech/xdefi-distribution/blob/3856a42df295183b40c6eee89307308f196612fe/contracts/XDEFIDistribution.sol#L156-L159
https://github.com/XDeFi-tech/xdefi-distribution/blob/3856a42df295183b40c6eee89307308f196612fe/contracts/XDEFIDistribution.sol#L288-L291