GithubHelp home page GithubHelp logo

omni / bridge-ui Goto Github PK

View Code? Open in Web Editor NEW
40.0 8.0 51.0 46.55 MB

UI for TokenBridge, an interoperability solution between Ethereum networks for native and ERC tokens

Home Page: https://bridge.poa.net/

HTML 0.37% CSS 22.81% JavaScript 75.69% Dockerfile 0.54% Shell 0.58%
poa-bridge-contracts bridge poa cross-chain

bridge-ui's Introduction

Token Bridge User Interface (UI) Application

A DApp interface to transfer assets between networks running the Token Bridge contracts.

Due to reorganization of the token bridge repos into one monorepo the sources of the token bridge UI was moved to the TokenBridge repo.

What does it mean for you? If you would like

  • to raise an issue against the UI, follow this link.
  • to find if a new version of the UI is ready in the monorepo, visit the releases tab.
  • to get access to the last changes made in this repo, check the release 2.1.1 or the master branch.

If you still have no clear understanding what you need to do, please visit the TokenBridge forum and raise your question there.

bridge-ui's People

Contributors

akolotov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bridge-ui's Issues

Integrate Netlify

Problem: hard to review changes from PRs
Solution: Use netlify for each PR deployment

Deployment hangs when following the README instructions

It may be that I have used some incorrect information, as there is some ambiguity in the instructions. In particular, I have used the same account throughout, for 0xETH_ACCOUNT_VALIDATOR_SOKOL and the VALIDATORS and PROXY_OWNER parameters for running the deployment.

Another change I made, was to include this same account as the from field in each network configuration:

module.exports = {
  networks: {
    development: {
      host: "localhost",
      port: 7545,
      network_id: "*", // Match any network id
      from: "0xMY_ACCOUNT"
    },
    home: {
      host: "localhost",
      port: "8545", // check your sokol.toml [rpc] port section
      network_id: "*",
      from: "0xMY_ACCOUNT",
      gas: 4700000,
      gasPrice: 1000000000
    }
  }
}

This was because I was getting an error saying that the from parameter was missing.

With this setup, I have tried followed the instructions up to the bridge contract deployment:

$ VALIDATORS="0xMY_ACCOUNT" REQUIRED_NUMBER_OF_VALIDATORS=1 HOME_LIMIT=1000000000000000000 MAX_AMOUNT_PER_TX=100000000000000000 PROXY_OWNER="0xMY_ACCOUNT" NETWORK=home npm run deploy

But the process just hangs here:

> [email protected] deploy /Users/peter/dev/poa/sokol-kovan-bridge/poa-parity-bridge-contracts
> truffle migrate --reset --network $NETWORK

Using network 'home'.

Running migration: 1_initial_migration.js
  Deploying Migrations...

With Parity UI connected to Kovan, I do get a request for a signature, but this is on the wrong network. I believe this needs to be signed on the Sokol chain instead. However, I cannot get Parity UI to connect to me Sokol chain.

Add Zendesk widget to Bridge DApp

Problem
Add the embeddable zendesk widget.

Solution
Add the following to the head

		<!-- Start of poanet Zendesk Widget script -->
		<script>
			/*<![CDATA[*/
			window.zE || (function(e, t, s) {
				var n = window.zE = window.zEmbed = function() {
						n._.push(arguments)
					},
					a = n.s = e.createElement(t),
					r = e.getElementsByTagName(t)[0];
				n.set = function(e) {
					n.set._.push(e)
				}, n._ = [], n.set._ = [], a.async = true, a.setAttribute("charset", "utf-8"), a.src = "https://static.zdassets.com/ekr/asset_composer.js?key=" + s, n.t = +new Date, a.type = "text/javascript", r.parentNode.insertBefore(a, r)
			})(document, "script", "bb7f35c0-88a9-46f8-8807-01dd723665ea"); /*]]>*/
		</script>
		<!-- End of poanet Zendesk Widget script -->

Refactor react components

This issue refers to the third and fourth item of #20 . Some components can be refactored to reusable components, splitting logic and stateless components.

Fix Warnings

This is the first item of #20. When running the app on dev mode there are a couple of warnings. Fixing them will help to easily notice new warnings while working on new features.

Reflect in the documentation recent changes in bridge and contract deployment procedure

Please update the README.md file to reflect changes made under:

Also I think it is not necessary to install and configure parity binary any more. So, it could be removed from documentation also.

Last minute UI changes

image

Commas in number to make it more readable (2,999,999.5)

image

Remove the word “limit” on both info boxes.

  • Actually instead of Current Deposit Limit, change to Daily Deposit Limit
  • Instead of Token Contract Balance, Locked POA in Bridge Contract
  • On the POA20 side instead of Current Withdrawal Limit, Daily Withdrawal Limit

Also, close the modal if clicked outside

Refactoring

  • Make it more modular by decoupling React components into tiny modules

  • send sweetalert when the token is received on another chain

add sweetalert confirmation on transfer click

please show confirmation box with some information:

Please confirm that you would like to send 0.1 POA from POA.network to receive 0.1 POA20 on Ethereum Mainnet.
After confirmation, please allow metamask to submit transaction.
Cancel/Confirm buttons

Also, run validation checks on this click to make sure he is connected to right network.

Change language of the more info

image

Network (Instead of RPC URL)
Home Address - Bridge Home Address
Current Deposit Limit
Maximum Amount Per Transaction
Minimum Amount Per Transaction
Locked POA native tokens Amount
Your POA Balance (This should be the only value bolded)

image

Network (Instead of RPC URL)
Foreign Address - Bridge Foreign Address
Current Withdraw Limit -
Maximum Amount Per Transaction
Minimum Amount Per Transaction
Custom Token Address
POA20 tokens Amount
Your POA20 Balance (This should be the only value bolded)

Refactor mobx Stores

This refers to the second item of #20 . It would be nice to decouple the store logic from web3 and contracts functions. Also there are some functions that can be refactored to more reusable code.

Add matching query for CollectedSignatures Event

Solution:
Every event CollectedSignated & SignedForWithdraw has messageHash param,
so I have to call message method on the contract and substract txHash from it by doing the following:

message =

0x0039f22efb07a647557c7c5d17854cfd6d489ef3000000000000000000000000000000000000000000000000016345785d8a00002aba426015916079a2a10306fa1bb2edd18ed030a1a04cd9dcba2d1bd77b096c000000000000000000000000000000000000000000000000000000003b9aca00

txHash = '0x' + message.substring(106,170)

Update favicon

Problem:
Bridge has old favicon for POA.

Solution:
Update to this favicon:
favicon

Parity Bridge is corrupting the database file

I'm running Parity-bridge, based on the current version of the README, using:

./parity-bridge/target/release/bridge --config config.toml --database db.toml

And my db.toml file is like this:

home_contract_address = "0x74A71bFb6C4903d79EbDd77C556D2d43A9346BdD"
foreign_contract_address = "0xD6fE4c32ADDe8e4b5eD6272Ecb5c434Dc7b120c4"
home_deploy = 2025251 # block number at which the contract was created for home contract you can find in `bridgeDeploymentResults.json`
foreign_deploy = 6923247 # block number at which the contract was created for foreign contract you can find in `bridgeDeploymentResults.json`
checked_deposit_relay = 2025251 # last checked deposits events on Home network
checked_withdraw_relay = 6923247 # last checked withdraw events on Foreign network
checked_withdraw_confirm = 6923247 # last checked withdraw events on Foreign network

However, once the parity-bridge process starts, the file gets corrupted. It looks like this:

home_contract_address = "0x74a71bfb6c4903d79ebdd77c556d2d43a9346bdd"
foreign_contract_address = "0xd6fe4c32adde8e4b5ed6272ecb5c434dc7b120c4"
home_deploy = 2025251
foreign_deploy = 6923247
checked_deposit_relay = 2026365
checked_withdraw_relay = 6924041
checked_withdraw_confirm = 6924041
loy = 6923247 # block number at which the contract was created for foreign contract you can find in `bridgeDeploymentResults.json`
checked_deposit_relay = 2025251 # last checked deposits events on Home network
checked_withdraw_relay = 6923247 # last checked withdraw events on Foreign network
checked_withdraw_confirm = 6923247 # last checked withdraw events on Foreign network

The Home and Foreign account balances show as zero, even though I transferred ETH into them, and I suspect this is the cause.

E2E script

Problem: We need to make sure each PR satisfies our requirements to send tx via metamask from Home to Foreign and from Foreign to Home
Solution: Write end to end test script

After open the bridge web page the transfer direction doesn't match the selected network in Metamask

Steps to reproduce:

  1. Open browser, activate Metamask, select Kovan network
  2. Open https://bridge.poa.net/
  3. Observe arrow direction, try to transfer tokens

Expected result:

  • after open the bridge web page the transfer direction should be according with selected network in Metamask

Actual result:

  • direction by default from Home to Foreign account
  • disable to transfer tokens from Foreign to Home
  • error message: "Please switch metamask network to Sokol"

screen shot 2018-05-02 at 10 30 27

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.