wallet icon indicating copy to clipboard operation
wallet copied to clipboard

feat(OFAC compliance): Block Sanctioned Countries (RET-343)

Open Samuel3Shin opened this issue 2 years ago • 3 comments

Description

Blocks 4 sanctioned countries

Cuba: CU Iran: IR North Korea: KP Syria: SY

Screen Shot 2022-08-18 at 8 34 56 AM

Other changes

N/A

Tested

With iOS emulator

How others should test

With iOS emulator

Related issues

  • https://linear.app/valora/issue/RET-343/block-sanctioned-countries-for-ofac-compliance-346

Backwards compatibility

Yes

Samuel3Shin avatar Aug 18 '22 05:08 Samuel3Shin

RET-343 Block Sanctioned Countries for OFAC compliance #346

Description

Block Cuba, Iran, North Korea, and Syria IP's from using the Wallet. Blocking the cloud functions from working on these IP's seems sufficient to disable the wallet.

First step:

  • create a new full-screen screen in the app (repurpose the design for generic app errors)
  • for users in the above geo's, display this screen
  • should say something like "sorry, Valora is not support in your location"
  • use the user location cloud function to determine geo

Next steps (not in scope for this ticket)

Some options include:

linear[bot] avatar Aug 18 '22 05:08 linear[bot]

Codecov Report

Merging #2793 (d310736) into main (568ef28) will increase coverage by 0.00%. The diff coverage is 88.88%.

:exclamation: Current head d310736 differs from pull request most recent head 807ebd8. Consider uploading reports for the commit 807ebd8 to get more accurate results

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #2793   +/-   ##
=======================================
  Coverage   79.84%   79.85%           
=======================================
  Files         608      608           
  Lines       22017    22022    +5     
  Branches     4010     4012    +2     
=======================================
+ Hits        17580    17586    +6     
+ Misses       4386     4385    -1     
  Partials       51       51           
Impacted Files Coverage Δ
src/home/CashInBottomSheet.tsx 97.14% <ø> (ø)
src/home/WalletHome.tsx 97.82% <75.00%> (-1.04%) :arrow_down:
src/config.ts 97.40% <100.00%> (ø)
src/navigator/Screens.tsx 100.00% <100.00%> (ø)
src/utils/countryFeatures.ts 100.00% <100.00%> (ø)
src/tokens/utils.ts 97.05% <0.00%> (-2.95%) :arrow_down:
src/localCurrency/consts.ts 100.00% <0.00%> (ø)
src/web3/saga.ts 80.80% <0.00%> (+3.03%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update eb38639...807ebd8. Read the comment docs.

codecov[bot] avatar Aug 18 '22 05:08 codecov[bot]

Tested using an Android 12 Device with a VPN.

MuckT avatar Aug 24 '22 01:08 MuckT

@kathaypacific @jean - since there's been quite a few changes since the approval I thought another look would be good. I am not sure why 9a5cc1d2928bcfe83bee67d9f837be9aac36057e was needed to make the tests pass.

MuckT avatar Aug 24 '22 19:08 MuckT

although not sure why WalletHome would be mounted anyway :| if it's just racing the WalletHome rendering and determining the user country, having the hack in the navigator might also show the cash in bottom sheet? not sure what is best, i'm also okay with the hack in the navigator (but it does feel intrusive to have it there, it's so global...)

kathaypacific avatar Aug 26 '22 14:08 kathaypacific

Yes in most cases WalletHome will not be mounted. It's only for users switching from a non-sanctionned to a sanctionned country that it can happen.

jeanregisser avatar Aug 26 '22 14:08 jeanregisser

@jeanregisser I had not pushed my change to shouldShowCashInBottomSheet prior to merging. I think it's ok to leave as is since it's just an additional check, but it can be removed.

    // If user is in a sanctioned country do not show the cash in bottom sheet
    if (userInSanctionedCountry) {
      return false
    }

MuckT avatar Aug 26 '22 19:08 MuckT

Hey @MuckT we have verified the above task on latest Android Internal Release build V 1.40.1 and latest iOS Test Flight Release build V 1.40.1 and below is our observation

Observation : We are able to proceed to phone number page after applying neighboring countries VPN as instructed in the weekly meet

1] For Cuba - used Mexico VPN 2] For Iran - used Turkey VPN 3] For Syria - used Turkey VPN 4] For North Korea - Used Seoul VPN

Thanks.!!

ValoraQA avatar Sep 13 '22 09:09 ValoraQA