Closed code423n4 closed 2 years ago
sponsor disputed. We are using gelato to manually do this within a 6 hour window. So we don't have to worry about people being asleep for this. Also it's an external call anyone can call.
This is definitely a concern, will make informational.
Gelato/Keeper etc can also have issues, it is not completely impossible.
Lines of code
https://github.com/code-423n4/2022-06-yieldy/blob/524f3b83522125fb7d4677fa7a7e5ba5a2c0fe67/src/contracts/BatchRequests.sol#L14-L27
Vulnerability details
Impact
The DAO may inadvertently cause the batched
sendWithdrawalRequests()
to fail, incurring enough delays, that the withdrawals miss the 12-hr Tokemak window, and thus miss out on expected returns.Proof of Concept
As time goes on the DAO may add new contracts to
BatchRequests.contracts
. Basic checks by callingcanBatchContracts()
will pass, but since it involves double the number of external calls,sendWithdrawalRequests()
may run out of gas and revert:https://github.com/code-423n4/2022-06-yieldy/blob/524f3b83522125fb7d4677fa7a7e5ba5a2c0fe67/src/contracts/BatchRequests.sol#L14-L27
The DAO itself has at least a three-week delay for its governance process, so
removeAddress()
can't be used to rectify the situation. The only way for things to work within the 12-hour Tokemak windows is: 1) User submitting the call tosendWithdrawalRequests()
was awake and watching it happen when it was done (i.e. wasn't asleep for 8 hours with the call having failed) 2) The user is aware that there's a 12-hour Tokemak deadline approaching 3) The user is in direct contact with the responsible DAO members and or devs 4) The parties involved quickly figure out that the DAO process is too slow, and properly identify the contracts that need withdrawal requests to be doneWithout all four steps above, there will be too many delays to have all user's funds properly re-submitted in the correct Tokemak window
Tools Used
Code inspection
Recommended Mitigation Steps
Add an offset and a count to the
sendWithdrawalRequests()
function's parameters, which would allow the splitting of the batch into multiple, smaller parts