From d746ef194c25f58d0e114b1969eb94e388e07045 Mon Sep 17 00:00:00 2001 From: Roman Date: Mon, 20 Oct 2025 09:51:49 +0800 Subject: [PATCH] fix: delete MaliciousImplementation --- test/WakuRlnV2.t.sol | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/test/WakuRlnV2.t.sol b/test/WakuRlnV2.t.sol index 2116d50..6ddc3d9 100644 --- a/test/WakuRlnV2.t.sol +++ b/test/WakuRlnV2.t.sol @@ -67,24 +67,6 @@ contract NonUUPSContract { // A mock contract that does not support UUPS (no proxiable UUID or _authorizeUpgrade) } -// Malicious implementation for testing upgrade risks -// This overrides _authorizeUpgrade to allow anyone (public) and adds a drain function to steal tokens -contract MaliciousImplementation is UUPSUpgradeable, OwnableUpgradeable { - // Drain all balance of a token to caller (malicious) - function drainTokens(address token) external { - IERC20(token).transfer(msg.sender, IERC20(token).balanceOf(address(this))); - } - - // Override to allow anyone to upgrade (bypassing onlyOwner) - function _authorizeUpgrade(address newImplementation) internal override { } - - // Placeholder initializer to match layout (but malicious could ignore) - function initialize() public initializer { - __Ownable_init(); - __UUPSUpgradeable_init(); - } -} - contract WakuRlnV2Test is Test { WakuRlnV2 internal w; TestStableToken internal token;