ERC-721
Overview
Max Total Supply
1,111 RELICS
Holders
351
Market
Volume (24H)
N/A
Min Price (24H)
N/A
Max Price (24H)
N/A
Other Info
Token Contract
Balance
1 RELICSLoading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.
Contract Name:
TheReliquary
Compiler Version
v0.8.4+commit.c7e474f2
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: Unlicense /// @title: the reliquary /// @author: remnynt.eth /* _ _ _ _ | |_| |__ ___ _ __ ___| (_) __ _ _ _ __ _ _ __ _ _ | __| '_ \ / _ \ | '__/ _ \ | |/ _` | | | |/ _` | '__| | | | | |_| | | | __/ | | | __/ | | (_| | |_| | (_| | | | |_| | \__|_| |_|\___| |_| \___|_|_|\__, |\__,_|\__,_|_| \__, | |_| |___/ */ /* Seeker, Rumors abound ... proof of the divine? The "original" mystery? The way I see it, there was no spark; time has no beginning. We can try to find that early place, before everything; indeed, perhaps it's our duty. But that quest to find the first little thing that happened is an asymptote to the unknowable. As if something could flicker out of nothing, the first vibration in a void is just as likely the last of what came before, dancing on a mirror's edge. And yet, undaunted, we pull on those strings, yearning to unravel the mystery of our origin. Which thus far, brings us to the elements eight. Whether you worship those gods, practice the schools of magic, or pay no heed at all, the one shared truth is that these elements are the fundamental building blocks of our world. Learned arcanists believe each its own substrate of aether, a medium upon which pure elemental energy flows, and from the summation of those microscopic movements arise the physical laws as we know them. It's that knowledge that's gotten us this far. Of course, most scoff at the theorycraft, finding it easier to cling to the zealotry of this element's church or that. Nevertheless, all eyes are on this singular discovery: the reliquary. Ancient and nameless, lost in the shifting sands of the Bal'gurub, its existence will bring every explorer worth their salt for horizons around. If you can get inside, and claim one of its relics, study it; there's no doubt we'll be one step closer to uncovering the truth. Now, be warned, adventurer. We know not what dangers lie within, nor how to gain entry. Steel yourself, take what supplies you can carry, and elements, or gods, be with you. Ahn Pendrose Guild's Knight of the Seekers */ pragma solidity ^0.8.4; import "@0xsequence/sstore2/contracts/SSTORE2.sol"; import '@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol'; import '@openzeppelin/contracts/security/ReentrancyGuard.sol'; import '@openzeppelin/contracts/utils/Strings.sol'; import './ERC721ATM.sol'; import './TRMeta.sol'; /// @notice There are reports, first sourced from a nomadic shepherd, that indicate an enigmatic /// structure has been partially revealed by the sands' ebb and flow. It's located a few /// horizons beyond the southern edge of the Emptiness, that most unforgiving and desolate /// corner of the desert. He was foolish enough to chase a runaway from his flock that far, /// let alone to tell the tale. Unsurprisingly, he's since "gone missing." Droves of /// treasure hunters have already begun to descend upon the nearest village. They're /// calling it, "the reliquary." contract TheReliquary is ERC721ATM('the reliquary', 'RELICS'), ERC721Holder, ReentrancyGuard { using Strings for uint256; struct Reliquary { uint8 curiosDiscovered; uint8 secretsDiscovered; bool isDiscovered; string runicSeal; string hiddenLeyLines; } struct Relic { uint8 level; uint32 mana; bool isDivinityQuestLoot; bool isSecretDiscovered; address authorizedCreator; address glyph; string transmutation; uint24[] colors; bytes32 runeHash; } struct Adventurer { uint256 currentChamber; uint256 aether; } Reliquary private reliquary; /// @notice A collection of curious items sealed for millennia within the reliquary. /// By whom and for what purpose are yet to be determined. mapping(uint256 => Relic) public relics; /// @notice A record of the brave souls who've attempted entry into the reliquary. /// Those able to channel aether from vibes have been noted. mapping(address => Adventurer) public adventurers; /// @notice Vibes? Oh yes, our shorthand for vibrational energy; a crafty artificer /// managed to capture it, pure elemental aether, into these vessels we call "vibes." /// There may yet be some available; their aether identifier is: /// 0x6c7C97CaFf156473F6C9836522AE6e1d6448Abe7 mapping(uint256 => bool) public vibesAetherChanneled; event RelicUpdate(uint256 tokenId); error ReliquaryNotDiscovered(); error DivinityQuestProgressionMismatch(); error NotEntrustedOrInYourPossession(); error NotApprovedCreatorOrOwner(); error GrailsAreUnalterable(); error NoAdvancedSpellcastingContracts(); error InvalidTokenId(); error InvalidElement(); error UnableToCarrySoManyAtOnce(); error OutOfRelics(); error MissingInscription(); error ReliquaryAlreadySealed(); error IncorrectWhispers(); error IncorrectElementalWeakness(); error IncorrectInnerDemonElement(); error OutOfCurios(); error NotEnoughAether(); error NoSecretsLeftToReveal(); error RelicAlreadyWellStudied(); error NotEnoughMana(); error NoAetherRemainingUseMintInstead(); error OnlyBurnsVibes(); error InvalidCustomization(); error RelicAlreadyAtMaxLevel(); constructor() { // The aetheric toll is reduced for the bravest of adventurers. reliquary.curiosDiscovered = 1; reliquary.secretsDiscovered = 1; } receive() external payable {} fallback() external payable {} modifier prohibitTimeTravel() { // Will happen, happening, happened. Millennia can pass in an instant, as long as // each little thing happens in the right order and everything in its right place. if (!reliquary.isDiscovered) revert ReliquaryNotDiscovered(); _; } modifier prohibitTeleportation(uint256 requiredChamber) { // You know not where you stand. Follow the steps of the Divinity Quest, and you shall // find that which you seek; that is unless those other treasure hunters got there first. uint256 currentChamber = adventurers[_msgSender()].currentChamber; if (currentChamber != requiredChamber) revert DivinityQuestProgressionMismatch(); _; } modifier preventDeadEnds() { // The coffers of Divinity's End have nought left but motes of dust. // You may yet find other relics if you explore the less precarious parts of the reliquary. if (reliquary.curiosDiscovered > TRKeys.CURIO_SUPPLY) revert OutOfCurios(); _; } modifier prohibitThievery(uint256 tokenId) { // You are not the rightful owner, but don't be discouraged. Everything has a price ... if (!isApprovedOrOwnerOf(tokenId)) revert NotEntrustedOrInYourPossession(); _; } modifier prohibitVandalism(uint256 tokenId) { // You are not the rightful owner or authorized creator. Do ask permission, first! if (!isApprovedOrOwnerOf(tokenId) && _msgSender() != relics[tokenId].authorizedCreator && _msgSender() != TRKeys.VIBES_GENESIS && _msgSender() != TRKeys.VIBES_OPEN) { revert NotApprovedCreatorOrOwner(); } _; } modifier prohibitDesecration(uint256 tokenId) { // A relentlessly curious collector once hired a master smith to deconstruct a grail. The pair // were lucky to survive; they were found perforated by metal shrapnel and knocked unconscious // by the otherworldly reverberations that erupted from the first strike of his hammer. if (getGrailId(tokenId) != TRKeys.GRAIL_ID_NONE) revert GrailsAreUnalterable(); _; } modifier prohibitAdvancedSpellcasting() { // Advanced spellcasting is prohibited. There's no doubt with this level of expertise, // you'd fell a dragon with your last enchanted arrow in the midst of a blizzard atop the // tallest mountain, but do save your energy for such an occasion! if (tx.origin != _msgSender()) revert NoAdvancedSpellcastingContracts(); _; } modifier prohibitBlasphemy(uint256 tokenId) { // No such relic exists! One cannot simply speak a thing into existence through sheer force // of will. I suppose you'd also like to print paper money from a steam-powered press? if (tokenId < 1 || tokenId > super.totalSupply()) revert InvalidTokenId(); _; } modifier requireValidElement(string memory element) { // Do respect the eight elements; call them by their proper names. // When writing, be sure to capitalize the first letter to distinguish the element from // a more common manifestation, for example, the ocean's salty water is of the Water element. if (TRUtils.compare(element, TRKeys.ELEM_NATURE) || TRUtils.compare(element, TRKeys.ELEM_LIGHT) || TRUtils.compare(element, TRKeys.ELEM_WATER) || TRUtils.compare(element, TRKeys.ELEM_EARTH) || TRUtils.compare(element, TRKeys.ELEM_WIND) || TRUtils.compare(element, TRKeys.ELEM_ARCANE) || TRUtils.compare(element, TRKeys.ELEM_SHADOW) || TRUtils.compare(element, TRKeys.ELEM_FIRE)) { // A valid element, indeed! } else { // No such element exists! revert InvalidElement(); } _; } modifier enforceInventoryLimits(uint256 mintCount) { // Don't expect to escape the reliquary with more than you can carry. if (mintCount > TRKeys.INVENTORY_CAPACITY) revert UnableToCarrySoManyAtOnce(); _; } modifier enforceAbsoluteScarcity(uint256 mintCount) { // This old place is empty now. If you must lay hands on a relic yourself, you may be able to // convince a fellow adventurer to part with theirs... uint256 currentRelics = totalSupply() + 1 - reliquary.curiosDiscovered; if (currentRelics + mintCount > TRKeys.RELIC_SUPPLY) revert OutOfRelics(); _; } /// @notice Divinity Quest - Step 0: When is now? /// @dev The past stretches out behind us, like the horizon, always out of reach. /// Done or undone, it matters not. Continue onward with what you've got. /// A lone sage walks his fated path. The scripts, his guide. The gods, his wrath. /// @param inscription With this sacred runeword, the Ancient Reliquary is sealed. function inscribeRunicSeal(string memory inscription) public onlyOwner { // That is not a runic seal; the sage falters, but mustn't lose hope. if (bytes(inscription).length == 0) revert MissingInscription(); // The Ancient Reliquary was sealed long ago. if (bytes(reliquary.runicSeal).length != 0) revert ReliquaryAlreadySealed(); // The sage met with destiny. // The truth, safe within, would soon outlast those who sought to destroy it. reliquary.runicSeal = inscription; // And so, it came to pass. Centuries, millennia, the world ever changing... // Until finally today, having laid dormant, concealed, for so long, it is found once again. reliquary.isDiscovered = true; } /// @notice Divinity Quest - Step 1: Enter the Ancient Reliquary /// @dev The entrance was sealed with a powerful runeword long ago. /// The spell used here has the markings of a forgotten order. /// All that remains is a name: "The Guardians of Origin." /// @param whispering There must be a way inside. What if we could find the inscription, /// or at least remnants of it? Scan the surrounding aether... function whisperRunicSeal(string memory whispering) public preventDeadEnds prohibitTimeTravel prohibitTeleportation(TRKeys.RELIQUARY_CHAMBER_OUTSIDE) { // Your whispering is lost in the rasps of the desert wind. if (!TRUtils.compare(whispering, reliquary.runicSeal)) revert IncorrectWhispers(); // Your syllables ignite in blue flames against the solid rock slab that blocks the entrance. // As it rumbles open before you, the glow of elden magic reveals a stone passage. // You step inside, determined to discover the truth. The Guardian's Hall awaits. adventurers[_msgSender()].currentChamber = TRKeys.RELIQUARY_CHAMBER_GUARDIANS_HALL; } /// @notice Divinity Quest - Step 2: Access the Inner Sanctum /// @dev The Guardian's Hall extends in both directions, like a ring wrapped 'round the reliquary. /// An army of Elemental Guardians marches endlessly within the massive circular corridor. /// Beyond them, lies the Inner Sanctum, and the only way through is by force. /// @param attackElement Breaking this line won't be easy; we need to land a spell at just the /// right moment, coinciding with the elemental weakness of the guardian /// before us. I'd estimate a 1 in 8 chance of success. Good luck! function challengeElementalGuardians(string memory attackElement) public preventDeadEnds prohibitTeleportation(TRKeys.RELIQUARY_CHAMBER_GUARDIANS_HALL) { // You seize the moment, attacking the elemental directly in front of you. string memory previousHash = uint256(blockhash(block.number - 1)).toHexString(); string memory guardianElement = detectElementals(previousHash); string memory weaknessElement = detectElementalWeakness(guardianElement); // It's not very effective! Rattled, but unscathed, you resolve to try again. if (!TRUtils.compare(weaknessElement, attackElement)) revert IncorrectElementalWeakness(); // It's super effective! The elemental groans as it implodes spectacularly! // The opening is just enough. You sprint across the hall, and down a well-worn stair. // At the bottom, the Inner Sanctum beckons in ominous silence. adventurers[_msgSender()].currentChamber = TRKeys.RELIQUARY_CHAMBER_INNER_SANCTUM; } /// @notice Divinity Quest - Step 3: Defeat your Inner Demon /// @dev Every man has within him a darkness, the raw echoes of primordial chaos. /// Soulbound, these demons can never be truly purged, but perhaps, with tremendous /// self-awareness and strength of will, they can be controlled. The Inner Sanctum /// is a space designed for that very purpose. A shrine for meditation sits calmly /// in the chamber's center, across from the gilded gates that lead to Divinity's End. /// @param innerDemonElement Kneel before the shrine. Your first goal is to identify the type /// of demon buried within the depths of your heart. /// @param attackElement Once identified, you must also discover, and make use of, its weakness. function challengeInnerDemon(string memory innerDemonElement, string memory attackElement) public preventDeadEnds prohibitTeleportation(TRKeys.RELIQUARY_CHAMBER_INNER_SANCTUM) { // Bowing your head and closing your eyes, you fill your lungs with the stale air. string memory walletElement = detectDemons(_msgSender()); // You fail to understand that which holds you back. You must keep searching. if (!TRUtils.compare(walletElement, innerDemonElement)) revert IncorrectInnerDemonElement(); // A cursed demon emerges, tethered from somewhere deep within your soul. string memory weaknessElement = detectElementalWeakness(walletElement); // Tendrils of magic coalesce between its claws, as your attempt to counter has no effect. // It launches a powerful bolt, striking you directly in the chest. // A searing pain grips your heart, and suddenly, nothing. Darkness. // Hours pass, or days? You awaken, alone, but alive. Was it ... just a dream? if (!TRUtils.compare(weaknessElement, attackElement)) revert IncorrectElementalWeakness(); // The demon releases a condensed spell blast! With a swift wave of your hand, // streaking magic from your fingertips, you crush the enemy's bolt in the palm of your hand. // The shockwave from the elemental annihilation, rips the air from the room, and the demon, // from its corporeal manifestation. A gleaming aura ahead reveals the path to Divinity's End. adventurers[_msgSender()].currentChamber = TRKeys.RELIQUARY_CHAMBER_DIVINITYS_END; } /// @notice Divinity Quest - Step 4: Claim a Divine Curio /// @dev As you enter the most sacred place within the reliquary, your feet grow heavy, your /// senses captivated by its grandeur. Like the interior of a palace most grand, all is /// engulfed in shimmering warm light, emanating from enchanted magical cores, ensconced /// within orbs of pure gold filigree, a celebration of ancient craftsmanship in worship /// of the divine. At last, you've arrived. A tithe of aether, mana channeled from your /// very being, is required. A threshold of at least 0.08 will suffice. function mintDivineCurio() public payable nonReentrant preventDeadEnds prohibitAdvancedSpellcasting prohibitTeleportation(TRKeys.RELIQUARY_CHAMBER_DIVINITYS_END) { // A worthy tithe of aether is required to claim a divine curio. if (msg.value < TRKeys.CURIO_TITHE) revert NotEnoughAether(); // Your tithe accepted, a roughly hewn pedestal begins to rise against the far wall. // Divine light fills the room, illuminating golden adornments resting beneath lifetimes // of dust. It's almost too bright to see; a curious relic lay before you atop the pedestal. // As you take it into your hands, magic courses across its surface, responding to your touch. // An ancient device of sorts? A thought sparks, as if not your own: learn, create, feel ... adventurers[_msgSender()].currentChamber = TRKeys.RELIQUARY_CHAMBER_CHAMPIONS_VAULT; _mintDivineCurio(); } /// @notice Spell of Divination: Secrets /// @dev Use this spell whilst studying a relic in your possession. With any luck, you may /// discover its secrets. At the very least, it's a great way to store up mana for use /// on your future travels. /// @param tokenId The relic you seek to study; of course, it must also be in your possession. function seekDivineKnowledge(uint256 tokenId) public prohibitThievery(tokenId) { // The Queen's Grails, and the ley lines connecting them, have all been discovered. if (reliquary.secretsDiscovered > TRKeys.SECRETS_OF_THE_GRAIL) revert NoSecretsLeftToReveal(); // This relic has already been thoroughly studied. if (relics[tokenId].isSecretDiscovered) revert RelicAlreadyWellStudied(); // Your fervent studies bear fruit, another secret uncovered. Filled with excitement, // you feel primal mana coursing from within; your relic glows as if charged with new power. relics[tokenId].isSecretDiscovered = true; relics[tokenId].mana += TRKeys.MANA_FROM_DIVINATION; reliquary.secretsDiscovered++; if (reliquary.secretsDiscovered > TRKeys.SECRETS_OF_THE_GRAIL) { // A revelation! You've discovered hidden ley lines that run beneath the reliquary. // They seem to connect to certain relics ... but what does it mean? reliquary.hiddenLeyLines = getRuneHash(tokenId); } } /// @notice Spell of Divination: Elementals /// @dev Use this spell to detect a nearby elemental and to identify its intrinsic element. /// @param previousHash A unique identifier representing your four-dimensional location in the /// space-time continuum. With it being nigh impossible to calculate a hash /// of your current position, it's best to rely on one previous. function detectElementals(string memory previousHash) public view returns (string memory) { TRKeys.RuneCore memory core; core.tokenId = TRKeys.ELEMENTAL_GUARDIAN_DNA; core.runeHash = previousHash; core.metadataAddress = getMetadataAddress(core.tokenId); return ITRMeta(core.metadataAddress).getElement(core); } /// @notice Spell of Divination: Demons /// @dev Use this spell on any uncorrupted creature to identify potential demons lurking within. /// @param id The unique identifier of the creature to analyze. Most bipedal humanoids keep a /// copy in their wallet. function detectDemons(address id) public view returns (string memory) { TRKeys.RuneCore memory core; core.tokenId = TRKeys.ELEMENTAL_GUARDIAN_DNA; core.runeHash = uint256(uint160(id)).toHexString(); core.metadataAddress = getMetadataAddress(core.tokenId); return ITRMeta(core.metadataAddress).getElement(core); } /// @notice Spell of Divination: Weaknesses /// @dev Use this spell whilst focusing your mind on any element. Upon casting, that element's /// weakness will become known to you. /// @param element The element about which you seek knowledge. function detectElementalWeakness(string memory element) public pure returns (string memory) { if (TRUtils.compare(element, TRKeys.ELEM_NATURE)) { return TRKeys.ELEM_FIRE; } else if (TRUtils.compare(element, TRKeys.ELEM_FIRE)) { return TRKeys.ELEM_WATER; } else if (TRUtils.compare(element, TRKeys.ELEM_WATER)) { return TRKeys.ELEM_WIND; } else if (TRUtils.compare(element, TRKeys.ELEM_WIND)) { return TRKeys.ELEM_EARTH; } else if (TRUtils.compare(element, TRKeys.ELEM_EARTH)) { return TRKeys.ELEM_NATURE; } else if (TRUtils.compare(element, TRKeys.ELEM_ARCANE)) { return TRKeys.ELEM_SHADOW; } else if (TRUtils.compare(element, TRKeys.ELEM_SHADOW)) { return TRKeys.ELEM_LIGHT; } else { return TRKeys.ELEM_ARCANE; } } /// @notice Spell of Transmutation: Elements (USE WITH CAUTION) /// @dev This powerful spell can permanently transmute the element of a relic to any other, /// but be warned! It consumes a vibe in the process; the vibe will be irreversibly /// lost to the aether, where it can never be owned or used again. /// @param tokenId The relic which you seek to transmute. /// @param element The new element to which your relic will belong. /// @param burnVibeId The catalyst to be burned: a [genesis] or [open] vibe. /// This vibe will be burned, you will no longer own it, nor can anyone else. function transmuteElement(uint256 tokenId, string memory element, uint256 burnVibeId) public { _lockVibeForever(burnVibeId, tokenId); _transmuteElement(tokenId, element); emit RelicUpdate(tokenId); } function _transmuteElement(uint256 tokenId, string memory element) private prohibitVandalism(tokenId) prohibitDesecration(tokenId) requireValidElement(element) { relics[tokenId].transmutation = element; } /// @notice Spell of Creation: Glyphs (USE WITH CAUTION) /// @dev This powerful spell can permanently inscribe a glyph of your own design upon your relic, /// but be warned! It consumes a vibe in the process; the vibe will be irreversibly /// lost to the aether, where it can never be owned or used again. /// @param tokenId The relic which you seek to alter. /// @param glyph The data that defines the shape and characteristics of your design. /// It's an array, length 64, of integers. Each integer represents a row /// of points that make up your glyph. The 64 least-significant digits represent /// each column within that row, 0 being no change, and 9 being max change. /// @param burnVibeId The catalyst to be burned: a [genesis] or [open] vibe. /// This vibe will be burned, you will no longer own it, nor can anyone else. function createGlyph(uint256 tokenId, uint256[] memory glyph, uint256 burnVibeId) public { _lockVibeForever(burnVibeId, tokenId); _createGlyph(tokenId, glyph, _msgSender()); emit RelicUpdate(tokenId); } function _createGlyph(uint256 tokenId, uint256[] memory glyph, address credit) private prohibitVandalism(tokenId) prohibitDesecration(tokenId) { relics[tokenId].glyph = SSTORE2.write(abi.encode(credit, glyph)); } /// @notice Spell of Imagination: Colors (USE WITH CAUTION) /// @dev This powerful spell can permanently infuse your relic with colors of your choosing, /// but be warned! It consumes a vibe in the process; the vibe will be irreversibly /// lost to the aether, where it can never be owned or used again. /// @param tokenId The relic which you seek to reimagine. /// @param colors The data that defines the color palette to use. /// It's an array, length 6, of integers. Each integer represents a color, /// between 0 (black) and 16777215 (white). Any colors added beyond the /// color count of your relic will be ignored. Colors should be listed in /// order of strength; the first is the primary color, at index 0. /// @param burnVibeId The catalyst to be burned: a [genesis] or [open] vibe. /// This vibe will be burned, you will no longer own it, nor can anyone else. function imagineColors(uint256 tokenId, uint24[] memory colors, uint256 burnVibeId) public { _lockVibeForever(burnVibeId, tokenId); _imagineColors(tokenId, colors); emit RelicUpdate(tokenId); } function _imagineColors(uint256 tokenId, uint24[] memory colors) private prohibitVandalism(tokenId) prohibitDesecration(tokenId) { relics[tokenId].colors = colors; } /// @notice Spell of Creation: Camaraderie /// @dev Use this spell to grant certain privileges to a trusted friend. The authorized friend /// will be considered a creator who can use transmuteElement, createGlyph, and /// imagineColors. At the time of spellcasting, the catalysts to be used must be held by the /// creator. /// @param tokenId The relic which can be modified by the creator. /// @param creator The address belonging to the creator to be granted privileges. Pass address(0) /// to revoke any so granted privileges. function authorizeCreator(uint256 tokenId, address creator) public prohibitThievery(tokenId) { relics[tokenId].authorizedCreator = creator; } /// @notice Spell of Enhancement: Relic Level /// @dev Use this spell to break limiters installed in the runic circuits of your relic. Doing /// so will increase its mana regeneration, but may also change its visual appearance. Any /// underlying corruption may be exposed. It's not a certainty, but it is possible that /// our knowledge of these relics' inner-workings may advance over time, unlocking higher /// potential levels. /// @param tokenId The relic which you seek to upgrade. It must contain enough mana to sustain /// the upgrade; that mana will be consumed in the process. function upgradeRelic(uint256 tokenId) public prohibitThievery(tokenId) { address metadataAddress = getMetadataAddress(tokenId); uint8 maxLevel = ITRMeta(metadataAddress).getMaxRelicLevel(); uint8 level = getLevel(tokenId); // This relic is at its pinnacle. Mayhap, one day, we will discover what it means to take it // one step further. Until then, congratulations on this triumph over ancient technology. if (level >= maxLevel) revert RelicAlreadyAtMaxLevel(); consumeMana(tokenId, TRKeys.MANA_COST_TO_UPGRADE); relics[tokenId].level = ++relics[tokenId].level; emit RelicUpdate(tokenId); } /// @notice Spell of Divination: Relic Level /// @dev Use this spell to measure the upgrade level of a given relic. /// @param tokenId The relic to be sized up. function getLevel(uint256 tokenId) public view returns (uint8) { return relics[tokenId].level + 1; } /// @notice Spell of Divination: Mana /// @dev Use this spell to measure the supply of mana stored within a given relic. /// Be warned, adventurer! Transferring possession of relics as delicate as these will /// reduce any stored mana by half. /// @param tokenId The relic to be measured. function getMana(uint256 tokenId) public view returns (uint32) { uint256 startTimestamp = _ownerships[tokenId].startTimestamp; if (startTimestamp == 0) { return relics[tokenId].mana; } uint8 level = getLevel(tokenId); uint32 manaPerYear = level < 2 ? TRKeys.MANA_PER_YEAR : TRKeys.MANA_PER_YEAR_LV2; uint256 elapsed = block.timestamp - startTimestamp; uint32 accumulatedMana = uint32((elapsed * manaPerYear) / TRKeys.SECONDS_PER_YEAR); return relics[tokenId].mana + accumulatedMana; } /// @notice Consume Resource: Mana (USE WITH CAUTION) /// @dev Our world is one of infinite possibilities. Using this spell alone is not advised, /// but were it to be channeled into another spell, or magical contract, in the creation of, /// or as a requirement for, some fantastic purpose, that would indeed be worthwhile. /// By what means or from whom such purposes arise is uncertain, but the imaginations of /// those practiced in magic are as boundless as the sea of stars afloat in the night sky. /// @param tokenId The relic which will have an amount of its mana consumed. /// @param manaCost The amount of mana required and consumed by the accompanying spellcast. function consumeMana(uint256 tokenId, uint32 manaCost) public prohibitThievery(tokenId) { uint32 mana = getMana(tokenId); // The cost requirements of mana are absolute; such is the nature of measuring pure energy. if (mana < manaCost) revert NotEnoughMana(); relics[tokenId].mana = mana - manaCost; _ownerships[tokenId].startTimestamp = uint64(block.timestamp); } /// @notice Spell of Divination: Relic Traits - Element /// @dev Identifies the element trait of a given relic. /// The universe, as we know it, is the result of elemental vibrations /// within the aether, on a microscopic scale. /// @param tokenId The relic to be tested. function getElement(uint256 tokenId) public view returns (string memory) { TRKeys.RuneCore memory core = getRuneCore(tokenId); return ITRMeta(core.metadataAddress).getElement(core); } /// @notice Spell of Divination: Relic Traits - Color Count /// @dev Identifies the colors trait of a given relic. /// On the surface, this is the number of colors within a relic's palette. Going deeper, /// each color is a sort of elemental nucleus within the relic's structure, exerting /// vibrational gravity throughout. /// @param tokenId The relic to be studied. function getColorCount(uint256 tokenId) public view returns (uint256) { TRKeys.RuneCore memory core = getRuneCore(tokenId); return ITRMeta(core.metadataAddress).getColorCount(core); } /// @notice Spell of Divination: Colors /// @dev Fetch the hex code for a specific color of a given relic, between 000000 and ffffff. /// It's very rare to see two relics with the exact same palette, if ever at all. /// This is due to subtle variations in the vibrational forces of aether. /// @param tokenId The relic to be queried. /// @param index The index of the color sought, inclusive between 0 and colors - 1. function getColorByIndex(uint256 tokenId, uint256 index) public view returns (string memory) { TRKeys.RuneCore memory core = getRuneCore(tokenId); return ITRMeta(core.metadataAddress).getColorByIndex(core, index); } /// @notice Spell of Divination: Grails /// @dev The legend of the Queen's Grails? A tale as old as time ... /// The Queen was once a goddess, the first elemental of Light, and hailed by scholars as /// the original muse. She crafted the most magnificent set of grails, divine artifacts /// that were impossibly beautiful, unbreakable, and immutable. To behold them was to be /// enlightened - to see the universe as a beautiful sparkling globe, frozen in all times /// at once, speckled with brilliance and grandeur, all connected, all now, time itself /// but an illusion. The other gods, fearful of mortals obtaining such a perspective, /// wrapped her grails in powerful magic, shrouding them in obscurity. They were /// unrecognizable, but the Queen was cunning; she wanted her creations to inspire. /// She hid the grails amongst a gift of relics, which the other gods proudly bestowed /// upon the kingdom of man. It was only afterwards that the God of Shadow discovered /// her trick. What happened next is a story for another time, but suffice to say, this /// was the spark that ignited the Celestial Wars, spanning the heavens and the earth. /// @param tokenId The relic to be inspected. If 0 is returned, then that relic is not a grail; /// divine magic is powerful, and until we can dispel it, we truly don't know. function getGrailId(uint256 tokenId) public view returns (uint256) { TRKeys.RuneCore memory core = getRuneCore(tokenId); return ITRMeta(core.metadataAddress).getGrailId(core); } /// @notice Spell of Mathematics: Definition /// @dev Obtain the designs to recreate any relic from pure math and logic; /// conjure a stunning visualization, afloat in the air before you. /// You can have it all here, in red, blue, green. /// @param tokenId The relic to be conjured. function tokenScript(uint256 tokenId) public view returns (string memory) { TRKeys.RuneCore memory core = getRuneCore(tokenId); return ITRMeta(core.metadataAddress).tokenScript(core); } /// @notice Spell of Mathematics: Universal Runic Identifier /// @dev Blast enough Arcane magic through runic circuits, and you've got what arcanists call, /// "data." This spell helps identify all of the key traits belonging to a particular relic. /// @param tokenId The relic to be identified. function tokenURI(uint256 tokenId) override public view returns (string memory) { TRKeys.RuneCore memory core = getRuneCore(tokenId); return ITRMeta(core.metadataAddress).tokenURI(core); } /// @notice Spell of Divination: Rune Core /// @dev Use this spell to isolate and analyze the runic nucleus of a relic. Understanding the /// properties of a Rune Core is like knowing the seed of a flower, its entire life /// blossoms before you in an instant. /// @param tokenId The relic to be analyzed. function getRuneCore(uint256 tokenId) public view prohibitBlasphemy(tokenId) returns (TRKeys.RuneCore memory) { // DEV: A RuneCore contains all the data stored on-chain for a given relic. TRKeys.RuneCore memory core; core.tokenId = tokenId; core.level = getLevel(tokenId); core.mana = getMana(tokenId); core.runeCode = getRuneCode(tokenId); core.runeHash = getRuneHash(tokenId); core.metadataAddress = getMetadataAddress(tokenId); core.isDivinityQuestLoot = relics[tokenId].isDivinityQuestLoot; core.isSecretDiscovered = relics[tokenId].isSecretDiscovered; core.secretsDiscovered = reliquary.secretsDiscovered; core.hiddenLeyLines = reliquary.hiddenLeyLines; core.transmutation = relics[tokenId].transmutation; core.colors = relics[tokenId].colors; // DEV: SSTORE2 significantly reduces the gas costs of glyph creation. if (relics[tokenId].glyph != address(0)) { (address credit, uint256[] memory glyph) = abi.decode( SSTORE2.read(relics[tokenId].glyph), (address, uint256[]) ); core.credit = credit; core.glyph = glyph; } return core; } /// @notice Spell of Aether: Rune Code /// @dev Relics are infused with the elements, and as such, we can view the shape of the /// underlying aether by reading the physical effects on runic circuits. Each vibration /// can be encoded into data, and when a relic is forged, the vibrations of the aether /// forever leave their mark. The Rune Code is that unique aetheric stamp, a window /// into the past; its time and its news, all captured for the Queen to use. The chance /// of two relics sharing a Rune Code is just shy of impossible. /// @param tokenId The relic to be deciphered. function getRuneCode(uint256 tokenId) public view returns (uint256) { // DEV: Follow the ERC721A pattern, but for random blockhashes (one per mint batch). uint256 hashIndex; bytes32 entropy = relics[tokenId].runeHash; while (entropy == bytes32(0)) { ++hashIndex; entropy = relics[++tokenId].runeHash; } // DEV: Split each blockhash into even pieces, indexed by mint order in a batch. uint256 start = hashIndex * TRKeys.BYTES_PER_RELICHASH; uint256 end = TRKeys.BYTES_PER_BLOCKHASH; uint256 shift = (end - TRKeys.BYTES_PER_RELICHASH) - start; bytes32 finalHash = bytes32((entropy >> shift * 8) & TRKeys.RELICHASH_MASK); uint256 runeCode = uint256(finalHash); // DEV: Minimize potential hash collisions, while preventing overflow or underflow. if (runeCode >= TRKeys.HALF_POSSIBILITY_SPACE) { runeCode -= tokenId; } else { runeCode += tokenId; } return runeCode; } /// @notice Spell of Aether: Rune Hash /// @dev A Rune Hash is a human readable reinterpretation of a Rune Code. These are most often /// used as a sort of aetheric name to tell relics apart. /// @param tokenId The relic to be named. function getRuneHash(uint256 tokenId) public view returns (string memory) { return getRuneCode(tokenId).toHexString(TRKeys.BYTES_PER_RELICHASH); } /// @notice Spell of Aether: Vibrations /// @dev These are the aetheric vibrations wrapped up and forever imprinted upon a relic as /// it's forged. /// @param tokenId The relic being forged. function getAethericVibrations(uint256 tokenId) private view returns (bytes32) { // DEV: Minimize collisions by moving our index in the opposite direction of hashes. uint256 decrement = 1 + 255 % (block.number - 1); uint256 increment = tokenId % decrement; uint256 blockIndex = block.number - decrement + increment; return blockhash(blockIndex); } /// @notice Claim Relic(s) /// @dev Root, ransack, and raid for random relics from within the reliquary! /// Mind you, this is a holy place, and a tithe is due if you'd like to escape in one piece. /// A minimum of 0.15 aether per relic is required. If you've got vibes currently in your /// possession, try "mintWithVibesDiscount" first for a lesser tithe. /// @param mintCount The number of relics to claim. Limit 10 per transaction. function mint(uint256 mintCount) public payable nonReentrant prohibitTimeTravel prohibitAdvancedSpellcasting enforceInventoryLimits(mintCount) enforceAbsoluteScarcity(mintCount) { // Relics are divine in nature; a worthy tithe is strongly recommended. if (msg.value < TRKeys.RELIC_TITHE * mintCount) revert NotEnoughAether(); _mintRelics(mintCount); } /// @notice Claim Relic(s) with Aether from Vibes /// @dev By channeling the innate aether within vibes, one can significantly reduce the /// tithe. A minimum of 0.15 aether per relic is required, but each [genesis] vibe holds /// 0.12, while each [open] vibe holds 0.05, greatly reducing the overall cost. Vibes are /// not burned or affected in the process, though once channeled, the same vibes cannot be /// used for discounts again. Any excess aether will be stored and counted towards /// any additional relics you claim. Please calculate your tithe with care, use /// "calculateVibesDiscount" or visit https://vibes.art/ for an automated experience. /// @param mintCount The number of relics to claim. Limit 10 per transaction. function mintWithVibesDiscount(uint256 mintCount) public payable nonReentrant prohibitTimeTravel prohibitAdvancedSpellcasting enforceInventoryLimits(mintCount) enforceAbsoluteScarcity(mintCount) { uint256 discountGenesis = _channelVibesAether(TRKeys.VIBES_GENESIS, TRKeys.RELIC_DISCOUNT_GENESIS); uint256 discountOpen = _channelVibesAether(TRKeys.VIBES_OPEN, TRKeys.RELIC_DISCOUNT_OPEN); uint256 discountTotal = adventurers[_msgSender()].aether + discountGenesis + discountOpen; // Your aether shall not be wasted; use the "mint" method, instead. if (discountTotal == 0) revert NoAetherRemainingUseMintInstead(); uint256 tithe = TRKeys.RELIC_TITHE * mintCount; if (tithe >= discountTotal) { tithe -= discountTotal; discountTotal = 0; } else { discountTotal -= tithe; tithe = 0; } // Even with the elemental power of vibes, a worthy tithe is still required. if (msg.value < tithe) revert NotEnoughAether(); adventurers[_msgSender()].aether = discountTotal; _mintRelics(mintCount); } /// @notice Channel Aether from Vibes into an Adventurer's Tithe /// @dev This claims discounts for all vibes currently in your possession. Adding new vibes /// that haven't been used will accrue additional discounts. Excess discounts are saved /// and applied towards future relics. Discounts do not apply to the Divinity Quest. /// @param discountAddress The vibes contract to check for ownership. /// @param discountAmount The discount value per vibe to be claimed. function _channelVibesAether(address discountAddress, uint256 discountAmount) private returns (uint256) { Vibes discountContract = Vibes(discountAddress); uint256 tokenCount = discountContract.balanceOf(_msgSender()); uint256 discountClaimed; for (uint256 i; i < tokenCount; i++) { uint256 tokenId = discountContract.tokenOfOwnerByIndex(_msgSender(), i); if (!vibesAetherChanneled[tokenId]) { vibesAetherChanneled[tokenId] = true; discountClaimed += discountAmount; } } return discountClaimed; } /// @notice Calculate the Discount from Vibes in this Wallet /// @dev A read-only measurement of aether stored in vibes. /// Divide the result by 1000000000000000000 (18 zeroes) to convert to ETH. function calculateVibesDiscount() public view returns (uint256) { uint256 discountGenesis = _measureVibesAether(TRKeys.VIBES_GENESIS, TRKeys.RELIC_DISCOUNT_GENESIS); uint256 discountOpen = _measureVibesAether(TRKeys.VIBES_OPEN, TRKeys.RELIC_DISCOUNT_OPEN); return adventurers[_msgSender()].aether + discountGenesis + discountOpen; } /// @notice Measure Available Aether from Vibes /// @dev A read-only measurement of available aether. /// @param discountAddress The vibes contract to check for ownership. /// @param discountAmount The discount value per vibe. function _measureVibesAether(address discountAddress, uint256 discountAmount) private view returns (uint256) { Vibes discountContract = Vibes(discountAddress); uint256 tokenCount = discountContract.balanceOf(_msgSender()); uint256 discountAvailable; for (uint256 i; i < tokenCount; i++) { uint256 tokenId = discountContract.tokenOfOwnerByIndex(_msgSender(), i); if (!vibesAetherChanneled[tokenId]) { discountAvailable += discountAmount; } } return discountAvailable; } /// @notice Claim Divine Curio /// @dev This action is only accessible to adventurers who have completed the Divinity Quest. function _mintDivineCurio() private { _safeMint(_msgSender(), 1); uint256 lastTokenId = totalSupply(); relics[lastTokenId].runeHash = getAethericVibrations(lastTokenId); relics[lastTokenId].mana += TRKeys.MANA_FROM_REVELATION; relics[lastTokenId].isDivinityQuestLoot = true; reliquary.curiosDiscovered++; } /// @notice Claim Relic(s) /// @dev This action is for internal use only; see "mint" and "mintWithVibesDiscount." function _mintRelics(uint256 mintCount) private { _safeMint(_msgSender(), mintCount); uint256 lastTokenId = totalSupply(); relics[lastTokenId].runeHash = getAethericVibrations(lastTokenId); } /// @notice Burn a Vibe /// @dev Lock a vibe within this contract forever, /// effectively burning it while preserving the art. /// Vibes are used in this way to modify and customize relics. function _lockVibeForever(uint256 vibeId, uint256 tokenId) private { Vibes vibesContract; if (vibeId < TRKeys.FIRST_OPEN_VIBES_ID) { vibesContract = Vibes(TRKeys.VIBES_GENESIS); } else { vibesContract = Vibes(TRKeys.VIBES_OPEN); } vibesContract.transferFrom(_msgSender(), address(this), vibeId); relics[tokenId].mana += TRKeys.MANA_FROM_VIBRATION; } /// @notice Mana Loss /// @dev The ancient runic circuits of relics are extremely fragile! When a relic is transferred, /// any stored mana is reduced by half in the process. Please move, buy, and sell relics /// with care. There are no warranties for divine artifacts lost to the seas of time. function _disturbMana(uint256 tokenId) private { uint32 mana = getMana(tokenId); if (mana > 0) { relics[tokenId].mana = mana / 2; } } /// @notice See _disturbMana function _beforeTokenTransfers(address from, address to, uint256 startTokenId, uint256 quantity) internal override { super._beforeTokenTransfers(from, to, startTokenId, quantity); // DEV: Save gas and skip mint transactions, because mana always starts at 0. if (from != address(0)) { // DEV: Quantity is always 1 except in a mint transaction, so we can safely ignore // iterating over other relics that may have been minted in an ERC721A batch. _disturbMana(startTokenId); } } /// @notice Full Customization /// @dev Use "safeTransferFrom" in [genesis] or [open] vibes contracts to send a single vibe to /// this contract's address, for a single transaction to fully customize a relic. /// This is the most vibe-efficient and gas-efficient way for a full customization, but /// it generates less mana than performing each spell separately and burning more vibes. /// @param operator The wallet initiating the transaction, to be given creative credit. This will /// be passed automatically by the vibes contracts. /// @param data Encoded bytes in the format (uint256, string, uint256[], uint24[]), in order: /// uint256 targetTokenId - the tokenId of the relic to be customized, /// string element - transmute to this new element, empty string for no effect, /// uint256[] glyph - a new glyph to etch onto the relic, empty array for no effect, /// uint24[] colors - a reimagined color palette, empty array for no effect. /// See the individual customization methods for further documentation. function onERC721Received(address operator, address, uint256, bytes memory data) public override prohibitTimeTravel returns (bytes4) { if (_msgSender() != TRKeys.VIBES_GENESIS && _msgSender() != TRKeys.VIBES_OPEN) { revert OnlyBurnsVibes(); } uint256 targetTokenId; string memory element; uint256[] memory glyph; uint24[] memory colors; bool success = false; (targetTokenId, element, glyph, colors) = abi.decode( data, (uint256, string, uint256[], uint24[])); if (bytes(element).length > 0) { _transmuteElement(targetTokenId, element); success = true; } if (glyph.length > 0) { _createGlyph(targetTokenId, glyph, operator); success = true; } if (colors.length > 0) { _imagineColors(targetTokenId, colors); success = true; } if (!success) revert InvalidCustomization(); relics[targetTokenId].mana += TRKeys.MANA_FROM_VIBRATION; emit RelicUpdate(targetTokenId); return this.onERC721Received.selector; } /// @notice Withdraw aether to contract owner. function withdrawAether() public onlyOwner { (bool success,) = owner().call{ value: address(this).balance }(''); require(success); } } /// @notice This abstract contract matches both the [genesis] and [open] vibes contracts. /// Mint vibes and learn more about the project at https://vibes.art/ abstract contract Vibes { function balanceOf(address owner) external view virtual returns (uint256 balance); function ownerOf(uint256 tokenId) external view virtual returns (address); function getApproved(uint256 tokenId) public view virtual returns (address); function isApprovedForAll(address owner, address operator) public view virtual returns (bool); function transferFrom(address from, address to, uint256 tokenId) public virtual; function tokenOfOwnerByIndex(address owner, uint256 index) external view virtual returns (uint256 tokenId); } /* Dear Reader, Thank you for participating in this experience and for allowing me to use the circuits of your imagination. This project is presented without promises or obligations. Where we go from here is anyone's guess. I would be honored to receive your presence and thoughts. - remnynt DjhEVKnKW6 */
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./utils/Bytecode.sol"; /** @title A key-value storage with auto-generated keys for storing chunks of data with a lower write & read cost. @author Agustin Aguilar <[email protected]> Readme: https://github.com/0xsequence/sstore2#readme */ library SSTORE2 { error WriteError(); /** @notice Stores `_data` and returns `pointer` as key for later retrieval @dev The pointer is a contract address with `_data` as code @param _data to be written @return pointer Pointer to the written `_data` */ function write(bytes memory _data) internal returns (address pointer) { // Append 00 to _data so contract can't be called // Build init code bytes memory code = Bytecode.creationCodeFor( abi.encodePacked( hex'00', _data ) ); // Deploy contract using create assembly { pointer := create(0, add(code, 32), mload(code)) } // Address MUST be non-zero if (pointer == address(0)) revert WriteError(); } /** @notice Reads the contents of the `_pointer` code as data, skips the first byte @dev The function is intended for reading pointers generated by `write` @param _pointer to be read @return data read from `_pointer` contract */ function read(address _pointer) internal view returns (bytes memory) { return Bytecode.codeAt(_pointer, 1, type(uint256).max); } /** @notice Reads the contents of the `_pointer` code as data, skips the first byte @dev The function is intended for reading pointers generated by `write` @param _pointer to be read @param _start number of bytes to skip @return data read from `_pointer` contract */ function read(address _pointer, uint256 _start) internal view returns (bytes memory) { return Bytecode.codeAt(_pointer, _start + 1, type(uint256).max); } /** @notice Reads the contents of the `_pointer` code as data, skips the first byte @dev The function is intended for reading pointers generated by `write` @param _pointer to be read @param _start number of bytes to skip @param _end index before which to end extraction @return data read from `_pointer` contract */ function read(address _pointer, uint256 _start, uint256 _end) internal view returns (bytes memory) { return Bytecode.codeAt(_pointer, _start + 1, _end + 1); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC721/utils/ERC721Holder.sol) pragma solidity ^0.8.0; import "../IERC721Receiver.sol"; /** * @dev Implementation of the {IERC721Receiver} interface. * * Accepts all token transfers. * Make sure the contract is able to use its token with {IERC721-safeTransferFrom}, {IERC721-approve} or {IERC721-setApprovalForAll}. */ contract ERC721Holder is IERC721Receiver { /** * @dev See {IERC721Receiver-onERC721Received}. * * Always returns `IERC721Receiver.onERC721Received.selector`. */ function onERC721Received( address, address, uint256, bytes memory ) public virtual override returns (bytes4) { return this.onERC721Received.selector; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol) pragma solidity ^0.8.0; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; constructor() { _status = _NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { // On the first call to nonReentrant, _notEntered will be true require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; _; // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Strings.sol) pragma solidity ^0.8.0; /** * @dev String operations. */ library Strings { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { // Inspired by OraclizeAPI's implementation - MIT licence // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol if (value == 0) { return "0"; } uint256 temp = value; uint256 digits; while (temp != 0) { digits++; temp /= 10; } bytes memory buffer = new bytes(digits); while (value != 0) { digits -= 1; buffer[digits] = bytes1(uint8(48 + uint256(value % 10))); value /= 10; } return string(buffer); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { if (value == 0) { return "0x00"; } uint256 temp = value; uint256 length = 0; while (temp != 0) { length++; temp >>= 8; } return toHexString(value, length); } /** * @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] = _HEX_SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/Ownable.sol) pragma solidity ^0.8.4; import 'erc721a/contracts/ERC721A.sol'; import '@openzeppelin/contracts/access/Ownable.sol'; /// @notice ERC721ATM /// @dev ERC721A + Trustless Metadata /// An extension built on ERC721A v3.0.0 with trustless metadata upgrades. /// ~ upgradable: contract owner can add new metadata contracts, /// all tokens use the most recent by default. /// ~ immutable: token holders can opt-out of metadata updates by /// overriding tokens they hold to use any previously set metadata contract. abstract contract ERC721ATM is ERC721A, Ownable { /// allow for new metadata contracts but keep those previously used, /// the last entry in the list is the current metadata contract address[] public metadataAddressList; /// allow for token holders to opt-out of metadata contract updates mapping(uint256 => uint256) public metadataOverrides; error MissingMetadata(); error MetadataNumberTooLow(); error MetadataNumberTooHigh(); error NotMetadataApprovedOrOwner(); constructor(string memory name_, string memory symbol_) ERC721A(name_, symbol_) Ownable() {} function _startTokenId() override internal pure virtual returns (uint256) { return 1; } /// @notice update the collection to a new default metadata contract /// @param addr the address of the new metadata contract to use function setMetadataAddress(address addr) public virtual onlyOwner { metadataAddressList.push(addr); } /// @notice returns the metadata contract address for a given tokenId /// @param tokenId the token to check /// @return a metadata contract address override or the most recent set function getMetadataAddress(uint256 tokenId) public view virtual returns (address) { uint256 metadataNumber = metadataAddressList.length; if (metadataNumber == 0) revert MissingMetadata(); uint256 metadataOverride = metadataOverrides[tokenId]; if (metadataOverride > 0) { metadataNumber = metadataOverride; } return metadataAddressList[metadataNumber - 1]; } /// @notice opt-out of updates for this token, setting to any previously used metadata contract /// @param tokenId the token that will have its metadata overridden /// @param metadataNumber the metadata contract to use (index in metadataAddressList + 1) function setMetadataNumber(uint256 tokenId, uint256 metadataNumber) public virtual { uint256 addressCount = metadataAddressList.length; if (metadataNumber == 0) revert MetadataNumberTooLow(); if (metadataNumber > addressCount) revert MetadataNumberTooHigh(); if (!isApprovedOrOwnerOf(tokenId)) revert NotMetadataApprovedOrOwner(); metadataOverrides[tokenId] = metadataNumber; } /// @notice clear override and opt-in to metadata updates for this token /// @param tokenId the token that will have its metadata overridden function clearMetadataNumber(uint256 tokenId) public virtual { if (!isApprovedOrOwnerOf(tokenId)) revert NotMetadataApprovedOrOwner(); metadataOverrides[tokenId] = 0; } /// @dev returns whether `_msgSender()` is allowed to manage `tokenId` /// @param tokenId the token to check function isApprovedOrOwnerOf(uint256 tokenId) internal view virtual returns (bool) { address owner = ownerOf(tokenId); return _msgSender() == owner || _msgSender() == getApproved(tokenId) || isApprovedForAll(owner, _msgSender()); } }
// SPDX-License-Identifier: Unlicense pragma solidity ^0.8.4; import '@openzeppelin/contracts/access/Ownable.sol'; import '@openzeppelin/contracts/utils/Strings.sol'; import './Base64.sol'; import './TRScript.sol'; import './TRRolls.sol'; interface ITRMeta { function tokenURI(TRKeys.RuneCore memory core) external view returns (string memory); function tokenScript(TRKeys.RuneCore memory core) external view returns (string memory); function getElement(TRKeys.RuneCore memory core) external view returns (string memory); function getColorCount(TRKeys.RuneCore memory core) external view returns (uint256); function getColorByIndex(TRKeys.RuneCore memory core, uint256 index) external view returns (string memory); function getGrailId(TRKeys.RuneCore memory core) external view returns (uint256); function getMaxRelicLevel() external pure returns (uint8); } /// @notice The Reliquary Metadata v1 contract TRMeta is Ownable, ITRMeta { using Strings for uint256; string public imageURL = 'https://vibes.art/reliquary/png/'; string public imageSuffix = '.png'; string public animationURL = 'https://vibes.art/reliquary/html/'; string public animationSuffix = '.html'; address public rollsContract; mapping(string => string) public descriptionsByElement; mapping(string => string) public descriptionsByEssence; error RollsAreImmutable(); constructor() Ownable() {} function tokenURI(TRKeys.RuneCore memory core) override external view returns (string memory) { TRRolls.RelicInfo memory info = ITRRolls(rollsContract).getRelicInfo(core); string memory json = string(abi.encodePacked( '{"name": "Relic 0x', TRUtils.toCapsHexString(core.runeCode), '", "description": "', tokenDescription(core, info), '", "image": "', tokenImage(core), '", "animation_url": "', tokenAnimation(core), '", "attributes": [{ "trait_type": "Element", "value": "', info.element )); json = string(abi.encodePacked( json, '" }, { "trait_type": "Type", "value": "', info.relicType, '" }, { "trait_type": "Essence", "value": "', info.essence, '" }, { "trait_type": "Palette", "value": "', info.palette, '" }, { "trait_type": "Style", "value": "', info.style )); json = string(abi.encodePacked( json, '" }, { "trait_type": "Speed", "value": "', info.speed, '" }, { "trait_type": "Glyph", "value": "', info.glyphType, '" }, { "trait_type": "Colors", "value": "', TRUtils.toString(info.colorCount), '" }, { "trait_type": "Level", "value": ', TRUtils.toString(core.level) )); json = string(abi.encodePacked( json, ' }, { "trait_type": "Mana", "value": ', TRUtils.toString(core.mana), ' }], "hidden": [{ "trait_type": "Runeflux", "value": ', TRUtils.toString(info.runeflux), ' }, { "trait_type": "Corruption", "value": ', TRUtils.toString(info.corruption), ' }, { "trait_type": "Grail", "value": ', TRUtils.toString(info.grailId), ' }]}' )); return string(abi.encodePacked( 'data:application/json;base64,', Base64.encode(bytes(json)) )); } function tokenScript(TRKeys.RuneCore memory core) override public view returns (string memory) { TRRolls.RelicInfo memory info = ITRRolls(rollsContract).getRelicInfo(core); string[] memory html = new string[](19); uint256[] memory glyph = core.glyph; if (info.grailId != TRKeys.GRAIL_ID_NONE) { glyph = info.grailGlyph; } html[0] = '<!doctype html><html><head><script>'; html[1] = string(abi.encodePacked('var H="', core.runeHash, '";')); html[2] = string(abi.encodePacked('var N="', info.essence, '";')); html[3] = string(abi.encodePacked('var Y="', info.style, '";')); html[4] = string(abi.encodePacked('var E="', info.speed, '";')); html[5] = string(abi.encodePacked('var G="', info.gravity, '";')); html[6] = string(abi.encodePacked('var D="', info.display, '";')); html[7] = string(abi.encodePacked('var V=', TRUtils.toString(core.level), ';')); html[8] = string(abi.encodePacked('var F=', TRUtils.toString(info.runeflux), ';')); html[9] = string(abi.encodePacked('var C=', TRUtils.toString(info.corruption), ';')); string memory itemString; string memory partString; uint256 i; for (; i < TRKeys.RELIC_SIZE; i++) { if (i < glyph.length) { itemString = glyph[i].toString(); } else { itemString = '0'; } while (bytes(itemString).length < TRKeys.RELIC_SIZE) { itemString = string(abi.encodePacked('0', itemString)); } if (i == 0) { itemString = string(abi.encodePacked('var L=["', itemString, '",')); } else if (i < TRKeys.RELIC_SIZE - 1) { itemString = string(abi.encodePacked('"', itemString, '",')); } else { itemString = string(abi.encodePacked('"', itemString, '"];')); } partString = string(abi.encodePacked(partString, itemString)); } html[10] = partString; for (i = 0; i < 6; i++) { if (i < info.colorCount) { itemString = ITRRolls(rollsContract).getColorByIndex(core, i); } else { itemString = ''; } if (i == 0) { partString = string(abi.encodePacked('var P=["', itemString, '",')); } else if (i < info.colorCount - 1) { partString = string(abi.encodePacked('"', itemString, '",')); } else if (i < info.colorCount) { partString = string(abi.encodePacked('"', itemString, '"];')); } else { partString = ''; } html[11 + i] = partString; } html[17] = getScript(); html[18] = '</script></head><body></body></html>'; string memory output = string(abi.encodePacked( html[0], html[1], html[2], html[3], html[4], html[5], html[6], html[7], html[8] )); output = string(abi.encodePacked( output, html[9], html[10], html[11], html[12], html[13], html[14], html[15], html[16] )); return string(abi.encodePacked( output, html[17], html[18] )); } function tokenDescription(TRKeys.RuneCore memory core, TRRolls.RelicInfo memory info) public view returns (string memory) { string memory desc = string(abi.encodePacked( 'Relic 0x', TRUtils.toCapsHexString(core.runeCode), '\\n\\n', info.essence, ' ', info.relicType, ' of ', info.element )); desc = string(abi.encodePacked( desc, '\\n\\nLevel: ', TRUtils.toString(core.level), '\\n\\nMana: ', TRUtils.toString(core.mana), '\\n\\nRuneflux: ', TRUtils.toString(info.runeflux), '\\n\\nCorruption: ', TRUtils.toString(info.corruption) )); if (core.credit != address(0)) { desc = string(abi.encodePacked(desc, '\\n\\nGlyph by: 0x', TRUtils.toAsciiString(core.credit))); } string memory additionalInfo = ITRRolls(rollsContract).getDescription(core); if (bytes(additionalInfo).length > 0) { desc = string(abi.encodePacked(desc, '\\n\\n', additionalInfo)); } if (bytes(descriptionsByElement[info.element]).length > 0) { desc = string(abi.encodePacked(desc, '\\n\\n', descriptionsByElement[info.element])); } if (bytes(descriptionsByEssence[info.essence]).length > 0) { desc = string(abi.encodePacked(desc, '\\n\\n', descriptionsByEssence[info.essence])); } return desc; } function tokenImage(TRKeys.RuneCore memory core) public view returns (string memory) { if (bytes(imageSuffix).length > 0) { return string(abi.encodePacked(imageURL, TRUtils.toString(core.tokenId), imageSuffix)); } else { return string(abi.encodePacked(imageURL, TRUtils.toString(core.tokenId))); } } function tokenAnimation(TRKeys.RuneCore memory core) public view returns (string memory) { if (bytes(animationURL).length == 0) { return string(abi.encodePacked( 'data:text/html;base64,', Base64.encode(bytes(tokenScript(core))) )); } else { if (bytes(animationSuffix).length > 0) { return string(abi.encodePacked(animationURL, TRUtils.toString(core.tokenId), animationSuffix)); } else { return string(abi.encodePacked(animationURL, TRUtils.toString(core.tokenId))); } } } function getElement(TRKeys.RuneCore memory core) override public view returns (string memory) { return ITRRolls(rollsContract).getElement(core); } function getPalette(TRKeys.RuneCore memory core) public view returns (string memory) { return ITRRolls(rollsContract).getPalette(core); } function getEssence(TRKeys.RuneCore memory core) public view returns (string memory) { return ITRRolls(rollsContract).getEssence(core); } function getStyle(TRKeys.RuneCore memory core) public view returns (string memory) { return ITRRolls(rollsContract).getStyle(core); } function getSpeed(TRKeys.RuneCore memory core) public view returns (string memory) { return ITRRolls(rollsContract).getSpeed(core); } function getGravity(TRKeys.RuneCore memory core) public view returns (string memory) { return ITRRolls(rollsContract).getGravity(core); } function getDisplay(TRKeys.RuneCore memory core) public view returns (string memory) { return ITRRolls(rollsContract).getDisplay(core); } function getColorCount(TRKeys.RuneCore memory core) override public view returns (uint256) { return ITRRolls(rollsContract).getColorCount(core); } function getColorByIndex(TRKeys.RuneCore memory core, uint256 index) override public view returns (string memory) { return ITRRolls(rollsContract).getColorByIndex(core, index); } function getRelicType(TRKeys.RuneCore memory core) public view returns (string memory) { return ITRRolls(rollsContract).getRelicType(core); } function getRuneflux(TRKeys.RuneCore memory core) public view returns (uint256) { return ITRRolls(rollsContract).getRuneflux(core); } function getCorruption(TRKeys.RuneCore memory core) public view returns (uint256) { return ITRRolls(rollsContract).getCorruption(core); } function getGrailId(TRKeys.RuneCore memory core) override public view returns (uint256) { return ITRRolls(rollsContract).getGrailId(core); } function getMaxRelicLevel() override public pure returns (uint8) { return 2; } function getScript() public pure returns (string memory) { return TRScript.getScript(); } function setDescriptionForElement(string memory element, string memory desc) public onlyOwner { descriptionsByElement[element] = desc; } function setDescriptionForEssence(string memory essence, string memory desc) public onlyOwner { descriptionsByEssence[essence] = desc; } function setImageURL(string memory url) public onlyOwner { imageURL = url; } function setImageSuffix(string memory suffix) public onlyOwner { imageSuffix = suffix; } function setAnimationURL(string memory url) public onlyOwner { animationURL = url; } function setAnimationSuffix(string memory suffix) public onlyOwner { animationSuffix = suffix; } function setRollsContract(address rolls) public onlyOwner { if (rollsContract != address(0)) revert RollsAreImmutable(); rollsContract = rolls; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; library Bytecode { error InvalidCodeAtRange(uint256 _size, uint256 _start, uint256 _end); /** @notice Generate a creation code that results on a contract with `_code` as bytecode @param _code The returning value of the resulting `creationCode` @return creationCode (constructor) for new contract */ function creationCodeFor(bytes memory _code) internal pure returns (bytes memory) { /* 0x00 0x63 0x63XXXXXX PUSH4 _code.length size 0x01 0x80 0x80 DUP1 size size 0x02 0x60 0x600e PUSH1 14 14 size size 0x03 0x60 0x6000 PUSH1 00 0 14 size size 0x04 0x39 0x39 CODECOPY size 0x05 0x60 0x6000 PUSH1 00 0 size 0x06 0xf3 0xf3 RETURN <CODE> */ return abi.encodePacked( hex"63", uint32(_code.length), hex"80_60_0E_60_00_39_60_00_F3", _code ); } /** @notice Returns the size of the code on a given address @param _addr Address that may or may not contain code @return size of the code on the given `_addr` */ function codeSize(address _addr) internal view returns (uint256 size) { assembly { size := extcodesize(_addr) } } /** @notice Returns the code of a given address @dev It will fail if `_end < _start` @param _addr Address that may or may not contain code @param _start number of bytes of code to skip on read @param _end index before which to end extraction @return oCode read from `_addr` deployed bytecode Forked from: https://gist.github.com/KardanovIR/fe98661df9338c842b4a30306d507fbd */ function codeAt(address _addr, uint256 _start, uint256 _end) internal view returns (bytes memory oCode) { uint256 csize = codeSize(_addr); if (csize == 0) return bytes(""); if (_start > csize) return bytes(""); if (_end < _start) revert InvalidCodeAtRange(csize, _start, _end); unchecked { uint256 reqSize = _end - _start; uint256 maxSize = csize - _start; uint256 size = maxSize < reqSize ? maxSize : reqSize; assembly { // allocate output byte array - this could also be done without assembly // by using o_code = new bytes(size) oCode := mload(0x40) // new "memory end" including padding mstore(0x40, add(oCode, and(add(add(size, 0x20), 0x1f), not(0x1f)))) // store length in memory mstore(oCode, size) // actually retrieve the code, this needs assembly extcodecopy(_addr, add(oCode, 0x20), _start, size) } } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (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 `IERC721.onERC721Received.selector`. */ function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT // Creator: Chiru Labs pragma solidity ^0.8.4; import '@openzeppelin/contracts/token/ERC721/IERC721.sol'; import '@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol'; import '@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol'; import '@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol'; import '@openzeppelin/contracts/utils/Address.sol'; import '@openzeppelin/contracts/utils/Context.sol'; import '@openzeppelin/contracts/utils/Strings.sol'; import '@openzeppelin/contracts/utils/introspection/ERC165.sol'; error ApprovalCallerNotOwnerNorApproved(); error ApprovalQueryForNonexistentToken(); error ApproveToCaller(); error ApprovalToCurrentOwner(); error BalanceQueryForZeroAddress(); error MintedQueryForZeroAddress(); error BurnedQueryForZeroAddress(); error AuxQueryForZeroAddress(); error MintToZeroAddress(); error MintZeroQuantity(); error OwnerIndexOutOfBounds(); error OwnerQueryForNonexistentToken(); error TokenIndexOutOfBounds(); error TransferCallerNotOwnerNorApproved(); error TransferFromIncorrectOwner(); error TransferToNonERC721ReceiverImplementer(); error TransferToZeroAddress(); error URIQueryForNonexistentToken(); /** * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including * the Metadata extension. Built to optimize for lower gas during batch mints. * * Assumes serials are sequentially minted starting at _startTokenId() (defaults to 0, e.g. 0, 1, 2, 3..). * * Assumes that an owner cannot have more than 2**64 - 1 (max value of uint64) of supply. * * Assumes that the maximum token id cannot exceed 2**256 - 1 (max value of uint256). */ contract ERC721A is Context, ERC165, IERC721, IERC721Metadata { using Address for address; using Strings for uint256; // Compiler will pack this into a single 256bit word. struct TokenOwnership { // The address of the owner. address addr; // Keeps track of the start time of ownership with minimal overhead for tokenomics. uint64 startTimestamp; // Whether the token has been burned. bool burned; } // Compiler will pack this into a single 256bit word. struct AddressData { // Realistically, 2**64-1 is more than enough. uint64 balance; // Keeps track of mint count with minimal overhead for tokenomics. uint64 numberMinted; // Keeps track of burn count with minimal overhead for tokenomics. uint64 numberBurned; // For miscellaneous variable(s) pertaining to the address // (e.g. number of whitelist mint slots used). // If there are multiple variables, please pack them into a uint64. uint64 aux; } // The tokenId of the next token to be minted. uint256 internal _currentIndex; // The number of tokens burned. uint256 internal _burnCounter; // Token name string private _name; // Token symbol string private _symbol; // Mapping from token ID to ownership details // An empty struct value does not necessarily mean the token is unowned. See ownershipOf implementation for details. mapping(uint256 => TokenOwnership) internal _ownerships; // Mapping owner address to address data mapping(address => AddressData) private _addressData; // 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; constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; _currentIndex = _startTokenId(); } /** * To change the starting tokenId, please override this function. */ function _startTokenId() internal view virtual returns (uint256) { return 0; } /** * @dev See {IERC721Enumerable-totalSupply}. * @dev Burned tokens are calculated here, use _totalMinted() if you want to count just minted tokens. */ function totalSupply() public view returns (uint256) { // Counter underflow is impossible as _burnCounter cannot be incremented // more than _currentIndex - _startTokenId() times unchecked { return _currentIndex - _burnCounter - _startTokenId(); } } /** * Returns the total amount of tokens minted in the contract. */ function _totalMinted() internal view returns (uint256) { // Counter underflow is impossible as _currentIndex does not decrement, // and it is initialized to _startTokenId() unchecked { return _currentIndex - _startTokenId(); } } /** * @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 override returns (uint256) { if (owner == address(0)) revert BalanceQueryForZeroAddress(); return uint256(_addressData[owner].balance); } /** * Returns the number of tokens minted by `owner`. */ function _numberMinted(address owner) internal view returns (uint256) { if (owner == address(0)) revert MintedQueryForZeroAddress(); return uint256(_addressData[owner].numberMinted); } /** * Returns the number of tokens burned by or on behalf of `owner`. */ function _numberBurned(address owner) internal view returns (uint256) { if (owner == address(0)) revert BurnedQueryForZeroAddress(); return uint256(_addressData[owner].numberBurned); } /** * Returns the auxillary data for `owner`. (e.g. number of whitelist mint slots used). */ function _getAux(address owner) internal view returns (uint64) { if (owner == address(0)) revert AuxQueryForZeroAddress(); return _addressData[owner].aux; } /** * Sets the auxillary data for `owner`. (e.g. number of whitelist mint slots used). * If there are multiple variables, please pack them into a uint64. */ function _setAux(address owner, uint64 aux) internal { if (owner == address(0)) revert AuxQueryForZeroAddress(); _addressData[owner].aux = aux; } /** * Gas spent here starts off proportional to the maximum mint batch size. * It gradually moves to O(1) as tokens get transferred around in the collection over time. */ function ownershipOf(uint256 tokenId) internal view returns (TokenOwnership memory) { uint256 curr = tokenId; unchecked { if (_startTokenId() <= curr && curr < _currentIndex) { TokenOwnership memory ownership = _ownerships[curr]; if (!ownership.burned) { if (ownership.addr != address(0)) { return ownership; } // Invariant: // There will always be an ownership that has an address and is not burned // before an ownership that does not have an address and is not burned. // Hence, curr will not underflow. while (true) { curr--; ownership = _ownerships[curr]; if (ownership.addr != address(0)) { return ownership; } } } } } revert OwnerQueryForNonexistentToken(); } /** * @dev See {IERC721-ownerOf}. */ function ownerOf(uint256 tokenId) public view override returns (address) { return ownershipOf(tokenId).addr; } /** * @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) { if (!_exists(tokenId)) revert URIQueryForNonexistentToken(); 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 overriden in child contracts. */ function _baseURI() internal view virtual returns (string memory) { return ''; } /** * @dev See {IERC721-approve}. */ function approve(address to, uint256 tokenId) public override { address owner = ERC721A.ownerOf(tokenId); if (to == owner) revert ApprovalToCurrentOwner(); if (_msgSender() != owner && !isApprovedForAll(owner, _msgSender())) { revert ApprovalCallerNotOwnerNorApproved(); } _approve(to, tokenId, owner); } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view override returns (address) { if (!_exists(tokenId)) revert ApprovalQueryForNonexistentToken(); return _tokenApprovals[tokenId]; } /** * @dev See {IERC721-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public override { if (operator == _msgSender()) revert ApproveToCaller(); _operatorApprovals[_msgSender()][operator] = approved; emit ApprovalForAll(_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 { _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 { _transfer(from, to, tokenId); if (to.isContract() && !_checkContractOnERC721Received(from, to, tokenId, _data)) { revert TransferToNonERC721ReceiverImplementer(); } } /** * @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`), */ function _exists(uint256 tokenId) internal view returns (bool) { return _startTokenId() <= tokenId && tokenId < _currentIndex && !_ownerships[tokenId].burned; } function _safeMint(address to, uint256 quantity) internal { _safeMint(to, quantity, ''); } /** * @dev Safely mints `quantity` tokens and transfers them to `to`. * * Requirements: * * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called for each safe transfer. * - `quantity` must be greater than 0. * * Emits a {Transfer} event. */ function _safeMint( address to, uint256 quantity, bytes memory _data ) internal { _mint(to, quantity, _data, true); } /** * @dev Mints `quantity` tokens and transfers them to `to`. * * Requirements: * * - `to` cannot be the zero address. * - `quantity` must be greater than 0. * * Emits a {Transfer} event. */ function _mint( address to, uint256 quantity, bytes memory _data, bool safe ) internal { uint256 startTokenId = _currentIndex; if (to == address(0)) revert MintToZeroAddress(); if (quantity == 0) revert MintZeroQuantity(); _beforeTokenTransfers(address(0), to, startTokenId, quantity); // Overflows are incredibly unrealistic. // balance or numberMinted overflow if current value of either + quantity > 1.8e19 (2**64) - 1 // updatedIndex overflows if _currentIndex + quantity > 1.2e77 (2**256) - 1 unchecked { _addressData[to].balance += uint64(quantity); _addressData[to].numberMinted += uint64(quantity); _ownerships[startTokenId].addr = to; _ownerships[startTokenId].startTimestamp = uint64(block.timestamp); uint256 updatedIndex = startTokenId; uint256 end = updatedIndex + quantity; if (safe && to.isContract()) { do { emit Transfer(address(0), to, updatedIndex); if (!_checkContractOnERC721Received(address(0), to, updatedIndex++, _data)) { revert TransferToNonERC721ReceiverImplementer(); } } while (updatedIndex != end); // Reentrancy protection if (_currentIndex != startTokenId) revert(); } else { do { emit Transfer(address(0), to, updatedIndex++); } while (updatedIndex != end); } _currentIndex = updatedIndex; } _afterTokenTransfers(address(0), to, startTokenId, quantity); } /** * @dev Transfers `tokenId` from `from` to `to`. * * 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 ) private { TokenOwnership memory prevOwnership = ownershipOf(tokenId); bool isApprovedOrOwner = (_msgSender() == prevOwnership.addr || isApprovedForAll(prevOwnership.addr, _msgSender()) || getApproved(tokenId) == _msgSender()); if (!isApprovedOrOwner) revert TransferCallerNotOwnerNorApproved(); if (prevOwnership.addr != from) revert TransferFromIncorrectOwner(); if (to == address(0)) revert TransferToZeroAddress(); _beforeTokenTransfers(from, to, tokenId, 1); // Clear approvals from the previous owner _approve(address(0), tokenId, prevOwnership.addr); // Underflow of the sender's balance is impossible because we check for // ownership above and the recipient's balance can't realistically overflow. // Counter overflow is incredibly unrealistic as tokenId would have to be 2**256. unchecked { _addressData[from].balance -= 1; _addressData[to].balance += 1; _ownerships[tokenId].addr = to; _ownerships[tokenId].startTimestamp = uint64(block.timestamp); // If the ownership slot of tokenId+1 is not explicitly set, that means the transfer initiator owns it. // Set the slot of tokenId+1 explicitly in storage to maintain correctness for ownerOf(tokenId+1) calls. uint256 nextTokenId = tokenId + 1; if (_ownerships[nextTokenId].addr == address(0)) { // This will suffice for checking _exists(nextTokenId), // as a burned slot cannot contain the zero address. if (nextTokenId < _currentIndex) { _ownerships[nextTokenId].addr = prevOwnership.addr; _ownerships[nextTokenId].startTimestamp = prevOwnership.startTimestamp; } } } emit Transfer(from, to, tokenId); _afterTokenTransfers(from, to, tokenId, 1); } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId) internal virtual { TokenOwnership memory prevOwnership = ownershipOf(tokenId); _beforeTokenTransfers(prevOwnership.addr, address(0), tokenId, 1); // Clear approvals from the previous owner _approve(address(0), tokenId, prevOwnership.addr); // Underflow of the sender's balance is impossible because we check for // ownership above and the recipient's balance can't realistically overflow. // Counter overflow is incredibly unrealistic as tokenId would have to be 2**256. unchecked { _addressData[prevOwnership.addr].balance -= 1; _addressData[prevOwnership.addr].numberBurned += 1; // Keep track of who burned the token, and the timestamp of burning. _ownerships[tokenId].addr = prevOwnership.addr; _ownerships[tokenId].startTimestamp = uint64(block.timestamp); _ownerships[tokenId].burned = true; // If the ownership slot of tokenId+1 is not explicitly set, that means the burn initiator owns it. // Set the slot of tokenId+1 explicitly in storage to maintain correctness for ownerOf(tokenId+1) calls. uint256 nextTokenId = tokenId + 1; if (_ownerships[nextTokenId].addr == address(0)) { // This will suffice for checking _exists(nextTokenId), // as a burned slot cannot contain the zero address. if (nextTokenId < _currentIndex) { _ownerships[nextTokenId].addr = prevOwnership.addr; _ownerships[nextTokenId].startTimestamp = prevOwnership.startTimestamp; } } } emit Transfer(prevOwnership.addr, address(0), tokenId); _afterTokenTransfers(prevOwnership.addr, address(0), tokenId, 1); // Overflow not possible, as _burnCounter cannot be exceed _currentIndex times. unchecked { _burnCounter++; } } /** * @dev Approve `to` to operate on `tokenId` * * Emits a {Approval} event. */ function _approve( address to, uint256 tokenId, address owner ) private { _tokenApprovals[tokenId] = to; emit Approval(owner, to, tokenId); } /** * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target 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 _checkContractOnERC721Received( address from, address to, uint256 tokenId, bytes memory _data ) private returns (bool) { try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) { return retval == IERC721Receiver(to).onERC721Received.selector; } catch (bytes memory reason) { if (reason.length == 0) { revert TransferToNonERC721ReceiverImplementer(); } else { assembly { revert(add(32, reason), mload(reason)) } } } } /** * @dev Hook that is called before a set of serially-ordered token ids are about to be transferred. This includes minting. * And also called before burning one token. * * startTokenId - the first token id to be transferred * quantity - the amount to be transferred * * Calling conditions: * * - When `from` and `to` are both non-zero, `from`'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, `tokenId` will be burned by `from`. * - `from` and `to` are never both zero. */ function _beforeTokenTransfers( address from, address to, uint256 startTokenId, uint256 quantity ) internal virtual {} /** * @dev Hook that is called after a set of serially-ordered token ids have been transferred. This includes * minting. * And also called after one token has been burned. * * startTokenId - the first token id to be transferred * quantity - the amount to be transferred * * Calling conditions: * * - When `from` and `to` are both non-zero, `from`'s `tokenId` has been * transferred to `to`. * - When `from` is zero, `tokenId` has been minted for `to`. * - When `to` is zero, `tokenId` has been burned by `from`. * - `from` and `to` are never both zero. */ function _afterTokenTransfers( address from, address to, uint256 startTokenId, uint256 quantity ) internal virtual {} }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _transferOwnership(_msgSender()); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (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`, 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 be 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: Usage of this method is discouraged, use {safeTransferFrom} whenever possible. * * 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 Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @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 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); /** * @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; }
// 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 v4.4.1 (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 tokenId); /** * @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 (utils/Address.sol) pragma solidity ^0.8.0; /** * @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 * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; assembly { size := extcodesize(account) } return size > 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 functionCall(target, data, "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"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResult(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) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResult(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) { require(isContract(target), "Address: delegate call to non-contract"); (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason 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 { // 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 assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (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; } }
// 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 /// @title Base64 /// @notice Provides a function for encoding some bytes in base64 /// @author Brecht Devos <[email protected]> pragma solidity ^0.8.4; library Base64 { bytes internal constant TABLE = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; /// @notice Encodes some bytes to the base64 representation function encode(bytes memory data) internal pure returns (string memory) { uint256 len = data.length; if (len == 0) return ''; // multiply by 4/3 rounded up uint256 encodedLen = 4 * ((len + 2) / 3); // Add some extra buffer at the end bytes memory result = new bytes(encodedLen + 32); bytes memory table = TABLE; assembly { let tablePtr := add(table, 1) let resultPtr := add(result, 32) for { let i := 0 } lt(i, len) { } { i := add(i, 3) let input := and(mload(add(data, i)), 0xffffff) let out := mload(add(tablePtr, and(shr(18, input), 0x3F))) out := shl(8, out) out := add(out, and(mload(add(tablePtr, and(shr(12, input), 0x3F))), 0xFF)) out := shl(8, out) out := add(out, and(mload(add(tablePtr, and(shr(6, input), 0x3F))), 0xFF)) out := shl(8, out) out := add(out, and(mload(add(tablePtr, and(input, 0x3F))), 0xFF)) out := shl(224, out) mstore(resultPtr, out) resultPtr := add(resultPtr, 4) } switch mod(len, 3) case 1 { mstore(sub(resultPtr, 2), shl(240, 0x3d3d)) } case 2 { mstore(sub(resultPtr, 1), shl(248, 0x3d)) } mstore(result, encodedLen) } return string(result); } }
// SPDX-License-Identifier: Unlicense pragma solidity ^0.8.4; /// @notice The Reliquary Canvas App library TRScript { string public constant SCRIPT = 'for(var TH="",i=0;8>i;i++)TH+=H.substr(2,6);H="0x"+TH;for(var HB=!1,PC=64,MT=50,PI=Math.PI,TAU=2*PI,abs=Math.abs,min=Math.min,max=Math.max,sin=Math.sin,cos=Math.cos,pow=Math.pow,sqrt=Math.sqrt,ceil=Math.ceil,floor=Math.floor,rm=null,wW=0,wH=0,cS=1,canvas=null,ctx=null,L2=1<V,BC2=[{x:.5,y:.5},{x:.75,y:0}],BC3=[{x:.65,y:.15},{x:.5,y:.5},{x:.75,y:.75}],BC4=[{x:.5,y:0},{x:0,y:.5},{x:.5,y:1},{x:1,y:.5}],BC5=[{x:.5,y:.5},{x:.5,y:0},{x:0,y:.5},{x:.5,y:1},{x:1,y:.5}],BC6=[{x:.5,y:.5},{x:.5,y:0},{x:1,y:0},{x:1,y:1},{x:0,y:1},{x:0,y:0}],BC=[,,BC2,BC3,BC4,BC5,BC6],gvy=null,pxS=C/1e3,TS=TAU/127.5,DLO=.5+.5*F/1e3,DMD=1e3+19e3*F/1e3,DHI=8+24*F/1e3,RFOP=800<=F?.5+.5*(F-800)/199:0,wST=0,wS=[],wSE=0,eL=[],cPC=P.length,cP=[],pI=0,plC=BC[cPC],iFR=!0,dt=0,pvT=0,iPs=!1,iPt=!1,iEs=!1,iBx=!1,bxS=null,pB=9,pP=Array(PC),x=0;x<PC;x++){pP[x]=Array(PC);for(var y=0;y<PC;y++)pP[x][y]=0}if(L&&L.length===PC)for(var y=0;y<PC;y++)for(var row,x=0;x<PC;x++)row=""+L[y],pP[x][y]=+row.charAt(x);var sp=0;"Zen"==E&&(sp=256),"Tranquil"==E&&(sp=64),"Normal"==E&&(sp=16),"Fast"==E&&(sp=4),"Swift"==E&&(sp=2),"Hyper"==E&&(sp=.5);var sM=SD,sV=-1,sSS=1/3;"Pajamas"==Y&&(sM=SS,sSS=1/99),"Silk"==Y&&(sM=SS,sSS=1/3),"Sketch"==Y&&(sM=SRS);function SD(c,a){return c.distance-a.distance}function SS(){var a=sV;return sV+=sSS,2<=sV&&(sV-=3),a}function SRS(){var a=sV;return sV+=1/(rm()*PC),2<=sV&&(sV-=3),a}var flipX=!("Mirrored"!=D&&"MirroredUpsideDown"!=D),flipY=!("UpsideDown"!=D&&"MirroredUpsideDown"!=D),gv=3;"Lunar"==G&&(gv=.5),"Atmospheric"==G&&(gv=1),"Low"==G&&(gv=2),"High"==G&&(gv=6),"Massive"==G&&(gv=9),"Stellar"==G&&(gv=12),"Galactic"==G&&(gv=24);var ess={l:[]};"Heavenly"==N&&(ess={c:{r:{o:64},g:{o:64},b:{o:32}},l:[{st:{x:.006},n:{s:.006,d:128,c:.024,xp:.5},op:.4},{st:{x:-.007},n:{s:.007,d:128,c:.022,xp:.5},op:.6},{st:{y:.008},n:{s:.008,d:128,c:.02,xp:.5},op:.8},{st:{y:-.009},n:{s:.009,d:128,c:.018,xp:.5},op:1}]}),"Fae"==N&&(ess={l:[{c:{a:{o:16,e:-96}},st:{x:.002,y:-.017},op:.75,sc:1},{c:{a:{o:-16,e:96}},st:{x:-.001,y:-.015},op:.9,sc:1},{c:{a:{o:52,e:8}},st:{x:-.01,y:-.03},op:.9,n:{s:.02,d:64,c:.015,xp:2}}]}),"Prismatic"==N&&(ess={l:[{c:{r:{o:-64,e:128},g:{o:-64,e:128},b:{o:-32,e:64}},op:.75,n:{s:.001,d:1024,c:.001,xp:1}},{c:{r:{o:-64,e:255},g:{o:-64,e:255},b:{o:-32,e:128}},op:.25,n:{s:.001,d:1024,c:.001,xp:1}}]}),"Radiant"==N&&(ess={c:{r:{o:60,e:80},g:{o:60,e:80},b:{o:40,e:60}},l:[{op:1,n:{s:3e-4,d:40,c:.0014,xp:1}}]}),"Photonic"==N&&(ess={c:{a:{o:-64,e:140}},l:[{op:1,n:{s:.01,d:9999,c:.001,xp:3}},{op:1,n:{s:.009,d:9999,c:.001,xp:3}},{op:1,n:{s:.008,d:9999,c:.001,xp:3}},{op:1,n:{s:.007,d:9999,c:.001,xp:3}},{op:1,n:{s:.006,d:9999,c:.001,xp:3}},{op:1,n:{s:.005,d:9999,c:.001,xp:3}}]}),"Forest"==N&&(ess={c:{r:{o:-16,e:96},g:{o:-16,e:96},b:{o:16,e:-96}},l:[{st:{x:.002,y:-.014},op:.4,sc:1},{st:{x:-.001,y:-.012},op:.4,sc:1},{c:{r:{o:96,e:8},g:{o:128,e:8},b:{o:32,e:8}},st:{y:-.05},op:.3,n:{s:.02,d:1024,c:.006,xp:1}}]}),"Life"==N&&(ess={st:{x:-.006},c:{r:{o:-6,e:12},g:{o:-48,e:128},b:{o:-6,e:12}},l:[{op:.1,n:{s:.06,d:32,c:.03,xp:1}},{op:.3,n:{s:.03,d:32,c:.05,xp:2}},{op:.5,n:{s:.02,d:32,c:.07,xp:3}}]}),"Swamp"==N&&(ess={l:[{c:{r:{o:-192},b:{o:32,e:128}},st:{x:.005,y:.005},op:.8,sc:1},{c:{r:{o:-128,e:-64},g:{o:-64,e:128},b:{o:-64,e:-64}},op:1,n:{s:0,d:256,c:.04,xp:2}}]}),"Wildblood"==N&&(ess={c:{r:{o:128,e:128},g:{o:-64,e:32},b:{o:-64,e:32}},l:[{op:.3,n:{s:.002,d:64,c:.075,xp:1}},{op:.3,n:{s:.003,d:64,c:.015,xp:2}},{op:.3,n:{s:.004,d:64,c:.0023,xp:3}}]}),"Soul"==N&&(ess={n:{s:.25,d:128,c:.01,xp:3},l:[{c:{r:{o:200},g:{o:-100},b:{o:-100}},st:{x:-.005,y:-.015},op:1/3},{c:{r:{o:-100},g:{o:200},b:{o:-100}},st:{x:.005,y:-.015},op:1/3},{c:{r:{o:-100},g:{o:-100},b:{o:200}},st:{x:0,y:-.03},op:1/3}]}),"Magic"==N&&(ess={n:{s:.05,d:128,c:.015,xp:.5},l:[{c:{r:{o:200},b:{o:-200}},st:{x:-.02},op:1/3},{c:{r:{o:-200},g:{o:200}},st:{y:-.02},op:1/3},{c:{g:{o:-200},b:{o:200}},st:{x:.02},op:1/3}]}),"Astral"==N&&(ess={c:{r:{o:-64,e:96},g:{o:-64,e:64},b:{o:-64,e:96}},l:[{op:.33,n:{s:.003,d:512,c:.003,xp:1}},{op:.33,n:{s:.003,d:512,c:.003,xp:1}},{op:.33,n:{s:.003,d:512,c:.003,xp:1}},{op:.33,n:{s:.003,d:512,c:.003,xp:1}},{op:.33,n:{s:.003,d:512,c:.003,xp:1}},{op:.33,n:{s:.003,d:512,c:.003,xp:1}}]}),"Forbidden"==N&&(ess={c:{r:{o:-64,e:32},g:{o:-64,e:32},b:{o:128,e:128}},l:[{op:.3,n:{s:.001,d:64,c:.1,xp:1}},{op:.3,n:{s:.002,d:64,c:.02,xp:2}},{op:.3,n:{s:.003,d:64,c:.003,xp:3}}]}),"Runic"==N&&(ess={st:{x:-.005,y:.025},c:{r:{o:-56,e:200},g:{o:-256},b:{o:200,e:56}},n:{noBlend:!0,s:.05,d:19,c:.019,xp:2},l:[{op:.9}]}),"Unknown"==N&&(ess={l:[{c:{a:{o:256}},st:{delay:2,x:.003},n:{s:.25,d:256,c:.01,xp:1},op:1},{c:{a:{o:-256}},st:{delay:1,y:-.006},n:{s:.5,d:256,c:.01,xp:1},op:1}]}),"Tidal"==N&&(ess={c:{r:{o:48},g:{o:48},b:{o:64}},l:[{st:{x:-.02,y:-.015},op:.25,n:{s:.025,d:44,c:.032,xp:2}},{st:{x:-.02,y:.015},op:.25,n:{s:.025,d:44,c:.032,xp:2}},{st:{x:-.04,y:-.03},op:.5,n:{s:.0125,d:44,c:.016,xp:1}},{st:{x:-.04,y:.03},op:.5,n:{s:.0125,d:44,c:.016,xp:1}}]}),"Arctic"==N&&(ess={c:{r:{o:-32,e:64},g:{o:-32,e:64},b:{o:64,e:196}},l:[{op:1,n:{s:2e-6,d:48,c:.0025,xp:1}},{op:.2,n:{s:1e-6,d:512,c:.0025,xp:1}}]}),"Storm"==N&&(ess={l:[{c:{b:{e:255}},st:{x:.04,y:.04},op:1,sc:1},{c:{b:{o:-64,e:128}},st:{x:.03,y:.03},op:1,sc:0},{c:{r:{o:64,e:8},g:{o:64,e:8},b:{o:96,e:8}},st:{x:.05,y:.05},op:.5,n:{s:.01,d:64,c:.008,xp:2}}]}),"Illuvial"==N&&(ess={c:{r:{o:48},g:{o:48},b:{o:64}},l:[{st:{x:.02,y:.025},op:.2,n:{s:.03,d:44,c:.096,xp:2}},{st:{x:.03,y:.025},op:.2,n:{s:.03,d:44,c:.096,xp:2}},{st:{x:.04,y:.05},op:.5,n:{s:.015,d:44,c:.048,xp:1}},{st:{x:.06,y:.05},op:.5,n:{s:.015,d:44,c:.048,xp:1}}]}),"Undine"==N&&(ess={l:[{c:{r:{e:64},g:{e:64},b:{o:32,e:64}},op:.5,n:{s:.01,d:4444,c:.001,xp:1}},{c:{r:{o:-16,e:-333},g:{o:-16,e:-333},b:{o:-16,e:-222}},op:1,n:{s:.008,d:222,c:1e-4,xp:3}}]}),"Mineral"==N&&(ess={l:[{c:{a:{o:-16,e:48}},op:1},{c:{a:{o:-8,e:24}},op:1}]}),"Craggy"==N&&(ess={c:{r:{o:-25,e:-45},g:{o:-35,e:-55},b:{o:-45,e:-65}},n:{s:0,d:240,c:.064,xp:.75},l:[{op:1}]}),"Dwarven"==N&&(ess={c:{r:{o:-75,e:-25},g:{o:-85,e:-35},b:{o:-95,e:-45}},n:{s:0,d:128,c:.016,xp:1},l:[{op:1}]}),"Gnomic"==N&&(ess={c:{r:{o:-25,e:-45},g:{o:-35,e:-55},b:{o:-45,e:-65}},n:{s:0,d:240,c:.0064,xp:.8},l:[{op:1}]}),"Crystal"==N&&(ess={c:{a:{o:-32,e:128}},l:[{op:1},{op:1}]}),"Sylphic"==N&&(ess={l:[{c:{a:{o:-48,e:96}},st:{x:.06},op:1},{c:{a:{o:-16,e:64}},st:{x:.03},op:1}]}),"Visceral"==N&&(ess={c:{r:{o:-48},g:{o:128},b:{o:-48}},l:[{st:{x:.09},op:.1,n:{s:.14,d:128,c:.02,xp:1}},{st:{x:.12},op:.1,n:{s:.16,d:256,c:.004,xp:2}},{st:{x:.15},op:.1,n:{s:.18,d:512,c:6e-4,xp:3}}]}),"Frosted"==N&&(ess={l:[{c:{a:{o:128}},st:{x:-.06,y:.01},op:.33},{c:{r:{o:128},g:{o:128},b:{o:255}},st:{x:-.04,y:.007},op:.33},{c:{a:{o:128,e:8}},st:{x:-.07,y:.015},op:.33,n:{s:.01,d:64,c:.008,xp:2}},{c:{a:{o:128,e:8}},st:{x:-.08,y:.016},op:.33,n:{s:.008,d:64,c:.008,xp:2}}]}),"Electric"==N&&(ess={st:{x:.002,y:-.01},c:{r:{o:-256},g:{o:200,e:56},b:{o:-56,e:200}},n:{noBlend:!0,s:.05,d:19,c:.019,xp:2},l:[{op:.9}]}),"Magnetic"==N&&(ess={l:[{c:{a:{o:-255}},st:{x:-.001,y:-.001},op:.5,n:{s:.0024,d:2,c:4,xp:6}},{c:{a:{o:255}},st:{x:.001,y:.001},op:.5,n:{s:.0018,d:2,c:4,xp:6}}]}),"Infernal"==N&&(ess={l:[{c:{r:{e:255}},st:{x:.006,y:-.03},op:1,sc:1},{c:{r:{o:-64,e:128}},st:{x:.003,y:-.015},op:1,sc:0}]}),"Molten"==N&&(ess={st:{x:.001,y:.001},c:{r:{o:200,e:56},g:{o:-128,e:256},b:{o:-256}},n:{noBlend:!0,s:0,d:20,c:.024,xp:1},l:[{op:.9}]}),"Ashen"==N&&(ess={l:[{c:{r:{o:256,e:256},g:{o:128,e:128}},op:1,n:{s:.004,d:64,c:.03,xp:4}},{c:{r:{o:-512,e:256},g:{o:-512},b:{o:-512}},op:1,n:{s:.004,d:256,c:.02,xp:1}}]}),"Draconic"==N&&(ess={st:{x:-.005,y:.025},c:{r:{o:200,e:56},g:{o:-56,e:200},b:{o:-256}},n:{noBlend:!0,s:.05,d:19,c:.019,xp:2},l:[{op:.9}]}),"Celestial"==N&&(ess={st:{x:.004,y:.002},c:{a:{o:224,e:64}},n:{s:.02,d:50,c:.032,xp:2},l:[{op:1}]}),"Night"==N&&(ess={c:{r:{o:64},g:{o:-128},b:{o:64}},l:[{st:{x:-.03},op:.4,n:{s:.03,d:256,c:.01,xp:1}},{st:{y:-.02},op:.5,n:{s:.02,d:256,c:.01,xp:1}},{st:{x:-.015},op:.6,n:{s:.015,d:256,c:.01,xp:1}}]}),"Forgotten"==N&&(ess={st:{x:.006,y:.006},c:{a:{o:-512}},n:{s:.06,d:256,c:.01,xp:1},l:[{op:1}]}),"Abyssal"==N&&(ess={c:{r:{o:32,e:-512},g:{e:-512},b:{o:96,e:-512}},l:[{st:{x:-.03},op:.8,n:{s:.03,d:32,c:.005,xp:1}},{st:{y:-.02},op:.6,n:{s:.02,d:32,c:.005,xp:1}},{st:{x:.015},op:.4,n:{s:.015,d:32,c:.005,xp:1}},{st:{y:.0125},op:.2,n:{s:.0125,d:32,c:.005,xp:1}}]}),"Evil"==N&&(ess={c:{r:{o:96,e:-512},g:{e:-512},b:{o:32,e:-512}},l:[{st:{x:.01},op:.2,n:{s:.01,d:60,c:.04,xp:1}},{st:{y:.011},op:.4,n:{s:.011,d:70,c:.03,xp:1}},{st:{x:-.012},op:.6,n:{s:.012,d:80,c:.02,xp:1}},{st:{y:-.013},op:.8,n:{s:.013,d:90,c:.01,xp:1}}]}),"Lost"==N&&(ess={c:{a:{e:-512}},l:[{st:{x:-.03},op:.5,n:{s:.03,d:200,c:.03,xp:1}},{st:{y:-.02},op:.5,n:{s:.02,d:200,c:.03,xp:1}},{st:{x:.015},op:.5,n:{s:.015,d:200,c:.03,xp:1}},{st:{y:.0125},op:.5,n:{s:.0125,d:200,c:.03,xp:1}}]}),window.onload=function(){init()};function gAD(){return{id:0,value:0,minValue:0,maxValue:1,target:1,duration:1,elapsed:0,direction:1,easing:lin,ease1:lin,ease2:lin,callback:null}}var animations=[];function animate(a){var b=a.value,c=a.target,d=a.duration,e=a.easing,f=a.callback;a.elapsed=0;var g=function(g){a.elapsed+=dt;var h=max(0,min(1,e(a.elapsed/d)));a.value=b+h*(c-b),a.elapsed>=d&&(animations.splice(g,1),f&&f())};animations.push(g)}function lin(a){return a}function eSin(a){return-(cos(PI*a)-1)/2}function rAL(a){a.direction=-a.direction,a.callback=function(){rAL(a)},0>a.direction?(a.easing=a.ease1,a.target=a.minValue):(a.easing=a.ease2,a.target=a.maxValue),animate(a)}function init(){sRO(),sS(),iD(),cEl(),rC(),lFI(),sR(),rAL(gvy),window.requestAnimationFrame(oAF)}function sRO(){HB=!!document.body;var a=HB?document.body:document.all[1];wW=max(a.clientWidth,window.innerWidth),wH=max(a.clientHeight,window.innerHeight);var b=wW>wH,c=b?wH:wW;cS=c/PC,sV=-1,pI=0,cP.length=0}function cEl(){var a=HB?document.body:document.all[1];canvas=HB?document.createElement("canvas"):document.getElementById("canvas"),ctx=canvas.getContext("2d"),HB&&a.appendChild(canvas);var b=floor(cS*PC),c=document.createElement("style");c.innerText=`canvas { width: ${b}px; height: ${b}px; image-rendering: -moz-crisp-edges; image-rendering: -webkit-crisp-edges; image-rendering: pixelated; image-rendering: crisp-edges; }`,a.appendChild(c)}function rC(){if(HB){var a=floor((wW-cS*PC)/2),b=floor((wH-cS*PC)/2);canvas.style.position="absolute",canvas.style.left=a+"px",canvas.style.top=b+"px"}canvas.width=PC,canvas.height=PC}function gC(a,b){var c=PC*cS,d=floor((b-cS*PC)/2),e=floor(PC*(a-d)/c);return e}function iVC(a){return 0<=a&&a<PC}function gX(a){return gC(a.x,wW)}function gY(a){return gC(a.y,wH)}function pFE(a){if(iPt){var b=gX(a),c=gY(a);if(iVC(b)&&iVC(c)){var d=iEs?0:pB;if(iBx&&bxS){var e=gX(bxS),f=gY(bxS);if(iVC(e)&&iVC(f)){for(var g=b<e?b:e,h=c<f?c:f,i=b<e?e:b,j=c<f?f:c,k=g;k<=i;k++)for(var l=h;l<=j;l++)pP[k][l]=d;return}}pP[b][c]=d}}}function lFI(){document.addEventListener("keydown",a=>{var b=a.key;"Shift"===b&&(iEs=!0)," "===b&&(iBx=!0)},!1),document.addEventListener("keyup",a=>{var b=a.key,c=+b,d=a.ctrlKey;if(!isNaN(c))if(d)for(var e=0;e<PC;e++)for(var f=0;f<PC;f++)pP[e][f]=c;else" "!==b&&(pB=c);"p"===b||"P"===b?iPs=!iPs:"l"===b||"L"===b?lPP():"Shift"===b?iEs=!1:" "===b?(iBx=!1,bxS=null):void 0},!1),window.addEventListener("mousedown",a=>{iPt=!0,iBx&&null===bxS&&(bxS=a)}),window.addEventListener("mousemove",a=>pFE(a)),window.addEventListener("mouseup",a=>{pFE(a),iPt=!1,bxS=null})}function lPP(){for(var a=[],b=0;b<PC;b++){for(var c=0;c<PC;c++)a.push(pP[c][b]);b<PC-1&&a.push(",")}var d="["+a.join("")+"]";console.log(d),cGD(d)}function cGD(a){var b=HB?document.body:document.all[1],c=document.createElement("input");c.className="clipboard",b.appendChild(c),c.value=a,c.select(),document.execCommand("copy"),b.removeChild(c)}function oAF(a){dt=a-pvT,dt>MT?dt=MT:0>dt&&(dt=0),iPs&&(dt=0),sV=-1,pI=0,cP.length=0,wSE+=dt,sS(),sR();for(var b=animations.length,c=b-1;0<=c;c--)animations[c](c);pvT=a,window.requestAnimationFrame(oAF)}function sS(){s=0,t=0;var a=Uint32Array.from([0,1,s=t=2,3].map(function(a){return parseInt(H.substr(11*a+2,11),16)}));rm=function(){return t=a[3],a[3]=a[2],a[2]=a[1],a[1]=s=a[0],t^=t<<11,a[0]^=t^t>>>8^s>>>19,a[0]/4294967296}}function iD(){null===gvy&&(gvy=gAD(),gvy.value=gv,gvy.minValue=gv/2,gvy.maxValue=2*gv,gvy.duration=1750*(sp+2),gvy.ease1=eSin,gvy.ease2=eSin)}function sCl(){var a=P.slice();wS.length=0,wST=0;for(var b=0;b<cPC;b++){var c=gCP(),d=a[b],e=parseInt(d,16);c.r=255&e>>16,c.g=255&e>>8,c.b=255&e,pPt(c),c.weight=pow(gvy.value,5-b),wS.push(c.weight),wST+=c.weight,cP.push(c)}var f=wS[cPC-1],g=2e3*sp;wST-=cPC*f;for(var b=0;b<cPC;b++){var c=cP[b],h=wSE+.5*g*b/(cPC-1),j=cos(TAU*(h%g)/g);c.weight=f+j*wST}if(2===cPC)for(var k=cP[0],l=cP[1];;){var m=l.y-k.y,n=l.x-k.x,o=m/(n||1);if(-1.2<=o&&-.8>=o)pI=0,pPt(k),pPt(l);else break}}var imgData=null,uD=Array(4*PC*PC);function sR(){iFR&&(imgData=ctx.getImageData(0,0,PC,PC),cID(imgData.data),cE());var a=imgData.data;sCl(),L2&&(cID(uD),aE(uD)),dCPG(a),0<RFOP&&aP(a,RFOP),L2?aUD(a):aE(a),aP(a,1),ctx.putImageData(imgData,0,0),iFR=!1}function cID(a){for(var b=a.length,c=0;c<b;c++)a[c]=0==(c+1)%4?255:0}function cE(){for(var c=ess.l,e=ess.st||{},f=ess.n,h=ess.c,k={o:0,e:0},l=0;l<c.length;l++){var o=c[l],p=o.st||e,q=o.n||f,u=o.c||h,v=o.op,w=u.a||k,a=u.r||w,r=u.g||w,g=u.b||w,b=a.o||0,z=a.e||0,A=r.o||0,B=r.e||0,I=g.o||0,J=g.e||0,K={oX:0,oY:0,nOf:0,data:null,nObj:null,nDp:null,config:o,nC:q,stC:p},M=4*PC*PC;if(q){M=PC*PC,p&&(0<p.x&&(K.oX=1e8),0<p.y&&(K.oY=1e8));var O=q.d;K.nObj=cN(q.c,q.xp),K.nDp=[];for(var d=0;d<O;d++){var Q;if(d<.5*O)Q=2*d/O;else{var R=d-.5*O;Q=1-2*R/O}K.nDp.push({r:b+rm()*z,g:A+rm()*B,b:I+rm()*J,a:v*Q})}}if(K.data=Array(M),q)for(var m=0;m<M;m++){var S=floor(m/PC),y=m-S*PC;K.data[m]=K.nObj.get(y,S)}else for(var m=0;m<M;m+=4)K.data[m+0]=rm()*(b+rm()*z),K.data[m+1]=rm()*(A+rm()*B),K.data[m+2]=rm()*(I+rm()*J);eL.push(K)}}function aE(a){for(var b=a.length,c=eL.length,e=0;e<c;e++){var f=eL[e],g=f.data,h=f.nObj,l=f.config,m=f.stC,n=m.x||0,o=m.y||0;if(f.oX-=dt*n,f.oY-=dt*o,h){var p=f.nC,q=f.nDp,r=p.d||2,d=p.s||0;f.nOf+=dt*d;var u=f.nOf;0>u?u=r+u%r:u>=r&&(u%=r);for(var v=0;v<b;v+=4){var w=floor(v/4),k=floor(w/PC),z=floor(w-k*PC)+f.oX;k+=f.oY;var x=h.get(z,k),A=r*x+u,B=ceil(A),I=floor(A),J=q[B%r],K=q[I%r],M=p.noBlend?1:1-(A-I),O=p.noBlend?0:1-M,Q=K.a,R=J.a;a[v]+=M*K.r*Q+O*J.r*R,a[v+1]+=M*K.g*Q+O*J.g*R,a[v+2]+=M*K.b*Q+O*J.b*R}}else{var S=f.oX,T=f.oY,U=l.op||1,W=l.sc||0,X=1-W,Z=floor(S),$=floor(T),_=ceil(S),aa=ceil(T),ba=4*Z,ca=4*PC*$,da=4*_,ea=4*PC*aa,fa=1-(S-Z),ga=1-(T-$),ha=1-fa,ia=1-ga,ja=fa*ga,ka=fa*ia,la=ha*ga,ma=ha*ia,na=ba+ca;0>na?na=b+na%b:na>=b&&(na%=b);var oa=ba+ea;0>oa?oa=b+oa%b:oa>=b&&(oa%=b);var pa=da+ca;0>pa?pa=b+pa%b:pa>=b&&(pa%=b);var qa=da+ea;0>qa?qa=b+qa%b:qa>=b&&(qa%=b);for(var v=0;v<b;v+=4){var ra=(v+na)%b,sa=(v+oa)%b,ta=(v+pa)%b,ua=(v+qa)%b,va=(X+W*rm())*U,wa=(X+W*rm())*U,xa=(X+W*rm())*U;a[v]+=va*(ja*g[ra]+ka*g[sa]+la*g[ta]+ma*g[ua]),a[v+1]+=wa*(ja*g[ra+1]+ka*g[sa+1]+la*g[ta+1]+ma*g[ua+1]),a[v+2]+=xa*(ja*g[ra+2]+ka*g[sa+2]+la*g[ta+2]+ma*g[ua+2])}}}}function aUD(a){for(var b=a.length,c=1-pxS,d=0;d<b;d+=4){var e=d,f=d+1,g=d+2;a[e]+=c*uD[e],a[f]+=c*uD[f],a[g]+=c*uD[g]}}function aP(a,c){for(var d=a.length,e=0;e<d;e+=4){var f=floor(e/4),h=floor(f/PC),i=floor(f-h*PC),j=+pP[i][h];if(j){var l=e,m=e+1,n=e+2,o=a[l],q=a[m],g=a[n],b=c*j/9,r=1-b;a[l]=r*o+b*(255-o),a[m]=r*q+b*(255-q),a[n]=r*g+b*(255-g)}}}function dCPG(a){for(var b=0,c=0;b<PC;){for(c=0;c<PC;)sGCFP(a,cP,b,c),c++;b++}}function gCP(){return{x:0,y:0,r:0,g:0,b:0,weight:1,distance:0}}function pPt(a){var b=plC[pI++];pI>=plC.length&&(pI=0);var c=-.125+.25*rm(),d=-.125+.25*rm();a.x=(b.x+c)*PC,a.y=(b.y+d)*PC}function sGCFP(a,b,d,e){sFCCP(b,d,e);for(var f=[],g=b.length,h=0;h<g;h+=2)h==g-1?f.push(b[h]):f.push(sC(b[h],b[h+1]));if(1===f.length){flipX&&(d=PC-d-1),flipY&&(e=PC-e-1);var j=4*d,k=4*(e*PC),l=k+j,m=f[0],c=l,n=l+1,o=l+2;if(L2){var p=pxS;0<+pP[d][e]&&(p=0);var q=1-p;a[c]=q*m.r+p*a[c],a[n]=q*m.g+p*a[n],a[o]=q*m.b+p*a[o]}else a[c]=m.r,a[n]=m.g,a[o]=m.b}else sGCFP(a,f,d,e)}function sFCCP(a,b,c){var d=a.length;if(L2){var e=b,f=c;flipX&&(e=PC-b-1),flipY&&(f=PC-c-1);var g=4*e,h=4*(f*PC),j=h+g,k=3,l=3,m=3,n=uD[j]-127.5,o=uD[j+1]-127.5,p=uD[j+2]-127.5;150>C?(n=abs(n)*n*DLO,o=abs(o)*o*DLO,p=abs(p)*p*DLO):850>C?(n=DMD*cos(TS*n),o=DMD*cos(TS*o),p=DMD*cos(TS*p)):(k=1+floor(abs((n+127.5)/DHI)),l=1+floor(abs((o+127.5)/DHI)),m=1+floor(abs((p+127.5)/DHI)),n=0,o=0,p=0);for(var q=0;q<d;q++){var r=a[q],u=r.x,v=r.y;r.distance=gDE(b,c,u,v,3),r.rd=gDE(b,c,u,v,k)+n,r.gd=gDE(b,c,u,v,l)+o,r.bd=gDE(b,c,u,v,m)+p}}else for(var r,q=0;q<d;q++)r=a[q],r.distance=gDE(b,c,r.x,r.y,3);a.sort(sM)}function gDE(a,b,c,d,e){return pow(c-a,e)+pow(d-b,e)}function sC(a,b){var c=gCP(),d=a.r,e=a.g,f=a.b,g=b.r,h=b.g,i=b.b,j=a.weight,k=b.weight,l=g-d,m=h-e,n=i-f;if(L2){var o=a.rd*j,p=b.rd*k,q=a.gd*j,r=b.gd*k,u=a.bd*j,v=b.bd*k;c.x=(a.x+b.x)/2,c.y=(a.y+b.y)/2,c.r=p/(o+p)*l+d,c.g=r/(q+r)*m+e,c.b=v/(u+v)*n+f,c.weight=(j+k)/2}else{var w=a.distance*j,x=b.distance*k,y=x/(w+x);c.x=(a.x+b.x)/2,c.y=(a.y+b.y)/2,c.r=y*l+d,c.g=y*m+e,c.b=y*n+f,c.weight=(j+k)/2}return c}function cN(a,b){a=a||1,b=b||1;for(var c=[],d=function(a,b,c){return b*a[0]+c*a[1]},e=sqrt(3),f=[[1,1,0],[-1,1,0],[1,-1,0],[-1,-1,0],[1,0,1],[-1,0,1],[1,0,-1],[-1,0,-1],[0,1,1],[0,-1,1],[0,1,-1],[0,-1,-1]],g=[],h=0;256>h;h++)g[h]=0|256*rm();for(var h=0;512>h;h++)c[h]=g[255&h];return{get:function(g,h){g*=a,h*=a;var k,l,m,n,o,p=(e-1)/2*(g+h),q=0|g+p,i=0|h+p,j=(3-e)/6,r=j*(q+i),u=g-(q-r),v=h-(i-r);u>v?(n=1,o=0):(n=0,o=1);var w=u-n+j,z=v-o+j,A=u-1+2*j,B=v-1+2*j,I=255&q,J=255&i,K=c[I+c[J]]%12,M=c[I+n+c[J+o]]%12,O=c[I+1+c[J+1]]%12,Q=.5-u*u-v*v;0>Q?k=0:(Q*=Q,k=Q*Q*d(f[K],u,v));var R=.5-w*w-z*z;0>R?l=0:(R*=R,l=R*R*d(f[M],w,z));var S=.5-A*A-B*B;0>S?m=0:(S*=S,m=S*S*d(f[O],A,B));var T=(70*(k+l+m)+1)/2;return 1!==b&&(T=pow(T,b)),T}}}'; function getScript() public pure returns (string memory) { return SCRIPT; } }
// SPDX-License-Identifier: Unlicense pragma solidity ^0.8.4; import '@openzeppelin/contracts/access/Ownable.sol'; import './TRColors.sol'; interface ITRRolls { struct RelicInfo { string element; string palette; string essence; uint256 colorCount; string style; string speed; string gravity; string display; string relicType; string glyphType; uint256 runeflux; uint256 corruption; uint256 grailId; uint256[] grailGlyph; } function getRelicInfo(TRKeys.RuneCore memory core) external view returns (RelicInfo memory); function getElement(TRKeys.RuneCore memory core) external view returns (string memory); function getPalette(TRKeys.RuneCore memory core) external view returns (string memory); function getEssence(TRKeys.RuneCore memory core) external view returns (string memory); function getStyle(TRKeys.RuneCore memory core) external view returns (string memory); function getSpeed(TRKeys.RuneCore memory core) external view returns (string memory); function getGravity(TRKeys.RuneCore memory core) external view returns (string memory); function getDisplay(TRKeys.RuneCore memory core) external view returns (string memory); function getColorCount(TRKeys.RuneCore memory core) external view returns (uint256); function getColorByIndex(TRKeys.RuneCore memory core, uint256 index) external view returns (string memory); function getRelicType(TRKeys.RuneCore memory core) external view returns (string memory); function getGlyphType(TRKeys.RuneCore memory core) external view returns (string memory); function getRuneflux(TRKeys.RuneCore memory core) external view returns (uint256); function getCorruption(TRKeys.RuneCore memory core) external view returns (uint256); function getDescription(TRKeys.RuneCore memory core) external view returns (string memory); function getGrailId(TRKeys.RuneCore memory core) external pure returns (uint256); } /// @notice The Reliquary Rarity Distribution contract TRRolls is Ownable, ITRRolls { mapping(uint256 => address) public grailContracts; error GrailsAreImmutable(); constructor() Ownable() {} function getRelicInfo(TRKeys.RuneCore memory core) override public view returns (RelicInfo memory) { RelicInfo memory info; info.element = getElement(core); info.palette = getPalette(core); info.essence = getEssence(core); info.colorCount = getColorCount(core); info.style = getStyle(core); info.speed = getSpeed(core); info.gravity = getGravity(core); info.display = getDisplay(core); info.relicType = getRelicType(core); info.glyphType = getGlyphType(core); info.runeflux = getRuneflux(core); info.corruption = getCorruption(core); info.grailId = getGrailId(core); if (info.grailId != TRKeys.GRAIL_ID_NONE) { info.grailGlyph = Grail(grailContracts[info.grailId]).getGlyph(); } return info; } function getElement(TRKeys.RuneCore memory core) override public view returns (string memory) { uint256 grailId = getGrailId(core); if (grailId != TRKeys.GRAIL_ID_NONE) { return Grail(grailContracts[grailId]).getElement(); } if (bytes(core.transmutation).length > 0) { return core.transmutation; } uint256 roll = roll1000(core, TRKeys.ROLL_ELEMENT); if (roll <= uint256(125)) { return TRKeys.ELEM_NATURE; } else if (roll <= uint256(250)) { return TRKeys.ELEM_LIGHT; } else if (roll <= uint256(375)) { return TRKeys.ELEM_WATER; } else if (roll <= uint256(500)) { return TRKeys.ELEM_EARTH; } else if (roll <= uint256(625)) { return TRKeys.ELEM_WIND; } else if (roll <= uint256(750)) { return TRKeys.ELEM_ARCANE; } else if (roll <= uint256(875)) { return TRKeys.ELEM_SHADOW; } else { return TRKeys.ELEM_FIRE; } } function getPalette(TRKeys.RuneCore memory core) override public view returns (string memory) { uint256 grailId = getGrailId(core); if (grailId != TRKeys.GRAIL_ID_NONE) { return Grail(grailContracts[grailId]).getPalette(); } if (core.colors.length > 0) { return TRKeys.ANY_PAL_CUSTOM; } string memory element = getElement(core); uint256 roll = roll1000(core, TRKeys.ROLL_PALETTE); if (TRUtils.compare(element, TRKeys.ELEM_NATURE)) { return getNaturePalette(roll); } else if (TRUtils.compare(element, TRKeys.ELEM_LIGHT)) { return getLightPalette(roll); } else if (TRUtils.compare(element, TRKeys.ELEM_WATER)) { return getWaterPalette(roll); } else if (TRUtils.compare(element, TRKeys.ELEM_EARTH)) { return getEarthPalette(roll); } else if (TRUtils.compare(element, TRKeys.ELEM_WIND)) { return getWindPalette(roll); } else if (TRUtils.compare(element, TRKeys.ELEM_ARCANE)) { return getArcanePalette(roll); } else if (TRUtils.compare(element, TRKeys.ELEM_SHADOW)) { return getShadowPalette(roll); } else { return getFirePalette(roll); } } function getNaturePalette(uint256 roll) public pure returns (string memory) { if (roll <= 600) { return TRKeys.NAT_PAL_JUNGLE; } else if (roll <= 900) { return TRKeys.NAT_PAL_CAMOUFLAGE; } else { return TRKeys.NAT_PAL_BIOLUMINESCENCE; } } function getLightPalette(uint256 roll) public pure returns (string memory) { if (roll <= 600) { return TRKeys.LIG_PAL_PASTEL; } else if (roll <= 900) { return TRKeys.LIG_PAL_INFRARED; } else { return TRKeys.LIG_PAL_ULTRAVIOLET; } } function getWaterPalette(uint256 roll) public pure returns (string memory) { if (roll <= 600) { return TRKeys.WAT_PAL_FROZEN; } else if (roll <= 900) { return TRKeys.WAT_PAL_DAWN; } else { return TRKeys.WAT_PAL_OPALESCENT; } } function getEarthPalette(uint256 roll) public pure returns (string memory) { if (roll <= 600) { return TRKeys.EAR_PAL_COAL; } else if (roll <= 900) { return TRKeys.EAR_PAL_SILVER; } else { return TRKeys.EAR_PAL_GOLD; } } function getWindPalette(uint256 roll) public pure returns (string memory) { if (roll <= 600) { return TRKeys.WIN_PAL_BERRY; } else if (roll <= 900) { return TRKeys.WIN_PAL_THUNDER; } else { return TRKeys.WIN_PAL_AERO; } } function getArcanePalette(uint256 roll) public pure returns (string memory) { if (roll <= 600) { return TRKeys.ARC_PAL_FROSTFIRE; } else if (roll <= 900) { return TRKeys.ARC_PAL_COSMIC; } else { return TRKeys.ARC_PAL_COLORLESS; } } function getShadowPalette(uint256 roll) public pure returns (string memory) { if (roll <= 600) { return TRKeys.SHA_PAL_DARKNESS; } else if (roll <= 900) { return TRKeys.SHA_PAL_VOID; } else { return TRKeys.SHA_PAL_UNDEAD; } } function getFirePalette(uint256 roll) public pure returns (string memory) { if (roll <= 600) { return TRKeys.FIR_PAL_HEAT; } else if (roll <= 900) { return TRKeys.FIR_PAL_EMBER; } else { return TRKeys.FIR_PAL_CORRUPTED; } } function getEssence(TRKeys.RuneCore memory core) override public view returns (string memory) { uint256 grailId = getGrailId(core); if (grailId != TRKeys.GRAIL_ID_NONE) { return Grail(grailContracts[grailId]).getEssence(); } string memory element = getElement(core); string memory relicType = getRelicType(core); if (TRUtils.compare(element, TRKeys.ELEM_NATURE)) { return getNatureEssence(relicType); } else if (TRUtils.compare(element, TRKeys.ELEM_LIGHT)) { return getLightEssence(relicType); } else if (TRUtils.compare(element, TRKeys.ELEM_WATER)) { return getWaterEssence(relicType); } else if (TRUtils.compare(element, TRKeys.ELEM_EARTH)) { return getEarthEssence(relicType); } else if (TRUtils.compare(element, TRKeys.ELEM_WIND)) { return getWindEssence(relicType); } else if (TRUtils.compare(element, TRKeys.ELEM_ARCANE)) { return getArcaneEssence(relicType); } else if (TRUtils.compare(element, TRKeys.ELEM_SHADOW)) { return getShadowEssence(relicType); } else { return getFireEssence(relicType); } } function getNatureEssence(string memory relicType) public pure returns (string memory) { if (TRUtils.compare(relicType, TRKeys.RELIC_TYPE_TRINKET)) { return TRKeys.NAT_ESS_FOREST; } else if (TRUtils.compare(relicType, TRKeys.RELIC_TYPE_TALISMAN)) { return TRKeys.NAT_ESS_SWAMP; } else if (TRUtils.compare(relicType, TRKeys.RELIC_TYPE_AMULET)) { return TRKeys.NAT_ESS_WILDBLOOD; } else if (TRUtils.compare(relicType, TRKeys.RELIC_TYPE_FOCUS)) { return TRKeys.NAT_ESS_LIFE; } else { return TRKeys.NAT_ESS_SOUL; } } function getLightEssence(string memory relicType) public pure returns (string memory) { if (TRUtils.compare(relicType, TRKeys.RELIC_TYPE_TRINKET)) { return TRKeys.LIG_ESS_HEAVENLY; } else if (TRUtils.compare(relicType, TRKeys.RELIC_TYPE_TALISMAN)) { return TRKeys.LIG_ESS_FAE; } else if (TRUtils.compare(relicType, TRKeys.RELIC_TYPE_AMULET)) { return TRKeys.LIG_ESS_PRISMATIC; } else if (TRUtils.compare(relicType, TRKeys.RELIC_TYPE_FOCUS)) { return TRKeys.LIG_ESS_RADIANT; } else { return TRKeys.LIG_ESS_PHOTONIC; } } function getWaterEssence(string memory relicType) public pure returns (string memory) { if (TRUtils.compare(relicType, TRKeys.RELIC_TYPE_TRINKET)) { return TRKeys.WAT_ESS_TIDAL; } else if (TRUtils.compare(relicType, TRKeys.RELIC_TYPE_TALISMAN)) { return TRKeys.WAT_ESS_ARCTIC; } else if (TRUtils.compare(relicType, TRKeys.RELIC_TYPE_AMULET)) { return TRKeys.WAT_ESS_STORM; } else if (TRUtils.compare(relicType, TRKeys.RELIC_TYPE_FOCUS)) { return TRKeys.WAT_ESS_ILLUVIAL; } else { return TRKeys.WAT_ESS_UNDINE; } } function getEarthEssence(string memory relicType) public pure returns (string memory) { if (TRUtils.compare(relicType, TRKeys.RELIC_TYPE_TRINKET)) { return TRKeys.EAR_ESS_MINERAL; } else if (TRUtils.compare(relicType, TRKeys.RELIC_TYPE_TALISMAN)) { return TRKeys.EAR_ESS_CRAGGY; } else if (TRUtils.compare(relicType, TRKeys.RELIC_TYPE_AMULET)) { return TRKeys.EAR_ESS_DWARVEN; } else if (TRUtils.compare(relicType, TRKeys.RELIC_TYPE_FOCUS)) { return TRKeys.EAR_ESS_GNOMIC; } else { return TRKeys.EAR_ESS_CRYSTAL; } } function getWindEssence(string memory relicType) public pure returns (string memory) { if (TRUtils.compare(relicType, TRKeys.RELIC_TYPE_TRINKET)) { return TRKeys.WIN_ESS_SYLPHIC; } else if (TRUtils.compare(relicType, TRKeys.RELIC_TYPE_TALISMAN)) { return TRKeys.WIN_ESS_VISCERAL; } else if (TRUtils.compare(relicType, TRKeys.RELIC_TYPE_AMULET)) { return TRKeys.WIN_ESS_FROSTED; } else if (TRUtils.compare(relicType, TRKeys.RELIC_TYPE_FOCUS)) { return TRKeys.WIN_ESS_ELECTRIC; } else { return TRKeys.WIN_ESS_MAGNETIC; } } function getArcaneEssence(string memory relicType) public pure returns (string memory) { if (TRUtils.compare(relicType, TRKeys.RELIC_TYPE_TRINKET)) { return TRKeys.ARC_ESS_MAGIC; } else if (TRUtils.compare(relicType, TRKeys.RELIC_TYPE_TALISMAN)) { return TRKeys.ARC_ESS_ASTRAL; } else if (TRUtils.compare(relicType, TRKeys.RELIC_TYPE_AMULET)) { return TRKeys.ARC_ESS_FORBIDDEN; } else if (TRUtils.compare(relicType, TRKeys.RELIC_TYPE_FOCUS)) { return TRKeys.ARC_ESS_RUNIC; } else { return TRKeys.ARC_ESS_UNKNOWN; } } function getShadowEssence(string memory relicType) public pure returns (string memory) { if (TRUtils.compare(relicType, TRKeys.RELIC_TYPE_TRINKET)) { return TRKeys.SHA_ESS_NIGHT; } else if (TRUtils.compare(relicType, TRKeys.RELIC_TYPE_TALISMAN)) { return TRKeys.SHA_ESS_FORGOTTEN; } else if (TRUtils.compare(relicType, TRKeys.RELIC_TYPE_AMULET)) { return TRKeys.SHA_ESS_ABYSSAL; } else if (TRUtils.compare(relicType, TRKeys.RELIC_TYPE_FOCUS)) { return TRKeys.SHA_ESS_EVIL; } else { return TRKeys.SHA_ESS_LOST; } } function getFireEssence(string memory relicType) public pure returns (string memory) { if (TRUtils.compare(relicType, TRKeys.RELIC_TYPE_TRINKET)) { return TRKeys.FIR_ESS_INFERNAL; } else if (TRUtils.compare(relicType, TRKeys.RELIC_TYPE_TALISMAN)) { return TRKeys.FIR_ESS_MOLTEN; } else if (TRUtils.compare(relicType, TRKeys.RELIC_TYPE_AMULET)) { return TRKeys.FIR_ESS_ASHEN; } else if (TRUtils.compare(relicType, TRKeys.RELIC_TYPE_FOCUS)) { return TRKeys.FIR_ESS_DRACONIC; } else { return TRKeys.FIR_ESS_CELESTIAL; } } function getStyle(TRKeys.RuneCore memory core) override public view returns (string memory) { uint256 grailId = getGrailId(core); if (grailId != TRKeys.GRAIL_ID_NONE) { return Grail(grailContracts[grailId]).getStyle(); } uint256 roll = roll1000(core, TRKeys.ROLL_STYLE); if (roll <= 760) { return TRKeys.STYLE_SMOOTH; } else if (roll <= 940) { return TRKeys.STYLE_SILK; } else if (roll <= 980) { return TRKeys.STYLE_PAJAMAS; } else { return TRKeys.STYLE_SKETCH; } } function getSpeed(TRKeys.RuneCore memory core) override public view returns (string memory) { uint256 grailId = getGrailId(core); if (grailId != TRKeys.GRAIL_ID_NONE) { return Grail(grailContracts[grailId]).getSpeed(); } uint256 roll = roll1000(core, TRKeys.ROLL_SPEED); if (roll <= 70) { return TRKeys.SPEED_ZEN; } else if (roll <= 260) { return TRKeys.SPEED_TRANQUIL; } else if (roll <= 760) { return TRKeys.SPEED_NORMAL; } else if (roll <= 890) { return TRKeys.SPEED_FAST; } else if (roll <= 960) { return TRKeys.SPEED_SWIFT; } else { return TRKeys.SPEED_HYPER; } } function getGravity(TRKeys.RuneCore memory core) override public view returns (string memory) { uint256 grailId = getGrailId(core); if (grailId != TRKeys.GRAIL_ID_NONE) { return Grail(grailContracts[grailId]).getGravity(); } uint256 roll = roll1000(core, TRKeys.ROLL_GRAVITY); if (roll <= 50) { return TRKeys.GRAV_LUNAR; } else if (roll <= 150) { return TRKeys.GRAV_ATMOSPHERIC; } else if (roll <= 340) { return TRKeys.GRAV_LOW; } else if (roll <= 730) { return TRKeys.GRAV_NORMAL; } else if (roll <= 920) { return TRKeys.GRAV_HIGH; } else if (roll <= 970) { return TRKeys.GRAV_MASSIVE; } else if (roll <= 995) { return TRKeys.GRAV_STELLAR; } else { return TRKeys.GRAV_GALACTIC; } } function getDisplay(TRKeys.RuneCore memory core) override public view returns (string memory) { uint256 grailId = getGrailId(core); if (grailId != TRKeys.GRAIL_ID_NONE) { return Grail(grailContracts[grailId]).getDisplay(); } uint256 roll = roll1000(core, TRKeys.ROLL_DISPLAY); if (roll <= 250) { return TRKeys.DISPLAY_NORMAL; } else if (roll <= 500) { return TRKeys.DISPLAY_MIRRORED; } else if (roll <= 750) { return TRKeys.DISPLAY_UPSIDEDOWN; } else { return TRKeys.DISPLAY_MIRROREDUPSIDEDOWN; } } function getColorCount(TRKeys.RuneCore memory core) override public view returns (uint256) { uint256 grailId = getGrailId(core); if (grailId != TRKeys.GRAIL_ID_NONE) { return Grail(grailContracts[grailId]).getColorCount(); } string memory style = getStyle(core); if (TRUtils.compare(style, TRKeys.STYLE_SILK)) { return 5; } else if (TRUtils.compare(style, TRKeys.STYLE_PAJAMAS)) { return 5; } else if (TRUtils.compare(style, TRKeys.STYLE_SKETCH)) { return 4; } uint256 roll = roll1000(core, TRKeys.ROLL_COLORCOUNT); if (roll <= 400) { return 2; } else if (roll <= 750) { return 3; } else { return 4; } } function getColorByIndex(TRKeys.RuneCore memory core, uint256 index) override public view returns (string memory) { // if the requested index exceeds the color count, return empty string if (index >= getColorCount(core)) { return ''; } // if we've imagined new colors, use them instead if (core.colors.length > index) { return TRUtils.getColorCode(core.colors[index]); } // fetch the color palette uint256[] memory colorInts; uint256 colorIntCount; (colorInts, colorIntCount) = TRColors.get(getPalette(core)); // shuffle the color palette uint256 i; uint256 temp; uint256 count = colorIntCount; while (count > 0) { string memory rollKey = string(abi.encodePacked( TRKeys.ROLL_SHUFFLE, TRUtils.toString(count) )); i = roll1000(core, rollKey) % count; temp = colorInts[--count]; colorInts[count] = colorInts[i]; colorInts[i] = temp; } // slightly adjust the RGB channels of the color to make it unique temp = getWobbledColor(core, index, colorInts[index % colorIntCount]); // return a hex code (without the #) return TRUtils.getColorCode(temp); } function getWobbledColor(TRKeys.RuneCore memory core, uint256 index, uint256 color) public pure returns (uint256) { uint256 r = (color >> uint256(16)) & uint256(255); uint256 g = (color >> uint256(8)) & uint256(255); uint256 b = color & uint256(255); string memory k = TRUtils.toString(index); uint256 dr = rollMax(core, string(abi.encodePacked(TRKeys.ROLL_RED, k))) % 8; uint256 dg = rollMax(core, string(abi.encodePacked(TRKeys.ROLL_GREEN, k))) % 8; uint256 db = rollMax(core, string(abi.encodePacked(TRKeys.ROLL_BLUE, k))) % 8; uint256 rSign = rollMax(core, string(abi.encodePacked(TRKeys.ROLL_REDSIGN, k))) % 2; uint256 gSign = rollMax(core, string(abi.encodePacked(TRKeys.ROLL_GREENSIGN, k))) % 2; uint256 bSign = rollMax(core, string(abi.encodePacked(TRKeys.ROLL_BLUESIGN, k))) % 2; if (rSign == 0) { if (r > dr) { r -= dr; } else { r = 0; } } else { if (r + dr <= 255) { r += dr; } else { r = 255; } } if (gSign == 0) { if (g > dg) { g -= dg; } else { g = 0; } } else { if (g + dg <= 255) { g += dg; } else { g = 255; } } if (bSign == 0) { if (b > db) { b -= db; } else { b = 0; } } else { if (b + db <= 255) { b += db; } else { b = 255; } } return uint256((r << uint256(16)) | (g << uint256(8)) | b); } function getRelicType(TRKeys.RuneCore memory core) override public view returns (string memory) { uint256 grailId = getGrailId(core); if (grailId != TRKeys.GRAIL_ID_NONE) { return Grail(grailContracts[grailId]).getRelicType(); } if (core.isDivinityQuestLoot) { return TRKeys.RELIC_TYPE_CURIO; } uint256 roll = roll1000(core, TRKeys.ROLL_RELICTYPE); if (roll <= 360) { return TRKeys.RELIC_TYPE_TRINKET; } else if (roll <= 620) { return TRKeys.RELIC_TYPE_TALISMAN; } else if (roll <= 820) { return TRKeys.RELIC_TYPE_AMULET; } else if (roll <= 960) { return TRKeys.RELIC_TYPE_FOCUS; } else { return TRKeys.RELIC_TYPE_CURIO; } } function getGlyphType(TRKeys.RuneCore memory core) override public pure returns (string memory) { uint256 grailId = getGrailId(core); if (grailId != TRKeys.GRAIL_ID_NONE) { return TRKeys.GLYPH_TYPE_GRAIL; } if (core.glyph.length > 0) { return TRKeys.GLYPH_TYPE_CUSTOM; } return TRKeys.GLYPH_TYPE_NONE; } function getRuneflux(TRKeys.RuneCore memory core) override public view returns (uint256) { uint256 grailId = getGrailId(core); if (grailId != TRKeys.GRAIL_ID_NONE) { return Grail(grailContracts[grailId]).getRuneflux(); } if (core.isDivinityQuestLoot) { return 700 + rollMax(core, TRKeys.ROLL_RUNEFLUX) % 300; } return roll1000(core, TRKeys.ROLL_RUNEFLUX) - 1; } function getCorruption(TRKeys.RuneCore memory core) override public view returns (uint256) { uint256 grailId = getGrailId(core); if (grailId != TRKeys.GRAIL_ID_NONE) { return Grail(grailContracts[grailId]).getCorruption(); } if (core.isDivinityQuestLoot) { return 700 + rollMax(core, TRKeys.ROLL_CORRUPTION) % 300; } return roll1000(core, TRKeys.ROLL_CORRUPTION) - 1; } function getDescription(TRKeys.RuneCore memory core) override public view returns (string memory) { uint256 grailId = getGrailId(core); if (grailId != TRKeys.GRAIL_ID_NONE) { return Grail(grailContracts[grailId]).getDescription(); } return ''; } function getGrailId(TRKeys.RuneCore memory core) override public pure returns (uint256) { uint256 grailId = TRKeys.GRAIL_ID_NONE; if (bytes(core.hiddenLeyLines).length > 0) { uint256 rollDist = TRUtils.random(core.hiddenLeyLines) ^ TRUtils.random(TRKeys.ROLL_GRAILS); uint256 digits = 1 + rollDist % TRKeys.GRAIL_DISTRIBUTION; for (uint256 i; i < TRKeys.GRAIL_COUNT; i++) { if (core.tokenId == digits + TRKeys.GRAIL_DISTRIBUTION * i) { uint256 rollShuf = TRUtils.random(core.hiddenLeyLines) ^ TRUtils.random(TRKeys.ROLL_ELEMENT); uint256 offset = rollShuf % TRKeys.GRAIL_COUNT; grailId = 1 + (i + offset) % TRKeys.GRAIL_COUNT; break; } } } return grailId; } function rollMax(TRKeys.RuneCore memory core, string memory key) internal pure returns (uint256) { string memory tokenKey = string(abi.encodePacked(key, TRUtils.toString(7 * core.tokenId))); return TRUtils.random(core.runeHash) ^ TRUtils.random(tokenKey); } function roll1000(TRKeys.RuneCore memory core, string memory key) internal pure returns (uint256) { return 1 + rollMax(core, key) % 1000; } function rollColor(TRKeys.RuneCore memory core, uint256 index) internal pure returns (uint256) { string memory k = TRUtils.toString(index); return rollMax(core, string(abi.encodePacked(TRKeys.ROLL_RANDOMCOLOR, k))) % 16777216; } function setGrailContract(uint256 grailId, address grailContract) public onlyOwner { if (grailContracts[grailId] != address(0)) revert GrailsAreImmutable(); grailContracts[grailId] = grailContract; } } abstract contract Grail { function getElement() external pure virtual returns (string memory); function getPalette() external pure virtual returns (string memory); function getEssence() external pure virtual returns (string memory); function getStyle() external pure virtual returns (string memory); function getSpeed() external pure virtual returns (string memory); function getGravity() external pure virtual returns (string memory); function getDisplay() external pure virtual returns (string memory); function getColorCount() external pure virtual returns (uint256); function getRelicType() external pure virtual returns (string memory); function getRuneflux() external pure virtual returns (uint256); function getCorruption() external pure virtual returns (uint256); function getGlyph() external pure virtual returns (uint256[] memory); function getDescription() external pure virtual returns (string memory); }
/// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import './TRKeys.sol'; /// @notice The Reliquary Color Palettes library TRColors { function get(string memory palette) public pure returns (uint256[] memory, uint256) { uint256[] memory colorInts = new uint256[](12); uint256 colorIntCount = 0; if (TRUtils.compare(palette, TRKeys.NAT_PAL_JUNGLE)) { colorInts[0] = uint256(3299866); colorInts[1] = uint256(1256965); colorInts[2] = uint256(2375731); colorInts[3] = uint256(67585); colorInts[4] = uint256(16749568); colorInts[5] = uint256(16776295); colorInts[6] = uint256(16748230); colorInts[7] = uint256(16749568); colorInts[8] = uint256(67585); colorInts[9] = uint256(2375731); colorIntCount = uint256(10); } else if (TRUtils.compare(palette, TRKeys.NAT_PAL_CAMOUFLAGE)) { colorInts[0] = uint256(10328673); colorInts[1] = uint256(6245168); colorInts[2] = uint256(2171169); colorInts[3] = uint256(4610624); colorInts[4] = uint256(5269320); colorInts[5] = uint256(4994846); colorIntCount = uint256(6); } else if (TRUtils.compare(palette, TRKeys.NAT_PAL_BIOLUMINESCENCE)) { colorInts[0] = uint256(2434341); colorInts[1] = uint256(4194315); colorInts[2] = uint256(6488209); colorInts[3] = uint256(7270568); colorInts[4] = uint256(9117400); colorInts[5] = uint256(1599944); colorIntCount = uint256(6); } else if (TRUtils.compare(palette, TRKeys.LIG_PAL_PASTEL)) { colorInts[0] = uint256(16761760); colorInts[1] = uint256(16756669); colorInts[2] = uint256(16636817); colorInts[3] = uint256(13762047); colorInts[4] = uint256(8714928); colorInts[5] = uint256(9425908); colorInts[6] = uint256(16499435); colorInts[7] = uint256(10587345); colorIntCount = uint256(8); } else if (TRUtils.compare(palette, TRKeys.LIG_PAL_INFRARED)) { colorInts[0] = uint256(16642938); colorInts[1] = uint256(16755712); colorInts[2] = uint256(15883521); colorInts[3] = uint256(13503623); colorInts[4] = uint256(8257951); colorInts[5] = uint256(327783); colorInts[6] = uint256(13503623); colorInts[7] = uint256(15883521); colorIntCount = uint256(8); } else if (TRUtils.compare(palette, TRKeys.LIG_PAL_ULTRAVIOLET)) { colorInts[0] = uint256(14200063); colorInts[1] = uint256(5046460); colorInts[2] = uint256(16775167); colorInts[3] = uint256(16024318); colorInts[4] = uint256(11665662); colorInts[5] = uint256(1507410); colorIntCount = uint256(6); } else if (TRUtils.compare(palette, TRKeys.WAT_PAL_FROZEN)) { colorInts[0] = uint256(13034750); colorInts[1] = uint256(4102128); colorInts[2] = uint256(826589); colorInts[3] = uint256(346764); colorInts[4] = uint256(6707); colorInts[5] = uint256(1277652); colorIntCount = uint256(6); } else if (TRUtils.compare(palette, TRKeys.WAT_PAL_DAWN)) { colorInts[0] = uint256(334699); colorInts[1] = uint256(610965); colorInts[2] = uint256(5408708); colorInts[3] = uint256(16755539); colorIntCount = uint256(4); } else if (TRUtils.compare(palette, TRKeys.WAT_PAL_OPALESCENT)) { colorInts[0] = uint256(15985337); colorInts[1] = uint256(15981758); colorInts[2] = uint256(15713994); colorInts[3] = uint256(13941977); colorInts[4] = uint256(8242919); colorInts[5] = uint256(15985337); colorInts[6] = uint256(15981758); colorInts[7] = uint256(15713994); colorInts[8] = uint256(13941977); colorInts[9] = uint256(8242919); colorIntCount = uint256(10); } else if (TRUtils.compare(palette, TRKeys.EAR_PAL_COAL)) { colorInts[0] = uint256(3613475); colorInts[1] = uint256(1577233); colorInts[2] = uint256(4407359); colorInts[3] = uint256(2894892); colorIntCount = uint256(4); } else if (TRUtils.compare(palette, TRKeys.EAR_PAL_SILVER)) { colorInts[0] = uint256(16053492); colorInts[1] = uint256(15329769); colorInts[2] = uint256(10132122); colorInts[3] = uint256(6776679); colorInts[4] = uint256(3881787); colorInts[5] = uint256(1579032); colorIntCount = uint256(6); } else if (TRUtils.compare(palette, TRKeys.EAR_PAL_GOLD)) { colorInts[0] = uint256(16373583); colorInts[1] = uint256(12152866); colorInts[2] = uint256(12806164); colorInts[3] = uint256(4725765); colorInts[4] = uint256(2557441); colorIntCount = uint256(5); } else if (TRUtils.compare(palette, TRKeys.WIN_PAL_BERRY)) { colorInts[0] = uint256(5428970); colorInts[1] = uint256(13323211); colorInts[2] = uint256(15385745); colorInts[3] = uint256(13355851); colorInts[4] = uint256(15356630); colorInts[5] = uint256(14903600); colorIntCount = uint256(6); } else if (TRUtils.compare(palette, TRKeys.WIN_PAL_THUNDER)) { colorInts[0] = uint256(924722); colorInts[1] = uint256(9464002); colorInts[2] = uint256(470093); colorInts[3] = uint256(6378394); colorInts[4] = uint256(16246484); colorInts[5] = uint256(12114921); colorIntCount = uint256(6); } else if (TRUtils.compare(palette, TRKeys.WIN_PAL_AERO)) { colorInts[0] = uint256(4609); colorInts[1] = uint256(803087); colorInts[2] = uint256(2062109); colorInts[3] = uint256(11009906); colorIntCount = uint256(4); } else if (TRUtils.compare(palette, TRKeys.ARC_PAL_FROSTFIRE)) { colorInts[0] = uint256(16772570); colorInts[1] = uint256(4043519); colorInts[2] = uint256(16758832); colorInts[3] = uint256(16720962); colorIntCount = uint256(4); } else if (TRUtils.compare(palette, TRKeys.ARC_PAL_COSMIC)) { colorInts[0] = uint256(1182264); colorInts[1] = uint256(10834562); colorInts[2] = uint256(4269159); colorInts[3] = uint256(16769495); colorInts[4] = uint256(3351916); colorInts[5] = uint256(12612224); colorIntCount = uint256(6); } else if (TRUtils.compare(palette, TRKeys.ARC_PAL_COLORLESS)) { colorInts[0] = uint256(1644825); colorInts[1] = uint256(15132390); colorIntCount = uint256(2); } else if (TRUtils.compare(palette, TRKeys.SHA_PAL_DARKNESS)) { colorInts[0] = uint256(2885188); colorInts[1] = uint256(1572943); colorInts[2] = uint256(1179979); colorInts[3] = uint256(657930); colorIntCount = uint256(4); } else if (TRUtils.compare(palette, TRKeys.SHA_PAL_VOID)) { colorInts[0] = uint256(1572943); colorInts[1] = uint256(4194415); colorInts[2] = uint256(6488209); colorInts[3] = uint256(13051525); colorInts[4] = uint256(657930); colorIntCount = uint256(5); } else if (TRUtils.compare(palette, TRKeys.SHA_PAL_UNDEAD)) { colorInts[0] = uint256(3546937); colorInts[1] = uint256(50595); colorInts[2] = uint256(7511983); colorInts[3] = uint256(7563923); colorInts[4] = uint256(10535352); colorIntCount = uint256(5); } else if (TRUtils.compare(palette, TRKeys.FIR_PAL_HEAT)) { colorInts[0] = uint256(590337); colorInts[1] = uint256(12141574); colorInts[2] = uint256(15908162); colorInts[3] = uint256(6886400); colorIntCount = uint256(4); } else if (TRUtils.compare(palette, TRKeys.FIR_PAL_EMBER)) { colorInts[0] = uint256(1180162); colorInts[1] = uint256(7929858); colorInts[2] = uint256(7012357); colorInts[3] = uint256(16744737); colorIntCount = uint256(4); } else { colorInts[0] = uint256(197391); colorInts[1] = uint256(3604610); colorInts[2] = uint256(6553778); colorInts[3] = uint256(14305728); colorIntCount = uint256(4); } return (colorInts, colorIntCount); } }
// SPDX-License-Identifier: Unlicense pragma solidity ^0.8.4; import './TRUtils.sol'; /// @notice The Reliquary Constants library TRKeys { struct RuneCore { uint256 tokenId; uint8 level; uint32 mana; bool isDivinityQuestLoot; bool isSecretDiscovered; uint8 secretsDiscovered; uint256 runeCode; string runeHash; string transmutation; address credit; uint256[] glyph; uint24[] colors; address metadataAddress; string hiddenLeyLines; } uint256 public constant FIRST_OPEN_VIBES_ID = 7778; address public constant VIBES_GENESIS = 0x6c7C97CaFf156473F6C9836522AE6e1d6448Abe7; address public constant VIBES_OPEN = 0xF3FCd0F025c21F087dbEB754516D2AD8279140Fc; uint8 public constant CURIO_SUPPLY = 64; uint256 public constant CURIO_TITHE = 80000000000000000; // 0.08 ETH uint32 public constant MANA_PER_YEAR = 100; uint32 public constant MANA_PER_YEAR_LV2 = 150; uint32 public constant SECONDS_PER_YEAR = 31536000; uint32 public constant MANA_FROM_REVELATION = 50; uint32 public constant MANA_FROM_DIVINATION = 50; uint32 public constant MANA_FROM_VIBRATION = 100; uint32 public constant MANA_COST_TO_UPGRADE = 150; uint256 public constant RELIC_SIZE = 64; uint256 public constant RELIC_SUPPLY = 1047; uint256 public constant TOTAL_SUPPLY = CURIO_SUPPLY + RELIC_SUPPLY; uint256 public constant RELIC_TITHE = 150000000000000000; // 0.15 ETH uint256 public constant INVENTORY_CAPACITY = 10; uint256 public constant BYTES_PER_RELICHASH = 3; uint256 public constant BYTES_PER_BLOCKHASH = 32; uint256 public constant HALF_POSSIBILITY_SPACE = (16**6) / 2; bytes32 public constant RELICHASH_MASK = 0x0000000000000000000000000000000000000000000000000000000000ffffff; uint256 public constant RELIC_DISCOUNT_GENESIS = 120000000000000000; // 0.12 ETH uint256 public constant RELIC_DISCOUNT_OPEN = 50000000000000000; // 0.05 ETH uint256 public constant RELIQUARY_CHAMBER_OUTSIDE = 0; uint256 public constant RELIQUARY_CHAMBER_GUARDIANS_HALL = 1; uint256 public constant RELIQUARY_CHAMBER_INNER_SANCTUM = 2; uint256 public constant RELIQUARY_CHAMBER_DIVINITYS_END = 3; uint256 public constant RELIQUARY_CHAMBER_CHAMPIONS_VAULT = 4; uint256 public constant ELEMENTAL_GUARDIAN_DNA = 88888888; uint256 public constant GRAIL_ID_NONE = 0; uint256 public constant GRAIL_ID_NATURE = 1; uint256 public constant GRAIL_ID_LIGHT = 2; uint256 public constant GRAIL_ID_WATER = 3; uint256 public constant GRAIL_ID_EARTH = 4; uint256 public constant GRAIL_ID_WIND = 5; uint256 public constant GRAIL_ID_ARCANE = 6; uint256 public constant GRAIL_ID_SHADOW = 7; uint256 public constant GRAIL_ID_FIRE = 8; uint256 public constant GRAIL_COUNT = 8; uint256 public constant GRAIL_DISTRIBUTION = 100; uint8 public constant SECRETS_OF_THE_GRAIL = 128; uint8 public constant MODE_TRANSMUTE_ELEMENT = 1; uint8 public constant MODE_CREATE_GLYPH = 2; uint8 public constant MODE_IMAGINE_COLORS = 3; uint256 public constant MAX_COLOR_INTS = 10; string public constant ROLL_ELEMENT = 'ELEMENT'; string public constant ROLL_PALETTE = 'PALETTE'; string public constant ROLL_SHUFFLE = 'SHUFFLE'; string public constant ROLL_RED = 'RED'; string public constant ROLL_GREEN = 'GREEN'; string public constant ROLL_BLUE = 'BLUE'; string public constant ROLL_REDSIGN = 'REDSIGN'; string public constant ROLL_GREENSIGN = 'GREENSIGN'; string public constant ROLL_BLUESIGN = 'BLUESIGN'; string public constant ROLL_RANDOMCOLOR = 'RANDOMCOLOR'; string public constant ROLL_RELICTYPE = 'RELICTYPE'; string public constant ROLL_STYLE = 'STYLE'; string public constant ROLL_COLORCOUNT = 'COLORCOUNT'; string public constant ROLL_SPEED = 'SPEED'; string public constant ROLL_GRAVITY = 'GRAVITY'; string public constant ROLL_DISPLAY = 'DISPLAY'; string public constant ROLL_GRAILS = 'GRAILS'; string public constant ROLL_RUNEFLUX = 'RUNEFLUX'; string public constant ROLL_CORRUPTION = 'CORRUPTION'; string public constant RELIC_TYPE_GRAIL = 'Grail'; string public constant RELIC_TYPE_CURIO = 'Curio'; string public constant RELIC_TYPE_FOCUS = 'Focus'; string public constant RELIC_TYPE_AMULET = 'Amulet'; string public constant RELIC_TYPE_TALISMAN = 'Talisman'; string public constant RELIC_TYPE_TRINKET = 'Trinket'; string public constant GLYPH_TYPE_GRAIL = 'Origin'; string public constant GLYPH_TYPE_CUSTOM = 'Divine'; string public constant GLYPH_TYPE_NONE = 'None'; string public constant ELEM_NATURE = 'Nature'; string public constant ELEM_LIGHT = 'Light'; string public constant ELEM_WATER = 'Water'; string public constant ELEM_EARTH = 'Earth'; string public constant ELEM_WIND = 'Wind'; string public constant ELEM_ARCANE = 'Arcane'; string public constant ELEM_SHADOW = 'Shadow'; string public constant ELEM_FIRE = 'Fire'; string public constant ANY_PAL_CUSTOM = 'Divine'; string public constant NAT_PAL_JUNGLE = 'Jungle'; string public constant NAT_PAL_CAMOUFLAGE = 'Camouflage'; string public constant NAT_PAL_BIOLUMINESCENCE = 'Bioluminescence'; string public constant NAT_ESS_FOREST = 'Forest'; string public constant NAT_ESS_LIFE = 'Life'; string public constant NAT_ESS_SWAMP = 'Swamp'; string public constant NAT_ESS_WILDBLOOD = 'Wildblood'; string public constant NAT_ESS_SOUL = 'Soul'; string public constant LIG_PAL_PASTEL = 'Pastel'; string public constant LIG_PAL_INFRARED = 'Infrared'; string public constant LIG_PAL_ULTRAVIOLET = 'Ultraviolet'; string public constant LIG_ESS_HEAVENLY = 'Heavenly'; string public constant LIG_ESS_FAE = 'Fae'; string public constant LIG_ESS_PRISMATIC = 'Prismatic'; string public constant LIG_ESS_RADIANT = 'Radiant'; string public constant LIG_ESS_PHOTONIC = 'Photonic'; string public constant WAT_PAL_FROZEN = 'Frozen'; string public constant WAT_PAL_DAWN = 'Dawn'; string public constant WAT_PAL_OPALESCENT = 'Opalescent'; string public constant WAT_ESS_TIDAL = 'Tidal'; string public constant WAT_ESS_ARCTIC = 'Arctic'; string public constant WAT_ESS_STORM = 'Storm'; string public constant WAT_ESS_ILLUVIAL = 'Illuvial'; string public constant WAT_ESS_UNDINE = 'Undine'; string public constant EAR_PAL_COAL = 'Coal'; string public constant EAR_PAL_SILVER = 'Silver'; string public constant EAR_PAL_GOLD = 'Gold'; string public constant EAR_ESS_MINERAL = 'Mineral'; string public constant EAR_ESS_CRAGGY = 'Craggy'; string public constant EAR_ESS_DWARVEN = 'Dwarven'; string public constant EAR_ESS_GNOMIC = 'Gnomic'; string public constant EAR_ESS_CRYSTAL = 'Crystal'; string public constant WIN_PAL_BERRY = 'Berry'; string public constant WIN_PAL_THUNDER = 'Thunder'; string public constant WIN_PAL_AERO = 'Aero'; string public constant WIN_ESS_SYLPHIC = 'Sylphic'; string public constant WIN_ESS_VISCERAL = 'Visceral'; string public constant WIN_ESS_FROSTED = 'Frosted'; string public constant WIN_ESS_ELECTRIC = 'Electric'; string public constant WIN_ESS_MAGNETIC = 'Magnetic'; string public constant ARC_PAL_FROSTFIRE = 'Frostfire'; string public constant ARC_PAL_COSMIC = 'Cosmic'; string public constant ARC_PAL_COLORLESS = 'Colorless'; string public constant ARC_ESS_MAGIC = 'Magic'; string public constant ARC_ESS_ASTRAL = 'Astral'; string public constant ARC_ESS_FORBIDDEN = 'Forbidden'; string public constant ARC_ESS_RUNIC = 'Runic'; string public constant ARC_ESS_UNKNOWN = 'Unknown'; string public constant SHA_PAL_DARKNESS = 'Darkness'; string public constant SHA_PAL_VOID = 'Void'; string public constant SHA_PAL_UNDEAD = 'Undead'; string public constant SHA_ESS_NIGHT = 'Night'; string public constant SHA_ESS_FORGOTTEN = 'Forgotten'; string public constant SHA_ESS_ABYSSAL = 'Abyssal'; string public constant SHA_ESS_EVIL = 'Evil'; string public constant SHA_ESS_LOST = 'Lost'; string public constant FIR_PAL_HEAT = 'Heat'; string public constant FIR_PAL_EMBER = 'Ember'; string public constant FIR_PAL_CORRUPTED = 'Corrupted'; string public constant FIR_ESS_INFERNAL = 'Infernal'; string public constant FIR_ESS_MOLTEN = 'Molten'; string public constant FIR_ESS_ASHEN = 'Ashen'; string public constant FIR_ESS_DRACONIC = 'Draconic'; string public constant FIR_ESS_CELESTIAL = 'Celestial'; string public constant STYLE_SMOOTH = 'Smooth'; string public constant STYLE_PAJAMAS = 'Pajamas'; string public constant STYLE_SILK = 'Silk'; string public constant STYLE_SKETCH = 'Sketch'; string public constant SPEED_ZEN = 'Zen'; string public constant SPEED_TRANQUIL = 'Tranquil'; string public constant SPEED_NORMAL = 'Normal'; string public constant SPEED_FAST = 'Fast'; string public constant SPEED_SWIFT = 'Swift'; string public constant SPEED_HYPER = 'Hyper'; string public constant GRAV_LUNAR = 'Lunar'; string public constant GRAV_ATMOSPHERIC = 'Atmospheric'; string public constant GRAV_LOW = 'Low'; string public constant GRAV_NORMAL = 'Normal'; string public constant GRAV_HIGH = 'High'; string public constant GRAV_MASSIVE = 'Massive'; string public constant GRAV_STELLAR = 'Stellar'; string public constant GRAV_GALACTIC = 'Galactic'; string public constant DISPLAY_NORMAL = 'Normal'; string public constant DISPLAY_MIRRORED = 'Mirrored'; string public constant DISPLAY_UPSIDEDOWN = 'UpsideDown'; string public constant DISPLAY_MIRROREDUPSIDEDOWN = 'MirroredUpsideDown'; }
// SPDX-License-Identifier: Unlicense pragma solidity ^0.8.4; /// @notice The Reliquary Utility Methods library TRUtils { function random(string memory input) public pure returns (uint256) { return uint256(keccak256(abi.encodePacked(input))); } function getColorCode(uint256 color) public pure returns (string memory) { bytes16 hexChars = '0123456789abcdef'; uint256 r1 = (color >> uint256(20)) & uint256(15); uint256 r2 = (color >> uint256(16)) & uint256(15); uint256 g1 = (color >> uint256(12)) & uint256(15); uint256 g2 = (color >> uint256(8)) & uint256(15); uint256 b1 = (color >> uint256(4)) & uint256(15); uint256 b2 = color & uint256(15); bytes memory code = new bytes(6); code[0] = hexChars[r1]; code[1] = hexChars[r2]; code[2] = hexChars[g1]; code[3] = hexChars[g2]; code[4] = hexChars[b1]; code[5] = hexChars[b2]; return string(code); } function compare(string memory a, string memory b) public pure returns (bool) { if (bytes(a).length != bytes(b).length) { return false; } else { return keccak256(bytes(a)) == keccak256(bytes(b)); } } function toString(uint256 value) public pure returns (string memory) { // Inspired by OraclizeAPI's implementation - MIT license // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol if (value == 0) { return '0'; } uint256 temp = value; uint256 digits; while (temp != 0) { digits++; temp /= 10; } bytes memory buffer = new bytes(digits); while (value != 0) { digits -= 1; buffer[digits] = bytes1(uint8(48 + uint256(value % 10))); value /= 10; } return string(buffer); } // https://ethereum.stackexchange.com/a/8447 function toAsciiString(address x) public pure returns (string memory) { bytes memory s = new bytes(40); for (uint i = 0; i < 20; i++) { bytes1 b = bytes1(uint8(uint(uint160(x)) / (2**(8*(19 - i))))); bytes1 hi = bytes1(uint8(b) / 16); bytes1 lo = bytes1(uint8(b) - 16 * uint8(hi)); s[2*i] = char(hi); s[2*i+1] = char(lo); } return string(s); } function char(bytes1 b) internal pure returns (bytes1 c) { if (uint8(b) < 10) return bytes1(uint8(b) + 0x30); else return bytes1(uint8(b) + 0x57); } // https://stackoverflow.com/a/69302348/424107 function toCapsHexString(uint256 i) internal pure returns (string memory) { if (i == 0) return '0'; uint j = i; uint length; while (j != 0) { length++; j = j >> 4; } uint mask = 15; bytes memory bstr = new bytes(length); uint k = length; while (i != 0) { uint curr = (i & mask); bstr[--k] = curr > 9 ? bytes1(uint8(55 + curr)) : bytes1(uint8(48 + curr)); // 55 = 65 - 10 i = i >> 4; } return string(bstr); } }
{ "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": { "contracts/TRUtils.sol": { "TRUtils": "0xfc29bbb9d6e92605291cca1d5fc24870a50b0780" } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ApprovalCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"ApprovalQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"ApprovalToCurrentOwner","type":"error"},{"inputs":[],"name":"ApproveToCaller","type":"error"},{"inputs":[],"name":"BalanceQueryForZeroAddress","type":"error"},{"inputs":[],"name":"DivinityQuestProgressionMismatch","type":"error"},{"inputs":[],"name":"GrailsAreUnalterable","type":"error"},{"inputs":[],"name":"IncorrectElementalWeakness","type":"error"},{"inputs":[],"name":"IncorrectInnerDemonElement","type":"error"},{"inputs":[],"name":"IncorrectWhispers","type":"error"},{"inputs":[{"internalType":"uint256","name":"_size","type":"uint256"},{"internalType":"uint256","name":"_start","type":"uint256"},{"internalType":"uint256","name":"_end","type":"uint256"}],"name":"InvalidCodeAtRange","type":"error"},{"inputs":[],"name":"InvalidCustomization","type":"error"},{"inputs":[],"name":"InvalidElement","type":"error"},{"inputs":[],"name":"InvalidTokenId","type":"error"},{"inputs":[],"name":"MetadataNumberTooHigh","type":"error"},{"inputs":[],"name":"MetadataNumberTooLow","type":"error"},{"inputs":[],"name":"MintToZeroAddress","type":"error"},{"inputs":[],"name":"MintZeroQuantity","type":"error"},{"inputs":[],"name":"MissingInscription","type":"error"},{"inputs":[],"name":"MissingMetadata","type":"error"},{"inputs":[],"name":"NoAdvancedSpellcastingContracts","type":"error"},{"inputs":[],"name":"NoAetherRemainingUseMintInstead","type":"error"},{"inputs":[],"name":"NoSecretsLeftToReveal","type":"error"},{"inputs":[],"name":"NotApprovedCreatorOrOwner","type":"error"},{"inputs":[],"name":"NotEnoughAether","type":"error"},{"inputs":[],"name":"NotEnoughMana","type":"error"},{"inputs":[],"name":"NotEntrustedOrInYourPossession","type":"error"},{"inputs":[],"name":"NotMetadataApprovedOrOwner","type":"error"},{"inputs":[],"name":"OnlyBurnsVibes","type":"error"},{"inputs":[],"name":"OutOfCurios","type":"error"},{"inputs":[],"name":"OutOfRelics","type":"error"},{"inputs":[],"name":"OwnerQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"RelicAlreadyAtMaxLevel","type":"error"},{"inputs":[],"name":"RelicAlreadyWellStudied","type":"error"},{"inputs":[],"name":"ReliquaryAlreadySealed","type":"error"},{"inputs":[],"name":"ReliquaryNotDiscovered","type":"error"},{"inputs":[],"name":"TransferCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"TransferFromIncorrectOwner","type":"error"},{"inputs":[],"name":"TransferToNonERC721ReceiverImplementer","type":"error"},{"inputs":[],"name":"TransferToZeroAddress","type":"error"},{"inputs":[],"name":"UnableToCarrySoManyAtOnce","type":"error"},{"inputs":[],"name":"WriteError","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"RelicUpdate","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"stateMutability":"payable","type":"fallback"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"adventurers","outputs":[{"internalType":"uint256","name":"currentChamber","type":"uint256"},{"internalType":"uint256","name":"aether","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"creator","type":"address"}],"name":"authorizeCreator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"calculateVibesDiscount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"attackElement","type":"string"}],"name":"challengeElementalGuardians","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"innerDemonElement","type":"string"},{"internalType":"string","name":"attackElement","type":"string"}],"name":"challengeInnerDemon","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"clearMetadataNumber","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint32","name":"manaCost","type":"uint32"}],"name":"consumeMana","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256[]","name":"glyph","type":"uint256[]"},{"internalType":"uint256","name":"burnVibeId","type":"uint256"}],"name":"createGlyph","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"id","type":"address"}],"name":"detectDemons","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"element","type":"string"}],"name":"detectElementalWeakness","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"string","name":"previousHash","type":"string"}],"name":"detectElementals","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getColorByIndex","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getColorCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getElement","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getGrailId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getLevel","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getMana","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getMetadataAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getRuneCode","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getRuneCore","outputs":[{"components":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint8","name":"level","type":"uint8"},{"internalType":"uint32","name":"mana","type":"uint32"},{"internalType":"bool","name":"isDivinityQuestLoot","type":"bool"},{"internalType":"bool","name":"isSecretDiscovered","type":"bool"},{"internalType":"uint8","name":"secretsDiscovered","type":"uint8"},{"internalType":"uint256","name":"runeCode","type":"uint256"},{"internalType":"string","name":"runeHash","type":"string"},{"internalType":"string","name":"transmutation","type":"string"},{"internalType":"address","name":"credit","type":"address"},{"internalType":"uint256[]","name":"glyph","type":"uint256[]"},{"internalType":"uint24[]","name":"colors","type":"uint24[]"},{"internalType":"address","name":"metadataAddress","type":"address"},{"internalType":"string","name":"hiddenLeyLines","type":"string"}],"internalType":"struct TRKeys.RuneCore","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getRuneHash","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint24[]","name":"colors","type":"uint24[]"},{"internalType":"uint256","name":"burnVibeId","type":"uint256"}],"name":"imagineColors","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"inscription","type":"string"}],"name":"inscribeRunicSeal","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"metadataAddressList","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"metadataOverrides","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"mintCount","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"mintDivineCurio","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"mintCount","type":"uint256"}],"name":"mintWithVibesDiscount","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"relics","outputs":[{"internalType":"uint8","name":"level","type":"uint8"},{"internalType":"uint32","name":"mana","type":"uint32"},{"internalType":"bool","name":"isDivinityQuestLoot","type":"bool"},{"internalType":"bool","name":"isSecretDiscovered","type":"bool"},{"internalType":"address","name":"authorizedCreator","type":"address"},{"internalType":"address","name":"glyph","type":"address"},{"internalType":"string","name":"transmutation","type":"string"},{"internalType":"bytes32","name":"runeHash","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"seekDivineKnowledge","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"}],"name":"setMetadataAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"metadataNumber","type":"uint256"}],"name":"setMetadataNumber","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenScript","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"string","name":"element","type":"string"},{"internalType":"uint256","name":"burnVibeId","type":"uint256"}],"name":"transmuteElement","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"upgradeRelic","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"vibesAetherChanneled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"whispering","type":"string"}],"name":"whisperRunicSeal","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawAether","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]
Contract Creation Code
60806040523480156200001157600080fd5b50604080518082018252600d81526c7468652072656c69717561727960981b60208083019182528351808501909452600684526552454c49435360d01b90840152815191929183918391620000699160029162000100565b5080516200007f90600390602084019062000100565b50506001600055506200009233620000ae565b50506001600b55600c805461ffff1916610101179055620001e3565b600880546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b8280546200010e90620001a6565b90600052602060002090601f0160209004810192826200013257600085556200017d565b82601f106200014d57805160ff19168380011785556200017d565b828001600101855582156200017d579182015b828111156200017d57825182559160200191906001019062000160565b506200018b9291506200018f565b5090565b5b808211156200018b576000815560010162000190565b600181811c90821680620001bb57607f821691505b60208210811415620001dd57634e487b7160e01b600052602260045260246000fd5b50919050565b61594b80620001f36000396000f3fe60806040526004361061033e5760003560e01c8063744e94aa116101ae578063b496da8b116100eb578063ea7606121161008f578063f4f2d1411161006c578063f4f2d14114610a67578063f528d5b714610a94578063fa6b116414610ab4578063fc337bb114610ad457005b8063ea76061214610a07578063efb4e00814610a27578063f2fde38b14610a4757005b8063c87b56dd116100c8578063c87b56dd14610976578063e17b25af14610996578063e4fe2413146109b6578063e985e9c5146109be57005b8063b496da8b14610902578063b548332d14610936578063b88d4fde1461095657005b80638da5cb5b11610152578063a0712d681161012f578063a0712d681461088f578063a22cb465146108a2578063aa2773f6146108c2578063af3dbfdb146108e257005b80638da5cb5b1461081357806395d89b4114610831578063994ee5ae1461084657005b8063848909751161018b578063848909751461077c578063851bf5421461079c57806385877ecd146107cc57806386481d40146107e157005b8063744e94aa1461070757806383cdf59e1461073c5780638429ffb01461075c57005b8063201ffc121161027c5780635379522f116102205780636352211e116101fd5780636352211e1461069f5780636fac2411146106bf57806370a08231146106d2578063715018a6146106f257005b80635379522f146106325780635755669a1461065257806361c6833d1461067257005b8063394c19e211610259578063394c19e2146105b25780633a7d22bc146105d257806342842e0e146105f25780634376d1011461061257005b8063201ffc121461055257806323b872dd146105725780632b15505e1461059257005b80630924e345116102e357806311eea9c5116102c057806311eea9c5146104b6578063150b7a02146104d657806318160ddd1461050f5780631fc5727f1461053257005b80630924e34514610456578063095ea7b3146104765780630f14ef561461049657005b8063052384561161031c57806305238456146103bc57806306fdde03146103dc57806307a34b16146103fe578063081812fc1461041e57005b806287c2001461034757806301ffc9a7146103675780630396d7cd1461039c57005b3661034557005b005b34801561035357600080fd5b50610345610362366004614eb5565b610ae9565b34801561037357600080fd5b50610387610382366004614d6f565b610b35565b60405190151581526020015b60405180910390f35b3480156103a857600080fd5b506103456103b7366004614e61565b610b87565b3480156103c857600080fd5b506103456103d7366004615150565b610d01565b3480156103e857600080fd5b506103f1610dcd565b604051610393919061544b565b34801561040a57600080fd5b50610345610419366004614f64565b610e5f565b34801561042a57600080fd5b5061043e610439366004614e61565b610e74565b6040516001600160a01b039091168152602001610393565b34801561046257600080fd5b506103f1610471366004614b9d565b610eb8565b34801561048257600080fd5b50610345610491366004614d28565b610f78565b3480156104a257600080fd5b506103f16104b1366004614e61565b611006565b3480156104c257600080fd5b506103456104d1366004614da7565b61101c565b3480156104e257600080fd5b506104f66104f1366004614c7f565b61115c565b6040516001600160e01b03199091168152602001610393565b34801561051b57600080fd5b506105246112ff565b604051908152602001610393565b34801561053e57600080fd5b5061034561054d366004614da7565b61130d565b34801561055e57600080fd5b506103f161056d366004614e61565b61146c565b34801561057e57600080fd5b5061034561058d366004614c3f565b6114ad565b34801561059e57600080fd5b506103f16105ad366004614da7565b6114b8565b3480156105be57600080fd5b506103456105cd366004614e91565b6114da565b3480156105de57600080fd5b506103f16105ed366004614e61565b61153f565b3480156105fe57600080fd5b5061034561060d366004614c3f565b611580565b34801561061e57600080fd5b5061052461062d366004614e61565b61159b565b34801561063e57600080fd5b506103f161064d36600461512f565b611660565b34801561065e57600080fd5b5061034561066d366004614e61565b6116f7565b34801561067e57600080fd5b5061052461068d366004614e61565b600a6020526000908152604090205481565b3480156106ab57600080fd5b5061043e6106ba366004614e61565b61172e565b6103456106cd366004614e61565b611740565b3480156106de57600080fd5b506105246106ed366004614b9d565b611963565b3480156106fe57600080fd5b506103456119b1565b34801561071357600080fd5b50610727610722366004614e61565b6119e7565b60405163ffffffff9091168152602001610393565b34801561074857600080fd5b50610345610757366004614e0b565b611ab2565b34801561076857600080fd5b50610345610777366004614e61565b611c82565b34801561078857600080fd5b5061043e610797366004614e61565b611dd1565b3480156107a857600080fd5b506103876107b7366004614e61565b60116020526000908152604090205460ff1681565b3480156107d857600080fd5b50610524611dfb565b3480156107ed57600080fd5b506108016107fc366004614e61565b611e81565b60405160ff9091168152602001610393565b34801561081f57600080fd5b506008546001600160a01b031661043e565b34801561083d57600080fd5b506103f1611e9e565b34801561085257600080fd5b5061087a610861366004614b9d565b6010602052600090815260409020805460019091015482565b60408051928352602083019190915201610393565b61034561089d366004614e61565b611ead565b3480156108ae57600080fd5b506103456108bd366004614cfb565b611fdd565b3480156108ce57600080fd5b506103456108dd366004614da7565b612073565b3480156108ee57600080fd5b506105246108fd366004614e61565b612111565b34801561090e57600080fd5b5061092261091d366004614e61565b6121a1565b6040516103939897969594939291906155e9565b34801561094257600080fd5b506103f1610951366004614da7565b61228e565b34801561096257600080fd5b50610345610971366004614c7f565b612824565b34801561098257600080fd5b506103f1610991366004614e61565b612875565b3480156109a257600080fd5b506103456109b1366004614b9d565b6128b6565b610345612932565b3480156109ca57600080fd5b506103876109d9366004614c07565b6001600160a01b03918216600090815260076020908152604080832093909416825291909152205460ff1690565b348015610a1357600080fd5b5061043e610a22366004614e61565b612a23565b348015610a3357600080fd5b50610345610a423660046150e2565b612aa8565b348015610a5357600080fd5b50610345610a62366004614b9d565b612abc565b348015610a7357600080fd5b50610a87610a82366004614e61565b612b57565b60405161039391906155b4565b348015610aa057600080fd5b50610524610aaf366004614e61565b612e7a565b348015610ac057600080fd5b50610345610acf36600461512f565b612eba565b348015610ae057600080fd5b50610345612f35565b610af38184612fd0565b610afd83836130d3565b6040518381527f1d7dd0a2cbf0f220f58a5423e209b142181f14f4cb78ec896268af4f22f876299060200160405180910390a1505050565b60006001600160e01b031982166380ac58cd60e01b1480610b6657506001600160e01b03198216635b5e139f60e01b145b80610b8157506301ffc9a760e01b6001600160e01b03198316145b92915050565b80610b91816131c5565b610bae5760405163055d621960e01b815260040160405180910390fd5b6000610bb983612a23565b90506000816001600160a01b03166374cbaa976040518163ffffffff1660e01b815260040160206040518083038186803b158015610bf657600080fd5b505afa158015610c0a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c2e919061517c565b90506000610c3b85611e81565b90508160ff168160ff1610610c6357604051633ab816ed60e01b815260040160405180910390fd5b610c6e856096610d01565b6000858152600f602052604081208054909190610c8d9060ff16615855565b825460ff9182166101009390930a83810292021916179091556000868152600f602052604090819020805460ff1916909217909155517f1d7dd0a2cbf0f220f58a5423e209b142181f14f4cb78ec896268af4f22f8762990610cf29087815260200190565b60405180910390a15050505050565b81610d0b816131c5565b610d285760405163055d621960e01b815260040160405180910390fd5b6000610d33846119e7565b90508263ffffffff168163ffffffff161015610d6257604051636971a8f960e01b815260040160405180910390fd5b610d6c838261579d565b6000948552600f60209081526040808720805464ffffffff00191661010063ffffffff95909516949094029390931790925560049052909320805467ffffffffffffffff60a01b1916600160a01b426001600160401b031602179055505050565b606060028054610ddc90615805565b80601f0160208091040260200160405190810160405280929190818152602001828054610e0890615805565b8015610e555780601f10610e2a57610100808354040283529160200191610e55565b820191906000526020600020905b815481529060010190602001808311610e3857829003601f168201915b5050505050905090565b610e698184612fd0565b610afd838333613213565b6000610e7f82613339565b610e9c576040516333d1c03960e21b815260040160405180910390fd5b506000908152600660205260409020546001600160a01b031690565b6060610ec26148c6565b63054c56388152610edb6001600160a01b038416613372565b60e08201528051610eeb90612a23565b6001600160a01b03166101808201819052604051632df373ab60e01b8152632df373ab90610f1d9084906004016155b4565b60006040518083038186803b158015610f3557600080fd5b505afa158015610f49573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610f719190810190614dd9565b9392505050565b6000610f838261172e565b9050806001600160a01b0316836001600160a01b03161415610fb85760405163250fdee360e21b815260040160405180910390fd5b336001600160a01b03821614801590610fd85750610fd681336109d9565b155b15610ff6576040516367d9dca160e11b815260040160405180910390fd5b6110018383836133c6565b505050565b6060610b8160036110168461159b565b90613422565b600c54604060ff9091161115611045576040516330db714560e21b815260040160405180910390fd5b600c5462010000900460ff1661106e57604051639eec531f60e01b815260040160405180910390fd5b33600090815260106020526040812054801561109d57604051632628972360e01b815260040160405180910390fd5b604051633a96fdd760e01b815273fc29bbb9d6e92605291cca1d5fc24870a50b078090633a96fdd7906110d7908690600d9060040161548c565b60206040518083038186803b1580156110ef57600080fd5b505af4158015611103573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111279190614d53565b611144576040516321b7638960e21b815260040160405180910390fd5b50503360009081526010602052604090206001905550565b600c5460009062010000900460ff1661118857604051639eec531f60e01b815260040160405180910390fd5b33736c7c97caff156473f6c9836522ae6e1d6448abe7148015906111c057503373f3fcd0f025c21f087dbeb754516d2ad8279140fc14155b156111de57604051633c5573c960e21b815260040160405180910390fd5b600060608060606000868060200190518101906111fb9190614ff4565b8251939850919650945092501561121a576112168585613603565b5060015b8251156112305761122c85848c613213565b5060015b8151156112455761124185836130d3565b5060015b8061126357604051635a4521b960e01b815260040160405180910390fd5b6000858152600f60205260409020805460649190600190611290908490610100900463ffffffff166156e3565b92506101000a81548163ffffffff021916908363ffffffff1602179055507f1d7dd0a2cbf0f220f58a5423e209b142181f14f4cb78ec896268af4f22f87629856040516112df91815260200190565b60405180910390a150630a85bd0160e11b9450505050505b949350505050565b600154600054036000190190565b600c54604060ff9091161115611336576040516330db714560e21b815260040160405180910390fd5b3360009081526010602052604090205460019080821461136957604051632628972360e01b815260040160405180910390fd5b600061137f611379600143615786565b40613372565b9050600061138c826114b8565b905060006113998261228e565b604051633a96fdd760e01b815290915073fc29bbb9d6e92605291cca1d5fc24870a50b078090633a96fdd7906113d59084908a9060040161545e565b60206040518083038186803b1580156113ed57600080fd5b505af4158015611401573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114259190614d53565b6114425760405163995a375760e01b815260040160405180910390fd5b600260106000335b6001600160a01b03168152602081019190915260400160002055505050505050565b6060600061147983612b57565b61018081015160405163e13daa0d60e01b81529192506001600160a01b03169063e13daa0d90610f1d9084906004016155b4565b611001838383613c4d565b60606114c26148c6565b63054c563880825260e08201849052610eeb90612a23565b816114e4816131c5565b6115015760405163055d621960e01b815260040160405180910390fd5b506000918252600f602052604090912080546001600160a01b03909216600160381b02670100000000000000600160d81b0319909216919091179055565b6060600061154c83612b57565b610180810151604051632df373ab60e01b81529192506001600160a01b031690632df373ab90610f1d9084906004016155b4565b61100183838360405180602001604052806000815250612824565b6000818152600f602052604081206004015481905b806115e9576115be8261583a565b9150600f60006115cd8661583a565b95508581526020019081526020016000206004015490506115b0565b60006115f6600384615767565b90506020600082611608600384615786565b6116129190615786565b9050600062ffffff611625836008615767565b86901c16905080628000008110611647576116408982615786565b9050611654565b61165189826156cb565b90505b98975050505050505050565b6060600061166d84612b57565b6101808101516040516301ea9d4560e61b81529192506001600160a01b031690637aa75140906116a390849087906004016155c7565b60006040518083038186803b1580156116bb57600080fd5b505afa1580156116cf573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526112f79190810190614dd9565b611700816131c5565b61171d5760405163306c20fb60e01b815260040160405180910390fd5b6000908152600a6020526040812055565b600061173982613e6b565b5192915050565b6002600b54141561176c5760405162461bcd60e51b81526004016117639061557d565b60405180910390fd5b6002600b55600c5462010000900460ff1661179a57604051639eec531f60e01b815260040160405180910390fd5b3233146117ba5760405163f7798d3360e01b815260040160405180910390fd5b80600a8111156117dd57604051634bdda98760e11b815260040160405180910390fd5b600c54829060009060ff166117f06112ff565b6117fb9060016156cb565b6118059190615786565b905061041761181483836156cb565b111561183357604051632e57ee4960e11b815260040160405180910390fd5b600061185b736c7c97caff156473f6c9836522ae6e1d6448abe76701aa535d3d0c0000613f92565b9050600061188473f3fcd0f025c21f087dbeb754516d2ad8279140fc66b1a2bc2ec50000613f92565b336000908152601060205260408120600101549192509082906118a89085906156cb565b6118b291906156cb565b9050806118d257604051630ffe347760e21b815260040160405180910390fd5b60006118e688670214e8348c4f0000615767565b9050818110611904576118f98282615786565b905060009150611915565b61190e8183615786565b9150600090505b803410156119365760405163531cc80760e01b815260040160405180910390fd5b33600090815260106020526040902060010182905561195488614117565b50506001600b55505050505050565b60006001600160a01b03821661198c576040516323d3ad8160e21b815260040160405180910390fd5b506001600160a01b03166000908152600560205260409020546001600160401b031690565b6008546001600160a01b031633146119db5760405162461bcd60e51b815260040161176390615548565b6119e5600061414c565b565b600081815260046020526040812054600160a01b90046001600160401b031680611a2a5750506000908152600f6020526040902054610100900463ffffffff1690565b6000611a3584611e81565b9050600060028260ff1610611a4b576096611a4e565b60645b90506000611a5c8442615786565b905060006301e13380611a7563ffffffff851684615767565b611a7f9190615730565b6000888152600f6020526040902054909150611aa7908290610100900463ffffffff166156e3565b979650505050505050565b600c54604060ff9091161115611adb576040516330db714560e21b815260040160405180910390fd5b33600090815260106020526040902054600290808214611b0e57604051632628972360e01b815260040160405180910390fd5b6000611b1933610eb8565b604051633a96fdd760e01b815290915073fc29bbb9d6e92605291cca1d5fc24870a50b078090633a96fdd790611b55908490899060040161545e565b60206040518083038186803b158015611b6d57600080fd5b505af4158015611b81573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ba59190614d53565b611bc25760405163602bc0ff60e11b815260040160405180910390fd5b6000611bcd8261228e565b604051633a96fdd760e01b815290915073fc29bbb9d6e92605291cca1d5fc24870a50b078090633a96fdd790611c09908490899060040161545e565b60206040518083038186803b158015611c2157600080fd5b505af4158015611c35573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c599190614d53565b611c765760405163995a375760e01b815260040160405180910390fd5b6003601060003361144a565b80611c8c816131c5565b611ca95760405163055d621960e01b815260040160405180910390fd5b600c54608061010090910460ff161115611cd657604051637327b95360e01b815260040160405180910390fd5b6000828152600f6020526040902054600160301b900460ff1615611d0c5760405162ff8b6560e11b815260040160405180910390fd5b6000828152600f60205260409020805466ff0000000000001916600160301b1780825560329190600190611d4d90849063ffffffff610100909104166156e3565b825463ffffffff91821661010093840a9081029202191617909155600c805460ff9290049190911691506001611d8283615855565b825460ff91821661010093840a9081029083021990911617909255600c54608091900490911611159050611dcd57611db982611006565b805161100191600e91602090910190614957565b5050565b60098181548110611de157600080fd5b6000918252602090912001546001600160a01b0316905081565b600080611e24736c7c97caff156473f6c9836522ae6e1d6448abe76701aa535d3d0c000061419e565b90506000611e4d73f3fcd0f025c21f087dbeb754516d2ad8279140fc66b1a2bc2ec5000061419e565b336000908152601060205260409020600101549091508190611e709084906156cb565b611e7a91906156cb565b9250505090565b6000818152600f6020526040812054610b819060ff16600161570b565b606060038054610ddc90615805565b6002600b541415611ed05760405162461bcd60e51b81526004016117639061557d565b6002600b55600c5462010000900460ff16611efe57604051639eec531f60e01b815260040160405180910390fd5b323314611f1e5760405163f7798d3360e01b815260040160405180910390fd5b80600a811115611f4157604051634bdda98760e11b815260040160405180910390fd5b600c54829060009060ff16611f546112ff565b611f5f9060016156cb565b611f699190615786565b9050610417611f7883836156cb565b1115611f9757604051632e57ee4960e11b815260040160405180910390fd5b611fa984670214e8348c4f0000615767565b341015611fc95760405163531cc80760e01b815260040160405180910390fd5b611fd284614117565b50506001600b555050565b6001600160a01b0382163314156120075760405163b06307db60e01b815260040160405180910390fd5b3360008181526007602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b6008546001600160a01b0316331461209d5760405162461bcd60e51b815260040161176390615548565b80516120bc57604051637100025160e01b815260040160405180910390fd5b600d80546120c990615805565b1590506120e95760405163267ae94d60e21b815260040160405180910390fd5b80516120fc90600d906020840190614957565b5050600c805462ff0000191662010000179055565b60008061211d83612b57565b61018081015160405163278381d960e01b81529192506001600160a01b03169063278381d9906121519084906004016155b4565b60206040518083038186803b15801561216957600080fd5b505afa15801561217d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f719190614e79565b600f6020526000908152604090208054600182015460028301805460ff80851695610100860463ffffffff1695650100000000008104831695600160301b820490931694600160381b9091046001600160a01b039081169493169261220590615805565b80601f016020809104026020016040519081016040528092919081815260200182805461223190615805565b801561227e5780601f106122535761010080835404028352916020019161227e565b820191906000526020600020905b81548152906001019060200180831161226157829003601f168201915b5050505050908060040154905088565b60408051808201825260068152654e617475726560d01b60208201529051633a96fdd760e01b815260609173fc29bbb9d6e92605291cca1d5fc24870a50b078091633a96fdd7916122e49186919060040161545e565b60206040518083038186803b1580156122fc57600080fd5b505af4158015612310573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123349190614d53565b156123595750506040805180820190915260048152634669726560e01b602082015290565b6040805180820182526004808252634669726560e01b60208301529151633a96fdd760e01b815273fc29bbb9d6e92605291cca1d5fc24870a50b078092633a96fdd7926123a89287920161545e565b60206040518083038186803b1580156123c057600080fd5b505af41580156123d4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123f89190614d53565b1561241e5750506040805180820190915260058152642bb0ba32b960d91b602082015290565b60408051808201825260058152642bb0ba32b960d91b60208201529051633a96fdd760e01b815273fc29bbb9d6e92605291cca1d5fc24870a50b078091633a96fdd79161246f91869160040161545e565b60206040518083038186803b15801561248757600080fd5b505af415801561249b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124bf9190614d53565b156124e457505060408051808201909152600481526315da5b9960e21b602082015290565b60408051808201825260048082526315da5b9960e21b60208301529151633a96fdd760e01b815273fc29bbb9d6e92605291cca1d5fc24870a50b078092633a96fdd7926125339287920161545e565b60206040518083038186803b15801561254b57600080fd5b505af415801561255f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125839190614d53565b156125a957505060408051808201909152600581526408ac2e4e8d60db1b602082015290565b604080518082018252600581526408ac2e4e8d60db1b60208201529051633a96fdd760e01b815273fc29bbb9d6e92605291cca1d5fc24870a50b078091633a96fdd7916125fa91869160040161545e565b60206040518083038186803b15801561261257600080fd5b505af4158015612626573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061264a9190614d53565b156126715750506040805180820190915260068152654e617475726560d01b602082015290565b6040805180820182526006815265417263616e6560d01b60208201529051633a96fdd760e01b815273fc29bbb9d6e92605291cca1d5fc24870a50b078091633a96fdd7916126c391869160040161545e565b60206040518083038186803b1580156126db57600080fd5b505af41580156126ef573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127139190614d53565b1561273a575050604080518082019091526006815265536861646f7760d01b602082015290565b6040805180820182526006815265536861646f7760d01b60208201529051633a96fdd760e01b815273fc29bbb9d6e92605291cca1d5fc24870a50b078091633a96fdd79161278c91869160040161545e565b60206040518083038186803b1580156127a457600080fd5b505af41580156127b8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127dc9190614d53565b15612802575050604080518082019091526005815264131a59da1d60da1b602082015290565b5050604080518082019091526006815265417263616e6560d01b602082015290565b61282f848484613c4d565b6001600160a01b0383163b15158015612851575061284f84848484614300565b155b1561286f576040516368d2bf6b60e11b815260040160405180910390fd5b50505050565b6060600061288283612b57565b61018081015160405163f533450160e01b81529192506001600160a01b03169063f533450190610f1d9084906004016155b4565b6008546001600160a01b031633146128e05760405162461bcd60e51b815260040161176390615548565b600980546001810182556000919091527f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7af0180546001600160a01b0319166001600160a01b0392909216919091179055565b6002600b5414156129555760405162461bcd60e51b81526004016117639061557d565b6002600b55600c54604060ff9091161115612983576040516330db714560e21b815260040160405180910390fd5b3233146129a35760405163f7798d3360e01b815260040160405180910390fd5b336000908152601060205260409020546003908082146129d657604051632628972360e01b815260040160405180910390fd5b67011c37937e0800003410156129ff5760405163531cc80760e01b815260040160405180910390fd5b33600090815260106020526040902060049055612a1a6143f4565b50506001600b55565b60095460009080612a475760405163de4294fb60e01b815260040160405180910390fd5b6000838152600a60205260409020548015612a60578091505b6009612a6d600184615786565b81548110612a8b57634e487b7160e01b600052603260045260246000fd5b6000918252602090912001546001600160a01b0316949350505050565b612ab28184612fd0565b610afd8383613603565b6008546001600160a01b03163314612ae65760405162461bcd60e51b815260040161176390615548565b6001600160a01b038116612b4b5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401611763565b612b548161414c565b50565b612b5f6148c6565b816001811080612b755750612b726112ff565b81115b15612b93576040516307ed98ed60e31b815260040160405180910390fd5b612b9b6148c6565b838152612ba784611e81565b60ff166020820152612bb8846119e7565b63ffffffff166040820152612bcc8461159b565b60c0820152612bda84611006565b60e0820152612be884612a23565b6001600160a01b03166101808201526000848152600f6020818152604083205460ff65010000000000820481161515606087015293889052919052600160301b9004811615156080830152600c5461010090041660a0820152600e8054612c4e90615805565b80601f0160208091040260200160405190810160405280929190818152602001828054612c7a90615805565b8015612cc75780601f10612c9c57610100808354040283529160200191612cc7565b820191906000526020600020905b815481529060010190602001808311612caa57829003601f168201915b50505050506101a08201526000848152600f602052604090206002018054612cee90615805565b80601f0160208091040260200160405190810160405280929190818152602001828054612d1a90615805565b8015612d675780601f10612d3c57610100808354040283529160200191612d67565b820191906000526020600020905b815481529060010190602001808311612d4a57829003601f168201915b50505050506101008201526000848152600f602090815260409182902060030180548351818402810184019094528084529091830182828015612df357602002820191906000526020600020906000905b82829054906101000a900462ffffff1662ffffff1681526020019060030190602082600201049283019260010382029150808411612db85790505b50505050506101608201526000848152600f60205260409020600101546001600160a01b031615612e71576000848152600f60205260408120600101548190612e44906001600160a01b03166144b9565b806020019051810190612e579190614bb9565b6001600160a01b0390911661012085015261014084015250505b91505b50919050565b600080612e8683612b57565b6101808101516040516374dc81d760e01b81529192506001600160a01b0316906374dc81d7906121519084906004016155b4565b60095481612edb5760405163d16e0ad760e01b815260040160405180910390fd5b80821115612efc5760405163a0889e3b60e01b815260040160405180910390fd5b612f05836131c5565b612f225760405163306c20fb60e01b815260040160405180910390fd5b506000918252600a602052604090912055565b6008546001600160a01b03163314612f5f5760405162461bcd60e51b815260040161176390615548565b6000612f736008546001600160a01b031690565b6001600160a01b03164760405160006040518083038185875af1925050503d8060008114612fbd576040519150601f19603f3d011682016040523d82523d6000602084013e612fc2565b606091505b5050905080612b5457600080fd5b6000611e62831015612ff75750736c7c97caff156473f6c9836522ae6e1d6448abe761300e565b5073f3fcd0f025c21f087dbeb754516d2ad8279140fc5b6001600160a01b0381166323b872dd336040516001600160e01b031960e084901b1681526001600160a01b03909116600482015230602482015260448101869052606401600060405180830381600087803b15801561306c57600080fd5b505af1158015613080573d6000803e3d6000fd5b5050506000838152600f602052604090208054606492506001906130b0908490610100900463ffffffff166156e3565b92506101000a81548163ffffffff021916908363ffffffff160217905550505050565b816130dd816131c5565b15801561311157506000818152600f6020526040902054600160381b90046001600160a01b0316336001600160a01b031614155b8015613131575033736c7c97caff156473f6c9836522ae6e1d6448abe714155b801561315157503373f3fcd0f025c21f087dbeb754516d2ad8279140fc14155b1561316f576040516361404cd160e01b815260040160405180910390fd5b82600061317b82612111565b1461319957604051635c9f475f60e01b815260040160405180910390fd5b6000848152600f6020908152604090912084516131be926003909201918601906149db565b5050505050565b6000806131d18361172e565b9050336001600160a01b038216148061320357506131ee83610e74565b6001600160a01b0316336001600160a01b0316145b80610f715750610f7181336109d9565b8261321d816131c5565b15801561325157506000818152600f6020526040902054600160381b90046001600160a01b0316336001600160a01b031614155b8015613271575033736c7c97caff156473f6c9836522ae6e1d6448abe714155b801561329157503373f3fcd0f025c21f087dbeb754516d2ad8279140fc14155b156132af576040516361404cd160e01b815260040160405180910390fd5b8360006132bb82612111565b146132d957604051635c9f475f60e01b815260040160405180910390fd5b61330383856040516020016132ef929190615427565b6040516020818303038152906040526144c9565b6000958652600f602052604090952060010180546001600160a01b0319166001600160a01b039096169590951790945550505050565b60008160011115801561334d575060005482105b8015610b81575050600090815260046020526040902054600160e01b900460ff161590565b6060816133995750506040805180820190915260048152630307830360e41b602082015290565b8160005b81156133bc57806133ad8161583a565b915050600882901c915061339d565b6112f78482613422565b60008281526006602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b60606000613431836002615767565b61343c9060026156cb565b6001600160401b0381111561346157634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f19166020018201604052801561348b576020820181803683370190505b509050600360fc1b816000815181106134b457634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350600f60fb1b816001815181106134f157634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a9053506000613515846002615767565b6135209060016156cb565b90505b60018111156135b4576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061356257634e487b7160e01b600052603260045260246000fd5b1a60f81b82828151811061358657634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535060049490941c936135ad816157ee565b9050613523565b508315610f715760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401611763565b8161360d816131c5565b15801561364157506000818152600f6020526040902054600160381b90046001600160a01b0316336001600160a01b031614155b8015613661575033736c7c97caff156473f6c9836522ae6e1d6448abe714155b801561368157503373f3fcd0f025c21f087dbeb754516d2ad8279140fc14155b1561369f576040516361404cd160e01b815260040160405180910390fd5b8260006136ab82612111565b146136c957604051635c9f475f60e01b815260040160405180910390fd5b60408051808201825260068152654e617475726560d01b60208201529051633a96fdd760e01b8152849173fc29bbb9d6e92605291cca1d5fc24870a50b078091633a96fdd79161371e9185919060040161545e565b60206040518083038186803b15801561373657600080fd5b505af415801561374a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061376e9190614d53565b8061381557506040805180820182526005815264131a59da1d60da1b60208201529051633a96fdd760e01b815273fc29bbb9d6e92605291cca1d5fc24870a50b078091633a96fdd7916137c591859160040161545e565b60206040518083038186803b1580156137dd57600080fd5b505af41580156137f1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906138159190614d53565b806138bc575060408051808201825260058152642bb0ba32b960d91b60208201529051633a96fdd760e01b815273fc29bbb9d6e92605291cca1d5fc24870a50b078091633a96fdd79161386c91859160040161545e565b60206040518083038186803b15801561388457600080fd5b505af4158015613898573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906138bc9190614d53565b806139635750604080518082018252600581526408ac2e4e8d60db1b60208201529051633a96fdd760e01b815273fc29bbb9d6e92605291cca1d5fc24870a50b078091633a96fdd79161391391859160040161545e565b60206040518083038186803b15801561392b57600080fd5b505af415801561393f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906139639190614d53565b80613a08575060408051808201825260048082526315da5b9960e21b60208301529151633a96fdd760e01b815273fc29bbb9d6e92605291cca1d5fc24870a50b078092633a96fdd7926139b89286920161545e565b60206040518083038186803b1580156139d057600080fd5b505af41580156139e4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613a089190614d53565b80613ab057506040805180820182526006815265417263616e6560d01b60208201529051633a96fdd760e01b815273fc29bbb9d6e92605291cca1d5fc24870a50b078091633a96fdd791613a6091859160040161545e565b60206040518083038186803b158015613a7857600080fd5b505af4158015613a8c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613ab09190614d53565b80613b5857506040805180820182526006815265536861646f7760d01b60208201529051633a96fdd760e01b815273fc29bbb9d6e92605291cca1d5fc24870a50b078091633a96fdd791613b0891859160040161545e565b60206040518083038186803b158015613b2057600080fd5b505af4158015613b34573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613b589190614d53565b80613bfd57506040805180820182526004808252634669726560e01b60208301529151633a96fdd760e01b815273fc29bbb9d6e92605291cca1d5fc24870a50b078092633a96fdd792613bad9286920161545e565b60206040518083038186803b158015613bc557600080fd5b505af4158015613bd9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613bfd9190614d53565b15613c0757613c20565b604051630dee7a0b60e11b815260040160405180910390fd5b6000858152600f602090815260409091208551613c4592600290920191870190614957565b505050505050565b6000613c5882613e6b565b80519091506000906001600160a01b0316336001600160a01b03161480613c8657508151613c8690336109d9565b80613ca1575033613c9684610e74565b6001600160a01b0316145b905080613cc157604051632ce44b5f60e11b815260040160405180910390fd5b846001600160a01b031682600001516001600160a01b031614613cf65760405162a1148160e81b815260040160405180910390fd5b6001600160a01b038416613d1d57604051633a954ecd60e21b815260040160405180910390fd5b613d2a8585856001614528565b613d3a60008484600001516133c6565b6001600160a01b038581166000908152600560209081526040808320805467ffffffffffffffff198082166001600160401b0392831660001901831617909255898616808652838620805493841693831660019081018416949094179055898652600490945282852080546001600160e01b031916909417600160a01b429092169190910217909255908601808352912054909116613e2457600054811015613e2457825160008281526004602090815260409091208054918601516001600160401b0316600160a01b026001600160e01b03199092166001600160a01b03909316929092171790555b5082846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a46131be565b60408051606081018252600080825260208201819052918101919091528180600111158015613e9b575060005481105b15613f7957600081815260046020908152604091829020825160608101845290546001600160a01b0381168252600160a01b81046001600160401b031692820192909252600160e01b90910460ff16151591810182905290613f775780516001600160a01b031615613f0e579392505050565b5060001901600081815260046020908152604091829020825160608101845290546001600160a01b038116808352600160a01b82046001600160401b031693830193909352600160e01b900460ff1615159281019290925215613f72579392505050565b613f0e565b505b604051636f96cda160e11b815260040160405180910390fd5b600082816001600160a01b0382166370a08231336040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260240160206040518083038186803b158015613fe557600080fd5b505afa158015613ff9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061401d9190614e79565b90506000805b8281101561410d5760006001600160a01b038516632f745c59336040516001600160e01b031960e084901b1681526001600160a01b0390911660048201526024810185905260440160206040518083038186803b15801561408357600080fd5b505afa158015614097573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906140bb9190614e79565b60008181526011602052604090205490915060ff166140fa576000818152601160205260409020805460ff191660011790556140f787846156cb565b92505b50806141058161583a565b915050614023565b5095945050505050565b6141213382614540565b600061412b6112ff565b90506141368161455a565b6000918252600f60205260409091206004015550565b600880546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600082816001600160a01b0382166370a08231336040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260240160206040518083038186803b1580156141f157600080fd5b505afa158015614205573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906142299190614e79565b90506000805b8281101561410d5760006001600160a01b038516632f745c59336040516001600160e01b031960e084901b1681526001600160a01b0390911660048201526024810185905260440160206040518083038186803b15801561428f57600080fd5b505afa1580156142a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906142c79190614e79565b60008181526011602052604090205490915060ff166142ed576142ea87846156cb565b92505b50806142f88161583a565b91505061422f565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a02906143359033908990889088906004016153f4565b602060405180830381600087803b15801561434f57600080fd5b505af192505050801561437f575060408051601f3d908101601f1916820190925261437c91810190614d8b565b60015b6143da573d8080156143ad576040519150601f19603f3d011682016040523d82523d6000602084013e6143b2565b606091505b5080516143d2576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490506112f7565b6143ff336001614540565b60006144096112ff565b90506144148161455a565b6000828152600f602052604090206004810191909155805460329190600190614449908490610100900463ffffffff166156e3565b825463ffffffff9182166101009390930a9283029190920219909116179055506000818152600f60205260408120805465ff0000000000191665010000000000179055600c805460ff169161449d83615855565b91906101000a81548160ff021916908360ff1602179055505050565b6060610b818260016000196145af565b6000806144f4836040516020016144e091906153cf565b604051602081830303815290604052614660565b90508051602082016000f091506001600160a01b038216612e745760405163046a55db60e11b815260040160405180910390fd5b6001600160a01b0384161561286f5761286f8261468c565b611dcd8282604051806020016040528060008152506146e1565b600080614568600143615786565b6145739060ff615875565b61457e9060016156cb565b9050600061458c8285615875565b905060008161459b8443615786565b6145a591906156cb565b4095945050505050565b6060833b806145ce575050604080516020810190915260008152610f71565b808411156145ec575050604080516020810190915260008152610f71565b8383101561461e5760405163162544fd60e11b8152600481018290526024810185905260448101849052606401611763565b83830384820360008282106146335782614635565b815b60408051603f8301601f19168101909152818152955090508087602087018a3c505050509392505050565b606081518260405160200161467692919061537e565b6040516020818303038152906040529050919050565b6000614697826119e7565b905063ffffffff811615611dcd576146b0600282615744565b6000838152600f60205260409020805463ffffffff929092166101000264ffffffff00199092169190911790555050565b61100183838360016000546001600160a01b03851661471257604051622e076360e81b815260040160405180910390fd5b836147305760405163b562e8dd60e01b815260040160405180910390fd5b61473d6000868387614528565b6001600160a01b038516600081815260056020908152604080832080546fffffffffffffffffffffffffffffffff1981166001600160401b038083168c0181169182176801000000000000000067ffffffffffffffff1990941690921783900481168c01811690920217909155858452600490925290912080546001600160e01b031916909217600160a01b4290921691909102179055808085018380156147ee57506001600160a01b0387163b15155b15614877575b60405182906001600160a01b038916906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a461483f6000888480600101955088614300565b61485c576040516368d2bf6b60e11b815260040160405180910390fd5b808214156147f457826000541461487257600080fd5b6148bd565b5b6040516001830192906001600160a01b038916906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a480821415614878575b506000556131be565b604051806101c0016040528060008152602001600060ff168152602001600063ffffffff168152602001600015158152602001600015158152602001600060ff16815260200160008152602001606081526020016060815260200160006001600160a01b03168152602001606081526020016060815260200160006001600160a01b03168152602001606081525090565b82805461496390615805565b90600052602060002090601f01602090048101928261498557600085556149cb565b82601f1061499e57805160ff19168380011785556149cb565b828001600101855582156149cb579182015b828111156149cb5782518255916020019190600101906149b0565b506149d7929150614a7e565b5090565b82805482825590600052602060002090600901600a900481019282156149cb5791602002820160005b83821115614a4657835183826101000a81548162ffffff021916908362ffffff1602179055509260200192600301602081600201049283019260010302614a04565b8015614a755782816101000a81549062ffffff0219169055600301602081600201049283019260010302614a46565b50506149d79291505b5b808211156149d75760008155600101614a7f565b6000614aa6614aa1846156a4565b615651565b9050828152838383011115614aba57600080fd5b828260208301376000602084830101529392505050565b600082601f830112614ae1578081fd5b81516020614af1614aa183615681565b80838252828201915082860187848660051b8901011115614b10578586fd5b855b85811015614b2e57815184529284019290840190600101614b12565b5090979650505050505050565b600082601f830112614b4b578081fd5b610f7183833560208501614a93565b600082601f830112614b6a578081fd5b8151614b78614aa1826156a4565b818152846020838601011115614b8c578283fd5b6112f78260208301602087016157c2565b600060208284031215614bae578081fd5b8135610f71816158cb565b60008060408385031215614bcb578081fd5b8251614bd6816158cb565b60208401519092506001600160401b03811115614bf1578182fd5b614bfd85828601614ad1565b9150509250929050565b60008060408385031215614c19578182fd5b8235614c24816158cb565b91506020830135614c34816158cb565b809150509250929050565b600080600060608486031215614c53578081fd5b8335614c5e816158cb565b92506020840135614c6e816158cb565b929592945050506040919091013590565b60008060008060808587031215614c94578182fd5b8435614c9f816158cb565b93506020850135614caf816158cb565b92506040850135915060608501356001600160401b03811115614cd0578182fd5b8501601f81018713614ce0578182fd5b614cef87823560208401614a93565b91505092959194509250565b60008060408385031215614d0d578182fd5b8235614d18816158cb565b91506020830135614c34816158e0565b60008060408385031215614d3a578182fd5b8235614d45816158cb565b946020939093013593505050565b600060208284031215614d64578081fd5b8151610f71816158e0565b600060208284031215614d80578081fd5b8135610f71816158ee565b600060208284031215614d9c578081fd5b8151610f71816158ee565b600060208284031215614db8578081fd5b81356001600160401b03811115614dcd578182fd5b6112f784828501614b3b565b600060208284031215614dea578081fd5b81516001600160401b03811115614dff578182fd5b6112f784828501614b5a565b60008060408385031215614e1d578182fd5b82356001600160401b0380821115614e33578384fd5b614e3f86838701614b3b565b93506020850135915080821115614e54578283fd5b50614bfd85828601614b3b565b600060208284031215614e72578081fd5b5035919050565b600060208284031215614e8a578081fd5b5051919050565b60008060408385031215614ea3578182fd5b823591506020830135614c34816158cb565b600080600060608486031215614ec9578081fd5b833592506020808501356001600160401b03811115614ee6578283fd5b8501601f81018713614ef6578283fd5b8035614f04614aa182615681565b8082825284820191508484018a868560051b8701011115614f23578687fd5b8694505b83851015614f4e578035614f3a81615904565b835260019490940193918501918501614f27565b5096999698505050506040949094013593505050565b600080600060608486031215614f78578081fd5b833592506020808501356001600160401b03811115614f95578283fd5b8501601f81018713614fa5578283fd5b8035614fb3614aa182615681565b8082825284820191508484018a868560051b8701011115614fd2578687fd5b8694505b83851015614f4e578035835260019490940193918501918501614fd6565b60008060008060808587031215615009578182fd5b845193506020808601516001600160401b0380821115615027578485fd5b61503389838a01614b5a565b95506040880151915080821115615048578485fd5b61505489838a01614ad1565b94506060880151915080821115615069578384fd5b508601601f8101881361507a578283fd5b8051615088614aa182615681565b8082825284820191508484018b868560051b87010111156150a7578687fd5b8694505b838510156150d25780516150be81615904565b8352600194909401939185019185016150ab565b50979a9699509497505050505050565b6000806000606084860312156150f6578081fd5b8335925060208401356001600160401b03811115615112578182fd5b61511e86828701614b3b565b925050604084013590509250925092565b60008060408385031215615141578182fd5b50508035926020909101359150565b60008060408385031215615162578182fd5b82359150602083013563ffffffff81168114614c34578182fd5b60006020828403121561518d578081fd5b815160ff81168114610f71578182fd5b6000815180845260208085019450808401835b838110156151d157815162ffffff16875295820195908201906001016151b0565b509495945050505050565b6000815180845260208085019450808401835b838110156151d1578151875295820195908201906001016151ef565b600081518084526152238160208601602086016157c2565b601f01601f19169290920160200192915050565b60006101c0825184526020830151615254602086018260ff169052565b50604083015161526c604086018263ffffffff169052565b506060830151615280606086018215159052565b506080830151615294608086018215159052565b5060a08301516152a960a086018260ff169052565b5060c083015160c085015260e08301518160e08601526152cb8286018261520b565b91505061010080840151858303828701526152e6838261520b565b9250505061012080840151615305828701826001600160a01b03169052565b5050610140808401518583038287015261531f83826151dc565b92505050610160808401518583038287015261533b838261519d565b925050506101808084015161535a828701826001600160a01b03169052565b50506101a08084015185830382870152615374838261520b565b9695505050505050565b606360f81b815260e083901b6001600160e01b03191660018201526880600e6000396000f360b81b600582015281516000906153c181600e8501602087016157c2565b91909101600e019392505050565b600080825282516153e78160018501602087016157c2565b9190910160010192915050565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906153749083018461520b565b6001600160a01b03831681526040602082018190526000906112f7908301846151dc565b602081526000610f71602083018461520b565b604081526000615471604083018561520b565b8281036020840152615483818561520b565b95945050505050565b60408152600061549f604083018561520b565b60208382038185015282855484600182811c9150808316806154c257607f831692505b8583108114156154e057634e487b7160e01b88526022600452602488fd5b8287526020870196508080156154fd576001811461550e57615538565b60ff19851688528688019550615538565b60008b815260209020895b858110156155325781548a820152908401908801615519565b89019650505b50939a9950505050505050505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b602081526000610f716020830184615237565b6040815260006155da6040830185615237565b90508260208301529392505050565b60ff8916815263ffffffff88166020820152861515604082015285151560608201526001600160a01b038581166080830152841660a082015261010060c0820181905260009061563b8382018661520b565b9150508260e08301529998505050505050505050565b604051601f8201601f191681016001600160401b0381118282101715615679576156796158b5565b604052919050565b60006001600160401b0382111561569a5761569a6158b5565b5060051b60200190565b60006001600160401b038211156156bd576156bd6158b5565b50601f01601f191660200190565b600082198211156156de576156de615889565b500190565b600063ffffffff80831681851680830382111561570257615702615889565b01949350505050565b600060ff821660ff84168060ff0382111561572857615728615889565b019392505050565b60008261573f5761573f61589f565b500490565b600063ffffffff8084168061575b5761575b61589f565b92169190910492915050565b600081600019048311821515161561578157615781615889565b500290565b60008282101561579857615798615889565b500390565b600063ffffffff838116908316818110156157ba576157ba615889565b039392505050565b60005b838110156157dd5781810151838201526020016157c5565b8381111561286f5750506000910152565b6000816157fd576157fd615889565b506000190190565b600181811c9082168061581957607f821691505b60208210811415612e7457634e487b7160e01b600052602260045260246000fd5b600060001982141561584e5761584e615889565b5060010190565b600060ff821660ff81141561586c5761586c615889565b60010192915050565b6000826158845761588461589f565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114612b5457600080fd5b8015158114612b5457600080fd5b6001600160e01b031981168114612b5457600080fd5b62ffffff81168114612b5457600080fdfea264697066735822122007731cc5e3b305251a4f1e3247be1ef32867de7db4f3285177f22145cba69ad164736f6c63430008040033
Deployed Bytecode
0x60806040526004361061033e5760003560e01c8063744e94aa116101ae578063b496da8b116100eb578063ea7606121161008f578063f4f2d1411161006c578063f4f2d14114610a67578063f528d5b714610a94578063fa6b116414610ab4578063fc337bb114610ad457005b8063ea76061214610a07578063efb4e00814610a27578063f2fde38b14610a4757005b8063c87b56dd116100c8578063c87b56dd14610976578063e17b25af14610996578063e4fe2413146109b6578063e985e9c5146109be57005b8063b496da8b14610902578063b548332d14610936578063b88d4fde1461095657005b80638da5cb5b11610152578063a0712d681161012f578063a0712d681461088f578063a22cb465146108a2578063aa2773f6146108c2578063af3dbfdb146108e257005b80638da5cb5b1461081357806395d89b4114610831578063994ee5ae1461084657005b8063848909751161018b578063848909751461077c578063851bf5421461079c57806385877ecd146107cc57806386481d40146107e157005b8063744e94aa1461070757806383cdf59e1461073c5780638429ffb01461075c57005b8063201ffc121161027c5780635379522f116102205780636352211e116101fd5780636352211e1461069f5780636fac2411146106bf57806370a08231146106d2578063715018a6146106f257005b80635379522f146106325780635755669a1461065257806361c6833d1461067257005b8063394c19e211610259578063394c19e2146105b25780633a7d22bc146105d257806342842e0e146105f25780634376d1011461061257005b8063201ffc121461055257806323b872dd146105725780632b15505e1461059257005b80630924e345116102e357806311eea9c5116102c057806311eea9c5146104b6578063150b7a02146104d657806318160ddd1461050f5780631fc5727f1461053257005b80630924e34514610456578063095ea7b3146104765780630f14ef561461049657005b8063052384561161031c57806305238456146103bc57806306fdde03146103dc57806307a34b16146103fe578063081812fc1461041e57005b806287c2001461034757806301ffc9a7146103675780630396d7cd1461039c57005b3661034557005b005b34801561035357600080fd5b50610345610362366004614eb5565b610ae9565b34801561037357600080fd5b50610387610382366004614d6f565b610b35565b60405190151581526020015b60405180910390f35b3480156103a857600080fd5b506103456103b7366004614e61565b610b87565b3480156103c857600080fd5b506103456103d7366004615150565b610d01565b3480156103e857600080fd5b506103f1610dcd565b604051610393919061544b565b34801561040a57600080fd5b50610345610419366004614f64565b610e5f565b34801561042a57600080fd5b5061043e610439366004614e61565b610e74565b6040516001600160a01b039091168152602001610393565b34801561046257600080fd5b506103f1610471366004614b9d565b610eb8565b34801561048257600080fd5b50610345610491366004614d28565b610f78565b3480156104a257600080fd5b506103f16104b1366004614e61565b611006565b3480156104c257600080fd5b506103456104d1366004614da7565b61101c565b3480156104e257600080fd5b506104f66104f1366004614c7f565b61115c565b6040516001600160e01b03199091168152602001610393565b34801561051b57600080fd5b506105246112ff565b604051908152602001610393565b34801561053e57600080fd5b5061034561054d366004614da7565b61130d565b34801561055e57600080fd5b506103f161056d366004614e61565b61146c565b34801561057e57600080fd5b5061034561058d366004614c3f565b6114ad565b34801561059e57600080fd5b506103f16105ad366004614da7565b6114b8565b3480156105be57600080fd5b506103456105cd366004614e91565b6114da565b3480156105de57600080fd5b506103f16105ed366004614e61565b61153f565b3480156105fe57600080fd5b5061034561060d366004614c3f565b611580565b34801561061e57600080fd5b5061052461062d366004614e61565b61159b565b34801561063e57600080fd5b506103f161064d36600461512f565b611660565b34801561065e57600080fd5b5061034561066d366004614e61565b6116f7565b34801561067e57600080fd5b5061052461068d366004614e61565b600a6020526000908152604090205481565b3480156106ab57600080fd5b5061043e6106ba366004614e61565b61172e565b6103456106cd366004614e61565b611740565b3480156106de57600080fd5b506105246106ed366004614b9d565b611963565b3480156106fe57600080fd5b506103456119b1565b34801561071357600080fd5b50610727610722366004614e61565b6119e7565b60405163ffffffff9091168152602001610393565b34801561074857600080fd5b50610345610757366004614e0b565b611ab2565b34801561076857600080fd5b50610345610777366004614e61565b611c82565b34801561078857600080fd5b5061043e610797366004614e61565b611dd1565b3480156107a857600080fd5b506103876107b7366004614e61565b60116020526000908152604090205460ff1681565b3480156107d857600080fd5b50610524611dfb565b3480156107ed57600080fd5b506108016107fc366004614e61565b611e81565b60405160ff9091168152602001610393565b34801561081f57600080fd5b506008546001600160a01b031661043e565b34801561083d57600080fd5b506103f1611e9e565b34801561085257600080fd5b5061087a610861366004614b9d565b6010602052600090815260409020805460019091015482565b60408051928352602083019190915201610393565b61034561089d366004614e61565b611ead565b3480156108ae57600080fd5b506103456108bd366004614cfb565b611fdd565b3480156108ce57600080fd5b506103456108dd366004614da7565b612073565b3480156108ee57600080fd5b506105246108fd366004614e61565b612111565b34801561090e57600080fd5b5061092261091d366004614e61565b6121a1565b6040516103939897969594939291906155e9565b34801561094257600080fd5b506103f1610951366004614da7565b61228e565b34801561096257600080fd5b50610345610971366004614c7f565b612824565b34801561098257600080fd5b506103f1610991366004614e61565b612875565b3480156109a257600080fd5b506103456109b1366004614b9d565b6128b6565b610345612932565b3480156109ca57600080fd5b506103876109d9366004614c07565b6001600160a01b03918216600090815260076020908152604080832093909416825291909152205460ff1690565b348015610a1357600080fd5b5061043e610a22366004614e61565b612a23565b348015610a3357600080fd5b50610345610a423660046150e2565b612aa8565b348015610a5357600080fd5b50610345610a62366004614b9d565b612abc565b348015610a7357600080fd5b50610a87610a82366004614e61565b612b57565b60405161039391906155b4565b348015610aa057600080fd5b50610524610aaf366004614e61565b612e7a565b348015610ac057600080fd5b50610345610acf36600461512f565b612eba565b348015610ae057600080fd5b50610345612f35565b610af38184612fd0565b610afd83836130d3565b6040518381527f1d7dd0a2cbf0f220f58a5423e209b142181f14f4cb78ec896268af4f22f876299060200160405180910390a1505050565b60006001600160e01b031982166380ac58cd60e01b1480610b6657506001600160e01b03198216635b5e139f60e01b145b80610b8157506301ffc9a760e01b6001600160e01b03198316145b92915050565b80610b91816131c5565b610bae5760405163055d621960e01b815260040160405180910390fd5b6000610bb983612a23565b90506000816001600160a01b03166374cbaa976040518163ffffffff1660e01b815260040160206040518083038186803b158015610bf657600080fd5b505afa158015610c0a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c2e919061517c565b90506000610c3b85611e81565b90508160ff168160ff1610610c6357604051633ab816ed60e01b815260040160405180910390fd5b610c6e856096610d01565b6000858152600f602052604081208054909190610c8d9060ff16615855565b825460ff9182166101009390930a83810292021916179091556000868152600f602052604090819020805460ff1916909217909155517f1d7dd0a2cbf0f220f58a5423e209b142181f14f4cb78ec896268af4f22f8762990610cf29087815260200190565b60405180910390a15050505050565b81610d0b816131c5565b610d285760405163055d621960e01b815260040160405180910390fd5b6000610d33846119e7565b90508263ffffffff168163ffffffff161015610d6257604051636971a8f960e01b815260040160405180910390fd5b610d6c838261579d565b6000948552600f60209081526040808720805464ffffffff00191661010063ffffffff95909516949094029390931790925560049052909320805467ffffffffffffffff60a01b1916600160a01b426001600160401b031602179055505050565b606060028054610ddc90615805565b80601f0160208091040260200160405190810160405280929190818152602001828054610e0890615805565b8015610e555780601f10610e2a57610100808354040283529160200191610e55565b820191906000526020600020905b815481529060010190602001808311610e3857829003601f168201915b5050505050905090565b610e698184612fd0565b610afd838333613213565b6000610e7f82613339565b610e9c576040516333d1c03960e21b815260040160405180910390fd5b506000908152600660205260409020546001600160a01b031690565b6060610ec26148c6565b63054c56388152610edb6001600160a01b038416613372565b60e08201528051610eeb90612a23565b6001600160a01b03166101808201819052604051632df373ab60e01b8152632df373ab90610f1d9084906004016155b4565b60006040518083038186803b158015610f3557600080fd5b505afa158015610f49573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610f719190810190614dd9565b9392505050565b6000610f838261172e565b9050806001600160a01b0316836001600160a01b03161415610fb85760405163250fdee360e21b815260040160405180910390fd5b336001600160a01b03821614801590610fd85750610fd681336109d9565b155b15610ff6576040516367d9dca160e11b815260040160405180910390fd5b6110018383836133c6565b505050565b6060610b8160036110168461159b565b90613422565b600c54604060ff9091161115611045576040516330db714560e21b815260040160405180910390fd5b600c5462010000900460ff1661106e57604051639eec531f60e01b815260040160405180910390fd5b33600090815260106020526040812054801561109d57604051632628972360e01b815260040160405180910390fd5b604051633a96fdd760e01b815273fc29bbb9d6e92605291cca1d5fc24870a50b078090633a96fdd7906110d7908690600d9060040161548c565b60206040518083038186803b1580156110ef57600080fd5b505af4158015611103573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111279190614d53565b611144576040516321b7638960e21b815260040160405180910390fd5b50503360009081526010602052604090206001905550565b600c5460009062010000900460ff1661118857604051639eec531f60e01b815260040160405180910390fd5b33736c7c97caff156473f6c9836522ae6e1d6448abe7148015906111c057503373f3fcd0f025c21f087dbeb754516d2ad8279140fc14155b156111de57604051633c5573c960e21b815260040160405180910390fd5b600060608060606000868060200190518101906111fb9190614ff4565b8251939850919650945092501561121a576112168585613603565b5060015b8251156112305761122c85848c613213565b5060015b8151156112455761124185836130d3565b5060015b8061126357604051635a4521b960e01b815260040160405180910390fd5b6000858152600f60205260409020805460649190600190611290908490610100900463ffffffff166156e3565b92506101000a81548163ffffffff021916908363ffffffff1602179055507f1d7dd0a2cbf0f220f58a5423e209b142181f14f4cb78ec896268af4f22f87629856040516112df91815260200190565b60405180910390a150630a85bd0160e11b9450505050505b949350505050565b600154600054036000190190565b600c54604060ff9091161115611336576040516330db714560e21b815260040160405180910390fd5b3360009081526010602052604090205460019080821461136957604051632628972360e01b815260040160405180910390fd5b600061137f611379600143615786565b40613372565b9050600061138c826114b8565b905060006113998261228e565b604051633a96fdd760e01b815290915073fc29bbb9d6e92605291cca1d5fc24870a50b078090633a96fdd7906113d59084908a9060040161545e565b60206040518083038186803b1580156113ed57600080fd5b505af4158015611401573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114259190614d53565b6114425760405163995a375760e01b815260040160405180910390fd5b600260106000335b6001600160a01b03168152602081019190915260400160002055505050505050565b6060600061147983612b57565b61018081015160405163e13daa0d60e01b81529192506001600160a01b03169063e13daa0d90610f1d9084906004016155b4565b611001838383613c4d565b60606114c26148c6565b63054c563880825260e08201849052610eeb90612a23565b816114e4816131c5565b6115015760405163055d621960e01b815260040160405180910390fd5b506000918252600f602052604090912080546001600160a01b03909216600160381b02670100000000000000600160d81b0319909216919091179055565b6060600061154c83612b57565b610180810151604051632df373ab60e01b81529192506001600160a01b031690632df373ab90610f1d9084906004016155b4565b61100183838360405180602001604052806000815250612824565b6000818152600f602052604081206004015481905b806115e9576115be8261583a565b9150600f60006115cd8661583a565b95508581526020019081526020016000206004015490506115b0565b60006115f6600384615767565b90506020600082611608600384615786565b6116129190615786565b9050600062ffffff611625836008615767565b86901c16905080628000008110611647576116408982615786565b9050611654565b61165189826156cb565b90505b98975050505050505050565b6060600061166d84612b57565b6101808101516040516301ea9d4560e61b81529192506001600160a01b031690637aa75140906116a390849087906004016155c7565b60006040518083038186803b1580156116bb57600080fd5b505afa1580156116cf573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526112f79190810190614dd9565b611700816131c5565b61171d5760405163306c20fb60e01b815260040160405180910390fd5b6000908152600a6020526040812055565b600061173982613e6b565b5192915050565b6002600b54141561176c5760405162461bcd60e51b81526004016117639061557d565b60405180910390fd5b6002600b55600c5462010000900460ff1661179a57604051639eec531f60e01b815260040160405180910390fd5b3233146117ba5760405163f7798d3360e01b815260040160405180910390fd5b80600a8111156117dd57604051634bdda98760e11b815260040160405180910390fd5b600c54829060009060ff166117f06112ff565b6117fb9060016156cb565b6118059190615786565b905061041761181483836156cb565b111561183357604051632e57ee4960e11b815260040160405180910390fd5b600061185b736c7c97caff156473f6c9836522ae6e1d6448abe76701aa535d3d0c0000613f92565b9050600061188473f3fcd0f025c21f087dbeb754516d2ad8279140fc66b1a2bc2ec50000613f92565b336000908152601060205260408120600101549192509082906118a89085906156cb565b6118b291906156cb565b9050806118d257604051630ffe347760e21b815260040160405180910390fd5b60006118e688670214e8348c4f0000615767565b9050818110611904576118f98282615786565b905060009150611915565b61190e8183615786565b9150600090505b803410156119365760405163531cc80760e01b815260040160405180910390fd5b33600090815260106020526040902060010182905561195488614117565b50506001600b55505050505050565b60006001600160a01b03821661198c576040516323d3ad8160e21b815260040160405180910390fd5b506001600160a01b03166000908152600560205260409020546001600160401b031690565b6008546001600160a01b031633146119db5760405162461bcd60e51b815260040161176390615548565b6119e5600061414c565b565b600081815260046020526040812054600160a01b90046001600160401b031680611a2a5750506000908152600f6020526040902054610100900463ffffffff1690565b6000611a3584611e81565b9050600060028260ff1610611a4b576096611a4e565b60645b90506000611a5c8442615786565b905060006301e13380611a7563ffffffff851684615767565b611a7f9190615730565b6000888152600f6020526040902054909150611aa7908290610100900463ffffffff166156e3565b979650505050505050565b600c54604060ff9091161115611adb576040516330db714560e21b815260040160405180910390fd5b33600090815260106020526040902054600290808214611b0e57604051632628972360e01b815260040160405180910390fd5b6000611b1933610eb8565b604051633a96fdd760e01b815290915073fc29bbb9d6e92605291cca1d5fc24870a50b078090633a96fdd790611b55908490899060040161545e565b60206040518083038186803b158015611b6d57600080fd5b505af4158015611b81573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ba59190614d53565b611bc25760405163602bc0ff60e11b815260040160405180910390fd5b6000611bcd8261228e565b604051633a96fdd760e01b815290915073fc29bbb9d6e92605291cca1d5fc24870a50b078090633a96fdd790611c09908490899060040161545e565b60206040518083038186803b158015611c2157600080fd5b505af4158015611c35573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c599190614d53565b611c765760405163995a375760e01b815260040160405180910390fd5b6003601060003361144a565b80611c8c816131c5565b611ca95760405163055d621960e01b815260040160405180910390fd5b600c54608061010090910460ff161115611cd657604051637327b95360e01b815260040160405180910390fd5b6000828152600f6020526040902054600160301b900460ff1615611d0c5760405162ff8b6560e11b815260040160405180910390fd5b6000828152600f60205260409020805466ff0000000000001916600160301b1780825560329190600190611d4d90849063ffffffff610100909104166156e3565b825463ffffffff91821661010093840a9081029202191617909155600c805460ff9290049190911691506001611d8283615855565b825460ff91821661010093840a9081029083021990911617909255600c54608091900490911611159050611dcd57611db982611006565b805161100191600e91602090910190614957565b5050565b60098181548110611de157600080fd5b6000918252602090912001546001600160a01b0316905081565b600080611e24736c7c97caff156473f6c9836522ae6e1d6448abe76701aa535d3d0c000061419e565b90506000611e4d73f3fcd0f025c21f087dbeb754516d2ad8279140fc66b1a2bc2ec5000061419e565b336000908152601060205260409020600101549091508190611e709084906156cb565b611e7a91906156cb565b9250505090565b6000818152600f6020526040812054610b819060ff16600161570b565b606060038054610ddc90615805565b6002600b541415611ed05760405162461bcd60e51b81526004016117639061557d565b6002600b55600c5462010000900460ff16611efe57604051639eec531f60e01b815260040160405180910390fd5b323314611f1e5760405163f7798d3360e01b815260040160405180910390fd5b80600a811115611f4157604051634bdda98760e11b815260040160405180910390fd5b600c54829060009060ff16611f546112ff565b611f5f9060016156cb565b611f699190615786565b9050610417611f7883836156cb565b1115611f9757604051632e57ee4960e11b815260040160405180910390fd5b611fa984670214e8348c4f0000615767565b341015611fc95760405163531cc80760e01b815260040160405180910390fd5b611fd284614117565b50506001600b555050565b6001600160a01b0382163314156120075760405163b06307db60e01b815260040160405180910390fd5b3360008181526007602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b6008546001600160a01b0316331461209d5760405162461bcd60e51b815260040161176390615548565b80516120bc57604051637100025160e01b815260040160405180910390fd5b600d80546120c990615805565b1590506120e95760405163267ae94d60e21b815260040160405180910390fd5b80516120fc90600d906020840190614957565b5050600c805462ff0000191662010000179055565b60008061211d83612b57565b61018081015160405163278381d960e01b81529192506001600160a01b03169063278381d9906121519084906004016155b4565b60206040518083038186803b15801561216957600080fd5b505afa15801561217d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f719190614e79565b600f6020526000908152604090208054600182015460028301805460ff80851695610100860463ffffffff1695650100000000008104831695600160301b820490931694600160381b9091046001600160a01b039081169493169261220590615805565b80601f016020809104026020016040519081016040528092919081815260200182805461223190615805565b801561227e5780601f106122535761010080835404028352916020019161227e565b820191906000526020600020905b81548152906001019060200180831161226157829003601f168201915b5050505050908060040154905088565b60408051808201825260068152654e617475726560d01b60208201529051633a96fdd760e01b815260609173fc29bbb9d6e92605291cca1d5fc24870a50b078091633a96fdd7916122e49186919060040161545e565b60206040518083038186803b1580156122fc57600080fd5b505af4158015612310573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123349190614d53565b156123595750506040805180820190915260048152634669726560e01b602082015290565b6040805180820182526004808252634669726560e01b60208301529151633a96fdd760e01b815273fc29bbb9d6e92605291cca1d5fc24870a50b078092633a96fdd7926123a89287920161545e565b60206040518083038186803b1580156123c057600080fd5b505af41580156123d4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123f89190614d53565b1561241e5750506040805180820190915260058152642bb0ba32b960d91b602082015290565b60408051808201825260058152642bb0ba32b960d91b60208201529051633a96fdd760e01b815273fc29bbb9d6e92605291cca1d5fc24870a50b078091633a96fdd79161246f91869160040161545e565b60206040518083038186803b15801561248757600080fd5b505af415801561249b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124bf9190614d53565b156124e457505060408051808201909152600481526315da5b9960e21b602082015290565b60408051808201825260048082526315da5b9960e21b60208301529151633a96fdd760e01b815273fc29bbb9d6e92605291cca1d5fc24870a50b078092633a96fdd7926125339287920161545e565b60206040518083038186803b15801561254b57600080fd5b505af415801561255f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125839190614d53565b156125a957505060408051808201909152600581526408ac2e4e8d60db1b602082015290565b604080518082018252600581526408ac2e4e8d60db1b60208201529051633a96fdd760e01b815273fc29bbb9d6e92605291cca1d5fc24870a50b078091633a96fdd7916125fa91869160040161545e565b60206040518083038186803b15801561261257600080fd5b505af4158015612626573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061264a9190614d53565b156126715750506040805180820190915260068152654e617475726560d01b602082015290565b6040805180820182526006815265417263616e6560d01b60208201529051633a96fdd760e01b815273fc29bbb9d6e92605291cca1d5fc24870a50b078091633a96fdd7916126c391869160040161545e565b60206040518083038186803b1580156126db57600080fd5b505af41580156126ef573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127139190614d53565b1561273a575050604080518082019091526006815265536861646f7760d01b602082015290565b6040805180820182526006815265536861646f7760d01b60208201529051633a96fdd760e01b815273fc29bbb9d6e92605291cca1d5fc24870a50b078091633a96fdd79161278c91869160040161545e565b60206040518083038186803b1580156127a457600080fd5b505af41580156127b8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127dc9190614d53565b15612802575050604080518082019091526005815264131a59da1d60da1b602082015290565b5050604080518082019091526006815265417263616e6560d01b602082015290565b61282f848484613c4d565b6001600160a01b0383163b15158015612851575061284f84848484614300565b155b1561286f576040516368d2bf6b60e11b815260040160405180910390fd5b50505050565b6060600061288283612b57565b61018081015160405163f533450160e01b81529192506001600160a01b03169063f533450190610f1d9084906004016155b4565b6008546001600160a01b031633146128e05760405162461bcd60e51b815260040161176390615548565b600980546001810182556000919091527f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7af0180546001600160a01b0319166001600160a01b0392909216919091179055565b6002600b5414156129555760405162461bcd60e51b81526004016117639061557d565b6002600b55600c54604060ff9091161115612983576040516330db714560e21b815260040160405180910390fd5b3233146129a35760405163f7798d3360e01b815260040160405180910390fd5b336000908152601060205260409020546003908082146129d657604051632628972360e01b815260040160405180910390fd5b67011c37937e0800003410156129ff5760405163531cc80760e01b815260040160405180910390fd5b33600090815260106020526040902060049055612a1a6143f4565b50506001600b55565b60095460009080612a475760405163de4294fb60e01b815260040160405180910390fd5b6000838152600a60205260409020548015612a60578091505b6009612a6d600184615786565b81548110612a8b57634e487b7160e01b600052603260045260246000fd5b6000918252602090912001546001600160a01b0316949350505050565b612ab28184612fd0565b610afd8383613603565b6008546001600160a01b03163314612ae65760405162461bcd60e51b815260040161176390615548565b6001600160a01b038116612b4b5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401611763565b612b548161414c565b50565b612b5f6148c6565b816001811080612b755750612b726112ff565b81115b15612b93576040516307ed98ed60e31b815260040160405180910390fd5b612b9b6148c6565b838152612ba784611e81565b60ff166020820152612bb8846119e7565b63ffffffff166040820152612bcc8461159b565b60c0820152612bda84611006565b60e0820152612be884612a23565b6001600160a01b03166101808201526000848152600f6020818152604083205460ff65010000000000820481161515606087015293889052919052600160301b9004811615156080830152600c5461010090041660a0820152600e8054612c4e90615805565b80601f0160208091040260200160405190810160405280929190818152602001828054612c7a90615805565b8015612cc75780601f10612c9c57610100808354040283529160200191612cc7565b820191906000526020600020905b815481529060010190602001808311612caa57829003601f168201915b50505050506101a08201526000848152600f602052604090206002018054612cee90615805565b80601f0160208091040260200160405190810160405280929190818152602001828054612d1a90615805565b8015612d675780601f10612d3c57610100808354040283529160200191612d67565b820191906000526020600020905b815481529060010190602001808311612d4a57829003601f168201915b50505050506101008201526000848152600f602090815260409182902060030180548351818402810184019094528084529091830182828015612df357602002820191906000526020600020906000905b82829054906101000a900462ffffff1662ffffff1681526020019060030190602082600201049283019260010382029150808411612db85790505b50505050506101608201526000848152600f60205260409020600101546001600160a01b031615612e71576000848152600f60205260408120600101548190612e44906001600160a01b03166144b9565b806020019051810190612e579190614bb9565b6001600160a01b0390911661012085015261014084015250505b91505b50919050565b600080612e8683612b57565b6101808101516040516374dc81d760e01b81529192506001600160a01b0316906374dc81d7906121519084906004016155b4565b60095481612edb5760405163d16e0ad760e01b815260040160405180910390fd5b80821115612efc5760405163a0889e3b60e01b815260040160405180910390fd5b612f05836131c5565b612f225760405163306c20fb60e01b815260040160405180910390fd5b506000918252600a602052604090912055565b6008546001600160a01b03163314612f5f5760405162461bcd60e51b815260040161176390615548565b6000612f736008546001600160a01b031690565b6001600160a01b03164760405160006040518083038185875af1925050503d8060008114612fbd576040519150601f19603f3d011682016040523d82523d6000602084013e612fc2565b606091505b5050905080612b5457600080fd5b6000611e62831015612ff75750736c7c97caff156473f6c9836522ae6e1d6448abe761300e565b5073f3fcd0f025c21f087dbeb754516d2ad8279140fc5b6001600160a01b0381166323b872dd336040516001600160e01b031960e084901b1681526001600160a01b03909116600482015230602482015260448101869052606401600060405180830381600087803b15801561306c57600080fd5b505af1158015613080573d6000803e3d6000fd5b5050506000838152600f602052604090208054606492506001906130b0908490610100900463ffffffff166156e3565b92506101000a81548163ffffffff021916908363ffffffff160217905550505050565b816130dd816131c5565b15801561311157506000818152600f6020526040902054600160381b90046001600160a01b0316336001600160a01b031614155b8015613131575033736c7c97caff156473f6c9836522ae6e1d6448abe714155b801561315157503373f3fcd0f025c21f087dbeb754516d2ad8279140fc14155b1561316f576040516361404cd160e01b815260040160405180910390fd5b82600061317b82612111565b1461319957604051635c9f475f60e01b815260040160405180910390fd5b6000848152600f6020908152604090912084516131be926003909201918601906149db565b5050505050565b6000806131d18361172e565b9050336001600160a01b038216148061320357506131ee83610e74565b6001600160a01b0316336001600160a01b0316145b80610f715750610f7181336109d9565b8261321d816131c5565b15801561325157506000818152600f6020526040902054600160381b90046001600160a01b0316336001600160a01b031614155b8015613271575033736c7c97caff156473f6c9836522ae6e1d6448abe714155b801561329157503373f3fcd0f025c21f087dbeb754516d2ad8279140fc14155b156132af576040516361404cd160e01b815260040160405180910390fd5b8360006132bb82612111565b146132d957604051635c9f475f60e01b815260040160405180910390fd5b61330383856040516020016132ef929190615427565b6040516020818303038152906040526144c9565b6000958652600f602052604090952060010180546001600160a01b0319166001600160a01b039096169590951790945550505050565b60008160011115801561334d575060005482105b8015610b81575050600090815260046020526040902054600160e01b900460ff161590565b6060816133995750506040805180820190915260048152630307830360e41b602082015290565b8160005b81156133bc57806133ad8161583a565b915050600882901c915061339d565b6112f78482613422565b60008281526006602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b60606000613431836002615767565b61343c9060026156cb565b6001600160401b0381111561346157634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f19166020018201604052801561348b576020820181803683370190505b509050600360fc1b816000815181106134b457634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350600f60fb1b816001815181106134f157634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a9053506000613515846002615767565b6135209060016156cb565b90505b60018111156135b4576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061356257634e487b7160e01b600052603260045260246000fd5b1a60f81b82828151811061358657634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535060049490941c936135ad816157ee565b9050613523565b508315610f715760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401611763565b8161360d816131c5565b15801561364157506000818152600f6020526040902054600160381b90046001600160a01b0316336001600160a01b031614155b8015613661575033736c7c97caff156473f6c9836522ae6e1d6448abe714155b801561368157503373f3fcd0f025c21f087dbeb754516d2ad8279140fc14155b1561369f576040516361404cd160e01b815260040160405180910390fd5b8260006136ab82612111565b146136c957604051635c9f475f60e01b815260040160405180910390fd5b60408051808201825260068152654e617475726560d01b60208201529051633a96fdd760e01b8152849173fc29bbb9d6e92605291cca1d5fc24870a50b078091633a96fdd79161371e9185919060040161545e565b60206040518083038186803b15801561373657600080fd5b505af415801561374a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061376e9190614d53565b8061381557506040805180820182526005815264131a59da1d60da1b60208201529051633a96fdd760e01b815273fc29bbb9d6e92605291cca1d5fc24870a50b078091633a96fdd7916137c591859160040161545e565b60206040518083038186803b1580156137dd57600080fd5b505af41580156137f1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906138159190614d53565b806138bc575060408051808201825260058152642bb0ba32b960d91b60208201529051633a96fdd760e01b815273fc29bbb9d6e92605291cca1d5fc24870a50b078091633a96fdd79161386c91859160040161545e565b60206040518083038186803b15801561388457600080fd5b505af4158015613898573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906138bc9190614d53565b806139635750604080518082018252600581526408ac2e4e8d60db1b60208201529051633a96fdd760e01b815273fc29bbb9d6e92605291cca1d5fc24870a50b078091633a96fdd79161391391859160040161545e565b60206040518083038186803b15801561392b57600080fd5b505af415801561393f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906139639190614d53565b80613a08575060408051808201825260048082526315da5b9960e21b60208301529151633a96fdd760e01b815273fc29bbb9d6e92605291cca1d5fc24870a50b078092633a96fdd7926139b89286920161545e565b60206040518083038186803b1580156139d057600080fd5b505af41580156139e4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613a089190614d53565b80613ab057506040805180820182526006815265417263616e6560d01b60208201529051633a96fdd760e01b815273fc29bbb9d6e92605291cca1d5fc24870a50b078091633a96fdd791613a6091859160040161545e565b60206040518083038186803b158015613a7857600080fd5b505af4158015613a8c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613ab09190614d53565b80613b5857506040805180820182526006815265536861646f7760d01b60208201529051633a96fdd760e01b815273fc29bbb9d6e92605291cca1d5fc24870a50b078091633a96fdd791613b0891859160040161545e565b60206040518083038186803b158015613b2057600080fd5b505af4158015613b34573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613b589190614d53565b80613bfd57506040805180820182526004808252634669726560e01b60208301529151633a96fdd760e01b815273fc29bbb9d6e92605291cca1d5fc24870a50b078092633a96fdd792613bad9286920161545e565b60206040518083038186803b158015613bc557600080fd5b505af4158015613bd9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613bfd9190614d53565b15613c0757613c20565b604051630dee7a0b60e11b815260040160405180910390fd5b6000858152600f602090815260409091208551613c4592600290920191870190614957565b505050505050565b6000613c5882613e6b565b80519091506000906001600160a01b0316336001600160a01b03161480613c8657508151613c8690336109d9565b80613ca1575033613c9684610e74565b6001600160a01b0316145b905080613cc157604051632ce44b5f60e11b815260040160405180910390fd5b846001600160a01b031682600001516001600160a01b031614613cf65760405162a1148160e81b815260040160405180910390fd5b6001600160a01b038416613d1d57604051633a954ecd60e21b815260040160405180910390fd5b613d2a8585856001614528565b613d3a60008484600001516133c6565b6001600160a01b038581166000908152600560209081526040808320805467ffffffffffffffff198082166001600160401b0392831660001901831617909255898616808652838620805493841693831660019081018416949094179055898652600490945282852080546001600160e01b031916909417600160a01b429092169190910217909255908601808352912054909116613e2457600054811015613e2457825160008281526004602090815260409091208054918601516001600160401b0316600160a01b026001600160e01b03199092166001600160a01b03909316929092171790555b5082846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a46131be565b60408051606081018252600080825260208201819052918101919091528180600111158015613e9b575060005481105b15613f7957600081815260046020908152604091829020825160608101845290546001600160a01b0381168252600160a01b81046001600160401b031692820192909252600160e01b90910460ff16151591810182905290613f775780516001600160a01b031615613f0e579392505050565b5060001901600081815260046020908152604091829020825160608101845290546001600160a01b038116808352600160a01b82046001600160401b031693830193909352600160e01b900460ff1615159281019290925215613f72579392505050565b613f0e565b505b604051636f96cda160e11b815260040160405180910390fd5b600082816001600160a01b0382166370a08231336040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260240160206040518083038186803b158015613fe557600080fd5b505afa158015613ff9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061401d9190614e79565b90506000805b8281101561410d5760006001600160a01b038516632f745c59336040516001600160e01b031960e084901b1681526001600160a01b0390911660048201526024810185905260440160206040518083038186803b15801561408357600080fd5b505afa158015614097573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906140bb9190614e79565b60008181526011602052604090205490915060ff166140fa576000818152601160205260409020805460ff191660011790556140f787846156cb565b92505b50806141058161583a565b915050614023565b5095945050505050565b6141213382614540565b600061412b6112ff565b90506141368161455a565b6000918252600f60205260409091206004015550565b600880546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600082816001600160a01b0382166370a08231336040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260240160206040518083038186803b1580156141f157600080fd5b505afa158015614205573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906142299190614e79565b90506000805b8281101561410d5760006001600160a01b038516632f745c59336040516001600160e01b031960e084901b1681526001600160a01b0390911660048201526024810185905260440160206040518083038186803b15801561428f57600080fd5b505afa1580156142a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906142c79190614e79565b60008181526011602052604090205490915060ff166142ed576142ea87846156cb565b92505b50806142f88161583a565b91505061422f565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a02906143359033908990889088906004016153f4565b602060405180830381600087803b15801561434f57600080fd5b505af192505050801561437f575060408051601f3d908101601f1916820190925261437c91810190614d8b565b60015b6143da573d8080156143ad576040519150601f19603f3d011682016040523d82523d6000602084013e6143b2565b606091505b5080516143d2576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490506112f7565b6143ff336001614540565b60006144096112ff565b90506144148161455a565b6000828152600f602052604090206004810191909155805460329190600190614449908490610100900463ffffffff166156e3565b825463ffffffff9182166101009390930a9283029190920219909116179055506000818152600f60205260408120805465ff0000000000191665010000000000179055600c805460ff169161449d83615855565b91906101000a81548160ff021916908360ff1602179055505050565b6060610b818260016000196145af565b6000806144f4836040516020016144e091906153cf565b604051602081830303815290604052614660565b90508051602082016000f091506001600160a01b038216612e745760405163046a55db60e11b815260040160405180910390fd5b6001600160a01b0384161561286f5761286f8261468c565b611dcd8282604051806020016040528060008152506146e1565b600080614568600143615786565b6145739060ff615875565b61457e9060016156cb565b9050600061458c8285615875565b905060008161459b8443615786565b6145a591906156cb565b4095945050505050565b6060833b806145ce575050604080516020810190915260008152610f71565b808411156145ec575050604080516020810190915260008152610f71565b8383101561461e5760405163162544fd60e11b8152600481018290526024810185905260448101849052606401611763565b83830384820360008282106146335782614635565b815b60408051603f8301601f19168101909152818152955090508087602087018a3c505050509392505050565b606081518260405160200161467692919061537e565b6040516020818303038152906040529050919050565b6000614697826119e7565b905063ffffffff811615611dcd576146b0600282615744565b6000838152600f60205260409020805463ffffffff929092166101000264ffffffff00199092169190911790555050565b61100183838360016000546001600160a01b03851661471257604051622e076360e81b815260040160405180910390fd5b836147305760405163b562e8dd60e01b815260040160405180910390fd5b61473d6000868387614528565b6001600160a01b038516600081815260056020908152604080832080546fffffffffffffffffffffffffffffffff1981166001600160401b038083168c0181169182176801000000000000000067ffffffffffffffff1990941690921783900481168c01811690920217909155858452600490925290912080546001600160e01b031916909217600160a01b4290921691909102179055808085018380156147ee57506001600160a01b0387163b15155b15614877575b60405182906001600160a01b038916906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a461483f6000888480600101955088614300565b61485c576040516368d2bf6b60e11b815260040160405180910390fd5b808214156147f457826000541461487257600080fd5b6148bd565b5b6040516001830192906001600160a01b038916906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a480821415614878575b506000556131be565b604051806101c0016040528060008152602001600060ff168152602001600063ffffffff168152602001600015158152602001600015158152602001600060ff16815260200160008152602001606081526020016060815260200160006001600160a01b03168152602001606081526020016060815260200160006001600160a01b03168152602001606081525090565b82805461496390615805565b90600052602060002090601f01602090048101928261498557600085556149cb565b82601f1061499e57805160ff19168380011785556149cb565b828001600101855582156149cb579182015b828111156149cb5782518255916020019190600101906149b0565b506149d7929150614a7e565b5090565b82805482825590600052602060002090600901600a900481019282156149cb5791602002820160005b83821115614a4657835183826101000a81548162ffffff021916908362ffffff1602179055509260200192600301602081600201049283019260010302614a04565b8015614a755782816101000a81549062ffffff0219169055600301602081600201049283019260010302614a46565b50506149d79291505b5b808211156149d75760008155600101614a7f565b6000614aa6614aa1846156a4565b615651565b9050828152838383011115614aba57600080fd5b828260208301376000602084830101529392505050565b600082601f830112614ae1578081fd5b81516020614af1614aa183615681565b80838252828201915082860187848660051b8901011115614b10578586fd5b855b85811015614b2e57815184529284019290840190600101614b12565b5090979650505050505050565b600082601f830112614b4b578081fd5b610f7183833560208501614a93565b600082601f830112614b6a578081fd5b8151614b78614aa1826156a4565b818152846020838601011115614b8c578283fd5b6112f78260208301602087016157c2565b600060208284031215614bae578081fd5b8135610f71816158cb565b60008060408385031215614bcb578081fd5b8251614bd6816158cb565b60208401519092506001600160401b03811115614bf1578182fd5b614bfd85828601614ad1565b9150509250929050565b60008060408385031215614c19578182fd5b8235614c24816158cb565b91506020830135614c34816158cb565b809150509250929050565b600080600060608486031215614c53578081fd5b8335614c5e816158cb565b92506020840135614c6e816158cb565b929592945050506040919091013590565b60008060008060808587031215614c94578182fd5b8435614c9f816158cb565b93506020850135614caf816158cb565b92506040850135915060608501356001600160401b03811115614cd0578182fd5b8501601f81018713614ce0578182fd5b614cef87823560208401614a93565b91505092959194509250565b60008060408385031215614d0d578182fd5b8235614d18816158cb565b91506020830135614c34816158e0565b60008060408385031215614d3a578182fd5b8235614d45816158cb565b946020939093013593505050565b600060208284031215614d64578081fd5b8151610f71816158e0565b600060208284031215614d80578081fd5b8135610f71816158ee565b600060208284031215614d9c578081fd5b8151610f71816158ee565b600060208284031215614db8578081fd5b81356001600160401b03811115614dcd578182fd5b6112f784828501614b3b565b600060208284031215614dea578081fd5b81516001600160401b03811115614dff578182fd5b6112f784828501614b5a565b60008060408385031215614e1d578182fd5b82356001600160401b0380821115614e33578384fd5b614e3f86838701614b3b565b93506020850135915080821115614e54578283fd5b50614bfd85828601614b3b565b600060208284031215614e72578081fd5b5035919050565b600060208284031215614e8a578081fd5b5051919050565b60008060408385031215614ea3578182fd5b823591506020830135614c34816158cb565b600080600060608486031215614ec9578081fd5b833592506020808501356001600160401b03811115614ee6578283fd5b8501601f81018713614ef6578283fd5b8035614f04614aa182615681565b8082825284820191508484018a868560051b8701011115614f23578687fd5b8694505b83851015614f4e578035614f3a81615904565b835260019490940193918501918501614f27565b5096999698505050506040949094013593505050565b600080600060608486031215614f78578081fd5b833592506020808501356001600160401b03811115614f95578283fd5b8501601f81018713614fa5578283fd5b8035614fb3614aa182615681565b8082825284820191508484018a868560051b8701011115614fd2578687fd5b8694505b83851015614f4e578035835260019490940193918501918501614fd6565b60008060008060808587031215615009578182fd5b845193506020808601516001600160401b0380821115615027578485fd5b61503389838a01614b5a565b95506040880151915080821115615048578485fd5b61505489838a01614ad1565b94506060880151915080821115615069578384fd5b508601601f8101881361507a578283fd5b8051615088614aa182615681565b8082825284820191508484018b868560051b87010111156150a7578687fd5b8694505b838510156150d25780516150be81615904565b8352600194909401939185019185016150ab565b50979a9699509497505050505050565b6000806000606084860312156150f6578081fd5b8335925060208401356001600160401b03811115615112578182fd5b61511e86828701614b3b565b925050604084013590509250925092565b60008060408385031215615141578182fd5b50508035926020909101359150565b60008060408385031215615162578182fd5b82359150602083013563ffffffff81168114614c34578182fd5b60006020828403121561518d578081fd5b815160ff81168114610f71578182fd5b6000815180845260208085019450808401835b838110156151d157815162ffffff16875295820195908201906001016151b0565b509495945050505050565b6000815180845260208085019450808401835b838110156151d1578151875295820195908201906001016151ef565b600081518084526152238160208601602086016157c2565b601f01601f19169290920160200192915050565b60006101c0825184526020830151615254602086018260ff169052565b50604083015161526c604086018263ffffffff169052565b506060830151615280606086018215159052565b506080830151615294608086018215159052565b5060a08301516152a960a086018260ff169052565b5060c083015160c085015260e08301518160e08601526152cb8286018261520b565b91505061010080840151858303828701526152e6838261520b565b9250505061012080840151615305828701826001600160a01b03169052565b5050610140808401518583038287015261531f83826151dc565b92505050610160808401518583038287015261533b838261519d565b925050506101808084015161535a828701826001600160a01b03169052565b50506101a08084015185830382870152615374838261520b565b9695505050505050565b606360f81b815260e083901b6001600160e01b03191660018201526880600e6000396000f360b81b600582015281516000906153c181600e8501602087016157c2565b91909101600e019392505050565b600080825282516153e78160018501602087016157c2565b9190910160010192915050565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906153749083018461520b565b6001600160a01b03831681526040602082018190526000906112f7908301846151dc565b602081526000610f71602083018461520b565b604081526000615471604083018561520b565b8281036020840152615483818561520b565b95945050505050565b60408152600061549f604083018561520b565b60208382038185015282855484600182811c9150808316806154c257607f831692505b8583108114156154e057634e487b7160e01b88526022600452602488fd5b8287526020870196508080156154fd576001811461550e57615538565b60ff19851688528688019550615538565b60008b815260209020895b858110156155325781548a820152908401908801615519565b89019650505b50939a9950505050505050505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b602081526000610f716020830184615237565b6040815260006155da6040830185615237565b90508260208301529392505050565b60ff8916815263ffffffff88166020820152861515604082015285151560608201526001600160a01b038581166080830152841660a082015261010060c0820181905260009061563b8382018661520b565b9150508260e08301529998505050505050505050565b604051601f8201601f191681016001600160401b0381118282101715615679576156796158b5565b604052919050565b60006001600160401b0382111561569a5761569a6158b5565b5060051b60200190565b60006001600160401b038211156156bd576156bd6158b5565b50601f01601f191660200190565b600082198211156156de576156de615889565b500190565b600063ffffffff80831681851680830382111561570257615702615889565b01949350505050565b600060ff821660ff84168060ff0382111561572857615728615889565b019392505050565b60008261573f5761573f61589f565b500490565b600063ffffffff8084168061575b5761575b61589f565b92169190910492915050565b600081600019048311821515161561578157615781615889565b500290565b60008282101561579857615798615889565b500390565b600063ffffffff838116908316818110156157ba576157ba615889565b039392505050565b60005b838110156157dd5781810151838201526020016157c5565b8381111561286f5750506000910152565b6000816157fd576157fd615889565b506000190190565b600181811c9082168061581957607f821691505b60208210811415612e7457634e487b7160e01b600052602260045260246000fd5b600060001982141561584e5761584e615889565b5060010190565b600060ff821660ff81141561586c5761586c615889565b60010192915050565b6000826158845761588461589f565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114612b5457600080fd5b8015158114612b5457600080fd5b6001600160e01b031981168114612b5457600080fd5b62ffffff81168114612b5457600080fdfea264697066735822122007731cc5e3b305251a4f1e3247be1ef32867de7db4f3285177f22145cba69ad164736f6c63430008040033
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.