Overview
APE Balance
APE Value
$0.02 (@ $0.51/APE)More Info
Private Name Tags
ContractCreator
Latest 1 from a total of 1 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Transfer | 11200208 | 22 hrs ago | IN | 0.33 APE | 0.00053558 |
Latest 16 internal transactions
Parent Transaction Hash | Block | From | To | |||
---|---|---|---|---|---|---|
11200212 | 22 hrs ago | 0.01830289 APE | ||||
11200212 | 22 hrs ago | 0.01830289 APE | ||||
11200212 | 22 hrs ago | 0.01830289 APE | ||||
11200212 | 22 hrs ago | 0.01830289 APE | ||||
11200211 | 22 hrs ago | 0.01830289 APE | ||||
11200211 | 22 hrs ago | 0.01830289 APE | ||||
11200211 | 22 hrs ago | 0.01830289 APE | ||||
11200210 | 22 hrs ago | 0.01830289 APE | ||||
11200210 | 22 hrs ago | 0.01830289 APE | ||||
11200210 | 22 hrs ago | 0.01830289 APE | ||||
11200210 | 22 hrs ago | 0.01830289 APE | ||||
11200209 | 22 hrs ago | 0.01830289 APE | ||||
11200209 | 22 hrs ago | 0.01830289 APE | ||||
11200209 | 22 hrs ago | 0.01830289 APE | ||||
11200208 | 22 hrs ago | 0.01830289 APE | ||||
11200208 | 22 hrs ago | 0.01830289 APE |
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
DungeonGame
Compiler Version
v0.8.23+commit.f704f362
Optimization Enabled:
Yes with 200 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.23; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "./interfaces/IDungeonGame.sol"; import "./interfaces/IDungeonEntry.sol"; import "./interfaces/INFTStats.sol"; import "./interfaces/IPrizePool.sol"; import "./libraries/EncounterLibrary.sol"; import {IEntropy} from "@pythnetwork/entropy-sdk-solidity/IEntropy.sol"; import {IEntropyConsumer} from "@pythnetwork/entropy-sdk-solidity/IEntropyConsumer.sol"; /// @title DungeonGame /// @notice Core game logic for dungeon runs and encounters contract DungeonGame is IDungeonGame, IEntropyConsumer, Ownable, ReentrancyGuard { // Events event EntropyRequested(uint256 indexed requestId, uint256 fee); event EntropyFulfilled(uint256 indexed requestId); event FeesWithdrawn(address indexed owner, uint256 amount); // Allow contract to receive native currency (for Pyth refunds) receive() external payable {} // Constants uint8 public constant ROOM_COUNT = 16; uint256 private constant BASE_XP = 100; uint256 private constant COMPLETION_BONUS = 500; IEntropy public immutable entropy; address public immutable provider = 0x52DeaA1c84233F7bb8C8A45baeDE41091c616506; CharacterState private emptyRoom = CharacterState({ collection: address(0), tokenId: 0, currentHp: 0 }); // Core contract references address public immutable dungeonEntry; address public immutable nftStats; address public immutable prizePool; uint256 public currentIndex = 0; uint8 public startRoom = 0; CharacterState[ROOM_COUNT] public rooms; mapping(uint64 => CharacterState) private pendingEntries; mapping(address => mapping(uint256 => uint256)) private characterEntryIndex; constructor( address _dungeonEntry, address _nftStats, address _prizePool, address _entropy ) { require(_dungeonEntry != address(0), "Invalid DungeonEntry address"); require(_nftStats != address(0), "Invalid NFTStats address"); require(_prizePool != address(0), "Invalid PrizePool address"); require(_entropy != address(0), "Invalid entropy address"); dungeonEntry = _dungeonEntry; nftStats = _nftStats; prizePool = _prizePool; entropy = IEntropy(_entropy); } /// @notice Add a new character to the dungeon queue /// @dev Only DungeonEntry can add characters function enterDungeon( address collection, uint256 tokenId ) external { require(msg.sender == address(dungeonEntry), "Only DungeonEntry can add characters"); uint64 sequenceNumber = _requestEntropy(1, collection, tokenId); INFTStats.NFTStatsData memory stats = INFTStats(nftStats).getStats(collection, tokenId); pendingEntries[sequenceNumber] = CharacterState({ collection: collection, tokenId: tokenId, currentHp: stats.hp }); } /// @notice Get the state of a specific room function getRoomState(uint256 roomNumber) external view returns (CharacterState memory) { require(roomNumber >= 0 && roomNumber <= ROOM_COUNT-1, "Invalid room number"); return rooms[roomNumber]; } function getCharacterRoomNumber(address collection, uint256 tokenId) public view returns (uint8) { uint256 entryIndex = characterEntryIndex[collection][tokenId]; uint8 roomNumber = uint8((currentIndex - entryIndex + startRoom) % ROOM_COUNT); return roomNumber; } function getCharacterState(address collection, uint256 tokenId) external view returns (CharacterState memory) { uint8 roomNumber = getCharacterRoomNumber(collection, tokenId); return rooms[roomNumber]; } /// @notice Request entropy for an encounter function _requestEntropy( uint256 roomNumber, address collection, uint256 tokenId ) internal returns (uint64) { // Generate user seed from encounter data bytes32 userSeed = keccak256(abi.encodePacked(roomNumber, collection, tokenId, block.timestamp)); // Get fee from entropy provider uint256 fee = entropy.getFee(provider); // Request entropy with callback uint64 sequenceNumber = entropy.requestWithCallback{value: fee}( provider, userSeed ); emit EntropyRequested(sequenceNumber, fee); return sequenceNumber; } function testEntropy() external { entropyCallback(1, address(0), bytes32(0)); } /// @notice Callback function for Pyth entropy function entropyCallback( uint64 sequenceNumber, address, bytes32 randomNumber ) internal override { // Process encounter with received entropy _processPendingEntry( sequenceNumber, randomNumber ); emit EntropyFulfilled(sequenceNumber); } /// @notice Process encounter with received entropy function _processPendingEntry( uint64 sequenceNumber, bytes32 randomNumber ) internal { // Push all characters forward one room, starting from the last room for (uint8 i = 0; i < ROOM_COUNT; i++) { // Calculate room number safely to avoid underflow uint8 roomIndex = (ROOM_COUNT + startRoom - 1 - i) % ROOM_COUNT; CharacterState storage character = rooms[roomIndex]; // Skip empty rooms if (character.collection == address(0)) { continue; } // Generate encounter using entropy EncounterLibrary.Encounter memory encounter = EncounterLibrary.generateEncounter( roomIndex + 1, // Add 1 since EncounterLibrary expects 1-based room numbers uint256(randomNumber) ); INFTStats.NFTStatsData memory characterStats = INFTStats(nftStats).getStats(character.collection, character.tokenId); EncounterResult memory result = EncounterLibrary.processEncounter( encounter, characterStats ); int256 newHp = int256(character.currentHp) + result.hpChange; bool survived = newHp > 0; // Calculate XP (partial XP if failed) uint256 xpGained = survived ? encounter.baseXp : encounter.baseXp / 2; // Update character stats if (survived) { character.currentHp = uint256(newHp); INFTStats(nftStats).awardXP(character.collection, character.tokenId, xpGained, 1); } // Only move if they survived the encounter if (survived) { if (roomIndex == ROOM_COUNT - 1) { // Character completed the dungeon _handleDungeonCompletion(character.collection, character.tokenId); } } else { // Remove dead character rooms[roomIndex] = emptyRoom; // End the run in DungeonEntry IDungeonEntry(dungeonEntry).endDungeonRun(character.collection, character.tokenId, false); } } CharacterState storage pending = pendingEntries[sequenceNumber]; // Store the entry index for this character characterEntryIndex[pending.collection][pending.tokenId] = currentIndex; // Place the new character in the start room rooms[startRoom] = pending; // Increment indices for next entry startRoom = (startRoom + 1) % ROOM_COUNT; currentIndex++; // delete pendingEntries[sequenceNumber]; } /// @notice Required interface implementation function getEntropy() internal view override returns (address) { return address(entropy); } function _handleDungeonCompletion(address collection, uint256 tokenId) internal { // Award completion bonus XP INFTStats(nftStats).awardXP(collection, tokenId, COMPLETION_BONUS, ROOM_COUNT); // Clear the last room rooms[ROOM_COUNT-1] = emptyRoom; IPrizePool(prizePool).registerWinner(collection, tokenId); emit DungeonCompleted( collection, tokenId ); } /// @notice Withdraw accumulated fees from Pyth refunds /// @dev Only callable by contract owner function withdrawFees() external onlyOwner { uint256 balance = address(this).balance; require(balance > 0, "No fees to withdraw"); (bool success, ) = msg.sender.call{value: balance}(""); require(success, "Withdrawal failed"); emit FeesWithdrawn(msg.sender, balance); } function getPendingEntry(uint64 sequenceNumber) external view returns (CharacterState memory) { return pendingEntries[sequenceNumber]; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (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 Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { 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 (last updated v4.8.0) (security/ReentrancyGuard.sol) pragma solidity ^0.8.0; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; constructor() { _status = _NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { _nonReentrantBefore(); _; _nonReentrantAfter(); } function _nonReentrantBefore() private { // On the first call to nonReentrant, _status will be _NOT_ENTERED require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; } function _nonReentrantAfter() private { // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/IERC721.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721 is IERC165 { /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes calldata data ) external; /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Transfers `tokenId` token from `from` to `to`. * * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721 * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must * understand this adds an external call which potentially creates a reentrancy vulnerability. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool _approved) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view returns (bool); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.23; /// @title IDungeonGame /// @notice Interface for core dungeon game mechanics and progression interface IDungeonGame { /// @notice Structure for dungeon room state struct RoomState { address collection; uint256 tokenId; uint256 entryIndex; // Used for ordering characters uint256 currentHp; uint256 currentAttack; uint256 currentSpeed; bool isOccupied; } /// @notice Structure for encounter results struct EncounterResult { int256 hpChange; string encounterDescription; } /// @notice Structure for character state struct CharacterState { address collection; uint256 tokenId; uint256 currentHp; } /// @notice Event emitted when an encounter is completed event EncounterCompleted( address indexed collection, uint256 indexed tokenId, uint256 roomNumber, uint256 xpGained, bool survived, string encounterDescription ); /// @notice Event emitted when a dungeon run is completed event DungeonCompleted( address indexed collection, uint256 indexed tokenId ); /// @notice Add a new character to the dungeon queue /// @param collection Address of the NFT collection /// @param tokenId Token ID of the NFT function enterDungeon(address collection, uint256 tokenId) external; /// @notice Get the current room number for a character /// @param collection Address of the NFT collection /// @param tokenId Token ID of the NFT /// @return Current room number function getCharacterRoomNumber(address collection, uint256 tokenId) external view returns (uint8); /// @notice Get the current room state for a character /// @param collection Address of the NFT collection /// @param tokenId Token ID of the NFT /// @return Current room state function getCharacterState(address collection, uint256 tokenId) external view returns (CharacterState memory); /// @notice Get the state of a specific room /// @param roomNumber Room number to get state for /// @return CharacterState Memory of the room state function getRoomState(uint256 roomNumber) external view returns (CharacterState memory); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.23; /// @title IDungeonEntry /// @notice Interface for managing dungeon entry and run initialization interface IDungeonEntry { /// @notice Structure for active dungeon run state struct DungeonRun { uint256 currentHp; uint256 currentRoom; bool isActive; } /// @notice Event emitted when a dungeon run is started event DungeonRunStarted( address indexed collection, uint256 indexed tokenId, address indexed player, uint256 entryFee ); /// @notice Event emitted when a dungeon run is ended event DungeonRunEnded( address indexed collection, uint256 indexed tokenId, bool success ); /// @notice Start a new dungeon run for an NFT /// @param collection Address of the NFT collection /// @param tokenId Token ID of the NFT function startDungeonRun(address collection, uint256 tokenId) external payable; /// @notice End an active dungeon run (called by DungeonGame) /// @param collection Address of the NFT collection /// @param tokenId Token ID of the NFT /// @param success Whether the run was successful function endDungeonRun(address collection, uint256 tokenId, bool success) external; /// @notice Check if an NFT has an active dungeon run /// @param collection Address of the NFT collection /// @param tokenId Token ID of the NFT /// @return bool True if NFT has an active run function hasActiveRun(address collection, uint256 tokenId) external view returns (bool); /// @notice Get the current entry fee for dungeon runs /// @return uint256 Current entry fee in wei function getEntryFee() external view returns (uint256); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.23; /// @title INFTStats /// @notice Interface for managing individual NFT stats and progression interface INFTStats { /// @notice Structure for NFT permanent stats struct NFTStatsData { uint256 hp; uint256 attack; uint256 speed; uint256 level; uint256 currentXP; uint256 xpToNextLevel; uint256 dungeonRuns; uint256 successfulRuns; uint256 roomsCleared; bool initialized; } /// @notice Event emitted when an NFT's stats are initialized event StatsInitialized(address indexed collection, uint256 indexed tokenId, uint256 hp, uint256 attack, uint256 speed); /// @notice Event emitted when an NFT's stats are boosted event StatsBoosted(address indexed collection, uint256 indexed tokenId, uint256 newHp, uint256 newAttack, uint256 newSpeed); /// @notice Event emitted when XP is gained event XPGained(address indexed collection, uint256 indexed tokenId, uint256 xpGained, uint256 newTotalXP); /// @notice Event emitted when a level up occurs event LevelUp(address indexed collection, uint256 indexed tokenId, uint256 newLevel); /// @notice Event emitted when a run is recorded event RunRecorded(address indexed collection, uint256 indexed tokenId, bool success, uint256 roomsCleared, uint256 xpGained); /// @notice Initialize stats for an NFT based on its collection's base stats /// @param collection Address of the NFT collection /// @param tokenId Token ID of the NFT function initializeStats(address collection, uint256 tokenId) external; /// @notice Award XP for dungeon progress /// @param collection Address of the NFT collection /// @param tokenId Token ID of the NFT /// @param xpAmount Amount of XP to award /// @param roomsCleared Number of rooms cleared in this run function awardXP( address collection, uint256 tokenId, uint256 xpAmount, uint256 roomsCleared ) external; /// @notice Calculate XP required for next level /// @param currentLevel Current level of the NFT /// @return uint256 XP required for next level function getXPForNextLevel(uint256 currentLevel) external pure returns (uint256); /// @notice Get the stat increases for a level up /// @param collection Address of the NFT collection /// @param tokenId Token ID of the NFT /// @return hpIncrease Amount HP increases /// @return attackIncrease Amount Attack increases /// @return speedIncrease Amount Speed increases function getLevelUpStats( address collection, uint256 tokenId ) external view returns ( uint256 hpIncrease, uint256 attackIncrease, uint256 speedIncrease ); /// @notice Record a dungeon run attempt /// @param collection Address of the NFT collection /// @param tokenId Token ID of the NFT /// @param success Whether the run was successful function recordRun(address collection, uint256 tokenId, bool success) external; /// @notice Get current stats for an NFT /// @param collection Address of the NFT collection /// @param tokenId Token ID of the NFT /// @return NFTStatsData struct containing current stats function getStats(address collection, uint256 tokenId) external view returns (NFTStatsData memory); /// @notice Check if an NFT has been initialized /// @param collection Address of the NFT collection /// @param tokenId Token ID of the NFT /// @return bool True if NFT has been initialized function isInitialized(address collection, uint256 tokenId) external view returns (bool); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.23; /// @title IPrizePool /// @notice Interface for managing dungeon rewards and prize distribution interface IPrizePool { /// @notice Event emitted when entry fee is deposited event EntryFeeDeposited(address indexed collection, uint256 indexed tokenId, uint256 amount); /// @notice Event emitted when reward is claimed event RewardClaimed(address indexed collection, uint256 indexed tokenId, address indexed recipient, uint256 amount); /// @notice Event emitted when prize pool parameters are updated event PrizePoolParametersUpdated(uint256 entryFee, uint256 winnerShare); /// @notice Deposit entry fee for a dungeon run function depositEntryFee() external payable; /// @notice Register a winner and immediately transfer their prize /// @param collection Address of the NFT collection /// @param tokenId Token ID of the NFT function registerWinner(address collection, uint256 tokenId) external; /// @notice Get current prize pool amount /// @return uint256 Current prize pool amount function getCurrentPrizePool() external view returns (uint256); /// @notice Gets the current entry fee /// @return uint256 Current entry fee function getEntryFee() external view returns (uint256); /// @notice Gets total entry fees collected /// @return uint256 Total entry fees function getTotalEntryFees() external view returns (uint256); /// @notice Gets total prizes paid out /// @return uint256 Total prizes paid function getTotalPrizesPaid() external view returns (uint256); /// @notice Gets current treasury balance /// @return uint256 Current treasury balance function getTreasuryBalance() external view returns (uint256); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.23; import "../interfaces/IDungeonGame.sol"; import "../interfaces/INFTStats.sol"; /// @title EncounterLibrary /// @notice Library for generating and processing dungeon encounters library EncounterLibrary { // Encounter types enum EncounterType { Combat, // Standard combat encounter Trap, // Environmental hazard Blessing, // Positive encounter Elite, // Stronger combat encounter Boss // Room 16 boss encounter } // Encounter definition struct Encounter { EncounterType encounterType; uint256 difficulty; // 1-100 scale int256 baseHpChange; // Base HP modification int256 baseAttackMod; // Temporary attack modification int256 baseSpeedMod; // Temporary speed modification uint256 baseXp; // Base XP reward string description; // Encounter description } // Constants for encounter generation uint256 private constant BASE_DIFFICULTY_PER_ROOM = 6; // ~100 difficulty by room 16 uint256 private constant ELITE_CHANCE = 15; // 15% chance for elite encounter uint256 private constant BLESSING_CHANCE = 10; // 10% chance for blessing uint256 private constant TRAP_CHANCE = 20; // 20% chance for trap // Constants for encounter effects uint256 private constant BASE_DAMAGE = 20; uint256 private constant ELITE_DAMAGE_MULTIPLIER = 2; uint256 private constant BOSS_DAMAGE_MULTIPLIER = 3; int256 private constant MAX_STAT_MODIFICATION = 50; // Maximum temporary stat change /// @notice Generate an encounter for a specific room /// @param roomNumber Current room number (1-16) /// @param randomness Random number for encounter generation /// @return Encounter struct with encounter details function generateEncounter( uint256 roomNumber, uint256 randomness ) internal pure returns (Encounter memory) { require(roomNumber > 0 && roomNumber <= 16, "Invalid room number"); // Room 16 is always a boss encounter if (roomNumber == 16) { return _generateBossEncounter(); } // Use randomness to determine encounter type uint256 encounterRoll = randomness % 100; // Scale difficulty with room number uint256 difficulty = BASE_DIFFICULTY_PER_ROOM * roomNumber; // Select encounter type based on roll if (encounterRoll < BLESSING_CHANCE) { return _generateBlessing(roomNumber, difficulty); } else if (encounterRoll < BLESSING_CHANCE + TRAP_CHANCE) { return _generateTrap(roomNumber, difficulty); } else if (encounterRoll < BLESSING_CHANCE + TRAP_CHANCE + ELITE_CHANCE) { return _generateEliteEncounter(roomNumber, difficulty); } else { return _generateCombatEncounter(roomNumber, difficulty); } } /// @notice Process an encounter for a character /// @param encounter The encounter to process /// @param characterStats Current character stats /// @return IDungeonGame.EncounterResult Result of the encounter function processEncounter( Encounter memory encounter, INFTStats.NFTStatsData memory characterStats ) internal pure returns (IDungeonGame.EncounterResult memory) { // Calculate final HP change based on character stats int256 hpChange = _calculateHpChange(encounter, characterStats); return IDungeonGame.EncounterResult({ hpChange: hpChange, encounterDescription: encounter.description }); } // Internal encounter generation functions function _generateCombatEncounter( uint256 roomNumber, uint256 difficulty ) private pure returns (Encounter memory) { int256 damage = -int256(BASE_DAMAGE + (difficulty / 2)); return Encounter({ encounterType: EncounterType.Combat, difficulty: difficulty, baseHpChange: damage, baseAttackMod: 0, baseSpeedMod: 0, baseXp: 100 + (roomNumber * 10), description: "A hostile enemy appears!" }); } function _generateEliteEncounter( uint256 roomNumber, uint256 difficulty ) private pure returns (Encounter memory) { int256 damage = -int256((BASE_DAMAGE + (difficulty / 2)) * ELITE_DAMAGE_MULTIPLIER); return Encounter({ encounterType: EncounterType.Elite, difficulty: difficulty, baseHpChange: damage, baseAttackMod: int256(MAX_STAT_MODIFICATION / 2), baseSpeedMod: -int256(MAX_STAT_MODIFICATION / 4), baseXp: (150 + (roomNumber * 15)), description: "An elite enemy blocks your path!" }); } function _generateBossEncounter() private pure returns (Encounter memory) { return Encounter({ encounterType: EncounterType.Boss, difficulty: 100, baseHpChange: -int256(BASE_DAMAGE * BOSS_DAMAGE_MULTIPLIER), baseAttackMod: -int256(MAX_STAT_MODIFICATION), baseSpeedMod: -int256(MAX_STAT_MODIFICATION / 2), baseXp: 1000, description: "The dungeon boss emerges!" }); } function _generateBlessing( uint256 roomNumber, uint256 difficulty ) private pure returns (Encounter memory) { return Encounter({ encounterType: EncounterType.Blessing, difficulty: difficulty, baseHpChange: int256(BASE_DAMAGE), baseAttackMod: int256(MAX_STAT_MODIFICATION / 2), baseSpeedMod: int256(MAX_STAT_MODIFICATION / 2), baseXp: 50 + (roomNumber * 5), description: "You discover a magical blessing!" }); } function _generateTrap( uint256 roomNumber, uint256 difficulty ) private pure returns (Encounter memory) { return Encounter({ encounterType: EncounterType.Trap, difficulty: difficulty, baseHpChange: -int256(BASE_DAMAGE / 2), baseAttackMod: -int256(MAX_STAT_MODIFICATION / 4), baseSpeedMod: -int256(MAX_STAT_MODIFICATION / 4), baseXp: 75 + (roomNumber * 7), description: "You triggered a trap!" }); } // Internal helper functions function _calculateHpChange( Encounter memory encounter, INFTStats.NFTStatsData memory characterStats ) private pure returns (int256) { // Base damage int256 hpChange = encounter.baseHpChange; // Modify based on character stats if (encounter.encounterType == EncounterType.Combat || encounter.encounterType == EncounterType.Elite || encounter.encounterType == EncounterType.Boss) { // Higher attack reduces damage taken uint256 attackMitigation = characterStats.attack / 10; // Higher speed increases chance to dodge uint256 speedMitigation = characterStats.speed / 20; hpChange += int256(attackMitigation + speedMitigation); } return hpChange; } }
// SPDX-License-Identifier: Apache 2 pragma solidity ^0.8.0; import "./EntropyEvents.sol"; interface IEntropy is EntropyEvents { // Register msg.sender as a randomness provider. The arguments are the provider's configuration parameters // and initial commitment. Re-registering the same provider rotates the provider's commitment (and updates // the feeInWei). // // chainLength is the number of values in the hash chain *including* the commitment, that is, chainLength >= 1. function register( uint128 feeInWei, bytes32 commitment, bytes calldata commitmentMetadata, uint64 chainLength, bytes calldata uri ) external; // Withdraw a portion of the accumulated fees for the provider msg.sender. // Calling this function will transfer `amount` wei to the caller (provided that they have accrued a sufficient // balance of fees in the contract). function withdraw(uint128 amount) external; // Withdraw a portion of the accumulated fees for provider. The msg.sender must be the fee manager for this provider. // Calling this function will transfer `amount` wei to the caller (provided that they have accrued a sufficient // balance of fees in the contract). function withdrawAsFeeManager(address provider, uint128 amount) external; // As a user, request a random number from `provider`. Prior to calling this method, the user should // generate a random number x and keep it secret. The user should then compute hash(x) and pass that // as the userCommitment argument. (You may call the constructUserCommitment method to compute the hash.) // // This method returns a sequence number. The user should pass this sequence number to // their chosen provider (the exact method for doing so will depend on the provider) to retrieve the provider's // number. The user should then call fulfillRequest to construct the final random number. // // This method will revert unless the caller provides a sufficient fee (at least getFee(provider)) as msg.value. // Note that excess value is *not* refunded to the caller. function request( address provider, bytes32 userCommitment, bool useBlockHash ) external payable returns (uint64 assignedSequenceNumber); // Request a random number. The method expects the provider address and a secret random number // in the arguments. It returns a sequence number. // // The address calling this function should be a contract that inherits from the IEntropyConsumer interface. // The `entropyCallback` method on that interface will receive a callback with the generated random number. // // This method will revert unless the caller provides a sufficient fee (at least getFee(provider)) as msg.value. // Note that excess value is *not* refunded to the caller. function requestWithCallback( address provider, bytes32 userRandomNumber ) external payable returns (uint64 assignedSequenceNumber); // Fulfill a request for a random number. This method validates the provided userRandomness and provider's proof // against the corresponding commitments in the in-flight request. If both values are validated, this function returns // the corresponding random number. // // Note that this function can only be called once per in-flight request. Calling this function deletes the stored // request information (so that the contract doesn't use a linear amount of storage in the number of requests). // If you need to use the returned random number more than once, you are responsible for storing it. function reveal( address provider, uint64 sequenceNumber, bytes32 userRevelation, bytes32 providerRevelation ) external returns (bytes32 randomNumber); // Fulfill a request for a random number. This method validates the provided userRandomness // and provider's revelation against the corresponding commitment in the in-flight request. If both values are validated // and the requestor address is a contract address, this function calls the requester's entropyCallback method with the // sequence number, provider address and the random number as arguments. Else if the requestor is an EOA, it won't call it. // // Note that this function can only be called once per in-flight request. Calling this function deletes the stored // request information (so that the contract doesn't use a linear amount of storage in the number of requests). // If you need to use the returned random number more than once, you are responsible for storing it. // // Anyone can call this method to fulfill a request, but the callback will only be made to the original requester. function revealWithCallback( address provider, uint64 sequenceNumber, bytes32 userRandomNumber, bytes32 providerRevelation ) external; function getProviderInfo( address provider ) external view returns (EntropyStructs.ProviderInfo memory info); function getDefaultProvider() external view returns (address provider); function getRequest( address provider, uint64 sequenceNumber ) external view returns (EntropyStructs.Request memory req); function getFee(address provider) external view returns (uint128 feeAmount); function getAccruedPythFees() external view returns (uint128 accruedPythFeesInWei); function setProviderFee(uint128 newFeeInWei) external; function setProviderFeeAsFeeManager( address provider, uint128 newFeeInWei ) external; function setProviderUri(bytes calldata newUri) external; // Set manager as the fee manager for the provider msg.sender. // After calling this function, manager will be able to set the provider's fees and withdraw them. // Only one address can be the fee manager for a provider at a time -- calling this function again with a new value // will override the previous value. Call this function with the all-zero address to disable the fee manager role. function setFeeManager(address manager) external; function constructUserCommitment( bytes32 userRandomness ) external pure returns (bytes32 userCommitment); function combineRandomValues( bytes32 userRandomness, bytes32 providerRandomness, bytes32 blockHash ) external pure returns (bytes32 combinedRandomness); }
// SPDX-License-Identifier: Apache 2 pragma solidity ^0.8.0; abstract contract IEntropyConsumer { // This method is called by Entropy to provide the random number to the consumer. // It asserts that the msg.sender is the Entropy contract. It is not meant to be // override by the consumer. function _entropyCallback( uint64 sequence, address provider, bytes32 randomNumber ) external { address entropy = getEntropy(); require(entropy != address(0), "Entropy address not set"); require(msg.sender == entropy, "Only Entropy can call this function"); entropyCallback(sequence, provider, randomNumber); } // getEntropy returns Entropy contract address. The method is being used to check that the // callback is indeed from Entropy contract. The consumer is expected to implement this method. // Entropy address can be found here - https://docs.pyth.network/entropy/contract-addresses function getEntropy() internal view virtual returns (address); // This method is expected to be implemented by the consumer to handle the random number. // It will be called by _entropyCallback after _entropyCallback ensures that the call is // indeed from Entropy contract. function entropyCallback( uint64 sequence, address provider, bytes32 randomNumber ) internal virtual; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; import "./EntropyStructs.sol"; interface EntropyEvents { event Registered(EntropyStructs.ProviderInfo provider); event Requested(EntropyStructs.Request request); event RequestedWithCallback( address indexed provider, address indexed requestor, uint64 indexed sequenceNumber, bytes32 userRandomNumber, EntropyStructs.Request request ); event Revealed( EntropyStructs.Request request, bytes32 userRevelation, bytes32 providerRevelation, bytes32 blockHash, bytes32 randomNumber ); event RevealedWithCallback( EntropyStructs.Request request, bytes32 userRandomNumber, bytes32 providerRevelation, bytes32 randomNumber ); event ProviderFeeUpdated(address provider, uint128 oldFee, uint128 newFee); event ProviderUriUpdated(address provider, bytes oldUri, bytes newUri); event ProviderFeeManagerUpdated( address provider, address oldFeeManager, address newFeeManager ); event Withdrawal( address provider, address recipient, uint128 withdrawnAmount ); }
// SPDX-License-Identifier: Apache 2 pragma solidity ^0.8.0; contract EntropyStructs { struct ProviderInfo { uint128 feeInWei; uint128 accruedFeesInWei; // The commitment that the provider posted to the blockchain, and the sequence number // where they committed to this. This value is not advanced after the provider commits, // and instead is stored to help providers track where they are in the hash chain. bytes32 originalCommitment; uint64 originalCommitmentSequenceNumber; // Metadata for the current commitment. Providers may optionally use this field to help // manage rotations (i.e., to pick the sequence number from the correct hash chain). bytes commitmentMetadata; // Optional URI where clients can retrieve revelations for the provider. // Client SDKs can use this field to automatically determine how to retrieve random values for each provider. // TODO: specify the API that must be implemented at this URI bytes uri; // The first sequence number that is *not* included in the current commitment (i.e., an exclusive end index). // The contract maintains the invariant that sequenceNumber <= endSequenceNumber. // If sequenceNumber == endSequenceNumber, the provider must rotate their commitment to add additional random values. uint64 endSequenceNumber; // The sequence number that will be assigned to the next inbound user request. uint64 sequenceNumber; // The current commitment represents an index/value in the provider's hash chain. // These values are used to verify requests for future sequence numbers. Note that // currentCommitmentSequenceNumber < sequenceNumber. // // The currentCommitment advances forward through the provider's hash chain as values // are revealed on-chain. bytes32 currentCommitment; uint64 currentCommitmentSequenceNumber; // An address that is authorized to set / withdraw fees on behalf of this provider. address feeManager; } struct Request { // Storage slot 1 // address provider; uint64 sequenceNumber; // The number of hashes required to verify the provider revelation. uint32 numHashes; // Storage slot 2 // // The commitment is keccak256(userCommitment, providerCommitment). Storing the hash instead of both saves 20k gas by // eliminating 1 store. bytes32 commitment; // Storage slot 3 // // The number of the block where this request was created. // Note that we're using a uint64 such that we have an additional space for an address and other fields in // this storage slot. Although block.number returns a uint256, 64 bits should be plenty to index all of the // blocks ever generated. uint64 blockNumber; // The address that requested this random number. address requester; // If true, incorporate the blockhash of blockNumber into the generated random value. bool useBlockhash; // If true, the requester will be called back with the generated random value. bool isRequestWithCallback; // There are 2 remaining bytes of free space in this slot. } }
{ "remappings": [ "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/", "forge-std/=lib/forge-std/src/", "@pythnetwork/=lib/@pythnetwork/", "pyth-sdk-solidity/=lib/pyth-sdk-solidity/" ], "optimizer": { "enabled": true, "runs": 200 }, "metadata": { "useLiteralContent": false, "bytecodeHash": "ipfs", "appendCBOR": true }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "evmVersion": "paris", "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"_dungeonEntry","type":"address"},{"internalType":"address","name":"_nftStats","type":"address"},{"internalType":"address","name":"_prizePool","type":"address"},{"internalType":"address","name":"_entropy","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"collection","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"DungeonCompleted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"collection","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"roomNumber","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"xpGained","type":"uint256"},{"indexed":false,"internalType":"bool","name":"survived","type":"bool"},{"indexed":false,"internalType":"string","name":"encounterDescription","type":"string"}],"name":"EncounterCompleted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"requestId","type":"uint256"}],"name":"EntropyFulfilled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"requestId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"fee","type":"uint256"}],"name":"EntropyRequested","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"FeesWithdrawn","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"ROOM_COUNT","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64","name":"sequence","type":"uint64"},{"internalType":"address","name":"provider","type":"address"},{"internalType":"bytes32","name":"randomNumber","type":"bytes32"}],"name":"_entropyCallback","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"currentIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"dungeonEntry","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"collection","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"enterDungeon","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"entropy","outputs":[{"internalType":"contract IEntropy","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"collection","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getCharacterRoomNumber","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"collection","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getCharacterState","outputs":[{"components":[{"internalType":"address","name":"collection","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"currentHp","type":"uint256"}],"internalType":"struct IDungeonGame.CharacterState","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64","name":"sequenceNumber","type":"uint64"}],"name":"getPendingEntry","outputs":[{"components":[{"internalType":"address","name":"collection","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"currentHp","type":"uint256"}],"internalType":"struct IDungeonGame.CharacterState","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"roomNumber","type":"uint256"}],"name":"getRoomState","outputs":[{"components":[{"internalType":"address","name":"collection","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"currentHp","type":"uint256"}],"internalType":"struct IDungeonGame.CharacterState","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nftStats","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"prizePool","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"provider","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"rooms","outputs":[{"internalType":"address","name":"collection","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"currentHp","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"startRoom","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"testEntropy","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawFees","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]
Contract Creation Code
7352deaa1c84233f7bb8c8a45baede41091c61650660a0526101806040526000610120819052610140819052610160819052600280546001600160a01b0319169055600381905560048190556005556006805460ff191690553480156200006557600080fd5b50604051620020c0380380620020c083398101604081905262000088916200028c565b62000093336200021f565b600180556001600160a01b038416620000f35760405162461bcd60e51b815260206004820152601c60248201527f496e76616c69642044756e67656f6e456e74727920616464726573730000000060448201526064015b60405180910390fd5b6001600160a01b0383166200014b5760405162461bcd60e51b815260206004820152601860248201527f496e76616c6964204e46545374617473206164647265737300000000000000006044820152606401620000ea565b6001600160a01b038216620001a35760405162461bcd60e51b815260206004820152601960248201527f496e76616c6964205072697a65506f6f6c2061646472657373000000000000006044820152606401620000ea565b6001600160a01b038116620001fb5760405162461bcd60e51b815260206004820152601760248201527f496e76616c696420656e74726f707920616464726573730000000000000000006044820152606401620000ea565b6001600160a01b0393841660c05291831660e05282166101005216608052620002e9565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80516001600160a01b03811681146200028757600080fd5b919050565b60008060008060808587031215620002a357600080fd5b620002ae856200026f565b9350620002be602086016200026f565b9250620002ce604086016200026f565b9150620002de606086016200026f565b905092959194509250565b60805160a05160c05160e05161010051611d3e6200038260003960008181610347015261142d015260008181610402015281816108c701528181610e5d01528181610f6701526113520152600081816103b901528181610814015261108201526000818161017801528181610be00152610c920152600081816102c40152818161070b01528181610c0e0152610cd20152611d3e6000f3fe6080604052600436106101235760003560e01c8063607e9d77116100a0578063b996e27d11610064578063b996e27d146103a7578063e379ad73146103db578063e602ef36146103f0578063f0477d7914610424578063f2fde38b1461044457600080fd5b8063607e9d7714610306578063715018a614610320578063719ce73e146103355780638da5cb5b146103695780639d157ea01461038757600080fd5b80633c42dd9c116100e75780633c42dd9c146102665780633dd591111461027b578063476343ee1461029b57806347ce07cc146102b257806352a5f1f8146102e657600080fd5b806305e72e421461012f578063085d4883146101665780631911ce78146101b25780631bae0ac8146101fd57806326987b601461024257600080fd5b3661012a57005b600080fd5b34801561013b57600080fd5b5061014f61014a36600461198d565b610464565b60405160ff90911681526020015b60405180910390f35b34801561017257600080fd5b5061019a7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b03909116815260200161015d565b3480156101be57600080fd5b506101d26101cd3660046119cd565b6104c3565b6040805182516001600160a01b0316815260208084015190820152918101519082015260600161015d565b34801561020957600080fd5b5061021d6102183660046119ea565b610517565b604080516001600160a01b03909416845260208401929092529082015260600161015d565b34801561024e57600080fd5b5061025860055481565b60405190815260200161015d565b34801561027257600080fd5b5061014f601081565b34801561028757600080fd5b506101d26102963660046119ea565b610548565b3480156102a757600080fd5b506102b06105f8565b005b3480156102be57600080fd5b5061019a7f000000000000000000000000000000000000000000000000000000000000000081565b3480156102f257600080fd5b506102b0610301366004611a03565b610709565b34801561031257600080fd5b5060065461014f9060ff1681565b34801561032c57600080fd5b506102b06107f5565b34801561034157600080fd5b5061019a7f000000000000000000000000000000000000000000000000000000000000000081565b34801561037557600080fd5b506000546001600160a01b031661019a565b34801561039357600080fd5b506102b06103a236600461198d565b610809565b3480156103b357600080fd5b5061019a7f000000000000000000000000000000000000000000000000000000000000000081565b3480156103e757600080fd5b506102b061099a565b3480156103fc57600080fd5b5061019a7f000000000000000000000000000000000000000000000000000000000000000081565b34801561043057600080fd5b506101d261043f36600461198d565b6109a7565b34801561045057600080fd5b506102b061045f366004611a41565b610a11565b6001600160a01b0382166000908152603860209081526040808320848452909152812054600654600554839160109160ff909116906104a4908590611a72565b6104ae9190611a85565b6104b89190611aae565b925050505b92915050565b6104cb611909565b5067ffffffffffffffff16600090815260376020908152604091829020825160608101845281546001600160a01b03168152600182015492810192909252600201549181019190915290565b6007816010811061052757600080fd5b60030201805460018201546002909201546001600160a01b03909116925083565b610550611909565b61055c60016010611ac2565b60ff168211156105a95760405162461bcd60e51b815260206004820152601360248201527224b73b30b634b2103937b7b690373ab6b132b960691b60448201526064015b60405180910390fd5b600782601081106105bc576105bc611adb565b604080516060810182526003929092029290920180546001600160a01b0316825260018101546020830152600201549181019190915292915050565b610600610a8a565b47806106445760405162461bcd60e51b81526020600482015260136024820152724e6f206665657320746f20776974686472617760681b60448201526064016105a0565b604051600090339083908381818185875af1925050503d8060008114610686576040519150601f19603f3d011682016040523d82523d6000602084013e61068b565b606091505b50509050806106d05760405162461bcd60e51b815260206004820152601160248201527015da5d1a191c985dd85b0819985a5b1959607a1b60448201526064016105a0565b60405182815233907fc0819c13be868895eb93e40eaceb96de976442fa1d404e5c55f14bb65a8c489a9060200160405180910390a25050565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0381166107805760405162461bcd60e51b815260206004820152601760248201527f456e74726f70792061646472657373206e6f742073657400000000000000000060448201526064016105a0565b336001600160a01b038216146107e45760405162461bcd60e51b815260206004820152602360248201527f4f6e6c7920456e74726f70792063616e2063616c6c20746869732066756e637460448201526234b7b760e91b60648201526084016105a0565b6107ef848484610ae4565b50505050565b6107fd610a8a565b6108076000610b28565b565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161461088d5760405162461bcd60e51b8152602060048201526024808201527f4f6e6c792044756e67656f6e456e7472792063616e20616464206368617261636044820152637465727360e01b60648201526084016105a0565b600061089b60018484610b78565b604051630368516960e01b81526001600160a01b038581166004830152602482018590529192506000917f0000000000000000000000000000000000000000000000000000000000000000169063036851699060440161014060405180830381865afa15801561090f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109339190611b39565b604080516060810182526001600160a01b0396871681526020808201968752925181830190815267ffffffffffffffff95909516600090815260379093529120905181546001600160a01b0319169516949094178455509051600183015551600290910155565b6108076001600080610ae4565b6109af611909565b60006109bb8484610464565b905060078160ff16601081106109d3576109d3611adb565b604080516060810182526003929092029290920180546001600160a01b03168252600181015460208301526002015491810191909152949350505050565b610a19610a8a565b6001600160a01b038116610a7e5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105a0565b610a8781610b28565b50565b6000546001600160a01b031633146108075760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105a0565b610aee8382610d91565b60405167ffffffffffffffff8416907f4ba5186b4e7e1e2ddc4bc81ec33fc45f5f4e30c2d8e4f1e422178e3eb8cfd08d90600090a2505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60408051602081018590526bffffffffffffffffffffffff19606085901b169181019190915260548101829052426074820152600090819060940160408051808303601f19018152908290528051602090910120631711922960e31b82526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000811660048401529092506000917f00000000000000000000000000000000000000000000000000000000000000009091169063b88c914890602401602060405180830381865afa158015610c57573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c7b9190611bc3565b6040516319cb825f60e01b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000081166004830152602482018590526001600160801b039290921692506000917f000000000000000000000000000000000000000000000000000000000000000016906319cb825f90849060440160206040518083038185885af1158015610d1c573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610d419190611bec565b90508067ffffffffffffffff167fbdc6d9cd20b69192d98208f944398e7220245fa28933232072f237e004b9a37683604051610d7f91815260200190565b60405180910390a29695505050505050565b60005b601060ff821610156110f0576006546000906010908390600190610dbb9060ff1684611c09565b610dc59190611ac2565b610dcf9190611ac2565b610dd99190611c22565b9050600060078260ff1660108110610df357610df3611adb565b6003020180549091506001600160a01b0316610e105750506110e8565b6000610e29610e20846001611c09565b60ff16866111d8565b82546001840154604051630368516960e01b81526001600160a01b03928316600482015260248101919091529192506000917f00000000000000000000000000000000000000000000000000000000000000009091169063036851699060440161014060405180830381865afa158015610ea7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ecb9190611b39565b90506000610ed983836112dc565b9050600081600001518560020154610ef19190611c44565b905060008082139081610f145760028660a00151610f0f9190611c64565b610f1a565b8560a001515b90508115610fc65760028701839055865460018089015460405163012a988f60e31b81526001600160a01b03938416600482015260248101919091526044810184905260648101919091527f000000000000000000000000000000000000000000000000000000000000000090911690630954c47890608401600060405180830381600087803b158015610fad57600080fd5b505af1158015610fc1573d6000803e3d6000fd5b505050505b811561100357610fd860016010611ac2565b60ff168860ff1603610ffe5786546001880154610ffe916001600160a01b03169061131d565b6110df565b600260078960ff166010811061101b5761101b611adb565b82546003919091029190910180546001600160a01b0319166001600160a01b0392831617815560018084015481830155600293840154939091019290925588549189015460405163ceef46bd60e01b815292821660048401526024830152600060448301527f0000000000000000000000000000000000000000000000000000000000000000169063ceef46bd90606401600060405180830381600087803b1580156110c657600080fd5b505af11580156110da573d6000803e3d6000fd5b505050505b50505050505050505b600101610d94565b5067ffffffffffffffff8216600090815260376020908152604080832060055481546001600160a01b031685526038845282852060018301548652909352922055600654819060079060ff166010811061114c5761114c611adb565b82546003919091029190910180546001600160a01b0319166001600160a01b039092169190911781556001808301548183015560029283015492909101919091556006546010916111a09160ff1690611c09565b6111aa9190611c22565b6006805460ff191660ff92909216919091179055600580549060006111ce83611c78565b9190505550505050565b6111e0611933565b6000831180156111f1575060108311155b6112335760405162461bcd60e51b815260206004820152601360248201527224b73b30b634b2103937b7b690373ab6b132b960691b60448201526064016105a0565b8260100361124a576112436114c5565b90506104bd565b6000611257606484611aae565b90506000611266856006611c91565b9050600a8210156112845761127b858261156e565b925050506104bd565b6112906014600a611a85565b8210156112a15761127b8582611610565b600f6112af6014600a611a85565b6112b99190611a85565b8210156112ca5761127b85826116d2565b61127b85826117ab565b505092915050565b60408051808201909152600081526060602082015260006112fd8484611863565b6040805180820190915290815260c0850151602082015291505092915050565b60405163012a988f60e31b81526001600160a01b038381166004830152602482018390526101f46044830152601060648301527f00000000000000000000000000000000000000000000000000000000000000001690630954c47890608401600060405180830381600087803b15801561139657600080fd5b505af11580156113aa573d6000803e3d6000fd5b5050505060026007600160106113c09190611ac2565b60ff16601081106113d3576113d3611adb565b82546003919091029190910180546001600160a01b0319166001600160a01b039283161781556001808401549082015560029283015492019190915560405163f79edfcd60e01b81528382166004820152602481018390527f00000000000000000000000000000000000000000000000000000000000000009091169063f79edfcd90604401600060405180830381600087803b15801561147357600080fd5b505af1158015611487573d6000803e3d6000fd5b50506040518392506001600160a01b03851691507f83c7c1485e35802f043337a3bbc33306ed0d06395209bcfa732d95eeab9776bb90600090a35050565b6114cd611933565b6040805160e08101825260048152606460208201529081016114f160036014611c91565b6114fa90611cbe565b81526020016115096032611cbe565b815260200161151a60026032611cda565b61152390611cbe565b81526020016103e881526020016040518060400160405280601981526020017f5468652064756e67656f6e20626f737320656d65726765732100000000000000815250815250905090565b611576611933565b6040805160e08101909152806002815260208101849052601460408201526060016115a360026032611cda565b81526020016115b460026032611cda565b81526020016115c4856005611c91565b6115cf906032611a85565b81526040805180820190915260208082527f596f7520646973636f7665722061206d61676963616c20626c657373696e672182820152909101529392505050565b611618611933565b6040805160e081018252600181526020810184905290810161163c60026014611c64565b61164590611cbe565b815260200161165660046032611cda565b61165f90611cbe565b815260200161167060046032611cda565b61167990611cbe565b8152602001611689856007611c91565b61169490604b611a85565b815260200160405180604001604052806015815260200174596f7520747269676765726564206120747261702160581b815250815250905092915050565b6116da611933565b600060026116e88185611c64565b6116f3906014611a85565b6116fd9190611c91565b61170690611cbe565b6040805160e08101825260038152602081018690529081018290529091506060810161173460026032611cda565b815260200161174560046032611cda565b61174e90611cbe565b815260200161175e86600f611c91565b611769906096611a85565b81526040805180820190915260208082527f416e20656c69746520656e656d7920626c6f636b7320796f75722070617468218282015290910152949350505050565b6117b3611933565b60006117c0600284611c64565b6117cb906014611a85565b6117d490611cbe565b6040805160e081019091529091508060008152602001848152602001828152602001600081526020016000815260200185600a6118119190611c91565b61181c906064611a85565b81526020016040518060400160405280601881526020017f4120686f7374696c6520656e656d79206170706561727321000000000000000081525081525091505092915050565b6040820151600090818451600481111561187f5761187f611ca8565b148061189d575060038451600481111561189b5761189b611ca8565b145b806118ba57506004845160048111156118b8576118b8611ca8565b145b15611902576000600a84602001516118d29190611c64565b90506000601485604001516118e79190611c64565b90506118f38183611a85565b6118fd9084611c44565b925050505b9392505050565b604051806060016040528060006001600160a01b0316815260200160008152602001600081525090565b6040805160e0810190915280600081526020016000815260200160008152602001600081526020016000815260200160008152602001606081525090565b80356001600160a01b038116811461198857600080fd5b919050565b600080604083850312156119a057600080fd5b6119a983611971565b946020939093013593505050565b67ffffffffffffffff81168114610a8757600080fd5b6000602082840312156119df57600080fd5b8135611902816119b7565b6000602082840312156119fc57600080fd5b5035919050565b600080600060608486031215611a1857600080fd5b8335611a23816119b7565b9250611a3160208501611971565b9150604084013590509250925092565b600060208284031215611a5357600080fd5b61190282611971565b634e487b7160e01b600052601160045260246000fd5b818103818111156104bd576104bd611a5c565b808201808211156104bd576104bd611a5c565b634e487b7160e01b600052601260045260246000fd5b600082611abd57611abd611a98565b500690565b60ff82811682821603908111156104bd576104bd611a5c565b634e487b7160e01b600052603260045260246000fd5b604051610140810167ffffffffffffffff81118282101715611b2357634e487b7160e01b600052604160045260246000fd5b60405290565b8051801515811461198857600080fd5b60006101408284031215611b4c57600080fd5b611b54611af1565b825181526020830151602082015260408301516040820152606083015160608201526080830151608082015260a083015160a082015260c083015160c082015260e083015160e0820152610100808401518183015250610120611bb8818501611b29565b908201529392505050565b600060208284031215611bd557600080fd5b81516001600160801b038116811461190257600080fd5b600060208284031215611bfe57600080fd5b8151611902816119b7565b60ff81811683821601908111156104bd576104bd611a5c565b600060ff831680611c3557611c35611a98565b8060ff84160691505092915050565b80820182811260008312801582168215821617156112d4576112d4611a5c565b600082611c7357611c73611a98565b500490565b600060018201611c8a57611c8a611a5c565b5060010190565b80820281158282048414176104bd576104bd611a5c565b634e487b7160e01b600052602160045260246000fd5b6000600160ff1b8201611cd357611cd3611a5c565b5060000390565b600082611ce957611ce9611a98565b600160ff1b821460001984141615611d0357611d03611a5c565b50059056fea264697066735822122082bbcbf7ac1784879054925777f17cb6140d070d9ee31ee063fe480d792d6d9d64736f6c63430008170033000000000000000000000000ca50e8e5c129236553d213460d17072e3e7c0b880000000000000000000000004972734712cfa9e20c4ee52d3a77267a6c9e66db0000000000000000000000001dc942ca93b7ede47991bfef4e56c256b568e6ad00000000000000000000000036825bf3fbdf5a29e2d5148bfe7dcf7b5639e320
Deployed Bytecode
0x6080604052600436106101235760003560e01c8063607e9d77116100a0578063b996e27d11610064578063b996e27d146103a7578063e379ad73146103db578063e602ef36146103f0578063f0477d7914610424578063f2fde38b1461044457600080fd5b8063607e9d7714610306578063715018a614610320578063719ce73e146103355780638da5cb5b146103695780639d157ea01461038757600080fd5b80633c42dd9c116100e75780633c42dd9c146102665780633dd591111461027b578063476343ee1461029b57806347ce07cc146102b257806352a5f1f8146102e657600080fd5b806305e72e421461012f578063085d4883146101665780631911ce78146101b25780631bae0ac8146101fd57806326987b601461024257600080fd5b3661012a57005b600080fd5b34801561013b57600080fd5b5061014f61014a36600461198d565b610464565b60405160ff90911681526020015b60405180910390f35b34801561017257600080fd5b5061019a7f00000000000000000000000052deaa1c84233f7bb8c8a45baede41091c61650681565b6040516001600160a01b03909116815260200161015d565b3480156101be57600080fd5b506101d26101cd3660046119cd565b6104c3565b6040805182516001600160a01b0316815260208084015190820152918101519082015260600161015d565b34801561020957600080fd5b5061021d6102183660046119ea565b610517565b604080516001600160a01b03909416845260208401929092529082015260600161015d565b34801561024e57600080fd5b5061025860055481565b60405190815260200161015d565b34801561027257600080fd5b5061014f601081565b34801561028757600080fd5b506101d26102963660046119ea565b610548565b3480156102a757600080fd5b506102b06105f8565b005b3480156102be57600080fd5b5061019a7f00000000000000000000000036825bf3fbdf5a29e2d5148bfe7dcf7b5639e32081565b3480156102f257600080fd5b506102b0610301366004611a03565b610709565b34801561031257600080fd5b5060065461014f9060ff1681565b34801561032c57600080fd5b506102b06107f5565b34801561034157600080fd5b5061019a7f0000000000000000000000001dc942ca93b7ede47991bfef4e56c256b568e6ad81565b34801561037557600080fd5b506000546001600160a01b031661019a565b34801561039357600080fd5b506102b06103a236600461198d565b610809565b3480156103b357600080fd5b5061019a7f000000000000000000000000ca50e8e5c129236553d213460d17072e3e7c0b8881565b3480156103e757600080fd5b506102b061099a565b3480156103fc57600080fd5b5061019a7f0000000000000000000000004972734712cfa9e20c4ee52d3a77267a6c9e66db81565b34801561043057600080fd5b506101d261043f36600461198d565b6109a7565b34801561045057600080fd5b506102b061045f366004611a41565b610a11565b6001600160a01b0382166000908152603860209081526040808320848452909152812054600654600554839160109160ff909116906104a4908590611a72565b6104ae9190611a85565b6104b89190611aae565b925050505b92915050565b6104cb611909565b5067ffffffffffffffff16600090815260376020908152604091829020825160608101845281546001600160a01b03168152600182015492810192909252600201549181019190915290565b6007816010811061052757600080fd5b60030201805460018201546002909201546001600160a01b03909116925083565b610550611909565b61055c60016010611ac2565b60ff168211156105a95760405162461bcd60e51b815260206004820152601360248201527224b73b30b634b2103937b7b690373ab6b132b960691b60448201526064015b60405180910390fd5b600782601081106105bc576105bc611adb565b604080516060810182526003929092029290920180546001600160a01b0316825260018101546020830152600201549181019190915292915050565b610600610a8a565b47806106445760405162461bcd60e51b81526020600482015260136024820152724e6f206665657320746f20776974686472617760681b60448201526064016105a0565b604051600090339083908381818185875af1925050503d8060008114610686576040519150601f19603f3d011682016040523d82523d6000602084013e61068b565b606091505b50509050806106d05760405162461bcd60e51b815260206004820152601160248201527015da5d1a191c985dd85b0819985a5b1959607a1b60448201526064016105a0565b60405182815233907fc0819c13be868895eb93e40eaceb96de976442fa1d404e5c55f14bb65a8c489a9060200160405180910390a25050565b7f00000000000000000000000036825bf3fbdf5a29e2d5148bfe7dcf7b5639e3206001600160a01b0381166107805760405162461bcd60e51b815260206004820152601760248201527f456e74726f70792061646472657373206e6f742073657400000000000000000060448201526064016105a0565b336001600160a01b038216146107e45760405162461bcd60e51b815260206004820152602360248201527f4f6e6c7920456e74726f70792063616e2063616c6c20746869732066756e637460448201526234b7b760e91b60648201526084016105a0565b6107ef848484610ae4565b50505050565b6107fd610a8a565b6108076000610b28565b565b336001600160a01b037f000000000000000000000000ca50e8e5c129236553d213460d17072e3e7c0b88161461088d5760405162461bcd60e51b8152602060048201526024808201527f4f6e6c792044756e67656f6e456e7472792063616e20616464206368617261636044820152637465727360e01b60648201526084016105a0565b600061089b60018484610b78565b604051630368516960e01b81526001600160a01b038581166004830152602482018590529192506000917f0000000000000000000000004972734712cfa9e20c4ee52d3a77267a6c9e66db169063036851699060440161014060405180830381865afa15801561090f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109339190611b39565b604080516060810182526001600160a01b0396871681526020808201968752925181830190815267ffffffffffffffff95909516600090815260379093529120905181546001600160a01b0319169516949094178455509051600183015551600290910155565b6108076001600080610ae4565b6109af611909565b60006109bb8484610464565b905060078160ff16601081106109d3576109d3611adb565b604080516060810182526003929092029290920180546001600160a01b03168252600181015460208301526002015491810191909152949350505050565b610a19610a8a565b6001600160a01b038116610a7e5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105a0565b610a8781610b28565b50565b6000546001600160a01b031633146108075760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105a0565b610aee8382610d91565b60405167ffffffffffffffff8416907f4ba5186b4e7e1e2ddc4bc81ec33fc45f5f4e30c2d8e4f1e422178e3eb8cfd08d90600090a2505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60408051602081018590526bffffffffffffffffffffffff19606085901b169181019190915260548101829052426074820152600090819060940160408051808303601f19018152908290528051602090910120631711922960e31b82526001600160a01b037f00000000000000000000000052deaa1c84233f7bb8c8a45baede41091c616506811660048401529092506000917f00000000000000000000000036825bf3fbdf5a29e2d5148bfe7dcf7b5639e3209091169063b88c914890602401602060405180830381865afa158015610c57573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c7b9190611bc3565b6040516319cb825f60e01b81526001600160a01b037f00000000000000000000000052deaa1c84233f7bb8c8a45baede41091c61650681166004830152602482018590526001600160801b039290921692506000917f00000000000000000000000036825bf3fbdf5a29e2d5148bfe7dcf7b5639e32016906319cb825f90849060440160206040518083038185885af1158015610d1c573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610d419190611bec565b90508067ffffffffffffffff167fbdc6d9cd20b69192d98208f944398e7220245fa28933232072f237e004b9a37683604051610d7f91815260200190565b60405180910390a29695505050505050565b60005b601060ff821610156110f0576006546000906010908390600190610dbb9060ff1684611c09565b610dc59190611ac2565b610dcf9190611ac2565b610dd99190611c22565b9050600060078260ff1660108110610df357610df3611adb565b6003020180549091506001600160a01b0316610e105750506110e8565b6000610e29610e20846001611c09565b60ff16866111d8565b82546001840154604051630368516960e01b81526001600160a01b03928316600482015260248101919091529192506000917f0000000000000000000000004972734712cfa9e20c4ee52d3a77267a6c9e66db9091169063036851699060440161014060405180830381865afa158015610ea7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ecb9190611b39565b90506000610ed983836112dc565b9050600081600001518560020154610ef19190611c44565b905060008082139081610f145760028660a00151610f0f9190611c64565b610f1a565b8560a001515b90508115610fc65760028701839055865460018089015460405163012a988f60e31b81526001600160a01b03938416600482015260248101919091526044810184905260648101919091527f0000000000000000000000004972734712cfa9e20c4ee52d3a77267a6c9e66db90911690630954c47890608401600060405180830381600087803b158015610fad57600080fd5b505af1158015610fc1573d6000803e3d6000fd5b505050505b811561100357610fd860016010611ac2565b60ff168860ff1603610ffe5786546001880154610ffe916001600160a01b03169061131d565b6110df565b600260078960ff166010811061101b5761101b611adb565b82546003919091029190910180546001600160a01b0319166001600160a01b0392831617815560018084015481830155600293840154939091019290925588549189015460405163ceef46bd60e01b815292821660048401526024830152600060448301527f000000000000000000000000ca50e8e5c129236553d213460d17072e3e7c0b88169063ceef46bd90606401600060405180830381600087803b1580156110c657600080fd5b505af11580156110da573d6000803e3d6000fd5b505050505b50505050505050505b600101610d94565b5067ffffffffffffffff8216600090815260376020908152604080832060055481546001600160a01b031685526038845282852060018301548652909352922055600654819060079060ff166010811061114c5761114c611adb565b82546003919091029190910180546001600160a01b0319166001600160a01b039092169190911781556001808301548183015560029283015492909101919091556006546010916111a09160ff1690611c09565b6111aa9190611c22565b6006805460ff191660ff92909216919091179055600580549060006111ce83611c78565b9190505550505050565b6111e0611933565b6000831180156111f1575060108311155b6112335760405162461bcd60e51b815260206004820152601360248201527224b73b30b634b2103937b7b690373ab6b132b960691b60448201526064016105a0565b8260100361124a576112436114c5565b90506104bd565b6000611257606484611aae565b90506000611266856006611c91565b9050600a8210156112845761127b858261156e565b925050506104bd565b6112906014600a611a85565b8210156112a15761127b8582611610565b600f6112af6014600a611a85565b6112b99190611a85565b8210156112ca5761127b85826116d2565b61127b85826117ab565b505092915050565b60408051808201909152600081526060602082015260006112fd8484611863565b6040805180820190915290815260c0850151602082015291505092915050565b60405163012a988f60e31b81526001600160a01b038381166004830152602482018390526101f46044830152601060648301527f0000000000000000000000004972734712cfa9e20c4ee52d3a77267a6c9e66db1690630954c47890608401600060405180830381600087803b15801561139657600080fd5b505af11580156113aa573d6000803e3d6000fd5b5050505060026007600160106113c09190611ac2565b60ff16601081106113d3576113d3611adb565b82546003919091029190910180546001600160a01b0319166001600160a01b039283161781556001808401549082015560029283015492019190915560405163f79edfcd60e01b81528382166004820152602481018390527f0000000000000000000000001dc942ca93b7ede47991bfef4e56c256b568e6ad9091169063f79edfcd90604401600060405180830381600087803b15801561147357600080fd5b505af1158015611487573d6000803e3d6000fd5b50506040518392506001600160a01b03851691507f83c7c1485e35802f043337a3bbc33306ed0d06395209bcfa732d95eeab9776bb90600090a35050565b6114cd611933565b6040805160e08101825260048152606460208201529081016114f160036014611c91565b6114fa90611cbe565b81526020016115096032611cbe565b815260200161151a60026032611cda565b61152390611cbe565b81526020016103e881526020016040518060400160405280601981526020017f5468652064756e67656f6e20626f737320656d65726765732100000000000000815250815250905090565b611576611933565b6040805160e08101909152806002815260208101849052601460408201526060016115a360026032611cda565b81526020016115b460026032611cda565b81526020016115c4856005611c91565b6115cf906032611a85565b81526040805180820190915260208082527f596f7520646973636f7665722061206d61676963616c20626c657373696e672182820152909101529392505050565b611618611933565b6040805160e081018252600181526020810184905290810161163c60026014611c64565b61164590611cbe565b815260200161165660046032611cda565b61165f90611cbe565b815260200161167060046032611cda565b61167990611cbe565b8152602001611689856007611c91565b61169490604b611a85565b815260200160405180604001604052806015815260200174596f7520747269676765726564206120747261702160581b815250815250905092915050565b6116da611933565b600060026116e88185611c64565b6116f3906014611a85565b6116fd9190611c91565b61170690611cbe565b6040805160e08101825260038152602081018690529081018290529091506060810161173460026032611cda565b815260200161174560046032611cda565b61174e90611cbe565b815260200161175e86600f611c91565b611769906096611a85565b81526040805180820190915260208082527f416e20656c69746520656e656d7920626c6f636b7320796f75722070617468218282015290910152949350505050565b6117b3611933565b60006117c0600284611c64565b6117cb906014611a85565b6117d490611cbe565b6040805160e081019091529091508060008152602001848152602001828152602001600081526020016000815260200185600a6118119190611c91565b61181c906064611a85565b81526020016040518060400160405280601881526020017f4120686f7374696c6520656e656d79206170706561727321000000000000000081525081525091505092915050565b6040820151600090818451600481111561187f5761187f611ca8565b148061189d575060038451600481111561189b5761189b611ca8565b145b806118ba57506004845160048111156118b8576118b8611ca8565b145b15611902576000600a84602001516118d29190611c64565b90506000601485604001516118e79190611c64565b90506118f38183611a85565b6118fd9084611c44565b925050505b9392505050565b604051806060016040528060006001600160a01b0316815260200160008152602001600081525090565b6040805160e0810190915280600081526020016000815260200160008152602001600081526020016000815260200160008152602001606081525090565b80356001600160a01b038116811461198857600080fd5b919050565b600080604083850312156119a057600080fd5b6119a983611971565b946020939093013593505050565b67ffffffffffffffff81168114610a8757600080fd5b6000602082840312156119df57600080fd5b8135611902816119b7565b6000602082840312156119fc57600080fd5b5035919050565b600080600060608486031215611a1857600080fd5b8335611a23816119b7565b9250611a3160208501611971565b9150604084013590509250925092565b600060208284031215611a5357600080fd5b61190282611971565b634e487b7160e01b600052601160045260246000fd5b818103818111156104bd576104bd611a5c565b808201808211156104bd576104bd611a5c565b634e487b7160e01b600052601260045260246000fd5b600082611abd57611abd611a98565b500690565b60ff82811682821603908111156104bd576104bd611a5c565b634e487b7160e01b600052603260045260246000fd5b604051610140810167ffffffffffffffff81118282101715611b2357634e487b7160e01b600052604160045260246000fd5b60405290565b8051801515811461198857600080fd5b60006101408284031215611b4c57600080fd5b611b54611af1565b825181526020830151602082015260408301516040820152606083015160608201526080830151608082015260a083015160a082015260c083015160c082015260e083015160e0820152610100808401518183015250610120611bb8818501611b29565b908201529392505050565b600060208284031215611bd557600080fd5b81516001600160801b038116811461190257600080fd5b600060208284031215611bfe57600080fd5b8151611902816119b7565b60ff81811683821601908111156104bd576104bd611a5c565b600060ff831680611c3557611c35611a98565b8060ff84160691505092915050565b80820182811260008312801582168215821617156112d4576112d4611a5c565b600082611c7357611c73611a98565b500490565b600060018201611c8a57611c8a611a5c565b5060010190565b80820281158282048414176104bd576104bd611a5c565b634e487b7160e01b600052602160045260246000fd5b6000600160ff1b8201611cd357611cd3611a5c565b5060000390565b600082611ce957611ce9611a98565b600160ff1b821460001984141615611d0357611d03611a5c565b50059056fea264697066735822122082bbcbf7ac1784879054925777f17cb6140d070d9ee31ee063fe480d792d6d9d64736f6c63430008170033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000ca50e8e5c129236553d213460d17072e3e7c0b880000000000000000000000004972734712cfa9e20c4ee52d3a77267a6c9e66db0000000000000000000000001dc942ca93b7ede47991bfef4e56c256b568e6ad00000000000000000000000036825bf3fbdf5a29e2d5148bfe7dcf7b5639e320
-----Decoded View---------------
Arg [0] : _dungeonEntry (address): 0xcA50e8e5C129236553d213460D17072e3e7C0B88
Arg [1] : _nftStats (address): 0x4972734712CFA9e20C4EE52D3A77267a6C9E66Db
Arg [2] : _prizePool (address): 0x1DC942cA93B7eDE47991BfEf4E56C256B568E6AD
Arg [3] : _entropy (address): 0x36825bf3Fbdf5a29E2d5148bfe7Dcf7B5639e320
-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 000000000000000000000000ca50e8e5c129236553d213460d17072e3e7c0b88
Arg [1] : 0000000000000000000000004972734712cfa9e20c4ee52d3a77267a6c9e66db
Arg [2] : 0000000000000000000000001dc942ca93b7ede47991bfef4e56c256b568e6ad
Arg [3] : 00000000000000000000000036825bf3fbdf5a29e2d5148bfe7dcf7b5639e320
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 31 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|---|---|---|---|---|
APE | 100.00% | $0.513062 | 0.0372 | $0.019062 |
[ 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.