@@ -227,6 +227,8 @@ contract MOVETokenV2Test is Test {
227227 * @param other Random address to test role assignment
228228 */
229229 function testAdminRoleFuzz (address other ) public {
230+ vm.assume (other != oldFoundation);
231+ vm.assume (other != address (0 ));
230232 assertEq (move.hasRole (DEFAULT_ADMIN_ROLE, other), false );
231233
232234 vm.expectRevert (
@@ -264,8 +266,9 @@ contract MOVETokenV2Test is Test {
264266 assertEq (move.hasRole (DEFAULT_ADMIN_ROLE, labs), false );
265267
266268 // Define deprecated addresses whose balances will be burned during upgrade
267- address [] memory deprecated = new address [](1 );
269+ address [] memory deprecated = new address [](2 );
268270 deprecated[0 ] = bridge;
271+ deprecated[1 ] = address (moveProxy); // Token address
269272
270273 bytes memory initializeData =
271274 abi.encodeWithSignature ("initialize(address,address,address[]) " , labs, oldFoundation, deprecated);
@@ -277,6 +280,8 @@ contract MOVETokenV2Test is Test {
277280 initializeData
278281 );
279282
283+ console.logBytes (upgradeData);
284+
280285 vm.prank (labs);
281286 timelock.schedule (address (admin), 0 , upgradeData, bytes32 (0 ), bytes32 (0 ), minDelay);
282287
@@ -297,8 +302,9 @@ contract MOVETokenV2Test is Test {
297302 */
298303 function testUpgradeFromTimelock () public {
299304 // Define deprecated addresses whose balances will be burned during upgrade
300- address [] memory deprecated = new address [](1 );
305+ address [] memory deprecated = new address [](2 );
301306 deprecated[0 ] = bridge;
307+ deprecated[1 ] = address (moveProxy); // Token address
302308
303309 bytes memory initializeData =
304310 abi.encodeWithSignature ("initialize(address,address,address[]) " , labs, oldFoundation, deprecated);
@@ -320,13 +326,14 @@ contract MOVETokenV2Test is Test {
320326 vm.warp (block .timestamp + minDelay + 1 );
321327
322328 uint256 bridgeBalance = move.balanceOf (bridge);
329+ uint256 proxyBalance = move.balanceOf (address (moveProxy));
323330
324331 vm.prank (foundation);
325332 timelock.execute (address (admin), 0 , upgradeData, bytes32 (0 ), bytes32 (0 ));
326333
327334 // Verify V1 token state after upgrade with old interface
328335 assertEq (move.decimals (), MOVE_DECIMALS);
329- assertEq (move.totalSupply (), TOTAL_SUPPLY - bridgeBalance);
336+ assertEq (move.totalSupply (), TOTAL_SUPPLY - ( bridgeBalance + proxyBalance) );
330337 assertEq (move.balanceOf (bridge), 0 );
331338 assertEq (move.hasRole (DEFAULT_ADMIN_ROLE, oldFoundation), false );
332339 assertEq (move.hasRole (DEFAULT_ADMIN_ROLE, foundation), false );
@@ -335,7 +342,7 @@ contract MOVETokenV2Test is Test {
335342
336343 // Verify V2 token state after upgrade
337344 assertEq (move2.decimals (), 8 );
338- assertEq (move2.totalSupply (), 10000000000 * 10 ** 8 - bridgeBalance);
345+ assertEq (move2.totalSupply (), 10000000000 * 10 ** 8 - ( bridgeBalance + proxyBalance) );
339346 assertEq (move2.balanceOf (bridge), 0 );
340347 assertEq (move2.hasRole (DEFAULT_ADMIN_ROLE, oldFoundation), false );
341348 assertEq (move2.hasRole (DEFAULT_ADMIN_ROLE, foundation), false );
@@ -364,8 +371,9 @@ contract MOVETokenV2Test is Test {
364371 * including labs, oldFoundation, foundation, and proxy admin
365372 */
366373 function testCannotReinitialize2 () public {
367- address [] memory deprecated = new address [](1 );
374+ address [] memory deprecated = new address [](2 );
368375 deprecated[0 ] = bridge;
376+ deprecated[1 ] = address (moveProxy); // Token address
369377
370378 bytes memory initializeData =
371379 abi.encodeWithSignature ("initialize(address,address,address[]) " , labs, oldFoundation, deprecated);
@@ -414,6 +422,9 @@ contract MOVETokenV2Test is Test {
414422 */
415423 function testAdminRole2Fuzz (address other ) public {
416424 testUpgradeFromTimelock ();
425+ vm.assume (other != address (admin));
426+ vm.assume (other != labs);
427+ vm.assume (other != address (0 ));
417428 assertEq (move2.hasRole (DEFAULT_ADMIN_ROLE, other), false );
418429
419430 vm.prank (other);
@@ -463,6 +474,7 @@ contract MOVETokenV2Test is Test {
463474 function testDeprecatedBridge () public {
464475 testSend ();
465476 assertEq (move2.balanceOf (bridge), 0 );
477+ assertEq (move2.balanceOf (address (moveProxy)), 0 );
466478
467479 uint256 amount = 1 * 10 ** MOVE_DECIMALS;
468480 vm.prank (anchorage);
0 commit comments