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

Casper Wallet | Signature request | Show called contract hash #486

Open
davidatwhiletrue opened this issue Jan 25, 2023 · 2 comments
Open
Assignees
Labels
blocked by design Blocked by design

Comments

@davidatwhiletrue
Copy link
Member

In this screen, it would be helpful to show the contract hash that's being called. If the call is via the contract package, then show the contract package hash and the version number.

image

@adammake adammake self-assigned this Feb 3, 2023
@piotrwitek
Copy link
Contributor

piotrwitek commented Feb 13, 2023

I have completed the requirements & dependency analysis of this ticket.
contract hash is available in the deploy, version is an optional argument for StoredVersionContractByHash and it will be shown only when provided, in case it's empty we can show latest as it will call the latest version.
Same situation for StoredVersionContractByName @davidatwhiletrue
Furthermore, when a deploy is calling contracts by name we will show the NamedKeys argument.

Blocker: it's also blocked by the design specs @adammake

@piotrwitek piotrwitek removed their assignment Feb 13, 2023
@adammake adammake added blocked by design Blocked by design open beta Important for launch. and removed blocked by design Blocked by design labels Feb 13, 2023
@piotrwitek piotrwitek assigned ost-ptk and unassigned adammake Feb 13, 2023
@ihor
Copy link
Member

ihor commented Feb 13, 2023

@piotrwitek as described, the contract should be displayed to the user on the "Sign" screen. The entry point name alone is insufficient as multiple contracts may have identically named entry points, thus the contract identification is necessary.

There are six different ways of creating a deploy on the Casper network, each of which should have its own representation in the Wallet. The method used to call a deploy can be determined from the session key within the deploy structure.

Below are the six deploy execution types with examples (here is the corresponding definition from the Casper node sources)

Type Session key Example Casper Wallet representation Notes
WASM byte-code ModuleBytes 0000...6127 "Type" field with the word "WASM" as the value. E.g. Type: WASM
On-chain contract called by hash StoredContractByHash 0001...8ae6 "Type" field with the word "Contract call" as value and the "Contract" field with the shortened contract hash with a possibility of full preview, e.g. Type: Contract call and Contract: dead...beef
On-chain contract called by user-defined name StoredContractByName 0009...bf2f1 "Type" field with the word "Contract call" as value and the "Contract" field with the contract name defined by the user, e.g. Type: Contract call and Contract: faucet The alias is defined in the user namespace and works only for the user who defined it.
On-chain contract called by its contract package hash and version StoredVersionedContractByHash 01b6...1b64 "Type" field with the word "Contract call" as value and the "Contract Package" field with shortened contract package hash with a possibility of full preview and "Contract Version" field with the called contract version. E.g. Type: Contract call and Contract Package: dead...beef and Contract Version: latest The version defaults to the latest if omitted
On-chain contract called by user-defined contract package name and version StoredVersionedContractByName 00e21...e966 "Type" field with the word "Contract call" as value and the "Contract Package" field with the contract package name defined by the user and "Contract Version" field with the called contract version. E.g. Type: Contract call and Contract Package: faucet and Contract Version: 1 The version defaults to the latest if omitted. The alias is defined in the user namespace and works only for the user who defined it.
Natively defined transfer contract known as "Native transfer" Transfer 7cc4...fd22 "Type" field with the word "Transfer" as the value. E.g. Type: Transfer

The session key can be found in the raw deploy data in the examples above. Here is a screenshot for the StoredContractByName example:

Screenshot 2023-02-13 at 19 06 44

@piotrwitek piotrwitek added the blocked by design Blocked by design label Feb 15, 2023
@piotrwitek piotrwitek removed the open beta Important for launch. label Mar 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked by design Blocked by design
Projects
None yet
Development

No branches or pull requests

5 participants