I'm trying to execute a swap with ETH and interacting with a function that call the swap function but I get error when I tried to send ETH to the contract,
E */
E function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
E require(address(this).balance >= value, "Address: insufficient balance for call");
E require(isContract(target), "Address: call to non-contract");
E
E // solhint-disable-next-line avoid-low-level-calls
E (bool success, bytes memory returndata) = target.call{ value: value }(data);
This is the function I used to swap , note that it works with all ERC20 tokens, but when I try to use ETH, I have this error , and I'm using brownie for test