Skip to content

A template for creating Starknet and Eth multichain applications

License

Notifications You must be signed in to change notification settings

Scaffold-Stark/scaffold-eth-stark

Repository files navigation

Scaffold-ETH-Stark

🧪 An open-source, up-to-date toolkit for building decentralized applications (dapps) on Starknet and EVM blockchain. It's designed to make it easier for developers to create and deploy smart contracts and build user interfaces that interact with those contracts.

⚙️ Built using NextJS, Starknet.js, Scarb, Starknet-React, Starknet Foundry, RainbowKit, Foundry, Wagmi, Viem, and Typescript.

  • 🪝 Custom hooks: Collection of React hooks wrapper around wagmi and starknet-react to simplify interactions with smart contracts with typescript autocompletion.
  • 🔐 Integration with Wallet Providers: Connect to different wallet providers and interact with Starknet network and EVM network.

Requirements

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

Note for Windows users. Foundryup is not currently supported by Powershell or Cmd. You will need to use Git BASH or WSL as your terminal.

Starknet-devnet version

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

starknet-devnet --version

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

Scarb version

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

scarb --version

If your local Scarb version is not 2.8.3, 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.31.0, you need to install it.

Compatible versions

  • Starknet-devnet - v0.2.0
  • Scarb - v2.8.3
  • Snforge - v0.31.0
  • Cairo - v2.8.2
  • Rpc - v0.7.1

Getting Started

  1. Clone this repo and install dependencies
git clone https://github.com/Scaffold-Stark/scaffold-eth-stark
cd scaffold-eth-stark
yarn install
  1. Run a local eth network in the first terminal:
yarn chain:eth

This command starts a local Ethereum network using Anvil for testing and development. The network runs on your local machine and can be used for testing and development. You can customize the network configuration in config.ts.

  1. Run a local starknet network in the second terminal:
yarn chain:strk

This command starts a local Starknet network using Devnet. The network runs on your local machine and can be used for testing and development. You can customize the network configuration in config.ts for your nextjs app.

  1. Copy .env.example to .env and set the correct variables
cp ./packages/foundry/.env.example ./packages/foundry/.env
cp ./packages/snfoundry/.env.example ./packages/snfoundry/.env
  1. On a third terminal, deploy your smart contract(s) on the eth network and starknet network:
yarn deploy

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

By default, Scaffold-Stark uses the first prefunded account from starknet-devnet as the deployer address for Starknet contracts. For Ethereum contracts, when deploying to the local chain, Scaffold-ETH 2 creates a keystore account using Anvil's last address private key. This keystore account is named scaffold-eth-local with the password localhost.

Note: If you want to deploy to a network beside devnet For starknet, you need to fill the env file under ./packages/snfoundry/.env with the correct values. For ethereum, you need to fill the env file under ./packages/foundry/.env with the correct values.

Then for starknet, run yarn deploy:strk --network ${YOUR_NETWORK} For ethereum, run yarn deploy:eth --network ${YOUR_NETWORK}

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

Visit your app on: http://localhost:3000. You can tweak the app config in packages/nextjs/config.ts.

Documentation

Visit our docs to learn how to start building with Scaffold-Eth-Stark.

Contributing to Scaffold-ETH-Stark

We welcome contributions to Scaffold-ETH-Stark!

Please see CONTRIBUTING.MD for more information and guidelines for contributing to Scaffold-ETH-Stark.

About

A template for creating Starknet and Eth multichain applications

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •