Last active
September 13, 2022 19:19
-
-
Save pcaversaccio/87b4666b2131ad950bf9ee97573447be to your computer and use it in GitHub Desktop.
This smart contract determines whether "The Merge" has already taken place or not.
This file contains 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: WTFPL | |
pragma solidity 0.8.16; | |
contract Merge { | |
uint72 private constant _DIFFICULTY_THRESHOLD = 2**64; | |
/** | |
* @dev A difficulty value greater than `2**64` indicates that a transaction is | |
* being executed in a PoS block. Also note that the `DIFFICULTY` opcode (0x44) | |
* is renamed to `PREVRANDAO` post-merge. | |
* | |
* For further information, see here: https://eips.ethereum.org/EIPS/eip-4399. | |
*/ | |
function merged() public view returns (bool) { | |
return block.difficulty > _DIFFICULTY_THRESHOLD; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Official deployment address
0x17FEF0D05fFed818aF08AE00BeC06B65c4319618
.