Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 2,018 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Raid Dungeon | 19765235 | 115 days ago | IN | 0 ETH | 0.00137123 | ||||
Raid Dungeon | 19765212 | 115 days ago | IN | 0 ETH | 0.00162013 | ||||
Raid Dungeon | 19765172 | 115 days ago | IN | 0 ETH | 0.00156064 | ||||
Raid Dungeon | 19758036 | 116 days ago | IN | 0 ETH | 0.00134075 | ||||
Raid Dungeon | 19758032 | 116 days ago | IN | 0 ETH | 0.00114241 | ||||
Raid Dungeon | 19758028 | 116 days ago | IN | 0 ETH | 0.00092646 | ||||
Raid Dungeon | 19758016 | 116 days ago | IN | 0 ETH | 0.00095913 | ||||
Raid Dungeon | 19750833 | 117 days ago | IN | 0 ETH | 0.00107741 | ||||
Raid Dungeon | 19750827 | 117 days ago | IN | 0 ETH | 0.0010699 | ||||
Raid Dungeon | 19750820 | 117 days ago | IN | 0 ETH | 0.00114642 | ||||
Raid Dungeon | 19750812 | 117 days ago | IN | 0 ETH | 0.00107331 | ||||
Raid Dungeon | 19750790 | 117 days ago | IN | 0 ETH | 0.00105084 | ||||
Raid Dungeon | 19743678 | 118 days ago | IN | 0 ETH | 0.00107539 | ||||
Raid Dungeon | 19743674 | 118 days ago | IN | 0 ETH | 0.001075 | ||||
Raid Dungeon | 19743662 | 118 days ago | IN | 0 ETH | 0.0011088 | ||||
Raid Dungeon | 19743633 | 118 days ago | IN | 0 ETH | 0.001128 | ||||
Raid Dungeon | 19736607 | 119 days ago | IN | 0 ETH | 0.00125572 | ||||
Raid Dungeon | 19736289 | 119 days ago | IN | 0 ETH | 0.00102406 | ||||
Raid Dungeon | 19736281 | 119 days ago | IN | 0 ETH | 0.00118828 | ||||
Raid Dungeon | 19736264 | 119 days ago | IN | 0 ETH | 0.00106905 | ||||
Raid Dungeon | 18354560 | 312 days ago | IN | 0 ETH | 0.00110544 | ||||
Raid Dungeon | 18345530 | 314 days ago | IN | 0 ETH | 0.00111134 | ||||
Raid Dungeon | 18312837 | 318 days ago | IN | 0 ETH | 0.0020098 | ||||
Raid Dungeon | 18290089 | 321 days ago | IN | 0 ETH | 0.00144713 | ||||
Raid Dungeon | 18282618 | 322 days ago | IN | 0 ETH | 0.00126795 |
Latest 25 internal transactions (View All)
Advanced mode:
Parent Transaction Hash | Block | From | To | |||
---|---|---|---|---|---|---|
15084514 | 779 days ago | 4.48 ETH | ||||
14500436 | 874 days ago | 0.01 ETH | ||||
14443685 | 883 days ago | 0.01 ETH | ||||
14416589 | 887 days ago | 0.01 ETH | ||||
14405994 | 889 days ago | 0.01 ETH | ||||
14403538 | 889 days ago | 0.01 ETH | ||||
14400366 | 890 days ago | 0.01 ETH | ||||
14386748 | 892 days ago | 0.01 ETH | ||||
14379658 | 893 days ago | 0.01 ETH | ||||
14377464 | 893 days ago | 0.01 ETH | ||||
14374656 | 894 days ago | 0.01 ETH | ||||
14370705 | 894 days ago | 0.01 ETH | ||||
14368522 | 895 days ago | 0.01 ETH | ||||
14366363 | 895 days ago | 0.01 ETH | ||||
14366359 | 895 days ago | 0.01 ETH | ||||
14366358 | 895 days ago | 0.01 ETH | ||||
14366350 | 895 days ago | 0.09 ETH | ||||
14366349 | 895 days ago | 0.01 ETH | ||||
14366349 | 895 days ago | 0.01 ETH | ||||
14366348 | 895 days ago | 0.01 ETH | ||||
14366348 | 895 days ago | 0.01 ETH | ||||
14366346 | 895 days ago | 0.01 ETH | ||||
14366346 | 895 days ago | 0.01 ETH | ||||
14366339 | 895 days ago | 0.01 ETH | ||||
14363214 | 896 days ago | 0.01 ETH |
Loading...
Loading
Contract Name:
Dungeon2
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: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "./LootClassification2.sol"; import "./Relic.sol"; import "hardhat/console.sol"; interface Loot { function ownerOf(uint256 tokenId) external view returns (address); } contract Dungeon2 is Ownable, IRelicMinter { uint256[] public _dungeons; uint256[] public _relicAwardsByDungeonRank; uint256 public _relicAwardBrackets; uint256 _nextDungeonCompleteRank; mapping(uint256 => uint256) _raids; // maps tokenId => packed raid data Loot internal _loot; LootClassification internal _lootClassification; Relic internal _relic; string public _imageBaseURL; mapping(address => uint256) public _lastFreeRaidForAddress; // address => last free raid block number uint256 public _raidingFee; bool public _raidingLocked; uint256 public _blocksBetweenFreeRaids; struct AwardBracket { uint256 max; uint256 relics; } string constant _EnemiesTag = "ENEMIES"; uint256 constant ENEMY_COUNT = 18; string[] private _enemies = [ // vulnerable to Warriors "Orcs", "Giant Spiders", "Trolls", "Zombies", "Giant Rats", // vulnerable to Hunters "Minotaurs", "Werewolves", "Berserkers", "Goblins", "Gnomes", // vulnerable to Mages (wands) "Ghouls", "Wraiths", "Skeletons", "Revenants", // vulnerable to Mages (books) "Necromancers", "Warlocks", "Wizards", "Druids" ]; string constant _TrapsTag = "TRAPS"; uint256 constant TRAP_COUNT = 15; string[] private _traps = [ // vulnerable to Mages "Trap Doors", "Poison Darts", "Flame Jets", "Poisoned Well", "Falling Net", // vulnerable to Hunters "Blinding Light", "Lightning Bolts", "Pendulum Blades", "Snake Pits", "Poisonous Gas", // vulnerable to Warrirors "Lava Pits", "Burning Oil", "Fire-Breathing Gargoyle", "Hidden Arrows", "Spiked Pits" ]; string constant _MonsterTag = "MONSTERS"; uint256 constant MONSTER_COUNT = 15; string[] private _bossMonsters = [ // vulnerable to Warrirors "Golden Dragon", "Black Dragon", "Bronze Dragon", "Red Dragon", "Wyvern", // vulnerable to Hunters "Fire Giant", "Storm Giant", "Ice Giant", "Frost Giant", "Hill Giant", // vulnerable to Mages "Ogre", "Skeleton Lords", "Knights of Chaos", "Lizard Kings", "Medusa" ]; string constant _ArtefactTag = "ARTEFACTS"; uint256 constant ARTEFACT_COUNT = 15; string[] private _artefacts = [ // vulnerable to Warrirors "The Purple Orb of Zhang", "The Horn of Calling", "The Wondrous Twine of Ping", "The Circle of Squares", "The Scroll of Serpents", // vulnerable to Hunters "The Rod of Runes", "Crystal of Crimson Light", "Oil of Darkness", "Bonecrusher Bag", "Mirror of Madness", // vulnerable to Mages "Ankh of the Ancients", "The Wand of Fear", "The Tentacles of Terror", "The Altar of Ice", "The Creeping Hand" ]; string constant _PassagewaysTag = "PASSAGEWAYS"; uint256 constant PASSAGEWAYS_COUNT = 15; string[] private _passageways = [ // vulnerable to Warrirors "Crushing Walls", "Loose Logs", "Rolling Rocks", "Spiked Floor", "Burning Coals", // vulnerable to Hunters "The Hidden Pit of Doom", "The Sticky Stairs", "The Bridge of Sorrow", "The Maze of Madness", "The Flooded Tunnel", // vulnerable to Mages "The Floor of Fog", "The Frozen Floor", "The Shifting Sands", "The Trembling Trap", "The Broken Glass Floor" ]; string constant _RoomsTag = "ROOMS"; uint256 constant ROOM_COUNT = 15; string[] private _rooms = [ // vulnerable to Warrirors "Room of Undead Hands", "Room of the Stone Claws", "Room of Poison Arrows", "Room of the Iron Bear", "Room of the Wandering Worm", // vulnerable to Hunters "Room of the Infernal Beast", "Room of the Infected Slime", "Room of the Horned Rats", "Room of the Flaming Hounds", "Room of the Million Maggots", // vulnerable to Mages "Room of the Flaming Pits", "Room of the Rabid Flesh Eaters", "Room of the Grim Golem", "Room of the Chaos Firebreathers", "Room of the Nightmare Clones" ]; string constant _TheSoullessTag = "SOULLESS"; uint256 constant SOULLESS_COUNT = 3; string[] private _theSoulless = [ "Lich Queen", "Zombie Lord", "The Grim Reaper" ]; string constant _DemiGodTag = "ELEMENTS"; uint256 constant DEMIGOD_COUNT = 5; string[] private _demiGods = [ "The Bone Demon", "The Snake God", "The Howling Banshee", "Demonspawn", "The Elementals" ]; function numDungeons() public view returns(uint256) { return _dungeons.length; } function getTraitIndex(uint256 dungeonId, string memory traitName, uint256 traitCount) private pure returns (uint256) { return pluckDungeonTrait(dungeonId, traitName, traitCount); } function getTraitName(uint256 dungeonId, string memory traitName, string[] storage traitList) private view returns (string memory) { uint256 index = getTraitIndex(dungeonId, traitName, traitList.length); return traitList[index]; } function enemiesIndex(uint256 dungeonId) private pure returns (uint256) { return getTraitIndex(dungeonId, _EnemiesTag, ENEMY_COUNT); } function trapsIndex(uint256 dungeonId) private pure returns (uint256) { return getTraitIndex(dungeonId, _TrapsTag, TRAP_COUNT); } function monsterIndex(uint256 dungeonId) private pure returns (uint256) { return getTraitIndex(dungeonId, _MonsterTag, MONSTER_COUNT); } function artefactsIndex(uint256 dungeonId) private pure returns (uint256) { return getTraitIndex(dungeonId, _ArtefactTag, ARTEFACT_COUNT); } function passagewaysIndex(uint256 dungeonId) private pure returns (uint256) { return getTraitIndex(dungeonId, _PassagewaysTag, PASSAGEWAYS_COUNT); } function roomsIndex(uint256 dungeonId) private pure returns (uint256) { return getTraitIndex(dungeonId, _RoomsTag, ROOM_COUNT); } function soullessIndex(uint256 dungeonId) private pure returns (uint256) { return getTraitIndex(dungeonId, _TheSoullessTag, SOULLESS_COUNT); } function demiGodIndex(uint256 dungeonId) private pure returns (uint256) { return getTraitIndex(dungeonId, _DemiGodTag, DEMIGOD_COUNT); } function getEnemies(uint256 dungeonId) public view returns (string memory) { return getTraitName(dungeonId, _EnemiesTag, _enemies); } function getTraps(uint256 dungeonId) public view returns (string memory) { return getTraitName(dungeonId, _TrapsTag, _traps); } function getBossMonster(uint256 dungeonId) public view returns (string memory) { return getTraitName(dungeonId, _MonsterTag, _bossMonsters); } function getArtefact(uint256 dungeonId) public view returns (string memory) { return getTraitName(dungeonId, _ArtefactTag, _artefacts); } function getPassageways(uint256 dungeonId) public view returns (string memory) { return getTraitName(dungeonId, _PassagewaysTag, _passageways); } function getRooms(uint256 dungeonId) public view returns (string memory) { return getTraitName(dungeonId, _RoomsTag, _rooms); } function getTheSoulless(uint256 dungeonId) public view returns (string memory) { return getTraitName(dungeonId, _TheSoullessTag, _theSoulless); } function getDemiGod(uint256 dungeonId) public view returns (string memory) { return getTraitName(dungeonId, _DemiGodTag, _demiGods); } function pluckDungeonTrait(uint256 dungeonId, string memory keyPrefix, uint256 traitCount) internal pure returns (uint256) { uint256 rand = random(string(abi.encodePacked(keyPrefix, Strings.toString(dungeonId + 16)))); uint256 index = rand % traitCount; return index; } constructor( uint16 dungeonCount, uint[8] memory startHitPoints, uint256[] memory relicAwards, address raidTokenContract, address lootClassificationAddress, address relicAddress, string memory imageBaseURL, uint256 raidingFee, uint256 blocksBetweenFreeRaids, AwardBracket[] memory awardBrackets ) { _loot = Loot(raidTokenContract); _lootClassification = LootClassification(lootClassificationAddress); _relic = Relic(relicAddress); _relicAwardsByDungeonRank = relicAwards; _nextDungeonCompleteRank = 0; _imageBaseURL = imageBaseURL; _raidingFee = raidingFee; _raidingLocked = true; _blocksBetweenFreeRaids = blocksBetweenFreeRaids; for (uint16 i = 0; i < dungeonCount; i++) { _dungeons.push(packDungeon(dungeonCount, startHitPoints, 0)); } uint256 relicAwardBrackets; require(awardBrackets.length <= 16); for (uint16 i = 0; i < awardBrackets.length; i++) { relicAwardBrackets |= (awardBrackets[i].max | (awardBrackets[i].relics << 8)) << (i * 16); } _relicAwardBrackets = relicAwardBrackets; } event Raid ( uint256 indexed dungeonId, uint256 raidTokenId, uint256[8] damage ); function raidDungeon(uint dungeonId, uint256 raidTokenId) public payable { require(!_raidingLocked, "raiding is locked"); require(_raids[raidTokenId] == 0, "loot already used in a raid"); require(msg.sender == _loot.ownerOf(raidTokenId), "raider does not own loot"); uint256 dungeonCount = _dungeons.length; require(dungeonId < dungeonCount, "invalid dungeon"); uint256 fee = _raidingFee; if (canRaidFree()) { fee = 0; _lastFreeRaidForAddress[msg.sender] = block.number; } require(msg.value >= fee, "not enough eth sent"); if (msg.value > fee) { payable(msg.sender).transfer(msg.value - fee); } (uint256 rank, uint256[8] memory dungeonHitPoints, uint256 rewardOffset) = unpackDungeon(_dungeons[dungeonId]); require(rank == dungeonCount, "dungeon already complete"); uint256[9] memory raidHitPoints = _getRaidHitPoints(dungeonId, dungeonHitPoints, raidTokenId); require(raidHitPoints[8] > 0, "raid would have no affect"); bool complete = true; uint256 dungeonTotalHp; for (uint i = 0; i < 8; i++) { dungeonTotalHp += dungeonHitPoints[i]; // it's safe to blind delete the raidHitPoints from the dungeonHitPoints // because the _getRaidHitPoints already limits them to dungeonHitPoints dungeonHitPoints[i] -= raidHitPoints[i]; if (dungeonHitPoints[i] > 0) { complete = false; } } uint256 rewardCount = getRewardCount(raidHitPoints[8]); _raids[raidTokenId] = packRaid(dungeonId, rewardOffset, rewardCount); rewardOffset += rewardCount; if (complete) { rank = _nextDungeonCompleteRank; _nextDungeonCompleteRank++; } _dungeons[dungeonId] = packDungeon(rank, dungeonHitPoints, rewardOffset); emit Raid(dungeonId, raidTokenId, [ raidHitPoints[0], raidHitPoints[1], raidHitPoints[2], raidHitPoints[3], raidHitPoints[4], raidHitPoints[5], raidHitPoints[6], raidHitPoints[7]]); } function getRewardBrackets() public view returns (AwardBracket[] memory) { uint256 bracketCount; for (uint256 i = 1; i <= 16; ++i) { if ((_relicAwardBrackets >> (i * 16)) == 0) { bracketCount = i; break; } } AwardBracket[] memory relicAwardBrackets = new AwardBracket[](bracketCount); for (uint256 i = 0; i < bracketCount; ++i) { uint256 packedBracket = (_relicAwardBrackets >> (i * 16)) & 0xffff; relicAwardBrackets[i].max = packedBracket & 0xff; relicAwardBrackets[i].relics = packedBracket >> 8; } return relicAwardBrackets; } function getRewardCount(uint256 damage) public view returns(uint256 rewardCount) { for (uint256 i = 0; i < 16; i++) { uint256 packedBracket = (_relicAwardBrackets >> (i * 16)) & 0xffff; if (damage > (packedBracket & 0xff)) { continue; } return packedBracket >> 8; } require(false, 'invalid reward brackets configured'); } function canRaidFree() public view returns(bool) { return (block.number - _lastFreeRaidForAddress[msg.sender]) > _blocksBetweenFreeRaids; } function withdraw() public onlyOwner { (bool sent,) = owner().call{value: address(this).balance}(""); require(sent, "failed to send"); } function setRaidingLock(bool locked) external onlyOwner { _raidingLocked = locked; } function setRaidingFee(uint256 raidingFee) external onlyOwner { _raidingFee = raidingFee; } function setBlocksBetweenFreeRaids(uint256 blocksBetweenFreeRaids) external onlyOwner { _blocksBetweenFreeRaids = blocksBetweenFreeRaids; } function packRaid(uint256 dungeonId, uint256 rewardFirstId, uint256 rewardCount) private pure returns(uint256) { return 1 | (dungeonId << 8) | (rewardFirstId << 16) | (rewardCount << 32); } function unpackRaid(uint256 packed) private pure returns(uint256 dungeonId, uint256 rewardFirstId, uint256 rewardCount) { dungeonId = (packed >> 8) & 0xff; rewardFirstId = (packed >> 16) & 0xffff; rewardCount = (packed >> 32) & 0xff; } function packDungeon(uint256 rank, uint256[8] memory hitPoints, uint256 raidRewardOffset) private pure returns(uint256) { return rank | (hitPoints[0] << 8) | (hitPoints[1] << 16) | (hitPoints[2] << 24) | (hitPoints[3] << 32) | (hitPoints[4] << 40) | (hitPoints[5] << 48) | (hitPoints[6] << 56) | (hitPoints[7] << 64) | (raidRewardOffset << 72); } function unpackDungeon(uint256 packed) private pure returns(uint256 rank, uint256[8] memory hitPoints, uint256 raidRewardOffset) { rank = packed & 0xff; hitPoints[0] = (packed >> 8) & 0xff; hitPoints[1] = (packed >> 16) & 0xff; hitPoints[2] = (packed >> 24) & 0xff; hitPoints[3] = (packed >> 32) & 0xff; hitPoints[4] = (packed >> 40) & 0xff; hitPoints[5] = (packed >> 48) & 0xff; hitPoints[6] = (packed >> 56) & 0xff; hitPoints[7] = (packed >> 64) & 0xff; raidRewardOffset = (packed >> 72) & 0xffff; } struct DungeonInfo { uint256 orderIndex; string enemies; string traps; string bossMonster; string artefact; string passageways; string rooms; string theSoulless; string demiGod; uint256[8] hitPoints; bool isOpen; uint256 rank; int256 rewards; } function getDungeons() external view returns(DungeonInfo[] memory) { DungeonInfo[] memory dungeonInfo = new DungeonInfo[](_dungeons.length); for (uint256 i = 0; i < _dungeons.length; ++i) { dungeonInfo[i].orderIndex = getDungeonOrderIndex(i); dungeonInfo[i].enemies = getEnemies(i); dungeonInfo[i].traps = getTraps(i); dungeonInfo[i].bossMonster = getBossMonster(i); dungeonInfo[i].artefact = getArtefact(i); dungeonInfo[i].passageways = getPassageways(i); dungeonInfo[i].rooms = getRooms(i); dungeonInfo[i].theSoulless = getTheSoulless(i); dungeonInfo[i].demiGod = getDemiGod(i); dungeonInfo[i].hitPoints = getDungeonRemainingHitPoints(i); dungeonInfo[i].isOpen = getDungeonOpen(i); dungeonInfo[i].rank = getDungeonRank(i); dungeonInfo[i].rewards = getDungeonRewardToken(i); } return dungeonInfo; } function getDungeonOrderIndex(uint dungeonId) pure public returns (uint) { return dungeonId % 16; } function getItemHitPoints( uint256 dungeonId, uint256[6] memory lootComponents, string memory traitName, uint256 traitCount, LootClassification.Type lootType) internal view returns(uint) { uint256 dungeonTraitIndex = getTraitIndex(dungeonId, traitName, traitCount); uint256 lootTypeIndex = lootComponents[0]; // Hit points awarded for following // perfect match: 1 // class match with high enough rank: 1 // order match: 2 // order match "+1": 1 bool orderMatch = lootComponents[1] == (getDungeonOrderIndex(dungeonId) + 1); uint256 orderScore; if (orderMatch) { orderScore = 2; if (lootComponents[4] > 0) { orderScore += 1; } } if (dungeonTraitIndex == lootTypeIndex) { // perfect match (and presumed class match) return orderScore + 2; } // there is an order match but not direct hit // if the item is of the correct class and more powerful than exact macth get the order orderScore LootClassification.Class dungeonClass = _lootClassification.getClass(lootType, dungeonTraitIndex); LootClassification.Class lootClass = _lootClassification.getClass(lootType, lootTypeIndex); if (dungeonClass == lootClass && dungeonClass != LootClassification.Class.Any) { uint256 dungeonRank = _lootClassification.getRank(lootType, dungeonTraitIndex); uint256 lootRank = _lootClassification.getRank(lootType, lootTypeIndex); if (lootRank <= dungeonRank) { // class hit of high enough rank return orderScore + 1; } } return orderScore; } function applyRaidItem( uint raidIndex, uint256 raidScore, uint256 maxScore, uint256[9] memory results) pure private { uint256 score = (raidScore > maxScore) ? maxScore : raidScore; results[raidIndex] = score; results[8] += score; } function getRaidHitPoints( uint256 dungeonId, uint256 lootToken) view public returns(uint256[9] memory) { (,uint256[8] memory currentHitPoints,) = unpackDungeon(_dungeons[dungeonId]); return _getRaidHitPoints(dungeonId, currentHitPoints, lootToken); } function getRaidHitPointsBatch( uint256 dungeonId, uint256[] memory lootTokens) view public returns(uint256[9][] memory hitPoints) { hitPoints = new uint256[9][](lootTokens.length); (,uint256[8] memory currentHitPoints,) = unpackDungeon(_dungeons[dungeonId]); for (uint256 i = 0; i < lootTokens.length; ++i) { hitPoints[i] = _getRaidHitPoints(dungeonId, currentHitPoints, lootTokens[i]); } return hitPoints; } // returns an array of 8 hitpoints these raids would achieved plus a total in the 9th array slot function _getRaidHitPoints( uint256 dungeonId, uint256[8] memory currentHitPoints, uint256 lootToken) view private returns(uint256[9] memory) { uint256[8] memory itemScores; uint256[9] memory results; if (_raids[lootToken] != 0) { return results; } LootClassification lootClassification = _lootClassification; if (currentHitPoints[0] > 0) { uint256[6] memory weapon = lootClassification.weaponComponents(lootToken); itemScores[0] = getItemHitPoints(dungeonId, weapon, _EnemiesTag, ENEMY_COUNT, LootClassification.Type.Weapon); } if (currentHitPoints[1] > 0) { uint256[6] memory chest = lootClassification.chestComponents(lootToken); itemScores[1] = getItemHitPoints(dungeonId, chest, _TrapsTag, TRAP_COUNT, LootClassification.Type.Chest); } if (currentHitPoints[2] > 0) { uint256[6] memory head = lootClassification.headComponents(lootToken); itemScores[2] = getItemHitPoints(dungeonId, head, _MonsterTag, MONSTER_COUNT, LootClassification.Type.Head); } if (currentHitPoints[3] > 0) { uint256[6] memory waist = lootClassification.waistComponents(lootToken); itemScores[3] = getItemHitPoints(dungeonId, waist, _ArtefactTag, ARTEFACT_COUNT, LootClassification.Type.Waist); } if (currentHitPoints[4] > 0) { uint256[6] memory foot = lootClassification.footComponents(lootToken); itemScores[4] = getItemHitPoints(dungeonId, foot, _PassagewaysTag, PASSAGEWAYS_COUNT, LootClassification.Type.Foot); } if (currentHitPoints[5] > 0) { uint256[6] memory hand = lootClassification.handComponents(lootToken); itemScores[5] = getItemHitPoints(dungeonId, hand, _RoomsTag, ROOM_COUNT, LootClassification.Type.Hand); } if (currentHitPoints[6] > 0) { uint256[6] memory neck = lootClassification.neckComponents(lootToken); itemScores[6] = getItemHitPoints(dungeonId, neck, _TheSoullessTag, SOULLESS_COUNT, LootClassification.Type.Neck); } if (currentHitPoints[7] > 0) { uint256[6] memory ring = lootClassification.ringComponents(lootToken); itemScores[7] = getItemHitPoints(dungeonId, ring, _DemiGodTag, DEMIGOD_COUNT, LootClassification.Type.Ring); } for (uint i = 0; i < 8; i++) { applyRaidItem(i, itemScores[i], currentHitPoints[i], results); } return results; } function getDungeonCount() view public returns(uint256) { if (_dungeons.length == 0) { return 99; } return _dungeons.length; } function getDungeonRemainingHitPoints(uint256 dungeonId) view public returns(uint256[8] memory hitPoints) { (,hitPoints,) = unpackDungeon(_dungeons[dungeonId]); } function getDungeonRank(uint256 dungeonId) view public returns(uint256 rank) { (rank,,) = unpackDungeon(_dungeons[dungeonId]); } function getDungeonOpen(uint256 dungeonId) view public returns(bool) { if (dungeonId >= _dungeons.length) { return false; } return getDungeonRank(dungeonId) == _dungeons.length; } function getDungeonRewardToken(uint256 dungeonId) view public returns (int256) { if (dungeonId >= _dungeons.length) { return -1; } uint256 rank = getDungeonRank(dungeonId); if (rank >= _dungeons.length) { return -1; } return int256(_relicAwardsByDungeonRank[rank]); } function _getRewardsForToken(Loot loot, uint256 dungeonCount, uint256 tokenId) private view returns(uint256 dungeonId, uint256 rewardFirstId, uint256 rewardCount) { require(msg.sender == loot.ownerOf(tokenId), "sender isn't owner of loot"); uint256 packedRaid = _raids[tokenId]; require(packedRaid != 0, "loot bag not used in raid"); (dungeonId, rewardFirstId, rewardCount) = unpackRaid(packedRaid); require(dungeonId < dungeonCount, "invalid dungeon id"); (uint256 rank,,) = unpackDungeon(_dungeons[dungeonId]); require(rank < dungeonCount, "dungeon still open"); rewardFirstId += _relicAwardsByDungeonRank[rank]; } function getRewardsForToken(uint256 tokenId) public view returns(uint256 dungeonId, uint256 rewardFirstId, uint256 rewardCount) { return _getRewardsForToken(_loot, _dungeons.length, tokenId); } function getRewardsForTokens(uint256[] memory tokenIds) public view returns( uint256[] memory dungeonId, uint256[] memory rewardFirstId, uint256[] memory rewardCount) { dungeonId = new uint256[](tokenIds.length); rewardFirstId = new uint256[](tokenIds.length); rewardCount = new uint256[](tokenIds.length); Loot loot = _loot; uint256 dungeonCount = _dungeons.length; for (uint256 i = 0; i < tokenIds.length; ++i) { (dungeonId[i], rewardFirstId[i], rewardCount[i]) = _getRewardsForToken(loot, dungeonCount, tokenIds[i]); } } function claimRewards(uint256[] memory tokenIds) public { uint256 dungeonCount = _dungeons.length; Loot loot = _loot; Relic relic = _relic; for (uint256 i = 0; i < tokenIds.length; ++i) { (uint256 dungeonId, uint256 rewardFirstId, uint256 rewardCount) = _getRewardsForToken(loot, dungeonCount, tokenIds[i]); bytes12 data = bytes12(uint96(dungeonId & 0xffffffffffffffffffffffff)); for (uint256 j = 0; j < rewardCount; ++j) { relic.mint(msg.sender, rewardFirstId + j, data); } } } // // *** Copied from Loot *** // function random(string memory input) internal pure returns (uint256) { return uint256(keccak256(abi.encodePacked(input))); } // // *** IRelicMinter Interface *** // function setImageBaseURL(string memory newImageBaseURL) public onlyOwner { _imageBaseURL = newImageBaseURL; } function getTokenOrderIndex(uint256 /*tokenId*/, bytes12 data) external override pure returns(uint) { uint96 dungeonId = uint96(data); return getDungeonOrderIndex(dungeonId); } function getTokenProvenance(uint256 /*tokenId*/, bytes12 /*data*/) external override pure returns(string memory) { return "The Crypt: Chapter Two"; } function getAdditionalAttributes(uint256 /*tokenId*/, bytes12 /*data*/) external override pure returns(string memory) { return ""; } function getImageBaseURL() external override view returns(string memory) { return _imageBaseURL; } }
// 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 (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 pragma solidity ^0.8.0; // v2 of LootClassification copied from https://github.com/playmint/loot-classification/tree/f8d64e4ea071585cbb505ed795491573ad5f9135 /* LootCLassification.sol Lootverse Utility contract to classifyitems found in Loot (For Adventurers) Bags. See OG Loot Contract for lists of all possible items. https://etherscan.io/address/0xff9c1b15b16263c61d017ee9f65c50e4ae0113d7 All functions are made public incase they are useful but the expected use is through the main 3 classification functions: - getRank() - getClass() - getMaterial() - getLevel() Each of these take an item 'Type' (weapon, chest, head etc.) and an index into the list of all possible items of that type as found in the OG Loot contract. The LootComponents(0x3eb43b1545a360d1D065CB7539339363dFD445F3) contract can be used to get item indexes from Loot bag tokenIDs. The code from LootComponents is copied into this contract and rewritten for gas efficiency So a typical use might be: // get weapon classification for loot bag# 1234 { LootClassification classification = LootClassification(_TBD_); uint256[5] memory weaponComponents = classification.weaponComponents(1234); uint256 index = weaponComponents[0]; LootClassification.Type itemType = LootClassification.Type.Weapon; LootClassification.Class class = classification.getClass(itemType, index); LootClassification.Material material = classification.getMaterial(itemType, index); uint256 rank = classification.getRank(itemType, index); uint256 level = classification.getLevel(itemType, index); } */ contract LootClassification { enum Type { Weapon, Chest, Head, Waist, Foot, Hand, Neck, Ring } enum Material { Heavy, Medium, Dark, Light, Cloth, Hide, Metal, Jewellery } enum Class { Warrior, Hunter, Mage, Any } uint256 constant public WeaponLastHeavyIndex = 4; uint256 constant public WeaponLastMediumIndex = 9; uint256 constant public WeaponLastDarkIndex = 13; function getWeaponMaterial(uint256 index) pure public returns(Material) { if (index <= WeaponLastHeavyIndex) return Material.Heavy; if (index <= WeaponLastMediumIndex) return Material.Medium; if (index <= WeaponLastDarkIndex) return Material.Dark; return Material.Light; } function getWeaponRank(uint256 index) pure public returns (uint256) { if (index <= WeaponLastHeavyIndex) return index + 1; if (index <= WeaponLastMediumIndex) return index - 4; if (index <= WeaponLastDarkIndex) return index - 9; return index -13; } uint256 constant public ChestLastClothIndex = 4; uint256 constant public ChestLastLeatherIndex = 9; function getChestMaterial(uint256 index) pure public returns(Material) { if (index <= ChestLastClothIndex) return Material.Cloth; if (index <= ChestLastLeatherIndex) return Material.Hide; return Material.Metal; } function getChestRank(uint256 index) pure public returns (uint256) { if (index <= ChestLastClothIndex) return index + 1; if (index <= ChestLastLeatherIndex) return index - 4; return index - 9; } // Head, waist, foot and hand items all follow the same classification pattern, // so they are generalised as armour. uint256 constant public ArmourLastMetalIndex = 4; uint256 constant public ArmourLasLeatherIndex = 9; function getArmourMaterial(uint256 index) pure public returns(Material) { if (index <= ArmourLastMetalIndex) return Material.Metal; if (index <= ArmourLasLeatherIndex) return Material.Hide; return Material.Cloth; } function getArmourRank(uint256 index) pure public returns (uint256) { if (index <= ArmourLastMetalIndex) return index + 1; if (index <= ArmourLasLeatherIndex) return index - 4; return index - 9; } function getRingRank(uint256 index) pure public returns (uint256) { if (index > 2) return 1; else return index + 1; } function getNeckRank(uint256 /*index*/) pure public returns (uint256) { return 1; } function getMaterial(Type lootType, uint256 index) pure public returns (Material) { if (lootType == Type.Weapon) return getWeaponMaterial(index); if (lootType == Type.Chest) return getChestMaterial(index); if (lootType == Type.Head || lootType == Type.Waist || lootType == Type.Foot || lootType == Type.Hand) { return getArmourMaterial(index); } return Material.Jewellery; } function getClass(Type lootType, uint256 index) pure public returns (Class) { Material material = getMaterial(lootType, index); return getClassFromMaterial(material); } function getClassFromMaterial(Material material) pure public returns (Class) { if (material == Material.Heavy || material == Material.Metal) return Class.Warrior; if (material == Material.Medium || material == Material.Hide) return Class.Hunter; if (material == Material.Dark || material == Material.Light || material == Material.Cloth) return Class.Mage; return Class.Any; } function getRank(Type lootType, uint256 index) pure public returns (uint256) { if (lootType == Type.Weapon) return getWeaponRank(index); if (lootType == Type.Chest) return getChestRank(index); if (lootType == Type.Head || lootType == Type.Waist || lootType == Type.Foot || lootType == Type.Hand) { return getArmourRank(index); } if (lootType == Type.Ring) return getRingRank(index); return getNeckRank(index); } function getLevel(Type lootType, uint256 index) pure public returns (uint256) { if (lootType == Type.Chest || lootType == Type.Weapon || lootType == Type.Head || lootType == Type.Waist || lootType == Type.Foot || lootType == Type.Hand) { return 6 - getRank(lootType, index); } else { return 4 - getRank(lootType, index); } } /////////////////////////////////////////////////////////////////////////// /* Gas efficient implementation of LootComponents https://etherscan.io/address/0x3eb43b1545a360d1D065CB7539339363dFD445F3#code The actual names are not needed when retreiving the component indexes only Header comment from orignal follows: // SPDX-License-Identifier: Unlicense This is a utility contract to make it easier for other contracts to work with Loot properties. Call weaponComponents(), chestComponents(), etc. to get an array of attributes that correspond to the item. The return format is: uint256[6] => [0] = Item ID [1] = Suffix ID (0 for none) [2] = Name Prefix ID (0 for none) [3] = Name Suffix ID (0 for none) [4] = Augmentation (0 = false, 1 = true) [5] = Greatness See the item and attribute tables below for corresponding IDs. */ uint256 constant WEAPON_COUNT = 18; uint256 constant CHEST_COUNT = 15; uint256 constant HEAD_COUNT = 15; uint256 constant WAIST_COUNT = 15; uint256 constant FOOT_COUNT = 15; uint256 constant HAND_COUNT = 15; uint256 constant NECK_COUNT = 3; uint256 constant RING_COUNT = 5; uint256 constant SUFFIX_COUNT = 16; uint256 constant NAME_PREFIX_COUNT = 69; uint256 constant NAME_SUFFIX_COUNT = 18; function random(string memory input) internal pure returns (uint256) { return uint256(keccak256(abi.encodePacked(input))); } function weaponComponents(uint256 tokenId) public pure returns (uint256[6] memory) { return tokenComponents(tokenId, "WEAPON", WEAPON_COUNT); } function chestComponents(uint256 tokenId) public pure returns (uint256[6] memory) { return tokenComponents(tokenId, "CHEST", CHEST_COUNT); } function headComponents(uint256 tokenId) public pure returns (uint256[6] memory) { return tokenComponents(tokenId, "HEAD", HEAD_COUNT); } function waistComponents(uint256 tokenId) public pure returns (uint256[6] memory) { return tokenComponents(tokenId, "WAIST", WAIST_COUNT); } function footComponents(uint256 tokenId) public pure returns (uint256[6] memory) { return tokenComponents(tokenId, "FOOT", FOOT_COUNT); } function handComponents(uint256 tokenId) public pure returns (uint256[6] memory) { return tokenComponents(tokenId, "HAND", HAND_COUNT); } function neckComponents(uint256 tokenId) public pure returns (uint256[6] memory) { return tokenComponents(tokenId, "NECK", NECK_COUNT); } function ringComponents(uint256 tokenId) public pure returns (uint256[6] memory) { return tokenComponents(tokenId, "RING", RING_COUNT); } function tokenComponents(uint256 tokenId, string memory keyPrefix, uint256 itemCount) internal pure returns (uint256[6] memory) { uint256[6] memory components; uint256 rand = random(string(abi.encodePacked(keyPrefix, toString(tokenId)))); components[0] = rand % itemCount; components[1] = 0; components[2] = 0; components[5] = rand % 21; //aka greatness if (components[5] > 14) { components[1] = (rand % SUFFIX_COUNT) + 1; } if (components[5] >= 19) { components[2] = (rand % NAME_PREFIX_COUNT) + 1; components[3] = (rand % NAME_SUFFIX_COUNT) + 1; if (components[5] == 19) { // ... } else { components[4] = 1; } } return components; } function toString(uint256 value) internal 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); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./ERC1967/ERC1967ProxyImplementation.sol"; import "./OpenSea/ERC721TradableUpgradeable.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; struct RelicProperties { uint256 relicTypeId; uint256 materialId; uint256 materialOffset; // this relic's number relative to material, e.g. Gold Skull #42 uint256 poleId; uint256 astralId; uint256 elementId; uint256 alignmentId; uint256 greatness; } interface IRelicMinter { // The relic minter can inject attributes into the metadata attributes array, // they will be added after the standard ones so should begin with a comma. // e.g. ,{"trait_type": "Extra Field", "value": "The Value"} function getAdditionalAttributes(uint256 tokenId, bytes12 data) external view returns(string memory); function getTokenOrderIndex(uint256 tokenId, bytes12 data) external view returns(uint); function getTokenProvenance(uint256 tokenId, bytes12 data) external view returns(string memory); function getImageBaseURL() external view returns(string memory); } contract Relic is ProxyImplementation, ERC721TradableUpgradeable { mapping(address => bool) private _whitelistedMinters; mapping(uint256 => uint256) public _tokenMintInfo; string public _placeholderImageURL; string public _animationBaseURL; string public _collectionName; string public _collectionDesc; string public _collectionImgURL; string public _collectionExtURL; uint256 public _feeBasisPoints; address public _feeRecipient; function init( string memory name, string memory symbol, address proxyRegistryAddress, string memory placeholderImageURL, string memory animationBaseURL, string memory collectionName, string memory collectionDesc, string memory collectionImgURL, string memory collectionExtURL, uint256 feeBasisPoints, address feeRecipient) public onlyOwner initializer { _initializeEIP712(name); __Context_init_unchained(); __ERC165_init_unchained(); __ERC721_init_unchained(name, symbol); __ERC721TradableUpgradeable_init_unchained(proxyRegistryAddress); _placeholderImageURL = placeholderImageURL; _animationBaseURL = animationBaseURL; _collectionName = collectionName; _collectionDesc = collectionDesc; _collectionImgURL = collectionImgURL; _collectionExtURL = collectionExtURL; _feeBasisPoints = feeBasisPoints; _feeRecipient = feeRecipient; } function exists(uint256 tokenId) public view returns(bool) { return _exists(tokenId); } function mint(address to, uint256 tokenId, bytes12 data) public { require(isMinterWhitelisted(_msgSender()), "minter not whitelisted"); // only need 20 bytes for the minter address, so might as well use the // other 12 bytes of the slot for something. The minter can pass // whatever they want, I'm thinking some kind of useful context, e.g. a // minter which manages multiple dungeons could use this field for // dungeon Id _tokenMintInfo[tokenId] = packTokenMintInfo(IRelicMinter(_msgSender()), data); _safeMint(to, tokenId); } function tokenURI(uint256 tokenId) public override view returns (string memory) { require(_exists(tokenId), "token doesn't exist"); RelicProperties memory relicProps = getRelicProperties(tokenId); (IRelicMinter relicMinter, bytes12 data) = unpackTokenMintInfo(_tokenMintInfo[tokenId]); uint orderIndex = relicMinter.getTokenOrderIndex(tokenId, data); string memory provenance = relicMinter.getTokenProvenance(tokenId, data); string memory baseImageURL = relicMinter.getImageBaseURL(); if (bytes(baseImageURL).length == 0) { baseImageURL = _placeholderImageURL; } string memory imageURL = getImageURLForToken(tokenId, baseImageURL, orderIndex, provenance); string memory attrs = string(abi.encodePacked( _getAttributes(relicProps), ",{\"trait_type\": \"Order\", \"value\": \"", getOrderSuffix(orderIndex), "\"}", ",{\"trait_type\": \"Provenance\", \"value\": \"", provenance, "\"}", relicMinter.getAdditionalAttributes(tokenId, data) )); return string(abi.encodePacked( "data:application/json;utf8,{" "\"name\": \"", getName(relicProps.relicTypeId, relicProps.materialId, relicProps.materialOffset), "\"," "\"description\": \"Loot dungeon relic\"," "\"image\": \"", imageURL, "\",", "\"external_url\": \"", imageURL,"\",", // TODO: this should be link to asset on TheCrupt "\"attributes\": [", attrs, "]}" )); } function contractURI() public view returns(string memory) { return string(abi.encodePacked( "data:application/json;utf8,{" "\"name\": \"", _collectionName, "\"," "\"description\": \"", _collectionDesc, "\"," "\"image\": \"", _collectionImgURL, "\",", "\"external_link\": \"", _collectionExtURL,"\",", "\"seller_fee_basis_points\": \"", StringsUpgradeable.toString(_feeBasisPoints),"\",", "\"fee_recipient\": \"", StringsUpgradeable.toHexString(uint256(uint160(_feeRecipient)), 20),"\"", "}" )); } function getRelicProperties(uint256 tokenId) public pure returns(RelicProperties memory) { RelicProperties memory props; uint256 relicsPerMaterialForCurrentType = 84; uint256 totalRelicsOfCurrentType; uint256 tokenIdStartForCurrentType; uint256 tokenIdEndForCurrentType; // exclusive while (true) { totalRelicsOfCurrentType = relicsPerMaterialForCurrentType << 2; tokenIdEndForCurrentType = tokenIdStartForCurrentType + totalRelicsOfCurrentType; if (tokenId < tokenIdEndForCurrentType) { break; } ++props.relicTypeId; tokenIdStartForCurrentType = tokenIdEndForCurrentType; relicsPerMaterialForCurrentType <<= 1; } // find out the offset of this token Id into its relic type, that is to // say if it's the Nth Skull, what is the value of N uint256 relicOffset = tokenId - tokenIdStartForCurrentType; // we want materials to be allocated in order from smallest to largest // token Id, so derive material from relic offset props.materialId = relicOffset / relicsPerMaterialForCurrentType; // we want to know that this is the Nth relic of type x material y, for // the token name e.g. Golden Skull #42 props.materialOffset = relicOffset % relicsPerMaterialForCurrentType; // First relic of each material set is greatness 20 then it is decremented per token until it loops at the minimum for its type uint256 minGreatness = getMiniumGreatness(props.relicTypeId); uint256 greatnessRange = 21 - minGreatness; props.greatness = 20 - (props.materialOffset % greatnessRange); // offset the attributes Id with a "random" number per relic + material // combination, so that all relics of a certain material don't start on // N Sun Earth Good Greatness 0 etc uint256 attributesId = relicOffset + uint256(keccak256(abi.encodePacked(props.relicTypeId, props.materialId))); props.alignmentId = (attributesId / greatnessRange) & 3; props.elementId = (attributesId / (greatnessRange * 4)) & 3; props.astralId = (attributesId / (greatnessRange * 16)) & 3; props.poleId = (attributesId / (greatnessRange * 64)) & 3; return props; } function packTokenMintInfo(IRelicMinter relicMinter, bytes12 data) public pure returns(uint256) { return (uint256(uint160(address(relicMinter))) << 96) | uint96(data); } function unpackTokenMintInfo(uint256 mintInfo) public pure returns(IRelicMinter relicMinter, bytes12 data) { relicMinter = IRelicMinter(address(uint160(mintInfo >> 96))); data = bytes12(uint96(mintInfo & 0xffffffffffffffffffffffff)); } function getRelicType(uint256 relicId) public pure returns(string memory) { string[7] memory relics = ["Skull", "Crown", "Medal", "Key", "Dagger", "Gem", "Coin"]; return relics[relicId]; } function getMaterial(uint256 materialId) public pure returns(string memory) { string[4] memory materials = ["Gold", "Ice", "Fire", "Jade"]; return materials[materialId]; } function getName(uint256 relicId, uint256 materialId, uint256 materialOffset) public pure returns(string memory) { return string(abi.encodePacked( getMaterial(materialId), " ", getRelicType(relicId), " #", StringsUpgradeable.toString(materialOffset + 1))); } function getAlignment(uint256 alignmentId) public pure returns(string memory) { string[4] memory alignment = ["Good", "Evil", "Lawful", "Chaos"]; return alignment[alignmentId]; } function getElement(uint256 elementId) public pure returns(string memory) { string[4] memory element = ["Earth", "Wind", "Fire", "Water"]; return element[elementId]; } function getAstral(uint256 astralId) public pure returns(string memory) { string[4] memory astral = ["Earth", "Sun", "Moon", "Stars"]; return astral[astralId]; } function getPole(uint256 poleId) public pure returns(string memory) { string[4] memory pole = ["North", "South", "East", "West"]; return pole[poleId]; } function getMiniumGreatness(uint256 relicId) public pure returns(uint256) { uint256[7] memory greatnesses = [(uint256)(20), 19, 18,17,15,10,0]; return greatnesses[relicId]; } function getOrderSuffix(uint orderId) public pure returns(string memory) { string[16] memory suffixes = [ "of Power", "of Giants", "of Titans", "of Skill", "of Perfection", "of Brilliance", "of Enlightenment", "of Protection", "of Anger", "of Rage", "of Fury", "of Vitriol", "of the Fox", "of Detection", "of Reflection", "of the Twins" ]; return suffixes[orderId]; } // encodes properties in relicProps for use in a URL, such as for animation_url function _getURLParams(RelicProperties memory relicProps) public pure returns(string memory) { return string(abi.encodePacked( "relicType=", getRelicType(relicProps.relicTypeId), "&material=", getMaterial(relicProps.materialId), "&pole=", getPole(relicProps.poleId), "&astral=", getAstral(relicProps.astralId), "&element=", getElement(relicProps.elementId), "&alignment=", getAlignment(relicProps.alignmentId), "&greatness=", StringsUpgradeable.toString(relicProps.greatness) )); } // encodes properties in relicProps for use in the attributes array of token // metadata function _getAttributes(RelicProperties memory relicProps) public pure returns(string memory) { bytes memory str = abi.encodePacked( "{\"trait_type\": \"Relic Type\", \"value\": \"", getRelicType(relicProps.relicTypeId),"\"}," "{\"trait_type\": \"Material\", \"value\": \"", getMaterial(relicProps.materialId),"\"}," "{\"trait_type\": \"Pole\", \"value\": \"", getPole(relicProps.poleId),"\"}," "{\"trait_type\": \"Astral\", \"value\": \"", getAstral(relicProps.astralId),"\"}," "{\"trait_type\": \"Element\", \"value\": \"", getElement(relicProps.elementId),"\"}," "{\"trait_type\": \"Alignment\", \"value\": \"", getAlignment(relicProps.alignmentId),"\"}," ); // had to break this into two calls to encodePacked as it runs out of stack otherwise str = abi.encodePacked(str, "{\"trait_type\": \"Greatness\", \"value\": \"", StringsUpgradeable.toString(relicProps.greatness),"\"}"); return string(str); } function getImageURLPart1(RelicProperties memory props) internal pure returns(string memory) { return string(abi.encodePacked( Strings.toString(props.materialId), "-", Strings.toString(props.relicTypeId), "-" )); } function getImageURLPart2(RelicProperties memory props) internal pure returns(string memory) { return string(abi.encodePacked( Strings.toString(props.astralId), "-", Strings.toString(props.elementId), "-", Strings.toString(props.poleId), "-" )); } function getImageURLPart3(RelicProperties memory props) internal pure returns(string memory) { return string(abi.encodePacked( Strings.toString(props.alignmentId), "-", Strings.toString(props.greatness), "-" )); } function getImageURLForToken(uint256 tokenId, string memory baseURL, uint orderIndex, string memory provenance) internal pure returns(string memory) { RelicProperties memory props = getRelicProperties(tokenId); return string(abi.encodePacked( baseURL, getImageURLPart1(props), Strings.toString(orderIndex), "-", getImageURLPart2(props), getImageURLPart3(props), provenance, ".png" )); } function isMinterWhitelisted(address minter) public view returns(bool) { return _whitelistedMinters[minter]; } function addWhitelistedMinter(address minter) public onlyOwner { require(AddressUpgradeable.isContract(minter), "minter is not a contract"); require(!isMinterWhitelisted(minter), "already whitelisted"); _whitelistedMinters[minter] = true; } function removeWhitelistedMinter(address minter) public onlyOwner { require(isMinterWhitelisted(minter), "not whitelisted"); _whitelistedMinters[minter] = false; } function setPlaceholderImageURL(string memory placeholderImageURL) public onlyOwner { _placeholderImageURL = placeholderImageURL; } function setAnimationBaseURL(string memory animationBaseURL) public onlyOwner { _animationBaseURL = animationBaseURL; } function setCollectionName(string memory collectionName) public onlyOwner { _collectionName = collectionName; } function setCollectionDesc(string memory collectionDesc) public onlyOwner { _collectionDesc = collectionDesc; } function setCollectionImgURL(string memory collectionImgURL) public onlyOwner { _collectionImgURL = collectionImgURL; } function setCollectionExtURL(string memory collectionExtURL) public onlyOwner { _collectionExtURL = collectionExtURL; } function setFeeBasisPoints(uint256 feeBasisPoints) public onlyOwner { _feeBasisPoints = feeBasisPoints; } function setFeeRecipient(address feeRecipient) public onlyOwner { _feeRecipient = feeRecipient; } }
// SPDX-License-Identifier: MIT pragma solidity >= 0.4.22 <0.9.0; library console { address constant CONSOLE_ADDRESS = address(0x000000000000000000636F6e736F6c652e6c6f67); function _sendLogPayload(bytes memory payload) private view { uint256 payloadLength = payload.length; address consoleAddress = CONSOLE_ADDRESS; assembly { let payloadStart := add(payload, 32) let r := staticcall(gas(), consoleAddress, payloadStart, payloadLength, 0, 0) } } function log() internal view { _sendLogPayload(abi.encodeWithSignature("log()")); } function logInt(int p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(int)", p0)); } function logUint(uint p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint)", p0)); } function logString(string memory p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(string)", p0)); } function logBool(bool p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool)", p0)); } function logAddress(address p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(address)", p0)); } function logBytes(bytes memory p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes)", p0)); } function logBytes1(bytes1 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes1)", p0)); } function logBytes2(bytes2 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes2)", p0)); } function logBytes3(bytes3 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes3)", p0)); } function logBytes4(bytes4 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes4)", p0)); } function logBytes5(bytes5 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes5)", p0)); } function logBytes6(bytes6 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes6)", p0)); } function logBytes7(bytes7 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes7)", p0)); } function logBytes8(bytes8 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes8)", p0)); } function logBytes9(bytes9 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes9)", p0)); } function logBytes10(bytes10 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes10)", p0)); } function logBytes11(bytes11 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes11)", p0)); } function logBytes12(bytes12 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes12)", p0)); } function logBytes13(bytes13 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes13)", p0)); } function logBytes14(bytes14 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes14)", p0)); } function logBytes15(bytes15 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes15)", p0)); } function logBytes16(bytes16 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes16)", p0)); } function logBytes17(bytes17 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes17)", p0)); } function logBytes18(bytes18 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes18)", p0)); } function logBytes19(bytes19 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes19)", p0)); } function logBytes20(bytes20 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes20)", p0)); } function logBytes21(bytes21 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes21)", p0)); } function logBytes22(bytes22 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes22)", p0)); } function logBytes23(bytes23 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes23)", p0)); } function logBytes24(bytes24 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes24)", p0)); } function logBytes25(bytes25 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes25)", p0)); } function logBytes26(bytes26 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes26)", p0)); } function logBytes27(bytes27 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes27)", p0)); } function logBytes28(bytes28 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes28)", p0)); } function logBytes29(bytes29 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes29)", p0)); } function logBytes30(bytes30 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes30)", p0)); } function logBytes31(bytes31 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes31)", p0)); } function logBytes32(bytes32 p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bytes32)", p0)); } function log(uint p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint)", p0)); } function log(string memory p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(string)", p0)); } function log(bool p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool)", p0)); } function log(address p0) internal view { _sendLogPayload(abi.encodeWithSignature("log(address)", p0)); } function log(uint p0, uint p1) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,uint)", p0, p1)); } function log(uint p0, string memory p1) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,string)", p0, p1)); } function log(uint p0, bool p1) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,bool)", p0, p1)); } function log(uint p0, address p1) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,address)", p0, p1)); } function log(string memory p0, uint p1) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,uint)", p0, p1)); } function log(string memory p0, string memory p1) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,string)", p0, p1)); } function log(string memory p0, bool p1) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,bool)", p0, p1)); } function log(string memory p0, address p1) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,address)", p0, p1)); } function log(bool p0, uint p1) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,uint)", p0, p1)); } function log(bool p0, string memory p1) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,string)", p0, p1)); } function log(bool p0, bool p1) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,bool)", p0, p1)); } function log(bool p0, address p1) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,address)", p0, p1)); } function log(address p0, uint p1) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,uint)", p0, p1)); } function log(address p0, string memory p1) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,string)", p0, p1)); } function log(address p0, bool p1) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,bool)", p0, p1)); } function log(address p0, address p1) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,address)", p0, p1)); } function log(uint p0, uint p1, uint p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,uint,uint)", p0, p1, p2)); } function log(uint p0, uint p1, string memory p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,uint,string)", p0, p1, p2)); } function log(uint p0, uint p1, bool p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,uint,bool)", p0, p1, p2)); } function log(uint p0, uint p1, address p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,uint,address)", p0, p1, p2)); } function log(uint p0, string memory p1, uint p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,string,uint)", p0, p1, p2)); } function log(uint p0, string memory p1, string memory p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,string,string)", p0, p1, p2)); } function log(uint p0, string memory p1, bool p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,string,bool)", p0, p1, p2)); } function log(uint p0, string memory p1, address p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,string,address)", p0, p1, p2)); } function log(uint p0, bool p1, uint p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,bool,uint)", p0, p1, p2)); } function log(uint p0, bool p1, string memory p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,bool,string)", p0, p1, p2)); } function log(uint p0, bool p1, bool p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,bool,bool)", p0, p1, p2)); } function log(uint p0, bool p1, address p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,bool,address)", p0, p1, p2)); } function log(uint p0, address p1, uint p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,address,uint)", p0, p1, p2)); } function log(uint p0, address p1, string memory p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,address,string)", p0, p1, p2)); } function log(uint p0, address p1, bool p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,address,bool)", p0, p1, p2)); } function log(uint p0, address p1, address p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,address,address)", p0, p1, p2)); } function log(string memory p0, uint p1, uint p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,uint,uint)", p0, p1, p2)); } function log(string memory p0, uint p1, string memory p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,uint,string)", p0, p1, p2)); } function log(string memory p0, uint p1, bool p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,uint,bool)", p0, p1, p2)); } function log(string memory p0, uint p1, address p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,uint,address)", p0, p1, p2)); } function log(string memory p0, string memory p1, uint p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,string,uint)", p0, p1, p2)); } function log(string memory p0, string memory p1, string memory p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,string,string)", p0, p1, p2)); } function log(string memory p0, string memory p1, bool p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,string,bool)", p0, p1, p2)); } function log(string memory p0, string memory p1, address p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,string,address)", p0, p1, p2)); } function log(string memory p0, bool p1, uint p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,bool,uint)", p0, p1, p2)); } function log(string memory p0, bool p1, string memory p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,bool,string)", p0, p1, p2)); } function log(string memory p0, bool p1, bool p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,bool,bool)", p0, p1, p2)); } function log(string memory p0, bool p1, address p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,bool,address)", p0, p1, p2)); } function log(string memory p0, address p1, uint p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,address,uint)", p0, p1, p2)); } function log(string memory p0, address p1, string memory p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,address,string)", p0, p1, p2)); } function log(string memory p0, address p1, bool p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,address,bool)", p0, p1, p2)); } function log(string memory p0, address p1, address p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,address,address)", p0, p1, p2)); } function log(bool p0, uint p1, uint p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,uint,uint)", p0, p1, p2)); } function log(bool p0, uint p1, string memory p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,uint,string)", p0, p1, p2)); } function log(bool p0, uint p1, bool p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,uint,bool)", p0, p1, p2)); } function log(bool p0, uint p1, address p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,uint,address)", p0, p1, p2)); } function log(bool p0, string memory p1, uint p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,string,uint)", p0, p1, p2)); } function log(bool p0, string memory p1, string memory p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,string,string)", p0, p1, p2)); } function log(bool p0, string memory p1, bool p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,string,bool)", p0, p1, p2)); } function log(bool p0, string memory p1, address p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,string,address)", p0, p1, p2)); } function log(bool p0, bool p1, uint p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,bool,uint)", p0, p1, p2)); } function log(bool p0, bool p1, string memory p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,bool,string)", p0, p1, p2)); } function log(bool p0, bool p1, bool p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,bool,bool)", p0, p1, p2)); } function log(bool p0, bool p1, address p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,bool,address)", p0, p1, p2)); } function log(bool p0, address p1, uint p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,address,uint)", p0, p1, p2)); } function log(bool p0, address p1, string memory p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,address,string)", p0, p1, p2)); } function log(bool p0, address p1, bool p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,address,bool)", p0, p1, p2)); } function log(bool p0, address p1, address p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,address,address)", p0, p1, p2)); } function log(address p0, uint p1, uint p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,uint,uint)", p0, p1, p2)); } function log(address p0, uint p1, string memory p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,uint,string)", p0, p1, p2)); } function log(address p0, uint p1, bool p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,uint,bool)", p0, p1, p2)); } function log(address p0, uint p1, address p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,uint,address)", p0, p1, p2)); } function log(address p0, string memory p1, uint p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,string,uint)", p0, p1, p2)); } function log(address p0, string memory p1, string memory p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,string,string)", p0, p1, p2)); } function log(address p0, string memory p1, bool p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,string,bool)", p0, p1, p2)); } function log(address p0, string memory p1, address p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,string,address)", p0, p1, p2)); } function log(address p0, bool p1, uint p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,bool,uint)", p0, p1, p2)); } function log(address p0, bool p1, string memory p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,bool,string)", p0, p1, p2)); } function log(address p0, bool p1, bool p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,bool,bool)", p0, p1, p2)); } function log(address p0, bool p1, address p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,bool,address)", p0, p1, p2)); } function log(address p0, address p1, uint p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,address,uint)", p0, p1, p2)); } function log(address p0, address p1, string memory p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,address,string)", p0, p1, p2)); } function log(address p0, address p1, bool p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,address,bool)", p0, p1, p2)); } function log(address p0, address p1, address p2) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,address,address)", p0, p1, p2)); } function log(uint p0, uint p1, uint p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,uint,uint,uint)", p0, p1, p2, p3)); } function log(uint p0, uint p1, uint p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,uint,uint,string)", p0, p1, p2, p3)); } function log(uint p0, uint p1, uint p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,uint,uint,bool)", p0, p1, p2, p3)); } function log(uint p0, uint p1, uint p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,uint,uint,address)", p0, p1, p2, p3)); } function log(uint p0, uint p1, string memory p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,uint,string,uint)", p0, p1, p2, p3)); } function log(uint p0, uint p1, string memory p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,uint,string,string)", p0, p1, p2, p3)); } function log(uint p0, uint p1, string memory p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,uint,string,bool)", p0, p1, p2, p3)); } function log(uint p0, uint p1, string memory p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,uint,string,address)", p0, p1, p2, p3)); } function log(uint p0, uint p1, bool p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,uint,bool,uint)", p0, p1, p2, p3)); } function log(uint p0, uint p1, bool p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,uint,bool,string)", p0, p1, p2, p3)); } function log(uint p0, uint p1, bool p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,uint,bool,bool)", p0, p1, p2, p3)); } function log(uint p0, uint p1, bool p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,uint,bool,address)", p0, p1, p2, p3)); } function log(uint p0, uint p1, address p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,uint,address,uint)", p0, p1, p2, p3)); } function log(uint p0, uint p1, address p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,uint,address,string)", p0, p1, p2, p3)); } function log(uint p0, uint p1, address p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,uint,address,bool)", p0, p1, p2, p3)); } function log(uint p0, uint p1, address p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,uint,address,address)", p0, p1, p2, p3)); } function log(uint p0, string memory p1, uint p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,string,uint,uint)", p0, p1, p2, p3)); } function log(uint p0, string memory p1, uint p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,string,uint,string)", p0, p1, p2, p3)); } function log(uint p0, string memory p1, uint p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,string,uint,bool)", p0, p1, p2, p3)); } function log(uint p0, string memory p1, uint p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,string,uint,address)", p0, p1, p2, p3)); } function log(uint p0, string memory p1, string memory p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,string,string,uint)", p0, p1, p2, p3)); } function log(uint p0, string memory p1, string memory p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,string,string,string)", p0, p1, p2, p3)); } function log(uint p0, string memory p1, string memory p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,string,string,bool)", p0, p1, p2, p3)); } function log(uint p0, string memory p1, string memory p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,string,string,address)", p0, p1, p2, p3)); } function log(uint p0, string memory p1, bool p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,string,bool,uint)", p0, p1, p2, p3)); } function log(uint p0, string memory p1, bool p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,string,bool,string)", p0, p1, p2, p3)); } function log(uint p0, string memory p1, bool p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,string,bool,bool)", p0, p1, p2, p3)); } function log(uint p0, string memory p1, bool p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,string,bool,address)", p0, p1, p2, p3)); } function log(uint p0, string memory p1, address p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,string,address,uint)", p0, p1, p2, p3)); } function log(uint p0, string memory p1, address p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,string,address,string)", p0, p1, p2, p3)); } function log(uint p0, string memory p1, address p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,string,address,bool)", p0, p1, p2, p3)); } function log(uint p0, string memory p1, address p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,string,address,address)", p0, p1, p2, p3)); } function log(uint p0, bool p1, uint p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,bool,uint,uint)", p0, p1, p2, p3)); } function log(uint p0, bool p1, uint p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,bool,uint,string)", p0, p1, p2, p3)); } function log(uint p0, bool p1, uint p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,bool,uint,bool)", p0, p1, p2, p3)); } function log(uint p0, bool p1, uint p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,bool,uint,address)", p0, p1, p2, p3)); } function log(uint p0, bool p1, string memory p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,bool,string,uint)", p0, p1, p2, p3)); } function log(uint p0, bool p1, string memory p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,bool,string,string)", p0, p1, p2, p3)); } function log(uint p0, bool p1, string memory p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,bool,string,bool)", p0, p1, p2, p3)); } function log(uint p0, bool p1, string memory p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,bool,string,address)", p0, p1, p2, p3)); } function log(uint p0, bool p1, bool p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,bool,bool,uint)", p0, p1, p2, p3)); } function log(uint p0, bool p1, bool p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,bool,bool,string)", p0, p1, p2, p3)); } function log(uint p0, bool p1, bool p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,bool,bool,bool)", p0, p1, p2, p3)); } function log(uint p0, bool p1, bool p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,bool,bool,address)", p0, p1, p2, p3)); } function log(uint p0, bool p1, address p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,bool,address,uint)", p0, p1, p2, p3)); } function log(uint p0, bool p1, address p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,bool,address,string)", p0, p1, p2, p3)); } function log(uint p0, bool p1, address p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,bool,address,bool)", p0, p1, p2, p3)); } function log(uint p0, bool p1, address p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,bool,address,address)", p0, p1, p2, p3)); } function log(uint p0, address p1, uint p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,address,uint,uint)", p0, p1, p2, p3)); } function log(uint p0, address p1, uint p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,address,uint,string)", p0, p1, p2, p3)); } function log(uint p0, address p1, uint p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,address,uint,bool)", p0, p1, p2, p3)); } function log(uint p0, address p1, uint p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,address,uint,address)", p0, p1, p2, p3)); } function log(uint p0, address p1, string memory p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,address,string,uint)", p0, p1, p2, p3)); } function log(uint p0, address p1, string memory p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,address,string,string)", p0, p1, p2, p3)); } function log(uint p0, address p1, string memory p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,address,string,bool)", p0, p1, p2, p3)); } function log(uint p0, address p1, string memory p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,address,string,address)", p0, p1, p2, p3)); } function log(uint p0, address p1, bool p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,address,bool,uint)", p0, p1, p2, p3)); } function log(uint p0, address p1, bool p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,address,bool,string)", p0, p1, p2, p3)); } function log(uint p0, address p1, bool p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,address,bool,bool)", p0, p1, p2, p3)); } function log(uint p0, address p1, bool p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,address,bool,address)", p0, p1, p2, p3)); } function log(uint p0, address p1, address p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,address,address,uint)", p0, p1, p2, p3)); } function log(uint p0, address p1, address p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,address,address,string)", p0, p1, p2, p3)); } function log(uint p0, address p1, address p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,address,address,bool)", p0, p1, p2, p3)); } function log(uint p0, address p1, address p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(uint,address,address,address)", p0, p1, p2, p3)); } function log(string memory p0, uint p1, uint p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,uint,uint,uint)", p0, p1, p2, p3)); } function log(string memory p0, uint p1, uint p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,uint,uint,string)", p0, p1, p2, p3)); } function log(string memory p0, uint p1, uint p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,uint,uint,bool)", p0, p1, p2, p3)); } function log(string memory p0, uint p1, uint p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,uint,uint,address)", p0, p1, p2, p3)); } function log(string memory p0, uint p1, string memory p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,uint,string,uint)", p0, p1, p2, p3)); } function log(string memory p0, uint p1, string memory p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,uint,string,string)", p0, p1, p2, p3)); } function log(string memory p0, uint p1, string memory p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,uint,string,bool)", p0, p1, p2, p3)); } function log(string memory p0, uint p1, string memory p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,uint,string,address)", p0, p1, p2, p3)); } function log(string memory p0, uint p1, bool p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,uint,bool,uint)", p0, p1, p2, p3)); } function log(string memory p0, uint p1, bool p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,uint,bool,string)", p0, p1, p2, p3)); } function log(string memory p0, uint p1, bool p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,uint,bool,bool)", p0, p1, p2, p3)); } function log(string memory p0, uint p1, bool p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,uint,bool,address)", p0, p1, p2, p3)); } function log(string memory p0, uint p1, address p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,uint,address,uint)", p0, p1, p2, p3)); } function log(string memory p0, uint p1, address p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,uint,address,string)", p0, p1, p2, p3)); } function log(string memory p0, uint p1, address p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,uint,address,bool)", p0, p1, p2, p3)); } function log(string memory p0, uint p1, address p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,uint,address,address)", p0, p1, p2, p3)); } function log(string memory p0, string memory p1, uint p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,string,uint,uint)", p0, p1, p2, p3)); } function log(string memory p0, string memory p1, uint p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,string,uint,string)", p0, p1, p2, p3)); } function log(string memory p0, string memory p1, uint p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,string,uint,bool)", p0, p1, p2, p3)); } function log(string memory p0, string memory p1, uint p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,string,uint,address)", p0, p1, p2, p3)); } function log(string memory p0, string memory p1, string memory p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,string,string,uint)", p0, p1, p2, p3)); } function log(string memory p0, string memory p1, string memory p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,string,string,string)", p0, p1, p2, p3)); } function log(string memory p0, string memory p1, string memory p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,string,string,bool)", p0, p1, p2, p3)); } function log(string memory p0, string memory p1, string memory p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,string,string,address)", p0, p1, p2, p3)); } function log(string memory p0, string memory p1, bool p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,string,bool,uint)", p0, p1, p2, p3)); } function log(string memory p0, string memory p1, bool p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,string,bool,string)", p0, p1, p2, p3)); } function log(string memory p0, string memory p1, bool p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,string,bool,bool)", p0, p1, p2, p3)); } function log(string memory p0, string memory p1, bool p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,string,bool,address)", p0, p1, p2, p3)); } function log(string memory p0, string memory p1, address p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,string,address,uint)", p0, p1, p2, p3)); } function log(string memory p0, string memory p1, address p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,string,address,string)", p0, p1, p2, p3)); } function log(string memory p0, string memory p1, address p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,string,address,bool)", p0, p1, p2, p3)); } function log(string memory p0, string memory p1, address p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,string,address,address)", p0, p1, p2, p3)); } function log(string memory p0, bool p1, uint p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,bool,uint,uint)", p0, p1, p2, p3)); } function log(string memory p0, bool p1, uint p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,bool,uint,string)", p0, p1, p2, p3)); } function log(string memory p0, bool p1, uint p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,bool,uint,bool)", p0, p1, p2, p3)); } function log(string memory p0, bool p1, uint p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,bool,uint,address)", p0, p1, p2, p3)); } function log(string memory p0, bool p1, string memory p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,bool,string,uint)", p0, p1, p2, p3)); } function log(string memory p0, bool p1, string memory p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,bool,string,string)", p0, p1, p2, p3)); } function log(string memory p0, bool p1, string memory p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,bool,string,bool)", p0, p1, p2, p3)); } function log(string memory p0, bool p1, string memory p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,bool,string,address)", p0, p1, p2, p3)); } function log(string memory p0, bool p1, bool p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,bool,bool,uint)", p0, p1, p2, p3)); } function log(string memory p0, bool p1, bool p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,bool,bool,string)", p0, p1, p2, p3)); } function log(string memory p0, bool p1, bool p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,bool,bool,bool)", p0, p1, p2, p3)); } function log(string memory p0, bool p1, bool p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,bool,bool,address)", p0, p1, p2, p3)); } function log(string memory p0, bool p1, address p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,bool,address,uint)", p0, p1, p2, p3)); } function log(string memory p0, bool p1, address p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,bool,address,string)", p0, p1, p2, p3)); } function log(string memory p0, bool p1, address p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,bool,address,bool)", p0, p1, p2, p3)); } function log(string memory p0, bool p1, address p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,bool,address,address)", p0, p1, p2, p3)); } function log(string memory p0, address p1, uint p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,address,uint,uint)", p0, p1, p2, p3)); } function log(string memory p0, address p1, uint p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,address,uint,string)", p0, p1, p2, p3)); } function log(string memory p0, address p1, uint p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,address,uint,bool)", p0, p1, p2, p3)); } function log(string memory p0, address p1, uint p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,address,uint,address)", p0, p1, p2, p3)); } function log(string memory p0, address p1, string memory p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,address,string,uint)", p0, p1, p2, p3)); } function log(string memory p0, address p1, string memory p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,address,string,string)", p0, p1, p2, p3)); } function log(string memory p0, address p1, string memory p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,address,string,bool)", p0, p1, p2, p3)); } function log(string memory p0, address p1, string memory p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,address,string,address)", p0, p1, p2, p3)); } function log(string memory p0, address p1, bool p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,address,bool,uint)", p0, p1, p2, p3)); } function log(string memory p0, address p1, bool p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,address,bool,string)", p0, p1, p2, p3)); } function log(string memory p0, address p1, bool p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,address,bool,bool)", p0, p1, p2, p3)); } function log(string memory p0, address p1, bool p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,address,bool,address)", p0, p1, p2, p3)); } function log(string memory p0, address p1, address p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,address,address,uint)", p0, p1, p2, p3)); } function log(string memory p0, address p1, address p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,address,address,string)", p0, p1, p2, p3)); } function log(string memory p0, address p1, address p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,address,address,bool)", p0, p1, p2, p3)); } function log(string memory p0, address p1, address p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(string,address,address,address)", p0, p1, p2, p3)); } function log(bool p0, uint p1, uint p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,uint,uint,uint)", p0, p1, p2, p3)); } function log(bool p0, uint p1, uint p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,uint,uint,string)", p0, p1, p2, p3)); } function log(bool p0, uint p1, uint p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,uint,uint,bool)", p0, p1, p2, p3)); } function log(bool p0, uint p1, uint p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,uint,uint,address)", p0, p1, p2, p3)); } function log(bool p0, uint p1, string memory p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,uint,string,uint)", p0, p1, p2, p3)); } function log(bool p0, uint p1, string memory p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,uint,string,string)", p0, p1, p2, p3)); } function log(bool p0, uint p1, string memory p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,uint,string,bool)", p0, p1, p2, p3)); } function log(bool p0, uint p1, string memory p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,uint,string,address)", p0, p1, p2, p3)); } function log(bool p0, uint p1, bool p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,uint,bool,uint)", p0, p1, p2, p3)); } function log(bool p0, uint p1, bool p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,uint,bool,string)", p0, p1, p2, p3)); } function log(bool p0, uint p1, bool p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,uint,bool,bool)", p0, p1, p2, p3)); } function log(bool p0, uint p1, bool p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,uint,bool,address)", p0, p1, p2, p3)); } function log(bool p0, uint p1, address p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,uint,address,uint)", p0, p1, p2, p3)); } function log(bool p0, uint p1, address p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,uint,address,string)", p0, p1, p2, p3)); } function log(bool p0, uint p1, address p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,uint,address,bool)", p0, p1, p2, p3)); } function log(bool p0, uint p1, address p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,uint,address,address)", p0, p1, p2, p3)); } function log(bool p0, string memory p1, uint p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,string,uint,uint)", p0, p1, p2, p3)); } function log(bool p0, string memory p1, uint p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,string,uint,string)", p0, p1, p2, p3)); } function log(bool p0, string memory p1, uint p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,string,uint,bool)", p0, p1, p2, p3)); } function log(bool p0, string memory p1, uint p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,string,uint,address)", p0, p1, p2, p3)); } function log(bool p0, string memory p1, string memory p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,string,string,uint)", p0, p1, p2, p3)); } function log(bool p0, string memory p1, string memory p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,string,string,string)", p0, p1, p2, p3)); } function log(bool p0, string memory p1, string memory p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,string,string,bool)", p0, p1, p2, p3)); } function log(bool p0, string memory p1, string memory p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,string,string,address)", p0, p1, p2, p3)); } function log(bool p0, string memory p1, bool p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,string,bool,uint)", p0, p1, p2, p3)); } function log(bool p0, string memory p1, bool p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,string,bool,string)", p0, p1, p2, p3)); } function log(bool p0, string memory p1, bool p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,string,bool,bool)", p0, p1, p2, p3)); } function log(bool p0, string memory p1, bool p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,string,bool,address)", p0, p1, p2, p3)); } function log(bool p0, string memory p1, address p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,string,address,uint)", p0, p1, p2, p3)); } function log(bool p0, string memory p1, address p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,string,address,string)", p0, p1, p2, p3)); } function log(bool p0, string memory p1, address p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,string,address,bool)", p0, p1, p2, p3)); } function log(bool p0, string memory p1, address p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,string,address,address)", p0, p1, p2, p3)); } function log(bool p0, bool p1, uint p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,bool,uint,uint)", p0, p1, p2, p3)); } function log(bool p0, bool p1, uint p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,bool,uint,string)", p0, p1, p2, p3)); } function log(bool p0, bool p1, uint p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,bool,uint,bool)", p0, p1, p2, p3)); } function log(bool p0, bool p1, uint p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,bool,uint,address)", p0, p1, p2, p3)); } function log(bool p0, bool p1, string memory p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,bool,string,uint)", p0, p1, p2, p3)); } function log(bool p0, bool p1, string memory p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,bool,string,string)", p0, p1, p2, p3)); } function log(bool p0, bool p1, string memory p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,bool,string,bool)", p0, p1, p2, p3)); } function log(bool p0, bool p1, string memory p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,bool,string,address)", p0, p1, p2, p3)); } function log(bool p0, bool p1, bool p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,bool,bool,uint)", p0, p1, p2, p3)); } function log(bool p0, bool p1, bool p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,bool,bool,string)", p0, p1, p2, p3)); } function log(bool p0, bool p1, bool p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,bool,bool,bool)", p0, p1, p2, p3)); } function log(bool p0, bool p1, bool p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,bool,bool,address)", p0, p1, p2, p3)); } function log(bool p0, bool p1, address p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,bool,address,uint)", p0, p1, p2, p3)); } function log(bool p0, bool p1, address p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,bool,address,string)", p0, p1, p2, p3)); } function log(bool p0, bool p1, address p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,bool,address,bool)", p0, p1, p2, p3)); } function log(bool p0, bool p1, address p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,bool,address,address)", p0, p1, p2, p3)); } function log(bool p0, address p1, uint p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,address,uint,uint)", p0, p1, p2, p3)); } function log(bool p0, address p1, uint p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,address,uint,string)", p0, p1, p2, p3)); } function log(bool p0, address p1, uint p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,address,uint,bool)", p0, p1, p2, p3)); } function log(bool p0, address p1, uint p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,address,uint,address)", p0, p1, p2, p3)); } function log(bool p0, address p1, string memory p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,address,string,uint)", p0, p1, p2, p3)); } function log(bool p0, address p1, string memory p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,address,string,string)", p0, p1, p2, p3)); } function log(bool p0, address p1, string memory p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,address,string,bool)", p0, p1, p2, p3)); } function log(bool p0, address p1, string memory p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,address,string,address)", p0, p1, p2, p3)); } function log(bool p0, address p1, bool p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,address,bool,uint)", p0, p1, p2, p3)); } function log(bool p0, address p1, bool p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,address,bool,string)", p0, p1, p2, p3)); } function log(bool p0, address p1, bool p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,address,bool,bool)", p0, p1, p2, p3)); } function log(bool p0, address p1, bool p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,address,bool,address)", p0, p1, p2, p3)); } function log(bool p0, address p1, address p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,address,address,uint)", p0, p1, p2, p3)); } function log(bool p0, address p1, address p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,address,address,string)", p0, p1, p2, p3)); } function log(bool p0, address p1, address p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,address,address,bool)", p0, p1, p2, p3)); } function log(bool p0, address p1, address p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(bool,address,address,address)", p0, p1, p2, p3)); } function log(address p0, uint p1, uint p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,uint,uint,uint)", p0, p1, p2, p3)); } function log(address p0, uint p1, uint p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,uint,uint,string)", p0, p1, p2, p3)); } function log(address p0, uint p1, uint p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,uint,uint,bool)", p0, p1, p2, p3)); } function log(address p0, uint p1, uint p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,uint,uint,address)", p0, p1, p2, p3)); } function log(address p0, uint p1, string memory p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,uint,string,uint)", p0, p1, p2, p3)); } function log(address p0, uint p1, string memory p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,uint,string,string)", p0, p1, p2, p3)); } function log(address p0, uint p1, string memory p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,uint,string,bool)", p0, p1, p2, p3)); } function log(address p0, uint p1, string memory p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,uint,string,address)", p0, p1, p2, p3)); } function log(address p0, uint p1, bool p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,uint,bool,uint)", p0, p1, p2, p3)); } function log(address p0, uint p1, bool p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,uint,bool,string)", p0, p1, p2, p3)); } function log(address p0, uint p1, bool p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,uint,bool,bool)", p0, p1, p2, p3)); } function log(address p0, uint p1, bool p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,uint,bool,address)", p0, p1, p2, p3)); } function log(address p0, uint p1, address p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,uint,address,uint)", p0, p1, p2, p3)); } function log(address p0, uint p1, address p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,uint,address,string)", p0, p1, p2, p3)); } function log(address p0, uint p1, address p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,uint,address,bool)", p0, p1, p2, p3)); } function log(address p0, uint p1, address p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,uint,address,address)", p0, p1, p2, p3)); } function log(address p0, string memory p1, uint p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,string,uint,uint)", p0, p1, p2, p3)); } function log(address p0, string memory p1, uint p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,string,uint,string)", p0, p1, p2, p3)); } function log(address p0, string memory p1, uint p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,string,uint,bool)", p0, p1, p2, p3)); } function log(address p0, string memory p1, uint p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,string,uint,address)", p0, p1, p2, p3)); } function log(address p0, string memory p1, string memory p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,string,string,uint)", p0, p1, p2, p3)); } function log(address p0, string memory p1, string memory p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,string,string,string)", p0, p1, p2, p3)); } function log(address p0, string memory p1, string memory p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,string,string,bool)", p0, p1, p2, p3)); } function log(address p0, string memory p1, string memory p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,string,string,address)", p0, p1, p2, p3)); } function log(address p0, string memory p1, bool p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,string,bool,uint)", p0, p1, p2, p3)); } function log(address p0, string memory p1, bool p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,string,bool,string)", p0, p1, p2, p3)); } function log(address p0, string memory p1, bool p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,string,bool,bool)", p0, p1, p2, p3)); } function log(address p0, string memory p1, bool p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,string,bool,address)", p0, p1, p2, p3)); } function log(address p0, string memory p1, address p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,string,address,uint)", p0, p1, p2, p3)); } function log(address p0, string memory p1, address p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,string,address,string)", p0, p1, p2, p3)); } function log(address p0, string memory p1, address p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,string,address,bool)", p0, p1, p2, p3)); } function log(address p0, string memory p1, address p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,string,address,address)", p0, p1, p2, p3)); } function log(address p0, bool p1, uint p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,bool,uint,uint)", p0, p1, p2, p3)); } function log(address p0, bool p1, uint p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,bool,uint,string)", p0, p1, p2, p3)); } function log(address p0, bool p1, uint p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,bool,uint,bool)", p0, p1, p2, p3)); } function log(address p0, bool p1, uint p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,bool,uint,address)", p0, p1, p2, p3)); } function log(address p0, bool p1, string memory p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,bool,string,uint)", p0, p1, p2, p3)); } function log(address p0, bool p1, string memory p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,bool,string,string)", p0, p1, p2, p3)); } function log(address p0, bool p1, string memory p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,bool,string,bool)", p0, p1, p2, p3)); } function log(address p0, bool p1, string memory p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,bool,string,address)", p0, p1, p2, p3)); } function log(address p0, bool p1, bool p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,bool,bool,uint)", p0, p1, p2, p3)); } function log(address p0, bool p1, bool p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,bool,bool,string)", p0, p1, p2, p3)); } function log(address p0, bool p1, bool p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,bool,bool,bool)", p0, p1, p2, p3)); } function log(address p0, bool p1, bool p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,bool,bool,address)", p0, p1, p2, p3)); } function log(address p0, bool p1, address p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,bool,address,uint)", p0, p1, p2, p3)); } function log(address p0, bool p1, address p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,bool,address,string)", p0, p1, p2, p3)); } function log(address p0, bool p1, address p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,bool,address,bool)", p0, p1, p2, p3)); } function log(address p0, bool p1, address p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,bool,address,address)", p0, p1, p2, p3)); } function log(address p0, address p1, uint p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,address,uint,uint)", p0, p1, p2, p3)); } function log(address p0, address p1, uint p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,address,uint,string)", p0, p1, p2, p3)); } function log(address p0, address p1, uint p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,address,uint,bool)", p0, p1, p2, p3)); } function log(address p0, address p1, uint p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,address,uint,address)", p0, p1, p2, p3)); } function log(address p0, address p1, string memory p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,address,string,uint)", p0, p1, p2, p3)); } function log(address p0, address p1, string memory p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,address,string,string)", p0, p1, p2, p3)); } function log(address p0, address p1, string memory p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,address,string,bool)", p0, p1, p2, p3)); } function log(address p0, address p1, string memory p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,address,string,address)", p0, p1, p2, p3)); } function log(address p0, address p1, bool p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,address,bool,uint)", p0, p1, p2, p3)); } function log(address p0, address p1, bool p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,address,bool,string)", p0, p1, p2, p3)); } function log(address p0, address p1, bool p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,address,bool,bool)", p0, p1, p2, p3)); } function log(address p0, address p1, bool p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,address,bool,address)", p0, p1, p2, p3)); } function log(address p0, address p1, address p2, uint p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,address,address,uint)", p0, p1, p2, p3)); } function log(address p0, address p1, address p2, string memory p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,address,address,string)", p0, p1, p2, p3)); } function log(address p0, address p1, address p2, bool p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,address,address,bool)", p0, p1, p2, p3)); } function log(address p0, address p1, address p2, address p3) internal view { _sendLogPayload(abi.encodeWithSignature("log(address,address,address,address)", p0, p1, p2, p3)); } }
// 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 pragma solidity ^0.8.0; import "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/StorageSlotUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import "./ERC1967Proxy.sol"; contract ProxyImplementation is Initializable { bytes32 private constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; bytes32 private constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103; modifier onlyAdmin() { require(admin() == msg.sender, "Implementation: caller is not admin"); _; } modifier onlyOwner() { require(owner() == msg.sender, "Implementation: caller is not owner"); _; } function getImplementation() public view returns(address) { return StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value; } function setImplementation(address implementation) public virtual onlyAdmin { require(AddressUpgradeable.isContract(implementation), "ERC1967: new implementation is not a contract"); StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value = implementation; } function admin() public view returns(address) { return StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value; } function owner() public view returns(address) { return admin(); } function setAdmin(address newAdmin) public virtual onlyAdmin { require(newAdmin != address(0), "invalid newAdmin address"); _setAdmin(newAdmin); } function renounceAdminPowers() public virtual onlyAdmin { _setAdmin(address(0)); } function _setAdmin(address newAdmin) private { StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value = newAdmin; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol"; import "./ContextMixin.sol"; import "./NativeMetaTransactionUpgradeable.sol"; contract OwnableDelegateProxy {} contract ProxyRegistry { mapping(address => OwnableDelegateProxy) public proxies; } /** * @title ERC721Tradable * ERC721Tradable - ERC721 contract that whitelists a trading address, and has minting functionality. */ abstract contract ERC721TradableUpgradeable is ContextMixin, ERC721Upgradeable, NativeMetaTransactionUpgradeable { using SafeMathUpgradeable for uint256; address proxyRegistryAddress; uint256 private _currentTokenId = 0; function __ERC721TradableUpgradeable_init_unchained(address _proxyRegistryAddress) internal initializer { proxyRegistryAddress = _proxyRegistryAddress; } /** * Override isApprovedForAll to whitelist user's OpenSea proxy accounts to enable gas-less listings. */ function isApprovedForAll(address owner, address operator) override public view returns (bool) { // Whitelist OpenSea proxy contract for easy trading. ProxyRegistry proxyRegistry = ProxyRegistry(proxyRegistryAddress); if (address(proxyRegistry.proxies(owner)) == operator) { return true; } return super.isApprovedForAll(owner, operator); } /** * This is used instead of msg.sender as transactions won't be sent by the original token owner, but by OpenSea. */ function _msgSender() internal override view returns (address sender) { return ContextMixin.msgSender(); } }
// 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 AddressUpgradeable { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ 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 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/StorageSlot.sol) pragma solidity ^0.8.0; /** * @dev Library for reading and writing primitive types to specific storage slots. * * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts. * This library helps with reading and writing to such slots without the need for inline assembly. * * The functions in this library return Slot structs that contain a `value` member that can be used to read or write. * * Example usage to set ERC1967 implementation slot: * ``` * contract ERC1967 { * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; * * function _getImplementation() internal view returns (address) { * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value; * } * * function _setImplementation(address newImplementation) internal { * require(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract"); * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation; * } * } * ``` * * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._ */ library StorageSlotUpgradeable { struct AddressSlot { address value; } struct BooleanSlot { bool value; } struct Bytes32Slot { bytes32 value; } struct Uint256Slot { uint256 value; } /** * @dev Returns an `AddressSlot` with member `value` located at `slot`. */ function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) { assembly { r.slot := slot } } /** * @dev Returns an `BooleanSlot` with member `value` located at `slot`. */ function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) { assembly { r.slot := slot } } /** * @dev Returns an `Bytes32Slot` with member `value` located at `slot`. */ function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) { assembly { r.slot := slot } } /** * @dev Returns an `Uint256Slot` with member `value` located at `slot`. */ function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) { assembly { r.slot := slot } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (proxy/utils/Initializable.sol) pragma solidity ^0.8.0; import "../../utils/AddressUpgradeable.sol"; /** * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed * behind a proxy. Since a proxied contract can't have a constructor, it's common to move constructor logic to an * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect. * * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}. * * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity. * * [CAUTION] * ==== * Avoid leaving a contract uninitialized. * * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation * contract, which may impact the proxy. To initialize the implementation contract, you can either invoke the * initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed: * * [.hljs-theme-light.nopadding] * ``` * /// @custom:oz-upgrades-unsafe-allow constructor * constructor() initializer {} * ``` * ==== */ abstract contract Initializable { /** * @dev Indicates that the contract has been initialized. */ bool private _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool private _initializing; /** * @dev Modifier to protect an initializer function from being invoked twice. */ modifier initializer() { // If the contract is initializing we ignore whether _initialized is set in order to support multiple // inheritance patterns, but we only do this in the context of a constructor, because in other contexts the // contract may have been reentered. require(_initializing ? _isConstructor() : !_initialized, "Initializable: contract is already initialized"); bool isTopLevelCall = !_initializing; if (isTopLevelCall) { _initializing = true; _initialized = true; } _; if (isTopLevelCall) { _initializing = false; } } /** * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the * {initializer} modifier, directly or indirectly. */ modifier onlyInitializing() { require(_initializing, "Initializable: contract is not initializing"); _; } function _isConstructor() private view returns (bool) { return !AddressUpgradeable.isContract(address(this)); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/utils/Address.sol"; import "@openzeppelin/contracts/utils/StorageSlot.sol"; contract Proxy { bytes32 private constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; bytes32 private constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103; constructor(address implementation, bytes memory data) payable { StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = implementation; StorageSlot.getAddressSlot(_ADMIN_SLOT).value = msg.sender; if (data.length > 0) { Address.functionDelegateCall(implementation, data, /*errorMessage*/ "init failed"); } } fallback() external payable { _fallback(); } receive() external payable { _fallback(); } function _fallback() private { address implementation = StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value; // from OpenZeppelin/contracts assembly { // Copy msg.data. We take full control of memory in this inline assembly // block because it will not return to Solidity code. We overwrite the // Solidity scratch pad at memory position 0. calldatacopy(0, 0, calldatasize()) // Call the implementation. // out and outsize are 0 because we don't know the size yet. let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0) // Copy the returned data. returndatacopy(0, 0, returndatasize()) switch result // delegatecall returns 0 on error. case 0 { revert(0, returndatasize()) } default { return(0, returndatasize()) } } } }
// 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/StorageSlot.sol) pragma solidity ^0.8.0; /** * @dev Library for reading and writing primitive types to specific storage slots. * * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts. * This library helps with reading and writing to such slots without the need for inline assembly. * * The functions in this library return Slot structs that contain a `value` member that can be used to read or write. * * Example usage to set ERC1967 implementation slot: * ``` * contract ERC1967 { * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; * * function _getImplementation() internal view returns (address) { * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value; * } * * function _setImplementation(address newImplementation) internal { * require(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract"); * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation; * } * } * ``` * * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._ */ library StorageSlot { struct AddressSlot { address value; } struct BooleanSlot { bool value; } struct Bytes32Slot { bytes32 value; } struct Uint256Slot { uint256 value; } /** * @dev Returns an `AddressSlot` with member `value` located at `slot`. */ function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) { assembly { r.slot := slot } } /** * @dev Returns an `BooleanSlot` with member `value` located at `slot`. */ function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) { assembly { r.slot := slot } } /** * @dev Returns an `Bytes32Slot` with member `value` located at `slot`. */ function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) { assembly { r.slot := slot } } /** * @dev Returns an `Uint256Slot` with member `value` located at `slot`. */ function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) { assembly { r.slot := slot } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC721/ERC721.sol) pragma solidity ^0.8.0; import "./IERC721Upgradeable.sol"; import "./IERC721ReceiverUpgradeable.sol"; import "./extensions/IERC721MetadataUpgradeable.sol"; import "../../utils/AddressUpgradeable.sol"; import "../../utils/ContextUpgradeable.sol"; import "../../utils/StringsUpgradeable.sol"; import "../../utils/introspection/ERC165Upgradeable.sol"; import "../../proxy/utils/Initializable.sol"; /** * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including * the Metadata extension, but not including the Enumerable extension, which is available separately as * {ERC721Enumerable}. */ contract ERC721Upgradeable is Initializable, ContextUpgradeable, ERC165Upgradeable, IERC721Upgradeable, IERC721MetadataUpgradeable { using AddressUpgradeable for address; using StringsUpgradeable for uint256; // Token name string private _name; // Token symbol string private _symbol; // Mapping from token ID to owner address mapping(uint256 => address) private _owners; // Mapping owner address to token count mapping(address => uint256) private _balances; // Mapping from token ID to approved address mapping(uint256 => address) private _tokenApprovals; // Mapping from owner to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; /** * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection. */ function __ERC721_init(string memory name_, string memory symbol_) internal onlyInitializing { __Context_init_unchained(); __ERC165_init_unchained(); __ERC721_init_unchained(name_, symbol_); } function __ERC721_init_unchained(string memory name_, string memory symbol_) internal onlyInitializing { _name = name_; _symbol = symbol_; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165Upgradeable, IERC165Upgradeable) returns (bool) { return interfaceId == type(IERC721Upgradeable).interfaceId || interfaceId == type(IERC721MetadataUpgradeable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721-balanceOf}. */ function balanceOf(address owner) public view virtual override returns (uint256) { require(owner != address(0), "ERC721: balance query for the zero address"); return _balances[owner]; } /** * @dev See {IERC721-ownerOf}. */ function ownerOf(uint256 tokenId) public view virtual override returns (address) { address owner = _owners[tokenId]; require(owner != address(0), "ERC721: owner query for nonexistent token"); return owner; } /** * @dev See {IERC721Metadata-name}. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev See {IERC721Metadata-symbol}. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token"); 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 virtual override { address owner = ERC721Upgradeable.ownerOf(tokenId); require(to != owner, "ERC721: approval to current owner"); require( _msgSender() == owner || isApprovedForAll(owner, _msgSender()), "ERC721: approve caller is not owner nor approved for all" ); _approve(to, tokenId); } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view virtual override returns (address) { require(_exists(tokenId), "ERC721: approved query for nonexistent token"); return _tokenApprovals[tokenId]; } /** * @dev See {IERC721-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { _setApprovalForAll(_msgSender(), operator, approved); } /** * @dev See {IERC721-isApprovedForAll}. */ function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { return _operatorApprovals[owner][operator]; } /** * @dev See {IERC721-transferFrom}. */ function transferFrom( address from, address to, uint256 tokenId ) public virtual override { //solhint-disable-next-line max-line-length require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved"); _transfer(from, to, tokenId); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId ) public virtual override { safeTransferFrom(from, to, tokenId, ""); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory _data ) public virtual override { require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved"); _safeTransfer(from, to, tokenId, _data); } /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * `_data` is additional data, it has no specified format and it is sent in call to `to`. * * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g. * implement alternative mechanisms to perform token transfer, such as signature-based. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeTransfer( address from, address to, uint256 tokenId, bytes memory _data ) internal virtual { _transfer(from, to, tokenId); require(_checkOnERC721Received(from, to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer"); } /** * @dev Returns whether `tokenId` exists. * * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}. * * Tokens start existing when they are minted (`_mint`), * and stop existing when they are burned (`_burn`). */ function _exists(uint256 tokenId) internal view virtual returns (bool) { return _owners[tokenId] != address(0); } /** * @dev Returns whether `spender` is allowed to manage `tokenId`. * * Requirements: * * - `tokenId` must exist. */ function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) { require(_exists(tokenId), "ERC721: operator query for nonexistent token"); address owner = ERC721Upgradeable.ownerOf(tokenId); return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender)); } /** * @dev Safely mints `tokenId` and transfers it to `to`. * * Requirements: * * - `tokenId` must not exist. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeMint(address to, uint256 tokenId) internal virtual { _safeMint(to, tokenId, ""); } /** * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is * forwarded in {IERC721Receiver-onERC721Received} to contract recipients. */ function _safeMint( address to, uint256 tokenId, bytes memory _data ) internal virtual { _mint(to, tokenId); require( _checkOnERC721Received(address(0), to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer" ); } /** * @dev Mints `tokenId` and transfers it to `to`. * * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible * * Requirements: * * - `tokenId` must not exist. * - `to` cannot be the zero address. * * Emits a {Transfer} event. */ function _mint(address to, uint256 tokenId) internal virtual { require(to != address(0), "ERC721: mint to the zero address"); require(!_exists(tokenId), "ERC721: token already minted"); _beforeTokenTransfer(address(0), to, tokenId); _balances[to] += 1; _owners[tokenId] = to; emit Transfer(address(0), to, tokenId); } /** * @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 { address owner = ERC721Upgradeable.ownerOf(tokenId); _beforeTokenTransfer(owner, address(0), tokenId); // Clear approvals _approve(address(0), tokenId); _balances[owner] -= 1; delete _owners[tokenId]; emit Transfer(owner, address(0), tokenId); } /** * @dev Transfers `tokenId` from `from` to `to`. * As opposed to {transferFrom}, this imposes no restrictions on msg.sender. * * Requirements: * * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * * Emits a {Transfer} event. */ function _transfer( address from, address to, uint256 tokenId ) internal virtual { require(ERC721Upgradeable.ownerOf(tokenId) == from, "ERC721: transfer of token that is not own"); require(to != address(0), "ERC721: transfer to the zero address"); _beforeTokenTransfer(from, to, tokenId); // Clear approvals from the previous owner _approve(address(0), tokenId); _balances[from] -= 1; _balances[to] += 1; _owners[tokenId] = to; emit Transfer(from, to, tokenId); } /** * @dev Approve `to` to operate on `tokenId` * * Emits a {Approval} event. */ function _approve(address to, uint256 tokenId) internal virtual { _tokenApprovals[tokenId] = to; emit Approval(ERC721Upgradeable.ownerOf(tokenId), to, tokenId); } /** * @dev Approve `operator` to operate on all of `owner` tokens * * Emits a {ApprovalForAll} event. */ function _setApprovalForAll( address owner, address operator, bool approved ) internal virtual { require(owner != operator, "ERC721: approve to caller"); _operatorApprovals[owner][operator] = approved; emit ApprovalForAll(owner, operator, approved); } /** * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address. * The call is not executed if the target address is not a contract. * * @param from address representing the previous owner of the given token ID * @param to target address that will receive the tokens * @param tokenId uint256 ID of the token to be transferred * @param _data bytes optional data to send along with the call * @return bool whether the call correctly returned the expected magic value */ function _checkOnERC721Received( address from, address to, uint256 tokenId, bytes memory _data ) private returns (bool) { if (to.isContract()) { try IERC721ReceiverUpgradeable(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) { return retval == IERC721ReceiverUpgradeable.onERC721Received.selector; } catch (bytes memory reason) { if (reason.length == 0) { revert("ERC721: transfer to non ERC721Receiver implementer"); } else { assembly { revert(add(32, reason), mload(reason)) } } } } else { return true; } } /** * @dev Hook that is called before any token transfer. This includes minting * and burning. * * 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, ``from``'s `tokenId` will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal virtual {} uint256[44] private __gap; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; abstract contract ContextMixin { function msgSender() internal view returns (address payable sender) { if (msg.sender == address(this)) { bytes memory array = msg.data; uint256 index = msg.data.length; assembly { // Load the 32 bytes word from memory with the address on the lower 20 bytes, and mask those. sender := and( mload(add(array, index)), 0xffffffffffffffffffffffffffffffffffffffff ) } } else { sender = payable(msg.sender); } return sender; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import {SafeMathUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/math/SafeMathUpgradeable.sol"; import {EIP712BaseUpgradeable} from "./EIP712BaseUpgradeable.sol"; contract NativeMetaTransactionUpgradeable is EIP712BaseUpgradeable { using SafeMathUpgradeable for uint256; bytes32 private constant META_TRANSACTION_TYPEHASH = keccak256( bytes( "MetaTransaction(uint256 nonce,address from,bytes functionSignature)" ) ); event MetaTransactionExecuted( address userAddress, address payable relayerAddress, bytes functionSignature ); mapping(address => uint256) nonces; /* * Meta transaction structure. * No point of including value field here as if user is doing value transfer then he has the funds to pay for gas * He should call the desired function directly in that case. */ struct MetaTransaction { uint256 nonce; address from; bytes functionSignature; } function executeMetaTransaction( address userAddress, bytes memory functionSignature, bytes32 sigR, bytes32 sigS, uint8 sigV ) public payable returns (bytes memory) { MetaTransaction memory metaTx = MetaTransaction({ nonce: nonces[userAddress], from: userAddress, functionSignature: functionSignature }); require( verify(userAddress, metaTx, sigR, sigS, sigV), "Signer and signature do not match" ); // increase nonce for user (to avoid re-use) nonces[userAddress] = nonces[userAddress].add(1); emit MetaTransactionExecuted( userAddress, payable(msg.sender), functionSignature ); // Append userAddress and relayer address at the end to extract it from calling context (bool success, bytes memory returnData) = address(this).call( abi.encodePacked(functionSignature, userAddress) ); require(success, "Function call not successful"); return returnData; } function hashMetaTransaction(MetaTransaction memory metaTx) internal pure returns (bytes32) { return keccak256( abi.encode( META_TRANSACTION_TYPEHASH, metaTx.nonce, metaTx.from, keccak256(metaTx.functionSignature) ) ); } function getNonce(address user) public view returns (uint256 nonce) { nonce = nonces[user]; } function verify( address signer, MetaTransaction memory metaTx, bytes32 sigR, bytes32 sigS, uint8 sigV ) internal view returns (bool) { require(signer != address(0), "NativeMetaTransaction: INVALID_SIGNER"); return signer == ecrecover( toTypedMessageHash(hashMetaTransaction(metaTx)), sigV, sigR, sigS ); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165Upgradeable.sol"; /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721Upgradeable is IERC165Upgradeable { /** * @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/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 IERC721ReceiverUpgradeable { /** * @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 // OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol) pragma solidity ^0.8.0; import "../IERC721Upgradeable.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional metadata extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721MetadataUpgradeable is IERC721Upgradeable { /** * @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 (utils/Context.sol) pragma solidity ^0.8.0; import "../proxy/utils/Initializable.sol"; /** * @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 ContextUpgradeable is Initializable { function __Context_init() internal onlyInitializing { __Context_init_unchained(); } function __Context_init_unchained() internal onlyInitializing { } function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } uint256[50] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Strings.sol) pragma solidity ^0.8.0; /** * @dev String operations. */ library StringsUpgradeable { 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 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; import "./IERC165Upgradeable.sol"; import "../../proxy/utils/Initializable.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 ERC165Upgradeable is Initializable, IERC165Upgradeable { function __ERC165_init() internal onlyInitializing { __ERC165_init_unchained(); } function __ERC165_init_unchained() internal onlyInitializing { } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165Upgradeable).interfaceId; } uint256[50] private __gap; }
// 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 IERC165Upgradeable { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/math/SafeMath.sol) pragma solidity ^0.8.0; // CAUTION // This version of SafeMath should only be used with Solidity 0.8 or later, // because it relies on the compiler's built in overflow checks. /** * @dev Wrappers over Solidity's arithmetic operations. * * NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler * now has built in overflow checking. */ library SafeMathUpgradeable { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } } /** * @dev Returns the substraction of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b > a) return (false, 0); return (true, a - b); } } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } } /** * @dev Returns the division of two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a / b); } } /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a % b); } } /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { return a + b; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return a - b; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { return a * b; } /** * @dev Returns the integer division of two unsigned integers, reverting on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return a % b; } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {trySub}. * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b <= a, errorMessage); return a - b; } } /** * @dev Returns the integer division of two unsigned integers, reverting with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a / b; } } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting with custom message when dividing by zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryMod}. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a % b; } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; contract EIP712BaseUpgradeable is Initializable { struct EIP712Domain { string name; string version; address verifyingContract; bytes32 salt; } string constant public ERC712_VERSION = "1"; bytes32 internal constant EIP712_DOMAIN_TYPEHASH = keccak256( bytes( "EIP712Domain(string name,string version,address verifyingContract,bytes32 salt)" ) ); bytes32 internal domainSeperator; // supposed to be called once while initializing. // one of the contracts that inherits this contract follows proxy pattern // so it is not possible to do this in a constructor function _initializeEIP712( string memory name ) internal initializer { _setDomainSeperator(name); } function _setDomainSeperator(string memory name) internal { domainSeperator = keccak256( abi.encode( EIP712_DOMAIN_TYPEHASH, keccak256(bytes(name)), keccak256(bytes(ERC712_VERSION)), address(this), bytes32(getChainId()) ) ); } function getDomainSeperator() public view returns (bytes32) { return domainSeperator; } function getChainId() public view returns (uint256) { uint256 id; assembly { id := chainid() } return id; } /** * Accept message hash and returns hash message in EIP712 compatible form * So that it can be used to recover signer from signature signed using EIP712 formatted data * https://eips.ethereum.org/EIPS/eip-712 * "\\x19" makes the encoding deterministic * "\\x01" is the version byte to make it compatible to EIP-191 */ function toTypedMessageHash(bytes32 messageHash) internal view returns (bytes32) { return keccak256( abi.encodePacked("\x19\x01", getDomainSeperator(), messageHash) ); } }
{ "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"uint16","name":"dungeonCount","type":"uint16"},{"internalType":"uint256[8]","name":"startHitPoints","type":"uint256[8]"},{"internalType":"uint256[]","name":"relicAwards","type":"uint256[]"},{"internalType":"address","name":"raidTokenContract","type":"address"},{"internalType":"address","name":"lootClassificationAddress","type":"address"},{"internalType":"address","name":"relicAddress","type":"address"},{"internalType":"string","name":"imageBaseURL","type":"string"},{"internalType":"uint256","name":"raidingFee","type":"uint256"},{"internalType":"uint256","name":"blocksBetweenFreeRaids","type":"uint256"},{"components":[{"internalType":"uint256","name":"max","type":"uint256"},{"internalType":"uint256","name":"relics","type":"uint256"}],"internalType":"struct Dungeon2.AwardBracket[]","name":"awardBrackets","type":"tuple[]"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"dungeonId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"raidTokenId","type":"uint256"},{"indexed":false,"internalType":"uint256[8]","name":"damage","type":"uint256[8]"}],"name":"Raid","type":"event"},{"inputs":[],"name":"_blocksBetweenFreeRaids","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"_dungeons","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_imageBaseURL","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"_lastFreeRaidForAddress","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_raidingFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_raidingLocked","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_relicAwardBrackets","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"_relicAwardsByDungeonRank","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"canRaidFree","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"claimRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes12","name":"","type":"bytes12"}],"name":"getAdditionalAttributes","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"dungeonId","type":"uint256"}],"name":"getArtefact","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"dungeonId","type":"uint256"}],"name":"getBossMonster","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"dungeonId","type":"uint256"}],"name":"getDemiGod","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getDungeonCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"dungeonId","type":"uint256"}],"name":"getDungeonOpen","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"dungeonId","type":"uint256"}],"name":"getDungeonOrderIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"dungeonId","type":"uint256"}],"name":"getDungeonRank","outputs":[{"internalType":"uint256","name":"rank","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"dungeonId","type":"uint256"}],"name":"getDungeonRemainingHitPoints","outputs":[{"internalType":"uint256[8]","name":"hitPoints","type":"uint256[8]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"dungeonId","type":"uint256"}],"name":"getDungeonRewardToken","outputs":[{"internalType":"int256","name":"","type":"int256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getDungeons","outputs":[{"components":[{"internalType":"uint256","name":"orderIndex","type":"uint256"},{"internalType":"string","name":"enemies","type":"string"},{"internalType":"string","name":"traps","type":"string"},{"internalType":"string","name":"bossMonster","type":"string"},{"internalType":"string","name":"artefact","type":"string"},{"internalType":"string","name":"passageways","type":"string"},{"internalType":"string","name":"rooms","type":"string"},{"internalType":"string","name":"theSoulless","type":"string"},{"internalType":"string","name":"demiGod","type":"string"},{"internalType":"uint256[8]","name":"hitPoints","type":"uint256[8]"},{"internalType":"bool","name":"isOpen","type":"bool"},{"internalType":"uint256","name":"rank","type":"uint256"},{"internalType":"int256","name":"rewards","type":"int256"}],"internalType":"struct Dungeon2.DungeonInfo[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"dungeonId","type":"uint256"}],"name":"getEnemies","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getImageBaseURL","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"dungeonId","type":"uint256"}],"name":"getPassageways","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"dungeonId","type":"uint256"},{"internalType":"uint256","name":"lootToken","type":"uint256"}],"name":"getRaidHitPoints","outputs":[{"internalType":"uint256[9]","name":"","type":"uint256[9]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"dungeonId","type":"uint256"},{"internalType":"uint256[]","name":"lootTokens","type":"uint256[]"}],"name":"getRaidHitPointsBatch","outputs":[{"internalType":"uint256[9][]","name":"hitPoints","type":"uint256[9][]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getRewardBrackets","outputs":[{"components":[{"internalType":"uint256","name":"max","type":"uint256"},{"internalType":"uint256","name":"relics","type":"uint256"}],"internalType":"struct Dungeon2.AwardBracket[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"damage","type":"uint256"}],"name":"getRewardCount","outputs":[{"internalType":"uint256","name":"rewardCount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getRewardsForToken","outputs":[{"internalType":"uint256","name":"dungeonId","type":"uint256"},{"internalType":"uint256","name":"rewardFirstId","type":"uint256"},{"internalType":"uint256","name":"rewardCount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"getRewardsForTokens","outputs":[{"internalType":"uint256[]","name":"dungeonId","type":"uint256[]"},{"internalType":"uint256[]","name":"rewardFirstId","type":"uint256[]"},{"internalType":"uint256[]","name":"rewardCount","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"dungeonId","type":"uint256"}],"name":"getRooms","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"dungeonId","type":"uint256"}],"name":"getTheSoulless","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes12","name":"data","type":"bytes12"}],"name":"getTokenOrderIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes12","name":"","type":"bytes12"}],"name":"getTokenProvenance","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"dungeonId","type":"uint256"}],"name":"getTraps","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"numDungeons","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"dungeonId","type":"uint256"},{"internalType":"uint256","name":"raidTokenId","type":"uint256"}],"name":"raidDungeon","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"blocksBetweenFreeRaids","type":"uint256"}],"name":"setBlocksBetweenFreeRaids","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"newImageBaseURL","type":"string"}],"name":"setImageBaseURL","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"raidingFee","type":"uint256"}],"name":"setRaidingFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"locked","type":"bool"}],"name":"setRaidingLock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60046102c0908152634f72637360e01b6102e0526080908152600d6103009081526c4769616e74205370696465727360981b6103205260a05260066103408181526554726f6c6c7360d01b6103605260c0526007610380818152665a6f6d6269657360c81b6103a05260e052600a6103c0818152694769616e74205261747360b01b6103e052610100526009610400818152684d696e6f746175727360b81b61042052610120526104408281526957657265776f6c76657360b01b6104605261014052610480918252694265727365726b65727360b01b6104a052610160919091526104c082815266476f626c696e7360c81b6104e0526101805261050083815265476e6f6d657360d01b610520526101a0526105408381526547686f756c7360d01b610560526101c052610580828152665772616974687360c81b6105a0526101e0526105c081815268536b656c65746f6e7360b81b6105e0526102005261060090815268526576656e616e747360b81b6106205261022052600c6106409081526b4e6563726f6d616e6365727360a01b61066052610240526008610680908152675761726c6f636b7360c01b6106a052610260526106c09081526657697a6172647360c81b6106e052610280526107406040526107009081526544727569647360d01b610720526102a052620001fc90600e906012620013be565b506040805161022081018252600a6101e08201818152695472617020446f6f727360b01b610200840152825282518084018452600c81526b506f69736f6e20446172747360a01b602082810191909152808401919091528351808501855282815269466c616d65204a65747360b01b818301528385015283518085018552600d8082526c141bda5cdbdb99590815d95b1b609a1b82840152606085019190915284518086018652600b8082526a11985b1b1a5b99c813995d60aa1b82850152608086019190915285518087018752600e81526d109b1a5b991a5b99c8131a59da1d60921b8185015260a086015285518087018752600f8082526e4c696768746e696e6720426f6c747360881b8286015260c0870191909152865180880188528181526e50656e64756c756d20426c6164657360881b8186015260e08701528651808801885294855269536e616b65205069747360b01b85850152610100860194909452855180870187528281526c506f69736f6e6f75732047617360981b818501526101208601528551808701875260098152684c617661205069747360b81b81850152610140860152855180870187528181526a109d5c9b9a5b99c813da5b60aa1b8185015261016086015285518087018752601781527f466972652d427265617468696e6720476172676f796c6500000000000000000081850152610180860152855180870187529182526c48696464656e204172726f777360981b828401526101a0850191909152845180860190955284526a5370696b6564205069747360a81b908401526101c08201929092526200045a91908162001422565b506040805161022081018252600d6101e082018181526c23b7b63232b710223930b3b7b760991b610200840152825282518084018452600c8082526b213630b1b590223930b3b7b760a11b60208381019190915280850192909252845180860186529283526c213937b73d3290223930b3b7b760991b838301528385019290925283518085018552600a808252692932b210223930b3b7b760b11b828401526060850191909152845180860186526006808252652bbcbb32b93760d11b8285015260808601919091528551808701875282815269119a5c994811da585b9d60b21b8185015260a086015285518087018752600b8082526a14dd1bdc9b4811da585b9d60aa1b8286015260c08701919091528651808801885260098152681258d94811da585b9d60ba1b8186015260e0870152865180880188529081526a119c9bdcdd0811da585b9d60aa1b818501526101008601528551808701875291825269121a5b1b0811da585b9d60b21b828401526101208501919091528451808601865260048152634f67726560e01b8184015261014085015284518086018652600e81526d536b656c65746f6e204c6f72647360901b818401526101608501528451808601865260108082526f4b6e6967687473206f66204368616f7360801b82850152610180860191909152855180870187529384526b4c697a617264204b696e677360a01b848401526101a085019390935284518086019095528452654d656475736160d01b908401526101c08201929092526200069b9190600f62001422565b50604080516102208101825260176101e082018181527f54686520507572706c65204f7262206f66205a68616e67000000000000000000610200840152825282518084018452601381527f54686520486f726e206f662043616c6c696e67000000000000000000000000006020828101919091528084019190915283518085018552601a81527f54686520576f6e64726f7573205477696e65206f662050696e67000000000000818301528385015283518085018552601581527f54686520436972636c65206f662053717561726573000000000000000000000081830152606084015283518085018552601681527f546865205363726f6c6c206f662053657270656e7473000000000000000000008183015260808401528351808501855260108082526f54686520526f64206f662052756e657360801b8284015260a085019190915284518086018652601881527f4372797374616c206f66204372696d736f6e204c6967687400000000000000008184015260c085015284518086018652600f8082526e4f696c206f66204461726b6e65737360881b8285015260e0860191909152855180870187528181526e426f6e65637275736865722042616760881b81850152610100860152855180870187526011808252704d6972726f72206f66204d61646e65737360781b8286015261012087019190915286518088018852601481527f416e6b68206f662074686520416e6369656e747300000000000000000000000081860152610140870152865180880188528381526f2a3432902bb0b7321037b3102332b0b960811b81860152610160870152865180880188529485527f5468652054656e7461636c6573206f6620546572726f7200000000000000000085850152610180860194909452855180870187529182526f54686520416c746172206f662049636560801b828401526101a0850191909152845180860190955282855270151a194810dc99595c1a5b99c812185b99607a1b918501919091526101c0830193909352620009949290919062001422565b506040805161022081018252600e6101e082019081526d4372757368696e672057616c6c7360901b610200830152815281518083018352600a8152694c6f6f7365204c6f677360b01b6020828101919091528083019190915282518084018452600d8082526c526f6c6c696e6720526f636b7360981b828401528385019190915283518085018552600c81526b29b834b5b2b210233637b7b960a11b818401526060840152835180850185529081526c4275726e696e6720436f616c7360981b8183015260808301528251808401845260168082527f5468652048696464656e20506974206f6620446f6f6d000000000000000000008284015260a084019190915283518085018552601181527054686520537469636b792053746169727360781b8184015260c084015283518085018552601481527f54686520427269646765206f6620536f72726f770000000000000000000000008184015260e084015283518085018552601381527f546865204d617a65206f66204d61646e657373000000000000000000000000008184015261010084015283518085018552601280825271151a1948119b1bdbd9195908151d5b9b995b60721b828501526101208501919091528451808601865260108082526f54686520466c6f6f72206f6620466f6760801b82860152610140860191909152855180870187529081526f2a343290233937bd32b710233637b7b960811b818501526101608501528451808601865281815271546865205368696674696e672053616e647360701b8185015261018085015284518086018652818152710546865205472656d626c696e6720547261760741b818501526101a085015284518086019095529084527f5468652042726f6b656e20476c61737320466c6f6f7200000000000000000000918401919091526101c082019290925262000c4c9190600f62001422565b50604080516102208101825260146101e082019081527f526f6f6d206f6620556e646561642048616e647300000000000000000000000061020083015281528151808301835260178082527f526f6f6d206f66207468652053746f6e6520436c617773000000000000000000602083810191909152808401929092528351808501855260158082527f526f6f6d206f6620506f69736f6e204172726f777300000000000000000000008285015284860191909152845180860186529081527f526f6f6d206f66207468652049726f6e2042656172000000000000000000000081840152606084015283518085018552601a8082527f526f6f6d206f66207468652057616e646572696e6720576f726d000000000000828501526080850191909152845180860186528181527f526f6f6d206f662074686520496e6665726e616c2042656173740000000000008185015260a0850152845180860186528181527f526f6f6d206f662074686520496e66656374656420536c696d650000000000008185015260c0850152845180860186529182527f526f6f6d206f662074686520486f726e656420526174730000000000000000008284015260e0840191909152835180850185529081527f526f6f6d206f662074686520466c616d696e6720486f756e64730000000000008183015261010083015282518084018452601b81527f526f6f6d206f6620746865204d696c6c696f6e204d6167676f747300000000008183015261012083015282518084018452601881527f526f6f6d206f662074686520466c616d696e67205069747300000000000000008183015261014083015282518084018452601e81527f526f6f6d206f662074686520526162696420466c6573682045617465727300008183015261016083015282518084018452601681527f526f6f6d206f6620746865204772696d20476f6c656d000000000000000000008183015261018083015282518084018452601f81527f526f6f6d206f6620746865204368616f73204669726562726561746865727300818301526101a08301528251808401909352601c83527f526f6f6d206f6620746865204e696768746d61726520436c6f6e657300000000908301526101c081019190915262000f9990601390600f62001422565b5060405180606001604052806040518060400160405280600a8152602001692634b1b41028bab2b2b760b11b81525081526020016040518060400160405280600b81526020016a169bdb589a5948131bdc9960aa1b81525081526020016040518060400160405280600f81526020016e2a34329023b934b6902932b0b832b960891b81525081525060149060036200103392919062001474565b506040805160e081018252600e60a082018181526d2a3432902137b732902232b6b7b760911b60c0840152825282518084018452600d81526c151a194814db985ad94811dbd9609a1b6020828101919091528084019190915283518085018552601381527f54686520486f776c696e672042616e7368656500000000000000000000000000818301528385015283518085018552600a8152692232b6b7b739b830bbb760b11b81830152606084015283518085019094529083526d54686520456c656d656e74616c7360901b9083015260808101919091526200111b906015906005620014c6565b503480156200112957600080fd5b5060405162005483380380620054838339810160408190526200114c9162001898565b62001157336200136e565b600680546001600160a01b03808a166001600160a01b0319928316179092556007805489841690831617905560088054928816929091169190911790558751620011a99060029060208b019062001518565b5060006004558351620011c490600990602087019062001564565b50600b839055600c805460ff19166001179055600d82905560005b8a61ffff168161ffff161015620012a15760016200127661ffff8d168c600060e082015160c083015160a08401516080850151600093604886901b9360409190911b9260389190911b9160309190911b9060281b60208860036020020151901b60188960026020020151901b60108a60016020020151901b60088b60006020020151901b8c17171717171717171790509392505050565b8154600181018355600092835260209092209091015580620012988162001a8e565b915050620011df565b506000601082511115620012b457600080fd5b60005b82518161ffff1610156200135957620012d281601062001a24565b61ffff166008848361ffff1681518110620012fd57634e487b7160e01b600052603260045260246000fd5b602002602001015160200151901b848361ffff16815181106200133057634e487b7160e01b600052603260045260246000fd5b60200260200101516000015117901b821791508080620013509062001a8e565b915050620012b7565b506003555062001adf98505050505050505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b82805482825590600052602060002090810192821562001410579160200282015b82811115620014105782518051620013ff91849160209091019062001564565b5091602001919060010190620013df565b506200141e929150620015e0565b5090565b82805482825590600052602060002090810192821562001410579160200282015b828111156200141057825180516200146391849160209091019062001564565b509160200191906001019062001443565b82805482825590600052602060002090810192821562001410579160200282015b82811115620014105782518051620014b591849160209091019062001564565b509160200191906001019062001495565b82805482825590600052602060002090810192821562001410579160200282015b828111156200141057825180516200150791849160209091019062001564565b5091602001919060010190620014e7565b82805482825590600052602060002090810192821562001556579160200282015b828111156200155657825182559160200191906001019062001539565b506200141e92915062001601565b828054620015729062001a51565b90600052602060002090601f01602090048101928262001596576000855562001556565b82601f10620015b157805160ff191683800117855562001556565b828001600101855582156200155657918201828111156200155657825182559160200191906001019062001539565b808211156200141e576000620015f7828262001618565b50600101620015e0565b5b808211156200141e576000815560010162001602565b508054620016269062001a51565b6000825580601f1062001637575050565b601f01602090049060005260206000209081019062001657919062001601565b50565b80516001600160a01b03811681146200167257600080fd5b919050565b600082601f83011262001688578081fd5b81516020620016a16200169b83620019fe565b620019cb565b80838252828201915082860187848660061b8901011115620016c1578586fd5b855b858110156200170657604080838b031215620016dd578788fd5b620016e7620019a0565b83518152868401518782015285529385019390910190600101620016c3565b5090979650505050505050565b600082601f83011262001724578081fd5b6040516101008082016001600160401b03811183821017156200174b576200174b62001ac9565b60405281848281018710156200175f578485fd5b8492505b6008831015620017855780518252600192909201916020918201910162001763565b509195945050505050565b600082601f830112620017a1578081fd5b81516020620017b46200169b83620019fe565b80838252828201915082860187848660051b8901011115620017d4578586fd5b855b858110156200170657815184529284019290840190600101620017d6565b600082601f83011262001805578081fd5b81516001600160401b0381111562001821576200182162001ac9565b602062001837601f8301601f19168201620019cb565b82815285828487010111156200184b578384fd5b835b838110156200186a5785810183015182820184015282016200184d565b838111156200187b57848385840101525b5095945050505050565b805161ffff811681146200167257600080fd5b6000806000806000806000806000806102208b8d031215620018b8578586fd5b620018c38b62001885565b9950620018d48c60208d0162001713565b6101208c01519099506001600160401b0380821115620018f2578788fd5b620019008e838f0162001790565b9950620019116101408e016200165a565b9850620019226101608e016200165a565b9750620019336101808e016200165a565b96506101a08d01519150808211156200194a578586fd5b620019588e838f01620017f4565b95506101c08d015194506101e08d015193506102008d01519150808211156200197f578283fd5b506200198e8d828e0162001677565b9150509295989b9194979a5092959850565b604080519081016001600160401b0381118282101715620019c557620019c562001ac9565b60405290565b604051601f8201601f191681016001600160401b0381118282101715620019f657620019f662001ac9565b604052919050565b60006001600160401b0382111562001a1a5762001a1a62001ac9565b5060051b60200190565b600061ffff8083168185168183048111821515161562001a485762001a4862001ab3565b02949350505050565b600181811c9082168062001a6657607f821691505b6020821081141562001a8857634e487b7160e01b600052602260045260246000fd5b50919050565b600061ffff8083168181141562001aa95762001aa962001ab3565b6001019392505050565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6139948062001aef6000396000f3fe6080604052600436106102725760003560e01c80636bca96a91161014f578063acfae5ad116100c1578063cd08b6be1161007a578063cd08b6be146107a7578063cf99e0db146107c7578063d4a7f552146107f6578063e13b49b214610816578063f2ac98981461082c578063f2fde38b1461084657600080fd5b8063acfae5ad146106d8578063ae208b3414610705578063b81112ff14610725578063bfe226401461073a578063c840496c1461075a578063cc0a24b71461077a57600080fd5b806386adcd221161011357806386adcd221461062757806386c1e32b1461063d5780638da5cb5b14610650578063993539f6146106785780639c27c7e514610698578063a4da70fc146106b857600080fd5b80636bca96a9146105745780636e0e908c14610594578063715018a6146105c15780637559cb38146105d65780637a552a9a1461061157600080fd5b80632f2ddf54116101e857806347418a24116101ac57806347418a24146104ca57806348e1ef29146104df5780634f618940146104ff57806357f425101461051f5780635eac62391461053457806365e29e711461055457600080fd5b80632f2ddf541461040657806334377dec1461042657806338da057d146104485780633b7afad2146104685780633ccfd60b146104b557600080fd5b80631b3e66be1161023a5780631b3e66be1461033f5780631cffdbb51461035f578063213e6e201461038457806323030a1b14610399578063283eab67146103b95780632abc55f6146103e657600080fd5b806301194049146102775780630c8f5504146102ad57806311270ca9146102cf57806315ae11b2146102fd578063181b6c7d1461031d575b600080fd5b34801561028357600080fd5b506102976102923660046133a9565b610866565b6040516102a49190613788565b60405180910390f35b3480156102b957600080fd5b506102cd6102c83660046132a9565b61087c565b005b3480156102db57600080fd5b506102ef6102ea366004613335565b6108c6565b6040519081526020016102a4565b34801561030957600080fd5b506102cd61031836600461326a565b6108d3565b34801561032957600080fd5b50610332610910565b6040516102a49190613545565b34801561034b57600080fd5b506102cd61035a366004613335565b610a5e565b34801561036b57600080fd5b50610374610a8d565b60405190151581526020016102a4565b34801561039057600080fd5b50610297610ab3565b3480156103a557600080fd5b506102976103b4366004613335565b610b41565b3480156103c557600080fd5b506102ef6103d436600461317f565b600a6020526000908152604090205481565b3480156103f257600080fd5b506102ef6104013660046133a9565b610b6f565b34801561041257600080fd5b50610297610421366004613335565b610b87565b34801561043257600080fd5b5061043b610bb4565b6040516102a49190613594565b34801561045457600080fd5b50610297610463366004613335565b610f21565b34801561047457600080fd5b506102976104833660046133a9565b50506040805180820190915260168152755468652043727970743a20436861707465722054776f60501b602082015290565b3480156104c157600080fd5b506102cd610f50565b3480156104d657600080fd5b506001546102ef565b3480156104eb57600080fd5b506102ef6104fa366004613335565b611011565b34801561050b57600080fd5b5061037461051a366004613335565b6110b7565b34801561052b57600080fd5b506102976110de565b34801561054057600080fd5b506102cd61054f366004613238565b611170565b34801561056057600080fd5b5061029761056f366004613335565b6112a0565b34801561058057600080fd5b5061029761058f366004613335565b6112ce565b3480156105a057600080fd5b506105b46105af366004613365565b6112ff565b6040516102a49190613502565b3480156105cd57600080fd5b506102cd611420565b3480156105e257600080fd5b506105f66105f1366004613335565b611456565b604080519384526020840192909252908201526060016102a4565b34801561061d57600080fd5b506102ef60035481565b34801561063357600080fd5b506102ef600d5481565b6102cd61064b3660046133e4565b611486565b34801561065c57600080fd5b506000546040516001600160a01b0390911681526020016102a4565b34801561068457600080fd5b50610297610693366004613335565b611b67565b3480156106a457600080fd5b506102ef6106b3366004613335565b611b92565b3480156106c457600080fd5b506102ef6106d3366004613335565b611bc1565b3480156106e457600080fd5b506106f86106f33660046133e4565b611be2565b6040516102a49190613714565b34801561071157600080fd5b506102cd610720366004613335565b611c1f565b34801561073157600080fd5b506102ef611c4e565b34801561074657600080fd5b50610297610755366004613335565b611c65565b34801561076657600080fd5b506102ef610775366004613335565b611c93565b34801561078657600080fd5b5061079a610795366004613335565b611ca3565b6040516102a49190613705565b3480156107b357600080fd5b506102ef6107c2366004613335565b611cd7565b3480156107d357600080fd5b506107e76107e2366004613238565b611d41565b6040516102a493929190613723565b34801561080257600080fd5b50610297610811366004613335565b611f1b565b34801561082257600080fd5b506102ef600b5481565b34801561083857600080fd5b50600c546103749060ff1681565b34801561085257600080fd5b506102cd61086136600461317f565b611f46565b6040805160208101909152600081525b92915050565b6000546001600160a01b031633146108af5760405162461bcd60e51b81526004016108a69061379b565b60405180910390fd5b80516108c2906009906020840190612fb6565b5050565b60006108766010836138f3565b6000546001600160a01b031633146108fd5760405162461bcd60e51b81526004016108a69061379b565b600c805460ff1916911515919091179055565b6060600060015b6010811161094b5761092a816010613841565b600354901c61093b5780915061094b565b610944816138d8565b9050610917565b506000816001600160401b0381111561097457634e487b7160e01b600052604160045260246000fd5b6040519080825280602002602001820160405280156109b957816020015b60408051808201909152600080825260208201528152602001906001900390816109925790505b50905060005b82811015610a575760006109d4826010613841565b600354901c61ffff1690508060ff16838381518110610a0357634e487b7160e01b600052603260045260246000fd5b60200260200101516000018181525050600881901c838381518110610a3857634e487b7160e01b600052603260045260246000fd5b602090810291909101810151015250610a50816138d8565b90506109bf565b5092915050565b6000546001600160a01b03163314610a885760405162461bcd60e51b81526004016108a69061379b565b600d55565b600d54336000908152600a6020526040812054909190610aad9043613860565b11905090565b60098054610ac0906138a3565b80601f0160208091040260200160405190810160405280929190818152602001828054610aec906138a3565b8015610b395780601f10610b0e57610100808354040283529160200191610b39565b820191906000526020600020905b815481529060010190602001808311610b1c57829003601f168201915b505050505081565b60606108768260405180604001604052806008815260200167534f554c4c45535360c01b8152506014611fde565b600060a082901c610b7f816108c6565b949350505050565b60606108768260405180604001604052806007815260200166454e454d49455360c81b815250600e611fde565b6001546060906000906001600160401b03811115610be257634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015610c1b57816020015b610c0861303a565b815260200190600190039081610c005790505b50905060005b600154811015610f1b57610c34816108c6565b828281518110610c5457634e487b7160e01b600052603260045260246000fd5b602090810291909101015152610c6981610b87565b828281518110610c8957634e487b7160e01b600052603260045260246000fd5b602002602001015160200181905250610ca181611b67565b828281518110610cc157634e487b7160e01b600052603260045260246000fd5b602002602001015160400181905250610cd9816112a0565b828281518110610cf957634e487b7160e01b600052603260045260246000fd5b602002602001015160600181905250610d1181610f21565b828281518110610d3157634e487b7160e01b600052603260045260246000fd5b602002602001015160800181905250610d49816112ce565b828281518110610d6957634e487b7160e01b600052603260045260246000fd5b602002602001015160a00181905250610d8181611f1b565b828281518110610da157634e487b7160e01b600052603260045260246000fd5b602002602001015160c00181905250610db981610b41565b828281518110610dd957634e487b7160e01b600052603260045260246000fd5b602002602001015160e00181905250610df181611c65565b828281518110610e1157634e487b7160e01b600052603260045260246000fd5b60200260200101516101000181905250610e2a81611ca3565b828281518110610e4a57634e487b7160e01b600052603260045260246000fd5b60200260200101516101200181905250610e63816110b7565b828281518110610e8357634e487b7160e01b600052603260045260246000fd5b602090810291909101015190151561014090910152610ea181611b92565b828281518110610ec157634e487b7160e01b600052603260045260246000fd5b6020026020010151610160018181525050610edb81611cd7565b828281518110610efb57634e487b7160e01b600052603260045260246000fd5b60209081029190910101516101800152610f14816138d8565b9050610c21565b50919050565b6060610876826040518060400160405280600981526020016841525445464143545360b81b8152506011611fde565b6000546001600160a01b03163314610f7a5760405162461bcd60e51b81526004016108a69061379b565b600080546040516001600160a01b039091169047908381818185875af1925050503d8060008114610fc7576040519150601f19603f3d011682016040523d82523d6000602084013e610fcc565b606091505b505090508061100e5760405162461bcd60e51b815260206004820152600e60248201526d19985a5b1959081d1bc81cd95b9960921b60448201526064016108a6565b50565b6000805b601081101561106357600061102b826010613841565b600354901c61ffff1690508060ff168411156110475750611051565b60081c9392505050565b8061105b816138d8565b915050611015565b5060405162461bcd60e51b815260206004820152602260248201527f696e76616c69642072657761726420627261636b65747320636f6e6669677572604482015261195960f21b60648201526084016108a6565b60015460009082106110cb57506000919050565b6001546110d783611b92565b1492915050565b6060600980546110ed906138a3565b80601f0160208091040260200160405190810160405280929190818152602001828054611119906138a3565b80156111665780601f1061113b57610100808354040283529160200191611166565b820191906000526020600020905b81548152906001019060200180831161114957829003601f168201915b5050505050905090565b6001546006546008546001600160a01b03918216911660005b84518110156112995760008060006111c986888a87815181106111bc57634e487b7160e01b600052603260045260246000fd5b60200260200101516120b1565b919450925090506001600160a01b031960a084901b1660005b82811015611283576001600160a01b03871663763df5d8336112048488613815565b6040516001600160e01b031960e085901b1681526001600160a01b03909216600483015260248201526001600160a01b031985166044820152606401600060405180830381600087803b15801561125a57600080fd5b505af115801561126e573d6000803e3d6000fd5b505050508061127c906138d8565b90506111e2565b505050505080611292906138d8565b9050611189565b5050505050565b606061087682604051806040016040528060088152602001674d4f4e535445525360c01b8152506010611fde565b6060610876826040518060400160405280600b81526020016a504153534147455741595360a81b8152506012611fde565b606081516001600160401b0381111561132857634e487b7160e01b600052604160045260246000fd5b60405190808252806020026020018201604052801561136157816020015b61134e6130aa565b8152602001906001900390816113465790505b509050600061139a6001858154811061138a57634e487b7160e01b600052603260045260246000fd5b9060005260206000200154612304565b5091505060005b8351811015611418576113dc85838684815181106113cf57634e487b7160e01b600052603260045260246000fd5b602002602001015161238a565b8382815181106113fc57634e487b7160e01b600052603260045260246000fd5b602002602001018190525080611411906138d8565b90506113a1565b505092915050565b6000546001600160a01b0316331461144a5760405162461bcd60e51b81526004016108a69061379b565b6114546000612a2b565b565b60065460015460009182918291611479916001600160a01b0390911690866120b1565b9250925092509193909250565b600c5460ff16156114cd5760405162461bcd60e51b81526020600482015260116024820152701c985a591a5b99c81a5cc81b1bd8dad959607a1b60448201526064016108a6565b600081815260056020526040902054156115295760405162461bcd60e51b815260206004820152601b60248201527f6c6f6f7420616c7265616479207573656420696e20612072616964000000000060448201526064016108a6565b6006546040516331a9108f60e11b8152600481018390526001600160a01b0390911690636352211e9060240160206040518083038186803b15801561156d57600080fd5b505afa158015611581573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115a5919061319b565b6001600160a01b0316336001600160a01b0316146116055760405162461bcd60e51b815260206004820152601860248201527f72616964657220646f6573206e6f74206f776e206c6f6f74000000000000000060448201526064016108a6565b6001548083106116495760405162461bcd60e51b815260206004820152600f60248201526e34b73b30b634b210323ab733b2b7b760891b60448201526064016108a6565b600b54611654610a8d565b1561166d5750336000908152600a602052604081204390555b803410156116b35760405162461bcd60e51b81526020600482015260136024820152721b9bdd08195b9bdd59da08195d1a081cd95b9d606a1b60448201526064016108a6565b803411156116f357336108fc6116c98334613860565b6040518115909202916000818181858888f193505050501580156116f1573d6000803e3d6000fd5b505b600080600061171c6001888154811061138a57634e487b7160e01b600052603260045260246000fd5b9250925092508483146117715760405162461bcd60e51b815260206004820152601860248201527f64756e67656f6e20616c726561647920636f6d706c657465000000000000000060448201526064016108a6565b600061177e88848961238a565b6101008101519091506117d35760405162461bcd60e51b815260206004820152601960248201527f7261696420776f756c642068617665206e6f206166666563740000000000000060448201526064016108a6565b60016000805b60088110156118b05785816008811061180257634e487b7160e01b600052603260045260246000fd5b60200201516118119083613815565b915083816009811061183357634e487b7160e01b600052603260045260246000fd5b602002015186826008811061185857634e487b7160e01b600052603260045260246000fd5b602002018181516118699190613860565b905250600086826008811061188e57634e487b7160e01b600052603260045260246000fd5b6020020151111561189e57600092505b806118a8816138d8565b9150506117d9565b5060006118c38460086020020151611011565b90506001602082901b601087901b60088e901b17171760008b8152600560205260409020556118f28186613815565b94508215611913576004805497508790600061190d836138d8565b91905055505b61199187878760e082015160c083015160a08401516080850151600093604886901b9360409190911b9260389190911b9160309190911b9060281b60208860036020020151901b60188960026020020151901b60108a60016020020151901b60088b60006020020151901b8c17171717171717171790509392505050565b60018c815481106119b257634e487b7160e01b600052603260045260246000fd5b90600052602060002001819055508a7f3f015a4f0c7cd9549187c19ff1cb102555de6af20e28262616a6a8bef1dd32048b60405180610100016040528088600060098110611a1057634e487b7160e01b600052603260045260246000fd5b6020020151815260200188600160098110611a3b57634e487b7160e01b600052603260045260246000fd5b6020020151815260200188600260098110611a6657634e487b7160e01b600052603260045260246000fd5b6020020151815260200188600360098110611a9157634e487b7160e01b600052603260045260246000fd5b6020020151815260200188600460098110611abc57634e487b7160e01b600052603260045260246000fd5b6020020151815260200188600560098110611ae757634e487b7160e01b600052603260045260246000fd5b6020020151815260200188600660098110611b1257634e487b7160e01b600052603260045260246000fd5b6020020151815260200188600760098110611b3d57634e487b7160e01b600052603260045260246000fd5b60200201519052604051611b529291906137d0565b60405180910390a25050505050505050505050565b60606108768260405180604001604052806005815260200164545241505360d81b815250600f611fde565b6000611bb86001838154811061138a57634e487b7160e01b600052603260045260246000fd5b50909392505050565b60028181548110611bd157600080fd5b600091825260209091200154905081565b611bea6130aa565b6000611c106001858154811061138a57634e487b7160e01b600052603260045260246000fd5b50915050610b7f84828561238a565b6000546001600160a01b03163314611c495760405162461bcd60e51b81526004016108a69061379b565b600b55565b600154600090611c5e5750606390565b5060015490565b60606108768260405180604001604052806008815260200167454c454d454e545360c01b8152506015611fde565b60018181548110611bd157600080fd5b611cab6130c9565b611ccf6001838154811061138a57634e487b7160e01b600052603260045260246000fd5b509392505050565b6001546000908210611cec5750600019919050565b6000611cf783611b92565b6001549091508110611d0d575060001992915050565b60028181548110611d2e57634e487b7160e01b600052603260045260246000fd5b9060005260206000200154915050919050565b606080606083516001600160401b03811115611d6d57634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015611d96578160200160208202803683370190505b50925083516001600160401b03811115611dc057634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015611de9578160200160208202803683370190505b50915083516001600160401b03811115611e1357634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015611e3c578160200160208202803683370190505b506006546001549192506001600160a01b03169060005b8651811015611f1157611e8183838984815181106111bc57634e487b7160e01b600052603260045260246000fd5b888481518110611ea157634e487b7160e01b600052603260045260246000fd5b60200260200101888581518110611ec857634e487b7160e01b600052603260045260246000fd5b60200260200101888681518110611eef57634e487b7160e01b600052603260045260246000fd5b602090810291909101019290925291905252611f0a816138d8565b9050611e53565b5050509193909250565b60606108768260405180604001604052806005815260200164524f4f4d5360d81b8152506013611fde565b6000546001600160a01b03163314611f705760405162461bcd60e51b81526004016108a69061379b565b6001600160a01b038116611fd55760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016108a6565b61100e81612a2b565b60606000611ff185858580549050612a7b565b905082818154811061201357634e487b7160e01b600052603260045260246000fd5b906000526020600020018054612028906138a3565b80601f0160208091040260200160405190810160405280929190818152602001828054612054906138a3565b80156120a15780601f10612076576101008083540402835291602001916120a1565b820191906000526020600020905b81548152906001019060200180831161208457829003601f168201915b50505050509150505b9392505050565b6000806000856001600160a01b0316636352211e856040518263ffffffff1660e01b81526004016120e491815260200190565b60206040518083038186803b1580156120fc57600080fd5b505afa158015612110573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612134919061319b565b6001600160a01b0316336001600160a01b0316146121945760405162461bcd60e51b815260206004820152601a60248201527f73656e6465722069736e2774206f776e6572206f66206c6f6f7400000000000060448201526064016108a6565b600084815260056020526040902054806121f05760405162461bcd60e51b815260206004820152601960248201527f6c6f6f7420626167206e6f74207573656420696e20726169640000000000000060448201526064016108a6565b60ff600882901c8116945061ffff601083901c169350602082901c1691508584106122525760405162461bcd60e51b81526020600482015260126024820152711a5b9d985b1a5908191d5b99d95bdb881a5960721b60448201526064016108a6565b60006122786001868154811061138a57634e487b7160e01b600052603260045260246000fd5b505090508681106122c05760405162461bcd60e51b8152602060048201526012602482015271323ab733b2b7b71039ba34b6361037b832b760711b60448201526064016108a6565b600281815481106122e157634e487b7160e01b600052603260045260246000fd5b9060005260206000200154846122f79190613815565b9350505093509350939050565b600061230e6130c9565b60ff600884901c81168252601084901c8116602080840191909152601885901c8216604084015281851693506000919085901c1682600360200201525060ff602884901c81166080830152603084901c811660a0830152603884901c811660c0830152604084901c1660e08201529092909160481c61ffff1690565b6123926130aa565b61239a6130c9565b6123a26130aa565b600084815260056020526040902054156123bf5791506120aa9050565b60075485516001600160a01b03909116901561248457604051634c865a7960e01b8152600481018690526000906001600160a01b03831690634c865a799060240160c06040518083038186803b15801561241857600080fd5b505afa15801561242c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061245091906131b7565b9050612480888260405180604001604052806007815260200166454e454d49455360c81b81525060126000612a88565b8452505b60208601511561253e5760405163fbe0fbd560e01b8152600481018690526000906001600160a01b0383169063fbe0fbd59060240160c06040518083038186803b1580156124d157600080fd5b505afa1580156124e5573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061250991906131b7565b9050612537888260405180604001604052806005815260200164545241505360d81b815250600f6001612a88565b6020850152505b6040860151156125fb57604051630441870d60e41b8152600481018690526000906001600160a01b0383169063441870d09060240160c06040518083038186803b15801561258b57600080fd5b505afa15801561259f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125c391906131b7565b90506125f48882604051806040016040528060088152602001674d4f4e535445525360c01b815250600f6002612a88565b6040850152505b6060860151156126b95760405163098779df60e21b8152600481018690526000906001600160a01b0383169063261de77c9060240160c06040518083038186803b15801561264857600080fd5b505afa15801561265c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061268091906131b7565b90506126b288826040518060400160405280600981526020016841525445464143545360b81b815250600f6003612a88565b6060850152505b6080860151156127795760405163701cc60d60e11b8152600481018690526000906001600160a01b0383169063e0398c1a9060240160c06040518083038186803b15801561270657600080fd5b505afa15801561271a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061273e91906131b7565b905061277288826040518060400160405280600b81526020016a504153534147455741595360a81b815250600f6004612a88565b6080850152505b60a08601511561283357604051630cb7b2cf60e11b8152600481018690526000906001600160a01b0383169063196f659e9060240160c06040518083038186803b1580156127c657600080fd5b505afa1580156127da573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127fe91906131b7565b905061282c888260405180604001604052806005815260200164524f4f4d5360d81b815250600f6005612a88565b60a0850152505b60c0860151156128f057604051634521d52360e11b8152600481018690526000906001600160a01b03831690638a43aa469060240160c06040518083038186803b15801561288057600080fd5b505afa158015612894573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128b891906131b7565b90506128e9888260405180604001604052806008815260200167534f554c4c45535360c01b81525060036006612a88565b60c0850152505b60e0860151156129ad5760405163031f03bd60e11b8152600481018690526000906001600160a01b0383169063063e077a9060240160c06040518083038186803b15801561293d57600080fd5b505afa158015612951573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061297591906131b7565b90506129a6888260405180604001604052806008815260200167454c454d454e545360c01b81525060056007612a88565b60e0850152505b60005b6008811015612a1f57612a0d818583600881106129dd57634e487b7160e01b600052603260045260246000fd5b6020020151898460088110612a0257634e487b7160e01b600052603260045260246000fd5b602002015186612dbd565b80612a17816138d8565b9150506129b0565b50909695505050505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000610b7f848484612e15565b600080612a96878686612a7b565b86519091506000612aa6896108c6565b612ab1906001613815565b602089015114905060008115612add5750608088015160029015612add57612ada600182613815565b90505b82841415612afb57612af0816002613815565b945050505050612db4565b600754604051632e3f358760e11b81526000916001600160a01b031690635c7e6b0e90612b2e908a90899060040161375c565b60206040518083038186803b158015612b4657600080fd5b505afa158015612b5a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b7e919061328a565b600754604051632e3f358760e11b81529192506000916001600160a01b0390911690635c7e6b0e90612bb6908b90899060040161375c565b60206040518083038186803b158015612bce57600080fd5b505afa158015612be2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c06919061328a565b9050806003811115612c2857634e487b7160e01b600052602160045260246000fd5b826003811115612c4857634e487b7160e01b600052602160045260246000fd5b148015612c7557506003826003811115612c7257634e487b7160e01b600052602160045260246000fd5b14155b15612dab5760075460405163f63db29760e01b81526000916001600160a01b03169063f63db29790612cad908c908b9060040161375c565b60206040518083038186803b158015612cc557600080fd5b505afa158015612cd9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612cfd919061334d565b60075460405163f63db29760e01b81529192506000916001600160a01b039091169063f63db29790612d35908d908b9060040161375c565b60206040518083038186803b158015612d4d57600080fd5b505afa158015612d61573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d85919061334d565b9050818111612da857612d99856001613815565b98505050505050505050612db4565b50505b50909450505050505b95945050505050565b6000828411612dcc5783612dce565b825b905080828660098110612df157634e487b7160e01b600052603260045260246000fd5b60200201528082600860200201818151612e0b9190613815565b9052505050505050565b600080612e5484612e2f612e2a886010613815565b612e6c565b604051602001612e409291906134d3565b604051602081830303815290604052612f85565b90506000612e6284836138f3565b9695505050505050565b606081612e905750506040805180820190915260018152600360fc1b602082015290565b8160005b8115612eba5780612ea4816138d8565b9150612eb39050600a8361382d565b9150612e94565b6000816001600160401b03811115612ee257634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015612f0c576020820181803683370190505b5090505b8415610b7f57612f21600183613860565b9150612f2e600a866138f3565b612f39906030613815565b60f81b818381518110612f5c57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350612f7e600a8661382d565b9450612f10565b600081604051602001612f9891906134b7565b60408051601f19818403018152919052805160209091012092915050565b828054612fc2906138a3565b90600052602060002090601f016020900481019282612fe4576000855561302a565b82601f10612ffd57805160ff191683800117855561302a565b8280016001018555821561302a579182015b8281111561302a57825182559160200191906001019061300f565b506130369291506130e8565b5090565b604051806101a0016040528060008152602001606081526020016060815260200160608152602001606081526020016060815260200160608152602001606081526020016060815260200161308d6130c9565b815260200160001515815260200160008152602001600081525090565b6040518061012001604052806009906020820280368337509192915050565b6040518061010001604052806008906020820280368337509192915050565b5b8082111561303657600081556001016130e9565b600082601f83011261310d578081fd5b813560206001600160401b0382111561312857613128613933565b8160051b6131378282016137e5565b838152828101908684018388018501891015613151578687fd5b8693505b85841015613173578035835260019390930192918401918401613155565b50979650505050505050565b600060208284031215613190578081fd5b81356120aa81613949565b6000602082840312156131ac578081fd5b81516120aa81613949565b600060c082840312156131c8578081fd5b82601f8301126131d6578081fd5b60405160c081018181106001600160401b03821117156131f8576131f8613933565b604052808360c0810186101561320c578384fd5b835b600681101561322d57815183526020928301929091019060010161320e565b509195945050505050565b600060208284031215613249578081fd5b81356001600160401b0381111561325e578182fd5b610b7f848285016130fd565b60006020828403121561327b578081fd5b813580151581146120aa578182fd5b60006020828403121561329b578081fd5b8151600481106120aa578182fd5b600060208083850312156132bb578182fd5b82356001600160401b03808211156132d1578384fd5b818501915085601f8301126132e4578384fd5b8135818111156132f6576132f6613933565b613308601f8201601f191685016137e5565b9150808252868482850101111561331d578485fd5b80848401858401378101909201929092529392505050565b600060208284031215613346578081fd5b5035919050565b60006020828403121561335e578081fd5b5051919050565b60008060408385031215613377578081fd5b8235915060208301356001600160401b03811115613393578182fd5b61339f858286016130fd565b9150509250929050565b600080604083850312156133bb578182fd5b8235915060208301356001600160a01b0319811681146133d9578182fd5b809150509250929050565b600080604083850312156133f6578182fd5b50508035926020909101359150565b8060005b6008811015613428578151845260209384019390910190600101613409565b50505050565b8060005b6009811015613428578151845260209384019390910190600101613432565b6000815180845260208085019450808401835b8381101561348057815187529582019590820190600101613464565b509495945050505050565b600081518084526134a3816020860160208601613877565b601f01601f19169290920160200192915050565b600082516134c9818460208701613877565b9190910192915050565b600083516134e5818460208801613877565b8351908301906134f9818360208801613877565b01949350505050565b6020808252825182820181905260009190848201906040850190845b81811015612a1f5761353183855161342e565b92840192610120929092019160010161351e565b602080825282518282018190526000919060409081850190868401855b8281101561358757815180518552860151868501529284019290850190600101613562565b5091979650505050505050565b60006020808301818452808551808352604092508286019150828160051b870101848801865b838110156136f757603f1989840301855281516102808151855288820151818a8701526135e98287018261348b565b9150508782015185820389870152613601828261348b565b9150506060808301518683038288015261361b838261348b565b9250505060808083015186830382880152613636838261348b565b9250505060a08083015186830382880152613651838261348b565b9250505060c0808301518683038288015261366c838261348b565b9250505060e08083015186830382880152613687838261348b565b9250505061010080830151868303828801526136a3838261348b565b92505050610120808301516136ba82880182613405565b50506101408201511515610220860152610160820151610240860152610180909101516102609094019390935293860193908601906001016135ba565b509098975050505050505050565b61010081016108768284613405565b6101208101610876828461342e565b6060815260006137366060830186613451565b82810360208401526137488186613451565b90508281036040840152612e628185613451565b604081016008841061377e57634e487b7160e01b600052602160045260246000fd5b9281526020015290565b6020815260006120aa602083018461348b565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b82815261012081016120aa6020830184613405565b604051601f8201601f191681016001600160401b038111828210171561380d5761380d613933565b604052919050565b6000821982111561382857613828613907565b500190565b60008261383c5761383c61391d565b500490565b600081600019048311821515161561385b5761385b613907565b500290565b60008282101561387257613872613907565b500390565b60005b8381101561389257818101518382015260200161387a565b838111156134285750506000910152565b600181811c908216806138b757607f821691505b60208210811415610f1b57634e487b7160e01b600052602260045260246000fd5b60006000198214156138ec576138ec613907565b5060010190565b6000826139025761390261391d565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461100e57600080fdfea26469706673582212205bb8becd422b1df4ce6c0d1724e404695c340e5e7ec0326edce30aafec09402964736f6c63430008040033000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000c800000000000000000000000000000000000000000000000000000000000000c800000000000000000000000000000000000000000000000000000000000000c800000000000000000000000000000000000000000000000000000000000000c800000000000000000000000000000000000000000000000000000000000000c800000000000000000000000000000000000000000000000000000000000000c800000000000000000000000000000000000000000000000000000000000000c800000000000000000000000000000000000000000000000000000000000000c800000000000000000000000000000000000000000000000000000000000002200000000000000000000000001dfe7ca09e99d10835bf73044a23b73fc20623df00000000000000000000000004190ef3d7c91c881d335725b6bb5d45236b22ae00000000000000000000000038065291fdce1a752afd725e96ff75e1c38ad6aa0000000000000000000000000000000000000000000000000000000000000440000000000000000000000000000000000000000000000000002386f26fc100000000000000000000000000000000000000000000000000000000000000001991000000000000000000000000000000000000000000000000000000000000048000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000bd000000000000000000000000000000000000000000000000000000000000018f00000000000000000000000000000000000000000000000000000000000001a80000000000000000000000000000000000000000000000000000000000000333000000000000000000000000000000000000000000000000000000000000034c0000000000000000000000000000000000000000000000000000000000000365000000000000000000000000000000000000000000000000000000000000037e0000000000000000000000000000000000000000000000000000000000000397000000000000000000000000000000000000000000000000000000000000067b000000000000000000000000000000000000000000000000000000000000069400000000000000000000000000000000000000000000000000000000000006ad00000000000000000000000000000000000000000000000000000000000006c600000000000000000000000000000000000000000000000000000000000006df00000000000000000000000000000000000000000000000000000000000006f80000000000000000000000000000000000000000000000000000000000000711000000000000000000000000000000000000000000000000000000000000072a0000000000000000000000000000000000000000000000000000000000000001d68747470733a2f2f72656c6963732e74686563727970742e67616d652f00000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000070000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000b000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000ff0000000000000000000000000000000000000000000000000000000000000003
Deployed Bytecode
0x6080604052600436106102725760003560e01c80636bca96a91161014f578063acfae5ad116100c1578063cd08b6be1161007a578063cd08b6be146107a7578063cf99e0db146107c7578063d4a7f552146107f6578063e13b49b214610816578063f2ac98981461082c578063f2fde38b1461084657600080fd5b8063acfae5ad146106d8578063ae208b3414610705578063b81112ff14610725578063bfe226401461073a578063c840496c1461075a578063cc0a24b71461077a57600080fd5b806386adcd221161011357806386adcd221461062757806386c1e32b1461063d5780638da5cb5b14610650578063993539f6146106785780639c27c7e514610698578063a4da70fc146106b857600080fd5b80636bca96a9146105745780636e0e908c14610594578063715018a6146105c15780637559cb38146105d65780637a552a9a1461061157600080fd5b80632f2ddf54116101e857806347418a24116101ac57806347418a24146104ca57806348e1ef29146104df5780634f618940146104ff57806357f425101461051f5780635eac62391461053457806365e29e711461055457600080fd5b80632f2ddf541461040657806334377dec1461042657806338da057d146104485780633b7afad2146104685780633ccfd60b146104b557600080fd5b80631b3e66be1161023a5780631b3e66be1461033f5780631cffdbb51461035f578063213e6e201461038457806323030a1b14610399578063283eab67146103b95780632abc55f6146103e657600080fd5b806301194049146102775780630c8f5504146102ad57806311270ca9146102cf57806315ae11b2146102fd578063181b6c7d1461031d575b600080fd5b34801561028357600080fd5b506102976102923660046133a9565b610866565b6040516102a49190613788565b60405180910390f35b3480156102b957600080fd5b506102cd6102c83660046132a9565b61087c565b005b3480156102db57600080fd5b506102ef6102ea366004613335565b6108c6565b6040519081526020016102a4565b34801561030957600080fd5b506102cd61031836600461326a565b6108d3565b34801561032957600080fd5b50610332610910565b6040516102a49190613545565b34801561034b57600080fd5b506102cd61035a366004613335565b610a5e565b34801561036b57600080fd5b50610374610a8d565b60405190151581526020016102a4565b34801561039057600080fd5b50610297610ab3565b3480156103a557600080fd5b506102976103b4366004613335565b610b41565b3480156103c557600080fd5b506102ef6103d436600461317f565b600a6020526000908152604090205481565b3480156103f257600080fd5b506102ef6104013660046133a9565b610b6f565b34801561041257600080fd5b50610297610421366004613335565b610b87565b34801561043257600080fd5b5061043b610bb4565b6040516102a49190613594565b34801561045457600080fd5b50610297610463366004613335565b610f21565b34801561047457600080fd5b506102976104833660046133a9565b50506040805180820190915260168152755468652043727970743a20436861707465722054776f60501b602082015290565b3480156104c157600080fd5b506102cd610f50565b3480156104d657600080fd5b506001546102ef565b3480156104eb57600080fd5b506102ef6104fa366004613335565b611011565b34801561050b57600080fd5b5061037461051a366004613335565b6110b7565b34801561052b57600080fd5b506102976110de565b34801561054057600080fd5b506102cd61054f366004613238565b611170565b34801561056057600080fd5b5061029761056f366004613335565b6112a0565b34801561058057600080fd5b5061029761058f366004613335565b6112ce565b3480156105a057600080fd5b506105b46105af366004613365565b6112ff565b6040516102a49190613502565b3480156105cd57600080fd5b506102cd611420565b3480156105e257600080fd5b506105f66105f1366004613335565b611456565b604080519384526020840192909252908201526060016102a4565b34801561061d57600080fd5b506102ef60035481565b34801561063357600080fd5b506102ef600d5481565b6102cd61064b3660046133e4565b611486565b34801561065c57600080fd5b506000546040516001600160a01b0390911681526020016102a4565b34801561068457600080fd5b50610297610693366004613335565b611b67565b3480156106a457600080fd5b506102ef6106b3366004613335565b611b92565b3480156106c457600080fd5b506102ef6106d3366004613335565b611bc1565b3480156106e457600080fd5b506106f86106f33660046133e4565b611be2565b6040516102a49190613714565b34801561071157600080fd5b506102cd610720366004613335565b611c1f565b34801561073157600080fd5b506102ef611c4e565b34801561074657600080fd5b50610297610755366004613335565b611c65565b34801561076657600080fd5b506102ef610775366004613335565b611c93565b34801561078657600080fd5b5061079a610795366004613335565b611ca3565b6040516102a49190613705565b3480156107b357600080fd5b506102ef6107c2366004613335565b611cd7565b3480156107d357600080fd5b506107e76107e2366004613238565b611d41565b6040516102a493929190613723565b34801561080257600080fd5b50610297610811366004613335565b611f1b565b34801561082257600080fd5b506102ef600b5481565b34801561083857600080fd5b50600c546103749060ff1681565b34801561085257600080fd5b506102cd61086136600461317f565b611f46565b6040805160208101909152600081525b92915050565b6000546001600160a01b031633146108af5760405162461bcd60e51b81526004016108a69061379b565b60405180910390fd5b80516108c2906009906020840190612fb6565b5050565b60006108766010836138f3565b6000546001600160a01b031633146108fd5760405162461bcd60e51b81526004016108a69061379b565b600c805460ff1916911515919091179055565b6060600060015b6010811161094b5761092a816010613841565b600354901c61093b5780915061094b565b610944816138d8565b9050610917565b506000816001600160401b0381111561097457634e487b7160e01b600052604160045260246000fd5b6040519080825280602002602001820160405280156109b957816020015b60408051808201909152600080825260208201528152602001906001900390816109925790505b50905060005b82811015610a575760006109d4826010613841565b600354901c61ffff1690508060ff16838381518110610a0357634e487b7160e01b600052603260045260246000fd5b60200260200101516000018181525050600881901c838381518110610a3857634e487b7160e01b600052603260045260246000fd5b602090810291909101810151015250610a50816138d8565b90506109bf565b5092915050565b6000546001600160a01b03163314610a885760405162461bcd60e51b81526004016108a69061379b565b600d55565b600d54336000908152600a6020526040812054909190610aad9043613860565b11905090565b60098054610ac0906138a3565b80601f0160208091040260200160405190810160405280929190818152602001828054610aec906138a3565b8015610b395780601f10610b0e57610100808354040283529160200191610b39565b820191906000526020600020905b815481529060010190602001808311610b1c57829003601f168201915b505050505081565b60606108768260405180604001604052806008815260200167534f554c4c45535360c01b8152506014611fde565b600060a082901c610b7f816108c6565b949350505050565b60606108768260405180604001604052806007815260200166454e454d49455360c81b815250600e611fde565b6001546060906000906001600160401b03811115610be257634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015610c1b57816020015b610c0861303a565b815260200190600190039081610c005790505b50905060005b600154811015610f1b57610c34816108c6565b828281518110610c5457634e487b7160e01b600052603260045260246000fd5b602090810291909101015152610c6981610b87565b828281518110610c8957634e487b7160e01b600052603260045260246000fd5b602002602001015160200181905250610ca181611b67565b828281518110610cc157634e487b7160e01b600052603260045260246000fd5b602002602001015160400181905250610cd9816112a0565b828281518110610cf957634e487b7160e01b600052603260045260246000fd5b602002602001015160600181905250610d1181610f21565b828281518110610d3157634e487b7160e01b600052603260045260246000fd5b602002602001015160800181905250610d49816112ce565b828281518110610d6957634e487b7160e01b600052603260045260246000fd5b602002602001015160a00181905250610d8181611f1b565b828281518110610da157634e487b7160e01b600052603260045260246000fd5b602002602001015160c00181905250610db981610b41565b828281518110610dd957634e487b7160e01b600052603260045260246000fd5b602002602001015160e00181905250610df181611c65565b828281518110610e1157634e487b7160e01b600052603260045260246000fd5b60200260200101516101000181905250610e2a81611ca3565b828281518110610e4a57634e487b7160e01b600052603260045260246000fd5b60200260200101516101200181905250610e63816110b7565b828281518110610e8357634e487b7160e01b600052603260045260246000fd5b602090810291909101015190151561014090910152610ea181611b92565b828281518110610ec157634e487b7160e01b600052603260045260246000fd5b6020026020010151610160018181525050610edb81611cd7565b828281518110610efb57634e487b7160e01b600052603260045260246000fd5b60209081029190910101516101800152610f14816138d8565b9050610c21565b50919050565b6060610876826040518060400160405280600981526020016841525445464143545360b81b8152506011611fde565b6000546001600160a01b03163314610f7a5760405162461bcd60e51b81526004016108a69061379b565b600080546040516001600160a01b039091169047908381818185875af1925050503d8060008114610fc7576040519150601f19603f3d011682016040523d82523d6000602084013e610fcc565b606091505b505090508061100e5760405162461bcd60e51b815260206004820152600e60248201526d19985a5b1959081d1bc81cd95b9960921b60448201526064016108a6565b50565b6000805b601081101561106357600061102b826010613841565b600354901c61ffff1690508060ff168411156110475750611051565b60081c9392505050565b8061105b816138d8565b915050611015565b5060405162461bcd60e51b815260206004820152602260248201527f696e76616c69642072657761726420627261636b65747320636f6e6669677572604482015261195960f21b60648201526084016108a6565b60015460009082106110cb57506000919050565b6001546110d783611b92565b1492915050565b6060600980546110ed906138a3565b80601f0160208091040260200160405190810160405280929190818152602001828054611119906138a3565b80156111665780601f1061113b57610100808354040283529160200191611166565b820191906000526020600020905b81548152906001019060200180831161114957829003601f168201915b5050505050905090565b6001546006546008546001600160a01b03918216911660005b84518110156112995760008060006111c986888a87815181106111bc57634e487b7160e01b600052603260045260246000fd5b60200260200101516120b1565b919450925090506001600160a01b031960a084901b1660005b82811015611283576001600160a01b03871663763df5d8336112048488613815565b6040516001600160e01b031960e085901b1681526001600160a01b03909216600483015260248201526001600160a01b031985166044820152606401600060405180830381600087803b15801561125a57600080fd5b505af115801561126e573d6000803e3d6000fd5b505050508061127c906138d8565b90506111e2565b505050505080611292906138d8565b9050611189565b5050505050565b606061087682604051806040016040528060088152602001674d4f4e535445525360c01b8152506010611fde565b6060610876826040518060400160405280600b81526020016a504153534147455741595360a81b8152506012611fde565b606081516001600160401b0381111561132857634e487b7160e01b600052604160045260246000fd5b60405190808252806020026020018201604052801561136157816020015b61134e6130aa565b8152602001906001900390816113465790505b509050600061139a6001858154811061138a57634e487b7160e01b600052603260045260246000fd5b9060005260206000200154612304565b5091505060005b8351811015611418576113dc85838684815181106113cf57634e487b7160e01b600052603260045260246000fd5b602002602001015161238a565b8382815181106113fc57634e487b7160e01b600052603260045260246000fd5b602002602001018190525080611411906138d8565b90506113a1565b505092915050565b6000546001600160a01b0316331461144a5760405162461bcd60e51b81526004016108a69061379b565b6114546000612a2b565b565b60065460015460009182918291611479916001600160a01b0390911690866120b1565b9250925092509193909250565b600c5460ff16156114cd5760405162461bcd60e51b81526020600482015260116024820152701c985a591a5b99c81a5cc81b1bd8dad959607a1b60448201526064016108a6565b600081815260056020526040902054156115295760405162461bcd60e51b815260206004820152601b60248201527f6c6f6f7420616c7265616479207573656420696e20612072616964000000000060448201526064016108a6565b6006546040516331a9108f60e11b8152600481018390526001600160a01b0390911690636352211e9060240160206040518083038186803b15801561156d57600080fd5b505afa158015611581573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115a5919061319b565b6001600160a01b0316336001600160a01b0316146116055760405162461bcd60e51b815260206004820152601860248201527f72616964657220646f6573206e6f74206f776e206c6f6f74000000000000000060448201526064016108a6565b6001548083106116495760405162461bcd60e51b815260206004820152600f60248201526e34b73b30b634b210323ab733b2b7b760891b60448201526064016108a6565b600b54611654610a8d565b1561166d5750336000908152600a602052604081204390555b803410156116b35760405162461bcd60e51b81526020600482015260136024820152721b9bdd08195b9bdd59da08195d1a081cd95b9d606a1b60448201526064016108a6565b803411156116f357336108fc6116c98334613860565b6040518115909202916000818181858888f193505050501580156116f1573d6000803e3d6000fd5b505b600080600061171c6001888154811061138a57634e487b7160e01b600052603260045260246000fd5b9250925092508483146117715760405162461bcd60e51b815260206004820152601860248201527f64756e67656f6e20616c726561647920636f6d706c657465000000000000000060448201526064016108a6565b600061177e88848961238a565b6101008101519091506117d35760405162461bcd60e51b815260206004820152601960248201527f7261696420776f756c642068617665206e6f206166666563740000000000000060448201526064016108a6565b60016000805b60088110156118b05785816008811061180257634e487b7160e01b600052603260045260246000fd5b60200201516118119083613815565b915083816009811061183357634e487b7160e01b600052603260045260246000fd5b602002015186826008811061185857634e487b7160e01b600052603260045260246000fd5b602002018181516118699190613860565b905250600086826008811061188e57634e487b7160e01b600052603260045260246000fd5b6020020151111561189e57600092505b806118a8816138d8565b9150506117d9565b5060006118c38460086020020151611011565b90506001602082901b601087901b60088e901b17171760008b8152600560205260409020556118f28186613815565b94508215611913576004805497508790600061190d836138d8565b91905055505b61199187878760e082015160c083015160a08401516080850151600093604886901b9360409190911b9260389190911b9160309190911b9060281b60208860036020020151901b60188960026020020151901b60108a60016020020151901b60088b60006020020151901b8c17171717171717171790509392505050565b60018c815481106119b257634e487b7160e01b600052603260045260246000fd5b90600052602060002001819055508a7f3f015a4f0c7cd9549187c19ff1cb102555de6af20e28262616a6a8bef1dd32048b60405180610100016040528088600060098110611a1057634e487b7160e01b600052603260045260246000fd5b6020020151815260200188600160098110611a3b57634e487b7160e01b600052603260045260246000fd5b6020020151815260200188600260098110611a6657634e487b7160e01b600052603260045260246000fd5b6020020151815260200188600360098110611a9157634e487b7160e01b600052603260045260246000fd5b6020020151815260200188600460098110611abc57634e487b7160e01b600052603260045260246000fd5b6020020151815260200188600560098110611ae757634e487b7160e01b600052603260045260246000fd5b6020020151815260200188600660098110611b1257634e487b7160e01b600052603260045260246000fd5b6020020151815260200188600760098110611b3d57634e487b7160e01b600052603260045260246000fd5b60200201519052604051611b529291906137d0565b60405180910390a25050505050505050505050565b60606108768260405180604001604052806005815260200164545241505360d81b815250600f611fde565b6000611bb86001838154811061138a57634e487b7160e01b600052603260045260246000fd5b50909392505050565b60028181548110611bd157600080fd5b600091825260209091200154905081565b611bea6130aa565b6000611c106001858154811061138a57634e487b7160e01b600052603260045260246000fd5b50915050610b7f84828561238a565b6000546001600160a01b03163314611c495760405162461bcd60e51b81526004016108a69061379b565b600b55565b600154600090611c5e5750606390565b5060015490565b60606108768260405180604001604052806008815260200167454c454d454e545360c01b8152506015611fde565b60018181548110611bd157600080fd5b611cab6130c9565b611ccf6001838154811061138a57634e487b7160e01b600052603260045260246000fd5b509392505050565b6001546000908210611cec5750600019919050565b6000611cf783611b92565b6001549091508110611d0d575060001992915050565b60028181548110611d2e57634e487b7160e01b600052603260045260246000fd5b9060005260206000200154915050919050565b606080606083516001600160401b03811115611d6d57634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015611d96578160200160208202803683370190505b50925083516001600160401b03811115611dc057634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015611de9578160200160208202803683370190505b50915083516001600160401b03811115611e1357634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015611e3c578160200160208202803683370190505b506006546001549192506001600160a01b03169060005b8651811015611f1157611e8183838984815181106111bc57634e487b7160e01b600052603260045260246000fd5b888481518110611ea157634e487b7160e01b600052603260045260246000fd5b60200260200101888581518110611ec857634e487b7160e01b600052603260045260246000fd5b60200260200101888681518110611eef57634e487b7160e01b600052603260045260246000fd5b602090810291909101019290925291905252611f0a816138d8565b9050611e53565b5050509193909250565b60606108768260405180604001604052806005815260200164524f4f4d5360d81b8152506013611fde565b6000546001600160a01b03163314611f705760405162461bcd60e51b81526004016108a69061379b565b6001600160a01b038116611fd55760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016108a6565b61100e81612a2b565b60606000611ff185858580549050612a7b565b905082818154811061201357634e487b7160e01b600052603260045260246000fd5b906000526020600020018054612028906138a3565b80601f0160208091040260200160405190810160405280929190818152602001828054612054906138a3565b80156120a15780601f10612076576101008083540402835291602001916120a1565b820191906000526020600020905b81548152906001019060200180831161208457829003601f168201915b50505050509150505b9392505050565b6000806000856001600160a01b0316636352211e856040518263ffffffff1660e01b81526004016120e491815260200190565b60206040518083038186803b1580156120fc57600080fd5b505afa158015612110573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612134919061319b565b6001600160a01b0316336001600160a01b0316146121945760405162461bcd60e51b815260206004820152601a60248201527f73656e6465722069736e2774206f776e6572206f66206c6f6f7400000000000060448201526064016108a6565b600084815260056020526040902054806121f05760405162461bcd60e51b815260206004820152601960248201527f6c6f6f7420626167206e6f74207573656420696e20726169640000000000000060448201526064016108a6565b60ff600882901c8116945061ffff601083901c169350602082901c1691508584106122525760405162461bcd60e51b81526020600482015260126024820152711a5b9d985b1a5908191d5b99d95bdb881a5960721b60448201526064016108a6565b60006122786001868154811061138a57634e487b7160e01b600052603260045260246000fd5b505090508681106122c05760405162461bcd60e51b8152602060048201526012602482015271323ab733b2b7b71039ba34b6361037b832b760711b60448201526064016108a6565b600281815481106122e157634e487b7160e01b600052603260045260246000fd5b9060005260206000200154846122f79190613815565b9350505093509350939050565b600061230e6130c9565b60ff600884901c81168252601084901c8116602080840191909152601885901c8216604084015281851693506000919085901c1682600360200201525060ff602884901c81166080830152603084901c811660a0830152603884901c811660c0830152604084901c1660e08201529092909160481c61ffff1690565b6123926130aa565b61239a6130c9565b6123a26130aa565b600084815260056020526040902054156123bf5791506120aa9050565b60075485516001600160a01b03909116901561248457604051634c865a7960e01b8152600481018690526000906001600160a01b03831690634c865a799060240160c06040518083038186803b15801561241857600080fd5b505afa15801561242c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061245091906131b7565b9050612480888260405180604001604052806007815260200166454e454d49455360c81b81525060126000612a88565b8452505b60208601511561253e5760405163fbe0fbd560e01b8152600481018690526000906001600160a01b0383169063fbe0fbd59060240160c06040518083038186803b1580156124d157600080fd5b505afa1580156124e5573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061250991906131b7565b9050612537888260405180604001604052806005815260200164545241505360d81b815250600f6001612a88565b6020850152505b6040860151156125fb57604051630441870d60e41b8152600481018690526000906001600160a01b0383169063441870d09060240160c06040518083038186803b15801561258b57600080fd5b505afa15801561259f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125c391906131b7565b90506125f48882604051806040016040528060088152602001674d4f4e535445525360c01b815250600f6002612a88565b6040850152505b6060860151156126b95760405163098779df60e21b8152600481018690526000906001600160a01b0383169063261de77c9060240160c06040518083038186803b15801561264857600080fd5b505afa15801561265c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061268091906131b7565b90506126b288826040518060400160405280600981526020016841525445464143545360b81b815250600f6003612a88565b6060850152505b6080860151156127795760405163701cc60d60e11b8152600481018690526000906001600160a01b0383169063e0398c1a9060240160c06040518083038186803b15801561270657600080fd5b505afa15801561271a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061273e91906131b7565b905061277288826040518060400160405280600b81526020016a504153534147455741595360a81b815250600f6004612a88565b6080850152505b60a08601511561283357604051630cb7b2cf60e11b8152600481018690526000906001600160a01b0383169063196f659e9060240160c06040518083038186803b1580156127c657600080fd5b505afa1580156127da573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127fe91906131b7565b905061282c888260405180604001604052806005815260200164524f4f4d5360d81b815250600f6005612a88565b60a0850152505b60c0860151156128f057604051634521d52360e11b8152600481018690526000906001600160a01b03831690638a43aa469060240160c06040518083038186803b15801561288057600080fd5b505afa158015612894573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128b891906131b7565b90506128e9888260405180604001604052806008815260200167534f554c4c45535360c01b81525060036006612a88565b60c0850152505b60e0860151156129ad5760405163031f03bd60e11b8152600481018690526000906001600160a01b0383169063063e077a9060240160c06040518083038186803b15801561293d57600080fd5b505afa158015612951573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061297591906131b7565b90506129a6888260405180604001604052806008815260200167454c454d454e545360c01b81525060056007612a88565b60e0850152505b60005b6008811015612a1f57612a0d818583600881106129dd57634e487b7160e01b600052603260045260246000fd5b6020020151898460088110612a0257634e487b7160e01b600052603260045260246000fd5b602002015186612dbd565b80612a17816138d8565b9150506129b0565b50909695505050505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000610b7f848484612e15565b600080612a96878686612a7b565b86519091506000612aa6896108c6565b612ab1906001613815565b602089015114905060008115612add5750608088015160029015612add57612ada600182613815565b90505b82841415612afb57612af0816002613815565b945050505050612db4565b600754604051632e3f358760e11b81526000916001600160a01b031690635c7e6b0e90612b2e908a90899060040161375c565b60206040518083038186803b158015612b4657600080fd5b505afa158015612b5a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b7e919061328a565b600754604051632e3f358760e11b81529192506000916001600160a01b0390911690635c7e6b0e90612bb6908b90899060040161375c565b60206040518083038186803b158015612bce57600080fd5b505afa158015612be2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c06919061328a565b9050806003811115612c2857634e487b7160e01b600052602160045260246000fd5b826003811115612c4857634e487b7160e01b600052602160045260246000fd5b148015612c7557506003826003811115612c7257634e487b7160e01b600052602160045260246000fd5b14155b15612dab5760075460405163f63db29760e01b81526000916001600160a01b03169063f63db29790612cad908c908b9060040161375c565b60206040518083038186803b158015612cc557600080fd5b505afa158015612cd9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612cfd919061334d565b60075460405163f63db29760e01b81529192506000916001600160a01b039091169063f63db29790612d35908d908b9060040161375c565b60206040518083038186803b158015612d4d57600080fd5b505afa158015612d61573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d85919061334d565b9050818111612da857612d99856001613815565b98505050505050505050612db4565b50505b50909450505050505b95945050505050565b6000828411612dcc5783612dce565b825b905080828660098110612df157634e487b7160e01b600052603260045260246000fd5b60200201528082600860200201818151612e0b9190613815565b9052505050505050565b600080612e5484612e2f612e2a886010613815565b612e6c565b604051602001612e409291906134d3565b604051602081830303815290604052612f85565b90506000612e6284836138f3565b9695505050505050565b606081612e905750506040805180820190915260018152600360fc1b602082015290565b8160005b8115612eba5780612ea4816138d8565b9150612eb39050600a8361382d565b9150612e94565b6000816001600160401b03811115612ee257634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015612f0c576020820181803683370190505b5090505b8415610b7f57612f21600183613860565b9150612f2e600a866138f3565b612f39906030613815565b60f81b818381518110612f5c57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350612f7e600a8661382d565b9450612f10565b600081604051602001612f9891906134b7565b60408051601f19818403018152919052805160209091012092915050565b828054612fc2906138a3565b90600052602060002090601f016020900481019282612fe4576000855561302a565b82601f10612ffd57805160ff191683800117855561302a565b8280016001018555821561302a579182015b8281111561302a57825182559160200191906001019061300f565b506130369291506130e8565b5090565b604051806101a0016040528060008152602001606081526020016060815260200160608152602001606081526020016060815260200160608152602001606081526020016060815260200161308d6130c9565b815260200160001515815260200160008152602001600081525090565b6040518061012001604052806009906020820280368337509192915050565b6040518061010001604052806008906020820280368337509192915050565b5b8082111561303657600081556001016130e9565b600082601f83011261310d578081fd5b813560206001600160401b0382111561312857613128613933565b8160051b6131378282016137e5565b838152828101908684018388018501891015613151578687fd5b8693505b85841015613173578035835260019390930192918401918401613155565b50979650505050505050565b600060208284031215613190578081fd5b81356120aa81613949565b6000602082840312156131ac578081fd5b81516120aa81613949565b600060c082840312156131c8578081fd5b82601f8301126131d6578081fd5b60405160c081018181106001600160401b03821117156131f8576131f8613933565b604052808360c0810186101561320c578384fd5b835b600681101561322d57815183526020928301929091019060010161320e565b509195945050505050565b600060208284031215613249578081fd5b81356001600160401b0381111561325e578182fd5b610b7f848285016130fd565b60006020828403121561327b578081fd5b813580151581146120aa578182fd5b60006020828403121561329b578081fd5b8151600481106120aa578182fd5b600060208083850312156132bb578182fd5b82356001600160401b03808211156132d1578384fd5b818501915085601f8301126132e4578384fd5b8135818111156132f6576132f6613933565b613308601f8201601f191685016137e5565b9150808252868482850101111561331d578485fd5b80848401858401378101909201929092529392505050565b600060208284031215613346578081fd5b5035919050565b60006020828403121561335e578081fd5b5051919050565b60008060408385031215613377578081fd5b8235915060208301356001600160401b03811115613393578182fd5b61339f858286016130fd565b9150509250929050565b600080604083850312156133bb578182fd5b8235915060208301356001600160a01b0319811681146133d9578182fd5b809150509250929050565b600080604083850312156133f6578182fd5b50508035926020909101359150565b8060005b6008811015613428578151845260209384019390910190600101613409565b50505050565b8060005b6009811015613428578151845260209384019390910190600101613432565b6000815180845260208085019450808401835b8381101561348057815187529582019590820190600101613464565b509495945050505050565b600081518084526134a3816020860160208601613877565b601f01601f19169290920160200192915050565b600082516134c9818460208701613877565b9190910192915050565b600083516134e5818460208801613877565b8351908301906134f9818360208801613877565b01949350505050565b6020808252825182820181905260009190848201906040850190845b81811015612a1f5761353183855161342e565b92840192610120929092019160010161351e565b602080825282518282018190526000919060409081850190868401855b8281101561358757815180518552860151868501529284019290850190600101613562565b5091979650505050505050565b60006020808301818452808551808352604092508286019150828160051b870101848801865b838110156136f757603f1989840301855281516102808151855288820151818a8701526135e98287018261348b565b9150508782015185820389870152613601828261348b565b9150506060808301518683038288015261361b838261348b565b9250505060808083015186830382880152613636838261348b565b9250505060a08083015186830382880152613651838261348b565b9250505060c0808301518683038288015261366c838261348b565b9250505060e08083015186830382880152613687838261348b565b9250505061010080830151868303828801526136a3838261348b565b92505050610120808301516136ba82880182613405565b50506101408201511515610220860152610160820151610240860152610180909101516102609094019390935293860193908601906001016135ba565b509098975050505050505050565b61010081016108768284613405565b6101208101610876828461342e565b6060815260006137366060830186613451565b82810360208401526137488186613451565b90508281036040840152612e628185613451565b604081016008841061377e57634e487b7160e01b600052602160045260246000fd5b9281526020015290565b6020815260006120aa602083018461348b565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b82815261012081016120aa6020830184613405565b604051601f8201601f191681016001600160401b038111828210171561380d5761380d613933565b604052919050565b6000821982111561382857613828613907565b500190565b60008261383c5761383c61391d565b500490565b600081600019048311821515161561385b5761385b613907565b500290565b60008282101561387257613872613907565b500390565b60005b8381101561389257818101518382015260200161387a565b838111156134285750506000910152565b600181811c908216806138b757607f821691505b60208210811415610f1b57634e487b7160e01b600052602260045260246000fd5b60006000198214156138ec576138ec613907565b5060010190565b6000826139025761390261391d565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461100e57600080fdfea26469706673582212205bb8becd422b1df4ce6c0d1724e404695c340e5e7ec0326edce30aafec09402964736f6c63430008040033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000c800000000000000000000000000000000000000000000000000000000000000c800000000000000000000000000000000000000000000000000000000000000c800000000000000000000000000000000000000000000000000000000000000c800000000000000000000000000000000000000000000000000000000000000c800000000000000000000000000000000000000000000000000000000000000c800000000000000000000000000000000000000000000000000000000000000c800000000000000000000000000000000000000000000000000000000000000c800000000000000000000000000000000000000000000000000000000000002200000000000000000000000001dfe7ca09e99d10835bf73044a23b73fc20623df00000000000000000000000004190ef3d7c91c881d335725b6bb5d45236b22ae00000000000000000000000038065291fdce1a752afd725e96ff75e1c38ad6aa0000000000000000000000000000000000000000000000000000000000000440000000000000000000000000000000000000000000000000002386f26fc100000000000000000000000000000000000000000000000000000000000000001991000000000000000000000000000000000000000000000000000000000000048000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000bd000000000000000000000000000000000000000000000000000000000000018f00000000000000000000000000000000000000000000000000000000000001a80000000000000000000000000000000000000000000000000000000000000333000000000000000000000000000000000000000000000000000000000000034c0000000000000000000000000000000000000000000000000000000000000365000000000000000000000000000000000000000000000000000000000000037e0000000000000000000000000000000000000000000000000000000000000397000000000000000000000000000000000000000000000000000000000000067b000000000000000000000000000000000000000000000000000000000000069400000000000000000000000000000000000000000000000000000000000006ad00000000000000000000000000000000000000000000000000000000000006c600000000000000000000000000000000000000000000000000000000000006df00000000000000000000000000000000000000000000000000000000000006f80000000000000000000000000000000000000000000000000000000000000711000000000000000000000000000000000000000000000000000000000000072a0000000000000000000000000000000000000000000000000000000000000001d68747470733a2f2f72656c6963732e74686563727970742e67616d652f00000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000070000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000b000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000ff0000000000000000000000000000000000000000000000000000000000000003
-----Decoded View---------------
Arg [0] : dungeonCount (uint16): 16
Arg [1] : startHitPoints (uint256[8]): 200,200,200,200,200,200,200,200
Arg [2] : relicAwards (uint256[]): 3024,6384,6784,13104,13504,13904,14304,14704,26544,26944,27344,27744,28144,28544,28944,29344
Arg [3] : raidTokenContract (address): 0x1dfe7Ca09e99d10835Bf73044a23B73Fc20623DF
Arg [4] : lootClassificationAddress (address): 0x04190EF3D7C91C881D335725B6BB5d45236B22AE
Arg [5] : relicAddress (address): 0x38065291fDce1A752afD725e96FF75E1c38aD6aa
Arg [6] : imageBaseURL (string): https://relics.thecrypt.game/
Arg [7] : raidingFee (uint256): 10000000000000000
Arg [8] : blocksBetweenFreeRaids (uint256): 6545
Arg [9] : awardBrackets (tuple[]): System.Collections.Generic.List`1[Nethereum.ABI.FunctionEncoding.ParameterOutput],System.Collections.Generic.List`1[Nethereum.ABI.FunctionEncoding.ParameterOutput],System.Collections.Generic.List`1[Nethereum.ABI.FunctionEncoding.ParameterOutput],System.Collections.Generic.List`1[Nethereum.ABI.FunctionEncoding.ParameterOutput]
-----Encoded View---------------
45 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000010
Arg [1] : 00000000000000000000000000000000000000000000000000000000000000c8
Arg [2] : 00000000000000000000000000000000000000000000000000000000000000c8
Arg [3] : 00000000000000000000000000000000000000000000000000000000000000c8
Arg [4] : 00000000000000000000000000000000000000000000000000000000000000c8
Arg [5] : 00000000000000000000000000000000000000000000000000000000000000c8
Arg [6] : 00000000000000000000000000000000000000000000000000000000000000c8
Arg [7] : 00000000000000000000000000000000000000000000000000000000000000c8
Arg [8] : 00000000000000000000000000000000000000000000000000000000000000c8
Arg [9] : 0000000000000000000000000000000000000000000000000000000000000220
Arg [10] : 0000000000000000000000001dfe7ca09e99d10835bf73044a23b73fc20623df
Arg [11] : 00000000000000000000000004190ef3d7c91c881d335725b6bb5d45236b22ae
Arg [12] : 00000000000000000000000038065291fdce1a752afd725e96ff75e1c38ad6aa
Arg [13] : 0000000000000000000000000000000000000000000000000000000000000440
Arg [14] : 000000000000000000000000000000000000000000000000002386f26fc10000
Arg [15] : 0000000000000000000000000000000000000000000000000000000000001991
Arg [16] : 0000000000000000000000000000000000000000000000000000000000000480
Arg [17] : 0000000000000000000000000000000000000000000000000000000000000010
Arg [18] : 0000000000000000000000000000000000000000000000000000000000000bd0
Arg [19] : 00000000000000000000000000000000000000000000000000000000000018f0
Arg [20] : 0000000000000000000000000000000000000000000000000000000000001a80
Arg [21] : 0000000000000000000000000000000000000000000000000000000000003330
Arg [22] : 00000000000000000000000000000000000000000000000000000000000034c0
Arg [23] : 0000000000000000000000000000000000000000000000000000000000003650
Arg [24] : 00000000000000000000000000000000000000000000000000000000000037e0
Arg [25] : 0000000000000000000000000000000000000000000000000000000000003970
Arg [26] : 00000000000000000000000000000000000000000000000000000000000067b0
Arg [27] : 0000000000000000000000000000000000000000000000000000000000006940
Arg [28] : 0000000000000000000000000000000000000000000000000000000000006ad0
Arg [29] : 0000000000000000000000000000000000000000000000000000000000006c60
Arg [30] : 0000000000000000000000000000000000000000000000000000000000006df0
Arg [31] : 0000000000000000000000000000000000000000000000000000000000006f80
Arg [32] : 0000000000000000000000000000000000000000000000000000000000007110
Arg [33] : 00000000000000000000000000000000000000000000000000000000000072a0
Arg [34] : 000000000000000000000000000000000000000000000000000000000000001d
Arg [35] : 68747470733a2f2f72656c6963732e74686563727970742e67616d652f000000
Arg [36] : 0000000000000000000000000000000000000000000000000000000000000004
Arg [37] : 0000000000000000000000000000000000000000000000000000000000000003
Arg [38] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [39] : 0000000000000000000000000000000000000000000000000000000000000007
Arg [40] : 0000000000000000000000000000000000000000000000000000000000000001
Arg [41] : 000000000000000000000000000000000000000000000000000000000000000b
Arg [42] : 0000000000000000000000000000000000000000000000000000000000000002
Arg [43] : 00000000000000000000000000000000000000000000000000000000000000ff
Arg [44] : 0000000000000000000000000000000000000000000000000000000000000003
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 26 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.