feat: enhance OFT token detection to block deposits#147
feat: enhance OFT token detection to block deposits#147dewanshparashar wants to merge 7 commits intomasterfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
| } catch (error) { | ||
| return false; | ||
| // Fallback: check if chain is in orbitChains list | ||
| return !!orbitChains[chainId]; |
There was a problem hiding this comment.
Updated this to check orbitChains as a fallback when the SDK doesn't recognize the chain. This ensures Orbit chains like Xai are correctly identified and tests pass.
| parentChainErc20Address: CommonAddress.ArbitrumOne['USDC.e'], | ||
| parentChainId: ChainId.Ethereum, |
There was a problem hiding this comment.
this doesn't make any sense because the parent chain is Ethereum so the ERC20 address should be the one on Ethereum instead of Arbitrum One
| // tokens that can't be bridged to Arbitrum (maybe coz they have their native protocol bridges and custom implementation or they are being discontinued) | ||
| // the UI doesn't let users deposit such tokens. If bridged already, these can only be withdrawn. |
There was a problem hiding this comment.
these comments should be useful to keep?
| l2Address: '0xe575586566b02a16338c199c23ca6d295d794e66', | ||
| }, | ||
| { | ||
| symbol: 'pyUSD', |
| l2CustomAddr: '0xfab5891ed867a1195303251912013b92c4fc3a1d', | ||
| l1Address: '0xa2c323fe5a74adffad2bf3e007e36bb029606444', | ||
| l2Address: '0x327006c8712fe0abdbbd55b7999db39b0967342e', |
There was a problem hiding this comment.
where do these come from??
the l2CustomAddr you gave is their OFT adapter address
we should use the innerTokenAddress
| l2CustomAddr: '0xfab5891ed867a1195303251912013b92c4fc3a1d', | |
| l1Address: '0xa2c323fe5a74adffad2bf3e007e36bb029606444', | |
| l2Address: '0x327006c8712fe0abdbbd55b7999db39b0967342e', | |
| l2CustomAddr: '0x46850ad61c2b7d64d08c9c754f45254596696984', | |
| l1Address: '0x6c3ea9036406852006290770bedfcaba0e23a0e8', | |
| l2Address: '0x327006c8712fe0abdbbd55b7999db39b0967342e', |
| const tokenEntries = metadata[tokenSymbol]; | ||
| if (!Array.isArray(tokenEntries)) continue; | ||
|
|
||
| for (const tokenEntry of tokenEntries) { |
There was a problem hiding this comment.
the content in this for loop seems very repetitive and can be simplified with some helper functions.
Redo of OffchainLabs/arbitrum-token-bridge#2537 in the Portal repo