Address: 0x19080718f490A0A2195081C4cB3e9b4DD4d61A1B
Balance (XRP): 0 XRP
Bytecode: 0x608060405234801561000f575f80fd5b5060043610610106575f3560e01c8063715018a61161009e5780639ccbdd0d1161006e5780639ccbdd0d14610264578063bc073cc614610277578063da6d472814610296578063f2fde38b146102a9578063f852e67c146102bc575f80fd5b8063715018a6146101f05780637f221734146101fa5780638da5cb5b146102375780638f6eb47114610251575f80fd5b80632d55f737116100d95780632d55f737146101815780633b28d9db146101ab5780634aa13e9c146101be5780636664189c146101d1575f80fd5b80630c2463ba1461010a5780631284a3e71461013c57806317dc45a91461014f5780632d149b6f1461016e575b5f80fd5b61012961011836600461087d565b60016020525f908152604090205481565b6040519081526020015b60405180910390f35b61012961014a36600461089d565b6102cf565b61012961015d36600461087d565b60066020525f908152604090205481565b61012961017c36600461089d565b61034b565b61012961018f3660046108b4565b600460209081525f928352604080842090915290825290205481565b6101296101b936600461089d565b6103b2565b6101296101cc36600461089d565b610423565b6101296101df36600461087d565b60026020525f908152604090205481565b6101f86104ec565b005b6102276102083660046108b4565b600560209081525f928352604080842090915290825290205460ff1681565b6040519015158152602001610133565b5f546040516001600160a01b039091168152602001610133565b61012961025f36600461089d565b6104ff565b61012961027236600461089d565b6105bc565b61012961028536600461087d565b60036020525f908152604090205481565b6101296102a436600461089d565b61063b565b6101f86102b736600461087d565b6106f8565b6101f86102ca3660046108dc565b610735565b335f90815260036020526040812054816102e9848361095f565b335f818152600360209081526040918290208490558151868152908101849052600191810191909152919250907fe2f35f74adf10d31dfb6fca6f8952ad49e6255c3adcc81d8f0139922c3529593906060015b60405180910390a29392505050565b335f9081526006602052604081205481610365848361095f565b335f81815260066020908152604091829020849055815186815290810184905292935090917fdd51e81bf0b3ca41f571aea0ae0c85a365798d370184a550bf2521e4242eadcc910161033c565b335f90815260026020526040812054816103cc848361095f565b335f818152600260209081526040918290208490558151868152908101849052600191810191909152919250907f0e639f45b1d305d9102910f55732dedcc2ebb54effcfe46ee1b2f481a00d201e9060600161033c565b335f9081526001602052604081205480831161049a5760405162461bcd60e51b815260206004820152602b60248201527f4e6577207374616765206d75737420626520686967686572207468616e20637560448201526a7272656e7420737461676560a81b60648201526084015b60405180910390fd5b335f8181526001602090815260409182902086905581518481529081018690527f8ac44aa24401e42623195ec866c3decf300e6f73bbb436f3cc3874ebf0148796910160405180910390a25090919050565b6104f46107e7565b6104fd5f610813565b565b335f908152600360205260408120548281101561055e5760405162461bcd60e51b815260206004820152601860248201527f496e73756666696369656e742067656d2062616c616e636500000000000000006044820152606401610491565b5f6105698483610978565b335f8181526003602090815260408083208590558051878152918201859052810191909152919250907fe2f35f74adf10d31dfb6fca6f8952ad49e6255c3adcc81d8f0139922c35295939060600161033c565b335f90815260046020908152604080832084845290915281205481906105e390600161095f565b335f818152600460209081526040808320888452825291829020849055905183815292935085927fd3b2006f08b93f217e62a4445c82311f1e315e0fb5908815c8c63ba4c319ca30910160405180910390a392915050565b335f908152600260205260408120548281101561069a5760405162461bcd60e51b815260206004820152601960248201527f496e73756666696369656e7420676f6c642062616c616e6365000000000000006044820152606401610491565b5f6106a58483610978565b335f8181526002602090815260408083208590558051878152918201859052810191909152919250907f0e639f45b1d305d9102910f55732dedcc2ebb54effcfe46ee1b2f481a00d201e9060600161033c565b6107006107e7565b6001600160a01b03811661072957604051631e4fbdf760e01b81525f6004820152602401610491565b61073281610813565b50565b5f5b8181101561079f57335f9081526005602052604081206001918585858181106107625761076261098b565b9050602002013581526020019081526020015f205f6101000a81548160ff02191690831515021790555080806107979061099f565b915050610737565b50336001600160a01b03167fa422c6ac14d0d5a9cd04ffc0ead3e193e61da86847592e4faeb55b7997c136b783836040516107db9291906109b7565b60405180910390a25050565b5f546001600160a01b031633146104fd5760405163118cdaa760e01b8152336004820152602401610491565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80356001600160a01b0381168114610878575f80fd5b919050565b5f6020828403121561088d575f80fd5b61089682610862565b9392505050565b5f602082840312156108ad575f80fd5b5035919050565b5f80604083850312156108c5575f80fd5b6108ce83610862565b946020939093013593505050565b5f80602083850312156108ed575f80fd5b823567ffffffffffffffff80821115610904575f80fd5b818501915085601f830112610917575f80fd5b813581811115610925575f80fd5b8660208260051b8501011115610939575f80fd5b60209290920196919550909350505050565b634e487b7160e01b5f52601160045260245ffd5b808201808211156109725761097261094b565b92915050565b818103818111156109725761097261094b565b634e487b7160e01b5f52603260045260245ffd5b5f600182016109b0576109b061094b565b5060010190565b602080825281018290525f6001600160fb1b038311156109d5575f80fd5b8260051b8085604085013791909101604001939250505056fea2646970667358221220476f65a5fd10156e486904c6be6f7efe0e59f16fe9c57780faea4c5cc6fded6064736f6c63430008140033
Gas Token:
Ownable.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol) pragma solidity ^0.8.20; import {Context} from "../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. * * The initial owner is set to the address provided by the deployer. 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; /** * @dev The caller account is not authorized to perform an operation. */ error OwnableUnauthorizedAccount(address account); /** * @dev The owner is not a valid owner account. (eg. `address(0)`) */ error OwnableInvalidOwner(address owner); event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the address provided by the deployer as the initial owner. */ constructor(address initialOwner) { if (initialOwner == address(0)) { revert OwnableInvalidOwner(address(0)); } _transferOwnership(initialOwner); } /** * @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 { if (owner() != _msgSender()) { revert OwnableUnauthorizedAccount(_msgSender()); } } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby disabling 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 { if (newOwner == address(0)) { revert OwnableInvalidOwner(address(0)); } _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); } }
Context.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol) pragma solidity ^0.8.20; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } function _contextSuffixLength() internal view virtual returns (uint256) { return 0; } }
IdleArenaContract.sol
// SPDX-License-Identifier: MIT // Compatible with OpenZeppelin Contracts ^5.0.0 pragma solidity ^0.8.20; import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; contract IdleArenaContract is Ownable { // Mapping to store campaign stage ID for each user mapping(address => uint256) public userCampaignStage; // Mapping to store gold balance for each user mapping(address => uint256) public userGold; // Mapping to store gem balance for each user mapping(address => uint256) public userGems; // Mapping to store hero counts for each user: user => heroId => count mapping(address => mapping(uint256 => uint256)) public userHeroes; // Mapping to store completed daily quests: user => questId => completed mapping(address => mapping(uint256 => bool)) public userCompletedQuests; // Mapping to store AFK rewards balance for each user mapping(address => uint256) public userAfkRewards; // Events event GoldChanged( address indexed user, uint256 oldAmount, uint256 newAmount, bool isReceived ); event GemsChanged( address indexed user, uint256 oldAmount, uint256 newAmount, bool isReceived ); event CampaignStageUpdated( address indexed user, uint256 oldStage, uint256 newStage ); event HeroSummoned( address indexed user, uint256 indexed heroId, uint256 newCount ); event DailyQuestCompleted(address indexed user, uint256[] questIds); event AfkRewardReceived( address indexed user, uint256 oldAmount, uint256 newAmount ); constructor(address initialOwner) Ownable(initialOwner) {} /** * @dev Updates the current campaign stage for the caller * @param stageId The ID of the campaign stage * @return The new campaign stage ID */ function updateCampaignStage(uint256 stageId) external returns (uint256) { uint256 oldStage = userCampaignStage[msg.sender]; require( stageId > oldStage, "New stage must be higher than current stage" ); userCampaignStage[msg.sender] = stageId; emit CampaignStageUpdated(msg.sender, oldStage, stageId); return stageId; } /** * @dev Adds gold to the user's balance * @param amount The amount of gold to add * @return The new gold balance */ function receiveGold(uint256 amount) external returns (uint256) { uint256 oldAmount = userGold[msg.sender]; uint256 newAmount = oldAmount + amount; userGold[msg.sender] = newAmount; emit GoldChanged(msg.sender, oldAmount, newAmount, true); return newAmount; } /** * @dev Subtracts gold from the user's balance * @param amount The amount of gold to subtract * @return The new gold balance */ function consumeGold(uint256 amount) external returns (uint256) { uint256 oldAmount = userGold[msg.sender]; require(oldAmount >= amount, "Insufficient gold balance"); uint256 newAmount = oldAmount - amount; userGold[msg.sender] = newAmount; emit GoldChanged(msg.sender, oldAmount, newAmount, false); return newAmount; } /** * @dev Adds gems to the user's balance * @param amount The amount of gems to add * @return The new gem balance */ function receiveGems(uint256 amount) external returns (uint256) { uint256 oldAmount = userGems[msg.sender]; uint256 newAmount = oldAmount + amount; userGems[msg.sender] = newAmount; emit GemsChanged(msg.sender, oldAmount, newAmount, true); return newAmount; } /** * @dev Subtracts gems from the user's balance * @param amount The amount of gems to subtract * @return The new gem balance */ function consumeGems(uint256 amount) external returns (uint256) { uint256 oldAmount = userGems[msg.sender]; require(oldAmount >= amount, "Insufficient gem balance"); uint256 newAmount = oldAmount - amount; userGems[msg.sender] = newAmount; emit GemsChanged(msg.sender, oldAmount, newAmount, false); return newAmount; } /** * @dev Summons a hero for the caller, incrementing the hero count by 1 * @param heroId The ID of the hero to summon * @return The new count of this hero for the user */ function summonHero(uint256 heroId) external returns (uint256) { uint256 newCount = userHeroes[msg.sender][heroId] + 1; userHeroes[msg.sender][heroId] = newCount; emit HeroSummoned(msg.sender, heroId, newCount); return newCount; } /** * @dev Marks daily quests as completed for the caller * @param questIds Array of quest IDs to mark as completed */ function completeDailyQuests(uint256[] calldata questIds) external { for (uint256 i = 0; i < questIds.length; i++) { userCompletedQuests[msg.sender][questIds[i]] = true; } emit DailyQuestCompleted(msg.sender, questIds); } /** * @dev Adds AFK rewards to the user's balance * @param amount The amount of AFK rewards to add * @return The new AFK rewards balance */ function receiveAfkReward(uint256 amount) external returns (uint256) { uint256 oldAmount = userAfkRewards[msg.sender]; uint256 newAmount = oldAmount + amount; userAfkRewards[msg.sender] = newAmount; emit AfkRewardReceived(msg.sender, oldAmount, newAmount); return newAmount; } }