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

Wallet Tx Security Provider: Warning Message #16258

Closed
ElvirCe opened this issue Oct 24, 2022 · 9 comments · Fixed by #17662
Closed

Wallet Tx Security Provider: Warning Message #16258

ElvirCe opened this issue Oct 24, 2022 · 9 comments · Fixed by #17662
Assignees
Labels
area-transactions PS-team PS MM extension team issues team-confirmations-secure-ux DEPRECATED: please use "team-confirmations" label instead type-enhancement

Comments

@ElvirCe
Copy link

ElvirCe commented Oct 24, 2022

User Story

As a user, I want my tx security provider to be able to flag transactions and signature requests as malicious in my confirmation screen.

User research request:
OpenSea Collab - Tx Security Provider

User story

Resources

Acceptance Criteria

  1. User gets prompted a transaction request
  2. If an unsigned transaction or signature request payload is flagged as malicious then:
  3. A warning message is shown to the user in the transaction confirmation screen as in design
  4. Users should be able to still proceed with the transaction if they want to by clicking on the "Confirm" button
@ElvirCe
Copy link
Author

ElvirCe commented Dec 15, 2022

@bschorchit the original requirement was to create only one message with the copy: “OpenSea has reviewed this request and is flagging it as malicious. Approving it could lead to a loss of funds. Proceed with caution.”
I see that the design has been updated and will put the ticket on hold until we groom it out and clarify everything.

@bschorchit
Copy link

bschorchit commented Dec 22, 2022

  • This should be shown whenever the API response data has flagAsDangerous with value 1. The copy will change based on the response data. The bold part is the reason_header and the copy below the reason from the API response data.

  • This should be shown whenever the API response data has flagAsDangerous with value 2. Copy won't vary with response data.

  • This should be shown whenever an error occur and we're not able to get a response data from the API.

  • When the API response data has flagAsDangerous with value 0, no warning or message should be shown.

@ElvirCe
Copy link
Author

ElvirCe commented Dec 22, 2022

@bschorchit we will need the URL for the OpenSea link and also please note that the messages are a new component since we don't have them anywhere like this so the scope of the ticket will have to be expanded.

@bschorchit
Copy link

url is this: https://opensea.io/

@bschorchit
Copy link

bschorchit commented Dec 22, 2022

please note that the messages are a new component since we don't have them anywhere like this so the scope of the ticket will have to be expanded.

Thanks for pointing this out, Elvir. I agree with expanded scope, but just want to have this component reviewed by design system team before we add it.
@georgewrmarshall could you kindly confirm if the warning component being used in the design matches our patterns and design system before we go ahead with it?
Here's the link for the designs: https://www.figma.com/file/Q69vHaA7Or7Rxz4vdzjVHC/Support-for-tx-security-providers-(MVP)?node-id=4986%3A26901&t=H3PgEpqvjHPr1hnS-0

@garrettbear
Copy link
Contributor

I'm working on the Banner component right now that would be used here. In the meantime, the BannerBase component can be easily used with a few color prop modifications.

BannerBase Docs

When the Banner component is completed, I will be sure to have this swapped out properly.

Would look something like this:

<BannerBase
      title="This could be a scam"
      startAccessory={<Icon name={ICON_NAMES.DANGER_FILLED} size={SIZES.LG} />}
      color={COLORS.ERROR_DEFAULT}
      backgroundColor={COLORS.ERROR_MUTED}
      className="mm-banner--type-error"
    >
      <Text>
        Approval is to an unverified smart contract known for stealing NFTs in
        the past.
      </Text>
      <Text color={COLORS.TEXT_ALTERNATIVE} size={TEXT_VARIANTS.BODY_SM}>
        This is based on information from{' '}
        <ButtonLink
          size={SIZES.INHERIT}
          href="https://opensea.io/"
          target="_blank"
        >
          OpenSea
        </ButtonLink>
        .
      </Text>
    </BannerBase>

You'll need to add a class to update the color for the border:

.mm-banner--type-error {
   border-left: 4px solid var(--color-error-default);
}

Ping me with questions

@garrettbear
Copy link
Contributor

Got a PR opened for the Banner component so it may be ready in time!

Banner Component

@ElvirCe
Copy link
Author

ElvirCe commented Jan 24, 2023

We are blocked on this ticket until the Banner component gets merged.

@bschorchit
Copy link

Banner has been merged, @ElvirCe
Thanks, @garrettbear!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-transactions PS-team PS MM extension team issues team-confirmations-secure-ux DEPRECATED: please use "team-confirmations" label instead type-enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants