Source Code
Overview
S Balance
Token Holdings
More Info
ContractCreator
Latest 10 from a total of 10 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Rug Pool | 25527286 | 13 hrs ago | IN | 0 S | 0.00052292 | ||||
Rug Pool | 25525795 | 13 hrs ago | IN | 0 S | 0.00037 | ||||
Rug Pool | 25525671 | 13 hrs ago | IN | 0 S | 0.00037 | ||||
Rug Pool | 25517947 | 14 hrs ago | IN | 0 S | 0.00037 | ||||
Rug Pool | 25515164 | 14 hrs ago | IN | 0 S | 0.0003698 | ||||
Rug Pool | 25514903 | 14 hrs ago | IN | 0 S | 0.00037 | ||||
Rug Pool | 25514309 | 15 hrs ago | IN | 0 S | 0.00037 | ||||
Buy Entry | 25514281 | 15 hrs ago | IN | 0 S | 0.00011637 | ||||
Buy Entry | 25514241 | 15 hrs ago | IN | 0 S | 0.00011637 | ||||
Buy Entry | 25514203 | 15 hrs ago | IN | 0 S | 0.00016377 |
Latest 25 internal transactions (View All)
Parent Transaction Hash | Block | From | To | |||
---|---|---|---|---|---|---|
25527286 | 13 hrs ago | 0 S | ||||
25527286 | 13 hrs ago | 0 S | ||||
25527286 | 13 hrs ago | 0 S | ||||
25525795 | 13 hrs ago | 0 S | ||||
25525795 | 13 hrs ago | 0 S | ||||
25525795 | 13 hrs ago | 0 S | ||||
25525671 | 13 hrs ago | 0 S | ||||
25525671 | 13 hrs ago | 0 S | ||||
25525671 | 13 hrs ago | 0 S | ||||
25517947 | 14 hrs ago | 0 S | ||||
25517947 | 14 hrs ago | 0 S | ||||
25517947 | 14 hrs ago | 0 S | ||||
25515164 | 14 hrs ago | 0 S | ||||
25515164 | 14 hrs ago | 0 S | ||||
25515164 | 14 hrs ago | 0 S | ||||
25514903 | 14 hrs ago | 0 S | ||||
25514903 | 14 hrs ago | 0 S | ||||
25514903 | 14 hrs ago | 0 S | ||||
25514309 | 15 hrs ago | 0 S | ||||
25514309 | 15 hrs ago | 0 S | ||||
25514309 | 15 hrs ago | 0 S | ||||
25514281 | 15 hrs ago | 0 S | ||||
25514281 | 15 hrs ago | 0 S | ||||
25514241 | 15 hrs ago | 0 S | ||||
25514241 | 15 hrs ago | 0 S |
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
NFTRaffle
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)
// SPDX-License-Identifier: MIT pragma solidity 0.8.24; import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import {IERC1155} from "@openzeppelin/contracts/token/ERC1155/IERC1155.sol"; import {IERC721} from "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import {ReentrancyGuard} from "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; // Local imports import {INTERFACE_ERC721, INTERFACE_ERC1155} from "../Constants/ERCInterfaces.sol"; import {INFTRaffleSync} from "../Interfaces/INFTRaffleSync.sol"; import {NFTRaffleLobby} from "../Structs/NFTRaffleLobby.sol"; import {NFTReceiver} from "../Utils/NFTReceiver.sol"; import {RNGLib} from "../Utils/RNGLib.sol"; contract NFTRaffle is ReentrancyGuard, NFTReceiver { using SafeERC20 for IERC20; // Beneficiary address address public beneficiary; // List of users address[] public userEntries; // All data for Pool NFTRaffleLobby internal gameData; // Contract synchronizes pool events address public rugletteSync; // Pool Completed Flag bool public gameOver; // Custom Errors error AlreadyEntered(); error InvalidEntryQuantity(); error NotEnoughOpenSpots(); error NotEnoughTokens(); error NotExpiredYet(); error GameOver(); constructor(NFTRaffleLobby memory gameLaunch, address benef, address sync) { // Storing Pool Data gameData = gameLaunch; beneficiary = benef; rugletteSync = sync; } /// @notice Buy entries into game /// @param quantity How many entries to buy function buyEntry(uint256 quantity) external nonReentrant() { uint256 total = userEntries.length + quantity; if(total > gameData.maxEntries) { revert NotEnoughOpenSpots(); } for(uint256 i; i < quantity; i++) { userEntries.push(msg.sender); INFTRaffleSync(rugletteSync).lobbyEntry(address(this), msg.sender); } total = quantity * gameData.price; IERC20(gameData.token).transferFrom(msg.sender, address(this), total); } /// @notice Sometimes gameData() doesn't get recognized by frontends, this helps function getGameData() external view returns(NFTRaffleLobby memory) { return gameData; } /// @notice Use Gelato RNG library to determine rugger /// @param exgen ex gen function rugPool(uint256 exgen) external nonReentrant { if(userEntries.length < gameData.maxEntries) { if(gameData.end > block.timestamp) { revert NotExpiredYet(); } } if(gameOver) { revert GameOver(); } if(gameData.threshold > 0 && userEntries.length < gameData.threshold) { refund(); return; } uint256 lucky; // CALL RNG 0 - totalSupply lucky = RNGLib.revealRugger(exgen, userEntries.length, string(abi.encodePacked(gameData.price, block.timestamp))); INFTRaffleSync(rugletteSync).results(address(this), userEntries[lucky], lucky); gameData.winner = userEntries[lucky]; // Rug the Pool gameOver = true; processPayments(); if(gameData.winner != address(0)) { transferCollateral(address(this), gameData.winner, gameData.nftPrize, gameData.nftID); } } /// @notice Process the payment distribution between Protocol and Creator function processPayments() internal { uint256 _protocolFee; uint256 gameBalance; // Prevent Divide by 0 if protocol fees are off if(gameData.protocolPercent > 0) { // Protocol Fee gameBalance = IERC20(gameData.token).balanceOf(address(this)); _protocolFee = gameBalance * gameData.protocolPercent / 1e18; IERC20(gameData.token).transferFrom(msg.sender, beneficiary, _protocolFee); } // Creator Share gameBalance = IERC20(gameData.token).balanceOf(address(this)); IERC20(gameData.token).transfer(gameData.creator, gameBalance); INFTRaffleSync(rugletteSync).entryFees(address(this), _protocolFee, gameBalance); } function verifyCustody(address nft, uint256 tokenId) public view returns(bool inCustody) { // Check if interface supports 721 standard if(IERC721(nft).supportsInterface(INTERFACE_ERC721)) { address custodian = IERC721(nft).ownerOf(tokenId); if(address(this) == custodian) { return true;} } // Check if interface supports 1155 standard if(IERC1155(nft).supportsInterface(INTERFACE_ERC1155)) { if(IERC1155(nft).balanceOf(address(this), tokenId) > 0){ return true; } } else return false; } // Refund everyone if threshold insurance is purchase, and not met. function refund() internal { gameOver = true; // Refund NFT to creator transferCollateral(address(this), gameData.creator, gameData.nftPrize, gameData.nftID); // Refund all entrants for(uint256 i; i < userEntries.length; i++) { IERC20(gameData.token).transfer(userEntries[i], gameData.price); } } /// @notice Transfers ERC721 or ERC115 standard tokens /// @param sender Who is sending the Token /// @param receiver Who will receive the Token /// @param nft NFT Token Address /// @param tokenId NFT Token Id function transferCollateral( address sender, address receiver, address nft, uint256 tokenId) internal { // Check if interface supports 721 standard if(IERC721(nft).supportsInterface(INTERFACE_ERC721)) { IERC721(nft).safeTransferFrom(sender, receiver, tokenId); return; } // Check if interface supports 1155 standard if(IERC1155(nft).supportsInterface(INTERFACE_ERC1155)) { IERC1155(nft).safeTransferFrom(sender, receiver, tokenId, 1, ""); } } }
// 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)')) */ /** * @dev Moves a `value` amount of tokens from the caller's account to `to` * and then calls {IERC1363Receiver-onTransferReceived} on `to`. * @param to The address which you want to transfer to. * @param value The amount of tokens to be transferred. * @return A boolean value indicating whether the operation succeeded unless throwing. */ function transferAndCall(address to, uint256 value) external returns (bool); /** * @dev Moves a `value` amount of tokens from the caller's account to `to` * and then calls {IERC1363Receiver-onTransferReceived} on `to`. * @param to The address which you want to transfer to. * @param value The amount of tokens to be transferred. * @param data Additional data with no specified format, sent in call to `to`. * @return A boolean value indicating whether the operation succeeded unless throwing. */ function transferAndCall(address to, uint256 value, bytes calldata data) external returns (bool); /** * @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism * and then calls {IERC1363Receiver-onTransferReceived} on `to`. * @param from The address which you want to send tokens from. * @param to The address which you want to transfer to. * @param value The amount of tokens to be transferred. * @return A boolean value indicating whether the operation succeeded unless throwing. */ function transferFromAndCall(address from, address to, uint256 value) external returns (bool); /** * @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism * and then calls {IERC1363Receiver-onTransferReceived} on `to`. * @param from The address which you want to send tokens from. * @param to The address which you want to transfer to. * @param value The amount of tokens to be transferred. * @param data Additional data with no specified format, sent in call to `to`. * @return A boolean value indicating whether the operation succeeded unless throwing. */ function transferFromAndCall(address from, address to, uint256 value, bytes calldata data) external returns (bool); /** * @dev Sets a `value` amount of tokens as the allowance of `spender` over the * caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`. * @param spender The address which will spend the funds. * @param value The amount of tokens to be spent. * @return A boolean value indicating whether the operation succeeded unless throwing. */ function approveAndCall(address spender, uint256 value) external returns (bool); /** * @dev Sets a `value` amount of tokens as the allowance of `spender` over the * caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`. * @param spender The address which will spend the funds. * @param value The amount of tokens to be spent. * @param data Additional data with no specified format, sent in call to `spender`. * @return A boolean value indicating whether the operation succeeded unless throwing. */ function approveAndCall(address spender, uint256 value, bytes calldata data) external returns (bool); }
// 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";
// 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";
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (token/ERC1155/IERC1155.sol) pragma solidity ^0.8.20; import {IERC165} from "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC-1155 compliant contract, as defined in the * https://eips.ethereum.org/EIPS/eip-1155[ERC]. */ interface IERC1155 is IERC165 { /** * @dev Emitted when `value` amount of tokens of type `id` are transferred from `from` to `to` by `operator`. */ event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value); /** * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all * transfers. */ event TransferBatch( address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values ); /** * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to * `approved`. */ event ApprovalForAll(address indexed account, address indexed operator, bool approved); /** * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI. * * If an {URI} event was emitted for `id`, the standard * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value * returned by {IERC1155MetadataURI-uri}. */ event URI(string value, uint256 indexed id); /** * @dev Returns the value of tokens of token type `id` owned by `account`. */ function balanceOf(address account, uint256 id) external view returns (uint256); /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}. * * Requirements: * * - `accounts` and `ids` must have the same length. */ function balanceOfBatch( address[] calldata accounts, uint256[] calldata ids ) external view returns (uint256[] memory); /** * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`, * * Emits an {ApprovalForAll} event. * * Requirements: * * - `operator` cannot be the zero address. */ function setApprovalForAll(address operator, bool approved) external; /** * @dev Returns true if `operator` is approved to transfer ``account``'s tokens. * * See {setApprovalForAll}. */ function isApprovedForAll(address account, address operator) external view returns (bool); /** * @dev Transfers a `value` amount of tokens of type `id` from `from` to `to`. * * WARNING: This function can potentially allow a reentrancy attack when transferring tokens * to an untrusted contract, when invoking {onERC1155Received} on the receiver. * Ensure to follow the checks-effects-interactions pattern and consider employing * reentrancy guards when interacting with untrusted contracts. * * Emits a {TransferSingle} event. * * Requirements: * * - `to` cannot be the zero address. * - If the caller is not `from`, it must have been approved to spend ``from``'s tokens via {setApprovalForAll}. * - `from` must have a balance of tokens of type `id` of at least `value` amount. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the * acceptance magic value. */ function safeTransferFrom(address from, address to, uint256 id, uint256 value, bytes calldata data) external; /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}. * * WARNING: This function can potentially allow a reentrancy attack when transferring tokens * to an untrusted contract, when invoking {onERC1155BatchReceived} on the receiver. * Ensure to follow the checks-effects-interactions pattern and consider employing * reentrancy guards when interacting with untrusted contracts. * * Emits either a {TransferSingle} or a {TransferBatch} event, depending on the length of the array arguments. * * Requirements: * * - `ids` and `values` must have the same length. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the * acceptance magic value. */ function safeBatchTransferFrom( address from, address to, uint256[] calldata ids, uint256[] calldata values, bytes calldata data ) external; }
// 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. */ function totalSupply() external view returns (uint256); /** * @dev Returns the value of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves a `value` amount of tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 value) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets a `value` amount of tokens as the allowance of `spender` over the * caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 value) external returns (bool); /** * @dev Moves a `value` amount of tokens from `from` to `to` using the * allowance mechanism. `value` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address from, address to, uint256 value) external returns (bool); }
// 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. */ error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease); /** * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value, * non-reverting calls are assumed to be successful. */ function safeTransfer(IERC20 token, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value))); } /** * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful. */ function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value))); } /** * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value, * non-reverting calls are assumed to be successful. * * IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the "client" * smart contract uses ERC-7674 to set temporary allowances, then the "client" smart contract should avoid using * this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract * that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior. */ function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 oldAllowance = token.allowance(address(this), spender); forceApprove(token, spender, oldAllowance + value); } /** * @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no * value, non-reverting calls are assumed to be successful. * * IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the "client" * smart contract uses ERC-7674 to set temporary allowances, then the "client" smart contract should avoid using * this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract * that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior. */ function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal { unchecked { uint256 currentAllowance = token.allowance(address(this), spender); if (currentAllowance < requestedDecrease) { revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease); } forceApprove(token, spender, currentAllowance - requestedDecrease); } } /** * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value, * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval * to be set to zero before setting it to a non-zero value, such as USDT. * * NOTE: If the token implements ERC-7674, this function will not modify any temporary allowance. This function * only sets the "standard" allowance. Any temporary allowance will remain active, in addition to the value being * set here. */ function forceApprove(IERC20 token, address spender, uint256 value) internal { bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value)); if (!_callOptionalReturnBool(token, approvalCall)) { _callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0))); _callOptionalReturn(token, approvalCall); } } /** * @dev Performs an {ERC1363} transferAndCall, with a fallback to the simple {ERC20} transfer if the target has no * code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when * targeting contracts. * * Reverts if the returned value is other than `true`. */ function transferAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal { if (to.code.length == 0) { safeTransfer(token, to, value); } else if (!token.transferAndCall(to, value, data)) { revert SafeERC20FailedOperation(address(token)); } } /** * @dev Performs an {ERC1363} transferFromAndCall, with a fallback to the simple {ERC20} transferFrom if the target * has no code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when * targeting contracts. * * Reverts if the returned value is other than `true`. */ function transferFromAndCallRelaxed( IERC1363 token, address from, address to, uint256 value, bytes memory data ) internal { if (to.code.length == 0) { safeTransferFrom(token, from, to, value); } else if (!token.transferFromAndCall(from, to, value, data)) { revert SafeERC20FailedOperation(address(token)); } } /** * @dev Performs an {ERC1363} approveAndCall, with a fallback to the simple {ERC20} approve if the target has no * code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when * targeting contracts. * * NOTE: When the recipient address (`to`) has no code (i.e. is an EOA), this function behaves as {forceApprove}. * Opposedly, when the recipient address (`to`) has code, this function only attempts to call {ERC1363-approveAndCall} * once without retrying, and relies on the returned value to be true. * * Reverts if the returned value is other than `true`. */ function approveAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal { if (to.code.length == 0) { forceApprove(token, to, value); } else if (!token.approveAndCall(to, value, data)) { revert SafeERC20FailedOperation(address(token)); } } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). * * This is a variant of {_callOptionalReturnBool} that reverts if call fails to meet the requirements. */ function _callOptionalReturn(IERC20 token, bytes memory data) private { uint256 returnSize; uint256 returnValue; assembly ("memory-safe") { let success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20) // bubble errors if iszero(success) { let ptr := mload(0x40) returndatacopy(ptr, 0, returndatasize()) revert(ptr, returndatasize()) } returnSize := returndatasize() returnValue := mload(0) } if (returnSize == 0 ? address(token).code.length == 0 : returnValue != 1) { revert SafeERC20FailedOperation(address(token)); } } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). * * This is a variant of {_callOptionalReturn} that silently catches all reverts and returns a bool instead. */ function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) { bool success; uint256 returnSize; uint256 returnValue; assembly ("memory-safe") { success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20) returnSize := returndatasize() returnValue := mload(0) } return success && (returnSize == 0 ? address(token).code.length > 0 : returnValue == 1); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/IERC721.sol) pragma solidity ^0.8.20; import {IERC165} from "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC-721 compliant contract. */ interface IERC721 is IERC165 { /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon * a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external; /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC-721 protocol to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or * {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon * a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom(address from, address to, uint256 tokenId) external; /** * @dev Transfers `tokenId` token from `from` to `to`. * * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC-721 * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must * understand this adds an external call which potentially creates a reentrancy vulnerability. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom(address from, address to, uint256 tokenId) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the address zero. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool approved) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view returns (bool); }
// SPDX-License-Identifier: MIT // 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]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { if (address(this).balance < amount) { revert Errors.InsufficientBalance(address(this).balance, amount); } (bool success, ) = recipient.call{value: amount}(""); if (!success) { revert Errors.FailedCall(); } } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason or custom error, it is bubbled * up by this function (like regular Solidity function calls). However, if * the call reverted with no returned reason, this function reverts with a * {Errors.FailedCall} error. * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { if (address(this).balance < value) { revert Errors.InsufficientBalance(address(this).balance, value); } (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, success, returndata); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResultFromTarget(target, success, returndata); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target * was not a contract or bubbling up the revert reason (falling back to {Errors.FailedCall}) in case * of an unsuccessful call. */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata ) internal view returns (bytes memory) { if (!success) { _revert(returndata); } else { // only check if target is a contract if the call was successful and the return data is empty // otherwise we already know that it was a contract if (returndata.length == 0 && target.code.length == 0) { revert AddressEmptyCode(target); } return returndata; } } /** * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the * revert reason or with a default {Errors.FailedCall} error. */ function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) { if (!success) { _revert(returndata); } else { return returndata; } } /** * @dev Reverts with returndata if present. Otherwise reverts with {Errors.FailedCall}. */ function _revert(bytes memory returndata) private pure { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly assembly ("memory-safe") { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert Errors.FailedCall(); } } }
// 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. */ error FailedDeployment(); /** * @dev A necessary precompile is missing. */ error MissingPrecompile(address); }
// 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); }
// 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; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.24; bytes4 constant INTERFACE_ERC1155 = 0xd9b67a26; bytes4 constant INTERFACE_ERC721 = 0x80ac58cd;
// SPDX-License-Identifier: MIT pragma solidity 0.8.24; interface INFTRaffleSync { function lobbyEntry(address pool, address minter) external; function newLobby(address pool, uint256 id, address token, address nftPrize) external; function entryFees(address pool, uint256 protocolFee, uint256 creatorFee) external; function results(address pool, address rugger, uint256 prizeShare) external; function updatedFees(uint256 creationFee, uint256 protocolFee, uint256 thresholdFee) external; function updatedRanges(uint16[2] memory entries) external; function updateWhitelist(address[] memory addressList, bool action) external; }
// SPDX-License-Identifier: MIT pragma solidity 0.8.24; struct NFTRaffleLobby { uint256 id; // Maximum Number of entries. uint256 maxEntries; // Token used address token; // NFT address address nftPrize; // NFT ID uint256 nftID; // Cost per Ticket uint256 price; // Ticket Sale Ends uint256 end; // Threshold insurance uint256 threshold; // Selected winner address winner; // Protocol Percent uint256 protocolPercent; // Creator Address address creator; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.24; abstract contract NFTReceiver { function onERC721Received( address, address, uint256, bytes calldata ) external pure returns (bytes4) { return this.onERC721Received.selector; } // required function to allow receiving ERC-1155 function onERC1155Received( address, address, uint256, uint256, bytes calldata ) external pure returns(bytes4) { return bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)")); } }
// SPDX-License-Identifier: MIT pragma 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( abi.encodePacked(randomness, block.chainid, address(this), domain) ); st.counter = 0; } /// @notice Generate a distinct, uniformly distributed number, and advance the RNG. /// @param st The RNGState struct representing the state of the RNG. /// @return random A distinct, uniformly distributed number. function randomUint256( RNGState memory st ) internal pure returns (uint256 random) { random = uint256(keccak256(abi.encodePacked(st.seed, st.counter))); unchecked { // It's not possible to call random enough times to overflow st.counter++; } } /// @notice Generate a distinct, uniformly distributed number less than max, and advance the RNG /// @dev Max is limited to uint224 to ensure modulo bias probability is negligible. /// @param st The RNGState struct representing the state of the RNG. /// @param max The upper limit for the generated random number (exclusive). /// @return A distinct, uniformly distributed number less than max. function randomUintLessThan( RNGState memory st, uint224 max ) internal pure returns (uint224) { return uint224(randomUint256(st) % max); } /// @dev Custom function that will return the rugger number using gelato RNGLib /// @param rand1 random value to help RNG, this case it's pool ID which will be difrerent every pool /// @param rand2 random value to help RNG, this case it's totalMinted which can be different every pool /// @param rand3 string made up of multiple random values to help with RNG function revealRugger(uint256 rand1, uint256 rand2, string memory rand3) internal view returns(uint256 rugger) { RNGState memory rng = makeRNG(rand1 + rand2, rand3); rugger = RNGLib.randomUint256(rng) % rand2; } }
{ "optimizer": { "enabled": true, "runs": 1000 }, "evmVersion": "paris", "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract ABI
API[{"inputs":[{"components":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"maxEntries","type":"uint256"},{"internalType":"address","name":"token","type":"address"},{"internalType":"address","name":"nftPrize","type":"address"},{"internalType":"uint256","name":"nftID","type":"uint256"},{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint256","name":"end","type":"uint256"},{"internalType":"uint256","name":"threshold","type":"uint256"},{"internalType":"address","name":"winner","type":"address"},{"internalType":"uint256","name":"protocolPercent","type":"uint256"},{"internalType":"address","name":"creator","type":"address"}],"internalType":"struct NFTRaffleLobby","name":"gameLaunch","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":"GameOver","type":"error"},{"inputs":[],"name":"InvalidEntryQuantity","type":"error"},{"inputs":[],"name":"NotEnoughOpenSpots","type":"error"},{"inputs":[],"name":"NotEnoughTokens","type":"error"},{"inputs":[],"name":"NotExpiredYet","type":"error"},{"inputs":[],"name":"ReentrancyGuardReentrantCall","type":"error"},{"inputs":[],"name":"beneficiary","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"quantity","type":"uint256"}],"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":"address","name":"nftPrize","type":"address"},{"internalType":"uint256","name":"nftID","type":"uint256"},{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint256","name":"end","type":"uint256"},{"internalType":"uint256","name":"threshold","type":"uint256"},{"internalType":"address","name":"winner","type":"address"},{"internalType":"uint256","name":"protocolPercent","type":"uint256"},{"internalType":"address","name":"creator","type":"address"}],"internalType":"struct NFTRaffleLobby","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC1155Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"pure","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":[{"internalType":"address","name":"nft","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"verifyCustody","outputs":[{"internalType":"bool","name":"inCustody","type":"bool"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
60806040523480156200001157600080fd5b50604051620016a6380380620016a6833981016040819052620000349162000148565b60016000819055835160035560208401516004556040840151600580546001600160a01b03199081166001600160a01b03938416179091556060860151600680548316918416919091179055608086015160075560a086015160085560c086015160095560e0860151600a55610100860151600b80548316918416919091179055610120860151600c5561014090950151600d8054871691831691909117905581548516938116939093179055600e8054909316911617905562000239565b60405161016081016001600160401b03811182821017156200012557634e487b7160e01b600052604160045260246000fd5b60405290565b80516001600160a01b03811681146200014357600080fd5b919050565b60008060008385036101a08112156200016057600080fd5b610160808212156200017157600080fd5b6200017b620000f3565b9150855182526020860151602083015262000199604087016200012b565b6040830152620001ac606087016200012b565b60608301526080860151608083015260a086015160a083015260c086015160c083015260e086015160e0830152610100620001e98188016200012b565b908301526101208681015190830152610140620002088188016200012b565b81840152508194506200021d8187016200012b565b935050506200023061018085016200012b565b90509250925092565b61145d80620002496000396000f3fe608060405234801561001057600080fd5b50600436106100be5760003560e01c8063767d59af11610076578063af4e99de1161005b578063af4e99de146101cd578063bdb337d1146101e2578063f23a6e61146101f657600080fd5b8063767d59af14610197578063a0251aa9146101aa57600080fd5b8063152b1f7c116100a7578063152b1f7c146101465780631f84ff411461017157806338af3eed1461018457600080fd5b806303de7b12146100c3578063150b7a02146100d8575b600080fd5b6100d66100d136600461108e565b61022f565b005b6101106100e6366004611105565b7f150b7a020000000000000000000000000000000000000000000000000000000095945050505050565b6040517fffffffff0000000000000000000000000000000000000000000000000000000090911681526020015b60405180910390f35b61015961015436600461108e565b610489565b6040516001600160a01b03909116815260200161013d565b600e54610159906001600160a01b031681565b600154610159906001600160a01b031681565b6100d66101a536600461108e565b6104b3565b6101bd6101b8366004611178565b610686565b604051901515815260200161013d565b6101d56108ba565b60405161013d91906111a4565b600e546101bd90600160a01b900460ff1681565b61011061020436600461125c565b7ff23a6e612e1ff4830e658fe43f4e3cb4a5f8170bd5d9e69fb5d7a7fa9e4fdf979695505050505050565b6102376109b6565b600454600254101561027f5760095442101561027f576040517fa8058ea900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600e54600160a01b900460ff16156102c3576040517fdf469ccb00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600a54158015906102d75750600a54600254105b156102e9576102e46109f9565b61047c565b60025460085460405160009261032792859261031391904290602001918252602082015260400190565b604051602081830303815290604052610b05565b600e54600280549293506001600160a01b03909116916339f2884891309185908110610355576103556112d8565b60009182526020909120015460405160e084901b7fffffffff000000000000000000000000000000000000000000000000000000001681526001600160a01b0392831660048201529116602482015260448101849052606401600060405180830381600087803b1580156103c857600080fd5b505af11580156103dc573d6000803e3d6000fd5b50505050600281815481106103f3576103f36112d8565b600091825260209091200154600b805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03909216919091179055600e805460ff60a01b1916600160a01b179055610446610b3a565b600b546001600160a01b03161561047a57600b5460065460075461047a9230926001600160a01b0391821692911690610de3565b505b6104866001600055565b50565b6002818154811061049957600080fd5b6000918252602090912001546001600160a01b0316905081565b6104bb6109b6565b6002546000906104cc908390611304565b60045490915081111561050b576040517fbda98fc800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b828110156105f057600280546001810182556000919091527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace01805473ffffffffffffffffffffffffffffffffffffffff191633908117909155600e546040517f57b8f18700000000000000000000000000000000000000000000000000000000815230600482015260248101929092526001600160a01b0316906357b8f18790604401600060405180830381600087803b1580156105cc57600080fd5b505af11580156105e0573d6000803e3d6000fd5b50506001909201915061050e9050565b506008546105fe9083611317565b6005546040516323b872dd60e01b8152336004820152306024820152604481018390529192506001600160a01b0316906323b872dd906064016020604051808303816000875af1158015610656573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061067a919061132e565b50506104866001600055565b6040516301ffc9a760e01b81526380ac58cd60e01b60048201526000906001600160a01b038416906301ffc9a790602401602060405180830381865afa1580156106d4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106f8919061132e565b156107a0576040517f6352211e000000000000000000000000000000000000000000000000000000008152600481018390526000906001600160a01b03851690636352211e90602401602060405180830381865afa15801561075e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107829190611357565b90506001600160a01b038116300361079e5760019150506108b4565b505b6040516301ffc9a760e01b8152636cdb3d1360e11b60048201526001600160a01b038416906301ffc9a790602401602060405180830381865afa1580156107eb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061080f919061132e565b156108b0576040517efdd58e000000000000000000000000000000000000000000000000000000008152306004820152602481018390526000906001600160a01b0385169062fdd58e90604401602060405180830381865afa158015610879573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061089d9190611374565b11156108ab575060016108b4565b6108b4565b5060005b92915050565b61093b604051806101600160405280600081526020016000815260200160006001600160a01b0316815260200160006001600160a01b031681526020016000815260200160008152602001600081526020016000815260200160006001600160a01b031681526020016000815260200160006001600160a01b031681525090565b506040805161016081018252600354815260045460208201526005546001600160a01b039081169282019290925260065482166060820152600754608082015260085460a082015260095460c0820152600a5460e0820152600b548216610100820152600c54610120820152600d5490911661014082015290565b6002600054036109f2576040517f3ee5aeb500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6002600055565b600e805460ff60a01b1916600160a01b179055600d54600654600754610a2f9230926001600160a01b0391821692911690610de3565b60005b60025481101561048657600554600280546001600160a01b039092169163a9059cbb919084908110610a6657610a666112d8565b60009182526020909120015460085460405160e084901b7fffffffff000000000000000000000000000000000000000000000000000000001681526001600160a01b03909216600483015260248201526044016020604051808303816000875af1158015610ad8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610afc919061132e565b50600101610a32565b600080610b1b610b158587611304565b84610ff2565b905083610b2782611043565b610b3191906113a3565b95945050505050565b600c54600090819015610c5a576005546040516370a0823160e01b81523060048201526001600160a01b03909116906370a0823190602401602060405180830381865afa158015610b8f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bb39190611374565b600c54909150670de0b6b3a764000090610bcd9083611317565b610bd791906113b7565b6005546001546040516323b872dd60e01b81523360048201526001600160a01b0391821660248201526044810184905292945016906323b872dd906064016020604051808303816000875af1158015610c34573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c58919061132e565b505b6005546040516370a0823160e01b81523060048201526001600160a01b03909116906370a0823190602401602060405180830381865afa158015610ca2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cc69190611374565b600554600d546040517fa9059cbb0000000000000000000000000000000000000000000000000000000081526001600160a01b03918216600482015260248101849052929350169063a9059cbb906044016020604051808303816000875af1158015610d36573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d5a919061132e565b50600e546040517f413fa17a00000000000000000000000000000000000000000000000000000000815230600482015260248101849052604481018390526001600160a01b039091169063413fa17a90606401600060405180830381600087803b158015610dc757600080fd5b505af1158015610ddb573d6000803e3d6000fd5b505050505050565b6040516301ffc9a760e01b81526380ac58cd60e01b60048201526001600160a01b038316906301ffc9a790602401602060405180830381865afa158015610e2e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e52919061132e565b15610edf576040517f42842e0e0000000000000000000000000000000000000000000000000000000081526001600160a01b0385811660048301528481166024830152604482018390528316906342842e0e90606401600060405180830381600087803b158015610ec257600080fd5b505af1158015610ed6573d6000803e3d6000fd5b50505050610fec565b6040516301ffc9a760e01b8152636cdb3d1360e11b60048201526001600160a01b038316906301ffc9a790602401602060405180830381865afa158015610f2a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f4e919061132e565b15610fec576040517ff242432a0000000000000000000000000000000000000000000000000000000081526001600160a01b0385811660048301528481166024830152604482018390526001606483015260a06084830152600060a483015283169063f242432a9060c401600060405180830381600087803b158015610fd357600080fd5b505af1158015610fe7573d6000803e3d6000fd5b505050505b50505050565b60408051808201909152600080825260208201528246308460405160200161101d94939291906113cb565b60408051601f198184030181529190528051602091820120825260009082015292915050565b600081600001518260200151604051602001611069929190918252602082015260400190565b60408051601f1981840301815291905280516020918201209201805160010190525090565b6000602082840312156110a057600080fd5b5035919050565b6001600160a01b038116811461048657600080fd5b60008083601f8401126110ce57600080fd5b50813567ffffffffffffffff8111156110e657600080fd5b6020830191508360208285010111156110fe57600080fd5b9250929050565b60008060008060006080868803121561111d57600080fd5b8535611128816110a7565b94506020860135611138816110a7565b935060408601359250606086013567ffffffffffffffff81111561115b57600080fd5b611167888289016110bc565b969995985093965092949392505050565b6000806040838503121561118b57600080fd5b8235611196816110a7565b946020939093013593505050565b600061016082019050825182526020830151602083015260408301516111d560408401826001600160a01b03169052565b5060608301516111f060608401826001600160a01b03169052565b506080830151608083015260a083015160a083015260c083015160c083015260e083015160e083015261010080840151611234828501826001600160a01b03169052565b50506101208381015190830152610140928301516001600160a01b0316929091019190915290565b60008060008060008060a0878903121561127557600080fd5b8635611280816110a7565b95506020870135611290816110a7565b94506040870135935060608701359250608087013567ffffffffffffffff8111156112ba57600080fd5b6112c689828a016110bc565b979a9699509497509295939492505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808201808211156108b4576108b46112ee565b80820281158282048414176108b4576108b46112ee565b60006020828403121561134057600080fd5b8151801515811461135057600080fd5b9392505050565b60006020828403121561136957600080fd5b8151611350816110a7565b60006020828403121561138657600080fd5b5051919050565b634e487b7160e01b600052601260045260246000fd5b6000826113b2576113b261138d565b500690565b6000826113c6576113c661138d565b500490565b848152600060208560208401526bffffffffffffffffffffffff198560601b166040840152835160005b81811015611411578581018301518582016054015282016113f5565b506000930160540192835250909594505050505056fea2646970667358221220807ad78d46df3d50dee76a4e5c0012d1bca86baac7213091b48613fbcd27e84464736f6c634300081800330000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000300000000000000000000000045af2dbe0b0e4d6c334ceea73c990f4e4a362ca60000000000000000000000005a7058b91eb93f54adc106719116d17e9ac37eba000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010f0cf064dd592000000000000000000000000000000000000000000000000000000000000067d64cc000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006a94d74f430000000000000000000000000000c40ee6d87dcbaf8ae332876af20d7cb97b4143cd0000000000000000000000003235164f2f5627b2606cebbd8065c8a419955c6d00000000000000000000000021c7444ddfad748b40bac662a89080a7455e056b
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100be5760003560e01c8063767d59af11610076578063af4e99de1161005b578063af4e99de146101cd578063bdb337d1146101e2578063f23a6e61146101f657600080fd5b8063767d59af14610197578063a0251aa9146101aa57600080fd5b8063152b1f7c116100a7578063152b1f7c146101465780631f84ff411461017157806338af3eed1461018457600080fd5b806303de7b12146100c3578063150b7a02146100d8575b600080fd5b6100d66100d136600461108e565b61022f565b005b6101106100e6366004611105565b7f150b7a020000000000000000000000000000000000000000000000000000000095945050505050565b6040517fffffffff0000000000000000000000000000000000000000000000000000000090911681526020015b60405180910390f35b61015961015436600461108e565b610489565b6040516001600160a01b03909116815260200161013d565b600e54610159906001600160a01b031681565b600154610159906001600160a01b031681565b6100d66101a536600461108e565b6104b3565b6101bd6101b8366004611178565b610686565b604051901515815260200161013d565b6101d56108ba565b60405161013d91906111a4565b600e546101bd90600160a01b900460ff1681565b61011061020436600461125c565b7ff23a6e612e1ff4830e658fe43f4e3cb4a5f8170bd5d9e69fb5d7a7fa9e4fdf979695505050505050565b6102376109b6565b600454600254101561027f5760095442101561027f576040517fa8058ea900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600e54600160a01b900460ff16156102c3576040517fdf469ccb00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600a54158015906102d75750600a54600254105b156102e9576102e46109f9565b61047c565b60025460085460405160009261032792859261031391904290602001918252602082015260400190565b604051602081830303815290604052610b05565b600e54600280549293506001600160a01b03909116916339f2884891309185908110610355576103556112d8565b60009182526020909120015460405160e084901b7fffffffff000000000000000000000000000000000000000000000000000000001681526001600160a01b0392831660048201529116602482015260448101849052606401600060405180830381600087803b1580156103c857600080fd5b505af11580156103dc573d6000803e3d6000fd5b50505050600281815481106103f3576103f36112d8565b600091825260209091200154600b805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03909216919091179055600e805460ff60a01b1916600160a01b179055610446610b3a565b600b546001600160a01b03161561047a57600b5460065460075461047a9230926001600160a01b0391821692911690610de3565b505b6104866001600055565b50565b6002818154811061049957600080fd5b6000918252602090912001546001600160a01b0316905081565b6104bb6109b6565b6002546000906104cc908390611304565b60045490915081111561050b576040517fbda98fc800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b828110156105f057600280546001810182556000919091527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace01805473ffffffffffffffffffffffffffffffffffffffff191633908117909155600e546040517f57b8f18700000000000000000000000000000000000000000000000000000000815230600482015260248101929092526001600160a01b0316906357b8f18790604401600060405180830381600087803b1580156105cc57600080fd5b505af11580156105e0573d6000803e3d6000fd5b50506001909201915061050e9050565b506008546105fe9083611317565b6005546040516323b872dd60e01b8152336004820152306024820152604481018390529192506001600160a01b0316906323b872dd906064016020604051808303816000875af1158015610656573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061067a919061132e565b50506104866001600055565b6040516301ffc9a760e01b81526380ac58cd60e01b60048201526000906001600160a01b038416906301ffc9a790602401602060405180830381865afa1580156106d4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106f8919061132e565b156107a0576040517f6352211e000000000000000000000000000000000000000000000000000000008152600481018390526000906001600160a01b03851690636352211e90602401602060405180830381865afa15801561075e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107829190611357565b90506001600160a01b038116300361079e5760019150506108b4565b505b6040516301ffc9a760e01b8152636cdb3d1360e11b60048201526001600160a01b038416906301ffc9a790602401602060405180830381865afa1580156107eb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061080f919061132e565b156108b0576040517efdd58e000000000000000000000000000000000000000000000000000000008152306004820152602481018390526000906001600160a01b0385169062fdd58e90604401602060405180830381865afa158015610879573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061089d9190611374565b11156108ab575060016108b4565b6108b4565b5060005b92915050565b61093b604051806101600160405280600081526020016000815260200160006001600160a01b0316815260200160006001600160a01b031681526020016000815260200160008152602001600081526020016000815260200160006001600160a01b031681526020016000815260200160006001600160a01b031681525090565b506040805161016081018252600354815260045460208201526005546001600160a01b039081169282019290925260065482166060820152600754608082015260085460a082015260095460c0820152600a5460e0820152600b548216610100820152600c54610120820152600d5490911661014082015290565b6002600054036109f2576040517f3ee5aeb500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6002600055565b600e805460ff60a01b1916600160a01b179055600d54600654600754610a2f9230926001600160a01b0391821692911690610de3565b60005b60025481101561048657600554600280546001600160a01b039092169163a9059cbb919084908110610a6657610a666112d8565b60009182526020909120015460085460405160e084901b7fffffffff000000000000000000000000000000000000000000000000000000001681526001600160a01b03909216600483015260248201526044016020604051808303816000875af1158015610ad8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610afc919061132e565b50600101610a32565b600080610b1b610b158587611304565b84610ff2565b905083610b2782611043565b610b3191906113a3565b95945050505050565b600c54600090819015610c5a576005546040516370a0823160e01b81523060048201526001600160a01b03909116906370a0823190602401602060405180830381865afa158015610b8f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bb39190611374565b600c54909150670de0b6b3a764000090610bcd9083611317565b610bd791906113b7565b6005546001546040516323b872dd60e01b81523360048201526001600160a01b0391821660248201526044810184905292945016906323b872dd906064016020604051808303816000875af1158015610c34573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c58919061132e565b505b6005546040516370a0823160e01b81523060048201526001600160a01b03909116906370a0823190602401602060405180830381865afa158015610ca2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cc69190611374565b600554600d546040517fa9059cbb0000000000000000000000000000000000000000000000000000000081526001600160a01b03918216600482015260248101849052929350169063a9059cbb906044016020604051808303816000875af1158015610d36573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d5a919061132e565b50600e546040517f413fa17a00000000000000000000000000000000000000000000000000000000815230600482015260248101849052604481018390526001600160a01b039091169063413fa17a90606401600060405180830381600087803b158015610dc757600080fd5b505af1158015610ddb573d6000803e3d6000fd5b505050505050565b6040516301ffc9a760e01b81526380ac58cd60e01b60048201526001600160a01b038316906301ffc9a790602401602060405180830381865afa158015610e2e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e52919061132e565b15610edf576040517f42842e0e0000000000000000000000000000000000000000000000000000000081526001600160a01b0385811660048301528481166024830152604482018390528316906342842e0e90606401600060405180830381600087803b158015610ec257600080fd5b505af1158015610ed6573d6000803e3d6000fd5b50505050610fec565b6040516301ffc9a760e01b8152636cdb3d1360e11b60048201526001600160a01b038316906301ffc9a790602401602060405180830381865afa158015610f2a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f4e919061132e565b15610fec576040517ff242432a0000000000000000000000000000000000000000000000000000000081526001600160a01b0385811660048301528481166024830152604482018390526001606483015260a06084830152600060a483015283169063f242432a9060c401600060405180830381600087803b158015610fd357600080fd5b505af1158015610fe7573d6000803e3d6000fd5b505050505b50505050565b60408051808201909152600080825260208201528246308460405160200161101d94939291906113cb565b60408051601f198184030181529190528051602091820120825260009082015292915050565b600081600001518260200151604051602001611069929190918252602082015260400190565b60408051601f1981840301815291905280516020918201209201805160010190525090565b6000602082840312156110a057600080fd5b5035919050565b6001600160a01b038116811461048657600080fd5b60008083601f8401126110ce57600080fd5b50813567ffffffffffffffff8111156110e657600080fd5b6020830191508360208285010111156110fe57600080fd5b9250929050565b60008060008060006080868803121561111d57600080fd5b8535611128816110a7565b94506020860135611138816110a7565b935060408601359250606086013567ffffffffffffffff81111561115b57600080fd5b611167888289016110bc565b969995985093965092949392505050565b6000806040838503121561118b57600080fd5b8235611196816110a7565b946020939093013593505050565b600061016082019050825182526020830151602083015260408301516111d560408401826001600160a01b03169052565b5060608301516111f060608401826001600160a01b03169052565b506080830151608083015260a083015160a083015260c083015160c083015260e083015160e083015261010080840151611234828501826001600160a01b03169052565b50506101208381015190830152610140928301516001600160a01b0316929091019190915290565b60008060008060008060a0878903121561127557600080fd5b8635611280816110a7565b95506020870135611290816110a7565b94506040870135935060608701359250608087013567ffffffffffffffff8111156112ba57600080fd5b6112c689828a016110bc565b979a9699509497509295939492505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808201808211156108b4576108b46112ee565b80820281158282048414176108b4576108b46112ee565b60006020828403121561134057600080fd5b8151801515811461135057600080fd5b9392505050565b60006020828403121561136957600080fd5b8151611350816110a7565b60006020828403121561138657600080fd5b5051919050565b634e487b7160e01b600052601260045260246000fd5b6000826113b2576113b261138d565b500690565b6000826113c6576113c661138d565b500490565b848152600060208560208401526bffffffffffffffffffffffff198560601b166040840152835160005b81811015611411578581018301518582016054015282016113f5565b506000930160540192835250909594505050505056fea2646970667358221220807ad78d46df3d50dee76a4e5c0012d1bca86baac7213091b48613fbcd27e84464736f6c63430008180033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000300000000000000000000000045af2dbe0b0e4d6c334ceea73c990f4e4a362ca60000000000000000000000005a7058b91eb93f54adc106719116d17e9ac37eba000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010f0cf064dd592000000000000000000000000000000000000000000000000000000000000067d64cc000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006a94d74f430000000000000000000000000000c40ee6d87dcbaf8ae332876af20d7cb97b4143cd0000000000000000000000003235164f2f5627b2606cebbd8065c8a419955c6d00000000000000000000000021c7444ddfad748b40bac662a89080a7455e056b
-----Decoded View---------------
Arg [0] : gameLaunch (tuple): System.Collections.Generic.List`1[Nethereum.ABI.FunctionEncoding.ParameterOutput]
Arg [1] : benef (address): 0x3235164f2F5627b2606CeBbd8065C8A419955C6D
Arg [2] : sync (address): 0x21C7444ddfAD748B40baC662A89080a7455E056B
-----Encoded View---------------
13 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000003
Arg [2] : 00000000000000000000000045af2dbe0b0e4d6c334ceea73c990f4e4a362ca6
Arg [3] : 0000000000000000000000005a7058b91eb93f54adc106719116d17e9ac37eba
Arg [4] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [5] : 00000000000000000000000000000000000000000000010f0cf064dd59200000
Arg [6] : 0000000000000000000000000000000000000000000000000000000067d64cc0
Arg [7] : 0000000000000000000000000000000000000000000000000000000000000002
Arg [8] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [9] : 000000000000000000000000000000000000000000000000006a94d74f430000
Arg [10] : 000000000000000000000000c40ee6d87dcbaf8ae332876af20d7cb97b4143cd
Arg [11] : 0000000000000000000000003235164f2f5627b2606cebbd8065c8a419955c6d
Arg [12] : 00000000000000000000000021c7444ddfad748b40bac662a89080a7455e056b
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 35 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
[ Download: CSV Export ]
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.