Skip to content

Conversation

dewanshparashar
Copy link
Contributor

@dewanshparashar dewanshparashar commented Jun 20, 2025

Issue that triggered this

User was able to transfer ENA token (which is OFT) via Canonical Arbitrum Bridge - which sent it to canonical arbitrum-bridged token counterpart instead of the custom (Arb)ENA token that was deployed via OFT. This prompted us to make our isLayerZeroToken() method more robust, which is supposed to block such deposits.

In this PR

  1. Updated LayerZero / OFT token detection logic (see below)
  2. Add tests for detection of Withdraw-only tokens

Description

The previous on-chain OFT detection was unreliable, as it missed tokens like ENA that don't expose the oftVersion() method. This caused user funds to be bridged to incorrect, non-OFT contracts on Arbitrum.

The new solution uses the LayerZero metadata API as the definitive source for identifying OFT tokens. This ensures accurate detection and prevents improper deposits by marking these tokens as withdraw-only (except USDT0 which is a special case as we have an existing integration for it's transfers).

How to test

Try depositing ENA token (0x57e114b691db790c35207b2e685d4a43181e6061) from Ethereum to Arbitrum One - it should be blocked. Withdrawals should be okay.

Closes FS-1277

Copy link

vercel bot commented Jun 20, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
arbitrum-token-bridge ✅ Ready (Inspect) Visit Preview Jul 1, 2025 1:02pm

@cla-bot cla-bot bot added the cla-signed label Jun 20, 2025
@dewanshparashar dewanshparashar changed the title feat: enhance oft token detection for blocking deposits feat: enhance oft token detection to block deposits Jun 20, 2025
@dewanshparashar dewanshparashar marked this pull request as ready for review June 20, 2025 10:21
@dewanshparashar dewanshparashar changed the title feat: enhance oft token detection to block deposits feat: enhance OFT token detection to block deposits Jun 20, 2025
@dewanshparashar dewanshparashar requested review from brtkx and spsjvc June 20, 2025 10:23
) {
const parentProvider = getProviderForChainId(parentChainId)
): Promise<boolean> {
const chainIdToLzName: Record<number, string | undefined> = {
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like all values are defined, we can narrow down the type here

// }
// }

const response = await axios.get(
Copy link
Contributor

Choose a reason for hiding this comment

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

Any reason we use axios over fetch here? We don't seem to leverage any of the utilities of axios

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants