From f1d07bd3c76d196f0dbfd1fe547d751cd899eac6 Mon Sep 17 00:00:00 2001 From: Ansaf Ahmed <40786269+1saf@users.noreply.github.com> Date: Wed, 29 Jun 2022 14:17:33 +1000 Subject: [PATCH] TRM Sanctioned Wallets (#2017) * New footer * Minor primary navigation updates * Reformat default locales file to 2 spaces indent * feature: 3rd party modals * cp * feature: TRM checking for wallets * fix: typo * Update privacy policy * Updated privacy policy text * Top align icons * Updated Balancer entities * replace dashes * Updated compliance text * Tweaks to the new 3rd party services modal * Minor style tweaks * final touches * Updating the policies * Update cookie policy date * Updated licenses * fix: grants url Co-authored-by: pkattera Co-authored-by: Tim Robinson --- LICENSE | 2 +- public/manifest.json | 2 +- src/App.vue | 26 +- src/assets/css/global/all.css | 1 + src/assets/css/global/social-icons.css | 22 ++ src/assets/images/services/TRM-labs.svg | 5 + src/assets/images/services/alchemy.svg | 13 + .../images/services/fathom-analytics.svg | 10 + .../images/services/google-analytics.svg | 7 + src/assets/images/services/infura.svg | 5 + src/assets/images/services/sentry.svg | 5 + src/assets/images/services/the-graph.svg | 4 + src/components/_global/BalModal/BalModal.vue | 2 +- src/components/footer/Footer.vue | 288 +++++++++++++++ src/components/icons/IconDiscord.vue | 35 ++ src/components/icons/IconGithub.vue | 35 ++ src/components/icons/IconLinkedin.vue | 33 ++ src/components/icons/IconMail.vue | 33 ++ src/components/icons/IconMedium.vue | 37 ++ src/components/icons/IconTwitter.vue | 35 ++ src/components/icons/IconYoutube.vue | 37 ++ src/components/icons/LogotypeBalancer.vue | 45 +++ src/components/images/AppLogo.vue | 39 +- src/components/navs/AppNav/AppNav.vue | 2 +- .../navs/AppNav/AppSidebar/SidebarContent.vue | 2 +- .../AppNav/DesktopLinks/DesktopLinkItem.vue | 3 +- .../navs/AppNav/DesktopLinks/DesktopLinks.vue | 2 +- src/components/web3/SanctionedWalletModal.vue | 14 + .../web3/ThirdPartyServicesModal.vue | 61 ++++ src/components/web3/WalletSelectModal.vue | 15 +- src/constants/exploits.ts | 3 + src/constants/links.ts | 17 +- src/locales/default.json | 25 +- src/pages/_layouts/ContentLayout.vue | 8 +- src/pages/_layouts/DefaultLayout.vue | 29 +- src/pages/cookies-policy.vue | 18 +- src/pages/privacy-policy.vue | 155 ++++---- src/pages/terms-of-use.vue | 341 ++++++++++-------- src/services/web3/useWeb3.ts | 4 +- src/services/web3/web3.plugin.ts | 23 +- 40 files changed, 1161 insertions(+), 282 deletions(-) create mode 100644 src/assets/css/global/social-icons.css create mode 100644 src/assets/images/services/TRM-labs.svg create mode 100644 src/assets/images/services/alchemy.svg create mode 100644 src/assets/images/services/fathom-analytics.svg create mode 100644 src/assets/images/services/google-analytics.svg create mode 100644 src/assets/images/services/infura.svg create mode 100644 src/assets/images/services/sentry.svg create mode 100644 src/assets/images/services/the-graph.svg create mode 100644 src/components/footer/Footer.vue create mode 100644 src/components/icons/IconDiscord.vue create mode 100644 src/components/icons/IconGithub.vue create mode 100644 src/components/icons/IconLinkedin.vue create mode 100644 src/components/icons/IconMail.vue create mode 100644 src/components/icons/IconMedium.vue create mode 100644 src/components/icons/IconTwitter.vue create mode 100644 src/components/icons/IconYoutube.vue create mode 100644 src/components/icons/LogotypeBalancer.vue create mode 100644 src/components/web3/SanctionedWalletModal.vue create mode 100644 src/components/web3/ThirdPartyServicesModal.vue diff --git a/LICENSE b/LICENSE index 7c9b3702db..53a24d1ec2 100755 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) Balancer Labs +Copyright (c) Balancer Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/public/manifest.json b/public/manifest.json index 2dbea3286b..9d6a69d797 100644 --- a/public/manifest.json +++ b/public/manifest.json @@ -3,7 +3,7 @@ "name": "Balancer", "description": "Swap tokens and manage your assets on Balancer Protocol", "providedBy": { - "name": "Balancer Labs", + "name": "Balancer", "url": "https://balancer.fi" }, "icons": [ diff --git a/src/App.vue b/src/App.vue index 2239ba8161..3ebc05b9df 100644 --- a/src/App.vue +++ b/src/App.vue @@ -6,6 +6,7 @@ import { useRoute } from 'vue-router'; import { useStore } from 'vuex'; import Notifications from '@/components/notifications/Notifications.vue'; +import ThirdPartyServicesModal from '@/components/web3/ThirdPartyServicesModal.vue'; import WalletSelectModal from '@/components/web3/WalletSelectModal.vue'; import useWeb3Watchers from '@/composables/watchers/useWeb3Watchers'; import { DEFAULT_TOKEN_DECIMALS } from '@/constants/tokens'; @@ -14,6 +15,7 @@ import useWeb3 from '@/services/web3/useWeb3'; import GlobalModalContainer from './components/modals/GlobalModalContainer.vue'; import AppSidebar from './components/navs/AppNav/AppSidebar/AppSidebar.vue'; +import SanctionedWalletModal from './components/web3/SanctionedWalletModal.vue'; import useBackgroundColor from './composables/useBackgroundColor'; import useGnosisSafeApp from './composables/useGnosisSafeApp'; import useNavigationGuards from './composables/useNavigationGuards'; @@ -24,11 +26,15 @@ import usePoolCreationWatcher from './composables/watchers/usePoolCreationWatche BigNumber.config({ DECIMAL_PLACES: DEFAULT_TOKEN_DECIMALS }); +export const isThirdPartyServicesModalVisible = ref(false); + export default defineComponent({ components: { ...Layouts, VueQueryDevTools, WalletSelectModal, + SanctionedWalletModal, + ThirdPartyServicesModal, Notifications, AppSidebar, GlobalModalContainer @@ -39,7 +45,6 @@ export default defineComponent({ * STATE */ const layout = ref('DefaultLayout'); - /** * COMPOSABLES */ @@ -51,7 +56,8 @@ export default defineComponent({ useNavigationGuards(); const { isWalletSelectVisible, - toggleWalletSelectModal + toggleWalletSelectModal, + isSanctioned // isMainnet } = useWeb3(); const route = useRoute(); @@ -77,6 +83,10 @@ export default defineComponent({ store.dispatch('app/init'); }); + function handleThirdPartyModalToggle(value: boolean) { + isThirdPartyServicesModalVisible.value = value; + } + /** * WATCHERS */ @@ -92,11 +102,14 @@ export default defineComponent({ return { // state layout, + isSanctioned, + isThirdPartyServicesModalVisible, // computed isWalletSelectVisible, sidebarOpen, // methods - toggleWalletSelectModal + toggleWalletSelectModal, + handleThirdPartyModalToggle }; } }); @@ -109,9 +122,14 @@ export default defineComponent({ - + + diff --git a/src/assets/css/global/all.css b/src/assets/css/global/all.css index ded29f3c29..132220116a 100644 --- a/src/assets/css/global/all.css +++ b/src/assets/css/global/all.css @@ -2,6 +2,7 @@ @import "./typography.css"; @import "./backgrounds.css"; @import "./animations.css"; +@import "./social-icons.css"; html, body { diff --git a/src/assets/css/global/social-icons.css b/src/assets/css/global/social-icons.css new file mode 100644 index 0000000000..ee229b915c --- /dev/null +++ b/src/assets/css/global/social-icons.css @@ -0,0 +1,22 @@ +.social-icon:hover .logo { + fill: #fff; /* gray-900 */ + transform-origin: center; + transform: scale(1.05); +} +.social-icon .bg { + fill: #0f172a; /* gray-900 */ + @apply transition-all; +} +.social-icon .logo { + fill: #fff; + @apply transition-all; +} +.dark .social-icon:hover .logo { + fill: #fff; +} +.dark .social-icon .bg { + fill: #fff; +} +.dark .social-icon .logo { + fill: #0f172a; /* gray-900 */ +} diff --git a/src/assets/images/services/TRM-labs.svg b/src/assets/images/services/TRM-labs.svg new file mode 100644 index 0000000000..15e92e17d2 --- /dev/null +++ b/src/assets/images/services/TRM-labs.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/assets/images/services/alchemy.svg b/src/assets/images/services/alchemy.svg new file mode 100644 index 0000000000..d6067592a6 --- /dev/null +++ b/src/assets/images/services/alchemy.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/src/assets/images/services/fathom-analytics.svg b/src/assets/images/services/fathom-analytics.svg new file mode 100644 index 0000000000..a5ac4000a8 --- /dev/null +++ b/src/assets/images/services/fathom-analytics.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/src/assets/images/services/google-analytics.svg b/src/assets/images/services/google-analytics.svg new file mode 100644 index 0000000000..3e8bf4b308 --- /dev/null +++ b/src/assets/images/services/google-analytics.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/src/assets/images/services/infura.svg b/src/assets/images/services/infura.svg new file mode 100644 index 0000000000..8691f02ca9 --- /dev/null +++ b/src/assets/images/services/infura.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/assets/images/services/sentry.svg b/src/assets/images/services/sentry.svg new file mode 100644 index 0000000000..76396c173e --- /dev/null +++ b/src/assets/images/services/sentry.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/assets/images/services/the-graph.svg b/src/assets/images/services/the-graph.svg new file mode 100644 index 0000000000..5cfce319d5 --- /dev/null +++ b/src/assets/images/services/the-graph.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/components/_global/BalModal/BalModal.vue b/src/components/_global/BalModal/BalModal.vue index 382f87ccd4..f5c0190d8f 100644 --- a/src/components/_global/BalModal/BalModal.vue +++ b/src/components/_global/BalModal/BalModal.vue @@ -109,7 +109,7 @@ defineExpose({ hide }); } .modal-bg { - @apply absolute h-full w-full bg-black bg-opacity-80; + @apply absolute h-full w-full bg-black bg-opacity-90; } .modal-card { diff --git a/src/components/footer/Footer.vue b/src/components/footer/Footer.vue new file mode 100644 index 0000000000..1ae67b5d69 --- /dev/null +++ b/src/components/footer/Footer.vue @@ -0,0 +1,288 @@ + + + + + diff --git a/src/components/icons/IconDiscord.vue b/src/components/icons/IconDiscord.vue new file mode 100644 index 0000000000..70980bdd48 --- /dev/null +++ b/src/components/icons/IconDiscord.vue @@ -0,0 +1,35 @@ + + + + + diff --git a/src/components/icons/IconGithub.vue b/src/components/icons/IconGithub.vue new file mode 100644 index 0000000000..73f99dcda8 --- /dev/null +++ b/src/components/icons/IconGithub.vue @@ -0,0 +1,35 @@ + + + + + diff --git a/src/components/icons/IconLinkedin.vue b/src/components/icons/IconLinkedin.vue new file mode 100644 index 0000000000..5925173af6 --- /dev/null +++ b/src/components/icons/IconLinkedin.vue @@ -0,0 +1,33 @@ + + + + + diff --git a/src/components/icons/IconMail.vue b/src/components/icons/IconMail.vue new file mode 100644 index 0000000000..ab76e1f720 --- /dev/null +++ b/src/components/icons/IconMail.vue @@ -0,0 +1,33 @@ + + + + + diff --git a/src/components/icons/IconMedium.vue b/src/components/icons/IconMedium.vue new file mode 100644 index 0000000000..5e1d0ee0c1 --- /dev/null +++ b/src/components/icons/IconMedium.vue @@ -0,0 +1,37 @@ + + + + + diff --git a/src/components/icons/IconTwitter.vue b/src/components/icons/IconTwitter.vue new file mode 100644 index 0000000000..766a513319 --- /dev/null +++ b/src/components/icons/IconTwitter.vue @@ -0,0 +1,35 @@ + + + + + diff --git a/src/components/icons/IconYoutube.vue b/src/components/icons/IconYoutube.vue new file mode 100644 index 0000000000..b191e0e31b --- /dev/null +++ b/src/components/icons/IconYoutube.vue @@ -0,0 +1,37 @@ + + + + + diff --git a/src/components/icons/LogotypeBalancer.vue b/src/components/icons/LogotypeBalancer.vue new file mode 100644 index 0000000000..184fff1927 --- /dev/null +++ b/src/components/icons/LogotypeBalancer.vue @@ -0,0 +1,45 @@ + + + + + diff --git a/src/components/images/AppLogo.vue b/src/components/images/AppLogo.vue index 51324da4ab..8df7686ec3 100644 --- a/src/components/images/AppLogo.vue +++ b/src/components/images/AppLogo.vue @@ -1,35 +1,16 @@ + + diff --git a/src/components/navs/AppNav/AppNav.vue b/src/components/navs/AppNav/AppNav.vue index c9a78b2e7e..1686f58f85 100644 --- a/src/components/navs/AppNav/AppNav.vue +++ b/src/components/navs/AppNav/AppNav.vue @@ -57,7 +57,7 @@ onUnmounted(() => { :to="{ name: 'home' }" @click="trackGoal(Goals.ClickNavLogo)" > - + diff --git a/src/components/navs/AppNav/AppSidebar/SidebarContent.vue b/src/components/navs/AppNav/AppSidebar/SidebarContent.vue index 8613eb469b..44f37c2fc6 100644 --- a/src/components/navs/AppNav/AppSidebar/SidebarContent.vue +++ b/src/components/navs/AppNav/AppSidebar/SidebarContent.vue @@ -47,7 +47,7 @@ const ecosystemLinks = [ { label: t('forum'), url: 'https://forum.balancer.fi/' }, { label: t('grants'), - url: 'https://balancer.community/balancer-community-grants' + url: 'http://grants.balancer.community' } ]; diff --git a/src/components/navs/AppNav/DesktopLinks/DesktopLinkItem.vue b/src/components/navs/AppNav/DesktopLinks/DesktopLinkItem.vue index 151f8320fb..ece98de73f 100644 --- a/src/components/navs/AppNav/DesktopLinks/DesktopLinkItem.vue +++ b/src/components/navs/AppNav/DesktopLinks/DesktopLinkItem.vue @@ -11,7 +11,8 @@ const props = withDefaults(defineProps(), { const classes = computed(() => ({ 'border-white dark:border-gray-900': !props.active, - 'border-blue-500 text-blue-500': props.active + 'border-blue-600 dark:border-yellow-500 text-blue-600 dark:text-yellow-500': + props.active })); diff --git a/src/components/navs/AppNav/DesktopLinks/DesktopLinks.vue b/src/components/navs/AppNav/DesktopLinks/DesktopLinks.vue index 8f6ce72266..24e4217d83 100644 --- a/src/components/navs/AppNav/DesktopLinks/DesktopLinks.vue +++ b/src/components/navs/AppNav/DesktopLinks/DesktopLinks.vue @@ -41,7 +41,7 @@ function isActive(page: string): boolean {
{{ $t('claim') }} - +
diff --git a/src/components/web3/SanctionedWalletModal.vue b/src/components/web3/SanctionedWalletModal.vue new file mode 100644 index 0000000000..5dc8ea1f50 --- /dev/null +++ b/src/components/web3/SanctionedWalletModal.vue @@ -0,0 +1,14 @@ + + + diff --git a/src/components/web3/ThirdPartyServicesModal.vue b/src/components/web3/ThirdPartyServicesModal.vue new file mode 100644 index 0000000000..134a7663a6 --- /dev/null +++ b/src/components/web3/ThirdPartyServicesModal.vue @@ -0,0 +1,61 @@ + + + + diff --git a/src/components/web3/WalletSelectModal.vue b/src/components/web3/WalletSelectModal.vue index 92856b846a..aedeca3c7f 100644 --- a/src/components/web3/WalletSelectModal.vue +++ b/src/components/web3/WalletSelectModal.vue @@ -11,8 +11,16 @@ >, - {{ $t('policies.cookiesPolicy') }} - + {{ + $t('policies.cookiesPolicy') + }} , + {{ $t('useOf') }}  + {{ $t('and') }} {{ $t('policies.privacyPolicy') }}; +export const SANCTIONS_ENDPOINT = + 'https://api.trmlabs.com/public/v1/sanctions/screening'; + export const ACTIVE_EXPLOITS: Exploits = { sorbet_finance: { message: `This address is reported to be at risk due to a Sorbet Finance hack. The owner is advised to secure their funds by revoking all approvals now.`, diff --git a/src/constants/links.ts b/src/constants/links.ts index 8797d03d1e..d300766258 100644 --- a/src/constants/links.ts +++ b/src/constants/links.ts @@ -1,8 +1,23 @@ export const EXTERNAL_LINKS = { Balancer: { Home: 'https://balancer.fi', + Analytics: 'https://dune.xyz/balancerlabs', BalForGas: - 'https://docs.balancer.finance/core-concepts/bal-balancer-governance-token/bal-for-gas' + 'https://docs.balancer.finance/core-concepts/bal-balancer-governance-token/bal-for-gas', + BugBounty: 'https://immunefi.com/bounty/balancer/', + Docs: 'https://docs.balancer.fi', + Forum: 'https://forum.balancer.finance/', + Grants: 'http://grants.balancer.community/', + Social: { + Discord: 'https://discord.balancer.fi', + Github: 'https://github.com/balancer-labs/', + Mail: 'mailto:contact@balancer.finance', + Medium: 'https://medium.com/balancer-protocol', + Linkedin: 'https://www.linkedin.com/company/balancer-labs/', + Twitter: 'https://twitter.com/BalancerLabs', + Youtube: 'https://www.youtube.com/channel/UCBRHug6Hu3nmbxwVMt8x_Ow' + }, + Vote: 'https://vote.balancer.finance/' }, Gauntlet: { Home: 'https://gauntlet.network' diff --git a/src/locales/default.json b/src/locales/default.json index d075327953..2a6c817d4f 100644 --- a/src/locales/default.json +++ b/src/locales/default.json @@ -1,4 +1,5 @@ { + "about": "About", "accept": "Accept", "account": "Account", "action": "Action", @@ -83,11 +84,12 @@ "best": "Best", "browseLists": "Browse lists", "browserWallet": "Browser Wallet", + "bugBounty": "Bug bounty", "buy": "Buy", "build": "Build", "blog": "Blog", "boostedPool": "Balancer Boosted pool", - "byConnectingWallet": "By connecting a wallet, I agree to Balancer Labs’", + "byConnectingWallet": "By connecting a wallet, I agree to Balancer Foundation’s", "cancel": "Cancel", "cancelling": "Cancelling", "checkWallet": "Confirm in wallet", @@ -314,7 +316,7 @@ "highGasFees": "High gas fees? Here's a helping hand", "highPriceImpact": "High price impact", "highPriceImpactDetailed": "This trade is significantly moving the market price.", - "highRiskPool": "This is a higher-risk pool that contains one or more unlisted tokens. A liquidity pool is only as good as its weakest token! If a token were blacklisted, infinitely minted, frozen, or exploited in any other way, the value of this pool could go to 0. Balancer Labs is never liable for losses incurred through using our UI or the Balancer protocol. Be careful, and do your own research!", + "highRiskPool": "This is a higher-risk pool that contains one or more unlisted tokens. A liquidity pool is only as good as its weakest token! If a token were blacklisted, infinitely minted, frozen, or exploited in any other way, the value of this pool could go to 0. Balancer Foundation is never liable for losses incurred through using our UI or the Balancer protocol. Be careful, and do your own research!", "home": "Home", "hourAbbrev": "h", "incentiveToken": "Incentive token", @@ -511,9 +513,12 @@ "pendingEstimate": "Pending: (estimate)", "perWeek": "per week", "policies": { + "balancerThirdPartyInfo": "Balancer is an open source, permissionless, decentralized protocol. The smart contracts that power the ecosystem may be used by anyone. This website is the Balancer Foundation's front-end to the ecosystem and it is also open-source. You are free to fork it on Github and modify it as you wish", "cookiesPolicy": "Cookies Policy", "privacyPolicy": "Privacy Policy", - "termsOfUse": "Terms of Use" + "termsOfUse": "Terms of Use", + "thirdPartyServices": "3rd party services", + "usesFollowing": "This website uses the following" }, "pool": "Pool", "pools": "Pools", @@ -631,6 +636,15 @@ "selectToken": "Select token", "sell": "Sell", "send": "Send", + "services": { + "infura": "Used to fetch on-chain data and constructs contract calls with an Infura API.", + "alchemy": "Used to fetch on-chain data and constructs contract calls with an Alchemy API.", + "the-graph": "Used to fetch blockchain data from The Graph’s hosted service.", + "google-analytics": "Used to understand user behavior on the site and marketing performance.", + "fathom-analytics": "Used to understand user behavior on the site and marketing performance.", + "TRM-labs": "Used to securely collect wallet addresses and shares it with TRM Labs Inc. for risk and compliance reasons.", + "sentry": "Used for error tracking and performance monitoring." + }, "settings": "Settings", "setUpEthereumWallet": "Balancer is a DeFi app on Ethereum. Set up an Ethereum Wallet to Invest and Trade here.", "singleToken": "Single token", @@ -995,7 +1009,7 @@ "tokensLowerCase": "tokens", "tokensParen": "Token(s)", "tokenPrices": "Token prices", - "tokenWarning": "Balancer Labs is not liable for any losses you might incur as a direct or indirect result of adding liquidity to this pool. Do not add deflationary tokens, tokens with transfer fees, or any other non-ERC20-conforming tokens. Please acknowlege before continuing.", + "tokenWarning": "Balancer Foundation is not liable for any losses you might incur as a direct or indirect result of adding liquidity to this pool. Do not add deflationary tokens, tokens with transfer fees, or any other non-ERC20-conforming tokens. Please acknowlege before continuing.", "tokenWarningTitle": "You have added a custom token", "tooltips": { "invest": { @@ -1178,10 +1192,12 @@ "unstaked": "Unstaked", "unwrap": "Unwrap", "usdValue": "USD Value", + "useOf": "use of", "v1": "V1", "v2": "V2", "value": "Value", "vault": "Vault", + "vebal": "veBAL", "vestVote": "Vest+Vote", "viewAllAssets": "View all assets ({0})", "viewAndManangeOnElement": "View and manage all pools on Element.fi", @@ -1193,6 +1209,7 @@ "volume24h": "Volume (24{0})", "volume24hShort": "Vol (24h)", "volumeTime": "Volume ({0})", + "vote": "Vote", "wallet": "Wallet", "warning": "Warning", "week": "Week", diff --git a/src/pages/_layouts/ContentLayout.vue b/src/pages/_layouts/ContentLayout.vue index 2f7ea64e76..55c5929364 100644 --- a/src/pages/_layouts/ContentLayout.vue +++ b/src/pages/_layouts/ContentLayout.vue @@ -1,4 +1,5 @@ @@ -9,6 +10,7 @@ import AppNav from '@/components/navs/AppNav/AppNav.vue'; +