use-ink / contracts-ui

Web application for deploying wasm smart contracts on Substrate chains that include the FRAME contracts pallet
https://contracts-ui.substrate.io/
GNU General Public License v3.0
62 stars 48 forks source link

feat: Ethereum accounts #493

Closed JoshOrndorff closed 1 year ago

JoshOrndorff commented 1 year ago

This PR demonstrates how to enable Etheruem-style accounts in the contracts-ui.

Eventually this could solve #492 . But I would request some help from a project maintainer in finishing this up.

This is only a demonstration because this PR, as it is currently written, switches the UI to use ethereum accounts always. Rather we need to provide a setting for the user. Ideally we could add a param to the url so I could link to something like contracts-ui.substrate.io/?account-type=ethereum or similar.

netlify[bot] commented 1 year ago

Deploy Preview for contracts-ui ready!

Name Link
Latest commit f309a1179c84831d2ebfc525bcaa980714bc40e5
Latest deploy log https://app.netlify.com/sites/contracts-ui/deploys/64a30a08e9d73700081558d1
Deploy Preview https://deploy-preview-493--contracts-ui.netlify.app/
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

statictype commented 1 year ago

@JoshOrndorff does the latest commit solve your problem?

JoshOrndorff commented 1 year ago

Wonderful! Yes! This makes the contracts ui detect whether it is dealing with an ethereum chain based on the spec name just like Polkadot JS Apps does.

I'm testing it locally and all is well. I would love it if we could get this change into the hosted contracts UI in time for the PBA on July 10th. Do you think it is possible?

statictype commented 1 year ago

@JoshOrndorff what else is needed? can we merge as is? do we need to support the full list of ethereum chains?

JoshOrndorff commented 1 year ago

For me, there is nothing else needed. This solves the exact problem I had and I'm very grateful for your help :pray: .

do we need to support the full list of ethereum chains?

Some of these chains don't have pallet contracts installed (for example moonbeam does not, and probably many others), so you may prefer to remove those chains. OTOH, it is only a few bytes of source code, and it may make more sense to just keep the list updated with Polkadot JS upstream rather than have your own process. IMO I would just keep the whole list, but if you want to make it smaller, I think that is fine.

For me the only spec name you must keep is frontier-template because that's the one I'm starting from.

JoshOrndorff commented 1 year ago

Hooray! Thank you for your help @statictype . Very much appreciated. The students at PBA will have a fun time working on contracts with this UI feature.