OddsForgeV2 on BNB Smart Chain
All prediction market activity on OddsForge is powered by the OddsForgeV2 smart contract, deployed on BNB Smart Chain (BSC). The smart contract handles market creation, trading (buying and selling shares), market resolution, and payout claims — all on-chain and fully transparent.
BSC was chosen for its low transaction fees, fast block times (~3 seconds), and broad wallet support, making it accessible for traders of all sizes.
Key Contract Functions
The OddsForgeV2 contract exposes several core functions that drive the platform. Here is a summary of the most important ones:
buy(marketId, outcome, amount)
Purchases shares in a specific market outcome (Yes or No). The AMM calculates the number of shares you receive based on the current pool reserves and the Constant Product formula. A small fee is deducted and distributed to the liquidity pool.
sell(marketId, outcome, shares)
Sells shares back to the AMM pool. The contract calculates the payout based on the current reserves. Like buying, a small fee applies. You receive the proceeds directly in your wallet.
claimWinnings(marketId)
After a market has been resolved, holders of winning shares call this function to redeem their shares for $1.00 each. The contract verifies that the market is resolved, checks your share balance, and transfers the payout to your wallet in a single transaction.
createMarket(title, description, endDate, ...)
Creates a new prediction market with the specified parameters. This function is admin-only — it can only be called by authorized addresses. It initializes the AMM pool with the provided liquidity.
resolveMarket(marketId, outcome)
Resolves a market by recording the winning outcome on-chain. This function is also admin-only. Once called, the market is permanently settled and winning shares become redeemable.
getMarket, getPrice, and getUserShares that allow anyone to query market data, current prices, and individual holdings without making a transaction.
Fee Structure
A small fee is charged on each buy and sell transaction. These fees serve two purposes:
- Liquidity Pool Rewards: A portion of fees is distributed to liquidity providers who help maintain deep, liquid markets.
- Platform Operations: The remainder supports ongoing platform development, infrastructure, and market curation.
Fee rates are configured in the smart contract and are visible on-chain. The exact fee percentage is displayed on the trade confirmation screen before you submit any transaction.
Security Features
The OddsForgeV2 smart contract incorporates multiple layers of security:
- Access Control: Administrative functions like
createMarketandresolveMarketare restricted to authorized admin addresses. Regular users cannot create or resolve markets. - Reentrancy Protection: The contract uses reentrancy guards to prevent exploits where a malicious contract could recursively call functions to drain funds.
- Input Validation: All function parameters are validated on-chain. Invalid market IDs, zero-amount trades, and trades on closed markets are automatically rejected.
- Overflow Protection: The contract uses safe math operations to prevent integer overflow and underflow vulnerabilities.
- Open Source: The contract source code is verified and publicly available on BscScan, allowing anyone to inspect the logic and verify its correctness.
0xb144043806E6287851e50F24A90e00e8d5B90bB8. Bookmark the official site and never interact with contracts from unverified sources.
On-Chain Transparency
One of the core advantages of OddsForge is that every trade, market creation, and resolution happens on-chain. This means:
- Verifiable trades: Every buy and sell transaction is recorded on BSC and can be independently verified on BscScan.
- Auditable prices: The AMM's Constant Product formula is deterministic — anyone can verify that prices are calculated correctly by inspecting the pool reserves.
- Immutable resolutions: Once a market is resolved on-chain, the result cannot be altered. This eliminates disputes and guarantees fair payouts.
- Transparent fees: Fee rates and distributions are encoded in the contract and applied consistently to every transaction.
You can view the full transaction history, contract state, and event logs for OddsForgeV2 at any time by visiting the contract page on BscScan.
Interacting with the Contract
Most users interact with the OddsForgeV2 contract through the OddsForge web application, which provides a user-friendly interface for all actions. However, advanced users can also interact directly with the contract using:
- BscScan: Use the "Write Contract" tab on BscScan to call functions directly after connecting your wallet.
- Web3 libraries: Developers can use libraries like ethers.js or web3.js to build custom integrations or bots.
- Wallet CLI tools: Command-line tools like
cast(from Foundry) can interact with the contract programmatically.
OddsForge Help Center