More Info
Private Name Tags
ContractCreator
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Loading...
Loading
Similar Match Source Code This contract matches the deployed Bytecode of the Source Code for Contract 0x21E6C4db...dAa61A2A1 The constructor portion of the code might be different and could alter the actual behaviour of the contract
Contract Name:
Ruglette
Compiler Version
v0.8.24+commit.e11b9ed9
Optimization Enabled:
Yes with 1000 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
1234567891011121314151617181920212223242526// SPDX-License-Identifier: MITpragma solidity 0.8.24;import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";import {ReentrancyGuard} from "@openzeppelin/contracts/utils/ReentrancyGuard.sol";import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";// Local importsimport {IRugletteSync} from "../Interfaces/IRugletteSync.sol";import {RugletteLobby} from "../Structs/RugletteLobby.sol";import {RNGLib} from "../Utils/RNGLib.sol";contract Ruglette is ReentrancyGuard {using SafeERC20 for IERC20;// Prevent an address from joining more than oncemapping(address => bool) public addressLock;// Beneficiary addressaddress public beneficiary;// List of usersaddress[] public userEntries;// Number of people to payoutuint256 public winners;// All data for PoolRugletteLobby internal gameData;// Contract synchronizes pool eventsaddress public rugletteSync;
1234567891011121314151617181920212223242526// SPDX-License-Identifier: MIT// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/IERC1363.sol)pragma solidity ^0.8.20;import {IERC20} from "./IERC20.sol";import {IERC165} from "./IERC165.sol";/*** @title IERC1363* @dev Interface of the ERC-1363 standard as defined in the https://eips.ethereum.org/EIPS/eip-1363[ERC-1363].** Defines an extension interface for ERC-20 tokens that supports executing code on a recipient contract* after `transfer` or `transferFrom`, or code on a spender contract after `approve`, in a single transaction.*/interface IERC1363 is IERC20, IERC165 {/** Note: the ERC-165 identifier for this interface is 0xb0202a11.* 0xb0202a11 ===* bytes4(keccak256('transferAndCall(address,uint256)')) ^* bytes4(keccak256('transferAndCall(address,uint256,bytes)')) ^* bytes4(keccak256('transferFromAndCall(address,address,uint256)')) ^* bytes4(keccak256('transferFromAndCall(address,address,uint256,bytes)')) ^* bytes4(keccak256('approveAndCall(address,uint256)')) ^* bytes4(keccak256('approveAndCall(address,uint256,bytes)'))*/
123456// SPDX-License-Identifier: MIT// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC165.sol)pragma solidity ^0.8.20;import {IERC165} from "../utils/introspection/IERC165.sol";
123456// SPDX-License-Identifier: MIT// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC20.sol)pragma solidity ^0.8.20;import {IERC20} from "../token/ERC20/IERC20.sol";
1234567891011121314151617181920212223242526// SPDX-License-Identifier: MIT// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/IERC20.sol)pragma solidity ^0.8.20;/*** @dev Interface of the ERC-20 standard as defined in the ERC.*/interface IERC20 {/*** @dev Emitted when `value` tokens are moved from one account (`from`) to* another (`to`).** Note that `value` may be zero.*/event Transfer(address indexed from, address indexed to, uint256 value);/*** @dev Emitted when the allowance of a `spender` for an `owner` is set by* a call to {approve}. `value` is the new allowance.*/event Approval(address indexed owner, address indexed spender, uint256 value);/*** @dev Returns the value of tokens in existence.*/
1234567891011121314151617181920212223242526// SPDX-License-Identifier: MIT// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/utils/SafeERC20.sol)pragma solidity ^0.8.20;import {IERC20} from "../IERC20.sol";import {IERC1363} from "../../../interfaces/IERC1363.sol";import {Address} from "../../../utils/Address.sol";/*** @title SafeERC20* @dev Wrappers around ERC-20 operations that throw on failure (when the token* contract returns false). Tokens that return no value (and instead revert or* throw on failure) are also supported, non-reverting calls are assumed to be* successful.* To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.*/library SafeERC20 {/*** @dev An operation with an ERC-20 token failed.*/error SafeERC20FailedOperation(address token);/*** @dev Indicates a failed `decreaseAllowance` request.
1234567891011121314151617181920212223242526// SPDX-License-Identifier: MIT// OpenZeppelin Contracts (last updated v5.1.0) (utils/Address.sol)pragma solidity ^0.8.20;import {Errors} from "./Errors.sol";/*** @dev Collection of functions related to the address type*/library Address {/*** @dev There's no code at `target` (it is not a contract).*/error AddressEmptyCode(address target);/*** @dev Replacement for Solidity's `transfer`: sends `amount` wei to* `recipient`, forwarding all available gas and reverting on errors.** https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost* of certain opcodes, possibly making contracts go over the 2300 gas limit* imposed by `transfer`, making them unable to receive funds via* `transfer`. {sendValue} removes this limitation.** https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].
1234567891011121314151617181920212223242526// SPDX-License-Identifier: MIT// OpenZeppelin Contracts (last updated v5.1.0) (utils/Errors.sol)pragma solidity ^0.8.20;/*** @dev Collection of common custom errors used in multiple contracts** IMPORTANT: Backwards compatibility is not guaranteed in future versions of the library.* It is recommended to avoid relying on the error API for critical functionality.** _Available since v5.1._*/library Errors {/*** @dev The ETH balance of the account is not enough to perform the operation.*/error InsufficientBalance(uint256 balance, uint256 needed);/*** @dev A call to an address target failed. The target may have reverted.*/error FailedCall();/*** @dev The deployment failed.
12345678910111213141516171819202122232425// SPDX-License-Identifier: MIT// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/IERC165.sol)pragma solidity ^0.8.20;/*** @dev Interface of the ERC-165 standard, as defined in the* https://eips.ethereum.org/EIPS/eip-165[ERC].** 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[ERC 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);}
1234567891011121314151617181920212223242526// 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
123456789101112131415161718192021// SPDX-License-Identifier: MITpragma solidity 0.8.24;interface IRugletteSync {function lobbyEntry(address pool, address minter) external;function newLobby(address pool, uint256 id, address token, address creator) external;function entryFees(address pool, uint256 protocolFee) external;function results(address pool, address[] memory losers, uint256 prizeShare) external;function updatedFees(uint256 creationFee, uint256 percentageFee) external;function updatedRanges(uint16[2] memory entries, uint16[2] memory losers) external;function whitelistedToken(address token, bool status) external;function updateWhitelist(address[] memory addressList, bool action) external;}
12345678910111213141516171819202122// SPDX-License-Identifier: MITpragma solidity 0.8.24;struct RugletteLobby {uint256 id;// Maximum Number of entries.uint256 maxEntries;// Token usedaddress token;// Cost per Ticketuint256 price;// Ticket Sale Endsuint256 end;// How many losers in the gameuint256 loserCount;// Selected Losersaddress[] losers;// Protocol Percentuint256 protocolPercent;// Game creatoraddress creator;}
1234567891011121314151617181920212223242526// SPDX-License-Identifier: MITpragma solidity ^0.8.0;/*** @title RNGLib* @dev Library providing a simple interface to manage a* contract-internal PRNG and pull random numbers from it.*/library RNGLib {/// @dev Structure to hold the state of the random number generator (RNG).struct RNGState {bytes32 seed;uint256 counter;}/// @notice Seed a new RNG based on value from a public randomness beacon./// @dev To ensure domain separation, at least one of randomness, chain id, current contract/// address, or the domain string must be different between two different RNGs./// @param randomness The value from a public randomness beacon./// @param domain A string that contributes to domain separation./// @return st The initialized RNGState struct.function makeRNG(uint256 randomness,string memory domain) internal view returns (RNGState memory st) {st.seed = keccak256(
1234567891011121314151617181920{"optimizer": {"enabled": true,"runs": 1000},"evmVersion": "paris","outputSelection": {"*": {"*": ["evm.bytecode","evm.deployedBytecode","devdoc","userdoc","metadata","abi"]}},"libraries": {}}
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"components":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"maxEntries","type":"uint256"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint256","name":"end","type":"uint256"},{"internalType":"uint256","name":"loserCount","type":"uint256"},{"internalType":"address[]","name":"losers","type":"address[]"},{"internalType":"uint256","name":"protocolPercent","type":"uint256"},{"internalType":"address","name":"creator","type":"address"}],"internalType":"struct RugletteLobby","name":"newGame","type":"tuple"},{"internalType":"address","name":"benef","type":"address"},{"internalType":"address","name":"sync","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AlreadyEntered","type":"error"},{"inputs":[],"name":"ERC20Error","type":"error"},{"inputs":[],"name":"GameOver","type":"error"},{"inputs":[],"name":"InvalidEntryQuantity","type":"error"},{"inputs":[],"name":"NotEnoughExGens","type":"error"},{"inputs":[],"name":"NotEnoughOpenSpots","type":"error"},{"inputs":[],"name":"NotEnoughTokens","type":"error"},{"inputs":[],"name":"NotExpiredYet","type":"error"},{"inputs":[],"name":"ReentrancyGuardReentrantCall","type":"error"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"addressLock","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"beneficiary","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"buyEntry","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"gameOver","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getgameData","outputs":[{"components":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"maxEntries","type":"uint256"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint256","name":"end","type":"uint256"},{"internalType":"uint256","name":"loserCount","type":"uint256"},{"internalType":"address[]","name":"losers","type":"address[]"},{"internalType":"uint256","name":"protocolPercent","type":"uint256"},{"internalType":"address","name":"creator","type":"address"}],"internalType":"struct RugletteLobby","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"exgen","type":"uint256[]"}],"name":"rugPool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rugletteSync","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"userEntries","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"winners","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100a35760003560e01c806338af3eed11610076578063a487bcd81161005b578063a487bcd814610130578063bdb337d114610147578063e83e03301461016b57600080fd5b806338af3eed1461010a578063396a9e5d1461011d57600080fd5b8063152b1f7c146100a85780631f84ff41146100d8578063215e1138146100eb57806335c13f3014610100575b600080fd5b6100bb6100b6366004610e3e565b61018e565b6040516001600160a01b0390911681526020015b60405180910390f35b600e546100bb906001600160a01b031681565b6100f36101b8565b6040516100cf9190610e9c565b6101086102e0565b005b6002546100bb906001600160a01b031681565b61010861012b366004610f31565b610507565b61013960045481565b6040519081526020016100cf565b600e5461015b90600160a01b900460ff1681565b60405190151581526020016100cf565b61015b610179366004610fa6565b60016020526000908152604090205460ff1681565b6003818154811061019e57600080fd5b6000918252602090912001546001600160a01b0316905081565b610219604051806101200160405280600081526020016000815260200160006001600160a01b03168152602001600081526020016000815260200160008152602001606081526020016000815260200160006001600160a01b031681525090565b60408051610120810182526005805482526006546020808401919091526007546001600160a01b03168385015260085460608401526009546080840152600a5460a0840152600b80548551818402810184019096528086529394929360c0860193928301828280156102b457602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610296575b5050509183525050600782015460208201526008909101546001600160a01b0316604090910152919050565b6102e8610967565b3360009081526001602052604090205460ff1615610332576040517f7863668300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600654600354610343906001610fe5565b111561037b576040517fbda98fc800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6003805460018082019092557fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b01805473ffffffffffffffffffffffffffffffffffffffff19163390811790915560008181526020839052604090819020805460ff191690931790925560075460085492517f23b872dd000000000000000000000000000000000000000000000000000000008152600481019290925230602483015260448201929092526001600160a01b03909116906323b872dd906064016020604051808303816000875af115801561045a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061047e9190610ffe565b50600e546040517f57b8f1870000000000000000000000000000000000000000000000000000000081523060048201523360248201526001600160a01b03909116906357b8f18790604401600060405180830381600087803b1580156104e357600080fd5b505af11580156104f7573d6000803e3d6000fd5b505050506105056001600055565b565b61050f610967565b600654600354101561055757600954421015610557576040517fa8058ea900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600e54600160a01b900460ff161561059b576040517fdf469ccb00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600a548110156105d7576040517f7051d14d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600354600a541061061557600354600a546006546000926105f99290916109aa565b9050806000036106115761060b6109ec565b50610959565b600a555b600a5460035460009161062791611020565b60045560005b600a548110156107445761068e84848381811061064c5761064c611033565b905060200201356003805490506005600301544260405160200161067a929190918252602082015260400190565b604051602081830303815290604052610bc2565b91506005600601600383815481106106a8576106a8611033565b60009182526020808320909101548354600181018555938352908220909201805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0390931692909217909155600380548490811061070657610706611033565b6000918252602090912001805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b039290921691909117905560010161062d565b50600e805460ff60a01b1916600160a01b179055610760610bee565b600480546007546040516370a0823160e01b815230938101939093526000926001600160a01b03909116906370a0823190602401602060405180830381865afa1580156107b1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107d59190611049565b6107df9190611078565b600e54604051630c537b5760e11b81529192506001600160a01b0316906318a6f6ae90610815903090600b90869060040161108c565b600060405180830381600087803b15801561082f57600080fd5b505af1158015610843573d6000803e3d6000fd5b5050505060005b6003548110156109555760006001600160a01b03166003828154811061087257610872611033565b6000918252602090912001546001600160a01b03161461094d57600754600380546001600160a01b039092169163a9059cbb9190849081106108b6576108b6611033565b60009182526020909120015460405160e083901b7fffffffff000000000000000000000000000000000000000000000000000000001681526001600160a01b039091166004820152602481018590526044016020604051808303816000875af1158015610927573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061094b9190610ffe565b505b60010161084a565b5050505b6109636001600055565b5050565b6002600054036109a3576040517f3ee5aeb500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6002600055565b60008315806109b7575082155b806109c0575081155b156109cd575060006109e5565b816109d884866110f7565b6109e29190611078565b90505b9392505050565b6003546007546040516370a0823160e01b815230600482015260609260009290916001600160a01b03909116906370a0823190602401602060405180830381865afa158015610a3f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a639190611049565b610a6d9190611078565b600e54604051630c537b5760e11b81529192506001600160a01b0316906318a6f6ae90610aa29030908690869060040161110e565b600060405180830381600087803b158015610abc57600080fd5b505af1158015610ad0573d6000803e3d6000fd5b5050600e805460ff60a01b1916600160a01b17905550600090505b600354811015610bbd57600754600380546001600160a01b039092169163a9059cbb919084908110610b1f57610b1f611033565b60009182526020909120015460405160e083901b7fffffffff000000000000000000000000000000000000000000000000000000001681526001600160a01b039091166004820152602481018590526044016020604051808303816000875af1158015610b90573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bb49190610ffe565b50600101610aeb565b505050565b600080610bcf8584610da2565b905083610bdb82610df3565b610be5919061115d565b95945050505050565b6007546040516370a0823160e01b815230600482015260009182916001600160a01b03909116906370a0823190602401602060405180830381865afa158015610c3b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c5f9190611049565b600c5490915015610d2157600c54670de0b6b3a764000090610c8190836110f7565b610c8b9190611078565b6007546002546040517fa9059cbb0000000000000000000000000000000000000000000000000000000081526001600160a01b03918216600482015260248101849052929450169063a9059cbb906044016020604051808303816000875af1158015610cfb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d1f9190610ffe565b505b600e546040517fb6219aa1000000000000000000000000000000000000000000000000000000008152306004820152602481018490526001600160a01b039091169063b6219aa190604401600060405180830381600087803b158015610d8657600080fd5b505af1158015610d9a573d6000803e3d6000fd5b505050505050565b604080518082019091526000808252602082015282463084604051602001610dcd9493929190611171565b60408051601f198184030181529190528051602091820120825260009082015292915050565b600081600001518260200151604051602001610e19929190918252602082015260400190565b60408051601f1981840301815291905280516020918201209201805160010190525090565b600060208284031215610e5057600080fd5b5035919050565b60008151808452602080850194506020840160005b83811015610e915781516001600160a01b031687529582019590820190600101610e6c565b509495945050505050565b60208152815160208201526020820151604082015260006040830151610ecd60608401826001600160a01b03169052565b5060608301516080830152608083015160a083015260a083015160c083015260c08301516101208060e0850152610f08610140850183610e57565b60e086015161010086810191909152909501516001600160a01b03169301929092525090919050565b60008060208385031215610f4457600080fd5b823567ffffffffffffffff80821115610f5c57600080fd5b818501915085601f830112610f7057600080fd5b813581811115610f7f57600080fd5b8660208260051b8501011115610f9457600080fd5b60209290920196919550909350505050565b600060208284031215610fb857600080fd5b81356001600160a01b03811681146109e557600080fd5b634e487b7160e01b600052601160045260246000fd5b80820180821115610ff857610ff8610fcf565b92915050565b60006020828403121561101057600080fd5b815180151581146109e557600080fd5b81810381811115610ff857610ff8610fcf565b634e487b7160e01b600052603260045260246000fd5b60006020828403121561105b57600080fd5b5051919050565b634e487b7160e01b600052601260045260246000fd5b60008261108757611087611062565b500490565b6000606082016001600160a01b038087168452602060606020860152828754808552608087019150886000526020600020945060005b818110156110e05785548516835260019586019592840192016110c2565b505080945050505050826040830152949350505050565b8082028115828204841417610ff857610ff8610fcf565b6000606082016001600160a01b03808716845260206060602086015282875180855260808701915060208901945060005b818110156110e057855185168352948301949183019160010161113f565b60008261116c5761116c611062565b500690565b848152600060208560208401526bffffffffffffffffffffffff198560601b166040840152835160005b818110156111b75785810183015185820160540152820161119b565b506000930160540192835250909594505050505056fea2646970667358221220f2c8242c4c9d6dc0e5aff436c43f14f195b11dbaa2a4401e3409a2fc25da0e2364736f6c63430008180033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 34 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
Loading...
Loading
[ 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.