https://github.com/bitfancy/rust-solidity
https://github.com/bitfancy/rust-solidity
Last synced: 11 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/bitfancy/rust-solidity
- Owner: BitFancy
- License: apache-2.0
- Created: 2024-02-19T20:41:05.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2024-02-19T21:15:23.000Z (about 2 years ago)
- Last Synced: 2025-02-15T20:54:18.402Z (about 1 year ago)
- Language: TypeScript
- Size: 293 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 🏗 Solana App Scaffold
Scaffolding for a dapp built on Solana
# Quickstart
```bash
git clone https://github.com/solana-labs/dapp-scaffold.git
cd dapp-scaffold
```
```bash
yarn
```
```bash
yarn start
```
# Environment Setup
1. Install Rust from https://rustup.rs/
2. Install Solana v1.6.7 or later from https://docs.solana.com/cli/install-solana-cli-tools#use-solanas-install-tool
3. Install Node
4. Install NPM, Yarn
# Build Smart Contract (compiled for BPF)
Run the following from the program/ subdirectory:
```bash
$ cargo build-bpf
$ cargo test-bpf
```
# Directory structure
## program
Solana program template in Rust
### program/src/lib.rs
* process_instruction function is used to run all calls issued to the smart contract
## src/actions
Setup here actions that will interact with Solana programs using sendTransaction function
## src/contexts
React context objects that are used propagate state of accounts across the application
## src/hooks
Generic react hooks to interact with token program:
* useUserBalance - query for balance of any user token by mint, returns:
- balance
- balanceLamports
- balanceInUSD
* useUserTotalBalance - aggregates user balance across all token accounts and returns value in USD
- balanceInUSD
* useAccountByMint
* useTokenName
* useUserAccounts
## src/views
* home - main page for your app
* faucet - airdrops SOL on Testnet and Devnet