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
61 stars 44 forks source link

feat: reuse known metadata when adding already deployed contracts #545

Closed peetzweg closed 4 months ago

peetzweg commented 4 months ago

Closes #464

The Dropdown allows to choose any metadata the frontend already knows about. However it's only visible and preselects the metadata which matches with the codeHash with the onchain contract.

I'm not sure if we should allow for this. Could a metadata be valid and usable if the codeHash is not the same? Afaik the metadata is compatible with any contract as long as the messages and events are the same, right?

https://github.com/paritytech/contracts-ui/assets/839848/205c930e-e780-4771-97f4-0a7ab30f8008

netlify[bot] commented 4 months ago

Deploy Preview for contracts-ui ready!

Name Link
Latest commit d0b8192dc360b6df7359359e4c20caf3c058281c
Latest deploy log https://app.netlify.com/sites/contracts-ui/deploys/65d8b0f0c0351b0008e71f74
Deploy Preview https://deploy-preview-545--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.

cypress[bot] commented 4 months ago

Passing run #362 ↗ī¸Ž

0 61 0 0 Flakiness 0
⚠ī¸ You've recorded test results over your free plan limit.
Upgrade your plan to view test results.

Details:

Merge d0b8192dc360b6df7359359e4c20caf3c058281c into 9db9e44f9437811e856aabf50501...
Project: Contracts UI Commit: 14da14df00 ℹī¸
Status: Passed Duration: 01:47 💡
Started: Mar 4, 2024 4:25 PM Ended: Mar 4, 2024 4:27 PM

Review all test suite changes for PR #545 ↗ī¸Ž

cmichi commented 4 months ago

Could a metadata be valid and usable if the codeHash is not the same?

Yes this is fine. Use cases are e.g. the metadata for an upgradeable contract where metadata passed out to users of a dApp is different from the metadata an "admin" would use.

Or for the ink! workshop we also gave out different metadata, just to simplify things for workshop attendees. The metadata they used didn't contain any privileged function.

cypress[bot] commented 4 months ago

Passing run #366 ↗ī¸Ž

0 61 0 0 Flakiness 0
⚠ī¸ You've recorded test results over your free plan limit.
Upgrade your plan to view test results.

Details:

feat: reuse known metadata when adding already deployed contracts (#545)
Project: Contracts UI Commit: 27a145f112
Status: Passed Duration: 01:28 💡
Started: Mar 5, 2024 12:45 PM Ended: Mar 5, 2024 12:46 PM

Review all test suite changes for PR #545 ↗ī¸Ž