diff --git a/docs/about/faq/FAQ.md b/docs/about/faq/FAQ.md new file mode 100644 index 00000000..f04b47f9 --- /dev/null +++ b/docs/about/faq/FAQ.md @@ -0,0 +1,309 @@ +# FAQ + +## Informational + +1. Where can I purchase xDai? + + https://buyxdai.com/ + +2. Where can I bridge my tokens to Gnosis Chain? + + Between Ethereum and Gnosis Chain : For DAI/xDAI : https://bridge.xdaichain.com/ ; For ERC20 : https://omni.xdaichain.com/ + More chains and options : https://jumper.exchange/ ; others third party bridges : https://docs.gnosischain.com/bridges/third-party + + To bridge AgEUR : https://app.angle.money/bridges-agEUR + +3. What is Gnosis Faucet? + + The Gnosis Chain xDAI faucet distributes xDAI to new users so that they may have enough gas to complete a few transactions and interact with applications on Gnosis Chain : https://www.gnosisfaucet.com/ + +4. Where can I stake my GNO? + + Currently you can stake your GNO on [Stakewise.io] (https://stakewise.io/). Please note that your wallet must be directed at the Gnosis Chain network with your GNO tokens already bridged to Gnosis. + +5. What is sGNO? + + When you stake your GNO on Stakewise you receive sGNO. + +6. What is mGNO? + + To create a more accurate ETH-mirrored environment, a minimum of 32 tokens are used for staking purposes on the Gnosis Beacon Chain. The mGNO token is a metaToken similar to a wrapped token created for this purpose. During deposits, 1 GNO is automatically converted to 32 mGNO. + +7. What is LGNO? + + This stands for locked GNO. The LGNO contact was an incentive program for the Gnosis community to lock their GNO in return for vCOW. To learn more, please visit this thread by Stefan George -https://twitter.com/StefanDGeorge/status/1488924732191907849 + +8. What is d14n.info? + + [d14n.info](https://www.d14n.info/) is a real-time dashboard that measures decentralization of the Gnosis Chain and Ethereum networks. We use the Nakamoto Coefficient as the primary quantitative measure across multiple dimensions of the network. + You may also check out [Gnosis Metrics](https://www.gnosismetrics.com/#overview) + +9. What native bridges does Gnosis have? + + [xDAI & OmniBridge](https://docs.gnosischain.com/bridges/) + +10. What are the DAOs running on the Gnosis Chain? + + https://www.daosongnosis.com/ + +11. Which wallets can I use on the Gnosis Chain? + + https://www.gnosiswallets.com/ + +12. How do I connect my wallet to Gnosis Chain? + + Click 'Add to Metamask' in [here](https://docs.gnosischain.com/about/networks/mainnet) or view other options from + https://docs.gnosischain.com/tools/wallets/ + +13. I was staking xdai on the easystaking xdai site and it is no longer active. How can I access my xdai? + + This has been down for some time now due to the old team that was running xdai not maintain it anymore. You will need to use the block explorer to interact with the contracts without the UI in oder for it to be withdrawn. + + These are the steps that need to be taken: + + https://etherscan.io/address/0xecbcd6d7264e3c9eac24c7130ed3cd2b38f5a7ad#readProxyContract 11. lastDepositIds Type your address which gives you a number. 3. balances Find your deposits. They are numbered from 0 up to the number you got previously. Check all of them. + https://etherscan.io/address/0xecbcd6d7264e3c9eac24c7130ed3cd2b38f5a7ad#writeProxyContract 7. makeForcedWithdrawal Withdraw. Please note this instant-withdrawal has a 2% fee + +14. I recently transferred an ERC-1155 into a safe. I realized after the fact that gnosis does not support 1155s. Is there a way that I’m able to transfer it back out? + + You have to use “contract interaction” on the safe when you click on “New Transaction” + On the pop up, you will you put in the contract address of the ERC-1155 token - (It may or may not automatically pull in the ABI so you may have to copy that from the contract details via gnosis scan) + + Once, the contract address and abi is input into the prompt… there should be a drop down of which functions are available to you. You want to drop down to “safeTransferFrom” + + When you select that, you will have prompts to fill in: + From(address) - that address that owns the token - your safe + To(address) - what wallet do you want to send it to? + id(uint256) - The token number of the NFT + amount(uint256) - How many of those tokens do you want to send? - usually just 1 + data(bytes) - I just put in " 0x0 " empty data. + + Add that transaction - then sign it off and that should work + if you are still having issues i would suggest to hop into the Safe discord and ask for further assistance there. + +15. when SAFE airdrop? + + https://forum.gnosis.io/t/gip-64-should-gnosisdao-distribute-safe-tokens-to-incentivize-decentralizing-gnosis-chain/5896 + https://forum.gnosis.io/t/gip-64-should-gnosisdao-distribute-safe-tokens-to-incentivize-decentralizing-gnosis-chain/5896/54 + +16. Where is the simplest way to stake GNO on gnosis chain? + + https://www.validategnosis.com/ + +17. I’ve been experiencing this error withMetamask on Gnosis Chain. It doesn’t generate fees whenever I send tokens. ‘Transaction error - Internal JASON-RPC error.’ + + https://metamask.zendesk.com/hc/en-us/articles/360059289871-Error-Internal-JSON-RPC-error-when-trying-to-interact-with-other-network and please update your RPC on MetaMask to https://rpc.gnosis.gateway.fm/ + +18. What is WXDAI for? + + As xDai on Gnosis Chain acts similar to ETH on Ethereum Network, you would need a wrapped version of xDai to be used as an ERC-20. Basically, WXDAI is the equivalent of WETH on Gnosis Chain. + +19. What is Gnosis chain? + + Gnosis Chain is an EVM-based Layer 1 utilizing PoS consensus. Gnosis Chain utilizes a dual token model unlike similar EVM chains. On Gnosis Chain GNO token is used to secure the consensus layer while xDai is used as the gas token. + +20. How can I add Gnosis Chain to Metamask? + + You can follow the instructions on this page: https://docs.gnosischain.com/tools/wallets/metamask/ + + Or alternatively, you can go to https://chainlist.org/ search for Gnosis Chain to get Gnosis Chain added automatically to your Metamask. + +21. What DApps can we use on Gnosis? + All dApps on Gnosis Ecosystem can be found here: + https://docs.gnosischain.com/ecosystems/ + +22. Is it possible run a Node and qualify for future rewards ? + + Yes, you can run a Node and qualify for rewards. For all the information you need in terms of runnnig a node, please visit https://docs.gnosischain.com/node/. + +23. I’m totally new to this project and I’m trying to feel myself around. Where should I start learning? + + You can jump to all relevant links on our landing page at https://www.gnosis.io/. Alternatively, you can check our documentation https://docs.gnosischain.com/. Also, feel free to take a look at the governance forum to see what is being discussed around the community regarding improvement proposals https://forum.gnosis.io/. + +24. Is Gnosis Chain a Testnet or Mainnet released? + + Gnosis Chain is not a testnet. It is a fully operational Layer 1 utilizing Proof of Stake. But if you are wondering, Gnosis Chain has its testnet called Chiado, the details of which can be found here: https://docs.gnosischain.com/about/networks/chiado. + +25. Is the grants program still running? + + ‼️UPDATE: The Gnosis Ecosystem Fund was discontinued. Projects can now directly apply for funding through the GnosisDAO. For non commercial/public goods : https://bit.ly/gnosis-grants + +26. What are the NFT marketplaces on Gnosis Chain? + + https://niftyfair.io/ + +## Validators + +1. Where can I track my validator performance? + + [GnosisPools](https://www.gnosis.builders/post/gnosispools-guide), [Node monitoring guide](../../node/management/monitoring-node.md) + +2. How to run a node on Gnosis Chain? + + https://docs.gnosischain.com/node/ + +3. What is reward & penalties? + + https://docs.gnosischain.com/node/rewards-penalties + +4. Where can I find hardware requirements to run a node? + + Hardware requirements differ by client but generally are not that high. To get a better idea, you can check each specific client’s hardware requirements here: https://docs.gnosischain.com/node/#hardware + +5. How did the merge impact my GBC node? + + The Ethereum Mainnet merged with the beacon chain proof-of-stake system. This marked the end of proof-of-work for Ethereum, and the full transition to proof-of-stake. The Gnosis Beacon Chain (GBC) serves in a frontrunning capacity to important Ethereum consensus-layer updates. + +6. My nethermind xdai is lagging, it never seems to catch up to 100%. It fluctuates between 97-99.5% synced. I’m using nethermind xdai execution client, lighthouse gnosis consensus client and the web3 gnosis signer. + + 1. update all packages to the latest version (core, EL, CL, web3signer, etc) + 2. turn on EL + CL and check if both are on sync before turning on the validator (see that lighthouse has 2 processes, 1 beacon and 1 validator) + 3. (a) if both are on sync, turn on the validator and check 10 minutes later the beacon explorer + (b) if you don’t get both to the head, let me know here and we can troubleshoot together. + +7. My validator is constantly missing attestations. Several of my validators are said to be inactive and getting penalized on beacon.gnosischain.com, although logs show errors that I don’t understand. And half of them are active and well (all running on the same physical machine). + + Solution from discord user @pyk: + https://discord.com/channels/502416149343109121/920642136272166972/1055445460023783525 + + This happen on my end due to one beacon node cannot handle all validators request (hence some validators miss their attestations while others dont) and sometimes beacon node lose all its peers. + + My solution is to run a few beacon nodes (lodestar) connected to one execution node (nethermind), so I have backup when one beacon node disconnected from their peers. + + For example here is how to connect multiple beacon nodes in one validator (lodestar): + + ``` + validator + --network=gnosis + --dataDir=/data + --logFileLevel=info + --beaconNodes=http://gnosis-beacon-1:4000,http://gnosis-beacon-2:4000,http://gnosis-beacon-3:4000,http://gnosis-beacon-4:4000,http://gnosis-beacon-5:4000 + + ``` + +8. I added 3 validators and skipped the [“Step 3: Upload Keystores to Web3Signer”](https://docs.gnosischain.com/node/tools/dappnode/#step-3-upload-keystores-to-web3signer) in dappNode and got error: Status: error ❌ Message: Error importing keystore: Unable to add validator. Check that the keystore file format is valid and the password is correct.” . I went directly to “Step 4: Fund Your Validators”. Now I see they are active but missing attestations. The password is correct and the keystore files are the same I used in step 4. + + 1. Double-check that you’re uploading your keystores to web3signer Gnosis + 2. Try restarting both Web3Signer Gnosis and your Consensus Client + 3. If this is the first time you’re uploading your keystores, make sure you uncheck the import slashing data option + 4. Triple-check your password is right and was inputed as you intended + +## Shapella FAQs + +1. What is Shapella? + + Shapella refers to the combination of both Shanghai and Capella. Shanghai enables GNO staking withdrawals for Gnosis Chain, unlike the previous model that doesn’t allow for staked GNO to be withdrawn. Shanghai is the name given to the execution layer (EL) upgrade, while Capella is the name of the coinciding consensus layer (CL) upgrade. + +2. What are withdrawals? + + Validator withdrawal allows a validator’s account balance get withdrawn from Beacon Chain to Execution Layer, in the form of GNO. The GNO will be accrued on validator’s withdrawal address on the Execution Layer, which is set using `eth1_withdrawal_address` option during validator key generation. + +3. What are two types of withdrawals? + + There are 2 types of withdrawals: Partial Withdrawal and Full Withdrawal. + Partial Withdrawal: Any balance in excess of 1 GNO from the account balance get withdrawn back to withdrawal address, automatically. + Full Withdrawal: All the balance from validator’s account get withdrawn back to withdrawal address. This has to be initiated by validator, signing `voluntary_exit` message and broadcasting it to the network. It is irreversible. + +4. What are 0x00 and 0x01 withdrawal credentials prefixes? + + The beacon chain validators have a field called withdrawal credentials, where the first byte is referred to as the withdrawal prefix. Currently, this value can be either 0x00 or 0x01, depending on how it is set during the deposit process using a deposit tool. Validators with 0x00 withdrawal credentials won’t have immediate withdrawal capabilities. To enable partial and full withdrawals and unlock their funds, these validators must undergo a one-time migration to 0x01. As this is a one time process, it is essential to be careful performing it. + +5. How do I change my withdrawal credential? + + You can find a full tutorial on how to change your withdrawal credential [here](https://docs.gnosischain.com/node/management/withdrawals#how-to-change-the-withdrawal-credential). + +6. I have been running multiple validators. Can I set up the same withdrawal credential for all of them? + + Yes, you can set up the same withdrawal credential for all of your validators and can also set up different withdrawal credentials for individual validators. + +7. Where can I check my withdrawal credential? + + https://docs.gnosischain.com/node/management/withdrawals#check-withdrawal-credential + +8. Do partial withdrawals happen automatically? + + If your withdrawal credentials are set to 0x01 and point to a valid Gnosis Chain address, then the partial withdrawal will happen automatically. + +9. Do full withdrawals happen automatically? + + No. If your validator is currently active and participating in the beacon chain, then the full withdrawal will not happen automatically. You will have to manually initiate an exit to cause this. + + Additionally, if you initiate an exit but still have a 0x00 withdrawal credential, your funds will not be withdrawn until a `BLSToExecutionChange` message is included on chain. + +10. Is there a UI that I can use for withdrawals? + + No, as you will have to interact with the beacon chain, it is not feasible to provide a UI that encompasses all the clients. + +11. Where does the automatic balance withdraw to? + + In case you are using a legacy withdrawal credential 0x00, it will not be withdrawn and you will have to perform a migration to 0x01 credentials to complete the withdrawal. If you have already configured your withdrawal address and have a withdrawal credential of 0x01, then rewards in excess of 1 GNO (32 mGNO) will be transferred to your withdrawal address. + +12. Once I have changed my credential to 0x01, can I change it to an alternative withdrawal address? + + No, the migration from 0x00 to 0x01 is a one time process and once you set the address, it cannot be changed. Please make this migration with the utmost care. Note, the withdrawal credential can either be an externally-owned account (EOA) or a smart contract such as a SAFE. + +13. I have lost the private key to my withdrawal address, what can I do? + + Unfortunately, there is nothing that can be done if the withdrawal address is lost. Please ensure this address is properly backed up and securely stored. + +14. What happens to my GNO if I make a full withdrawal but I forgot to set the withdrawal credential to 0x01? + + Nothing. Your validator will exit, and will no longer be assigned duties, neither able to earn nor lose any more additional GNO. You may still migrate your withdrawal credentials from 0x00 to 0x01. Once this is done, the validator’s balance will be withdrawn into the address you specify. + +15. Can I cancel a withdrawal request that is in the queue? + + No you cannot, this is a one time, irreversible process. Once you submit your withdrawal request (BLSToExecutionChange and/or exit) you can’t go back. Please only exit or change credentials when you are fully aware of what the specific operation will do and with utmost caution. + +16. Where can I find the client updates for Shapella? + + You can find all client updates in this [blog post](https://www.gnosis.io/blog/shapella-client-updates) or [validator withdrawal section](https://docs.gnosischain.com/node/management/withdrawals). Make sure you update your clients before the upgrade. + +## Bridges + +1. Can I bridge tokens between Gnosis Chain and BSC using Omni Bridge + + The BSC - Gnosis Chain bridge has been depreciated you can instead use a third party bridge like Jumper for example. + +2. What is the best way to bridge it to another chain? + + For larger amounts, you can use the xDAI bridge (from Gnosis Chain to Ethereum) : https://bridge.gnosischain.com/ For smaller amounts or if you want to bridge them to another chain (to a L2 or another chain), with very small gas fees using Jumper : https://jumper.exchange/ + +3. On AMB/Omni Bridge once the daily limit has been reached, how can I get my tokens? + + Follow the manual execution tutorial https://docs.gnosischain.com/bridges/tutorials/using-amb once you have initiated the `executeSignature()` transaction, the token release transaction will be credited to your account automatically the next day. + +4. I’m trying to bridge but Omni Bridge says that the maximum amount was already transferred? + + Some tokens have [bridge limits](https://docs.gnosischain.com/bridges/tokenbridge/omnibridge#single-transaction-limits), which can be a daily limit and or maximum or minimum per transaction, this is for example the case for GNO between Gnosis Chain and Ethereum, you can click the “Limits” button below the bridge box to check the current limits for a given token. These Daily Limits will be reset at 00:00 UTC. + +5. How much time does it take to bridge using Omni Bridge ? + + With the new zk light client verification, bridging assets takes about 20 minutes. You can check your bridge transaction on the bridge explorer : https://bridge-explorer.gnosischain.com/ + +6. Why do the tokens I just got on Gnosis Chain after bridging from Ethereum have a different contract address? + + Often tokens have a different contract address because when they are bridged into Gnosis Chain, the contract address alters, becoming a proxy token of the bridged one. This process is fundamental to how the tokens are locked on the bridge. + +7. I bridged some agEUR tokens using the Angle Bridge, now I have lz-agEUR in my wallet, what can I do? + + The Angle Bridge has daily and hourly limits (they are visible on the bridge page). If the limits are reached when processing a bridge transaction, you won’t receive agEUR in your wallet on the destination chain but instead, you will receive lz-agEUR tokens in your wallet that can be used to redeem agEUR later, when the limits reset, you would then need to make a manual claim following this tutorial : https://docs.angle.money/overview/guides/bridge#how-to-get-back-ageur-from-lz-ageur + +8. I’m trying to bridge agEUR from Gnosis Chain to another chain using the Angle Bridge but I’m getting an error “internal JSON-RPC error” + + Be sure to have enough xDAI for gas and fees, to use the Angle Bridge you should have at least 1,5 xDAI on your wallet. More information in Angle Protocol docs : https://docs.angle.money/overview/guides/bridge + +9. I’m having issues using Omni bridge to bridge assets held in a SAFE between Ethereum and Gnosis Chain, I get a “failure to connect” ERROR. + + Rabby wallet ( https://rabby.io/ ) wallet is good workaround allowing to load SAFE into it and inject them in similarly to Metamask. + +## Outdated + +1. What is the hard fork and do I need to do anything? + + Hard forks (HF) are used to introduce new functionality or fix security related issues. The community has voiced their support for a HF to upgrade the Permittable Token contract functionality for bridged tokens. This update is designed to prevent future reentrancy attacks such as the ones suffered by Agave and Hundred Finance and their users on 15 March, 2022. + + For additional context, details and discussion see GIP-31: Should Gnosis Chain perform a Hardfork to upgrade the token contract vulnerable to the reentrancy attack? + + Gnosis Chain had a HF at Block number: 21,735,000 Date: 20 April 2022 at ~ 6:30am UTC. If you are a user of the Gnosis Chain, you don’t need to do anything and day-to-day functionality should not be impacted. However, if you are running a node with either OpenEthereum or Nethermind, you will need to upgrade to the new version. + + https://docs.gnosischain.com/specs/hard-forks/21735000 diff --git a/docs/about/networks/optimism.md b/docs/about/networks/optimism.md index 2f84e505..788bb16c 100644 --- a/docs/about/networks/optimism.md +++ b/docs/about/networks/optimism.md @@ -15,11 +15,10 @@ An Optimism implementation is deployed on Gnosis. Gnosis functions as the L1 (ak Deployment processes are similar to using [Optimism with Ethereum](https://community.optimism.io/) with updated configs to match the Gnosis chain setup. - -| Parameter | Value | -| -------------------------------- | ---------------------- | -| Network Name | Optimism on Gnosis | -| Chain ID | 300 | +| Parameter | Value | +| ------------ | ------------------ | +| Network Name | Optimism on Gnosis | +| Chain ID | 300 | ## Make a Deposit @@ -27,11 +26,11 @@ Deployment processes are similar to using [Optimism with Ethereum](https://commu Do NOT deposit funds, they will not be withdrawable. ::: -Deposits are initiated through the [Proxy\_\_OVM\_L1StandardBridge contract](https://blockscout.com/xdai/mainnet/address/0x184a119d4C1D08A459FCfBFe7ECc051c163B4c80/transactions) on the Gnosis Chain with the **`depositETH`** method and the following inputs: +Deposits are initiated through the [Proxy\_\_OVM_L1StandardBridge contract](https://gnosis.blockscout.com/address/0x184a119d4C1D08A459FCfBFe7ECc051c163B4c80/transactions) on the Gnosis Chain with the **`depositETH`** method and the following inputs: -* \_l2Gas: **`200000`** -* data: **`0x`** -* value: **`Deposit value in xDai (ie. 0.1 = 0.1 xDai)`** +- \_l2Gas: **`200000`** +- data: **`0x`** +- value: **`Deposit value in xDai (ie. 0.1 = 0.1 xDai)`** :::info Some smart contract wallets are blocked from calling the `depositETH (and depositERC20) methods`. If you want to deposit using a smart contract wallet you can use the `depositETHTo function instead.` @@ -40,7 +39,7 @@ Some smart contract wallets are blocked from calling the `depositETH (and deposi
Example using BlockScout -1. Go to [https://blockscout.com/xdai/mainnet/address/0x184a119d4C1D08A459FCfBFe7ECc051c163B4c80/write-proxy](https://blockscout.com/xdai/mainnet/address/0x184a119d4C1D08A459FCfBFe7ECc051c163B4c80/write-proxy) +1. Go to [https://gnosis.blockscout.com/address/0x184a119d4C1D08A459FCfBFe7ECc051c163B4c80/write-proxy](https://gnosis.blockscout.com/address/0x184a119d4C1D08A459FCfBFe7ECc051c163B4c80/write-proxy) 2. Connect a web3 wallet like MetaMask that contains some xDai for funding and gas fees. @@ -48,10 +47,10 @@ Some smart contract wallets are blocked from calling the `depositETH (and deposi 3. Scroll down to the **`depositETH`** method and enter the following: -* _l2Gas: **`200000`** -* _data: **`0x`** -* value: **`Deposit value in xDai`** -* Click **Write** and complete the transaction with your wallet. +- \_l2Gas: **`200000`** +- \_data: **`0x`** +- value: **`Deposit value in xDai`** +- Click **Write** and complete the transaction with your wallet. ![](/img/about/optimism/method.png) @@ -65,48 +64,47 @@ It may take several minutes for the deposit to be processed and the balance to u Additional Info related to specific contracts is [available here](https://github.com/ethereum-optimism/optimism/tree/56961f9208af8a43a25a138cce21ef488c418141/packages/contracts/docs). -| Contract | Address | -| ------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| BondManager | [0x730fE4431a00286Ff8dc7E9B03c661E63Ef05121](https://blockscout.com/xdai/mainnet/address/0x730fE4431a00286Ff8dc7E9B03c661E63Ef05121/transactions) | -| CanonicalTransactionChain | [0x636434F59e52D50423bD8272FEB3B2bff5dF586b](https://blockscout.com/xdai/mainnet/address/0x636434F59e52D50423bD8272FEB3B2bff5dF586b/transactions) | -| ChainStorageContainer-CTC-batches | [0xEc64fee4f95E48A3BAd799A5912F183d222086A8](https://blockscout.com/xdai/mainnet/address/0xEc64fee4f95E48A3BAd799A5912F183d222086A8/transactions) | -| ChainStorageContainer-SCC-batches | [0x26EbaD990cC56ef36166d1C4114CEF25F024b75D](https://blockscout.com/xdai/mainnet/address/0x26EbaD990cC56ef36166d1C4114CEF25F024b75D/transactions) | -| ChugSplashDictator | [0x77fAf5Aa4EB7874a676F773fc308e0FD8e9400f7](https://blockscout.com/xdai/mainnet/address/0x77fAf5Aa4EB7874a676F773fc308e0FD8e9400f7/transactions) | -| ERC1820Registry | [x1820a4B7618BdE71Dce8cdc73aAB6C95905faD24](https://blockscout.com/xdai/mainnet/address/0x1820a4B7618BdE71Dce8cdc73aAB6C95905faD24/transactions) | -| L1StandardBridge | [0x3804bA4ecC886AAe91A6D57dE880616E17C8269C](https://blockscout.com/xdai/mainnet/address/0x3804bA4ecC886AAe91A6D57dE880616E17C8269C/transactions) | -| OVM\_L1CrossDomainMessenger | [0x6A52b1dbE0293F1ba1bc136b0f8C8f0395F940b9](https://blockscout.com/xdai/mainnet/address/0x6A52b1dbE0293F1ba1bc136b0f8C8f0395F940b9/transactions) | -| OVM\_Proposer | [0xE57cfefE4B7EddE88af28d4ffB3BD63b272f578A](https://blockscout.com/xdai/mainnet/address/0xE57cfefE4B7EddE88af28d4ffB3BD63b272f578A/transactions) | -| OVM\_Sequencer | [0xFDCa025dB7368A84deeCc0d82598eB90638D52DF](https://blockscout.com/xdai/mainnet/address/0xFDCa025dB7368A84deeCc0d82598eB90638D52DF/transactions) | -| Proxy\_\_OVM\_L1CrossDomainMessenger | [0x4324fdD26161457f4BCc1ABDA87709d3Be8Fd10E](https://blockscout.com/xdai/mainnet/address/0x4324fdD26161457f4BCc1ABDA87709d3Be8Fd10E/transactions) | -| Proxy\_\_OVM\_L1StandardBridge | [0x184a119d4C1D08A459FCfBFe7ECc051c163B4c80](https://blockscout.com/xdai/mainnet/address/0x184a119d4C1D08A459FCfBFe7ECc051c163B4c80/transactions) | -| StateCommitmentChain | [0xbAE5EA90F4A1dFBC1b0D145453f371E06287a6D8](https://blockscout.com/xdai/mainnet/address/0xbAE5EA90F4A1dFBC1b0D145453f371E06287a6D8/transactions) | - +| Contract | Address | +| ----------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | +| BondManager | [0x730fE4431a00286Ff8dc7E9B03c661E63Ef05121](https://gnosis.blockscout.com/address/0x730fE4431a00286Ff8dc7E9B03c661E63Ef05121/transactions) | +| CanonicalTransactionChain | [0x636434F59e52D50423bD8272FEB3B2bff5dF586b](https://gnosis.blockscout.com/address/0x636434F59e52D50423bD8272FEB3B2bff5dF586b/transactions) | +| ChainStorageContainer-CTC-batches | [0xEc64fee4f95E48A3BAd799A5912F183d222086A8](https://gnosis.blockscout.com/address/0xEc64fee4f95E48A3BAd799A5912F183d222086A8/transactions) | +| ChainStorageContainer-SCC-batches | [0x26EbaD990cC56ef36166d1C4114CEF25F024b75D](https://gnosis.blockscout.com/address/0x26EbaD990cC56ef36166d1C4114CEF25F024b75D/transactions) | +| ChugSplashDictator | [0x77fAf5Aa4EB7874a676F773fc308e0FD8e9400f7](https://gnosis.blockscout.com/address/0x77fAf5Aa4EB7874a676F773fc308e0FD8e9400f7/transactions) | +| ERC1820Registry | [x1820a4B7618BdE71Dce8cdc73aAB6C95905faD24](https://gnosis.blockscout.com/address/0x1820a4B7618BdE71Dce8cdc73aAB6C95905faD24/transactions) | +| L1StandardBridge | [0x3804bA4ecC886AAe91A6D57dE880616E17C8269C](https://gnosis.blockscout.com/address/0x3804bA4ecC886AAe91A6D57dE880616E17C8269C/transactions) | +| OVM_L1CrossDomainMessenger | [0x6A52b1dbE0293F1ba1bc136b0f8C8f0395F940b9](https://gnosis.blockscout.com/address/0x6A52b1dbE0293F1ba1bc136b0f8C8f0395F940b9/transactions) | +| OVM_Proposer | [0xE57cfefE4B7EddE88af28d4ffB3BD63b272f578A](https://gnosis.blockscout.com/address/0xE57cfefE4B7EddE88af28d4ffB3BD63b272f578A/transactions) | +| OVM_Sequencer | [0xFDCa025dB7368A84deeCc0d82598eB90638D52DF](https://gnosis.blockscout.com/address/0xFDCa025dB7368A84deeCc0d82598eB90638D52DF/transactions) | +| Proxy\_\_OVM_L1CrossDomainMessenger | [0x4324fdD26161457f4BCc1ABDA87709d3Be8Fd10E](https://gnosis.blockscout.com/address/0x4324fdD26161457f4BCc1ABDA87709d3Be8Fd10E/transactions) | +| Proxy\_\_OVM_L1StandardBridge | [0x184a119d4C1D08A459FCfBFe7ECc051c163B4c80](https://gnosis.blockscout.com/address/0x184a119d4C1D08A459FCfBFe7ECc051c163B4c80/transactions) | +| StateCommitmentChain | [0xbAE5EA90F4A1dFBC1b0D145453f371E06287a6D8](https://gnosis.blockscout.com/address/0xbAE5EA90F4A1dFBC1b0D145453f371E06287a6D8/transactions) | ## L2 Contract Addresses -* Optimism L2 contracts can be explored at [https://blockscout.com/xdai/optimism](https://blockscout.com/xdai/optimism) -* Additional Info related to specific contracts is [available here](https://github.com/ethereum-optimism/optimism/tree/56961f9208af8a43a25a138cce21ef488c418141/packages/contracts/docs). -* Summaries for [relevant predeploys here](https://github.com/ethereum-optimism/optimism/blob/8d67991aba584c1703692ea46273ea8a1ef45f56/specs/protocol/components/predeploys.md). - -| Contract | Address | -| ---------------------------- | ------------------------------------------ | -| OVM\_L2ToL1MessagePasser | 0x4200000000000000000000000000000000000000 | -| OVM\_L1MessageSender | 0x4200000000000000000000000000000000000001 | -| OVM\_DeployerWhitelist | 0x4200000000000000000000000000000000000002 | -| OVM\_ECDSAContractAccount | 0x4200000000000000000000000000000000000003 | -| OVM\_SequencerEntrypoint | 0x4200000000000000000000000000000000000005 | -| OVM\_ETH | 0x4200000000000000000000000000000000000006 | -| OVM\_L2CrossDomainMessenger | 0x4200000000000000000000000000000000000007 | -| Lib\_AddressManager | 0x4200000000000000000000000000000000000008 | -| OVM\_ProxyEOA | 0x4200000000000000000000000000000000000009 | -| OVM\_L2StandardBridge | 0x4200000000000000000000000000000000000010 | -| OVM\_SequencerFeeVault | 0x4200000000000000000000000000000000000011 | -| OVM\_ExecutionManagerWrapper | 0x420000000000000000000000000000000000000B | -| OVM\_GasPriceOracle | 0x420000000000000000000000000000000000000F | +- Optimism L2 contracts can be explored at [https://blockscout.com/xdai/optimism](https://blockscout.com/xdai/optimism) +- Additional Info related to specific contracts is [available here](https://github.com/ethereum-optimism/optimism/tree/56961f9208af8a43a25a138cce21ef488c418141/packages/contracts/docs). +- Summaries for [relevant predeploys here](https://github.com/ethereum-optimism/optimism/blob/8d67991aba584c1703692ea46273ea8a1ef45f56/specs/protocol/components/predeploys.md). + +| Contract | Address | +| --------------------------- | ------------------------------------------ | +| OVM_L2ToL1MessagePasser | 0x4200000000000000000000000000000000000000 | +| OVM_L1MessageSender | 0x4200000000000000000000000000000000000001 | +| OVM_DeployerWhitelist | 0x4200000000000000000000000000000000000002 | +| OVM_ECDSAContractAccount | 0x4200000000000000000000000000000000000003 | +| OVM_SequencerEntrypoint | 0x4200000000000000000000000000000000000005 | +| OVM_ETH | 0x4200000000000000000000000000000000000006 | +| OVM_L2CrossDomainMessenger | 0x4200000000000000000000000000000000000007 | +| Lib_AddressManager | 0x4200000000000000000000000000000000000008 | +| OVM_ProxyEOA | 0x4200000000000000000000000000000000000009 | +| OVM_L2StandardBridge | 0x4200000000000000000000000000000000000010 | +| OVM_SequencerFeeVault | 0x4200000000000000000000000000000000000011 | +| OVM_ExecutionManagerWrapper | 0x420000000000000000000000000000000000000B | +| OVM_GasPriceOracle | 0x420000000000000000000000000000000000000F | ## Graph Protocol When starting the graph-node the network key is: **`optimism`** -* Graph [https://graph-optimism.gnosischain.com/](https://graph-optimism.gnosischain.com/) -* Admin [https://admin-graph-optimism.gnosischain.com/](https://admin-graph-optimism.gnosischain.com/) +- Graph [https://graph-optimism.gnosischain.com/](https://graph-optimism.gnosischain.com/) +- Admin [https://admin-graph-optimism.gnosischain.com/](https://admin-graph-optimism.gnosischain.com/) diff --git a/docs/bridges/README.md b/docs/bridges/README.md index 7e85ce5f..4cb611c2 100644 --- a/docs/bridges/README.md +++ b/docs/bridges/README.md @@ -8,38 +8,42 @@ keywords: [gnosis bridge, bridge architecture, omnibridge, xdai bridge] Gnosis' native bridges allow for sending tokens and data, and are run by a group of [trusted bridge validators](/bridges/tokenbridge/amb-bridge#bridge-validators). There is a [roadmap](/bridges/roadmap) to move towards [trustless bridges](/bridges/roadmap#trustless-bridges). -There is a growing ecosystem of [3rd-party Bridges](/user-guide/bridges) that build on top of native bridges, that provide users with fast liquidity and user experience. +There is a growing ecosystem of [3rd-party Bridges](third-party.md) that build on top of native bridges, that provide users with fast liquidity and user experience. + +Gnosis' native bridges are first-class citizens in the chain's architecture due to the [native xDai bridge's](/bridges/tokenbridge/xdai-bridge) integral role in minting and burning the native [xDai token](/about/tokens/xdai) used for gas. -Gnosis' native bridges are first-class citizens in the chain's architecture due to the [native xDai bridge's](/bridges/tokenbridge/xdai-bridge) integral role in minting and burning the native [xDai token](/about/tokens/xdai) used for gas. ## Conceptual Architecture -Gnosis has three main types of bridges: +Gnosis has three main types of bridges: + +- **Native Bridges**: built into the chain itself, and mint the [canonical token](./tokenbridge/omnibridge.md#canonical-token-registries) representation of the original asset on Gnosis (e.g. "Canonical Dai", "Canonical ETH") +- **3rd-party Bridges**: these are maintained by 3rd parties and allow users to swap for canonical tokens created by native bridges +- **Application-Specific Bridges**: some applications may provide custom bridges that maintain their own canonical token on Gnosis -- **Native Bridges**: built into the chain itself, and mint the [canonical token](#canonical-tokens) representation of the original asset on Gnosis (e.g. "Canonical Dai", "Canonical ETH") -- **3rd-party Bridges**: these are maintained by 3rd parties and allow users to swap for [canonical tokens](#canonical-tokens) created by native bridges -- **Application-Specific Bridges**: some applications may provide custom bridges that maintain their own [canonical token](#canonical-tokens) on Gnosis +![Diagrams overview of Bridges](../../static/img/bridges/diagrams/bridge-overview.svg) -![Diagrams overview of Bridges](/img/bridges/diagrams/bridge-overview.svg) ## Native Bridges Gnosis has two native bridges: - **xDai Bridge** that is used to mint the native stablecoin by bridging Dai from Ethereum -- **Omnibridge** and underlying **Arbitrary Message Bridge** that are used for bridging tokens and data +- **Omnibridge** and underlying **Arbitrary Message Bridge** that are used for bridging tokens and data ### Bridging Dai -See the [xDai Bridge](/bridges/tokenbridge/xdai-bridge). +See the [xDai Bridge](/bridges/tokenbridge/xdai-bridge). + ### Bridging Data See the [Arbitrary Message Passing Bridge](/bridges/tokenbridge/amb-bridge) or AMB Bridge for short. + ### Bridging Tokens See the [Omnibridge](/bridges/tokenbridge/omnibridge), which is built on top of the [Arbitrary Message Passing Bridge](/bridges/tokenbridge/amb-bridge). ## Canonical Bridged Tokens -Tokens that are bridged using [Omnibridge](/bridges/tokenbridge/omnibridge) are regarded as canonical representations of the origin token on Gnosis Chain. +Tokens that are bridged using [Omnibridge](/bridges/tokenbridge/omnibridge) are regarded as canonical representations of the origin token on Gnosis Chain. - [Canonical Bridged Tokens from Ethereum](https://blockscout.com/xdai/mainnet/bridged-tokens/eth) - [Canonical Bridged Tokens from Binance Smart Chain](https://blockscout.com/xdai/mainnet/bridged-tokens/bsc) diff --git a/docs/bridges/governance/README.md b/docs/bridges/governance/README.md index 15df8881..d2381911 100644 --- a/docs/bridges/governance/README.md +++ b/docs/bridges/governance/README.md @@ -52,15 +52,15 @@ There are currently 16 Bridge Governors, of which 8-of-16 are required to pass a ### Phase 1: Ideation -Post created on the Gnosis Forum in the [GnosisDAO category 108](https://forum.gnosis.io/c/dao/20). There is no set duration on how long a proposal stays in this stage. There is no formal requirement for a proposal to pass this stage. However, if a proposal discussion fails to garner momentum from the community, it is unlikely to become a successful proposal. +Post created on the Gnosis Forum in the [GnosisDAO](https://forum.gnosis.io/). There is no set duration on how long a proposal stays in this stage. There is no formal requirement for a proposal to pass this stage. However, if a proposal discussion fails to garner momentum from the community, it is unlikely to become a successful proposal. ### Phase 2: Specification -[Gnosis Improvement Proposal 73](https://forum.gnosis.io/t/gip-0-template/734) (GIP) post is created. This stage lasts 5 days. For the proposal to pass this stage, one outcome with a relative majority of votes on the forum poll must be achieved. If the relative majority of votes indicates `Make no changes`, the proposal does not pass to Phase 3. +[Gnosis Improvement Proposal](https://forum.gnosis.io/t/gip-0-template/734) (GIP) post is created. This stage lasts 5 days. For the proposal to pass this stage, one outcome with a relative majority of votes on the forum poll must be achieved. If the relative majority of votes indicates `Make no changes`, the proposal does not pass to Phase 3. ### Phase 3: Multisig Voting & Execution -[Gnosis Improvement Proposal 73](https://forum.gnosis.io/t/gip-0-template/734) (GIP) post is refined, and there is a [GnosisDAO Snapshot 60](https://snapshot.org/#/gnosis.eth) poll. This stage lasts for 7 days. For proposals to be accepted there must be one outcome with a relative majority of GNO used for signaling on the GnosisDAO Snapshot poll accompanied by a yes-voting quorum of a minimum of 4% of the circulating supply of GNO. If the relative majority of GNO used in signaling on the Snapshot poll indicates the result Make no changes, the proposal will not be accepted and considered closed. +[Gnosis Improvement Proposal](https://forum.gnosis.io/t/gip-0-template/734) (GIP) post is refined, and there is a [GnosisDAO Snapshot](https://snapshot.org/#/gnosis.eth) poll. This stage lasts for 7 days. For proposals to be accepted there must be one outcome with a relative majority of GNO used for signaling on the GnosisDAO Snapshot poll accompanied by a yes-voting quorum of a minimum of 4% of the circulating supply of GNO. If the relative majority of GNO used in signaling on the Snapshot poll indicates the result Make no changes, the proposal will not be accepted and considered closed. ## Governance Parameters diff --git a/docs/bridges/tokenbridge/amb-bridge.md b/docs/bridges/tokenbridge/amb-bridge.md index 8904a1c0..c6cbdb10 100644 --- a/docs/bridges/tokenbridge/amb-bridge.md +++ b/docs/bridges/tokenbridge/amb-bridge.md @@ -13,7 +13,7 @@ The AMB is a key bridge primitive that is used inside higher-order bridges like The AMB currently supports Ethereum, and is part of the [Tokenbridge Architecture](https://tokenbridge.net/). There may be additional EVM-based networks supported in the future. -With [Telepathy added as the 8th validator](../governance/decisions.md#add-telepathy-validator-in-the-amb), AMB bridge is now more secure with trustless zero-knowledge light client technology. Due to the light client finality requirements (at least 12mins on Ethereum), the transactions will take approx. 30mins to be signed by the bridge. However, users can still use 3rd party bridges (Jumper.exchange, Connext, Hop) without any impact. For more details, check out how AMB & Omnibridge works with Telepathy validator. +With [Telepathy added as the 8th validator](../governance/decisions.md#add-telepathy-validator-in-the-amb), AMB bridge is now more secure with trustless zero-knowledge light client technology. Due to the light client finality requirements (at least 12mins on Ethereum), the transactions will take approx. 30mins to be signed by the bridge. However, users can still use 3rd party bridges (Jumper.exchange, Connext, Hop) without any impact. For more details, check out [how AMB & Omnibridge works with Telepathy validator](#how-it-works-with-telepathy-validator). ## Key Information @@ -34,7 +34,7 @@ As the Arbitrary Message Bridge is a message passing bridge, there are no fees o ### Bridge Validators -For a message/tokens to be relayed to another network, bridge validators need to affirm the transaction. Bridge validators are run by trusted members of the Gnosis community and ZK Light Client validator Telepathy. The [long-term roadmap](/bridges/roadmap) is to move towards [trustless bridges](/bridges/roadmap#trustless-bridges) using [zero-knowledge proofs from light clients](/bridges/roadmap#zero-knowledge-light-clients) or other trust-minimized techniques. +For a message/tokens to be relayed to another network, bridge validators need to affirm the transaction. Bridge validators are run by trusted members of the Gnosis community and ZK Light Client validator Telepathy. ### Current Bridge Validators diff --git a/docs/bridges/tokenbridge/nft-bridge.md b/docs/bridges/tokenbridge/nft-bridge.md index 89eb2790..9bdb73f9 100644 --- a/docs/bridges/tokenbridge/nft-bridge.md +++ b/docs/bridges/tokenbridge/nft-bridge.md @@ -6,6 +6,6 @@ keywords: [nft bridge, bridge, gnosis bridge] # NFT Bridge -Gnosis does not support the native bridging of NFTs, which is usually done through [3rd-party NFT Bridges](/user-guide/bridges) (e.g. [XP NFT Bridge](https://bridge.xp.network/)) +Gnosis does not support the native bridging of NFTs, which is usually done through [3rd-party NFT Bridges](../third-party.md#nft-bridges) (e.g. [XP NFT Bridge](https://bridge.xp.network/)) -There is a [legacy native NFT bridge](https://docs.tokenbridge.net/eth-xdai-amb-bridge/nft-omnibridge-extension) that is no longer actively maintained. \ No newline at end of file +There is a [legacy native NFT bridge](https://docs.tokenbridge.net/eth-xdai-amb-bridge/nft-omnibridge-extension) that is no longer actively maintained. diff --git a/docs/bridges/tokenbridge/omnibridge.md b/docs/bridges/tokenbridge/omnibridge.md index 52514768..d7c935bd 100644 --- a/docs/bridges/tokenbridge/omnibridge.md +++ b/docs/bridges/tokenbridge/omnibridge.md @@ -14,11 +14,11 @@ Omnibridge can be accessed at [omni.gnosischain.com](https://omni.gnosischain.co ## Key Information -[Omnibridge](https://omni.gnosischain.com/) a native token bridge that mints the canonical representations of bridged assets on Gnosis. The Omnibridge is built on top of the [Arbitrary Message Bridge (AMB)](/bridges/tokenbridge/amb-bridge) and thus relies on the same group of [Trusted Bridge Validators](/bridges/tokenbridge/amb-bridge#bridge-validators) and trust model as the AMB. With [Telepathy added as the 8th validator](../governance/decisions.md#add-telepathy-validator-in-the-amb), Omnibridge bridge is now more secure with trustless zero-knowledge light client technology. Check out how Omnibridge works with Telepathy validator [here](amb-bridge.md#how-it-works-with-telepathy-validator). +[Omnibridge](https://omni.gnosischain.com/) is a native token bridge that mints the canonical representations of bridged assets on Gnosis. The Omnibridge is built on top of the [Arbitrary Message Bridge (AMB)](/bridges/tokenbridge/amb-bridge) and thus relies on the same group of [Trusted Bridge Validators](/bridges/tokenbridge/amb-bridge#bridge-validators) and trust model as the AMB. With [Telepathy added as the 8th validator](../governance/decisions.md#add-telepathy-validator-in-the-amb), Omnibridge bridge is now more secure with trustless zero-knowledge light client technology. Check out how Omnibridge works with Telepathy validator [here](amb-bridge.md#how-it-works-with-telepathy-validator). The Omnibridge currently connects Gnosis to Ethereum. -The Omnibridge mints bridged tokens using a variant of the [ERC-677](https://github.com/ethereum/EIPs/issues/677) token standard, with all bridged tokens tracked in the canonical [Bridged Token Registries](#bridged-token-registries). +The Omnibridge mints bridged tokens using a variant of the [ERC-677](https://github.com/ethereum/EIPs/issues/677) token standard, with all bridged tokens tracked in the [canonical Bridged Token Registries](#canonical-token-registries). ### Overview @@ -132,7 +132,7 @@ Daily Limit is reset according to the following logic: the smart contract stores ### Bridge Validators -For a message/tokens to be relayed to another network, bridge validators need to affirm the transaction. Bridge validators are run by trusted members of the Gnosis community. Since Omnibridge is based on the Arbitrary Message Bridge functionality, the set of validators is the actual set of AMB validators. The [long-term roadmap](/bridges/roadmap) is to move towards [trustless bridges](/bridges/roadmap#trustless-bridges) using [zero-knowledge proofs from light clients](/bridges/roadmap#zero-knowledge-light-clients) or other trust-minimized techniques. The same [validator set](amb-bridge#bridge-validators) is used as the AMB bridge, as the OmniBridge is built on top of the AMB Bridge. +For a message/tokens to be relayed to another network, bridge validators need to affirm the transaction. Bridge validators are run by trusted members of the Gnosis community. Since Omnibridge is based on the Arbitrary Message Bridge functionality, the set of validators is the actual set of AMB validators. The same [validator set](amb-bridge#bridge-validators) is used as the AMB bridge, as the OmniBridge is built on top of the AMB Bridge. ### Bridge Validator Flow @@ -263,10 +263,10 @@ In a multi-chain world, some assets (e.g. USDC) can be bridged over from differe For example, there are two different representations of USDC on Gnosis: -| Asset | Token Contract | -| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------ | -| USDC from Ethereum | [0xDDAfbb505ad214D7b80b1f830fcCc89B60fb7A83](https://blockscout.com/xdai/mainnet/address/0xDDAfbb505ad214D7b80b1f830fcCc89B60fb7A83) | -| USDC from BSC | [0xD10Cc63531a514BBa7789682E487Add1f15A51E2](https://blockscout.com/xdai/mainnet/address/0xD10Cc63531a514BBa7789682E487Add1f15A51E2) | +| Asset | Token Contract | +| ------------------ | ------------------------------------------------------------------------------------------------------------------------------ | +| USDC from Ethereum | [0xDDAfbb505ad214D7b80b1f830fcCc89B60fb7A83](https://gnosis.blockscout.com/address/0xDDAfbb505ad214D7b80b1f830fcCc89B60fb7A83) | +| USDC from BSC | [0xD10Cc63531a514BBa7789682E487Add1f15A51E2](https://gnosis.blockscout.com/address/0xD10Cc63531a514BBa7789682E487Add1f15A51E2) | Gnosis adopts a naming convention where the "chain of origin" is added as a suffix to the token name (e.g. USDC from Ethereum, USDC from BSC) diff --git a/docs/bridges/tokenbridge/xdai-bridge.md b/docs/bridges/tokenbridge/xdai-bridge.md index d1230ed3..2107d8d0 100644 --- a/docs/bridges/tokenbridge/xdai-bridge.md +++ b/docs/bridges/tokenbridge/xdai-bridge.md @@ -1,6 +1,6 @@ --- title: xDai Bridge -description: The xDai bridge is a native Dai bridge from Ethereum that is used to mint and burn xDai, the native asset used for gas and transaction fees on Gnosis. +description: The xDai bridge is a native Dai bridge from Ethereum that is used to mint and burn xDai, the native asset used for gas and transaction fees on Gnosis. keywords: [xdai bridge, bridge, dai, ethereum, gnosis bridge] --- @@ -12,18 +12,18 @@ The xDai bridge can be found at [bridge.gnosischain.com](https://bridge.gnosisch ::: -The [xDai bridge](https://bridge.gnosischain.com) is a native Dai bridge from Ethereum that is used to mint and burn [xDai](/about/tokens/xdai), the native asset used for gas and transaction fees on Gnosis. +The [xDai bridge](https://bridge.gnosischain.com) is a native Dai bridge from Ethereum that is used to mint and burn [xDai](/about/tokens/xdai), the native asset used for gas and transaction fees on Gnosis. -![xDai Bridge Diagram](/img/bridges/diagrams/dai-bridge-01.png) +![xDai Bridge Diagram](/img/bridges/diagrams/dai-bridge-01.png) -Once Dai is bridged into the xDai bridge, the xDai bridge contract on Gnosis notifies the [block rewards contract](#block-rewards-contract). The consensus algorithm then mints xDai to the user's corresponding address on Gnosis in the next block. +Once Dai is bridged into the xDai bridge, the xDai bridge contract on Gnosis notifies the [block rewards contract](#block-rewards-contract). The consensus algorithm then mints xDai to the user's corresponding address on Gnosis in the next block. ## Key Information ### Overview | | Detail | -|-----------------------|-------------------------------------------------------| +| --------------------- | ----------------------------------------------------- | | Frontend URL | https://bridge.gnosischain.com | | Trust Model | [4-of-7 Validator Multisig](#bridge-validators) | | Governance | [8-of-16 Multisig](#bridge-governance) | @@ -31,7 +31,6 @@ Once Dai is bridged into the xDai bridge, the xDai bridge contract on Gnosis not | Bug Bounty | [Up to $2m](https://immunefi.com/bounty/gnosischain/) | | Bug Reporting | [Immunefi](https://immunefi.com/bounty/gnosischain/) | - ### Key Contracts @@ -39,9 +38,8 @@ Once Dai is bridged into the xDai bridge, the xDai bridge contract on Gnosis not ### Ethereum - | Contract | Ethereum Address | -|-------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------| +| ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | | Proxy Contract | [eth:0x4aa42145Aa6Ebf72e164C9bBC74fbD3788045016](https://etherscan.io/address/0x4aa42145Aa6Ebf72e164C9bBC74fbD3788045016#readProxyContract) | | Validator Management Contract | [eth:0xe1579dEbdD2DF16Ebdb9db8694391fa74EeA201E](https://etherscan.io/address/0xe1579dEbdD2DF16Ebdb9db8694391fa74EeA201E#code) | | Admin Multisignature Wallet | [eth:0xff1a8EDA5eAcdB6aAf729905492bdc6376DBe2dd](https://etherscan.io/address/0xff1a8EDA5eAcdB6aAf729905492bdc6376DBe2dd) | @@ -51,52 +49,52 @@ Once Dai is bridged into the xDai bridge, the xDai bridge contract on Gnosis not ### Gnosis -| Contract | Gnosis Address | -|-------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| Proxy Contract | [gno:0x7301CFA0e1756B71869E93d4e4Dca5c7d0eb0AA6](https://blockscout.com/xdai/mainnet/address/0x7301CFA0e1756B71869E93d4e4Dca5c7d0eb0AA6/read-proxy#address-tabs) | -| Block Reward Contract | [gno:0x481c034c6d9441db23Ea48De68BCAe812C5d39bA](https://blockscout.com/xdai/mainnet/address/0x481c034c6d9441db23Ea48De68BCAe812C5d39bA) | -| Validator Management Contract | [gno:0xB289f0e6fBDFf8EEE340498a56e1787B303F1B6D](https://blockscout.com/xdai/mainnet/address/0xB289f0e6fBDFf8EEE340498a56e1787B303F1B6D/read-proxy) | -| Admin Multisignature Wallet | [gno:0x0d3726e5a9f37234d6b55216fc971d30f150a60f](https://blockscout.com/xdai/mainnet/address/0x0D3726e5a9f37234D6B55216fC971D30F150a60F/transactions#address-tabs) | -| ERC20ToNative Helper Contract | [gno:0x2D51EAa266eafcb59bB36dD3c7E99C515e58113A](https://gnosisscan.io/address/0x2d51eaa266eafcb59bb36dd3c7e99c515e58113a#readContract) | +| Contract | Gnosis Address | +| ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| Proxy Contract | [gno:0x7301CFA0e1756B71869E93d4e4Dca5c7d0eb0AA6](https://gnosis.blockscout.com/address/0x7301CFA0e1756B71869E93d4e4Dca5c7d0eb0AA6#address-tabs) | +| Block Reward Contract | [gno:0x481c034c6d9441db23Ea48De68BCAe812C5d39bA](https://gnosis.blockscout.com/address/0x481c034c6d9441db23Ea48De68BCAe812C5d39bA) | +| Validator Management Contract | [gno:0xB289f0e6fBDFf8EEE340498a56e1787B303F1B6D](https://gnosis.blockscout.com/address/0xB289f0e6fBDFf8EEE340498a56e1787B303F1B6D/read-proxy) | +| Admin Multisignature Wallet | [gno:0x0d3726e5a9f37234d6b55216fc971d30f150a60f](https://gnosis.blockscout.com/address/0x0D3726e5a9f37234D6B55216fC971D30F150a60F/transactions#address-tabs) | +| ERC20ToNative Helper Contract | [gno:0x2D51EAa266eafcb59bB36dD3c7E99C515e58113A](https://gnosis.blockscout.com/address/0x2d51eaa266eafcb59bb36dd3c7e99c515e58113a#readContract) | ### Goerli -| Contract | Address | -|-------------------------------|------------------------------------------------------------------------------------------------------------------------------| +| Contract | Address | +| ----------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | | OmniBridge Mediator (Foreign) | [0x00147c84f13764dCDAbAF1cbAe622fa6f6839085](https://goerli.etherscan.io/address/0x00147c84f13764dCDAbAF1cbAe622fa6f6839085) | | AMB Contract Proxy (Foreign) | [0x87A19d769D875964E9Cd41dDBfc397B2543764E6](https://goerli.etherscan.io/address/0x87A19d769D875964E9Cd41dDBfc397B2543764E6) | - - ### Chiado -| Contract | Address | -|----------------------------|--------------------------------------------| -| OmniBridge Mediator (Home) | [0x09D549a48AC52F3f9945E7de6402c609c92aa2E1](https://gnosisscan.io/address/0x09D549a48AC52F3f9945E7de6402c609c92aa2E1) | -| AMB Contract Proxy (Home) | [0x99Ca51a3534785ED619f46A79C7Ad65Fa8d85e7a](https://gnosisscan.io/address/0x99Ca51a3534785ED619f46A79C7Ad65Fa8d85e7a) | +| Contract | Address | +| -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | +| OmniBridge Mediator (Home) | [0x09D549a48AC52F3f9945E7de6402c609c92aa2E1](https://gnosis-chiado.blockscout.com/address/0x09D549a48AC52F3f9945E7de6402c609c92aa2E1) | +| AMB Contract Proxy (Home) | [0x99Ca51a3534785ED619f46A79C7Ad65Fa8d85e7a](https://gnosis-chiado.blockscout.com/address/0x99Ca51a3534785ED619f46A79C7Ad65Fa8d85e7a) | -References: -* [TokenBridge Docs: About xDai Bridge](https://docs.tokenbridge.net/xdai-bridge/about) -* [TokenBridge Docs: Bridge Contract Management](https://docs.tokenbridge.net/xdai-bridge/xdai-bridge-contracts-management) +References: + +- [TokenBridge Docs: About xDai Bridge](https://docs.tokenbridge.net/xdai-bridge/about) +- [TokenBridge Docs: Bridge Contract Management](https://docs.tokenbridge.net/xdai-bridge/xdai-bridge-contracts-management) + ### Fees & Daily Limits -| Type | Ethereum -> Gnosis | Gnosis -> Ethereum | -|--------------------|--------------------|-----------------------| -| Approx. Gas Cost | | | -| Bridge Fees | 0% | 0% | -| Min Transfer | 0.005 Dai | 10 xDai | -| Daily Limit | 10,000,000 Dai | 10,000,000 xDai | -| Max Single Deposit | 9,999,999 Dai | 10,000,000 xDai | +| Type | Ethereum -> Gnosis | Gnosis -> Ethereum | +| ------------------ | ------------------ | ------------------ | +| Approx. Gas Cost | | | +| Bridge Fees | 0% | 0% | +| Min Transfer | 0.005 Dai | 10 xDai | +| Daily Limit | 10,000,000 Dai | 10,000,000 xDai | +| Max Single Deposit | 9,999,999 Dai | 10,000,000 xDai | :::note Daily Limit is reset according to the following logic: the smart contract stores total amount of processed tokens per current day and reverts on a new transfer if it exceeds the daily limit. Id of the day is calculated using the formula `timestamp / (number of seconds in 1 day)`, where `timestamp` is the Unix timestamp. @@ -104,33 +102,31 @@ Daily Limit is reset according to the following logic: the smart contract stores ### Bridge Validators -The xDai bridge relies on trusted xDai Bridge Validators as cross-chain bridge oracle. There is a roadmap to move towards [trustless bridges](/bridges/roadmap). +The xDai bridge relies on trusted xDai Bridge Validators as cross-chain bridge oracle. There is a roadmap to move towards [trustless bridges](/bridges/roadmap). Bridge transactions currently requires signatures from 4 of 7 validators. - -| Organization | Gnosis Address | -|--------------|------------------------------------------------------------------------------------------------------------------------------------------| -| GnosisDao | [gno:0x97630e2ae609d4104abda91f3066c556403182dd](https://blockscout.com/xdai/mainnet/address/0x97630e2ae609d4104abda91f3066c556403182dd) | -| Protofire | [gno:0x4d1c96b9a49c4469a0b720a22b74b034eddfe051](https://blockscout.com/xdai/mainnet/address/0x4D1c96B9A49C4469A0b720a22b74b034EDdFe051) | -| CowProtocol | [gno:0x587c0d02b40822f15f05301d87c16f6a08aaddde](https://blockscout.com/xdai/mainnet/address/0x587c0d02b40822f15f05301d87c16f6a08aaddde) | -| Giveth | [gno:0xc073C8E5ED9Aa11CF6776C69b3e13b259Ba9F506](https://blockscout.com/xdai/mainnet/address/0xc073C8E5ED9Aa11CF6776C69b3e13b259Ba9F506) | -| GnosisSafe | [gno:0x1312e98995bbcc30fc63db3cef807e20cdd33dca](https://blockscout.com/xdai/mainnet/address/0x1312e98995bbcc30fc63db3cef807e20cdd33dca) | -| Karpatkey | [gno:0xfa98b60e02a61b6590f073cad56e68326652d094](https://blockscout.com/xdai/mainnet/address/0xfa98b60e02a61b6590f073cad56e68326652d094) | -| Gateway | [gno:0x3e0A20099626F3d4d4Ea7B0cE0330e88d1Fe65D6](https://blockscout.com/xdai/mainnet/address/0x3e0A20099626F3d4d4Ea7B0cE0330e88d1Fe65D6) | +| Organization | Gnosis Address | +| ------------ | ---------------------------------------------------------------------------------------------------------------------------------- | +| GnosisDao | [gno:0x97630e2ae609d4104abda91f3066c556403182dd](https://gnosis.blockscout.com/address/0x97630e2ae609d4104abda91f3066c556403182dd) | +| Protofire | [gno:0x4d1c96b9a49c4469a0b720a22b74b034eddfe051](https://gnosis.blockscout.com/address/0x4D1c96B9A49C4469A0b720a22b74b034EDdFe051) | +| CowProtocol | [gno:0x587c0d02b40822f15f05301d87c16f6a08aaddde](https://gnosis.blockscout.com/address/0x587c0d02b40822f15f05301d87c16f6a08aaddde) | +| Giveth | [gno:0xc073C8E5ED9Aa11CF6776C69b3e13b259Ba9F506](https://gnosis.blockscout.com/address/0xc073C8E5ED9Aa11CF6776C69b3e13b259Ba9F506) | +| GnosisSafe | [gno:0x1312e98995bbcc30fc63db3cef807e20cdd33dca](https://gnosis.blockscout.com/address/0x1312e98995bbcc30fc63db3cef807e20cdd33dca) | +| Karpatkey | [gno:0xfa98b60e02a61b6590f073cad56e68326652d094](https://gnosis.blockscout.com/address/0xfa98b60e02a61b6590f073cad56e68326652d094) | +| Gateway | [gno:0x3e0A20099626F3d4d4Ea7B0cE0330e88d1Fe65D6](https://gnosis.blockscout.com/address/0x3e0A20099626F3d4d4Ea7B0cE0330e88d1Fe65D6) | ### Bridge Validator Flow ![](/img/bridges/diagrams/xdai-bridge-validator-flow.png) - ### Bridge Governance -* See [Bridge Governance](/bridges/governance) +- See [Bridge Governance](/bridges/governance) ### Bridge Revenue -The xDai bridge currently generates bridge revenue through earned yield on stablecoins deposited on the bridge, which is then used by the GnosisDAO treasury to fund Gnosis development. +The xDai bridge currently generates bridge revenue through earned yield on stablecoins deposited on the bridge, which is then used by the GnosisDAO treasury to fund Gnosis development. ### Analytics @@ -139,24 +135,24 @@ The xDai bridge currently generates bridge revenue through earned yield on stabl ## How it Works +### Ethereum -> Gnosis Chain. -### Ethereum -> Gnosis Chain. ![](/img/bridges/diagrams/dai-bridge-01.png) The [xDai token](/about/tokens/xdai) is minted when Dai is transferred from Ethereum to Gnosis using the xDai Bridge. During the transfer process, a block reward contract is invoked to mint xDai to a user's account. Because contract calls are made from the consensus engine to create xDai tokens, balance updates are more difficult to trace than simple value transfers. -1. Users lock an amount of DAI on the [bridge contract](https://etherscan.io/address/0x4aa42145Aa6Ebf72e164C9bBC74fbD3788045016#code) on Ethereum -2. `UserRequestForAffirmation` event is triggered +1. Users lock an amount of DAI on the [bridge contract](https://etherscan.io/address/0x4aa42145Aa6Ebf72e164C9bBC74fbD3788045016#code) on Ethereum +2. `UserRequestForAffirmation` event is triggered 3. Validators observe the deposit and invoke `executeAffirmation` function on Gnosis bridge contract -4. When enough confirmations are collected (4/7 majority), the bridge contract on Gnosis Chain calls the block reward contract to record the receiver(s) and amount(s) of xDAI to mint. -5. The [block reward contract](https://blockscout.com/xdai/mainnet/address/0x481c034c6d9441db23Ea48De68BCAe812C5d39bA) is called by the consensus engine to update user's xDAI balance. +4. When enough confirmations are collected (4/7 majority), the bridge contract on Gnosis Chain calls the block reward contract to record the receiver(s) and amount(s) of xDAI to mint. +5. The [block reward contract](https://gnosis.blockscout.com/address/0x481c034c6d9441db23Ea48De68BCAe812C5d39bA) is called by the consensus engine to update user's xDAI balance. -You can view a receiver's address and amount of xDai received in the [block reward contract's](https://blockscout.com/xdai/mainnet/address/0x481c034c6d9441db23Ea48De68BCAe812C5d39bA) logs. Whenever the `executeAffirmation` method is called, it registers the following: +You can view a receiver's address and amount of xDai received in the [block reward contract's](https://gnosis.blockscout.com/address/0x481c034c6d9441db23Ea48De68BCAe812C5d39bA) logs. Whenever the `executeAffirmation` method is called, it registers the following: ``` AddedReceiver( - uint256 amount, - address indexed receiver, + uint256 amount, + address indexed receiver, address indexed bridge ) ``` @@ -164,9 +160,11 @@ AddedReceiver( Example: https://blockscout.com/xdai/mainnet/tx/0x5892a695860f6087a2d93140f05e6365142ff77fd7128e39dbc03128d5797ac4/logs --- + ### Gnosis Chain -> Ethereum. - + ![](/img/bridges/diagrams/dai-bridge-02.png) + 1. User -> Gnosis Chain bridge: initiate a withdrawal: xDAI is burned. 2. `UserRequestForSignature` event emitted (see [example transaction](https://blockscout.com/xdai/mainnet/tx/0x8e23cf0ab01476c2df5b71a72603f2c229d3d9a63ad6ca71ce164798f3733826/internal-transactions)). 3. Validators listen to the event: call `submitSignature` on Gnosis chain. @@ -174,73 +172,79 @@ Example: https://blockscout.com/xdai/mainnet/tx/0x5892a695860f6087a2d93140f05e63 5. Anyone can execute the withdrawal on Ethereum (user via UI or validator). DAI is unlocked. 6. `RelayedMessage` emitted on mainnet - :::note This final step may be delayed if Ethereum mainnet is congested. ::: -References: - -* [TokenBridge Docs: Withdrawing xDai to Dai](https://docs.tokenbridge.net/xdai-bridge/using-the-xdai-bridge/withdrawal-authorization-flow) - +References: +- [TokenBridge Docs: Withdrawing xDai to Dai](https://docs.tokenbridge.net/xdai-bridge/using-the-xdai-bridge/withdrawal-authorization-flow) ## Managing Bridge Contracts + ### Upgrading a Contract + There are two possible scenarios for how the bridge or validators contracts can be upgraded: -* a security fix when only the contract implementation is changed -* an improvement when the contract implementation upgrade requires initialization of storage values. + +- a security fix when only the contract implementation is changed +- an improvement when the contract implementation upgrade requires initialization of storage values. #### Basic Process + ![](/img/bridges/diagrams/xdaibridge-contract-mgmt.svg) + 1. One of the multisig wallet owners ABI encodes a method call with parameters (if any). This can be done with the [ABI Encoding Service](https://abi.hashex.org/). The encoded sequence of bytes is used to create a transaction for the multisig wallet contract. This is done with the `submitTransaction` method of the multisig wallet contract. 2. The method raises the event `Submission` containing the index of the registered transaction. The index is shared with the other owners of the wallet. 3. The rest of the owners confirm the transaction by invoking `confirmTransaction` from the multisig wallet contract. -4. As soon as enough confirmations are received, the method encoded in step 1 is invoked automatically. This is important because adequate gas limits must be set for that transaction and set of confirmations sent by the wallet owner finalizing the operation. If the method is not invoked because the gas limit is exceeded, the owners can execute the confirmed transaction manually by sending `executeTransaction`. +4. As soon as enough confirmations are received, the method encoded in step 1 is invoked automatically. This is important because adequate gas limits must be set for that transaction and set of confirmations sent by the wallet owner finalizing the operation. If the method is not invoked because the gas limit is exceeded, the owners can execute the confirmed transaction manually by sending `executeTransaction`. #### Security Upgrade + 1. Deploy a new implementation of the bridge or validators contract. 2. Depending on the contract and the chain use one of the links below to get the current version of the contract implementation: - * The bridge contract on _ETH Mainnet_: [Etherscan](https://etherscan.io/address/0x4aa42145aa6ebf72e164c9bbc74fbd3788045016#readContract), - * The validators contract on _ETH Mainnet_: [Etherscan](https://etherscan.io/address/0xe1579dEbdD2DF16Ebdb9db8694391fa74EeA201E#readContract) - * The bridge contract on _Gnosis_: [Blockscout](https://blockscout.com/poa/xdai/address/0x7301CFA0e1756B71869E93d4e4Dca5c7d0eb0AA6/read-contract) - * The validators contract on _Gnosis_: [Blockscout](https://blockscout.com/poa/xdai/address/0xB289f0e6fBDFf8EEE340498a56e1787B303F1B6D/read-contract) -3. Use the upgradeTo method from EternalStorageProxy ABI, the address of the new implementation, and the incremented version number to encode the data for the transaction. Example of the data: `3ad06d160000000000000000000000000000000000000000000000000000000000000004000000000000000000000000f097137c7ec5e582b5704065f72ac5903d0b526d`. + - The bridge contract on _ETH Mainnet_: [Etherscan](https://etherscan.io/address/0x4aa42145aa6ebf72e164c9bbc74fbd3788045016#readContract), + - The validators contract on _ETH Mainnet_: [Etherscan](https://etherscan.io/address/0xe1579dEbdD2DF16Ebdb9db8694391fa74EeA201E#readContract) + - The bridge contract on _Gnosis_: [Blockscout](https://gnosis.blockscout.com/address/0x7301CFA0e1756B71869E93d4e4Dca5c7d0eb0AA6?tab=read_proxy) + - The validators contract on _Gnosis_: [Blockscout](https://gnosis.blockscout.com/address/0xB289f0e6fBDFf8EEE340498a56e1787B303F1B6D?tab=read_proxy) +3. Use the `upgradeTo` method from EternalStorageProxy ABI, the address of the new implementation, and the incremented version number to encode the data for the transaction. Example of the data: `3ad06d160000000000000000000000000000000000000000000000000000000000000004000000000000000000000000f097137c7ec5e582b5704065f72ac5903d0b526d`. 4. Invoke `submitTransaction` of the multisig wallet contract (`0xff1a8EDA5eAcdB6aAf729905492bdc6376DBe2dd` on Mainnet ETH, `0x0d3726e5a9f37234d6b55216fc971d30f150a60f` on Gnosis chain). The data field must be filled with the bytes received from the previous step. The destination depends on the contract: - * `0x4aa42145Aa6Ebf72e164C9bBC74fbD3788045016` if the security upgrade is made for the bridge contract on ETH Mainnet. - * `0xe1579dEbdD2DF16Ebdb9db8694391fa74EeA201E` if the security upgrade is made for the validators contract on the ETH Mainnet. - * `0x7301cfa0e1756b71869e93d4e4dca5c7d0eb0aa6` if the security upgrade is made for the bridge contract on the xDai chain. - * `0xb289f0e6fbdff8eee340498a56e1787b303f1b6d` if the security upgrade is made for the validators contract on the xDai chain. + - `0x4aa42145Aa6Ebf72e164C9bBC74fbD3788045016` if the security upgrade is made for the bridge contract on ETH Mainnet. + - `0xe1579dEbdD2DF16Ebdb9db8694391fa74EeA201E` if the security upgrade is made for the validators contract on the ETH Mainnet. + - `0x7301cfa0e1756b71869e93d4e4dca5c7d0eb0aa6` if the security upgrade is made for the bridge contract on the xDai chain. + - `0xb289f0e6fbdff8eee340498a56e1787b303f1b6d` if the security upgrade is made for the validators contract on the xDai chain. 5. Identify the index of the transaction returned in the `Submission` event as soon as the transaction from the previous step is included into a block and share it with the other multisig wallet owners. 6. (for the rest of owners) Invoke `confirmTransaction` on the multisig wallet contract (`0xff1a8EDA5eAcdB6aAf729905492bdc6376DBe2dd` on the Mainnet ETH, `0x0d3726e5a9f37234d6b55216fc971d30f150a60f` on Gnosis chain). Set the gas limit to _three times bigger_ than the gas estimator function suggests. #### Bridge Improvement -1. Identify the method to call as part of the new implementation initialization. In the following steps we assume that the method's name is `upgradeFrom3to4()` which takes no arguments. -2. Use the method mentioned above from the new contract implementation code or ABI to encode the data to be passed to `upgradeToAndCall()` method. Example of the data: `50d28adb`. + +1. Identify the method to call as part of the new implementation initialization. In the following steps we assume that the method's name is `upgradeFrom3to4()` which takes no arguments. +2. Use the method mentioned above from the new contract implementation code or ABI to encode the data to be passed to `upgradeToAndCall()` method. Example of the data: `50d28adb`. 3. Deploy a new implementation of the bridge or validators contract. 4. Depending on the contract and the chain, use one of the links below to get the current `version` of the contract implementation: - * The bridge contract on _the ETH Mainnet_: [Etherscan](https://etherscan.io/address/0x4aa42145aa6ebf72e164c9bbc74fbd3788045016#readContract), - * The validators contract on _the ETH Mainnet_: [Etherscan](https://etherscan.io/address/0xe1579dEbdD2DF16Ebdb9db8694391fa74EeA201E#readContract) - * The bridge contract on _Gnosis Chain_: [Blockscout](https://blockscout.com/poa/xdai/address/0x7301CFA0e1756B71869E93d4e4Dca5c7d0eb0AA6/read-contract) - * The validators contract on _Gnosis chain_: [Blockscout](https://blockscout.com/poa/xdai/address/0xB289f0e6fBDFf8EEE340498a56e1787B303F1B6D/read-contract) -5. Use the upgradeToAndCall method from the EternalStorageProxy ABI, the address of the new implementation, and the incremented version number to encode the data for the transaction. Example of the data: `0xa9c45fcb0000000000000000000000000000000000000000000000000000000000000004000000000000000000000000692a70d2e424a56d2c6c27aa97d1a86395877b3a0000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000450d28adb00000000000000000000000000000000000000000000000000000000`. + - The bridge contract on _the ETH Mainnet_: [Etherscan](https://etherscan.io/address/0x4aa42145aa6ebf72e164c9bbc74fbd3788045016#readContract), + - The validators contract on _the ETH Mainnet_: [Etherscan](https://etherscan.io/address/0xe1579dEbdD2DF16Ebdb9db8694391fa74EeA201E#readContract) + - The bridge contract on _Gnosis Chain_: [Blockscout](https://gnosis.blockscout.com/address/0x7301CFA0e1756B71869E93d4e4Dca5c7d0eb0AA6?tab=read_proxy) + - The validators contract on _Gnosis chain_: [Blockscout](https://gnosis.blockscout.com/address/0xB289f0e6fBDFf8EEE340498a56e1787B303F1B6D?tab=read_proxy) +5. Use the `upgradeToAndCall` method from the EternalStorageProxy ABI, the address of the new implementation, and the incremented version number to encode the data for the transaction. Example of the data: `0xa9c45fcb0000000000000000000000000000000000000000000000000000000000000004000000000000000000000000692a70d2e424a56d2c6c27aa97d1a86395877b3a0000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000450d28adb00000000000000000000000000000000000000000000000000000000`. 6. Invoke `submitTransaction` on the multisig wallet contract (`0xff1a8EDA5eAcdB6aAf729905492bdc6376DBe2dd` on Mainnet ETH, `0x0d3726e5a9f37234d6b55216fc971d30f150a60f` on Gnosis chain). The data field must be filled with the bytes received on the previous step. The destination depends on the contract: - * `0x4aa42145Aa6Ebf72e164C9bBC74fbD3788045016` if the security upgrade is made for the bridge contract on ETH Mainnet. - * `0xe1579dEbdD2DF16Ebdb9db8694391fa74EeA201E` if the security upgrade is made for the validators contract on ETH Mainnet. - * `0x7301cfa0e1756b71869e93d4e4dca5c7d0eb0aa6` if the security upgrade is made for the bridge contract on Gnosis chain. - * `0xb289f0e6fbdff8eee340498a56e1787b303f1b6d` if the security upgrade is made for the validators contract on Gnosis chain. + - `0x4aa42145Aa6Ebf72e164C9bBC74fbD3788045016` if the security upgrade is made for the bridge contract on ETH Mainnet. + - `0xe1579dEbdD2DF16Ebdb9db8694391fa74EeA201E` if the security upgrade is made for the validators contract on ETH Mainnet. + - `0x7301cfa0e1756b71869e93d4e4dca5c7d0eb0aa6` if the security upgrade is made for the bridge contract on Gnosis chain. + - `0xb289f0e6fbdff8eee340498a56e1787b303f1b6d` if the security upgrade is made for the validators contract on Gnosis chain. 7. Identify the index of the transaction returned in the `Submission` event as soon as the transaction from the previous step is included into a block and share it with other multisig wallet owners. 8. (for the rest of owners) Invoke `confirmTransaction()` of the multisig wallet contract (`0xff1a8EDA5eAcdB6aAf729905492bdc6376DBe2dd` on Mainnet ETH, `0x0d3726e5a9f37234d6b55216fc971d30f150a60f` on Gnosis chain). Set the gas limit to _four times bigger_ than the gas estimator suggests. -References: -* [TokenBridge Docs: xDai Contracts Management](https://docs.tokenbridge.net/xdai-bridge/xdai-bridge-contracts-management) -* [TokenBridge Docs: Upgrading xDai Bridge Contracts](https://docs.tokenbridge.net/xdai-bridge/xdai-bridge-contracts-management/upgrade-contracts) -* [TokenBridge Docs: Configuring Contracts](https://docs.tokenbridge.net/xdai-bridge/xdai-bridge-contracts-management/configuration) -* [TokenBridge Docs: Admin Privilege Management](https://docs.tokenbridge.net/xdai-bridge/xdai-bridge-contracts-management/admin-privileges-management) -* [TokenBridge Docs: ERC20 Token Release](https://docs.tokenbridge.net/xdai-bridge/xdai-bridge-contracts-management/erc20-tokens-release) -* [TokenBridge Docs: xDai Bridge Management API](https://docs.tokenbridge.net/xdai-bridge/xdai-bridge-contracts-management/xdai-bridge-management-api) +References: + +- [TokenBridge Docs: xDai Contracts Management](https://docs.tokenbridge.net/xdai-bridge/xdai-bridge-contracts-management) +- [TokenBridge Docs: Upgrading xDai Bridge Contracts](https://docs.tokenbridge.net/xdai-bridge/xdai-bridge-contracts-management/upgrade-contracts) +- [TokenBridge Docs: Configuring Contracts](https://docs.tokenbridge.net/xdai-bridge/xdai-bridge-contracts-management/configuration) +- [TokenBridge Docs: Admin Privilege Management](https://docs.tokenbridge.net/xdai-bridge/xdai-bridge-contracts-management/admin-privileges-management) +- [TokenBridge Docs: ERC20 Token Release](https://docs.tokenbridge.net/xdai-bridge/xdai-bridge-contracts-management/erc20-tokens-release) +- [TokenBridge Docs: xDai Bridge Management API](https://docs.tokenbridge.net/xdai-bridge/xdai-bridge-contracts-management/xdai-bridge-management-api) ## Resources + - [Tokenbridge Docs on xDai Bridge](https://docs.tokenbridge.net/xdai-bridge/about) - [xDai Bridge docs](/bridges/tutorials/using-xdai-bridge/) -- [TokenBridge Docs: Migrating Oracle to new Server](https://docs.tokenbridge.net/xdai-bridge/xdai-bridge-oracle-maintenance/oracle-migration-to-a-new-server) \ No newline at end of file +- [TokenBridge Docs: Migrating Oracle to new Server](https://docs.tokenbridge.net/xdai-bridge/xdai-bridge-oracle-maintenance/oracle-migration-to-a-new-server) diff --git a/docs/bridges/tutorials/using-amb.md b/docs/bridges/tutorials/using-amb.md index a4d421c9..eda2e24c 100644 --- a/docs/bridges/tutorials/using-amb.md +++ b/docs/bridges/tutorials/using-amb.md @@ -27,5 +27,5 @@ MetaMask will show a high gas estimate for this transaction. In most cases the f ## Deploying custom ERC-20 Bridge -- [Tokenbridge Docs: Deploying custom token bridge on top of AMB](https://docs.tokenbridge.net/eth-xdai-amb-bridge/multi-token-extension/correspondence-of-bridgeable-tokens) +- [Tokenbridge Docs: Deploying custom token bridge on top of AMB](hhttps://docs.tokenbridge.net/eth-xdai-amb-bridge/erc20-to-erc20-extension-linked-with-a-particular-token/deploy-erc20-erc677-erc827-to-erc677-amb-bridge-extension) - [Tokenbridge Docs: Deplying a custom UI token bridge on top of AMB](https://docs.tokenbridge.net/eth-xdai-amb-bridge/erc20-to-erc20-extension-linked-with-a-particular-token/ui-to-transfer-tokens-through-amb) diff --git a/docs/bridges/tutorials/using-omnibridge/README.md b/docs/bridges/tutorials/using-omnibridge/README.md index 4510104b..6d4c2b90 100644 --- a/docs/bridges/tutorials/using-omnibridge/README.md +++ b/docs/bridges/tutorials/using-omnibridge/README.md @@ -1,132 +1,147 @@ --- title: OmniBridge Basics -description: The Omnibridge can be used to bridge ERC-20 tokens between Ethereum and Gnosis, Binance Smart Chain and Gnosis, and the POA Network and Gnosis. +description: The Omnibridge can be used to bridge ERC-20 tokens between Ethereum and Gnosis, Binance Smart Chain and Gnosis, and the POA Network and Gnosis. keywords: [omnibridge, token bridge, gnosis, bsc, ethereum] --- # OmniBridge + :::info -The OmniBridge and the OmniBridge UI are experimental software in Beta which you use at your own risk. The [OmniBridge UI](https://omni.gnosischain.com/bridge) can be accessed here: https://omni.gnosischain.com/bridge +The OmniBridge and the OmniBridge UI are experimental software in Beta which you use at your own risk. The OmniBridge UI can be accessed here: https://omni.gnosischain.com/bridge ::: -The Omnibridge can be used to bridge ERC-20 tokens between Ethereum and Gnosis, Binance Smart Chain and Gnosis, and the POA Network and Gnosis. The first time a token is bridged, a new ERC677 token contract is deployed on GC with an additional suffix to differentiate the token. It will say "token name on xDai", as this was the original chain name prior to re-branding. If a token has been bridged previously, the previously deployed contract is used. The requested token amount is minted and sent to the account initiating the transfer (or an [alternate receiver](#alternate-receiver) account specified by the sender). -- [Tokenbridge Docs: Using the Omnibridge UI](https://docs.tokenbridge.net/eth-xdai-amb-bridge/multi-token-extension/ui-to-transfer-tokens) +The Omnibridge can be used to bridge ERC-20 tokens between Ethereum and Gnosis. The first time a token is bridged, a new ERC677 token contract is deployed on GC with an additional suffix to differentiate the token. It will say "token name on xDai", as this was the original chain name prior to re-branding. If a token has been bridged previously, the previously deployed contract is used. The requested token amount is minted and sent to the account initiating the transfer (or an alternative receiver account specified by the sender). +- [Tokenbridge Docs: Using the Omnibridge UI](https://docs.tokenbridge.net/eth-xdai-amb-bridge/multi-token-extension/ui-to-transfer-tokens) ## Transfer any ERC-20 token from Ethereum to Gnosis -It is possible to use the OmniBridge UI to transfer any ERC20 from Ethereum to xDai. Any user can initiate this initial transfer. Once the token exists on Gnosis, it can be transferred back and forth using the same UI. + +It is possible to use the OmniBridge UI to transfer any ERC20 from Ethereum to xDai. Any user can initiate this initial transfer. Once the token exists on Gnosis, it can be transferred back and forth using the same UI. + ### Token Transfer + In this example, we transfer the Basic Attention Token (BAT) from Ethereum to xDai. When this process was started, this token does not yet exist on Gnosis. It takes less than 5 minutes and some ETH for gas fees. + 1. Go the the [OmniBridge UI](https://omni.gnosischain.com/bridge) - * Connect your wallet to the Ethereum Mainnet - * Select the token you want to transfer (here we select BAT) and enter the amount - * Click Unlock and approve the account interaction. +- Connect your wallet to the Ethereum Mainnet +- Select the token you want to transfer (here we select BAT) and enter the amount +- Click Unlock and approve the account interaction. :::note These screenshots were taken back when Basic Attention Token (BAT) was first bridged. The steps are the same, but note that the url is old and is now https://omni.gnosischain.com/bridge ::: -![](/img/bridges/omni-tokentransfer1.jpg) -2. Confirm the transaction to approve -![](/img/bridges/omni-tokentransfer2.jpg) -3. Once transaction approval is complete, you can now Transfer BAT to BAT on xDai. Click Transfer. -![](/img/bridges/omni-tokentransfer3.jpg) -4. Press Confirm to approve the transfer and pay the gas fees. These may be expensive depending on network congestion. We recommend [checking current gas prices](https://ethgas.watch/). Because of high fees, it also may make sense to bridge over a larger amount of tokens in a single transaction rather than several smaller ones. -![](/img/bridges/omni-tokentransfer4.jpg) -5. The bridge transaction will begin to process. While you are waiting for block confirmations, you can click on the ALM monitor link to view progress of your transfer, or you can view the [ALM monitor here](https://alm-bridge-monitor.gnosischain.com/) and look up your transaction by the transaction hash. +![](/img/bridges/omni-tokentransfer1.jpg) 2. Confirm the transaction to approve +![](/img/bridges/omni-tokentransfer2.jpg) 3. Once transaction approval is complete, you can now Transfer BAT to BAT on xDai. Click Transfer. +![](/img/bridges/omni-tokentransfer3.jpg) 4. Press Confirm to approve the transfer and pay the gas fees. These may be expensive depending on network congestion. We recommend [checking current gas prices](https://ethgas.watch/). Because of high fees, it also may make sense to bridge over a larger amount of tokens in a single transaction rather than several smaller ones. +![](/img/bridges/omni-tokentransfer4.jpg) 5. The bridge transaction will begin to process. While you are waiting for block confirmations, you can click on the ALM monitor link to view progress of your transfer, or you can view the [ALM monitor here](https://alm-bridge-monitor.gnosischain.com/) and look up your transaction by the transaction hash. ![](/img/bridges/omni-tokentransfer5.jpg) Viewing the ALM app: ![](/img/bridges/omni-tokentransfer6.jpg) :::note Back when BAT was first bridged, only 2/3 confirmations were required. Now the validator set has expanded so 4/7 confirmations are required. -::: -6. After a successful transfer, you can check the token on BlockScout to see that it exists. Check Bridged tokens at https://blockscout.com/xdai/mainnet/bridged-tokens. -![](/img/bridges/omni-tokentransfer7.jpg) -7. Note the contract address and be sure to [add the token to your wallet](https://metamask.zendesk.com/hc/en-us/articles/360015489031-How-to-add-unlisted-tokens-custom-tokens-in-MetaMask#h_01FWH492CHY60HWPC28RW0872H). +::: 6. After a successful transfer, you can check the token on BlockScout to see that it exists. Check Bridged tokens at https://blockscout.com/xdai/mainnet/bridged-tokens. +![](/img/bridges/omni-tokentransfer7.jpg) 7. Note the contract address and be sure to [add the token to your wallet](https://metamask.zendesk.com/hc/en-us/articles/360015489031-How-to-add-unlisted-tokens-custom-tokens-in-MetaMask#h_01FWH492CHY60HWPC28RW0872H). ### Switch Bridges and Networks in the UI + #### Bridges + The OmniBridge UI supports several bridges. To switch chains, click on the Bridge Selector to choose. Once selected, a popup will instruct you to change networks in MetaMask. Click the buttons directly in the popup to complete the process. + 1. Choose from selector -![](/img/bridges/omni-switchnetwork1.png) + ![](/img/bridges/omni-switchnetwork1.png) 2. Click to switch to target network (Binance Smart Chain in the screenshot) -![](/img/bridges/omni-switchnetwork2.png) + ![](/img/bridges/omni-switchnetwork2.png) 3. Click approve to add the network to MetaMask. If you get a warning that the network details don't match, it's likely ok. Be sure to check [chainlist.org](https://chainlist.org/) to verify the network details just in case. -![](/img/bridges/omni-switchnetwork3.png) -4. Click "Switch Network" to allow the site to switch the network. -![](/img/bridges/omni-switchnetwork4.png) -5. UI should display that you are connected to the new chain. Your wallet address will now change from being highlighted red to blue. -![](/img/bridges/omni-switchnetwork5.png) -#### Networks + ![](/img/bridges/omni-switchnetwork3.png) +4. Click "Switch Network" to allow the site to switch the network. + ![](/img/bridges/omni-switchnetwork4.png) +5. UI should display that you are connected to the new chain. Your wallet address will now change from being highlighted red to blue. + ![](/img/bridges/omni-switchnetwork5.png) + +#### Networks + When switching between networks within the same bridge, press the arrows icon in the top middle, then confirm the network switch in MetaMask. ![](/img/bridges/omni-switchnetwork6.png) ## Transfer Tokens without the UI -The instructions below use the Etherscan UI and the Blockscout UI to demonstrate the token transfer process. -There is an [OMNIBRIDGE UI](https://omni.gnosischain.com/bridge) also available which calls the methods of the multi-token mediators contracts described below. + +The instructions below use the Etherscan UI and the Blockscout UI to demonstrate the token transfer process. +There is an [OMNIBRIDGE UI](https://omni.gnosischain.com/bridge) also available which calls the methods of the multi-token mediators contracts described below. ### General Case: ERC-20 Token Transfer + The general case describes a "pure" ERC20 token. For tokens compatible with ERC677 and ERC827 token standards the steps may be simplified - see the [separate section below](#simplification-for-erc677erc827-tokens). + #### Ethereum -> Gnosis Chain + The steps below assume: -* The account performing the actions owns some amount of an ERC20 token on Ethereum. -* The account is funded with some ether to cover gas fees. -* The MetaMask/NiftyWallet must be unlocked and rights to access the account must be granted for Etherscan. -For demonstration purposes we transfer Sai tokens. -![](/img/bridges/omni-erc20manual1.png) -1. __Approve the mediator contract to transfer tokens.__ The mediator contract uses the `transferFrom` functionality of the ERC20 token contract to lock the tokens; it must be explicitly approved to perform this operation. -![](/img/bridges/omni-erc20manual2.png) -First, connect to the Web3 provider (MetaMask or other). Next, click on Write Contract and go to the approve method. Enter the following: -`guy (address)` field: the mediator contract address on Ethereum (`0x88ad09518695c6c3712AC10a214bE5109a655671`) -`wad (uint256)`: the amount of tokens to transfer in wei -![](/img/bridges/omni-erc20manual3.png) -Press the "Write" button to send the transaction. -![](/img/bridges/omni-erc20manual4.png) -The wallet window will appear. Gas price can be adjusted to speed up transaction verification. After the transaction is confirmed in the wallet, it is necessary to wait for verification. Depending on the gas price specified and traffic congestion it can take several seconds to several minutes. -2. __Initiate the transfer request.__ -Copy the contract address before proceeding: -![](/img/bridges/omni-erc20manual5.png) -Next, open the mediator contract ([`0x88ad09518695c6c3712AC10a214bE5109a655671`](https://etherscan.io/address/0x88ad09518695c6c3712AC10a214bE5109a655671)) in Etherscan. -![](/img/bridges/omni-erc20manual6.png) -The mediator contract is a proxy contract; Click contract then click the "Write as Proxy" tab. -![](/img/bridges/omni-erc20manual7.png) -Since you are opening a new contract in Etherscan, you will connect to the Web3 provider (your wallet of choice) again. Then, in the `relayTokens` method enter the token contract address and the amount of tokens to transfer. -![](/img/bridges/omni-erc20manual8.png) -Press the "Write" button to send the transaction. -![](/img/bridges/omni-erc20manual9.png) -The MetaMask/NiftyWallet will appear and the gas price can be adjusted to speed up the transaction verification. Once the transaction is confirmed in MetaMask, wait for confirmation. Depending on the gas price specified and traffic congestion it could take from several seconds to several minutes. -Once the transaction is included in a block, the Arbitrary Message Bridge validators will wait for 8 additional blocks. Then, they will send confirmations to Gnosis chain to invoke the multi-token mediator contract and complete the tokens transfer. -You can monitor the confirmation and AMB request execution with the [AMB Live Monitoring tool](https://alm-bridge-monitor.gnosischain.com/). Specify the hash (tx id) of the transaction used to call `relayTokens` in the ALM entry page to check the status of the AMB request initiated by this transaction in real time. If the AMB request is executed successfully: - * __If token has not been transferred with AMB before:__ If this is the first transaction for this particular token using the AMB, a new ERC677 token contract will be deployed to Gnosis. The token contract will be initialized with the same symbol and decimals as for the original token on Ethereum. The name of the new token will be extended with the letters "on xDai" (e.g. "Dai Stablecoin v1.0 on xDai"). At the end, the requested amount of tokens will be minted and sent to the account that called `relayTokens`. - * __If token has been previously transferred with AMB:__ If If the ERC677 token has already been registered by the mediator for the original ERC20 token, deployment of the contract will be skipped but the requested amount of tokens will be minted and sent to the account that called `relayTokens`. -Once the process is complete and indexed by BlockScout, it is possible to find the token contract on Gnosis Chain. Check out the [Bridged token registry](https://blockscout.com/xdai/mainnet/bridged-tokens) to view it. + +- The account performing the actions owns some amount of an ERC20 token on Ethereum. +- The account is funded with some ether to cover gas fees. +- The MetaMask/NiftyWallet must be unlocked and rights to access the account must be granted for Etherscan. + For demonstration purposes we transfer Sai tokens. + ![](/img/bridges/omni-erc20manual1.png) + +1. **Approve the mediator contract to transfer tokens.** The mediator contract uses the `transferFrom` functionality of the ERC20 token contract to lock the tokens; it must be explicitly approved to perform this operation. + ![](/img/bridges/omni-erc20manual2.png) + First, connect to the Web3 provider (MetaMask or other). Next, click on Write Contract and go to the approve method. Enter the following: + `guy (address)` field: the mediator contract address on Ethereum (`0x88ad09518695c6c3712AC10a214bE5109a655671`) + `wad (uint256)`: the amount of tokens to transfer in wei + ![](/img/bridges/omni-erc20manual3.png) + Press the "Write" button to send the transaction. + ![](/img/bridges/omni-erc20manual4.png) + The wallet window will appear. Gas price can be adjusted to speed up transaction verification. After the transaction is confirmed in the wallet, it is necessary to wait for verification. Depending on the gas price specified and traffic congestion it can take several seconds to several minutes. +2. **Initiate the transfer request.** + Copy the contract address before proceeding: + ![](/img/bridges/omni-erc20manual5.png) + Next, open the mediator contract ([`0x88ad09518695c6c3712AC10a214bE5109a655671`](https://etherscan.io/address/0x88ad09518695c6c3712AC10a214bE5109a655671)) in Etherscan. + ![](/img/bridges/omni-erc20manual6.png) + The mediator contract is a proxy contract; Click contract then click the "Write as Proxy" tab. + ![](/img/bridges/omni-erc20manual7.png) + Since you are opening a new contract in Etherscan, you will connect to the Web3 provider (your wallet of choice) again. Then, in the `relayTokens` method enter the token contract address and the amount of tokens to transfer. + ![](/img/bridges/omni-erc20manual8.png) + Press the "Write" button to send the transaction. + ![](/img/bridges/omni-erc20manual9.png) + The MetaMask/NiftyWallet will appear and the gas price can be adjusted to speed up the transaction verification. Once the transaction is confirmed in MetaMask, wait for confirmation. Depending on the gas price specified and traffic congestion it could take from several seconds to several minutes. + Once the transaction is included in a block, the Arbitrary Message Bridge validators will wait for 8 additional blocks. Then, they will send confirmations to Gnosis chain to invoke the multi-token mediator contract and complete the tokens transfer. + You can monitor the confirmation and AMB request execution with the [AMB Live Monitoring tool](https://alm-bridge-monitor.gnosischain.com/). Specify the hash (tx id) of the transaction used to call `relayTokens` in the ALM entry page to check the status of the AMB request initiated by this transaction in real time. If the AMB request is executed successfully: + +- **If token has not been transferred with AMB before:** If this is the first transaction for this particular token using the AMB, a new ERC677 token contract will be deployed to Gnosis. The token contract will be initialized with the same symbol and decimals as for the original token on Ethereum. The name of the new token will be extended with the letters "on xDai" (e.g. "Dai Stablecoin v1.0 on xDai"). At the end, the requested amount of tokens will be minted and sent to the account that called `relayTokens`. +- **If token has been previously transferred with AMB:** If If the ERC677 token has already been registered by the mediator for the original ERC20 token, deployment of the contract will be skipped but the requested amount of tokens will be minted and sent to the account that called `relayTokens`. + Once the process is complete and indexed by BlockScout, it is possible to find the token contract on Gnosis Chain. Check out the [Bridged token registry](https://blockscout.com/xdai/mainnet/bridged-tokens) to view it. + #### Gnosis -> Ethereum + The steps below assume that the account performing the actions is funded with some xDai to cover gas fees. Also, the MetaMask/NiftyWallet must be unlocked and rights to access the account must be granted for BlockScout. :::info -Make sure that the token contract is verified in BlockScout. Token contracts deployed as part of the multi-token mediator operations are not verified automatically, so if the token does not allow read and write in the block explorer, [follow the steps](#verifying-a-canonical-bridged-token-on-blockscout) to verify the contract before starting. +Make sure that the token contract is verified in BlockScout. Token contracts deployed as part of the multi-token mediator operations are not verified automatically, so if the token does not allow read and write in the block explorer, [follow the steps](hhttps://docs.blockscout.com/for-users/verifying-a-smart-contract) to verify the contract before starting. ::: -1. __Call the transferAndCall method to transfer tokens__ -The token contract deployed by the mutli-token mediator supports the ERC677 standard, so instead of calling `approve` and `relayTokens`, a single method `transferAndCall` can be used to transfer tokens to the mediator contract and notify it regarding this action at the same time. -Go to the "Write Proxy" tab of the token contract in BlockScout -![](/img/bridges/omni-gno-eth-manual1.png) -In the transferAndCall method enter the multi-token mediator contract address on Gnosis chain (`0xf6A78083ca3e2a662D6dd1703c939c8aCE2e268d`), amount of tokens to transfer, and "0x" in the _data field. Press Write to send the transaction. -![](/img/bridges/omni-gno-eth-manual2.png) -The MetaMask window will appear. Gas price should be 1 GWei, adjust if needed. Once the transaction is confirmed in MetaMask, wait for verification by the Gnosis chain validators. This is typically completed in a few seconds. -Once the transaction is included in a block, the Arbitrary Message Bridge validators will wait for one more block. After that, they will collect confirmations on Gnosis chain and transfer them to Ethereum. The transaction sent by a validator to Ethereum will execute the request to unlock the tokens. -You can monitor this process using the [AMB Live Monitoring tool](https://alm-bridge-monitor.gnosischain.com/). Specify the hash (tx id) of the transaction used to call transferAndCall in the ALM entry page and it will check the status of the AMB request initiated by this transaction in real time. The requested amount of tokens minus any fees will be unlocked on Ethereum. +1. **Call the transferAndCall method to transfer tokens** + The token contract deployed by the mutli-token mediator supports the ERC677 standard, so instead of calling `approve` and `relayTokens`, a single method `transferAndCall` can be used to transfer tokens to the mediator contract and notify it regarding this action at the same time. + Go to the "Write Proxy" tab of the token contract in BlockScout + ![](/img/bridges/omni-gno-eth-manual1.png) + In the transferAndCall method enter the multi-token mediator contract address on Gnosis chain (`0xf6A78083ca3e2a662D6dd1703c939c8aCE2e268d`), amount of tokens to transfer, and "0x" in the \_data field. Press Write to send the transaction. + ![](/img/bridges/omni-gno-eth-manual2.png) + The MetaMask window will appear. Gas price should be 1 GWei, adjust if needed. Once the transaction is confirmed in MetaMask, wait for verification by the Gnosis chain validators. This is typically completed in a few seconds. + Once the transaction is included in a block, the Arbitrary Message Bridge validators will wait for one more block. After that, they will collect confirmations on Gnosis chain and transfer them to Ethereum. The transaction sent by a validator to Ethereum will execute the request to unlock the tokens. + You can monitor this process using the [AMB Live Monitoring tool](https://alm-bridge-monitor.gnosischain.com/). Specify the hash (tx id) of the transaction used to call transferAndCall in the ALM entry page and it will check the status of the AMB request initiated by this transaction in real time. The requested amount of tokens minus any fees will be unlocked on Ethereum. #### Simplification for ERC677/ERC827 tokens + If the token on Ethereum is ERC677 or ERC827 compatible it is possible to omit the approve method call and only call the `transferAndCall` method in the token contract. :::note -This example uses the STAKE token, [whose utility will be depreciated after the merge](https://forum.gnosis.io/t/gip-16-gnosis-chain-xdai-gnosis-merge/1904). However, the token will still exist and these steps are still relevant. +This example uses the STAKE token, [whose utility will be depreciated after the merge of xDAI/Gnosis](https://forum.gnosis.io/t/gip-16-gnosis-chain-xdai-gnosis-merge/1904). However, the token will still exist and these steps are still relevant. ::: Below is example with the STAKE token contract: ![](/img/bridges/omni-erc677-simplification1.png) Click Write Contract and specify the multi-token mediator contract address on Ethereum (0x88ad09518695c6c3712AC10a214bE5109a655671) as the recipient of the tokens, the amount of tokens in wei the "value" field, and `0x` in the "data" field. Click Write to execute. -![](/img/bridges/omni-erc677-simplification2.png) +![](/img/bridges/omni-erc677-simplification2.png) #### Simplification for token transfers from the Gnosis Chain side + :::danger Do Not Use the `transfer` method to send tokens to the multi-token mediator on Ethereum. It will lead to loss of tokens. ::: @@ -136,10 +151,11 @@ The token contact deployed on Gnosis Chain is a customized version of ERC677 sta The method described above works only for tokens deployed by the multi-token mediator on Gnosis chain. ::: - ## Bridging Tokens Minted on Gnosis -Tokens minted natively on xDai are now available to bridge to other destination chains, including Ethereum, BSC and POA. Note that you will need to pay gas costs for the destination chain (which can be quite high for Ethereum) with the destination currency (such as ETH or BSC) when bridging. + +Tokens minted natively on Gnosis Chain are now available to bridge to Ethereum. Note that you will need to pay gas costs for the destination chain (which can be quite high for Ethereum) with the destination currency (such as ether) when bridging. Bridging requires 2 steps: + 1. Unlock the Token (allow the application to transfer) -2. Request the Transfer (requires 2 transactions, 1 from sending chain and a second on destination chain to claim) -Please see the [previous section on bridging from Gnosis to Ethereum](#gnosis---ethereum) for specific instructions, as the steps are the same. +2. Request the Transfer (requires 2 transactions, 1 from sending chain and the 2nd on destination chain to claim) + Please see the [previous section on bridging from Gnosis to Ethereum](#gnosis---ethereum) for specific instructions, as the steps are the same. diff --git a/docs/bridges/tutorials/using-omnibridge/advanced.md b/docs/bridges/tutorials/using-omnibridge/advanced.md index 67200fe2..49f305ce 100644 --- a/docs/bridges/tutorials/using-omnibridge/advanced.md +++ b/docs/bridges/tutorials/using-omnibridge/advanced.md @@ -1,65 +1,50 @@ --- title: Advanced description: Advanced operations to bridge between Gnosis and other chains -keywords: [alternate receiver, custom rpc endpoints, bridge, omnibridge ui, safe] +keywords: + [alternate receiver, custom rpc endpoints, bridge, omnibridge ui, safe] --- # Advanced + ## Alternate Receiver + The default bridge mode sends funds to the same address across chains, as the same algorithm is used to derive an address from a private key across the chains where the OmniBridge is deployed. However, it is easy to specify another address to receive funds on the chain you are bridging to. This may be desirable when sending funds from a multi-sig wallet (like Gnosis Safe), or as a transfer method to another address on a secondary chain. + ### Set and Alternate Receiver + 1. Click on the "Advanced" link on the Omnibridge UI. A text field will appear. 2. Paste the `0x...` address you are transferring funds to on the receiving chain. 3. Proceed with the Request -![](/img/bridges/omni-alternate-receiver.gif) - + ![](/img/bridges/omni-alternate-receiver.gif) + :::info Claims on the receiving chain can be completed using any address with enough funds. Copy the tx hash from the first transaction (it will be linked during tx processing or when complete in the history tab of the bridge. You can also find in your MetaMask wallet) and paste into https://alm-bridge-monitor.gnosischain.com/ to search and execute. ::: - ## Set Custom RPC Endpoints + If you are experiencing an issue with an Ethereum or Gnosis Chain RPC endpoint when trying to bridge you can easily set your own endpoint in the interface. Note that these are Read Only, if you need to use the RPCs to process transactions, you can [set custom RPCs in your web3 wallet like MetaMask](https://metamask.zendesk.com/hc/en-us/articles/360043227612-How-to-add-a-custom-Network-RPC-and-or-Block-Explorer) as well. + ### RPC Endpoints: -* [Gnosis RPC's](/tools/rpc/) -* [Ethereum Default RPC's](https://mainnet.infura.io/), [Alternate Ethereum RPC's](https://ethereumnodes.com/) -1. Go to [the bridge UI](https://omni.gnosischain.com/bridge) and click settings at the top. -2. Add your RPC of choice and click __Save__. Note that the URL options change based off which networks you have selected to bridge between. -![](/img/bridges/omni-custom-rpc1.png) +- [Gnosis RPC's](/tools/rpc/) +- [Ethereum RPC's](https://www.alchemy.com/list-of/rpc-node-providers-on-ethereum) + +1. Go to [the bridge UI](https://omni.gnosischain.com/bridge) and click settings at the top. +2. Add your RPC of choice and click **Save**. Note that the URL options change based off which networks you have selected to bridge between. + ![](/img/bridges/omni-custom-rpc1.png) ## Infinite Unlock + You must give approval to the bridge contracts to access and send ERC-20 tokens. This is similar to Uniswap or another DEX that asks for approval to spend your tokens. You can give this permission on a per transaction basis, or you can unlock an unlimited amount to transfer with the infinite unlock option. Infinite unlock saves on transaction fees, but does introduce security risk if the contract is compromised. If compromised, a malicious 3rd party may have the ability to access all funds rather than a finite approved amount. ### Set Infinite Unlock + 1. Go to Settings on the top of the page -2. Toggle "Infinite Unlock" and click __Save__. When you process your next unlock, the transaction will allow all transfers of that token without needing to unlock again. -![](/img/bridges/omni-infinite-unlock1.png) +2. Toggle "Infinite Unlock" and click **Save**. When you process your next unlock, the transaction will allow all transfers of that token without needing to unlock again. + ![](/img/bridges/omni-infinite-unlock1.png) 3. If you don't wish to use infinite unlock but would like te instead set a custom limit, when the MetaMask window pops up to ask for approval you have the option to set a spend limit. Click "Edit Permission" and it will take you to the following screen: -![](/img/bridges/omni-custom-limit.png) - - -## Using Omnibridge with Gnosis Safe -OmniBridge is compatible with the Gnosis Safe apps interface, allowing for bridge interaction and ERC20 transfers between xDai and Ethereum using a Multisig Wallet. The following instructions are for bridging ERC20s between Ethereum and Gnosis. To transfer xDai to Dai and vice versa, see the [xDai Bridge + Gnosis Safe instructions](../using-xdai-bridge). -:::danger -Each Gnosis Safe is deployed independently on Gnosis chain and/or Ethereum. Cross-chain safes do not share the same contract addresses (even when they have the same owners etc), so it is important to use the Alternate Recipient Address feature when bridging with a safe. -::: -### Add the App -1. Go to your Gnosis Safe and login and connect as you normally would -* [Gnosis Safe on Gnosis Chain](https://gnosis-safe.io/app/gno) -* [Gnosis Safe on Ethereum](https://gnosis-safe.io/app/) -2. Go to Apps -> Add Custom App, and add the app url https://omni.gnosischain.com/ . The App name should populate as OmniBridge -![](/img/bridges/omni-gnosis-safe1.png) -3. Agree to the terms and click "Add". The app will now be added to the interface. - -### Bridge App on Receiving Chain: Claiming a Bridge Transaction -In this example, we sent STAKE from xDai to a Gnosis Safe address on Ethereum. To claim this transaction, login to Gnosis Safe on Ethereum and open the OmniBridge Application (you may need to add it using the [steps above](#add-the-app) if you have not added previously) -1. You should see the claim screen, click the __Claim__ button to begin the process. If you do not see this screen, click on __History__ at the top of the OmniBridge app. -![](/img/bridges/omni-gnosis-safe2.png) -2. Click the __Claim__ button -![](/img/bridges/omni-gnosis-safe3.png) -3. All required owners must confirm the transaction before it is processed. Once completed, the funds will be added to the safe. -![](/img/bridges/omni-gnosis-safe4.png) - + ![](/img/bridges/omni-custom-limit.png) diff --git a/docs/bridges/tutorials/using-omnibridge/debugging-omnibridge-txns.md b/docs/bridges/tutorials/using-omnibridge/debugging-omnibridge-txns.md index eb3bf0a9..a3789237 100644 --- a/docs/bridges/tutorials/using-omnibridge/debugging-omnibridge-txns.md +++ b/docs/bridges/tutorials/using-omnibridge/debugging-omnibridge-txns.md @@ -5,17 +5,21 @@ keywords: [amb debug, developer, debugging transactions, bridge transactions] --- # Debugging OmniBridge Transactions + :::info This page is mostly for application developers, if you sent tokens through the OmniBridge and would like to get the status whether the tokens were sent successfully or not, please use [AMB Live Monitoring application](https://alm-bridge-monitor.gnosischain.com/) instead. ::: -Firstly, the [Foreign Arbitrary Message Bridge contract](https://etherscan.io/address/0x4C36d2919e407f0Cc2Ee3c993ccF8ac26d9CE64e) which is used by the OmniBridge, emits the `UserRequestForAffirmation` event as part of the a deposit request made by user (on the Ethereum side). +Firstly, the [Foreign Arbitrary Message Bridge contract](https://etherscan.io/address/0x4C36d2919e407f0Cc2Ee3c993ccF8ac26d9CE64e) which is used by the OmniBridge, emits the `UserRequestForAffirmation` event as part of the a deposit request made by user (on the Ethereum side). + ``` event UserRequestForAffirmation(bytes32 indexed messageId, bytes encodedData); -``` +``` + For example, [this is the event in the OmniBridge transaction](https://etherscan.io/tx/0x804a4b28520faad8b68d122cafdffedd2e185a9aa734b69f264a652d5c53afa4#eventlog), and the topic `0x482515ce3d9494a37ce83f18b72b363449458435fafdd7a53ddea7460fe01b58` ![](/img/bridges/omni-debugging1.png) In the event definition and from the example, the Id of the AMB message is trackable as part of the event. The event from the example shows the message Id: `0x000500004ac82b41bd819dd871590b510316f2385cb196fb0000000000000402`. -On the other side of the bridge, if the message was executed successfully the [AMB contract](https://blockscout.com/xdai/mainnet/address/0x75Df5AF045d91108662D8080fD1FEFAd6aA0bb59/logs#address-tabs) emits the `AffirmationCompleted` event. +On the other side of the bridge, if the message was executed successfully the [AMB contract](https://gnosis.blockscout.com/address/0x75Df5AF045d91108662D8080fD1FEFAd6aA0bb59) emits the `AffirmationCompleted` event. + ``` event AffirmationCompleted( address indexed sender, @@ -24,15 +28,19 @@ event AffirmationCompleted( bool status ); ``` + Here is [the event corresponding to the example](https://blockscout.com/xdai/mainnet/tx/0x092f1c8a02f305e5bfb671b923710cdd150c5b0e41df048c75b790538a25025b/logs) -![](/img/bridges/omni-debugging2.png) +![](/img/bridges/omni-debugging2.png) The topic of the event is `0xe194ef610f9150a2db4110b3db5116fd623175dca3528d7ae7046a1042f84fe7`. And the message Id is represented as a separate topic in the event. That's why it is possible to use different ways to filter out the corresponding transaction if the message Id of the OmniBridge deposit is known (it always can be received from the deposit transaction). -For example, you can use the BlockScout API for this: https://blockscout.com/xdai/mainnet/api-docs. Example of the request to the BlockScout: +For example, you can use the BlockScout API for this: https://docs.blockscout.com/for-users/api/rpc-endpoints. Example of the request to the BlockScout: + ``` -https://blockscout.com/xdai/mainnet/api?module=logs&action=getLogs&fromBlock=1&toBlock=latest&address=0x75Df5AF045d91108662D8080fD1FEFAd6aA0bb59&topic0=0xe194ef610f9150a2db4110b3db5116fd623175dca3528d7ae7046a1042f84fe7&topic3=0x000500004ac82b41bd819dd871590b510316f2385cb196fb0000000000000402&topic0_3_opr=and +https://gnosis.blockscout.com/api?module=logs&action=getLogs&fromBlock=1&toBlock=latest&address=0x75Df5AF045d91108662D8080fD1FEFAd6aA0bb59&topic0=0xe194ef610f9150a2db4110b3db5116fd623175dca3528d7ae7046a1042f84fe7&topic3=0x000500004ac82b41bd819dd871590b510316f2385cb196fb0000000000000402&topic0_3_opr=and ``` + It will return the JSON with the transaction hash correlated to the emission of the event `AffirmationCompleted` with the message Id: + ``` { "message": "OK", @@ -57,4 +65,4 @@ It will return the JSON with the transaction hash correlated to the emission of ], "status": "1" } -``` \ No newline at end of file +``` diff --git a/docs/bridges/tutorials/using-omnibridge/safe.md b/docs/bridges/tutorials/using-omnibridge/safe.md index 9fd05008..85da43d4 100644 --- a/docs/bridges/tutorials/using-omnibridge/safe.md +++ b/docs/bridges/tutorials/using-omnibridge/safe.md @@ -6,7 +6,7 @@ keywords: [safe app, bridge safe, gnosis safe app] # OmniBridge with Safe App -OmniBridge is compatible with the Gnosis Safe apps interface, allowing for bridge interaction and ERC20 transfers between xDai and Ethereum using a Multisig Wallet. The following instructions are for bridging **ERC20s between Ethereum and Gnosis**. To transfer xDai to Dai and vice versa, see the [xDai Bridge + Gnosis Safe](../using-xdai-bridge/safe.md) instructions. +OmniBridge is compatible with the Gnosis Safe apps interface, allowing for bridge interaction and ERC20 transfers between Gnosis Chain and Ethereum using a Multisig Wallet. The following instructions are for bridging **ERC20s between Ethereum and Gnosis**. To transfer xDai to Dai and vice versa, see the [xDai Bridge + Gnosis Safe](../using-xdai-bridge/safe.md) instructions. :::warning Each Gnosis Safe is deployed independently on Gnosis and/or Ethereum. Cross-chain safes do not share the same contract addresses (even when they have the same owners etc), so it is **important to use the Alternate Recipient Address feature** when bridging with a safe. @@ -16,8 +16,8 @@ Each Gnosis Safe is deployed independently on Gnosis and/or Ethereum. Cross-chai 1. Go to your Gnosis Safe and login and connect as you normally would. -* Gnosis Safe on Ethereum/Gnosis: [https://gnosis-safe.io/app/](https://gnosis-safe.io/app/) -Select corresponding network on top right corner. +- Gnosis Safe on Ethereum/Gnosis: [https://gnosis-safe.io/app/](https://gnosis-safe.io/app/) + Select corresponding network on top right corner. 2. Go to Apps -> Add Custom App @@ -33,7 +33,7 @@ Select corresponding network on top right corner. ## Bridge App on Origin Chain: Initiating a Transaction -5. Open the application and interact with the bridge as you normally would to begin the transfer process. **** In this example we bridge from xDai to Ethereum. +5. Open the application and interact with the bridge as you normally would to begin the transfer process. \*\*\*\* In this example we bridge from xDai to Ethereum. :::warning Note that when bridging with a safe you will set an alternate receiver. This may be a 2nd safe contract on the receiving chain or an individual address to receive the funds. **If you bridge without setting a Recipient Address, your funds may be lost.** @@ -66,4 +66,3 @@ In this example, we sent STAKE from xDai to a Gnosis Safe address on Ethereum. T 9. All required owners must confirm the transaction before it is processed. Once completed, the funds are added to the Safe. ![](/img/bridges/omnibridge/omni-3.png) - diff --git a/docs/bridges/tutorials/using-omnibridge/specific-tokens.md b/docs/bridges/tutorials/using-omnibridge/specific-tokens.md index e3788e79..fa9488a8 100644 --- a/docs/bridges/tutorials/using-omnibridge/specific-tokens.md +++ b/docs/bridges/tutorials/using-omnibridge/specific-tokens.md @@ -4,68 +4,74 @@ title: Specific Tokens # Specific Tokens -In some cases it is convenient to use ETH, the native token for the Ethereum Mainnet, in the form of a wrapped ERC20 token. This allows to unify interfaces for operations with assets. The recent Wrapped ETH token contract is [WETH9](https://etherscan.io/address/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2). +In some cases it is convenient to use ETH, the native token for the Ethereum Mainnet, in the form of a wrapped ERC20 token. This allows to unify interfaces for operations with assets. The recent Wrapped ETH token contract is [WETH9](https://etherscan.io/address/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2). When the ETH-Gnosis OmniBridge first started, wrapped ETH was bridged to the Gnosis chain in form of ERC677 token: Wrapped ETH on xDai. Although the bridged token can be transferred back to ETH, it is still be in form of the ERC20 token, and it cannot be used in transactions to pay for gas fees. In this case, if a user has no ETH, it is impossible for them to unwrap these ETH tokens. This set of instructions demonstrates how the Wrapped ETH can be bridged from Gnosis chain directly to ETH tokens using a new `relay-and-call` feature implemented in the OmniBridge contracts. In the last part of this guide there is also an instruction on how to transfer ETH to WETH on Gnosis chain using a single operation. This may not be used often but some users may find it handy. -This instruction assumes that you have access to BlockScout and Etherscan. You also must have a bit of xDai to pay for gas fees for a bridge transaction on Gnosis chain. +This instruction assumes that you have access to BlockScout and Etherscan. You also must have a bit of xDai to pay for gas fees for a bridge transaction on Gnosis chain. -In the second part of the tutorial, you will learn how to bridge GNO between Goerli and Chiado testnet. You are required to have some xDAI on Chiado and ETH on Goerli to complete the transaction. +In the second part of the tutorial, you will learn how to bridge GNO between Goerli and Chiado testnet. You are required to have some xDAI on Chiado and ETH on Goerli to complete the transaction. ## Bridge wEth on Gnosis to Native Eth on Ethereum + 1. Change the chain to Gnosis in MetaMask -2. Find the wEth token in [BlockScout](https://blockscout.com/xdai/mainnet/token/0x6A023CCd1ff6F2045C3309768eAd9E68F978f6e1/token-transfers/), and go to the [Write Proxy](https://blockscout.com/xdai/mainnet/token/0x6A023CCd1ff6F2045C3309768eAd9E68F978f6e1/write-proxy) tab. -![](/img/bridges/omni-bridge-to-native-eth1.png) -3. Scroll to the `transferAndCall` method: -![](/img/bridges/omni-bridge-to-native-eth2.png) +2. Find the wEth token in BlockScout, and go to the [Write Proxy](https://gnosis.blockscout.com/address/0x6A023CCd1ff6F2045C3309768eAd9E68F978f6e1?tab=write_proxy) tab. + ![](/img/bridges/omni-bridge-to-native-eth1.png) +3. Scroll to the `transferAndCall` method: + ![](/img/bridges/omni-bridge-to-native-eth2.png) 4. Enter the following information as parameters to call the method: -* `_to`(address): `0xf6A78083ca3e2a662D6dd1703c939c8aCE2e268d` . This is sthe address of the OmniBridge contract on Gnosis. -* `_value`(uint256): amount of wETH to be bridged (bridge fees wikll be subtracted from this value). -* `_data`(bytes): the concatenation of the following: - * the address of the wETH OmniBridge helper contract on the Ethereum Mainnet (`0xa6439Ca0FCbA1d0F80df0bE6A17220feD9c9038a`) - * he address of the ETH recipient without the leading `0x` - For example, for the recipient `0xbf3d6f830ce263cae987193982192cd990442b53`, the value in `_data` field is `0xa6439ca0fcba1d0f80df0be6a17220fed9c9038abf3d6f830ce263cae987193982192cd990442b53` -Click __Write__ to send the transaction. + +- `_to`(address): `0xf6A78083ca3e2a662D6dd1703c939c8aCE2e268d` . This is sthe address of the OmniBridge contract on Gnosis. +- `_value`(uint256): amount of wETH to be bridged (bridge fees wikll be subtracted from this value). +- `_data`(bytes): the concatenation of the following: +- the address of the wETH OmniBridge helper contract on the Ethereum Mainnet (`0xa6439Ca0FCbA1d0F80df0bE6A17220feD9c9038a`) +- the address of the ETH recipient without the leading `0x` + For example, for the recipient `0xbf3d6f830ce263cae987193982192cd990442b53`, the value in `_data` field is `0xa6439ca0fcba1d0f80df0be6a17220fed9c9038abf3d6f830ce263cae987193982192cd990442b53` + Click **Write** to send the transaction. + 5. When the transaction is included in the block, click on the transaction link to get the transaction details -![](/img/bridges/omni-bridge-to-native-eth3.png) -6. Use the "View in ALM App" link on the page with transaction details, or use the transaction hash and go the the [ALM site](https://alm-bridge-monitor.gnosischain.com/) and enter it manually to track status of the transfer and finalize bridge operations if required. -![](/img/bridges/omni-bridge-to-native-eth4.png) + ![](/img/bridges/omni-bridge-to-native-eth3.png) +6. Use the "View in ALM App" link on the page with transaction details, or use the transaction hash and go the the [ALM site](https://alm-bridge-monitor.gnosischain.com/) and enter it manually to track status of the transfer and finalize bridge operations if required. + ![](/img/bridges/omni-bridge-to-native-eth4.png) 7. Eventually, when an executing transaction on the Mainnet is processed, the WETH will be unlocked and unwrapped to ETH native tokens: -![](/img/bridges/omni-bridge-to-native-eth5.png) + ![](/img/bridges/omni-bridge-to-native-eth5.png) --- ## Bridge Eth to Gnosis Chain + 1. Visit the WETH OmniBridge helper contract on [Etherscan](https://etherscan.io/address/0xa6439ca0fcba1d0f80df0be6a17220fed9c9038a#writeContract) and connect your wallet. 2. Scroll to the `wrapAndRelayTokens` method and enter the amount of ETH to bridge to Gnosis chain: -![](/img/bridges/omni-bridge-from-native-eth1.png) -Click __Write__ to send the transaction + ![](/img/bridges/omni-bridge-from-native-eth1.png) + Click **Write** to send the transaction 3. When the transaction is included in the block, press the "View you transaction" button to get the transaction hash which can be used in the [AMB Live Monitoring app](https://alm-bridge-monitor.gnosischain.com/) to track the status of the transaction. - --- - + ## GNO: Goerli -> Chiado Bridging GNO from Goerli to Chiado requires 2 txs. #### Transaction 1 -Allow Foreign OmniBridge Mediator to transfer GNOs, by calling approve() on GNO contract. -**[Called Function](https://goerli.etherscan.io/address/0x7f477c3F03213970d939104CC436Dc995CF615b5)**: `GNO.approve(address Foreign OmniBridge Mediator, uint256 amount)` -**[Transaction Parameter Example](https://docs.metamask.io/guide/sending-transactions.html)**: +Allow Foreign OmniBridge Mediator to transfer GNOs, by calling approve() on GNO contract. + +**[Called Function](https://goerli.etherscan.io/address/0x7f477c3F03213970d939104CC436Dc995CF615b5)**: `GNO.approve(address Foreign OmniBridge Mediator, uint256 amount)` +**[Transaction Parameter Example](https://docs.metamask.io/guide/sending-transactions.html)**: + ``` to: 0x7f477c3F03213970d939104CC436Dc995CF615b5 (GNO on Goerli) value: 0 data: 0x095ea7b300000000000000000000000000147c84f13764dcdabaf1cbae622fa6f683908500000000000000000000000000000000000000000000d3c21bcecceda1000000 ``` - #### Transaction 2 -Relay GNO tokens from Foreign Omnibridge Mediator. -**[Called Function](https://goerli.etherscan.io/address/0x00147c84f13764dcdabaf1cbae622fa6f6839085)**: `Foreign_OmniBridge_Mediator.relayTokens(address _receiver, uint256 _value)` -**[Transaction Parameter Example](https://docs.metamask.io/guide/sending-transactions.html)**: +Relay GNO tokens from Foreign Omnibridge Mediator. + +**[Called Function](https://goerli.etherscan.io/address/0x00147c84f13764dcdabaf1cbae622fa6f6839085)**: `Foreign_OmniBridge_Mediator.relayTokens(address _receiver, uint256 _value)` +**[Transaction Parameter Example](https://docs.metamask.io/guide/sending-transactions.html)**: + ``` to: 0x00147c84f13764dcdabaf1cbae622fa6f6839085 (Foreign OmniBridge Mediator) value: 0 @@ -80,11 +86,13 @@ After a few minutes the exact amount of relayed tokens will be available on Chia Bridging GNO from Chiado to Goerli also requires 2 txs. - #### Transaction 1 - Allow Home OmniBridge Mediator to transfer GNOs. +#### Transaction 1 + +Allow Home OmniBridge Mediator to transfer GNOs. + +**[Called Function](https://blockscout.com/gnosis/chiado/address/0x19C653Da7c37c66208fbfbE8908A5051B57b4C70)**: `GNO.approve(address Home OmniBridge Mediator, uint256 amount)` + **[Transaction Parameter Example](https://docs.metamask.io/guide/sending-transactions.html)**: - **[Called Function](https://blockscout.com/gnosis/chiado/address/0x19C653Da7c37c66208fbfbE8908A5051B57b4C70)**: `GNO.approve(address Home OmniBridge Mediator, uint256 amount)` - **[Transaction Parameter Example](https://docs.metamask.io/guide/sending-transactions.html)**: ``` to: 0x19C653Da7c37c66208fbfbE8908A5051B57b4C70 (GNO on Chiado) value: 0 @@ -92,14 +100,16 @@ data: 0x095ea7b300000000000000000000000009d549a48ac52f3f9945e7de6402c609c92aa2e1 ``` #### Transaction 2 -Relay GNO tokens from Home Omnibridge Mediator. -**[Called Function](https://blockscout.com/gnosis/chiado/address/0x09D549a48AC52F3f9945E7de6402c609c92aa2E1)**: `Home_OmniBridge_Mediator.relayTokens(address _receiver, uint256 _value)` - **[Transaction Parameter Example](https://docs.metamask.io/guide/sending-transactions.html)**: +Relay GNO tokens from Home Omnibridge Mediator. + +**[Called Function](https://blockscout.com/gnosis/chiado/address/0x09D549a48AC52F3f9945E7de6402c609c92aa2E1)**: `Home_OmniBridge_Mediator.relayTokens(address _receiver, uint256 _value)` + **[Transaction Parameter Example](https://docs.metamask.io/guide/sending-transactions.html)**: + ``` to: 0x09D549a48AC52F3f9945E7de6402c609c92aa2E1 (Home OmniBridge Mediator) value: 0 data: 0x01e4f53a00000000000000000000000019C653Da7c37c66208fbfbE8908A5051B57b4C700000000000000000000000000000000000000000000000000de0b6b3a7640000 ``` -After a few minutes the exact amount of relayed tokens will be available on Goerli side. \ No newline at end of file +After a few minutes the exact amount of relayed tokens will be available on Goerli side. diff --git a/docs/bridges/tutorials/using-omnibridge/token-registry.md b/docs/bridges/tutorials/using-omnibridge/token-registry.md index 09d601d9..c7f3ea23 100644 --- a/docs/bridges/tutorials/using-omnibridge/token-registry.md +++ b/docs/bridges/tutorials/using-omnibridge/token-registry.md @@ -3,231 +3,236 @@ title: Token Registry description: Discover the token contract on the Ethereum Mainnet that corresponds to the token contract on Gnosis chain. keywords: [token registry, bridged tokens, canonical token, gnosis bridge] --- + # Token Registry ## Getting corresponding Token Address + There are several approaches to discover the token contract on the Ethereum Mainnet that corresponds to the token contract on Gnosis chain. -### __Approach 1: BlockScout__ + +### **Approach 1: BlockScout** + BlockScout allows you to see if a token was bridged using the multi-token extension. First, search the token and go it's contract page: ![](/img/bridges/omni-bridged-tokens1.png) This view contains information that this token was bridged and a link to the original token. ![](/img/bridges/omni-bridged-tokens2.png) -If you go to the top bar, you will notice that the token dropdown allows you to filter between tokens based off where they were bridged from: +If you go to the top bar, you will notice that the token dropdown allows you to filter between tokens based off where they were bridged from: ![](/img/bridges/omni-bridged-tokens3.png) -### __Approach 2: Mediator Storage__ -The [multi-token mediator on Gnosis chain](https://blockscout.com/xdai/mainnet/address/0xf6A78083ca3e2a662D6dd1703c939c8aCE2e268d/read-proxy#address-tabs) provides methods for viewing correspondence of bridgeable tokens: -* `foreignTokenAddress` - returns the address of the token contract on the Ethereum Mainnet by specifying the address the token contract on Gnosis Chain. -* `homeTokenAddress`- returns the address of the token contract on Gnosis chain by specifying the address of the token contract on Ethereum. -Pass in the token address to get the corresponding address on the other chain: -![](/img/bridges/omni-mediatorstorage1.png) +### **Approach 2: Mediator Storage** +The [multi-token mediator on Gnosis chain](https://gnosisscan.io/address/0xf6A78083ca3e2a662D6dd1703c939c8aCE2e268d#writeProxyContract) provides methods for viewing correspondence of bridgeable tokens: + +- `foreignTokenAddress` - returns the address of the token contract on the Ethereum Mainnet by specifying the address the token contract on Gnosis Chain. +- `homeTokenAddress`- returns the address of the token contract on Gnosis chain by specifying the address of the token contract on Ethereum. + Pass in the token address to get the corresponding address on the other chain: + ![](/img/bridges/omni-mediatorstorage1.png) ## Verifying a Canonical Bridged Token on BlockScout + New tokens deployed by the multi-token mediator are not verified automatically in BlockScout. Sometimes it is necessary to read data from the token contract directly in the block explorer or even call a method of the token contract (e.g. to transfer tokens back to the Ethereum Mainnet). Follow the instructions below to verify the contract in BlockScout. Once verified, you can read and write to the contract using the BlockScout interface. 1. Find the token contract by the token symbol using the search bar. The following example follows the verification of the STAKE token, which [recently had its staking utility deprecated](https://forum.gnosis.io/t/gip-16-gnosis-chain-xdai-gnosis-merge/1904). However, these steps are still relevant. The bridgeable token name is extended by "on xDai": -![](/img/bridges/omni-verify-token1.png) + ![](/img/bridges/omni-verify-token1.png) 2. Verify the contract: -![](/img/bridges/omni-verify-token2.png) -![](/img/bridges/omni-verify-token3.png) -Click on the Code tab, click Verify and Publish, then fill the form following the recommendations below (see solidity contract code below this image). Press the "Verify & publish" button at the bottom of the form to finish. -![](/img/bridges/omni-verify-token4.png) + ![](/img/bridges/omni-verify-token2.png) + ![](/img/bridges/omni-verify-token3.png) + Click on the Code tab, click Verify and Publish, then fill the form following the recommendations below (see solidity contract code below this image). Press the "Verify & publish" button at the bottom of the form to finish. + ![](/img/bridges/omni-verify-token4.png)
Click to View Solidity Contract Code used in the Example - __Code__: - - ```solidity showLineNumbers - - pragma solidity 0.4.24; - - /** - * @title Proxy - * @dev Gives the possibility to delegate any call to a foreign implementation. - */ - contract Proxy { - /** - * @dev Tells the address of the implementation where every call will be delegated. - * @return address of the implementation to which it will be delegated - */ - /* solcov ignore next */ - function implementation() public view returns (address); - - /** - * @dev Fallback function allowing to perform a delegatecall to the given implementation. - * This function will return whatever the implementation call returns - */ - function() public payable { - // solhint-disable-previous-line no-complex-fallback - address _impl = implementation(); - require(_impl != address(0)); - assembly { - /* - 0x40 is the "free memory slot", meaning a pointer to next slot of empty memory. mload(0x40) - loads the data in the free memory slot, so `ptr` is a pointer to the next slot of empty - memory. It's needed because we're going to write the return data of delegatecall to the - free memory slot. - */ - let ptr := mload(0x40) - /* - `calldatacopy` is copy calldatasize bytes from calldata - First argument is the destination to which data is copied(ptr) - Second argument specifies the start position of the copied data. - Since calldata is sort of its own unique location in memory, - 0 doesn't refer to 0 in memory or 0 in storage - it just refers to the zeroth byte of calldata. - That's always going to be the zeroth byte of the function selector. - Third argument, calldatasize, specifies how much data will be copied. - calldata is naturally calldatasize bytes long (same thing as msg.data.length) - */ - calldatacopy(ptr, 0, calldatasize) - /* - delegatecall params explained: - gas: the amount of gas to provide for the call. `gas` is an Opcode that gives - us the amount of gas still available to execution - - _impl: address of the contract to delegate to - - ptr: to pass copied data - - calldatasize: loads the size of `bytes memory data`, same as msg.data.length - - 0, 0: These are for the `out` and `outsize` params. Because the output could be dynamic, - these are set to 0, 0 so the output data will not be written to memory. The output - data will be read using `returndatasize` and `returdatacopy` instead. - - result: This will be 0 if the call fails and 1 if it succeeds - */ - let result := delegatecall(gas, _impl, ptr, calldatasize, 0, 0) - /* - - */ - /* - ptr current points to the value stored at 0x40, - because we assigned it like ptr := mload(0x40). - Because we use 0x40 as a free memory pointer, - we want to make sure that the next time we want to allocate memory, - we aren't overwriting anything important. - So, by adding ptr and returndatasize, - we get a memory location beyond the end of the data we will be copying to ptr. - We place this in at 0x40, and any reads from 0x40 will now read from free memory - */ - mstore(0x40, add(ptr, returndatasize)) - /* - `returndatacopy` is an Opcode that copies the last return data to a slot. `ptr` is the - slot it will copy to, 0 means copy from the beginning of the return data, and size is - the amount of data to copy. - `returndatasize` is an Opcode that gives us the size of the last return data. In this case, that is the size of the data returned from delegatecall - */ - returndatacopy(ptr, 0, returndatasize) - - /* - if `result` is 0, revert. - if `result` is 1, return `size` amount of data from `ptr`. This is the data that was - copied to `ptr` from the delegatecall return data - */ - switch result - case 0 { - revert(ptr, returndatasize) - } - default { - return(ptr, returndatasize) - } - } - } - } - - interface IPermittableTokenVersion { - function version() external pure returns (string); - } - - /** - * @title TokenProxy - * @dev Helps to reduces the size of the deployed bytecode for automatically created tokens, by using a proxy contract. - */ - contract TokenProxy is Proxy { - // storage layout is copied from PermittableToken.sol - string internal name; - string internal symbol; - uint8 internal decimals; - mapping(address => uint256) internal balances; - uint256 internal totalSupply; - mapping(address => mapping(address => uint256)) internal allowed; - address internal owner; - bool internal mintingFinished; - address internal bridgeContractAddr; - // string public constant version = "1"; - bytes32 internal DOMAIN_SEPARATOR; - // bytes32 public constant PERMIT_TYPEHASH = 0xea2aa0a1be11a07ed86d755c93467f4f82362b452371d1ba94d1715123511acb; - mapping(address => uint256) internal nonces; - mapping(address => mapping(address => uint256)) internal expirations; - - /** - * @dev Creates a non-upgradeable token proxy for PermitableToken.sol, initializes its eternalStorage. - * @param _tokenImage address of the token image used for mirrowing all functions. - * @param _name token name. - * @param _symbol token symbol. - * @param _decimals token decimals. - * @param _chainId chain id for current network. - */ - constructor(address _tokenImage, string memory _name, string memory _symbol, uint8 _decimals, uint256 _chainId) - public - { - string memory version = IPermittableTokenVersion(_tokenImage).version(); - - assembly { - // EIP 1967 - // bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1) - sstore(0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc, _tokenImage) - } - name = _name; - symbol = _symbol; - decimals = _decimals; - owner = msg.sender; // msg.sender == HomeMultiAMBErc20ToErc677 mediator - bridgeContractAddr = msg.sender; - DOMAIN_SEPARATOR = keccak256( - abi.encode( - keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"), - keccak256(bytes(_name)), - keccak256(bytes(version)), - _chainId, - address(this) - ) - ); - } - - /** - * @dev Retrieves the implementation contract address, mirrowed token image. - * @return token image address. - */ - function implementation() public view returns (address impl) { - assembly { - impl := sload(0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc) - } - } - } - ``` - +**Code**: + +```solidity showLineNumbers + + pragma solidity 0.4.24; + + /** + * @title Proxy + * @dev Gives the possibility to delegate any call to a foreign implementation. + */ + contract Proxy { + /** + * @dev Tells the address of the implementation where every call will be delegated. + * @return address of the implementation to which it will be delegated + */ + /* solcov ignore next */ + function implementation() public view returns (address); + + /** + * @dev Fallback function allowing to perform a delegatecall to the given implementation. + * This function will return whatever the implementation call returns + */ + function() public payable { + // solhint-disable-previous-line no-complex-fallback + address _impl = implementation(); + require(_impl != address(0)); + assembly { + /* + 0x40 is the "free memory slot", meaning a pointer to next slot of empty memory. mload(0x40) + loads the data in the free memory slot, so `ptr` is a pointer to the next slot of empty + memory. It's needed because we're going to write the return data of delegatecall to the + free memory slot. + */ + let ptr := mload(0x40) + /* + `calldatacopy` is copy calldatasize bytes from calldata + First argument is the destination to which data is copied(ptr) + Second argument specifies the start position of the copied data. + Since calldata is sort of its own unique location in memory, + 0 doesn't refer to 0 in memory or 0 in storage - it just refers to the zeroth byte of calldata. + That's always going to be the zeroth byte of the function selector. + Third argument, calldatasize, specifies how much data will be copied. + calldata is naturally calldatasize bytes long (same thing as msg.data.length) + */ + calldatacopy(ptr, 0, calldatasize) + /* + delegatecall params explained: + gas: the amount of gas to provide for the call. `gas` is an Opcode that gives + us the amount of gas still available to execution + + _impl: address of the contract to delegate to + + ptr: to pass copied data + + calldatasize: loads the size of `bytes memory data`, same as msg.data.length + + 0, 0: These are for the `out` and `outsize` params. Because the output could be dynamic, + these are set to 0, 0 so the output data will not be written to memory. The output + data will be read using `returndatasize` and `returdatacopy` instead. + + result: This will be 0 if the call fails and 1 if it succeeds + */ + let result := delegatecall(gas, _impl, ptr, calldatasize, 0, 0) + /* + + */ + /* + ptr current points to the value stored at 0x40, + because we assigned it like ptr := mload(0x40). + Because we use 0x40 as a free memory pointer, + we want to make sure that the next time we want to allocate memory, + we aren't overwriting anything important. + So, by adding ptr and returndatasize, + we get a memory location beyond the end of the data we will be copying to ptr. + We place this in at 0x40, and any reads from 0x40 will now read from free memory + */ + mstore(0x40, add(ptr, returndatasize)) + /* + `returndatacopy` is an Opcode that copies the last return data to a slot. `ptr` is the + slot it will copy to, 0 means copy from the beginning of the return data, and size is + the amount of data to copy. + `returndatasize` is an Opcode that gives us the size of the last return data. In this case, that is the size of the data returned from delegatecall + */ + returndatacopy(ptr, 0, returndatasize) + + /* + if `result` is 0, revert. + if `result` is 1, return `size` amount of data from `ptr`. This is the data that was + copied to `ptr` from the delegatecall return data + */ + switch result + case 0 { + revert(ptr, returndatasize) + } + default { + return(ptr, returndatasize) + } + } + } + } + + interface IPermittableTokenVersion { + function version() external pure returns (string); + } + + /** + * @title TokenProxy + * @dev Helps to reduces the size of the deployed bytecode for automatically created tokens, by using a proxy contract. + */ + contract TokenProxy is Proxy { + // storage layout is copied from PermittableToken.sol + string internal name; + string internal symbol; + uint8 internal decimals; + mapping(address => uint256) internal balances; + uint256 internal totalSupply; + mapping(address => mapping(address => uint256)) internal allowed; + address internal owner; + bool internal mintingFinished; + address internal bridgeContractAddr; + // string public constant version = "1"; + bytes32 internal DOMAIN_SEPARATOR; + // bytes32 public constant PERMIT_TYPEHASH = 0xea2aa0a1be11a07ed86d755c93467f4f82362b452371d1ba94d1715123511acb; + mapping(address => uint256) internal nonces; + mapping(address => mapping(address => uint256)) internal expirations; + + /** + * @dev Creates a non-upgradeable token proxy for PermitableToken.sol, initializes its eternalStorage. + * @param _tokenImage address of the token image used for mirrowing all functions. + * @param _name token name. + * @param _symbol token symbol. + * @param _decimals token decimals. + * @param _chainId chain id for current network. + */ + constructor(address _tokenImage, string memory _name, string memory _symbol, uint8 _decimals, uint256 _chainId) + public + { + string memory version = IPermittableTokenVersion(_tokenImage).version(); + + assembly { + // EIP 1967 + // bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1) + sstore(0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc, _tokenImage) + } + name = _name; + symbol = _symbol; + decimals = _decimals; + owner = msg.sender; // msg.sender == HomeMultiAMBErc20ToErc677 mediator + bridgeContractAddr = msg.sender; + DOMAIN_SEPARATOR = keccak256( + abi.encode( + keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"), + keccak256(bytes(_name)), + keccak256(bytes(version)), + _chainId, + address(this) + ) + ); + } + + /** + * @dev Retrieves the implementation contract address, mirrowed token image. + * @return token image address. + */ + function implementation() public view returns (address impl) { + assembly { + impl := sload(0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc) + } + } + } +```
-After verification is successful, the number tabs in the contract window will be extended to allow users to "Read Contract", "Write Contract", "Read Proxy" and "Write Proxy". +After verification is successful, the number tabs in the contract window will be extended to allow users to "Read Contract", "Write Contract", "Read Proxy" and "Write Proxy". ![](/img/bridges/omni-verify-token5.png) - - - ## Bridged Tokens List + A dynamic list of bridged tokens is now available. -* [Tokens Bridged from Ethereum]( https://blockscout.com/xdai/mainnet/bridged-tokens/eth) -* [Tokens Bridged from Binance Smart Chain](https://blockscout.com/xdai/mainnet/bridged-tokens/bsc) -The OmniBridge multi-token bridge extension is now being used to bridge many tokens from Ethereum to Gnosis. A second instance bridges tokens to and from the Binance Smart Chain. When a token is bridged, the name is appended with "on xDai" or "from Ethereum/BSC". On a token page, you can also find the link to the original token on Ethereum. + +- [Tokens Bridged from Ethereum](https://blockscout.com/xdai/mainnet/bridged-tokens/eth) +- [Tokens Bridged from Binance Smart Chain](https://blockscout.com/xdai/mainnet/bridged-tokens/bsc) + The OmniBridge multi-token bridge extension is now being used to bridge many tokens from Ethereum to Gnosis. A second instance bridges tokens to and from the Binance Smart Chain. When a token is bridged, the name is appended with "on xDai" or "from Ethereum/BSC". On a token page, you can also find the link to the original token on Ethereum. ## Getting bridged tokens from Omnibridge Smart Contracts The Token list is queried dynamically with BlockScout. The list is compiled by following these steps: -1. Find all transactions to the [AMB Contract on Gnosis](https://blockscout.com/xdai/mainnet/address/0x75Df5AF045d91108662D8080fD1FEFAd6aA0bb59/transactions#address-tabs) + +1. Find all transactions to the [AMB Contract on Gnosis](https://gnosis.blockscout.com/address/0x75Df5AF045d91108662D8080fD1FEFAd6aA0bb59/transactions#address-tabs) 2. Check all internal transactions for each transaction. -3. If an internal transaction creates a contract from the AMB mediator address (0xf6A78083ca3e2a662D6dd1703c939c8aCE2e268d), and this contract exposes the `getTokenInterfacesVersion()` getter, it is safe to assume that this contract’s address is a bridged token address. \ No newline at end of file +3. If an internal transaction creates a contract from the AMB mediator address (0xf6A78083ca3e2a662D6dd1703c939c8aCE2e268d), and this contract exposes the `getTokenInterfacesVersion()` getter, it is safe to assume that this contract’s address is a bridged token address. diff --git a/docs/bridges/tutorials/using-xdai-bridge/README.md b/docs/bridges/tutorials/using-xdai-bridge/README.md index 638f19b1..4f3ccecd 100644 --- a/docs/bridges/tutorials/using-xdai-bridge/README.md +++ b/docs/bridges/tutorials/using-xdai-bridge/README.md @@ -8,7 +8,6 @@ keywords: [xdai bridge, token bridge, ethereum, gnosis, gnosis bridge] ### Moving Dai from Ethereum to xDai on Gnosis - :::note You will need some Dai to transfer AND some ETH for gas (transaction fees). [Bridge minimum/maximum amounts](../../tokenbridge/xdai-bridge.md#fees--daily-limits) are set by the [bridge governors](../../tokenbridge/xdai-bridge.md#bridge-governance). Bridge may take some time to update chain stats, try refreshing or waiting a minute if you receive any errors. You can also select a [different RPC](#custom-rpc) in the Settings dropdown. ::: @@ -16,61 +15,60 @@ You will need some Dai to transfer AND some ETH for gas (transaction fees). [Bri 1. Go to the [xDai Bridge UI](https://bridge.gnosischain.com/) and connect your wallet to the Ethereum Mainnet. Once connected, you will see your address populated in the header, and your DAI and xDai balance displayed on the page. If you change the dropdown on the page (ETH Mainnet) but not in MetaMask, the interface will update but your wallet will not auto-connect to the chain. _Switching chains in MetaMask_ however will automatically update the interface. 2. Enter the amount of Dai you would like to transfer to Gnosis, and click the Transfer button. 3. The web3 wallet window will open with transaction details. The default gas price is fine, if you would like a faster transaction you can increase. Click Submit or Confirm (depending on wallet) to initiate the transaction. -4. Wait for the transaction confirmation (this can take some time if the network is super congested). The transaction is considered finalized after 8 blocks. To check on a pending transaction, click on the tx in the UI. +4. Wait for the transaction confirmation (this can take some time if the network is super congested). The transaction is considered finalized after 8 blocks. To check on a pending transaction, click on the tx in the UI. 5. Once the initial transfer confirmation is successful, you will see consecutive 'Transfer Pending' notifications with: - 1. 8 of 8 block confirmations - 2. Countdown with continue until 1 block confirmation is left. - 3. Waiting for execution on Gnosis Chain side. - 4. Transfer Complete. + 1. 20 of 20 block confirmations + 2. Countdown with continue until 1 block confirmation is left. + 3. Waiting for execution on Gnosis Chain side. + 4. Transfer Complete. 6. Click on View on BlockScout to see details about the transaction. If you scroll down you will see the `address` (your address where the xdai was sent), `value` (amount sent in wei), and `transactionHash`, which will match the hash from the initial transaction. ### Moving xDai from Gnosis back to Dai on Ethereum + :::note It is recommended to use Google Chrome and MetaMask without Ad Blockers to complete this process. -You will need a __small additional amount of xDai__ to process the first transaction, and an __additional amount of Eth__ to process the claim transaction on Ethereum. +You will need a **small additional amount of xDai** to process the first transaction, and an **additional amount of Eth** to process the claim transaction on Ethereum. ::: 1. Go to the [xDai Bridge UI](https://bridge.gnosischain.com/) and connect your wallet to Gnosis Chain. Once connected, you will see your address populated in the header, and your DAI and xDai balance displayed on the page. If you change the dropdown on the page but not in MetaMask, the interface will update but your wallet will not auto-connect to the chain. _Switching chains in MetaMask_ however will automatically update the interface. 2. Enter the amount of xDai you would like to transfer to Dai, and click the Request button. Note that there exists a [minimum amount](../../tokenbridge/xdai-bridge.md#fees--daily-limits). -3. Confirm that you will need to perform 2 transactions, and will need xDai and Eth to complete the transfer. Click __Confirm__ to process the transaction on Gnosis Chain. -4. Your web3 wallet window will open with transaction details. +3. Confirm that you will need to perform 2 transactions, and will need xDai and Eth to complete the transfer. Click **Confirm** to process the transaction on Gnosis Chain. +4. Your web3 wallet window will open with transaction details. 5. Wait for 8 block confirmations. You will see several popups with block confirmation info. 6. You will see a modal instructing you switch networks in your MetaMask (or other web3 wallet) to the Ethereum Mainnet. 7. After you switch networks the **Claim** button will appear. Press to proceed. 8. **Confirm** the second claim transaction in MetaMask (you will need some Eth for gas fees). Once processed, the Dai should be available in your wallet. -:::info -If you are interested in converting Dai to xDai without the UI see [how to use xDai Bridge without UI](#using-xdai-bridge-without-the-ui) -::: + :::info + If you are interested in converting Dai to xDai without the UI see [how to use xDai Bridge without UI](#using-xdai-bridge-without-the-ui) + ::: ### How To Use the xDai Bridge with Safe (formerly Gnosis Safe) + The xDai Bridge is included as a native Safe application, and Multisig Wallets on both Ethereum and Gnosis can interact with the bridge directly from the safe. The following instructions are for bridging **xDai to Dai** and vice versa. To bridge any other ERC20s, see the [Omnibridge + Gnosis Safe](../using-omnibridge/README.md) instructions. -#### Initiating a Transaction -1. Go to your [Safe](https://gnosis-safe.io/app), login and connect. You will want to access the safe you are bridging from first (if moving xDai to Dai, start with the Gnosis one). __Safe addresses are distinct for each chain__. You can toggle which network you are using in the top right corner dropdown. +#### Initiating a Transaction +1. Go to your [Safe](https://gnosis-safe.io/app), login and connect. You will want to access the safe you are bridging from first (if moving xDai to Dai, start with the Gnosis one). **Safe addresses are distinct for each chain**. You can toggle which network you are using in the top right corner dropdown. 2. Go to **Apps** and find the [**xDai Bridge** App](https://gnosis-safe.io/app/share/safe-app?appUrl=https://bridge.xdaichain.com&chainId=1). Apps are typically displayed in alphabetical order. Click to access. +3. Open the application and interact with the bridge as you normally would to begin the transfer process. \*\*\*\* In the following example we bridge xDai on Gnosis chain to Dai on Ethereum. Note that there exists a [minimum amount](../../tokenbridge/xdai-bridge.md#fees--daily-limits). Enter: -3. Open the application and interact with the bridge as you normally would to begin the transfer process. **** In the following example we bridge xDai on Gnosis chain to Dai on Ethereum. Note that there exists a [minimum amount](../../tokenbridge/xdai-bridge.md#fees--daily-limits). Enter: + 1. xDai Amount + 2. Recipient Address + 3. Click Request. - 1. xDai Amount - 2. Recipient Address - 3. Click Request. +The Mainnet amount will show 0 DAI, as your Safe address on the Ethereum Mainnet is different and will not correspond with any Dai amount in a mainnet safe. - The Mainnet amount will show 0 DAI, as your Safe address on the Ethereum Mainnet is different and will not correspond with any Dai amount in a mainnet safe. - - :::danger - When bridging with a safe you will set a **Recipient Address**. This may be a 2nd safe contract on the receiving chain or an individual address to receive the funds. The app will not let you proceed until you set the Recipient Address. - ::: - - - Once you request to bridge xDai, you will see this warning reminding you about the claims process. Some xDai is required on one of the owner's wallets to initiate the transfer process, and Eth on Ethereum is required to claim bridged Dai. +:::danger +When bridging with a safe you will set a **Recipient Address**. This may be a 2nd safe contract on the receiving chain or an individual address to receive the funds. The app will not let you proceed until you set the Recipient Address. +::: +Once you request to bridge xDai, you will see this warning reminding you about the claims process. Some xDai is required on one of the owner's wallets to initiate the transfer process, and Eth on Ethereum is required to claim bridged Dai. 4. On submission, the required number of safe owners each need to **submit** and **sign** to process the request. This does not require any xDai. - The final signature owner (required number of signatures are set through the gnosis safe settings) then needs to confirm. Any owner can then execute the tx and pay for the initial transfer transaction with xDai once this quorum has been met. In this example, a second owner goes to the **transactions** menu in their safe to find **transaction needs your confirmation**. +The final signature owner (required number of signatures are set through the gnosis safe settings) then needs to confirm. Any owner can then execute the tx and pay for the initial transfer transaction with xDai once this quorum has been met. In this example, a second owner goes to the **transactions** menu in their safe to find **transaction needs your confirmation**. 5. Execute the transaction on Gnosis. A warning message may appear related to the gas limit which is set too low by the application. To fix, go to **Advanced options** and raise the gas limit. You can set it to be higher if desired - the transaction will only use the amount required within the set limit. @@ -78,11 +76,10 @@ The xDai Bridge is included as a native Safe application, and Multisig Wallets o #### Claiming a Bridge Transaction on Ethereum - In this example, we sent xDai to a Safe address on Ethereum. To claim the transaction and receive Dai, login to [Safe on Ethereum](https://gnosis-safe.io/app/) and open the xDai Bridge Application (located in the Apps menu). +In this example, we sent xDai to a Safe address on Ethereum. To claim the transaction and receive Dai, login to [Safe on Ethereum](https://gnosis-safe.io/app/) and open the xDai Bridge Application (located in the Apps menu). 1. You should see the claim screen, click the **History** button to begin the process. If you do not see this screen, click on **History** at the top of the bridge app. - 2. Click the **Claim** button. 3. All required owners must confirm the transaction before it is processed. Once the required signatures are collected, an owner can claim the transaction. The claim will require Eth, and can be completed anytime if the current prices are too high. Once completed, you can find the Etherscan link in your MetaMask Activity tab or the pending transaction pop-up. diff --git a/docs/bridges/tutorials/using-xdai-bridge/alternate-receiver.md b/docs/bridges/tutorials/using-xdai-bridge/alternate-receiver.md index 76a0980e..57b8f1be 100644 --- a/docs/bridges/tutorials/using-xdai-bridge/alternate-receiver.md +++ b/docs/bridges/tutorials/using-xdai-bridge/alternate-receiver.md @@ -9,109 +9,95 @@ The feature _Alternative Receiver_ has integrated in the contracts of the xDai b Due to different nature of tokens on two sides of the xDai bridge the operations to transfer assets to an alternative receiver from one chain to another differ as well. - The xDai Bridge Alternative Receiver functionality. The transfer requires 2 transactions, one to unlock the contract and a second to process the transaction. _Manual methods are described below this section._ ## Dai to xDai -1. Go to [the bridge UI](https://bridge.gnosischain.com/) and connect your MetaMask Wallet. - +1. Go to [the bridge UI](https://bridge.gnosischain.com/) and connect your MetaMask Wallet. + ![](/img/bridges/xdai-alt-rec-dai-xdai1.png) -2. Determine **Single Tx Unlock** or **Infinite Tx Unlock**. You may want to approve the transfer for a single transaction, or approve the contract to make unlimited transfers from this address to many other addresses. For a Single TX Unlock, proceed directly to step 3 below. For infinite TX unlock, complete the following. +2. Determine **Single Tx Unlock** or **Infinite Tx Unlock**. You may want to approve the transfer for a single transaction, or approve the contract to make unlimited transfers from this address to many other addresses. For a Single TX Unlock, proceed directly to step 3 below. For infinite TX unlock, complete the following. + + 1. Go to Settings - 1. Go to Settings - - ![](/img/bridges/xdai-alt-rec-dai-xdai2.png) + ![](/img/bridges/xdai-alt-rec-dai-xdai2.png) - 2. Toggle Infinite Unlock and save. Close the modal and proceed to step 3. - - ![](/img/bridges/xdai-alt-rec-dai-xdai3.png) + 2. Toggle Infinite Unlock and save. Close the modal and proceed to step 3. + ![](/img/bridges/xdai-alt-rec-dai-xdai3.png) + +3. Click on **Advanced** and add the Recipients Address and the amount to Dai to transfer to Gnosis. Press **Unlock.** -3. Click on **Advanced** and add the Recipients Address and the amount to Dai to transfer to Gnosis. Press **Unlock.** - ![](/img/bridges/xdai-alt-rec-dai-xdai4.gif) 4. Confirm the Unlock transaction in MetaMask. - 5. Click to Transfer and Confirm the transaction. - 6. Once the initial transaction is successful, you will see consecutive Transfer Pending notifications with: - 1. 8 of 8 block confirmations..... - 2. Countdown with continue until 1 block confirmation is left. - 3. Waiting for execution on Gnosis side. - 4. Transfer Complete. - + 1. 20 of 20 block confirmations..... + 2. Countdown with continue until 1 block confirmation is left. + 3. Waiting for execution on Gnosis side. + 4. Transfer Complete. 7. The transfer is complete. Check the balance of the new account by clicking on the BlockScout link or accessing the address on Gnosis Chain. ## xDai to Dai -1. With xDai to Dai transfers you do not need to use the Unlock feature. Connect to Gnosis Chain in MetaMask. - - 1. Click on Advanced. - 2. Enter the Address that will receive Dai. - 3. Enter Amount. - 4. Click Request. -![](/img/bridges/xdai-alt-rec-xdai-dai1.png) - -2. Click Confirm to acknowledge you will need to perform 2 transactions. - +1. With xDai to Dai transfers you do not need to use the Unlock feature. Connect to Gnosis Chain in MetaMask. -3. Confirm the first tx in MetaMask. + 1. Click on Advanced. + 2. Enter the Address that will receive Dai. + 3. Enter Amount. + 4. Click Request. + ![](/img/bridges/xdai-alt-rec-xdai-dai1.png) -4. Wait for 8 Block Confirmations on xDai. +2. Click Confirm to acknowledge you will need to perform 2 transactions. +3. Confirm the first tx in MetaMask. -5. Switch to **Ethereum Mainnet** in MetaMask. The Claim button will appear. Click **Claim**. +4. Wait for 20 Block Confirmations on xDai. +5. Switch to **Ethereum Mainnet** in MetaMask. The Claim button will appear. Click **Claim**. - -6. **Confirm** the second claim transaction in MetaMask. Once processed, the Dai should be available for the alternative receiver on Ethereum. - +6. **Confirm** the second claim transaction in MetaMask. Once processed, the Dai should be available for the alternative receiver on Ethereum. ## Dai to xDai (Manual, Non-UI Method) 1. Open MetaMask and choose the Ethereum Mainnet. -2. Go to the Dai Token Contract -> Write Contract functionality in Etherscan.\ -[https://etherscan.io/address/0x6b175474e89094c44da98b954eedeac495271d0f#writeContract](https://etherscan.io/address/0x6b175474e89094c44da98b954eedeac495271d0f#writeContract) +2. Go to the Dai Token Contract -> Write Contract functionality in Etherscan. + [https://etherscan.io/address/0x6b175474e89094c44da98b954eedeac495271d0f#writeContract](https://etherscan.io/address/0x6b175474e89094c44da98b954eedeac495271d0f#writeContract) 3. Connect to your Web3 Wallet (MetaMask). - 4. Approve the bridge contract to perform operations with tokens: -* `usr(address)` -- the address of the xDai bridge contract in the Ethereum Mainnet: `0x4aa42145Aa6Ebf72e164C9bBC74fbD3788045016` -* `wad(uint256)` -- the amount of tokens (in Wei) approved to send through the bridge (in this case 2 Dai): `2000000000000000000` -* Click **Write** - +- `usr(address)` -- the address of the xDai bridge contract in the Ethereum Mainnet: `0x4aa42145Aa6Ebf72e164C9bBC74fbD3788045016` +- `wad(uint256)` -- the amount of tokens (in Wei) approved to send through the bridge (in this case 2 Dai): `2000000000000000000` +- Click **Write** 4. Confirm the transaction in the MetaMask and wait until it is included in the chain. - 5. Initialize the xDai bridge contract interface in Etherscan. Here you will write to the proxy contract. [https://etherscan.io/address/0x4aa42145aa6ebf72e164c9bbc74fbd3788045016#writeProxyContract](https://etherscan.io/address/0x4aa42145aa6ebf72e164c9bbc74fbd3788045016#writeProxyContract) -6. You will see several `relayTokens` methods. Use Method (1) to send to an alternate address. You can also use a second method (14) if the Dai deposit is performed by another contract of behalf of the user account (like a DEX). There are also 2 other `relayToken` methods (4), (22) that specify a `_token(address)`. These are not in use. +6. You will see several `relayTokens` methods. Use Method (1) to send to an alternate address. You can also use a second method (14) if the Dai deposit is performed by another contract of behalf of the user account (like a DEX). There are also 2 other `relayToken` methods (4), (22) that specify a `_token(address)`. These are not in use. -**relayTokens Method (1)** +**relayTokens Method (1)** -* `_receiver (address)` - address of the alternate receiver, the account that will be sent native tokens on Gnosis chain -* `_amount (uint256)` - the amount of tokens (in Wei) to transfer; must be less or equal amount of tokens approved for the bridge operations -* Click **Write** +- `_receiver (address)` - address of the alternate receiver, the account that will be sent native tokens on Gnosis chain +- `_amount (uint256)` - the amount of tokens (in Wei) to transfer; must be less or equal amount of tokens approved for the bridge operations +- Click **Write** **relayTokens Method(14)** -* `_sender (address)` - optional. Use when the Dai deposit is performed by another contract on behalf of a user account (e.g. by a DEX) -* `_receiver (address)` - address of the alternate receiver, the account that will be sent native tokens on Gnosis chain -* `_amount (uint256)` - the amount of tokens (in Wei) to transfer; must be less or equal amount of tokens approved for the bridge operations -* Click **Write** - +- `_sender (address)` - optional. Use when the Dai deposit is performed by another contract on behalf of a user account (e.g. by a DEX) +- `_receiver (address)` - address of the alternate receiver, the account that will be sent native tokens on Gnosis chain +- `_amount (uint256)` - the amount of tokens (in Wei) to transfer; must be less or equal amount of tokens approved for the bridge operations +- Click **Write** 7. Submit the transaction in the MetaMask and wait until it is included in the chain. @@ -119,22 +105,21 @@ The xDai Bridge Alternative Receiver functionality. The transfer requires 2 tran ## xDai to Dai (Non-UI Method) - -1. Go to the [xDai bridge proxy contract on Gnosis Chain](https://blockscout.com/xdai/mainnet/address/0x7301CFA0e1756B71869E93d4e4Dca5c7d0eb0AA6/write-proxy#address-tabs) +1. Go to the [xDai bridge proxy contract on Gnosis Chain](https://gnosis.blockscout.com/address/0x7301CFA0e1756B71869E93d4e4Dca5c7d0eb0AA6?tab=write_proxy) 2. Using the `relayTokens` method under the "Write Proxy" tab, enter the receiver address in the `_receiver` box, and the amount of xDai to transfer (in xDai - no need to convert to WEI). Connect your wallet and confirm the transaction. Copy the transaction hash. -![](/img/bridges/xDai-manual-xDai-Dai1.png) + ![](/img/bridges/xDai-manual-xDai-Dai1.png) +3. Go to the [helper contract](https://gnosis.blockscout.com/address/0x2D51EAa266eafcb59bB36dD3c7E99C515e58113A?tab=write_proxy). In the `getMethodHash()` method, enter the transaction hash from the previous step, the recipient address, and the amount being transferred. When entering the amount, you can use that little "+" icon to add the zeroes, as the amount needs to be entered in wei. Use the 10^18 option to save yourself some typing. Do not include any fees, only the amount to send. Copy the message hash after clicking query. + ![](/img/bridges/xDai-manual-xDai-Dai-getMsgHash.png) -3. Go to the [helper contract](https://blockscout.com/xdai/mainnet/address/0x2D51EAa266eafcb59bB36dD3c7E99C515e58113A/read-contract#address-tabs). In the `getMethodHash()` method, enter the transaction hash from the previous step, the recipient address, and the amount being transferred. When entering the amount, you can use that little "+" icon to add the zeroes, as the amount needs to be entered in wei. Use the 10^18 option to save yourself some typing. Do not include any fees, only the amount to send. Copy the message hash after clicking query. -![](/img/bridges/xDai-manual-xDai-Dai-getMsgHash.png) - -4. Paste the message hash from the previous step into the `getMessage()` method. If you receive 0x0 it means either the bridge oracles did not send a confirmation for the withdrawal yet or the data entered in the step 3 is incorrect. Double check the info and if it is correct you will eventually receive the message. -![](/img/bridges/xDai-manual-xDai-Dai-getMsg.png) +4. Paste the message hash from the previous step into the `getMessage()` method. If you receive 0x0 it means either the bridge oracles did not send a confirmation for the withdrawal yet or the data entered in the step 3 is incorrect. Double check the info and if it is correct you will eventually receive the message. + ![](/img/bridges/xDai-manual-xDai-Dai-getMsg.png) 5. Once you receive the message, use the message hash from step 3 and query the `getSignatures()` method with it. It should return a blob packed with the signatures provided by the validator. If enough signatures haven't been collected yet, then the query could fail. If this happens, waiting a few minutes should fix it. -![](/img/bridges/xDai-manual-xDai-Dai-getSignatures.png) + ![](/img/bridges/xDai-manual-xDai-Dai-getSignatures.png) + +6. Copy and paste the signature blob and the output from step 4 into the [Ethereum proxy contract](https://etherscan.io/address/0x4aa42145aa6ebf72e164c9bbc74fbd3788045016#writeProxyContract)'s `executeSignatures` method (you will need some Eth for gas). Connect your wallet and click write. After the transaction processes, the funds should appear in the receiver wallet. + ![](/img/bridges/xDai-manual-xDai-Dai-execSignatures.png) -5. Copy and paste the signature blob and the output from step 4 into the [Ethereum proxy contract](https://etherscan.io/address/0x4aa42145aa6ebf72e164c9bbc74fbd3788045016#writeProxyContract)'s `executeSignatures` method (you will need some Eth for gas). Connect your wallet and click write. After the transaction processes, the funds should appear in the receiver wallet. -![](/img/bridges/xDai-manual-xDai-Dai-execSignatures.png) - [How to bridge Dai to a different address on Gnosis](/bridges/tutorials/using-xdai-bridge/alternate-receiver) -- [TokenBridge Docs: Alternative Receiver for the xDai Bridge](https://docs.tokenbridge.net/xdai-bridge/using-the-xdai-bridge/alternative-receiver-for-the-xdai-bridge) \ No newline at end of file +- [TokenBridge Docs: Alternative Receiver for the xDai Bridge](https://docs.tokenbridge.net/xdai-bridge/using-the-xdai-bridge/alternative-receiver-for-the-xdai-bridge) diff --git a/docs/bridges/tutorials/using-xdai-bridge/no-ui.md b/docs/bridges/tutorials/using-xdai-bridge/no-ui.md index efe877b2..b49dc902 100644 --- a/docs/bridges/tutorials/using-xdai-bridge/no-ui.md +++ b/docs/bridges/tutorials/using-xdai-bridge/no-ui.md @@ -5,16 +5,16 @@ keywords: [xdai bridge, gnosis bridge] # Without UI -It is possible to move Dai and xDai using a wallet rather than through the UI. This method is supported by all wallets that support ERC20 transfers (e.g. [NiftyWallet](https://chrome.google.com/webstore/detail/nifty-wallet/jbdaocneiiinmjbjlgalhcelgbejmnid?hl=en), [MyEtherWallet.com](http://myetherwallet.com/), [TrustWallet](https://trustwallet.com/), [MetaMask](https://metamask.io/)). Here we use NiftyWallet. +It is possible to move Dai and xDai using a wallet rather than through the UI. This method is supported by all wallets that support ERC20 transfers (e.g. [MyEtherWallet.com](http://myetherwallet.com/), [TrustWallet](https://trustwallet.com/), [MetaMask](https://metamask.io/)). Here we use NiftyWallet. Token address for reference: -* Dai: [0x6b175474e89094c44da98b954eedeac495271d0f](https://etherscan.io/token/0x6b175474e89094c44da98b954eedeac495271d0f) +- Dai: [0x6b175474e89094c44da98b954eedeac495271d0f](https://etherscan.io/token/0x6b175474e89094c44da98b954eedeac495271d0f) TokenBridge addresses for reference (where you send the asset to transfer) -* Mainnet TokenBridge (Dai -> xDai): `0x4aa42145Aa6Ebf72e164C9bBC74fbD3788045016` -* xDai TokenBridge (xDai -> Dai): `0x7301CFA0e1756B71869E93d4e4Dca5c7d0eb0AA6` +- Mainnet TokenBridge (Dai -> xDai): `0x4aa42145Aa6Ebf72e164C9bBC74fbD3788045016` +- xDai TokenBridge (xDai -> Dai): `0x7301CFA0e1756B71869E93d4e4Dca5c7d0eb0AA6` ## Transfer Dai from the Ethereum Mainnet to the Gnosis Chain @@ -22,15 +22,14 @@ TokenBridge addresses for reference (where you send the asset to transfer) 2. Enter in the following: - 1. TokenBridge Address as the recipient: `0x4aa42145Aa6Ebf72e164C9bBC74fbD3788045016` - 2. Amount to Send - 3. Submit the transaction + 1. TokenBridge Address as the recipient: `0x4aa42145Aa6Ebf72e164C9bBC74fbD3788045016` + 2. Amount to Send + 3. Submit the transaction 3. Wait for the relay confirmation from the bridge validators. This may take several minutes. 4. Set your wallet to the Gnosis chain and check your balance. - ## Transfer xDai to DAI from the Gnosis chain to the Ethereum Mainnet :::info @@ -43,13 +42,13 @@ The following demonstrates interaction with contract methods using BlockScout an 3. Copy the transaction hash of the confirmation and connect to the Ethereum mainnet. -4. Visit the helper contract: [https://blockscout.com/xdai/mainnet/address/0x2D51EAa266eafcb59bB36dD3c7E99C515e58113A/read-contract](https://blockscout.com/xdai/mainnet/address/0x2D51EAa266eafcb59bB36dD3c7E99C515e58113A/read-contract) +4. Visit the helper contract: [https://gnosis.blockscout.com/address/0x2D51EAa266eafcb59bB36dD3c7E99C515e58113A](https://gnosis.blockscout.com/address/0x2D51EAa266eafcb59bB36dD3c7E99C515e58113A) 5. In the `getMessageHash` method field add the following information from your originating transaction and press the Query button. The method will return a hashed message. -* DAI recipient (typically the transaction sender but may differ if the ‘relayTokens’ functionality is used) -* Value (in **Wei** - do not include fees, only amount sent (Wei converter at [http://eth-converter.com/](http://eth-converter.com/)) -* Originating transaction hash +- DAI recipient (typically the transaction sender but may differ if the ‘relayTokens’ functionality is used) +- Value (in **Wei** - do not include fees, only amount sent (Wei converter at [http://eth-converter.com/](http://eth-converter.com/)) +- Originating transaction hash 6. Copy the message hash and paste into the `getMessage` method. If you receive 0x0 it means either the bridge oracles did not send a confirmation for the withdrawal yet or the data entered in the step 3 is incorrect. Double check the info and if it is correct you will eventually receive the message. diff --git a/docs/bridges/tutorials/using-xdai-bridge/troubleshooting.md b/docs/bridges/tutorials/using-xdai-bridge/troubleshooting.md index 5e8b9dfd..ccc8cc2c 100644 --- a/docs/bridges/tutorials/using-xdai-bridge/troubleshooting.md +++ b/docs/bridges/tutorials/using-xdai-bridge/troubleshooting.md @@ -1,6 +1,7 @@ --- description: Bridge transactions can take some time (hours in extreme cases) to complete depending on Ethereum mainnet congestion. Troubleshoot Bridge issues -keywords: [troubleshooting, bridge problems, issues, token bridge, gnosis bridge] +keywords: + [troubleshooting, bridge problems, issues, token bridge, gnosis bridge] --- # Troubleshoot Bridge Issues @@ -12,12 +13,12 @@ If you are using OmniBridge for other ERC20 tokens (not xDai <-> Dai) please see :::info **Things to know** -* A bridge exit (moving from xDai to Dai) requires **2 transactions**, **one to initiate the transfer** on Gnosis, and a **2nd to claim DAI on Ethereum**. -* To process the **2nd transaction**, you will need to **switch to Ethereum Mainnet in MetaMask** and **you will need Ether to pay gas fees.** -* The **2nd transaction may take quite a long time**, it is being processed on Ethereum. You can set a higher gas price if you want to speed it up. [**Instructions**](#dai-to-xdai-transaction-is-taking-a-long-time)**.** -* If you closed the UI before starting the 2nd transaction, you can come back and to complete later. [**Instructions**](#i-used-the-xdai-bridge-ui)**.** -* Additional troubleshooting items below. -::: +- A bridge exit (moving from xDai to Dai) requires **2 transactions**, **one to initiate the transfer** on Gnosis, and a **2nd to claim DAI on Ethereum**. +- To process the **2nd transaction**, you will need to **switch to Ethereum Mainnet in MetaMask** and **you will need Ether to pay gas fees.** +- The **2nd transaction may take quite a long time**, it is being processed on Ethereum. You can set a higher gas price if you want to speed it up. [**Instructions**](#dai-to-xdai-transaction-is-taking-a-long-time)**.** +- If you closed the UI before starting the 2nd transaction, you can come back and to complete later. [**Instructions**](#i-used-the-xdai-bridge-ui)**.** +- Additional troubleshooting items below. + ::: ## Bridge UI is Offline or in Maintenance Mode @@ -38,9 +39,8 @@ A new bridge decentralization feature means **withdrawals now require 2 steps**. There are currently different bridging UIs, and depending on the UI you may need to take different steps to complete the process. -* [xDai bridge](#i-used-the-xdai-bridge-ui): [https://bridge.gnosischain.com/](https://bridge.gnosischain.com/) -* [Burner Wallet](#i-used-burner-wallet-at-xdai-io): [https://xdai.io](https://xdai.io) - +- [xDai bridge](#i-used-the-xdai-bridge-ui): [https://bridge.gnosischain.com/](https://bridge.gnosischain.com/) +- [Burner Wallet](#i-used-burner-wallet-at-xdai-io): [https://xdai.io](https://xdai.io) ## I Used the xDai Bridge UI @@ -78,7 +78,7 @@ You can retrieve the pending transaction using the MetaMask interface. [Learn mo 1. Go to the Bridge UI at [https://bridge.gnosischain.com/](https://bridge.gnosischain.com/) 2. Switch your MetaMask wallet to the ETH Mainnet -3. Click on **History.** You will see any unclaimed transactions_. (You can also filter unclaimed transactions)_ +3. Click on **History.** You will see any unclaimed transactions*. (You can also filter unclaimed transactions)* 4. Press the **Claim button** to process**.** _(will not appear until 6+ minutes after the transaction)_ 5. **Confirm** transaction in MetaMask and wait for tx validation. @@ -109,7 +109,7 @@ In this case, you'll want to export your private key into MetaMask to finish the 5\) Go to the Bridge UI at [https://bridge.gnosischain.com/](https://bridge.gnosischain.com/) 1. Switch your MetaMask wallet to the ETH Mainnet -2. Click on **History.** You will see any unclaimed transactions_. (You can also filter unclaimed transactions)_ +2. Click on **History.** You will see any unclaimed transactions*. (You can also filter unclaimed transactions)* 3. Press the **Claim button** to process**.** _(will not appear until 6+ minutes after the transaction)_ 4. **Confirm** transaction in MetaMask and wait for tx validation. @@ -151,12 +151,12 @@ Otherwise, it will likely be in a pending state until the congestion breaks up. ## Transaction Not Showing on BlockScout or Etherscan - Resetting MetaMask. -If you initiated a transaction but don't see a pending transaction the Block Explorer (in either direction, if originating from Gnosis check [BlockScout](https://blockscout.com/xdai/mainnet), if Ethereum check [Etherscan](https://etherscan.io/)) try resetting your MetaMask account to clear your transaction history. +If you initiated a transaction but don't see a pending transaction the Block Explorer (in either direction, if originating from Gnosis check [BlockScout](https://gnosis.blockscout.com/), if Ethereum check [Etherscan](https://etherscan.io/)) try resetting your MetaMask account to clear your transaction history. This can be useful to clear up: -* A pending transaction which refuses to clear. -* A transaction fails to show up on Etherscan but is still pending. +- A pending transaction which refuses to clear. +- A transaction fails to show up on Etherscan but is still pending. :::warning Imported accounts will not repopulate win your wallet with this method, so be sure you have access to a private key or seed phrase to restore these in a [reset account](https://metamask.zendesk.com/hc/en-us/articles/360015488891-Resetting-an-Account). @@ -172,7 +172,7 @@ To use a Ledger you need to allow contract data in order to interact with smart 2. Connect and unlock your Ledger device. 3. Open the **Ethereum** application. 4. Press the right button to navigate to **Settings**. Press both buttons to validate. -5. In the **Contract data** settings, press both buttons to allow contract data in transactions. The device displays **Allowed**. +5. In the **Contract data** settings, press both buttons to allow contract data in transactions. The device displays **Allowed**. 6. Retry your transaction. For more help with Ledger, please see their [support docs](https://support.ledger.com/hc/en-us). @@ -190,7 +190,7 @@ In some cases, however, step 2 may not process, or a different method may be use ### Find Transaction Hash in BlockScout -1. Go to BlockScout at [https://blockscout.com/xdai/mainnet](https://blockscout.com/xdai/mainnet) and enter the address that originated the transaction (typically your wallet address). If you were using a contract to interact with the bridge (in this case use the contract that called the relayToken method) enter that address. +1. Go to BlockScout at https://gnosis.blockscout.com/ and enter the address that originated the transaction (typically your wallet address). If you were using a contract to interact with the bridge (in this case use the contract that called the relayToken method) enter that address. ![](/img/bridges/xdaibridge/xdai-bs.jpg) @@ -212,7 +212,6 @@ The process will be similar for other Ethereum wallets. Find your past transacti ![Copy the tx hash for the contract interaction](/img/bridges/xdaibridge/MM2.jpg) - ## View Inbound (Dai to xDai) Transactions When Dai is transferred from Ethereum to xDai on Gnosis, the amount of Dai in your wallet will decrease and the corresponding amount of xDai will increase. However, the transaction will not appear on the xDai side of the wallet. The easiest way to track it is in BlockScout with the Coin Balance History view. @@ -221,7 +220,7 @@ When Dai is transferred from Ethereum to xDai on Gnosis, the amount of Dai in yo ![Copy Address - you can be connected to Ethereum or Gnosis, it is the same address on both chains.](/img/bridges/xdaibridge/tut22.jpg) -2. Paste the address into BlockScout at [https://blockscout.com/xdai/mainnet](https://blockscout.com/xdai/mainnet/). +2. Paste the address into BlockScout at https://gnosis.blockscout.com/. ![](/img/bridges/xdaibridge/tut2.jpg) diff --git a/docs/node/faq.md b/docs/node/faq.md index af86ca0e..081e9c3f 100644 --- a/docs/node/faq.md +++ b/docs/node/faq.md @@ -28,16 +28,16 @@ Validators propose and vote on blocks to include in the chain. The chain is secu ### What is the deposit contract? -The deposit contract keeps track of validators and staking amounts. The GBC deposit contract is based on [the original Ethereum beacon chain deposit contract](https://github.com/ethereum/consensus-specs/blob/master/solidity\_deposit\_contract/deposit\_contract.sol), with [some additional functionality](/specs/security-audit). +The deposit contract keeps track of validators and staking amounts. The GBC deposit contract is based on [the original Ethereum beacon chain deposit contract](https://github.com/ethereum/consensus-specs/blob/master/solidity_deposit_contract/deposit_contract.sol), with [some additional functionality](/specs/security-audit). -* Contract Security Audit by Chainsecurity: [https://chainsecurity.com/security-audit/poa-network-stake-beacon-chain-sbc-deposit/](https://chainsecurity.com/security-audit/poa-network-stake-beacon-chain-sbc-deposit/) -* GBC Contract Address: [0x0B98057eA310F4d31F2a452B414647007d1645d9](https://blockscout.com/xdai/mainnet/address/0x0B98057eA310F4d31F2a452B414647007d1645d9) +- Contract Security Audit by Chainsecurity: [https://chainsecurity.com/security-audit/poa-network-stake-beacon-chain-sbc-deposit/](https://chainsecurity.com/security-audit/poa-network-stake-beacon-chain-sbc-deposit/) +- GBC Contract Address: [0x0B98057eA310F4d31F2a452B414647007d1645d9](https://gnosis.blockscout.com/address/0x0B98057eA310F4d31F2a452B414647007d1645d9) ### How much do validators earn in rewards? This varies based on how many validators are participating. As the number of validators increases, the reward for validation is reduced as security becomes increasingly decentralized. Additional info is available on the [incentives page](/node/rewards-penalties). -You can view the current reward yield and other statistics on the [Gnosis Beacon Chain Dune Analytics dashboard](https://dune.xyz/maxaleks/Gnosis-Beacon-Chain-\(Deposits\)). +You can view the current reward yield and other statistics on the [Gnosis Beacon Chain Dune Analytics dashboard](). ### How many validator processes can run per node? @@ -112,9 +112,9 @@ For BLS withdrawal credentials, make sure to keep the mnemonic phrase from the k For ETH1 withdrawal credentials, make sure you have full control over the specified address and can execute transactions on behalf of this address. Three common options for ETH1 withdrawal credentials: -* **EOA address**. Make sure to keep its private key / mnemonic in a secure place, so that you will have access to it once withdrawals are enabled. -* **Gnosis Safe multisig**. Make sure you can execute calls on behalf of the safe address once withdrawals are enabled. -* **Stub proxy**. For advanced users and service providers, another option is to deploy a proxy contract with an empty implementation. Once all details about the withdrawals are known, you can upgrade your proxy to any implementation that suits your needs. Just make sure you have full control over the upgradeability procedure, so that you will be able to update an implementation address once withdrawals are enabled. +- **EOA address**. Make sure to keep its private key / mnemonic in a secure place, so that you will have access to it once withdrawals are enabled. +- **Gnosis Safe multisig**. Make sure you can execute calls on behalf of the safe address once withdrawals are enabled. +- **Stub proxy**. For advanced users and service providers, another option is to deploy a proxy contract with an empty implementation. Once all details about the withdrawals are known, you can upgrade your proxy to any implementation that suits your needs. Just make sure you have full control over the upgradeability procedure, so that you will be able to update an implementation address once withdrawals are enabled. ## Validator Setup (Technical) @@ -122,5 +122,5 @@ For ETH1 withdrawal credentials, make sure you have full control over the specif It depends on the mode and hardware specifications. Typically 24 hours should be allowed. -* For more information on syncing with Nethermind see [https://github.com/NethermindEth/docs/blob/master/ethereum-client/sync-modes.md](https://github.com/NethermindEth/docs/blob/master/ethereum-client/sync-modes.md) -* To learn more about reading logs during syncing see [https://docs.nethermind.io/nethermind/first-steps-with-nethermind/getting-started#explaining-nethermind-logs](https://docs.nethermind.io/nethermind/first-steps-with-nethermind/getting-started#explaining-nethermind-logs) +- For more information on syncing with Nethermind see [https://github.com/NethermindEth/docs/blob/master/ethereum-client/sync-modes.md](https://github.com/NethermindEth/docs/blob/master/ethereum-client/sync-modes.md) +- To learn more about reading logs during syncing see [https://docs.nethermind.io/nethermind/first-steps-with-nethermind/getting-started#explaining-nethermind-logs](https://docs.nethermind.io/nethermind/first-steps-with-nethermind/getting-started#explaining-nethermind-logs) diff --git a/docs/node/guide/validator/deposit.md b/docs/node/guide/validator/deposit.md index cb41f8ca..204e6c5a 100644 --- a/docs/node/guide/validator/deposit.md +++ b/docs/node/guide/validator/deposit.md @@ -64,7 +64,7 @@ If you can't upload the file, you may want to check the file permissions to make You are responsible for the transaction. Fraudulent websites might try to lure you into sending funds to them, instead of the official deposit contract. Make sure that you are sending the transaction with the correct data. :::caution -Verify that the contract address you're interacting with is [0x9C58BAcC331c9aa871AFD802DB6379a98e80CEdb](https://blockscout.com/xdai/mainnet/address/0x9C58BAcC331c9aa871AFD802DB6379a98e80CEdb/transactions) (GNO on Gnosis Chain) +Verify that the contract address you're interacting with is [0x9C58BAcC331c9aa871AFD802DB6379a98e80CEdb](https://gnosis.blockscout.com/address/0x9C58BAcC331c9aa871AFD802DB6379a98e80CEdb/transactions) (GNO on Gnosis Chain) ![](/img/node/safety-1.png) @@ -80,7 +80,7 @@ Check that the transaction uses the `transferAndCall` method. :::caution -Check that the transaction's data includes the Deposit Contract address ([0x0B98057eA310F4d31F2a452B414647007d1645d9](https://blockscout.com/xdai/mainnet/address/0x0B98057eA310F4d31F2a452B414647007d1645d9/transactions)) +Check that the transaction's data includes the Deposit Contract address ([0x0B98057eA310F4d31F2a452B414647007d1645d9](https://gnosis.blockscout.com/address/0x0B98057eA310F4d31F2a452B414647007d1645d9/transactions)) ``` 0x4000aea00000000000000000000000000b98057ea310f4d31f2a452b414647007d1645d9 diff --git a/docs/node/rewards-penalties.md b/docs/node/rewards-penalties.md index bf5c0491..04f0c8bc 100644 --- a/docs/node/rewards-penalties.md +++ b/docs/node/rewards-penalties.md @@ -7,15 +7,17 @@ title: Rewards & Penalties You are responsible for your node, including ensuring uptime, correct behavior, and monitoring. If your node is not responding properly, or is displaying dishonest behavior (like running keys on 2 nodes at the same time), you will be penalized. ### Proof-of-Stake -- Gnosis (and Ethereum) utilize a Proof-of-Stake cryptoeconomic incentive system to secure the network and disincentivize malicious behavior by nodes. -- Nodes that play an active role in validating the network are required to stake [32 mGNO](../about/tokens/gno.md) (i.e. 1 GNO) per validator. They receive periodic rewards for each epoch that they stay online and performing their duties. -- However, if they engage in malicious or disruptive activity on the network, their stake gets "slashed", and they can also be permanently removed from the validator pool. -- Nodes that go offline also attract a penalty for "inactivity leaks", although these are significantly less harsh if the node is offline only for a short period of time. + +- Gnosis (and Ethereum) utilize a Proof-of-Stake cryptoeconomic incentive system to secure the network and disincentivize malicious behavior by nodes. +- Nodes that play an active role in validating the network are required to stake [32 mGNO](../about/tokens/gno.md) (i.e. 1 GNO) per validator. They receive periodic rewards for each epoch that they stay online and performing their duties. +- However, if they engage in malicious or disruptive activity on the network, their stake gets "slashed", and they can also be permanently removed from the validator pool. +- Nodes that go offline also attract a penalty for "inactivity leaks", although these are significantly less harsh if the node is offline only for a short period of time. ## Rewards + ### Current Yield -- The current yield on GNO staking can be found in this [Dune Dashboard](https://dune.xyz/maxaleks/Gnosis-Beacon-Chain-\(Deposits\)). +- The current yield on GNO staking can be found in this [Dune Dashboard](). - As of Nov 2022, GNO staking has a ~15-16% yield. ### Rewards Calculation: @@ -26,7 +28,7 @@ Example: A validator with index 10 proposes a block. The base reward for proposi - **Block Attestations**: The reward for attesting to a block features a base reward that diminishes over time. Initially set at 100%, the base reward decreases by 1% for every 1000 slots, maintaining the attractiveness of block proposal rewards even as the number of validators grows. -Example: A validator with index 100 attests to a block. The base reward for attesting to a block is 100, and the additional reward is 99%. The total reward for the validator is 100 * 0.99 = 99. +Example: A validator with index 100 attests to a block. The base reward for attesting to a block is 100, and the additional reward is 99%. The total reward for the validator is 100 \* 0.99 = 99. ### Understanding Gas Consumption and Transaction Fees @@ -40,11 +42,11 @@ For example, if the base fee is 10 gwei and the gas price is 100 gwei, then the :::info -Gnosis' rewards curve was [proposed in Nov 2021](https://forum.gnosis.io/t/launch-parameters-for-gnosis-beacon-chain-gbc/2200) in a Gnosis Forum post. +Gnosis' rewards curve was [proposed in Nov 2021](https://forum.gnosis.io/t/launch-parameters-for-gnosis-beacon-chain-gbc/2200) in a Gnosis Forum post. ::: -- The minimum requirement to run a validator is [32 mGNO](/about/tokens/gno) (i.e. 1 GNO). +- The minimum initial stake to run a validator is [1 GNO](/about/tokens/gno) . - The reward rate drops with more active validators | GNO staked | % of GNO validating | reward for validators | Total GNO rewards | Overall inflation p.a. | @@ -64,10 +66,10 @@ Gnosis follows Ethereum's Proof-of-Stake penalties. ### "Offline" Penalties :::tip Read more -[Upgrading Ethereum: Penalties](https://eth2book.info/bellatrix/part2/incentives/penalties/) +[Upgrading Ethereum: Penalties](https://eth2book.info/bellatrix/part2/incentives/penalties/) ::: -The most common "penalty" validators encounter is if they are offline, or are late in performing their duties of attesting or proposing blocks. +The most common "penalty" validators encounter is if they are offline, or are late in performing their duties of attesting or proposing blocks. - Generally speaking, the penalties for being offline (or late) are equal to the rewards that a validator would have received if they were online - If your validator is [online more than 42.5% of the time](https://eth2book.info/bellatrix/part2/incentives/penalties/#attestation-penalties), you will be earning a positive return @@ -75,34 +77,38 @@ The most common "penalty" validators encounter is if they are offline, or are la - There is no penalty for missing the head vote. - There is no penalty for failing to propose a block. - There is no penalty for missing a sync committee (except the lost rewards). + ### Inactivity Leak :::tip Read more [Upgrading Ethereum: Inactivity Leak](https://eth2book.info/bellatrix/part2/incentives/inactivity/) ::: -Gnosis will move into a "inactivity leak" mode, if a large number (i.e. >1/3) of validators are offline at the same time causing the network to not finalize. +Gnosis will move into a "inactivity leak" mode, if a large number (i.e. >1/3) of validators are offline at the same time causing the network to not finalize. - "Offline" validators receive increasingly large penalties based on their track records -- This is designed to restore finality by reducing the stake of "offline" validators, who may get ejected from the network if their stake drops below the minimum required (i.e. 16 mGNO) +- This is designed to restore finality by reducing the stake of "offline" validators, who may get ejected from the network if their stake drops below the minimum required (i.e. 16 mGNO or 0.5 GNO) +- While the initial stake is 1 GNO , a validator is allowed to continue validating even after being penalized so long as the stake is above 16 mGNO. + ### Slashings :::tip Read more + - [Ethereum.org: Slashing](https://ethereum.org/en/developers/docs/consensus-mechanisms/pos/rewards-and-penalties/#slashing) - [Upgrading Ethereum: Slashing](https://eth2book.info/bellatrix/part2/incentives/slashing/) -::: + ::: -Slashing is the most serious penalty and results in losing a potentially significant amount of stake, and possible ejection of a validator from the network. This is when validators break very specific protocol rules that prevent the network from functioning effectively. +Slashing is the most serious penalty and results in losing a potentially significant amount of stake, and possible ejection of a validator from the network. This is when validators break very specific protocol rules that prevent the network from functioning effectively. -In these cases, 1/32 of a validator's staked GNO is immediately burned, and the validator enters a removal process from the chain. +In these cases, 1/32 of a validator's staked GNO is immediately burned, and the validator enters a removal process from the chain. -- "Double signing" is the most common slashing offence, where a validator proposes and signs two different blocks at the same slot. This often happens when a validator is run in two machines at once (e.g. redundancy). +- "Double signing" is the most common slashing offence, where a validator proposes and signs two different blocks at the same slot. This often happens when a validator is run in two machines at once (e.g. redundancy). - "Double voting" by attesting to two candidates for the same block - Attesting to a block that "surrounds" another one (i.e. changing history) ### Resources -We recommend the following readings for a more in-depth understanding of validator penalties. +We recommend the following readings for a more in-depth understanding of validator penalties. - [Ethereum.org on Proof-of-stake Rewards and Penalties](https://ethereum.org/en/developers/docs/consensus-mechanisms/pos/rewards-and-penalties/) - [Upgrading Ethereum on "The Incentive Layer"](https://eth2book.info/bellatrix/part2/incentives/) diff --git a/docs/specs/bug-bounty.md b/docs/specs/bug-bounty.md index d752c24d..0ae6a516 100644 --- a/docs/specs/bug-bounty.md +++ b/docs/specs/bug-bounty.md @@ -7,7 +7,7 @@ keywords: [gnosis security, gnosis bounty, bug bounty program, gnosis immunefi] ## Immunefi Bug Bounty -Bounties are an important tool for testing and enhancing application and contract security. We appreciate the skilled hackers and programmers within the community and believe in rewarding those working to protect and strengthen the ecosystem. Working in partnership with [Immunefi](https://immunefi.com/), we will be releasing additional bounties in the near future, and invite the community to help identify any possible exploits we may have missed. +Bounties are an important tool for testing and enhancing application and contract security. We appreciate the skilled hackers and programmers within the community and believe in rewarding those working to protect and strengthen the ecosystem. Working in partnership with [Immunefi](https://immunefi.com/), we will be releasing additional bounties in the near future, and invite the community to help identify any possible exploits we may have missed. Security is the #1 priority of the Gnosis team. This bounty program is not being enacted in response to any know exploits, we are proactively implementing to ensure safety and soundness of our applications and protect users and their funds. @@ -16,6 +16,7 @@ There are two ongoing bug bounty programs: [Bridges bug bounty](https://immunef Each bug bounty program requires different assets in scope and both offer rewards determined by thread level. ## Web/app Bounty + ### Asset in scope Assets in scopes includes Gnosis Chain documentation, forum, lock, RPC, beacon chain explorer, checkpoint, and block explorer. @@ -24,57 +25,57 @@ Only the following assets in the table are considered. If an impact can be cause For specific assets, only specific thread level bug reports may be submitted. -| Type | Target | Only High/Critical severity | -| --- | --- | --- | -| Websites and Applications - Doc (Gnosis Chain) | http://docs.gnosis.io | ✅ All level | -| Websites and Applications - Forum (Gnosis Chain) | http://forum.gnosis.io | ⚠️High | -| Websites and Applications - Lock (Gnosis Chain) | http://lock.gnosis.io | ✅ All level | -| Websites and Applications - RPC GBC (Chiado Testnet) | http://rpc-gbc.chiadochain.net | ✅ All level | -| Websites and Applications - RPC (Chiado Testnet) | http://rpc.chiadochain.net | ✅ All level | -| Websites and Applications - RPC (Gnosis Chain) | http://rpc.gnosischain.com | ✅ All level | -| Websites and Applications - RPC GBC (Gnosis Chain) | http://rpc-gbc.gnosischain.com | ✅ All level | -| Websites and Applications - RPC (Bicocca) | http://rpc.bicoccachain.net | ✅ All level | -| Websites and Applications - Beacon (Chiado Testnet) | http://beacon.chiadochain.net | 🆘 Critical | -| Websites and Applications - Blockscout (Chiado Testnet) | http://blockscout.chiadochain.net | 🆘 Critical | -| Websites and Applications - Checkpoint (Gnosis Chain) | http://checkpoint.gnosischain.com | 🆘 Critical | -| Websites and Applications - Beacon (Gnosis Chain) | http://beacon.gnosischain.com | 🆘 Critical | -| Websites and Applications - Explorer (Bicocca) | http://blockscout.bicoccachain.net | 🆘 Critical | +| Type | Target | Only High/Critical severity | +| ------------------------------------------------------- | ---------------------------------- | --------------------------- | +| Websites and Applications - Doc (Gnosis Chain) | http://docs.gnosis.io | ✅ All level | +| Websites and Applications - Forum (Gnosis Chain) | http://forum.gnosis.io | ⚠️High | +| Websites and Applications - Lock (Gnosis Chain) | http://lock.gnosis.io | ✅ All level | +| Websites and Applications - RPC GBC (Chiado Testnet) | http://rpc-gbc.chiadochain.net | ✅ All level | +| Websites and Applications - RPC (Chiado Testnet) | http://rpc.chiadochain.net | ✅ All level | +| Websites and Applications - RPC (Gnosis Chain) | http://rpc.gnosischain.com | ✅ All level | +| Websites and Applications - RPC GBC (Gnosis Chain) | http://rpc-gbc.gnosischain.com | ✅ All level | +| Websites and Applications - RPC (Bicocca) | http://rpc.bicoccachain.net | ✅ All level | +| Websites and Applications - Beacon (Chiado Testnet) | http://beacon.chiadochain.net | 🆘 Critical | +| Websites and Applications - Blockscout (Chiado Testnet) | http://blockscout.chiadochain.net | 🆘 Critical | +| Websites and Applications - Checkpoint (Gnosis Chain) | http://checkpoint.gnosischain.com | 🆘 Critical | +| Websites and Applications - Beacon (Gnosis Chain) | http://beacon.gnosischain.com | 🆘 Critical | +| Websites and Applications - Explorer (Bicocca) | http://blockscout.bicoccachain.net | 🆘 Critical | ### Reward by Thread Level Rewards are distributed according to the impact of the vulnerability based on the [Immunefi Vulnerability Severity Classification System v2.2.](https://immunefi.com/immunefi-vulnerability-severity-classification-system-v2-2/) -| Impact | Reward | -| --- | --- | -| Critical* | USD $15,000 to USD $50,000 | -| High* | USD $10,000 to USD $15,000 | -| Medium | USD $5,000 | -| Low | USD $1,500 | +| Impact | Reward | +| ---------- | -------------------------- | +| Critical\* | USD $15,000 to USD $50,000 | +| High\* | USD $10,000 to USD $15,000 | +| Medium | USD $5,000 | +| Low | USD $1,500 | -*All Critical and High web/app vulnerabilities are scaled based on internally established team criteria, taking into account the exploitability of the bug, the impact it causes, the report quality (at the discretion of the team), and the likelihood of the vulnerability presenting itself, which is especially factored in with bug reports requiring multiple conditions to be met that are currently not in place. However, there is a minimum reward of USD 10 000 for High impact web/app impact vulnerabilities and USD 15 000 for Critical web/app impact vulnerabilities. Rewards will be provided at the determined fair value by the team depending on these conditions, assuming that the bug report is in-scope of the bug bounty program. +\*All Critical and High web/app vulnerabilities are scaled based on internally established team criteria, taking into account the exploitability of the bug, the impact it causes, the report quality (at the discretion of the team), and the likelihood of the vulnerability presenting itself, which is especially factored in with bug reports requiring multiple conditions to be met that are currently not in place. However, there is a minimum reward of USD 10 000 for High impact web/app impact vulnerabilities and USD 15 000 for Critical web/app impact vulnerabilities. Rewards will be provided at the determined fair value by the team depending on these conditions, assuming that the bug report is in-scope of the bug bounty program. All web/app bug reports must come with a PoC with an end-effect impacting an asset-in-scope in order to be considered for a reward. Only the following impacts in scope are accepted within this bug bounty program. -| Impact | Scope | -| --- | --- | -| Critical | Execute arbitrary system commands | -| Critical | Retrieve sensitive data/files from a running server such as /etc/shadow, database passwords, and blockchain keys(this does not include non-sensitive environment variables, open source code, or usernames) | -| Critical | Taking down the application/website | -| Critical | Taking state-modifying authenticated actions (with or without blockchain state interaction) on behalf of other users without any interaction by that user, such as, changing registration information, commenting, voting, making trades, withdrawals, etc. | -| Critical | Direct theft of user funds | -| Critical | Malicious interactions with an already-connected wallet such as modifying transaction arguments or parameters, substituting contract addresses, submitting malicious transactions | -| Critical | Injection of malicious HTML or XSS through NFT metadata | -| High | Injecting/modifying the static content on the target application without Javascript (Persistent) such as HTML injection without Javascript, replacing existing text with arbitrary text, arbitrary file uploads, etc. | -| High | Changing sensitive details of other users (including modifying browser local storage) without already-connected wallet interaction and with up to one click of user interaction, such as email or password of the victim, etc. | -| High | Subdomain takeover with already-connected wallet interaction | -| Medium | Changing non-sensitive details of other users (including modifying browser local storage) without already-connected wallet interaction and with up to one click of user interaction, such as changing the first/last name of user, or en/disabling notification | -| Medium | Injecting/modifying the static content on the target application without Javascript (Reflected) such as reflected HTML injection or loading external site data | -| Medium | Redirecting users to malicious websites (Open Redirect) | -| Low | Changing details of other users (including modifying browser local storage) without already-connected wallet interaction and with significant user interaction such as iframing leading to modifying the backend/browser state (demonstrate impact with PoC) | -| Low | Any impact involving a publicly released CVE (demonstrate impact with PoC) | -| Low | Temporarily disabling user to access target site, such as locking up the victim from login, cookie bombing, etc. | +| Impact | Scope | +| -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Critical | Execute arbitrary system commands | +| Critical | Retrieve sensitive data/files from a running server such as /etc/shadow, database passwords, and blockchain keys(this does not include non-sensitive environment variables, open source code, or usernames) | +| Critical | Taking down the application/website | +| Critical | Taking state-modifying authenticated actions (with or without blockchain state interaction) on behalf of other users without any interaction by that user, such as, changing registration information, commenting, voting, making trades, withdrawals, etc. | +| Critical | Direct theft of user funds | +| Critical | Malicious interactions with an already-connected wallet such as modifying transaction arguments or parameters, substituting contract addresses, submitting malicious transactions | +| Critical | Injection of malicious HTML or XSS through NFT metadata | +| High | Injecting/modifying the static content on the target application without Javascript (Persistent) such as HTML injection without Javascript, replacing existing text with arbitrary text, arbitrary file uploads, etc. | +| High | Changing sensitive details of other users (including modifying browser local storage) without already-connected wallet interaction and with up to one click of user interaction, such as email or password of the victim, etc. | +| High | Subdomain takeover with already-connected wallet interaction | +| Medium | Changing non-sensitive details of other users (including modifying browser local storage) without already-connected wallet interaction and with up to one click of user interaction, such as changing the first/last name of user, or en/disabling notification | +| Medium | Injecting/modifying the static content on the target application without Javascript (Reflected) such as reflected HTML injection or loading external site data | +| Medium | Redirecting users to malicious websites (Open Redirect) | +| Low | Changing details of other users (including modifying browser local storage) without already-connected wallet interaction and with significant user interaction such as iframing leading to modifying the backend/browser state (demonstrate impact with PoC) | +| Low | Any impact involving a publicly released CVE (demonstrate impact with PoC) | +| Low | Temporarily disabling user to access target site, such as locking up the victim from login, cookie bombing, etc. | ### Out of scope & Rules @@ -85,7 +86,7 @@ bounty program:** - Attacks requiring access to leaked keys/credentials - Attacks requiring access to privileged addresses (governance, strategist) - Incorrect data supplied by third party oracles - - Not to exclude oracle manipulation/flash loan attacks + - Not to exclude oracle manipulation/flash loan attacks - Basic economic governance attacks (e.g. 51% attack) - Lack of liquidity - Best practice critiques @@ -94,38 +95,35 @@ bounty program:** **The following activities are prohibited by bug bounty program:** - Any testing with mainnet or public testnet contracts; all testing should be -done on private testnets + done on private testnets - Any testing with pricing oracles or third party smart contracts - Attempting phishing or other social engineering attacks against our employees -and/or customers + and/or customers - Any testing with third party systems and applications (e.g. browser -extensions) as well as websites (e.g. SSO providers, advertising networks) + extensions) as well as websites (e.g. SSO providers, advertising networks) - Any denial of service attacks - Automated testing of services that generates significant amounts of traffic - Public disclosure of an unpatched vulnerability in an embargoed bounty -Please visit [Immunefi bounty page]( -https://immunefi.com/bounty/gnosischainwebapp/) for more details. +Please visit [Immunefi bounty page](https://immunefi.com/bounty/gnosischainwebapp/) for more details. Tweet: https://twitter.com/gnosischain/status/1651285327125053440 - - ## Bridge(Omnibridge, xDAI Bridge) Bounty ### Asset in scope All smart contract bug from Gnosis Chain Bridges includes ETH-xDAI Omnibridge, xDAI bridge, BSC-xDAI Omnibridge. -| Type | Target | -| --- | --- | -| Smart Contract - DAI-xDAI TokenBridge contract on the Ethereum Mainnet | https://etherscan.io/address/0x4aa42145Aa6Ebf72e164C9bBC74fbD3788045016 | -| Smart Contract - DAI-xDAI OmniBridge contract on the Gnosis chain | https://blockscout.com/xdai/mainnet/address/0x7301CFA0e1756B71869E93d4e4Dca5c7d0eb0AA6 | -| Smart Contract - ETH-xDAI OmniBridge contract on the Ethereum Mainnet | https://etherscan.io/address/0x88ad09518695c6c3712AC10a214bE5109a655671 | -| Smart Contract - ETH-xDAI OmniBridge contract on the Gnosis chain | https://blockscout.com/xdai/mainnet/address/0xf6A78083ca3e2a662D6dd1703c939c8aCE2e268d | -| Smart Contract - BSC-xDAI OmniBridge contract on the Binance Smart Chain | https://bscscan.com/address/0xf0b456250dc9990662a6f25808cc74a6d1131ea9 | -| Smart Contract - BSC-xDAI OmniBridge contract on the Gnosis chain | https://blockscout.com/xdai/mainnet/address/0x59447362798334d3485c64D1e4870Fde2DDC0d75| -| | | +| Type | Target | +| ------------------------------------------------------------------------ | -------------------------------------------------------------------------------- | +| Smart Contract - DAI-xDAI TokenBridge contract on the Ethereum Mainnet | https://etherscan.io/address/0x4aa42145Aa6Ebf72e164C9bBC74fbD3788045016 | +| Smart Contract - DAI-xDAI OmniBridge contract on the Gnosis chain | https://gnosis.blockscout.com/address/0x7301CFA0e1756B71869E93d4e4Dca5c7d0eb0AA6 | +| Smart Contract - ETH-xDAI OmniBridge contract on the Ethereum Mainnet | https://etherscan.io/address/0x88ad09518695c6c3712AC10a214bE5109a655671 | +| Smart Contract - ETH-xDAI OmniBridge contract on the Gnosis chain | https://gnosis.blockscout.com/address/0xf6A78083ca3e2a662D6dd1703c939c8aCE2e268d | +| Smart Contract - BSC-xDAI OmniBridge contract on the Binance Smart Chain | https://bscscan.com/address/0xf0b456250dc9990662a6f25808cc74a6d1131ea9 | +| Smart Contract - BSC-xDAI OmniBridge contract on the Gnosis chain | https://gnosis.blockscout.com/address/0x59447362798334d3485c64D1e4870Fde2DDC0d75 | +| | | ### Reward by Thread level @@ -135,13 +133,13 @@ All smart contract bug reports must come with a PoC with an end-effect impacting Only the following smart contract impacts are accepted within this bug bounty program: -| Smart Contract Impact | Reward | -| --- | --- | -| Critical* | Up to USD 2,000,000 | -| High | USD $10,000 | -| Medium | USD $1,000 | +| Smart Contract Impact | Reward | +| --------------------- | ------------------- | +| Critical\* | Up to USD 2,000,000 | +| High | USD $10,000 | +| Medium | USD $1,000 | -*All Critical smart contract vulnerabilities are further capped at 10% of economic damage, primarily taking into consideration the funds at risk. However, there is a minimum reward of **USD 50 000**. +\*All Critical smart contract vulnerabilities are further capped at 10% of economic damage, primarily taking into consideration the funds at risk. However, there is a minimum reward of **USD 50 000**. Payouts are handled by the Gnosis Chain team directly and are denominated in USD. However, payouts are done in USDT for payments up to USD 100 000. All remaining rewards are paid in STAKE. @@ -153,7 +151,7 @@ Payouts are handled by the Gnosis Chain team directly and are denominated in USD - Attacks requiring access to leaked keys/credentials - Attacks requiring access to privileged addresses (governance, strategist) - Incorrect data supplied by third party oracles - - Not to exclude oracle manipulation/flash loan attacks + - Not to exclude oracle manipulation/flash loan attacks - Basic economic governance attacks (e.g. 51% attack) - Lack of liquidity - Best practice critiques @@ -173,8 +171,6 @@ Please visit [Immunefi bounty page](https://immunefi.com/bounty/gnosischain/) fo More info -> [https://medium.com/immunefi/xdai-stake-hosts-2-000-000-bug-bounty-on-immunefi-3760e0687616](https://medium.com/immunefi/xdai-stake-hosts-2-000-000-bug-bounty-on-immunefi-3760e0687616) - - ## What’s next? - [Submit a bug](https://bugs.immunefi.com/) @@ -182,8 +178,7 @@ More info -> [https://medium.com/immunefi/xdai-stake-hosts-2-000-000-bug-bounty- ## FAQ -1. Is the bug bounty program time limited? - No. - -2. How to submit a bug on Immunefi? - https://medium.com/immunefi/a-hackers-guide-to-submitting-bugs-on-immunefi-1e6b7ada71a9 +1. Is the bug bounty program time limited? + No. +2. How to submit a bug on Immunefi? + https://medium.com/immunefi/a-hackers-guide-to-submitting-bugs-on-immunefi-1e6b7ada71a9 diff --git a/docs/specs/gbc/README.md b/docs/specs/gbc/README.md index 83dcd0d7..e4d40ee1 100644 --- a/docs/specs/gbc/README.md +++ b/docs/specs/gbc/README.md @@ -11,26 +11,26 @@ keywords: [gnosis beacon chain, gnosis upgradeability, gbc, gbc contracts] To stake on GBC, follow the Validator instructions starting with [Validator Requirements and Responsibilities](/node/guide). ::: -| Contract | Address | -| -------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- | -| GBC Deposit Contract | [0x0B98057eA310F4d31F2a452B414647007d1645d9](https://blockscout.com/xdai/mainnet/address/0x0B98057eA310F4d31F2a452B414647007d1645d9) | -| GNO-> mGNO contract | [0x647507A70Ff598F386CB96ae5046486389368C66](https://blockscout.com/xdai/mainnet/address/0x647507A70Ff598F386CB96ae5046486389368C66) | +| Contract | Address | +| -------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- | +| GBC Deposit Contract | [0x0B98057eA310F4d31F2a452B414647007d1645d9](https://gnosis.blockscout.com/address/0x0B98057eA310F4d31F2a452B414647007d1645d9) | +| GNO-> mGNO contract | [0x647507A70Ff598F386CB96ae5046486389368C66](https://gnosis.blockscout.com/address/0x647507A70Ff598F386CB96ae5046486389368C66) | | GNO token on Gnosis | [0x9C58BAcC331c9aa871AFD802DB6379a98e80CEdb](https://blockscout.com/xdai/mainnet/token/0x9C58BAcC331c9aa871AFD802DB6379a98e80CEdb/token-transfers) | -| mGNO token on Gnosis | [0x722fc4DAABFEaff81b97894fC623f91814a1BF68](https://blockscout.com/xdai/mainnet/address/0x722fc4DAABFEaff81b97894fC623f91814a1BF68) | +| mGNO token on Gnosis | [0x722fc4DAABFEaff81b97894fC623f91814a1BF68](https://gnosis.blockscout.com/address/0x722fc4DAABFEaff81b97894fC623f91814a1BF68) | ### **Initial Parameters (subject to change)** -| Variable | Value | -| ------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| Staking amount | 32 mGNO (equivalent to 1 GNO) | -| Block time | 5 seconds | -| Validator slots per epoch | 16 (with further reduction possible, [N > 1 honest proposer/epoch as per V. Buterin](https://notes.ethereum.org/@vbuterin/rkhCgQteN?type=view#Why-32-ETH-validator-sizes)) | -| Validators per slot | 128 ([see more on minimum committee size](https://medium.com/@chihchengliang/minimum-committee-size-explained-67047111fa20)) | -| Epoch time | 80 seconds | -| Slashing | Reductions to 16 mGNO, then removal | -| Clients | Prysm, Lighthouse | -| Custom Deposit Contract |

  • mGNO deposit (ERC20 enabled)
  • Upgradeable
  • Claiming on accidental locks
  • Custom network keys generation (deposit-cli)
| -| Explorer |

Modified beaconchain explorer
🔍 beacon.gnosischain.com

| -| RPC | [https://rpc-gbc.gnosischain.com](https://rpc-gbc.gnosischain.com) | +| Variable | Value | +| ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Staking amount | 32 mGNO (equivalent to 1 GNO) | +| Block time | 5 seconds | +| Validator slots per epoch | 16 (with further reduction possible, [N > 1 honest proposer/epoch as per V. Buterin](https://notes.ethereum.org/@vbuterin/rkhCgQteN?type=view#Why-32-ETH-validator-sizes)) | +| Validators per slot | 128 ([see more on minimum committee size](https://medium.com/@chihchengliang/minimum-committee-size-explained-67047111fa20)) | +| Epoch time | 80 seconds | +| Slashing | Reductions to 16 mGNO, then removal | +| Clients | Prysm, Lighthouse | +| Custom Deposit Contract |

  • mGNO deposit (ERC20 enabled)
  • Upgradeable
  • Claiming on accidental locks
  • Custom network keys generation (deposit-cli)
| +| Explorer |

Modified beaconchain explorer
🔍 beacon.gnosischain.com

| +| RPC | [https://rpc-gbc.gnosischain.com](https://rpc-gbc.gnosischain.com) | | Launch MVP |

4096 validators
131,072 mGNO

83% APY

| -| Security Goal Prior to Merge |

50K+ validators

1.6M+ mGNO

23% APY

| +| Security Goal Prior to Merge |

50K+ validators

1.6M+ mGNO

23% APY

| diff --git a/docs/specs/gbc/upgradeability.md b/docs/specs/gbc/upgradeability.md index 77456542..6dca0dbb 100644 --- a/docs/specs/gbc/upgradeability.md +++ b/docs/specs/gbc/upgradeability.md @@ -2,6 +2,7 @@ description: Gnosis Beacon Chain has the ability to upgrade contracts keywords: [gnosis beacon chain, gnosis upgradeability] --- + # Upgradeability One differentiator for the Gnosis Beacon Chain relative to the Ethereum Beacon chain is the ability to upgrade contracts. A proxy pattern allows for this functionality, which can be extremely useful if an update is required (a bug is found, new functionality added etc). @@ -16,7 +17,6 @@ A proposed upgrade is presented to this board and a minimum of 7 signatures are ### Contracts managed by the Governance Board -* Deposit Contract: [0x0B98057eA310F4d31F2a452B414647007d1645d9](https://blockscout.com/xdai/mainnet/address/0x0B98057eA310F4d31F2a452B414647007d1645d9/read-contract) -* mGno Token Contract: [0x722fc4DAABFEaff81b97894fC623f91814a1BF68](https://blockscout.com/xdai/mainnet/address/0x722fc4DAABFEaff81b97894fC623f91814a1BF68/read-contract) -* GNO-mGNO Wrapper Contract: [0x647507A70Ff598F386CB96ae5046486389368C66](https://blockscout.com/xdai/mainnet/address/0x647507A70Ff598F386CB96ae5046486389368C66/read-contract) - +- Deposit Contract: [0x0B98057eA310F4d31F2a452B414647007d1645d9](https://gnosis.blockscout.com/address/0x0B98057eA310F4d31F2a452B414647007d1645d9/read-contract) +- mGno Token Contract: [0x722fc4DAABFEaff81b97894fC623f91814a1BF68](https://gnosis.blockscout.com/address/0x722fc4DAABFEaff81b97894fC623f91814a1BF68/read-contract) +- GNO-mGNO Wrapper Contract: [0x647507A70Ff598F386CB96ae5046486389368C66](https://gnosis.blockscout.com/address/0x647507A70Ff598F386CB96ae5046486389368C66/read-contract) diff --git a/docs/tools/oracles/chainlink.md b/docs/tools/oracles/chainlink.md index f94418e7..2de4f20b 100644 --- a/docs/tools/oracles/chainlink.md +++ b/docs/tools/oracles/chainlink.md @@ -14,9 +14,8 @@ Chainlink offers a tutorial on using secure data feeds with Gnosis. [See it in a ## Addresses -* **LINK Token on Gnosis**: [`0xE2e73A1c69ecF83F464EFCE6A5be353a37cA09b2`](https://blockscout.com/xdai/mainnet/address/0xE2e73A1c69ecF83F464EFCE6A5be353a37cA09b2) -* **Price Feeds on Gnosis:** [Latest list is available in the Chainlink Documentation](https://docs.chain.link/docs/data-feeds-gnosis-chain/#Gnosis%20Chain%20Mainnet) - +- **LINK Token on Gnosis**: [`0xE2e73A1c69ecF83F464EFCE6A5be353a37cA09b2`](https://gnosis.blockscout.com/address/0xE2e73A1c69ecF83F464EFCE6A5be353a37cA09b2) +- **Price Feeds on Gnosis:** [Latest list is available in the Chainlink Documentation](https://docs.chain.link/docs/data-feeds-gnosis-chain/#Gnosis%20Chain%20Mainnet) ## Basic Tutorial: Price Feeds @@ -40,7 +39,7 @@ There are several ways to create a new file. Here we: 2. Create a file in the folder called `PriceFeedTest.sol`. 3. Paste in the example code below the image. -![]() +![](/img/tools/chainlink/chain1.png) ### Example Code @@ -74,7 +73,7 @@ contract PriceConsumerV3 { */ function getLatestPrice() public view returns (int) { ( - uint80 roundID, + uint80 roundID, int price, uint startedAt, uint timeStamp, @@ -87,7 +86,7 @@ contract PriceConsumerV3 { The code below uses the Chainlink standard Price Consumer contract along with several modifications: -* We initialize the ETH/USD Gnosis Price Feed in the constructor +- We initialize the ETH/USD Gnosis Price Feed in the constructor ```solidity priceFeed = AggregatorV3Interface(0xa767f745331D267c7751297D982b050c93985627); @@ -99,7 +98,7 @@ We use the `getLatestPrice` function to return the current price. It pulls this Click on the Compiler Icon, adjust items (if necessary, we keep defaults here) and click the Compile button. -![]() +![](/img/tools/chainlink/chain2.png) ### 5) Deploy Contract @@ -108,7 +107,7 @@ Click on the Compiler Icon, adjust items (if necessary, we keep defaults here) a 3. Click **Deploy**. 4. Confirm the transaction in MetaMask. You account must be connected to Gnosis and have a small amount of xDai (see steps 1 and 2). -![]() +![](/img/tools/chainlink/chain3.png) ### 6) Check Contract @@ -120,7 +119,7 @@ Once deployed, click to expand the contract. Click `getLatestPrice` to check the ### 1) Find Deployed Contract -For transparency and interaction purposes, you can verify your contract on [BlockScout](https://blockscout.com/xdai/mainnet/). _Note, if a contract with the same bytecode has already been deployed and verified, your contract code may be viewable._ [_See this example_](https://blockscout.com/xdai/mainnet/address/0x681ef0446AA72723256f1De4d1BE7Dd9bb7F84Cf/contracts)_._ +For transparency and interaction purposes, you can verify your contract on [BlockScout](https://blockscout.com/xdai/mainnet/). _Note, if a contract with the same bytecode has already been deployed and verified, your contract code may be viewable._ [_See this example_](https://gnosis.blockscout.com/address/0x681ef0446AA72723256f1De4d1BE7Dd9bb7F84Cf/contracts)_._ 1. Copy the deployed contract address in Remix. 2. Go to [BlockScout](https://blockscout.com/xdai/mainnet/) and paste into the search field. @@ -151,4 +150,4 @@ Drag and drop the files into the interface and click **Verify & publish**. Once verified, you will see the checkmark next to the code, and you can read (and write) to your contract within the BlockScout environment. -![](/img/tools/chainlink/chain11.png) \ No newline at end of file +![](/img/tools/chainlink/chain11.png) diff --git a/docs/user-guide/bridges.md b/docs/user-guide/bridges.md deleted file mode 100644 index 9e25c912..00000000 --- a/docs/user-guide/bridges.md +++ /dev/null @@ -1 +0,0 @@ -Moved [here](../bridges/third-party.md) \ No newline at end of file diff --git a/sidebars.js b/sidebars.js index 1f1aa300..24b4d16a 100644 --- a/sidebars.js +++ b/sidebars.js @@ -124,9 +124,10 @@ const sidebars = { 'specs/security-audit', ], }, + ['about/faq/FAQ'], + ], - userguide: [{type: 'autogenerated', dirName: 'user-guide'}], ecosystems: [ 'ecosystems/README', diff --git a/static/img/bridges/diagrams/bridge-overview.drawio b/static/img/bridges/diagrams/bridge-overview.drawio index f329fa27..cd4ff349 100644 --- a/static/img/bridges/diagrams/bridge-overview.drawio +++ b/static/img/bridges/diagrams/bridge-overview.drawio @@ -1,263 +1,263 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/static/img/bridges/diagrams/bridge-overview.svg b/static/img/bridges/diagrams/bridge-overview.svg index a0029809..2395be32 100644 --- a/static/img/bridges/diagrams/bridge-overview.svg +++ b/static/img/bridges/diagrams/bridge-overview.svg @@ -1,58 +1,4 @@ -
Ethereum
Ethereum
Bridge
Validators
Bridge...
Omnibridge
(Native Token Bridge)
Omnibridge...
xDai Bridge
(xDai Bridge Contract)
xDai Bridge...
xDai Bridge
(Mints native gas token)
xDai Bridge...
Block Rewards Contract
Block Rewards Contract
Consensus
Consensus
Canonical Dai
(native asset)
Canonical Dai...
Dai 
(ERC-20)
Dai...
Gnosis
Gnosis
Arbitrary Message Bridge
Arbitrary Message Bridge
AMB Bridge
(Bridges Data)
AMB Bridge...
AMB Bridge
(Bridges Data)
AMB Bridge...
Bridge
Validators
Bridge...
Random Token
(ERC-20)
Random Token...
USDC (Eth)
(ERC-20)
USDC (Eth)...
Deposits
Deposits
Deposits
Deposits
Canonical ERC-20
(from Ethereum)
Canonical ERC-20...
Canonical USDC
(from Ethereum)
Canonical USDC...
Omnibridge
(Native Token Bridge)
Omnibridge...
Mints
Mints
Mints
Mints
xDai Bridge
xDai Bridge
3rd-Party Bridges
3rd-Party Bridges -
Examples:
Examples:
Viewer does not support full SVG 1.1
\ No newline at end of file + + + +
Ethereum
Ethereum
Bridge
Validators
Bridge...
Omnibridge
(Native Token Bridge)
Omnibridge...
xDai Bridge
(xDai Bridge Contract)
xDai Bridge...
xDai Bridge
(Mints native gas token)
xDai Bridge...
Block Rewards Contract
Block Rewards Contract
Consensus
Consensus
Canonical Dai
(native asset)
Canonical Dai...
Dai 
(ERC-20)
Dai...
Gnosis
Gnosis
Arbitrary Message Bridge
Arbitrary Message Bridge
AMB Bridge
(Bridges Data)
AMB Bridge...
AMB Bridge
(Bridges Data)
AMB Bridge...
Bridge
Validators
Bridge...
Random Token
(ERC-20)
Random Token...
USDC (Eth)
(ERC-20)
USDC (Eth)...
Deposits
Deposits
Deposits
Deposits
Canonical ERC-20
(from Ethereum)
Canonical ERC-20...
Canonical USDC
(from Ethereum)
Canonical USDC...
Omnibridge
(Native Token Bridge)
Omnibridge...
Mints
Mints
Mints
Mints
xDai Bridge
xDai Bridge
3rd-Party Bridges
3rd-Party Bridges
Examples:
Examples:
Text is not SVG - cannot display
\ No newline at end of file diff --git a/updates/2023/07-26-core-devs-call.md b/updates/2023/07-26-core-devs-call.md index 7b37a075..e732908d 100644 --- a/updates/2023/07-26-core-devs-call.md +++ b/updates/2023/07-26-core-devs-call.md @@ -1,5 +1,5 @@ --- -title: Core Devs Call - 07/26/2023 +title: Core Devs Call - 26/07/2023 authors: [dapplion, armaganercan] tags: [CoreDevsCall, gnosis] --- @@ -12,60 +12,58 @@ Welcome to the weekly Gnosis Core Devs Call, where members of the Gnosis team an The participants of this call include representatives from various teams such as Erigon, Gateway, Nethermind, Geth, Gnosis DevOps, Gnosis Core Devs, Gnosis DevRels, Gnosis Comms team, and community contributors. The presence of diverse team members ensures that discussions are comprehensive and informative, with insights from multiple perspectives. -For those who missed the live meeting, [a full recording is available on YouTube](https://youtu.be/DYi4jxbSKOY). +For those who missed the live meeting, [a full recording is available on YouTube](https://youtu.be/DYi4jxbSKOY). The Gnosis Core Devs Call is a crucial component of the Gnosis ecosystem. It provides an opportunity for participants to stay informed, share ideas and collaborate, thus driving innovation and progress within the Gnosis community. July 26, 2023 # Client Team Updates -## EL - -* **Nethermind**: -Issue when fetching events (`eth_getLogs`) on a contract that hasn’t emitted said event yet -{"jsonrpc":"2.0","result":[]}{"jsonrpc":"2.0","error":{"code":-32016,"message":"Request was canceled due to enabled timeout."},"id":null} -There’s a setting on Json RPC to disable streaming -Erigon will check the code as well -No specific updates -Working on a shadow fork with Carlos -Not sure if it’s going to be ready before mainnet hard fork -Withdrawing works just fine on Chiado -Rechecking everything -Fixed the “too many concurrent requests” issue - -* **Erigon**: -There was an issue for block syncs for older blocks which was fixed in 2.48.1 -Syncing from genesis works again -Was probably introduced in 2.46 or 2.47 -Working with Marcos for Hive tests - - -* **Geth**: -Nothing significant -Talked to Philippe and Martin -Calling the reward contract seems to work and return the correct result -The root is still wrong -Guillaume has several hypotheses -The state might not be saved to the database after a system transaction -Andrew from Erigon is getting Guillaume some traces for system transactions -Gateway provided Guillaume with an Erigon archive node +## EL +- **Nethermind**: + Issue when fetching events (`eth_getLogs`) on a contract that hasn’t emitted said event yet + {"jsonrpc":"2.0","result":[]}{"jsonrpc":"2.0","error":{"code":-32016,"message":"Request was canceled due to enabled timeout."},"id":null} + There’s a setting on Json RPC to disable streaming + Erigon will check the code as well + No specific updates + Working on a shadow fork with Carlos + Not sure if it’s going to be ready before mainnet hard fork + Withdrawing works just fine on Chiado + Rechecking everything + Fixed the “too many concurrent requests” issue + +- **Erigon**: + There was an issue for block syncs for older blocks which was fixed in 2.48.1 + Syncing from genesis works again + Was probably introduced in 2.46 or 2.47 + Working with Marcos for Hive tests + +- **Geth**: + Nothing significant + Talked to Philippe and Martin + Calling the reward contract seems to work and return the correct result + The root is still wrong + Guillaume has several hypotheses + The state might not be saved to the database after a system transaction + Andrew from Erigon is getting Guillaume some traces for system transactions + Gateway provided Guillaume with an Erigon archive node ## CL -* **Lighthouse** -PR to add Chiado -https://github.com/sigp/lighthouse/pull/4530 +- **Lighthouse** + PR to add Chiado + https://github.com/sigp/lighthouse/pull/4530 -* **Nimbus** -Added Chiado -https://github.com/status-im/nimbus-eth2/pull/5208 +- **Nimbus** + Added Chiado + https://github.com/status-im/nimbus-eth2/pull/5208 -* **Prsym** -Seems to at least start in the latest stable version (v4.0.7) -Doesn’t have the Gnosis presets, so works, but only after a good checkpoint sync and until the next sync committee -More testing needed +- **Prsym** + Seems to at least start in the latest stable version (v4.0.7) + Doesn’t have the Gnosis presets, so works, but only after a good checkpoint sync and until the next sync committee + More testing needed # Hive Tests @@ -98,7 +96,6 @@ Party Streamed online Who wants to join? - # Block Building Can we use Nethermind? @@ -107,41 +104,26 @@ Can definitely make it work Can we use Erigon? Will check - # Research Gnosis as a L2 thought experiment https://docs.google.com/document/d/1zZJswccklwEE3q_HZAQ7kDlKHHa2zzg4Fcw5Rbgf0n4/edit Polygon and Celo started talks about this - # Chain Infra -* **Gateway** -Was the deposit UI updated? -Apparently yes, tests pending -The issue with Nethermind was fixed -Decided to sync some Erigon nodes for non-archival mainnet to have some diversity - -* **Potential issues for the next hard fork** -Short block times could be an issue because of bigger blocks and thus higher latency to get a block across the network -Dapplion is questioning whether we actually even need blobs -Philippe thinks we should have them to be compatible with mainnet, even if we have to have less than mainnet -Martin also expected there to be demand -The zkEVM L2 for Gnosis Pay would be an example -There’s also some other partnerships with Spark / Fuel building on this -This might actually become a huge selling point for Gnosis as we (and Lukso now) are the only other chains with a beacon chain and thus 4844 compatibility -Changing the intervals for block building, attestation and aggregation would require consensus from all client devs - - - - - - - - - - - - - +- **Gateway** + Was the deposit UI updated? + Apparently yes, tests pending + The issue with Nethermind was fixed + Decided to sync some Erigon nodes for non-archival mainnet to have some diversity + +- **Potential issues for the next hard fork** + Short block times could be an issue because of bigger blocks and thus higher latency to get a block across the network + Dapplion is questioning whether we actually even need blobs + Philippe thinks we should have them to be compatible with mainnet, even if we have to have less than mainnet + Martin also expected there to be demand + The zkEVM L2 for Gnosis Pay would be an example + There’s also some other partnerships with Spark / Fuel building on this + This might actually become a huge selling point for Gnosis as we (and Lukso now) are the only other chains with a beacon chain and thus 4844 compatibility + Changing the intervals for block building, attestation and aggregation would require consensus from all client devs diff --git a/updates/archive/2020/xdai-weekly-recap-09-10-2020.md b/updates/archive/2020/xdai-weekly-recap-09-10-2020.md index fc04e06d..faff2dd9 100644 --- a/updates/archive/2020/xdai-weekly-recap-09-10-2020.md +++ b/updates/archive/2020/xdai-weekly-recap-09-10-2020.md @@ -32,7 +32,7 @@ The game uses an incredible amount of resources, and we've been working tireless To further support the universe, BlockScout released a Dark Forest theme so users can view contract interactions related to the game. It keeps users engaged with the universe and supports gamers verifying and viewing their DF transactions. -Live view: [https://blockscout.com/xdai/mainnet/address/0xa8688cCF5E407C1C782CF0c19b3Ab2cE477Fd739/transactions](https://blockscout.com/xdai/mainnet/address/0xa8688cCF5E407C1C782CF0c19b3Ab2cE477Fd739/transactions) +Live view: [https://gnosis.blockscout.com/address/0xa8688cCF5E407C1C782CF0c19b3Ab2cE477Fd739/transactions](https://gnosis.blockscout.com/address/0xa8688cCF5E407C1C782CF0c19b3Ab2cE477Fd739/transactions) ## 🌉 Bridge Engineering Updates diff --git a/updates/archive/2021/xdai-weekly-recap-15-01-2021.md b/updates/archive/2021/xdai-weekly-recap-15-01-2021.md index 27b199ae..696a5d60 100644 --- a/updates/archive/2021/xdai-weekly-recap-15-01-2021.md +++ b/updates/archive/2021/xdai-weekly-recap-15-01-2021.md @@ -11,7 +11,7 @@ import ArchiveWarning from '@site/src/components/ArchiveWarning'; ## 👩🏫 POSDAO Updates -[Staking Epoch 40 is now active with 14 validator pools and \~121 delegators](https://blockscout.com/xdai/mainnet/validators). During epoch 39 a validator pool was inactivated (mining address[ 0xb76756f95A9fB6ff9ad3E6cb41b734c1bd805103](https://blockscout.com/xdai/mainnet/address/0xb76756f95A9fB6ff9ad3E6cb41b734c1bd805103/transactions)) due to excessive downtime. +[Staking Epoch 40 is now active with 14 validator pools and \~121 delegators](https://blockscout.com/xdai/mainnet/validators). During epoch 39 a validator pool was inactivated (mining address[ 0xb76756f95A9fB6ff9ad3E6cb41b734c1bd805103](https://gnosis.blockscout.com/address/0xb76756f95A9fB6ff9ad3E6cb41b734c1bd805103/transactions)) due to excessive downtime. Delegators on this pool (which happened to have the most delegators) received a smaller initial reward due to this downtime and associated block skips. Because staking epoch 39 was one of the first 3 staking epochs for delegators, and information on inactive pools was not readily available, staking rewards were distributed manually via Disperse, an open source built by core YFI contributor Banteg. @@ -41,9 +41,9 @@ Igor and Andrew along with special guest Patricio from [POAP](https://www.poap.x Next, the Maker risk management group will consider STAKE as a Dai collateral. We will provide more information as we receive it. -* Call forum page: [https://forum.makerdao.com/t/collateral-onboarding-call-23-xdai-stake-wednesday-january-13th-18-00-utc/5910](https://forum.makerdao.com/t/collateral-onboarding-call-23-xdai-stake-wednesday-january-13th-18-00-utc/5910) -* STAKE application: [https://forum.makerdao.com/t/stake-mip6-collateral-onboarding-application/5551](https://forum.makerdao.com/t/stake-mip6-collateral-onboarding-application/5551) -* Collateral status index: [https://forum.makerdao.com/t/collateral-status-index/2231](https://forum.makerdao.com/t/collateral-status-index/2231) +- Call forum page: [https://forum.makerdao.com/t/collateral-onboarding-call-23-xdai-stake-wednesday-january-13th-18-00-utc/5910](https://forum.makerdao.com/t/collateral-onboarding-call-23-xdai-stake-wednesday-january-13th-18-00-utc/5910) +- STAKE application: [https://forum.makerdao.com/t/stake-mip6-collateral-onboarding-application/5551](https://forum.makerdao.com/t/stake-mip6-collateral-onboarding-application/5551) +- Collateral status index: [https://forum.makerdao.com/t/collateral-status-index/2231](https://forum.makerdao.com/t/collateral-status-index/2231) https://www.youtube.com/watch?v=C1dbId69vJo diff --git a/updates/archive/2021/xdai-weekly-recap-22-01-2021.md b/updates/archive/2021/xdai-weekly-recap-22-01-2021.md index 941d26cb..835eb311 100644 --- a/updates/archive/2021/xdai-weekly-recap-22-01-2021.md +++ b/updates/archive/2021/xdai-weekly-recap-22-01-2021.md @@ -17,8 +17,8 @@ Staking Epoch 41 started successfully with additional participation and a [new v Welcoming 1Hive is a newly active POSDAO validator! -* Pool: 0x91d8116fa60516cf25e258ef14deaacaf7a74127 -* Mining Address: [0x35770EF700Ff88D5f650597068e3Aaf051F3D5a4](https://blockscout.com/xdai/mainnet/address/0x35770EF700Ff88D5f650597068e3Aaf051F3D5a4/validations) +- Pool: 0x91d8116fa60516cf25e258ef14deaacaf7a74127 +- Mining Address: [0x35770EF700Ff88D5f650597068e3Aaf051F3D5a4](https://gnosis.blockscout.com/address/0x35770EF700Ff88D5f650597068e3Aaf051F3D5a4/validations) ### 👨🚀 POAP for First 100 @@ -62,9 +62,9 @@ Upcoming Project Migrations, current project announcements and new projects on x ### BAO -* We are going to have 2 Bao Farmer contracts, one on Ethereum mainnet and on the xDAI network (an Ethereum L2 sidechain). -* The new xDAI chain contract will issue $BAO.CX (Bao Coupon XDAI) which will be redeemable 1:1 for Bao tokens on the main Ethereum chain. -* Users will be able to pick to farm in either contract. Using the xDAI chain is simple and requires them to move their tokens via a bridge contract. +- We are going to have 2 Bao Farmer contracts, one on Ethereum mainnet and on the xDAI network (an Ethereum L2 sidechain). +- The new xDAI chain contract will issue $BAO.CX (Bao Coupon XDAI) which will be redeemable 1:1 for Bao tokens on the main Ethereum chain. +- Users will be able to pick to farm in either contract. Using the xDAI chain is simple and requires them to move their tokens via a bridge contract. https://thebaoman.medium.com/bao-v2-the-journey-86dab5a203de diff --git a/updates/archive/2021/xdai-weekly-recap-28-05-2021.md b/updates/archive/2021/xdai-weekly-recap-28-05-2021.md index 8ff829df..d8d082aa 100644 --- a/updates/archive/2021/xdai-weekly-recap-28-05-2021.md +++ b/updates/archive/2021/xdai-weekly-recap-28-05-2021.md @@ -13,16 +13,16 @@ import ArchiveWarning from '@site/src/components/ArchiveWarning'; :::success The protocol is currently in Epoch **58.**\ -****\ -****There are **16** validator pools with **272** delegators staking a total of **608,769** STAKE - over 75% of the total STAKE supply on xDai. +\***\*\ +\*\***There are **16** validator pools with **272** delegators staking a total of **608,769** STAKE - over 75% of the total STAKE supply on xDai. The new Stakefish pool has the highest amount staked, with 97K+ in the pool.\ \ High pool APY is currently **18.28%**, low is **10.92%** _(stats as of 28/05/2021 14:30 UTC)_. -* Staking Statistics: [https://duneanalytics.com/maxaleks/xdai-staking](https://duneanalytics.com/maxaleks/xdai-staking) -* Staking Platform: [https://blockscout.com/xdai/mainnet/validators](https://blockscout.com/xdai/mainnet/validators) -::: +- Staking Statistics: [https://duneanalytics.com/maxaleks/xdai-staking](https://duneanalytics.com/maxaleks/xdai-staking) +- Staking Platform: [https://blockscout.com/xdai/mainnet/validators](https://blockscout.com/xdai/mainnet/validators) + ::: ## :pencil2: Protocol Updates @@ -32,23 +32,23 @@ Assets worth more than 360K were sent to users on Ethereum from prior pending cl **xDai Bridge** -* Amount: 160K DAI -* Addresses: 461 -* Tx Fees: 3.58 ETH -* USD equivalent: $8,985.00 -* USD cost avg per tx: $19.50 +- Amount: 160K DAI +- Addresses: 461 +- Tx Fees: 3.58 ETH +- USD equivalent: $8,985.00 +- USD cost avg per tx: $19.50 **OmniBridge** -* Amount: 200K+ USD value -* Addresses: 570 -* Tx Fees: 6.06 ETH -* USD equivalent: $15,200.00 -* USD cost avg per tx: $26.66 +- Amount: 200K+ USD value +- Addresses: 570 +- Tx Fees: 6.06 ETH +- USD equivalent: $15,200.00 +- USD cost avg per tx: $26.66 ### OmniBridge AutoFaucet -To assist new user onboarding, and automatic faucet feature was added to the [OmniBridge](https://omni.xdaichain.com/bridge). Users moving assets over the Omnibridge from Ethereum or BSC to xDai now also automatically receive $.01 xDai\* in addition to their bridged asset. This can be used to process transactions and swap some of their remaining assets into xDai as required. Over [500 faucet transactions](https://blockscout.com/xdai/mainnet/address/0x562a9171c251777766285E877c80e7F4cC02d165/transactions) have been processed since this feature was implemented on May 22. +To assist new user onboarding, and automatic faucet feature was added to the [OmniBridge](https://omni.xdaichain.com/bridge). Users moving assets over the Omnibridge from Ethereum or BSC to xDai now also automatically receive $.01 xDai\* in addition to their bridged asset. This can be used to process transactions and swap some of their remaining assets into xDai as required. Over [500 faucet transactions](https://gnosis.blockscout.com/address/0x562a9171c251777766285E877c80e7F4cC02d165/transactions) have been processed since this feature was implemented on May 22. _\*Only non-contract wallets with a 0 xDai balance receive xDai._ @@ -95,8 +95,3 @@ https://twitter.com/Omen_eth/status/1396572004774400000 DxSale application allows users to create, launch and secure tokens. They offer multi-chain support and now include xDai support. https://dxsale.network/ - - - - -