DeFiFoundry
60,000 USDC
View results
Submission Details
Severity: low
Valid

`TradingAccountBranch::createTradingAccountAndMulticall` handles msg.value incorrectly

Summary

Multicall functions preverse msg.value over calls, which leads erreneous execution if the payloader intends to deal with different msg.value for each call.

Vulnerability Details

TradingAccountBranch::createTradingAccountAndMulticall is a multicall function which enable traders to perform several calls in a single transaction by providing the correct data payload. This includes sending ether as seen by the payable modifier.
The problem is if the payload intends to deal with different amount of eth for each call, the call will be erreneous as msg.value will persist over calls. All the msg.value to be distributed will be thesame.

Area of interest: https://github.com/Cyfrin/2024-07-zaros/blob/69ccf428b745058bea08804b3f3d961d31406ba8/src/perpetuals/branches/TradingAccountBranch.sol#L285-L294

Impact

Incorrect accounting.

Tools Used

Manual

Recommendations

Please use solodit for a broader context and alternative approach to the desired action.

Updates

Lead Judging Commences

inallhonesty Lead Judge about 1 year ago
Submission Judgement Published
Validated
Assigned finding tags:

`createTradingAccountAndMulticall` shouldn't be payable

Support

FAQs

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