Creating Raffles
How to create NFT raffles on the Gaambl platform
Raffle Creation Process
Creating a raffle requires approving your NFT and paying a creation fee. The NFT is automatically transferred to the contract.
Key Points
- • Creator does NOT auto-join (unlike lotto games)
- • Must approve NFT transfer first
- • Must pay creation fee (0.001 ETH)
- • NFT collection must be whitelisted
Function Signature
function createRaffle(RaffleConfig memory config) external payable returns (uint256 raffleId)Step-by-Step Process
1
Approve NFT
Approve the raffle contract to transfer your NFT.
nftContract.approve(raffleAddress, tokenId)2
Create Raffle
Call createRaffle() with your configuration and creation fee.
createRaffle{value: "0.001 ETH"}(config)3
NFT Transfer
Contract automatically transfers NFT from creator and raffle goes live.
Raffle Configuration
NFT Settings
- nftContract: NFT contract address
- tokenId: Specific NFT token ID
- nftType: 0=ERC721, 1=ERC1155
- Requirements: NFT collection must be whitelisted
Payment Settings
- paymentToken: 0x0 for ETH, token address for ERC20
- entryFee: Cost to enter raffle
- Requirements: Payment token must be whitelisted
Player Settings
- maxPlayers: Maximum number of players (2-100)
- Requirements: Must be between MIN_PLAYERS and MAX_PLAYERS
- Creator: Does NOT auto-join (unlike lotto)
Timing Settings
- duration: Raffle duration in seconds (24 hours to 30 days)
- Requirements: Must be between MIN_DURATION and MAX_DURATION