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

[BRO-13] Payload decoding in the browser wallet of the CIS3 standard #460

Conversation

Ivan-Mahda
Copy link
Contributor

@Ivan-Mahda Ivan-Mahda commented Apr 4, 2024

Purpose

The browser wallet can also decode the payload field by looking up the parameter schema of the entry_point_name and using this schema to decode the payload. The payload is the input parameter that is sent to the entry_point_name.

Changes

Proposal on how to decode the payload for the CIS3 contract.
Screenshot from 2024-04-15 15-32-01

Checklist

  • My code follows the style of this project.
  • The code compiles without warnings.
  • I have performed a self-review of the changes.
  • I have documented my code, in particular the intent of the
    hard-to-understand areas.
  • (If necessary) I have updated the CHANGELOG.

By submitting the contribution I accept the terms and conditions of the
Contributor License Agreement v1.0

@Ivan-Mahda Ivan-Mahda requested a review from limemloh April 5, 2024 07:07
@limemloh
Copy link
Contributor

limemloh commented Apr 5, 2024

As mentioned in the related issue #279
We cannot make signMessage behave like this, since it won't work reliably and worse it could be triggered for unrelated messages.

Created signCIS3Message method for explicit CIS3 sign
@Ivan-Mahda Ivan-Mahda requested review from limemloh and removed request for limemloh April 9, 2024 17:24
@limemloh limemloh requested a review from soerenbf April 12, 2024 07:18
@limemloh
Copy link
Contributor

Adding @soerenbf as reviewer since he is more familiar with the UI part of the wallet than me

Copy link
Collaborator

@soerenbf soerenbf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know that much about the CIS3 standard; I think @limemloh is better suited to comment on this part (as he already has). It would however be good if you created a small example application under /examples that uses the functionality.

There is an app /examples/two-step-transfer which has a pile of different functionality all inlined in a <script> tag in the html document. You can also find the sponsored transaction example there and adapt it. I would prefer if you created a small isolated (typescript) example though. We usually use vite to do this.

Ivan-Mahda and others added 2 commits April 15, 2024 11:59
Update signCIS3Message parameters, for creating CIS3 message. Now full message will be generated at wallet side.
Copy link
Contributor

@limemloh limemloh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

@soerenbf
Copy link
Collaborator

Are we not doing the example for running this, or what is the resolution on that?

@Ivan-Mahda
Copy link
Contributor Author

Are we not doing the example for running this, or what is the resolution on that?

Yes, after wallet update. I will update example in sponsored transaction Concordium/concordium-dapp-examples#77

@Ivan-Mahda Ivan-Mahda merged commit f30327a into main Apr 23, 2024
7 checks passed
@Ivan-Mahda Ivan-Mahda deleted the BRO-13-payload-decoding-in-the-browser-wallet-of-the-cis3-standard branch April 23, 2024 16:28
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

Successfully merging this pull request may close these issues.

3 participants