-
Notifications
You must be signed in to change notification settings - Fork 43
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
added bridge (Dai - xDai) #416
base: dev
Are you sure you want to change the base?
Conversation
- master | ||
script: | ||
- yarn deploy | ||
notifications: | ||
email: | ||
- [email protected] | ||
- [email protected] |
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.
Can you put this back?
this.contract_account = ContractedAccount | ||
this.wallet_address = sdkState.walletAddress | ||
let acc_bal = await this.sdk.getAccountBalances({ | ||
tokens: ['0x6b175474e89094c44da98b954eedeac495271d0f'] |
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.
Can you put this into constant like DAI_MAINNET_CONTRACT_ADDRESS ?
acc_bal.items[1] == null ? 0 : acc_bal.items[1].balance | ||
) | ||
) | ||
this.sokol_sdk = await new Sdk.Sdk(Web3Provider, { |
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.
Sokol network is a testnet for xDAI. is this only for testnet?
Hi. thank you for your contribution. I am having a bit of trouble installing dependencies on my machine. Would you be able to deploy the frontend somewhere and point this to xdai backend so that at least I can check how UI all works? |
import React, { Component } from 'react' | ||
import PropTypes from 'prop-types' | ||
|
||
class Tab extends Component { |
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.
Please use functional component style as described in our style guide.
import PropTypes from 'prop-types' | ||
import Tab from './Tab' | ||
|
||
class Tabs extends Component { |
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.
Please use functional component style as described in our style guide.
} | ||
` | ||
|
||
class Bridge extends Component { |
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.
Please use functional component style as described in our style guide.
) | ||
) | ||
this.sokol_sdk = await new Sdk.Sdk(Web3Provider, { | ||
networkName: 'xdai', |
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.
Would it possible to make it switchable between xdai and polygon as we now deploy on both networks?
method: 'eth_accounts' | ||
}) | ||
console.log(accounts, provider) | ||
let Web3Provider = await Sdk.MetaMaskWalletProvider.connect() |
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.
Does this solution only work for Metamask? Can it also work for WalletConnect (and Torus)?
if (Number(this.state.amount) >= 10) { | ||
if (Number(this.state.amount) <= Number(this.sokol_bal)) { | ||
let xdai_bridge_address = '0x7301CFA0e1756B71869E93d4e4Dca5c7d0eb0AA6' | ||
let bridge_contract = '0x6A92e97A568f5F58590E8b1f56484e6268CdDC51' |
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.
Can you put all contract addresses into constant like const BRIDGE_CONTRACT
and place them all on top of the file?
loading: true, | ||
loading_msg: '' | ||
}) | ||
if (Number(this.state.amount) >= 10) { |
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.
Is this hardcoding commitment to 10 xDAI? Each event can have different commitment amount
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.
or is this the minimum amount to use the specific bridge? If so, please put that into a constant variable so that it is easier to understand
}) | ||
} | ||
|
||
xDai_dai = async () => { |
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.
This is a huge logic. can you move to a different file/class and make it reusable?
} | ||
} | ||
|
||
Dai_to_xDai = async () => { |
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.
seems some overwrapping logic with xDAI_to_DAI. Can you generalise so it makes easier to do $MATIC_l1 -> $Matic_l2 . We could also integrate with something like https://li.finance to do cross chain swap so users can deposit with any token they have on their wallet
I don't fully understand the whole UI. What is Etherspot address and what is it used for? |
Hi,
Okay so this is a poc for Dai to xDai using etherspot smart contracts. So
the etherspot address that you are seeing is your unique etherspot smart
contract address which are derived from your key based account.
Just transfer the assets from your key based wallet to the etherspot wallet
and then can make the cross chain transfer which transfers to your same
account on the the other chain. Please note that the first transaction from
the etherspot account will always carry a bit higher fee due to the fact
that it deploys the smart contract and do the transaction at the same time.
If you are interested in this product please do let me know we can
work something out together since now all that I could do without backend
was to create a separate page as I couldn’t connect with the backend.
Please feel free to contact me if you have any questions or concerns
Thanks,
Vignesh.A
Pillar
…On Sun, 8 Aug 2021 at 2:37 PM, Makoto Inoue ***@***.***> wrote:
I don't fully understand the whole UI. What is Etherspot address and what
is it used for?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#416 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ATWCIWFLOHGRAKZSVZNZSTLT3ZCOFANCNFSM476WZ6WA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email>
.
|
Thank you for your response.
Yeah, definitely interested in finding out more |
In terms of user flow, you would have to modify your website to either:
1. Change the address and show the user that the address has been changed
a. The previous address may have to be monitored for people still sending
assets to that address
2. Show two addresses, the “legacy address” and the new multichain address
We would be welcome to help you with any other queries or questions
regarding this.
Thank you
…On Wed, 11 Aug 2021 at 3:52 AM, Makoto Inoue ***@***.***> wrote:
Thank you for your response.
Just transfer the assets from your key-based wallet to the etherspot
wallet and then can make the cross-chain transfer which transfers to your
same account on the other chain. Does this mean users have to RSVP on
Kickback using the smartcontract account you guys generated? I am kinda
using an account as cross chain username so need to think about user flow.
Otherwise people get confused why they RSVP with an ETH address they don't
recognise.
If you are interested in this product please do let me know we can work
something out together
Yeah, definitely interested in finding out more
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#416 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ATWCIWAUCS5J24BAAOYBUGLT4GREHANCNFSM476WZ6WA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email>
.
|
Issue number
Description
Added a page called Bridge(/bridge) for transferring Dai to xDai and vice versa using etherspot sdk
List of features added/changed
How Has This Been Tested?
Tested locally. Other areas of the code would not get affected since the changes are made only on a seperate page(/bridge) and no other areas are the code of the seperate page conflicts with each other
Screenshots (if appropriate):
Checklist: