Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/network toggle #222

Merged
merged 6 commits into from
Dec 4, 2024
Merged

Feat/network toggle #222

merged 6 commits into from
Dec 4, 2024

Conversation

elclandestin0
Copy link
Contributor

No description provided.

symbol: 'ETH'
},
g7TokenAddress: '0x12c88a3C30A7AaBC1dd7f2c08a97145F5DCcD830',
routerSpender: '0x902b3e5f8f19571859f4ab1003b960a5df693aff',
Copy link
Contributor

Choose a reason for hiding this comment

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

it's not true.
I don't think it's used anywhere, so it should be removed

symbol: 'ETH'
},
g7TokenAddress: '0xF18e4466F26B4cA55bbAb890b314a54976E45B17',
routerSpender: '0x902b3e5f8f19571859f4ab1003b960a5df693aff',
Copy link
Contributor

Choose a reason for hiding this comment

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

it's not true.
I don't think it's used anywhere, so it should be removed

symbol: 'G7T'
},
g7TokenAddress: '0x0000000000000000000000000000000000000000',
routerSpender: '0x902b3e5f8f19571859f4ab1003b960a5df693aff',
Copy link
Contributor

Choose a reason for hiding this comment

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

it's not true.
I don't think it's used anywhere, so it should be removed

@@ -71,3 +129,66 @@ export const FIVE_MINUTES = 1000 * 60 * 5
export const DEFAULT_STAKE_NATIVE_POOL_ID = '1'

export const MAX_ALLOWANCE_ACCOUNT = '0x9ed191DB1829371F116Deb9748c26B49467a592A'
Copy link
Contributor

Choose a reason for hiding this comment

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

This address doesn't have tokens anymore and can't be used for gas estimation


export const USDC: TokenAddressMap = {
13746: '0xf2B58E3519C5b977a254993A4A6EaD581A8989A0',
421614: '0x119f0E6303BEc7021B295EcaB27A4a1A5b37ECf0',
Copy link
Contributor

Choose a reason for hiding this comment

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

completionTimestamp: Date.now() / 1000,
newTransaction: true,
symbol: symbol,
status: BridgeTransferStatus.DEPOSIT_GAS_PENDING
Copy link
Contributor

Choose a reason for hiding this comment

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

for ERC20 status is different

@@ -0,0 +1,18 @@
import React from 'react'

const IconTokenNoSynbol: React.FC<React.SVGProps<SVGSVGElement>> = () => (
Copy link
Contributor

Choose a reason for hiding this comment

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

typo

<TransactionSummary
direction={direction}
gasBalance={Number((direction === 'DEPOSIT' ? lowNetworkNativeBalance : highNetworkNativeBalance) ?? 0)}
gasBalance={Number(tokenInformation?.tokenBalance)}
Copy link
Contributor

Choose a reason for hiding this comment

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

gasBalance is not tokenBalance

const [tokens, setTokens] = useState<Token[]>([])
const { connectedAccount, selectedBridgeToken, selectedHighNetwork, selectedLowNetwork } = useBlockchainContext()

const getTokens = async () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

why is it async

const { data: transactionInputs } = getTransactionInputs({ txRecord: deposit })
const [highNetworkTimestamp, setHighNetworkTimestamp] = useState<number>(0)

useEffect(() => {
Copy link
Contributor

Choose a reason for hiding this comment

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

why not use useQuery here

const storedTransactionsString = localStorage.getItem(
`bridge-${connectedAccount}-transactions-${selectedNetworkType}`
)
const storedTransactions = storedTransactionsString ? JSON.parse(storedTransactionsString) : []
Copy link
Contributor

Choose a reason for hiding this comment

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

localTransactions' duplicate

const NetworkToggle: React.FC<NetworkToggleProps> = () => {
const { selectedNetworkType, setSelectedNetworkType } = useBlockchainContext()
const [isDropdownOpen, setDropdownOpen] = useState(false)
const dropdownRef = useRef<HTMLDivElement>(null)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think the type should be <HTMLDivElement | null>

return useQuery(
['historyTransactions', address, selectedNetworkType],
async () => {
console.log(selectedNetworkType)
Copy link
Contributor

Choose a reason for hiding this comment

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

console.log

@@ -114,7 +114,10 @@ const ActionButton: React.FC<ActionButtonProps> = ({
completionTimestamp: Date.now() / 1000,
newTransaction: true,
symbol: symbol,
status: BridgeTransferStatus.DEPOSIT_GAS_PENDING
status:
selectedBridgeToken.address === ZERO_ADDRESS
Copy link
Contributor

Choose a reason for hiding this comment

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

If selectedBridgeToken.adsress !== ZERO_ADDRESS, but token's address on the destination chain equal ZERO_ADDRESS, correct status would be DEPOSIT_GAS_PENDING, not DEPOSIT_ERC20_NOT_YET_CREATED

@elclandestin0 elclandestin0 changed the base branch from main to staging December 4, 2024 16:26
@elclandestin0 elclandestin0 merged commit ef888e5 into staging Dec 4, 2024
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.

2 participants