According to the Documentation "Only the GodFather can withdraw and no one can deposit in this contract", but actually anyone can still deposit USDC and the GodFather can't withdraw anything from this contract leading to stuck funds.
Everyone can send USDC into this contract but no one can actually withdraw the funds anymore so all tokens are stuck.
No one is able to withdraw USDC from the MoneyVault
leading to stuck funds. If the protocol had a correct implementation of moving funds as described in the other issue: "Funds doesn't move from MoneyShelf to MoneyVault after EmergencyMigration causing the assets be unprotected", then all funds would be stuck in the MoneyVault
contract forever. Also the invariant " no one can deposit in this contract" is broken and if someone deposits into this contract the funds are stuck again.
forge test
It's not necessary for the protocol that no one can deposit USDC in this contract because the GodFather will be the only one who can withdraw anyways.
The MoneyVault
should let the Godfather withdraw directly without calling the Laundrette
, so we need these adjustments:
Because the Godfather is the only one who should receive USDC we can check for msg.sender and remove the address account and address to from the function.
We check if the msg.sender is equal to the executor
We can skip the withdraw function because we don't need to update the balance of the accounts that deposited, we only want the money.
We don't need to burn the crimeMoney token because this has no value right ? We only care about getting the USDC.
We check that the the input amount doesn't exceed the available balance.
Then we transfer to the msg.sender which is the Godfather.
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.