code-423n4 / 2022-01-livepeer-findings

0 stars 0 forks source link

Setting `uint256` variables to `0` is redundant #124

Open code423n4 opened 2 years ago

code423n4 commented 2 years ago

Handle

WatchPug

Vulnerability details

https://github.com/livepeer/arbitrum-lpt-bridge/blob/ebf68d11879c2798c5ec0735411b08d0bea4f287/contracts/L1/gateway/L1Migrator.sol#L471-L471

uint256 total = 0;

https://github.com/livepeer/arbitrum-lpt-bridge/blob/ebf68d11879c2798c5ec0735411b08d0bea4f287/contracts/L1/gateway/L1Migrator.sol#L472-L472

for (uint256 i = 0; i < _unbondingLockIds.length; i++)

Setting uint256 variables to 0 is redundant as they default to 0.

kautukkundan commented 2 years ago

fixed in https://github.com/livepeer/arbitrum-lpt-bridge/pull/61/commits/ce788ebc484e9d75d903ace592832d042f082a73