sherlock-audit / 2023-04-jojo-judging

7 stars 4 forks source link

n33k - Order sender pays trade gas fee and the cost will be huge #411

Closed sherlock-admin closed 1 year ago

sherlock-admin commented 1 year ago

n33k

high

Order sender pays trade gas fee and the cost will be huge

Summary

Trade transactions are sent by order sender, an account managed by JOJO. The trade transaction gas fees are paid by order sender instead of traders.

Vulnerability Detail

For this trading system, high volume tradings are expected which will consume JOJO considerable gas fees.

Impact

Order sender pays trading gas fee and the cost will be huge.

Code Snippet

https://github.com/sherlock-audit/2023-04-jojo/blob/main/smart-contract-EVM/contracts/impl/Perpetual.sol#L95-L110

Tool used

Manual Review

Recommendation

Measure gas fee of trade transaction and take the fee from trader.