React frontend application for displaying Salary Receipt Token balances.
- Connect Web3 wallet (MetaMask, etc.)
- Display connected user's Salary Receipt Token balance
- Automatic balance refresh on account/network changes
- Support for multiple networks (Mainnet, Sepolia, Localhost)
- Install dependencies:
npm install-
Update contract addresses in
src/addresses.js:- Replace the placeholder addresses with your deployed contract addresses
- Update addresses for each network you plan to use
-
Start development server:
npm run devFor transfer history to work properly, you'll need an Etherscan API key:
-
Get a free API key from:
- Mainnet/Sepolia: https://etherscan.io/apis
- Arbitrum: https://arbiscan.io/apis
-
Create a
.envfile in the root directory:VITE_ETHERSCAN_API_KEY=your_api_key_here
-
The app will use Etherscan API V2 automatically when an API key is provided.
Note: Without an API key, the app will fall back to reading transfer events directly from the contract (limited to recent blocks).
Edit src/addresses.js to add your deployed contract addresses:
export const addresses = {
mainnet: {
salaryReceiptToken: "0xYourDeployedAddress",
},
sepolia: {
salaryReceiptToken: "0xYourDeployedAddress",
},
localhost: {
salaryReceiptToken: "0xYourDeployedAddress",
},
};To build for production:
npm run buildThe built files will be in the dist folder.
- Node.js 18+
- A Web3 wallet (MetaMask recommended)
- Deployed SalaryReceiptToken contract