Skip to content
Request an audit

‹ Findings database

Structs can be packed to save gas

Low/InfoNftperp Exchange audit·Three Sigma·NFT perpetuals·2nd January, 20243S-NFTPerp-N04

Description

In solidity, structs can often be packed into fewer words to save gas on storage loads/stores. In the code, the following structs can be optimized in this way: LimitOrder, TriggerOrder, TwapInputAsset, MarketOrder.

Recommendation

Reorder the variables in these structs to pack them together.

Status

Acknowledged