humanprotocol / hmt-escrow

A Python 3 library to launch escrow contracts onto the HUMAN network.
MIT License
24 stars 42 forks source link

Add BSC and become the official maintainer for this network integration #335

Closed Human-Protocol closed 1 year ago

Human-Protocol commented 2 years ago

HMT-Escrow supports arbitrary EVM networks but there's a bit of work to do to make a network first class and make sure that it works. All of our EVM network launches are supported by gitcoin but you can gain a yearly bonus by being our network sponsor. If you need support please join tech-discussions on the human protocol discord linked on hmt.ai.

Steps to receive gitcoin bounty

gitcoinbot commented 2 years ago

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


This issue now has a funding of 5.0 BNB (1087.35 USD @ $217.47/BNB) attached to it as part of the humanprotocol fund.

gitcoinbot commented 2 years ago

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


Work has been started.

These users each claimed they can complete the work by 2 months, 1 week ago. Please review their action plans below:

1) jokoanwarr has applied to start work _(Funders only: approve worker | reject worker)_.

I want to try and am interested in this project.

hope it can help you 2) leetdev has been approved to start work.

I have read and understand the requirements of this integration. I would happily set up the contracts and create the bridging app for the front-end functionality. My previous attempt at contribution to Human Protocol got cut short, hopefully I can get another opportunity!

Learn more on the Gitcoin Issue Details page.

developerfred commented 2 years ago

@Human-Protocol can you assign me to this task?

foufrix commented 2 years ago

Hi @developerfred, it would be nice to finish the Avalance integration first that you started months ago: https://github.com/humanprotocol/human-protocol/issues/137 How are you on this?

foufrix commented 2 years ago

Hi @leetdev, reply to this issue so that I can assign it to you. Then don't hesitate to hop on the discord server (which can be found here https://www.humanprotocol.org/) and if you need tech-related help ask in tech-discussion, good luck on your task :)

leetdev commented 2 years ago

Hi @leetdev, reply to this issue so that I can assign it to you. Then don't hesitate to hop on the discord server (which can be found here https://www.humanprotocol.org/) and if you need tech-related help ask in tech-discussion, good luck on your task :)

Thanks! I'm already on your Discord, I will be sure to ask if I need anything.

foufrix commented 2 years ago

Hi @leetdev, Is everything good on your side? Did you manage to make progress on this task? If you need any help don't hesitate to reach out here or on Discord

leetdev commented 2 years ago

Hi @foufrix, it's been a bit of a slow start for me on this issue because I've been somewhat busy with other tasks, but I've been familiarizing myself with your other integrations and figuring out a strategy. I should be able to fully commit in the next few days, I'll present my ideas then.

foufrix commented 2 years ago

Hi, @leetdev any updates?

leetdev commented 2 years ago

Hi @foufrix, my apologies for the delay. I got pretty much everything figured out, just need to do a write-up, but then I managed to catch COVID and was out of commission for almost a week. I'm better now, and hoping to get the detailed write-up of the integration plan finished by tomorrow.

foufrix commented 2 years ago

@leetdev thank you for the quick update! Hope you are well now and out of Covid 🙏 . Awesome for the write-up!

foufrix commented 2 years ago

Hi, @leetdev hope you are feeling better, do you have an update on this task?

foufrix commented 2 years ago

Hi @leetdev, possible to have an update?

leetdev commented 2 years ago

Hi @foufrix, so sorry for the delay, I somehow forgot to respond the last time you asked.

There were some complications with my illness that made it pretty much impossible for me to get any work done. I am finally recovering now and hopefully I can finally present my ideas tomorrow. I've had some time to think about this stuff, and I have a few ideas on how to do the bridging (I think my initial approach might have actually been unnecessarily complicated). I'll just need a little time to do some research.

foufrix commented 2 years ago

Hi @leetdev, Do you have any updates? We want to move a bit faster on this. If we have no news on that issue after 3 days I will have to let the opportunity to someone else.

leetdev commented 2 years ago

Hi @foufrix,

Here are the results on my research on bridging tokens between the two networks. There are more options available, but I picked two existing solutions that seemed the most promising, as well as using a custom solution.

  1. cBridge

According to my research, this one probably has the lowest fees for bridging tokens. However, to get a token listed, it is my understanding that it needs to be manually negotiated with the network operators.

  1. Multichain (previously AnySwap)

Probably easiest to set up, as their site has the application form for adding tokens to their system.

  1. Create a dedicated bridge service

There are multiple solutions for setting up a dedicated bridge. The downside is that it needs to be hosted separately, and setup is more complicated and technical than using any of the existing solutions. If we decide to go down this route I will share the details as to available options.


I apologize again for the delays. Catching Covid at the worst possible time and having it last for so long created many complications in my life. I am now back to full availability, however, and am ready to move on with this project.

foufrix commented 2 years ago

Hi @leetdev, thank you for your quick reply! Hope you are now well. Sorry to be a bit direct but lots of candidates go AOL, and it's complicated for us to know if people are still dedicated to the tasks or don't care anymore. Happy to see that you still want to contribute! We are already using Multichain for the Polygon <=> ETH bridge so you can go with this solution

leetdev commented 2 years ago

Hi @foufrix, no problem, I completely understand.

As for setting up the token bridge, I filled out their application, but it turns out someone with an official email address needs to verify it. We have 2 options - either 1. someone from within the organization sets it up (https://dard6erxu8t.typeform.com/to/C7RwF08A), or 2. I can forward the email to an official address, and we can complete the verification from there. Let me know which one you would prefer.

In the mean time, I'm working on setting everything up on the testnet.

foufrix commented 2 years ago

@posix4e @Jalal-1 need your help on that, do we have an official account already with Multichain ?

Human-Protocol commented 2 years ago

Hey @foufrix and @leetdev I (@ansaqib) am here and I can help with this. We already are using multichain, this bridge is needed from Polygon to BSC?

Human-Protocol commented 2 years ago

Multichain said that there is a request for ETH to BSC

foufrix commented 2 years ago

@leetdev the bridge is needed from Polygon to BSC, we are requesting also from ETH to BSC, waiting for multichain answer

leetdev commented 2 years ago

@foufrix and @Human-Protocol - I submitted a request for the ETH-BSC bridge the other day, which is probably why it was blocked. I've sent them an email to cancel my request so you guys can resubmit it officially.

In the mean time, I've setup contracts on BSC testnet, working on testing it using the fortune app now. I will post all my results here when complete. After that, all that is left to do is deploy the contracts to BSC mainnet, verify that everything works, update documentation, and add to dashboard. I will work on all that as soon as the bridge is live and we have an official address for the token on the mainnet.

foufrix commented 2 years ago

@leetdev this is awesome, you've grasped everything that needs to be done. For the fortune app if you have trouble to make it works on tesnet, do not hesitate to ping me or @Jalal-1 You can also check the PR made by me and issue created on fortune to understand how to configure it.

leetdev commented 2 years ago

@Human-Protocol FYI, I got a response from Multichain telling me they've canceled my request for the ETH-BSC bridge. Please let me know the HMT token address on BSC once the bridge has been set up.

I'll also need some BNB and HMT for deploying the contracts and testing. You can send it to 0x922F80dC06342861CAf5Dcd16FcAd33500a9c1C9 (this is the address I'll be deploying the contracts from, created from a dedicated seed).

@foufrix, I got the fortune app to work just fine, except for some reason it's not detecting the Launched event that updates the created escrow address in the UI. Not something that blocks the testing in any way, just a peculiarity. Might have something to do with the RPC node I'm using in Metamask, idk.

Human-Protocol commented 2 years ago

Will keep you posted about the bridge, thanks for testing out fortune app. How much HMT and BNB you would be needing and on which network?

leetdev commented 2 years ago

I think 0.1 BNB should be enough. As for HMT, 20 should suffice. The network is BSC Mainnet, so obviously when it comes to HMT it'll have to wait until the bridge is up.

leetdev commented 2 years ago

@Human-Protocol Looks like Multichain has deployed the token contract at 0x0d501b743f22b641b8c8dfe00f1aab881d57ddc7. Can you send the BNB and HMT to 0x922F80dC06342861CAf5Dcd16FcAd33500a9c1C9 as discussed so I can complete setting things up?

Human-Protocol commented 2 years ago

Yes that’s correct, we will get HMT and BNB to you by Monday

foufrix commented 2 years ago

Hi @leetdev fund has been sent, 0.2 BNB on BSC chain and 50 HMT on Polygon chain to bridge to BSC using multichain If you need anything don't hesitate to reach out here or on Discord

leetdev commented 2 years ago

@foufrix thanks! I've set up the contracts and created a PR. I'm going to bridge over the HMT and make a test run on the mainnet.

I'm also currently in the process of adding the new integration to the dashboard, however I'm a little confused right now as to the subgraph part of the task. Should I deploy my own subgraph and add that to dashboard configuration, or will it be set up separately on the official humanprotocol thegraph? Past approaches seem inconsistent to say the least, there's still open PRs regarding that from months ago, etc. Some clarification on that would be much appreciated.

leetdev commented 2 years ago

Actually, it turns out the minimum amount for the Polygon-BSC bridge is 100 HMT because the minimum fee is almost 50 HMT:

image
foufrix commented 2 years ago

Thanks for the quick reply @leetdev !

@ansaqib if you can send 100 more HMT would be nice so that @leetdev have enough to work with

@vkomodey do you know the answer for the subgraph part on dashboard?

Human-Protocol commented 2 years ago

Sure I will send out more HMT in like 30 mins from now

leetdev commented 2 years ago

@Human-Protocol I'm not seeing anything in the wallet yet. By the way, 50 more HMT is enough, I just need 100 in total to bridge it over to BSC.

ansaqib commented 2 years ago

You should have it now @leetdev

leetdev commented 2 years ago

I've successfully verified that the contracts are working on BSC. The only thing left to do is to add the new network to the dashboard. For that, I've created a new branch in my fork of the humansubgraph repository, but in order to create a PR, the branch needs to be added to the main repository. Could someone with access create a bsc branch? Additionally, humanprotocol/bsc should be created in thegraph hosted service.

leetdev commented 2 years ago

Steps to receive gitcoin bounty

leetdev commented 2 years ago

FYI, the gitcoin issue for this bounty has expired. Can you update its expiration date so I can post my submission? Alternatively, you can payout the bounty directly to the following address on BSC: 0x171a84d58dA4d9B065B462e77ab5C1A81Efe7B5b

foufrix commented 2 years ago

@leetdev awesome thanks for your contribution 🙏 . I need some validation from the tech team. To me, all appear good except the comment I've put to join the deployment of the 2 contracts on humanprotocol/hmt-escrow#354 @Jalal-1 or @vkomodey can you confirm that everything is good on your side?

For payment, @ansaqib will handle that directly once the tech team validates everything

For the official Maintainer role can you fill this: https://humanprotocol.typeform.com/to/WRxcX2C9 ? Someone will reach out to you to finalize it. Note that we will need some KYC for that.

leetdev commented 2 years ago

I've filled out the ambassador form. Note that none of the roles in the form really fit this role of a network integration maintainer, so I just picked HUMAN Emissary. I'll be available via email or discord to follow up on KYC.

posix4e commented 2 years ago

We no longer use the human subgraph rep. It is all in hmt-escrow now

ansaqib commented 2 years ago

I've successfully verified that the contracts are working on BSC. The only thing left to do is to add the new network to the dashboard. For that, I've created a new branch in my fork of the humansubgraph repository, but in order to create a PR, the branch needs to be added to the main repository. Could someone with access create a bsc branch? Additionally, humanprotocol/bsc should be created in thegraph hosted service.

humansubgraph is merged into hmt-escrow, you shouldn't need humanprotocol/bsc

leetdev commented 2 years ago

Thanks, I didn't realize it had been moved. I've added a commit adding subgraph deployment to humanprotocol/hmt-escrow#354.

gitcoinbot commented 2 years ago

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


Work for 5.0 BNB (1400.25 USD @ $280.05/BNB) has been submitted by:

  1. @leetdev

@human-protocol please take a look at the submitted work:


foufrix commented 2 years ago

Hi @leetdev, your contribution is currently being reviewed by the team. Almost done! Thank you for your awesome job 🙏

posix4e commented 2 years ago

Reverted https://github.com/humanprotocol/hmt-escrow/pull/365

foufrix commented 2 years ago

Grant paid out, Leetdev KYC done (official BSC maintainer), but graph indexation is currently failing. (https://github.com/humanprotocol/hmt-escrow/pull/365)

foufrix commented 2 years ago

BSC graph indexation now working. Shall we re-revert humanprotocol/hmt-escrow#365 @posix4e ?

foufrix commented 2 years ago

humanprotocol/hmt-escrow#373 merged, normally we are good