0

Here is the file which i try to run test through foundry.

//Imports
import "forge-std/Test.sol";
import {Portal} from "../src/Portal.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {StdCheatsSafe} from "forge-std/StdCheats.sol" ;



 function testDust() public {

        IERC20 LocalHLP = IERC20(0x4307fbDCD9Ec7AEA5a1c2958deCaa6f316952bAb);


        address bob = makeAddr("bob");
        deal(LocalHLP , bob , 10000e18 ,);
        portal.contributeFunding(1000e18);

        address alice = makeAddr("alice");
        deal(IERC20(LocalHLP) , address(alice) , 1000000e18);
        portal.contributeFunding(10000e18);

        address Gary = makeAddr("Gary");
        deal(LocalHLP , Gary , 100000e18 );
        portal.contributeFunding(10000e18);

        address ajax = makeAddr("ajax");
        deal(LocalHLP , ajax , 10000e18);
        portal.contributeFunding(1000e18);
}

Error

 forge build                                                                                          1 ⨯ 1 ⚙
[⠒] Compiling...
[⠰] Compiling 49 files with 0.8.20
[⠔] Solc 0.8.20 finished in 1.23s
Error: 
Compiler run failed:
Error (9322): No matching declaration found after argument-dependent lookup.
  --> test/DustCheck.t.sol:38:9:
   |
38 |         deal(LocalHLP , bob , 10000e18 ,true );
   |         ^^^^

I tried many ways but no use, is there any solution for this or something to change in test function.

1 Answer 1

1
  1. Try to use vm.deal()
  2. Also try put the function testDust() public in contract ContractTest is Test {}
  3. deal(address(LocalHLP) , bob , 10000e18 ,);
2
  • First one worked. But it's giving another error. Wrong argument count for function call: 3 arguments given but expected 2. --> test/DustCheck.t.sol:38:9: | 38 | vm.deal(address(LocalHLP) , bob , 10000e18); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Nov 19 at 3:45
  • Thanks for answer 1 and 3 worked. but 3. should be like this ``` deal(address(LocalHLP) , bob , 10000e18 ); ``` Nov 19 at 4:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.