1

I am getting two errors with call: My contract is:

//SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.10;
contract TestingFF {
   uint cP = 100;
   address payable k;
   receive() external payable{
   }
   fallback() external payable {
      if (msg.value < cP) revert();
      uint c = cC();
      if(!k.call{value:cP, gas:10000}) revert();
  } 
  function cC() public returns(uint) {
      uint NP = cP * 2000;
      return NP;
   }
}

==

The error messages are given below:

TypeError: Unary operator ! cannot be applied to type function (bytes memory) payable returns (bool,bytes memory)
--> Paper37p16.sol:13:10:
|
13 | if(!k.call{value:cP, gas:10000}) revert();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^

TypeError: Type function (bytes memory) payable returns (bool,bytes memory) is not implicitly convertible to expected type bool. --> Paper37p16.sol:13:10: | 13 | if(!k.call{value:cP, gas:10000}) revert(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^

Kindly also tell me what is the minimum gas value for call, I have written 10000. Somebody please guide me.

Zulfi.

zak100
  • 1,406
  • 1
  • 13
  • 37

0 Answers0