// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
/**
* @title TheHollowGame
* @notice Pay-to-play contract for The Hollow game on Robinhood Chain.
* @dev Players pay the native gas token (ETH) to play; the owner sets the
* price and withdraws collected funds.
*/
contract TheHollowGame is Ownable, ReentrancyGuard {
// Play price in wei of the native token (ETH, 18 decimals).
// Default 0.0001 ETH — owner can adjust via setPlayPrice.
uint256 public playPrice = 0.0001 ether;
// Events
event PlayPurchased(address indexed player, uint256 amount, uint256 timestamp);
event PlayPriceUpdated(uint256 oldPrice, uint256 newPrice);
event FundsWithdrawn(address indexed owner, uint256 amount);
constructor() Ownable(msg.sender) {}
/**
* @notice Pay to play the game
* @dev Emits PlayPurchased event on success
*/
function payToPlay() external payable nonReentrant {
require(msg.value >= playPrice, "Insufficient payment");
// Refund excess payment
uint256 excess = msg.value - playPrice;
if (excess > 0) {
(bool refundSuccess, ) = payable(msg.sender).call{value: excess}("");
require(refundSuccess, "Refund failed");
}
emit PlayPurchased(msg.sender, playPrice, block.timestamp);
}
/**
* @notice Set the play price (owner only)
* @param _newPrice New price in wei
*/
function setPlayPrice(uint256 _newPrice) external onlyOwner {
require(_newPrice > 0, "Price must be greater than 0");
uint256 oldPrice = playPrice;
playPrice = _newPrice;
emit PlayPriceUpdated(oldPrice, _newPrice);
}
/**
* @notice Get the current play price
* @return Current price in wei
*/
function getPlayPrice() external view returns (uint256) {
return playPrice;
}
/**
* @notice Withdraw all funds to owner (owner only)
*/
function withdraw() external onlyOwner nonReentrant {
uint256 balance = address(this).balance;
require(balance > 0, "No funds to withdraw");
(bool success, ) = payable(owner()).call{value: balance}("");
require(success, "Withdrawal failed");
emit FundsWithdrawn(owner(), balance);
}
/**
* @notice Get contract balance
* @return Contract balance in wei
*/
function getBalance() external view returns (uint256) {
return address(this).balance;
}
// Allow contract to receive ETH directly
receive() external payable {}
}[
{
"type": "constructor",
"inputs": [],
"stateMutability": "nonpayable"
},
{
"name": "OwnableInvalidOwner",
"type": "error",
"inputs": [
{
"name": "owner",
"type": "address",
"internalType": "address"
}
]
},
{
"name": "OwnableUnauthorizedAccount",
"type": "error",
"inputs": [
{
"name": "account",
"type": "address",
"internalType": "address"
}
]
},
{
"name": "ReentrancyGuardReentrantCall",
"type": "error",
"inputs": []
},
{
"name": "FundsWithdrawn",
"type": "event",
"inputs": [
{
"name": "owner",
"type": "address",
"indexed": true,
"internalType": "address"
},
{
"name": "amount",
"type": "uint256",
"indexed": false,
"internalType": "uint256"
}
],
"anonymous": false
},
{
"name": "OwnershipTransferred",
"type": "event",
"inputs": [
{
"name": "previousOwner",
"type": "address",
"indexed": true,
"internalType": "address"
},
{
"name": "newOwner",
"type": "address",
"indexed": true,
"internalType": "address"
}
],
"anonymous": false
},
{
"name": "PlayPriceUpdated",
"type": "event",
"inputs": [
{
"name": "oldPrice",
"type": "uint256",
"indexed": false,
"internalType": "uint256"
},
{
"name": "newPrice",
"type": "uint256",
"indexed": false,
"internalType": "uint256"
}
],
"anonymous": false
},
{
"name": "PlayPurchased",
"type": "event",
"inputs": [
{
"name": "player",
"type": "address",
"indexed": true,
"internalType": "address"
},
{
"name": "amount",
"type": "uint256",
"indexed": false,
"internalType": "uint256"
},
{
"name": "timestamp",
"type": "uint256",
"indexed": false,
"internalType": "uint256"
}
],
"anonymous": false
},
{
"name": "getBalance",
"type": "function",
"inputs": [],
"outputs": [
{
"name": "",
"type": "uint256",
"internalType": "uint256"
}
],
"stateMutability": "view"
},
{
"name": "getPlayPrice",
"type": "function",
"inputs": [],
"outputs": [
{
"name": "",
"type": "uint256",
"internalType": "uint256"
}
],
"stateMutability": "view"
},
{
"name": "owner",
"type": "function",
"inputs": [],
"outputs": [
{
"name": "",
"type": "address",
"internalType": "address"
}
],
"stateMutability": "view"
},
{
"name": "payToPlay",
"type": "function",
"inputs": [],
"outputs": [],
"stateMutability": "payable"
},
{
"name": "playPrice",
"type": "function",
"inputs": [],
"outputs": [
{
"name": "",
"type": "uint256",
"internalType": "uint256"
}
],
"stateMutability": "view"
},
{
"name": "renounceOwnership",
"type": "function",
"inputs": [],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"name": "setPlayPrice",
"type": "function",
"inputs": [
{
"name": "_newPrice",
"type": "uint256",
"internalType": "uint256"
}
],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"name": "transferOwnership",
"type": "function",
"inputs": [
{
"name": "newOwner",
"type": "address",
"internalType": "address"
}
],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"name": "withdraw",
"type": "function",
"inputs": [],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"type": "receive",
"stateMutability": "payable"
}
]0x608080604052346100885733156100725760008054336001600160a01b03198216811783556040519290916001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09080a360018055655af3107a4000600255610564908161008e8239f35b631e4fbdf760e01b815260006004820152602490fd5b600080fdfe6080604081815260049081361015610022575b505050361561002057600080fd5b005b600092833560e01c90816312065fe014610464575080633ccfd60b146103725780633e5edbd31461026757806359a9ae11146101c657806369c1a7ed146101a75780636a0d09d0146101a7578063715018a61461014a5780638da5cb5b1461011e5763f2fde38b03610012573461011a57602036600319011261011a576001600160a01b03823581811693919290849003610116576100bf6104df565b831561010057505082546001600160a01b0319811683178455167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08380a380f35b51631e4fbdf760e01b8152908101849052602490fd5b8480fd5b8280fd5b838234610146578160031936011261014657905490516001600160a01b039091168152602090f35b5080fd5b83346101a457806003193601126101a4576101636104df565b80546001600160a01b03198116825581906001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b80fd5b8382346101465781600319360112610146576020906002549051908152f35b50903461011a57602036600319011261011a578035906101e46104df565b81156102245750907f7f00a89280a0ae1f23540ebef3770800a932622926732a30abcd2cacc3cb1eb391600254908060025582519182526020820152a180f35b606490602084519162461bcd60e51b8352820152601c60248201527f5072696365206d7573742062652067726561746572207468616e2030000000006044820152fd5b50908260031936011261011a5761027c61050b565b60025480341061033857803403903482116103255790849134036102d7575b50827f4b420fda24412f894c6a65f0ab8a1e5b37c9d1bb81f29c1fa06139140659cd236002549180519283524260208401523392a26001805580f35b81808092335af16102e661047e565b50156102f357828161029b565b6020606492519162461bcd60e51b8352820152600d60248201526c1499599d5b990819985a5b1959609a1b6044820152fd5b634e487b7160e01b855260118352602485fd5b506020606492519162461bcd60e51b83528201526014602482015273125b9cdd59999a58da595b9d081c185e5b595b9d60621b6044820152fd5b50903461011a578260031936011261011a5761038c6104df565b61039461050b565b4790811561042a5760018060a01b03908480808086868254165af16103b761047e565b50156103f357507feaff4b37086828766ad3268786972c0cd24259d4c87a80f9d3963a3c3d999b0d916020918554169351908152a26001805580f35b606490602085519162461bcd60e51b8352820152601160248201527015da5d1a191c985dd85b0819985a5b1959607a1b6044820152fd5b606490602084519162461bcd60e51b835282015260146024820152734e6f2066756e647320746f20776974686472617760601b6044820152fd5b849034610146578160031936011261014657602090478152f35b3d156104da5767ffffffffffffffff903d8281116104c45760405192601f8201601f19908116603f01168401908111848210176104c45760405282523d6000602084013e565b634e487b7160e01b600052604160045260246000fd5b606090565b6000546001600160a01b031633036104f357565b60405163118cdaa760e01b8152336004820152602490fd5b60026001541461051c576002600155565b604051633ee5aeb560e01b8152600490fdfea26469706673582212207aa02a2d9b79e01aace6bd196026e4ba7ea24d54398e324161190aad204407be64736f6c63430008180033
0x6080604081815260049081361015610022575b505050361561002057600080fd5b005b600092833560e01c90816312065fe014610464575080633ccfd60b146103725780633e5edbd31461026757806359a9ae11146101c657806369c1a7ed146101a75780636a0d09d0146101a7578063715018a61461014a5780638da5cb5b1461011e5763f2fde38b03610012573461011a57602036600319011261011a576001600160a01b03823581811693919290849003610116576100bf6104df565b831561010057505082546001600160a01b0319811683178455167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08380a380f35b51631e4fbdf760e01b8152908101849052602490fd5b8480fd5b8280fd5b838234610146578160031936011261014657905490516001600160a01b039091168152602090f35b5080fd5b83346101a457806003193601126101a4576101636104df565b80546001600160a01b03198116825581906001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b80fd5b8382346101465781600319360112610146576020906002549051908152f35b50903461011a57602036600319011261011a578035906101e46104df565b81156102245750907f7f00a89280a0ae1f23540ebef3770800a932622926732a30abcd2cacc3cb1eb391600254908060025582519182526020820152a180f35b606490602084519162461bcd60e51b8352820152601c60248201527f5072696365206d7573742062652067726561746572207468616e2030000000006044820152fd5b50908260031936011261011a5761027c61050b565b60025480341061033857803403903482116103255790849134036102d7575b50827f4b420fda24412f894c6a65f0ab8a1e5b37c9d1bb81f29c1fa06139140659cd236002549180519283524260208401523392a26001805580f35b81808092335af16102e661047e565b50156102f357828161029b565b6020606492519162461bcd60e51b8352820152600d60248201526c1499599d5b990819985a5b1959609a1b6044820152fd5b634e487b7160e01b855260118352602485fd5b506020606492519162461bcd60e51b83528201526014602482015273125b9cdd59999a58da595b9d081c185e5b595b9d60621b6044820152fd5b50903461011a578260031936011261011a5761038c6104df565b61039461050b565b4790811561042a5760018060a01b03908480808086868254165af16103b761047e565b50156103f357507feaff4b37086828766ad3268786972c0cd24259d4c87a80f9d3963a3c3d999b0d916020918554169351908152a26001805580f35b606490602085519162461bcd60e51b8352820152601160248201527015da5d1a191c985dd85b0819985a5b1959607a1b6044820152fd5b606490602084519162461bcd60e51b835282015260146024820152734e6f2066756e647320746f20776974686472617760601b6044820152fd5b849034610146578160031936011261014657602090478152f35b3d156104da5767ffffffffffffffff903d8281116104c45760405192601f8201601f19908116603f01168401908111848210176104c45760405282523d6000602084013e565b634e487b7160e01b600052604160045260246000fd5b606090565b6000546001600160a01b031633036104f357565b60405163118cdaa760e01b8152336004820152602490fd5b60026001541461051c576002600155565b604051633ee5aeb560e01b8152600490fdfea26469706673582212207aa02a2d9b79e01aace6bd196026e4ba7ea24d54398e324161190aad204407be64736f6c63430008180033
| Token | Symbol | Balance | Price | Value |
|---|---|---|---|---|
| no token holdings | ||||
| Type | Age | Block | Details |
|---|---|---|---|
| no cross-chain L1↔L2 transactions for this address | |||
| Txn Hash | Age | Event | Topics / Data |
|---|---|---|---|
| 0x99fecf…61420f | 19 days agoMon, 27 Jul 2026 12:32:57 UTC | 0x4b420f…cd23 | [0] 0x000000000000…3e94cce3 data: 0x000000000000000000…6a674ff9 |
| 0x8c7281…e5b2da | 19 days agoMon, 27 Jul 2026 12:32:21 UTC | 0x4b420f…cd23 | [0] 0x000000000000…3e94cce3 data: 0x000000000000000000…6a674fd5 |
| 0xfae743…e91838 | 33 days agoMon, 13 Jul 2026 11:34:30 UTC | 0x4b420f…cd23 | [0] 0x000000000000…52433767 data: 0x000000000000000000…6a54cd46 |
| 0xa7ad48…231bb3 | 33 days agoMon, 13 Jul 2026 11:26:07 UTC | 0x4b420f…cd23 | [0] 0x000000000000…52433767 data: 0x000000000000000000…6a54cb4f |
| 0x2692c6…6a064e | 33 days agoMon, 13 Jul 2026 11:19:49 UTC | 0x8be007…57e0 | [0] 0x000000000000…00000000 [1] 0x000000000000…52433767 |
| Block | Age | Parent Transaction Hash | Type | Method | From | To | Value | |
|---|---|---|---|---|---|---|---|---|
| no internal transactions found for this address yet (traced blocks + on-demand) | ||||||||
| Transaction Hash | Method | Block | Age | From | To | Type | Item | ||
|---|---|---|---|---|---|---|---|---|---|
| no NFT transfers for this address yet | |||||||||
| Transaction Hash | Method ? | Block | Age | From | To | Amount | Txn Fee ? | ||
|---|---|---|---|---|---|---|---|---|---|
| 0x99fecf…61420f | payToPlay | 20,734,753 | 19 days agoMon, 27 Jul 2026 12:32:57 UTC | 0xd5b4…cce3 | IN | TheHollowGame | $0.190.0001 ETH | 0.00000100 | |
| 0x8c7281…e5b2da | payToPlay | 20,734,382 | 19 days agoMon, 27 Jul 2026 12:32:21 UTC | 0xd5b4…cce3 | IN | TheHollowGame | $0.190.0001 ETH | 0.00000100 | |
| 0xfae743…e91838 | payToPlay | 8,635,036 | 33 days agoMon, 13 Jul 2026 11:34:30 UTC | 0x4c33…3767 | IN | TheHollowGame | $0.190.0001 ETH | 0.00000133 | |
| 0xa7ad48…231bb3 | payToPlay | 8,630,027 | 33 days agoMon, 13 Jul 2026 11:26:07 UTC | 0x4c33…3767 | IN | TheHollowGame | $0.190.0001 ETH | 0.00000135 |
| Transaction Hash | Method | Block | Age | From | To | Amount | Token | ||
|---|---|---|---|---|---|---|---|---|---|
| no token transfers for this address yet | |||||||||