Skip to content

executeOutstandingNextPriceSettlementsUserMulti may exceed gas limits #80

@code423n4

Description

@code423n4

Handle

0xRajeev

Vulnerability details

Impact

executeOutstandingNextPriceSettlementsUserMulti() accepts an array of marketIndexes for executing outstanding next price settlements for a user for multiple markets.

Given the complexity of the logic executed for each underlying operation, this function may either hit an OOG exception for transaction gas or perhaps exceed the block gas limit.

Proof of Concept

https://github.com/code-423n4/2021-08-floatcapital/blob/bd419abf68e775103df6e40d8f0e8d40156c2f81/contracts/contracts/LongShort.sol#L1031-L1056

Tools Used

Manual Analysis

Recommended Mitigation Steps

Profile the gas used accurately and consider capping the number of markets based on the gas required per market to avoid hitting gas limits.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions