Skip to content

Instantly share code, notes, and snippets.

@ilamanov
Created May 6, 2022 09:59
Show Gist options
  • Save ilamanov/e8fc85bd9d28714b6bf35f203c540d23 to your computer and use it in GitHub Desktop.
Save ilamanov/e8fc85bd9d28714b6bf35f203c540d23 to your computer and use it in GitHub Desktop.
// 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