Using shift operators can save gas #145
Labels
bug
Something isn't working
duplicate
This issue or pull request already exists
G (Gas Optimization)
sponsor confirmed
Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity")
Handle
WatchPug
Vulnerability details
_pointsMultiplier
multiplication and division can be replaced with shift operators to save gas.The gas cost of
<<
and>>
is3
while*
and/
costs5
.https://github.com/XDeFi-tech/xdefi-distribution/blob/3856a42df295183b40c6eee89307308f196612fe/contracts/XDEFIDistribution.sol#L17-L17
https://github.com/XDeFi-tech/xdefi-distribution/blob/3856a42df295183b40c6eee89307308f196612fe/contracts/XDEFIDistribution.sol#L151-L152
https://github.com/XDeFi-tech/xdefi-distribution/blob/3856a42df295183b40c6eee89307308f196612fe/contracts/XDEFIDistribution.sol#L337-L345
Recommendation
Change to:
The text was updated successfully, but these errors were encountered: