1.0.0-alpha.36 • Published 5 days ago

@rabbitholegg/questdk-plugin-hop v1.0.0-alpha.36

Weekly downloads
-
License
ISC
Repository
-
Last release
5 days ago

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 1. L1 to L2 1. 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`` usingswapAndSendor 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

1.0.0-alpha.34

6 days ago

1.0.0-alpha.36

5 days ago

1.0.0-alpha.35

6 days ago

1.0.0-alpha.33

7 days ago

1.0.0-alpha.32

14 days ago

1.0.0-alpha.31

1 month ago

1.0.0-alpha.30

1 month ago

1.0.0-alpha.29

2 months ago

1.0.0-alpha.28

2 months ago

1.0.0-alpha.27

2 months ago

1.0.0-alpha.26

2 months ago

1.0.0-alpha.25

2 months ago

1.0.0-alpha.23

2 months ago

1.0.0-alpha.22

2 months ago

1.0.0-alpha.24

2 months ago

1.0.0-alpha.21

2 months ago

1.0.0-alpha.20

2 months ago

1.0.0-alpha.19

2 months ago

1.0.0-alpha.18

2 months ago

1.0.0-alpha.17

2 months ago

1.0.0-alpha.16

3 months ago

1.0.0-alpha.15

3 months ago

1.0.0-alpha.14

3 months ago

1.0.0-alpha.13

3 months ago

1.0.0-alpha.12

4 months ago

1.0.0-alpha.11

4 months ago

1.0.0-alpha.9

4 months ago

1.0.0-alpha.8

6 months ago

1.0.0-alpha.7

7 months ago

1.0.0-alpha.6

7 months ago

1.0.0-alpha.5

8 months ago