1
0
mirror of https://github.com/oceanprotocol/docs.git synced 2024-11-26 19:49:26 +01:00

Merge pull request #277 from oceanprotocol/add-token-bridge-tutorial

Add a token bridge tutorial
This commit is contained in:
Matthias Kretschmann 2019-07-10 19:11:15 +02:00 committed by GitHub
commit 028aab7ade
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
17 changed files with 176 additions and 63 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 339 KiB

View File

@ -1,41 +1,19 @@
---
title: Ocean Tokens
description: The technical basics of Ocean Tokens.
description: The technical basics and most important infos about Ocean Tokens in different networks.
---
**NOTICE: Below we outline some plans at the time of writing. Those plans might change. We will update this page on a regular basis.**
## Basics
**Ocean Tokens** are the [cryptocurrency](https://en.wikipedia.org/wiki/Cryptocurrency) associated with Ocean Protocol. They are standards-compliant [ERC-20 tokens](https://en.wikipedia.org/wiki/ERC-20).
| Property | Value |
| ---------------------- | -------------------------------------------------------- |
| Token Contract Address | [See the tutorial](/tutorials/wallets-and-ocean-tokens/) |
| Token Symbol | OCEAN |
| Decimals of Precision | 18 |
Ocean Tokens can, in principle, live in any EVM-compatible network. The [Ocean Token contract](https://github.com/oceanprotocol/keeper-contracts/blob/develop/contracts/OceanToken.sol) is deployed in the Ethereum Mainnet, Pacific Mainnet, and the Nile Testnet. The tokens sold in the Ocean Protocol token sale were in the Ethereum Mainnet.
## Testnet Ocean Tokens
There are Ocean Tokens in several testnets, including the Nile testnet. They are just testnet Ocean Tokens (i.e. for testing purposes only) and they aren't interchangeable with Ethereum Mainnet Ocean Tokens. For more details, see the the [page about Testnets](/concepts/testnets/) and the [tutorials](/tutorials/introduction/).
### Testnet Ocean Token Utility
Once you have some Testnet Ocean Tokens, you can use them for all currently-implemented Ocean Protocol tasks _in that testnet_ (e.g. buying assets).
### Get Testnet Ocean Tokens
All Squid libraries have methods to request Ocean Tokens. They work by calling the "Dispenser" keeper contract, a contract which is only deployed to testnets. Therefore they will only work in testnets. They're documented in the following places:
- The squid-js docs for:
- [OceanAccounts.requestTokens()](/references/squid-js/#OceanAccounts-requestTokens)
- [Account.requestTokens()](/references/squid-js/#Account-requestTokens)
- The squid-py docs for:
- [the `squid_py.ocean.ocean_tokens` module](https://squid-py.readthedocs.io/en/develop/api/squid_py.ocean.ocean_tokens.html): see the `request()` method.
- [the `squid_py.ocean.ocean_accounts` module](https://squid-py.readthedocs.io/en/develop/api/squid_py.ocean.ocean_accounts.html): see the `request_tokens()` method.
- [The squid-java docs](https://www.javadoc.io/doc/com.oceanprotocol/squid/): click "All Classes" then "AccountsManager" then scroll to the bottom of the Class AccountsManager page where you'll find the `requestTokens()` method.
The [Example Code page](/tutorials/example-code/) has links to example Squid code (in all of the languages), including examples of using the above methods.
| Property | Value |
| ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Token Contract Addresses | _Ethereum Mainnet_<br /> [`0x985dd3D42De1e256d09e1c10F112bCCB8015AD41`](https://etherscan.io/token/0x985dd3d42de1e256d09e1c10f112bccb8015ad41)<br /><br />_Pacific Mainnet_<br /> [`0x012578f9381e876A9E2a9111Dfd436FF91A451ae`](https://submarine.oceanprotocol.com/address/0x012578f9381e876a9e2a9111dfd436ff91a451ae/transactions)<br /><br />_Nile Testnet_<br />[`0x9861Da395d7da984D5E8C712c2EDE44b41F777Ad`](https://submarine.nile.dev-ocean.com/address/0x9861Da395d7da984D5E8C712c2EDE44b41F777Ad) |
| Token Symbol | OCEAN |
| Decimals of Precision | 18 |
## Ethereum Mainnet Ocean Tokens
@ -44,30 +22,45 @@ There were several ways to acquire some of the Ethereum Mainnet Ocean Tokens in
- participation in the seed round
- participation in the pre-sale
- participation in the token sale
- participation in the initial exchange offering
- participation in the initial exchange offering (IEO)
- completion of a [bounty](/concepts/bounties/)
After [the initial exchange offering on Bittrex International](https://blog.oceanprotocol.com/initial-exchange-offering-of-ocean-protocol-on-bittrex-international-a454688f466a), Ethereum Mainnet Ocean Tokens became available in the Ethereum Mainnet (and not in any other network).
The initial circulating supply of Ethereum Mainnet Ocean Tokens became available on the Ethereum Mainnet in May 2019.
If you acquired Ocean Tokens in the initial circulating supply, they should have been, or will be, sent to the address you provided, in the Ethereum Mainnet.
### How to Check Your Ethereum Mainnet Ocean Token Balance
There are many ways to check your Ethereum Mainnet Ocean Token balance. Starting with the easiest, here are some ways:
- Enter your account address into the form at [https://wallet.oceanprotocol.com/tokens](https://wallet.oceanprotocol.com/tokens)
- Go to [Etherscan](https://etherscan.io/), enter your account address into the search field, click **Search**, click on **Erc20 Token Txns**, look for an "OceanToken" transaction in the "Token" colum, and click on **OceanToken** there.
- Download and use [Blowfish](https://github.com/kremalicious/blowfish), a desktop app that tells you your Ocean Token balance (and other things).
- Use MetaMask or other wallet software. See the page about [using wallet software to manage Ocean Tokens](/tutorials/wallets-and-ocean-tokens/). You can also use wallet software to send Ocean Tokens to some other account.
### Ethereum Mainnet Ocean Token Utility
The initial circulating supply of Ethereum Mainnet Ocean Tokens became available on the Ethereum Mainnet in May 2019. If you acquired Ocean Tokens in the initial circulating supply, they should have been, or will be, sent to the address you provided, in the Ethereum Mainnet.
At the time of writing, you could use Ethereum Mainnet Ocean Tokens to do various things in the Ethereum Mainnet, including but not limited to:
- buy other cryptocurrencies. See the next subsection for more details.
- stake in [dxDAO](https://dxdao.daostack.io/).
### How to Buy or Sell Ethereum Mainnet Ocean Tokens
### Check Your Ethereum Mainnet Ocean Token Balance
There are many ways to check your Ethereum Mainnet Ocean Token balance. Starting with the easiest, here are some ways:
---
- Enter your account address into the form in the [Ocean Token Tool](https://wallet.oceanprotocol.com/tokens).
[![Ocean Token Tool](images/token-tool.png)](https://wallet.oceanprotocol.com/tokens)
---
- Go to [Etherscan](https://etherscan.io/), enter your account address into the search field, click **Search**, click on **Erc20 Token Txns**, look for an _OceanToken_ transaction in the _Token_ colum, and click on **OceanToken** there.
---
- Download and use [Blowfish](https://github.com/kremalicious/blowfish), a desktop app that tells you your Ocean Token balance (and other things).
[![Blowfish](images/blowfish.png)](https://github.com/kremalicious/blowfish)
---
- Use MetaMask or other ERC-20-compatible wallet software. See the page about [using wallet software to manage Ocean Tokens](/tutorials/wallets-and-ocean-tokens/). You can also use wallet software to send Ocean Tokens to some other account.
---
### Buy or Sell Ethereum Mainnet Ocean Tokens
You can buy or sell Ethereum Mainnet Ocean Tokens via any exchange that lists them. See the official list of exchanges below.
@ -83,11 +76,44 @@ Below is the _official list_ of exchanges which listed Ethereum Mainnet Ocean To
## Pacific Network Ocean Tokens
At the time of writing, the [Pacific Network](/concepts/pacific-network/) wasn't publicly-usable yet. Once it is, there will be a token bridge from the Ethereum Mainnet to the Pacific Network, allowing you to move Ocean Tokens from the Ethereum Mainnet to the Pacific Network.
Ocean Tokens in Ocean's Mainnet, [Pacific](/concepts/pacific-network/), represent the same value as in the Ethereum Mainnet. The only way to get Ocean Tokens in Pacific is to transfer them from the Ethereum Mainnet.
For this purpose there is a token bridge between the Ethereum Mainnet and the Pacific Network, allowing anyone with Ocean Tokens to move them from the Ethereum Mainnet to the Pacific Network, and vice versa.
- [**Ocean Token Bridge**](https://bridge.oceanprotocol.com)
- [Tutorial: Transfer Ocean Tokens between Networks](/tutorials/token-bridge/)
[![The Ocean token bridge user interface](../tutorials/images/tb02.png)](https://bridge.oceanprotocol.com)
Once you have some Ocean Tokens in Pacific, you can use them for all currently-implemented Ocean Protocol tasks _in Pacific_ (e.g. buying assets from a marketplace connected to Pacific).
However, please be aware that transfering tokens between networks can put your Ocean Tokens at risk.
## Testnet Ocean Tokens
There are Ocean Tokens in several testnets, including the Nile testnet. They are just testnet Ocean Tokens (i.e. for testing purposes only) and they aren't interchangeable with Ethereum Mainnet Ocean Tokens. For more details, see the the [page about Testnets](/concepts/testnets/) and the [tutorials](/tutorials/introduction/).
Once you have some Testnet Ocean Tokens, you can use them for all currently-implemented Ocean Protocol tasks _in that testnet_ (e.g. buying assets).
### Get Testnet Ocean Tokens
All Squid libraries have methods to request Ocean Tokens. They work by calling the _Dispenser_ keeper contract, a contract which is only deployed to testnets. Therefore they will only work in testnets.
They're documented in the following places:
- The squid-js docs for:
- [`OceanAccounts.requestTokens()`](/references/squid-js/#OceanAccounts-requestTokens)
- [`Account.requestTokens()`](/references/squid-js/#Account-requestTokens)
- The squid-py docs for:
- [the `squid_py.ocean.ocean_tokens` module](https://squid-py.readthedocs.io/en/develop/api/squid_py.ocean.ocean_tokens.html): see the `request()` method.
- [the `squid_py.ocean.ocean_accounts` module](https://squid-py.readthedocs.io/en/develop/api/squid_py.ocean.ocean_accounts.html): see the `request_tokens()` method.
- [The squid-java docs](https://www.javadoc.io/doc/com.oceanprotocol/squid/): click _All Classes_ then _AccountsManager_ then scroll to the bottom of the Class _AccountsManager_ page where you'll find the `requestTokens()` method.
The [Example Code page](/tutorials/example-code/) has links to example Squid code (in all of the languages), including examples of using the above methods.
## Further Reading about Ocean Tokens
- [Teach Your Wallet to Track Ocean Tokens](/tutorials/wallets-and-ocean-tokens/)
- “[Ocean Tokenomics](https://blog.oceanprotocol.com/ocean-tokenomics-d34f28c480a8)”
- “[Ocean Tokenomics II](https://blog.oceanprotocol.com/https-blog-oceanprotocol-com-ocean-tokenomics-ii-faf05854314b)”
- [Tutorial: Use Your Wallet to Manage Ocean Tokens](/tutorials/wallets-and-ocean-tokens/)
- [Ocean Tokenomics](https://blog.oceanprotocol.com/ocean-tokenomics-d34f28c480a8)
- [Ocean Tokenomics II](https://blog.oceanprotocol.com/https-blog-oceanprotocol-com-ocean-tokenomics-ii-faf05854314b)
- [Ocean Protocol Technical Whitepaper](https://oceanprotocol.com/tech-whitepaper.pdf)

View File

@ -14,13 +14,17 @@ Over time, the Pacific Network will be upgraded and improved.
There is no intent to shut it down.
Eventually, the goal is for it to be used in production by many projects.
[Ocean Tokens](/concepts/ocean-tokens/) can, in principle, live in any EVM-compatible network. The ones sold in the Ocean Protocol token sale were in the Ethereum Mainnet. There is a token bridge between the Ethereum Mainnet and the Pacific Network, allowing anyone with Ocean Tokens to move them from the Ethereum Mainnet to the Pacific Network. However, please be aware that doing so would put those Ocean Tokens at risk. For more information, see [the page about Ocean Tokens](/concepts/ocean-tokens/).
[^1]: The Pacific Network is (or was) also known by other names, including _Pacific_, _Main Ocean Network_, _Ocean Mainnet_, _Ocean Live Network_.
## Ocean Tokens in Pacific
To be able to use [Ocean Tokens](/concepts/ocean-tokens/) in Pacific, they need to be transferred from the Ethereum Mainnet with a token bridge.
For more information, see [Pacific Network Ocean Tokens](/concepts/ocean-tokens/#pacific-network-ocean-tokens).
## Connect to the Pacific Network
See the tutorial page about [connecting to Ocean-related networks](/tutorials/connect-to-networks/#connect-to-the-pacific-network) to connect to Pacific in your browser with MetaMask.
To connect to Pacific in your browser with MetaMask, see [Tutorial: Connect to the Pacific Network](/tutorials/connect-to-networks/#connect-to-the-pacific-network).
## Pacific Blockchain Explorers

View File

@ -23,7 +23,7 @@ In the _Nile Testnet_[^2] all nodes are operated by BigchainDB GmbH.
### Connect to the Nile Testnet
See the [tutorial page about connecting to Ocean-related networks](/tutorials/connect-to-networks/#connect-to-the-nile-testnet).
See [Tutorial: Connect to the Nile Testnet](/tutorials/connect-to-networks/#connect-to-the-nile-testnet).
### Nile Blockchain Explorers

View File

@ -3,6 +3,12 @@ title: Tools
description: Some tools that can be useful when working with Ocean Protocol.
---
## Tuna
Tuna is a showcase and provides cross environment examples & tests for the Squid client libraries.
<repo name="tuna"></repo>
## Plecos
Plecos is a Python tool to check metadata (a JSON file) to see if it conforms to the [OEP-8 schema](https://github.com/oceanprotocol/OEPs/tree/master/8). It wraps the [jsonschema](https://github.com/Julian/jsonschema) validator. Aquarius uses Plecos for checking metadata and other Ocean Protocol software will probably use it in the future.
@ -22,13 +28,18 @@ There is an [Ocean Protocol fork of BlockScout](https://github.com/oceanprotocol
<repo name="blockscout"></repo>
## Ocean Token Bridge
The Ocean Token Bridge between the Ethereum Mainnet and the Pacific Network allows anyone with Ocean Tokens to move them from the Ethereum Mainnet to the Pacific Network.
- [**Ocean Token Bridge**](https://bridge.oceanprotocol.com)
- [Tutorial: Transfer Ocean Tokens between Networks](/tutorials/token-bridge/)
<repo name="token-bridge-ui"></repo>
## Command-Line Interfaces
There are a few Ocean Protocol command-line interfaces (CLIs). All of them were under development at the time of writing, so you may have issues with using them.
[tuna](https://github.com/oceanprotocol/tuna) can help you use squid-py, squid-js or squid-java from the command line.
<repo name="tuna"></repo>
- [ocean-cli](https://github.com/bigchaindb-gmbh/ocean-cli) was built using squid-java
- [ocean-cli-py](https://github.com/bigchaindb-gmbh/ocean-cli-py) was built using squid-py

View File

@ -3,9 +3,9 @@ title: Get Ether and Ocean Tokens
description: A tutorial about how to get Ether and Ocean Tokens.
---
If you want to interact with an Ethereum-based network that supports Ocean Protocol, then you'll eventually need Ether or [Ocean Tokens](/concepts/ocean-tokens/) _for that network_. (Every Ethereum-based network has its own Ether and maybe its own Ocean Tokens, and you can't use those in other networks.)
If you want to interact with an Ethereum-based network that supports Ocean Protocol, then you'll eventually need Ether or [Ocean Tokens](/concepts/ocean-tokens/) _for that network_. Every Ethereum-based network has its own Ether and its own Ocean Tokens, and you can't use those in other networks.
At the time of writing, there were some public testnets you could use to test an Ocean Protocol application. For more information about those, see the page about [testnets](/concepts/testnets/).
There are some public testnets you can use to test an Ocean Protocol application. For more information about those, see the page about [testnets](/concepts/testnets/).
## Get a Compatible Wallet

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 KiB

View File

@ -0,0 +1,65 @@
---
title: Transfer Ocean Tokens between Networks
description: How to use the token bridge to transfer Ocean Tokens from the Ethereum Mainnet to the Pacific Network, and vice versa.
---
## Introduction
There is a token bridge between the Ethereum Mainnet and the [Pacific Network](/concepts/pacific-network/) available under [**bridge.oceanprotocol.com**](https://bridge.oceanprotocol.com) to transfer [Ocean Tokens](/concepts/ocean-tokens/) (OCEAN) between those networks.
[![The Ocean token bridge user interface](images/tb02.png)](https://bridge.oceanprotocol.com)
It's based on the [TokenBridge by POA Network](https://medium.com/poa-network/introducing-the-erc20-to-erc20-tokenbridge-ce266cc1a2d0) (the company), but the user interface was modified to conform to the Ocean Protocol style, and the loaded contracts are fixed to a specific security-checked version.[^1]
## Using the Token Bridge
> **Please Note: If you transfer your Ocean Tokens to the Pacific Network, then you are putting your Ocean Tokens at risk.**
### Ethereum Mainnet → Ocean Pacific
If you want to transfer OCEAN out of the Ethereum Mainnet, then first you need an Ethereum account with some OCEAN in the Ethereum Mainnet, and be connected to Ethereum Mainnet in MetaMask. If you want to get some OCEAN in the Ethereum Mainnet, then see the page about [Ocean Tokens](/concepts/ocean-tokens/).
Below is a screenshot of MetaMask showing an account (with address `0x8…`) which has 500 OCEAN in the Ethereum Mainnet. If you want MetaMask to show OCEAN, then see the page about [using your wallet to manage Ocean Tokens](/tutorials/wallets-and-ocean-tokens/).
![MetaMask showing an account that has 500 OCEAN in the Ethereum Mainnet](./images/tb01.png)
To use the token bridge to transfer Ocean Tokens from the Ethereum Mainnet to the Pacific Network, go to [**bridge.oceanprotocol.com**](https://bridge.oceanprotocol.com) while being connected to the Ethereum Mainnet in MetaMask.
You should see something like this:
[![From Ethereum Mainnet to Ocean Pacific](images/tb02.png)](https://bridge.oceanprotocol.com)
The above screenshot shows that the account with address `0x8…` has 500 OCEAN in the Ethereum Mainnet and 0 OCEAN in the Pacific Network.
- Enter the amount of OCEAN you want to transfer (e.g. 1 OCEAN)
- Click _Transfer_
A confirmation dialog box like the following should appear.
![Confirmation dialog box](./images/tb03.png)
- Click _Continue_
After the end of some status updates you should see a success message with a transaction ID.
If you go back to MetaMask and switch the network to Pacific, then the account's OCEAN balance in Pacific should be higher by the amount just transferred.
![MetaMask showing an account that has 1 OCEAN in the Pacific Network](./images/tb06.png)
### Ocean Pacific → Ethereum Mainnet
To go the other way around, transfering Ocean Tokens from Pacific back into the Ethereum Mainnet, you simply connect to Pacific in MetaMask when visiting [**bridge.oceanprotocol.com**](https://bridge.oceanprotocol.com).
This will reverse the order of the token bridge networks:
![From Pacific to Ethereum Mainnet](./images/tb07.png)
Then follow the same steps as outlined above to transfer Ocean Tokens between the networks.
## Reporting Issues
If you found something was not working right for you, feel free to reach out to us and open an issue on the [`token-bridge-ui`](https://github.com/oceanprotocol/token-bridge-ui) repository:
<repo name="token-bridge-ui" />
[^1]: The code for the Ocean Protocol version of the token bridge UI and all technical documentation is in the [oceanprotocol/token-bridge-ui](https://github.com/oceanprotocol/token-bridge-ui) repo on GitHub.

View File

@ -16,6 +16,7 @@
url: /references/brizo/
- name: pleuston
- name: commons
- group: Libraries
items:
@ -34,10 +35,11 @@
- group: Tools
items:
- name: tuna
- name: plecos
- name: faucet
- name: blockscout
- name: tuna
- name: token-bridge-ui
- group: OceanDB Drivers
items:

View File

@ -13,6 +13,8 @@
link: /tutorials/wallets-and-ocean-tokens/
- title: Get Ether and Ocean Tokens
link: /tutorials/get-ether-and-ocean-tokens/
- title: Transfer Ocean Tokens between Networks
link: /tutorials/token-bridge/
- group: Storage Setup
items:

View File

@ -25,15 +25,15 @@
"@oceanprotocol/art": "^2.2.0",
"axios": "^0.19.0",
"classnames": "^2.2.6",
"gatsby": "^2.13.3",
"gatsby": "^2.13.10",
"gatsby-image": "^2.2.4",
"gatsby-plugin-catch-links": "^2.1.0",
"gatsby-plugin-google-analytics": "^2.1.1",
"gatsby-plugin-manifest": "^2.2.1",
"gatsby-plugin-offline": "^2.2.0",
"gatsby-plugin-offline": "^2.2.1",
"gatsby-plugin-react-helmet": "^3.1.0",
"gatsby-plugin-sass": "^2.1.0",
"gatsby-plugin-sharp": "^2.2.2",
"gatsby-plugin-sharp": "^2.2.3",
"gatsby-plugin-sitemap": "^2.2.1",
"gatsby-plugin-svgr": "^2.0.2",
"gatsby-remark-autolink-headers": "^2.1.0",
@ -41,13 +41,13 @@
"gatsby-remark-copy-linked-files": "^2.1.0",
"gatsby-remark-embed-video": "^1.7.1",
"gatsby-remark-github": "^2.0.0",
"gatsby-remark-images": "^3.1.2",
"gatsby-remark-images": "^3.1.3",
"gatsby-remark-prismjs": "^3.3.1",
"gatsby-remark-responsive-iframe": "^2.2.1",
"gatsby-remark-smartypants": "^2.1.0",
"gatsby-source-filesystem": "^2.1.2",
"gatsby-source-graphql": "^2.1.0",
"gatsby-transformer-remark": "^2.5.0",
"gatsby-transformer-remark": "^2.6.1",
"gatsby-transformer-sharp": "^2.2.1",
"gatsby-transformer-xml": "^2.1.0",
"gatsby-transformer-yaml": "^2.2.0",

View File

@ -39,6 +39,9 @@
display: inline-block;
padding-left: .3rem;
padding-right: .3rem;
overflow-wrap: break-word;
word-wrap: break-word;
word-break: break-all;
}
// stylelint-enable selector-no-qualifying-type, declaration-no-important