Smart Contract Reference
Contract addresses, key functions, and technical details for developers and advanced users.
Contract Addresses
| Contract | Address | Network |
|---|---|---|
| OddsForge V2 (Main) | 0xb144043806E6287851e50F24A90e00e8d5B90bB8 |
BSC Mainnet |
| USDC (BEP-20) | 0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d |
BSC Mainnet |
| Operator Wallet | 0xEe1C01eBE7181725F0aA8dE42B1E1237941272d4 |
BSC Mainnet |
💡
Verify on BscScan: You can view the verified contract source code at bscscan.com.
Contract Overview
The OddsForgeV2 smart contract handles all core platform operations:
- Deposits & Withdrawals — USDC transfers in and out of the platform
- Trade Placement — Recording trades on YES/NO outcomes for each pool
- Market Resolution — Determining winners and distributing funds
- Fee Collection — 5% platform fee (500 basis points) from losing pools
| Property | Value |
|---|---|
| Solidity Version | ^0.8.20 |
| Fee Rate | 500 bps (5%) |
| Token Standard | BEP-20 (USDC) |
| Access Control | Ownable (operator-only admin functions) |
Key Functions
User Functions
These functions can be called by any user:
| Function | Description | Parameters |
|---|---|---|
deposit(uint256 amount) |
Deposit USDC into your OddsForge account | amount — USDC amount (18 decimals) |
withdraw(uint256 amount) |
Withdraw USDC from your available balance | amount — USDC amount to withdraw |
placeBet(uint256 poolId, uint8 side, uint256 amount) |
Place a trade on a market pool | poolId — market ID, side — 1 (YES) or 2 (NO), amount — trade amount |
View Functions (Read-Only)
These functions don't cost gas and return data:
| Function | Returns |
|---|---|
getUserInfo(address user) |
(balance, totalDeposited, totalWithdrawn, totalBets, available) |
getPoolInfo(uint256 poolId) |
(yesPool, noPool, totalPool, status, resolvedOutcome) |
getUserBets(address user, uint256 poolId) |
(yesBets, noBets) — user's total trades on each side |
estimatePayout(uint256 poolId, uint8 side, uint256 amount) |
(estimatedPayout, multiplier) — projected payout if that side wins |
Admin Functions (Operator Only)
These functions can only be called by the contract operator:
| Function | Description |
|---|---|
createPool(string title, uint256 endTime) |
Create a new prediction market pool |
resolvePool(uint256 poolId, uint8 outcome) |
Resolve a market — outcome 1 (YES) or 2 (NO) |
cancelPool(uint256 poolId) |
Cancel a market and refund all traders |
withdrawFees(uint256 amount) |
Withdraw accumulated platform fees |
Contract Events
The contract emits events for all key actions, which can be monitored on-chain:
| Event | Emitted When | Data |
|---|---|---|
Deposited |
User deposits USDC | user, amount |
Withdrawn |
User withdraws USDC | user, amount |
BetPlaced |
User places a trade | user, poolId, side, amount |
PoolResolved |
Market is resolved | poolId, outcome, totalPrize, fee |
PoolCancelled |
Market is cancelled | poolId |
Security Considerations
- Non-custodial: Users always control their own wallet keys. The contract only holds deposited funds.
- Ownable pattern: Admin functions are restricted to the operator address.
- Atomic resolution: Markets can only be resolved once. Double-resolution is prevented at the contract level.
- Verified source: The contract source code is verified on BscScan for full transparency.
- USDC integration: Uses the official Binance-pegged USDC (BEP-20) for stability.
⚠️
For developers: Always verify contract addresses before interacting programmatically. Use the official addresses listed on this page and verify them on BscScan.
Interacting with the Contract
You can interact with the OddsForge contract in several ways:
- OddsForge Website — The simplest method. All contract interactions are handled through the UI.
- BscScan — Go to the contract page → "Write Contract" tab to call functions directly.
- ethers.js / web3.js — For developers building integrations or bots:
const contract = new ethers.Contract( '0xb144043806E6287851e50F24A90e00e8d5B90bB8', ABI, signer ); // Check your info const info = await contract.getUserInfo(walletAddress); console.log('Balance:', ethers.formatUnits(info.balance, 18));
OddsForge