Created
January 26, 2022 08:38
-
-
Save thatguyintech/e9b7f0c972aaba0a427858fdc991853d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//SPDX-License-Identifier: Unlicense | |
pragma solidity ^0.8.0; | |
import "hardhat/console.sol"; | |
contract GasLimits { | |
constructor() {} | |
function burnGas(uint256 gas) public view returns (uint256) { | |
uint256 endGas = gasleft() - gas; | |
while (gasleft() > endGas) {} | |
return gasleft(); | |
} | |
function getGasLimit() public view returns (uint256) { | |
return gasleft(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment