-
Notifications
You must be signed in to change notification settings - Fork 7
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
Feat/network toggle #222
Conversation
symbol: 'ETH' | ||
}, | ||
g7TokenAddress: '0x12c88a3C30A7AaBC1dd7f2c08a97145F5DCcD830', | ||
routerSpender: '0x902b3e5f8f19571859f4ab1003b960a5df693aff', |
There was a problem hiding this comment.
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', |
There was a problem hiding this comment.
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', |
There was a problem hiding this comment.
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' |
There was a problem hiding this comment.
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', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it's correct
https://sepolia.arbiscan.io/token/0x75faf114eafb1bdbe2f0316df893fd58ce46aa4d
completionTimestamp: Date.now() / 1000, | ||
newTransaction: true, | ||
symbol: symbol, | ||
status: BridgeTransferStatus.DEPOSIT_GAS_PENDING |
There was a problem hiding this comment.
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>> = () => ( |
There was a problem hiding this comment.
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)} |
There was a problem hiding this comment.
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 () => { |
There was a problem hiding this comment.
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(() => { |
There was a problem hiding this comment.
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) : [] |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
console.log
webapps/world-builder-dashboard/src/hooks/useL2ToL1MessageStatus.ts
Outdated
Show resolved
Hide resolved
@@ -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 |
There was a problem hiding this comment.
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
No description provided.