Contract Address: 0x2E48c2aae9CC1dF9Ca4e5Cd67be17f299B86eB4f
Network: Base Mainnet
Deployment Date: $(date)
Contract: TriviaBattle (with CRE onReport() support)
- ✅ Full CRE compatibility with
onReport()function - ✅ ERC165 interface support
- ✅ Automated prize distribution ready
- ✅ Chainlink Functions integration ready
- ✅ Emergency withdrawal with timelock
- ✅ Platform fee distribution
Basescan:
- Contract: https://basescan.org/address/0x2E48c2aae9CC1dF9Ca4e5Cd67be17f299B86eB4f
- Add to watchlist for monitoring
The workflow configuration has been updated with the deployed contract address.
cd chainlink-cre-workflows/weekly-prize-distribution
bun install
cre workflow deploy weekly-prize-distribution --target production-settings
cre workflow activate weekly-prize-distribution --target production-settingsAfter deploying the CRE workflow, get the forwarder address and set it:
cast send 0x2E48c2aae9CC1dF9Ca4e5Cd67be17f299B86eB4f \
"setChainlinkOracle(address)" <FORWARDER_ADDRESS> \
--rpc-url base_mainnet \
--private-key $PRIVATE_KEY# Check owner
cast call 0x2E48c2aae9CC1dF9Ca4e5Cd67be17f299B86eB4f "owner()" --rpc-url base_mainnet
# Check session interval
cast call 0x2E48c2aae9CC1dF9Ca4e5Cd67be17f299B86eB4f "sessionInterval()" --rpc-url base_mainnet
# Check entry fee
cast call 0x2E48c2aae9CC1dF9Ca4e5Cd67be17f299B86eB4f "entryFee()" --rpc-url base_mainnet- Contract deployed to Base Mainnet
- Contract verified (if you ran with --verify)
- CRE workflow config updated
- CRE workflow deployed
- Forwarder address set on contract
- First session started
startNewSession()- Start a new game sessionendSession()- End current session and distribute prizes manuallydistributePrizes()- Distribute prizes (also callable by Chainlink)submitScores(address[], uint256[])- Submit player scoressetChainlinkOracle(address)- Set CRE forwarder addresssetChainlinkFunctions(address)- Set Chainlink Functions addresssetSessionInterval(uint256)- Update session intervalsetEntryFee(uint256)- Update entry feeinitiateEmergencyWithdraw()- Start emergency withdrawal (timelocked)executeWithdrawal()- Execute pending withdrawal after timelock
joinBattle()- Join the current session (requires USDC entry fee)getCurrentPlayers()- Get list of current playersgetPlayerScore(address)- Get a player's scoregetContractUsdcBalance()- Get contract's USDC balanceisSessionActive()- Check if session is activesessionCounter()- Get current session number
Contract is ready for production use! 🚀