Skip to content

Instantly share code, notes, and snippets.

View coderwithsense's full-sized avatar
:shipit:

Himanshu coderwithsense

:shipit:
View GitHub Profile
@coderwithsense
coderwithsense / PredictionFactory.sol
Created March 30, 2025 09:49
Deploys new PredictionGame contracts and tracks them by creator and token pair
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
import "./PredictionGame.sol";
contract PredictionFactory {
address[] public allGames;
mapping(address => address[]) public userGames;
event GameCreated(address game, address creator);
@coderwithsense
coderwithsense / OracleProvider.sol
Created March 30, 2025 09:50
Deploys new PredictionGame contracts and tracks them by creator and token pair. Core contract per market. Handles mint, burn, snapshot, claim, and progressive fee logic.
// Still to be implemented
@coderwithsense
coderwithsense / PredictionGame.sol
Created June 19, 2025 12:56
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.30+commit.73712a01.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
import "@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol";
contract PredictionGame {
enum Side { BULL, BEAR }
address public immutable creator; // e.g., 0xYourWallet
string public tokenPair; // e.g., "ETH/USD"
@coderwithsense
coderwithsense / PredictionFactory.sol
Created June 19, 2025 12:56
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.30+commit.73712a01.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
import "./PredictionGame.sol";
contract PredictionFactory {
address public immutable owner;
address[] public allGames;
mapping(address => address[]) public gamesByCreator;