Last active
October 17, 2016 17:04
-
-
Save etscrivner/2e96868cb32d2e1c1787dadbb0ebeaf7 to your computer and use it in GitHub Desktop.
Solidity contract used to determine the constant that should be used in EIP-150 fork oracle.
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.2; | |
| contract EIP150ForkConstant { | |
| // Used to determine gas constant | |
| event GasConstant(uint first, uint second, uint third); | |
| event OnFork(bool forked); | |
| // This function should be called between block X and Y. | |
| function run() { | |
| uint beforeGas = 0; | |
| uint afterGas = 0; | |
| assembly { | |
| beforeGas := gas | |
| balance | |
| afterGas := gas | |
| } | |
| GasConstant(beforeGas, afterGas, (beforeGas - afterGas)); | |
| OnFork((beforeGas - afterGas) == 27); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment