code-423n4 / 2021-09-defiprotocol-findings

1 stars 0 forks source link

Gas Optimization Via Slot Consolidation #166

Closed code423n4 closed 2 years ago

code423n4 commented 2 years ago

Handle

leastwood

Vulnerability details

Impact

There are a number of bools in Auction.sol which can be combined to fit into a single slot. This saves gas on each deployment of the Auction.sol contract.

Proof of Concept

https://github.com/code-423n4/2021-09-defiProtocol/blob/main/contracts/contracts/Auction.sol#L16-L21

Tools Used

Manual code review

Recommended Mitigation Steps

Consider implementing proper slot packing in all contracts.

GalloDaSballo commented 2 years ago

Duplicate of #109