I am trying to test my project, but keeps throwing an error in the test setup.

//SPDX-License-Identifier: MIT
pragma solidity ^0.8.18;

import {Test} from "forge-std/Test.sol";
import {FoodOrder} from "../src/FoodOrder.sol";
import {DeployFoodOrder} from "../script/DeployFoodOrder.s.sol";
import {HelperConfig} from "../script/HelperConfig.s.sol";

contract FoodOrderTest is Test {
    FoodOrder foodOrder;
    HelperConfig helperConfig;

    uint256 public constant SEND_VALUE = 0.1 ether;
    address USER = makeAddr("user");
    uint256 public constant STARTING_BALANCE = 10 ether;

    function setUp() external {
        DeployFoodOrder deployer = new DeployFoodOrder();
        (foodOrder, helperConfig) = deployer.run();

        vm.deal(USER, STARTING_BALANCE);
        address customer = helperConfig.activeNetworkConfig();

And this is the error when Compiling

Error (7407): Type contract FoodOrder is not implicitly convertible to expected type tuple(contract FoodOrder,contract HelperConfig).

  • deployer variable contains the deployed contract insatance. Not a tuple. Where did you find this code snippet? Aug 9 at 10:57


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.

Browse other questions tagged or ask your own question.