🧪 An open-source, up-to-date toolkit for building decentralized applications (dapps) on Starknet. 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, Starknet-React, Starknetkit, Typescript, Scarb, and Starknet-Foundry.
Before you begin, you need to install the following tools:
To get started with Starknet-Scaffold, Clone this repo:
git clone git@github.com:horuslabsio/Starknet-Scaffold.git
cd Starknet-Scaffold
Or install using create-starknet-app (recommended).
PS: defaults to debugger mode, if no type is specified.
Scripts exists to make your life easier! Here are available scripts and features:
Feature | Available |
---|---|
Build Contract | ✅ |
Format Contract | ✅ |
Verify Contract | ✅ |
Run custom scripts | ✅ |
Generate SRC5 Interface | ✅ |
Prepare Account | ✅ |
Deploy Account | ✅ |
Delete Account | ✅ |
Declare Contract | ✅ |
Deploy Contract | ✅ |
Devnet spin up | ✅ |
Burner wallets for debugging | ✅ |
Starknet contract Deployer | ✅ |
sepETH/sepSTRK faucet | ✅ |
Cairo Wikipedia | ✅ |
Scripts to make building with Dojo easier! Here are available scripts and features:
Feature | Available |
---|---|
Initialize Dojo Project | ✅ |
Build Dojo Project | ✅ |
Deploy Katana | ✅ |
Migrate Dojo Project | ✅ |
UI components, to spin up faster UIs. Any missing UI component you'd like to see? please open a PR:)
Feature | Available |
---|---|
Connect button & Custom Wallet Modal | ✅ |
Address bar (Displays StarknetID) | ✅ |
Transactions List | ✅ |
modal to copy/disconnect/view account | ✅ |
Display account balance | ✅ |
Switch/display network | ✅ |
App Light/Dark mode | ✅ |
Burner wallet UI | ✅ |
The contract
folder contains all the tools needed to write, build, test and deploy your Starknet smart contracts. It is built with Scarb and Starknet Foundry. Here are common operations you can perform on your contracts:
To build your smart contracts, from the base repository run:
npm run build-contracts
Scarb comes with an in-built cairo formatter. To utilize it run:
npm run format-contracts
To verify your smart contracts, from the base repository run:
npm run verify-contracts --contract-address=<CONTRACT_ADDRESS> --contract-name=<CONTRACT_NAME> --network=<NETWORK>
To run your tests:
npm run test-contracts
To run a custom starknet foundry deploy/declare/invoke script:
npm run contract-scripts <SCRIPT_NAME> --url=<RPC_URL>
To generate an interface ID, run:
npm run generate-interface <PATH_TO_INTERFACE>
To prepare your account for deployment, run:
npm run prepare-account --url=<RPC_URL> --name=<ACCOUNT_NAME> <PROFILE_NAME>
generates a profile which is added to scarb.toml
and can be passed to other commands.
To deploy an account:
npm run deploy-account --profile=<MY_PROFILE> --name=<ACCOUNT_NAME> --feetoken=<FEE_TOKEN> --maxfee=<MAX_FEE>
where the profile
is gotten from snfoundry.toml
, name
is the prepared account and maxfee
is the specified max fee.
To delete an account:
npm run delete-account --profile=<MY_PROFILE> --accountfile=<PATH_TO_ACCOUNT_FILE> --name=<ACCOUNT_NAME> --network=<alpha-mainnet | alpha-goerli>
To declare a contract:
npm run declare-contract --profile=<MY_PROFILE> --contract=<CONTRACT_NAME> --feetoken=<FEE_TOKEN>
To deploy a contract:
npm run deploy-contract --profile=<MY_PROFILE> --feetoken=<FEE_TOKEN> --class=<CONTRACT_CLASSHASH>
Ensure to have Docker installed. To run starknet-devnet:
npm run devnet
The dojo-contracts
folder contains all the tools needed to write, build, test and dojo projects. It is built with sozo and katana. Here are common operations you can perform on your dojo contracts.
To initialize a dojo project, from the base repository:
npm run initialize-dojo --name=<PROJECT_NAME>
To build your dojo project, from the base repository run:
npm run build-dojo --name=<PROJECT_NAME>
To build deploy katana, from the base repository run:
npm run deploy-dojo-katana --name=<PROJECT_NAME>
To migrate your dojo project, from the base repository run:
npm run migrate-dojo --name=<PROJECT_NAME>
The frontend
section contains all UI components. Built using NextJS, Starknet.js, Starknet-React, Starknetkit, and Typescript.
To run UI, from the base repository:
npm run start
To build your frontend, from the base repository run:
npm run build-ui
Documentations of tools used in this scaffold:
We welcome contributions to Starknet-Scaffold!
Please see CONTRIBUTING.MD for more information and guidelines for contributing to Starknet-Scaffold.