From eeecc037f670543ddcf32d3884d6b2b3e3c25d4c Mon Sep 17 00:00:00 2001 From: DhairyaSethi <55102840+DhairyaSethi@users.noreply.github.com> Date: Wed, 30 Aug 2023 14:43:42 +0530 Subject: [PATCH] fix: fuzz inputs --- test/PolygonMigration.t.sol | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/test/PolygonMigration.t.sol b/test/PolygonMigration.t.sol index 9b4c7c1..a0fb90a 100644 --- a/test/PolygonMigration.t.sol +++ b/test/PolygonMigration.t.sol @@ -42,7 +42,11 @@ contract PolygonMigrationTest is Test { } function test_Migrate(address user, uint256 amount) external { - vm.assume(amount <= 10000000000 * 10 ** 18 && user != address(0)); + vm.assume( + amount <= 10000000000 * 10 ** 18 && + user != address(0) && + user != address(migration) + ); matic.mint(user, amount); vm.startPrank(user); matic.approve(address(migration), amount); @@ -134,14 +138,15 @@ contract PolygonMigrationTest is Test { uint256 amount, uint256 amount2 ) external { + address user; vm.assume( privKey != 0 && privKey < 115792089237316195423570985008687907852837564279074904382605163141518161494337 && + (user = vm.addr(privKey)) != address(migration) && amount <= 10000000000 * 10 ** 18 && amount2 <= amount ); - address user = vm.addr(privKey); matic.mint(user, amount); vm.startPrank(user); matic.approve(address(migration), amount);