MonkeyHoodRaffle
0xd8805d8900b1b62d4673f0db9f933368658a7bbf
Verification
Verified
v0.8.34+commit.80d5c536
Type
Contract
3,662 bytes
ABI entries
14
8 read · 4 write
License
none
Contract information
- Address
- 0xd8805d8900b1b62d4673f0db9f933368658a7bbf
- Chain
- Robinhood Chain (4663)
- Compiler
- v0.8.34+commit.80d5c536
- Optimization
- Disabled
- Creator
- 0xF1c9Bc957a…74165fd4A7
- Creation tx
- 0xdde7d30d8c…bfa3e67cbc
Token
Not a token
This contract does not expose ERC-20 metadata.
Read contract (8)
entered(address) → bool
entryFee() → uint256
getParticipants() → address[]
owner() → address
participants(uint256) → address
totalEntries() → uint256
totalRaised() → uint256
uniqueParticipants() → uint256
Events (1)
Entered
ABI
[
{
"inputs": [],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "participant",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "totalEntries",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "uniqueParticipants",
"type": "uint256"
}
],
"name": "Entered",
"type": "event"
},
{
"inputs": [],
"name": "enter",
"outputs": [],
"stateMutability": "payable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"name": "entered",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "entryFee",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getParticipants",
"outputs": [
{
"internalType": "address[]",
"name": "",
"type": "address[]"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "owner",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"name": "participants",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_fee",
"type": "uint256"
}
],
"name": "setEntryFee",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "totalEntries",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "totalRaised",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_new",
"type": "address"
}
],
"name": "transferOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "uniqueParticipants",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "withdraw",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
]Source code
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
// ─────────────────────────────────────────────────────────────────────────────
// CONTRACT 1 — Deploy on Robinhood Chain
// Handles: payments, participant list, treasury
// No randomness needed here
// ─────────────────────────────────────────────────────────────────────────────
contract MonkeyHoodRaffle {
address public owner;
uint256 public entryFee = 0.000003 ether; // ~$0.01
address[] public participants;
mapping(address => bool) public entered;
uint256 public totalEntries;
event Entered(address indexed participant, uint256 totalEntries, uint256 uniqueParticipants);
modifier onlyOwner() {
require(msg.sender == owner, "Not owner");
_;
}
constructor() {
owner = msg.sender;
}
function enter() external payable {
require(msg.value >= entryFee, "Send at least 0.000003 ETH");
if (!entered[msg.sender]) {
participants.push(msg.sender);
entered[msg.sender] = true;
}
totalEntries++;
emit Entered(msg.sender, totalEntries, participants.length);
}
// Returns the full participant list — use this to match winner indices
function getParticipants() external view returns (address[] memory) {
return participants;
}
function uniqueParticipants() external view returns (uint256) {
return participants.length;
}
function totalRaised() external view returns (uint256) {
return address(this).balance;
}
function withdraw() external onlyOwner {
uint256 bal = address(this).balance;
require(bal > 0, "Nothing to withdraw");
(bool ok, ) = payable(owner).call{value: bal}("");
require(ok, "Transfer failed");
}
function setEntryFee(uint256 _fee) external onlyOwner {
entryFee = _fee;
}
function transferOwnership(address _new) external onlyOwner {
require(_new != address(0), "Invalid");
owner = _new;
}
}
Chain explorer2695msChain node76ms