code-423n4 / 2021-06-pooltogether-findings

0 stars 0 forks source link

Gas savings on uninitialized variables. #101

Open code423n4 opened 3 years ago

code423n4 commented 3 years ago

Handle

tensors

Vulnerability details

Impact

Uninitialized variables initialize to 0 automatically. No need to explicitly initialize it.

Proof of concept

https://github.com/pooltogether/aave-yield-source/blob/bc65c875f62235b7af55ede92231a495ba091a47/contracts/yield-source/ATokenYieldSource.sol#L141

Recommended mitigation steps

Replace with: uint256 shares;

PierrickGT commented 3 years ago

PR: https://github.com/pooltogether/aave-yield-source/pull/16