A dashboard for interacting with blockchain smart contracts, including functionality for token staking, unstaking, and minting.
This project uses environment variables to configure API keys and endpoints. Follow these steps to set up your environment:
.env.example
file to create a new .env
file:cp .env.example .env
.env
file with your own values:# Blockchain Explorer API
NEXT_PUBLIC_EXPLORER_API_KEY=your_api_key_here # Get from Basescan/Etherscan
NEXT_PUBLIC_EXPLORER_API_URL=https://api-sepolia.basescan.org/api # Or your preferred network
# RPC URL
NEXT_PUBLIC_RPC_URL= https://sepolia.base.org
First, install dependencies:
pnpm install
Then, run the development server:
pnpm dev
Open http://localhost:3000 with your browser to see the dashboard.
The dashboard is configured to work with a simple ERC20 token contract with staking capabilities. Here's how to deploy it:
.env
file in your smart contract project with the following:PRIVATE_KEY=your_private_key_here
ETHERSCAN_API_KEY=your_etherscan_api_key_here
anvil
forge script script/SimpleToken.s.sol:DeploySimpleToken --rpc-url http://localhost:8545 --private-key YOUR_PRIVATE_KEY --broadcast
This will deploy the contract to your local Anvil node, and you can interact with it using the dashboard. Remember to change the network to localhost.
To deploy to Sepolia testnet:
# Deploy to Sepolia
forge script script/SimpleToken.s.sol:DeploySimpleToken --rpc-url https://sepolia.base.org --private-key $PRIVATE_KEY --broadcast --verify --etherscan-api-key $ETHERSCAN_API_KEY
After deploying your contract, update the tokenAddress
in the dashboard project's constants/addresses.ts
with your deployed contract address.
MIT