Description:
The function TradingAccount::createTradingAccountAndMulticall
is marked as payable
, potentially leading to users mistakenly depositing Ether into the protocol when creating an account with the Multicall functionality. Since msg.value
is ignored, any Ether sent to this function will be permanently locked in the contract.
Impact:
If users mistakenly send Ether when calling this function, the Ether will be irretrievably locked in the contract, leading to:
Loss of Funds: Users may unintentionally lose their Ether by sending it to a function that does not process it.
User Frustration: Users who mistakenly send Ether may become frustrated with the platform, potentially leading to a loss of trust and a decrease in user retention.
Proof of Concept:
A proof of concept would involve calling the createTradingAccountAndMulticall
function and sending Ether along with the call. The Ether sent will not be processed and will be stuck in the contract.
Recommended Mitigation:
Remove the payable
modifier from the createTradingAccountAndMulticall
function to address this issue. This will prevent users from mistakenly sending Ether to the function.
Additionally, you can add a withdraw function to enable users who have deposited Ether to withdraw.
By implementing this change, the risk of Ether being mistakenly sent and stuck in the contract will be eliminated, thereby protecting user funds and maintaining the integrity of the protocol.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.