Skip to content

Commit

Permalink
Merge branch 'staging'
Browse files Browse the repository at this point in the history
- Load params from cloud: #52
- Multitransfer: #55
- Upgrade lib version: #98
- Fix some bugs
  • Loading branch information
maxaleks committed Nov 22, 2022
2 parents 5a410d7 + 9c84912 commit 3bce3c9
Show file tree
Hide file tree
Showing 29 changed files with 1,664 additions and 379 deletions.
6 changes: 4 additions & 2 deletions netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
REACT_APP_TOKEN_ADDRESS = "0xB0B195aEFA3650A6908f15CdaC7D92F8a5791B0B"
REACT_APP_RELAYER_URL = "https://relayer-mvp.zkbob.com"
REACT_APP_RPC_URL = "https://polygon-rpc.com"
REACT_APP_ZEROPOOL_NETWORK = "ethereum"
REACT_APP_ZEROPOOL_NETWORK = "polygon"
REACT_APP_BUCKET_URL = "https://r2.zkbob.com"
# REACT_APP_RESTRICTED_COUNTRIES = "BY,CU,IR,IQ,CI,LR,KP,RU,SD,SY,US,ZW"

[context.staging.environment]
Expand All @@ -37,5 +38,6 @@
REACT_APP_TOKEN_ADDRESS = "0x2C74B18e2f84B78ac67428d0c7a9898515f0c46f"
REACT_APP_RELAYER_URL = "https://relayer.thgkjlr.website/"
REACT_APP_RPC_URL = "https://rpc.sepolia.org"
REACT_APP_ZEROPOOL_NETWORK = "ethereum"
REACT_APP_ZEROPOOL_NETWORK = "sepolia"
REACT_APP_BUCKET_URL = "https://r2-staging.zkbob.com"
# REACT_APP_RESTRICTED_COUNTRIES = "BY,CU,IR,IQ,CI,LR,KP,RU,SD,SY,US,ZW"
13 changes: 9 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"@web3-react/core": "^6.1.9",
"@web3-react/injected-connector": "^6.0.7",
"@web3-react/walletconnect-connector": "^6.2.13",
"codemirror": "5.65.9",
"crypto-browserify": "^3.12.0",
"crypto-js": "^4.1.1",
"ethers": "^5.4.7",
Expand All @@ -23,20 +24,22 @@
"moment": "^2.29.3",
"rc-tooltip": "^5.1.1",
"react": "^17.0.2",
"react-codemirror2": "^7.2.1",
"react-copy-to-clipboard": "^5.0.4",
"react-device-detect": "^2.2.2",
"react-dom": "^17.0.2",
"react-modal": "^3.14.3",
"react-outside-click-handler": "^1.3.0",
"react-router-dom": "^5.3.0",
"react-scripts": "5.0.0",
"react-switch": "^7.0.0",
"react-toastify": "^8.2.0",
"stream-browserify": "^3.0.0",
"styled-components": "^5.3.0",
"unique-names-generator": "^4.7.1",
"web-vitals": "^1.0.1",
"webpack": "^5.70.0",
"zkbob-client-js": "0.8.0"
"zkbob-client-js": "1.1.0"
},
"scripts": {
"start": "react-app-rewired start",
Expand Down Expand Up @@ -66,9 +69,11 @@
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
"chrome >= 67",
"edge >= 79",
"firefox >= 68",
"opera >= 54",
"safari >= 14"
],
"development": [
"last 1 chrome version",
Expand Down
3 changes: 3 additions & 0 deletions src/assets/red-cross.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed src/assets/zp-params/transfer_params.bin
Binary file not shown.
62 changes: 0 additions & 62 deletions src/assets/zp-params/transfer_verification_key.json

This file was deleted.

Binary file removed src/assets/zp-params/tree_params.bin
Binary file not shown.
54 changes: 0 additions & 54 deletions src/assets/zp-params/tree_verification_key.json

This file was deleted.

2 changes: 2 additions & 0 deletions src/components/Card/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ const Card = styled.div`
const Title = styled.span`
color: ${props => props.theme.card.title.color};
font-weight: ${props => props.theme.text.weight.normal};
padding: 0 10px;
`;

const Note = styled.span`
Expand All @@ -38,4 +39,5 @@ const Note = styled.span`
font-weight: ${props => props.theme.text.weight.normal};
align-self: center;
text-align: center;
padding: 0 10px;
`;
38 changes: 32 additions & 6 deletions src/components/ConfirmTransactionModal/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react';
import styled from 'styled-components';
import { ethers } from 'ethers';

import Button from 'components/Button';
import Modal from 'components/Modal';
Expand All @@ -10,6 +11,7 @@ import { formatNumber } from 'utils';
export default ({
isOpen, onClose, onConfirm, title, amount, receiver,
shielded, isZkAddress, fee, numberOfTxs, type,
isMultitransfer, transfers, openDetails,
}) => {
return (
<Modal
Expand All @@ -22,13 +24,27 @@ export default ({
<DetailsContainer>
<AmountContainer>
<TokenIcon src={tokenIcon(shielded)} />
<Amount>{formatNumber(amount)}{' '}</Amount>
<Amount>
{formatNumber(isMultitransfer
? transfers.reduce((acc, curr) => acc.add(curr.amount), ethers.constants.Zero)
: amount, 18
)}{' '}
</Amount>
<TokenSymbol>{tokenSymbol(shielded)}</TokenSymbol>
</AmountContainer>
<SmallText>
send to {isZkAddress ? 'zkBob address' : ''}
</SmallText>
<MediumText>{receiver}</MediumText>
{isMultitransfer ? (
<>
<MediumTextMulti>will be transferred to {transfers.length} zkBob addresses</MediumTextMulti>
<ViewAllButton type="link" onClick={openDetails}>view all</ViewAllButton>
</>
) : (
<>
<SmallText>
send to {isZkAddress ? 'zkBob address' : ''}
</SmallText>
<MediumText>{receiver}</MediumText>
</>
)}
<SmallText>{type} details</SmallText>
<Row>
<MediumText>Number of transactions:</MediumText>
Expand All @@ -39,7 +55,7 @@ export default ({
<MediumText>{formatNumber(fee)} {tokenSymbol(shielded)}</MediumText>
</Row>
</DetailsContainer>
<Button onClick={onConfirm}>Confirm</Button>
<Button onClick={onConfirm}>Confirm {isMultitransfer && 'multitransfer'}</Button>
</Container>
</Modal>
);
Expand Down Expand Up @@ -113,3 +129,13 @@ const Row = styled.div`
justify-content: space-between;
align-self: stretch;
`;

const ViewAllButton = styled(Button)`
font-size: 16px;
margin-bottom: 5px;
`;

const MediumTextMulti = styled(MediumText)`
margin-bottom: 0;
margin-top: 10px;
`;
Loading

0 comments on commit 3bce3c9

Please sign in to comment.