Skip to content

Commit

Permalink
create new versions of contracts
Browse files Browse the repository at this point in the history
  • Loading branch information
Wagalidoom committed Jun 21, 2023
1 parent 2548004 commit b01ec03
Show file tree
Hide file tree
Showing 6 changed files with 829 additions and 62 deletions.
5 changes: 0 additions & 5 deletions contracts/INumberRunnerClub.sol

This file was deleted.

14 changes: 2 additions & 12 deletions contracts/NumberRunnerClub.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,14 @@
pragma solidity ^0.8.0;

import "@ensdomains/ens-contracts/contracts/registry/ENS.sol";
import "@ensdomains/ens-contracts/contracts/resolvers/profiles/TextResolver.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";
import "@chainlink/contracts/src/v0.8/VRFV2WrapperConsumerBase.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "./INumberRunnerClub.sol";

// TODO add system of burn/sell before claiming personal prize
contract NumberRunnerClub is INumberRunnerClub, ERC721URIStorage, VRFV2WrapperConsumerBase, Ownable, ReentrancyGuard {
contract NumberRunnerClub is ERC721URIStorage, VRFV2WrapperConsumerBase, Ownable, ReentrancyGuard {
struct PieceDetails {
uint256 maxSupply;
uint256 totalMinted;
Expand Down Expand Up @@ -50,7 +48,6 @@ contract NumberRunnerClub is INumberRunnerClub, ERC721URIStorage, VRFV2WrapperCo
uint256 kingHandsPrize = 0;

ENS ens;
TextResolver textResolver;
mapping(uint256 => bytes32) public nodeOfTokenId; // Mapping of tokenId to the corresponding ENS name
PieceDetails[6] pieceDetails;

Expand All @@ -76,15 +73,14 @@ contract NumberRunnerClub is INumberRunnerClub, ERC721URIStorage, VRFV2WrapperCo

event KingHandBurned(uint256 tokenId);

constructor(address _ens, address _resolver, address _vrfCoordinator, address _link) ERC721("NumberRunnerClub", "NRC") VRFV2WrapperConsumerBase(_link, _vrfCoordinator) {
constructor(address _ens, address _vrfCoordinator, address _link) ERC721("NumberRunnerClub", "NRC") VRFV2WrapperConsumerBase(_link, _vrfCoordinator) {
pieceDetails[0] = PieceDetails(2, 0, 0, 0, 350, 0, 0, 8, 0, 0, true);
pieceDetails[1] = PieceDetails(10, 0, 0, 0, 225, 35, 2, 7, 15, 15, false);
pieceDetails[2] = PieceDetails(50, 0, 0, 0, 150, 35, 12, 8, 15, 15, true);
pieceDetails[3] = PieceDetails(100, 0, 0, 0, 125, 30, 62, 8, 10, 10, false);
pieceDetails[4] = PieceDetails(200, 0, 0, 0, 100, 25, 162, 9, 10, 0, true);
pieceDetails[5] = PieceDetails(9638, 0, 0, 0, 650, 25, 362, 9, 0, 0, false);
ens = ENS(_ens);
textResolver = TextResolver(_resolver);
prizePool = 0;
for (uint8 i = 0; i < 6; i++) {
shareTypeAccumulator[i].push(0);
Expand Down Expand Up @@ -259,9 +255,6 @@ contract NumberRunnerClub is INumberRunnerClub, ERC721URIStorage, VRFV2WrapperCo
isNodeUsed[node] = true;
// Set the token ID for the ENS node
nodeOfTokenId[tokenId] = node;

// Set the NFT as the avatar for the ENS node
// textResolver.setText(node, "avatar", string(abi.encodePacked("eip721:", address(this), "/", tokenId)));
}

function unstack(uint256 tokenId) public {
Expand All @@ -287,9 +280,6 @@ contract NumberRunnerClub is INumberRunnerClub, ERC721URIStorage, VRFV2WrapperCo
unclaimedRewards[tokenId] += unclaimedReward;
// update user and total stake count
nftShares[tokenId] = shareTypeAccumulator[_pieceType][epoch];

// Remove the NFT as the avatar for the ENS node
// textResolver.setText(node, "avatar", "");
}

function listNFT(uint256 tokenId, uint256 price) public saleIsActive {
Expand Down
Loading

0 comments on commit b01ec03

Please sign in to comment.