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

0 stars 0 forks source link

function _getPrizeSplitAmount can be refactored #48

Open code423n4 opened 3 years ago

code423n4 commented 3 years ago

Handle

pauliax

Vulnerability details

Impact

If you want to save some gas you can get rid of _getPrizeSplitAmount and calculate the split directly in _distributePrizeSplits as this function is internal and is only called once so there is no actual need for reusability here and removing this extra call will make the execution cheaper.

Recommended Mitigation Steps

Consider moving the logic of _getPrizeSplitAmount directly to _distributePrizeSplits.

asselstine commented 3 years ago

https://github.com/pooltogether/v4-core/pull/238

GalloDaSballo commented 3 years ago

The sponsor applied the improvement in a subsequent PR