solidity/test/libsolidity/semanticTests/various/gasleft_decrease.sol
2023-05-11 10:56:55 -05:00

20 lines
371 B
Solidity

contract C {
uint256 v;
function f() public returns (bool) {
uint256 startGas = gasleft();
v++;
assert(startGas > gasleft());
return true;
}
function g() public returns (bool) {
uint256 startGas = gasleft();
assert(startGas > gasleft());
return true;
}
}
// ----
// f() -> true
// g() -> true