Giter Site home page Giter Site logo

ton-blockchain / bridge Goto Github PK

View Code? Open in Web Editor NEW

This project forked from zavtramen/bridge

30.0 30.0 13.0 10.8 MB

TON-EVM Toncoin bridge frontend

Home Page: https://ton.org/bridge

License: GNU General Public License v3.0

JavaScript 5.33% CSS 4.70% Vue 83.73% TypeScript 6.24%
hacktoberfest

bridge's People

Contributors

emelyanenkok avatar hiyorimi avatar rise1507 avatar tolya-yanot avatar zavtramen 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

Watchers

 avatar  avatar  avatar  avatar  avatar

bridge's Issues

TON extension doesn't work on Chromium browser — Brave

Bug Type

Functional

Reproduction steps

  1. Open TON bridge (Eth or BSC, doesn't matter) using Chromium browser Brave with installed TON extension;
  2. Choose direction from TON network to Eth/BSC;
  3. Enter amount of TON and address to receive;
  4. Tap on transfer link type ton://transfer

Actual result

Brave opens new tab with no info and dark theme. TON extension doesn't activate for transfer.

Bridge.mov

Expected result

TON extension opens with filled form of transaction for confirming: amount of tons, comment and recipient.

Suggested Severity

Critical

Device

Desktop:

Additional Context

No response

TON-BSC Bridge is broken in testnet

Bug Type

Functional

Reproduction steps

  1. Go to TON bridge page in testnet and choose TON-BSC Bridge
  2. Log in into your Metamask account
  3. Click Transfer button

Actual result

Nothing happens.

These errors appear in console logs:

Error: Invalid bridge data at 22a6ade.js:1:40432 at v (041e0a9.js:2:93785) at Generator._invoke (041e0a9.js:2:93573) at Generator.next (041e0a9.js:2:94214) at r (041e0a9.js:2:66915) at l (041e0a9.js:2:67118)

Expected result

A new pop-up window shows and users is able to transfer digital assets

Suggested Severity

Medium

Device

Desktop:

  • macOS Monterey 12.2.1
  • Chrome
  • 105

Additional Context

No response

Transfer blocked

Bug Type

Functional

Reproduction steps

The transfer of 189 Toncoins to my ETH wallet in blocked since the 15th of September at that stage:

Please send 189 Toncoins to bridge smart-contract
ton://transfer/Ef_dJMSh8riPi3BTUTtcxsWjG8RLKnLctNjAM4rw8NN-xWdr?amount=189000000000&text=swapTo%230x37AEc2350De679780078C1855b1493d8877Bf9Af
Send from your personal wallet. Do not send directly from exchanges and bots!

The 189 Toncoins have been sent to the wallet Ef_dJMSh8riPi3BTUTtcxsWjG8RLKnLctNjAM4rw8NN-xWdr but never reached my ETH wallet

Actual result

Transfer not completed

Expected result

Transfer of 189 Toncoins to my ETH wallet

Suggested Severity

High

Device

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser Chrome
  • Version 105.0.5195.125

Additional Context

No response

Unable to use with Ropston Test network

Bug Type

Functional

Reproduction steps

  1. Open https://ton.org/bridge/?testnet=true in Firefox
  2. Set Metamask to Ropston Test network
  3. Enter TON amount and Ethereum address
  4. Click Transfer

Actual result

Nothing happens.

In Console the following error is displayed.

Error: Invalid bridge data
041e0a9.js:2:11891

Uncaught TypeError: e.provider is null
22a6ade.js:1:40059

Expected result

TON tokens should be transferred to Ethereum wallet in Ropsten test network

Suggested Severity

Medium

Device

Desktop:

  • OS: Windows 10
  • Browser Firefox
  • Version 104.0.2 (64-bit)

Additional Context

No response

TON-BSC bridge: getPairGasFee function always fails because of not accepted header in fetch function

Bug Type

Functional

Reproduction steps

1- open the bridge webpage
2- select "Binance Smart Chain" as the source or destination

Actual result

BSC gas fee doesn't get updated and always is the default value defined in the frontend web app.

BSC -> TON : default = 0.0002 BNB

image

TON -> BSC: default = 0.0008 BNB

image

Expected result

The bridge should fetch the current gas fee and show it to the user.
Also,
If the current gas fees are lower than the default values, users would be charged more than necessary in their transactions.
And if the current gas fees are higher than the default Gas fees, users' transactions would fail.

Reason

here is the reference to function getPairGasFee: https://github.com/ton-blockchain/bridge/blob/master/pages/index.vue#L339

This function uses bsc.main.getGasUrl to fetch current fees from the network. it works perfectly for Eth, but it fails for BSC because of Cors policy:

image

Seems like the header 'Cache-Control': 'no-store, max-age=0' set inside fetch is not accepted by the backend. This failing will be caught in catch block and thus this line will be executed:

this.gasPrice = 0

Because of this error local gasPrice variable never gets updated and will be 0 when runtime reaches the line below:

this.gasPrice = gasPrice > 0 ? gasPrice : this.params.defaultGwei;

And this causes the this.gasPrice to be equal to default values.

sulotion

I removed the header and everything is working perfectly without it. So I opened a pull request which deletes that specific header.

Suggested Severity

Critical

Device

Desktop (please complete the following information):

  • OS: Windows
  • Browser chrome, firefox
  • Version 21H2

Additional Context

No response

Incorrect Fee Formula on website

Bug Type

UI

Reproduction steps

  1. Open the Bridge website
  2. Incorrect Formula in Bridge fee

Screenshot 2022-09-27 125114

Actual result

It show's Formula below as the formula for Bridge fee:5 TON + 0.25% of amount

An example:

Assume we have 100 as Ton amount. according to Formula Bridge fee should be:
5 + 0.25% * 100 = 5 + 0.25 = 5.25

But the Fee on the screen is 5.2375
image

Expected result

Looking at the codebase and calculated fees on the website it's clear that the correct formula is: 5 TON + 0.25% of (amount - 5 )

Following our example in "Actual Result" we would have:

Ton amount = 100

Bridge Fee = 5 + (0.25% * (100 - 5) = 5 + 0.2375 = 5.2375

Suggested Severity

High

Device

Desktop (please complete the following information):

  • OS: Windows
  • Browser Chrome
  • Version win11 21h2

Additional Context

No response

App faild cant connect to metamask on my android

Bug Type

Functional

Reproduction steps

  1. Fill amount and adress (on android)

Actual result

App tell me install MetaMask on phone (but i already got it and it work)
photo_2022-09-25_06-57-11

Expected result

So app cant connect to metamask nothing happen after
Also How it works link faild
photo_2022-09-25_06-57-17

Suggested Severity

Medium

Device

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional Context

Comissions too big)) this amont is too big for simple users
photo_2022-09-25_06-57-21

TON-ETH bridge: Arithmetic flaw in calculating fees

Bug Type

Functional

Reproduction steps

1- open the bridge website
2- Input 999 in the input field "Amount of TON"

Actual result

Shown "Bridge Fees" is 7.484999999999999 TON

image

Expected result

According to Documentation "Bridge fees" is calculated as below:

input_amount = amount of TON which user inputs In the "Amount of TON" field (which is a minimum of 10TON)

Bridge Fees = (Fixed 5 TON) + ( 0.25% of (input_amount - 5))

Having 999 as input we have:

Bridge Fees = (5) + ( 0.25% * (999 - 5)) = 5 + 2.485 = 7.485 TON

Other cases

999 is not the only case. for example take a look at the cases below:

Trying 1000:

expected fee 7.4875, shown fee: 7.487500000000001 TON

image

Trying 100000000

expected fee 250004.9875, shown fee: 250004.98750000002 TON

image

Reason

It's happening due to the nature of storing float numbers. since numbers are stored in their binary representation. Some decimal values cannot be represented accurately in binary format and cause these kinda weird results.

suggestion

To illuminate this and other potential arithmetic flaws avoid calculating with bare Javascript methods and utilize a battle-tested Math Library.

Side-note

The demonstrated difference between displayed and expected value may seem insignificant but a malicious user with repetition may harm the bridge and its users significantly.

Suggested Severity

High

Device

Desktop (please complete the following information):

  • OS: Windows 11
  • Browser: chrome
  • Version: 21H2
    Chrome

Additional Context

No response

TON-BSC Bridge: lack of detailed documentation for TON-BSC bridge

Bug Type

Other

Reproduction steps

1- open bridge webpage
2- scroll down and select Documentation
the

Actual result

It is linked to an issue from an archived repository TIPs.

Only contains information about ETH-TON bridge

image

Expected result

It's better to open a user-friendly documentation web page with exhaustive and classified details about current bridges.

Suggested Severity

Medium

Device

Desktop (please complete the following information):

  • OS: Windows
  • Browser chrome
  • Version 21H2

Device is not important in this issue

Additional Context

No response

Broken How-It-Works Link

Bug Type

UX

Reproduction steps

1- Go to https://ton.org/bridge/
2- Scroll to the end of the page
3- Click on How it works.

Actual result

Get redirected to not found error page.
https://ton.org/how-it-works/bridge
image

Expected result

To go to the how it works. page.

Suggested Severity

Low

Device

Desktop (please complete the following information):

  • OS: Ubuntu 18.04
  • Browser Chrome
  • Version 100.0.4896.127 (Official Build) (64-bit)

Additional Context

No response

Doesn't work at mobile dAPP browser at 1INCH app.

Bug Type

Functional

Reproduction steps

  1. Open the bridge website using mobile crypto wallet app for Eth/BSC chains — 1INCH wallet;
  2. Paste needed settings: amount of coins + recipient address;
  3. Tap button «transfer»

Actual result

Nothing happens: no notification, no loading page.
RPReplay_Final1663432378.MP4.zip

Expected result

  1. Getting link like ton://transfer and next steps for transferring coins between chains;
  2. OR notification about not supported crypto wallets with dAPPs.

Suggested Severity

Critical

Device

Smartphone:

  • Device: iPhoneXr
  • OS: IOS16
  • Browser dBrowser at app 1INCH
  • Version 1.9.1 (226)

Additional Context

The bridge only works with Metamask app included browser. Another WEB3 browsers don't accept the bridge and transferring coins.

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.