Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some minor and general questions regarding the details of Hop protocol #76

Open
NIC619 opened this issue Jun 17, 2021 · 0 comments
Open

Comments

@NIC619
Copy link

NIC619 commented Jun 17, 2021

Hi friends, I've read through the Hop protocol white paper and the contracts. Amazing work!
I've had some minor and general questions regarding the details of Hop protocol. I can not find other ways to get in touch so I just post them here. Let me know if I should post them somewhere.

  1. the two links in Diagram section in readme do not seem to be the correct ones

  2. don't know if it's just me, but the transferFromBridge/transferToBridge functions create a small confusion for me:

  • transferFromBridge actually transfer "to" some address while transferToBridge actually transfer "from" some address
  • function _transferFromBridge(address recipient, uint256 amount) internal override {
    l1CanonicalToken.safeTransfer(recipient, amount);
    }
    function _transferToBridge(address from, uint256 amount) internal override {
    l1CanonicalToken.safeTransferFrom(from, address(this), amount);
    }
  1. swapAndSend function mentioned in readme seems to reside in L2_AmmWrapper contract instead of L2_bridge.
    Are they refering to the same contract?

4-1. I see that L2_Bridge inherit Bridge contract so it will also have bondWithdrawal function. I think it's possible that a bonder accidentally call bondWithdrawal on L2_bridge contract? (though not really a big deal)
4-2. these two functions seem to differ only in whether they have AMM swap functionality or not?

  1. in Expected contract invocation section in readme
  • the L2 -> L2 (bonder offline) case says:
    • ...
    • ...
    • Wait for the sending layer-2 to be confirmed on layer-1 (approximately 7 days)
    • User or Relayer calls L2_Bridge.withdraw() on the receiving layer-2

are there any more steps or wait time between these last two steps?
if I understand correctly, even if sending layer-2 is confirmed on layer-1, it doesn't mean the state on receiving layer-2 is updated immediately?

  1. Can you explain more on this part in the Expected usage section in readme?
    "Credit is added to the Bonder's credit account each time transactions (from/to any chain) are successfully confirmed on layer-1. Debit is added to the Bonder's debit account each time transactions are sent (from/to any chain) but not yet confirmed on layer-1."
    6-1. what kind of transactions are to be confirmed? transfer? withdraw? bondWithdraw?
    6-2. what would be the circumstances where transactions are sent but not yet confirmed on layer-1?
    (it would be helpful to better understand what type of transactions and in what circumstances would have an affect on both credit and debt)

  2. if there's transferId for each transfer, it seems it should be able to prevent multiple bonder bonding for same transfer at the same time?

  3. do you have guidelines for how to become a bonder? it would be really helpful for us to better understand the protocol and assessing the risk!

Thanks alot!

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

No branches or pull requests

1 participant