DittoETH

Ditto
DeFiFoundryOracle
55,000 USDC
View results
Submission Details
Severity: low
Invalid

Gas optimization

Summary

Gas optimization

Vulnerability Details

In the given contract, the 'orderHintArray' is a struct array passed to the 'createAsk' function. The function call cost may escalate depending on the array's size due to the need for each element's memory replication. This is attributed to the significant cost associated with memory operations within the Ethereum platform.

Impact

In terms of gas costs, each additional element in the orderHintArray could potentially increase the gas cost of the createAsk function call. This is because more data needs to be processed and stored on the blockchain. If the array is very large, this could lead to high transaction costs.

Tools Used

Manual

Recommendations

To resolve this issue, you could consider using a mapping instead of an array for 'orderHintArray'. This would allow you to access elements directly without having to iterate over the entire array, thus saving gas. However, this would require a unique identifier for each order hint.

Updates

Lead Judging Commences

0xnevi Lead Judge
over 1 year ago
0xnevi Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Other

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.