Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
15.8.0
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ type BridgeConfig = {
networkId: number // The networkId of this chain.
name: string // The human readable name of this chain.
bridgeAddress: string // The address on the brdige contract deployed on this chain.
erc20HandlerAddress: string // The ERC20 handler address.
genericHandlerAddress: string // The ERC20 handler address.
rpcUrl: string // An RPC URL for this chain.
type: "Ethereum" | "Substrate" // The type of chain.
tokens: TokenConfig[] // An object to configure the tokens this bridge can transfer. See the TokenConfig object below.
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"@babel/core": "^7.12.3",
"@babel/runtime": "^7.12.1",
"@chainsafe/chainbridge-contracts": "^1.0.3",
"@chainsafe/web3-context": "1.2.0",
"@meterio/web3-context": "1.2.3",
"@chainsafe/common-components": "1.0.26",
"@chainsafe/common-theme": "1.0.6",
"@material-ui/styles": "4.10.0",
Expand All @@ -15,7 +15,7 @@
"bnc-onboard": "1.19.2",
"clsx": "^1.1.1",
"dayjs": "^1.9.1",
"ethers": "^5.0.17",
"ethers": "^5.4.4",
"formik": "^2.2.0",
"history": "^5.0.0",
"react": "^16.13.1",
Expand Down
Binary file removed public/ChainSafe-logo.png
Binary file not shown.
Binary file added public/ample-favicon/android-icon-144x144.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/ample-favicon/android-icon-192x192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/ample-favicon/android-icon-36x36.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/ample-favicon/android-icon-48x48.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/ample-favicon/android-icon-72x72.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/ample-favicon/android-icon-96x96.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/ample-favicon/apple-icon-114x114.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/ample-favicon/apple-icon-120x120.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/ample-favicon/apple-icon-144x144.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/ample-favicon/apple-icon-152x152.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/ample-favicon/apple-icon-180x180.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/ample-favicon/apple-icon-57x57.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/ample-favicon/apple-icon-60x60.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/ample-favicon/apple-icon-72x72.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/ample-favicon/apple-icon-76x76.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/ample-favicon/apple-icon-precomposed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/ample-favicon/apple-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions public/ample-favicon/browserconfig.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<browserconfig><msapplication><tile><square70x70logo src="/ms-icon-70x70.png"/><square150x150logo src="/ms-icon-150x150.png"/><square310x310logo src="/ms-icon-310x310.png"/><TileColor>#ffffff</TileColor></tile></msapplication></browserconfig>
Binary file added public/ample-favicon/favicon-16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/ample-favicon/favicon-32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/ample-favicon/favicon-96x96.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/ample-favicon/favicon.ico
Binary file not shown.
41 changes: 41 additions & 0 deletions public/ample-favicon/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"name": "App",
"icons": [
{
"src": "\/android-icon-36x36.png",
"sizes": "36x36",
"type": "image\/png",
"density": "0.75"
},
{
"src": "\/android-icon-48x48.png",
"sizes": "48x48",
"type": "image\/png",
"density": "1.0"
},
{
"src": "\/android-icon-72x72.png",
"sizes": "72x72",
"type": "image\/png",
"density": "1.5"
},
{
"src": "\/android-icon-96x96.png",
"sizes": "96x96",
"type": "image\/png",
"density": "2.0"
},
{
"src": "\/android-icon-144x144.png",
"sizes": "144x144",
"type": "image\/png",
"density": "3.0"
},
{
"src": "\/android-icon-192x192.png",
"sizes": "192x192",
"type": "image\/png",
"density": "4.0"
}
]
}
Binary file added public/ample-favicon/ms-icon-144x144.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/ample-favicon/ms-icon-150x150.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/ample-favicon/ms-icon-310x310.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/ample-favicon/ms-icon-70x70.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions public/downtime.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<html>
<body>
<h1>The Meter Passport bridge is experiencing downtime. Check back again soon.</h1>
</body>
</html>
Binary file removed public/favicon.ico
Binary file not shown.
26 changes: 22 additions & 4 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta name="description" content="ChainBridge" />
<link rel="apple-touch-icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="description" content="Cross-Chain Ample Bridge" />
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
Expand All @@ -21,7 +19,27 @@
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>Chainbridge</title>

<!-- Ample additions start -->
<link rel="preload" href="https://fonts.gstatic.com/s/cormorantgaramond/v5/EI2hhCO6kSfLAy-Dpd8fdwtAvOaaBo6YYi0S8FnWF2s.woff2" as="font" crossorigin="anonymous">
<link rel="stylesheet" href="https://use.fontawesome.com/1df5373559.css">
<link href="https://fonts.googleapis.com/css2?family=Montserrat+Alternates:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap" rel="stylesheet">
<link rel="apple-touch-icon" sizes="57x57" href="%PUBLIC_URL%/ample-favicon/apple-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="%PUBLIC_URL%/ample-favicon/apple-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="%PUBLIC_URL%/ample-favicon/apple-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="%PUBLIC_URL%/ample-favicon/apple-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="%PUBLIC_URL%/ample-favicon/apple-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="%PUBLIC_URL%/ample-favicon/apple-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="%PUBLIC_URL%/ample-favicon/apple-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="%PUBLIC_URL%/ample-favicon/apple-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="%PUBLIC_URL%/ample-favicon/apple-icon-180x180.png">
<link rel="icon" type="image/png" sizes="192x192" href="%PUBLIC_URL%/ample-favicon/android-icon-192x192.png">
<link rel="icon" type="image/png" sizes="32x32" href="%PUBLIC_URL%/ample-favicon/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="96x96" href="%PUBLIC_URL%/ample-favicon/favicon-96x96.png">
<link rel="icon" type="image/png" sizes="16x16" href="%PUBLIC_URL%/ample-favicon/favicon-16x16.png">
<!-- Ample additions end -->

<title>Ample Bridge</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
Expand Down
10 changes: 5 additions & 5 deletions public/manifest.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"short_name": "Chainbridge",
"name": "Chainbridge",
"short_name": "Ample Bridge",
"name": "Ample Bridge",
"icons": [
{
"src": "ChainSafe-logo.png",
"src": "ample-logo/logo.png",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
}
],
"start_url": ".",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
"theme_color": "#ffffff",
"background_color": "#000000"
}
3 changes: 3 additions & 0 deletions scripts/deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
yarn build
aws s3 sync build/ s3://bridge.ampleforth.org/ --cache-control max-age=86400 --acl public-read

8 changes: 4 additions & 4 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import {
} from "@chainsafe/common-components";

import Routes from "./Components/Routes";
import { lightTheme } from "./Themes/LightTheme";
import { ampleTheme } from "./Themes/AmpleforthTheme";
import { ChainbridgeProvider } from "./Contexts/ChainbridgeContext";
import AppWrapper from "./Layouts/AppWrapper";
import { Web3Provider } from "@chainsafe/web3-context";
import { Web3Provider } from "@meterio/web3-context";
import { chainbridgeConfig } from "./chainbridgeConfig";
import { utils } from "ethers";

Expand Down Expand Up @@ -53,7 +53,7 @@ const App: React.FC<{}> = () => {
)}
onReset={() => window.location.reload()}
>
<ThemeSwitcher themes={{ light: lightTheme }}>
<ThemeSwitcher themes={{ light: ampleTheme }}>
<CssBaseline />
<ToasterProvider autoDismiss>
<Web3Provider
Expand All @@ -71,7 +71,7 @@ const App: React.FC<{}> = () => {
}}
checkNetwork={false}
gasPricePollingInterval={120}
gasPriceSetting="fast"
gasPriceSetting="recommendedBaseFee"
>
<ChainbridgeProvider>
<Router>
Expand Down
8 changes: 6 additions & 2 deletions src/Components/Custom/TokenInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ import React from "react";

import { useField, useFormikContext } from "formik";
import { Button, FormikTextInput } from "@chainsafe/common-components";
import { Tokens } from "@chainsafe/web3-context/dist/context/tokensReducer";
import { Tokens } from "@meterio/web3-context/dist/context/tokensReducer";

import {safeRound} from "../../Utils/XCAmple";

interface ITokenInput {
disabled?: boolean;
Expand Down Expand Up @@ -42,7 +44,9 @@ const TokenInput: React.FC<ITokenInput> = ({
className={classNames?.button}
onClick={() => {
helpers.setValue(
tokens[(values as Record<string, any>)[tokenSelectorKey]].balance
safeRound(
tokens[(values as Record<string, any>)[tokenSelectorKey]].balance,
tokens[(values as Record<string, any>)[tokenSelectorKey]].decimals)
);
}}
variant="outline"
Expand Down
10 changes: 8 additions & 2 deletions src/Components/Custom/TokenSelectInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import {
IFormikSelectInputProps,
FormikSelectInput,
} from "@chainsafe/common-components";
import { Tokens } from "@chainsafe/web3-context/dist/context/tokensReducer";
import { Tokens } from "@meterio/web3-context/dist/context/tokensReducer";
import {safeRound} from "../../Utils/XCAmple";

interface ITokenSelectInput extends IFormikSelectInputProps {
tokens: Tokens;
Expand All @@ -20,10 +21,15 @@ const TokenSelectInput: React.FC<ITokenSelectInput> = ({
...rest
}: ITokenSelectInput) => {
const [field] = useField(name);
const roundedBalance = safeRound(tokens[field.value]?.balance, tokens[field.value]?.decimals);
const amountToDisplay = parseFloat(roundedBalance).toLocaleString();
const labelParsed = tokens[field.value]
? `${label} ${tokens[field.value]?.balance} ${tokens[field.value]?.symbol}`
? `${label} ${amountToDisplay} ${tokens[field.value]?.symbol}`
: "Please select token";

const tokenList = Object.keys(tokens);
const nTokens = tokenList.length;

const [synced, setSynced] = useState();
useEffect(() => {
if (sync && field.value !== synced) {
Expand Down
6 changes: 3 additions & 3 deletions src/Components/Pages/FormikContextElements/Fees.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ const FeesFormikWrapped: React.FC<IFeesFormikWrapped> = ({

return (
<section className={className}>
{fee !== undefined && feeSymbol !== undefined && (
{(
<>
<Typography component="p">Bridge Fee</Typography>
<Typography component="p">
{fee} {feeSymbol}
{fee||"0"} {feeSymbol}
</Typography>
</>
)}
{symbol !== undefined && (
{(
<>
<Typography component="p">Transfer Amount:</Typography>
<Typography component="p">
Expand Down
Loading