Polygon Sponsored slots available. Book your slot here!
Overview
POL Balance
0 POL
POL Value
$0.00More Info
Private Name Tags
ContractCreator
Loading...
Loading
Contract Name:
KinoraQuestData
Compiler Version
v0.8.19+commit.7dd6d404
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: UNLICENSE pragma solidity ^0.8.19; import "./KinoraLibrary.sol"; import "./KinoraErrors.sol"; import "./KinoraEscrow.sol"; import "./KinoraMetrics.sol"; import "./KinoraAccessControl.sol"; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; contract KinoraQuestData { KinoraAccessControl public kinoraAccess; KinoraMetrics public kinoraMetrics; KinoraEscrow public kinoraEscrow; string public name; string public symbol; address public kinoraOpenAction; uint256 private _questCount; uint256 private _playerCount; mapping(uint256 => KinoraLibrary.Player) private _allPlayers; mapping(uint256 => KinoraLibrary.Quest) private _allQuests; mapping(string => uint256[]) private _idsToQuests; mapping(string => KinoraLibrary.VideoPost) private _idsToVideos; mapping(uint256 => mapping(uint256 => string)) private _postToPlayback; mapping(address => uint256) private _addressToProfile; mapping(uint256 => mapping(uint256 => uint256)) _questIdFromLensData; event QuestInstantiated(uint256 questId, uint256 milestoneCount); event PlayerJoinedQuest(uint256 questId, uint256 playerProfileId); event PlayerMetricsUpdated( uint256 playerProfileId, uint256 videoPubId, uint256 videoProfileId ); event QuestDeleted(uint256 questId); event QuestStatusUpdated(uint256 questId, KinoraLibrary.Status status); event MilestoneCompleted( uint256 questId, uint256 playerProfileId, uint256 milestone ); event QuestCompleted(uint256 questId, uint256 playerProfileId); event PlayerEligibleToClaimMilestone( uint256 playerProfileId, uint256 questId, uint256 milestone, bool eligibility ); modifier onlyKinoraOpenAction() { if (kinoraOpenAction != msg.sender) { revert KinoraErrors.InvalidContract(); } _; } modifier onlyKinoraEscrow() { if (address(kinoraEscrow) != msg.sender) { revert KinoraErrors.InvalidContract(); } _; } modifier onlyKinoraMetrics() { if (address(kinoraMetrics) != msg.sender) { revert KinoraErrors.InvalidContract(); } _; } modifier onlyMaintainer() { if (!kinoraAccess.isEnvoker(msg.sender)) { revert KinoraErrors.InvalidAddress(); } _; } modifier onlyMaintainerOrOpenAction() { if (!kinoraAccess.isEnvoker(msg.sender) && msg.sender != kinoraOpenAction) { revert KinoraErrors.InvalidAddress(); } _; } function initialize( address _kinoraAccessAddress, address _kinoraOpenActionAddress ) external { if (address(kinoraAccess) != address(0)) { revert KinoraErrors.AlreadyInitialized(); } name = "KinoraQuestData"; symbol = "KQD"; _questCount = 0; _playerCount = 0; kinoraAccess = KinoraAccessControl(_kinoraAccessAddress); kinoraOpenAction = _kinoraOpenActionAddress; } function configureNewQuest( KinoraLibrary.NewQuestParams memory _params ) external onlyKinoraOpenAction { _questCount++; KinoraLibrary.Quest storage newQuest = _allQuests[_questCount]; newQuest.questId = _questCount; newQuest.pubId = _params.pubId; newQuest.profileId = _params.profileId; newQuest.envoker = _params.envokerAddress; newQuest.maxPlayerCount = _params.maxPlayerCount; newQuest.status = KinoraLibrary.Status.Open; newQuest.gated = _params.gateLogic; newQuest.milestoneCount = _params.milestones.length; newQuest.uri = _params.uri; _setMilestones(_params.milestones, newQuest, _questCount); _questIdFromLensData[_params.profileId][_params.pubId] = _questCount; emit QuestInstantiated(_questCount, _params.milestones.length); } function joinQuest( address _playerAddress, uint256 _questId, uint256 _playerProfileId ) external onlyKinoraOpenAction { if (_allPlayers[_playerProfileId].activeSince == 0) { _playerCount++; _allPlayers[_playerProfileId].playerAddress = _playerAddress; _allPlayers[_playerProfileId].activeSince = block.timestamp; _addressToProfile[_playerAddress] = _playerProfileId; } _allPlayers[_playerProfileId].questsJoined.push(_questId); _allPlayers[_playerProfileId].joinedQuest[_questId] = true; _allQuests[_questId].players.push(_playerProfileId); emit PlayerJoinedQuest(_questId, _playerProfileId); } function playerEligibleToClaim( uint256 _playerProfileId, uint256 _questId, uint256 _milestone, bool _eligible ) external onlyKinoraMetrics { _allPlayers[_playerProfileId].eligibleToClaimMilestone[_questId][ _milestone - 1 ] = _eligible; emit PlayerEligibleToClaimMilestone( _playerProfileId, _questId, _milestone, _eligible ); } function completeMilestone( uint256 _questId, uint256 _playerProfileId ) external onlyKinoraOpenAction { uint256 _milestone = _allPlayers[_playerProfileId] .milestonesCompletedPerQuest[_questId] + 1; _allPlayers[_playerProfileId].milestonesCompletedPerQuest[ _questId ] = _milestone; emit MilestoneCompleted(_questId, _playerProfileId, _milestone); if (_milestone == _allQuests[_questId].milestoneCount) { _allPlayers[_playerProfileId].questsCompleted.push(_questId); emit QuestCompleted(_questId, _playerProfileId); } } function setKinoraMetricsContract( address _newMetricsContract ) external onlyMaintainerOrOpenAction { kinoraMetrics = KinoraMetrics(_newMetricsContract); } function setKinoraOpenActionContract( address _newOpenActionContract ) external onlyMaintainer { kinoraOpenAction = _newOpenActionContract; } function setKinoraAccessContract( address _newAccessContract ) external onlyMaintainer { kinoraAccess = KinoraAccessControl(_newAccessContract); } function setKinoraEscrowContract( address _newEscrowContract ) external onlyMaintainerOrOpenAction { kinoraEscrow = KinoraEscrow(_newEscrowContract); } function updateQuestStatus(uint256 _questId) external onlyKinoraEscrow { _allQuests[_questId].status = KinoraLibrary.Status.Closed; emit QuestStatusUpdated(_questId, _allQuests[_questId].status); } function updatePlayerMetrics( KinoraLibrary.PlayerVideoMetrics memory _metrics, uint256 _playerProfileId ) external onlyKinoraMetrics { if (_allPlayers[_playerProfileId].activeSince == 0) { revert KinoraErrors.PlayerNotEligible(); } if ( _allPlayers[_playerProfileId] .videoMetrics[_metrics.profileId][_metrics.pubId].profileId == 0 && _allPlayers[_playerProfileId] .videoMetrics[_metrics.profileId][_metrics.pubId].pubId == 0 ) { string memory _playback = _postToPlayback[_metrics.profileId][ _metrics.pubId ]; _allPlayers[_playerProfileId].videoBytes.push( _idsToVideos[_playback].videoBytes ); } _allPlayers[_playerProfileId].videoMetrics[_metrics.profileId][ _metrics.pubId ] = _metrics; emit PlayerMetricsUpdated( _playerProfileId, _metrics.pubId, _metrics.profileId ); } function _setMilestones( KinoraLibrary.MilestoneParameter[] memory _milestones, KinoraLibrary.Quest storage _newQuest, uint256 _questId ) private { for (uint256 i = 0; i < _milestones.length; i++) { KinoraLibrary.Milestone storage _newMilestone = _newQuest .milestones .push(); _newMilestone.milestone = i + 1; _newMilestone.gated = _milestones[i].gated; _newMilestone.videoLength = _milestones[i].videos.length; _newMilestone.rewardsLength = _milestones[i].rewards.length; _newMilestone.uri = _milestones[i].uri; _setRewards(_newMilestone, _milestones[i]); _setVideos(_newMilestone, _milestones[i], _questId); } } function _setRewards( KinoraLibrary.Milestone storage _newMilestone, KinoraLibrary.MilestoneParameter memory _paramsMilestone ) private { for (uint j = 0; j < _paramsMilestone.rewards.length; j++) { KinoraLibrary.Reward memory rewardMemory = _paramsMilestone.rewards[j]; KinoraLibrary.Reward storage rewardStorage = _newMilestone.rewards.push(); rewardStorage.rewardType = rewardMemory.rewardType; rewardStorage.uri = rewardMemory.uri; rewardStorage.tokenAddress = rewardMemory.tokenAddress; rewardStorage.amount = rewardMemory.amount; } } function _setVideos( KinoraLibrary.Milestone storage _newMilestone, KinoraLibrary.MilestoneParameter memory _paramsMilestone, uint256 _questId ) private { string[] memory _videoBytes = new string[](_paramsMilestone.videos.length); for (uint j = 0; j < _paramsMilestone.videos.length; j++) { KinoraLibrary.Video memory video = _paramsMilestone.videos[j]; _newMilestone.videos[video.profileId][video.pubId] = video; _idsToQuests[video.playerId].push(_questId); _idsToVideos[video.playerId] = KinoraLibrary.VideoPost({ pubId: video.pubId, profileId: video.profileId, videoBytes: video.videoBytes }); _postToPlayback[video.profileId][video.pubId] = video.playerId; _videoBytes[j] = video.videoBytes; } _newMilestone.videoBytes = _videoBytes; } function deleteQuest(uint256 _questId) external onlyKinoraEscrow { delete _allQuests[_questId]; emit QuestDeleted(_questId); } function getTotalQuestCount() public view returns (uint256) { return _questCount; } function getTotalPlayerCount() public view returns (uint256) { return _playerCount; } function getPlayerQuestsCompleted( uint256 _playerProfileId ) public view returns (uint256[] memory) { return _allPlayers[_playerProfileId].questsCompleted; } function getPlayerVideoAVD( uint256 _playerProfileId, uint256 _videoPubId, uint256 _videoProfileId ) public view returns (uint256) { return _allPlayers[_playerProfileId] .videoMetrics[_videoProfileId][_videoPubId].avd; } function getPlayerVideoSecondaryCommentOnComment( uint256 _playerProfileId, uint256 _videoPubId, uint256 _videoProfileId ) public view returns (uint256) { return _allPlayers[_playerProfileId] .videoMetrics[_videoProfileId][_videoPubId].secondaryCommentOnComment; } function getPlayerVideoSecondaryReactOnComment( uint256 _playerProfileId, uint256 _videoPubId, uint256 _videoProfileId ) public view returns (uint256) { return _allPlayers[_playerProfileId] .videoMetrics[_videoProfileId][_videoPubId].secondaryReactOnComment; } function getPlayerVideoSecondaryCollectOnComment( uint256 _playerProfileId, uint256 _videoPubId, uint256 _videoProfileId ) public view returns (uint256) { return _allPlayers[_playerProfileId] .videoMetrics[_videoProfileId][_videoPubId].secondaryCollectOnComment; } function getPlayerVideoSecondaryMirrorOnComment( uint256 _playerProfileId, uint256 _videoPubId, uint256 _videoProfileId ) public view returns (uint256) { return _allPlayers[_playerProfileId] .videoMetrics[_videoProfileId][_videoPubId].secondaryMirrorOnComment; } function getPlayerVideoSecondaryQuoteOnComment( uint256 _playerProfileId, uint256 _videoPubId, uint256 _videoProfileId ) public view returns (uint256) { return _allPlayers[_playerProfileId] .videoMetrics[_videoProfileId][_videoPubId].secondaryQuoteOnComment; } function getPlayerVideoSecondaryCollectOnQuote( uint256 _playerProfileId, uint256 _videoPubId, uint256 _videoProfileId ) public view returns (uint256) { return _allPlayers[_playerProfileId] .videoMetrics[_videoProfileId][_videoPubId].secondaryCollectOnQuote; } function getPlayerVideoSecondaryReactOnQuote( uint256 _playerProfileId, uint256 _videoPubId, uint256 _videoProfileId ) public view returns (uint256) { return _allPlayers[_playerProfileId] .videoMetrics[_videoProfileId][_videoPubId].secondaryReactOnQuote; } function getPlayerVideoSecondaryMirrorOnQuote( uint256 _playerProfileId, uint256 _videoPubId, uint256 _videoProfileId ) public view returns (uint256) { return _allPlayers[_playerProfileId] .videoMetrics[_videoProfileId][_videoPubId].secondaryMirrorOnQuote; } function getPlayerVideoSecondaryCommentOnQuote( uint256 _playerProfileId, uint256 _videoPubId, uint256 _videoProfileId ) public view returns (uint256) { return _allPlayers[_playerProfileId] .videoMetrics[_videoProfileId][_videoPubId].secondaryCommentOnQuote; } function getPlayerVideoSecondaryQuoteOnQuote( uint256 _playerProfileId, uint256 _videoPubId, uint256 _videoProfileId ) public view returns (uint256) { return _allPlayers[_playerProfileId] .videoMetrics[_videoProfileId][_videoPubId].secondaryQuoteOnQuote; } function getPlayerVideoMostReplayedArea( uint256 _playerProfileId, uint256 _videoPubId, uint256 _videoProfileId ) public view returns (string memory) { return _allPlayers[_playerProfileId] .videoMetrics[_videoProfileId][_videoPubId].mostReplayedArea; } function getPlayerVideoDuration( uint256 _playerProfileId, uint256 _videoPubId, uint256 _videoProfileId ) public view returns (uint256) { return _allPlayers[_playerProfileId] .videoMetrics[_videoProfileId][_videoPubId].duration; } function getPlayerVideoBytes( uint256 _playerProfileId ) public view returns (string[] memory) { return _allPlayers[_playerProfileId].videoBytes; } function getPlayerVideoBookmark( uint256 _playerProfileId, uint256 _videoPubId, uint256 _videoProfileId ) public view returns (bool) { return _allPlayers[_playerProfileId] .videoMetrics[_videoProfileId][_videoPubId].hasBookmarked; } function getPlayerVideoComment( uint256 _playerProfileId, uint256 _videoPubId, uint256 _videoProfileId ) public view returns (bool) { return _allPlayers[_playerProfileId] .videoMetrics[_videoProfileId][_videoPubId].hasCommented; } function getPlayerVideoQuote( uint256 _playerProfileId, uint256 _videoPubId, uint256 _videoProfileId ) public view returns (bool) { return _allPlayers[_playerProfileId] .videoMetrics[_videoProfileId][_videoPubId].hasQuoted; } function getPlayerVideoMirror( uint256 _playerProfileId, uint256 _videoPubId, uint256 _videoProfileId ) public view returns (bool) { return _allPlayers[_playerProfileId] .videoMetrics[_videoProfileId][_videoPubId].hasMirrored; } function getPlayerVideoReact( uint256 _playerProfileId, uint256 _videoPubId, uint256 _videoProfileId ) public view returns (bool) { return _allPlayers[_playerProfileId] .videoMetrics[_videoProfileId][_videoPubId].hasReacted; } function getPlayerVideoPlayCount( uint256 _playerProfileId, uint256 _videoPubId, uint256 _videoProfileId ) public view returns (uint256) { return _allPlayers[_playerProfileId] .videoMetrics[_videoProfileId][_videoPubId].playCount; } function getPlayerMilestonesCompletedPerQuest( uint256 _playerProfileId, uint256 _questId ) public view returns (uint256) { return _allPlayers[_playerProfileId].milestonesCompletedPerQuest[_questId]; } function getPlayerEligibleToClaimMilestone( uint256 _playerProfileId, uint256 _questId, uint256 _milestone ) public view returns (bool) { return _allPlayers[_playerProfileId].eligibleToClaimMilestone[_questId][ _milestone - 1 ]; } function getPlayerActiveSince( uint256 _playerProfileId ) public view returns (uint256) { return _allPlayers[_playerProfileId].activeSince; } function getPlayerAddress( uint256 _playerProfileId ) public view returns (address) { return _allPlayers[_playerProfileId].playerAddress; } function getPlayerQuestsJoined( uint256 _playerProfileId ) public view returns (uint256[] memory) { return _allPlayers[_playerProfileId].questsJoined; } function getPlayerHasJoinedQuest( uint256 _playerProfileId, uint256 _questId ) public view returns (bool) { return _allPlayers[_playerProfileId].joinedQuest[_questId]; } function getQuestEnvoker(uint256 _questId) public view returns (address) { return _allQuests[_questId].envoker; } function getQuestPlayers( uint256 _questId ) public view returns (uint256[] memory) { return _allQuests[_questId].players; } function getQuestMaxPlayerCount( uint256 _questId ) public view returns (uint256) { return _allQuests[_questId].maxPlayerCount; } function getQuestStatus( uint256 _questId ) public view returns (KinoraLibrary.Status) { return _allQuests[_questId].status; } function getMilestoneCount(uint256 _questId) public view returns (uint256) { return _allQuests[_questId].milestoneCount; } function getQuestPubId(uint256 _questId) public view returns (uint256) { return _allQuests[_questId].pubId; } function getQuestProfileId(uint256 _questId) public view returns (uint256) { return _allQuests[_questId].profileId; } function getQuestURI(uint256 _questId) public view returns (string memory) { return _allQuests[_questId].uri; } function getQuestGatedERC721Addresses( uint256 _questId ) public view returns (address[] memory) { return _allQuests[_questId].gated.erc721Addresses; } function getQuestGatedERC721TokenIds( uint256 _questId ) public view returns (uint256[][] memory) { return _allQuests[_questId].gated.erc721TokenIds; } function getQuestGatedERC721TokenURIs( uint256 _questId ) public view returns (string[][] memory) { return _allQuests[_questId].gated.erc721TokenURIs; } function getQuestGatedOneOf(uint256 _questId) public view returns (bool) { return _allQuests[_questId].gated.oneOf; } function getQuestGatedERC20Addresses( uint256 _questId ) public view returns (address[] memory) { return _allQuests[_questId].gated.erc20Addresses; } function getQuestGatedERC20Thresholds( uint256 _questId ) public view returns (uint256[] memory) { return _allQuests[_questId].gated.erc20Thresholds; } function getMilestoneURI( uint256 _questId, uint256 _milestone ) public view returns (string memory) { return _allQuests[_questId].milestones[_milestone - 1].uri; } function getMilestoneGatedERC721Addresses( uint256 _questId, uint256 _milestone ) public view returns (address[] memory) { return _allQuests[_questId].milestones[_milestone - 1].gated.erc721Addresses; } function getMilestoneGatedERC721TokenIds( uint256 _questId, uint256 _milestone ) public view returns (uint256[][] memory) { return _allQuests[_questId].milestones[_milestone - 1].gated.erc721TokenIds; } function getMilestoneGatedERC721TokenURIs( uint256 _questId, uint256 _milestone ) public view returns (string[][] memory) { return _allQuests[_questId].milestones[_milestone - 1].gated.erc721TokenURIs; } function getMilestoneVideoLength( uint256 _questId, uint256 _milestone ) public view returns (uint256) { return _allQuests[_questId].milestones[_milestone - 1].videoLength; } function getMilestoneRewardsLength( uint256 _questId, uint256 _milestone ) public view returns (uint256) { return _allQuests[_questId].milestones[_milestone - 1].rewardsLength; } function getMilestoneVideos( uint256 _questId, uint256 _milestone ) public view returns (string[] memory) { return _allQuests[_questId].milestones[_milestone - 1].videoBytes; } function getMilestoneVideoMinPlayCount( uint256 _questId, uint256 _milestone, uint256 _videoProfileId, uint256 _videoPubId ) public view returns (uint256) { return _allQuests[_questId] .milestones[_milestone - 1] .videos[_videoProfileId][_videoPubId].minPlayCount; } function getMilestoneVideoMinDuration( uint256 _questId, uint256 _milestone, uint256 _videoProfileId, uint256 _videoPubId ) public view returns (uint256) { return _allQuests[_questId] .milestones[_milestone - 1] .videos[_videoProfileId][_videoPubId].minDuration; } function getMilestoneVideoMinSecondaryQuoteOnQuote( uint256 _questId, uint256 _milestone, uint256 _videoProfileId, uint256 _videoPubId ) public view returns (uint256) { return _allQuests[_questId] .milestones[_milestone - 1] .videos[_videoProfileId][_videoPubId].minSecondaryQuoteOnQuote; } function getMilestoneVideoMinSecondaryCollectOnQuote( uint256 _questId, uint256 _milestone, uint256 _videoProfileId, uint256 _videoPubId ) public view returns (uint256) { return _allQuests[_questId] .milestones[_milestone - 1] .videos[_videoProfileId][_videoPubId].minSecondaryCollectOnQuote; } function getMilestoneVideoMinSecondaryCommentOnQuote( uint256 _questId, uint256 _milestone, uint256 _videoProfileId, uint256 _videoPubId ) public view returns (uint256) { return _allQuests[_questId] .milestones[_milestone - 1] .videos[_videoProfileId][_videoPubId].minSecondaryCommentOnQuote; } function getMilestoneVideoMinSecondaryReactOnQuote( uint256 _questId, uint256 _milestone, uint256 _videoProfileId, uint256 _videoPubId ) public view returns (uint256) { return _allQuests[_questId] .milestones[_milestone - 1] .videos[_videoProfileId][_videoPubId].minSecondaryReactOnQuote; } function getMilestoneVideoMinSecondaryMirrorOnQuote( uint256 _questId, uint256 _milestone, uint256 _videoProfileId, uint256 _videoPubId ) public view returns (uint256) { return _allQuests[_questId] .milestones[_milestone - 1] .videos[_videoProfileId][_videoPubId].minSecondaryMirrorOnQuote; } function getMilestoneVideoMinSecondaryCommentOnComment( uint256 _questId, uint256 _milestone, uint256 _videoProfileId, uint256 _videoPubId ) public view returns (uint256) { return _allQuests[_questId] .milestones[_milestone - 1] .videos[_videoProfileId][_videoPubId].minSecondaryCommentOnComment; } function getMilestoneVideoMinSecondaryMirrorOnComment( uint256 _questId, uint256 _milestone, uint256 _videoProfileId, uint256 _videoPubId ) public view returns (uint256) { return _allQuests[_questId] .milestones[_milestone - 1] .videos[_videoProfileId][_videoPubId].minSecondaryMirrorOnComment; } function getMilestoneVideoMinSecondaryQuoteOnComment( uint256 _questId, uint256 _milestone, uint256 _videoProfileId, uint256 _videoPubId ) public view returns (uint256) { return _allQuests[_questId] .milestones[_milestone - 1] .videos[_videoProfileId][_videoPubId].minSecondaryQuoteOnComment; } function getMilestoneVideoMinSecondaryReactOnComment( uint256 _questId, uint256 _milestone, uint256 _videoProfileId, uint256 _videoPubId ) public view returns (uint256) { return _allQuests[_questId] .milestones[_milestone - 1] .videos[_videoProfileId][_videoPubId].minSecondaryReactOnComment; } function getMilestoneVideoMinSecondaryCollectOnComment( uint256 _questId, uint256 _milestone, uint256 _videoProfileId, uint256 _videoPubId ) public view returns (uint256) { return _allQuests[_questId] .milestones[_milestone - 1] .videos[_videoProfileId][_videoPubId].minSecondaryCollectOnComment; } function getMilestoneVideoQuote( uint256 _questId, uint256 _milestone, uint256 _videoProfileId, uint256 _videoPubId ) public view returns (bool) { return _allQuests[_questId] .milestones[_milestone - 1] .videos[_videoProfileId][_videoPubId].quote; } function getMilestoneVideoMirror( uint256 _questId, uint256 _milestone, uint256 _videoProfileId, uint256 _videoPubId ) public view returns (bool) { return _allQuests[_questId] .milestones[_milestone - 1] .videos[_videoProfileId][_videoPubId].mirror; } function getMilestoneVideoBookmark( uint256 _questId, uint256 _milestone, uint256 _videoProfileId, uint256 _videoPubId ) public view returns (bool) { return _allQuests[_questId] .milestones[_milestone - 1] .videos[_videoProfileId][_videoPubId].bookmark; } function getMilestoneVideoReact( uint256 _questId, uint256 _milestone, uint256 _videoProfileId, uint256 _videoPubId ) public view returns (bool) { return _allQuests[_questId] .milestones[_milestone - 1] .videos[_videoProfileId][_videoPubId].react; } function getMilestoneVideoComment( uint256 _questId, uint256 _milestone, uint256 _videoProfileId, uint256 _videoPubId ) public view returns (bool) { return _allQuests[_questId] .milestones[_milestone - 1] .videos[_videoProfileId][_videoPubId].comment; } function getMilestoneVideoMinAVD( uint256 _questId, uint256 _milestone, uint256 _videoProfileId, uint256 _videoPubId ) public view returns (uint256) { return _allQuests[_questId] .milestones[_milestone - 1] .videos[_videoProfileId][_videoPubId].minAVD; } function getMilestoneVideoFactoryIds( uint256 _questId, uint256 _milestone, uint256 _videoProfileId, uint256 _videoPubId ) public view returns (uint256[] memory) { return _allQuests[_questId] .milestones[_milestone - 1] .videos[_videoProfileId][_videoPubId].factoryIds; } function getMilestoneGatedOneOf( uint256 _questId, uint256 _milestone ) public view returns (bool) { return _allQuests[_questId].milestones[_milestone - 1].gated.oneOf; } function getMilestoneGatedERC20Addresses( uint256 _questId, uint256 _milestone ) public view returns (address[] memory) { return _allQuests[_questId].milestones[_milestone - 1].gated.erc20Addresses; } function getMilestoneGatedERC20Thresholds( uint256 _questId, uint256 _milestone ) public view returns (uint256[] memory) { return _allQuests[_questId].milestones[_milestone - 1].gated.erc20Thresholds; } function getMilestoneRewardType( uint256 _questId, uint256 _rewardIndex, uint256 _milestone ) public view returns (KinoraLibrary.RewardType) { return _allQuests[_questId] .milestones[_milestone - 1] .rewards[_rewardIndex] .rewardType; } function getMilestoneRewardTokenAddress( uint256 _questId, uint256 _rewardIndex, uint256 _milestone ) public view returns (address) { return _allQuests[_questId] .milestones[_milestone - 1] .rewards[_rewardIndex] .tokenAddress; } function getMilestoneRewardTokenAmount( uint256 _questId, uint256 _rewardIndex, uint256 _milestone ) public view returns (uint256) { return _allQuests[_questId] .milestones[_milestone - 1] .rewards[_rewardIndex] .amount; } function getMilestoneRewardURI( uint256 _questId, uint256 _rewardIndex, uint256 _milestone ) public view returns (string memory) { return _allQuests[_questId].milestones[_milestone - 1].rewards[_rewardIndex].uri; } function getQuestIdsToVideoPlaybackId( string memory _playbackId ) public view returns (uint256[] memory) { return _idsToQuests[_playbackId]; } function getVideoPubIdFromPlaybackId( string memory _playbackId ) public view returns (uint256) { return _idsToVideos[_playbackId].pubId; } function getVideoProfileIdFromPlaybackId( string memory _playbackId ) public view returns (uint256) { return _idsToVideos[_playbackId].profileId; } function getVideoBytesFromPlaybackId( string memory _playbackId ) public view returns (string memory) { return _idsToVideos[_playbackId].videoBytes; } function getVideoPlaybackId( uint256 _pubId, uint256 _profileId ) public view returns (string memory) { return _postToPlayback[_profileId][_pubId]; } function getAddressToProfileId( address _playerAddress ) public view returns (uint256) { return _addressToProfile[_playerAddress]; } function getQuestIdFromLensData( uint256 _profileId, uint256 _pubId ) public view returns (uint256) { return _questIdFromLensData[_profileId][_pubId]; } function getLensDataFromQuestId( uint256 _questId ) public view returns (uint256, uint256) { return (_allQuests[_questId].profileId, _allQuests[_questId].pubId); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.1) (proxy/utils/Initializable.sol) pragma solidity ^0.8.2; import "../../utils/AddressUpgradeable.sol"; /** * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect. * * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in * case an upgrade adds a module that needs to be initialized. * * For example: * * [.hljs-theme-light.nopadding] * ``` * contract MyToken is ERC20Upgradeable { * function initialize() initializer public { * __ERC20_init("MyToken", "MTK"); * } * } * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable { * function initializeV2() reinitializer(2) public { * __ERC20Permit_init("MyToken"); * } * } * ``` * * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}. * * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity. * * [CAUTION] * ==== * Avoid leaving a contract uninitialized. * * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed: * * [.hljs-theme-light.nopadding] * ``` * /// @custom:oz-upgrades-unsafe-allow constructor * constructor() { * _disableInitializers(); * } * ``` * ==== */ abstract contract Initializable { /** * @dev Indicates that the contract has been initialized. * @custom:oz-retyped-from bool */ uint8 private _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool private _initializing; /** * @dev Triggered when the contract has been initialized or reinitialized. */ event Initialized(uint8 version); /** * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope, * `onlyInitializing` functions can be used to initialize parent contracts. * * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a * constructor. * * Emits an {Initialized} event. */ modifier initializer() { bool isTopLevelCall = !_initializing; require( (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1), "Initializable: contract is already initialized" ); _initialized = 1; if (isTopLevelCall) { _initializing = true; } _; if (isTopLevelCall) { _initializing = false; emit Initialized(1); } } /** * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be * used to initialize parent contracts. * * A reinitializer may be used after the original initialization step. This is essential to configure modules that * are added through upgrades and that require initialization. * * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer` * cannot be nested. If one is invoked in the context of another, execution will revert. * * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in * a contract, executing them in the right order is up to the developer or operator. * * WARNING: setting the version to 255 will prevent any future reinitialization. * * Emits an {Initialized} event. */ modifier reinitializer(uint8 version) { require(!_initializing && _initialized < version, "Initializable: contract is already initialized"); _initialized = version; _initializing = true; _; _initializing = false; emit Initialized(version); } /** * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the * {initializer} and {reinitializer} modifiers, directly or indirectly. */ modifier onlyInitializing() { require(_initializing, "Initializable: contract is not initializing"); _; } /** * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call. * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized * to any version. It is recommended to use this to lock implementation contracts that are designed to be called * through proxies. * * Emits an {Initialized} event the first time it is successfully executed. */ function _disableInitializers() internal virtual { require(!_initializing, "Initializable: contract is initializing"); if (_initialized < type(uint8).max) { _initialized = type(uint8).max; emit Initialized(type(uint8).max); } } /** * @dev Returns the highest version that has been initialized. See {reinitializer}. */ function _getInitializedVersion() internal view returns (uint8) { return _initialized; } /** * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}. */ function _isInitializing() internal view returns (bool) { return _initializing; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library AddressUpgradeable { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract. * * _Available since v4.8._ */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata, string memory errorMessage ) internal view returns (bytes memory) { if (success) { if (returndata.length == 0) { // only check isContract if the call was successful and the return data is empty // otherwise we already know that it was a contract require(isContract(target), "Address: call to non-contract"); } return returndata; } else { _revert(returndata, errorMessage); } } /** * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason or using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { _revert(returndata, errorMessage); } } function _revert(bytes memory returndata, string memory errorMessage) private pure { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `from` to `to` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address from, address to, uint256 amount) external returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC721/ERC721.sol) pragma solidity ^0.8.0; import "./IERC721.sol"; import "./IERC721Receiver.sol"; import "./extensions/IERC721Metadata.sol"; import "../../utils/Address.sol"; import "../../utils/Context.sol"; import "../../utils/Strings.sol"; import "../../utils/introspection/ERC165.sol"; /** * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including * the Metadata extension, but not including the Enumerable extension, which is available separately as * {ERC721Enumerable}. */ contract ERC721 is Context, ERC165, IERC721, IERC721Metadata { using Address for address; using Strings for uint256; // Token name string private _name; // Token symbol string private _symbol; // Mapping from token ID to owner address mapping(uint256 => address) private _owners; // Mapping owner address to token count mapping(address => uint256) private _balances; // Mapping from token ID to approved address mapping(uint256 => address) private _tokenApprovals; // Mapping from owner to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; /** * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection. */ constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IERC721).interfaceId || interfaceId == type(IERC721Metadata).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721-balanceOf}. */ function balanceOf(address owner) public view virtual override returns (uint256) { require(owner != address(0), "ERC721: address zero is not a valid owner"); return _balances[owner]; } /** * @dev See {IERC721-ownerOf}. */ function ownerOf(uint256 tokenId) public view virtual override returns (address) { address owner = _ownerOf(tokenId); require(owner != address(0), "ERC721: invalid token ID"); return owner; } /** * @dev See {IERC721Metadata-name}. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev See {IERC721Metadata-symbol}. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { _requireMinted(tokenId); string memory baseURI = _baseURI(); return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : ""; } /** * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each * token will be the concatenation of the `baseURI` and the `tokenId`. Empty * by default, can be overridden in child contracts. */ function _baseURI() internal view virtual returns (string memory) { return ""; } /** * @dev See {IERC721-approve}. */ function approve(address to, uint256 tokenId) public virtual override { address owner = ERC721.ownerOf(tokenId); require(to != owner, "ERC721: approval to current owner"); require( _msgSender() == owner || isApprovedForAll(owner, _msgSender()), "ERC721: approve caller is not token owner or approved for all" ); _approve(to, tokenId); } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view virtual override returns (address) { _requireMinted(tokenId); return _tokenApprovals[tokenId]; } /** * @dev See {IERC721-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { _setApprovalForAll(_msgSender(), operator, approved); } /** * @dev See {IERC721-isApprovedForAll}. */ function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { return _operatorApprovals[owner][operator]; } /** * @dev See {IERC721-transferFrom}. */ function transferFrom(address from, address to, uint256 tokenId) public virtual override { //solhint-disable-next-line max-line-length require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner or approved"); _transfer(from, to, tokenId); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom(address from, address to, uint256 tokenId) public virtual override { safeTransferFrom(from, to, tokenId, ""); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public virtual override { require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner or approved"); _safeTransfer(from, to, tokenId, data); } /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * `data` is additional data, it has no specified format and it is sent in call to `to`. * * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g. * implement alternative mechanisms to perform token transfer, such as signature-based. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeTransfer(address from, address to, uint256 tokenId, bytes memory data) internal virtual { _transfer(from, to, tokenId); require(_checkOnERC721Received(from, to, tokenId, data), "ERC721: transfer to non ERC721Receiver implementer"); } /** * @dev Returns the owner of the `tokenId`. Does NOT revert if token doesn't exist */ function _ownerOf(uint256 tokenId) internal view virtual returns (address) { return _owners[tokenId]; } /** * @dev Returns whether `tokenId` exists. * * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}. * * Tokens start existing when they are minted (`_mint`), * and stop existing when they are burned (`_burn`). */ function _exists(uint256 tokenId) internal view virtual returns (bool) { return _ownerOf(tokenId) != address(0); } /** * @dev Returns whether `spender` is allowed to manage `tokenId`. * * Requirements: * * - `tokenId` must exist. */ function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) { address owner = ERC721.ownerOf(tokenId); return (spender == owner || isApprovedForAll(owner, spender) || getApproved(tokenId) == spender); } /** * @dev Safely mints `tokenId` and transfers it to `to`. * * Requirements: * * - `tokenId` must not exist. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeMint(address to, uint256 tokenId) internal virtual { _safeMint(to, tokenId, ""); } /** * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is * forwarded in {IERC721Receiver-onERC721Received} to contract recipients. */ function _safeMint(address to, uint256 tokenId, bytes memory data) internal virtual { _mint(to, tokenId); require( _checkOnERC721Received(address(0), to, tokenId, data), "ERC721: transfer to non ERC721Receiver implementer" ); } /** * @dev Mints `tokenId` and transfers it to `to`. * * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible * * Requirements: * * - `tokenId` must not exist. * - `to` cannot be the zero address. * * Emits a {Transfer} event. */ function _mint(address to, uint256 tokenId) internal virtual { require(to != address(0), "ERC721: mint to the zero address"); require(!_exists(tokenId), "ERC721: token already minted"); _beforeTokenTransfer(address(0), to, tokenId, 1); // Check that tokenId was not minted by `_beforeTokenTransfer` hook require(!_exists(tokenId), "ERC721: token already minted"); unchecked { // Will not overflow unless all 2**256 token ids are minted to the same owner. // Given that tokens are minted one by one, it is impossible in practice that // this ever happens. Might change if we allow batch minting. // The ERC fails to describe this case. _balances[to] += 1; } _owners[tokenId] = to; emit Transfer(address(0), to, tokenId); _afterTokenTransfer(address(0), to, tokenId, 1); } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * This is an internal function that does not check if the sender is authorized to operate on the token. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId) internal virtual { address owner = ERC721.ownerOf(tokenId); _beforeTokenTransfer(owner, address(0), tokenId, 1); // Update ownership in case tokenId was transferred by `_beforeTokenTransfer` hook owner = ERC721.ownerOf(tokenId); // Clear approvals delete _tokenApprovals[tokenId]; unchecked { // Cannot overflow, as that would require more tokens to be burned/transferred // out than the owner initially received through minting and transferring in. _balances[owner] -= 1; } delete _owners[tokenId]; emit Transfer(owner, address(0), tokenId); _afterTokenTransfer(owner, address(0), tokenId, 1); } /** * @dev Transfers `tokenId` from `from` to `to`. * As opposed to {transferFrom}, this imposes no restrictions on msg.sender. * * Requirements: * * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * * Emits a {Transfer} event. */ function _transfer(address from, address to, uint256 tokenId) internal virtual { require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner"); require(to != address(0), "ERC721: transfer to the zero address"); _beforeTokenTransfer(from, to, tokenId, 1); // Check that tokenId was not transferred by `_beforeTokenTransfer` hook require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner"); // Clear approvals from the previous owner delete _tokenApprovals[tokenId]; unchecked { // `_balances[from]` cannot overflow for the same reason as described in `_burn`: // `from`'s balance is the number of token held, which is at least one before the current // transfer. // `_balances[to]` could overflow in the conditions described in `_mint`. That would require // all 2**256 token ids to be minted, which in practice is impossible. _balances[from] -= 1; _balances[to] += 1; } _owners[tokenId] = to; emit Transfer(from, to, tokenId); _afterTokenTransfer(from, to, tokenId, 1); } /** * @dev Approve `to` to operate on `tokenId` * * Emits an {Approval} event. */ function _approve(address to, uint256 tokenId) internal virtual { _tokenApprovals[tokenId] = to; emit Approval(ERC721.ownerOf(tokenId), to, tokenId); } /** * @dev Approve `operator` to operate on all of `owner` tokens * * Emits an {ApprovalForAll} event. */ function _setApprovalForAll(address owner, address operator, bool approved) internal virtual { require(owner != operator, "ERC721: approve to caller"); _operatorApprovals[owner][operator] = approved; emit ApprovalForAll(owner, operator, approved); } /** * @dev Reverts if the `tokenId` has not been minted yet. */ function _requireMinted(uint256 tokenId) internal view virtual { require(_exists(tokenId), "ERC721: invalid token ID"); } /** * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address. * The call is not executed if the target address is not a contract. * * @param from address representing the previous owner of the given token ID * @param to target address that will receive the tokens * @param tokenId uint256 ID of the token to be transferred * @param data bytes optional data to send along with the call * @return bool whether the call correctly returned the expected magic value */ function _checkOnERC721Received( address from, address to, uint256 tokenId, bytes memory data ) private returns (bool) { if (to.isContract()) { try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, data) returns (bytes4 retval) { return retval == IERC721Receiver.onERC721Received.selector; } catch (bytes memory reason) { if (reason.length == 0) { revert("ERC721: transfer to non ERC721Receiver implementer"); } else { /// @solidity memory-safe-assembly assembly { revert(add(32, reason), mload(reason)) } } } } else { return true; } } /** * @dev Hook that is called before any token transfer. This includes minting and burning. If {ERC721Consecutive} is * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s tokens will be transferred to `to`. * - When `from` is zero, the tokens will be minted for `to`. * - When `to` is zero, ``from``'s tokens will be burned. * - `from` and `to` are never both zero. * - `batchSize` is non-zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer(address from, address to, uint256 firstTokenId, uint256 batchSize) internal virtual {} /** * @dev Hook that is called after any token transfer. This includes minting and burning. If {ERC721Consecutive} is * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s tokens were transferred to `to`. * - When `from` is zero, the tokens were minted for `to`. * - When `to` is zero, ``from``'s tokens were burned. * - `from` and `to` are never both zero. * - `batchSize` is non-zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _afterTokenTransfer(address from, address to, uint256 firstTokenId, uint256 batchSize) internal virtual {} /** * @dev Unsafe write access to the balances, used by extensions that "mint" tokens using an {ownerOf} override. * * WARNING: Anyone calling this MUST ensure that the balances remain consistent with the ownership. The invariant * being that for any address `a` the value returned by `balanceOf(a)` must be equal to the number of tokens such * that `ownerOf(tokenId)` is `a`. */ // solhint-disable-next-line func-name-mixedcase function __unsafe_increaseBalance(address account, uint256 amount) internal { _balances[account] += amount; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/extensions/ERC721Enumerable.sol) pragma solidity ^0.8.0; import "../ERC721.sol"; import "./IERC721Enumerable.sol"; /** * @dev This implements an optional extension of {ERC721} defined in the EIP that adds * enumerability of all the token ids in the contract as well as all token ids owned by each * account. */ abstract contract ERC721Enumerable is ERC721, IERC721Enumerable { // Mapping from owner to list of owned token IDs mapping(address => mapping(uint256 => uint256)) private _ownedTokens; // Mapping from token ID to index of the owner tokens list mapping(uint256 => uint256) private _ownedTokensIndex; // Array with all token ids, used for enumeration uint256[] private _allTokens; // Mapping from token id to position in the allTokens array mapping(uint256 => uint256) private _allTokensIndex; /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721) returns (bool) { return interfaceId == type(IERC721Enumerable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}. */ function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override returns (uint256) { require(index < ERC721.balanceOf(owner), "ERC721Enumerable: owner index out of bounds"); return _ownedTokens[owner][index]; } /** * @dev See {IERC721Enumerable-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _allTokens.length; } /** * @dev See {IERC721Enumerable-tokenByIndex}. */ function tokenByIndex(uint256 index) public view virtual override returns (uint256) { require(index < ERC721Enumerable.totalSupply(), "ERC721Enumerable: global index out of bounds"); return _allTokens[index]; } /** * @dev See {ERC721-_beforeTokenTransfer}. */ function _beforeTokenTransfer( address from, address to, uint256 firstTokenId, uint256 batchSize ) internal virtual override { super._beforeTokenTransfer(from, to, firstTokenId, batchSize); if (batchSize > 1) { // Will only trigger during construction. Batch transferring (minting) is not available afterwards. revert("ERC721Enumerable: consecutive transfers not supported"); } uint256 tokenId = firstTokenId; if (from == address(0)) { _addTokenToAllTokensEnumeration(tokenId); } else if (from != to) { _removeTokenFromOwnerEnumeration(from, tokenId); } if (to == address(0)) { _removeTokenFromAllTokensEnumeration(tokenId); } else if (to != from) { _addTokenToOwnerEnumeration(to, tokenId); } } /** * @dev Private function to add a token to this extension's ownership-tracking data structures. * @param to address representing the new owner of the given token ID * @param tokenId uint256 ID of the token to be added to the tokens list of the given address */ function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private { uint256 length = ERC721.balanceOf(to); _ownedTokens[to][length] = tokenId; _ownedTokensIndex[tokenId] = length; } /** * @dev Private function to add a token to this extension's token tracking data structures. * @param tokenId uint256 ID of the token to be added to the tokens list */ function _addTokenToAllTokensEnumeration(uint256 tokenId) private { _allTokensIndex[tokenId] = _allTokens.length; _allTokens.push(tokenId); } /** * @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that * while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for * gas optimizations e.g. when performing a transfer operation (avoiding double writes). * This has O(1) time complexity, but alters the order of the _ownedTokens array. * @param from address representing the previous owner of the given token ID * @param tokenId uint256 ID of the token to be removed from the tokens list of the given address */ function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private { // To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and // then delete the last slot (swap and pop). uint256 lastTokenIndex = ERC721.balanceOf(from) - 1; uint256 tokenIndex = _ownedTokensIndex[tokenId]; // When the token to delete is the last token, the swap operation is unnecessary if (tokenIndex != lastTokenIndex) { uint256 lastTokenId = _ownedTokens[from][lastTokenIndex]; _ownedTokens[from][tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token _ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index } // This also deletes the contents at the last position of the array delete _ownedTokensIndex[tokenId]; delete _ownedTokens[from][lastTokenIndex]; } /** * @dev Private function to remove a token from this extension's token tracking data structures. * This has O(1) time complexity, but alters the order of the _allTokens array. * @param tokenId uint256 ID of the token to be removed from the tokens list */ function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private { // To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and // then delete the last slot (swap and pop). uint256 lastTokenIndex = _allTokens.length - 1; uint256 tokenIndex = _allTokensIndex[tokenId]; // When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so // rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding // an 'if' statement (like in _removeTokenFromOwnerEnumeration) uint256 lastTokenId = _allTokens[lastTokenIndex]; _allTokens[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token _allTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index // This also deletes the contents at the last position of the array delete _allTokensIndex[tokenId]; _allTokens.pop(); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/extensions/IERC721Enumerable.sol) pragma solidity ^0.8.0; import "../IERC721.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721Enumerable is IERC721 { /** * @dev Returns the total amount of tokens stored by the contract. */ function totalSupply() external view returns (uint256); /** * @dev Returns a token ID owned by `owner` at a given `index` of its token list. * Use along with {balanceOf} to enumerate all of ``owner``'s tokens. */ function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256); /** * @dev Returns a token ID at a given `index` of all the tokens stored by the contract. * Use along with {totalSupply} to enumerate all tokens. */ function tokenByIndex(uint256 index) external view returns (uint256); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol) pragma solidity ^0.8.0; import "../IERC721.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional metadata extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721Metadata is IERC721 { /** * @dev Returns the token collection name. */ function name() external view returns (string memory); /** * @dev Returns the token collection symbol. */ function symbol() external view returns (string memory); /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ function tokenURI(uint256 tokenId) external view returns (string memory); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC721/IERC721.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721 is IERC165 { /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external; /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom(address from, address to, uint256 tokenId) external; /** * @dev Transfers `tokenId` token from `from` to `to`. * * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721 * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must * understand this adds an external call which potentially creates a reentrancy vulnerability. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom(address from, address to, uint256 tokenId) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool approved) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol) pragma solidity ^0.8.0; /** * @title ERC721 token receiver interface * @dev Interface for any contract that wants to support safeTransfers * from ERC721 asset contracts. */ interface IERC721Receiver { /** * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom} * by `operator` from `from`, this function is called. * * It must return its Solidity selector to confirm the token transfer. * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted. * * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`. */ function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * * Furthermore, `isContract` will also return true if the target contract within * the same transaction is already scheduled for destruction by `SELFDESTRUCT`, * which only has an effect at the end of a transaction. * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract. * * _Available since v4.8._ */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata, string memory errorMessage ) internal view returns (bytes memory) { if (success) { if (returndata.length == 0) { // only check isContract if the call was successful and the return data is empty // otherwise we already know that it was a contract require(isContract(target), "Address: call to non-contract"); } return returndata; } else { _revert(returndata, errorMessage); } } /** * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason or using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { _revert(returndata, errorMessage); } } function _revert(bytes memory returndata, string memory errorMessage) private pure { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.4) (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } function _contextSuffixLength() internal view virtual returns (uint256) { return 0; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; import "./IERC165.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol) pragma solidity ^0.8.0; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { enum Rounding { Down, // Toward negative infinity Up, // Toward infinity Zero // Toward zero } /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a > b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds up instead * of rounding down. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b - 1) / b can overflow on addition, so we distribute. return a == 0 ? 0 : (a - 1) / b + 1; } /** * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0 * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) * with further edits by Uniswap Labs also under MIT license. */ function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) { unchecked { // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256 // variables such that product = prod1 * 2^256 + prod0. uint256 prod0; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod0 := mul(x, y) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division. if (prod1 == 0) { // Solidity will revert if denominator == 0, unlike the div opcode on its own. // The surrounding unchecked block does not change this fact. // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic. return prod0 / denominator; } // Make sure the result is less than 2^256. Also prevents denominator == 0. require(denominator > prod1, "Math: mulDiv overflow"); /////////////////////////////////////////////// // 512 by 256 division. /////////////////////////////////////////////// // Make division exact by subtracting the remainder from [prod1 prod0]. uint256 remainder; assembly { // Compute remainder using mulmod. remainder := mulmod(x, y, denominator) // Subtract 256 bit number from 512 bit number. prod1 := sub(prod1, gt(remainder, prod0)) prod0 := sub(prod0, remainder) } // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1. // See https://cs.stackexchange.com/q/138556/92363. // Does not overflow because the denominator cannot be zero at this stage in the function. uint256 twos = denominator & (~denominator + 1); assembly { // Divide denominator by twos. denominator := div(denominator, twos) // Divide [prod1 prod0] by twos. prod0 := div(prod0, twos) // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one. twos := add(div(sub(0, twos), twos), 1) } // Shift in bits from prod1 into prod0. prod0 |= prod1 * twos; // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for // four bits. That is, denominator * inv = 1 mod 2^4. uint256 inverse = (3 * denominator) ^ 2; // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works // in modular arithmetic, doubling the correct bits in each step. inverse *= 2 - denominator * inverse; // inverse mod 2^8 inverse *= 2 - denominator * inverse; // inverse mod 2^16 inverse *= 2 - denominator * inverse; // inverse mod 2^32 inverse *= 2 - denominator * inverse; // inverse mod 2^64 inverse *= 2 - denominator * inverse; // inverse mod 2^128 inverse *= 2 - denominator * inverse; // inverse mod 2^256 // Because the division is now exact we can divide by multiplying with the modular inverse of denominator. // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1 // is no longer required. result = prod0 * inverse; return result; } } /** * @notice Calculates x * y / denominator with full precision, following the selected rounding direction. */ function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) { uint256 result = mulDiv(x, y, denominator); if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) { result += 1; } return result; } /** * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down. * * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11). */ function sqrt(uint256 a) internal pure returns (uint256) { if (a == 0) { return 0; } // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target. // // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`. // // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)` // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))` // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)` // // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit. uint256 result = 1 << (log2(a) >> 1); // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128, // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision // into the expected uint128 result. unchecked { result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; return min(result, a / result); } } /** * @notice Calculates sqrt(a), following the selected rounding direction. */ function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = sqrt(a); return result + (rounding == Rounding.Up && result * result < a ? 1 : 0); } } /** * @dev Return the log in base 2, rounded down, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 128; } if (value >> 64 > 0) { value >>= 64; result += 64; } if (value >> 32 > 0) { value >>= 32; result += 32; } if (value >> 16 > 0) { value >>= 16; result += 16; } if (value >> 8 > 0) { value >>= 8; result += 8; } if (value >> 4 > 0) { value >>= 4; result += 4; } if (value >> 2 > 0) { value >>= 2; result += 2; } if (value >> 1 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 2, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log2(value); return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0); } } /** * @dev Return the log in base 10, rounded down, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >= 10 ** 64) { value /= 10 ** 64; result += 64; } if (value >= 10 ** 32) { value /= 10 ** 32; result += 32; } if (value >= 10 ** 16) { value /= 10 ** 16; result += 16; } if (value >= 10 ** 8) { value /= 10 ** 8; result += 8; } if (value >= 10 ** 4) { value /= 10 ** 4; result += 4; } if (value >= 10 ** 2) { value /= 10 ** 2; result += 2; } if (value >= 10 ** 1) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log10(value); return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0); } } /** * @dev Return the log in base 256, rounded down, of a positive value. * Returns 0 if given 0. * * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string. */ function log256(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 16; } if (value >> 64 > 0) { value >>= 64; result += 8; } if (value >> 32 > 0) { value >>= 32; result += 4; } if (value >> 16 > 0) { value >>= 16; result += 2; } if (value >> 8 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 256, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log256(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log256(value); return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol) pragma solidity ^0.8.0; /** * @dev Standard signed math utilities missing in the Solidity language. */ library SignedMath { /** * @dev Returns the largest of two signed numbers. */ function max(int256 a, int256 b) internal pure returns (int256) { return a > b ? a : b; } /** * @dev Returns the smallest of two signed numbers. */ function min(int256 a, int256 b) internal pure returns (int256) { return a < b ? a : b; } /** * @dev Returns the average of two signed numbers without overflow. * The result is rounded towards zero. */ function average(int256 a, int256 b) internal pure returns (int256) { // Formula from the book "Hacker's Delight" int256 x = (a & b) + ((a ^ b) >> 1); return x + (int256(uint256(x) >> 255) & (a ^ b)); } /** * @dev Returns the absolute unsigned value of a signed value. */ function abs(int256 n) internal pure returns (uint256) { unchecked { // must be unchecked in order to support `n = type(int256).min` return uint256(n >= 0 ? n : -n); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/Strings.sol) pragma solidity ^0.8.0; import "./math/Math.sol"; import "./math/SignedMath.sol"; /** * @dev String operations. */ library Strings { bytes16 private constant _SYMBOLS = "0123456789abcdef"; uint8 private constant _ADDRESS_LENGTH = 20; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { unchecked { uint256 length = Math.log10(value) + 1; string memory buffer = new string(length); uint256 ptr; /// @solidity memory-safe-assembly assembly { ptr := add(buffer, add(32, length)) } while (true) { ptr--; /// @solidity memory-safe-assembly assembly { mstore8(ptr, byte(mod(value, 10), _SYMBOLS)) } value /= 10; if (value == 0) break; } return buffer; } } /** * @dev Converts a `int256` to its ASCII `string` decimal representation. */ function toString(int256 value) internal pure returns (string memory) { return string(abi.encodePacked(value < 0 ? "-" : "", toString(SignedMath.abs(value)))); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { unchecked { return toHexString(value, Math.log256(value) + 1); } } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH); } /** * @dev Returns true if the two strings are equal. */ function equal(string memory a, string memory b) internal pure returns (bool) { return keccak256(bytes(a)) == keccak256(bytes(b)); } }
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.19; import "./KinoraErrors.sol"; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; contract KinoraAccessControl { string public symbol; string public name; address private _kinoraEscrow; address private _kinoraQuestData; address private _kinoraMetrics; address private _kinoraNFTCreator; address private _coreEnvoker; address public kinoraOpenAction; mapping(address => bool) private _envokers; event EnvokerAdded(address indexed envoker); event EnvokerRemoved(address indexed envoker); event CoreEnvokerChanged(address indexed newEnvoker); modifier onlyCoreEnvoker() { if (msg.sender != _coreEnvoker) { revert KinoraErrors.OnlyCoreEnvoker(); } _; } function initialize( address _coreEnvokerAddress, address _kinoraOpenActionAddress ) external { if (kinoraOpenAction != address(0)) { revert KinoraErrors.AlreadyInitialized(); } symbol = "KAC"; name = "KinoraAccessControl"; kinoraOpenAction = _kinoraOpenActionAddress; _envokers[_coreEnvokerAddress] = true; _coreEnvoker = _coreEnvokerAddress; } function setRelatedContract( address _kinoraEscrowAddress, address _kinoraQuestDataAddress, address _kinoraMetricsAddress, address _kinoraNFTCreatorAddress ) external { if (msg.sender != kinoraOpenAction) { revert KinoraErrors.InvalidAddress(); } _kinoraEscrow = _kinoraEscrowAddress; _kinoraQuestData = _kinoraQuestDataAddress; _kinoraMetrics = _kinoraMetricsAddress; _kinoraNFTCreator = _kinoraNFTCreatorAddress; } function addEnvoker(address _envoker) external onlyCoreEnvoker { if (_envoker == msg.sender || _envokers[_envoker]) { revert KinoraErrors.InvalidAddress(); } _envokers[_envoker] = true; emit EnvokerAdded(_envoker); } function removeEnvoker(address _envoker) external onlyCoreEnvoker { if (_envoker == msg.sender || !_envokers[_envoker]) { revert KinoraErrors.InvalidAddress(); } delete _envokers[_envoker]; emit EnvokerRemoved(_envoker); } function changeCoreEnvoker(address _newEnvoker) external onlyCoreEnvoker { _envokers[_coreEnvoker] = false; _coreEnvoker = _newEnvoker; _envokers[_newEnvoker] = true; emit CoreEnvokerChanged(_newEnvoker); } function isEnvoker(address _address) public view returns (bool) { return _envokers[_address]; } function isCoreEnvoker() public view returns (address) { return _coreEnvoker; } function getKinoraEscrow() public view returns (address) { return _kinoraEscrow; } function getKinoraMetrics() public view returns (address) { return _kinoraMetrics; } function getKinoraQuestData() public view returns (address) { return _kinoraQuestData; } function getKinoraNFTCreator() public view returns (address) { return _kinoraNFTCreator; } }
// SPDX-License-Identifier: UNLICENSE pragma solidity ^0.8.19; contract KinoraErrors { error OnlyAdmin(); error InvalidLength(); error InvalidAddress(); error InvalidContract(); error AlreadyInitialized(); error OnlyCoreEnvoker(); error UserNotMaintainer(); error QuestClosed(); error QuestDoesntExist(); error InsufficientBalance(); error PlayerNotEligible(); error MaxPlayerCountReached(); error MilestoneInvalid(); error CurrencyNotWhitelisted(); error InvalidRewardAmount(); }
// SPDX-License-Identifier: UNLICENSE pragma solidity ^0.8.19; import "./KinoraAccessControl.sol"; import "./KinoraLibrary.sol"; import "./KinoraNFTCreator.sol"; import "./KinoraQuestData.sol"; import "./KinoraErrors.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; contract KinoraEscrow { string public name; string public symbol; KinoraAccessControl public kinoraAccess; KinoraQuestData public kinoraQuestData; KinoraNFTCreator public kinoraNFTCreator; address public kinoraOpenAction; mapping(uint256 => mapping(uint256 => mapping(address => uint256))) private _questMilestoneERC20Deposit; mapping(uint256 => mapping(uint256 => mapping(uint256 => string))) private _questMilestoneERC721Deposit; modifier onlyOpenAction() { if (msg.sender != kinoraOpenAction) { revert KinoraErrors.InvalidContract(); } _; } modifier onlyMaintainer() { if (!kinoraAccess.isEnvoker(msg.sender)) { revert KinoraErrors.InvalidAddress(); } _; } event ERC20Deposited( address tokenAddress, uint256 amount, uint256 questId, uint256 milestone ); event ERC721URISet(string uri, uint256 questId, uint256 milestone); event ERC20Withdrawn(address toAddress, uint256 questId, uint256 milestone); event EmergencyERC20Withdrawn(address toAddress, uint256 questId); event ERC721Minted(address playerAddress, uint256 questId, uint256 milestone); function initialize( address _kinoraAccessAddress, address _kinoraQuestDataAddress, address _kinoraNFTCreatorAddress, address _kinoraOpenActionAddress ) external { if (address(kinoraAccess) != address(0)) { revert KinoraErrors.AlreadyInitialized(); } name = "KinoraEscrow"; symbol = "KES"; kinoraAccess = KinoraAccessControl(_kinoraAccessAddress); kinoraQuestData = KinoraQuestData(_kinoraQuestDataAddress); kinoraNFTCreator = KinoraNFTCreator(_kinoraNFTCreatorAddress); kinoraOpenAction = _kinoraOpenActionAddress; } function depositERC20( address _tokenAddress, uint256 _amount, uint256 _questId, uint256 _milestone ) external onlyOpenAction { IERC20(_tokenAddress).transferFrom( address(kinoraOpenAction), address(this), _amount ); _questMilestoneERC20Deposit[_questId][_milestone][_tokenAddress] = _amount; emit ERC20Deposited(_tokenAddress, _amount, _questId, _milestone); } function withdrawERC20( address _toAddress, uint256 _questId, uint256 _milestone, uint256 _rewardIndex ) external onlyOpenAction { if (kinoraQuestData.getQuestStatus(_questId) != KinoraLibrary.Status.Open) { revert KinoraErrors.QuestClosed(); } uint256 _amount = kinoraQuestData.getMilestoneRewardTokenAmount( _questId, _rewardIndex, _milestone ); address _tokenAddress = kinoraQuestData.getMilestoneRewardTokenAddress( _questId, _rewardIndex, _milestone ); IERC20(_tokenAddress).transfer(_toAddress, _amount); _questMilestoneERC20Deposit[_questId][_milestone - 1][ _tokenAddress ] -= _amount; emit ERC20Withdrawn(_toAddress, _questId, _milestone); } function emergencyWithdrawERC20(address _toAddress, uint256 _questId) public { if ( kinoraQuestData.getQuestEnvoker(_questId) != msg.sender && msg.sender != address(this) ) { revert KinoraErrors.InvalidAddress(); } if (kinoraQuestData.getQuestEnvoker(_questId) == address(0)) { revert KinoraErrors.QuestDoesntExist(); } uint256 _milestoneCount = kinoraQuestData.getMilestoneCount(_questId); for (uint256 i = 0; i < _milestoneCount; i++) { uint256 _rewardLength = kinoraQuestData.getMilestoneRewardsLength( _questId, i + 1 ); uint256 _counterSize = 0; for (uint256 j = 0; j < _rewardLength; j++) { if ( kinoraQuestData.getMilestoneRewardType(_questId, j, i + 1) == KinoraLibrary.RewardType.ERC20 ) { _counterSize++; } } address[] memory _uniqueAddresses = new address[](_counterSize); uint256 _counter = 0; for (uint256 j = 0; j < _rewardLength; j++) { if ( kinoraQuestData.getMilestoneRewardType(_questId, j, i + 1) == KinoraLibrary.RewardType.ERC20 ) { _uniqueAddresses[_counter] = kinoraQuestData .getMilestoneRewardTokenAddress(_questId, j, i + 1); _counter++; } } for (uint256 k = 0; k < _uniqueAddresses.length; k++) { IERC20(_uniqueAddresses[k]).transfer( _toAddress, _questMilestoneERC20Deposit[_questId][i][_uniqueAddresses[k]] ); _questMilestoneERC20Deposit[_questId][i][_uniqueAddresses[k]] = 0; } } kinoraQuestData.updateQuestStatus(_questId); emit EmergencyERC20Withdrawn(_toAddress, _questId); } function depositERC721( string memory _uri, uint256 _questId, uint256 _milestone, uint256 _rewardIndex ) external onlyOpenAction { _questMilestoneERC721Deposit[_questId][_milestone][_rewardIndex] = _uri; emit ERC721URISet(_uri, _questId, _milestone); } function mintERC721( address _playerAddress, uint256 _questId, uint256 _milestone, uint256 _rewardIndex ) external onlyOpenAction { if (kinoraQuestData.getQuestStatus(_questId) != KinoraLibrary.Status.Open) { revert KinoraErrors.QuestClosed(); } kinoraNFTCreator.mintToken( _questMilestoneERC721Deposit[_questId][_milestone - 1][_rewardIndex], _playerAddress ); emit ERC721Minted(_playerAddress, _questId, _milestone); } function deleteQuest(uint256 _questId) public { if (kinoraQuestData.getQuestEnvoker(_questId) == address(0)) { revert KinoraErrors.QuestDoesntExist(); } if (kinoraQuestData.getQuestEnvoker(_questId) != msg.sender) { revert KinoraErrors.InvalidAddress(); } if (kinoraQuestData.getQuestStatus(_questId) == KinoraLibrary.Status.Open) { emergencyWithdrawERC20(msg.sender, _questId); } kinoraQuestData.deleteQuest(_questId); } function getQuestMilestoneERC20TotalDeposit( address _tokenAddress, uint256 _questId, uint256 _milestone ) public view returns (uint256) { return _questMilestoneERC20Deposit[_questId][_milestone - 1][_tokenAddress]; } function getQuestMilestoneERC721URI( uint256 _questId, uint256 _milestone, uint256 _rewardIndex ) public view returns (string memory) { return _questMilestoneERC721Deposit[_questId][_milestone - 1][_rewardIndex]; } function setKinoraQuestDataContract( address _newQuestDataContract ) external onlyMaintainer { kinoraQuestData = KinoraQuestData(_newQuestDataContract); } function setKinoraAccessContract( address _newAccessContract ) external onlyMaintainer { kinoraAccess = KinoraAccessControl(_newAccessContract); } function setKinoraNFTCreatorContract( address _newNFTCreatorContract ) external onlyMaintainer { kinoraNFTCreator = KinoraNFTCreator(_newNFTCreatorContract); } function setKinoraOpenActionContract( address _newOpenActionContract ) external onlyMaintainer { kinoraOpenAction = _newOpenActionContract; } function getKinoraQuestDataAddress() public view returns (address) { return address(kinoraQuestData); } }
// SPDX-License-Identifier: UNLICENSE pragma solidity ^0.8.19; contract KinoraLibrary { enum Status { Open, Closed } enum RewardType { ERC20, ERC721 } enum TokenType { Collection, Token } struct Reward { RewardType rewardType; string uri; address tokenAddress; uint256 amount; } struct Milestone { GatingLogic gated; Reward[] rewards; mapping(uint256 => mapping(uint256 => Video)) videos; string[] videoBytes; string uri; uint256 milestone; uint256 videoLength; uint256 rewardsLength; } struct Video { uint256[] factoryIds; string playerId; string videoBytes; uint256 profileId; uint256 pubId; uint256 minPlayCount; uint256 minAVD; uint256 minDuration; uint256 minSecondaryQuoteOnQuote; uint256 minSecondaryMirrorOnQuote; uint256 minSecondaryReactOnQuote; uint256 minSecondaryCommentOnQuote; uint256 minSecondaryCollectOnQuote; uint256 minSecondaryQuoteOnComment; uint256 minSecondaryMirrorOnComment; uint256 minSecondaryReactOnComment; uint256 minSecondaryCommentOnComment; uint256 minSecondaryCollectOnComment; bool quote; bool mirror; bool comment; bool bookmark; bool react; } struct VideoPost { string videoBytes; uint256 profileId; uint256 pubId; } struct Quest { Milestone[] milestones; GatingLogic gated; uint256[] players; string uri; address envoker; Status status; uint256 questId; uint256 profileId; uint256 pubId; uint256 milestoneCount; uint256 maxPlayerCount; } struct GatingLogic { string[][] erc721TokenURIs; uint256[][] erc721TokenIds; address[] erc721Addresses; address[] erc20Addresses; uint256[] erc20Thresholds; bool oneOf; } struct PlayerVideoMetrics { string mostReplayedArea; uint256 profileId; uint256 pubId; uint256 playCount; uint256 secondaryQuoteOnQuote; uint256 secondaryMirrorOnQuote; uint256 secondaryReactOnQuote; uint256 secondaryCommentOnQuote; uint256 secondaryCollectOnQuote; uint256 secondaryQuoteOnComment; uint256 secondaryMirrorOnComment; uint256 secondaryReactOnComment; uint256 secondaryCommentOnComment; uint256 secondaryCollectOnComment; uint256 avd; uint256 duration; bool hasQuoted; bool hasMirrored; bool hasCommented; bool hasBookmarked; bool hasReacted; } struct Player { mapping(uint256 => uint256) milestonesCompletedPerQuest; uint256[] questsJoined; uint256[] questsCompleted; mapping(uint256 => bool) joinedQuest; mapping(uint256 => mapping(uint256 => PlayerVideoMetrics)) videoMetrics; mapping(uint256 => mapping(uint256 => bool)) eligibleToClaimMilestone; string[] videoBytes; address playerAddress; uint256 activeSince; } struct NewQuestParams { uint256 maxPlayerCount; GatingLogic gateLogic; MilestoneParameter[] milestones; string uri; address envokerAddress; uint256 pubId; uint256 profileId; } struct MilestoneParameter { GatingLogic gated; Reward[] rewards; Video[] videos; string uri; uint256 milestone; } struct ActionParameters { MilestoneParameter[] milestones; GatingLogic gateLogic; string uri; uint256 maxPlayerCount; } struct AggregateParams { uint256 avd; uint256 playCount; uint256 secondaryQuoteOnQuote; uint256 secondaryMirrorOnQuote; uint256 secondaryReactOnQuote; uint256 secondaryCommentOnQuote; uint256 secondaryCollectOnQuote; uint256 secondaryQuoteOnComment; uint256 secondaryMirrorOnComment; uint256 secondaryReactOnComment; uint256 secondaryCommentOnComment; uint256 secondaryCollectOnComment; uint256 duration; bool hasQuoted; bool hasMirrored; bool hasCommented; bool hasBookmarked; bool hasReacted; } }
// SPDX-License-Identifier: UNLICENSE pragma solidity ^0.8.19; import "./KinoraAccessControl.sol"; import "./KinoraLibrary.sol"; import "./KinoraQuestData.sol"; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; contract KinoraMetrics { string public symbol; string public name; KinoraAccessControl public kinoraAccess; KinoraQuestData public kinoraQuestData; event AddPlayerMetrics( uint256 videoPubId, uint256 videoProfileId, uint256 playerProfileId ); event PlayerEligibleToClaimMilestone( uint256 questId, uint256 milestone, uint256 playerProfileId ); modifier onlyPlayer() { uint256 _playerProfileId = kinoraQuestData.getAddressToProfileId( msg.sender ); if (kinoraQuestData.getPlayerActiveSince(_playerProfileId) == 0) { revert KinoraErrors.PlayerNotEligible(); } _; } modifier onlyQuestEnvoker(uint256 _questId) { if (kinoraQuestData.getQuestEnvoker(_questId) != msg.sender) { revert KinoraErrors.InvalidAddress(); } _; } modifier onlyMaintainer() { if (!kinoraAccess.isEnvoker(msg.sender)) { revert KinoraErrors.InvalidAddress(); } _; } function initialize( address _kinoraAccessAddress, address _kinoraQuestDataAddress ) external { if (address(kinoraAccess) != address(0)) { revert KinoraErrors.AlreadyInitialized(); } name = "KinoraMetrics"; symbol = "KME"; kinoraAccess = KinoraAccessControl(_kinoraAccessAddress); kinoraQuestData = KinoraQuestData(_kinoraQuestDataAddress); } function addPlayerMetrics( KinoraLibrary.PlayerVideoMetrics memory _metrics ) public onlyPlayer { uint256 _playerProfileId = kinoraQuestData.getAddressToProfileId( msg.sender ); kinoraQuestData.updatePlayerMetrics(_metrics, _playerProfileId); emit AddPlayerMetrics(_metrics.pubId, _metrics.profileId, _playerProfileId); } function playerEligibleToClaimMilestone( uint256 _questId, uint256 _milestone, uint256 _playerProfileId, bool _eligibility ) public onlyQuestEnvoker(_questId) { kinoraQuestData.playerEligibleToClaim( _playerProfileId, _questId, _milestone, _eligibility ); emit PlayerEligibleToClaimMilestone(_questId, _milestone, _playerProfileId); } function setKinoraQuestData( address _newQuestDataContract ) external onlyMaintainer { kinoraQuestData = KinoraQuestData(_newQuestDataContract); } function setKinoraAccess(address _newAccessContract) external onlyMaintainer { kinoraAccess = KinoraAccessControl(_newAccessContract); } }
// SPDX-License-Identifier: UNLICENSE pragma solidity ^0.8.19; import "./KinoraLibrary.sol"; import "./KinoraErrors.sol"; import "./KinoraEscrow.sol"; import "./KinoraAccessControl.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; contract KinoraNFTCreator is ERC721Enumerable { KinoraAccessControl public kinoraAccess; address public kinoraEscrow; address public kinoraOpenAction; uint256 private _tokenSupply; mapping(uint256 => string) private _tokenIdURI; modifier onlyMaintainer() { if (!kinoraAccess.isEnvoker(msg.sender)) { revert KinoraErrors.InvalidAddress(); } _; } modifier onlyMaintainerOrOpenAction() { if (!kinoraAccess.isEnvoker(msg.sender) && msg.sender != kinoraOpenAction) { revert KinoraErrors.InvalidAddress(); } _; } modifier onlyKinoraEscrow() { if (kinoraEscrow != msg.sender) { revert KinoraErrors.InvalidContract(); } _; } event TokenMinted(address playerAddress, uint256 tokenId); constructor() ERC721("KinoraNFTCreator", "KNC") {} function initialize(address _kinoraAccessAddress, address _kinoraOpenActionAddress) external { if (address(kinoraAccess) != address(0)) { revert KinoraErrors.AlreadyInitialized(); } kinoraAccess = KinoraAccessControl(_kinoraAccessAddress); kinoraOpenAction = _kinoraOpenActionAddress; _tokenSupply = 0; } function mintToken( string memory _uri, address _playerAddress ) public onlyKinoraEscrow { _tokenSupply++; _tokenIdURI[_tokenSupply] = _uri; _safeMint(_playerAddress, _tokenSupply); emit TokenMinted(_playerAddress, _tokenSupply); } function tokenURI( uint256 _tokenId ) public view virtual override returns (string memory) { return _tokenIdURI[_tokenId]; } function getTokenSupply() public view returns (uint256) { return _tokenSupply; } function setKinoraEscrowContract( address _newEscrowContract ) external onlyMaintainerOrOpenAction { kinoraEscrow = _newEscrowContract; } function setKinoraAccessContract( address _newAccessContract ) external onlyMaintainer { kinoraAccess = KinoraAccessControl(_newAccessContract); } }
{ "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[],"name":"AlreadyInitialized","type":"error"},{"inputs":[],"name":"InvalidAddress","type":"error"},{"inputs":[],"name":"InvalidContract","type":"error"},{"inputs":[],"name":"PlayerNotEligible","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"questId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"playerProfileId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"milestone","type":"uint256"}],"name":"MilestoneCompleted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"playerProfileId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"questId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"milestone","type":"uint256"},{"indexed":false,"internalType":"bool","name":"eligibility","type":"bool"}],"name":"PlayerEligibleToClaimMilestone","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"questId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"playerProfileId","type":"uint256"}],"name":"PlayerJoinedQuest","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"playerProfileId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"videoPubId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"videoProfileId","type":"uint256"}],"name":"PlayerMetricsUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"questId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"playerProfileId","type":"uint256"}],"name":"QuestCompleted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"questId","type":"uint256"}],"name":"QuestDeleted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"questId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"milestoneCount","type":"uint256"}],"name":"QuestInstantiated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"questId","type":"uint256"},{"indexed":false,"internalType":"enum KinoraLibrary.Status","name":"status","type":"uint8"}],"name":"QuestStatusUpdated","type":"event"},{"inputs":[{"internalType":"uint256","name":"_questId","type":"uint256"},{"internalType":"uint256","name":"_playerProfileId","type":"uint256"}],"name":"completeMilestone","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"maxPlayerCount","type":"uint256"},{"components":[{"internalType":"string[][]","name":"erc721TokenURIs","type":"string[][]"},{"internalType":"uint256[][]","name":"erc721TokenIds","type":"uint256[][]"},{"internalType":"address[]","name":"erc721Addresses","type":"address[]"},{"internalType":"address[]","name":"erc20Addresses","type":"address[]"},{"internalType":"uint256[]","name":"erc20Thresholds","type":"uint256[]"},{"internalType":"bool","name":"oneOf","type":"bool"}],"internalType":"struct KinoraLibrary.GatingLogic","name":"gateLogic","type":"tuple"},{"components":[{"components":[{"internalType":"string[][]","name":"erc721TokenURIs","type":"string[][]"},{"internalType":"uint256[][]","name":"erc721TokenIds","type":"uint256[][]"},{"internalType":"address[]","name":"erc721Addresses","type":"address[]"},{"internalType":"address[]","name":"erc20Addresses","type":"address[]"},{"internalType":"uint256[]","name":"erc20Thresholds","type":"uint256[]"},{"internalType":"bool","name":"oneOf","type":"bool"}],"internalType":"struct KinoraLibrary.GatingLogic","name":"gated","type":"tuple"},{"components":[{"internalType":"enum KinoraLibrary.RewardType","name":"rewardType","type":"uint8"},{"internalType":"string","name":"uri","type":"string"},{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct KinoraLibrary.Reward[]","name":"rewards","type":"tuple[]"},{"components":[{"internalType":"uint256[]","name":"factoryIds","type":"uint256[]"},{"internalType":"string","name":"playerId","type":"string"},{"internalType":"string","name":"videoBytes","type":"string"},{"internalType":"uint256","name":"profileId","type":"uint256"},{"internalType":"uint256","name":"pubId","type":"uint256"},{"internalType":"uint256","name":"minPlayCount","type":"uint256"},{"internalType":"uint256","name":"minAVD","type":"uint256"},{"internalType":"uint256","name":"minDuration","type":"uint256"},{"internalType":"uint256","name":"minSecondaryQuoteOnQuote","type":"uint256"},{"internalType":"uint256","name":"minSecondaryMirrorOnQuote","type":"uint256"},{"internalType":"uint256","name":"minSecondaryReactOnQuote","type":"uint256"},{"internalType":"uint256","name":"minSecondaryCommentOnQuote","type":"uint256"},{"internalType":"uint256","name":"minSecondaryCollectOnQuote","type":"uint256"},{"internalType":"uint256","name":"minSecondaryQuoteOnComment","type":"uint256"},{"internalType":"uint256","name":"minSecondaryMirrorOnComment","type":"uint256"},{"internalType":"uint256","name":"minSecondaryReactOnComment","type":"uint256"},{"internalType":"uint256","name":"minSecondaryCommentOnComment","type":"uint256"},{"internalType":"uint256","name":"minSecondaryCollectOnComment","type":"uint256"},{"internalType":"bool","name":"quote","type":"bool"},{"internalType":"bool","name":"mirror","type":"bool"},{"internalType":"bool","name":"comment","type":"bool"},{"internalType":"bool","name":"bookmark","type":"bool"},{"internalType":"bool","name":"react","type":"bool"}],"internalType":"struct KinoraLibrary.Video[]","name":"videos","type":"tuple[]"},{"internalType":"string","name":"uri","type":"string"},{"internalType":"uint256","name":"milestone","type":"uint256"}],"internalType":"struct KinoraLibrary.MilestoneParameter[]","name":"milestones","type":"tuple[]"},{"internalType":"string","name":"uri","type":"string"},{"internalType":"address","name":"envokerAddress","type":"address"},{"internalType":"uint256","name":"pubId","type":"uint256"},{"internalType":"uint256","name":"profileId","type":"uint256"}],"internalType":"struct KinoraLibrary.NewQuestParams","name":"_params","type":"tuple"}],"name":"configureNewQuest","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_questId","type":"uint256"}],"name":"deleteQuest","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_playerAddress","type":"address"}],"name":"getAddressToProfileId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_questId","type":"uint256"}],"name":"getLensDataFromQuestId","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_questId","type":"uint256"}],"name":"getMilestoneCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_questId","type":"uint256"},{"internalType":"uint256","name":"_milestone","type":"uint256"}],"name":"getMilestoneGatedERC20Addresses","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_questId","type":"uint256"},{"internalType":"uint256","name":"_milestone","type":"uint256"}],"name":"getMilestoneGatedERC20Thresholds","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_questId","type":"uint256"},{"internalType":"uint256","name":"_milestone","type":"uint256"}],"name":"getMilestoneGatedERC721Addresses","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_questId","type":"uint256"},{"internalType":"uint256","name":"_milestone","type":"uint256"}],"name":"getMilestoneGatedERC721TokenIds","outputs":[{"internalType":"uint256[][]","name":"","type":"uint256[][]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_questId","type":"uint256"},{"internalType":"uint256","name":"_milestone","type":"uint256"}],"name":"getMilestoneGatedERC721TokenURIs","outputs":[{"internalType":"string[][]","name":"","type":"string[][]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_questId","type":"uint256"},{"internalType":"uint256","name":"_milestone","type":"uint256"}],"name":"getMilestoneGatedOneOf","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_questId","type":"uint256"},{"internalType":"uint256","name":"_rewardIndex","type":"uint256"},{"internalType":"uint256","name":"_milestone","type":"uint256"}],"name":"getMilestoneRewardTokenAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_questId","type":"uint256"},{"internalType":"uint256","name":"_rewardIndex","type":"uint256"},{"internalType":"uint256","name":"_milestone","type":"uint256"}],"name":"getMilestoneRewardTokenAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_questId","type":"uint256"},{"internalType":"uint256","name":"_rewardIndex","type":"uint256"},{"internalType":"uint256","name":"_milestone","type":"uint256"}],"name":"getMilestoneRewardType","outputs":[{"internalType":"enum KinoraLibrary.RewardType","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_questId","type":"uint256"},{"internalType":"uint256","name":"_rewardIndex","type":"uint256"},{"internalType":"uint256","name":"_milestone","type":"uint256"}],"name":"getMilestoneRewardURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_questId","type":"uint256"},{"internalType":"uint256","name":"_milestone","type":"uint256"}],"name":"getMilestoneRewardsLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_questId","type":"uint256"},{"internalType":"uint256","name":"_milestone","type":"uint256"}],"name":"getMilestoneURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_questId","type":"uint256"},{"internalType":"uint256","name":"_milestone","type":"uint256"},{"internalType":"uint256","name":"_videoProfileId","type":"uint256"},{"internalType":"uint256","name":"_videoPubId","type":"uint256"}],"name":"getMilestoneVideoBookmark","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_questId","type":"uint256"},{"internalType":"uint256","name":"_milestone","type":"uint256"},{"internalType":"uint256","name":"_videoProfileId","type":"uint256"},{"internalType":"uint256","name":"_videoPubId","type":"uint256"}],"name":"getMilestoneVideoComment","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_questId","type":"uint256"},{"internalType":"uint256","name":"_milestone","type":"uint256"},{"internalType":"uint256","name":"_videoProfileId","type":"uint256"},{"internalType":"uint256","name":"_videoPubId","type":"uint256"}],"name":"getMilestoneVideoFactoryIds","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_questId","type":"uint256"},{"internalType":"uint256","name":"_milestone","type":"uint256"}],"name":"getMilestoneVideoLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_questId","type":"uint256"},{"internalType":"uint256","name":"_milestone","type":"uint256"},{"internalType":"uint256","name":"_videoProfileId","type":"uint256"},{"internalType":"uint256","name":"_videoPubId","type":"uint256"}],"name":"getMilestoneVideoMinAVD","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_questId","type":"uint256"},{"internalType":"uint256","name":"_milestone","type":"uint256"},{"internalType":"uint256","name":"_videoProfileId","type":"uint256"},{"internalType":"uint256","name":"_videoPubId","type":"uint256"}],"name":"getMilestoneVideoMinDuration","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_questId","type":"uint256"},{"internalType":"uint256","name":"_milestone","type":"uint256"},{"internalType":"uint256","name":"_videoProfileId","type":"uint256"},{"internalType":"uint256","name":"_videoPubId","type":"uint256"}],"name":"getMilestoneVideoMinPlayCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_questId","type":"uint256"},{"internalType":"uint256","name":"_milestone","type":"uint256"},{"internalType":"uint256","name":"_videoProfileId","type":"uint256"},{"internalType":"uint256","name":"_videoPubId","type":"uint256"}],"name":"getMilestoneVideoMinSecondaryCollectOnComment","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_questId","type":"uint256"},{"internalType":"uint256","name":"_milestone","type":"uint256"},{"internalType":"uint256","name":"_videoProfileId","type":"uint256"},{"internalType":"uint256","name":"_videoPubId","type":"uint256"}],"name":"getMilestoneVideoMinSecondaryCollectOnQuote","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_questId","type":"uint256"},{"internalType":"uint256","name":"_milestone","type":"uint256"},{"internalType":"uint256","name":"_videoProfileId","type":"uint256"},{"internalType":"uint256","name":"_videoPubId","type":"uint256"}],"name":"getMilestoneVideoMinSecondaryCommentOnComment","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_questId","type":"uint256"},{"internalType":"uint256","name":"_milestone","type":"uint256"},{"internalType":"uint256","name":"_videoProfileId","type":"uint256"},{"internalType":"uint256","name":"_videoPubId","type":"uint256"}],"name":"getMilestoneVideoMinSecondaryCommentOnQuote","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_questId","type":"uint256"},{"internalType":"uint256","name":"_milestone","type":"uint256"},{"internalType":"uint256","name":"_videoProfileId","type":"uint256"},{"internalType":"uint256","name":"_videoPubId","type":"uint256"}],"name":"getMilestoneVideoMinSecondaryMirrorOnComment","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_questId","type":"uint256"},{"internalType":"uint256","name":"_milestone","type":"uint256"},{"internalType":"uint256","name":"_videoProfileId","type":"uint256"},{"internalType":"uint256","name":"_videoPubId","type":"uint256"}],"name":"getMilestoneVideoMinSecondaryMirrorOnQuote","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_questId","type":"uint256"},{"internalType":"uint256","name":"_milestone","type":"uint256"},{"internalType":"uint256","name":"_videoProfileId","type":"uint256"},{"internalType":"uint256","name":"_videoPubId","type":"uint256"}],"name":"getMilestoneVideoMinSecondaryQuoteOnComment","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_questId","type":"uint256"},{"internalType":"uint256","name":"_milestone","type":"uint256"},{"internalType":"uint256","name":"_videoProfileId","type":"uint256"},{"internalType":"uint256","name":"_videoPubId","type":"uint256"}],"name":"getMilestoneVideoMinSecondaryQuoteOnQuote","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_questId","type":"uint256"},{"internalType":"uint256","name":"_milestone","type":"uint256"},{"internalType":"uint256","name":"_videoProfileId","type":"uint256"},{"internalType":"uint256","name":"_videoPubId","type":"uint256"}],"name":"getMilestoneVideoMinSecondaryReactOnComment","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_questId","type":"uint256"},{"internalType":"uint256","name":"_milestone","type":"uint256"},{"internalType":"uint256","name":"_videoProfileId","type":"uint256"},{"internalType":"uint256","name":"_videoPubId","type":"uint256"}],"name":"getMilestoneVideoMinSecondaryReactOnQuote","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_questId","type":"uint256"},{"internalType":"uint256","name":"_milestone","type":"uint256"},{"internalType":"uint256","name":"_videoProfileId","type":"uint256"},{"internalType":"uint256","name":"_videoPubId","type":"uint256"}],"name":"getMilestoneVideoMirror","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_questId","type":"uint256"},{"internalType":"uint256","name":"_milestone","type":"uint256"},{"internalType":"uint256","name":"_videoProfileId","type":"uint256"},{"internalType":"uint256","name":"_videoPubId","type":"uint256"}],"name":"getMilestoneVideoQuote","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_questId","type":"uint256"},{"internalType":"uint256","name":"_milestone","type":"uint256"},{"internalType":"uint256","name":"_videoProfileId","type":"uint256"},{"internalType":"uint256","name":"_videoPubId","type":"uint256"}],"name":"getMilestoneVideoReact","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_questId","type":"uint256"},{"internalType":"uint256","name":"_milestone","type":"uint256"}],"name":"getMilestoneVideos","outputs":[{"internalType":"string[]","name":"","type":"string[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_playerProfileId","type":"uint256"}],"name":"getPlayerActiveSince","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_playerProfileId","type":"uint256"}],"name":"getPlayerAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_playerProfileId","type":"uint256"},{"internalType":"uint256","name":"_questId","type":"uint256"},{"internalType":"uint256","name":"_milestone","type":"uint256"}],"name":"getPlayerEligibleToClaimMilestone","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_playerProfileId","type":"uint256"},{"internalType":"uint256","name":"_questId","type":"uint256"}],"name":"getPlayerHasJoinedQuest","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_playerProfileId","type":"uint256"},{"internalType":"uint256","name":"_questId","type":"uint256"}],"name":"getPlayerMilestonesCompletedPerQuest","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_playerProfileId","type":"uint256"}],"name":"getPlayerQuestsCompleted","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_playerProfileId","type":"uint256"}],"name":"getPlayerQuestsJoined","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_playerProfileId","type":"uint256"},{"internalType":"uint256","name":"_videoPubId","type":"uint256"},{"internalType":"uint256","name":"_videoProfileId","type":"uint256"}],"name":"getPlayerVideoAVD","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_playerProfileId","type":"uint256"},{"internalType":"uint256","name":"_videoPubId","type":"uint256"},{"internalType":"uint256","name":"_videoProfileId","type":"uint256"}],"name":"getPlayerVideoBookmark","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_playerProfileId","type":"uint256"}],"name":"getPlayerVideoBytes","outputs":[{"internalType":"string[]","name":"","type":"string[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_playerProfileId","type":"uint256"},{"internalType":"uint256","name":"_videoPubId","type":"uint256"},{"internalType":"uint256","name":"_videoProfileId","type":"uint256"}],"name":"getPlayerVideoComment","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_playerProfileId","type":"uint256"},{"internalType":"uint256","name":"_videoPubId","type":"uint256"},{"internalType":"uint256","name":"_videoProfileId","type":"uint256"}],"name":"getPlayerVideoDuration","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_playerProfileId","type":"uint256"},{"internalType":"uint256","name":"_videoPubId","type":"uint256"},{"internalType":"uint256","name":"_videoProfileId","type":"uint256"}],"name":"getPlayerVideoMirror","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_playerProfileId","type":"uint256"},{"internalType":"uint256","name":"_videoPubId","type":"uint256"},{"internalType":"uint256","name":"_videoProfileId","type":"uint256"}],"name":"getPlayerVideoMostReplayedArea","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_playerProfileId","type":"uint256"},{"internalType":"uint256","name":"_videoPubId","type":"uint256"},{"internalType":"uint256","name":"_videoProfileId","type":"uint256"}],"name":"getPlayerVideoPlayCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_playerProfileId","type":"uint256"},{"internalType":"uint256","name":"_videoPubId","type":"uint256"},{"internalType":"uint256","name":"_videoProfileId","type":"uint256"}],"name":"getPlayerVideoQuote","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_playerProfileId","type":"uint256"},{"internalType":"uint256","name":"_videoPubId","type":"uint256"},{"internalType":"uint256","name":"_videoProfileId","type":"uint256"}],"name":"getPlayerVideoReact","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_playerProfileId","type":"uint256"},{"internalType":"uint256","name":"_videoPubId","type":"uint256"},{"internalType":"uint256","name":"_videoProfileId","type":"uint256"}],"name":"getPlayerVideoSecondaryCollectOnComment","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_playerProfileId","type":"uint256"},{"internalType":"uint256","name":"_videoPubId","type":"uint256"},{"internalType":"uint256","name":"_videoProfileId","type":"uint256"}],"name":"getPlayerVideoSecondaryCollectOnQuote","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_playerProfileId","type":"uint256"},{"internalType":"uint256","name":"_videoPubId","type":"uint256"},{"internalType":"uint256","name":"_videoProfileId","type":"uint256"}],"name":"getPlayerVideoSecondaryCommentOnComment","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_playerProfileId","type":"uint256"},{"internalType":"uint256","name":"_videoPubId","type":"uint256"},{"internalType":"uint256","name":"_videoProfileId","type":"uint256"}],"name":"getPlayerVideoSecondaryCommentOnQuote","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_playerProfileId","type":"uint256"},{"internalType":"uint256","name":"_videoPubId","type":"uint256"},{"internalType":"uint256","name":"_videoProfileId","type":"uint256"}],"name":"getPlayerVideoSecondaryMirrorOnComment","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_playerProfileId","type":"uint256"},{"internalType":"uint256","name":"_videoPubId","type":"uint256"},{"internalType":"uint256","name":"_videoProfileId","type":"uint256"}],"name":"getPlayerVideoSecondaryMirrorOnQuote","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_playerProfileId","type":"uint256"},{"internalType":"uint256","name":"_videoPubId","type":"uint256"},{"internalType":"uint256","name":"_videoProfileId","type":"uint256"}],"name":"getPlayerVideoSecondaryQuoteOnComment","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_playerProfileId","type":"uint256"},{"internalType":"uint256","name":"_videoPubId","type":"uint256"},{"internalType":"uint256","name":"_videoProfileId","type":"uint256"}],"name":"getPlayerVideoSecondaryQuoteOnQuote","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_playerProfileId","type":"uint256"},{"internalType":"uint256","name":"_videoPubId","type":"uint256"},{"internalType":"uint256","name":"_videoProfileId","type":"uint256"}],"name":"getPlayerVideoSecondaryReactOnComment","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_playerProfileId","type":"uint256"},{"internalType":"uint256","name":"_videoPubId","type":"uint256"},{"internalType":"uint256","name":"_videoProfileId","type":"uint256"}],"name":"getPlayerVideoSecondaryReactOnQuote","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_questId","type":"uint256"}],"name":"getQuestEnvoker","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_questId","type":"uint256"}],"name":"getQuestGatedERC20Addresses","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_questId","type":"uint256"}],"name":"getQuestGatedERC20Thresholds","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_questId","type":"uint256"}],"name":"getQuestGatedERC721Addresses","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_questId","type":"uint256"}],"name":"getQuestGatedERC721TokenIds","outputs":[{"internalType":"uint256[][]","name":"","type":"uint256[][]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_questId","type":"uint256"}],"name":"getQuestGatedERC721TokenURIs","outputs":[{"internalType":"string[][]","name":"","type":"string[][]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_questId","type":"uint256"}],"name":"getQuestGatedOneOf","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_profileId","type":"uint256"},{"internalType":"uint256","name":"_pubId","type":"uint256"}],"name":"getQuestIdFromLensData","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"_playbackId","type":"string"}],"name":"getQuestIdsToVideoPlaybackId","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_questId","type":"uint256"}],"name":"getQuestMaxPlayerCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_questId","type":"uint256"}],"name":"getQuestPlayers","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_questId","type":"uint256"}],"name":"getQuestProfileId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_questId","type":"uint256"}],"name":"getQuestPubId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_questId","type":"uint256"}],"name":"getQuestStatus","outputs":[{"internalType":"enum KinoraLibrary.Status","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_questId","type":"uint256"}],"name":"getQuestURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTotalPlayerCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTotalQuestCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"_playbackId","type":"string"}],"name":"getVideoBytesFromPlaybackId","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pubId","type":"uint256"},{"internalType":"uint256","name":"_profileId","type":"uint256"}],"name":"getVideoPlaybackId","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"_playbackId","type":"string"}],"name":"getVideoProfileIdFromPlaybackId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"_playbackId","type":"string"}],"name":"getVideoPubIdFromPlaybackId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_kinoraAccessAddress","type":"address"},{"internalType":"address","name":"_kinoraOpenActionAddress","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_playerAddress","type":"address"},{"internalType":"uint256","name":"_questId","type":"uint256"},{"internalType":"uint256","name":"_playerProfileId","type":"uint256"}],"name":"joinQuest","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"kinoraAccess","outputs":[{"internalType":"contract KinoraAccessControl","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"kinoraEscrow","outputs":[{"internalType":"contract KinoraEscrow","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"kinoraMetrics","outputs":[{"internalType":"contract KinoraMetrics","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"kinoraOpenAction","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_playerProfileId","type":"uint256"},{"internalType":"uint256","name":"_questId","type":"uint256"},{"internalType":"uint256","name":"_milestone","type":"uint256"},{"internalType":"bool","name":"_eligible","type":"bool"}],"name":"playerEligibleToClaim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newAccessContract","type":"address"}],"name":"setKinoraAccessContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newEscrowContract","type":"address"}],"name":"setKinoraEscrowContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newMetricsContract","type":"address"}],"name":"setKinoraMetricsContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOpenActionContract","type":"address"}],"name":"setKinoraOpenActionContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"string","name":"mostReplayedArea","type":"string"},{"internalType":"uint256","name":"profileId","type":"uint256"},{"internalType":"uint256","name":"pubId","type":"uint256"},{"internalType":"uint256","name":"playCount","type":"uint256"},{"internalType":"uint256","name":"secondaryQuoteOnQuote","type":"uint256"},{"internalType":"uint256","name":"secondaryMirrorOnQuote","type":"uint256"},{"internalType":"uint256","name":"secondaryReactOnQuote","type":"uint256"},{"internalType":"uint256","name":"secondaryCommentOnQuote","type":"uint256"},{"internalType":"uint256","name":"secondaryCollectOnQuote","type":"uint256"},{"internalType":"uint256","name":"secondaryQuoteOnComment","type":"uint256"},{"internalType":"uint256","name":"secondaryMirrorOnComment","type":"uint256"},{"internalType":"uint256","name":"secondaryReactOnComment","type":"uint256"},{"internalType":"uint256","name":"secondaryCommentOnComment","type":"uint256"},{"internalType":"uint256","name":"secondaryCollectOnComment","type":"uint256"},{"internalType":"uint256","name":"avd","type":"uint256"},{"internalType":"uint256","name":"duration","type":"uint256"},{"internalType":"bool","name":"hasQuoted","type":"bool"},{"internalType":"bool","name":"hasMirrored","type":"bool"},{"internalType":"bool","name":"hasCommented","type":"bool"},{"internalType":"bool","name":"hasBookmarked","type":"bool"},{"internalType":"bool","name":"hasReacted","type":"bool"}],"internalType":"struct KinoraLibrary.PlayerVideoMetrics","name":"_metrics","type":"tuple"},{"internalType":"uint256","name":"_playerProfileId","type":"uint256"}],"name":"updatePlayerMetrics","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_questId","type":"uint256"}],"name":"updateQuestStatus","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
608060405234801561001057600080fd5b5061546e806100206000396000f3fe608060405234801561001057600080fd5b50600436106105d25760003560e01c80637a57dad811610300578063c3e35d4d116101a8578063e14ffb9e116100f4578063f903ad86116100ad578063fd4c9fbe11610087578063fd4c9fbe14611194578063fd800a72146111a7578063fd9d3c21146111e6578063ffce6261146111ee57600080fd5b8063f903ad86146110fe578063f9cc469614611145578063fa4ac00b1461115857600080fd5b8063e14ffb9e1461107c578063e277c8911461108f578063e2839eb3146110a2578063e784c517146110b5578063e9e0c04e146110c8578063f326206b146110eb57600080fd5b8063d11f220311610161578063d7ea46431161013b578063d7ea464314610fec578063d85c671a14611010578063e016cea614611023578063e068856e1461103657600080fd5b8063d11f220314610f61578063d173403214610f9d578063d2c42a7b14610fd957600080fd5b8063c3e35d4d14610e9d578063c6cd50ff14610ed9578063ca223ba514610f15578063ce1982d914610f28578063cf405da914610f3b578063cfdf9f6b14610f4e57600080fd5b80639a07e00811610267578063a67599a911610220578063c0f55b7c116101fa578063c0f55b7c14610e41578063c17b608314610e54578063c2010e5014610e67578063c2f0d6e414610e8a57600080fd5b8063a67599a914610dc8578063aaea9a8614610ddb578063b756019a14610e0857600080fd5b80639a07e00814610d565780639be8a0eb14610d69578063a08edda014610d7c578063a15b30ba14610d8f578063a17b307e14610da2578063a1d2f56814610db557600080fd5b80638e073cfc116102b95780638e073cfc14610ccc5780638fa33a1c14610cdf57806391719e7814610cf25780639434430714610d1857806395d89b4114610d3b5780639951197c14610d4357600080fd5b80637a57dad814610be257806382daf2e914610c0557806383428e0d14610c1857806385d40a0714610c2b5780638916825014610c675780638baa96a414610c8757600080fd5b806336d6a30a1161047e578063598ca3c0116103ca5780636a1a4f5b116103835780636f552a7c1161035d5780636f552a7c14610b695780637182ecd114610b7c578063756d104414610bbc5780637769dcd914610bcf57600080fd5b80636a1a4f5b14610b0d5780636cacf67414610b2d5780636d34191b14610b5657600080fd5b8063598ca3c014610a8257806359ce839d14610a955780635c557a9414610aa85780636222b57914610abb5780636522566514610ace5780636527293314610afa57600080fd5b8063485cc9551161043757806350d9a72d1161041157806350d9a72d146109af5780635302113d146109cf5780635562c17e14610a0b57806356c469c614610a4757600080fd5b8063485cc955146109765780634b7d93f2146109895780634f5701cb1461099c57600080fd5b806336d6a30a146108c35780633aebaeaa146108d65780633cb7e7da146108de5780633eb229561461090c5780634277b9041461091f57806344c60a3d1461093257600080fd5b806322510a4a1161053d5780632a962d1e116104f65780632c71b749116104d05780632c71b749146108415780632e78e46f1461085457806334b2201b14610874578063363756d11461088757600080fd5b80632a962d1e146108085780632b7b63861461081b5780632bd719a31461082e57600080fd5b806322510a4a1461073d5780632639433c14610750578063279f7ac91461076357806328185781146107765780632824d2f4146107a15780632871eaa5146107dd57600080fd5b80630f1996a81161058f5780630f1996a81461067b5780630f848dfc1461068e578063103d36b8146106ae57806311eb85a0146106c3578063170b00ba146106ff5780631c5a65c81461071257600080fd5b806302dce97f146105d75780630487228d146105ff57806306fdde03146106205780630addf880146106355780630d05962d146106485780630efa3b2e14610668575b600080fd5b6105ea6105e5366004614190565b611201565b60405190151581526020015b60405180910390f35b61061261060d3660046141b2565b611228565b6040519081526020016105f6565b610628611285565b6040516105f69190614234565b6106126106433660046141b2565b611313565b61065b61065636600461424e565b611370565b6040516105f691906142ae565b61061261067636600461444a565b6113d7565b6105ea6106893660046141b2565b611402565b6106a161069c366004614486565b61146a565b6040516105f6919061449f565b6106c16106bc366004614486565b6114cf565b005b6106126106d136600461424e565b6000928352600860209081526040808520928552600490920181528184209284529190915290206003015490565b61061261070d3660046141b2565b6115f1565b61072561072036600461424e565b61164e565b6040516001600160a01b0390911681526020016105f6565b61062861074b36600461424e565b6116be565b6105ea61075e3660046141b2565b611778565b6106c16107713660046144ff565b6117d8565b610612610784366004614190565b600091825260086020908152604080842092845291905290205490565b6106126107af36600461424e565b600092835260086020908152604080852092855260049092018152818420928452919091529020600f015490565b6106126107eb366004614190565b6000918252600e6020908152604080842092845291905290205490565b6106126108163660046141b2565b611882565b6105ea6108293660046141b2565b6118df565b61061261083c3660046141b2565b611945565b6106a161084f366004614486565b6119a2565b610867610862366004614486565b611a05565b6040516105f6919061456f565b600154610725906001600160a01b031681565b61061261089536600461424e565b6000928352600860209081526040808520928552600490920181528184209284529190915290206006015490565b6106286108d136600461444a565b611b34565b600654610612565b61065b6108ec366004614486565b60009081526009602081905260409091200154600160a01b900460ff1690565b6106c161091a3660046145ea565b611bdb565b6105ea61092d366004614190565b611c9e565b6105ea61094036600461424e565b60009283526008602090815260408085209285526004909201815281842092845291909152902060100154610100900460ff1690565b6106c161098436600461462b565b611ce5565b6106a1610997366004614486565b611da2565b6106a16109aa366004614486565b611e05565b6109c26109bd366004614486565b611e68565b6040516105f6919061465e565b6106126109dd36600461424e565b600092835260086020908152604080852092855260049092018152818420928452919091529020600d015490565b610612610a1936600461424e565b600092835260086020908152604080852092855260049092018152818420928452919091529020600b015490565b610612610a5536600461424e565b60009283526008602081815260408086209386526004909301815282852093855292909252909120015490565b610612610a903660046141b2565b611f4c565b6105ea610aa33660046141b2565b611fa8565b6106c1610ab6366004614671565b61200f565b610628610ac9366004614190565b612142565b610725610adc366004614486565b6000908152600860205260409020600701546001600160a01b031690565b6106a1610b083660046141b2565b612210565b610b20610b1b366004614486565b6122b6565b6040516105f691906146a4565b610612610b3b3660046144ff565b6001600160a01b03166000908152600d602052604090205490565b6106c1610b64366004614e75565b612324565b600254610725906001600160a01b031681565b610ba7610b8a366004614486565b6000908152600960205260409020600b810154600c909101549091565b604080519283526020830191909152016105f6565b610867610bca366004614190565b6124fd565b610612610bdd36600461424e565b61265c565b610612610bf0366004614486565b6000908152600960205260409020600b015490565b610612610c133660046141b2565b6126c2565b6105ea610c2636600461424e565b61271f565b610612610c3936600461424e565b6000928352600860209081526040808520928552600490920181528184209284529190915290206005015490565b610c7a610c75366004614190565b612763565b6040516105f69190614f5b565b6105ea610c9536600461424e565b6000928352600860209081526040808520928552600490920181528184209284529190915290206010015462010000900460ff1690565b6106c1610cda3660046144ff565b61282f565b610628610ced36600461424e565b6128f2565b6105ea610d00366004614486565b60009081526009602052604090206006015460ff1690565b610612610d26366004614486565b6000908152600960205260409020600c015490565b61062861295c565b610612610d513660046141b2565b612969565b6106c1610d643660046144ff565b6129c6565b610612610d773660046141b2565b612a89565b610612610d8a3660046141b2565b612ae6565b610612610d9d366004614190565b612b43565b6106c1610db0366004614fe5565b612b86565b600554610725906001600160a01b031681565b6106a1610dd636600461444a565b612efa565b610725610de9366004614486565b600090815260096020819052604090912001546001600160a01b031690565b610612610e1636600461424e565b6000928352600860209081526040808520928552600492830182528085209385529290529120015490565b610b20610e4f366004614190565b612f68565b610b20610e62366004614486565b613001565b610612610e75366004614486565b6000908152600960205260409020600d015490565b610612610e983660046141b2565b61306e565b610612610eab36600461424e565b600092835260086020908152604080852092855260049092018152818420928452919091529020600a015490565b610612610ee736600461424e565b600092835260086020908152604080852092855260049092018152818420928452919091529020600c015490565b6106c1610f23366004614486565b6130cb565b610628610f36366004614486565b613154565b6106a1610f49366004614190565b613174565b610b20610f5c366004614190565b613203565b610612610f6f36600461424e565b600092835260086020908152604080852092855260049092018152818420928452919091529020600e015490565b610612610fab36600461424e565b6000928352600860209081526040808520928552600490920181528184209284529190915290206007015490565b610612610fe73660046141b2565b61329b565b610612610ffa366004614486565b6000908152600860208190526040909120015490565b610c7a61101e366004614486565b6132f8565b6109c2611031366004614190565b613395565b6105ea61104436600461424e565b600092835260086020908152604080852092855260049092018152818420928452919091529020601001546301000000900460ff1690565b61061261108a36600461444a565b61349e565b61061261109d3660046141b2565b6134c9565b600054610725906001600160a01b031681565b6106c16110c33660046144ff565b613526565b6106126110d6366004614486565b6000908152600960205260409020600e015490565b6106c16110f9366004614190565b6135d0565b6105ea61110c36600461424e565b60009283526008602090815260408085209285526004909201815281842092845291909152902060100154640100000000900460ff1690565b610612611153366004614190565b6136f7565b61061261116636600461424e565b6000928352600860209081526040808520928552600490920181528184209284529190915290206009015490565b6106286111a2366004614190565b61373a565b6105ea6111b536600461424e565b6000928352600860209081526040808520928552600490920181528184209284529190915290206010015460ff1690565b600754610612565b6105ea6111fc3660046141b2565b613762565b600082815260086020908152604080832084845260030190915290205460ff165b92915050565b6000848152600960205260408120611241600186615174565b8154811061125157611251615187565b60009182526020808320958352600d9190910290940160070184526040808220938252929093525090206011015492915050565b600380546112929061519d565b80601f01602080910402602001604051908101604052809291908181526020018280546112be9061519d565b801561130b5780601f106112e05761010080835404028352916020019161130b565b820191906000526020600020905b8154815290600101906020018083116112ee57829003601f168201915b505050505081565b600084815260096020526040812061132c600186615174565b8154811061133c5761133c615187565b60009182526020808320958352600d919091029094016007018452604080822093825292909352509020600c015492915050565b6000838152600960205260408120611389600184615174565b8154811061139957611399615187565b90600052602060002090600d020160060183815481106113bb576113bb615187565b600091825260209091206004909102015460ff16949350505050565b6000600b826040516113e991906151d7565b9081526020016040518091039020600101549050919050565b600084815260096020526040812061141b600186615174565b8154811061142b5761142b615187565b60009182526020808320958352600d91909102909401600701845260408082209382529290935250902060120154640100000000900460ff1692915050565b6000818152600860209081526040918290206002018054835181840281018401909452808452606093928301828280156114c357602002820191906000526020600020905b8154815260200190600101908083116114af575b50505050509050919050565b6002546001600160a01b031633146114fa576040516303777f6960e51b815260040160405180910390fd5b6000818152600960205260408120906115138282613da6565b6001820160006115238282613dca565b611531600183016000613de8565b61153f600283016000613e06565b61154d600383016000613e06565b61155b600483016000613e06565b50600501805460ff19169055611575600783016000613e06565b611583600883016000613e24565b506009810180546001600160a81b03191690556000600a8201819055600b8201819055600c8201819055600d8201819055600e909101556040518181527fcbe2e2b576d488acbd141580ea0928b24300831852f56c7eb39330a9a35e1e6d906020015b60405180910390a150565b600084815260096020526040812061160a600186615174565b8154811061161a5761161a615187565b600091825260208083208684526007600d938402909101018152604080842086855290915290912001549050949350505050565b6000838152600960205260408120611667600184615174565b8154811061167757611677615187565b90600052602060002090600d0201600601838154811061169957611699615187565b60009182526020909120600490910201600201546001600160a01b0316949350505050565b6000838152600860209081526040808320848452600401825280832085845290915290208054606091906116f19061519d565b80601f016020809104026020016040519081016040528092919081815260200182805461171d9061519d565b801561176a5780601f1061173f5761010080835404028352916020019161176a565b820191906000526020600020905b81548152906001019060200180831161174d57829003601f168201915b505050505090509392505050565b6000848152600960205260408120611791600186615174565b815481106117a1576117a1615187565b60009182526020808320958352600d9190910290940160070184526040808220938252929093525090206012015460ff1692915050565b60005460405162a08cef60e31b81523360048201526001600160a01b0390911690630504677890602401602060405180830381865afa15801561181f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061184391906151f3565b6118605760405163e6c4247b60e01b815260040160405180910390fd5b600580546001600160a01b0319166001600160a01b0392909216919091179055565b600084815260096020526040812061189b600186615174565b815481106118ab576118ab615187565b60009182526020808320958352600d9190910290940160070184526040808220938252929093525090206005015492915050565b60008481526009602052604081206118f8600186615174565b8154811061190857611908615187565b60009182526020808320958352600d9190910290940160070184526040808220938252929093525090206012015462010000900460ff1692915050565b600084815260096020526040812061195e600186615174565b8154811061196e5761196e615187565b60009182526020808320958352600d919091029094016007018452604080822093825292909352509020600e015492915050565b6000818152600960209081526040918290206005018054835181840281018401909452808452606093928301828280156114c357602002820191906000526020600020908154815260200190600101908083116114af5750505050509050919050565b6000818152600960209081526040808320600101805482518185028101850190935280835260609492939192909184015b82821015611b2957838290600052602060002001805480602002602001604051908101604052809291908181526020016000905b82821015611b16578382906000526020600020018054611a899061519d565b80601f0160208091040260200160405190810160405280929190818152602001828054611ab59061519d565b8015611b025780601f10611ad757610100808354040283529160200191611b02565b820191906000526020600020905b815481529060010190602001808311611ae557829003601f168201915b505050505081526020019060010190611a6a565b5050505081526020019060010190611a36565b505050509050919050565b6060600b82604051611b4691906151d7565b9081526040519081900360200190208054611b609061519d565b80601f0160208091040260200160405190810160405280929190818152602001828054611b8c9061519d565b80156114c35780601f10611bae576101008083540402835291602001916114c3565b820191906000526020600020905b815481529060010190602001808311611bbc5750939695505050505050565b6001546001600160a01b03163314611c06576040516303777f6960e51b815260040160405180910390fd5b600084815260086020908152604080832086845260050190915281208291611c2f600186615174565b81526020808201929092526040908101600020805460ff191693151593909317909255815186815290810185905290810183905281151560608201527f3e5fd3c8c3bf9ba7775238a59e49658c93eca135b514862163084e5e24ee8fd09060800160405180910390a150505050565b6000828152600960205260408120611cb7600184615174565b81548110611cc757611cc7615187565b60009182526020909120600d909102016005015460ff169392505050565b6000546001600160a01b031615611d0e5760405162dc149f60e41b815260040160405180910390fd5b60408051808201909152600f81526e4b696e6f726151756573744461746160881b6020820152600390611d41908261525e565b5060408051808201909152600381526212d45160ea1b6020820152600490611d69908261525e565b5060006006819055600781905580546001600160a01b039384166001600160a01b03199182161790915560058054929093169116179055565b6000818152600960209081526040918290206007018054835181840281018401909452808452606093928301828280156114c357602002820191906000526020600020908154815260200190600101908083116114af5750505050509050919050565b6000818152600860209081526040918290206001018054835181840281018401909452808452606093928301828280156114c357602002820191906000526020600020908154815260200190600101908083116114af5750505050509050919050565b606060086000838152602001908152602001600020600601805480602002602001604051908101604052809291908181526020016000905b82821015611b29578382906000526020600020018054611ebf9061519d565b80601f0160208091040260200160405190810160405280929190818152602001828054611eeb9061519d565b8015611f385780601f10611f0d57610100808354040283529160200191611f38565b820191906000526020600020905b815481529060010190602001808311611f1b57829003601f168201915b505050505081526020019060010190611ea0565b6000848152600960205260408120611f65600186615174565b81548110611f7557611f75615187565b600091825260208083208684526007600d9093020182018152604080842086855290915290912001549050949350505050565b6000848152600960205260408120611fc1600186615174565b81548110611fd157611fd1615187565b60009182526020808320958352600d919091029094016007018452604080822093825292909352509020601201546301000000900460ff1692915050565b6005546001600160a01b0316331461203a576040516303777f6960e51b815260040160405180910390fd5b60008181526008602081905260408220015490036120ab57600780549060006120628361531d565b909155505060008181526008602081815260408084206007810180546001600160a01b0319166001600160a01b038a16908117909155429190940155918352600d905290208190555b60008181526008602090815260408083206001808201805480830182559086528486200187905586855260039091018352818420805460ff191682179055600983528184206007018054918201815584529282902090920183905581518481529081018390527f460fc19d43699e9d9517be583f6e6648433b80374cbd6837e466cd09e5b6598791015b60405180910390a1505050565b600082815260096020526040902060609061215e600184615174565b8154811061216e5761216e615187565b90600052602060002090600d0201600901805461218a9061519d565b80601f01602080910402602001604051908101604052809291908181526020018280546121b69061519d565b80156122035780601f106121d857610100808354040283529160200191612203565b820191906000526020600020905b8154815290600101906020018083116121e657829003601f168201915b5050505050905092915050565b600084815260096020526040902060609061222c600186615174565b8154811061223c5761223c615187565b600091825260208083208684526007600d909302019190910181526040808320858452825291829020805483518184028101840190945280845290918301828280156122a757602002820191906000526020600020905b815481526020019060010190808311612293575b50505050509050949350505050565b6000818152600960209081526040918290206004018054835181840281018401909452808452606093928301828280156114c357602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116122fb5750505050509050919050565b6005546001600160a01b0316331461234f576040516303777f6960e51b815260040160405180910390fd5b6006805490600061235f8361531d565b90915550506006546000818152600960208181526040909220600a81019390935560a0840151600c84015560c0840151600b840155608084015190830180548551600e8601556001600160a81b0319166001600160a01b039092169190911790558281015180518051919260018501926123dc9284920190613e5e565b5060208281015180516123f59260018501920190613ebb565b5060408201518051612411916002840191602090910190613f14565b506060820151805161242d916003840191602090910190613f14565b5060808201518051612449916004840191602090910190613f75565b5060a091909101516005909101805460ff1916911515919091179055604082015151600d82015560608201516008820190612484908261525e565b506124968260400151826006546137c7565b60065460c08301516000908152600e6020908152604080832060a0870151845282529182902083905581850151518251938452908301527f5fc06d224c9af68add198a86b9edf62077458edade4534748f0ee3e3a4ff965a91015b60405180910390a15050565b6000828152600960205260409020606090612519600184615174565b8154811061252957612529615187565b90600052602060002090600d0201600001600001805480602002602001604051908101604052809291908181526020016000905b8282101561265057838290600052602060002001805480602002602001604051908101604052809291908181526020016000905b8282101561263d5783829060005260206000200180546125b09061519d565b80601f01602080910402602001604051908101604052809291908181526020018280546125dc9061519d565b80156126295780601f106125fe57610100808354040283529160200191612629565b820191906000526020600020905b81548152906001019060200180831161260c57829003601f168201915b505050505081526020019060010190612591565b505050508152602001906001019061255d565b50505050905092915050565b6000838152600960205260408120612675600184615174565b8154811061268557612685615187565b90600052602060002090600d020160060183815481106126a7576126a7615187565b90600052602060002090600402016003015490509392505050565b60008481526009602052604081206126db600186615174565b815481106126eb576126eb615187565b60009182526020808320958352600d919091029094016007018452604080822093825292909352509020600b015492915050565b6000838152600860209081526040808320858452600501909152812081612747600185615174565b815260208101919091526040016000205460ff16949350505050565b600082815260096020526040902060609061277f600184615174565b8154811061278f5761278f615187565b90600052602060002090600d0201600001600101805480602002602001604051908101604052809291908181526020016000905b828210156126505760008481526020908190208301805460408051828502810185019091528181529283018282801561281b57602002820191906000526020600020905b815481526020019060010190808311612807575b5050505050815260200190600101906127c3565b60005460405162a08cef60e31b81523360048201526001600160a01b0390911690630504677890602401602060405180830381865afa158015612876573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061289a91906151f3565b1580156128b257506005546001600160a01b03163314155b156128d05760405163e6c4247b60e01b815260040160405180910390fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b600083815260096020526040902060609061290e600184615174565b8154811061291e5761291e615187565b90600052602060002090600d0201600601838154811061294057612940615187565b906000526020600020906004020160010180546116f19061519d565b600480546112929061519d565b6000848152600960205260408120612982600186615174565b8154811061299257612992615187565b60009182526020808320958352600d919091029094016007018452604080822093825292909352509020600f015492915050565b60005460405162a08cef60e31b81523360048201526001600160a01b0390911690630504677890602401602060405180830381865afa158015612a0d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a3191906151f3565b158015612a4957506005546001600160a01b03163314155b15612a675760405163e6c4247b60e01b815260040160405180910390fd5b600280546001600160a01b0319166001600160a01b0392909216919091179055565b6000848152600960205260408120612aa2600186615174565b81548110612ab257612ab2615187565b60009182526020808320958352600d9190910290940160070184526040808220938252929093525090206010015492915050565b6000848152600960205260408120612aff600186615174565b81548110612b0f57612b0f615187565b60009182526020808320958352600d9190910290940160070184526040808220938252929093525090206008015492915050565b6000828152600960205260408120612b5c600184615174565b81548110612b6c57612b6c615187565b90600052602060002090600d0201600c0154905092915050565b6001546001600160a01b03163314612bb1576040516303777f6960e51b815260040160405180910390fd5b6000818152600860208190526040822001549003612be2576040516313fee0df60e21b815260040160405180910390fd5b60008181526008602090815260408083208583015184526004018252808320858201518452909152902060010154158015612c48575060008181526008602090815260408083208583015184526004018252808320858201518452909152902060020154155b15612d4e576020808301516000908152600c825260408082208186015183529092529081208054612c789061519d565b80601f0160208091040260200160405190810160405280929190818152602001828054612ca49061519d565b8015612cf15780601f10612cc657610100808354040283529160200191612cf1565b820191906000526020600020905b815481529060010190602001808311612cd457829003601f168201915b5050505050905060086000838152602001908152602001600020600601600b82604051612d1e91906151d7565b9081526040516020918190038201902082546001810184556000938452919092200190612d4b9082615336565b50505b60008181526008602090815260408083208286015184526004018252808320818601518452909152902082518391908190612d89908261525e565b506020828101516001830155604080840151600284015560608085015160038501556080850151600485015560a0850151600585015560c0850151600685015560e085015160078501556101008086015160088601556101208601516009860155610140860151600a860155610160860151600b860155610180860151600c8601556101a0860151600d8601556101c0860151600e8601556101e0860151600f860155610200860151601090950180546102208801516102408901516102608a0151610280909a015115156401000000000264ff00000000199a151563010000000263ff0000001992151562010000029290921663ffff00001993151590960261ff00199a15159a909a1661ffff19909416939093179890981716929092179590951795909516949094179092558482015185820151835186815292830191909152918101919091527fe3fb5dd959a469b4fc3e2825b1b4c046d0c15f97b2a01d7a77344a6d52f7ae3091016124f1565b6060600a82604051612f0c91906151d7565b90815260408051918290036020908101832080548083028501830190935282845291908301828280156114c357602002820191906000526020600020908154815260200190600101908083116114af5750505050509050919050565b6000828152600960205260409020606090612f84600184615174565b81548110612f9457612f94615187565b60009182526020918290206003600d9092020101805460408051828502810185019091528181529283018282801561220357602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311612fd7575050505050905092915050565b6000818152600960209081526040918290206003018054835181840281018401909452808452606093928301828280156114c3576020028201919060005260206000209081546001600160a01b031681526001909101906020018083116122fb5750505050509050919050565b6000848152600960205260408120613087600186615174565b8154811061309757613097615187565b60009182526020808320958352600d9190910290940160070184526040808220938252929093525090206006015492915050565b6002546001600160a01b031633146130f6576040516303777f6960e51b815260040160405180910390fd5b60008181526009602081905260409182902001805460ff60a01b1916600160a01b9081179182905591517f69ece81755488aa3937ce59552d302d53cf2f9e4740f8617bf7b2d6c91643cdc926115e692859291900460ff1690615408565b6000818152600960205260409020600801805460609190611b609061519d565b6000828152600960205260409020606090613190600184615174565b815481106131a0576131a0615187565b60009182526020918290206004600d9092020101805460408051828502810185019091528181529283018282801561220357602002820191906000526020600020905b8154815260200190600101908083116131e3575050505050905092915050565b600082815260096020526040902060609061321f600184615174565b8154811061322f5761322f615187565b60009182526020918290206002600d90920201018054604080518285028101850190915281815292830182828015612203576020028201919060005260206000209081546001600160a01b03168152600190910190602001808311612fd7575050505050905092915050565b60008481526009602052604081206132b4600186615174565b815481106132c4576132c4615187565b60009182526020808320958352600d9190910290940160070184526040808220938252929093525090206009015492915050565b6000818152600960209081526040808320600201805482518185028101850190935280835260609492939192909184015b82821015611b295760008481526020908190208301805460408051828502810185019091528181529283018282801561338157602002820191906000526020600020905b81548152602001906001019080831161336d575b505050505081526020019060010190613329565b60008281526009602052604090206060906133b1600184615174565b815481106133c1576133c1615187565b90600052602060002090600d0201600801805480602002602001604051908101604052809291908181526020016000905b828210156126505783829060005260206000200180546134119061519d565b80601f016020809104026020016040519081016040528092919081815260200182805461343d9061519d565b801561348a5780601f1061345f5761010080835404028352916020019161348a565b820191906000526020600020905b81548152906001019060200180831161346d57829003601f168201915b5050505050815260200190600101906133f2565b6000600b826040516134b091906151d7565b9081526020016040518091039020600201549050919050565b60008481526009602052604081206134e2600186615174565b815481106134f2576134f2615187565b60009182526020808320958352600d919091029094016007018452604080822093825292909352509020600a015492915050565b60005460405162a08cef60e31b81523360048201526001600160a01b0390911690630504677890602401602060405180830381865afa15801561356d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061359191906151f3565b6135ae5760405163e6c4247b60e01b815260040160405180910390fd5b600080546001600160a01b0319166001600160a01b0392909216919091179055565b6005546001600160a01b031633146135fb576040516303777f6960e51b815260040160405180910390fd5b6000818152600860209081526040808320858452909152812054613620906001615425565b600083815260086020908152604080832087845282529182902083905581518681529081018590529081018290529091507fd4dbda378623f00b72ef135b4579b7ba064c49645217eb107d663831efac63589060600160405180910390a16000838152600960205260409020600d015481036136f257600082815260086020908152604080832060020180546001810182559084529282902090920185905581518581529081018490527f77ea6debc663dad7a8e05dda9320c0ed1027cb92c4ba923c3888885c301577099101612135565b505050565b6000828152600960205260408120613710600184615174565b8154811061372057613720615187565b90600052602060002090600d0201600b0154905092915050565b6000818152600c60209081526040808320858452909152902080546060919061218a9061519d565b600084815260096020526040812061377b600186615174565b8154811061378b5761378b615187565b60009182526020808320958352600d91909102909401600701845260408082209382529290935250902060120154610100900460ff1692915050565b60005b835181101561399657825460018181018555600085815260209020600d909202909101906137f9908390615425565b600a820155845185908390811061381257613812615187565b6020908102919091018101515180518051919284926138349284920190613e5e565b50602082810151805161384d9260018501920190613ebb565b5060408201518051613869916002840191602090910190613f14565b5060608201518051613885916003840191602090910190613f14565b50608082015180516138a1916004840191602090910190613f75565b5060a091909101516005909101805460ff191691151591909117905584518590839081106138d1576138d1615187565b6020026020010151604001515181600b01819055508482815181106138f8576138f8615187565b6020026020010151602001515181600c018190555084828151811061391f5761391f615187565b60200260200101516060015181600901908161393b919061525e565b5061395f8186848151811061395257613952615187565b602002602001015161399c565b6139838186848151811061397557613975615187565b602002602001015185613a6e565b508061398e8161531d565b9150506137ca565b50505050565b60005b8160200151518110156136f2576000826020015182815181106139c4576139c4615187565b6020908102919091018101516006860180546001818101835560009283529390912082516004909202018054929450929091839160ff19909116908381811115613a1057613a1061427a565b021790555060208201516001820190613a29908261525e565b5060408201516002820180546001600160a01b0319166001600160a01b0390921691909117905560609091015160039091015580613a668161531d565b91505061399f565b60008260400151516001600160401b03811115613a8d57613a8d6142c1565b604051908082528060200260200182016040528015613ac057816020015b6060815260200190600190039081613aab5790505b50905060005b836040015151811015613d8957600084604001518281518110613aeb57613aeb615187565b60209081029190910181015160608101516000908152600789018352604080822060808401518352845290208151805192945084939192613b2f9284920190613f75565b5060208201516001820190613b44908261525e565b5060408201516002820190613b59908261525e565b50606082015160038201556080820151600482015560a0820151600582015560c0820151600682015560e082015160078201556101008083015160088301556101208301516009830155610140830151600a80840191909155610160840151600b840155610180840151600c8401556101a0840151600d8401556101c0840151600e8401556101e0840151600f84015561020084015160108401556102208401516011840155610240840151601290930180546102608601516102808701516102a08801516102c09098015115156401000000000264ff000000001998151563010000000263ff0000001992151562010000029290921663ffff00001993151590970261ff00199815159890981661ffff199094169390931796909617169390931793909317939093161790556020820151604051613c9891906151d7565b90815260408051918290036020908101832080546001810182556000918252908290200187905560608084018352848301518452840151838201526080840151838301528301519051600b91613ced916151d7565b90815260405190819003602001902081518190613d0a908261525e565b5060208281015160018301556040928301516002909201919091558281015160608401516000908152600c83528381206080860151825290925291902090613d52908261525e565b508060400151838381518110613d6a57613d6a615187565b6020026020010181905250508080613d819061531d565b915050613ac6565b508051613d9f9060088601906020840190613fb0565b5050505050565b50805460008255600d0290600052602060002090810190613dc79190614002565b50565b5080546000825590600052602060002090810190613dc791906140a4565b5080546000825590600052602060002090810190613dc791906140c1565b5080546000825590600052602060002090810190613dc791906140de565b508054613e309061519d565b6000825580601f10613e40575050565b601f016020900490600052602060002090810190613dc791906140de565b828054828255906000526020600020908101928215613eab579160200282015b82811115613eab5782518051613e9b918491602090910190613fb0565b5091602001919060010190613e7e565b50613eb79291506140a4565b5090565b828054828255906000526020600020908101928215613f08579160200282015b82811115613f085782518051613ef8918491602090910190613f75565b5091602001919060010190613edb565b50613eb79291506140c1565b828054828255906000526020600020908101928215613f69579160200282015b82811115613f6957825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190613f34565b50613eb79291506140de565b828054828255906000526020600020908101928215613f69579160200282015b82811115613f69578251825591602001919060010190613f95565b828054828255906000526020600020908101928215613ff6579160200282015b82811115613ff65782518290613fe6908261525e565b5091602001919060010190613fd0565b50613eb79291506140f3565b80821115613eb757600081816140188282613dca565b614026600183016000613de8565b614034600283016000613e06565b614042600383016000613e06565b614050600483016000613e06565b50600501805460ff1916905561406a600683016000614110565b614078600883016000614131565b614086600983016000613e24565b506000600a8201819055600b8201819055600c820155600d01614002565b80821115613eb75760006140b88282614131565b506001016140a4565b80821115613eb75760006140d58282613e06565b506001016140c1565b5b80821115613eb757600081556001016140df565b80821115613eb75760006141078282613e24565b506001016140f3565b5080546000825560040290600052602060002090810190613dc7919061414f565b5080546000825590600052602060002090810190613dc791906140f3565b80821115613eb757805460ff19168155600061416e6001830182613e24565b506002810180546001600160a01b03191690556000600382015560040161414f565b600080604083850312156141a357600080fd5b50508035926020909101359150565b600080600080608085870312156141c857600080fd5b5050823594602084013594506040840135936060013592509050565b60005b838110156141ff5781810151838201526020016141e7565b50506000910152565b600081518084526142208160208601602086016141e4565b601f01601f19169290920160200192915050565b6020815260006142476020830184614208565b9392505050565b60008060006060848603121561426357600080fd5b505081359360208301359350604090920135919050565b634e487b7160e01b600052602160045260246000fd5b60028110613dc757634e487b7160e01b600052602160045260246000fd5b602081016142bb83614290565b91905290565b634e487b7160e01b600052604160045260246000fd5b60405160c081016001600160401b03811182821017156142f9576142f96142c1565b60405290565b604051608081016001600160401b03811182821017156142f9576142f96142c1565b6040516102e081016001600160401b03811182821017156142f9576142f96142c1565b60405160a081016001600160401b03811182821017156142f9576142f96142c1565b60405160e081016001600160401b03811182821017156142f9576142f96142c1565b6040516102a081016001600160401b03811182821017156142f9576142f96142c1565b604051601f8201601f191681016001600160401b03811182821017156143d3576143d36142c1565b604052919050565b600082601f8301126143ec57600080fd5b81356001600160401b03811115614405576144056142c1565b614418601f8201601f19166020016143ab565b81815284602083860101111561442d57600080fd5b816020850160208301376000918101602001919091529392505050565b60006020828403121561445c57600080fd5b81356001600160401b0381111561447257600080fd5b61447e848285016143db565b949350505050565b60006020828403121561449857600080fd5b5035919050565b6020808252825182820181905260009190848201906040850190845b818110156144d7578351835292840192918401916001016144bb565b50909695505050505050565b80356001600160a01b03811681146144fa57600080fd5b919050565b60006020828403121561451157600080fd5b614247826144e3565b600081518084526020808501808196508360051b8101915082860160005b85811015614562578284038952614550848351614208565b98850198935090840190600101614538565b5091979650505050505050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b828110156145c457603f198886030184526145b285835161451a565b94509285019290850190600101614596565b5092979650505050505050565b8015158114613dc757600080fd5b80356144fa816145d1565b6000806000806080858703121561460057600080fd5b8435935060208501359250604085013591506060850135614620816145d1565b939692955090935050565b6000806040838503121561463e57600080fd5b614647836144e3565b9150614655602084016144e3565b90509250929050565b602081526000614247602083018461451a565b60008060006060848603121561468657600080fd5b61468f846144e3565b95602085013595506040909401359392505050565b6020808252825182820181905260009190848201906040850190845b818110156144d75783516001600160a01b0316835292840192918401916001016146c0565b60006001600160401b038211156146fe576146fe6142c1565b5060051b60200190565b600082601f83011261471957600080fd5b8135602061472e614729836146e5565b6143ab565b82815260059290921b8401810191818101908684111561474d57600080fd5b8286015b848110156147ff5780356001600160401b038082111561477057600080fd5b818901915089603f83011261478457600080fd5b85820135614794614729826146e5565b81815260059190911b830160400190878101908c8311156147b457600080fd5b604085015b838110156147ed578035858111156147d057600080fd5b6147df8f6040838a01016143db565b8452509189019189016147b9565b50875250505092840192508301614751565b509695505050505050565b600082601f83011261481b57600080fd5b8135602061482b614729836146e5565b82815260059290921b8401810191818101908684111561484a57600080fd5b8286015b848110156147ff578035835291830191830161484e565b600082601f83011261487657600080fd5b81356020614886614729836146e5565b82815260059290921b840181019181810190868411156148a557600080fd5b8286015b848110156147ff5780356001600160401b038111156148c85760008081fd5b6148d68986838b010161480a565b8452509183019183016148a9565b600082601f8301126148f557600080fd5b81356020614905614729836146e5565b82815260059290921b8401810191818101908684111561492457600080fd5b8286015b848110156147ff57614939816144e3565b8352918301918301614928565b600060c0828403121561495857600080fd5b6149606142d7565b905081356001600160401b038082111561497957600080fd5b61498585838601614708565b8352602084013591508082111561499b57600080fd5b6149a785838601614865565b602084015260408401359150808211156149c057600080fd5b6149cc858386016148e4565b604084015260608401359150808211156149e557600080fd5b6149f1858386016148e4565b60608401526080840135915080821115614a0a57600080fd5b50614a178482850161480a565b608083015250614a2960a083016145df565b60a082015292915050565b600082601f830112614a4557600080fd5b81356020614a55614729836146e5565b82815260059290921b84018101918181019086841115614a7457600080fd5b8286015b848110156147ff5780356001600160401b0380821115614a985760008081fd5b908801906080828b03601f1901811315614ab25760008081fd5b614aba6142ff565b8784013560028110614acc5760008081fd5b815260408481013584811115614ae25760008081fd5b614af08e8b838901016143db565b8a8401525060609350614b048486016144e3565b90820152920135908201528352918301918301614a78565b600082601f830112614b2d57600080fd5b81356020614b3d614729836146e5565b82815260059290921b84018101918181019086841115614b5c57600080fd5b8286015b848110156147ff5780356001600160401b0380821115614b805760008081fd5b908801906102e0828b03601f1901811315614b9b5760008081fd5b614ba3614321565b8784013583811115614bb55760008081fd5b614bc38d8a8388010161480a565b82525060408085013584811115614bda5760008081fd5b614be88e8b838901016143db565b8a8401525060608086013585811115614c015760008081fd5b614c0f8f8c838a01016143db565b8385015250608094508486013581840152505060a0808501358483015260c0935083850135818301525060e08085013584830152610100935083850135818301525061012080850135848301526101409350838501358183015250610160808501358483015261018093508385013581830152506101a080850135848301526101c093508385013581830152506101e08085013584830152610200935083850135818301525061022080850135848301526102409350838501358183015250610260614cdc8186016145df565b848301526102809350614cf08486016145df565b908201526102a0614d028582016145df565b848301526102c09350614d168486016145df565b90820152614d258483016145df565b9281019290925250845250918301918301614b60565b600082601f830112614d4c57600080fd5b81356020614d5c614729836146e5565b82815260059290921b84018101918181019086841115614d7b57600080fd5b8286015b848110156147ff5780356001600160401b0380821115614d9f5760008081fd5b9088019060a0828b03601f1901811315614db95760008081fd5b614dc1614344565b8784013583811115614dd35760008081fd5b614de18d8a83880101614946565b82525060408085013584811115614df85760008081fd5b614e068e8b83890101614a34565b8a8401525060608086013585811115614e1f5760008081fd5b614e2d8f8c838a0101614b1c565b8385015250608091508186013585811115614e485760008081fd5b614e568f8c838a01016143db565b9184019190915250919093013590830152508352918301918301614d7f565b600060208284031215614e8757600080fd5b81356001600160401b0380821115614e9e57600080fd5b9083019060e08286031215614eb257600080fd5b614eba614366565b82358152602083013582811115614ed057600080fd5b614edc87828601614946565b602083015250604083013582811115614ef457600080fd5b614f0087828601614d3b565b604083015250606083013582811115614f1857600080fd5b614f24878286016143db565b606083015250614f36608084016144e3565b608082015260a083013560a082015260c083013560c082015280935050505092915050565b6000602080830181845280855180835260408601915060408160051b87010192508387016000805b83811015614fd757888603603f19018552825180518088529088019088880190845b81811015614fc15783518352928a0192918a0191600101614fa5565b5090975050509386019391860191600101614f83565b509398975050505050505050565b60008060408385031215614ff857600080fd5b82356001600160401b038082111561500f57600080fd5b908401906102a0828703121561502457600080fd5b61502c614388565b82358281111561503b57600080fd5b615047888286016143db565b8252506020838101359082015260408084013590820152606080840135908201526080808401359082015260a0808401359082015260c0808401359082015260e08084013590820152610100808401359082015261012080840135908201526101408084013590820152610160808401359082015261018080840135908201526101a080840135908201526101c080840135908201526101e0808401359082015261020091506150f88284016145df565b82820152610220915061510c8284016145df565b8282015261024091506151208284016145df565b8282015261026091506151348284016145df565b8282015261028091506151488284016145df565b9181019190915295602094909401359450505050565b634e487b7160e01b600052601160045260246000fd5b818103818111156112225761122261515e565b634e487b7160e01b600052603260045260246000fd5b600181811c908216806151b157607f821691505b6020821081036151d157634e487b7160e01b600052602260045260246000fd5b50919050565b600082516151e98184602087016141e4565b9190910192915050565b60006020828403121561520557600080fd5b8151614247816145d1565b601f8211156136f257600081815260208120601f850160051c810160208610156152375750805b601f850160051c820191505b8181101561525657828155600101615243565b505050505050565b81516001600160401b03811115615277576152776142c1565b61528b81615285845461519d565b84615210565b602080601f8311600181146152c057600084156152a85750858301515b600019600386901b1c1916600185901b178555615256565b600085815260208120601f198616915b828110156152ef578886015182559484019460019091019084016152d0565b508582101561530d5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60006001820161532f5761532f61515e565b5060010190565b818103615341575050565b61534b825461519d565b6001600160401b03811115615362576153626142c1565b61537081615285845461519d565b6000601f8211600181146153a4576000831561538c5750848201545b600019600385901b1c1916600184901b178455613d9f565b600085815260209020601f19841690600086815260209020845b838110156153de57828601548255600195860195909101906020016153be565b508583101561530d5793015460001960f8600387901b161c19169092555050600190811b01905550565b8281526040810161541883614290565b8260208301529392505050565b808201808211156112225761122261515e56fea2646970667358221220f030deda900ae0f4ccd516e31b9f81def2353f779f976a19a76b5e061ab95f0b64736f6c63430008130033
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106105d25760003560e01c80637a57dad811610300578063c3e35d4d116101a8578063e14ffb9e116100f4578063f903ad86116100ad578063fd4c9fbe11610087578063fd4c9fbe14611194578063fd800a72146111a7578063fd9d3c21146111e6578063ffce6261146111ee57600080fd5b8063f903ad86146110fe578063f9cc469614611145578063fa4ac00b1461115857600080fd5b8063e14ffb9e1461107c578063e277c8911461108f578063e2839eb3146110a2578063e784c517146110b5578063e9e0c04e146110c8578063f326206b146110eb57600080fd5b8063d11f220311610161578063d7ea46431161013b578063d7ea464314610fec578063d85c671a14611010578063e016cea614611023578063e068856e1461103657600080fd5b8063d11f220314610f61578063d173403214610f9d578063d2c42a7b14610fd957600080fd5b8063c3e35d4d14610e9d578063c6cd50ff14610ed9578063ca223ba514610f15578063ce1982d914610f28578063cf405da914610f3b578063cfdf9f6b14610f4e57600080fd5b80639a07e00811610267578063a67599a911610220578063c0f55b7c116101fa578063c0f55b7c14610e41578063c17b608314610e54578063c2010e5014610e67578063c2f0d6e414610e8a57600080fd5b8063a67599a914610dc8578063aaea9a8614610ddb578063b756019a14610e0857600080fd5b80639a07e00814610d565780639be8a0eb14610d69578063a08edda014610d7c578063a15b30ba14610d8f578063a17b307e14610da2578063a1d2f56814610db557600080fd5b80638e073cfc116102b95780638e073cfc14610ccc5780638fa33a1c14610cdf57806391719e7814610cf25780639434430714610d1857806395d89b4114610d3b5780639951197c14610d4357600080fd5b80637a57dad814610be257806382daf2e914610c0557806383428e0d14610c1857806385d40a0714610c2b5780638916825014610c675780638baa96a414610c8757600080fd5b806336d6a30a1161047e578063598ca3c0116103ca5780636a1a4f5b116103835780636f552a7c1161035d5780636f552a7c14610b695780637182ecd114610b7c578063756d104414610bbc5780637769dcd914610bcf57600080fd5b80636a1a4f5b14610b0d5780636cacf67414610b2d5780636d34191b14610b5657600080fd5b8063598ca3c014610a8257806359ce839d14610a955780635c557a9414610aa85780636222b57914610abb5780636522566514610ace5780636527293314610afa57600080fd5b8063485cc9551161043757806350d9a72d1161041157806350d9a72d146109af5780635302113d146109cf5780635562c17e14610a0b57806356c469c614610a4757600080fd5b8063485cc955146109765780634b7d93f2146109895780634f5701cb1461099c57600080fd5b806336d6a30a146108c35780633aebaeaa146108d65780633cb7e7da146108de5780633eb229561461090c5780634277b9041461091f57806344c60a3d1461093257600080fd5b806322510a4a1161053d5780632a962d1e116104f65780632c71b749116104d05780632c71b749146108415780632e78e46f1461085457806334b2201b14610874578063363756d11461088757600080fd5b80632a962d1e146108085780632b7b63861461081b5780632bd719a31461082e57600080fd5b806322510a4a1461073d5780632639433c14610750578063279f7ac91461076357806328185781146107765780632824d2f4146107a15780632871eaa5146107dd57600080fd5b80630f1996a81161058f5780630f1996a81461067b5780630f848dfc1461068e578063103d36b8146106ae57806311eb85a0146106c3578063170b00ba146106ff5780631c5a65c81461071257600080fd5b806302dce97f146105d75780630487228d146105ff57806306fdde03146106205780630addf880146106355780630d05962d146106485780630efa3b2e14610668575b600080fd5b6105ea6105e5366004614190565b611201565b60405190151581526020015b60405180910390f35b61061261060d3660046141b2565b611228565b6040519081526020016105f6565b610628611285565b6040516105f69190614234565b6106126106433660046141b2565b611313565b61065b61065636600461424e565b611370565b6040516105f691906142ae565b61061261067636600461444a565b6113d7565b6105ea6106893660046141b2565b611402565b6106a161069c366004614486565b61146a565b6040516105f6919061449f565b6106c16106bc366004614486565b6114cf565b005b6106126106d136600461424e565b6000928352600860209081526040808520928552600490920181528184209284529190915290206003015490565b61061261070d3660046141b2565b6115f1565b61072561072036600461424e565b61164e565b6040516001600160a01b0390911681526020016105f6565b61062861074b36600461424e565b6116be565b6105ea61075e3660046141b2565b611778565b6106c16107713660046144ff565b6117d8565b610612610784366004614190565b600091825260086020908152604080842092845291905290205490565b6106126107af36600461424e565b600092835260086020908152604080852092855260049092018152818420928452919091529020600f015490565b6106126107eb366004614190565b6000918252600e6020908152604080842092845291905290205490565b6106126108163660046141b2565b611882565b6105ea6108293660046141b2565b6118df565b61061261083c3660046141b2565b611945565b6106a161084f366004614486565b6119a2565b610867610862366004614486565b611a05565b6040516105f6919061456f565b600154610725906001600160a01b031681565b61061261089536600461424e565b6000928352600860209081526040808520928552600490920181528184209284529190915290206006015490565b6106286108d136600461444a565b611b34565b600654610612565b61065b6108ec366004614486565b60009081526009602081905260409091200154600160a01b900460ff1690565b6106c161091a3660046145ea565b611bdb565b6105ea61092d366004614190565b611c9e565b6105ea61094036600461424e565b60009283526008602090815260408085209285526004909201815281842092845291909152902060100154610100900460ff1690565b6106c161098436600461462b565b611ce5565b6106a1610997366004614486565b611da2565b6106a16109aa366004614486565b611e05565b6109c26109bd366004614486565b611e68565b6040516105f6919061465e565b6106126109dd36600461424e565b600092835260086020908152604080852092855260049092018152818420928452919091529020600d015490565b610612610a1936600461424e565b600092835260086020908152604080852092855260049092018152818420928452919091529020600b015490565b610612610a5536600461424e565b60009283526008602081815260408086209386526004909301815282852093855292909252909120015490565b610612610a903660046141b2565b611f4c565b6105ea610aa33660046141b2565b611fa8565b6106c1610ab6366004614671565b61200f565b610628610ac9366004614190565b612142565b610725610adc366004614486565b6000908152600860205260409020600701546001600160a01b031690565b6106a1610b083660046141b2565b612210565b610b20610b1b366004614486565b6122b6565b6040516105f691906146a4565b610612610b3b3660046144ff565b6001600160a01b03166000908152600d602052604090205490565b6106c1610b64366004614e75565b612324565b600254610725906001600160a01b031681565b610ba7610b8a366004614486565b6000908152600960205260409020600b810154600c909101549091565b604080519283526020830191909152016105f6565b610867610bca366004614190565b6124fd565b610612610bdd36600461424e565b61265c565b610612610bf0366004614486565b6000908152600960205260409020600b015490565b610612610c133660046141b2565b6126c2565b6105ea610c2636600461424e565b61271f565b610612610c3936600461424e565b6000928352600860209081526040808520928552600490920181528184209284529190915290206005015490565b610c7a610c75366004614190565b612763565b6040516105f69190614f5b565b6105ea610c9536600461424e565b6000928352600860209081526040808520928552600490920181528184209284529190915290206010015462010000900460ff1690565b6106c1610cda3660046144ff565b61282f565b610628610ced36600461424e565b6128f2565b6105ea610d00366004614486565b60009081526009602052604090206006015460ff1690565b610612610d26366004614486565b6000908152600960205260409020600c015490565b61062861295c565b610612610d513660046141b2565b612969565b6106c1610d643660046144ff565b6129c6565b610612610d773660046141b2565b612a89565b610612610d8a3660046141b2565b612ae6565b610612610d9d366004614190565b612b43565b6106c1610db0366004614fe5565b612b86565b600554610725906001600160a01b031681565b6106a1610dd636600461444a565b612efa565b610725610de9366004614486565b600090815260096020819052604090912001546001600160a01b031690565b610612610e1636600461424e565b6000928352600860209081526040808520928552600492830182528085209385529290529120015490565b610b20610e4f366004614190565b612f68565b610b20610e62366004614486565b613001565b610612610e75366004614486565b6000908152600960205260409020600d015490565b610612610e983660046141b2565b61306e565b610612610eab36600461424e565b600092835260086020908152604080852092855260049092018152818420928452919091529020600a015490565b610612610ee736600461424e565b600092835260086020908152604080852092855260049092018152818420928452919091529020600c015490565b6106c1610f23366004614486565b6130cb565b610628610f36366004614486565b613154565b6106a1610f49366004614190565b613174565b610b20610f5c366004614190565b613203565b610612610f6f36600461424e565b600092835260086020908152604080852092855260049092018152818420928452919091529020600e015490565b610612610fab36600461424e565b6000928352600860209081526040808520928552600490920181528184209284529190915290206007015490565b610612610fe73660046141b2565b61329b565b610612610ffa366004614486565b6000908152600860208190526040909120015490565b610c7a61101e366004614486565b6132f8565b6109c2611031366004614190565b613395565b6105ea61104436600461424e565b600092835260086020908152604080852092855260049092018152818420928452919091529020601001546301000000900460ff1690565b61061261108a36600461444a565b61349e565b61061261109d3660046141b2565b6134c9565b600054610725906001600160a01b031681565b6106c16110c33660046144ff565b613526565b6106126110d6366004614486565b6000908152600960205260409020600e015490565b6106c16110f9366004614190565b6135d0565b6105ea61110c36600461424e565b60009283526008602090815260408085209285526004909201815281842092845291909152902060100154640100000000900460ff1690565b610612611153366004614190565b6136f7565b61061261116636600461424e565b6000928352600860209081526040808520928552600490920181528184209284529190915290206009015490565b6106286111a2366004614190565b61373a565b6105ea6111b536600461424e565b6000928352600860209081526040808520928552600490920181528184209284529190915290206010015460ff1690565b600754610612565b6105ea6111fc3660046141b2565b613762565b600082815260086020908152604080832084845260030190915290205460ff165b92915050565b6000848152600960205260408120611241600186615174565b8154811061125157611251615187565b60009182526020808320958352600d9190910290940160070184526040808220938252929093525090206011015492915050565b600380546112929061519d565b80601f01602080910402602001604051908101604052809291908181526020018280546112be9061519d565b801561130b5780601f106112e05761010080835404028352916020019161130b565b820191906000526020600020905b8154815290600101906020018083116112ee57829003601f168201915b505050505081565b600084815260096020526040812061132c600186615174565b8154811061133c5761133c615187565b60009182526020808320958352600d919091029094016007018452604080822093825292909352509020600c015492915050565b6000838152600960205260408120611389600184615174565b8154811061139957611399615187565b90600052602060002090600d020160060183815481106113bb576113bb615187565b600091825260209091206004909102015460ff16949350505050565b6000600b826040516113e991906151d7565b9081526020016040518091039020600101549050919050565b600084815260096020526040812061141b600186615174565b8154811061142b5761142b615187565b60009182526020808320958352600d91909102909401600701845260408082209382529290935250902060120154640100000000900460ff1692915050565b6000818152600860209081526040918290206002018054835181840281018401909452808452606093928301828280156114c357602002820191906000526020600020905b8154815260200190600101908083116114af575b50505050509050919050565b6002546001600160a01b031633146114fa576040516303777f6960e51b815260040160405180910390fd5b6000818152600960205260408120906115138282613da6565b6001820160006115238282613dca565b611531600183016000613de8565b61153f600283016000613e06565b61154d600383016000613e06565b61155b600483016000613e06565b50600501805460ff19169055611575600783016000613e06565b611583600883016000613e24565b506009810180546001600160a81b03191690556000600a8201819055600b8201819055600c8201819055600d8201819055600e909101556040518181527fcbe2e2b576d488acbd141580ea0928b24300831852f56c7eb39330a9a35e1e6d906020015b60405180910390a150565b600084815260096020526040812061160a600186615174565b8154811061161a5761161a615187565b600091825260208083208684526007600d938402909101018152604080842086855290915290912001549050949350505050565b6000838152600960205260408120611667600184615174565b8154811061167757611677615187565b90600052602060002090600d0201600601838154811061169957611699615187565b60009182526020909120600490910201600201546001600160a01b0316949350505050565b6000838152600860209081526040808320848452600401825280832085845290915290208054606091906116f19061519d565b80601f016020809104026020016040519081016040528092919081815260200182805461171d9061519d565b801561176a5780601f1061173f5761010080835404028352916020019161176a565b820191906000526020600020905b81548152906001019060200180831161174d57829003601f168201915b505050505090509392505050565b6000848152600960205260408120611791600186615174565b815481106117a1576117a1615187565b60009182526020808320958352600d9190910290940160070184526040808220938252929093525090206012015460ff1692915050565b60005460405162a08cef60e31b81523360048201526001600160a01b0390911690630504677890602401602060405180830381865afa15801561181f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061184391906151f3565b6118605760405163e6c4247b60e01b815260040160405180910390fd5b600580546001600160a01b0319166001600160a01b0392909216919091179055565b600084815260096020526040812061189b600186615174565b815481106118ab576118ab615187565b60009182526020808320958352600d9190910290940160070184526040808220938252929093525090206005015492915050565b60008481526009602052604081206118f8600186615174565b8154811061190857611908615187565b60009182526020808320958352600d9190910290940160070184526040808220938252929093525090206012015462010000900460ff1692915050565b600084815260096020526040812061195e600186615174565b8154811061196e5761196e615187565b60009182526020808320958352600d919091029094016007018452604080822093825292909352509020600e015492915050565b6000818152600960209081526040918290206005018054835181840281018401909452808452606093928301828280156114c357602002820191906000526020600020908154815260200190600101908083116114af5750505050509050919050565b6000818152600960209081526040808320600101805482518185028101850190935280835260609492939192909184015b82821015611b2957838290600052602060002001805480602002602001604051908101604052809291908181526020016000905b82821015611b16578382906000526020600020018054611a899061519d565b80601f0160208091040260200160405190810160405280929190818152602001828054611ab59061519d565b8015611b025780601f10611ad757610100808354040283529160200191611b02565b820191906000526020600020905b815481529060010190602001808311611ae557829003601f168201915b505050505081526020019060010190611a6a565b5050505081526020019060010190611a36565b505050509050919050565b6060600b82604051611b4691906151d7565b9081526040519081900360200190208054611b609061519d565b80601f0160208091040260200160405190810160405280929190818152602001828054611b8c9061519d565b80156114c35780601f10611bae576101008083540402835291602001916114c3565b820191906000526020600020905b815481529060010190602001808311611bbc5750939695505050505050565b6001546001600160a01b03163314611c06576040516303777f6960e51b815260040160405180910390fd5b600084815260086020908152604080832086845260050190915281208291611c2f600186615174565b81526020808201929092526040908101600020805460ff191693151593909317909255815186815290810185905290810183905281151560608201527f3e5fd3c8c3bf9ba7775238a59e49658c93eca135b514862163084e5e24ee8fd09060800160405180910390a150505050565b6000828152600960205260408120611cb7600184615174565b81548110611cc757611cc7615187565b60009182526020909120600d909102016005015460ff169392505050565b6000546001600160a01b031615611d0e5760405162dc149f60e41b815260040160405180910390fd5b60408051808201909152600f81526e4b696e6f726151756573744461746160881b6020820152600390611d41908261525e565b5060408051808201909152600381526212d45160ea1b6020820152600490611d69908261525e565b5060006006819055600781905580546001600160a01b039384166001600160a01b03199182161790915560058054929093169116179055565b6000818152600960209081526040918290206007018054835181840281018401909452808452606093928301828280156114c357602002820191906000526020600020908154815260200190600101908083116114af5750505050509050919050565b6000818152600860209081526040918290206001018054835181840281018401909452808452606093928301828280156114c357602002820191906000526020600020908154815260200190600101908083116114af5750505050509050919050565b606060086000838152602001908152602001600020600601805480602002602001604051908101604052809291908181526020016000905b82821015611b29578382906000526020600020018054611ebf9061519d565b80601f0160208091040260200160405190810160405280929190818152602001828054611eeb9061519d565b8015611f385780601f10611f0d57610100808354040283529160200191611f38565b820191906000526020600020905b815481529060010190602001808311611f1b57829003601f168201915b505050505081526020019060010190611ea0565b6000848152600960205260408120611f65600186615174565b81548110611f7557611f75615187565b600091825260208083208684526007600d9093020182018152604080842086855290915290912001549050949350505050565b6000848152600960205260408120611fc1600186615174565b81548110611fd157611fd1615187565b60009182526020808320958352600d919091029094016007018452604080822093825292909352509020601201546301000000900460ff1692915050565b6005546001600160a01b0316331461203a576040516303777f6960e51b815260040160405180910390fd5b60008181526008602081905260408220015490036120ab57600780549060006120628361531d565b909155505060008181526008602081815260408084206007810180546001600160a01b0319166001600160a01b038a16908117909155429190940155918352600d905290208190555b60008181526008602090815260408083206001808201805480830182559086528486200187905586855260039091018352818420805460ff191682179055600983528184206007018054918201815584529282902090920183905581518481529081018390527f460fc19d43699e9d9517be583f6e6648433b80374cbd6837e466cd09e5b6598791015b60405180910390a1505050565b600082815260096020526040902060609061215e600184615174565b8154811061216e5761216e615187565b90600052602060002090600d0201600901805461218a9061519d565b80601f01602080910402602001604051908101604052809291908181526020018280546121b69061519d565b80156122035780601f106121d857610100808354040283529160200191612203565b820191906000526020600020905b8154815290600101906020018083116121e657829003601f168201915b5050505050905092915050565b600084815260096020526040902060609061222c600186615174565b8154811061223c5761223c615187565b600091825260208083208684526007600d909302019190910181526040808320858452825291829020805483518184028101840190945280845290918301828280156122a757602002820191906000526020600020905b815481526020019060010190808311612293575b50505050509050949350505050565b6000818152600960209081526040918290206004018054835181840281018401909452808452606093928301828280156114c357602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116122fb5750505050509050919050565b6005546001600160a01b0316331461234f576040516303777f6960e51b815260040160405180910390fd5b6006805490600061235f8361531d565b90915550506006546000818152600960208181526040909220600a81019390935560a0840151600c84015560c0840151600b840155608084015190830180548551600e8601556001600160a81b0319166001600160a01b039092169190911790558281015180518051919260018501926123dc9284920190613e5e565b5060208281015180516123f59260018501920190613ebb565b5060408201518051612411916002840191602090910190613f14565b506060820151805161242d916003840191602090910190613f14565b5060808201518051612449916004840191602090910190613f75565b5060a091909101516005909101805460ff1916911515919091179055604082015151600d82015560608201516008820190612484908261525e565b506124968260400151826006546137c7565b60065460c08301516000908152600e6020908152604080832060a0870151845282529182902083905581850151518251938452908301527f5fc06d224c9af68add198a86b9edf62077458edade4534748f0ee3e3a4ff965a91015b60405180910390a15050565b6000828152600960205260409020606090612519600184615174565b8154811061252957612529615187565b90600052602060002090600d0201600001600001805480602002602001604051908101604052809291908181526020016000905b8282101561265057838290600052602060002001805480602002602001604051908101604052809291908181526020016000905b8282101561263d5783829060005260206000200180546125b09061519d565b80601f01602080910402602001604051908101604052809291908181526020018280546125dc9061519d565b80156126295780601f106125fe57610100808354040283529160200191612629565b820191906000526020600020905b81548152906001019060200180831161260c57829003601f168201915b505050505081526020019060010190612591565b505050508152602001906001019061255d565b50505050905092915050565b6000838152600960205260408120612675600184615174565b8154811061268557612685615187565b90600052602060002090600d020160060183815481106126a7576126a7615187565b90600052602060002090600402016003015490509392505050565b60008481526009602052604081206126db600186615174565b815481106126eb576126eb615187565b60009182526020808320958352600d919091029094016007018452604080822093825292909352509020600b015492915050565b6000838152600860209081526040808320858452600501909152812081612747600185615174565b815260208101919091526040016000205460ff16949350505050565b600082815260096020526040902060609061277f600184615174565b8154811061278f5761278f615187565b90600052602060002090600d0201600001600101805480602002602001604051908101604052809291908181526020016000905b828210156126505760008481526020908190208301805460408051828502810185019091528181529283018282801561281b57602002820191906000526020600020905b815481526020019060010190808311612807575b5050505050815260200190600101906127c3565b60005460405162a08cef60e31b81523360048201526001600160a01b0390911690630504677890602401602060405180830381865afa158015612876573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061289a91906151f3565b1580156128b257506005546001600160a01b03163314155b156128d05760405163e6c4247b60e01b815260040160405180910390fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b600083815260096020526040902060609061290e600184615174565b8154811061291e5761291e615187565b90600052602060002090600d0201600601838154811061294057612940615187565b906000526020600020906004020160010180546116f19061519d565b600480546112929061519d565b6000848152600960205260408120612982600186615174565b8154811061299257612992615187565b60009182526020808320958352600d919091029094016007018452604080822093825292909352509020600f015492915050565b60005460405162a08cef60e31b81523360048201526001600160a01b0390911690630504677890602401602060405180830381865afa158015612a0d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a3191906151f3565b158015612a4957506005546001600160a01b03163314155b15612a675760405163e6c4247b60e01b815260040160405180910390fd5b600280546001600160a01b0319166001600160a01b0392909216919091179055565b6000848152600960205260408120612aa2600186615174565b81548110612ab257612ab2615187565b60009182526020808320958352600d9190910290940160070184526040808220938252929093525090206010015492915050565b6000848152600960205260408120612aff600186615174565b81548110612b0f57612b0f615187565b60009182526020808320958352600d9190910290940160070184526040808220938252929093525090206008015492915050565b6000828152600960205260408120612b5c600184615174565b81548110612b6c57612b6c615187565b90600052602060002090600d0201600c0154905092915050565b6001546001600160a01b03163314612bb1576040516303777f6960e51b815260040160405180910390fd5b6000818152600860208190526040822001549003612be2576040516313fee0df60e21b815260040160405180910390fd5b60008181526008602090815260408083208583015184526004018252808320858201518452909152902060010154158015612c48575060008181526008602090815260408083208583015184526004018252808320858201518452909152902060020154155b15612d4e576020808301516000908152600c825260408082208186015183529092529081208054612c789061519d565b80601f0160208091040260200160405190810160405280929190818152602001828054612ca49061519d565b8015612cf15780601f10612cc657610100808354040283529160200191612cf1565b820191906000526020600020905b815481529060010190602001808311612cd457829003601f168201915b5050505050905060086000838152602001908152602001600020600601600b82604051612d1e91906151d7565b9081526040516020918190038201902082546001810184556000938452919092200190612d4b9082615336565b50505b60008181526008602090815260408083208286015184526004018252808320818601518452909152902082518391908190612d89908261525e565b506020828101516001830155604080840151600284015560608085015160038501556080850151600485015560a0850151600585015560c0850151600685015560e085015160078501556101008086015160088601556101208601516009860155610140860151600a860155610160860151600b860155610180860151600c8601556101a0860151600d8601556101c0860151600e8601556101e0860151600f860155610200860151601090950180546102208801516102408901516102608a0151610280909a015115156401000000000264ff00000000199a151563010000000263ff0000001992151562010000029290921663ffff00001993151590960261ff00199a15159a909a1661ffff19909416939093179890981716929092179590951795909516949094179092558482015185820151835186815292830191909152918101919091527fe3fb5dd959a469b4fc3e2825b1b4c046d0c15f97b2a01d7a77344a6d52f7ae3091016124f1565b6060600a82604051612f0c91906151d7565b90815260408051918290036020908101832080548083028501830190935282845291908301828280156114c357602002820191906000526020600020908154815260200190600101908083116114af5750505050509050919050565b6000828152600960205260409020606090612f84600184615174565b81548110612f9457612f94615187565b60009182526020918290206003600d9092020101805460408051828502810185019091528181529283018282801561220357602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311612fd7575050505050905092915050565b6000818152600960209081526040918290206003018054835181840281018401909452808452606093928301828280156114c3576020028201919060005260206000209081546001600160a01b031681526001909101906020018083116122fb5750505050509050919050565b6000848152600960205260408120613087600186615174565b8154811061309757613097615187565b60009182526020808320958352600d9190910290940160070184526040808220938252929093525090206006015492915050565b6002546001600160a01b031633146130f6576040516303777f6960e51b815260040160405180910390fd5b60008181526009602081905260409182902001805460ff60a01b1916600160a01b9081179182905591517f69ece81755488aa3937ce59552d302d53cf2f9e4740f8617bf7b2d6c91643cdc926115e692859291900460ff1690615408565b6000818152600960205260409020600801805460609190611b609061519d565b6000828152600960205260409020606090613190600184615174565b815481106131a0576131a0615187565b60009182526020918290206004600d9092020101805460408051828502810185019091528181529283018282801561220357602002820191906000526020600020905b8154815260200190600101908083116131e3575050505050905092915050565b600082815260096020526040902060609061321f600184615174565b8154811061322f5761322f615187565b60009182526020918290206002600d90920201018054604080518285028101850190915281815292830182828015612203576020028201919060005260206000209081546001600160a01b03168152600190910190602001808311612fd7575050505050905092915050565b60008481526009602052604081206132b4600186615174565b815481106132c4576132c4615187565b60009182526020808320958352600d9190910290940160070184526040808220938252929093525090206009015492915050565b6000818152600960209081526040808320600201805482518185028101850190935280835260609492939192909184015b82821015611b295760008481526020908190208301805460408051828502810185019091528181529283018282801561338157602002820191906000526020600020905b81548152602001906001019080831161336d575b505050505081526020019060010190613329565b60008281526009602052604090206060906133b1600184615174565b815481106133c1576133c1615187565b90600052602060002090600d0201600801805480602002602001604051908101604052809291908181526020016000905b828210156126505783829060005260206000200180546134119061519d565b80601f016020809104026020016040519081016040528092919081815260200182805461343d9061519d565b801561348a5780601f1061345f5761010080835404028352916020019161348a565b820191906000526020600020905b81548152906001019060200180831161346d57829003601f168201915b5050505050815260200190600101906133f2565b6000600b826040516134b091906151d7565b9081526020016040518091039020600201549050919050565b60008481526009602052604081206134e2600186615174565b815481106134f2576134f2615187565b60009182526020808320958352600d919091029094016007018452604080822093825292909352509020600a015492915050565b60005460405162a08cef60e31b81523360048201526001600160a01b0390911690630504677890602401602060405180830381865afa15801561356d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061359191906151f3565b6135ae5760405163e6c4247b60e01b815260040160405180910390fd5b600080546001600160a01b0319166001600160a01b0392909216919091179055565b6005546001600160a01b031633146135fb576040516303777f6960e51b815260040160405180910390fd5b6000818152600860209081526040808320858452909152812054613620906001615425565b600083815260086020908152604080832087845282529182902083905581518681529081018590529081018290529091507fd4dbda378623f00b72ef135b4579b7ba064c49645217eb107d663831efac63589060600160405180910390a16000838152600960205260409020600d015481036136f257600082815260086020908152604080832060020180546001810182559084529282902090920185905581518581529081018490527f77ea6debc663dad7a8e05dda9320c0ed1027cb92c4ba923c3888885c301577099101612135565b505050565b6000828152600960205260408120613710600184615174565b8154811061372057613720615187565b90600052602060002090600d0201600b0154905092915050565b6000818152600c60209081526040808320858452909152902080546060919061218a9061519d565b600084815260096020526040812061377b600186615174565b8154811061378b5761378b615187565b60009182526020808320958352600d91909102909401600701845260408082209382529290935250902060120154610100900460ff1692915050565b60005b835181101561399657825460018181018555600085815260209020600d909202909101906137f9908390615425565b600a820155845185908390811061381257613812615187565b6020908102919091018101515180518051919284926138349284920190613e5e565b50602082810151805161384d9260018501920190613ebb565b5060408201518051613869916002840191602090910190613f14565b5060608201518051613885916003840191602090910190613f14565b50608082015180516138a1916004840191602090910190613f75565b5060a091909101516005909101805460ff191691151591909117905584518590839081106138d1576138d1615187565b6020026020010151604001515181600b01819055508482815181106138f8576138f8615187565b6020026020010151602001515181600c018190555084828151811061391f5761391f615187565b60200260200101516060015181600901908161393b919061525e565b5061395f8186848151811061395257613952615187565b602002602001015161399c565b6139838186848151811061397557613975615187565b602002602001015185613a6e565b508061398e8161531d565b9150506137ca565b50505050565b60005b8160200151518110156136f2576000826020015182815181106139c4576139c4615187565b6020908102919091018101516006860180546001818101835560009283529390912082516004909202018054929450929091839160ff19909116908381811115613a1057613a1061427a565b021790555060208201516001820190613a29908261525e565b5060408201516002820180546001600160a01b0319166001600160a01b0390921691909117905560609091015160039091015580613a668161531d565b91505061399f565b60008260400151516001600160401b03811115613a8d57613a8d6142c1565b604051908082528060200260200182016040528015613ac057816020015b6060815260200190600190039081613aab5790505b50905060005b836040015151811015613d8957600084604001518281518110613aeb57613aeb615187565b60209081029190910181015160608101516000908152600789018352604080822060808401518352845290208151805192945084939192613b2f9284920190613f75565b5060208201516001820190613b44908261525e565b5060408201516002820190613b59908261525e565b50606082015160038201556080820151600482015560a0820151600582015560c0820151600682015560e082015160078201556101008083015160088301556101208301516009830155610140830151600a80840191909155610160840151600b840155610180840151600c8401556101a0840151600d8401556101c0840151600e8401556101e0840151600f84015561020084015160108401556102208401516011840155610240840151601290930180546102608601516102808701516102a08801516102c09098015115156401000000000264ff000000001998151563010000000263ff0000001992151562010000029290921663ffff00001993151590970261ff00199815159890981661ffff199094169390931796909617169390931793909317939093161790556020820151604051613c9891906151d7565b90815260408051918290036020908101832080546001810182556000918252908290200187905560608084018352848301518452840151838201526080840151838301528301519051600b91613ced916151d7565b90815260405190819003602001902081518190613d0a908261525e565b5060208281015160018301556040928301516002909201919091558281015160608401516000908152600c83528381206080860151825290925291902090613d52908261525e565b508060400151838381518110613d6a57613d6a615187565b6020026020010181905250508080613d819061531d565b915050613ac6565b508051613d9f9060088601906020840190613fb0565b5050505050565b50805460008255600d0290600052602060002090810190613dc79190614002565b50565b5080546000825590600052602060002090810190613dc791906140a4565b5080546000825590600052602060002090810190613dc791906140c1565b5080546000825590600052602060002090810190613dc791906140de565b508054613e309061519d565b6000825580601f10613e40575050565b601f016020900490600052602060002090810190613dc791906140de565b828054828255906000526020600020908101928215613eab579160200282015b82811115613eab5782518051613e9b918491602090910190613fb0565b5091602001919060010190613e7e565b50613eb79291506140a4565b5090565b828054828255906000526020600020908101928215613f08579160200282015b82811115613f085782518051613ef8918491602090910190613f75565b5091602001919060010190613edb565b50613eb79291506140c1565b828054828255906000526020600020908101928215613f69579160200282015b82811115613f6957825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190613f34565b50613eb79291506140de565b828054828255906000526020600020908101928215613f69579160200282015b82811115613f69578251825591602001919060010190613f95565b828054828255906000526020600020908101928215613ff6579160200282015b82811115613ff65782518290613fe6908261525e565b5091602001919060010190613fd0565b50613eb79291506140f3565b80821115613eb757600081816140188282613dca565b614026600183016000613de8565b614034600283016000613e06565b614042600383016000613e06565b614050600483016000613e06565b50600501805460ff1916905561406a600683016000614110565b614078600883016000614131565b614086600983016000613e24565b506000600a8201819055600b8201819055600c820155600d01614002565b80821115613eb75760006140b88282614131565b506001016140a4565b80821115613eb75760006140d58282613e06565b506001016140c1565b5b80821115613eb757600081556001016140df565b80821115613eb75760006141078282613e24565b506001016140f3565b5080546000825560040290600052602060002090810190613dc7919061414f565b5080546000825590600052602060002090810190613dc791906140f3565b80821115613eb757805460ff19168155600061416e6001830182613e24565b506002810180546001600160a01b03191690556000600382015560040161414f565b600080604083850312156141a357600080fd5b50508035926020909101359150565b600080600080608085870312156141c857600080fd5b5050823594602084013594506040840135936060013592509050565b60005b838110156141ff5781810151838201526020016141e7565b50506000910152565b600081518084526142208160208601602086016141e4565b601f01601f19169290920160200192915050565b6020815260006142476020830184614208565b9392505050565b60008060006060848603121561426357600080fd5b505081359360208301359350604090920135919050565b634e487b7160e01b600052602160045260246000fd5b60028110613dc757634e487b7160e01b600052602160045260246000fd5b602081016142bb83614290565b91905290565b634e487b7160e01b600052604160045260246000fd5b60405160c081016001600160401b03811182821017156142f9576142f96142c1565b60405290565b604051608081016001600160401b03811182821017156142f9576142f96142c1565b6040516102e081016001600160401b03811182821017156142f9576142f96142c1565b60405160a081016001600160401b03811182821017156142f9576142f96142c1565b60405160e081016001600160401b03811182821017156142f9576142f96142c1565b6040516102a081016001600160401b03811182821017156142f9576142f96142c1565b604051601f8201601f191681016001600160401b03811182821017156143d3576143d36142c1565b604052919050565b600082601f8301126143ec57600080fd5b81356001600160401b03811115614405576144056142c1565b614418601f8201601f19166020016143ab565b81815284602083860101111561442d57600080fd5b816020850160208301376000918101602001919091529392505050565b60006020828403121561445c57600080fd5b81356001600160401b0381111561447257600080fd5b61447e848285016143db565b949350505050565b60006020828403121561449857600080fd5b5035919050565b6020808252825182820181905260009190848201906040850190845b818110156144d7578351835292840192918401916001016144bb565b50909695505050505050565b80356001600160a01b03811681146144fa57600080fd5b919050565b60006020828403121561451157600080fd5b614247826144e3565b600081518084526020808501808196508360051b8101915082860160005b85811015614562578284038952614550848351614208565b98850198935090840190600101614538565b5091979650505050505050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b828110156145c457603f198886030184526145b285835161451a565b94509285019290850190600101614596565b5092979650505050505050565b8015158114613dc757600080fd5b80356144fa816145d1565b6000806000806080858703121561460057600080fd5b8435935060208501359250604085013591506060850135614620816145d1565b939692955090935050565b6000806040838503121561463e57600080fd5b614647836144e3565b9150614655602084016144e3565b90509250929050565b602081526000614247602083018461451a565b60008060006060848603121561468657600080fd5b61468f846144e3565b95602085013595506040909401359392505050565b6020808252825182820181905260009190848201906040850190845b818110156144d75783516001600160a01b0316835292840192918401916001016146c0565b60006001600160401b038211156146fe576146fe6142c1565b5060051b60200190565b600082601f83011261471957600080fd5b8135602061472e614729836146e5565b6143ab565b82815260059290921b8401810191818101908684111561474d57600080fd5b8286015b848110156147ff5780356001600160401b038082111561477057600080fd5b818901915089603f83011261478457600080fd5b85820135614794614729826146e5565b81815260059190911b830160400190878101908c8311156147b457600080fd5b604085015b838110156147ed578035858111156147d057600080fd5b6147df8f6040838a01016143db565b8452509189019189016147b9565b50875250505092840192508301614751565b509695505050505050565b600082601f83011261481b57600080fd5b8135602061482b614729836146e5565b82815260059290921b8401810191818101908684111561484a57600080fd5b8286015b848110156147ff578035835291830191830161484e565b600082601f83011261487657600080fd5b81356020614886614729836146e5565b82815260059290921b840181019181810190868411156148a557600080fd5b8286015b848110156147ff5780356001600160401b038111156148c85760008081fd5b6148d68986838b010161480a565b8452509183019183016148a9565b600082601f8301126148f557600080fd5b81356020614905614729836146e5565b82815260059290921b8401810191818101908684111561492457600080fd5b8286015b848110156147ff57614939816144e3565b8352918301918301614928565b600060c0828403121561495857600080fd5b6149606142d7565b905081356001600160401b038082111561497957600080fd5b61498585838601614708565b8352602084013591508082111561499b57600080fd5b6149a785838601614865565b602084015260408401359150808211156149c057600080fd5b6149cc858386016148e4565b604084015260608401359150808211156149e557600080fd5b6149f1858386016148e4565b60608401526080840135915080821115614a0a57600080fd5b50614a178482850161480a565b608083015250614a2960a083016145df565b60a082015292915050565b600082601f830112614a4557600080fd5b81356020614a55614729836146e5565b82815260059290921b84018101918181019086841115614a7457600080fd5b8286015b848110156147ff5780356001600160401b0380821115614a985760008081fd5b908801906080828b03601f1901811315614ab25760008081fd5b614aba6142ff565b8784013560028110614acc5760008081fd5b815260408481013584811115614ae25760008081fd5b614af08e8b838901016143db565b8a8401525060609350614b048486016144e3565b90820152920135908201528352918301918301614a78565b600082601f830112614b2d57600080fd5b81356020614b3d614729836146e5565b82815260059290921b84018101918181019086841115614b5c57600080fd5b8286015b848110156147ff5780356001600160401b0380821115614b805760008081fd5b908801906102e0828b03601f1901811315614b9b5760008081fd5b614ba3614321565b8784013583811115614bb55760008081fd5b614bc38d8a8388010161480a565b82525060408085013584811115614bda5760008081fd5b614be88e8b838901016143db565b8a8401525060608086013585811115614c015760008081fd5b614c0f8f8c838a01016143db565b8385015250608094508486013581840152505060a0808501358483015260c0935083850135818301525060e08085013584830152610100935083850135818301525061012080850135848301526101409350838501358183015250610160808501358483015261018093508385013581830152506101a080850135848301526101c093508385013581830152506101e08085013584830152610200935083850135818301525061022080850135848301526102409350838501358183015250610260614cdc8186016145df565b848301526102809350614cf08486016145df565b908201526102a0614d028582016145df565b848301526102c09350614d168486016145df565b90820152614d258483016145df565b9281019290925250845250918301918301614b60565b600082601f830112614d4c57600080fd5b81356020614d5c614729836146e5565b82815260059290921b84018101918181019086841115614d7b57600080fd5b8286015b848110156147ff5780356001600160401b0380821115614d9f5760008081fd5b9088019060a0828b03601f1901811315614db95760008081fd5b614dc1614344565b8784013583811115614dd35760008081fd5b614de18d8a83880101614946565b82525060408085013584811115614df85760008081fd5b614e068e8b83890101614a34565b8a8401525060608086013585811115614e1f5760008081fd5b614e2d8f8c838a0101614b1c565b8385015250608091508186013585811115614e485760008081fd5b614e568f8c838a01016143db565b9184019190915250919093013590830152508352918301918301614d7f565b600060208284031215614e8757600080fd5b81356001600160401b0380821115614e9e57600080fd5b9083019060e08286031215614eb257600080fd5b614eba614366565b82358152602083013582811115614ed057600080fd5b614edc87828601614946565b602083015250604083013582811115614ef457600080fd5b614f0087828601614d3b565b604083015250606083013582811115614f1857600080fd5b614f24878286016143db565b606083015250614f36608084016144e3565b608082015260a083013560a082015260c083013560c082015280935050505092915050565b6000602080830181845280855180835260408601915060408160051b87010192508387016000805b83811015614fd757888603603f19018552825180518088529088019088880190845b81811015614fc15783518352928a0192918a0191600101614fa5565b5090975050509386019391860191600101614f83565b509398975050505050505050565b60008060408385031215614ff857600080fd5b82356001600160401b038082111561500f57600080fd5b908401906102a0828703121561502457600080fd5b61502c614388565b82358281111561503b57600080fd5b615047888286016143db565b8252506020838101359082015260408084013590820152606080840135908201526080808401359082015260a0808401359082015260c0808401359082015260e08084013590820152610100808401359082015261012080840135908201526101408084013590820152610160808401359082015261018080840135908201526101a080840135908201526101c080840135908201526101e0808401359082015261020091506150f88284016145df565b82820152610220915061510c8284016145df565b8282015261024091506151208284016145df565b8282015261026091506151348284016145df565b8282015261028091506151488284016145df565b9181019190915295602094909401359450505050565b634e487b7160e01b600052601160045260246000fd5b818103818111156112225761122261515e565b634e487b7160e01b600052603260045260246000fd5b600181811c908216806151b157607f821691505b6020821081036151d157634e487b7160e01b600052602260045260246000fd5b50919050565b600082516151e98184602087016141e4565b9190910192915050565b60006020828403121561520557600080fd5b8151614247816145d1565b601f8211156136f257600081815260208120601f850160051c810160208610156152375750805b601f850160051c820191505b8181101561525657828155600101615243565b505050505050565b81516001600160401b03811115615277576152776142c1565b61528b81615285845461519d565b84615210565b602080601f8311600181146152c057600084156152a85750858301515b600019600386901b1c1916600185901b178555615256565b600085815260208120601f198616915b828110156152ef578886015182559484019460019091019084016152d0565b508582101561530d5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60006001820161532f5761532f61515e565b5060010190565b818103615341575050565b61534b825461519d565b6001600160401b03811115615362576153626142c1565b61537081615285845461519d565b6000601f8211600181146153a4576000831561538c5750848201545b600019600385901b1c1916600184901b178455613d9f565b600085815260209020601f19841690600086815260209020845b838110156153de57828601548255600195860195909101906020016153be565b508583101561530d5793015460001960f8600387901b161c19169092555050600190811b01905550565b8281526040810161541883614290565b8260208301529392505050565b808201808211156112225761122261515e56fea2646970667358221220f030deda900ae0f4ccd516e31b9f81def2353f779f976a19a76b5e061ab95f0b64736f6c63430008130033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.