Skip to content

Commit

Permalink
🔒️ feat: block US
Browse files Browse the repository at this point in the history
  • Loading branch information
jgalat committed Jul 11, 2023
1 parent 2158f8f commit b549c4c
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 84 deletions.
1 change: 1 addition & 0 deletions .unimportedrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"entry": [
"sentry.*.config.ts",
"*.config.cjs",
"middleware.ts",
"pages/**/*",
"scripts/**/*",
"i18n/index.ts"
Expand Down
65 changes: 0 additions & 65 deletions components/DisclaimerModal/index.tsx

This file was deleted.

2 changes: 0 additions & 2 deletions components/Navbar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import React, { ReactNode, useCallback, useEffect, useState } from 'react';
import { setContext, setUser } from '@sentry/nextjs';
import { useBlockNumber, useConfig } from 'wagmi';
import { goerli } from 'wagmi/chains';
import DisclaimerModal from 'components/DisclaimerModal';
import Image from 'next/image';
import useRouter from 'hooks/useRouter';

Expand Down Expand Up @@ -99,7 +98,6 @@ function Navbar() {

return (
<Box sx={{ display: 'flex', justifyContent: 'center' }}>
<DisclaimerModal />
<MaturityDateReminder />
<AppBar
position="static"
Expand Down
17 changes: 2 additions & 15 deletions i18n/es/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,6 @@
"day": "día",
"days": "días",
"There was an error, please try again": "Hubo un error, por favor reintentar",
"Transaction rejected by user": "Transacción rechazada por el usuario",
"Transaction cancelled by user": "Transacción cancelada por el usuario",
"Unsupported operation": "Operación no soportada",
"Insufficient ether balance": "Ether insuficiente",
"Nonce expired": "Nonce expirado",
"There is not enough liquidity in your account": "No hay suficiente liquidez en tu cuenta",
"There is not enough liquidity in the protocol": "No hay suficiente liquidez en el protocolo",
"Not enough slippage": "Deslizamiento insuficiente",
Expand All @@ -159,7 +154,6 @@
"Cannot repay 0": "No puede pagar 0",
"Cannot borrow 0": "No puede pedir prestado 0",
"Utilization rate exceeded": "Tasa de utlización excedida",
"Insufficient assets or lack of approval, please try again": "Activos insuficiente o falta de aprobación, por favor reintentar",
"borrow": "pedir prestado",
"deposit": "depositar",
"withdraw": "retirar",
Expand All @@ -172,7 +166,6 @@
"depositing": "depositando",
"withdrawing": "retirando",
"repaying": "pagando",
"faucet": "faucet",
"deposits": "depositos",
"borrows": "préstamos",
"be paid": "ser pagados",
Expand Down Expand Up @@ -233,13 +226,6 @@
"Spanish": "Español",
"Switch language": "Cambiar idioma",
"You have reached the maximum yield possible": "Has alcanzado la máxima rentabilidad posible",
"Disclaimer": "Descargo de Responsabilidad",
"Exactly is an open source, non-custodial protocol that operates on both the Ethereum Mainnet (L1) and Optimism roll-up (L2) networks. The protocol is designed to bring fixed-income solutions for lenders and borrowers (the \"Platform\"). The Platform will permit its users, among other things, enter into certain transaction involving digital assets (including but not limited to digital loans and credit products) (the \"Digital Assets Services\").": "Exactly es un protocolo de código abierto y no custodio que opera tanto en la red principal de Ethereum (L1) como en la red de roll-up de Optimism (L2). El protocolo está diseñado para ofrecer soluciones de ingresos fijos para prestamistas y prestatarios (la \"Plataforma\"). La Plataforma permitirá a sus usuarios, entre otras cosas, participar en ciertas transacciones que involucren activos digitales (incluidos, pero no limitados a, préstamos digitales y productos crediticios) (los \"Servicios de Activos Digitales\").",
"The Platform does not allow it use by, or operates in any way with, US Persons. US Persons are prohibited from accessing and using the Digital Asset Services in any way. If Exactly has a reasonable suspicion that you are a US Person, we reserve the right to take whatever action we deem appropriate to prohibit your access to the Digital Asset Services. For purposes herein “US Person” shall mean any United States citizen or alien admitted for permanent residence in the United States, and any corporation, partnership, or other organization organized under the laws of the United States.": "La Plataforma no permite su uso por, ni opera de ninguna manera con, Personas de EE. UU. Se prohíbe a las Personas de EE. UU. acceder y utilizar los Servicios de Activos Digitales de cualquier manera. Si Exactly tiene una sospecha razonable de que usted es una Persona de EE. UU., nos reservamos el derecho de tomar cualquier medida que consideremos apropiada para prohibir su acceso a los Servicios de Activos Digitales. A los efectos de este documento, 'Persona de EE. UU.' se referirá a cualquier ciudadano de los Estados Unidos o extranjero admitido para residencia permanente en los Estados Unidos, y a cualquier corporación, asociación u otra organización organizada bajo las leyes de los Estados Unidos.",
"By clicking \"Proceed\" at the bottom of this disclaimer, you will be confirming that you are not a US Person and that you are not located, organized or resident in the United States of America. For more information please carefully read in full our": "Al hacer clic en \"Continuar\" en la parte inferior de este descargo de responsabilidad, estará confirmando que no es una Persona de EE. UU. y que no se encuentra, no está organizado ni reside en los Estados Unidos de América. Para obtener más información, lea detenidamente en su totalidad nuestros",
"terms and conditions": "términos y condiciones",
"before using the Platform or the Digital Asset Services.": "antes de utilizar la Plataforma o los Servicios de Activos Digitales.",
"Proceed": "Continuar",
"[Exactly] {{operationName}} maturity date reminder": "[Exactly] {{operationName}}: Recordatorio de fecha de vencimiento",
"Remember to pay before the maturity date": "Recuerda pagar antes de la fecha de vencimiento",
"Remember to withdraw your assets": "Recuerda retirar tus activos",
Expand Down Expand Up @@ -297,5 +283,6 @@
"Unlock the full potential of DeFi, start earning interest today!": "¡Desbloquea todo el potencial de DeFi, comienza a ganar intereses hoy!",
"Top {{number}} positions": "Top {{number}} posiciones",
"Unlock better loan terms with the new Rollover feature.": "Desbloquea mejores condiciones de préstamo con la nueva función de refinanciación.",
"Try it out now!": "¡Pruébalo ahora!"
"Try it out now!": "¡Pruébalo ahora!",
"Faucet": "Faucet"
}
27 changes: 27 additions & 0 deletions middleware.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import type { NextRequest } from 'next/server';
import { NextResponse } from 'next/server';

const text = `Disclaimer
Exactly is an open source, non-custodial protocol that operates on both the Ethereum Mainnet (L1)
and Optimism roll-up (L2) networks. The protocol is designed to bring fixed-income solutions for
lenders and borrowers (the "Platform"). The Platform will permit its users, among other things, enter
into certain transaction involving digital assets (including but not limited to digital loans and credit products)
(the "Digital Assets Services").
The Platform does not allow it use by, or operates in any way with, US Persons. US Persons are prohibited
from accessing and using the Digital Asset Services in any way. If Exactly has a reasonable suspicion that you
are a US Person, we reserve the right to take whatever action we deem appropriate to prohibit your access to the
Digital Asset Services. For purposes herein "US Person" shall mean any United States citizen or alien admitted for
permanent residence in the United States, and any corporation, partnership, or other organization organized under
the laws of the United States.`;

export function middleware(req: NextRequest) {
const country = req.geo?.country;

if (country === 'US') {
return new Response(text, { status: 451 });
}

return NextResponse.next();
}
2 changes: 0 additions & 2 deletions tests/e2e/steps/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@ export const setup = ({
};

Cypress.on('window:before:load', (window) => {
window.localStorage.setItem('tos', 'true');

window.ethereum = ethereum();
if (!useDefaultProvider && fork) {
window.rpcURL = fork.url();
Expand Down

0 comments on commit b549c4c

Please sign in to comment.