Open code423n4 opened 3 years ago
itsmeSTYJ
Minor gas optimisation
function publishNewIndex(address[] memory _tokens, uint256[] memory _weights) onlyPublisher public override { // validateWeights(_tokens, _weights); // delete this if (pendingWeights.pending) { require(block.number >= pendingWeights.block + TIMELOCK_DURATION); if (auction.auctionOngoing() == false) { auction.startAuction(); emit PublishedNewIndex(publisher); } else if (auction.hasBonded()) { } else { auction.killAuction(); validateWeights(_tokens, _weights); // add here pendingWeights.tokens = _tokens; pendingWeights.weights = _weights; pendingWeights.block = block.number; } } else { validateWeights(_tokens, _weights); // add here pendingWeights.pending = true; pendingWeights.tokens = _tokens; pendingWeights.weights = _weights; pendingWeights.block = block.number; } }
Agree with the finding, saves gas in the best case
Handle
itsmeSTYJ
Vulnerability details
Impact
Minor gas optimisation
Recommended Mitigation Steps