-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support ERC20 to Native #138
Conversation
Deploy preview for kind-kilby-95344f processing. Built with commit 0ed18c7 https://app.netlify.com/sites/kind-kilby-95344f/deploys/5bcf108a67610c7a9cf926c6 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you clarify the process what gas price is set for transactions in both networks? Currently it is possible to configure the speed chosen for the response of the gas price oracle. Will it affect the value on the window presented to the user? What value is used for the network if the gas price oracle is not configured or what will happen if the gas price oracle is not configured. Does it makes sense to introduce parameters to configure a fallback gas price?
This question is due to the fact that gas price in the shard we are creating could be 1000 gwei. I am curious if the legacy code still use the value in 1 gwei for Home network.
src/stores/TxStore.js
Outdated
@@ -105,8 +100,6 @@ class TxStore { | |||
web3.eth.getTransactionReceipt(hash, (error, res) => { | |||
if(res && res.blockNumber){ | |||
if(res.status === '0x1'){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
consider to compare the number 1
instead of the string in hexadecimal 0x1
. The status code is not standardized well that is why some clients could return 0x01
(rskj
for example).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Currently gas price is fetched from oracle, the same value is used for both networks. You can only configure the speed using
So same as it works on bridge-nodejs, we can use oracle's gas price, if cannot be obtained, use gas price from contract, if it also fails, use fallback gas price from Does it makes sense @akolotov ? |
Thank you for the investigation. This answer is exactly what I looked for. Let's implement this in this version of the Bridge UI. |
Also: check gas price in contract if oracle fails, and use fallback value if that fails too.
@akolotov the last commit allows using a different gas price for home and foreign, calls the contract if the oracle fails, and uses a fallback value if that also fails. The |
@akolotov Also, notice that much of the logic here duplicates the one in |
src/stores/Web3Store.js
Outdated
@@ -1,4 +1,4 @@ | |||
import { action, observable } from "mobx"; | |||
import { action, computed, observable } from "mobx"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think computed
is not used here, so we can avoid importing it
@akolotov I'm having the same issues as you with that chain on validators on status page. The way how validators are retrieved is by listening all |
@akolotov for now I added 3 digits after the point on network details you mentioned, I need to investigate best way to implement the logic you suggested after I finish with all of the issues |
src/components/StatisticsPage.js
Outdated
foreignSymbol={foreignStore.symbol} | ||
foreignSupply={foreignStore.totalSupply} /> | ||
</div> | ||
<div className='statistics-transaction-container'> | ||
<div className='statistics-deposit-container'> | ||
<span className='statistics-deposit-title statistics-title'>Network Deposits</span> | ||
<span className='statistics-deposit-title statistics-title'>Tokens Deposits</span> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The logic when we use erc-to-erc
and erc-to-native
modes are reversed.
native-to-erc
: tokens are deposited by sending coins from Home and withdrawn by sending tokens from Foreignerc-to-erc
: tokens are deposited by sending tokens from Foreign and withdrawn by sending tokens from Homeerc-to-native
: tokens are deposited by sending tokens from Foreign and withdrawn by sending coins from Home
The current layout of lables "Tokens Deposits" and "Tokens Withdrawals" confuses.
Since the amount of withdrawn tokens cannot be more than the amount of deposited tokens.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
# Conflicts: # README.md # src/stores/utils/web3.js
I think we can merge the changes to |
This PR includes the following changes:
fromBlock
parameter to be > 0 ongetPastEvents
methodPending: