diff --git a/.github/workflows/chain-docs.yml b/.github/workflows/chain-docs.yml
index dca6e665..e07d049d 100644
--- a/.github/workflows/chain-docs.yml
+++ b/.github/workflows/chain-docs.yml
@@ -8,7 +8,7 @@ on:
jobs:
scan:
name: Scan
- runs-on: ubuntu-18.04
+ runs-on: ubuntu-22.04
if: >-
github.event_name == 'push' || github.event_name == 'pull_request' || (github.event.comment.body == '/staging' &&
(github.actor == 'allthatjazzleo' || github.actor == 'tomtau' || github.actor == 'lezzokafka' || github.actor == 'yihuang' ||
@@ -35,9 +35,9 @@ jobs:
# sarif_file: reports
build:
name: Build
- runs-on: ubuntu-18.04
+ runs-on: ubuntu-22.04
needs: scan
- if: >-
+ if: >-
github.event_name == 'push' || (github.event.comment.body == '/staging' && (github.actor == 'allthatjazzleo' || github.actor == 'tomtau' ||
github.actor == 'lezzokafka' || github.actor == 'yihuang' || github.actor == 'calvinaco' ||
github.actor == 'CeruleanAtMonaco' || github.actor == 'devashishdxt' || github.actor == 'leejw51crypto' ||
diff --git a/ci/scripts/prepare b/ci/scripts/prepare
index 399899a4..ce49610d 100755
--- a/ci/scripts/prepare
+++ b/ci/scripts/prepare
@@ -16,6 +16,7 @@ BRANCH_CLOUDFRONT_DISTRIBUTION_ID=${BRANCH}_CLOUDFRONT_DISTRIBUTION_ID
BRANCH_REGION=${BRANCH}_REGION
aws configure set aws_access_key_id ${!BRANCH_AWS_ACCESS_KEY_ID}
aws configure set aws_secret_access_key ${!BRANCH_AWS_SECRET_ACCESS_KEY}
+aws configure set region us-east-1
export S3_BUCKET=${!BRANCH_BUCKET_NAME}
export CLOUDFRONT_DISTRIBUTION_ID=${!BRANCH_CLOUDFRONT_DISTRIBUTION_ID}
diff --git a/cronos-gamefi-integraton/getting-started.md b/cronos-gamefi-integraton/getting-started.md
index 408f550e..cafc370c 100644
--- a/cronos-gamefi-integraton/getting-started.md
+++ b/cronos-gamefi-integraton/getting-started.md
@@ -1,4 +1,4 @@
-# Getting Started
+# Unity
## Pre-requisites
@@ -10,9 +10,9 @@ This documentation currently supports WebGL, IOS and Android builds. Other platf
### Other Requirements
-* **Mobile IDE**: If you want to test your Mobile Builds we recommend you to download a Mobile Development IDE with Device Simulation Capabilities such as Xcode.
-* **DefiConnect**: [DefiConnect](https://chrome.google.com/webstore/detail/cryptocom-wallet-extensio/hifafgmccdpekplomjjkcfgodnhcellj) is required for the Login Example.
-* **Assets**: Some of the scenes require assets to work properly. If you do not have any assets you can always use the Cronos Testnet and generate some ERC721 test assets. You can read more around integration methods [here](https://cronos.crypto.org/docs/resources/chain-integration.html#useful-links]).
+- **Mobile IDE**: If you want to test your Mobile Builds we recommend you to download a Mobile Development IDE with Device Simulation Capabilities such as Xcode.
+- **DefiConnect**: [DefiConnect](https://chrome.google.com/webstore/detail/cryptocom-wallet-extensio/hifafgmccdpekplomjjkcfgodnhcellj) is required for the Login Example.
+- **Assets**: Some of the scenes require assets to work properly. If you do not have any assets you can always use the Cronos Testnet and generate some ERC721 test assets. You can read more around integration methods [here](https://cronos.crypto.org/docs/resources/chain-integration.html#useful-links]).
### Download and install Unity
@@ -28,18 +28,16 @@ You can use the following RPC methods. By default, we use the mainnet rpc method
{% tabs %}
{% tab title="Mainnet" %}
-* RPC Method: `https://evm-dev.cronos.org`
-* Chain ID: **25**
+- RPC Method: `https://evm-dev.cronos.org`
+- Chain ID: **25**
{% endtab %}
{% tab title="Testnet" %}
-* RPC Method: `https://evm-dev-t3.cronos.org`
-* Chain ID: **338**
+- RPC Method: `https://evm-dev-t3.cronos.org`
+- Chain ID: **338**
{% endtab %}
{% endtabs %}
-
-
## Import ChainSafe Package
### Github
@@ -56,7 +54,8 @@ Or you can download the latest [releases](https://github.com/ChainSafe/web3.unit
### Create a new Unity Project
-Create a new project directly from your Unity Hub. In the next step Choose 3D as your project type. ![](../docs/play/assets/getting-started/new-projects.png)
+Create a new project directly from your Unity Hub. In the next step Choose 3D as your project type.
+
### Upload web3.unity Folders into Project
@@ -70,8 +69,8 @@ To connect your Cronos Assets to your Unity project, you can add the following s
### Get CRO Balance
-* Script Path: `Assets/Web3Unity/Scripts/Prefabs/EVM/EVMBalanceOfCronos.cs`
-* Prefab Path: `Assets/Web3Unity/Prefabs/EVM/EVMBalanceOfCronos.prefab`
+- Script Path: `Assets/Web3Unity/Scripts/Prefabs/EVM/EVMBalanceOfCronos.cs`
+- Prefab Path: `Assets/Web3Unity/Prefabs/EVM/EVMBalanceOfCronos.prefab`
```csharp
using System.Collections;
@@ -83,10 +82,10 @@ public class EVMBalanceOfCronos : MonoBehaviour
async void Start()
{
string chain = "cronos";
- string network = "mainnet";
+ string network = "mainnet";
string account = "ACCOUNT_ADDRESS";
string rpc = "https://evm-dev.cronos.org";
-
+
string balance = await EVM.BalanceOf(chain, network, account, rpc);
print(balance);
}
@@ -97,8 +96,8 @@ Drag the prefab into the sample scene and play in order to run the script. The b
### Get NFT Balance
-* Script Path: `Assets/Web3Unity/Scripts/Prefabs/ERC721/ERC721BalanceOfCronos.cs`
-* Prefab Path: `Assets/Web3Unity/Prefabs/ERC721/ERC721BalanceOfCronos.prefab`
+- Script Path: `Assets/Web3Unity/Scripts/Prefabs/ERC721/ERC721BalanceOfCronos.cs`
+- Prefab Path: `Assets/Web3Unity/Prefabs/ERC721/ERC721BalanceOfCronos.prefab`
```csharp
using System.Collections;
@@ -126,8 +125,8 @@ Drag the prefab into the sample scene and play in order to run the script. The b
### Get NFT Owner
-* Script Path: `Assets/Web3Unity/Scripts/Prefabs/ERC721/ERC721OwnerOfCronos.cs`
-* Prefab Path: `Assets/Web3Unity/Prefabs/ERC721/ERC721OwnerOfCronos.prefab`
+- Script Path: `Assets/Web3Unity/Scripts/Prefabs/ERC721/ERC721OwnerOfCronos.cs`
+- Prefab Path: `Assets/Web3Unity/Prefabs/ERC721/ERC721OwnerOfCronos.prefab`
```csharp
using System.Collections;
@@ -139,7 +138,7 @@ public class ERC721OwnerOfCronos : MonoBehaviour
async void Start()
{
string chain = "cronos";
- string network = "mainnet";
+ string network = "mainnet";
string contract = "CONTRACT_ADDRESS";
string tokenId = "TOKEN_ID";
string rpc = "https://evm-dev.cronos.org";
@@ -156,8 +155,8 @@ Drag the prefab into the sample scene and play in order to run the script. The o
You can test this script by creating a random 3D Quad object in the SampleScene and add the following script to it.
-* Script Path: `Assets/Web3Unity/Scripts/Prefabs/ERC721/ImportNFTTextureCronos.cs`
-* Prefab Path: `Assets/Web3Unity/Prefabs/ERC721/ImportNFTTextureCronos.prefab`
+- Script Path: `Assets/Web3Unity/Scripts/Prefabs/ERC721/ImportNFTTextureCronos.cs`
+- Prefab Path: `Assets/Web3Unity/Prefabs/ERC721/ImportNFTTextureCronos.prefab`
```csharp
using System.Collections;
@@ -175,7 +174,7 @@ public class ImportNFTTextureCronos : MonoBehaviour
async void Start()
{
string chain = "cronos";
- string network = "mainnet";
+ string network = "mainnet";
string contract = "CONTRACT_ADDRESS";
string tokenId = "TOKEN_ID";
string rpc = "https://evm-dev.cronos.org";
@@ -202,3 +201,427 @@ public class ImportNFTTextureCronos : MonoBehaviour
```
Drag the prefab into the sample scene and play in order to run the script. The Quad should take the form of the image fetched form the NFT metadata.
+
+# Login Example
+
+This section will illustrate how to build the scenes to login and load a player's NFT assets.
+
+::: tip NOTE
+In order to use the Cronos Network, you will have to add the Network ID and Name in the network.js file in the `Assets/WebGLTemplates/Web3GL-2020x/` folder.
+:::
+
+## Import NFT
+
+To ensure that the NFT loads conditionally after successfully connecting to a wallet, you can update the `ImportNFTTextureCronos.cs` file with the content below.
+
+- Script Path: `Assets/Web3Unity/Scripts/Prefabs/ERC721/ImportNFTTextureCronos.cs`
+
+```csharp
+using System.Collections;
+using System.Collections.Generic;
+using System.Threading.Tasks;
+using UnityEngine;
+using UnityEngine.Networking;
+
+public class ImportNFTTextureCronos : MonoBehaviour
+{
+ public class Response {
+ public string image;
+ }
+
+ async void Start()
+ {
+ string chain = "cronos";
+ string network = "mainnet";
+ string account = PlayerPrefs.GetString("Account");
+ string contract = "CONTRACT_ADDRESS";
+ string tokenId = "TOKEN_ID";
+ string rpc = "https://evm-dev.cronos.org";
+
+ string ownerOf = await ERC721.OwnerOf(chain, network, contract, tokenId, rpc);
+
+ if (ownerOf == account)
+ {
+ // fetch uri from chain
+ string uri = await ERC721.URI(chain, network, contract, tokenId, rpc);
+ print("uri: " + uri);
+
+ // fetch json from uri
+ UnityWebRequest webRequest = UnityWebRequest.Get(uri);
+ await webRequest.SendWebRequest();
+ Response data = JsonUtility.FromJson(System.Text.Encoding.UTF8.GetString(webRequest.downloadHandler.data));
+
+ // parse json to get image uri
+ string imageUri = data.image;
+ print("imageUri: " + imageUri);
+
+ // fetch image and display in game
+ UnityWebRequest textureRequest = UnityWebRequestTexture.GetTexture(imageUri);
+ await textureRequest.SendWebRequest();
+ this.gameObject.GetComponent().material.mainTexture = ((DownloadHandlerTexture)textureRequest.downloadHandler).texture;
+ }
+ }
+}
+```
+
+::: tip NOTE
+We are using `PlayerPrefs.GetString("Account")` to dynamically fetch the address when connecting to DefiConnect. You can replace this with the actual account address for testing purposes like so: `string account = "account_address"`
+:::
+
+## Build the Scenes
+
+To build the Game Login example, you need to go to `File/Build Settings` and select your WebGL, IOS or Androi Build Settings. In this example, we will build using the WebGL method. To build with the DefiWallet option, you will have to select the Cronos DefiWallet Template in the Player -> Resolution and Presentation settings
+
+::: tip NOTE
+Make sure to select the Cronos Defi Wallet Template in the Player -> Resolution and Presentation settings.
+:::
+
+
+
+
+
+On successful completion, you will be able to log in to your DefiConnect wallet. The scene will load any textures from NFT assets you own on successful login.
+
+## Scripts
+
+This section contains the different types of script that can be used in the Unity SDK. For additional operations and methods please refer to the [ChainSafe Documentation](https://chainsafe.github.io/game-docs/).
+
+### Player Account
+
+PlayerPrefs.GetString("Account") is the user's wallet account accessed after the LoginScene.
+
+```csharp
+string account = PlayerPrefs.GetString("Account");
+print(account);
+```
+
+### EVM
+
+Get the current latest block number
+
+```csharp
+string chain = "cronos";
+string network = "mainnet";
+string rpc = "https://evm-dev.cronos.org";
+
+int blockNumber = await EVM.BlockNumber(chain, network, rpc);
+print(blockNumber);
+```
+
+Get the balance of the native blockchain
+
+```csharp
+string chain = "cronos";
+string network = "mainnet";
+string account = "ACCOUNT_ADDRESS";
+string rpc = "https://evm-dev.cronos.org";
+
+string balance = await EVM.BalanceOf(chain, network, account, rpc);
+print(balance);
+```
+
+Verify a signed message.
+
+```csharp
+string message = "YOUR_MESSAGE";
+string signature = "YOUR_SIGNATURE";
+
+string address = await EVM.Verify(message, signature);
+print(address);
+```
+
+Print Nonce.
+
+```csharp
+string chain = "cronos";
+string network = "mainnet";
+string account = "ACCOUNT_ADDRESS";
+string rpc = "https://evm-dev.cronos.org";
+
+string nonce = await EVM.Nonce(chain, network, account, rpc);
+print(nonce);
+```
+
+### ERC721
+
+Counts all NFTs assigned to an owner
+
+```csharp
+string chain = "cronos";
+string network = "mainnet";
+string contract = "CONTRACT_ADDRESS";
+string account = "ACCOUNT_ADDRESS";
+string rpc = "https://evm-dev.cronos.org";
+
+int balance = await ERC721.BalanceOf(chain, network, contract, account, rpc);
+print(balance);
+```
+
+Find the owner of a NFT.
+
+```csharp
+string chain = "cronos";
+string network = "mainnet";
+string contract = "CONTRACT_ADDRESS";
+string tokenId = "TOKEN_ID";
+string rpc = "https://evm-dev.cronos.org";
+
+string ownerOf = await ERC721.OwnerOf(chain, network, contract, tokenId, rpc);
+print(ownerOf);
+```
+
+Print URI.
+
+```csharp
+string chain = "cronos";
+string network = "mainnet";
+string contract = "CONTRACT_ADDRESS";
+string tokenId = "TOKEN_ID";
+
+string uri = await ERC721.URI(chain, network, contract, tokenId);
+print(uri)
+
+```
+
+### Signatures
+
+Sign through WebGL
+
+```csharp
+try {
+ string message = "signature_message";
+ string response = await Web3GL.Sign(message);
+ Debug.Log(response);
+} catch (Exception e) {
+ Debug.LogException(e, this);
+}
+```
+
+## Example on inntegration
+
+### Overview
+
+This section showcase the Cronos play Gaming SDK integration with the Cronos chain, aiming to bring Unity games into the Cronos ecosystem. In particular, we will show how to do a basic integration of the Cronos play with the Cronos chain including:
+
+- Connecting to Cronos networks;
+- Installaiton of the SDK;
+- Obtaining a sample NFT and;
+- Import Sample package from Unity Asset Store
+
+### Integration guide for Cronos
+
+### Step 1. [Unity] Create a new project
+
+- Download the tutorial bolt kit from [Unity](https://assetstore.unity.com/packages/essentials/tutorial-projects/bolt-kit-platformer-tutorial-assets-168067) and import the assets into the blank new project. Below are the steps of importing Tutorial Projects - Bolt Kit from Unity. See [Reference #1](#reference).
+
+### Step 2. [Unity] Download the latest ChainSafe SDK and import into the project.
+
+- For a detailed explanation, please refer to [ChainSafe official documentation](https://chainsafe.github.io/game-docs/)
+
+### Step 3. [Unity] Prefabs interaction
+
+- Step 3a. [Unity] Double click the `Level1` scene under `Assets/Scenes` directory
+
+
+
+#### [Unity] Transfer721 Example
+
+- Drag the `Transfer721` prefab under `Assets/Web3Unity/Prefabs/WebGL` dir into the scene.
+
+
+
+- Update the `Contract` address under `Transfer721Script` object inspector
+- Update the `To Account` address to your desired wallet address
+
+
+
+---
+
+\* For acquiring the NFT, you can create your own (see [Reference #2](#_2-smart-contract)), or mint an ERC721 NFT at our [Cronos NFT faucet](https://cronos.org/nft-faucet) (see [Reference #3](#_3-nft-faucet)).
+
+---
+
+### Step 4. [Unity] Build and Run
+
+1. Switch to WebGL platform
+
+
+2. Click the `Player Setting` button
+
+3. Select `Web3GL-2020` under `Resolution and Presentation` tab
+
+
+4. Set `Compression Format` to `Disabled` under `Publishing Settings` tab
+
+
+5. After that, click `Build and Run` button and you are ready to play.
+
+
+### What's next
+
+The above guideline documentation only highlights the basic integration between ChainSafe and Cronos chain. You can download the full source code of the above sample game [here](https://github.com/crypto-org-chain/cronos-docs/blob/master/docs/play/assets/cronos-chainsafe-unity-sample.unitypackage.zip). For other ERC protocol methods, please refer to the [ChainSafe Documentation](https://chainsafe.github.io/game-docs/).
+
+## Reference
+
+### 1. Import Sample package from Unity Asset Store
+
+#### Step 1a. [Unity Asset Store] Click to add the asset and sign in to your Unity account
+
+
+
+#### Step 1b. [Unity] Create a new project in Unity
+
+
+
+#### Step 1c. [Unity] Open the Package Manager window in Unity and under "My Assets" download the Bolt Kit.
+
+
+
+#### Step 1d. [Unity] Select `Bolt Kit: Platformer Tutorial Assets` and click Import
+
+
+
+---
+
+### 2. Smart contract
+
+#### 2a. Create an ERC standard smart contract
+
+- ERC20 example
+
+```javascript
+// SPDX-License-Identifier: MIT
+pragma solidity ^0.8.2;
+
+import "@openzeppelin/contracts@4.4.2/token/ERC20/ERC20.sol";
+import "@openzeppelin/contracts@4.4.2/access/Ownable.sol";
+
+contract MyToken is ERC20, Ownable {
+ constructor() ERC20("MyToken", "MTK") {
+ _mint(msg.sender, 1000 * 10 ** decimals());
+ }
+
+ function mint(address to, uint256 amount) public onlyOwner {
+ _mint(to, amount);
+ }
+}
+```
+
+- ERC721 example
+
+```javascript
+// SPDX-License-Identifier: MIT
+pragma solidity ^0.8.2;
+
+import "@openzeppelin/contracts@4.4.2/token/ERC721/ERC721.sol";
+import "@openzeppelin/contracts@4.4.2/access/Ownable.sol";
+import "@openzeppelin/contracts@4.4.2/utils/Counters.sol";
+
+contract MyNFT is ERC721, Ownable {
+ using Counters for Counters.Counter;
+
+ Counters.Counter private _tokenIdCounter;
+
+ constructor() ERC721("MyNFT", "MNFT") {}
+
+ function _baseURI() internal pure override returns (string memory) {
+ return "https://opensea-creatures-api.herokuapp.com/api/creature/";
+ }
+
+ function safeMint(address to) external onlyOwner {
+ uint256 tokenId = _tokenIdCounter.current();
+ _tokenIdCounter.increment();
+ _safeMint(to, tokenId);
+ }
+}
+
+```
+
+- ERC1155 example
+
+```javascript
+// SPDX-License-Identifier: MIT
+pragma solidity ^0.8.2;
+
+import "@openzeppelin/contracts@4.4.2/token/ERC1155/ERC1155.sol";
+import "@openzeppelin/contracts@4.4.2/access/Ownable.sol";
+
+contract My1155Token is ERC1155, Ownable {
+ constructor()
+ ERC1155("https://opensea-creatures-api.herokuapp.com/api/creature/")
+ {}
+
+ function setURI(string memory newuri) public onlyOwner {
+ _setURI(newuri);
+ }
+
+ function mint(address account, uint256 id, uint256 amount, bytes memory data)
+ public
+ onlyOwner
+ {
+ _mint(account, id, amount, data);
+ }
+
+ function mintBatch(address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data)
+ public
+ onlyOwner
+ {
+ _mintBatch(to, ids, amounts, data);
+ }
+}
+
+```
+
+#### 2b. Deploy Smart Contract via [Remix IDE](https://remix.ethereum.org/)
+
+ - Switch the chain network to Cronos Testnet via Metamask extension or other similar provider
+ - Select the `Injected Web3` under ENVIRONMENT tab
+
+
+
+ - Approve the connection
+
+
+
+ - Select your contract name under CONTRACT tab
+
+
+
+ - Approve the transaction after clicking `Deploy` button
+
+
+
+ - Copy the contract address
+
+---
+
+### 3. NFT Faucet
+
+- Step 1. Connect your wallet via metamask or walletconnect
+
+
+- Step 2. Click `Create NFT` under `YOUR COLLECTION` tab
+
+
+- Step 3. Create and sign the transaction after uploading the image
+
+
+- Step 4. Copy the contract address and image URL from the NFT modal
+
+
+- Step 5. Paste into the corresponding input box inside Unity inspector
+
+
+---
+
+### (Optional) List NFT for sale in marketplace faucet
+
+- Step 1. Fill in the price at list item modal and confirm
+
+
+- Step 2. Sign approval and create item transaction
+
+
+
+- Step 3. View the listed item in Marketplace tab
+
diff --git a/cronos-gamefi-integraton/introduction.md b/cronos-gamefi-integraton/introduction.md
index 05695b04..6d3bc1a8 100644
--- a/cronos-gamefi-integraton/introduction.md
+++ b/cronos-gamefi-integraton/introduction.md
@@ -1,6 +1,6 @@
# Introduction
-The term GameFi refers to the financialization of gaming. Similar to the term DeFi, or decentralized finance, GameFi combines the words “game” and “finance.” In this section, we introduce the concept of GameFi in the context of Unity game development. The objective of this document section is demonstrates how to Bridge games to the Cronos EVM Chain, using Unity. The [ChainSafe Gaming SDK](https://github.com/ChainSafe/web3.unity/releases) assets are used for the Unity build.
+The term GameFi refers to the financialization of gaming. Similar to the term DeFi, or decentralized finance, GameFi combines the words “game” and “finance.” In this section, we introduce the concept of GameFi in the context of blockchain game development. The objective of this document section demonstrates how to bridge games to the Cronos EVM Chain, using Unity / Unreal Engine or any related C++ game engine.
## Overview
@@ -9,25 +9,33 @@ Cronos Play Gaming SDK opens up the opportunity for connecting the gaming world
- Connect and interact with Cronos networks;
- Provide in-game NFTs functionality;
- Authenticate by using different crypto wallets;
-- ..and many more to come.
+ ..and many more to come.
Currently, Cronos Play supports the Unity game engine as a starting point, and it will be extended to support other game engines in the future.
## Cronos Plays Documentation
-This documentation showcases the Cronos play Gaming SDK integration with the Cronos chain, aiming to bring Unity games into the Cronos ecosystem. In particular, we will show how to do a basic integration of the Cronos play with the Cronos chain including:
+This documentation showcases the Cronos play Gaming SDK integration with the Cronos chain, aiming to bring different kind of games into the Cronos ecosystem. In particular, we will show how to do a basic integration of the Cronos play with the Cronos chain including:
- Connecting to Cronos networks;
-- Installaiton of the SDK;
+- Installation of the SDK;
- Obtaining a sample NFT and;
- Import Sample package from Unity Asset Store
+- Using BluePrint to interact with the blockchain
-## ChainSafe SDK
-The underlying SDK for this documentation has been developed and curated by ChainSafe. For additional operations and methods please refer to the [ChainSafe Documentation](https://chainsafe.github.io/game-docs/).
-
-
-### Useful links
+### Useful Links
- Community chatrooms (non-technical): [Discord](https://discord.gg/nsp9JTC) [Telegram](https://t.me/CryptoComOfficial)
- Developer community channel (technical): [![Support Server](https://img.shields.io/discord/783264383978569728.svg?color=7289da&label=Crypto.org Chain)](https://discord.gg/pahqHz26q4)
-- Email: [contact@cronoslabs.org](mailto:contact@cronoslabs.org)
\ No newline at end of file
+- [Cronos official website](https://cronos.crypto.org/)
+- [ChainSafe official website](https://gaming.chainsafe.io/)
+- [Unity official website](https://unity.com/)
+- [Openzeppelin](https://docs.openzeppelin.com/)
+- [Remix IDE](https://remix.ethereum.org/)
+- [Cronos-ChainSafe-Unity-sample](https://github.com/crypto-org-chain/cronos-docs/blob/master/docs/play/assets/cronos-chainsafe-unity-sample.unitypackage.zip)
+- Repositories
+ - [Cronos Play Unreal SDK plugin repository](https://github.com/cronos-labs/play-unreal-plugin)
+ - [Cronos Play Unreal demo repository](https://github.com/cronos-labs/play-unreal-demo)
+ - [Cronos Play C++ SDK repository](https://github.com/cronos-labs/play-cpp-sdk)
+- [Contact form](https://airtable.com/shrFiQnLrcpeBp2lS)
+- Email: [contact@cronoslabs.org](mailto:contact@cronoslabs.org)
diff --git a/cronos-gamefi-integraton/useful-links.md b/cronos-gamefi-integraton/useful-links.md
index cc040bc4..dddd9d31 100644
--- a/cronos-gamefi-integraton/useful-links.md
+++ b/cronos-gamefi-integraton/useful-links.md
@@ -6,4 +6,5 @@
- [Openzeppelin](https://docs.openzeppelin.com/)
- [Remix IDE](https://remix.ethereum.org/)
- [Cronos-ChainSafe-Unity-sample](https://github.com/crypto-org-chain/cronos-docs/blob/master/docs/play/assets/cronos-chainsafe-unity-sample.unitypackage.zip)
+- [Cronos Play Unreal SDK plugin repository](https://github.com/cronos-labs/play-unreal-plugin)
- Email: [contact@cronoslabs.org](mailto:contact@cronoslabs.org)
\ No newline at end of file
diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js
index ef2a9cff..742d768a 100644
--- a/docs/.vuepress/config.js
+++ b/docs/.vuepress/config.js
@@ -28,6 +28,10 @@ module.exports = {
text: "Cronos Testnet",
link: "/getting-started/cronos-testnet"
},
+ {
+ text: "Cronos Gravity bridge Testnet",
+ link: "/getting-started/cronos-gbtestnet"
+ },
{
text: "Local network deployment",
link: "/getting-started/local-devnet"
@@ -84,8 +88,8 @@ module.exports = {
link: "/bridge/other_chain#via-crypto-com-defi-wallet"
},
{
- text: "From other chains (Crypto.org Chain Desktop Wallet)",
- link: "/bridge/other_chain#via-crypto-org-chain-desktop-wallet"
+ text: "From other chains (Crypto.com DeFi Desktop Wallet)",
+ link: "/bridge/other_chain#via-crypto-com-defi-desktop-wallet"
}
]
},
@@ -97,16 +101,16 @@ module.exports = {
link: "/play/introduction.html",
},
{
- text: "Getting Started",
+ text: "Unity",
link: "/play/getting-started.html",
},
{
- text: "Login Example",
- link: "/play/login-example.html",
- },
+ text: "Unreal Engine",
+ link: "/play/getting-started_unreal.html",
+ },
{
- text: "Intergrating with Cronos Play",
- link: "/play/cronos-gamefi-integraton.html",
+ text: "C++ SDK",
+ link: "/play/getting-started_cpp.html",
}
]
},
@@ -142,6 +146,7 @@ module.exports = {
"cronos-mainnet",
"metamask",
"cronos-testnet",
+ "cronos-gbtesnet",
"local-devnet",
"security-checklist.md",
"defi-practice",
@@ -166,10 +171,8 @@ module.exports = {
"/play/": [
"introduction",
"getting-started",
- "login-example",
- "scripts",
- "cronos-gamefi-integraton",
- "useful-links",
+ "getting-started_unreal",
+ "getting-started_cpp"
],
"/resources/": [
"chain-integration",
diff --git a/docs/.vuepress/theme/components/Footer.vue b/docs/.vuepress/theme/components/Footer.vue
index bf7aa2a3..87bff535 100644
--- a/docs/.vuepress/theme/components/Footer.vue
+++ b/docs/.vuepress/theme/components/Footer.vue
@@ -73,11 +73,14 @@
+ -->
+
+
diff --git a/docs/bridge/assets/desktop1.png b/docs/bridge/assets/desktop1.png
index 69987c60..ab742a1c 100644
Binary files a/docs/bridge/assets/desktop1.png and b/docs/bridge/assets/desktop1.png differ
diff --git a/docs/bridge/assets/desktop5-2.png b/docs/bridge/assets/desktop5-2.png
index dea4ff16..94a0272c 100644
Binary files a/docs/bridge/assets/desktop5-2.png and b/docs/bridge/assets/desktop5-2.png differ
diff --git a/docs/getting-started/README.md b/docs/getting-started/README.md
new file mode 100644
index 00000000..21c952c8
--- /dev/null
+++ b/docs/getting-started/README.md
@@ -0,0 +1,68 @@
+---
+meta:
+ - name: "title"
+ content: Cronos | Crypto.org EVM Chain | Getting Started
+ - name: "description"
+ content: Learn how to setup nodes, different SDK modules and our all-in-one command-line interface cronosd in this technical documentation.
+ - name: "og:title"
+ content: Cronos | Crypto.org EVM Chain | Getting Started
+ - name: "og:type"
+ content: Website
+ - name: "og:description"
+ content: Learn how to setup nodes, different SDK modules and our all-in-one command-line interface cronosd in this technical documentation.
+ - name: "og:image"
+ content: https://cronos.org/og-image.png
+ - name: "twitter:title"
+ content: Cronos | Crypto.org EVM Chain | Getting Started
+ - name: "twitter:site"
+ content: "@cryptocom"
+ - name: "twitter:card"
+ content: summary_large_image
+ - name: "twitter:description"
+ content: Learn how to setup nodes, different SDK modules and our all-in-one command-line interface cronosd in this technical documentation.
+ - name: "twitter:image"
+ content: https://cronos.org/og-image.png
+canonicalUrl: https://cronos.org/docs/getting-started/
+---
+
+# Getting Started
+
+Thanks for your interest in Cronos Chain. In this technical documentation, we have covered node setup instructions, our all-in-one command-line interface `cronosd`, and different SDK modules we utilized in the Cronos Chain.
+
+### What is Cronos Chain?
+
+Cronos is the first Ethereum-compatible blockchain network built on Cosmos SDK technology. An open-source and permission-less Layer 1 chain, Cronos aims to massively scale the DeFi, GameFi, and overall Web3 user community by providing builders with the ability to instantly port apps and crypto assets from other chains while benefiting from low transaction fees, high throughput, and fast finality.
+
+#### Cronos Chain Mainnet Beta
+
+- [Join Cronos Mainnet Beta](./cronos-mainnet.md):
+
+ Try running Full Node connected Cronos Mainnet Beta.
+
+- [Setup your Metamask](./metamask.md):
+
+ Setup Metamask and connect to Cronos Mainnet Beta.
+
+#### Cronos Testnet
+
+- [Join Cronos Testnet](./cronos-testnet.md):
+
+ Try running Full Nodes or Validators connected to our Cronos Testnet.
+
+#### Devnet
+
+- **Devnet** - [Build latest development version](./local-devnet.md):
+
+ Try running the latest development network (_Devnet_)
+
+### Useful links
+
+
+
+- [Project Website](https://cronos.org)
+- [Project Repository](https://github.com/crypto-org-chain/cronos)
+- Community chatrooms (non-technical): [Discord](https://discord.gg/nsp9JTC) [Telegram](https://t.me/CryptoComOfficial)
+- Developer community channel (technical): [![Support Server](https://img.shields.io/discord/783264383978569728.svg?color=7289da&label=Crypto.org Chain)](https://discord.gg/pahqHz26q4)
+- Email dev relations : [contact@cronoslabs.org](mailto:contact@cronoslabs.org)
+
+
diff --git a/docs/getting-started/cronos-gbtesnet.md b/docs/getting-started/cronos-gbtesnet.md
new file mode 100644
index 00000000..3bb73bbb
--- /dev/null
+++ b/docs/getting-started/cronos-gbtesnet.md
@@ -0,0 +1,215 @@
+# Cronos gravity bridge testnet: Running Nodes
+
+This is a detailed documentation for setting up a full node on Cronos gravity bridge testnet - Pionner 11 `pioneereleventestnet_340-1`.
+
+::: tip Remarks:
+
+Cronos gravity bridge testnet - Pionner 11 (`pioneereleventestnet_340-1`) is **distinct from** the official "Cronos testnet" (`cronostestnet_338-3`) which is used by app developers to test their Dapps. The Pioneer 11 testnet is a dedicated testnet created specifically for the purpose of testing the Cronos Gravity Bridge.
+:::
+
+
+## Pre-requisites
+
+### Supported OS
+
+We officially support macOS, Windows and Linux only. Other platforms may work but there is no guarantee. We will extend our support to other platforms after we have stabilized our current architecture.
+
+### Prepare your machine
+
+- To run Cronos gravity bridge testnet nodes, you will need a machine with the following minimum requirements:
+
+ - 4-core, x86_64/ARM architecture processor;
+ - 16 GB RAM;
+ - 1 TB of storage space.
+
+## Step 1. Get the Cronos gravity bridge testnet binary
+
+
+To simplify the following step, we will be using **Linux** (Intel x86) for illustration. Binary for
+
+**Mac** Intel x86 as `Darwin_x86_64`, **Mac** M1 as `arm64` and **Windows** as `Windows_x86_64` are also available [here](https://github.com/crypto-org-chain/cronos/releases/tag/v0.8.0-gravity-alpha0).
+
+- To install released **Cronos Cronos Pionner 11 testnet binaries** from github:
+
+ ```bash
+ $ curl -LOJ https://github.com/crypto-org-chain/cronos/releases/download/v0.8.0-gravity-alpha0/cronos_0.8.0-gravity-alpha0-testnet_Linux_x86_64.tar.gz
+ $ tar -zxvf cronos_0.8.0-gravity-alpha0-testnet_Linux_x86_64.tar.gz
+ ```
+
+ Afterward, you can check the version of `cronosd` by
+
+ ```bash
+ $ ./cronosd version
+ v0.8.0
+ ```
+
+## Step 2. Configure `cronosd`
+
+### Step 2-0 (Optional) Clean up the old blockchain data
+
+- If you have joined other Cronos gravity bridge testnet before, you would have to clean up the old blockchain data and start over again, it can be done by running:
+
+ ```bash
+ $ ./cronosd unsafe-reset-all
+ ```
+
+ and remove the old genesis file by
+
+ ```bash
+ $ rm ~/.cronos/config/genesis.json
+ ```
+
+Before kick-starting your node, we will have to configure your node so that it connects to the Cronos gravity bridge testnet:
+
+### Step 2-1 Initialize `cronosd`
+
+- First of all, you can initialize cronosd by:
+
+ ```bash
+ $ ./cronosd init [moniker] --chain-id pioneereleventestnet_340-1
+ ```
+
+ This `moniker` will be the displayed id of your node when connected to the Cronos network.
+ When providing the moniker value, make sure you drop the square brackets since they are not needed.
+ The example below shows how to initialize a node named `pegasus-node` :
+
+ ```bash
+ $ ./cronosd init pegasus-node --chain-id pioneereleventestnet_340-1
+ ```
+
+ ::: tip NOTE
+
+ - Depending on your cronosd home setting, the cronosd configuration will be initialized to that home directory. To simply the following steps, we will use the default cronosd home directory `~/.cronos/` for illustration.
+ - You can also put the `cronosd` to your binary path and run it by `cronosd`
+ :::
+
+### Step 2-2 Configure cronosd
+
+- Download and replace the Cronos Testnet `genesis.json` by:
+
+ ```bash
+ $ curl https://raw.githubusercontent.com/crypto-org-chain/cronos-testnets/main/pioneereleventestnet_340-1/genesis.json > ~/.cronos/config/genesis.json
+ ```
+
+- Verify sha256sum checksum of the downloaded `genesis.json`. You should see `OK!` if the sha256sum checksum matches.
+
+ ```bash
+ $ if [[ $(sha256sum ~/.cronos/config/genesis.json | awk '{print $1}') = "350b4d14d38d37b1f60b340bcb6c05cc1e0980811e2153fdef29a6530bd3d952" ]]; then echo "OK"; else echo "MISMATCHED"; fi;
+
+ OK!
+ ```
+
+ ::: tip NOTE
+
+ - For Mac environment, `sha256sum` was not installed by default. In this case, you may setup `sha256sum` with this command:
+
+ ```bash
+ function sha256sum() { shasum -a 256 "$@" ; } && export -f sha256sum
+ ```
+
+ :::
+
+
+- For network configuration, in `~/.cronos/config/config.toml`, validator nodes need to modify the configurations of `persistent_peers`, `create_empty_blocks_interval` and `timeout_commit`. For non-validator full nodes, only `persistent_peers` modification is required:
+ ```bash
+ $ sed -i.bak -E 's#^(persistent_peers[[:space:]]+=[[:space:]]+).*$#\1"0d5cf1394a1cfde28dc8f023567222abc0f47534@52.74.82.209:26656,04f43116b4c6c70054d9c2b7485383df5b1ed1da@52.76.110.186:26656"#' ~/.cronos/config/config.toml
+ $ sed -i.bak -E 's#^(create_empty_blocks_interval[[:space:]]+=[[:space:]]+).*$#\1"5s"#' ~/.cronos/config/config.toml
+ $ sed -i.bak -E 's#^(timeout_commit[[:space:]]+=[[:space:]]+).*$#\1"5s"#' ~/.cronos/config/config.toml
+ ```
+
+::: tip NOTE
+
+- For Mac environment, if `jq` is missing, you may install it by: `brew install jq`
+ :::
+
+## Step 3. Run everything
+
+
+Once the `cronosd` has been configured, we are ready to start the node and sync the blockchain data:
+
+- Start cronosd, e.g.:
+
+```bash
+ $ ./cronosd start --unsafe-experimental
+```
+
+::: tip Remarks:
+If you see errors saying `too many files opened...`, then you need to set a higher number for maximum open file descriptors in your OS.
+
+If you are on OSX or Linux, then the following could be useful:
+
+```bash
+# Check current max fd
+$ ulimit -n
+# Set a new max fd
+$ ulimit -Sn [NEW_MAX_FILE_DESCRIPTOR]
+# Example
+$ ulimit -Sn 4096
+```
+
+:::
+
+- _(Optional for Linux)_ Start cronosd with systemd service, e.g.:
+
+```bash
+ $ curl -s https://raw.githubusercontent.com/crypto-org-chain/cronos-docs/master/systemd/create-service.sh -o create-service.sh && curl -s https://raw.githubusercontent.com/crypto-org-chain/cronos-docs/master/systemd/cronosd.service.template -o cronosd.service.template
+ $ chmod +x ./create-service.sh && ./create-service.sh
+ $ sudo systemctl start cronosd --unsafe-experimental
+ # view log
+ $ journalctl -u cronosd -f
+```
+
+:::details Example: /etc/systemd/system/cronosd.service created by script
+
+```bash
+# /etc/systemd/system/cronosd.service
+[Unit]
+Description=cronosd
+ConditionPathExists=/usr/local/bin/cronosd
+After=network.target
+
+[Service]
+Type=simple
+User=ubuntu
+WorkingDirectory=/usr/local/bin
+ExecStart=/usr/local/bin/cronosd start --unsafe-experimental --home /home/ubuntu/.cronos
+Restart=on-failure
+RestartSec=10
+LimitNOFILE=50000
+
+[Install]
+WantedBy=multi-user.target
+```
+
+:::
+
+It should begin fetching blocks from the other peers. Please wait until it is fully synced before moving onto the next step.
+
+- You can query the node syncing status by
+
+ ```bash
+ $ ./cronosd status 2>&1 | jq '.SyncInfo.catching_up'
+ ```
+
+ If the above command returns `false`, It means that your node **is fully synced**; otherwise, it returns `true` and implies your node is still catching up.
+
+- One can check the current block height by querying the public full node by:
+
+ ```bash
+ curl -s https://rpc-p11.cronos.org/commit | jq "{height: .result.signed_header.header.height}"
+ ```
+
+ and you can check your node's progress (in terms of block height) by
+
+ ```bash
+ $ ./cronosd status 2>&1 | jq '.SyncInfo.latest_block_height'
+ ```
+
+## Cronos gravity bridge testnet faucet and explorer
+
+- You can lookup data within the `pioneereleventestnet_340-1` network by the [explorer](https://cronos.org/explorer/pioneer11);
+
+- To interact with the blockchain, simply use the [test-token faucet](https://cronos.org/pioneer11-faucet) to obtain test CRO tokens for performing transactions on the **Cronos** gravity bridge testnet.
+
+ - Users can use the [faucet](https://cronos.org/pioneer11-faucet) to obtain test tokens, please note that you would need a Ethereum type address `0x...` that can be obtained by [Using metamask](./metamask.md#using-metamask-on-cronos-gravity-birdge-testnet-pionner-11).
+
diff --git a/docs/play/assets/unreal-engine/blue_print.png b/docs/play/assets/unreal-engine/blue_print.png
new file mode 100644
index 00000000..03d6a6ef
Binary files /dev/null and b/docs/play/assets/unreal-engine/blue_print.png differ
diff --git a/docs/play/getting-started_cpp.md b/docs/play/getting-started_cpp.md
new file mode 100644
index 00000000..458a3bb3
--- /dev/null
+++ b/docs/play/getting-started_cpp.md
@@ -0,0 +1,405 @@
+# Cronos Play C++ SDK
+
+## Pre-requisites
+
+- python 3.8 or newer
+- [rust](https://www.rust-lang.org/) 1.61 or newer
+- C++ 14 or newer
+- Optional:
+ - GNU make
+ - Visual Studio 2019 or newer for windows
+
+# Pre-build Download
+
+Please download the archive file based on your OS in the [release page](https://github.com/cronos-labs/play-cpp-sdk/releases), where:
+
+- Visual Studio 2019 MSVC, x86_64, toolset 14.29 or newer: `play_cpp_sdk_Windows_x86_64.zip`;
+- macOS 10.15 or newer: `play_cpp_sdk_Darwin_x86_64.tar.gz`;
+- Ubuntu 20.04 or newer: `play_cpp_sdk_Linux_x86_64.tar.gz`.
+
+## Setup
+
+### In a demo Visual C++ project
+
+#### Windows
+
+1. Clone the following repository
+ ```sh
+ git clone https://github.com/cronos-labs/play-cpp-sdk.git
+ ```
+2. Unzip the archive file into `demo` folder
+3. Open `demo.sln` which includes two projects: `demo` (dynamic build) and `demostatic` (static
+ build). If you use Visual Studio 2022, retarget project, and upgrade PlatformToolset to
+ v143.
+4. Select `Release` profile.
+5. Right click `demo` or `demostatic` project, click `Build` or `Rebuild` to build the project
+
+##### Build Events
+
+The following build events are included in the project file:
+
+- Pre-Build event (`demo` and `demostatic`): `call pre_build.bat`
+- Post-Build event (`demo`): `copy $(ProjectDir)lib\play_cpp_sdk.dll $(TargetDir)`
+
+#### Mac
+
+1. Clone the current repository
+ ```sh
+ git clone https://github.com/cronos-labs/play-cpp-sdk.git
+ ```
+2. Unzip the archive file into `demo` folder
+3. Copy the dynamic library to `/usr/local/lib`
+ ```sh
+ cd demo
+ cp lib/libplay_cpp_sdk.dylib /usr/local/lib
+ ```
+4. Under `demo` folder and build the `demo` project
+ ```sh
+ make
+ ```
+
+#### Linux
+
+1. Clone the current repository
+ ```sh
+ git clone https://github.com/cronos-labs/play-cpp-sdk.git
+ ```
+2. Unzip the archive file into `demo` folder
+3. Under `demo` folder and build the `demo` project
+ ```sh
+ make
+ ```
+
+### In any other c++ 14 (or newer) projects
+
+1. Unzip the archive file into the root folder of your project, you should see the following
+ folders and files.
+
+- `include`: c++ source files and header files
+- `lib`: static and dynamic libraries
+- `CHANGELOG.md`
+- `LICENSE`
+
+::: tip We suggest:
+- In case of same name collision, we suggest you unzip the archive in a temporary folder and
+review them first.
+- Review the folder or file names under `include` and `lib` folder to see if there are files
+that have same names as in your project, rename those files in your project to avoid
+collision.
+- Finally copy `include` and `lib` folders into your project.
+- We will support CMAKE and provide you a better integration in future release.
+:::
+
+2. Include the following headers and use the namespaces in your source codes
+
+```c++
+#include "include/defi-wallet-core-cpp/src/contract.rs.h" // erc20, erc721, erc1155 supports
+#include "include/defi-wallet-core-cpp/src/lib.rs.h" // wallet, EIP4361, query, signing, broadcast etc, on crypto.org and cronos
+#include "include/defi-wallet-core-cpp/src/nft.rs.h" // crypto.org chain nft support
+#include "include/defi-wallet-core-cpp/src/uint.rs.h" // uint256 type support
+#include "include/extra-cpp-bindings/src/lib.rs.h" // etherscan/cronoscan, crypto.com pay, wallet connect support
+#include "include/rust/cxx.h" // the important data types, e.g., rust::String, rust::str, etc
+
+using namespace rust;
+using namespace org::defi_wallet_core;
+using namespace com::crypto::game_sdk;
+```
+
+3. Link `play_cpp_sdk` static library in your build flow (check `demo/Makefile` for more
+ details)
+
+Windows
+```c++
+lib\play_cpp_sdk.lib
+```
+Mac or Linux
+```c++
+lib/libplay_cpp_sdk.a
+```
+
+4. Or link `play_cpp_sdk` dynamic library and `cxxbridge1` static library in your build flow
+ (check `demo/Makefile` for more details)
+
+Windows
+```
+lib\play_cpp_sdk.dll.lib
+lib\libcxxbridge1.a
+```
+
+Mac or Linux
+```c++
+lib/libplay_cpp_sdk.dylib
+lib\libcxxbridge1.a
+```
+- Linux dynamic build is under testing.
+
+## Build libraries and bindings from scratch
+
+If the Pre-built release does not support your platform, you can build the binaries and
+bindings on your own.
+
+### Windows
+
+1. Run `windows_build.bat` in x64 Native Tools Command Prompt for VS 2019. It will clone
+ necessary submodules, build `play-cpp-sdk` crate, finally setup and build the demo project.
+2. Clean `~/.cargo/git/checkouts` if cxx fails to build, then run `windows_build.bat` again.
+3. Run `windows_install.bat`, libraries and bindings will be copied into a new created folder:
+ `build`
+
+### Notes about Visual Studio 2022
+
+1. Open `demo.sln`. If you use Visual Studio 2022, retarget project, and upgrade
+ PlatformToolset to `v143` before running `windows_build.bat`
+
+### Mac
+
+1. Run `make build_cpp` or `make cppx86_64`
+2. Run `make install`, libraries and bindings will be copied into a new created folder: `build`
+
+### Linux
+
+1. Run `make build_cpp`
+2. Run `make install`, libraries and bindings will be copied into a new created folder: `build`
+
+## Common functions
+
+Full function list can be found [here](https://leslie-h-cheung.gitbook.io/cronos-play-c++-sdk/readme-1)
+
+## Wallet related functions
+
+function `new_wallet` - Generates the HD wallet with a BIP39 backup phrase (English words) and password
+
+```rust
+::rust::Box<::org::defi_wallet_core::Wallet > new_wallet(
+ ::rust::String password,
+ ::org::defi_wallet_core::MnemonicWordCount word_count
+)
+```
+
+function `restore_wallet` - Recovers/imports HD wallet from a BIP39 backup phrase (English words) and password
+
+```rust
+::rust::Box<::org::defi_wallet_core::Wallet > restore_wallet(
+ ::rust::String mnemonic,
+ ::rust::String password
+)
+```
+
+function `new_privatekey`- Generates a random private key
+
+```rust
+::rust::Box<::org::defi_wallet_core::PrivateKey > new_privatekey()
+```
+
+function `new_privatekey_from_bytes` - Constructs private key from hex bytes
+
+```rust
+// constructs private key from bytes
+::rust::Box<::org::defi_wallet_core::PrivateKey > new_privatekey_from_bytes(
+ ::rust::Vec<::std::uint8_t > bytes
+)
+```
+
+`function new_privatekey_from_hex` - Constructs private key from hex string
+
+```rust
+// constructs private key from hex string
+::rust::Box<::org::defi_wallet_core::PrivateKey > new_privatekey_from_hex(
+ ::rust::String hex
+)
+```
+
+### ERC20, ERC721, ERC1155 related functions
+
+## [ERC20](https://leslie-h-cheung.gitbook.io/cronos-play-c++-sdk/readme-1/classes/structorg_1_1defi__wallet__core_1_1_erc20)
+
+function `balance_of` - Returns the decimal amount of tokens owned by account_address.
+
+```rust
+::org::defi_wallet_core::U256 balance_of(
+ ::rust::String account_address
+) const
+
+```
+
+**Example**
+
+```Rust
+Erc20 erc20 = new_erc20("0xf0307093f23311FE6776a7742dB619EB3df62969",
+ "https://cronos-testnet-3.crypto.org:8545", 383)
+ .legacy();
+U256 = erc20.balance_of("0xf0307093f23311FE6776a7742dB619EB3df62969");
+cout << balance.to_string() << endl;
+```
+
+function `name` -Returns the name of the token.
+
+```rust
+::rust::String name() const
+```
+
+**Example**
+
+```Rust
+Erc20 erc20 = new_erc20("0xf0307093f23311FE6776a7742dB619EB3df62969",
+ "https://cronos-testnet-3.crypto.org:8545", 383);
+String name = erc20.name();
+assert(name == "USDC");
+```
+
+function `symbol` - Returns the symbol of the token.
+
+```rust
+::rust::String symbol() const
+```
+
+**Example**
+
+```rust
+Erc20 erc20 = new_erc20("0xf0307093f23311FE6776a7742dB619EB3df62969",
+ "https://cronos-testnet-3.crypto.org:8545", 383);
+String symbol = erc20.symbol();
+assert(symbol == "USDC");
+```
+
+function `decimals`- Returns the number of decimals the token uses.
+
+```rust
+::std::uint8_t decimals() const
+```
+
+**Example**
+
+```rust
+Erc20 erc20 = new_erc20("0xf0307093f23311FE6776a7742dB619EB3df62969",
+ "https://cronos-testnet-3.crypto.org:8545", 383)
+ .legacy();
+uint8_t decimals = erc20.decimals();
+assert(decimals == 6);
+```
+
+## [ERC721](https://leslie-h-cheung.gitbook.io/cronos-play-c++-sdk/readme-1/classes/structorg_1_1defi__wallet__core_1_1_erc721)
+
+function `balance_of` - Returns the number of tokens in owner's account_address.
+
+```rust
+::org::defi_wallet_core::U256 balance_of(
+ ::rust::String account_address
+) const
+```
+
+function `owner_of` - Returns the owner of the token_id token.
+
+```rust
+::rust::String owner_of(
+ ::rust::String token_id
+) const
+```
+
+function `name` - Get the descriptive name for a collection of NFTs in this contract.
+
+```rust
+::rust::String name() const
+```
+
+function `symbol` - Get the abbreviated name for NFTs in this contract.
+
+```rust
+::rust::String symbol() const
+```
+
+function `token_uri`- Get the distinct Uniform Resource Identifier (URI) for a given asset.
+
+```rust
+::rust::String token_uri(
+ ::rust::String token_id
+) const
+```
+
+function `transfer_from` - Transfers token_id token from from_address to to_address.
+
+```rust
+::org::defi_wallet_core::CronosTransactionReceiptRaw transfer_from(
+ ::rust::String from_address,
+ ::rust::String to_address,
+ ::rust::String token_id,
+ const ::org::defi_wallet_core::PrivateKey & private_key
+) const
+```
+
+function `safe_transfer_from` - Safely transfers `token_id` token from `from_address` to `to_address`.
+
+```rust
+::org::defi_wallet_core::CronosTransactionReceiptRaw safe_transfer_from(
+ ::rust::String from_address,
+ ::rust::String to_address,
+ ::rust::String token_id,
+ const ::org::defi_wallet_core::PrivateKey & private_key
+) const
+```
+
+function `safe_transfer_from_with_data` - Safely transfers token_id token from from_address to to_address with additional_data.
+
+```rust
+::org::defi_wallet_core::CronosTransactionReceiptRaw safe_transfer_from_with_data(
+ ::rust::String from_address,
+ ::rust::String to_address,
+ ::rust::String token_id,
+ ::rust::Vec<::std::uint8_t > additional_data,
+ const ::org::defi_wallet_core::PrivateKey & private_key
+) const
+```
+
+## [ERC1155](https://leslie-h-cheung.gitbook.io/cronos-play-c++-sdk/readme-1/classes/structorg_1_1defi__wallet__core_1_1_erc1155)
+
+function `balance_of` - Returns the amount of tokens of `token_id` owned by `account_address`.
+
+```rust
+::org::defi_wallet_core::U256 balance_of(
+ ::rust::String account_address,
+ ::rust::String token_id
+) const
+```
+
+function `balance_of_batch` - Batched version of balance_of, get the balance of multiple account/token pairs
+
+```rust
+::rust::Vec<::rust::String > balance_of_batch(
+ ::rust::Vec<::rust::String > account_addresses,
+ ::rust::Vec<::rust::String > token_ids
+) const
+```
+
+function `uri` - Get the distinct Uniform Resource Identifier (URI) for a given asset.
+
+```rust
+::rust::String uri(
+ ::rust::String token_id
+) const
+```
+
+function `safe_transfer_from` - Transfers amount tokens of `token_id` from `from_address` to `to_address` with `additional_data`.
+
+```rust
+::org::defi_wallet_core::CronosTransactionReceiptRaw safe_transfer_from(
+ ::rust::String from_address,
+ ::rust::String to_address,
+ ::rust::String token_id,
+ ::rust::String amount,
+ ::rust::Vec<::std::uint8_t > additional_data,
+ const ::org::defi_wallet_core::PrivateKey & private_key
+) const
+```
+
+function `safe_batch_transfer_from` - Batched version of `safeTransferFrom`.
+
+```rust
+::org::defi_wallet_core::CronosTransactionReceiptRaw safe_batch_transfer_from(
+ ::rust::String from_address,
+ ::rust::String to_address,
+ ::rust::Vec<::rust::String > token_ids,
+ ::rust::Vec<::rust::String > amounts,
+ ::rust::Vec<::std::uint8_t > additional_data,
+ const ::org::defi_wallet_core::PrivateKey & private_key
+) const
+```
diff --git a/docs/play/getting-started_unreal.md b/docs/play/getting-started_unreal.md
new file mode 100644
index 00000000..2e62b6e0
--- /dev/null
+++ b/docs/play/getting-started_unreal.md
@@ -0,0 +1,113 @@
+# Unreal Engine Plugin
+
+## Pre-requisites
+
+Unreal Engine 4.27 and 5.0 are supported, i.e. one of them should be installed via the Epic Games Launcher.
+
+### Supported OS
+
+- **Windows**: Make sure you use Visual Studio 2019 or later.(2022) it's already coded, if any compiling errors occur, add these line to top of c++ file:
+```c++
+#pragma warning(disable:4583)
+#pragma warning(disable:4582)
+```
+- **macOS**:
+ Make sure you use Xcode 13.2.1. If you are building the C++ SDK bindings and the corresponding binaries from Rust for Unreal Engine 5, then make sure to set a deployment target for the [Cronos Play C++ SDK](https://github.com/cronos-labs/play-cpp-sdk):
+
+```rust
+export MACOSX_DEPLOYMENT_TARGET=10.15
+cargo build ..
+// You may check the deployment target using `otool`:
+otool -l .dylib
+// where The `LC_BUILD_VERSION/minos` should be `10.15`.
+```
+## Start building!
+
+### How to compile
+
+To compile the existing library, follow the steps below:
+
+1. Install unreal engine 4.27
+2. Clone the following repository
+ ```sh
+ git clone https://github.com/cronos-labs/play-unreal-plugin
+ ```
+3. open `CronosPlaySdk/CronosPlaySdk.uproject` with the unreal editor
+
+### How to install
+
+To install, run the following commands:
+
+1. Run the following commands to copy dynamic libraries for ue4 editor
+ ```sh
+ git clone https://github.com/cronos-labs/play-unreal-plugin
+ cd CronosPlaySdk
+ `copydll.sh` or `copydll.bat`
+ mkdir Plugins
+ copy ./CronosPlaySdk/Plugins/CronosPlayUnreal yourProjectFolder/Plugins/
+ cd yourProjectFolder/Plugins/
+ `copydll.sh` or `copydll.bat`
+ ```
+### How to start coding
+
+1. click **add blueprint** in the ue4 menu
+2. inherit DefiWalletCoreActor or PlayCppSdkActor
+3. drag & drop your class to the scene
+4. category is **CronosPlayUnreal**
+5. the api in `..Blueprint.h` is stateless, and can be called anywhere in the blueprint
+
+
+
+## Documentation for UE function and blueprint
+
+Users can also download the [CronosPlaySdkHelp](https://github.com/cronos-labs/play-unreal-plugin/releases) and check the documentation for ue function and blueprint document.
+
+
+## Unreal Engine sample code
+
+This section contains a sample project that uses the Cronos Play Unreal SDK plugin.
+For more information, please see the [Cronos Play Unreal SDK plugin repository](https://github.com/cronos-labs/play-unreal-plugin).
+
+### Pre-requisites
+
+Visual Studo 2019 or later (2022) or XCODE 13.2.1
+Unreal Engine 4.27 and 5.0 are supported, i.e. one of them should be installed via the Epic Games Launcher.
+
+### Installation
+
+To install, run the following commands:
+
+**macOS**
+1. Run the following commands
+ ```sh
+ git clone https://github.com/cronos-labs/play-unreal-demo
+ cd play-unreal-demo/CronosPlayUnrealDemo/
+ `copydll.sh`
+ ```
+2. `CronosPlayUnrealDeemo.project` with the unreal editor
+
+
+**Windows**
+1. Run the following commands
+ ```sh
+ git submodule update --init --recursive`
+ cd CronosPlayUnrealDemo`
+ `copydll.bat`
+ ```
+2. `CronosPlayUnrealDemo.project`with the unreal editor
+
+
+### Documentation generation
+
+Currently, this is supported on Windows via [KantanDocGen Plugin](https://github.com/kamrann/KantanDocGenPlugin):
+
+1. Run `getdoc.sh` inside [Git shell](https://gitforwindows.org)
+2. Enable KantanDocGenPlugin in plugins
+3. Open the plugin dialog: File -> KantanDocGen
+4. Navigate in this dialog: Class Search -> Native Module -> Click + -> **CronosPlayUnreal**
+5. Click on "Generate Docs"
+ - location: **CronosPlaySdk/Saved/KantanDocGen/**
+
+### More information for Cronos Play
+
+If you are interested to build on Cronos, please visit [Cronos Play](https://cronos.org/play) or fill this [Contact Form](https://airtable.com/shrFiQnLrcpeBp2lS) for more information.
diff --git a/docs/resources/assets/desktopwallet-button.png b/docs/resources/assets/desktopwallet-button.png
index b2ba4e91..53388261 100644
Binary files a/docs/resources/assets/desktopwallet-button.png and b/docs/resources/assets/desktopwallet-button.png differ
diff --git a/for-dapp-developers/desktop-wallet-integration.md b/for-dapp-developers/desktop-wallet-integration.md
index fc740823..14b5b742 100644
--- a/for-dapp-developers/desktop-wallet-integration.md
+++ b/for-dapp-developers/desktop-wallet-integration.md
@@ -2,9 +2,9 @@
## Introduction
-[Crypto.org Chain Desktop Wallet (Beta)](https://crypto.org/desktopwallet), a public, open-source Desktop Wallet on Cronos Chain.
+[Crypto.com DeFi Desktop Wallet](https://crypto.com/defi-wallet), a public, open-source Desktop Wallet on Cronos Chain.
-Crypto.org Chain Desktop Wallet (Beta) supports staking operations, validator selections, and governance voting. Users can also view, send and mint NFTs directly, and much more from the Desktop Wallet. It provides a simple and secure way for users to connect their Desktop Wallet with Ethereum-compatible DApps via DApp Browser.
+Crypto.com DeFi Desktop Wallet supports staking operations, validator selections, and governance voting. Users can also view, send and mint NFTs directly, and much more from the Desktop Wallet. It provides a simple and secure way for users to connect their Desktop Wallet with Ethereum-compatible DApps via DApp Browser.
* **For DApp builders**, integrating with Desktop Wallet allows them to offer a streamlined user experience to the users, as well as encourage increased adoption and usage.
* **For users**, this means that they can connect to DApps simply by clicking the DApp's logo or type in the DApp's URL, they can also bookmark their favorite DApps. The user experience is familiar for those who are already using DApps in the browser. It also supports Ledger out of the box.
@@ -40,8 +40,8 @@ desktopWalletButton.on("click", () => {
if (navigator.userAgent.includes("Desktop Wallet")) {
// within Desktop Wallet's DappBrowser, connect wallet
} else {
- // jump to download desktop wallet page
- window.open("https://crypto.org/desktopwallet");
+ // jump to download Desktop Wallet page
+ window.open("https://crypto.com/defi-wallet");
}
});
```
diff --git a/for-users/bridge/desktop.md b/for-users/bridge/desktop.md
index de5b91d7..8ebfee4b 100644
--- a/for-users/bridge/desktop.md
+++ b/for-users/bridge/desktop.md
@@ -1,8 +1,8 @@
-# From Crypto.org Chain (Crypto.org Chain Desktop Wallet)
+# From Crypto.org Chain (Crypto.com DeFi Desktop Wallet)
-## Transfer assets from Crypto.org Chain using Crypto.org Chain Desktop Wallet
+## Transfer assets from Crypto.org Chain using Crypto.com DeFi Desktop Wallet
-Crypto.org Chain Desktop Wallet has integrated with the Cronos Bridge to allow all of its wallet users to seamlessly transfer assets over to Cronos straight from the Crypto.org Chain Desktop Wallet. Here’s how you can do so:
+Crypto.com DeFi Desktop Wallet has integrated with the Cronos Bridge to allow all of its wallet users to seamlessly transfer assets over to Cronos straight from the Crypto.com DeFi Desktop Wallet. Here’s how you can do so:
### Step-by-step Walkthrough
@@ -10,7 +10,7 @@ Crypto.org Chain Desktop Wallet has integrated with the Cronos Bridge to allow a
**Step 2**: Select “From” Crypto.org Chain as the origination chain and “To” Cronos Chain as the destination chain
-Only the `Crypto.org Chain <=> Cronos` route will be available on Day 1. The `Ethereum <=> Cronos` route will not be available till the Cronos Gravity Bridge goes live. As a user of the Crypto.org Chain Desktop Wallet, you will automatically have a Crypto.org Chain wallet address and Cronos Chain wallet address created for you. These wallet addresses will automatically be detected by the Cronos bridge.
+Only the `Crypto.org Chain <=> Cronos` route will be available on Day 1. The `Ethereum <=> Cronos` route will not be available till the Cronos Gravity Bridge goes live. As a user of the Crypto.com DeFi Desktop Wallet, you will automatically have a Crypto.org Chain wallet address and Cronos Chain wallet address created for you. These wallet addresses will automatically be detected by the Cronos bridge.
**Step 3**: Enter the amount of CRO you want to transfer and click “Transfer Asset”
diff --git a/for-users/bridge/other_chain.md b/for-users/bridge/other_chain.md
index e18029cd..0ca84402 100644
--- a/for-users/bridge/other_chain.md
+++ b/for-users/bridge/other_chain.md
@@ -237,11 +237,11 @@ Alternatively, you may view your transaction history on the upper right hand cor
![centered image](../../docs/bridge/assets/defiwallet6.png)
-## Via Crypto.org Chain Desktop Wallet
+## Via Crypto.com DeFi Desktop Wallet
-### Transfer assets from Crypto.org Chain using Crypto.org Chain Desktop Wallet
+### Transfer assets from Crypto.org Chain using Crypto.com DeFi Desktop Wallet
-Crypto.org Chain Desktop Wallet has integrated with the Cronos Bridge to allow all of its wallet users to seamlessly transfer assets over to Cronos straight from the Crypto.org Chain Desktop Wallet. Here’s how you can do so:
+Crypto.com DeFi Desktop Wallet has integrated with the Cronos Bridge to allow all of its wallet users to seamlessly transfer assets over to Cronos straight from the Crypto.com DeFi Desktop Wallet. Here’s how you can do so:
### Step-by-step Walkthrough
@@ -249,7 +249,7 @@ Crypto.org Chain Desktop Wallet has integrated with the Cronos Bridge to allow a
**Step 2**: Select “From” Crypto.org Chain as the origination chain and “To” Cronos Chain as the destination chain
-Only the `Crypto.org Chain <=> Cronos` route will be available on Day 1. The `Ethereum <=> Cronos` route will not be available till the Cronos Gravity Bridge goes live. As a user of the Crypto.org Chain Desktop Wallet, you will automatically have a Crypto.org Chain wallet address and Cronos Chain wallet address created for you. These wallet addresses will automatically be detected by the Cronos bridge.
+Only the `Crypto.org Chain <=> Cronos` route will be available on Day 1. The `Ethereum <=> Cronos` route will not be available till the Cronos Gravity Bridge goes live. As a user of the Crypto.com DeFi Desktop Wallet, you will automatically have a Crypto.org Chain wallet address and Cronos Chain wallet address created for you. These wallet addresses will automatically be detected by the Cronos bridge.
**Step 3**: Enter the amount of CRO you want to transfer and click “Transfer Asset”
diff --git a/for-users/metamask.md b/for-users/metamask.md
index 0f4e96b2..56e621c1 100644
--- a/for-users/metamask.md
+++ b/for-users/metamask.md
@@ -71,6 +71,15 @@ Similarly, for Cronos testnet, insert the network name, for example "Cronos test
* ![](../docs/getting-started/assets/3.png)
* After saving the network config, we should be able to see the token in your address!
+### Using MetaMask on Cronos Gravity birdge testnet (Pionner 11)
+
+For Cronos Gravity birdge testnet (Pionner 11), insert the network name, for example "Cronos testnet" and put
+
+- `https://evm-p11.cronos.org` for **New RPC URL**,
+- `340` for **Chain ID**,
+- `tCRO` for the symbol, and
+- `https://cronos.org/explorer/pioneer11` for the **Block explorer URL**.
+
## Importing private key to MetaMask
Alternatively, We can export the private key by using the `unsafe-export-eth-key` command with `cronosd`, for example:
@@ -117,7 +126,8 @@ $ cronosd debug addr 2F743F55AC49A446484988505244941DEDA1B60A
```
{% hint style="info" %}
-Remarks: One would have to add the `0x` at the beginning when using the Ethereum HEX address shown as above: for example: `Address (hex): 2F743F55AC49A446484988505244941DEDA1B60A` implies that `0x2F743F55AC49A446484988505244941DEDA1B60A` will be the address in the Ethereum manner.
+Remarks: One would have to add the `0x` at the beginning when using the Ethereum HEX address shown as above: for example:
+`Address (hex): 2F743F55AC49A446484988505244941DEDA1B60A` implies that `0x2F743F55AC49A446484988505244941DEDA1B60A` will be the address in the Ethereum manner.
{% endhint %}
## Resetting your account on Metamask
@@ -126,15 +136,16 @@ If you come across any issue with your account or you have used the imported acc
Simply go to `Setting/Advance` and click `Reset Account` as shown below:
-![](../docs/getting-started/assets/10.png)
+
## FAQs for ERC20-only transaction Support
-### Q1: I transferred CRO from the other centralized exchanges (CEXs) to the Crypto.org Desktop wallet, but why it is not showing up in my Crypto.org Chain Desktop Wallet?
+### Q1: I transferred CRO from the other centralized exchanges (CEXs) to the Crypto.org Desktop wallet, but why it is not showing up in my Crypto.com DeFi Desktop Wallet?
-**A** : Some centralized exchanges currently only support Ethereum mainnet ERC20-CRO withdrawal, while Crypto.org desktop Wallet only supports Crypto.org Chain & Cronos Beta Chain for the moment, thus you're not able to view any ERC20 assets or balances of Ethereum Chain on the Desktop Wallet. It is highly recommended that all users check the networks before making the withdrawal and always begin with a small amount to make sure the transfer actually works.
+**A** : Some centralized exchanges currently only support Ethereum mainnet ERC20-CRO withdrawal, while the Crypto.com DeFi Desktop Wallet only supports Crypto.org Chain & Cronos Beta Chain for the moment, thus you're not able to view any ERC20 assets or balances of Ethereum Chain on the Desktop Wallet.
+It is highly recommended that all users check the networks before making the withdrawal and always begin with a small amount to make sure the transfer actually works.
-### Q2: I’ve already made the transfer from the centralized exchange that does not support Cronos Beta Chain to my Crypto.org Desktop wallet. What should I do to retrieve my funds?
+### Q2: I’ve already made the transfer from the centralized exchange that does not support Cronos Beta Chain to my Crypto.com DeFi Desktop Wallet. What should I do to retrieve my funds?
**A** : Here's what you could do:
@@ -142,19 +153,22 @@ Simply go to `Setting/Advance` and click `Reset Account` as shown below:
2. Download our Crypto.com App, and register an account (skip this if you're already a user)
3. Send your ERC20-CRO to the Crypto.com App ERC20-CRO deposit address\*
4. When you get your CRO, withdraw your CRO to your ledger address (MAKE SURE YOU SELECT Cronos Beta Chain) `0x..` address
-5. You would be able to see your funds on Desktop Wallet afterwards
+5. You would be able to see your funds on Crypto.com DeFi Desktop Wallet afterwards
Other than this, it is also possible that there is no Ethereum in your wallet, which could result in your funds getting stuck as you aren't able to pay for the Ethereum gas fee. Please ensure you have enough ETH for the transaction.
-_For step 3 of transferring your ERC20-CRO, you could either use Metamask or Ledger Live (for ledger user) to send ERC20-CRO from your Ledger to Crypto.com App. Take the wallet on Metamask as an example, if you log into the same wallet on Metamask and switch the network to the ethereum mainnet on Metamask, you would be able to access those ERC20 tokens in this wallet on Metamask. After that, you would be free to transfer the funds to the Crypto.com app then withdraw them to the Cronos Beta network._
+_For step 3 of transferring your ERC20-CRO, you could either use Metamask or Ledger Live (for ledger user) to send ERC20-CRO from your Ledger to Crypto.com App.
+Take the wallet on Metamask as an example, if you log into the same wallet on Metamask and switch the network to the ethereum mainnet on Metamask, you would be able to access those ERC20 tokens in this wallet on Metamask. After that, you would be free to transfer the funds to the Crypto.com app then withdraw them to the Cronos Beta network._
### Q3: I would like to send ERC20-CRO from Crypto.com App or Defi Wallet to the other CEXs directly. Is it possible?
**A** : Please make sure both sender and receiver accounts support ERC20 format. Only if the other CEXs support ERC20-CRO can you send it. Users may refer to this guide for more details:
-* https://help.crypto.com/en/articles/5019195-send-and-receive-cro-the-difference-between-native-cro-and-erc20-cro
-* https://help.crypto.com/en/articles/4970776-cro-deposit-withdrawal-information-in-crypto-com-app
+- https://help.crypto.com/en/articles/5019195-send-and-receive-cro-the-difference-between-native-cro-and-erc20-cro
+- https://help.crypto.com/en/articles/4970776-cro-deposit-withdrawal-information-in-crypto-com-app
### Q4: I made a transaction on MetaMask (through Cronos Beta network) to the other CEXs that do NOT support Cronos. How should I retrieve it back?
-**A** : In this case, only the owner of the receiving account has access to that funds. You could also check if your transaction is successful/confirmed on [Cronoscan](https://cronoscan.com/). Given the receiving account is from other CEXs, you may contact the receiving party and find out if it is possible for them to do a manual refund for your transaction. They may or may not do it depending on their own policies. Otherwise, you will most likely not be able to access the funds until that CEX starts to support Cronos.
+**A** : In this case, only the owner of the receiving account has access to that funds. You could also check if your transaction is successful/confirmed on [Cronoscan](https://cronoscan.com/).
+Given the receiving account is from other CEXs, you may contact the receiving party and find out if it is possible for them to do a manual refund for your transaction. They may or may not do it depending on their own policies.
+Otherwise, you will most likely not be able to access the funds until that CEX starts to support Cronos.