Initial deposit can be frontrun by attacker and deposit some amount of weth and low amount of poolToken, this will bring the price of the poolToken too high depending on how much the attacker deposited.
The deposit function does not care if the initial depositor is depositing any amount of poolToken and rewards the depositor with LP tokens that are equal to the weth deposited. The price of tokens depends on the initial deposit percent only.
Attacker can manipulate the price in the pool and take advantage of the initial price to buy high amount of weth for a low amount of poolToken.
Unit test.
In the initial deposit, check if the deposited amounts are not zero.
Use price oracle to force the initial deposit to match the actual price in other pools.
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.