Oracle Manipulation.
users can interact with well via basic.exchange app or directly by using his own deployed smart contract
example: bad_actor can call swapTo/swapFrom/addLiquidity via his smart contract.
the bug arise when the bad_actor calls 2 Well functions in one transaction the 2 calls will use the same block.timestamp
for example:
bad_actor will call addLiquidity/swapTo/swapFrom twice with same block.timestamp in this Scenario this what will happen:
bad_actor calls addLiquidity/swapTo/swapFrom etc.. twice from call_Well function.
this will call Well functions twice (addLiquidity/addLiquidity) with same block.timestamp.
first addLiquidity call will execute _updatePumps and pumpState.lastReserves will be updated with new timestamp example: 1700000000
second addLiquidity call will execute _updatePumps but at this point the pumpState.lastReserves wont update because of this lines deltaTimestamp:
first call store pumpState.lastTimestamp 1700000000 and since the second call timestamp is also 1700000000 the deltaTimestamp will be:
1700000000 - 1700000000 -> 0
the pumpState.lastReserves not updated but the reserves in Well contract are updated which create a gap between the current Well reserves and the pump lastReserves.
according to the Docs the Pump should be updated upon each interaction with a Well adds/swaps but this can be bypassed:
Docs Link it says: "A Pump is updated upon each interaction with a Well that uses it"
and this is confirmed in IPump interface: IPump Interface
POC: Add this test is Pump.Update.t.sol
The impact is similar to these previous findings but the main difference is that these findings in Well but this bug is in update function but the idea is the same,
reservers in Well are updated but the reserves in Pump are not updated which will cause an Oracle manipulation.
According to the Docs the Pump should be updated upon each interaction with a Well adds/swaps but this can be bypassed:
Docs Link it says: "A Pump is updated upon each interaction with a Well that uses it"
and this is confirmed in IPump interface: IPump Interface
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.