Skip to content

Latest commit

 

History

History
102 lines (77 loc) · 3.04 KB

CONTRACT_DEPLOYED_MAINNET.md

File metadata and controls

102 lines (77 loc) · 3.04 KB

✅ Contract Deployed to Base Mainnet

📍 Deployment Details

Contract Address: 0x2E48c2aae9CC1dF9Ca4e5Cd67be17f299B86eB4f
Network: Base Mainnet
Deployment Date: $(date)
Contract: TriviaBattle (with CRE onReport() support)


✅ Contract Features

  • ✅ Full CRE compatibility with onReport() function
  • ✅ ERC165 interface support
  • ✅ Automated prize distribution ready
  • ✅ Chainlink Functions integration ready
  • ✅ Emergency withdrawal with timelock
  • ✅ Platform fee distribution

🔗 Useful Links

Basescan:


📋 Next Steps

1. ✅ CRE Workflow Config Updated

The workflow configuration has been updated with the deployed contract address.

2. Deploy CRE Workflow

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-settings

3. Set Forwarder Address

After 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

4. Verify Contract Setup

# 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

🎯 Status

  • 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

📊 Contract Functions Reference

Owner Functions

  • startNewSession() - Start a new game session
  • endSession() - End current session and distribute prizes manually
  • distributePrizes() - Distribute prizes (also callable by Chainlink)
  • submitScores(address[], uint256[]) - Submit player scores
  • setChainlinkOracle(address) - Set CRE forwarder address
  • setChainlinkFunctions(address) - Set Chainlink Functions address
  • setSessionInterval(uint256) - Update session interval
  • setEntryFee(uint256) - Update entry fee
  • initiateEmergencyWithdraw() - Start emergency withdrawal (timelocked)
  • executeWithdrawal() - Execute pending withdrawal after timelock

Public Functions

  • joinBattle() - Join the current session (requires USDC entry fee)
  • getCurrentPlayers() - Get list of current players
  • getPlayerScore(address) - Get a player's score
  • getContractUsdcBalance() - Get contract's USDC balance
  • isSessionActive() - Check if session is active
  • sessionCounter() - Get current session number

Contract is ready for production use! 🚀