How do I fix this?

abstract contract AionClient is Aion, Context, Ownable{
using SafeMath for uint256;
using Address for address;
address private AionAddress;
constructor(address addraion) public{
    AionAddress = addraion;

function execfunct(address to, uint256 value,uint256 gaslimit,bytes memory gas, bytes memory 
data) internal virtual returns (bool) {
    require(msg.sender == AionAddress);
    return to.call{value:value}("").gas(gaslimit)(data);

receive () external payable {}

  • I get a message like this. What should I do?                                    TypeError: Return argument type function (bytes memory) payable returns (bool,bytes memory) is not implicitly convertible to expected type (type of first return variable) bool. return to.call{value:value}{gas:("(gaslimit)(data)")} – garm Jun 11 at 15:54

Your formatting is just off with the call. The Solidity Documentation details this as the way to do this:

address(nameReg).call{gas: 1000000}(abi.encodeWithSignature("register(string)", "MyName"));

So you should change your code to be:

return to.call{value:value, gas:gaslimit}(data);
  • return to.call{value:value}{gas:("(gaslimit)(data)")}; Solidity 6.5 – garm Jun 11 at 15:39
  • I tried, but I could not do it in "Solidity" 6.5. – garm Jun 11 at 15:48
  • What I tried in the comment above is return to.call{value:value}{gas:("(gaslimit)(data)")};" – garm Jun 11 at 15:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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