The dependencies in the module Laundrette are defined incorrectly in the configureDependencies
function which is returned to the Kernel. The array is built incorrectly and the first dependency for the keycode MONEY is overwritten with the WEAPN keycode. This has another rather unfortunate side-effect that the module dependencies are then stored incorrectly in the Kernel contract itself. When it comes to a module change, the references stored in the Laundrette do not get updated, because the Laundrette contract does not get informed of the underlying module changes and keeps pointing to the old module implementation.
The creation of the dependencies
array within the policy Laundrette.sol
has a simple number error when adding in the second dependency which overwrites the first dependency. This means the controlling Kernel contract does not know that the Laundrette module depends on the MONEY module and won't let Laudrrette know when the module is updated.
When the MoneyShelf contract is replaced with MoneyVault, the Kernel triggers a _reconfigurePolicies
which calls all the dependent policies and triggers them to refresh their module addresses. Because the Kernel does not know the policy Laudrette uses keycode MONEY as it was overwritten, it does not call the Laundrette.configureDependencies
function, and as such, the Laundrette contract remains blissfully unaware that the MoneyShelf contract has been replaced and still points to MoneyShelf.
After an Emergency Migration, the Laundrette is still using the MoneyShelf contract. This means that gang members can still withdraw their USDC, even though the protocol should have locked them out to be only accessible by the GodFather. Now I am sure that given the emergency situation that caused the EmergencyMigration in the first place, this will result in all the gangmembers trusting in the benevolence of their GodFather and not doing anything rash, but reality dictates a rush for the exits and a draining of USDC from the original MoneyShelf and a glorious mass burning of CrimeMoney.
Here is a test script that can be slotted into the test folder highlighting the issue which can be passed with the fix suggested below.
forge test
Simply fix the line of code in Laundrette.sol (line26) to
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.