Created
September 21, 2020 14:36
-
-
Save k1rill-fedoseev/52f460bfc8e41ad7b7a6d0d9d90ff91c 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
| pragma solidity 0.4.24; | |
| contract Test { | |
| uint256 public x; | |
| function dummy() external { | |
| for (uint256 i = 0; i < 1000; i++) { | |
| x = i; | |
| } | |
| } | |
| } | |
| contract Caller { | |
| event Status(bool status); | |
| // call with 2000000 gas - status == true | |
| // call with 890000 gas - status == false | |
| function call(address _contract) external { | |
| emit Status(_contract.call.gas(1000000)(abi.encodeWithSelector(Test(this).dummy.selector))); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment