Created
May 6, 2022 09:59
-
-
Save ilamanov/e8fc85bd9d28714b6bf35f203c540d23 to your computer and use it in GitHub Desktop.
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: UNLICENSED | |
pragma solidity ^0.8.13; | |
import {ERC721} from "./ERC721.sol"; | |
contract Runes is ERC721 { | |
uint256 public constant RUNE_OF_ALPHA = 6; | |
uint256 public lastDelta; | |
uint256 public lastPurchaseBasefee; | |
constructor() ERC721("Runes", "RUNES") { | |
_mint(msg.sender, RUNE_OF_ALPHA); | |
lastPurchaseBasefee = block.basefee; | |
} | |
function proveAlpha() external { | |
uint256 delta = lastPurchaseBasefee - block.basefee; | |
require(delta > lastDelta, "Not enough alpha"); | |
lastPurchaseBasefee = block.basefee; | |
lastDelta = delta; | |
_transfer(ownerOf(RUNE_OF_ALPHA), msg.sender, RUNE_OF_ALPHA); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment