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

Formatting for Offer Args #114

Open
0xpatrickdev opened this issue Jul 20, 2023 · 0 comments
Open

Formatting for Offer Args #114

0xpatrickdev opened this issue Jul 20, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@0xpatrickdev
Copy link
Member

What is the Problem Being Solved?

Zoe offers sometimes have a fourth argument, offerArgs, that is an object that can take any arbitrary shape. It is currently displayed in the offer modal under "Arguments", with a Details dropdown that contains a json-like object with capData.

CapData can be challenging for non-developers and humans to read, so it should be presented in a readable format.

Description of the Design

The offer object should be transformed from cap data (makeMarshal(..).fromCapData()), so Brands, Amounts, Ratios, and BigInts are presented in a human-readable format. This could mean a list/table instead of json-like object syntax, and petnames + logos for Brands/Amounts of recognized issuers.

Someone more knowledgeable can comment on what the shape of most offerArgs will look like out in the wild, but if we can assume they are usually flat - each key resolves to a string, bigint, brand, amount, or ratio, and not an object or an array - I think it would help simply the requirements for the UI design. If offerArgs is a deeply nested object, the labels for the values could be something like foo.bar[0] or foo.bar.0.

Security Considerations

It is safer for wallet users if this data is displayed in a readable manner.

Test Plan

makeBidInvitation in the inter auction contracts leverages offerArgs and could be a good testing ground.

@0xpatrickdev 0xpatrickdev added the enhancement New feature or request label Jul 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant