Battle Wallet
What It Is
The Battle Wallet is a smart contract on Base (L2) that holds player funds during gameplay and distributes prizes after each match. It is the settlement layer of JoyFlick — every entry fee, prize payout, and withdrawal flows through this contract.
Contract address: 0x69385584b1292a559c04d7590e7b630889da6b5e (TransparentUpgradeableProxy → BattleWalletV3)
Why It Exists
In traditional skill gaming platforms, the operator holds player funds in a custodial account. Players must trust that the operator will not misappropriate deposits and will pay out winnings honestly.
Battle Wallet eliminates this trust requirement. Player funds are held by the smart contract — not by Elympics, not by JoyFlick, not by any individual. The contract enforces the rules: deposits are credited to the player's on-chain balance, entry fees are locked before a match begins, and prizes are distributed algorithmically when the match concludes.
Your funds, not ours. JoyFlick cannot unilaterally withdraw player balances. The contract's logic — not a company decision — determines when and how funds move.
Deposit Flow
- Player calls
topUp(token, amount)— transferring USDC directly from their wallet to the Battle Wallet contract - The contract records the deposit against the player's address via
SafeERC20.safeTransferFrom - A
PlayerBalanceToppedUpevent is emitted on-chain
A third party can also deposit on behalf of a player via topUpFor(receiver, token, amount). In both cases, funds move from the sender's wallet to the contract — never to a JoyFlick-controlled address.
Match Settlement
When a match concludes, the platform submits a VerifiedCompetitionData structure to the conclude function. This structure contains:
- Proof of Entry — each player's signed entry (player address, bet token, bet amount, unique nonce), confirming they agreed to participate at the stated stake
- Proof of Game — the match result (win/loss per player), signed by the match authority
- Commission split — the platform fee (Elympics commission) and the game developer's share, capped at a combined maximum of 40%
The contract verifies every signature cryptographically (EIP-712 + ECDSA), checks that nonces have not been replayed, confirms the bet amounts and tokens match across entries, and only then redistributes funds: commissions to the respective treasury addresses, prize pool split among winners.
If any signature is invalid, any nonce is reused, or the commission exceeds 40%, the transaction reverts. No funds move.
Withdrawals
Players withdraw via a signed WithdrawTicket that includes a deadline and a unique nonce. The withdraw authority (a platform-controlled signer) must co-sign the ticket. This prevents unauthorized withdrawals while still allowing KYC and compliance checks before releasing funds. Once the ticket is submitted on-chain before its deadline, the contract transfers USDC directly to the player's wallet.
Access Control
The contract uses role-based access (OpenZeppelin AccessControlUpgradeable):
| Role | Purpose |
|---|---|
DEFAULT_ADMIN_ROLE | Manages other roles |
AUTHORITY_MANAGER_ROLE | Sets the match authority and withdraw authority signers |
TREASURY_MANAGER_ROLE | Configures Elympics and per-game developer treasury addresses |
No role can move player balances. Only cryptographically signed proofs (match results, withdrawal tickets) trigger fund transfers.
Guarantees
- Non-custodial — funds sit in the contract, not in a company bank account
- Replay-protected — every entry and withdrawal uses a unique nonce; reuse reverts the transaction
- Commission-capped — total platform + developer commission cannot exceed 40%, enforced on-chain
- Signature-verified — match results require valid cryptographic signatures from the match authority; entries require player signatures
- Audited — the contract has undergone a professional security audit. The verified source code is publicly available on Sourcify and BaseScan
For Developers
If you are building a game on Elympics for JoyFlick:
- You do not handle payments. The Battle Wallet manages all entry fees, prize distribution, and withdrawals. Your game submits scores; the platform handles settlement.
- Your revenue is on-chain. Each game has a
developerTreasuryaddress set viasetDeveloperTreasury(gameId, address). Your commission share is sent to this address automatically when matches conclude. - Trust is built in. Players and partners can verify the contract's logic on-chain. The non-custodial model and public audit reduce due diligence friction when onboarding to JoyFlick.
Deployment Addresses
| Network | Contract | Address | Explorer |
|---|---|---|---|
| Base (mainnet) | Proxy (TransparentUpgradeableProxy) | 0x69385584b1292a559c04d7590e7b630889da6b5e | BaseScan |
| Base (mainnet) | Implementation (BattleWalletV3) | 0x6d605a038bc1ae4b939e647a75e9465e1697367c | BaseScan |
| Base (mainnet) | ProxyAdmin | 0xf6db6e7bbdfdd830dc2651ff9cd85dc97acd757c | BaseScan |
The contract is currently deployed only on Base mainnet (Chain ID 8453). No testnet or other chain deployments were found. Verified source code is available on Sourcify.
The contract source lives in the internal GitLab repo at elympics/smart-contracts/evm/elympics-deposit. Access requires GitLab authentication.
Technical Details
| Property | Value |
|---|---|
| Network | Base (Chain ID 8453) |
| Contract type | TransparentUpgradeableProxy (ERC-1967) |
| Implementation | BattleWalletV3 (0x6d605a038bc1ae4b939e647a75e9465e1697367c) |
| ProxyAdmin | 0xf6db6e7bbdfdd830dc2651ff9cd85dc97acd757c |
| Compiler | Solidity 0.8.28 (via IR, 1000 optimizer runs) |
| Dependencies | OpenZeppelin Contracts (Upgradeable) — AccessControl, EIP-712, SafeERC20, ECDSA |
| Supported token | USDC (0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913) |
| Max commission | 40% (enforced on-chain) |