Created
April 21, 2022 02:14
-
-
Save BeautifoolData/08fcc1d9edf61e3623216b0b7dd11470 to your computer and use it in GitHub Desktop.
early mooncat nft elig
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: MIT | |
pragma solidity ^0.8.0; | |
import "./NFTXEligibility.sol"; | |
interface MoonCatTraits { | |
function rescueYearOf (uint256 _rescueOrder) public pure returns (uint16) | |
external | |
view | |
returns (uint16 _rescueYear) | |
} | |
contract NFTXEarlyMoonCatEligibility is NFTXEligibility { | |
function name() public pure override virtual returns (string memory) { | |
return "EarlyMoonCat"; | |
} | |
function finalized() public view override virtual returns (bool) { | |
return true; | |
} | |
function targetAsset() public pure override virtual returns (address) { | |
return 0xc3f733ca98E0daD0386979Eb96fb1722A1A05E69; # AcclimatedMoonCats contract | |
} | |
event NFTXEligibilityInit(); | |
function __NFTXEligibility_init_bytes( | |
bytes memory /* configData */ | |
) public override virtual initializer { | |
__NFTXEligibility_init(); | |
} | |
// Parameters here should mirror the config struct. | |
function __NFTXEligibility_init() public initializer { | |
emit NFTXEligibilityInit(); | |
} | |
function _checkIfEligible(uint256 _tokenId) | |
internal | |
view | |
override | |
virtual | |
returns (bool) | |
{ | |
uint16 _rescueYear = MoonCatTraits(0x9330BbfBa0C8FdAf0D93717E4405a410a6103cC2) # MoonCatTraits contract | |
.rescueYearOf(_tokenId); | |
return (_rescueYear == 2017 || _rescueYear == 2018); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment