npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@rabbitholegg/questdk-plugin-hop

v1.0.0-alpha.37

Published

Hop is unique in that it's one of the only non-native bridges that uses the hub&spoke model. Because of this it basically has 3 types of transactions: 1. L2 to L1 1. L1 to L2 1. L2 to L2

Downloads

1,265

Readme

HOP PROTOCOL

Overview

Hop is unique in that it's one of the only non-native bridges that uses the hub&spoke model. Because of this it basically has 3 types of transactions:

  1. L2 to L1
  2. L1 to L2
  3. L2 to L2

L1 to L2

In this case we use the L1_ERC20_Bridge__factory and send using sendToL2

https://github.com/hop-protocol/hop/blob/fd451d32e7a7740fd3a1edd076fe0ec625dcf67e/packages/sdk/src/HopBridge.ts#L2079-L2081

The address for L1 to L2 transactions is the wrapper contract In order to get that address we need to use `getL1BridgeWrapperAddress

L2 to L1

In this case we either send to the AMM`` using swapAndSendor we send to thel2Bridgeusingsend`

https://github.com/hop-protocol/hop/blob/fd451d32e7a7740fd3a1edd076fe0ec625dcf67e/packages/sdk/src/HopBridge.ts#L2254-L2257

ETH can go through the Bonding contract before being withdrawn

L2 to L2

For our purposes, L2 to L2 works exactly the same as L2 to L1, there are differences after the transaction is issued to the bridge but not at the the source.

Example Transactions

L1 to L2 ETH

Address: 0xb8901acB165ed027E32754E0FFe830802919727f https://etherscan.io/advanced-filter?fadd=0xb8901acb165ed027e32754e0ffe830802919727f&tadd=0xb8901acb165ed027e32754e0ffe830802919727f&txntype=0&mtd=0xdeace8f5%7eSend+To+L2

https://etherscan.io/address/0xb8901acB165ed027E32754E0FFe830802919727f

L1 to L2 ERC20 (USDC)

Address: 0x3666f603Cc164936C1b87e207F36BEBa4AC5f18a https://etherscan.io/advanced-filter?fadd=0x3666f603cc164936c1b87e207f36beba4ac5f18a&tadd=0x3666f603cc164936c1b87e207f36beba4ac5f18a&txntype=0&mtd=0xdeace8f5%7eSend+To+L2

https://etherscan.io/address/0x914f986a44acb623a277d6bd17368171fcbe4273

L2 to L1 ETH

On L2 tokens and Ether target the AMM wrapper, which then calls the bridge.

https://polygonscan.com/address/0xc315239cfb05f1e130e7e28e603cea4c014c57f0

L2 to L1 ERC20

HOP has it's own strange flow https://polygonscan.com/tx/0x07b1c5480d3f8bbdad7fe20c7f05f41f3415c3d9d72413743beb651ca822ead9

All other tokens work similar to L2 ETH https://polygonscan.com/tx/0x14cab36f5b2187c9070d130dafeaccf585d7a4d134ee40169677c7e573ae2012

L2 to L2 ETH

Same flow as L2 to L1

L2 to L2 ERC20

Same flow as L2 to L1