Part 4: Web3 API and Ontology Bridge
In the last section, we demonstrated the Ontology EVM contract development process. In this section, we introduce a series of Web3 API references, and explain how to use the Ontology Bridge.
Due to the differences in the structure and storage structure of Ethereum and Ontology transactions, Ontology currently only supports the following RPC interfaces. For specific usage, click here.
6.1 Ontology Bridge TestNet
Users can log into https://bridge.ont.io/testnet to try Ontology Bridge. Currently, Ontology Bridge supports the TestNet.
A step-by-step guide is provided below:
1) Open the Ontology Bridge test network link and click Connect Wallet in the upper right corner.
Click Cyano and MetaMask respectively to connect a wallet. Once connected, you should see your wallet address displayed.
2) Select the asset to be exchanged and the type of asset to convert to.
An OEP-4 token being exchanged for an ORC-20 token is displayed below:
Click the Swap button and the following confirmation box will pop up. Click OK to complete the exchange of OEP-4 to ERC-20. If the exchange is successful, a successful exchange prompt box will pop up.
An ORC-20 token being exchanged for an OEP-4 token is displayed below:
This requires the Approve operation first. After the Approve is successful, the process is the same as the OEP-4 token exchange for the ORC-20 token described above
6.2 Exchange of ONG between Ethereum account address and Ontology account address
ONG can exist in both the Ontology account address (address starting with A) and the Ethereum account address (address starting with 0x). The function of this is to facilitate developers to transfer ONG in different account addresses to each other.
Proceed as follows:
- Open the TestNet and connect to the wallet
- Click the ONG Transfer button as shown in the figure below
The following two pictures show ONG transfers between different types of addresses. Of course, transfers between the same types are also possible.
This concludes our “Everything You Need To Know About Ontology EVM Contract Development” series: Part 1, Part 2, Part 3 and Part 4.
Don’t forget that the Ontology EVM-compatible public beta has been opened to developers around the world, and the “Security Vulnerability and Threat Intelligence Bounty Program” in cooperation with SlowMist Technology is also in progress. The reward for reporting a single vulnerability is up to $12,000!