Overview
ETH Balance
ETH Value
$0.00Latest 25 from a total of 28 transactions
| Transaction Hash |
|
Block
|
From
|
To
|
|||||
|---|---|---|---|---|---|---|---|---|---|
| Spin | 19732917 | 17 days ago | IN | 0 ETH | 0.00000138 | ||||
| Grant Free Spins | 19732874 | 17 days ago | IN | 0 ETH | 0.00000135 | ||||
| Spin | 17985179 | 37 days ago | IN | 0 ETH | 0.00000183 | ||||
| Spin | 17940024 | 38 days ago | IN | 0 ETH | 0.00000135 | ||||
| Spin | 17907497 | 38 days ago | IN | 0 ETH | 0.00000135 | ||||
| Grant Free Spins | 17907485 | 38 days ago | IN | 0 ETH | 0.00000135 | ||||
| Spin | 17907387 | 38 days ago | IN | 0 ETH | 0.00000135 | ||||
| Spin | 17906974 | 38 days ago | IN | 0 ETH | 0.00000135 | ||||
| Spin | 17906470 | 38 days ago | IN | 0 ETH | 0.00000174 | ||||
| Spin | 17906024 | 38 days ago | IN | 0 ETH | 0.00000135 | ||||
| Spin | 17905975 | 38 days ago | IN | 0 ETH | 0.00000135 | ||||
| Spin | 17905843 | 38 days ago | IN | 0 ETH | 0.00000135 | ||||
| Spin | 17904923 | 38 days ago | IN | 0 ETH | 0.00000135 | ||||
| Spin | 17881788 | 38 days ago | IN | 0 ETH | 0.0000018 | ||||
| Spin | 17881194 | 38 days ago | IN | 0 ETH | 0.00000135 | ||||
| Spin | 17880804 | 38 days ago | IN | 0 ETH | 0.00000135 | ||||
| Spin | 17880594 | 38 days ago | IN | 0 ETH | 0.00000135 | ||||
| Spin | 17880401 | 38 days ago | IN | 0 ETH | 0.00000135 | ||||
| Spin | 17880238 | 38 days ago | IN | 0 ETH | 0.00000135 | ||||
| Spin | 17880070 | 38 days ago | IN | 0 ETH | 0.00000135 | ||||
| Spin | 15397613 | 67 days ago | IN | 0 ETH | 0.00000152 | ||||
| Spin | 15397308 | 67 days ago | IN | 0 ETH | 0.00000135 | ||||
| Spin | 15397163 | 67 days ago | IN | 0 ETH | 0.00000135 | ||||
| Spin | 15396425 | 67 days ago | IN | 0 ETH | 0.00000135 | ||||
| Spin | 15396249 | 67 days ago | IN | 0 ETH | 0.00000135 |
Latest 25 internal transactions (View All)
| Parent Transaction Hash | Block | From | To | ||||
|---|---|---|---|---|---|---|---|
| 17985179 | 37 days ago | 0 ETH | |||||
| 17985179 | 37 days ago | 0 ETH | |||||
| 17940024 | 38 days ago | 0 ETH | |||||
| 17940024 | 38 days ago | 0 ETH | |||||
| 17907497 | 38 days ago | 0 ETH | |||||
| 17907497 | 38 days ago | 0 ETH | |||||
| 17906470 | 38 days ago | 0 ETH | |||||
| 17906470 | 38 days ago | 0 ETH | |||||
| 17906024 | 38 days ago | 0 ETH | |||||
| 17906024 | 38 days ago | 0 ETH | |||||
| 17905975 | 38 days ago | 0 ETH | |||||
| 17905975 | 38 days ago | 0 ETH | |||||
| 17905843 | 38 days ago | 0 ETH | |||||
| 17905843 | 38 days ago | 0 ETH | |||||
| 17904923 | 38 days ago | 0 ETH | |||||
| 17904923 | 38 days ago | 0 ETH | |||||
| 17881788 | 38 days ago | 0 ETH | |||||
| 17881788 | 38 days ago | 0 ETH | |||||
| 17881194 | 38 days ago | 0 ETH | |||||
| 17880804 | 38 days ago | 0 ETH | |||||
| 17880804 | 38 days ago | 0 ETH | |||||
| 17880594 | 38 days ago | 0 ETH | |||||
| 17880401 | 38 days ago | 0 ETH | |||||
| 17880401 | 38 days ago | 0 ETH | |||||
| 17880238 | 38 days ago | 0 ETH |
Cross-Chain Transactions
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Pausable.sol";
/**
* @title IKitsuBaddiesERC1155
* @notice Minimal interface for external NFT contract that mints prizes
* @dev Compatible with KitsuBaddiesERC1155.
*/
interface IKitsuBaddiesERC1155 {
/**
* @notice Mint an NFT with a specific id to a recipient
* @param collectionId The address to receive the NFT
* @param to The token id to mint (1-9 for slot machine results)
* @param data Additional data with no specified format, sent in the mint call.
*/
function mint(uint256 collectionId, address to, bytes memory data) external returns (uint256 id);
}
/**
* @title IRandomnessProvider
* @notice Interface for external randomness provider
* @dev Allows keeping randomness logic obfuscated in a separate unverified contract
*/
interface IRandomnessProvider {
/**
* @notice Generate a random number for probability calculations [0..999]
* @param salt Additional entropy
* @return Random number between 0 and 999
*/
function getRandomForProbability(uint256 salt) external returns (uint256);
}
/**
* @title SlotMachine
* @notice On-chain slot machine with internal balance system, fixed spin cost, and NFT rewards
* @dev Each user deposits ETH into an internal balance. Each spin costs `ticketPrice` or consumes a free spin.
* A spin generates 1 random result with weighted probabilities:
*
* Prize Distribution (81.5% win rate):
* - Collections 1-4: 14.0% each → mint NFT
* - Collections 5-7: 7.5% each → mint NFT
* - Collections 8-9: 1.5% each → mint NFT
* - Loss: 18.5% → no reward
*
* ⚠️ SECURITY WARNING: This contract uses pseudo-random generation based on block properties.
* This is ONLY suitable for demonstration/testing. For production, integrate Chainlink VRF.
*
* TODO: Phase 2 - Replace _rand() with Chainlink VRF integration for secure randomness
*/
contract SlotMachine is ReentrancyGuard, Ownable, Pausable {
// ========== State Variables ==========
/// @notice Internal ETH balance per user (in wei)
mapping(address => uint256) public balances;
/// @notice Free spins available per user
mapping(address => uint256) public freeSpins;
/// @notice Cost per spin in wei
uint256 public ticketPrice;
/// @notice External NFT contract for minting prizes
IKitsuBaddiesERC1155 public kitsuBaddiesERC1155;
/// @notice External randomness provider (unverified contract for obfuscation)
IRandomnessProvider public randomnessProvider;
/// @notice Total number of spins played across all users
uint256 public totalSpins;
/// @notice Total number of NFTs minted as prizes
uint256 public totalNFTsMinted;
/// @notice Cumulative probability thresholds for each result (out of 1000)
/// @dev Array indices 0-9 represent results 1-10. Value is the upper bound (exclusive) for that result.
/// Example: [140, 280, 420, 560, 635, 710, 785, 800, 815, 1000]
/// means: 1 if roll < 140, 2 if roll < 280, etc.
uint256[10] public probabilityThresholds;
// ========== Events ==========
/// @notice Emitted when a user deposits ETH to their internal balance
event Deposited(address indexed user, uint256 amount);
// Note: Withdrawn event removed - withdrawals are not allowed
/// @notice Emitted after each spin with full result details
/// @param user The player who spun
/// @param result The result [1..10]
/// @param minted Whether an NFT was minted (true for 1-9, false for 10)
event Spin(
address indexed user,
uint8 result,
bool minted
);
/// @notice Emitted when admin updates the ticket price
event TicketPriceUpdated(uint256 oldPrice, uint256 newPrice);
/// @notice Emitted when admin updates the prize NFT contract
event KitsuBaddiesERC1155Updated(address oldNft, address newNft);
/// @notice Emitted when admin updates the randomness provider contract
event RandomnessProviderUpdated(address oldProvider, address newProvider);
/// @notice Emitted when owner gifts free spins to a user
event FreeSpinsGranted(address indexed recipient, uint256 amount);
/// @notice Emitted when owner withdraws earnings from the contract
event EarningsWithdrawn(uint256 amount);
/// @notice Emitted when owner updates probability distribution
event ProbabilitiesUpdated(uint256[10] newThresholds);
// ========== Constructor ==========
/**
* @notice Deploy the slot machine with initial configuration
* @param _kitsuBaddiesERC1155 Address of the KitsuBaddiesERC1155 contract.
* @param _randomnessProvider Address of the RandomnessProvider contract (unverified for obfuscation).
*/
constructor(address _kitsuBaddiesERC1155, address _randomnessProvider) Ownable(msg.sender) {
// Set ticket price to 0.001 ether
ticketPrice = 0.001 ether;
// Set the KitsuBaddiesERC1155 contract
if (_kitsuBaddiesERC1155 != address(0)) {
kitsuBaddiesERC1155 = IKitsuBaddiesERC1155(_kitsuBaddiesERC1155);
}
// Set the RandomnessProvider contract
require(_randomnessProvider != address(0), "KITSU_SLOT: RandomnessProvider address cannot be zero");
randomnessProvider = IRandomnessProvider(_randomnessProvider);
// Initialize default probability thresholds (cumulative, out of 1000)
// [140, 280, 420, 560, 635, 710, 785, 800, 815, 1000]
// Results in: 14%, 14%, 14%, 14%, 7.5%, 7.5%, 7.5%, 1.5%, 1.5%, 18.5%
probabilityThresholds[0] = 140; // Collection 1: 14.0%
probabilityThresholds[1] = 280; // Collection 2: 14.0%
probabilityThresholds[2] = 420; // Collection 3: 14.0%
probabilityThresholds[3] = 560; // Collection 4: 14.0%
probabilityThresholds[4] = 635; // Collection 5: 7.5%
probabilityThresholds[5] = 710; // Collection 6: 7.5%
probabilityThresholds[6] = 785; // Collection 7: 7.5%
probabilityThresholds[7] = 800; // Collection 8: 1.5%
probabilityThresholds[8] = 815; // Collection 9: 1.5%
probabilityThresholds[9] = 1000; // Loss (10): 18.5%
}
// ========== Public/External Functions ==========
/**
* @notice This function buys tickets for the player.
* @dev Adds msg.value to the sender's internal balance
* @dev the amount its capped to 100 tickets.
*/
function depositETH() external payable whenNotPaused {
require(msg.value >= ticketPrice, "KITSU_SLOT: You are buying less than 1 ticket.");
require(msg.value <= ticketPrice * 100, "KITSU_SLOT: You are buying too many tickets.");
balances[msg.sender] += msg.value;
emit Deposited(msg.sender, msg.value);
}
// Note: Withdraw function removed - once you buy tickets, you cannot withdraw
// This mimics a real slot machine where you cannot take back inserted coins
/**
* @notice Play a spin: generates 1 random result [1..10] and mints NFT if result is 1-9
* @return result The result [1..10]
* @dev Consumes 1 free spin if available; otherwise deducts ticketPrice from balance.
* Result 1-9 mints an NFT with that collection id.
* Result 10 is a loss - user gets nothing.
* Protected against reentrancy (NFT mint could be external call).
* Can be paused by owner in emergency situations.
*/
function spin() external whenNotPaused nonReentrant returns (uint8 result) {
// Determine payment method
if (freeSpins[msg.sender] > 0) {
// Use a free spin
freeSpins[msg.sender] -= 1;
} else {
// Pay with balance
require(balances[msg.sender] >= ticketPrice, "KITSU_SLOT: Insufficient balance and no free spins");
balances[msg.sender] -= ticketPrice;
}
// Generate 1 random result [1..10]
result = _draw();
bool minted = false;
// Mint NFT only if result is 1-9 (result 10 is a loss)
if (result <= 9) {
require(address(kitsuBaddiesERC1155) != address(0), "KITSU_SLOT: KitsuBaddiesERC1155 contract not configured");
kitsuBaddiesERC1155.mint(uint256(result), msg.sender, "");
minted = true;
totalNFTsMinted++;
}
// else: result is 10, user loses
totalSpins++;
emit Spin(msg.sender, result, minted);
return result;
}
// ========== Admin Functions ==========
/**
* @notice Update the ticket price
* @param newPrice New price per spin in wei (must be > 0)
*/
function setTicketPrice(uint256 newPrice) external onlyOwner {
require(newPrice > 0, "KITSU_SLOT: Ticket price must be > 0");
uint256 oldPrice = ticketPrice;
ticketPrice = newPrice;
emit TicketPriceUpdated(oldPrice, newPrice);
}
/**
* @notice Update the prize NFT contract address
* @param nft Address of the new prize NFT contract
* @dev Cannot be set to address(0) once configured (prevents accidental breaking of game)
*/
function setKitsuBaddiesERC1155(address nft) external onlyOwner {
require(nft != address(0), "KITSU_SLOT: NFT address cannot be zero");
address oldNft = address(kitsuBaddiesERC1155);
kitsuBaddiesERC1155 = IKitsuBaddiesERC1155(nft);
emit KitsuBaddiesERC1155Updated(oldNft, nft);
}
/**
* @notice Update the randomness provider contract address
* @param provider Address of the new RandomnessProvider contract
* @dev Use this to upgrade randomness logic or switch to a different algorithm
* The new contract should remain unverified to maintain obfuscation
*/
function setRandomnessProvider(address provider) external onlyOwner {
require(provider != address(0), "KITSU_SLOT: Provider address cannot be zero");
address oldProvider = address(randomnessProvider);
randomnessProvider = IRandomnessProvider(provider);
emit RandomnessProviderUpdated(oldProvider, provider);
}
/**
* @notice Gift free spins to a user
* @param recipient Address to receive free spins
* @param amount Number of free spins to gift (must be > 0)
* @dev Allows owner to give promotional free spins to users
*/
function grantFreeSpins(address recipient, uint256 amount) external onlyOwner {
require(recipient != address(0), "KITSU_SLOT: Recipient cannot be zero address");
require(amount > 0, "KITSU_SLOT: Amount must be > 0");
freeSpins[recipient] += amount;
emit FreeSpinsGranted(recipient, amount);
}
/**
* @notice Batch gift free spins to multiple users
* @param recipients Array of addresses to receive free spins
* @param amount Number of free spins to gift to each recipient (must be > 0)
* @dev Useful for promotions and airdrops. All recipients get the same amount.
*/
function batchGrantFreeSpins(address[] calldata recipients, uint256 amount) external onlyOwner {
require(amount > 0, "KITSU_SLOT: Amount must be > 0");
require(recipients.length > 0, "KITSU_SLOT: Recipients array is empty");
for (uint256 i = 0; i < recipients.length; i++) {
require(recipients[i] != address(0), "KITSU_SLOT: Recipient cannot be zero address");
freeSpins[recipients[i]] += amount;
emit FreeSpinsGranted(recipients[i], amount);
}
}
/**
* @notice Pause the contract (emergency use only)
* @dev Prevents spins and deposits while paused. Only owner can pause.
*/
function pause() external onlyOwner {
_pause();
}
/**
* @notice Unpause the contract
* @dev Resumes normal operations. Only owner can unpause.
*/
function unpause() external onlyOwner {
_unpause();
}
/**
* @notice Update probability distribution for spin results
* @param newThresholds Array of 10 cumulative probability thresholds (out of 1000)
* @dev Each value must be strictly greater than the previous, and the last must be exactly 1000.
* Example: [140, 280, 420, 560, 635, 710, 785, 800, 815, 1000]
* Results in: 14%, 14%, 14%, 14%, 7.5%, 7.5%, 7.5%, 1.5%, 1.5%, 18.5%
*
* To calculate individual probabilities:
* - Collection 1: newThresholds[0] (e.g., 140 = 14%)
* - Collection 2: newThresholds[1] - newThresholds[0] (e.g., 280-140 = 140 = 14%)
* - Collection N: newThresholds[N-1] - newThresholds[N-2]
*/
function setProbabilities(uint256[10] calldata newThresholds) external onlyOwner {
// Validate that thresholds are strictly increasing
uint256 previous = 0;
for (uint8 i = 0; i < 10; i++) {
require(newThresholds[i] > previous, "KITSU_SLOT: Thresholds must be strictly increasing");
previous = newThresholds[i];
}
// Validate that the last threshold is exactly 1000 (100%)
require(newThresholds[9] == 1000, "KITSU_SLOT: Last threshold must be exactly 1000");
// Update the probability thresholds
for (uint8 i = 0; i < 10; i++) {
probabilityThresholds[i] = newThresholds[i];
}
emit ProbabilitiesUpdated(newThresholds);
}
/**
* @notice Earnings withdrawal of contract balance by owner
* @dev Allows owner to withdraw earnings from the contract
*/
function withdrawEarnings() external onlyOwner nonReentrant {
uint256 amount = address(this).balance;
require(amount > 0, "KITSU_SLOT: No earnings to withdraw");
(bool success, ) = payable(owner()).call{value: amount}("");
require(success, "ETH transfer failed");
}
// ========== Internal Functions ==========
/**
* @notice Generate 1 random result with weighted probabilities
* @return result The result [1..10], where 10 represents a loss
* @dev Uses external RandomnessProvider for obfuscated randomness logic.
* TODO: Replace with Chainlink VRF in phase 2 for production.
*
* Uses dynamic probabilityThresholds array for flexible probability distribution.
* The array contains cumulative thresholds out of 1000.
*/
function _draw() internal returns (uint8 result) {
// Get random number from external provider [0..999]
uint256 roll = randomnessProvider.getRandomForProbability(block.timestamp);
// Map roll to result based on cumulative probability thresholds
for (uint8 i = 0; i < 10; i++) {
if (roll < probabilityThresholds[i]) {
return i + 1; // Return result 1-10
}
}
// Fallback (should never reach here if thresholds are properly configured)
return 10;
}
// ========== View Functions ==========
/**
* @notice Get the total ETH balance held by the contract
* @return Contract's ETH balance in wei
*/
function getContractBalance() external view returns (uint256) {
return address(this).balance;
}
/**
* @notice Get a user's internal balance
* @param user Address to query
* @return User's internal balance in wei
*/
function getBalance(address user) external view returns (uint256) {
return balances[user];
}
/**
* @notice Get a user's free spins count
* @param user Address to query
* @return Number of free spins available
*/
function getFreeSpins(address user) external view returns (uint256) {
return freeSpins[user];
}
/**
* @notice Check if a user can spin
* @param user Address to query
* @return True if user has free spins or sufficient balance to spin
*/
function canSpin(address user) external view returns (bool) {
return freeSpins[user] > 0 || balances[user] >= ticketPrice;
}
/**
* @notice Get individual probabilities for each result (not cumulative)
* @return probs Array of 10 individual probabilities (out of 1000)
* @dev Converts cumulative thresholds to individual probabilities for easier understanding
* Index 0-8 represent collections 1-9, Index 9 represents loss (result 10)
*/
function getIndividualProbabilities() external view returns (uint256[10] memory probs) {
probs[0] = probabilityThresholds[0]; // First threshold is the probability itself
for (uint8 i = 1; i < 10; i++) {
probs[i] = probabilityThresholds[i] - probabilityThresholds[i - 1];
}
return probs;
}
// ========== Receive ETH ==========
/**
* @notice Fallback to receive direct ETH transfers
* @dev Does NOT add to sender's balance (prevents accidental locks)
* Use depositETH() to add to your balance
*/
receive() external payable {
// Accept ETH but don't credit to any balance
// Owner can withdraw via withdrawEarnings if needed
}
}// 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);
}
}// 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;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.3.0) (utils/Pausable.sol)
pragma solidity ^0.8.20;
import {Context} from "../utils/Context.sol";
/**
* @dev Contract module which allows children to implement an emergency stop
* mechanism that can be triggered by an authorized account.
*
* This module is used through inheritance. It will make available the
* modifiers `whenNotPaused` and `whenPaused`, which can be applied to
* the functions of your contract. Note that they will not be pausable by
* simply including this module, only once the modifiers are put in place.
*/
abstract contract Pausable is Context {
bool private _paused;
/**
* @dev Emitted when the pause is triggered by `account`.
*/
event Paused(address account);
/**
* @dev Emitted when the pause is lifted by `account`.
*/
event Unpaused(address account);
/**
* @dev The operation failed because the contract is paused.
*/
error EnforcedPause();
/**
* @dev The operation failed because the contract is not paused.
*/
error ExpectedPause();
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*
* Requirements:
*
* - The contract must not be paused.
*/
modifier whenNotPaused() {
_requireNotPaused();
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*
* Requirements:
*
* - The contract must be paused.
*/
modifier whenPaused() {
_requirePaused();
_;
}
/**
* @dev Returns true if the contract is paused, and false otherwise.
*/
function paused() public view virtual returns (bool) {
return _paused;
}
/**
* @dev Throws if the contract is paused.
*/
function _requireNotPaused() internal view virtual {
if (paused()) {
revert EnforcedPause();
}
}
/**
* @dev Throws if the contract is not paused.
*/
function _requirePaused() internal view virtual {
if (!paused()) {
revert ExpectedPause();
}
}
/**
* @dev Triggers stopped state.
*
* Requirements:
*
* - The contract must not be paused.
*/
function _pause() internal virtual whenNotPaused {
_paused = true;
emit Paused(_msgSender());
}
/**
* @dev Returns to normal state.
*
* Requirements:
*
* - The contract must be paused.
*/
function _unpause() internal virtual whenPaused {
_paused = false;
emit Unpaused(_msgSender());
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/ReentrancyGuard.sol)
pragma solidity ^0.8.20;
/**
* @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 EIP-1153 (transient storage) is available on the chain you're deploying at,
* consider using {ReentrancyGuardTransient} instead.
*
* 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;
/**
* @dev Unauthorized reentrant call.
*/
error ReentrancyGuardReentrantCall();
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
if (_status == ENTERED) {
revert ReentrancyGuardReentrantCall();
}
// 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;
}
/**
* @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
* `nonReentrant` function in the call stack.
*/
function _reentrancyGuardEntered() internal view returns (bool) {
return _status == ENTERED;
}
}{
"optimizer": {
"enabled": true,
"runs": 200
},
"evmVersion": "paris",
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"_kitsuBaddiesERC1155","type":"address"},{"internalType":"address","name":"_randomnessProvider","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"EnforcedPause","type":"error"},{"inputs":[],"name":"ExpectedPause","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"inputs":[],"name":"ReentrancyGuardReentrantCall","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Deposited","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"EarningsWithdrawn","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"FreeSpinsGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldNft","type":"address"},{"indexed":false,"internalType":"address","name":"newNft","type":"address"}],"name":"KitsuBaddiesERC1155Updated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256[10]","name":"newThresholds","type":"uint256[10]"}],"name":"ProbabilitiesUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldProvider","type":"address"},{"indexed":false,"internalType":"address","name":"newProvider","type":"address"}],"name":"RandomnessProviderUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint8","name":"result","type":"uint8"},{"indexed":false,"internalType":"bool","name":"minted","type":"bool"}],"name":"Spin","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"oldPrice","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newPrice","type":"uint256"}],"name":"TicketPriceUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"balances","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"recipients","type":"address[]"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"batchGrantFreeSpins","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"canSpin","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"depositETH","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"freeSpins","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"getBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getContractBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"getFreeSpins","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getIndividualProbabilities","outputs":[{"internalType":"uint256[10]","name":"probs","type":"uint256[10]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"grantFreeSpins","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"kitsuBaddiesERC1155","outputs":[{"internalType":"contract IKitsuBaddiesERC1155","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"probabilityThresholds","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"randomnessProvider","outputs":[{"internalType":"contract IRandomnessProvider","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"nft","type":"address"}],"name":"setKitsuBaddiesERC1155","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[10]","name":"newThresholds","type":"uint256[10]"}],"name":"setProbabilities","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"provider","type":"address"}],"name":"setRandomnessProvider","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newPrice","type":"uint256"}],"name":"setTicketPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"spin","outputs":[{"internalType":"uint8","name":"result","type":"uint8"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"ticketPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalNFTsMinted","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSpins","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawEarnings","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]Contract Creation Code
608060405234801561001057600080fd5b506040516119ba3803806119ba83398101604081905261002f916101e6565b6001600055338061005b57604051631e4fbdf760e01b8152600060048201526024015b60405180910390fd5b61006481610178565b5066038d7ea4c680006004556001600160a01b0382161561009b57600580546001600160a01b0319166001600160a01b0384161790555b6001600160a01b0381166101175760405162461bcd60e51b815260206004820152603560248201527f4b495453555f534c4f543a2052616e646f6d6e65737350726f7669646572206160448201527f6464726573732063616e6e6f74206265207a65726f00000000000000000000006064820152608401610052565b600680546001600160a01b0319166001600160a01b039290921691909117905550608c600955610118600a556101a4600b55610230600c5561027b600d556102c6600e55610311600f5561032060105561032f6011556103e8601255610219565b600180546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b80516001600160a01b03811681146101e157600080fd5b919050565b600080604083850312156101f957600080fd5b610202836101ca565b9150610210602084016101ca565b90509250929050565b611792806102286000396000f3fe6080604052600436106101bb5760003560e01c8063715018a6116100ec578063b79a6cf91161008a578063f2fde38b11610064578063f2fde38b146104e3578063f6326fb314610503578063f8b2cb4f1461050b578063f9691f721461054157600080fd5b8063b79a6cf91461047c578063ce9bf5ac1461049c578063f0acd7d5146104bc57600080fd5b80638da5cb5b116100c65780638da5cb5b14610413578063901b203614610431578063b15fbc1414610447578063b73c6ce91461046757600080fd5b8063715018a6146103c957806372b73ae5146103de5780638456cb59146103fe57600080fd5b80633f4ba83a11610159578063510d140a11610133578063510d140a1461034b5780635c975abb1461036b578063690cdc2d146103965780636f9fb98a146103b657600080fd5b80633f4ba83a146102e857806347e46496146102fd5780634eb7e95f1461033557600080fd5b8063159816501161019557806315981650146102385780631ed5e4fa1461025857806327e235e31461028e578063297d6c32146102bb57600080fd5b8063028b6099146101c7578063061554ac146101f25780631209b1f61461021457600080fd5b366101c257005b600080fd5b3480156101d357600080fd5b506101dc610561565b6040516101e991906114da565b60405180910390f35b3480156101fe57600080fd5b5061021261020d36600461150c565b6105e7565b005b34801561022057600080fd5b5061022a60045481565b6040519081526020016101e9565b34801561024457600080fd5b50610212610253366004611536565b61079f565b34801561026457600080fd5b5061022a61027336600461156b565b6001600160a01b031660009081526003602052604090205490565b34801561029a57600080fd5b5061022a6102a936600461156b565b60026020526000908152604090205481565b3480156102c757600080fd5b5061022a6102d636600461156b565b60036020526000908152604090205481565b3480156102f457600080fd5b50610212610841565b34801561030957600080fd5b5060055461031d906001600160a01b031681565b6040516001600160a01b0390911681526020016101e9565b34801561034157600080fd5b5061022a60085481565b34801561035757600080fd5b5061022a610366366004611536565b610853565b34801561037757600080fd5b50600154600160a01b900460ff165b60405190151581526020016101e9565b3480156103a257600080fd5b506102126103b136600461156b565b61086a565b3480156103c257600080fd5b504761022a565b3480156103d557600080fd5b50610212610931565b3480156103ea57600080fd5b506102126103f936600461158d565b610943565b34801561040a57600080fd5b50610212610b28565b34801561041f57600080fd5b506001546001600160a01b031661031d565b34801561043d57600080fd5b5061022a60075481565b34801561045357600080fd5b5061021261046236600461156b565b610b38565b34801561047357600080fd5b50610212610c04565b34801561048857600080fd5b50610212610497366004611609565b610d24565b3480156104a857600080fd5b5060065461031d906001600160a01b031681565b3480156104c857600080fd5b506104d1610e11565b60405160ff90911681526020016101e9565b3480156104ef57600080fd5b506102126104fe36600461156b565b61109d565b6102126110db565b34801561051757600080fd5b5061022a61052636600461156b565b6001600160a01b031660009081526002602052604090205490565b34801561054d57600080fd5b5061038661055c36600461156b565b611219565b6105696114bb565b600954815260015b600a8160ff1610156105e357600961058a60018361165f565b60ff16600a811061059d5761059d611633565b015460098260ff16600a81106105b5576105b5611633565b01546105c19190611678565b828260ff16600a81106105d6576105d6611633565b6020020152600101610571565b5090565b6105ef61125f565b6000805b600a8160ff1610156106ab5781838260ff16600a811061061557610615611633565b6020020135116106875760405162461bcd60e51b815260206004820152603260248201527f4b495453555f534c4f543a205468726573686f6c6473206d757374206265207360448201527174726963746c7920696e6372656173696e6760701b60648201526084015b60405180910390fd5b828160ff16600a811061069c5761069c611633565b602002013591506001016105f3565b506103e86101208301351461071a5760405162461bcd60e51b815260206004820152602f60248201527f4b495453555f534c4f543a204c617374207468726573686f6c64206d7573742060448201526e062652065786163746c79203130303608c1b606482015260840161067e565b60005b600a8160ff16101561076357828160ff16600a811061073e5761073e611633565b602002013560098260ff16600a811061075957610759611633565b015560010161071d565b507f6f6308ed4ac7cf514b7f81f781278cf799d9844fe5e3c92dda2083d8f8b21e6582604051610793919061168b565b60405180910390a15050565b6107a761125f565b600081116108035760405162461bcd60e51b8152602060048201526024808201527f4b495453555f534c4f543a205469636b6574207072696365206d7573742062656044820152630203e20360e41b606482015260840161067e565b600480549082905560408051828152602081018490527fd4c5e06b1ae097ba02372652a7adaa6e4a8e00be527497a3ad0ebc3f761ef3fb9101610793565b61084961125f565b61085161128c565b565b600981600a811061086357600080fd5b0154905081565b61087261125f565b6001600160a01b0381166108d75760405162461bcd60e51b815260206004820152602660248201527f4b495453555f534c4f543a204e465420616464726573732063616e6e6f74206260448201526565207a65726f60d01b606482015260840161067e565b600580546001600160a01b038381166001600160a01b031983168117909355604080519190921680825260208201939093527fa7fc47375052358d971acd4440a0cd759473a285a9f68f5cdd1436ea5a31c2839101610793565b61093961125f565b61085160006112e1565b61094b61125f565b6000811161099b5760405162461bcd60e51b815260206004820152601e60248201527f4b495453555f534c4f543a20416d6f756e74206d757374206265203e20300000604482015260640161067e565b816109f65760405162461bcd60e51b815260206004820152602560248201527f4b495453555f534c4f543a20526563697069656e747320617272617920697320604482015264656d70747960d81b606482015260840161067e565b60005b82811015610b22576000848483818110610a1557610a15611633565b9050602002016020810190610a2a919061156b565b6001600160a01b031603610a505760405162461bcd60e51b815260040161067e9061169b565b8160036000868685818110610a6757610a67611633565b9050602002016020810190610a7c919061156b565b6001600160a01b03166001600160a01b031681526020019081526020016000206000828254610aab91906116e7565b909155508490508382818110610ac357610ac3611633565b9050602002016020810190610ad8919061156b565b6001600160a01b03167f7db576419bddedf10571daf6c6aa0f87a8bcf9ddd98236889ffd403d6db1ba8883604051610b1291815260200190565b60405180910390a26001016109f9565b50505050565b610b3061125f565b610851611333565b610b4061125f565b6001600160a01b038116610baa5760405162461bcd60e51b815260206004820152602b60248201527f4b495453555f534c4f543a2050726f766964657220616464726573732063616e60448201526a6e6f74206265207a65726f60a81b606482015260840161067e565b600680546001600160a01b038381166001600160a01b031983168117909355604080519190921680825260208201939093527f6505575d19bb1ac7f9778b9eb49c92c7ac7ed5a346e76ff46372d0d21849b9799101610793565b610c0c61125f565b610c14611376565b4780610c6e5760405162461bcd60e51b815260206004820152602360248201527f4b495453555f534c4f543a204e6f206561726e696e677320746f20776974686460448201526272617760e81b606482015260840161067e565b6000610c826001546001600160a01b031690565b6001600160a01b03168260405160006040518083038185875af1925050503d8060008114610ccc576040519150601f19603f3d011682016040523d82523d6000602084013e610cd1565b606091505b5050905080610d185760405162461bcd60e51b8152602060048201526013602482015272115512081d1c985b9cd9995c8819985a5b1959606a1b604482015260640161067e565b50506108516001600055565b610d2c61125f565b6001600160a01b038216610d525760405162461bcd60e51b815260040161067e9061169b565b60008111610da25760405162461bcd60e51b815260206004820152601e60248201527f4b495453555f534c4f543a20416d6f756e74206d757374206265203e20300000604482015260640161067e565b6001600160a01b03821660009081526003602052604081208054839290610dca9084906116e7565b90915550506040518181526001600160a01b038316907f7db576419bddedf10571daf6c6aa0f87a8bcf9ddd98236889ffd403d6db1ba889060200160405180910390a25050565b6000610e1b6113a0565b610e23611376565b3360009081526003602052604090205415610e6357336000908152600360205260408120805460019290610e58908490611678565b90915550610f079050565b600454336000908152600260205260409020541015610edf5760405162461bcd60e51b815260206004820152603260248201527f4b495453555f534c4f543a20496e73756666696369656e742062616c616e636560448201527120616e64206e6f2066726565207370696e7360701b606482015260840161067e565b6004543360009081526002602052604081208054909190610f01908490611678565b90915550505b610f0f6113cb565b9050600060098260ff161161103b576005546001600160a01b0316610f9c5760405162461bcd60e51b815260206004820152603760248201527f4b495453555f534c4f543a204b6974737542616464696573455243313135352060448201527f636f6e7472616374206e6f7420636f6e66696775726564000000000000000000606482015260840161067e565b6005546040516373c0251960e01b815260ff8416600482015233602482015260606044820152600060648201526001600160a01b03909116906373c02519906084016020604051808303816000875af1158015610ffd573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061102191906116fa565b505060088054600191600061103583611713565b91905055505b6007805490600061104b83611713565b90915550506040805160ff84168152821515602082015233917f6ed792210b785921ab2b2410386d20f9a336a6953fa0912683ac30e9507b4a85910160405180910390a25061109a6001600055565b90565b6110a561125f565b6001600160a01b0381166110cf57604051631e4fbdf760e01b81526000600482015260240161067e565b6110d8816112e1565b50565b6110e36113a0565b60045434101561114c5760405162461bcd60e51b815260206004820152602e60248201527f4b495453555f534c4f543a20596f752061726520627579696e67206c6573732060448201526d3a3430b71018903a34b1b5b2ba1760911b606482015260840161067e565b60045461115a90606461172c565b3411156111be5760405162461bcd60e51b815260206004820152602c60248201527f4b495453555f534c4f543a20596f752061726520627579696e6720746f6f206d60448201526b30b73c903a34b1b5b2ba399760a11b606482015260840161067e565b33600090815260026020526040812080543492906111dd9084906116e7565b909155505060405134815233907f2da466a7b24304f47e87fa2e1e5a81b9831ce54fec19055ce277ca2f39ba42c49060200160405180910390a2565b6001600160a01b03811660009081526003602052604081205415158061125957506004546001600160a01b03831660009081526002602052604090205410155b92915050565b6001546001600160a01b031633146108515760405163118cdaa760e01b815233600482015260240161067e565b611294611491565b6001805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b600180546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b61133b6113a0565b6001805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586112c43390565b60026000540361139957604051633ee5aeb560e01b815260040160405180910390fd5b6002600055565b600154600160a01b900460ff16156108515760405163d93c066560e01b815260040160405180910390fd5b6006546040516318bff94560e31b815242600482015260009182916001600160a01b039091169063c5ffca28906024016020604051808303816000875af115801561141a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061143e91906116fa565b905060005b600a8160ff1610156114885760098160ff16600a811061146557611465611633565b015482101561148057611479816001611743565b9250505090565b600101611443565b50600a91505090565b600154600160a01b900460ff1661085157604051638dfc202b60e01b815260040160405180910390fd5b604051806101400160405280600a906020820280368337509192915050565b6101408101818360005b600a8110156115035781518352602092830192909101906001016114e4565b50505092915050565b6000610140828403121561151f57600080fd5b826101408301111561153057600080fd5b50919050565b60006020828403121561154857600080fd5b5035919050565b80356001600160a01b038116811461156657600080fd5b919050565b60006020828403121561157d57600080fd5b6115868261154f565b9392505050565b6000806000604084860312156115a257600080fd5b833567ffffffffffffffff8111156115b957600080fd5b8401601f810186136115ca57600080fd5b803567ffffffffffffffff8111156115e157600080fd5b8660208260051b84010111156115f657600080fd5b6020918201979096509401359392505050565b6000806040838503121561161c57600080fd5b6116258361154f565b946020939093013593505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60ff828116828216039081111561125957611259611649565b8181038181111561125957611259611649565b6101408181019083833792915050565b6020808252602c908201527f4b495453555f534c4f543a20526563697069656e742063616e6e6f742062652060408201526b7a65726f206164647265737360a01b606082015260800190565b8082018082111561125957611259611649565b60006020828403121561170c57600080fd5b5051919050565b60006001820161172557611725611649565b5060010190565b808202811582820484141761125957611259611649565b60ff81811683821601908111156112595761125961164956fea2646970667358221220e913a5ecd3626b5f2431921b97e3ee5737f061e85fc890f322ba34f2a9dcfc7a64736f6c634300081b0033000000000000000000000000a5469b9f8291da3abaa07c253a57537b949626f60000000000000000000000003120aabfdd9c352a3000254aa3408982cb911db8
Deployed Bytecode
0x6080604052600436106101bb5760003560e01c8063715018a6116100ec578063b79a6cf91161008a578063f2fde38b11610064578063f2fde38b146104e3578063f6326fb314610503578063f8b2cb4f1461050b578063f9691f721461054157600080fd5b8063b79a6cf91461047c578063ce9bf5ac1461049c578063f0acd7d5146104bc57600080fd5b80638da5cb5b116100c65780638da5cb5b14610413578063901b203614610431578063b15fbc1414610447578063b73c6ce91461046757600080fd5b8063715018a6146103c957806372b73ae5146103de5780638456cb59146103fe57600080fd5b80633f4ba83a11610159578063510d140a11610133578063510d140a1461034b5780635c975abb1461036b578063690cdc2d146103965780636f9fb98a146103b657600080fd5b80633f4ba83a146102e857806347e46496146102fd5780634eb7e95f1461033557600080fd5b8063159816501161019557806315981650146102385780631ed5e4fa1461025857806327e235e31461028e578063297d6c32146102bb57600080fd5b8063028b6099146101c7578063061554ac146101f25780631209b1f61461021457600080fd5b366101c257005b600080fd5b3480156101d357600080fd5b506101dc610561565b6040516101e991906114da565b60405180910390f35b3480156101fe57600080fd5b5061021261020d36600461150c565b6105e7565b005b34801561022057600080fd5b5061022a60045481565b6040519081526020016101e9565b34801561024457600080fd5b50610212610253366004611536565b61079f565b34801561026457600080fd5b5061022a61027336600461156b565b6001600160a01b031660009081526003602052604090205490565b34801561029a57600080fd5b5061022a6102a936600461156b565b60026020526000908152604090205481565b3480156102c757600080fd5b5061022a6102d636600461156b565b60036020526000908152604090205481565b3480156102f457600080fd5b50610212610841565b34801561030957600080fd5b5060055461031d906001600160a01b031681565b6040516001600160a01b0390911681526020016101e9565b34801561034157600080fd5b5061022a60085481565b34801561035757600080fd5b5061022a610366366004611536565b610853565b34801561037757600080fd5b50600154600160a01b900460ff165b60405190151581526020016101e9565b3480156103a257600080fd5b506102126103b136600461156b565b61086a565b3480156103c257600080fd5b504761022a565b3480156103d557600080fd5b50610212610931565b3480156103ea57600080fd5b506102126103f936600461158d565b610943565b34801561040a57600080fd5b50610212610b28565b34801561041f57600080fd5b506001546001600160a01b031661031d565b34801561043d57600080fd5b5061022a60075481565b34801561045357600080fd5b5061021261046236600461156b565b610b38565b34801561047357600080fd5b50610212610c04565b34801561048857600080fd5b50610212610497366004611609565b610d24565b3480156104a857600080fd5b5060065461031d906001600160a01b031681565b3480156104c857600080fd5b506104d1610e11565b60405160ff90911681526020016101e9565b3480156104ef57600080fd5b506102126104fe36600461156b565b61109d565b6102126110db565b34801561051757600080fd5b5061022a61052636600461156b565b6001600160a01b031660009081526002602052604090205490565b34801561054d57600080fd5b5061038661055c36600461156b565b611219565b6105696114bb565b600954815260015b600a8160ff1610156105e357600961058a60018361165f565b60ff16600a811061059d5761059d611633565b015460098260ff16600a81106105b5576105b5611633565b01546105c19190611678565b828260ff16600a81106105d6576105d6611633565b6020020152600101610571565b5090565b6105ef61125f565b6000805b600a8160ff1610156106ab5781838260ff16600a811061061557610615611633565b6020020135116106875760405162461bcd60e51b815260206004820152603260248201527f4b495453555f534c4f543a205468726573686f6c6473206d757374206265207360448201527174726963746c7920696e6372656173696e6760701b60648201526084015b60405180910390fd5b828160ff16600a811061069c5761069c611633565b602002013591506001016105f3565b506103e86101208301351461071a5760405162461bcd60e51b815260206004820152602f60248201527f4b495453555f534c4f543a204c617374207468726573686f6c64206d7573742060448201526e062652065786163746c79203130303608c1b606482015260840161067e565b60005b600a8160ff16101561076357828160ff16600a811061073e5761073e611633565b602002013560098260ff16600a811061075957610759611633565b015560010161071d565b507f6f6308ed4ac7cf514b7f81f781278cf799d9844fe5e3c92dda2083d8f8b21e6582604051610793919061168b565b60405180910390a15050565b6107a761125f565b600081116108035760405162461bcd60e51b8152602060048201526024808201527f4b495453555f534c4f543a205469636b6574207072696365206d7573742062656044820152630203e20360e41b606482015260840161067e565b600480549082905560408051828152602081018490527fd4c5e06b1ae097ba02372652a7adaa6e4a8e00be527497a3ad0ebc3f761ef3fb9101610793565b61084961125f565b61085161128c565b565b600981600a811061086357600080fd5b0154905081565b61087261125f565b6001600160a01b0381166108d75760405162461bcd60e51b815260206004820152602660248201527f4b495453555f534c4f543a204e465420616464726573732063616e6e6f74206260448201526565207a65726f60d01b606482015260840161067e565b600580546001600160a01b038381166001600160a01b031983168117909355604080519190921680825260208201939093527fa7fc47375052358d971acd4440a0cd759473a285a9f68f5cdd1436ea5a31c2839101610793565b61093961125f565b61085160006112e1565b61094b61125f565b6000811161099b5760405162461bcd60e51b815260206004820152601e60248201527f4b495453555f534c4f543a20416d6f756e74206d757374206265203e20300000604482015260640161067e565b816109f65760405162461bcd60e51b815260206004820152602560248201527f4b495453555f534c4f543a20526563697069656e747320617272617920697320604482015264656d70747960d81b606482015260840161067e565b60005b82811015610b22576000848483818110610a1557610a15611633565b9050602002016020810190610a2a919061156b565b6001600160a01b031603610a505760405162461bcd60e51b815260040161067e9061169b565b8160036000868685818110610a6757610a67611633565b9050602002016020810190610a7c919061156b565b6001600160a01b03166001600160a01b031681526020019081526020016000206000828254610aab91906116e7565b909155508490508382818110610ac357610ac3611633565b9050602002016020810190610ad8919061156b565b6001600160a01b03167f7db576419bddedf10571daf6c6aa0f87a8bcf9ddd98236889ffd403d6db1ba8883604051610b1291815260200190565b60405180910390a26001016109f9565b50505050565b610b3061125f565b610851611333565b610b4061125f565b6001600160a01b038116610baa5760405162461bcd60e51b815260206004820152602b60248201527f4b495453555f534c4f543a2050726f766964657220616464726573732063616e60448201526a6e6f74206265207a65726f60a81b606482015260840161067e565b600680546001600160a01b038381166001600160a01b031983168117909355604080519190921680825260208201939093527f6505575d19bb1ac7f9778b9eb49c92c7ac7ed5a346e76ff46372d0d21849b9799101610793565b610c0c61125f565b610c14611376565b4780610c6e5760405162461bcd60e51b815260206004820152602360248201527f4b495453555f534c4f543a204e6f206561726e696e677320746f20776974686460448201526272617760e81b606482015260840161067e565b6000610c826001546001600160a01b031690565b6001600160a01b03168260405160006040518083038185875af1925050503d8060008114610ccc576040519150601f19603f3d011682016040523d82523d6000602084013e610cd1565b606091505b5050905080610d185760405162461bcd60e51b8152602060048201526013602482015272115512081d1c985b9cd9995c8819985a5b1959606a1b604482015260640161067e565b50506108516001600055565b610d2c61125f565b6001600160a01b038216610d525760405162461bcd60e51b815260040161067e9061169b565b60008111610da25760405162461bcd60e51b815260206004820152601e60248201527f4b495453555f534c4f543a20416d6f756e74206d757374206265203e20300000604482015260640161067e565b6001600160a01b03821660009081526003602052604081208054839290610dca9084906116e7565b90915550506040518181526001600160a01b038316907f7db576419bddedf10571daf6c6aa0f87a8bcf9ddd98236889ffd403d6db1ba889060200160405180910390a25050565b6000610e1b6113a0565b610e23611376565b3360009081526003602052604090205415610e6357336000908152600360205260408120805460019290610e58908490611678565b90915550610f079050565b600454336000908152600260205260409020541015610edf5760405162461bcd60e51b815260206004820152603260248201527f4b495453555f534c4f543a20496e73756666696369656e742062616c616e636560448201527120616e64206e6f2066726565207370696e7360701b606482015260840161067e565b6004543360009081526002602052604081208054909190610f01908490611678565b90915550505b610f0f6113cb565b9050600060098260ff161161103b576005546001600160a01b0316610f9c5760405162461bcd60e51b815260206004820152603760248201527f4b495453555f534c4f543a204b6974737542616464696573455243313135352060448201527f636f6e7472616374206e6f7420636f6e66696775726564000000000000000000606482015260840161067e565b6005546040516373c0251960e01b815260ff8416600482015233602482015260606044820152600060648201526001600160a01b03909116906373c02519906084016020604051808303816000875af1158015610ffd573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061102191906116fa565b505060088054600191600061103583611713565b91905055505b6007805490600061104b83611713565b90915550506040805160ff84168152821515602082015233917f6ed792210b785921ab2b2410386d20f9a336a6953fa0912683ac30e9507b4a85910160405180910390a25061109a6001600055565b90565b6110a561125f565b6001600160a01b0381166110cf57604051631e4fbdf760e01b81526000600482015260240161067e565b6110d8816112e1565b50565b6110e36113a0565b60045434101561114c5760405162461bcd60e51b815260206004820152602e60248201527f4b495453555f534c4f543a20596f752061726520627579696e67206c6573732060448201526d3a3430b71018903a34b1b5b2ba1760911b606482015260840161067e565b60045461115a90606461172c565b3411156111be5760405162461bcd60e51b815260206004820152602c60248201527f4b495453555f534c4f543a20596f752061726520627579696e6720746f6f206d60448201526b30b73c903a34b1b5b2ba399760a11b606482015260840161067e565b33600090815260026020526040812080543492906111dd9084906116e7565b909155505060405134815233907f2da466a7b24304f47e87fa2e1e5a81b9831ce54fec19055ce277ca2f39ba42c49060200160405180910390a2565b6001600160a01b03811660009081526003602052604081205415158061125957506004546001600160a01b03831660009081526002602052604090205410155b92915050565b6001546001600160a01b031633146108515760405163118cdaa760e01b815233600482015260240161067e565b611294611491565b6001805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b600180546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b61133b6113a0565b6001805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586112c43390565b60026000540361139957604051633ee5aeb560e01b815260040160405180910390fd5b6002600055565b600154600160a01b900460ff16156108515760405163d93c066560e01b815260040160405180910390fd5b6006546040516318bff94560e31b815242600482015260009182916001600160a01b039091169063c5ffca28906024016020604051808303816000875af115801561141a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061143e91906116fa565b905060005b600a8160ff1610156114885760098160ff16600a811061146557611465611633565b015482101561148057611479816001611743565b9250505090565b600101611443565b50600a91505090565b600154600160a01b900460ff1661085157604051638dfc202b60e01b815260040160405180910390fd5b604051806101400160405280600a906020820280368337509192915050565b6101408101818360005b600a8110156115035781518352602092830192909101906001016114e4565b50505092915050565b6000610140828403121561151f57600080fd5b826101408301111561153057600080fd5b50919050565b60006020828403121561154857600080fd5b5035919050565b80356001600160a01b038116811461156657600080fd5b919050565b60006020828403121561157d57600080fd5b6115868261154f565b9392505050565b6000806000604084860312156115a257600080fd5b833567ffffffffffffffff8111156115b957600080fd5b8401601f810186136115ca57600080fd5b803567ffffffffffffffff8111156115e157600080fd5b8660208260051b84010111156115f657600080fd5b6020918201979096509401359392505050565b6000806040838503121561161c57600080fd5b6116258361154f565b946020939093013593505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60ff828116828216039081111561125957611259611649565b8181038181111561125957611259611649565b6101408181019083833792915050565b6020808252602c908201527f4b495453555f534c4f543a20526563697069656e742063616e6e6f742062652060408201526b7a65726f206164647265737360a01b606082015260800190565b8082018082111561125957611259611649565b60006020828403121561170c57600080fd5b5051919050565b60006001820161172557611725611649565b5060010190565b808202811582820484141761125957611259611649565b60ff81811683821601908111156112595761125961164956fea2646970667358221220e913a5ecd3626b5f2431921b97e3ee5737f061e85fc890f322ba34f2a9dcfc7a64736f6c634300081b0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000a5469b9f8291da3abaa07c253a57537b949626f60000000000000000000000003120aabfdd9c352a3000254aa3408982cb911db8
-----Decoded View---------------
Arg [0] : _kitsuBaddiesERC1155 (address): 0xA5469b9F8291DA3AbaA07C253a57537B949626f6
Arg [1] : _randomnessProvider (address): 0x3120aAbfdd9C352a3000254aA3408982CB911dB8
-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 000000000000000000000000a5469b9f8291da3abaa07c253a57537b949626f6
Arg [1] : 0000000000000000000000003120aabfdd9c352a3000254aa3408982cb911db8
Multichain Portfolio | 35 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.