编译器
0.8.17+commit.8df45f5f
文件 1 的 10:Context.sol
pragma solidity ^0.8.0;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
文件 2 的 10:DeadWillRise.sol
pragma solidity ^0.8.17;
import "./ERC721A.sol";
import "../delegatecash/IDelegationRegistry.sol";
import "../weth/IWETH.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/utils/introspection/ERC165Checker.sol";
contract DeadWillRise is ERC721A, Ownable {
event IndividualDailyActivity(uint256 tokenId, uint256 currentDay, uint256 riskChoice, uint256 activityOutcome);
event IndividualCured(uint256 tokenId);
event GroupDailyActivity(uint256 groupNum, uint256 currentDay, uint256 riskChoice, uint256 activityOutcome);
event InfectionSpreading(uint256 currentProgress, uint256 infectionRate);
event GroupRegistered(uint256 groupNum, address collectionAddress, address groupManager);
event GroupTransferred(uint256 groupNum, address collectionAddress, address groupManager);
struct IndividualData {
uint32 lastBlock;
uint32 lastScore;
uint32 individualSeed;
uint32 groupNumber;
bool bitten;
}
struct GroupData {
uint32 lastBlock;
uint32 lastScore;
uint32 groupSeed;
uint32 totalMembers;
}
struct InfectionData {
uint32 lastBlock;
uint32 lastProgress;
uint32 infectionRate;
}
struct ActivityRecord {
uint32 riskChoice;
uint32 activityOutcome;
}
uint256 public constant INDIVIDUAL_DAILY_ACTIVITY_COST = 0.001 ether;
uint256 public constant GROUP_DAILY_ACTIVITY_COST = 0.01 ether;
uint256 public constant GROUP_REGISTRATION_COST = 0.1 ether;
uint256 public constant FINAL_CURE_COST = 10 ether;
uint32 constant CURE_PROGRESS_INCREMENT = 72000;
uint8 constant RISK_LEVEL_LOW = 1;
uint8 constant RISK_LEVEL_MEDIUM = 2;
uint8 constant RISK_LEVEL_HIGH = 3;
uint8 constant ACTIVITY_OUTCOME_SMALL = 1;
uint8 constant ACTIVITY_OUTCOME_MEDIUM = 2;
uint8 constant ACTIVITY_OUTCOME_LARGE = 3;
uint8 constant ACTIVITY_OUTCOME_DEVASTATED = 4;
uint8 constant ACTIVITY_OUTCOME_CURED = 5;
uint8 constant ACTIVITY_OUTCOME_STILL_A_ZOMBIE = 6;
uint8 public constant MAX_DAY = 19;
uint32 constant INDIVIDUAL_BASE_RATE = 100;
uint32 constant INDIVIDUAL_VARIABLE_RATE = 50;
uint32 constant INDIVIDUAL_MAXIMUM_LUCK = 1000;
uint32 constant TOTAL_MAXIMUM_LUCK = 10000;
uint32 constant RISK_LOW_OUTCOME_LARGE = 9900;
uint32 constant RISK_LOW_OUTCOME_MEDIUM = 9500;
uint32 constant RISK_LOW_OUTCOME_SMALL = 100;
uint32 constant RISK_MEDIUM_OUTCOME_LARGE = 9000;
uint32 constant RISK_MEDIUM_OUTCOME_MEDIUM = 7500;
uint32 constant RISK_MEDIUM_OUTCOME_SMALL = 1000;
uint32 constant RISK_HIGH_OUTCOME_LARGE = 7500;
uint32 constant RISK_HIGH_OUTCOME_MEDIUM = 5000;
uint32 constant RISK_HIGH_OUTCOME_SMALL = 3300;
uint32 constant RANDOM_CURE_CHANCE = 9500;
uint32 constant INDIVIDUAL_REWARD_OUTCOME_LARGE = 360000;
uint32 constant INDIVIDUAL_REWARD_OUTCOME_MEDIUM = 180000;
uint32 constant INDIVIDUAL_REWARD_OUTCOME_SMALL = 72000;
uint32 constant GROUP_REWARD_OUTCOME_LARGE = 36000;
uint32 constant GROUP_REWARD_OUTCOME_MEDIUM = 18000;
uint32 constant GROUP_REWARD_OUTCOME_SMALL = 3600;
uint32 constant GROUP_BASE_RATE = 1;
uint32 constant GROUP_VARIABLE_RATE = 10;
uint32 constant GROUP_RATE_MULTIPLIER = 1;
uint256 public constant MAX_SUPPLY = 5000;
bool public eventOver;
uint64 public eventStartTime;
uint32 public eventStartBlock;
uint32 public collectionSeed;
uint32 public groupsRegistered;
bool public groupRegistrationOpen;
bool public publicMintOpen;
uint32 public maxPerWalletPerGroup = 1;
uint32 public maxPerGroup = 500;
uint32 public cureSupply = 500;
uint32 public lastSurvivorTokenID;
uint32 public winningGroupNumber;
uint32 constant BLOCKS_PER_DAY = 7200;
uint32 constant WITHDRAWAL_DELAY = 3600;
uint32 constant LATE_JOINER_PROGRESS = 21600;
InfectionData public infectionProgress;
mapping(address => uint256) public groupNumbers;
mapping(uint256 => address) public groupNumberToCollection;
mapping(uint256 => GroupData) public groupRecord;
mapping(uint256 => address) public groupManager;
mapping(uint256 => ActivityRecord) public groupActivity;
mapping(uint256 => IndividualData) public individualRecord;
mapping(uint256 => ActivityRecord) public individualActivity;
mapping(uint256 => uint256) public mintCount;
IWETH weth = IWETH(0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2);
IDelegationRegistry delegateCash = IDelegationRegistry(0x00000000000076A84feF008CDAbe6409d2FE638B);
string internal _baseTokenURI;
string internal _placeholderURI;
string internal _contractURI;
string public constant TOKEN_URI_SEPARATOR = "/";
bool public includeStatsInURI = true;
modifier eventInProgress() {
require(collectionSeed > 0 && !eventOver);
_;
}
modifier eventEnded() {
require(eventOver);
_;
}
modifier canWithdraw() {
require(uint32(block.number) > (infectionProgress.lastBlock + WITHDRAWAL_DELAY));
_;
}
constructor(string memory mContractURI, string memory mPlaceholderURI) ERC721A("Dead Will Rise", "DWR") {
_contractURI = mContractURI;
_placeholderURI = mPlaceholderURI;
}
receive() external payable { }
fallback() external payable { }
function unwrapWETH() external onlyOwner {
uint256 wethBalance = weth.balanceOf(address(this));
weth.withdraw(wethBalance);
}
function startEvent(uint32 _infectionRate) external onlyOwner {
require(collectionSeed == 0);
eventStartTime = uint64(block.timestamp);
collectionSeed = uint32(uint256(keccak256(abi.encodePacked(block.timestamp, block.difficulty))));
infectionProgress.lastBlock = uint32(block.number);
infectionProgress.infectionRate = _infectionRate;
emit InfectionSpreading(infectionProgress.lastProgress, infectionProgress.infectionRate);
eventStartBlock = uint32(block.number);
}
function endEvent() external onlyOwner eventInProgress {
require(!eventOver);
infectionProgress.lastProgress = this.currentInfectionProgress();
infectionProgress.lastBlock = uint32(block.number);
infectionProgress.infectionRate = 0;
emit InfectionSpreading(infectionProgress.lastProgress, infectionProgress.infectionRate);
eventOver = true;
}
function resumeEvent(uint32 _infectionRate) external onlyOwner eventEnded {
require(eventOver);
infectionProgress.lastProgress = this.currentInfectionProgress();
infectionProgress.lastBlock = uint32(block.number);
infectionProgress.infectionRate = _infectionRate;
emit InfectionSpreading(infectionProgress.lastProgress, infectionProgress.infectionRate);
eventOver = false;
}
function setInfectionRate(uint32 _infectionRate, uint32 _progressAdder) external onlyOwner eventInProgress {
infectionProgress.lastProgress = this.currentInfectionProgress() + _progressAdder;
infectionProgress.lastBlock = uint32(block.number);
infectionProgress.infectionRate = _infectionRate;
emit InfectionSpreading(infectionProgress.lastProgress, infectionProgress.infectionRate);
}
function setInfectionProgress(uint32 _infectionProgress) external onlyOwner {
infectionProgress.lastProgress = _infectionProgress;
emit InfectionSpreading(infectionProgress.lastProgress, infectionProgress.infectionRate);
}
function declareLastSurvivor(uint256 tokenId) external eventEnded {
uint256 _currentTokenID = lastSurvivorTokenID;
if(_currentTokenID == 0 || this.getIndividualScore(tokenId) > this.getIndividualScore(_currentTokenID)) {
lastSurvivorTokenID = uint32(tokenId);
} else {
revert();
}
}
function declareWinningGroup(uint32 groupNumber) external eventEnded {
uint32 _currentGroupNumber = winningGroupNumber;
if(_currentGroupNumber == 0 || this.getGroupScore(groupNumber) > this.getGroupScore(_currentGroupNumber)) {
winningGroupNumber = groupNumber;
} else {
revert();
}
}
uint256 public totalWithdrawn;
uint256 public totalSwept;
uint256 public hostBalance;
uint256 public groupBalance;
uint256 public survivorBalance;
function sweepRewards() external onlyOwner canWithdraw {
uint256 currentPool = totalWithdrawn + address(this).balance - totalSwept;
totalSwept = totalSwept + currentPool;
uint256 survivorShare = currentPool * 30 / 100;
uint256 groupShare = currentPool * 20 / 100;
uint256 hostShare = (currentPool - survivorShare - groupShare);
hostBalance += hostShare;
groupBalance += groupShare;
survivorBalance += survivorShare;
}
function withdraw(uint256 share) external onlyOwner {
address recipient;
uint256 recipientBalance;
if(share == 1) {
recipient = owner();
recipientBalance = hostBalance;
hostBalance = 0;
} else if(share == 2) {
recipient = groupManager[winningGroupNumber];
recipientBalance = groupBalance;
groupBalance = 0;
} else if(share == 3) {
recipient = ownerOf(lastSurvivorTokenID);
recipientBalance = survivorBalance;
survivorBalance = 0;
}
require(recipientBalance > 0);
(bool sent, ) = payable(recipient).call{value: recipientBalance}("");
require(sent);
totalWithdrawn = totalWithdrawn + recipientBalance;
}
function currentInfectionProgress() external view returns (uint32) {
if(eventOver) return infectionProgress.lastProgress;
return (infectionProgress.lastProgress + (uint32(block.number) - infectionProgress.lastBlock) * infectionProgress.infectionRate);
}
function getIndividualScore(uint256 tokenId) external view returns (uint32) {
require(_exists(tokenId));
if(eventStartTime == 0) return 0;
uint32 _endBlock = uint32(block.number);
if(eventOver) _endBlock = infectionProgress.lastBlock;
IndividualData memory individual = individualRecord[tokenId];
uint32 _lastBlock = individual.lastBlock;
if(_lastBlock == 0) _lastBlock = eventStartBlock;
return (individual.lastScore + (_endBlock - _lastBlock) * this.getIndividualRate(tokenId,false) + this.getGroupScore(individual.groupNumber));
}
function getIndividualOnlyScore(uint256 tokenId) external view returns (uint32) {
require(_exists(tokenId));
if(eventStartTime == 0) return 0;
uint32 _endBlock = uint32(block.number);
if(eventOver) _endBlock = infectionProgress.lastBlock;
IndividualData memory individual = individualRecord[tokenId];
uint32 _lastBlock = individual.lastBlock;
if(_lastBlock == 0) _lastBlock = eventStartBlock;
return (individual.lastScore + (_endBlock - _lastBlock) * this.getIndividualRate(tokenId,false));
}
function getIndividualRate(uint256 tokenId, bool ignoreBite) external view returns (uint32) {
if(eventStartTime == 0) return 0;
IndividualData memory individual = individualRecord[tokenId];
uint32 _individualRate = uint32(uint256(keccak256(abi.encodePacked(individual.individualSeed, collectionSeed)))) % INDIVIDUAL_VARIABLE_RATE + INDIVIDUAL_BASE_RATE;
if(individual.bitten && !ignoreBite) { _individualRate = _individualRate / 4; }
return _individualRate;
}
function getIndividualLuck(uint256 tokenId) external view returns (uint32) {
if(eventStartTime == 0) return 0;
IndividualData memory individual = individualRecord[tokenId];
uint32 _individualLuck = uint32(uint256(keccak256(abi.encodePacked(collectionSeed, individual.individualSeed)))) % INDIVIDUAL_MAXIMUM_LUCK;
return _individualLuck;
}
function getGroupScoreByAddress(address _collectionAddress) external view returns(uint32) {
return this.getGroupScore(uint32(groupNumbers[_collectionAddress]));
}
function getGroupScore(uint32 _groupNumber) external view returns (uint32) {
if(_groupNumber == 0) return 0;
if(eventStartTime == 0) return 0;
uint32 _endBlock = uint32(block.number);
if(eventOver) _endBlock = infectionProgress.lastBlock;
GroupData memory group = groupRecord[uint256(_groupNumber)];
uint32 _lastBlock = group.lastBlock;
if(_lastBlock == 0) _lastBlock = eventStartBlock;
return (group.lastScore + (_endBlock - _lastBlock) * this.getGroupRate(_groupNumber));
}
function getGroupRate(uint32 _groupNumber) external view returns (uint32) {
if(eventStartTime == 0) return 0;
if(_groupNumber == 0 || _groupNumber > groupsRegistered) return 0;
uint32 _totalMembers = groupRecord[uint256(_groupNumber)].totalMembers;
return (_totalMembers / GROUP_VARIABLE_RATE + GROUP_BASE_RATE) * GROUP_RATE_MULTIPLIER;
}
function currentDay() external view returns (uint32) {
if(eventStartTime == 0) return 0;
uint32 _currentDay = uint32((block.timestamp - uint256(eventStartTime)) / 1 days + 1);
if(_currentDay > MAX_DAY) { _currentDay = MAX_DAY; }
return _currentDay;
}
function getIndividualDailyActivityRecords(uint256 tokenId) external view returns(ActivityRecord[] memory) {
uint256 numRecords = this.currentDay();
ActivityRecord[] memory records = new ActivityRecord[](numRecords);
for(uint256 i = 1;i <= numRecords;i++) {
records[i-1] = individualActivity[((tokenId << 32) + i)];
}
return records;
}
function getGroupDailyActivityRecords(uint32 _groupNumber) external view returns(ActivityRecord[] memory) {
uint256 numRecords = this.currentDay();
ActivityRecord[] memory records = new ActivityRecord[](numRecords);
for(uint256 i = 1;i <= numRecords;i++) {
records[i-1] = groupActivity[((uint256(_groupNumber) << 32) + i)];
}
return records;
}
function getGroupDailyActivityRecordsByAddress(address _collectionAddress) external view returns(ActivityRecord[] memory) {
return this.getGroupDailyActivityRecords(uint32(groupNumbers[_collectionAddress]));
}
function cureIndividual(uint256 tokenId) external payable eventInProgress {
require(ownerOf(tokenId) == msg.sender);
require(cureSupply > 0);
IndividualData memory individual = individualRecord[tokenId];
if(individual.lastBlock == 0) { individual.lastBlock = eventStartBlock; }
individual.lastScore = (individual.lastScore + (uint32(block.number) - individual.lastBlock) * this.getIndividualRate(tokenId,false));
individual.lastBlock = uint32(block.number);
uint32 _groupScore = this.getGroupScore(individual.groupNumber);
uint32 _totalScore = (individual.lastScore + _groupScore);
uint32 _currentInfectionProgress = this.currentInfectionProgress();
uint256 cureCost = FINAL_CURE_COST / cureSupply;
if(_totalScore >= _currentInfectionProgress && individual.bitten) {
cureCost = cureCost / 2;
} else if(_totalScore < _currentInfectionProgress) {
individual.lastScore = (_currentInfectionProgress + CURE_PROGRESS_INCREMENT) - _groupScore;
} else {
cureCost = cureCost * 5;
}
individual.bitten = false;
cureSupply = cureSupply - 1;
individualRecord[tokenId] = individual;
require(msg.value >= cureCost);
emit IndividualCured(tokenId);
}
function dailyActivityIndividual(uint256 tokenId, uint32 _riskChoice) external payable eventInProgress {
require(_riskChoice >= RISK_LEVEL_LOW && _riskChoice <= RISK_LEVEL_HIGH);
require(msg.value >= INDIVIDUAL_DAILY_ACTIVITY_COST);
require(ownerOf(tokenId) == msg.sender);
uint256 _currentDay = uint256(this.currentDay());
uint256 individualDayKey = (tokenId << 32) + _currentDay;
ActivityRecord memory activity = individualActivity[individualDayKey];
require(activity.riskChoice == 0);
uint32 _activityOutcome = 0;
IndividualData memory individual = individualRecord[tokenId];
if(individual.lastBlock == 0) { individual.lastBlock = eventStartBlock; }
individual.lastScore = (individual.lastScore + (uint32(block.number) - individual.lastBlock) * this.getIndividualRate(tokenId,false));
individual.lastBlock = uint32(block.number);
uint32 _groupScore = this.getGroupScore(individual.groupNumber);
uint32 _currentInfectionProgress = this.currentInfectionProgress();
uint32 _individualLuck = this.getIndividualLuck(tokenId);
uint32 _seed = (uint32(uint256(keccak256(abi.encodePacked(block.timestamp,block.difficulty,tokenId)))) % TOTAL_MAXIMUM_LUCK) + _individualLuck;
if((individual.lastScore + _groupScore) >= _currentInfectionProgress) {
if(_riskChoice == RISK_LEVEL_LOW) {
if(_seed > RISK_LOW_OUTCOME_LARGE) {
_activityOutcome = ACTIVITY_OUTCOME_LARGE;
individual.lastScore += INDIVIDUAL_REWARD_OUTCOME_LARGE;
} else if(_seed > RISK_LOW_OUTCOME_MEDIUM) {
_activityOutcome = ACTIVITY_OUTCOME_MEDIUM;
individual.lastScore += INDIVIDUAL_REWARD_OUTCOME_MEDIUM;
} else if(_seed > RISK_LOW_OUTCOME_SMALL) {
_activityOutcome = ACTIVITY_OUTCOME_SMALL;
individual.lastScore += INDIVIDUAL_REWARD_OUTCOME_SMALL;
} else {
_activityOutcome = ACTIVITY_OUTCOME_DEVASTATED;
individual.bitten = true;
}
} else if(_riskChoice == RISK_LEVEL_MEDIUM) {
if(_seed > RISK_MEDIUM_OUTCOME_LARGE) {
_activityOutcome = ACTIVITY_OUTCOME_LARGE;
individual.lastScore += INDIVIDUAL_REWARD_OUTCOME_LARGE;
} else if(_seed > RISK_MEDIUM_OUTCOME_MEDIUM) {
_activityOutcome = ACTIVITY_OUTCOME_MEDIUM;
individual.lastScore += INDIVIDUAL_REWARD_OUTCOME_MEDIUM;
} else if(_seed > RISK_MEDIUM_OUTCOME_SMALL) {
_activityOutcome = ACTIVITY_OUTCOME_SMALL;
individual.lastScore += INDIVIDUAL_REWARD_OUTCOME_SMALL;
} else {
_activityOutcome = ACTIVITY_OUTCOME_DEVASTATED;
individual.bitten = true;
}
} else if(_riskChoice == RISK_LEVEL_HIGH) {
if(_seed > RISK_HIGH_OUTCOME_LARGE) {
_activityOutcome = ACTIVITY_OUTCOME_LARGE;
individual.lastScore += INDIVIDUAL_REWARD_OUTCOME_LARGE;
} else if(_seed > RISK_HIGH_OUTCOME_MEDIUM) {
_activityOutcome = ACTIVITY_OUTCOME_MEDIUM;
individual.lastScore += INDIVIDUAL_REWARD_OUTCOME_MEDIUM;
} else if(_seed > RISK_HIGH_OUTCOME_SMALL) {
_activityOutcome = ACTIVITY_OUTCOME_SMALL;
individual.lastScore += INDIVIDUAL_REWARD_OUTCOME_SMALL;
} else {
_activityOutcome = ACTIVITY_OUTCOME_DEVASTATED;
individual.bitten = true;
}
}
} else {
if(_seed > RANDOM_CURE_CHANCE) {
_riskChoice = 1;
individual.lastScore = (_currentInfectionProgress + LATE_JOINER_PROGRESS) - _groupScore;
_activityOutcome = ACTIVITY_OUTCOME_CURED;
individual.bitten = false;
} else {
_riskChoice = 1;
_activityOutcome = ACTIVITY_OUTCOME_STILL_A_ZOMBIE;
}
}
activity.riskChoice = _riskChoice;
activity.activityOutcome = _activityOutcome;
individualActivity[individualDayKey] = activity;
individualRecord[tokenId] = individual;
emit IndividualDailyActivity(tokenId, _currentDay, _riskChoice, _activityOutcome);
}
function dailyActivityGroup(uint32 _groupNumber, uint32 _riskChoice) external payable eventInProgress {
require(_riskChoice >= RISK_LEVEL_LOW && _riskChoice <= RISK_LEVEL_HIGH);
require(msg.value >= GROUP_DAILY_ACTIVITY_COST);
require(groupManager[_groupNumber] == msg.sender);
uint256 _currentDay = uint256(this.currentDay());
uint256 groupDayKey = (uint256(_groupNumber) << 32) + _currentDay;
ActivityRecord memory activity = groupActivity[groupDayKey];
require(activity.riskChoice == 0);
uint32 _activityOutcome = 0;
GroupData memory group = groupRecord[uint256(_groupNumber)];
if(group.lastBlock == 0) { group.lastBlock = eventStartBlock; }
group.lastScore = (group.lastScore + (uint32(block.number) - group.lastBlock) * this.getGroupRate(_groupNumber));
group.lastBlock = uint32(block.number);
uint32 _seed = (uint32(uint256(keccak256(abi.encodePacked(block.timestamp,block.difficulty,_groupNumber)))) % TOTAL_MAXIMUM_LUCK);
if(_riskChoice == RISK_LEVEL_LOW) {
if(_seed > RISK_LOW_OUTCOME_LARGE) {
_activityOutcome = ACTIVITY_OUTCOME_LARGE;
group.lastScore += GROUP_REWARD_OUTCOME_LARGE;
} else if(_seed > RISK_LOW_OUTCOME_MEDIUM) {
_activityOutcome = ACTIVITY_OUTCOME_MEDIUM;
group.lastScore += GROUP_REWARD_OUTCOME_MEDIUM;
} else if(_seed > RISK_LOW_OUTCOME_SMALL) {
_activityOutcome = ACTIVITY_OUTCOME_SMALL;
group.lastScore += GROUP_REWARD_OUTCOME_SMALL;
} else {
_activityOutcome = ACTIVITY_OUTCOME_DEVASTATED;
group.lastScore /= 2;
}
} else if(_riskChoice == RISK_LEVEL_MEDIUM) {
if(_seed > RISK_MEDIUM_OUTCOME_LARGE) {
_activityOutcome = ACTIVITY_OUTCOME_LARGE;
group.lastScore += GROUP_REWARD_OUTCOME_LARGE;
} else if(_seed > RISK_MEDIUM_OUTCOME_MEDIUM) {
_activityOutcome = ACTIVITY_OUTCOME_MEDIUM;
group.lastScore += GROUP_REWARD_OUTCOME_MEDIUM;
} else if(_seed > RISK_MEDIUM_OUTCOME_SMALL) {
_activityOutcome = ACTIVITY_OUTCOME_SMALL;
group.lastScore += GROUP_REWARD_OUTCOME_SMALL;
} else {
_activityOutcome = ACTIVITY_OUTCOME_DEVASTATED;
group.lastScore /= 2;
}
} else if(_riskChoice == RISK_LEVEL_HIGH) {
if(_seed > RISK_HIGH_OUTCOME_LARGE) {
_activityOutcome = ACTIVITY_OUTCOME_LARGE;
group.lastScore += GROUP_REWARD_OUTCOME_LARGE;
} else if(_seed > RISK_HIGH_OUTCOME_MEDIUM) {
_activityOutcome = ACTIVITY_OUTCOME_MEDIUM;
group.lastScore += GROUP_REWARD_OUTCOME_MEDIUM;
} else if(_seed > RISK_HIGH_OUTCOME_SMALL) {
_activityOutcome = ACTIVITY_OUTCOME_SMALL;
group.lastScore += GROUP_REWARD_OUTCOME_SMALL;
} else {
_activityOutcome = ACTIVITY_OUTCOME_DEVASTATED;
group.lastScore /= 2;
}
}
activity.riskChoice = _riskChoice;
activity.activityOutcome = _activityOutcome;
groupActivity[groupDayKey] = activity;
groupRecord[uint256(_groupNumber)] = group;
emit GroupDailyActivity(_groupNumber, _currentDay, _riskChoice, _activityOutcome);
}
function registerGroup(address _collectionAddress) external payable {
require(groupRegistrationOpen);
require(msg.value >= GROUP_REGISTRATION_COST);
require(groupNumbers[_collectionAddress] == 0);
require(IERC721(_collectionAddress).supportsInterface(type(IERC721).interfaceId));
groupsRegistered = groupsRegistered + 1;
uint256 newGroupNumber = groupsRegistered;
GroupData memory newGroup;
newGroup.groupSeed = uint32(uint256(keccak256(abi.encodePacked(block.timestamp, block.difficulty, _collectionAddress))));
if(eventStartBlock > 0) {
newGroup.lastBlock = uint32(block.number);
}
groupNumberToCollection[newGroupNumber] = _collectionAddress;
groupNumbers[_collectionAddress] = newGroupNumber;
groupRecord[newGroupNumber] = newGroup;
groupManager[newGroupNumber] = msg.sender;
emit GroupRegistered(newGroupNumber, _collectionAddress, msg.sender);
}
function transferGroupManagement(address _collectionAddress, address _newManager) external {
uint256 _groupNumber = groupNumbers[_collectionAddress];
require(groupManager[_groupNumber] == msg.sender);
groupManager[_groupNumber] = _newManager;
emit GroupTransferred(_groupNumber, _collectionAddress, _newManager);
}
function setMintingVariables(bool _groupOpen, bool _publicOpen, uint32 _maxPerWalletPerGroup, uint32 _maxPerGroup) external onlyOwner {
groupRegistrationOpen = _groupOpen;
publicMintOpen = _publicOpen;
maxPerWalletPerGroup = _maxPerWalletPerGroup;
maxPerGroup = _maxPerGroup;
}
function getCurrentRegistrationCost() external view returns (uint256) {
if(eventStartBlock > 0) {
uint256 _currentDay = this.currentDay();
if(_currentDay == MAX_DAY) {
return 5000 ether;
} else {
return address(this).balance * 50 / 100 / (MAX_DAY - _currentDay);
}
} else {
return 0;
}
}
function mintInner(address _to, address _collectionAddress, address _onBehalfOf) internal {
uint256 tokenId = totalSupply() + 1;
require(tokenId <= MAX_SUPPLY);
uint32 _groupNumber = uint32(groupNumbers[_collectionAddress]);
require((groupRegistrationOpen && _groupNumber > 0) || publicMintOpen);
uint256 mintKey = (uint256(uint160(_onBehalfOf)) << 32) + _groupNumber;
uint256 currentCount = mintCount[mintKey];
require(currentCount + 1 <= maxPerWalletPerGroup);
uint256 _eventStartBlock = eventStartBlock;
IndividualData memory individual;
individual.individualSeed = uint32(uint256(keccak256(abi.encodePacked(block.timestamp, block.difficulty, mintKey))));
if(_eventStartBlock > 0) {
individual.lastBlock = uint32(block.number);
individual.lastScore = this.currentInfectionProgress() * 110 / 100;
require(msg.value >= this.getCurrentRegistrationCost());
}
if(_groupNumber > 0) {
require(IERC721(_collectionAddress).balanceOf(_onBehalfOf) > 0);
GroupData memory group = groupRecord[_groupNumber];
group.totalMembers = group.totalMembers + 1;
require(group.totalMembers <= maxPerGroup);
if(_eventStartBlock > 0) {
group.lastScore = this.getGroupScore(_groupNumber);
group.lastBlock = uint32(block.number);
}
individual.groupNumber = _groupNumber;
groupRecord[_groupNumber] = group;
}
_safeMint(_to, 1);
mintCount[mintKey] = currentCount + 1;
individualRecord[tokenId] = individual;
}
function delegateMint(address _collectionAddress, address _onBehalfOf) external payable {
require(delegateCash.checkDelegateForAll(msg.sender, _onBehalfOf) || delegateCash.checkDelegateForContract(msg.sender, _onBehalfOf, _collectionAddress));
mintInner(msg.sender, _collectionAddress, _onBehalfOf);
}
function mintIndividual() external payable {
mintInner(msg.sender, address(0x0), msg.sender);
}
function mintToGroup(address _collectionAddress) external payable {
mintInner(msg.sender, _collectionAddress, msg.sender);
}
function _startTokenId() internal pure override returns (uint256) {
return 1;
}
function setBaseURI(string calldata baseURI) external onlyOwner {
_baseTokenURI = baseURI;
}
function setPlaceholderURI(string calldata placeholderURI) external onlyOwner {
_placeholderURI = placeholderURI;
}
function setContractURI(string calldata newContractURI) external onlyOwner {
_contractURI = newContractURI;
}
function setIncludeStatsInURI(bool _stats) external onlyOwner {
includeStatsInURI = _stats;
}
function contractURI() external view returns (string memory) {
return _contractURI;
}
function tokenURI(uint256 tokenId) public view override returns (string memory) {
require(_exists(tokenId));
if (eventStartTime == 0) {
return _placeholderURI;
}
string memory baseURI = _baseTokenURI;
string memory infectionStatus = 'H';
if(this.getIndividualScore(tokenId) < this.currentInfectionProgress()) { infectionStatus = 'Z'; }
if(includeStatsInURI) {
uint32 individualLuck = this.getIndividualLuck(tokenId);
uint32 individualRate = this.getIndividualRate(tokenId,true);
return bytes(baseURI).length > 0
? string(abi.encodePacked(baseURI, infectionStatus, _toString(tokenId), TOKEN_URI_SEPARATOR, _toString(individualRate), TOKEN_URI_SEPARATOR, _toString(individualLuck)))
: "";
} else {
return bytes(baseURI).length > 0
? string(abi.encodePacked(baseURI, infectionStatus, _toString(tokenId)))
: "";
}
}
function tokensOfOwner(address owner) external view returns (uint256[] memory) {
unchecked {
uint256 tokenIdsIdx;
uint256 tokenIdsLength = balanceOf(owner);
uint256[] memory tokenIds = new uint256[](tokenIdsLength);
for (uint256 i = _startTokenId(); tokenIdsIdx != tokenIdsLength; ++i) {
if (ownerOf(i) == owner) {
uint256 _individualScore = this.getIndividualScore(i);
tokenIds[tokenIdsIdx++] = (i<<32)+_individualScore;
}
}
return tokenIds;
}
}
}
文件 3 的 10:ERC165Checker.sol
pragma solidity ^0.8.0;
import "./IERC165.sol";
library ERC165Checker {
bytes4 private constant _INTERFACE_ID_INVALID = 0xffffffff;
function supportsERC165(address account) internal view returns (bool) {
return
_supportsERC165Interface(account, type(IERC165).interfaceId) &&
!_supportsERC165Interface(account, _INTERFACE_ID_INVALID);
}
function supportsInterface(address account, bytes4 interfaceId) internal view returns (bool) {
return supportsERC165(account) && _supportsERC165Interface(account, interfaceId);
}
function getSupportedInterfaces(address account, bytes4[] memory interfaceIds)
internal
view
returns (bool[] memory)
{
bool[] memory interfaceIdsSupported = new bool[](interfaceIds.length);
if (supportsERC165(account)) {
for (uint256 i = 0; i < interfaceIds.length; i++) {
interfaceIdsSupported[i] = _supportsERC165Interface(account, interfaceIds[i]);
}
}
return interfaceIdsSupported;
}
function supportsAllInterfaces(address account, bytes4[] memory interfaceIds) internal view returns (bool) {
if (!supportsERC165(account)) {
return false;
}
for (uint256 i = 0; i < interfaceIds.length; i++) {
if (!_supportsERC165Interface(account, interfaceIds[i])) {
return false;
}
}
return true;
}
function _supportsERC165Interface(address account, bytes4 interfaceId) private view returns (bool) {
bytes memory encodedParams = abi.encodeWithSelector(IERC165.supportsInterface.selector, interfaceId);
bool success;
uint256 returnSize;
uint256 returnValue;
assembly {
success := staticcall(30000, account, add(encodedParams, 0x20), mload(encodedParams), 0x00, 0x20)
returnSize := returndatasize()
returnValue := mload(0x00)
}
return success && returnSize >= 0x20 && returnValue > 0;
}
}
文件 4 的 10:ERC721A.sol
pragma solidity ^0.8.4;
import './IERC721A.sol';
interface ERC721A__IERC721Receiver {
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}
contract ERC721A is IERC721A {
struct TokenApprovalRef {
address value;
}
uint256 private constant _BITMASK_ADDRESS_DATA_ENTRY = (1 << 64) - 1;
uint256 private constant _BITPOS_NUMBER_MINTED = 64;
uint256 private constant _BITPOS_NUMBER_BURNED = 128;
uint256 private constant _BITPOS_AUX = 192;
uint256 private constant _BITMASK_AUX_COMPLEMENT = (1 << 192) - 1;
uint256 private constant _BITPOS_START_TIMESTAMP = 160;
uint256 private constant _BITMASK_BURNED = 1 << 224;
uint256 private constant _BITPOS_NEXT_INITIALIZED = 225;
uint256 private constant _BITMASK_NEXT_INITIALIZED = 1 << 225;
uint256 private constant _BITPOS_EXTRA_DATA = 232;
uint256 private constant _BITMASK_EXTRA_DATA_COMPLEMENT = (1 << 232) - 1;
uint256 private constant _BITMASK_ADDRESS = (1 << 160) - 1;
uint256 private constant _MAX_MINT_ERC2309_QUANTITY_LIMIT = 5000;
bytes32 private constant _TRANSFER_EVENT_SIGNATURE =
0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef;
uint256 private _currentIndex;
uint256 private _burnCounter;
string private _name;
string private _symbol;
mapping(uint256 => uint256) private _packedOwnerships;
mapping(address => uint256) private _packedAddressData;
mapping(uint256 => TokenApprovalRef) private _tokenApprovals;
mapping(address => mapping(address => bool)) private _operatorApprovals;
constructor(string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
_currentIndex = _startTokenId();
}
function _startTokenId() internal view virtual returns (uint256) {
return 0;
}
function _nextTokenId() internal view virtual returns (uint256) {
return _currentIndex;
}
function totalSupply() public view virtual override returns (uint256) {
unchecked {
return _currentIndex - _burnCounter - _startTokenId();
}
}
function _totalMinted() internal view virtual returns (uint256) {
unchecked {
return _currentIndex - _startTokenId();
}
}
function _totalBurned() internal view virtual returns (uint256) {
return _burnCounter;
}
function balanceOf(address owner) public view virtual override returns (uint256) {
if (owner == address(0)) revert BalanceQueryForZeroAddress();
return _packedAddressData[owner] & _BITMASK_ADDRESS_DATA_ENTRY;
}
function _numberMinted(address owner) internal view returns (uint256) {
return (_packedAddressData[owner] >> _BITPOS_NUMBER_MINTED) & _BITMASK_ADDRESS_DATA_ENTRY;
}
function _numberBurned(address owner) internal view returns (uint256) {
return (_packedAddressData[owner] >> _BITPOS_NUMBER_BURNED) & _BITMASK_ADDRESS_DATA_ENTRY;
}
function _getAux(address owner) internal view returns (uint64) {
return uint64(_packedAddressData[owner] >> _BITPOS_AUX);
}
function _setAux(address owner, uint64 aux) internal virtual {
uint256 packed = _packedAddressData[owner];
uint256 auxCasted;
assembly {
auxCasted := aux
}
packed = (packed & _BITMASK_AUX_COMPLEMENT) | (auxCasted << _BITPOS_AUX);
_packedAddressData[owner] = packed;
}
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return
interfaceId == 0x01ffc9a7 ||
interfaceId == 0x80ac58cd ||
interfaceId == 0x5b5e139f;
}
function name() public view virtual override returns (string memory) {
return _name;
}
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
if (!_exists(tokenId)) revert URIQueryForNonexistentToken();
string memory baseURI = _baseURI();
return bytes(baseURI).length != 0 ? string(abi.encodePacked(baseURI, _toString(tokenId))) : '';
}
function _baseURI() internal view virtual returns (string memory) {
return '';
}
function ownerOf(uint256 tokenId) public view virtual override returns (address) {
return address(uint160(_packedOwnershipOf(tokenId)));
}
function _ownershipOf(uint256 tokenId) internal view virtual returns (TokenOwnership memory) {
return _unpackedOwnership(_packedOwnershipOf(tokenId));
}
function _ownershipAt(uint256 index) internal view virtual returns (TokenOwnership memory) {
return _unpackedOwnership(_packedOwnerships[index]);
}
function _initializeOwnershipAt(uint256 index) internal virtual {
if (_packedOwnerships[index] == 0) {
_packedOwnerships[index] = _packedOwnershipOf(index);
}
}
function _packedOwnershipOf(uint256 tokenId) private view returns (uint256) {
uint256 curr = tokenId;
unchecked {
if (_startTokenId() <= curr)
if (curr < _currentIndex) {
uint256 packed = _packedOwnerships[curr];
if (packed & _BITMASK_BURNED == 0) {
while (packed == 0) {
packed = _packedOwnerships[--curr];
}
return packed;
}
}
}
revert OwnerQueryForNonexistentToken();
}
function _unpackedOwnership(uint256 packed) private pure returns (TokenOwnership memory ownership) {
ownership.addr = address(uint160(packed));
ownership.startTimestamp = uint64(packed >> _BITPOS_START_TIMESTAMP);
ownership.burned = packed & _BITMASK_BURNED != 0;
ownership.extraData = uint24(packed >> _BITPOS_EXTRA_DATA);
}
function _packOwnershipData(address owner, uint256 flags) private view returns (uint256 result) {
assembly {
owner := and(owner, _BITMASK_ADDRESS)
result := or(owner, or(shl(_BITPOS_START_TIMESTAMP, timestamp()), flags))
}
}
function _nextInitializedFlag(uint256 quantity) private pure returns (uint256 result) {
assembly {
result := shl(_BITPOS_NEXT_INITIALIZED, eq(quantity, 1))
}
}
function approve(address to, uint256 tokenId) public payable virtual override {
address owner = ownerOf(tokenId);
if (_msgSenderERC721A() != owner)
if (!isApprovedForAll(owner, _msgSenderERC721A())) {
revert ApprovalCallerNotOwnerNorApproved();
}
_tokenApprovals[tokenId].value = to;
emit Approval(owner, to, tokenId);
}
function getApproved(uint256 tokenId) public view virtual override returns (address) {
if (!_exists(tokenId)) revert ApprovalQueryForNonexistentToken();
return _tokenApprovals[tokenId].value;
}
function setApprovalForAll(address operator, bool approved) public virtual override {
_operatorApprovals[_msgSenderERC721A()][operator] = approved;
emit ApprovalForAll(_msgSenderERC721A(), operator, approved);
}
function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
return _operatorApprovals[owner][operator];
}
function _exists(uint256 tokenId) internal view virtual returns (bool) {
return
_startTokenId() <= tokenId &&
tokenId < _currentIndex &&
_packedOwnerships[tokenId] & _BITMASK_BURNED == 0;
}
function _isSenderApprovedOrOwner(
address approvedAddress,
address owner,
address msgSender
) private pure returns (bool result) {
assembly {
owner := and(owner, _BITMASK_ADDRESS)
msgSender := and(msgSender, _BITMASK_ADDRESS)
result := or(eq(msgSender, owner), eq(msgSender, approvedAddress))
}
}
function _getApprovedSlotAndAddress(uint256 tokenId)
private
view
returns (uint256 approvedAddressSlot, address approvedAddress)
{
TokenApprovalRef storage tokenApproval = _tokenApprovals[tokenId];
assembly {
approvedAddressSlot := tokenApproval.slot
approvedAddress := sload(approvedAddressSlot)
}
}
function transferFrom(
address from,
address to,
uint256 tokenId
) public payable virtual override {
uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId);
if (address(uint160(prevOwnershipPacked)) != from) revert TransferFromIncorrectOwner();
(uint256 approvedAddressSlot, address approvedAddress) = _getApprovedSlotAndAddress(tokenId);
if (!_isSenderApprovedOrOwner(approvedAddress, from, _msgSenderERC721A()))
if (!isApprovedForAll(from, _msgSenderERC721A())) revert TransferCallerNotOwnerNorApproved();
if (to == address(0)) revert TransferToZeroAddress();
_beforeTokenTransfers(from, to, tokenId, 1);
assembly {
if approvedAddress {
sstore(approvedAddressSlot, 0)
}
}
unchecked {
--_packedAddressData[from];
++_packedAddressData[to];
_packedOwnerships[tokenId] = _packOwnershipData(
to,
_BITMASK_NEXT_INITIALIZED | _nextExtraData(from, to, prevOwnershipPacked)
);
if (prevOwnershipPacked & _BITMASK_NEXT_INITIALIZED == 0) {
uint256 nextTokenId = tokenId + 1;
if (_packedOwnerships[nextTokenId] == 0) {
if (nextTokenId != _currentIndex) {
_packedOwnerships[nextTokenId] = prevOwnershipPacked;
}
}
}
}
emit Transfer(from, to, tokenId);
_afterTokenTransfers(from, to, tokenId, 1);
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public payable virtual override {
safeTransferFrom(from, to, tokenId, '');
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory _data
) public payable virtual override {
transferFrom(from, to, tokenId);
if (to.code.length != 0)
if (!_checkContractOnERC721Received(from, to, tokenId, _data)) {
revert TransferToNonERC721ReceiverImplementer();
}
}
function _beforeTokenTransfers(
address from,
address to,
uint256 startTokenId,
uint256 quantity
) internal virtual {}
function _afterTokenTransfers(
address from,
address to,
uint256 startTokenId,
uint256 quantity
) internal virtual {}
function _checkContractOnERC721Received(
address from,
address to,
uint256 tokenId,
bytes memory _data
) private returns (bool) {
try ERC721A__IERC721Receiver(to).onERC721Received(_msgSenderERC721A(), from, tokenId, _data) returns (
bytes4 retval
) {
return retval == ERC721A__IERC721Receiver(to).onERC721Received.selector;
} catch (bytes memory reason) {
if (reason.length == 0) {
revert TransferToNonERC721ReceiverImplementer();
} else {
assembly {
revert(add(32, reason), mload(reason))
}
}
}
}
function _mint(address to, uint256 quantity) internal virtual {
uint256 startTokenId = _currentIndex;
if (quantity == 0) revert MintZeroQuantity();
_beforeTokenTransfers(address(0), to, startTokenId, quantity);
unchecked {
_packedAddressData[to] += quantity * ((1 << _BITPOS_NUMBER_MINTED) | 1);
_packedOwnerships[startTokenId] = _packOwnershipData(
to,
_nextInitializedFlag(quantity) | _nextExtraData(address(0), to, 0)
);
uint256 toMasked;
uint256 end = startTokenId + quantity;
assembly {
toMasked := and(to, _BITMASK_ADDRESS)
log4(
0,
0,
_TRANSFER_EVENT_SIGNATURE,
0,
toMasked,
startTokenId
)
for {
let tokenId := add(startTokenId, 1)
} iszero(eq(tokenId, end)) {
tokenId := add(tokenId, 1)
} {
log4(0, 0, _TRANSFER_EVENT_SIGNATURE, 0, toMasked, tokenId)
}
}
if (toMasked == 0) revert MintToZeroAddress();
_currentIndex = end;
}
_afterTokenTransfers(address(0), to, startTokenId, quantity);
}
function _mintERC2309(address to, uint256 quantity) internal virtual {
uint256 startTokenId = _currentIndex;
if (to == address(0)) revert MintToZeroAddress();
if (quantity == 0) revert MintZeroQuantity();
if (quantity > _MAX_MINT_ERC2309_QUANTITY_LIMIT) revert MintERC2309QuantityExceedsLimit();
_beforeTokenTransfers(address(0), to, startTokenId, quantity);
unchecked {
_packedAddressData[to] += quantity * ((1 << _BITPOS_NUMBER_MINTED) | 1);
_packedOwnerships[startTokenId] = _packOwnershipData(
to,
_nextInitializedFlag(quantity) | _nextExtraData(address(0), to, 0)
);
emit ConsecutiveTransfer(startTokenId, startTokenId + quantity - 1, address(0), to);
_currentIndex = startTokenId + quantity;
}
_afterTokenTransfers(address(0), to, startTokenId, quantity);
}
function _safeMint(
address to,
uint256 quantity,
bytes memory _data
) internal virtual {
_mint(to, quantity);
unchecked {
if (to.code.length != 0) {
uint256 end = _currentIndex;
uint256 index = end - quantity;
do {
if (!_checkContractOnERC721Received(address(0), to, index++, _data)) {
revert TransferToNonERC721ReceiverImplementer();
}
} while (index < end);
if (_currentIndex != end) revert();
}
}
}
function _safeMint(address to, uint256 quantity) internal virtual {
_safeMint(to, quantity, '');
}
function _burn(uint256 tokenId) internal virtual {
_burn(tokenId, false);
}
function _burn(uint256 tokenId, bool approvalCheck) internal virtual {
uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId);
address from = address(uint160(prevOwnershipPacked));
(uint256 approvedAddressSlot, address approvedAddress) = _getApprovedSlotAndAddress(tokenId);
if (approvalCheck) {
if (!_isSenderApprovedOrOwner(approvedAddress, from, _msgSenderERC721A()))
if (!isApprovedForAll(from, _msgSenderERC721A())) revert TransferCallerNotOwnerNorApproved();
}
_beforeTokenTransfers(from, address(0), tokenId, 1);
assembly {
if approvedAddress {
sstore(approvedAddressSlot, 0)
}
}
unchecked {
_packedAddressData[from] += (1 << _BITPOS_NUMBER_BURNED) - 1;
_packedOwnerships[tokenId] = _packOwnershipData(
from,
(_BITMASK_BURNED | _BITMASK_NEXT_INITIALIZED) | _nextExtraData(from, address(0), prevOwnershipPacked)
);
if (prevOwnershipPacked & _BITMASK_NEXT_INITIALIZED == 0) {
uint256 nextTokenId = tokenId + 1;
if (_packedOwnerships[nextTokenId] == 0) {
if (nextTokenId != _currentIndex) {
_packedOwnerships[nextTokenId] = prevOwnershipPacked;
}
}
}
}
emit Transfer(from, address(0), tokenId);
_afterTokenTransfers(from, address(0), tokenId, 1);
unchecked {
_burnCounter++;
}
}
function _setExtraDataAt(uint256 index, uint24 extraData) internal virtual {
uint256 packed = _packedOwnerships[index];
if (packed == 0) revert OwnershipNotInitializedForExtraData();
uint256 extraDataCasted;
assembly {
extraDataCasted := extraData
}
packed = (packed & _BITMASK_EXTRA_DATA_COMPLEMENT) | (extraDataCasted << _BITPOS_EXTRA_DATA);
_packedOwnerships[index] = packed;
}
function _extraData(
address from,
address to,
uint24 previousExtraData
) internal view virtual returns (uint24) {}
function _nextExtraData(
address from,
address to,
uint256 prevOwnershipPacked
) private view returns (uint256) {
uint24 extraData = uint24(prevOwnershipPacked >> _BITPOS_EXTRA_DATA);
return uint256(_extraData(from, to, extraData)) << _BITPOS_EXTRA_DATA;
}
function _msgSenderERC721A() internal view virtual returns (address) {
return msg.sender;
}
function _toString(uint256 value) internal pure virtual returns (string memory str) {
assembly {
let m := add(mload(0x40), 0xa0)
mstore(0x40, m)
str := sub(m, 0x20)
mstore(str, 0)
let end := str
for { let temp := value } 1 {} {
str := sub(str, 1)
mstore8(str, add(48, mod(temp, 10)))
temp := div(temp, 10)
if iszero(temp) { break }
}
let length := sub(end, str)
str := sub(str, 0x20)
mstore(str, length)
}
}
}
文件 5 的 10:IDelegationRegistry.sol
pragma solidity ^0.8.17;
interface IDelegationRegistry {
enum DelegationType {
NONE,
ALL,
CONTRACT,
TOKEN
}
struct DelegationInfo {
DelegationType type_;
address vault;
address delegate;
address contract_;
uint256 tokenId;
}
struct ContractDelegation {
address contract_;
address delegate;
}
struct TokenDelegation {
address contract_;
uint256 tokenId;
address delegate;
}
event DelegateForAll(address vault, address delegate, bool value);
event DelegateForContract(address vault, address delegate, address contract_, bool value);
event DelegateForToken(address vault, address delegate, address contract_, uint256 tokenId, bool value);
event RevokeAllDelegates(address vault);
event RevokeDelegate(address vault, address delegate);
function delegateForAll(address delegate, bool value) external;
function delegateForContract(address delegate, address contract_, bool value) external;
function delegateForToken(address delegate, address contract_, uint256 tokenId, bool value) external;
function revokeAllDelegates() external;
function revokeDelegate(address delegate) external;
function revokeSelf(address vault) external;
function getDelegationsByDelegate(address delegate) external view returns (DelegationInfo[] memory);
function getDelegatesForAll(address vault) external view returns (address[] memory);
function getDelegatesForContract(address vault, address contract_) external view returns (address[] memory);
function getDelegatesForToken(address vault, address contract_, uint256 tokenId)
external
view
returns (address[] memory);
function getContractLevelDelegations(address vault)
external
view
returns (ContractDelegation[] memory delegations);
function getTokenLevelDelegations(address vault) external view returns (TokenDelegation[] memory delegations);
function checkDelegateForAll(address delegate, address vault) external view returns (bool);
function checkDelegateForContract(address delegate, address vault, address contract_)
external
view
returns (bool);
function checkDelegateForToken(address delegate, address vault, address contract_, uint256 tokenId)
external
view
returns (bool);
}
文件 6 的 10:IERC165.sol
pragma solidity ^0.8.0;
interface IERC165 {
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
文件 7 的 10:IERC721.sol
pragma solidity ^0.8.0;
import "../../utils/introspection/IERC165.sol";
interface IERC721 is IERC165 {
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
function balanceOf(address owner) external view returns (uint256 balance);
function ownerOf(uint256 tokenId) external view returns (address owner);
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes calldata data
) external;
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external;
function transferFrom(
address from,
address to,
uint256 tokenId
) external;
function approve(address to, uint256 tokenId) external;
function setApprovalForAll(address operator, bool _approved) external;
function getApproved(uint256 tokenId) external view returns (address operator);
function isApprovedForAll(address owner, address operator) external view returns (bool);
}
文件 8 的 10:IERC721A.sol
pragma solidity ^0.8.4;
interface IERC721A {
error ApprovalCallerNotOwnerNorApproved();
error ApprovalQueryForNonexistentToken();
error BalanceQueryForZeroAddress();
error MintToZeroAddress();
error MintZeroQuantity();
error OwnerQueryForNonexistentToken();
error TransferCallerNotOwnerNorApproved();
error TransferFromIncorrectOwner();
error TransferToNonERC721ReceiverImplementer();
error TransferToZeroAddress();
error URIQueryForNonexistentToken();
error MintERC2309QuantityExceedsLimit();
error OwnershipNotInitializedForExtraData();
struct TokenOwnership {
address addr;
uint64 startTimestamp;
bool burned;
uint24 extraData;
}
function totalSupply() external view returns (uint256);
function supportsInterface(bytes4 interfaceId) external view returns (bool);
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
function balanceOf(address owner) external view returns (uint256 balance);
function ownerOf(uint256 tokenId) external view returns (address owner);
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes calldata data
) external payable;
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external payable;
function transferFrom(
address from,
address to,
uint256 tokenId
) external payable;
function approve(address to, uint256 tokenId) external payable;
function setApprovalForAll(address operator, bool _approved) external;
function getApproved(uint256 tokenId) external view returns (address operator);
function isApprovedForAll(address owner, address operator) external view returns (bool);
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function tokenURI(uint256 tokenId) external view returns (string memory);
event ConsecutiveTransfer(uint256 indexed fromTokenId, uint256 toTokenId, address indexed from, address indexed to);
}
文件 9 的 10:IWETH.sol
pragma solidity ^0.8.17;
interface IWETH {
function balanceOf(address src) external view returns (uint);
function allowance(address src, address guy) external view returns (uint);
function deposit() external payable;
function withdraw(uint wad) external;
function totalSupply() external view returns (uint);
function approve(address guy, uint wad) external returns (bool);
function transfer(address dst, uint wad) external returns (bool);
function transferFrom(address src, address dst, uint wad) external returns (bool);
}
文件 10 的 10:Ownable.sol
pragma solidity ^0.8.0;
import "../utils/Context.sol";
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
_transferOwnership(_msgSender());
}
modifier onlyOwner() {
_checkOwner();
_;
}
function owner() public view virtual returns (address) {
return _owner;
}
function _checkOwner() internal view virtual {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
}
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
{
"compilationTarget": {
"contracts/DeadWillRise.sol": "DeadWillRise"
},
"evmVersion": "london",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": true,
"runs": 200
},
"remappings": []
}
[{"inputs":[{"internalType":"string","name":"mContractURI","type":"string"},{"internalType":"string","name":"mPlaceholderURI","type":"string"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ApprovalCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"ApprovalQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"BalanceQueryForZeroAddress","type":"error"},{"inputs":[],"name":"MintERC2309QuantityExceedsLimit","type":"error"},{"inputs":[],"name":"MintToZeroAddress","type":"error"},{"inputs":[],"name":"MintZeroQuantity","type":"error"},{"inputs":[],"name":"OwnerQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"OwnershipNotInitializedForExtraData","type":"error"},{"inputs":[],"name":"TransferCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"TransferFromIncorrectOwner","type":"error"},{"inputs":[],"name":"TransferToNonERC721ReceiverImplementer","type":"error"},{"inputs":[],"name":"TransferToZeroAddress","type":"error"},{"inputs":[],"name":"URIQueryForNonexistentToken","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"fromTokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"toTokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"ConsecutiveTransfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"groupNum","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"currentDay","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"riskChoice","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"activityOutcome","type":"uint256"}],"name":"GroupDailyActivity","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"groupNum","type":"uint256"},{"indexed":false,"internalType":"address","name":"collectionAddress","type":"address"},{"indexed":false,"internalType":"address","name":"groupManager","type":"address"}],"name":"GroupRegistered","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"groupNum","type":"uint256"},{"indexed":false,"internalType":"address","name":"collectionAddress","type":"address"},{"indexed":false,"internalType":"address","name":"groupManager","type":"address"}],"name":"GroupTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"IndividualCured","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"currentDay","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"riskChoice","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"activityOutcome","type":"uint256"}],"name":"IndividualDailyActivity","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"currentProgress","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"infectionRate","type":"uint256"}],"name":"InfectionSpreading","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"stateMutability":"payable","type":"fallback"},{"inputs":[],"name":"FINAL_CURE_COST","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"GROUP_DAILY_ACTIVITY_COST","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"GROUP_REGISTRATION_COST","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"INDIVIDUAL_DAILY_ACTIVITY_COST","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_DAY","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_SUPPLY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TOKEN_URI_SEPARATOR","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"collectionSeed","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"contractURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"cureIndividual","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"cureSupply","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"currentDay","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"currentInfectionProgress","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_groupNumber","type":"uint32"},{"internalType":"uint32","name":"_riskChoice","type":"uint32"}],"name":"dailyActivityGroup","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint32","name":"_riskChoice","type":"uint32"}],"name":"dailyActivityIndividual","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"declareLastSurvivor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"groupNumber","type":"uint32"}],"name":"declareWinningGroup","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_collectionAddress","type":"address"},{"internalType":"address","name":"_onBehalfOf","type":"address"}],"name":"delegateMint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"endEvent","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"eventOver","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"eventStartBlock","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"eventStartTime","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getCurrentRegistrationCost","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_groupNumber","type":"uint32"}],"name":"getGroupDailyActivityRecords","outputs":[{"components":[{"internalType":"uint32","name":"riskChoice","type":"uint32"},{"internalType":"uint32","name":"activityOutcome","type":"uint32"}],"internalType":"struct DeadWillRise.ActivityRecord[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_collectionAddress","type":"address"}],"name":"getGroupDailyActivityRecordsByAddress","outputs":[{"components":[{"internalType":"uint32","name":"riskChoice","type":"uint32"},{"internalType":"uint32","name":"activityOutcome","type":"uint32"}],"internalType":"struct DeadWillRise.ActivityRecord[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_groupNumber","type":"uint32"}],"name":"getGroupRate","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_groupNumber","type":"uint32"}],"name":"getGroupScore","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_collectionAddress","type":"address"}],"name":"getGroupScoreByAddress","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getIndividualDailyActivityRecords","outputs":[{"components":[{"internalType":"uint32","name":"riskChoice","type":"uint32"},{"internalType":"uint32","name":"activityOutcome","type":"uint32"}],"internalType":"struct DeadWillRise.ActivityRecord[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getIndividualLuck","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getIndividualOnlyScore","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bool","name":"ignoreBite","type":"bool"}],"name":"getIndividualRate","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getIndividualScore","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"groupActivity","outputs":[{"internalType":"uint32","name":"riskChoice","type":"uint32"},{"internalType":"uint32","name":"activityOutcome","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"groupBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"groupManager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"groupNumberToCollection","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"groupNumbers","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"groupRecord","outputs":[{"internalType":"uint32","name":"lastBlock","type":"uint32"},{"internalType":"uint32","name":"lastScore","type":"uint32"},{"internalType":"uint32","name":"groupSeed","type":"uint32"},{"internalType":"uint32","name":"totalMembers","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"groupRegistrationOpen","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"groupsRegistered","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"hostBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"includeStatsInURI","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"individualActivity","outputs":[{"internalType":"uint32","name":"riskChoice","type":"uint32"},{"internalType":"uint32","name":"activityOutcome","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"individualRecord","outputs":[{"internalType":"uint32","name":"lastBlock","type":"uint32"},{"internalType":"uint32","name":"lastScore","type":"uint32"},{"internalType":"uint32","name":"individualSeed","type":"uint32"},{"internalType":"uint32","name":"groupNumber","type":"uint32"},{"internalType":"bool","name":"bitten","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"infectionProgress","outputs":[{"internalType":"uint32","name":"lastBlock","type":"uint32"},{"internalType":"uint32","name":"lastProgress","type":"uint32"},{"internalType":"uint32","name":"infectionRate","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastSurvivorTokenID","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxPerGroup","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxPerWalletPerGroup","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"mintCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"mintIndividual","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_collectionAddress","type":"address"}],"name":"mintToGroup","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"publicMintOpen","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_collectionAddress","type":"address"}],"name":"registerGroup","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_infectionRate","type":"uint32"}],"name":"resumeEvent","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"baseURI","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"newContractURI","type":"string"}],"name":"setContractURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_stats","type":"bool"}],"name":"setIncludeStatsInURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_infectionProgress","type":"uint32"}],"name":"setInfectionProgress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_infectionRate","type":"uint32"},{"internalType":"uint32","name":"_progressAdder","type":"uint32"}],"name":"setInfectionRate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_groupOpen","type":"bool"},{"internalType":"bool","name":"_publicOpen","type":"bool"},{"internalType":"uint32","name":"_maxPerWalletPerGroup","type":"uint32"},{"internalType":"uint32","name":"_maxPerGroup","type":"uint32"}],"name":"setMintingVariables","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"placeholderURI","type":"string"}],"name":"setPlaceholderURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_infectionRate","type":"uint32"}],"name":"startEvent","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"survivorBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"sweepRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"tokensOfOwner","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSwept","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalWithdrawn","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_collectionAddress","type":"address"},{"internalType":"address","name":"_newManager","type":"address"}],"name":"transferGroupManagement","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unwrapWETH","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"winningGroupNumber","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"share","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]