Skip to content

Commit

Permalink
Merge pull request #76 from Cerebellum-Network/release/0.11.0
Browse files Browse the repository at this point in the history
Release v0.11.0
  • Loading branch information
Andrei Navoichyk authored Apr 21, 2022
2 parents 7a81cc2 + 9f61de9 commit d7fd22d
Show file tree
Hide file tree
Showing 12 changed files with 28 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .env.dev
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ REACT_APP_SUPPORT_URL="https://t.me/ceretroubleshooting"
REACT_APP_SENTRY_DSN_URL="https://3d39fa05d843482eb93377947b435b5b@o318183.ingest.sentry.io/5987177"
REACT_APP_SENTRY_ENV=development
SENTRY_AUTH_TOKEN="db67ae12222811ecabd2564b6436d30d"
REACT_APP_SENTRY_RELEASE="0.10.5"
REACT_APP_SENTRY_RELEASE="0.11.0"

REACT_APP_MAINTENANCE=false
REACT_APP_CONNECT_WITH_SUBSTRATE_WALLET_ENABLED=true
2 changes: 1 addition & 1 deletion .env.prod
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ REACT_APP_SUPPORT_URL="https://t.me/ceretroubleshooting"
REACT_APP_SENTRY_DSN_URL="https://3d39fa05d843482eb93377947b435b5b@o318183.ingest.sentry.io/5987177"
REACT_APP_SENTRY_ENV=production
SENTRY_AUTH_TOKEN="db67ae12222811ecabd2564b6436d30d"
REACT_APP_SENTRY_RELEASE="0.10.5"
REACT_APP_SENTRY_RELEASE="0.11.0"

REACT_APP_MAINTENANCE=false
REACT_APP_CONNECT_WITH_SUBSTRATE_WALLET_ENABLED=true
2 changes: 1 addition & 1 deletion .env.stage
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ REACT_APP_SUPPORT_URL="https://t.me/ceretroubleshooting"
REACT_APP_SENTRY_DSN_URL="https://3d39fa05d843482eb93377947b435b5b@o318183.ingest.sentry.io/5987177"
REACT_APP_SENTRY_ENV=staging
SENTRY_AUTH_TOKEN="db67ae12222811ecabd2564b6436d30d"
REACT_APP_SENTRY_RELEASE="0.10.5"
REACT_APP_SENTRY_RELEASE="0.11.0"

REACT_APP_MAINTENANCE=false
REACT_APP_CONNECT_WITH_SUBSTRATE_WALLET_ENABLED=true
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

- ...

## v0.11.0

- Added transferable balance

## v0.10.5

- Added fallback urls
Expand Down
17 changes: 8 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,18 @@

## Install

### Install dependencies

For installing the dependencies use the command:

```
yarn install
```

Create a `.env` file based on the `.env.example` file in the root of the project.
Get a Blocknative DAPP ID (here)[https://explorer.blocknative.com/account] and populate the respective field in the `.env` file
### Update configs

1. Copy to `.env` file in the root of the project the content from `.env.dev`, `.env.stage` or `env.prod` depending on the environment you want to run.
1. Copy to `chainbridge-runtime-config.js` file in the `public` folder the content from `chainbridge-runtime-config.cere.dev.js`, `chainbridge-runtime-config.cere.stage.js` or `chainbridge-runtime-config.cere.prod.js` in `config` folder depending on the environment you want to run.

## Usage

Expand All @@ -37,13 +43,6 @@ For running a local instance use the command:
yarn start
```

The codebase is configured to be run against the Geth <> Substrate node that can be set up by following the guide [here](https://chainbridge.chainsafe.io/local/) or executing:

- `yarn start:substrate` to start,
- `yarn setup:example` to initialize

Should the substrate chain you are targetting require different type definitions, the type definitions file should be added to `src/Contexts/Adaptors/SubstrateApis/` and the file name for the types set in the substrate bridge configs.

### Build

Update the configs for the bridge in `src/chainbridgeContext.ts`. There should be at least 2 chains configured for correct functioning of the bridge. Each chain accepts the following configuration parameters:
Expand Down
1 change: 1 addition & 0 deletions config/chainbridge-runtime-config.cere.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ window.__RUNTIME_CONFIG__ = {
transferPalletName: "erc20",
transferFunctionName: "transferNative",
typesFileName: "bridgeTypes.json",
existentialDepositPlusNetworkFee: "1.03",
tokens: [
{
address: "cere-native",
Expand Down
1 change: 1 addition & 0 deletions config/chainbridge-runtime-config.cere.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ window.__RUNTIME_CONFIG__ = {
transferPalletName: "erc20",
transferFunctionName: "transferNative",
typesFileName: "bridgeTypes.json",
existentialDepositPlusNetworkFee: "1.03",
tokens: [
{
address: "cere-native",
Expand Down
1 change: 1 addition & 0 deletions config/chainbridge-runtime-config.cere.stage.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ window.__RUNTIME_CONFIG__ = {
transferPalletName: "erc20",
transferFunctionName: "transferNative",
typesFileName: "bridgeTypes.json",
existentialDepositPlusNetworkFee: "1.03",
tokens: [
{
address: "cere-native",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@Cerebellum-Network/chainbridge-ui",
"version": "0.10.5",
"version": "0.11.0",
"private": true,
"dependencies": {
"@babel/core": "^7.12.3",
Expand Down
2 changes: 1 addition & 1 deletion src/Components/Pages/TransferPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,7 @@ const TransferPage = () => {
tokens={tokens}
name="token"
disabled={!destinationChainConfig}
label={`Balance: `}
label={`Transferable balance: `}
className={classes.generalInput}
placeholder=""
sync={(tokenAddress) => {
Expand Down
9 changes: 7 additions & 2 deletions src/Contexts/Adaptors/SubstrateAdaptors.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,13 @@ export const SubstrateHomeAdaptorProvider = ({
[homeChainConfig.tokens[0].symbol || "TOKEN"]: {
decimals:
homeChainConfig.tokens[0].decimals ?? homeChainConfig.decimals,
balance: parseInt(
utils.formatUnits(balance, homeChainConfig.decimals)
balance: Math.max(
0,
parseFloat(
utils.formatUnits(balance, homeChainConfig.decimals)
) -
(homeChainConfig as SubstrateBridgeConfig)
.existentialDepositPlusNetworkFee
),
balanceBN: new BN(balance).shiftedBy(-homeChainConfig.decimals),
name: homeChainConfig.tokens[0].name,
Expand Down
1 change: 1 addition & 0 deletions src/chainbridgeConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export type SubstrateBridgeConfig = BridgeConfig & {
transferPalletName: string;
transferFunctionName: string;
typesFileName: string;
existentialDepositPlusNetworkFee: number;
};

export type ChainbridgeConfig = {
Expand Down

0 comments on commit d7fd22d

Please sign in to comment.