Solidity

TypeError:在元組(布爾,字節記憶體)中進行參數相關查找後,成員“gas”未找到或不可見

  • June 11, 2021

我該如何解決?

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 {}

}

您的格式剛剛結束通話。Solidity文件詳細說明了這樣做的方法:

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

因此,您應該將程式碼更改為:

return to.call{value:value, gas:gaslimit}(data);

引用自:https://ethereum.stackexchange.com/questions/101734