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

0 stars 0 forks source link

Gas Optimization: Struct layout #112

Closed code423n4 closed 2 years ago

code423n4 commented 2 years ago

Handle

gzeon

Vulnerability details

Impact

https://github.com/pooltogether/v4-periphery/blob/b520faea26bcf60371012f6cb246aa149abd3c7d/contracts/interfaces/ITwabRewards.sol#L23 From 3 storage slot to 2 storage slot

    struct Promotion {
        address creator;
        address ticket;
        uint216 tokensPerEpoch;
        IERC20 token;
        uint32 startTimestamp;
        uint32 epochDuration;
        uint8 numberOfEpochs;
    }
PierrickGT commented 2 years ago

Duplicate of https://github.com/code-423n4/2021-12-pooltogether-findings/issues/12