From b5e7fbe10f0e02e54fdeba490b21f41162e29eaf Mon Sep 17 00:00:00 2001 From: Luiz Date: Tue, 17 May 2022 14:17:44 -0300 Subject: [PATCH 01/21] feat: flexible link to correct etherscan based on the current network --- wallet/src/components/Transactions/index.jsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/wallet/src/components/Transactions/index.jsx b/wallet/src/components/Transactions/index.jsx index ad5d7c3e5..be2880694 100644 --- a/wallet/src/components/Transactions/index.jsx +++ b/wallet/src/components/Transactions/index.jsx @@ -10,7 +10,7 @@ import polygonChainImage from '../../assets/img/polygon-chain.svg'; import tickBox from '../../assets/svg/tickBox.svg'; import etherscanArrow from '../../assets/svg/etherscanGo.svg'; import TxInfoModal from '../Modals/txInfoModal.tsx'; -import Web3 from '../../common-files/utils/web3'; +import Web3, { ChainIdMapping } from '../../common-files/utils/web3'; import './index.scss'; import { getContractInstance } from '../../common-files/utils/contract'; import useInterval from '../../hooks/useInterval'; @@ -41,6 +41,10 @@ const Transactions = () => { const [isActive, setActive] = React.useState('all'); const [showModal, setShowModal] = React.useState({ show: false }); const [delay, setDelay] = React.useState(50); + const [etherscan] = React.useState( + ChainIdMapping[process.env.REACT_APP_MODE].chainName === 'Ethereum Mainnet' ? + 'etherscan.io' : 'goerli.etherscan.io' + ); const initialPrices = {}; supportedTokens.forEach(t => { @@ -338,7 +342,7 @@ const Transactions = () => { Date: Tue, 17 May 2022 17:09:19 -0300 Subject: [PATCH 02/21] feat: setting the l1 transcation hash in our tx to be saved in database --- wallet/src/components/BridgeComponent/index.jsx | 3 ++- wallet/src/components/Transactions/index.jsx | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/wallet/src/components/BridgeComponent/index.jsx b/wallet/src/components/BridgeComponent/index.jsx index ba72367cb..024a9143b 100644 --- a/wallet/src/components/BridgeComponent/index.jsx +++ b/wallet/src/components/BridgeComponent/index.jsx @@ -192,7 +192,8 @@ const BridgeComponent = () => { try { switch (readyTx.type) { case 'onchain': - await submitTransaction(readyTx.rawTransaction, shieldContractAddress, 150000, 0); // 150k is enough gasLimit for a deposit + const txL1Hash = await submitTransaction(readyTx.rawTransaction, shieldContractAddress, 150000, 0); // 150k is enough gasLimit for a deposit + readyTx.transaction.l1Hash = txL1Hash; break; case 'offchain': await axios diff --git a/wallet/src/components/Transactions/index.jsx b/wallet/src/components/Transactions/index.jsx index be2880694..45f81d423 100644 --- a/wallet/src/components/Transactions/index.jsx +++ b/wallet/src/components/Transactions/index.jsx @@ -153,6 +153,8 @@ const Transactions = () => { (a, b) => b.createdTime - a.createdTime, ); + console.log('TRANSACTION TX: ',mappedTxs[0]); + console.log('Transactions', transactions); setTxs(mappedTxs); }, delay); @@ -342,7 +344,7 @@ const Transactions = () => { Date: Wed, 18 May 2022 11:03:55 -0300 Subject: [PATCH 03/21] fix: eslint problems --- wallet/src/components/BridgeComponent/index.jsx | 16 ++++++++++++---- wallet/src/components/Transactions/index.jsx | 5 +++-- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/wallet/src/components/BridgeComponent/index.jsx b/wallet/src/components/BridgeComponent/index.jsx index 024a9143b..a88d61d23 100644 --- a/wallet/src/components/BridgeComponent/index.jsx +++ b/wallet/src/components/BridgeComponent/index.jsx @@ -191,11 +191,17 @@ const BridgeComponent = () => { console.log('readyTx', readyTx); try { switch (readyTx.type) { - case 'onchain': - const txL1Hash = await submitTransaction(readyTx.rawTransaction, shieldContractAddress, 150000, 0); // 150k is enough gasLimit for a deposit + case 'onchain': { + const txL1Hash = await submitTransaction( + readyTx.rawTransaction, + shieldContractAddress, + 150000, + 0, + ); // 150k is enough gasLimit for a deposit readyTx.transaction.l1Hash = txL1Hash; break; - case 'offchain': + } + case 'offchain': { await axios .post( `${proposerUrl}/proposer/offchain-transaction`, @@ -206,8 +212,10 @@ const BridgeComponent = () => { throw new Error(err); }); break; - default: + } + default: { console.log('Error when sending'); + } } await saveTransaction(readyTx.transaction); handleClose(); diff --git a/wallet/src/components/Transactions/index.jsx b/wallet/src/components/Transactions/index.jsx index 45f81d423..b2944079d 100644 --- a/wallet/src/components/Transactions/index.jsx +++ b/wallet/src/components/Transactions/index.jsx @@ -42,8 +42,9 @@ const Transactions = () => { const [showModal, setShowModal] = React.useState({ show: false }); const [delay, setDelay] = React.useState(50); const [etherscan] = React.useState( - ChainIdMapping[process.env.REACT_APP_MODE].chainName === 'Ethereum Mainnet' ? - 'etherscan.io' : 'goerli.etherscan.io' + ChainIdMapping[process.env.REACT_APP_MODE].chainName === 'Ethereum Mainnet' + ?'etherscan.io': + 'goerli.etherscan.io' ); const initialPrices = {}; From ab2050609ab75c5bc9e5ed57621b823099959431 Mon Sep 17 00:00:00 2001 From: Luiz Date: Wed, 18 May 2022 11:13:33 -0300 Subject: [PATCH 04/21] fix: eslint problems and warnings --- wallet/src/components/Modals/txInfoModal.tsx | 2 +- wallet/src/components/Transactions/index.jsx | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/wallet/src/components/Modals/txInfoModal.tsx b/wallet/src/components/Modals/txInfoModal.tsx index 04c345f36..2c951d33f 100644 --- a/wallet/src/components/Modals/txInfoModal.tsx +++ b/wallet/src/components/Modals/txInfoModal.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { Button, Col, Modal, Row } from 'react-bootstrap'; +import { Button, Modal } from 'react-bootstrap'; import { markWithdrawState } from '@Nightfall/services/database'; import { finaliseWithdrawal } from '@Nightfall/services/finalise-withdrawal'; import { isValidWithdrawal } from '@Nightfall/services/valid-withdrawal'; diff --git a/wallet/src/components/Transactions/index.jsx b/wallet/src/components/Transactions/index.jsx index b2944079d..47b45cc1a 100644 --- a/wallet/src/components/Transactions/index.jsx +++ b/wallet/src/components/Transactions/index.jsx @@ -43,8 +43,8 @@ const Transactions = () => { const [delay, setDelay] = React.useState(50); const [etherscan] = React.useState( ChainIdMapping[process.env.REACT_APP_MODE].chainName === 'Ethereum Mainnet' - ?'etherscan.io': - 'goerli.etherscan.io' + ? 'etherscan.io' + : 'goerli.etherscan.io', ); const initialPrices = {}; @@ -153,9 +153,6 @@ const Transactions = () => { const mappedTxs = (await Promise.all(promisedTxs)).sort( (a, b) => b.createdTime - a.createdTime, ); - - console.log('TRANSACTION TX: ',mappedTxs[0]); - console.log('Transactions', transactions); setTxs(mappedTxs); }, delay); From e3eabc9713d97df9389d55df555bb4705713f936 Mon Sep 17 00:00:00 2001 From: Luiz Date: Wed, 18 May 2022 14:21:44 -0300 Subject: [PATCH 05/21] fix: fixing the mas button getting the elementId of bridge input based on shadowRoot element --- wallet/src/components/BridgeComponent/index.jsx | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/wallet/src/components/BridgeComponent/index.jsx b/wallet/src/components/BridgeComponent/index.jsx index a88d61d23..63bdca486 100644 --- a/wallet/src/components/BridgeComponent/index.jsx +++ b/wallet/src/components/BridgeComponent/index.jsx @@ -1,4 +1,4 @@ -import React, { useContext, useState, useEffect } from 'react'; +import React, { useContext, useState, useEffect, createRef } from 'react'; import Modal from 'react-bootstrap/Modal'; import { toast } from 'react-toastify'; import { useHistory } from 'react-router-dom'; @@ -148,6 +148,8 @@ const BridgeComponent = () => { const [showTokensListModal, setShowTokensListModal] = useState(false); + const inputRef = createRef(); + useEffect(() => { if (document.getElementById('inputValue')) { document.getElementById('inputValue').value = 0; @@ -353,13 +355,14 @@ const BridgeComponent = () => { }, [token, txType, accountInstance]); const updateInputValue = () => { + const inputElement = document.querySelector('nightfall-app').shadowRoot.getElementById('inputValue'); if (txType === 'deposit') { - document.getElementById('inputValue').value = l1Balance; + inputElement.value = new BigFloat(l1Balance, token.decimals).toFixed(4); setTransferValue(l1Balance); return; } - document.getElementById('inputValue').value = l2Balance; - setTransferValue(l2Balance); + inputElement.value = new BigFloat(l2Balance, token.decimals).toFixed(4); + setTransferValue(l2Balance); }; return ( @@ -422,7 +425,7 @@ const BridgeComponent = () => { { if ( (transferValue.toString().split('.')[1]?.length ?? 0) > 3 && From 9e4dfc3a039af36a5f241038ca7796d17acc578d Mon Sep 17 00:00:00 2001 From: Luiz Date: Wed, 18 May 2022 14:30:00 -0300 Subject: [PATCH 06/21] fix: eslint problems --- wallet/src/components/BridgeComponent/index.jsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/wallet/src/components/BridgeComponent/index.jsx b/wallet/src/components/BridgeComponent/index.jsx index 63bdca486..4ed42b309 100644 --- a/wallet/src/components/BridgeComponent/index.jsx +++ b/wallet/src/components/BridgeComponent/index.jsx @@ -1,4 +1,4 @@ -import React, { useContext, useState, useEffect, createRef } from 'react'; +import React, { useContext, useState, useEffect } from 'react'; import Modal from 'react-bootstrap/Modal'; import { toast } from 'react-toastify'; import { useHistory } from 'react-router-dom'; @@ -148,8 +148,6 @@ const BridgeComponent = () => { const [showTokensListModal, setShowTokensListModal] = useState(false); - const inputRef = createRef(); - useEffect(() => { if (document.getElementById('inputValue')) { document.getElementById('inputValue').value = 0; @@ -355,14 +353,16 @@ const BridgeComponent = () => { }, [token, txType, accountInstance]); const updateInputValue = () => { - const inputElement = document.querySelector('nightfall-app').shadowRoot.getElementById('inputValue'); + const inputElement = document + .querySelector('nightfall-app') + .shadowRoot.getElementById('inputValue'); if (txType === 'deposit') { inputElement.value = new BigFloat(l1Balance, token.decimals).toFixed(4); setTransferValue(l1Balance); return; } inputElement.value = new BigFloat(l2Balance, token.decimals).toFixed(4); - setTransferValue(l2Balance); + setTransferValue(l2Balance); }; return ( @@ -425,7 +425,7 @@ const BridgeComponent = () => { { if ( (transferValue.toString().split('.')[1]?.length ?? 0) > 3 && From 40688d1a8794bbed4a18f645bba7dd7726a06971 Mon Sep 17 00:00:00 2001 From: Luiz Date: Wed, 18 May 2022 17:12:20 -0300 Subject: [PATCH 07/21] fix: doing all verifications for deposit and withdraws transfers --- .../src/components/BridgeComponent/index.jsx | 45 ++++++++++++------- 1 file changed, 29 insertions(+), 16 deletions(-) diff --git a/wallet/src/components/BridgeComponent/index.jsx b/wallet/src/components/BridgeComponent/index.jsx index 4ed42b309..c77eb18c9 100644 --- a/wallet/src/components/BridgeComponent/index.jsx +++ b/wallet/src/components/BridgeComponent/index.jsx @@ -316,14 +316,33 @@ const BridgeComponent = () => { } const handleShow = () => { + console.log('Transfer value: ',transferValue); if ( (txType === 'deposit' && new BigFloat(transferValue, token.decimals).toBigInt() > l1Balance) || (txType === 'withdraw' && new BigFloat(transferValue, token.decimals).toBigInt() > l2Balance) - ) + ) { toast.error("Input value can't be greater than balance!"); - else if (!transferValue) toast.warn('Input a value for transfer, please.'); - else if (transferValue === 0) toast.warn("Input a value can't be zero."); + return; + } + + if (txType === 'deposit' && + new BigFloat(transferValue, token.decimals).toBigInt() > new BigFloat('0.25 ', token.decimals).toBigInt() + ) { + toast.error("Input value can't be greater than 0.25"); + return; + } + + if (!transferValue) { + toast.warn('Input a value for transfer, please.'); + return; + } + + if (transferValue === '0') { + toast.warn("Input a value can't be zero."); + return; + } + setShow(true); }; @@ -358,11 +377,11 @@ const BridgeComponent = () => { .shadowRoot.getElementById('inputValue'); if (txType === 'deposit') { inputElement.value = new BigFloat(l1Balance, token.decimals).toFixed(4); - setTransferValue(l1Balance); + setTransferValue((new BigFloat(l1Balance, token.decimals).toFixed(4)).toString()); return; } - inputElement.value = new BigFloat(l2Balance, token.decimals).toFixed(4); - setTransferValue(l2Balance); + inputElement.value = new BigFloat(l2Balance, token.decimals).toFixed(4); + setTransferValue((new BigFloat(l2Balance, token.decimals).toFixed(4)).toString()); }; return ( @@ -538,16 +557,10 @@ const BridgeComponent = () => { {/* TRANSFER BUTTON */} -
- {Number(transferValue) > 0 ? ( - - ) : ( - - )} +
+
{show && ( From 90ab92abca3c8c0ca74e4545d24cd245b01d34e5 Mon Sep 17 00:00:00 2001 From: Luiz Date: Wed, 18 May 2022 17:23:31 -0300 Subject: [PATCH 08/21] fix: eslint problems --- .../src/components/BridgeComponent/index.jsx | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/wallet/src/components/BridgeComponent/index.jsx b/wallet/src/components/BridgeComponent/index.jsx index c77eb18c9..348334a78 100644 --- a/wallet/src/components/BridgeComponent/index.jsx +++ b/wallet/src/components/BridgeComponent/index.jsx @@ -316,7 +316,6 @@ const BridgeComponent = () => { } const handleShow = () => { - console.log('Transfer value: ',transferValue); if ( (txType === 'deposit' && new BigFloat(transferValue, token.decimals).toBigInt() > l1Balance) || @@ -326,13 +325,15 @@ const BridgeComponent = () => { return; } - if (txType === 'deposit' && - new BigFloat(transferValue, token.decimals).toBigInt() > new BigFloat('0.25 ', token.decimals).toBigInt() + if ( + txType === 'deposit' && + new BigFloat(transferValue, token.decimals).toBigInt() > + new BigFloat('0.25 ', token.decimals).toBigInt() ) { toast.error("Input value can't be greater than 0.25"); return; } - + if (!transferValue) { toast.warn('Input a value for transfer, please.'); return; @@ -377,11 +378,11 @@ const BridgeComponent = () => { .shadowRoot.getElementById('inputValue'); if (txType === 'deposit') { inputElement.value = new BigFloat(l1Balance, token.decimals).toFixed(4); - setTransferValue((new BigFloat(l1Balance, token.decimals).toFixed(4)).toString()); + setTransferValue(new BigFloat(l1Balance, token.decimals).toFixed(4).toString()); return; } - inputElement.value = new BigFloat(l2Balance, token.decimals).toFixed(4); - setTransferValue((new BigFloat(l2Balance, token.decimals).toFixed(4)).toString()); + inputElement.value = new BigFloat(l2Balance, token.decimals).toFixed(4); + setTransferValue(new BigFloat(l2Balance, token.decimals).toFixed(4).toString()); }; return ( @@ -557,10 +558,10 @@ const BridgeComponent = () => { {/* TRANSFER BUTTON */} -
+
+
{show && ( From 255fa22353465b58b08594cb5326f36e20aad3af Mon Sep 17 00:00:00 2001 From: Luiz Date: Thu, 19 May 2022 17:05:31 -0300 Subject: [PATCH 09/21] fix: send modal verifications and max button --- .../src/components/BridgeComponent/index.jsx | 2 +- wallet/src/components/Modals/sendModal.tsx | 67 +++++++++++++++---- 2 files changed, 54 insertions(+), 15 deletions(-) diff --git a/wallet/src/components/BridgeComponent/index.jsx b/wallet/src/components/BridgeComponent/index.jsx index 348334a78..1c153fee0 100644 --- a/wallet/src/components/BridgeComponent/index.jsx +++ b/wallet/src/components/BridgeComponent/index.jsx @@ -328,7 +328,7 @@ const BridgeComponent = () => { if ( txType === 'deposit' && new BigFloat(transferValue, token.decimals).toBigInt() > - new BigFloat('0.25 ', token.decimals).toBigInt() + new BigFloat('0.25', token.decimals).toBigInt() ) { toast.error("Input value can't be greater than 0.25"); return; diff --git a/wallet/src/components/Modals/sendModal.tsx b/wallet/src/components/Modals/sendModal.tsx index 63b553ed1..2ab38d88e 100644 --- a/wallet/src/components/Modals/sendModal.tsx +++ b/wallet/src/components/Modals/sendModal.tsx @@ -23,6 +23,7 @@ import checkMarkYes from '../../assets/lottie/check-mark-yes.json'; import Transaction from '../../common-files/classes/transaction'; import checkMarkCross from '../../assets/lottie/check-mark-cross.json'; import { shieldAddressGet } from '../../utils/lib/local-storage'; +import { toast } from 'react-toastify'; const supportedTokens = importTokens(); @@ -423,6 +424,7 @@ const SendModal = (props: SendModalProps): JSX.Element => { const [readyTx, setReadyTx] = useState({ type: '', rawTransaction: '', transaction: {} }); const [shieldContractAddress, setShieldAddress] = useState(''); + const [isValidAddress, setIsValidAddress] = useState(false); function timeout(ms: number) { return new Promise(resolve => setTimeout(resolve, ms)); @@ -468,9 +470,17 @@ const SendModal = (props: SendModalProps): JSX.Element => { } useEffect(() => { - setShieldAddress(shieldAddressGet()); + setShieldAddress(shieldAddressGet()); }, []); + useEffect(() => { + if(recipient && recipient.length === 66) { + setIsValidAddress(true); + return; + } + setIsValidAddress(false); + }, [recipient]); + async function sendTx(): Promise { if (shieldContractAddress === '') setShieldAddress(shieldAddressGet()); setShowModalConfirm(true); @@ -509,6 +519,15 @@ const SendModal = (props: SendModalProps): JSX.Element => { }; } + const updateMaxBalance = () => { + const inputElement = document + ?.getElementById('TokenItem_modalSend_tokenAmount') as HTMLInputElement; + if(inputElement !== undefined && inputElement !== null) { + inputElement.value = new BigFloat(l2Balance, sendToken.decimals).toFixed(4).toString(); + setTransferValue(new BigFloat(l2Balance, sendToken.decimals).toFixed(4).toString()); + } + } + return ( <> onHide()}> @@ -562,7 +581,9 @@ const SendModal = (props: SendModalProps): JSX.Element => { onChange={e => setRecipient(e.target.value)} id="TokenItem_modalSend_compressedPkd" /> -

Enter a valid address existing on the Polygon Nightfall L2

+ {!isValidAddress && +

Enter a valid address existing on the Polygon Nightfall L2

+ } @@ -581,7 +602,7 @@ const SendModal = (props: SendModalProps): JSX.Element => { id="TokenItem_modalSend_tokenAmount" /> - MAX + updateMaxBalance()}>MAX setShowTokensListModal(true)} id="TokenItem_modalSend_tokenName" @@ -609,19 +630,37 @@ const SendModal = (props: SendModalProps): JSX.Element => { matic icon

0.00 Matic Transfer Fee

+
+ {new BigFloat(valueToSend.toString(), sendToken.decimals).toFixed(4) > new BigFloat(l2Balance, sendToken.decimals).toFixed(4) && +

The amount is greater than your balance.

+ } + {new BigFloat(valueToSend.toString(), sendToken.decimals).toFixed(4) === new BigFloat('0', sendToken.decimals).toFixed(4) && +

Insert an amount greater than zero.

+ } - { - props.onHide(); - setShowModalConfirm(true); - setShowModalTransferInProgress(true); - const pendingTx = await sendTx(); - if (pendingTx.type !== 'failed_transfer') setReadyTx(pendingTx); - }} - > - Continue - + {isValidAddress && + new BigFloat(valueToSend.toString(), sendToken.decimals).toFixed(4) <= new BigFloat(l2Balance, sendToken.decimals).toFixed(4) && + new BigFloat(valueToSend.toString(), sendToken.decimals).toFixed(4) !== new BigFloat('0', sendToken.decimals).toFixed(4) && + + { + props.onHide(); + setShowModalConfirm(true); + setShowModalTransferInProgress(true); + setIsValidAddress(false); + const pendingTx = await sendTx(); + if (pendingTx.type !== 'failed_transfer') setReadyTx(pendingTx); + }} + > + Continue + + } + {/* {!isValidAddress && + + Continue + + } */} )} From 9d885a51567506797a28320785a0c63513f77188 Mon Sep 17 00:00:00 2001 From: Luiz Date: Thu, 19 May 2022 18:17:58 -0300 Subject: [PATCH 10/21] fix: eslint problems --- wallet/src/components/Modals/sendModal.tsx | 53 +++++++++++----------- 1 file changed, 26 insertions(+), 27 deletions(-) diff --git a/wallet/src/components/Modals/sendModal.tsx b/wallet/src/components/Modals/sendModal.tsx index 2ab38d88e..80822a0ab 100644 --- a/wallet/src/components/Modals/sendModal.tsx +++ b/wallet/src/components/Modals/sendModal.tsx @@ -23,7 +23,6 @@ import checkMarkYes from '../../assets/lottie/check-mark-yes.json'; import Transaction from '../../common-files/classes/transaction'; import checkMarkCross from '../../assets/lottie/check-mark-cross.json'; import { shieldAddressGet } from '../../utils/lib/local-storage'; -import { toast } from 'react-toastify'; const supportedTokens = importTokens(); @@ -470,11 +469,11 @@ const SendModal = (props: SendModalProps): JSX.Element => { } useEffect(() => { - setShieldAddress(shieldAddressGet()); + setShieldAddress(shieldAddressGet()); }, []); useEffect(() => { - if(recipient && recipient.length === 66) { + if (recipient && recipient.length === 66) { setIsValidAddress(true); return; } @@ -519,14 +518,15 @@ const SendModal = (props: SendModalProps): JSX.Element => { }; } - const updateMaxBalance = () => { - const inputElement = document - ?.getElementById('TokenItem_modalSend_tokenAmount') as HTMLInputElement; - if(inputElement !== undefined && inputElement !== null) { + const updateMaxBalance = () => { + const inputElement = document?.getElementById( + 'TokenItem_modalSend_tokenAmount', + ) as HTMLInputElement; + if (inputElement !== undefined && inputElement !== null) { inputElement.value = new BigFloat(l2Balance, sendToken.decimals).toFixed(4).toString(); setTransferValue(new BigFloat(l2Balance, sendToken.decimals).toFixed(4).toString()); } - } + }; return ( <> @@ -581,9 +581,11 @@ const SendModal = (props: SendModalProps): JSX.Element => { onChange={e => setRecipient(e.target.value)} id="TokenItem_modalSend_compressedPkd" /> - {!isValidAddress && -

Enter a valid address existing on the Polygon Nightfall L2

- } + {!isValidAddress && ( +

+ Enter a valid address existing on the Polygon Nightfall L2 +

+ )} @@ -630,19 +632,21 @@ const SendModal = (props: SendModalProps): JSX.Element => { matic icon

0.00 Matic Transfer Fee

-
- {new BigFloat(valueToSend.toString(), sendToken.decimals).toFixed(4) > new BigFloat(l2Balance, sendToken.decimals).toFixed(4) && -

The amount is greater than your balance.

- } - {new BigFloat(valueToSend.toString(), sendToken.decimals).toFixed(4) === new BigFloat('0', sendToken.decimals).toFixed(4) && -

Insert an amount greater than zero.

- } + {new BigFloat(valueToSend.toString(), sendToken.decimals).toFixed(4) > + new BigFloat(l2Balance, sendToken.decimals).toFixed(4) && ( +

The amount is greater than your balance.

+ )} + {new BigFloat(valueToSend.toString(), sendToken.decimals).toFixed(4) === + new BigFloat('0', sendToken.decimals).toFixed(4) && ( +

Insert an amount greater than zero.

+ )} {isValidAddress && - new BigFloat(valueToSend.toString(), sendToken.decimals).toFixed(4) <= new BigFloat(l2Balance, sendToken.decimals).toFixed(4) && - new BigFloat(valueToSend.toString(), sendToken.decimals).toFixed(4) !== new BigFloat('0', sendToken.decimals).toFixed(4) && - + new BigFloat(valueToSend.toString(), sendToken.decimals).toFixed(4) <= + new BigFloat(l2Balance, sendToken.decimals).toFixed(4) && + new BigFloat(valueToSend.toString(), sendToken.decimals).toFixed(4) !== + new BigFloat('0', sendToken.decimals).toFixed(4) && ( { props.onHide(); @@ -655,12 +659,7 @@ const SendModal = (props: SendModalProps): JSX.Element => { > Continue - } - {/* {!isValidAddress && - - Continue - - } */} + )} )} From fda14b03c853237be6c158f105c5560d5692e385 Mon Sep 17 00:00:00 2001 From: Luiz Date: Thu, 19 May 2022 19:02:50 -0300 Subject: [PATCH 11/21] fix: eslint problems --- wallet/src/components/Modals/sendModal.tsx | 24 +++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/wallet/src/components/Modals/sendModal.tsx b/wallet/src/components/Modals/sendModal.tsx index 80822a0ab..274ecfb3c 100644 --- a/wallet/src/components/Modals/sendModal.tsx +++ b/wallet/src/components/Modals/sendModal.tsx @@ -424,6 +424,7 @@ const SendModal = (props: SendModalProps): JSX.Element => { const [readyTx, setReadyTx] = useState({ type: '', rawTransaction: '', transaction: {} }); const [shieldContractAddress, setShieldAddress] = useState(''); const [isValidAddress, setIsValidAddress] = useState(false); + const [isValidBalance, setIsValidBalance] = useState(false); function timeout(ms: number) { return new Promise(resolve => setTimeout(resolve, ms)); @@ -480,6 +481,23 @@ const SendModal = (props: SendModalProps): JSX.Element => { setIsValidAddress(false); }, [recipient]); + useEffect(() => { + console.log('ENTRA LEGAL'); + if (new BigFloat(valueToSend.toString(), sendToken.decimals).toFixed(4) > + new BigFloat(l2Balance, sendToken.decimals).toFixed(4) ) { + setIsValidBalance(false); + return; + } + + if (new BigFloat(valueToSend.toString(), sendToken.decimals).toFixed(4) === + new BigFloat('0', sendToken.decimals).toFixed(4)) { + setIsValidBalance(false); + return; + } + console.log('FICA OK'); + setIsValidBalance(true); + }, [valueToSend]); + async function sendTx(): Promise { if (shieldContractAddress === '') setShieldAddress(shieldAddressGet()); setShowModalConfirm(true); @@ -642,11 +660,7 @@ const SendModal = (props: SendModalProps): JSX.Element => {

Insert an amount greater than zero.

)} - {isValidAddress && - new BigFloat(valueToSend.toString(), sendToken.decimals).toFixed(4) <= - new BigFloat(l2Balance, sendToken.decimals).toFixed(4) && - new BigFloat(valueToSend.toString(), sendToken.decimals).toFixed(4) !== - new BigFloat('0', sendToken.decimals).toFixed(4) && ( + {isValidAddress && isValidBalance && ( { props.onHide(); From 113512a17941afbe2e95dac24cf3b17d0adf9f26 Mon Sep 17 00:00:00 2001 From: Luiz Date: Thu, 19 May 2022 19:13:18 -0300 Subject: [PATCH 12/21] fix: eslint problems --- wallet/src/components/Modals/sendModal.tsx | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/wallet/src/components/Modals/sendModal.tsx b/wallet/src/components/Modals/sendModal.tsx index 274ecfb3c..95eaf3aa6 100644 --- a/wallet/src/components/Modals/sendModal.tsx +++ b/wallet/src/components/Modals/sendModal.tsx @@ -482,20 +482,22 @@ const SendModal = (props: SendModalProps): JSX.Element => { }, [recipient]); useEffect(() => { - console.log('ENTRA LEGAL'); - if (new BigFloat(valueToSend.toString(), sendToken.decimals).toFixed(4) > - new BigFloat(l2Balance, sendToken.decimals).toFixed(4) ) { + if ( + new BigFloat(valueToSend.toString(), sendToken.decimals).toFixed(4) > + new BigFloat(l2Balance, sendToken.decimals).toFixed(4) + ) { setIsValidBalance(false); return; } - - if (new BigFloat(valueToSend.toString(), sendToken.decimals).toFixed(4) === - new BigFloat('0', sendToken.decimals).toFixed(4)) { + + if ( + new BigFloat(valueToSend.toString(), sendToken.decimals).toFixed(4) === + new BigFloat('0', sendToken.decimals).toFixed(4) + ) { setIsValidBalance(false); return; } - console.log('FICA OK'); - setIsValidBalance(true); + setIsValidBalance(true); }, [valueToSend]); async function sendTx(): Promise { From 03e3f108225c2d941b6a0249280e3b9a6e73fe40 Mon Sep 17 00:00:00 2001 From: Luiz Date: Fri, 20 May 2022 15:54:00 -0300 Subject: [PATCH 13/21] feat: sending the user for transactions after deposit or withdraw confirmation --- wallet/src/components/BridgeComponent/index.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wallet/src/components/BridgeComponent/index.jsx b/wallet/src/components/BridgeComponent/index.jsx index 1c153fee0..56bb0783a 100644 --- a/wallet/src/components/BridgeComponent/index.jsx +++ b/wallet/src/components/BridgeComponent/index.jsx @@ -651,9 +651,9 @@ const BridgeComponent = () => { { + onClick={async () => { setSendingState(true); - submitTx(); + await submitTx() && history.push("/transactionPage"); }} > {sending ? ( From f0e3cc617d3a23f16640a47cae469630c965bc66 Mon Sep 17 00:00:00 2001 From: Luiz Date: Fri, 20 May 2022 16:27:13 -0300 Subject: [PATCH 14/21] fix: eslint problems creating a function for continue transfer in sending button --- wallet/src/components/BridgeComponent/index.jsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/wallet/src/components/BridgeComponent/index.jsx b/wallet/src/components/BridgeComponent/index.jsx index 56bb0783a..72572b1f2 100644 --- a/wallet/src/components/BridgeComponent/index.jsx +++ b/wallet/src/components/BridgeComponent/index.jsx @@ -385,6 +385,12 @@ const BridgeComponent = () => { setTransferValue(new BigFloat(l2Balance, token.decimals).toFixed(4).toString()); }; + const continueTransfer = async () => { + if (await submitTx()) { + history.push("/transactionPage"); + } + } + return (
{showTokensListModal && ( @@ -653,7 +659,7 @@ const BridgeComponent = () => { id="Bridge_modal_continueTransferButton" onClick={async () => { setSendingState(true); - await submitTx() && history.push("/transactionPage"); + continueTransfer(); }} > {sending ? ( From f64825b10bf9faa07f3f55c70438f64f8fd86e21 Mon Sep 17 00:00:00 2001 From: Luiz Date: Fri, 20 May 2022 16:29:04 -0300 Subject: [PATCH 15/21] fix: eslint problems --- wallet/src/components/BridgeComponent/index.jsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/wallet/src/components/BridgeComponent/index.jsx b/wallet/src/components/BridgeComponent/index.jsx index 72572b1f2..7efc21715 100644 --- a/wallet/src/components/BridgeComponent/index.jsx +++ b/wallet/src/components/BridgeComponent/index.jsx @@ -387,9 +387,9 @@ const BridgeComponent = () => { const continueTransfer = async () => { if (await submitTx()) { - history.push("/transactionPage"); - } - } + history.push('/transactionPage'); + } + }; return (
From e70270564fb29899cb69cdffbca105ddcf144330 Mon Sep 17 00:00:00 2001 From: Luiz Date: Wed, 25 May 2022 15:32:22 -0300 Subject: [PATCH 16/21] fix: removing hardcoded amount restriction for deposit --- wallet/src/components/BridgeComponent/index.jsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/wallet/src/components/BridgeComponent/index.jsx b/wallet/src/components/BridgeComponent/index.jsx index 7efc21715..fc9ee390c 100644 --- a/wallet/src/components/BridgeComponent/index.jsx +++ b/wallet/src/components/BridgeComponent/index.jsx @@ -328,9 +328,9 @@ const BridgeComponent = () => { if ( txType === 'deposit' && new BigFloat(transferValue, token.decimals).toBigInt() > - new BigFloat('0.25', token.decimals).toBigInt() - ) { - toast.error("Input value can't be greater than 0.25"); + parseInt(token.restrictions[txType]) + ) { + toast.error(`Input value can't be greater than ${parseInt(token.restrictions[txType])/parseInt(new BigFloat('1', token.decimals).toBigInt().toString())}`); return; } From d638fbdcd3bc3818c2957cdc2ffbdc1239eb96e7 Mon Sep 17 00:00:00 2001 From: Luiz Date: Wed, 25 May 2022 15:51:16 -0300 Subject: [PATCH 17/21] fix: eslint problems --- wallet/src/components/BridgeComponent/index.jsx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/wallet/src/components/BridgeComponent/index.jsx b/wallet/src/components/BridgeComponent/index.jsx index fc9ee390c..503616e4e 100644 --- a/wallet/src/components/BridgeComponent/index.jsx +++ b/wallet/src/components/BridgeComponent/index.jsx @@ -328,9 +328,14 @@ const BridgeComponent = () => { if ( txType === 'deposit' && new BigFloat(transferValue, token.decimals).toBigInt() > - parseInt(token.restrictions[txType]) - ) { - toast.error(`Input value can't be greater than ${parseInt(token.restrictions[txType])/parseInt(new BigFloat('1', token.decimals).toBigInt().toString())}`); + parseInt(token.restrictions[txType], 10) + ) { + toast.error( + `Input value can't be greater than ${ + parseInt(token.restrictions[txType], 10) / + parseInt(new BigFloat('1', token.decimals).toBigInt().toString(), 10) + }`, + ); return; } From cb575f79b8787373bd17fcddaa015fbcca707898 Mon Sep 17 00:00:00 2001 From: Luiz Date: Thu, 26 May 2022 11:42:39 -0300 Subject: [PATCH 18/21] fix: verifying the l2 address correcty with decompressKey function --- wallet/src/components/Modals/sendModal.tsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/wallet/src/components/Modals/sendModal.tsx b/wallet/src/components/Modals/sendModal.tsx index 95eaf3aa6..db525ad79 100644 --- a/wallet/src/components/Modals/sendModal.tsx +++ b/wallet/src/components/Modals/sendModal.tsx @@ -23,6 +23,9 @@ import checkMarkYes from '../../assets/lottie/check-mark-yes.json'; import Transaction from '../../common-files/classes/transaction'; import checkMarkCross from '../../assets/lottie/check-mark-cross.json'; import { shieldAddressGet } from '../../utils/lib/local-storage'; +// @ts-ignore +import { generalise } from 'general-number'; +import { decompressKey } from '@Nightfall/services/keys'; const supportedTokens = importTokens(); @@ -474,11 +477,12 @@ const SendModal = (props: SendModalProps): JSX.Element => { }, []); useEffect(() => { - if (recipient && recipient.length === 66) { + try { + decompressKey(generalise(recipient)); setIsValidAddress(true); - return; + } catch { + setIsValidAddress(false); } - setIsValidAddress(false); }, [recipient]); useEffect(() => { From 0e8a9c900a3fe370bd65b79afb4d00a79f2484b9 Mon Sep 17 00:00:00 2001 From: Luiz Date: Thu, 26 May 2022 12:08:35 -0300 Subject: [PATCH 19/21] fix: eslint problems --- wallet/package.json | 3 +++ wallet/src/components/Modals/sendModal.tsx | 7 ++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/wallet/package.json b/wallet/package.json index 26ce38de2..6daf00ef8 100644 --- a/wallet/package.json +++ b/wallet/package.json @@ -26,6 +26,8 @@ "comlink-loader": "^2.0.0", "crypto-js": "^4.1.1", "css-loader": "4.3.0", + "dexie": "^3.2.2", + "dexie-export-import": "^1.0.3", "dotenv": "8.2.0", "dotenv-expand": "5.1.0", "eslint": "^7.11.0", @@ -103,6 +105,7 @@ }, "scripts": { "start": "LOCAL_PROPOSER=true PUBLIC_URL='/nightfall/' USE_STUBS=true REACT_APP_MODE=local node scripts/start.js", + "start:testnet": "LOCAL_PROPOSER=false PUBLIC_URL='/nightfall/' USE_STUBS=false REACT_APP_MODE=testnet node scripts/start.js", "build": "LOCAL_PROPOSER=false USE_STUBS=false REACT_APP_MODE=production PUBLIC_URL='https://wallet-beta.polygon.technology/nightfall/' node scripts/build.js", "deploy": "npm run build && aws s3 sync build s3://pnf-dev-browser --cache-control max-age=172800 --delete && aws configure set preview.cloudfront true && aws cloudfront create-invalidation --distribution-id ENV3X13MLR5YT --paths \"/*\"", "test": "env TS_NODE_COMPILER_OPTIONS='{\"module\": \"commonjs\" }' mocha -r ts-node/register 'tests/**/*.ts'", diff --git a/wallet/src/components/Modals/sendModal.tsx b/wallet/src/components/Modals/sendModal.tsx index db525ad79..cd0d0d15e 100644 --- a/wallet/src/components/Modals/sendModal.tsx +++ b/wallet/src/components/Modals/sendModal.tsx @@ -11,6 +11,10 @@ import transfer from '@Nightfall/services/transfer'; import { getWalletBalance } from '@Nightfall/services/commitment-storage'; import { saveTransaction } from '@Nightfall/services/database'; import Lottie from 'lottie-react'; +// eslint-disable-next-line @typescript-eslint/ban-ts-comment +// @ts-ignore +import { generalise } from 'general-number'; +import { decompressKey } from '@Nightfall/services/keys'; import { UserContext } from '../../hooks/User'; import maticImg from '../../assets/img/polygon-chain.svg'; import { retrieveAndDecrypt } from '../../utils/lib/key-storage'; @@ -23,9 +27,6 @@ import checkMarkYes from '../../assets/lottie/check-mark-yes.json'; import Transaction from '../../common-files/classes/transaction'; import checkMarkCross from '../../assets/lottie/check-mark-cross.json'; import { shieldAddressGet } from '../../utils/lib/local-storage'; -// @ts-ignore -import { generalise } from 'general-number'; -import { decompressKey } from '@Nightfall/services/keys'; const supportedTokens = importTokens(); From 2476cb47e6d9401e776c765b91e8752ba879ecd8 Mon Sep 17 00:00:00 2001 From: Luiz Date: Thu, 26 May 2022 12:19:06 -0300 Subject: [PATCH 20/21] fix: eslint problems --- wallet/package.json | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/wallet/package.json b/wallet/package.json index 6daf00ef8..686438287 100644 --- a/wallet/package.json +++ b/wallet/package.json @@ -25,9 +25,7 @@ "case-sensitive-paths-webpack-plugin": "2.3.0", "comlink-loader": "^2.0.0", "crypto-js": "^4.1.1", - "css-loader": "4.3.0", - "dexie": "^3.2.2", - "dexie-export-import": "^1.0.3", + "css-loader": "4.3.0", "dotenv": "8.2.0", "dotenv-expand": "5.1.0", "eslint": "^7.11.0", From 3d21c57e2461d96a6d9bfe3cb60c11568be1af4f Mon Sep 17 00:00:00 2001 From: Luiz Date: Thu, 26 May 2022 12:24:08 -0300 Subject: [PATCH 21/21] fix: eslint --- wallet/package-lock.json | 189 +++++++++++++++++++-------------------- wallet/package.json | 2 +- 2 files changed, 92 insertions(+), 99 deletions(-) diff --git a/wallet/package-lock.json b/wallet/package-lock.json index 2b0713fcb..733394176 100644 --- a/wallet/package-lock.json +++ b/wallet/package-lock.json @@ -1610,6 +1610,82 @@ "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==" }, + "@chainlink/contracts-0.0.10": { + "version": "npm:@chainlink/contracts@0.0.10", + "resolved": "https://registry.npmjs.org/@chainlink/contracts/-/contracts-0.0.10.tgz", + "integrity": "sha512-ok+ucSQ+3mrR+zjbi6zIrdd5M9XymcqVcnXGVyqBVRYZp97jS2/rt/glP320JmHxmi4pacgDOg0Ux11xIr1S8Q==", + "dev": true, + "requires": { + "@truffle/contract": "^4.2.6", + "ethers": "^4.0.45" + }, + "dependencies": { + "aes-js": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/aes-js/-/aes-js-3.0.0.tgz", + "integrity": "sha512-H7wUZRn8WpTq9jocdxQ2c8x2sKo9ZVmzfRE13GiNJXfp7NcKYEdvl3vspKjXox6RIG2VtaRe4JFvxG4rqp2Zuw==", + "dev": true, + "optional": true + }, + "ethers": { + "version": "4.0.49", + "resolved": "https://registry.npmjs.org/ethers/-/ethers-4.0.49.tgz", + "integrity": "sha512-kPltTvWiyu+OktYy1IStSO16i2e7cS9D9OxZ81q2UUaiNPVrm/RTcbxamCXF9VUSKzJIdJV68EAIhTEVBalRWg==", + "dev": true, + "optional": true, + "requires": { + "aes-js": "3.0.0", + "bn.js": "^4.11.9", + "elliptic": "6.5.4", + "hash.js": "1.1.3", + "js-sha3": "0.5.7", + "scrypt-js": "2.0.4", + "setimmediate": "1.0.4", + "uuid": "2.0.1", + "xmlhttprequest": "1.8.0" + } + }, + "hash.js": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.3.tgz", + "integrity": "sha512-/UETyP0W22QILqS+6HowevwhEFJ3MBJnwTf75Qob9Wz9t0DPuisL8kW8YZMK62dHAKE1c1p+gY1TtOLY+USEHA==", + "dev": true, + "optional": true, + "requires": { + "inherits": "^2.0.3", + "minimalistic-assert": "^1.0.0" + } + }, + "js-sha3": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.5.7.tgz", + "integrity": "sha1-DU/9gALVMzqrr0oj7tL2N0yfKOc=", + "dev": true, + "optional": true + }, + "scrypt-js": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/scrypt-js/-/scrypt-js-2.0.4.tgz", + "integrity": "sha512-4KsaGcPnuhtCZQCxFxN3GVYIhKFPTdLd8PLC552XwbMndtD0cjRFAhDuuydXQ0h08ZfPgzqe6EKHozpuH74iDw==", + "dev": true, + "optional": true + }, + "setimmediate": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.4.tgz", + "integrity": "sha1-IOgd5iLUoCWIzgyNqJc8vPHTE48=", + "dev": true, + "optional": true + }, + "uuid": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-2.0.1.tgz", + "integrity": "sha1-wqMN7bPlNdcsz4LjQ5QaULqFM6w=", + "dev": true, + "optional": true + } + } + }, "@cnakazawa/watch": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/@cnakazawa/watch/-/watch-1.0.4.tgz", @@ -5193,7 +5269,7 @@ "camelcase": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", - "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", + "integrity": "sha512-FxAv7HpHrXbh3aPo4o2qxHay2lkLY3x5Mw3KeE4KQE8ysVfziWeRZDwcjauvwBSGEC/nXUPzZy8zeh4HokqOnw==", "dev": true, "optional": true }, @@ -8273,11 +8349,6 @@ "tryer": "^1.0.1" } }, - "big-integer": { - "version": "1.6.51", - "resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.51.tgz", - "integrity": "sha512-GPEid2Y9QU1Exl1rpO9B2IPJGHPSupF5GnVIP0blYvNOMer2bTvSWs1jGOUg04hTmu67nmLsQ9TBo1puaotBHg==" - }, "big.js": { "version": "5.2.2", "resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz", @@ -9295,7 +9366,7 @@ "camel-case": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/camel-case/-/camel-case-3.0.0.tgz", - "integrity": "sha1-yjw2iKTpzzpM2nd9xNy8cTJJz3M=", + "integrity": "sha512-+MbKztAYHXPr1jNTSKQF52VpcFjwY5RkR7fxksV8Doo4KAYc5Fl4UJRgthBbTmEx8C54DqahhbLJkDwjI3PI/w==", "dev": true, "optional": true, "requires": { @@ -20987,6 +21058,12 @@ "is-wsl": "^2.1.1" } }, + "openzeppelin-solidity-2.3.0": { + "version": "npm:openzeppelin-solidity@2.3.0", + "resolved": "https://registry.npmjs.org/openzeppelin-solidity/-/openzeppelin-solidity-2.3.0.tgz", + "integrity": "sha512-QYeiPLvB1oSbDt6lDQvvpx7k8ODczvE474hb2kLXZBPKMsxKT1WxTCHBYrCU7kS7hfAku4DcJ0jqOyL+jvjwQw==", + "dev": true + }, "opn": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/opn/-/opn-5.5.0.tgz", @@ -25563,14 +25640,14 @@ "ansi-regex": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", "dev": true, "optional": true }, "camelcase": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz", - "integrity": "sha1-MvxLn82vhF/N9+c7uXysImHwqwo=", + "integrity": "sha512-4nhGqUkc4BqbBBB4Q6zLuD7lzzrHYrjKGeYaEji/3tFR5VdJu9v+LilhGIVe8wxEJPPOeWo7eg8dwY13TZ1BNg==", "dev": true, "optional": true }, @@ -26783,23 +26860,6 @@ "web3-utils": "1.2.2" }, "dependencies": { - "@chainlink/contracts-0.0.10": { - "version": "npm:@chainlink/contracts@0.0.10", - "resolved": "https://registry.npmjs.org/@chainlink/contracts/-/contracts-0.0.10.tgz", - "integrity": "sha512-ok+ucSQ+3mrR+zjbi6zIrdd5M9XymcqVcnXGVyqBVRYZp97jS2/rt/glP320JmHxmi4pacgDOg0Ux11xIr1S8Q==", - "dev": true, - "requires": { - "@truffle/contract": "^4.2.6", - "ethers": "^4.0.45" - } - }, - "aes-js": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/aes-js/-/aes-js-3.0.0.tgz", - "integrity": "sha1-4h3xCtbCBTKVvLuNq0Cwnb6ofk0=", - "dev": true, - "optional": true - }, "bn.js": { "version": "4.11.8", "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", @@ -26823,78 +26883,6 @@ "xhr-request-promise": "^0.1.2" } }, - "ethers": { - "version": "4.0.49", - "resolved": "https://registry.npmjs.org/ethers/-/ethers-4.0.49.tgz", - "integrity": "sha512-kPltTvWiyu+OktYy1IStSO16i2e7cS9D9OxZ81q2UUaiNPVrm/RTcbxamCXF9VUSKzJIdJV68EAIhTEVBalRWg==", - "dev": true, - "optional": true, - "requires": { - "aes-js": "3.0.0", - "bn.js": "^4.11.9", - "elliptic": "6.5.4", - "hash.js": "1.1.3", - "js-sha3": "0.5.7", - "scrypt-js": "2.0.4", - "setimmediate": "1.0.4", - "uuid": "2.0.1", - "xmlhttprequest": "1.8.0" - }, - "dependencies": { - "bn.js": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", - "dev": true, - "optional": true - } - } - }, - "hash.js": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.3.tgz", - "integrity": "sha512-/UETyP0W22QILqS+6HowevwhEFJ3MBJnwTf75Qob9Wz9t0DPuisL8kW8YZMK62dHAKE1c1p+gY1TtOLY+USEHA==", - "dev": true, - "optional": true, - "requires": { - "inherits": "^2.0.3", - "minimalistic-assert": "^1.0.0" - } - }, - "js-sha3": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.5.7.tgz", - "integrity": "sha1-DU/9gALVMzqrr0oj7tL2N0yfKOc=", - "dev": true, - "optional": true - }, - "openzeppelin-solidity-2.3.0": { - "version": "npm:openzeppelin-solidity@2.3.0", - "resolved": "https://registry.npmjs.org/openzeppelin-solidity/-/openzeppelin-solidity-2.3.0.tgz", - "integrity": "sha512-QYeiPLvB1oSbDt6lDQvvpx7k8ODczvE474hb2kLXZBPKMsxKT1WxTCHBYrCU7kS7hfAku4DcJ0jqOyL+jvjwQw==", - "dev": true - }, - "scrypt-js": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/scrypt-js/-/scrypt-js-2.0.4.tgz", - "integrity": "sha512-4KsaGcPnuhtCZQCxFxN3GVYIhKFPTdLd8PLC552XwbMndtD0cjRFAhDuuydXQ0h08ZfPgzqe6EKHozpuH74iDw==", - "dev": true, - "optional": true - }, - "setimmediate": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.4.tgz", - "integrity": "sha1-IOgd5iLUoCWIzgyNqJc8vPHTE48=", - "dev": true, - "optional": true - }, - "uuid": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-2.0.1.tgz", - "integrity": "sha1-wqMN7bPlNdcsz4LjQ5QaULqFM6w=", - "dev": true, - "optional": true - }, "web3-utils": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.2.2.tgz", @@ -30975,6 +30963,11 @@ "winston": "^3.7.2" }, "dependencies": { + "big-integer": { + "version": "1.6.51", + "resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.51.tgz", + "integrity": "sha512-GPEid2Y9QU1Exl1rpO9B2IPJGHPSupF5GnVIP0blYvNOMer2bTvSWs1jGOUg04hTmu67nmLsQ9TBo1puaotBHg==" + }, "is-stream": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", diff --git a/wallet/package.json b/wallet/package.json index 686438287..3b60ec455 100644 --- a/wallet/package.json +++ b/wallet/package.json @@ -25,7 +25,7 @@ "case-sensitive-paths-webpack-plugin": "2.3.0", "comlink-loader": "^2.0.0", "crypto-js": "^4.1.1", - "css-loader": "4.3.0", + "css-loader": "4.3.0", "dotenv": "8.2.0", "dotenv-expand": "5.1.0", "eslint": "^7.11.0",