EmergencyMigration misses to assign the moneyShelf role to MoneyVault.
Without the role, MoneyVault will not be able to call CrimeMoney::burn (or CrimeMoney::mint) and, conseqently, USDC withdrawal from MoneyVault will fail.
Consider MoneyVault::withdrawUSDC which requires MoneyVault to be able to call CrimeMoney::burn` for successful execution:
The following test demonstrates that
MoneyVault does not have the moneyShelf role after migration, and that
without this role, a call to MoneyVault::withdrawUSDC will revert with MoneyVault: only GodFather can receive USDC:
Note! For this test to properly work, uncomment the following line in MoneyVault, as that is another bug:
While MoneyVault lacks the moneyShelf role, all USDC funds of the Mafia will be stuck in MoneyVault.
Luckily, the godfather can mitigate the impact by performing the following steps:
Reclaim the admin rights to Kernel by executing
Note, however, that while he is the admin, Laundrette::addToTheGang and Laundrette::quitTheGang will not work.
Grant the moneyShelf role to the deployed instance of MoneyVault by executing
(and then he should give back the admin role to Laundrette by executing)
Manual review, Foundry.
The easiest solution is to deploy the MoneyVault contract together with the other contracts, in Deploy.s.sol, and grant MoneyVault the moneyShelf role while the godfather is still the admin of Kernel.
Alternatively, modify EmergencyMigration so that during the migration the moneyShelf role is granted to MoneyVault.
Godfather can add the role manually
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.