Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull Request Overview
This PR introduces staking functionality for a DeFi application with updated token addresses and new ABI configurations. The changes migrate from a previous chain ID configuration (66665) to a new one (2484) and add comprehensive staking components with proper contract integration.
- Update chain ID from 66665 to 2484 and replace DCC token addresses across all configuration files
- Add comprehensive staking functionality including utility functions, contract ABIs, and UI components
- Implement modular contract configuration system for different networks and staking durations
Reviewed Changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/utils/common.js | New utility functions for address formatting, date handling, and common helpers |
| src/stores/helpers/token-helper.js | Chain ID update from 66665 to 2484 |
| src/stores/helpers/deposit-helper.js | Add U2U token symbols to supported list |
| src/stores/constants/tokenlist.json | Update DCC token address |
| src/stores/constants/contractsTestnet.js | Update reward address to new DCC contract |
| src/constants/tokenList.json | Update DCC token address |
| src/constants/index.js | Update cybria address to new DCC contract |
| src/constants/abis/token.json | New ERC20 token ABI configuration |
| src/constants/abis/staking.json | New staking contract ABI configuration |
| src/constants/U2U_tokenList.json | Update DCC token address |
| src/constants/StakingOptions.js | Define staking duration options |
| src/constants/Contract.js | Multi-network contract address configuration |
| src/components/stake/TransactionStake.jsx | Extensive commented-out code for staking transactions |
| src/components/modal/StakeModal.jsx | New confirmation modal for staking operations |
| src/components/cross-chain/TransactionChain.jsx | Update DCC addresses for cross-chain |
| src/components/TransactionMenu.jsx | Change default tab from "stake" to "swap" and reorder tabs |
| src/components/ButtonConfig.jsx | New action button component for staking operations |
| .env | Remove all environment variables |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
|
||
| export function addCommas(value) { | ||
| const num = parseFloat(value.toString()) | ||
| if (isNaN(num)) throw new Error('Invalid number') |
There was a problem hiding this comment.
This function calls the custom parseFloat function defined above, but uses the global isNaN instead of Number.isNaN. This creates inconsistency since the custom parseFloat uses Number.isNaN. Use Number.isNaN(num) for consistency or call the custom parseFloat function properly.
| if (isNaN(num)) throw new Error('Invalid number') | |
| if (Number.isNaN(num)) throw new Error('Invalid number') |
| {/* {getButtonText()} */} | ||
| {} |
There was a problem hiding this comment.
The button contains an empty object {} which will render as text. This should either contain actual button text or be removed entirely.
| {/* {getButtonText()} */} | |
| {} | |
| {getButtonText()} |
| @@ -0,0 +1,278 @@ | |||
| import { useAccount, useConnect, useWriteContract } from 'wagmi' | |||
| import { formatUnits } from 'viem' | |||
| import { DCC_STAKING_ABI, TOKEN_ABI } from '../constants/contracts' | |||
There was a problem hiding this comment.
The import path '../constants/contracts' doesn't match the actual file path '../constants/Contract.js'. This will cause a module not found error.
| import { DCC_STAKING_ABI, TOKEN_ABI } from '../constants/contracts' | |
| import { DCC_STAKING_ABI, TOKEN_ABI } from '../constants/Contract.js' |
| // import { getSocket } from '../helper/socket' | ||
| import { toast } from 'react-toastify' | ||
| import { toastProps } from '../utils/common' | ||
| import ConfirmModal from './Modal/ConfirmModal' |
There was a problem hiding this comment.
The import path './Modal/ConfirmModal' doesn't match the actual file location './modal/StakeModal.jsx' (note the lowercase 'modal' directory). This will cause a module not found error.
| import ConfirmModal from './Modal/ConfirmModal' | |
| import StakeModal from './modal/StakeModal.jsx' |
No description provided.