Skip to content

BlackStarkGoku/StarkSight

 
 

Repository files navigation

Starksight

Starksight is a no-loss prediction market that redefines betting. Users place their bets, funds generate yield through Starknet protocols, and only the earnings reward the winners—while losers walk away with their full stake intact. A new era of risk-free wagering begins

Pull Requests welcome

Requirements

Before you begin, you need to install the following tools:

Starknet-devnet version

To ensure the proper functioning of scaffold-stark, your local starknet-devnet version must be 0.2.3. To accomplish this, first check your local starknet-devnet version:

starknet-devnet --version

If your local starknet-devnet version is not 0.2.3, you need to install it.

Scarb version

To ensure the proper functioning of scaffold-stark, your local Scarb version must be 2.9.2. To accomplish this, first check your local Scarb version:

scarb --version

If your local Scarb version is not 2.9.2, you need to install it.

Starknet Foundry version

To ensure the proper functioning of the tests on scaffold-stark, your Starknet Foundry version must be 0.31.0. To accomplish this, first check your Starknet Foundry version:

snforge --version

If your Starknet Foundry version is not 0.34.0, you need to install it.

Compatible versions

  • Starknet-devnet - v0.2.3
  • Scarb - v2.9.2
  • Snforge - v0.34.0
  • Cairo - v2.9.2
  • Rpc - v0.7.1

Quickstart with Starknet-Devnet

To get started with Starksight, follow the steps below:

  1. Clone this repo and install dependencies
git clone https://github.com/BlackStarkGoku/StarkSight.git
cd StarkSight
yarn install
  1. Run a local network in the first terminal.
yarn chain --fork-network <YOUR_MAINNET_RPC_URL>

To run a fork : You need to update targetNetworks to mainnetFork and isFork to true in scaffold.config.ts

This command starts a local Starknet network using Devnet.

  1. On a second terminal, deploy the BetMaker contract:
yarn deploy

This command deploys the BetMaker smart contract to the local network. The contract is located in packages/snfoundry/contracts/src and can be modified to suit your needs. The yarn deploy command uses the deploy script located in packages/snfoundry/scripts-ts/deploy.ts to deploy the contract to the network. You can also customize the deploy script.

By default Starksight takes the first prefunded account from starknet-devnet as a deployer address,

  1. On a third terminal, start your NextJS app:
yarn start

Visit your app on: http://localhost:3000. You can interact with your smart contract using the Debug Contracts page.

  1. Check your environment variables.

RPC specific version

To ensure the proper functioning of the scaffold-stark with Testnet or Mainnet, your RPC version must be 0.7.1. This repository contains a .env.example file, where we provided the default RPC URL for the Starknet Testnet: RPC_URL_SEPOLIA=https://starknet-sepolia.public.blastapi.io/rpc/v0_7. Let's verify this RPC version is 0.7.1 by calling a POST request in an API platform like Postman or Insommia . Your API endpoint should be https://starknet-sepolia.public.blastapi.io/rpc/v0_7 and the body should be:

{
 "jsonrpc":"2.0",
 "method":"starknet_specVersion",
 "id":1
}

You have to paste the endpoint and body in the API platform and click on the Send button. If the response is 0.7.1, then you are good to go. Otherwise, you have to get the correct RPC URL endpoint.

rpc-version

Contributing to Starksight

We welcome contributions to Starksight!

About

No-loss prediction market on Starknet

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 78.8%
  • Cairo 20.6%
  • Other 0.6%