Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions frontend/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Reown (WalletConnect) Project ID
# Get one at https://cloud.reown.com
VITE_REOWN_PROJECT_ID=""

# Contract Addresses - Sepolia
VITE_CONTRACT_ADDRESS_SEPOLIA_GOLD_TOKEN="0x19ad15A55D28B59775934be8913389F23b38fC34"
VITE_CONTRACT_ADDRESS_SEPOLIA_LOTTERIE="0xa44599409aDb9D9E69f5e262a9Cc17658D306565"
VITE_CONTRACT_ADDRESS_SEPOLIA_TOKEN_BRIDGE="0x1AF470D6e52A8aA3b1328Bb74D93967E0DC0F721"

# Contract Addresses - BSC Testnet
VITE_CONTRACT_ADDRESS_BSC_TESTNET_GOLD_TOKEN="0xaDA54cF66fe2aA440C2c230346a7B7621B61DF31"
VITE_CONTRACT_ADDRESS_BSC_TESTNET_LOTTERIE="0x0B0970beDa533276435bDcdD45DF9cE2875E6d78"
VITE_CONTRACT_ADDRESS_BSC_TESTNET_TOKEN_BRIDGE="0x4380FDA9f42BE8aEcda15CC5e6D67C87b20EcA6a"

# RPC URLs
VITE_RPC_URL_SEPOLIA=""
VITE_RPC_URL_BSC_TESTNET=""

# Site Metadata
VITE_SITE_NAME="Golden Bridge"
VITE_SITE_DESCRIPTION="Gold-backed tokenization with lottery rewards"
VITE_SITE_URL="http://localhost:5173"
VITE_SITE_ICON="https://assets.reown.com/reown-profile-pic.png"
8 changes: 8 additions & 0 deletions frontend/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Node modules
node_modules/

# Dist folder
dist/

# Environment variables
.env
90 changes: 90 additions & 0 deletions frontend/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# Golden Bridge Frontend

This is the frontend application for the Golden Bridge project, a gold-backed tokenization platform with lottery rewards and cross-chain bridging capabilities.

## Project Description

The Golden Bridge frontend allows users to:

- Connect their wallet (MetaMask, WalletConnect, etc.)
- Mint and burn Gold Tokens (GLD)
- Participate in the daily lottery
- Bridge tokens between Ethereum Sepolia and BSC Testnet
- View their token balance and transaction history

## Setup Instructions

1. **Prerequisites:**

- Node.js (v18 or later)
- npm or yarn

2. **Installation:**

```bash
cd frontend
npm install
```

3. **Environment Configuration:**

- Copy `.env.example` to `.env`:
```bash
cp .env.example .env
```
- Update the `.env` file with your specific configuration values (RPC URLs, Project ID, etc.).

4. **Running the Application:**
```bash
npm run dev
```
The application will be available at `http://localhost:5173`.

## Environment Variables

The following environment variables are required in the `.env` file:

- `VITE_REOWN_PROJECT_ID`: Your Reown (ex WalletConnect) Project ID
- `VITE_CONTRACT_ADDRESS_SEPOLIA_GOLD_TOKEN`: Gold Token contract address on Ethereum Sepolia
- `VITE_CONTRACT_ADDRESS_SEPOLIA_LOTTERIE`: Lotterie contract address on Ethereum Sepolia
- `VITE_CONTRACT_ADDRESS_SEPOLIA_TOKEN_BRIDGE`: Token Bridge contract address on Ethereum Sepolia
- `VITE_CONTRACT_ADDRESS_BSC_TESTNET_GOLD_TOKEN`: Gold Token contract address on BSC Testnet
- `VITE_CONTRACT_ADDRESS_BSC_TESTNET_LOTTERIE`: Lotterie contract address on BSC Testnet
- `VITE_CONTRACT_ADDRESS_BSC_TESTNET_TOKEN_BRIDGE`: Token Bridge contract address on BSC Testnet
- `VITE_RPC_URL_SEPOLIA`: RPC URL for Ethereum Sepolia
- `VITE_RPC_URL_BSC_TESTNET`: RPC URL for BSC Testnet
- `VITE_SITE_NAME`: Name of the site (default: "Golden Bridge")
- `VITE_SITE_DESCRIPTION`: Description of the site
- `VITE_SITE_URL`: URL of the site
- `VITE_SITE_ICON`: URL of the site icon

## Available Scripts

- `npm run dev`: Starts the development server
- `npm run build`: Builds the application for production
- `npm run preview`: Previews the production build locally
- `npm run lint`: Runs ESLint to check for code quality issues

## Project Structure

- `src/components`: React components
- `Dashboard`: Main dashboard component
- `GoldToken`: Components related to Gold Token operations
- `Lotterie`: Components related to the lottery
- `TokenBridge`: Components related to the bridge
- `ui`: Reusable UI components
- `src/config`: Configuration files (contracts, networks, etc.)
- `src/hooks`: Custom React hooks
- `src/styles`: Global styles and CSS modules
- `src/types`: TypeScript type definitions
- `src/utils`: Utility functions
- `abi`: Smart contract ABIs

## Technologies Used

- React
- TypeScript
- Vite
- ethers.js
- Reown AppKit (WalletConnect)
- CSS Modules
Loading
Loading