Skip to content

Main#7

Open
Habeebtoyin wants to merge 12 commits intomasterfrom
main
Open

Main#7
Habeebtoyin wants to merge 12 commits intomasterfrom
main

Conversation

@Habeebtoyin
Copy link
Copy Markdown
Contributor

No description provided.

@vercel
Copy link
Copy Markdown

vercel bot commented Sep 20, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
de-fi-connect-v3-dex Ready Ready Preview Comment Oct 5, 2025 9:26pm

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/utils/common.js

export function addCommas(value) {
const num = parseFloat(value.toString())
if (isNaN(num)) throw new Error('Invalid number')
Copy link

Copilot AI Sep 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
if (isNaN(num)) throw new Error('Invalid number')
if (Number.isNaN(num)) throw new Error('Invalid number')

Copilot uses AI. Check for mistakes.
Comment on lines +268 to +269
{/* {getButtonText()} */}
{}
Copy link

Copilot AI Sep 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The button contains an empty object {} which will render as text. This should either contain actual button text or be removed entirely.

Suggested change
{/* {getButtonText()} */}
{}
{getButtonText()}

Copilot uses AI. Check for mistakes.
@@ -0,0 +1,278 @@
import { useAccount, useConnect, useWriteContract } from 'wagmi'
import { formatUnits } from 'viem'
import { DCC_STAKING_ABI, TOKEN_ABI } from '../constants/contracts'
Copy link

Copilot AI Sep 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The import path '../constants/contracts' doesn't match the actual file path '../constants/Contract.js'. This will cause a module not found error.

Suggested change
import { DCC_STAKING_ABI, TOKEN_ABI } from '../constants/contracts'
import { DCC_STAKING_ABI, TOKEN_ABI } from '../constants/Contract.js'

Copilot uses AI. Check for mistakes.
// import { getSocket } from '../helper/socket'
import { toast } from 'react-toastify'
import { toastProps } from '../utils/common'
import ConfirmModal from './Modal/ConfirmModal'
Copy link

Copilot AI Sep 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
import ConfirmModal from './Modal/ConfirmModal'
import StakeModal from './modal/StakeModal.jsx'

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants