Skip to content

feat: enhance OFT token detection to block deposits#147

Open
dewanshparashar wants to merge 7 commits intomasterfrom
enhanced-oft-detection
Open

feat: enhance OFT token detection to block deposits#147
dewanshparashar wants to merge 7 commits intomasterfrom
enhanced-oft-detection

Conversation

@dewanshparashar
Copy link
Copy Markdown
Contributor

@dewanshparashar dewanshparashar commented Feb 3, 2026

Redo of OffchainLabs/arbitrum-token-bridge#2537 in the Portal repo

  • Updated the API to v2
  • Added hardcoded fallback for pyUSD

@vercel
Copy link
Copy Markdown

vercel Bot commented Feb 3, 2026

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

Project Deployment Actions Updated (UTC)
arbitrum-portal Error Error Feb 4, 2026 0:03am

Request Review

chrstph-dvx
chrstph-dvx previously approved these changes Feb 3, 2026
Comment thread packages/arb-token-bridge-ui/src/util/WithdrawOnlyUtils.ts Outdated
} catch (error) {
return false;
// Fallback: check if chain is in orbitChains list
return !!orbitChains[chainId];
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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.

Comment on lines +54 to +55
parentChainErc20Address: CommonAddress.ArbitrumOne['USDC.e'],
parentChainId: ChainId.Ethereum,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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

Comment on lines -1 to -2
// 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.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

these comments should be useful to keep?

l2Address: '0xe575586566b02a16338c199c23ca6d295d794e66',
},
{
symbol: 'pyUSD',
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: PYUSD

Comment on lines +263 to +265
l2CustomAddr: '0xfab5891ed867a1195303251912013b92c4fc3a1d',
l1Address: '0xa2c323fe5a74adffad2bf3e007e36bb029606444',
l2Address: '0x327006c8712fe0abdbbd55b7999db39b0967342e',
Copy link
Copy Markdown
Member

@fionnachan fionnachan Feb 4, 2026

Choose a reason for hiding this comment

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

where do these come from??

the l2CustomAddr you gave is their OFT adapter address
we should use the innerTokenAddress

Suggested change
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) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

the content in this for loop seems very repetitive and can be simplified with some helper functions.

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