hyperlane-monorepo icon indicating copy to clipboard operation
hyperlane-monorepo copied to clipboard

`TokenRouter` unnecessarily branching in `transferRemote`

Open yorhodes opened this issue 9 months ago • 0 comments

Problem

https://github.com/hyperlane-xyz/hyperlane-monorepo/pull/3566 introduced the ability to specific hook and metadata overrides to transferRemote. However, due to a complex inheritance tree of TokenRouter is GasRouter is Router is MailboxClient, an additional branch was introduced to decide which _dispatch behavior to inherit.

Additionally, it is not obvious that the GasRouter's intended hook metadata is used.

Solution

We should eliminate this unnecessary branch in the TokenRouter contract and solve the root cause of the inheritance tree complexity.

yorhodes avatar May 16 '24 16:05 yorhodes