full-blockchain-solidity-course-py
full-blockchain-solidity-course-py copied to clipboard
Lesson 7: unknown function or type 'gasleft'
Hi,
the function below is throwing an "unknow function or type" error when calling gasleft() and (bool success) is not being read.
function callBackWithRandomness(
bytes32 requestId,
uint256 randomness,
address consumerContract
) public {
VRFConsumerBase v;
bytes memory resp = abi.encodeWithSelector(v.rawFulfillRandomness.selector, requestId, randomness);
uint256 b = 206000;
require(gasleft() >= b, "not enough gas for consumer");
(bool success,) = consumerContract.call(resp);
}
thank you