From 919c88887826c91abc35ec2198fcc35147f46274 Mon Sep 17 00:00:00 2001 From: Shamil <66209982+shamilsan@users.noreply.github.com> Date: Wed, 12 Jul 2023 11:39:37 +0300 Subject: [PATCH 1/6] Prepare for release v1.2 --- docs/api/tooling/create-gear-app.md | 4 +- docs/developing-contracts/introduction.md | 2 +- docs/developing-contracts/testing-gclient.mdx | 6 +- docs/developing-contracts/testing-gtest.md | 6 +- docs/examples/DAO.md | 20 +++---- docs/examples/concert.md | 8 +-- docs/examples/crowdsale.md | 12 ++-- docs/examples/dein.md | 6 +- docs/examples/dex.md | 14 ++--- docs/examples/dutch-auction.md | 8 +-- docs/examples/dynamic-nft.md | 16 +++--- docs/examples/escrow.md | 16 +++--- docs/examples/feeds.md | 10 ++-- docs/examples/game-of-chance.md | 12 ++-- docs/examples/gft-20.md | 2 +- docs/examples/gmt-1155.md | 4 +- docs/examples/gnft-4907.md | 14 ++--- docs/examples/gnft-721.md | 26 ++++----- docs/examples/monopoly.md | 12 ++-- docs/examples/multisig-wallet.md | 8 +-- docs/examples/nft-marketplace/marketplace.md | 56 +++++++++---------- docs/examples/nft-pixelboard.md | 2 +- docs/examples/onchain-nft.md | 18 +++--- docs/examples/oracle/dia-randomness-oracle.md | 4 +- docs/examples/oracle/gear-oracle.md | 6 +- docs/examples/ping.md | 8 +-- docs/examples/prerequisites.mdx | 12 ++-- docs/examples/rmrk.md | 34 +++++------ docs/examples/rock-paper-scissors.md | 6 +- docs/examples/staking.md | 10 ++-- docs/examples/supply-chain.md | 16 +++--- docs/examples/tequila-train.md | 6 +- docs/examples/varatube.md | 16 +++--- docs/getting-started-in-5-minutes.md | 2 +- .../current/developing-contracts/testing.md | 6 +- .../current/examples/DAO.md | 6 +- .../current/examples/concert.md | 4 +- .../current/examples/crowdsale.md | 4 +- .../current/examples/dutch-auction.md | 4 +- .../current/examples/escrow.md | 4 +- .../current/examples/feeds.md | 4 +- .../current/examples/game-of-chance.md | 12 ++-- .../current/examples/gft-20.md | 6 +- .../current/examples/gmt-1155.md | 14 ++--- .../current/examples/gnft-721.md | 12 ++-- .../current/examples/marketplace.md | 8 +-- .../current/examples/monopoly.md | 4 +- .../current/examples/multisig-wallet.md | 4 +- .../current/examples/nft-pixelboard.md | 2 +- .../current/examples/onchain-nft.md | 14 ++--- .../current/examples/ping.md | 2 +- .../current/examples/prerequisites.mdx | 4 +- .../current/examples/rmrk.md | 4 +- .../current/examples/rock-paper-scissors.md | 4 +- .../current/examples/staking.md | 10 ++-- .../current/examples/supply-chain.md | 2 +- .../current/getting-started-in-5-minutes.md | 6 +- 57 files changed, 271 insertions(+), 271 deletions(-) diff --git a/docs/api/tooling/create-gear-app.md b/docs/api/tooling/create-gear-app.md index f07399acf..f58391e37 100644 --- a/docs/api/tooling/create-gear-app.md +++ b/docs/api/tooling/create-gear-app.md @@ -9,7 +9,7 @@ Introducing Gear React Application Template: Accelerate Your Decentralized App D Are you looking to swiftly launch your decentralized application (dApp) on Gear-powered blockchains? Look no further! Gear React Application Template, also known as `create-gear-app`, is a pre-configured application template designed to streamline the development process. With its well-thought-out infrastructure and convenient features, it allows developers to quickly create and deploy their dApps on Gear-powered blockchains. -Gear React Application Template can be found on [GitHub](https://github.com/gear-dapps/react-app). This template is packed with a range of benefits and features that make it an ideal choice for developers seeking efficiency and simplicity in their dApp development workflow. +Gear React Application Template can be found on [GitHub](https://github.com/gear-foundation/dapps-react-app). This template is packed with a range of benefits and features that make it an ideal choice for developers seeking efficiency and simplicity in their dApp development workflow. ## Features @@ -32,5 +32,5 @@ Furthermore, Gear React Application Template is particularly beneficial for deve Simply clone this repo to your local folder: ```sh -git clone https://github.com/gear-dapps/react-app.git d-app +git clone https://github.com/gear-foundation/dapps-react-app.git d-app ``` diff --git a/docs/developing-contracts/introduction.md b/docs/developing-contracts/introduction.md index 1c284ad6f..3339a3232 100644 --- a/docs/developing-contracts/introduction.md +++ b/docs/developing-contracts/introduction.md @@ -75,7 +75,7 @@ Let's explore the typical lifecycle of a Gear smart contract. We will use the Ru You can find the minimal example in the [Getting Started](/docs/getting-started-in-5-minutes.md) section. It is a simple program that stores the counter, can increment and decrement it, and return the current value of the counter. -More advanced examples can be found in the Gear dApps organization on GitHub: https://github.com/gear-dapps +More advanced examples can be found in the Gear Fooundation organization on GitHub: https://github.com/gear-foundation **Step 2.** Test the program. diff --git a/docs/developing-contracts/testing-gclient.mdx b/docs/developing-contracts/testing-gclient.mdx index 207781264..bf93f08f7 100644 --- a/docs/developing-contracts/testing-gclient.mdx +++ b/docs/developing-contracts/testing-gclient.mdx @@ -26,13 +26,13 @@ authors = ["Your Name"] edition = "2021" [dependencies] -gstd = { git = "https://github.com/gear-tech/gear.git", features = ["debug"], branch = "stable" } +gstd = { git = "https://github.com/gear-tech/gear.git", features = ["debug"], rev = "946ac47" } [build-dependencies] -gear-wasm-builder = { git = "https://github.com/gear-tech/gear.git", branch = "stable" } +gear-wasm-builder = { git = "https://github.com/gear-tech/gear.git", rev = "946ac47" } [dev-dependencies] -gclient = { git = "https://github.com/gear-tech/gear.git", branch = "stable" } +gclient = { git = "https://github.com/gear-tech/gear.git", rev = "946ac47" } tokio = { version = "1.23.0", features = ["full"] } [patch.crates-io] diff --git a/docs/developing-contracts/testing-gtest.md b/docs/developing-contracts/testing-gtest.md index c483c888a..6fdff2674 100644 --- a/docs/developing-contracts/testing-gtest.md +++ b/docs/developing-contracts/testing-gtest.md @@ -20,13 +20,13 @@ authors = ["Your Name"] edition = "2021" [dependencies] -gstd = { git = "https://github.com/gear-tech/gear.git", branch = "stable" } +gstd = { git = "https://github.com/gear-tech/gear.git", rev = "946ac47" } [build-dependencies] -gear-wasm-builder = { git = "https://github.com/gear-tech/gear.git", branch = "stable" } +gear-wasm-builder = { git = "https://github.com/gear-tech/gear.git", rev = "946ac47" } [dev-dependencies] -gtest = { git = "https://github.com/gear-tech/gear.git", branch = "stable" } +gtest = { git = "https://github.com/gear-tech/gear.git", rev = "946ac47" } ``` ## `gtest` capabilities diff --git a/docs/examples/DAO.md b/docs/examples/DAO.md index 6ac682163..a2f9efa23 100644 --- a/docs/examples/DAO.md +++ b/docs/examples/DAO.md @@ -17,11 +17,11 @@ DAOs offer safe alternatives to pooling together money for a particular cause. B ### DAO application example by Gear -Anyone can easily create their own DAO application and run it on the Gear Network. To do this, Gear created an example of the DAO smart contract, which is available on [GitHub](https://github.com/gear-dapps/dao-light). +Anyone can easily create their own DAO application and run it on the Gear Network. To do this, Gear created an example of the DAO smart contract, which is available on [GitHub](https://github.com/gear-foundation/dapps-dao-light). This article explains the programming interface, data structure, basic functions and explains their purpose. It can be used as is or modified to suit your own scenarios. - ## Logic @@ -80,7 +80,7 @@ where: `transactions` - the transaction history. -Parameters `approved_token_program_id`, `period_duration`, `grace_period_length` are set when initializing a contract. The contract is initialized +Parameters `approved_token_program_id`, `period_duration`, `grace_period_length` are set when initializing a contract. The contract is initialized with the following struct: ```rust @@ -232,7 +232,7 @@ The `DAO` contract interacts with the `fungible` token contract. Each transactio For more details about testing smart contracts written on Gear, refer to the [Program Testing](/docs/developing-contracts/testing) article. diff --git a/docs/examples/concert.md b/docs/examples/concert.md index 122b9b169..6d5848061 100644 --- a/docs/examples/concert.md +++ b/docs/examples/concert.md @@ -9,7 +9,7 @@ sidebar_position: 14 This smart contract example created by Gear represents a Concert tickets distribution with the idea of converting fungible tokens (gFT) to non-fungible tokens (gNFT) in time. -The article explains the programming interface, data structure, basic functions and explains their purpose. It can be used as is or modified to suit your own scenarios. Anyone can easily create their own application and run it on the Gear Network. The source code is available on [GitHub](https://github.com/gear-dapps/concert). +The article explains the programming interface, data structure, basic functions and explains their purpose. It can be used as is or modified to suit your own scenarios. Anyone can easily create their own application and run it on the Gear Network. The source code is available on [GitHub](https://github.com/gear-foundation/dapps-concert). In this example, a single deployed contract can hold one concert at a time. Firstly, all the tickets for the concert come as fungible-tokens. In order to buy tickets one should provide the metadata (e.g. seat/row number) that will later be included in NFTs. When the concert ends, all the fungible tokens of all users (ticket holders) will turn into NFTs. @@ -122,7 +122,7 @@ extern "C" fn state() { .expect("Failed to encode or reply with `::State` from `state()`"); } ``` -To display only necessary certain values from the state, you need to write a separate crate. In this crate, specify functions that will return the desired values from the `State` struct. For example - [gear-dapps/concert/state](https://github.com/gear-dapps/concert/tree/master/state): +To display only necessary certain values from the state, you need to write a separate crate. In this crate, specify functions that will return the desired values from the `State` struct. For example - [gear-foundation/dapps-concert/state](https://github.com/gear-foundation/dapps-concert/tree/master/state): ```rust #[metawasm] @@ -144,8 +144,8 @@ pub trait Metawasm { ``` ## Conclusion -A source code of the contract example provided by Gear is available on GitHub: [`concert/src`](https://github.com/gear-dapps/concert/tree/master/src). +A source code of the contract example provided by Gear is available on GitHub: [`concert/src`](https://github.com/gear-foundation/dapps-concert/tree/master/src). -See also an example of the smart contract testing implementation based on [gtest](https://github.com/gear-dapps/concert/tree/master/tests). +See also an example of the smart contract testing implementation based on [gtest](https://github.com/gear-foundation/dapps-concert/tree/master/tests). For more details about testing smart contracts written on Gear, refer to this article: [Program Testing](/docs/developing-contracts/testing). diff --git a/docs/examples/crowdsale.md b/docs/examples/crowdsale.md index cb8001e81..029c61244 100644 --- a/docs/examples/crowdsale.md +++ b/docs/examples/crowdsale.md @@ -11,7 +11,7 @@ A public offering to invest in a brand-new cryptocurrency or other digital asset An example of a crowdsale smart-contract implementation described in this article is one of many other decentralized applications that can be implemented and launched on Gear. This article explains the programming interface, data structure, basic functions and explains their purpose. It can be used as is or modified to suit your own scenarios. Anyone can easily create their own crowdsale application and run it on the Gear Network. -Initial funds with which a token is purchased are determined by the Gear fungible tokens contract - [gFT](https://wiki.gear-tech.io/examples/gft-20). The contract's source code is available on [GitHub](https://github.com/gear-dapps/crowdsale). +Initial funds with which a token is purchased are determined by the Gear fungible tokens contract - [gFT](https://wiki.gear-tech.io/examples/gft-20). The contract's source code is available on [GitHub](https://github.com/gear-foundation/dapps-crowdsale). ## Interface ### Source files @@ -23,7 +23,7 @@ pub async fn transfer_tokens( from: &ActorId, // - the sender address to: &ActorId, // - the recipient address amount: u128, // - the amount of tokens -) +) ``` This function sends a message (the action is defined in the enum IcoAction) and gets a reply (the reply is defined in the enum IcoEvent): ```rust @@ -45,7 +45,7 @@ let _transfer_response = msg::send_for_reply_as::
@@ -127,7 +127,7 @@ extern "C" fn state() { .expect("Failed to encode or reply with `::State` from `state()`"); } ``` -To display only necessary certain values from the state, you need to write a separate crate. In this crate, specify functions that will return the desired values from the `State` struct. For example - [gear-dapps/dex/factory/state](https://github.com/gear-dapps/dex/tree/master/factory/state): +To display only necessary certain values from the state, you need to write a separate crate. In this crate, specify functions that will return the desired values from the `State` struct. For example - [gear-foundation/dapps-dex/factory/state](https://github.com/gear-foundation/dapps-dex/tree/master/factory/state): ```rust #[metawasm] @@ -185,9 +185,9 @@ async fn create_pair(&mut self, mut token_a: ActorId, mut token_b: ActorId); ``` ### Source code -The source code of this example of DEX factory smart contract and the example of an implementation of its testing is available on [gear-dapps/dex/tree/master/factory](https://github.com/gear-dapps/dex/tree/master/factory). +The source code of this example of DEX factory smart contract and the example of an implementation of its testing is available on [gear-foundation/dapps-dex/tree/master/factory](https://github.com/gear-foundation/dapps-dex/tree/master/factory). -See also an example of the smart contract testing implementation based on `gtest`: [gear-dapps/dex/tree/master/factory/tests](https://github.com/gear-dapps/dex/tree/master/factory/tests). +See also an example of the smart contract testing implementation based on `gtest`: [gear-foundation/dapps-dex/tree/master/factory/tests](https://github.com/gear-foundation/dapps-dex/tree/master/factory/tests). For more details about testing smart contracts written on Gear, refer to the [Program Testing](/docs/developing-contracts/testing) article. @@ -378,7 +378,7 @@ extern "C" fn state() { .expect("Failed to encode or reply with `::State` from `state()`"); } ``` -To display only necessary certain values from the state, you need to write a separate crate. In this crate, specify functions that will return the desired values from the `State` struct. For example - [gear-dapps/dex/pair/state](https://github.com/gear-dapps/supply-chain/tree/master/pair/state): +To display only necessary certain values from the state, you need to write a separate crate. In this crate, specify functions that will return the desired values from the `State` struct. For example - [gear-foundation/dapps-dex/pair/state](https://github.com/gear-foundation/dapps-supply-chain/tree/master/pair/state): ```rust #[metawasm] @@ -557,8 +557,8 @@ pub async fn swap_tokens_for_exact(&mut self, amount_out: u128, to: ActorId); ``` ### Source code -The source code of this example of DEX pair smart contract and the example of an implementation of its testing is available on [gear-dapps/dex/tree/master/pair](https://github.com/gear-dapps/dex/tree/master/pair). +The source code of this example of DEX pair smart contract and the example of an implementation of its testing is available on [gear-foundation/dapps-dex/tree/master/pair](https://github.com/gear-foundation/dapps-dex/tree/master/pair). -See also an example of the smart contract testing implementation based on `gtest`: [gear-dapps/dex/tree/master/pair/tests](https://github.com/gear-dapps/dex/tree/master/pair/tests). +See also an example of the smart contract testing implementation based on `gtest`: [gear-foundation/dapps-dex/tree/master/pair/tests](https://github.com/gear-foundation/dapps-dex/tree/master/pair/tests). For more details about testing smart contracts written on Gear, refer to the [Program Testing](/docs/developing-contracts/testing) article. diff --git a/docs/examples/dutch-auction.md b/docs/examples/dutch-auction.md index 12f58c23b..96d48619a 100644 --- a/docs/examples/dutch-auction.md +++ b/docs/examples/dutch-auction.md @@ -10,7 +10,7 @@ A Dutch auction is one of several types of auctions for buying or selling goods. The auction uses [Gear non-fungible tokens (gNFT)](gnft-721.md) as tradable goods. -The article explains the programming interface, data structure, basic functions and explains their purpose. It can be used as is or modified to suit your own scenarios. Anyone can easily create their own application and run it on the Gear Network. The source code is available on [GitHub](https://github.com/gear-dapps/dutch-auction). +The article explains the programming interface, data structure, basic functions and explains their purpose. It can be used as is or modified to suit your own scenarios. Anyone can easily create their own application and run it on the Gear Network. The source code is available on [GitHub](https://github.com/gear-foundation/dapps-dutch-auction). ## Contract description @@ -115,7 +115,7 @@ extern "C" fn state() { ); } ``` -To display only necessary certain values from the state, you need to write a separate crate. In this crate, specify functions that will return the desired values from the `AuctionInfo` state. For example - [gear-dapps/dutch-auction/state](https://github.com/gear-dapps/dutch-auction/tree/master/state): +To display only necessary certain values from the state, you need to write a separate crate. In this crate, specify functions that will return the desired values from the `AuctionInfo` state. For example - [gear-foundation/dapps-dutch-auction/state](https://github.com/gear-foundation/dapps-dutch-auction/tree/master/state): ```rust #[metawasm] @@ -134,8 +134,8 @@ pub mod metafns { ## Source code -The source code of this example of Dutch Auction smart contract and the example of an implementation of its testing is available on [gear-dapps/dutch-auction](https://github.com/gear-dapps/dutch-auction). +The source code of this example of Dutch Auction smart contract and the example of an implementation of its testing is available on [gear-foundation/dapps-dutch-auction](https://github.com/gear-foundation/dapps-dutch-auction). -See also an example of the smart contract testing implementation based on `gtest`: [gear-dapps/dutch-auction/tree/master/tests](https://github.com/gear-dapps/dutch-auction/tree/master/tests). +See also an example of the smart contract testing implementation based on `gtest`: [gear-foundation/dapps-dutch-auction/tree/master/tests](https://github.com/gear-foundation/dapps-dutch-auction/tree/master/tests). For more details about testing smart contracts written on Gear, refer to the [Program Testing](/docs/developing-contracts/testing) article. diff --git a/docs/examples/dynamic-nft.md b/docs/examples/dynamic-nft.md index 48f782ac9..766b15266 100644 --- a/docs/examples/dynamic-nft.md +++ b/docs/examples/dynamic-nft.md @@ -6,7 +6,7 @@ sidebar_position: 5 # Gear Dynamic Non-Fungible Token ### Introduction -This is an extension of standard [Non-Fungible token](./gnft-721). It proposes an additional dynamic part that can change or evolve over time. The source code of the Gear NFT smart contract example is available on [GitHub](https://github.com/gear-dapps/dynamic-nft). +This is an extension of standard [Non-Fungible token](./gnft-721). It proposes an additional dynamic part that can change or evolve over time. The source code of the Gear NFT smart contract example is available on [GitHub](https://github.com/gear-foundation/dapps-dynamic-nft). ### Motivation @@ -16,13 +16,13 @@ This example demonstrates Gear Protocol's unique features enabling the new user ### Details -The default implementation of the NFT contract is provided in the gear library: [gear-lib/non_fungible_token](https://github.com/gear-dapps/gear-lib/tree/master/lib/src/non_fungible_token). +The default implementation of the NFT contract is provided in the gear library: [gear-lib/non_fungible_token](https://github.com/gear-foundation/dapps-gear-lib/tree/master/lib/src/non_fungible_token). To use the default implementation you should include the packages into your *Cargo.toml* file: ```toml -gear-lib = { git = "https://github.com/gear-dapps/gear-lib.git" } -gear-lib-derive = { git = "https://github.com/gear-dapps/gear-lib.git" } +gear-lib = { git = "https://github.com/gear-foundation/dapps-gear-lib.git" } +gear-lib-derive = { git = "https://github.com/gear-foundation/dapps-gear-lib.git" } hashbrown = "0.13" ``` @@ -66,7 +66,7 @@ pub enum NFTEvent { ## Examples -For an example, look at this [Auto-changed NFT](https://github.com/gear-dapps/auto-changed-nft) contract. This is a modified dynamic contract in which own dynamic data changes over time periods. We slightly changed the logic of the dynamic nft contract to suit our needs. +For an example, look at this [Auto-changed NFT](https://github.com/gear-foundation/dapps-auto-changed-nft) contract. This is a modified dynamic contract in which own dynamic data changes over time periods. We slightly changed the logic of the dynamic NFT contract to suit our needs. First, let's change the name of the contract and add a new field `rest_update_periods` in which we store the rest update periods (in our example, we need 2 updates): @@ -189,10 +189,10 @@ Similarly, you can implement other logic, for example, periodically request data ## Conclusion -Gear provides a reusable [library](https://github.com/gear-dapps/gear-lib/tree/master/lib/src/non_fungible_token) with core functionality for the gNFT-4907 protocol. By using object composition, the library can be utilized within a custom NFT contract implementation in order to minimize duplication of community available code. +Gear provides a reusable [library](https://github.com/gear-foundation/dapps-gear-lib/tree/master/lib/src/non_fungible_token) with core functionality for the gNFT-4907 protocol. By using object composition, the library can be utilized within a custom NFT contract implementation in order to minimize duplication of community available code. -A source code of the Gear NFT smart contract example based on `gear-lib` is available on GitHub: [gear-dapps/non-fungible-token](https://github.com/gear-dapps/dynamic-nft). +A source code of the Gear NFT smart contract example based on `gear-lib` is available on GitHub: [gear-foundation/dapps-non-fungible-token](https://github.com/gear-foundation/dapps-dynamic-nft). -See also an example of the smart contract testing implementation based on `gtest`: [gear-dapps/non-fungible-token/tests](https://github.com/gear-dapps/dynamic-nft/tree/master/tests). +See also an example of the smart contract testing implementation based on `gtest`: [gear-foundation/dapps-non-fungible-token/tests](https://github.com/gear-foundation/dapps-dynamic-nft/tree/master/tests). For more details about testing smart contracts written on Gear, refer to this article: [Program Testing](/docs/developing-contracts/testing). diff --git a/docs/examples/escrow.md b/docs/examples/escrow.md index 2925e809e..4089e3f25 100644 --- a/docs/examples/escrow.md +++ b/docs/examples/escrow.md @@ -8,17 +8,17 @@ sidebar_position: 9 An escrow is a special wallet to which some assets (e.g. money or stocks) are deposited and stored until certain conditions are met. In terms of smart contracts, an escrow is a wallet that is stored on a blockchain and, like a regular escrow, can receive some assets (e.g. a cryptocurrency or fungible tokens (like [Gear fungible tokens - gFT](gft-20.md) in this example)) from one user and, when certain conditions are met, send them to another. -- Program source code is avalible on [Github](https://github.com/gear-dapps/escrow) -- dApp UI [Github](https://github.com/gear-dapps/escrow/tree/master/frontend) +- Program source code is avalible on [Github](https://github.com/gear-foundation/dapps-escrow) +- dApp UI [Github](https://github.com/gear-foundation/dapps-escrow/tree/master/frontend) -## How to run +## How to run This video demonstrates how to configure and run Escrow application on your own and explains the user interaction workflow: **https://youtu.be/CD8j4epEY4E** ### ⚒️ Build program -- Get the source code of the [Escrow smart contract](https://github.com/gear-dapps/escrow) -- Build contract as described in [program/README.md](https://github.com/gear-dapps/escrow/blob/master/README.md). +- Get the source code of the [Escrow smart contract](https://github.com/gear-foundation/dapps-escrow) +- Build contract as described in [program/README.md](https://github.com/gear-foundation/dapps-escrow/blob/master/README.md). ### 🏗️ Upload Сode @@ -30,7 +30,7 @@ This application requires code to create an escrow wallet ### 🖥️ Run UI -1. Install packages as described in [frontend/README.md](https://github.com/gear-dapps/escrow/blob/master/frontend/README.md) +1. Install packages as described in [frontend/README.md](https://github.com/gear-foundation/dapps-escrow/blob/master/frontend/README.md) 2. Configure .evn file. Specify network address and code ID like in the example below: ```sh @@ -46,7 +46,7 @@ yarn start ## Introduction -This article explains at a superficial level the purpose and logic of this smart contract. The source code of the smart contract example is available on [GitHub](https://github.com/gear-dapps/escrow). +This article explains at a superficial level the purpose and logic of this smart contract. The source code of the smart contract example is available on [GitHub](https://github.com/gear-foundation/dapps-escrow). ## Logic @@ -221,7 +221,7 @@ extern "C" fn state() { .expect("Failed to share state"); } ``` -To display only necessary certain values from the state, you need to write a separate crate. In this crate, specify functions that will return the desired values from the `Escrow` state. For example - [gear-dapps/escrow/state](https://github.com/gear-dapps/escrow/tree/master/state): +To display only necessary certain values from the state, you need to write a separate crate. In this crate, specify functions that will return the desired values from the `Escrow` state. For example - [gear-foundation/dapps-escrow/state](https://github.com/gear-foundation/dapps-escrow/tree/master/state): ```rust #[metawasm] diff --git a/docs/examples/feeds.md b/docs/examples/feeds.md index 7ec220083..a15d787b2 100644 --- a/docs/examples/feeds.md +++ b/docs/examples/feeds.md @@ -6,7 +6,7 @@ sidebar_position: 7 # Introduction In order to introduce our rapidly growing community to the platform developed by Gear, we've developed a dApplication in order to showcase some of the features that can be implemented using our smart contracts. Specifically, this contract aims to build a platform simillar to Twitter: each user can have their own "feed", "feeds" can be subscribed to and the landing page contains global & personal "feeds". -This article explains the programming interface, data structure, basic functions and explains their purpose. It can be used as is or modified to suit your own scenarios. Anyone can easily create their own application and run it on the Gear Network. The source code is available on [GitHub](https://github.com/gear-dapps/feeds). +This article explains the programming interface, data structure, basic functions and explains their purpose. It can be used as is or modified to suit your own scenarios. Anyone can easily create their own application and run it on the Gear Network. The source code is available on [GitHub](https://github.com/gear-foundation/dapps-feeds). # Feeds dApp composition The application strcture consists of two smart contracts: the router contract and the channel contract. There's one router contract per application and one channel contract per user. @@ -24,7 +24,7 @@ Let's now go through the flow of the application step by step. First, channel owner should compile their own version of the contract filled in with information about the channel. Then, when the contract is uploaded to the network via the [Gear Idea portal](https://idea.gear-tech.io), owner of the contract should send a `Register` message to the router contract. Once router contract receives that message, it sends a `Meta` request to the recently deployed contract to verify that it has been set up correctly. If the channel contract responds properly, it is added to the list of available channels. -If you want to check out the code available for both the router and the channel contracts, you can find them here: [router](https://github.com/gear-dapps/feeds/tree/master/router), [channel](https://github.com/gear-dapps/gear-feeds-channel). +If you want to check out the code available for both the router and the channel contracts, you can find them here: [router](https://github.com/gear-foundation/dapps-feeds/tree/master/router), [channel](https://github.com/gear-foundation/dapps-gear-feeds-channel). # The Gear Feeds website @@ -73,7 +73,7 @@ extern "C" fn state() { .expect("Failed to encode or reply with `::State` from `state()`"); } ``` -To display only necessary certain values from the state, you need to write a separate crate. In this crate, specify functions that will return the desired values from the `Channel` state. For example - [gear-dapps/feeds/channel-state](https://github.com/gear-dapps/feeds/tree/master/channel-state): +To display only necessary certain values from the state, you need to write a separate crate. In this crate, specify functions that will return the desired values from the `Channel` state. For example - [gear-foundation/dapps-feeds/channel-state](https://github.com/gear-foundation/dapps-feeds/tree/master/channel-state): ```rust #[metawasm] @@ -117,7 +117,7 @@ extern "C" fn state() { .expect("Failed to encode or reply with `::State` from `state()`"); } ``` -To display only necessary certain values from the state, you need to write a separate crate. In this crate, specify functions that will return the desired values from the `RouterState` state. For example - [gear-dapps/feeds/router-state](https://github.com/gear-dapps/feeds/tree/master/router-state): +To display only necessary certain values from the state, you need to write a separate crate. In this crate, specify functions that will return the desired values from the `RouterState` state. For example - [gear-foundation/dapps-feeds/router-state](https://github.com/gear-foundation/dapps-feeds/tree/master/router-state): ```rust #[metawasm] @@ -141,6 +141,6 @@ pub trait Metawasm { # Conclusion Gear Feeds is an example of a full-fledged application with core logic being in a decentralized application implemented via Smart Contracts on Gear. We hope to see more exciting projects inspired by Gear feeds and recent platform improvements created by our community members! :) -The source code for both Channel and Router is available on [GitHub](https://github.com/gear-dapps/feeds). +The source code for both Channel and Router is available on [GitHub](https://github.com/gear-foundation/dapps-feeds). For more details about testing smart contracts written on Gear, refer to this article: [Program Testing](/docs/developing-contracts/testing). diff --git a/docs/examples/game-of-chance.md b/docs/examples/game-of-chance.md index 19edcdbb9..ba20c0a66 100644 --- a/docs/examples/game-of-chance.md +++ b/docs/examples/game-of-chance.md @@ -8,15 +8,15 @@ sidebar_position: 9 Game of chance is a simple game smart contract with the lottery logic. -- Program source code available on [Github](https://github.com/gear-dapps/game-of-chance) -- dApp UI [Github](https://github.com/gear-dapps/game-of-chance/tree/master/frontend) +- Program source code available on [Github](https://github.com/gear-foundation/dapps-game-of-chance) +- dApp UI [Github](https://github.com/gear-foundation/dapps-game-of-chance/tree/master/frontend) ## How to run ### ⚒️ Build program -- Get the source code of [GOC contract](https://github.com/gear-dapps/game-of-chance) -- Build contracts as described in [program/README.md](https://github.com/gear-dapps/game-of-chance/blob/master/README.md). +- Get the source code of [GOC contract](https://github.com/gear-foundation/dapps-game-of-chance) +- Build contracts as described in [program/README.md](https://github.com/gear-foundation/dapps-game-of-chance/blob/master/README.md). ### 🏗️ Upload program @@ -28,7 +28,7 @@ Game of chance is a simple game smart contract with the lottery logic. ### 🖥️ Run UI -1. Install packages as described in [frontend/README.md](https://github.com/gear-dapps/game-of-chance/blob/master/frontend/README.md) +1. Install packages as described in [frontend/README.md](https://github.com/gear-foundation/dapps-game-of-chance/blob/master/frontend/README.md) 2. Configure `.env` file. Specify network address and program ID like in the example below: ```sh @@ -168,6 +168,6 @@ To display only necessary certain values from the state, you need to write a sep ## Source code -The source code of the Game of chance smart contract and an implementation of its testing is available on [GitHub](https://github.com/gear-dapps/game-of-chance). They can be used as is or modified to suit your own scenarios. +The source code of the Game of chance smart contract and an implementation of its testing is available on [GitHub](https://github.com/gear-foundation/dapps-game-of-chance). They can be used as is or modified to suit your own scenarios. For more details about testing smart contracts written on Gear, refer to the [Program Testing](/docs/developing-contracts/testing) article. diff --git a/docs/examples/gft-20.md b/docs/examples/gft-20.md index 41d236bff..9914870b9 100644 --- a/docs/examples/gft-20.md +++ b/docs/examples/gft-20.md @@ -21,7 +21,7 @@ These smart contracts can then be used to create tokenized assets that represent These tokenized assets are known as fungible tokens as all instances of a given ERC-20 token are the same and they can be used interchangeably. A token that is unique and can not be interchangeable is known as a Non Fungible Token. -Gear provides native implementation of fungible token (gFT) described in this article. It explains the programming interface, data structure, basic functions and explains their purpose. It can be used as is or modified to suit your own scenarios. Anyone can easily create their own application and run it on the Gear Network. The source code is available on [GitHub](https://github.com/gear-dapps/sharded-fungible-token). +Gear provides native implementation of fungible token (gFT) described in this article. It explains the programming interface, data structure, basic functions and explains their purpose. It can be used as is or modified to suit your own scenarios. Anyone can easily create their own application and run it on the Gear Network. The source code is available on [GitHub](https://github.com/gear-foundation/dapps-sharded-fungible-token). The implementation of fungible token includes the following contracts: - The `master` fungible token that serves as a proxy program that redirects the message to the logic contract; diff --git a/docs/examples/gmt-1155.md b/docs/examples/gmt-1155.md index 86b5e43e1..65e677453 100644 --- a/docs/examples/gmt-1155.md +++ b/docs/examples/gmt-1155.md @@ -11,7 +11,7 @@ A standard interface for contracts that manage multiple token types. A single de The idea is simple and seeks to create a smart contract interface that can represent and control any number of fungible and non-fungible token types. In this way, the gMT token can do the same functions as gFT and gNFT token, and even both at the same time. Can be considered as analog of [ERC-1155](https://eips.ethereum.org/EIPS/eip-1155). -This article explains the programming interface, data structure, basic functions and explains their purpose. It can be used as is or modified to suit your own scenarios. Anyone can easily create their own application and run it on the Gear Network. The source code is available on [GitHub](https://github.com/gear-dapps/sharded-multitoken). +This article explains the programming interface, data structure, basic functions and explains their purpose. It can be used as is or modified to suit your own scenarios. Anyone can easily create their own application and run it on the Gear Network. The source code is available on [GitHub](https://github.com/gear-foundation/dapps-sharded-multitoken). ## Architecture @@ -478,6 +478,6 @@ pub struct InitMToken { Gear provides a reusable library with core functionality for the gMT protocol. By using object composition, that library can be utilized within a custom gMT/MTK contract implementation in order to minimize duplication of community available code. -See also an example of the smart contract testing implementation based on `gtest` and `gclient`: [`sharded-multitoken/mt-main/tests`](https://github.com/gear-dapps/sharded-multitoken/tree/master/mt-main/tests). +See also an example of the smart contract testing implementation based on `gtest` and `gclient`: [`sharded-multitoken/mt-main/tests`](https://github.com/gear-foundation/dapps-sharded-multitoken/tree/master/mt-main/tests). For more details about testing smart contracts written on Gear, refer to this article: [Program Testing](/docs/developing-contracts/testing). diff --git a/docs/examples/gnft-4907.md b/docs/examples/gnft-4907.md index 8a0fdb952..88f079ca3 100644 --- a/docs/examples/gnft-4907.md +++ b/docs/examples/gnft-4907.md @@ -6,7 +6,7 @@ sidebar_position: 5 # Gear Rentable Non-Fungible Token ### Introduction -This is an extension of standard [Non-Fungible token](./gnft-721). It proposes an additional role (user) which can be granted to addresses, and a time where the role is automatically revoked (expires). The user role represents permission to "use" the NFT, but not the ability to transfer it or set users. The source code of the Gear NFT smart contract example is available on [GitHub](https://github.com/gear-dapps/rentable_nft). +This is an extension of standard [Non-Fungible token](./gnft-721). It proposes an additional role (user) which can be granted to addresses, and a time where the role is automatically revoked (expires). The user role represents permission to "use" the NFT, but not the ability to transfer it or set users. The source code of the Gear NFT smart contract example is available on [GitHub](https://github.com/gear-foundation/dapps-rentable_nft). ### Motivation @@ -18,13 +18,13 @@ Furthermore, applications of this model (such as renting) often demand that user ### Details -The default implementation of the NFT contract is provided in the gear library: [gear-lib/non_fungible_token](https://github.com/gear-dapps/gear-lib/tree/master/lib/src/non_fungible_token). +The default implementation of the NFT contract is provided in the gear library: [gear-lib/non_fungible_token](https://github.com/gear-foundation/dapps-gear-lib/tree/master/lib/src/non_fungible_token). To use the default implementation you should include the packages into your *Cargo.toml* file: ```toml -gear-lib = { git = "https://github.com/gear-dapps/gear-lib.git" } -gear-lib-derive = { git = "https://github.com/gear-dapps/gear-lib.git" } +gear-lib = { git = "https://github.com/gear-foundation/dapps-gear-lib.git" } +gear-lib-derive = { git = "https://github.com/gear-foundation/dapps-gear-lib.git" } hashbrown = "0.13.1" ``` @@ -84,10 +84,10 @@ pub enum NFTEvent { ## Conclusion -Gear provides a reusable [library](https://github.com/gear-dapps/gear-lib/tree/master/lib/src/non_fungible_token) with core functionality for the gNFT-4907 protocol. By using object composition, the library can be utilized within a custom NFT contract implementation in order to minimize duplication of community available code. +Gear provides a reusable [library](https://github.com/gear-foundation/dapps-gear-lib/tree/master/lib/src/non_fungible_token) with core functionality for the gNFT-4907 protocol. By using object composition, the library can be utilized within a custom NFT contract implementation in order to minimize duplication of community available code. -A source code of the Gear NFT smart contract example based on `gear-lib` is available on GitHub: [gear-dapps/non-fungible-token](https://github.com/gear-dapps/rentable_nft). +A source code of the Gear NFT smart contract example based on `gear-lib` is available on GitHub: [gear-foundation/dapps-non-fungible-token](https://github.com/gear-foundation/dapps-rentable_nft). -See also an example of the smart contract testing implementation based on `gtest`: [gear-dapps/non-fungible-token/tests](https://github.com/gear-dapps/rentable_nft/tree/master/tests). +See also an example of the smart contract testing implementation based on `gtest`: [gear-foundation/dapps-non-fungible-token/tests](https://github.com/gear-foundation/dapps-rentable_nft/tree/master/tests). For more details about testing smart contracts written on Gear, refer to this article: [Program Testing](/docs/developing-contracts/testing). diff --git a/docs/examples/gnft-721.md b/docs/examples/gnft-721.md index 994e4773a..16c7c6800 100644 --- a/docs/examples/gnft-721.md +++ b/docs/examples/gnft-721.md @@ -17,13 +17,13 @@ This article explains the programming interface, data structure, basic functions ## How to run -- Program source code available on [Github](https://github.com/gear-dapps/non-fungible-token) -- dApp UI [Github](https://github.com/gear-dapps/non-fungible-token/tree/master/frontend) +- Program source code available on [Github](https://github.com/gear-foundation/dapps-non-fungible-token) +- dApp UI [Github](https://github.com/gear-foundation/dapps-non-fungible-token/tree/master/frontend) ### ⚒️ Build program -- Get the source code of [NFT contract](https://github.com/gear-dapps/non-fungible-token) -- Build contracts as described in [program/README.md](https://github.com/gear-dapps/non-fungible-token/blob/master/frontend/README.md). +- Get the source code of [NFT contract](https://github.com/gear-foundation/dapps-non-fungible-token) +- Build contracts as described in [program/README.md](https://github.com/gear-foundation/dapps-non-fungible-token/blob/master/frontend/README.md). ### 🏗️ Upload program @@ -42,7 +42,7 @@ royalties `Option` - Optional param to specify accounts to pay royalt ### 🖥️ Run UI -1. Install packages as described in [frontend/README.md](https://github.com/gear-dapps/non-fungible-token/blob/master/frontend/README.md) +1. Install packages as described in [frontend/README.md](https://github.com/gear-foundation/dapps-non-fungible-token/blob/master/frontend/README.md) 2. Configure .evn file. Specify network address and program ID like in the example below: ```sh @@ -66,13 +66,13 @@ The functions that must be supported by each non-fungible-token contract: - *mint(to, token_id, metadata)* is a function that creates a new token. Metadata can include any information about the token: it can be a link to a specific resource, a description of the token, etc; - *burn(from, token_id)* is a function that removes the token with the mentioned *token_id* from the contract. -The default implementation of the NFT contract is provided in the gear library: [gear-lib/non_fungible_token](https://github.com/gear-dapps/gear-lib/tree/master/lib/src/non_fungible_token). +The default implementation of the NFT contract is provided in the gear library: [gear-lib/non_fungible_token](https://github.com/gear-foundation/dapps-gear-lib/tree/master/lib/src/non_fungible_token). To use the default implementation you should include the packages into your *Cargo.toml* file: ```toml -gear-lib = { git = "https://github.com/gear-dapps/gear-lib.git" } -gear-lib-derive = { git = "https://github.com/gear-dapps/gear-lib.git" } +gear-lib = { git = "https://github.com/gear-foundation/dapps-gear-lib.git" } +gear-lib-derive = { git = "https://github.com/gear-foundation/dapps-gear-lib.git" } hashbrown = "0.13.1" ``` @@ -109,7 +109,7 @@ pub struct NFT { pub transactions: HashMap, } ``` -The `transactions` field is used for contract `idempotency`. +The `transactions` field is used for contract `idempotency`. There are two possible risks when sending a transaction: the risk of sending duplicate transactions and the risk of not knowing the status of the transaction due to a network failure. The message sender indicates the transaction id, and the token contract obtains the hash of this transaction using the sender's address and the transaction number. If a transaction with such a hash has already been completed, the contract returns the status of this transaction. To inherit the default logic functions you need to derive `NFTCore` trait. Accordingly, for reading the state of the contracts you need the `NFTMetaState` trait. @@ -307,7 +307,7 @@ unsafe extern "C" fn handle() { .expect("Error during replying with `NFTEvent::Transfer`"); } ... - + }; } ``` @@ -336,7 +336,7 @@ extern "C" fn state() { .expect("Failed to encode or reply with `::State` from `state()`"); } ``` -To display only necessary certain values from the state, you need to write a separate crate. In this crate, specify functions that will return the desired values from the `IoNFT` state. For example - [gear-dapps/non-fungible-token/state](https://github.com/gear-dapps/non-fungible-token/tree/master/state): +To display only necessary certain values from the state, you need to write a separate crate. In this crate, specify functions that will return the desired values from the `IoNFT` state. For example - [gear-foundation/dapps-non-fungible-token/state](https://github.com/gear-foundation/dapps-non-fungible-token/tree/master/state): ```rust #[metawasm] @@ -368,11 +368,11 @@ pub trait Metawasm { fn approved_tokens(account: ActorId, state: Self::State) -> Vec { ... - } + } } ``` ## Conclusion -Gear provides a reusable [library](https://github.com/gear-dapps/gear-lib/tree/master/lib/src/non_fungible_token) with core functionality for the gNFT protocol. By using object composition, that library can be utilized within a custom NFT contract implementation in order to minimize duplication of community available code. +Gear provides a reusable [library](https://github.com/gear-foundation/dapps-gear-lib/tree/master/lib/src/non_fungible_token) with core functionality for the gNFT protocol. By using object composition, that library can be utilized within a custom NFT contract implementation in order to minimize duplication of community available code. For more details about testing smart contracts written on Gear, refer to this article: [Program Testing](/docs/developing-contracts/testing). diff --git a/docs/examples/monopoly.md b/docs/examples/monopoly.md index 0ca39faac..e32babf61 100644 --- a/docs/examples/monopoly.md +++ b/docs/examples/monopoly.md @@ -23,9 +23,9 @@ To launch the game, you need to: ## ⚒️ Build Master and Player contracts -- Get the source code of [Master contract](https://github.com/gear-dapps/syndote/tree/master/syndote) and [Player contract](https://github.com/gear-dapps/syndote/tree/master/player). +- Get the source code of [Master contract](https://github.com/gear-foundation/dapps-syndote/tree/master/syndote) and [Player contract](https://github.com/gear-foundation/dapps-syndote/tree/master/player). - Modify Player's contract as you wish to achieve optimal game strategy. -- Build contracts as described in [program/README.md](https://github.com/gear-dapps/syndote). +- Build contracts as described in [program/README.md](https://github.com/gear-foundation/dapps-syndote). ## 🏗️ Upload contracts on chain @@ -49,7 +49,7 @@ There are two ways to upload the game onto the chain: ### 2. Using [`gear-js/cli`](https://github.com/gear-tech/gear-js/tree/main/tools/cli) It allows sending transactions to the Gear node based on `yaml` file: -- Go to folder with [scripts](https://github.com/gear-dapps/syndote/tree/master/upload-game): +- Go to folder with [scripts](https://github.com/gear-foundation/dapps-syndote/tree/master/upload-game): ``` cd ./upload-game/ ``` @@ -111,7 +111,7 @@ It allows sending transactions to the Gear node based on `yaml` file: ## 🖥️ Build and run user interface -1. Download [this repository](https://github.com/gear-dapps/syndote) locally and go to the `frontend` folder. +1. Download [this repository](https://github.com/gear-foundation/dapps-syndote) locally and go to the `frontend` folder. 2. Install packages: ```sh yarn install @@ -145,7 +145,7 @@ yarn start ## Smart contracts ### Master contract -[Master contract](https://github.com/gear-dapps/syndote/tree/master/syndote) is initialized with monopoly card information (cell cost, special cells: jail, lottery). As was already mentioned, it is given enough gas reservation for automatic play. Before each player's step `Master` contract checks the amount of gas and if it is not enough it will send a message to the game admin to request for another gas reservation. +[Master contract](https://github.com/gear-foundation/dapps-syndote/tree/master/syndote) is initialized with monopoly card information (cell cost, special cells: jail, lottery). As was already mentioned, it is given enough gas reservation for automatic play. Before each player's step `Master` contract checks the amount of gas and if it is not enough it will send a message to the game admin to request for another gas reservation. **Players registration**: Players deploy their strategic contracts and send a message `Register` to `Master` contract. Master contract: - Adds the players the list of participants and initializes it with the following structure: @@ -171,7 +171,7 @@ When the required number of participants is reached, the admin sends a message ` ![img alt](./img/monopoly_play.png) **Strategic messages:** -[Strategic contracts](https://github.com/gear-dapps/syndote/tree/master/player) send strategic messages depending on the position on the monopoly field. A player may be in one of the following positions: +[Strategic contracts](https://github.com/gear-foundation/dapps-syndote/tree/master/player) send strategic messages depending on the position on the monopoly field. A player may be in one of the following positions: - A cell with his own property. A player has a right: - To add a gear on the cell. The gear can be `Bronze`, `Silver` or `Gold`; - To upgrade a gear (from `Bronze` to `Silver` and from `Silver` to `Gold`); diff --git a/docs/examples/multisig-wallet.md b/docs/examples/multisig-wallet.md index 7fc24d70b..a374e637b 100644 --- a/docs/examples/multisig-wallet.md +++ b/docs/examples/multisig-wallet.md @@ -12,7 +12,7 @@ Imagine a bank vault that requires more than one key to open: That’s a little Multisignature proponents argue that multisignature is the most secure and fail-proof way to store cryptocurrency. Even if a thief gets his hands on one of your wallets, for example, they still won’t be able to access your account without the keys to the other wallets in the setup. -This article explains the programming interface, data structure, basic functions and explains their purpose. It can be used as is or modified to suit your own scenarios. Anyone can easily create their own application and run it on the Gear Network. The source code is available on [GitHub](https://github.com/gear-dapps/multisig-wallet). +This article explains the programming interface, data structure, basic functions and explains their purpose. It can be used as is or modified to suit your own scenarios. Anyone can easily create their own application and run it on the Gear Network. The source code is available on [GitHub](https://github.com/gear-foundation/dapps-multisig-wallet). ## Logic @@ -146,7 +146,7 @@ extern "C" fn state() { .expect("Failed to encode or reply with `::State` from `state()`"); } ``` -To display only necessary certain values from the state, you need to write a separate crate. In this crate, specify functions that will return the desired values from the `State` struct. For example - [gear-dapps/multisig-wallet/state](https://github.com/gear-dapps/multisig-wallet/tree/master/state): +To display only necessary certain values from the state, you need to write a separate crate. In this crate, specify functions that will return the desired values from the `State` struct. For example - [gear-foundation/dapps-multisig-wallet/state](https://github.com/gear-foundation/dapps-multisig-wallet/tree/master/state): ```rust #[metawasm] @@ -271,8 +271,8 @@ pub enum StateReply { ## Source code -The source code of this example of Multisig Wallet smart contract and the example of an implementation of its testing is available on [GitHub](https://github.com/gear-dapps/multisig-wallet). +The source code of this example of Multisig Wallet smart contract and the example of an implementation of its testing is available on [GitHub](https://github.com/gear-foundation/dapps-multisig-wallet). -See also an example of the smart contract testing implementation based on `gtest`: [multisig-wallet/tests](https://github.com/gear-dapps/multisig-wallet/tree/master/tests). +See also an example of the smart contract testing implementation based on `gtest`: [multisig-wallet/tests](https://github.com/gear-foundation/dapps-multisig-wallet/tree/master/tests). For more details about testing smart contracts written on Gear, refer to the [Program Testing](/docs/developing-contracts/testing) article. diff --git a/docs/examples/nft-marketplace/marketplace.md b/docs/examples/nft-marketplace/marketplace.md index 3a35e0504..94c196b32 100644 --- a/docs/examples/nft-marketplace/marketplace.md +++ b/docs/examples/nft-marketplace/marketplace.md @@ -11,17 +11,17 @@ NFT marketplace is a contract where you can buy and sell non-fungible tokens for A smart contract examples created by Gear are available on GitHub so anyone can easily create their own NFT marketplace application and run it on the Gear Network: -- [Gear Non-Fungible Token](https://github.com/gear-dapps/non-fungible-token/). -- [NFT marketplace](https://github.com/gear-dapps/nft-marketplace). +- [Gear Non-Fungible Token](https://github.com/gear-foundation/dapps-non-fungible-token/). +- [NFT marketplace](https://github.com/gear-foundation/dapps-nft-marketplace). -- Marketplace UI available on [Github](https://github.com/gear-dapps/nft-marketplace/tree/master/frontend) +- Marketplace UI available on [Github](https://github.com/gear-foundation/dapps-nft-marketplace/tree/master/frontend) -## How to run +## How to run ### ⚒️ Build programs -- Build [NFT contract](https://github.com/gear-dapps/non-fungible-token/) as described in `README.md` -- Build [Marketplace contract](https://github.com/gear-dapps/nft-marketplace/) as described in `README.md` +- Build [NFT contract](https://github.com/gear-foundation/dapps-non-fungible-token/) as described in `README.md` +- Build [Marketplace contract](https://github.com/gear-foundation/dapps-nft-marketplace/) as described in `README.md` ### 🏗️ Upload programs @@ -119,12 +119,12 @@ pub struct Market { ``` - `admin_id` - an account who has the right to approve non-fungible-token and fungible-tokens contracts that can be used in the marketplace contract; - `treasury_id` - an account to which sales commission will be credited; -- `treasury_fee` - +- `treasury_fee` - commission percentage (from 1 to 5 percent) The marketplace contract is initialized with the following fields; - `items` - listed NFTs; - `approved_nft_contracts` - NFT contracts accounts that can be listed on the marketplace; -- `approved_ft_contracts` - +- `approved_ft_contracts` - fungible token accounts for which it is possible to buy marketplace items; - `tx_id` - the id for tracking transactions in the fungible and non-fungible contracts (See the description of [fungible token](/examples/gft-20.md) and [non-fungible token](/examples/gnft-721.md)). @@ -142,13 +142,13 @@ pub struct Item { ``` - `owner` - an item owner; - `ft_contract_id` - a contract of fungible tokens for which that item can be bought. If that field is `None` then the item is on sale for native Gear value; -- `price` - +- `price` - the item price. `None` field means that the item is not on the sale; -- `auction` - +- `auction` - a field containing information on the current auction. `None` field means that there is no current auction on the item; -- `offers` - +- `offers` - purchase offers made on that item; -- `tx` - a pending transaction on the item. `None` means that there are no pending transactions. +- `tx` - a pending transaction on the item. `None` means that there are no pending transactions. `MarketTx` is an enum of possible transactions that can occur with NFT: @@ -178,7 +178,7 @@ pub enum MarketTx { } ``` ### Listing NFTs, changing the price or stopping the sale. -To list NFT on the marketplace or modify the terms of sale send the following message: +To list NFT on the marketplace or modify the terms of sale send the following message: ```rust /// Adds data on market item. /// If the item of that NFT does not exist on the marketplace then it will be listed. @@ -202,17 +202,17 @@ AddMarketData { } ``` ### NFT purchase. -To buy NFT send the following message: +To buy NFT send the following message: ```rust /// Sells the NFT. -/// +/// /// # Requirements: /// * The NFT item must exist and be on sale. /// * If the NFT is sold for a native Gear value, then a buyer must attach a value equal to the price. /// * If the NFT is sold for fungible tokens then a buyer must have enough tokens in the fungible token contract. /// * There must be no open auction on the item. -/// +/// /// On success replies [`MarketEvent::ItemSold`]. BuyItem { /// NFT contract address @@ -252,7 +252,7 @@ The auction is started with the following message: /// * Only the item owner can start the auction. /// * `nft_contract_id` must be in the list of `approved_nft_contracts` /// * There must be no active auction -/// +/// /// On success replies [`MarketEvent::AuctionCreated`]. CreateAuction { /// the NFT contract address @@ -273,14 +273,14 @@ CreateAuction { To add bid to the current auction send the following message: ```rust /// Adds a bid to an ongoing auction. -/// +/// /// # Requirements: /// * The item must exist. /// * The auction must exist on the item. /// * If the NFT is sold for a native Gear value, then a buyer must attach a value equal to the price indicated in the arguments. /// * If the NFT is sold for fungible tokens then a buyer must have enough tokens in the fungible token contract. /// * `price` must be greater than the current offered price for that item. -/// +/// /// On success replies [`MarketEvent::BidAdded`]. AddBid { /// the NFT contract address @@ -295,10 +295,10 @@ AddBid { If auction period is over then anyone can send message `SettleAuction` that will send the NFT to the winner and pay to the owner: ```rust /// Settles the auction. -/// +/// /// Requirements: /// * The auction must be over. -/// +/// /// On successful auction replies [`MarketEvent::AuctionSettled`]. /// If no bids were made replies [`MarketEvent::AuctionCancelled`]. SettleAuction { @@ -313,7 +313,7 @@ SettleAuction { To make offer on the marketplace item send the following message: ```rust /// Adds a price offer to the item. -/// +/// /// Requirements: /// * NFT items must exist and be listed on the marketplace. /// * There must be no ongoing auction on the item. @@ -321,7 +321,7 @@ To make offer on the marketplace item send the following message: /// * If a user makes an offer in fungible tokens then he must have enough tokens in the fungible token contract. /// * The price can not be equal to 0. /// * There must be no identical offers on the item. -/// +/// /// On success replies [`MarketEvent::OfferAdded`]. AddOffer { /// the NFT contract address @@ -337,13 +337,13 @@ AddOffer { The item owner can accept the offer: ```rust /// Accepts an offer. -/// +/// /// Requirements: /// * NFT items must exist and be listed on the marketplace. /// * Only the owner can accept the offer. /// * There must be no ongoing auction. /// * The offer with indicated hash must exist. -/// +/// /// On success replies [`MarketEvent::OfferAccepted`]. AcceptOffer { /// the NFT contract address @@ -360,12 +360,12 @@ The user who made the offer can also withdraw his tokens: ```rust /// Withdraws tokens. -/// +/// /// Requirements: /// * NFT items must exist and be listed on the marketplace. /// * Only the offer creator can withdraw his tokens. /// * The offer with indicated hash must exist. -/// +/// /// On success replies [`MarketEvent::TokensWithdrawn`]. Withdraw { /// the NFT contract address @@ -413,7 +413,7 @@ extern "C" fn state() { } ``` -To display only necessary certain values from the state, you need to write a separate crate. In this crate, specify functions that will return the desired values from the `Market` state. For example - [gear-dapps/nft-marketplace/state](https://github.com/gear-dapps/nft-marketplace/tree/master/state): +To display only necessary certain values from the state, you need to write a separate crate. In this crate, specify functions that will return the desired values from the `Market` state. For example - [gear-foundation/dapps-nft-marketplace/state](https://github.com/gear-foundation/dapps-nft-marketplace/tree/master/state): ```rust #[metawasm] diff --git a/docs/examples/nft-pixelboard.md b/docs/examples/nft-pixelboard.md index b21088630..aef6ce6cc 100644 --- a/docs/examples/nft-pixelboard.md +++ b/docs/examples/nft-pixelboard.md @@ -187,6 +187,6 @@ pub enum NFTPixelboardAction { ## Source code -The source code of the NFT pixelboard smart contract and an implementation of its testing is available on [GitHub](https://github.com/gear-dapps/nft-pixelboard). They can be used as is or modified to suit your own scenarios. +The source code of the NFT pixelboard smart contract and an implementation of its testing is available on [GitHub](https://github.com/gear-foundation/dapps-nft-pixelboard). They can be used as is or modified to suit your own scenarios. For more details about testing smart contracts written on Gear, refer to the [Program Testing](/docs/developing-contracts/testing) article. diff --git a/docs/examples/onchain-nft.md b/docs/examples/onchain-nft.md index 797e896b7..7418d378a 100644 --- a/docs/examples/onchain-nft.md +++ b/docs/examples/onchain-nft.md @@ -13,7 +13,7 @@ When the owner of a given token ID wishes to transfer it to another user, it is But there is another approach introduced here. Sometimes you can store NFTs directly on chain without any external storage. This approach helps you not to lose your NFT if there is a problem with the external storage. -This article explains the programming interface, data structure, basic functions and explains their purpose. It can be used as is or modified to suit your own scenarios. The source code is available on [GitHub](https://github.com/gear-dapps/on-chain-nft). +This article explains the programming interface, data structure, basic functions and explains their purpose. It can be used as is or modified to suit your own scenarios. The source code is available on [GitHub](https://github.com/gear-foundation/dapps-on-chain-nft). ## Approach To successfully implement this approach several things are needed. Firstly, when initializing a collection, one should provide all the possible images of all the layers for a collection. Secondly, when minting alongside with a small metadata, one should provide a combination of layers used for a specific NFT. This approach seems quite costly when initializing, but is relatively cheap when it comes to minting. @@ -25,13 +25,13 @@ The functions that must be supported by each non-fungible-token contract: - *mint(to, token_id, metadata)* is a function that creates a new token. Metadata can include any information about the token: it can be a link to a specific resource, a description of the token, etc; - *burn(from, token_id)* is a function that removes the token with the mentioned *token_id* from the contract. -The default implementation of the NFT contract is provided in the gear library: [gear-lib/non_fungible_token](https://github.com/gear-dapps/gear-lib/tree/master/src/non_fungible_token). +The default implementation of the NFT contract is provided in the gear library: [gear-lib/non_fungible_token](https://github.com/gear-foundation/dapps-gear-lib/tree/master/src/non_fungible_token). To use the default implementation you should include the packages into your *Cargo.toml* file: ```toml -gear-lib = { git = "https://github.com/gear-dapps/gear-lib.git" } -gear-lib-derive = { git = "https://github.com/gear-dapps/gear-lib.git" } +gear-lib = { git = "https://github.com/gear-foundation/dapps-gear-lib.git" } +gear-lib-derive = { git = "https://github.com/gear-foundation/dapps-gear-lib.git" } hashbrown = "0.13.1" ``` @@ -61,7 +61,7 @@ pub struct InitOnChainNFT { pub base_uri: String, pub base_image: String, // Layers MUST be specified in sequence order starting from 0, - // otherwise the contract will return the "No such layer" error. + // otherwise the contract will return the "No such layer" error. pub layers: Vec<(LayerId, Vec)>, pub royalties: Option, } @@ -274,7 +274,7 @@ extern "C" fn state() { .expect("Failed to encode or reply with `::State` from `state()`"); } ``` -To display only necessary certain values from the state, you need to write a separate crate. In this crate, specify functions that will return the desired values from the `State` state. For example - [gear-dapps/on-chain-nft/state](https://github.com/gear-dapps/on-chain-nft/tree/master/state): +To display only necessary certain values from the state, you need to write a separate crate. In this crate, specify functions that will return the desired values from the `State` state. For example - [gear-foundation/dapps-on-chain-nft/state](https://github.com/gear-foundation/dapps-on-chain-nft/tree/master/state): ```rust @@ -344,10 +344,10 @@ pub trait Metawasm { ## Conclusion -Gear provides a reusable [library](https://github.com/gear-dapps/gear-lib/tree/master/lib/src/non_fungible_token) with core functionality for the gNFT protocol. By using object composition, that library can be utilized within a custom NFT contract implementation in order to minimize duplication of community available code. +Gear provides a reusable [library](https://github.com/gear-foundation/dapps-gear-lib/tree/master/lib/src/non_fungible_token) with core functionality for the gNFT protocol. By using object composition, that library can be utilized within a custom NFT contract implementation in order to minimize duplication of community available code. -A source code of the on-chain NFT provided by Gear is available on GitHub: [on-chain-nft/src](https://github.com/gear-dapps/on-chain-nft). +A source code of the on-chain NFT provided by Gear is available on GitHub: [on-chain-nft/src](https://github.com/gear-foundation/dapps-on-chain-nft). -See also an example of the smart contract testing implementation based on `gtest`: [on-chain-nft/tests](https://github.com/gear-dapps/on-chain-nft/tree/master/tests). +See also an example of the smart contract testing implementation based on `gtest`: [on-chain-nft/tests](https://github.com/gear-foundation/dapps-on-chain-nft/tree/master/tests). For more details about testing smart contracts written on Gear, refer to this article: [Program Testing](/docs/developing-contracts/testing). diff --git a/docs/examples/oracle/dia-randomness-oracle.md b/docs/examples/oracle/dia-randomness-oracle.md index 1c8ffa7ee..b852cc41b 100644 --- a/docs/examples/oracle/dia-randomness-oracle.md +++ b/docs/examples/oracle/dia-randomness-oracle.md @@ -78,8 +78,8 @@ pub struct InitConfig { ## Conclusion -A source code of the contract example provided by Gear is available on GitHub: [oracle/randomness-oracle/src/lib.rs](https://github.com/gear-dapps/oracle/blob/wip/randomness-oracle/src/lib.rs). +A source code of the contract example provided by Gear is available on GitHub: [oracle/randomness-oracle/src/lib.rs](https://github.com/gear-foundation/dapps-oracle/blob/wip/randomness-oracle/src/lib.rs). -See also an example of the smart contract testing implementation based on `gtest`: [oracle/randomness-oracle/tests/randomness_oracle.rs](https://github.com/gear-dapps/oracle/blob/wip/randomness-oracle/tests/randomness_oracle.rs). +See also an example of the smart contract testing implementation based on `gtest`: [oracle/randomness-oracle/tests/randomness_oracle.rs](https://github.com/gear-foundation/dapps-oracle/blob/wip/randomness-oracle/tests/randomness_oracle.rs). For more details about testing smart contracts written on Gear, refer to this article: [Program Testing](/docs/developing-contracts/testing). diff --git a/docs/examples/oracle/gear-oracle.md b/docs/examples/oracle/gear-oracle.md index ea41d2120..3b9a5269e 100644 --- a/docs/examples/oracle/gear-oracle.md +++ b/docs/examples/oracle/gear-oracle.md @@ -16,7 +16,7 @@ These smart contracts can then be used to obtain external data which can't exist Moreover, oracles allow the creation of lending / DEX protocols, which form an important part of DeFi. -Gear provides an example of the native implementation of randomness oracle, which provides an ability to use random numbers in smart contracts. It can be used as is or modified to suit your own scenarios. Anyone can easily create their own oracle and run it on the Gear Network. The source code is available on [GitHub](https://github.com/gear-dapps/oracle). +Gear provides an example of the native implementation of randomness oracle, which provides an ability to use random numbers in smart contracts. It can be used as is or modified to suit your own scenarios. Anyone can easily create their own oracle and run it on the Gear Network. The source code is available on [GitHub](https://github.com/gear-foundation/dapps-oracle). ## Storage Structure @@ -52,8 +52,8 @@ pub enum Event { ## Conclusion -A source code of the contract example provided by Gear is available on GitHub: [oracle/oracle/src/contract.rs](https://github.com/gear-dapps/oracle/blob/wip/oracle/src/contract.rs). +A source code of the contract example provided by Gear is available on GitHub: [oracle/oracle/src/contract.rs](https://github.com/gear-foundation/dapps-oracle/blob/wip/oracle/src/contract.rs). -See also an example of the smart contract testing implementation based on `gtest` and `gclient`: [oracle/oracle/tests](https://github.com/gear-dapps/oracle/tree/wip/oracle/tests). +See also an example of the smart contract testing implementation based on `gtest` and `gclient`: [oracle/oracle/tests](https://github.com/gear-foundation/dapps-oracle/tree/wip/oracle/tests). For more details about testing smart contracts written on Gear, refer to this article: [Program Testing](/docs/developing-contracts/testing). diff --git a/docs/examples/ping.md b/docs/examples/ping.md index a3f0db0ec..e30428a19 100644 --- a/docs/examples/ping.md +++ b/docs/examples/ping.md @@ -7,7 +7,7 @@ sidebar_position: 2 Gear is very easy to write code for! -Let's look at the [minimal program](https://github.com/gear-dapps/app/). It contains the following files: +Let's look at the [minimal program](https://github.com/gear-foundation/dapps-app/). It contains the following files: ``` . ├── io / @@ -31,7 +31,7 @@ Let's look at the [minimal program](https://github.com/gear-dapps/app/). It cont ├── meta.txt └── build.rs ``` -The code of the program is in the `src/contract.rs` file. The program replies with `Pong` string if the sender sent `Ping` message to it. It also saves how many times a user sent a ping message to the program. +The code of the program is in the `src/contract.rs` file. The program replies with `Pong` string if the sender sent `Ping` message to it. It also saves how many times a user sent a ping message to the program. So, the program contains: - state definition: ```rust @@ -146,6 +146,6 @@ pub trait Metawasm { state.ping_count(actor) } } -``` +``` -In the tests directory you can see an example of testing the program using `gclient` and `gtest`. For more details about testing smart contracts written on Gear, refer to the [Program Testing](/docs/developing-contracts/testing) article. \ No newline at end of file +In the tests directory you can see an example of testing the program using `gclient` and `gtest`. For more details about testing smart contracts written on Gear, refer to the [Program Testing](/docs/developing-contracts/testing) article. diff --git a/docs/examples/prerequisites.mdx b/docs/examples/prerequisites.mdx index 0b216e182..d2615c048 100644 --- a/docs/examples/prerequisites.mdx +++ b/docs/examples/prerequisites.mdx @@ -75,7 +75,7 @@ commit hash: `78dfa07` Make sure the correct commit hash version is specified in the `Cargo.toml` file of the smart contract you're working on. For example: -https://github.com/gear-dapps/app/blob/master/Cargo.toml#L10 +https://github.com/gear-foundation/dapps-app/blob/master/Cargo.toml#L10 @@ -151,7 +151,7 @@ fn main() { ``` `Cargo.toml` is a project manifest in Rust, it contains all metadata necessary for compiling the project. -Configure the `Cargo.toml` similarly to how it is configured [ping/Cargo.toml](https://github.com/gear-dapps/ping/blob/master/Cargo.toml). You can refer to [Getting Started](/docs/getting-started-in-5-minutes.md) for additional details. +Configure the `Cargo.toml` similarly to how it is configured [ping/Cargo.toml](https://github.com/gear-foundation/dapps-ping/blob/master/Cargo.toml). You can refer to [Getting Started](/docs/getting-started-in-5-minutes.md) for additional details. ## Building Rust Contract @@ -167,14 +167,14 @@ Our application should compile successfully and the final file `target/wasm32-un You can use a pre-configured Docker image to build and test your smart contract. The image contains all the necessary tools and dependencies for building and running smart contracts and JS applications. -The source code of the image is available on [GitHub](https://github.com/gear-dapps/gear-env). +The source code of the image is available on [GitHub](https://github.com/gear-foundation/dapps-gear-env). To use the image, you need to install Docker on your machine. You can find the installation instructions for your OS on the [Docker website](https://docs.docker.com/get-docker/). After installing Docker, you can pull the image from the Docker Hub: ```bash -docker pull ghcr.io/gear-dapps/gear-env:stable +docker pull ghcr.io/gear-foundation/dapps-gear-env:stable ``` To run the image, use the following command: @@ -184,14 +184,14 @@ To run the image, use the following command: ```bash -docker run --rm --name gear-env -itd ghcr.io/gear-dapps/gear-env:stable bash +docker run --rm --name gear-env -itd ghcr.io/gear-foundation/dapps-gear-env:stable bash ``` ```bash -docker run --rm --name gear-env --platform linux/amd64 -itd ghcr.io/gear-dapps/gear-env:stable bash +docker run --rm --name gear-env --platform linux/amd64 -itd ghcr.io/gear-foundation/dapps-gear-env:stable bash ``` diff --git a/docs/examples/rmrk.md b/docs/examples/rmrk.md index 769152291..c2e0b7083 100644 --- a/docs/examples/rmrk.md +++ b/docs/examples/rmrk.md @@ -13,11 +13,11 @@ RMRK legos that are already implemented on Gear: - Multi-resource NFTs: The ability for an NFT to vary its output depending on the context it is being loaded in. -This article explains the programming interface, data structure, basic functions and explains their purpose. The source code is available on [GitHub](https://github.com/gear-dapps/RMRK). +This article explains the programming interface, data structure, basic functions and explains their purpose. The source code is available on [GitHub](https://github.com/gear-foundation/dapps-RMRK). ## Logic ### Nesting logic -The concept of nested NFTs refers to NFTs being able to own other NFTs. So, the NFT owner can be not only an account or a smart contract, but also another NFT. +The concept of nested NFTs refers to NFTs being able to own other NFTs. So, the NFT owner can be not only an account or a smart contract, but also another NFT. In the usual NFT standard, NFT owners were stored as mapping from the NFT ids to addresses: ```rust @@ -116,7 +116,7 @@ The root owner or the approved account can accept the child NFT by sending the f /// * `parent_token_id`: is the tokenId of the parent NFT /// * `child_token_id`: is the tokenId of the child instance /// -/// On success replies [`RMRKEvent::AcceptedChild`]. +/// On success replies [`RMRKEvent::AcceptedChild`]. AcceptChild { parent_token_id: TokenId, child_contract_id: ActorId, @@ -138,7 +138,7 @@ or reject the child NFT with the message: /// * `child_contract_id`: is the address of the child RMRK contract. /// * `child_token_id`: is the tokenId of the child instance. /// -/// On success replies [`RMRKEvent::RejectedChild`]. +/// On success replies [`RMRKEvent::RejectedChild`]. RejectChild { parent_token_id: TokenId, child_contract_id: ActorId, @@ -245,7 +245,7 @@ Transfer { token_id: TokenId, }, ``` -If the previous owner is another NFT it sends a message `BurnChild` to the parent contract. +If the previous owner is another NFT it sends a message `BurnChild` to the parent contract. In case of transferring a token to another NFT, the following message is sent: ```rust @@ -276,9 +276,9 @@ In that case child RMRK contract sends message `TransferChild` to parent RMRK co /// That message is designed to be sent from another RMRK contracts /// when the root owner transfers his child to another parent token within one contract. /// If root owner transfers child token from NFT to another his NFT -/// it adds a child to the NFT with a status that child had before. +/// it adds a child to the NFT with a status that child had before. /// If root owner transfers child token from NFT to another NFT that he does not own -/// it adds a child to the NFT with a status `Pending`. +/// it adds a child to the NFT with a status `Pending`. /// /// # Requirements: /// * The `msg::source()` must be a child RMRK contract. @@ -345,12 +345,12 @@ Approve { }, ``` ### Multiresource logic -The Multi Resource NFT standard is a standalone part of RMRK concepts. The idea is that an NFT can have multiple resources. +The Multi Resource NFT standard is a standalone part of RMRK concepts. The idea is that an NFT can have multiple resources. There are four key use cases for NFT multiresource: - *Cross-metaverse compatibility*: for example, NFT with several resources can be used in different games. - *Multimedia output*: NFT can be stored in different digital formats (image, video, audio, eBooks or text file). - *Media Redundancy*: many NFTs are minted with metadata centralized on a server somewhere or, in some cases, a hardcoded IPFS gateway which can also go down, instead of just an IPFS hash. By adding the same metadata file as different resources, the resilience of the metadata and its referenced media increases exponentially as the chances of all the protocols going down at once become ever less likely. -- *NFT Evolution*: many NFTs, particularly game related ones, require evolution. +- *NFT Evolution*: many NFTs, particularly game related ones, require evolution. RMRK contract can create a contract to store its resources. #### **Resource storage contract:** The storage state: @@ -379,7 +379,7 @@ To add resource to the token the RMRK contract must send the following message: /// * `thumb`: a string pointing to thumbnail media associated with the resource. /// * `metadata_uri`: a string pointing to a metadata file associated with the resource. /// -/// On success replies [`ResourceEvent::ResourceEntryAdded`]. +/// On success replies [`ResourceEvent::ResourceEntryAdded`]. AddResourceEntry { id: u8, src: String, @@ -394,7 +394,7 @@ To get information about whether such a resource exists in the storage or not, s /// # Arguments: /// * `id`: is a resource identifier. /// -/// On success replies [`ResourceEvent::Resource`]. +/// On success replies [`ResourceEvent::Resource`]. GetResource { id: u8, }, @@ -512,7 +512,7 @@ SetPriority { ``` ### Bases and Equippable NFTs -That functionality allows NFTs to equip owned NFTs in order to gain extra utility or change their appearance. It is also known as composable NFTs. +That functionality allows NFTs to equip owned NFTs in order to gain extra utility or change their appearance. It is also known as composable NFTs. Resources are divided into three types: * Basic: ```rust @@ -572,7 +572,7 @@ pub struct SlotResource { } ``` -Base contract is a catalogue of parts from which an NFT can be composed. If resource is `Composable` or `Slot` then it refers to `base` contract that contains the information about parts. +Base contract is a catalogue of parts from which an NFT can be composed. If resource is `Composable` or `Slot` then it refers to `base` contract that contains the information about parts. The base contract state: ```rust #[derive(Debug, Default, Encode, Decode, TypeInfo)] @@ -686,7 +686,7 @@ RemoveEquippable { }, /// Checks whether the part exists in the Base. -/// +/// /// # Arguments: /// * `PartId`: the Part Id. /// @@ -695,10 +695,10 @@ CheckPart(PartId), } ``` -The RMRK contract logic is extended with the following messages: +The RMRK contract logic is extended with the following messages: ```rust /// Equip a child NFT's resource to a parent's slot. -/// It sends message to the child contract +/// It sends message to the child contract /// to check whether the child token has the indicated slot resource. /// /// # Requirements: @@ -747,7 +747,7 @@ Unequip { ``` ## Source code -The source code of RMRK implementation and the example of an implementation of its testing is available on [GitHub](https://github.com/gear-dapps/RMRK). +The source code of RMRK implementation and the example of an implementation of its testing is available on [GitHub](https://github.com/gear-foundation/dapps-RMRK). For more details about testing smart contracts written on Gear, refer to the [Program Testing](/docs/developing-contracts/testing) article. diff --git a/docs/examples/rock-paper-scissors.md b/docs/examples/rock-paper-scissors.md index 8e8173e6b..70cd77a8d 100644 --- a/docs/examples/rock-paper-scissors.md +++ b/docs/examples/rock-paper-scissors.md @@ -12,7 +12,7 @@ A simultaneous, zero-sum game, it has three possible outcomes: a draw, a win or One popular five-weapon expansion is "rock paper scissors Spock lizard", invented by Sam Kass and Karen Bryla, which adds "Spock" and "lizard" to the standard three choices. "Spock" is signified with the Star Trek Vulcan salute, while "lizard" is shown by forming the hand into a sock-puppet-like mouth. Spock smashes scissors and vaporizes rock; he is poisoned by lizard and disproved by paper. Lizard poisons Spock and eats paper; it is crushed by rock and decapitated by scissors. This variant was mentioned in a 2005 article in The Times of London and was later the subject of an episode of the American sitcom The Big Bang Theory in 2008 (as rock-paper-scissors-lizard-Spock). -Anyone can easily create their own decentralized game application and run it on the Gear Network. To do this, we have made a "rock paper scissors Spock lizard" game version for multiple players, in which the winner can be determined in several rounds of tense struggle. The source code is available on [GitHub](https://github.com/gear-dapps/rock-paper-scissors). This article explains the programming interface, data structure, basic functions and explains their purpose. It can be used as is or modified to suit your own scenarios. +Anyone can easily create their own decentralized game application and run it on the Gear Network. To do this, we have made a "rock paper scissors Spock lizard" game version for multiple players, in which the winner can be determined in several rounds of tense struggle. The source code is available on [GitHub](https://github.com/gear-foundation/dapps-rock-paper-scissors). This article explains the programming interface, data structure, basic functions and explains their purpose. It can be used as is or modified to suit your own scenarios. ## Logic @@ -150,7 +150,7 @@ extern "C" fn state() { .expect("Failed to encode or reply with `::State` from `state()`"); } ``` -To display only necessary certain values from the state, you need to write a separate crate. In this crate, specify functions that will return the desired values from the `ContractState` state. For example - [gear-dapps/rock-paper-scissors/state](https://github.com/gear-dapps/rock-paper-scissors/tree/master/state): +To display only necessary certain values from the state, you need to write a separate crate. In this crate, specify functions that will return the desired values from the `ContractState` state. For example - [gear-foundation/dapps-rock-paper-scissors/state](https://github.com/gear-foundation/dapps-rock-paper-scissors/tree/master/state): ```rust @@ -178,6 +178,6 @@ pub trait Metawasm { ## Source code -The source code of Rock Paper Scissors implementation and the example of an implementation of its testing is available on [GitHub](https://github.com/gear-dapps/rock-paper-scissors). +The source code of Rock Paper Scissors implementation and the example of an implementation of its testing is available on [GitHub](https://github.com/gear-foundation/dapps-rock-paper-scissors). For more details about testing smart contracts written on Gear, refer to the [Program Testing](/docs/developing-contracts/testing) article. diff --git a/docs/examples/staking.md b/docs/examples/staking.md index f6c12e26a..96f75e422 100644 --- a/docs/examples/staking.md +++ b/docs/examples/staking.md @@ -9,7 +9,7 @@ sidebar_position: 18 Stacking is an analogue of a bank deposit, receiving passive earnings due to simple storage of cryptomonets. The percentage of income may be different – it all depends on the term of the deposit. -Anyone can create their own Staking contract and run it on the Gear Network. To do this, Gear created an example which is available on [GitHub](https://github.com/gear-dapps/staking). +Anyone can create their own Staking contract and run it on the Gear Network. To do this, Gear created an example which is available on [GitHub](https://github.com/gear-foundation/dapps-staking). This article explains the programming interface, data structure, basic functions and explains their purpose. It can be used as is or modified to suit your own scenarios. @@ -361,7 +361,7 @@ extern "C" fn state() { .expect("Failed to encode or reply with `::State` from `state()`"); } ``` -To display only necessary certain values from the state, you need to write a separate crate. In this crate, specify functions that will return the desired values from the `IoStaking` state. For example - [gear-dapps/staking/state](https://github.com/gear-dapps/staking/tree/master/state): +To display only necessary certain values from the state, you need to write a separate crate. In this crate, specify functions that will return the desired values from the `IoStaking` state. For example - [gear-foundation/dapps-staking/state](https://github.com/gear-foundation/dapps-staking/tree/master/state): ```rust #[metawasm] @@ -389,12 +389,12 @@ The `Staking` contract interacts with the `fungible` token contract. Each transa ## Conclusion -A source code of the contract example provided by Gear is available on GitHub: [`staking/src/lib.rs`](https://github.com/gear-dapps/staking/blob/master/src/lib.rs). +A source code of the contract example provided by Gear is available on GitHub: [`staking/src/lib.rs`](https://github.com/gear-foundation/dapps-staking/blob/master/src/lib.rs). See also examples of the smart contract testing implementation based on gtest: -- [`simple_test.rs`](https://github.com/gear-dapps/staking/blob/master/tests/simple_test.rs). +- [`simple_test.rs`](https://github.com/gear-foundation/dapps-staking/blob/master/tests/simple_test.rs). -- [`panic_test.rs`](https://github.com/gear-dapps/staking/blob/master/tests/panic_test.rs). +- [`panic_test.rs`](https://github.com/gear-foundation/dapps-staking/blob/master/tests/panic_test.rs). For more details about testing smart contracts written on Gear, refer to this article: [Program testing](/docs/developing-contracts/testing). diff --git a/docs/examples/supply-chain.md b/docs/examples/supply-chain.md index df9757c6b..6b0fdbc8b 100644 --- a/docs/examples/supply-chain.md +++ b/docs/examples/supply-chain.md @@ -6,8 +6,8 @@ sidebar_position: 12 In logistics, a supply chain is a system for tracking and delivering to an end consumer various items. As a rule, such systems can't work without a lot of paperwork and other layers of bureaucracy. All of this costs a lot of time and money and increases the likelihood of an accidental error or, worst of all, a fraud. With the help of smart contract and blockchain technologies, it is possible to eliminate these problems by making a supply chain more efficient, reliable and transparent. -- [Supply chain contract](https://github.com/gear-dapps/supply-chain). -- [Supply chain UI](https://github.com/gear-dapps/supply-chain/tree/master/frontend). +- [Supply chain contract](https://github.com/gear-foundation/dapps-supply-chain). +- [Supply chain UI](https://github.com/gear-foundation/dapps-supply-chain/tree/master/frontend). ## How to run @@ -15,9 +15,9 @@ In logistics, a supply chain is a system for tracking and delivering to an end c Upload Supply chain contract requires build two auxiliary contracts: -- Build [NFT contract](https://github.com/gear-dapps/non-fungible-token/) as described in `README.md` -- Build [Sharded FT contract](https://github.com/gear-dapps/sharded-fungible-token/) as described in `README.md` -- Build [Supply Chain contract](https://github.com/gear-dapps/supply-chain) as described in `README.md` +- Build [NFT contract](https://github.com/gear-foundation/dapps-non-fungible-token/) as described in `README.md` +- Build [Sharded FT contract](https://github.com/gear-foundation/dapps-sharded-fungible-token/) as described in `README.md` +- Build [Supply Chain contract](https://github.com/gear-foundation/dapps-supply-chain) as described in `README.md` ### 🏗️ Upload programs @@ -65,7 +65,7 @@ yarn install 2. Configure .evn file. Specify network address and program ID like in the example below: -For proper application functioning, one needs to adjust an environment variable parameters. An example is available [here](https://github.com/gear-dapps/supply-chain/blob/master/frontend/.env.example). +For proper application functioning, one needs to adjust an environment variable parameters. An example is available [here](https://github.com/gear-foundation/dapps-supply-chain/blob/master/frontend/.env.example). ```sh REACT_APP_NODE_ADDRESS=wss://rpc-node.gear-tech.io @@ -564,7 +564,7 @@ extern "C" fn state() { .expect("Failed to encode or reply with `::State` from `state()`"); } ``` -To display only necessary certain values from the state, you need to write a separate crate. In this crate, specify functions that will return the desired values from the `State` struct. For example - [gear-dapps/supply-chain/state](https://github.com/gear-dapps/supply-chain/tree/master/state): +To display only necessary certain values from the state, you need to write a separate crate. In this crate, specify functions that will return the desired values from the `State` struct. For example - [gear-foundation/dapps-supply-chain/state](https://github.com/gear-foundation/dapps-supply-chain/tree/master/state): ```rust #[metawasm] @@ -607,6 +607,6 @@ pub type ActorIdInnerSupplyChainAction = (ActorId, InnerAction); ## Source code -The source code of this example of a supply chain smart contract and an implementation of its testing is available on [GitHub](https://github.com/gear-dapps/supply-chain). They can be used as is or modified to suit your own scenarios. +The source code of this example of a supply chain smart contract and an implementation of its testing is available on [GitHub](https://github.com/gear-foundation/dapps-supply-chain). They can be used as is or modified to suit your own scenarios. For more details about testing smart contracts written on Gear, refer to the [Program Testing](/docs/developing-contracts/testing) article. diff --git a/docs/examples/tequila-train.md b/docs/examples/tequila-train.md index 4717ede46..cc296ff59 100644 --- a/docs/examples/tequila-train.md +++ b/docs/examples/tequila-train.md @@ -34,12 +34,12 @@ The aim is to be the first player to get rid of all the dominoes in their hand. ## How to run -Source code can be found in the GitHub: https://github.com/gear-dapps/tequila-train +Source code can be found in the GitHub: https://github.com/gear-foundation/dapps-tequila-train Clone the repo and enter to the project directory: ```shell -git clone https://github.com/gear-dapps/tequila-train +git clone https://github.com/gear-foundation/dapps-tequila-train cd tequila-train ``` @@ -248,4 +248,4 @@ pub enum State { ## Source code -The source code of the Tequila Train Game smart contract is available on [GitHub](https://github.com/gear-dapps/tequila-train). They can be used as is or modified to suit your own scenarios. +The source code of the Tequila Train Game smart contract is available on [GitHub](https://github.com/gear-foundation/dapps-tequila-train). They can be used as is or modified to suit your own scenarios. diff --git a/docs/examples/varatube.md b/docs/examples/varatube.md index 6254082a6..c5acaf9ac 100644 --- a/docs/examples/varatube.md +++ b/docs/examples/varatube.md @@ -11,7 +11,7 @@ sidebar_position: 24 Many web services (in Web2) work on a subscription basis. One of the main features of subscription management is subscription auto-renewal. So that after the expiration of the subscription period, the money is automatically debited from the wallet and the subscription is automatically renewed without user intervention. -This dApp example represents a video-hosting service **[VaraTube](https://github.com/gear-dapps/varatube)** that enables watching videos with a valid subscription that can be renewed automatically. +This dApp example represents a video-hosting service **[VaraTube](https://github.com/gear-foundation/dapps-varatube)** that enables watching videos with a valid subscription that can be renewed automatically. ### Decentralization aspect @@ -23,12 +23,12 @@ This makes it possible to implement logic when several logically related message State consistency between smart contracts is achieved using techniques described [here](/developing-contracts/distributed_transactions.md). -## How to run +## How to run ### ⚒️ Build program -- Get the source code of [VaraTube contract](https://github.com/gear-dapps/varatube/tree/master/src) and [Fungible Token contract](https://github.com/gear-dapps/fungible-token) -- Build contracts as described in [program/README.md](https://github.com/gear-dapps/varatube#readme). +- Get the source code of [VaraTube contract](https://github.com/gear-foundation/dapps-varatube/tree/master/src) and [Fungible Token contract](https://github.com/gear-foundation/dapps-fungible-token) +- Build contracts as described in [program/README.md](https://github.com/gear-foundation/dapps-varatube#readme). ### 🏗️ Upload program @@ -41,7 +41,7 @@ State consistency between smart contracts is achieved using techniques described ### 🖥️ Run UI -1. Install packages as described in [frontend/README.md](https://github.com/gear-dapps/varatube/tree/master/frontend#readme) +1. Install packages as described in [frontend/README.md](https://github.com/gear-foundation/dapps-varatube/tree/master/frontend#readme) ```sh yarn install @@ -68,16 +68,16 @@ yarn start When a user purchases a subscription, access to the service is open, and after the subscription expires, access is closed. -The interface provides an option whether to enable or disable subscription auto-renewal. And if it is enabled, the subscription will be renewed automatically by getting funds from the user's. +The interface provides an option whether to enable or disable subscription auto-renewal. And if it is enabled, the subscription will be renewed automatically by getting funds from the user's. There is also an option to cancel the active subscription. The VaraTube consists of two smart contracts: - [Gear Fungible Token (GFT-20)](/docs/examples/gft-20) contract determines user and service balances required to purchase a subscription and approves Subscription contract to get funds from user's balance. -- [VaraTube Subscription](https://github.com/gear-dapps/varatube#readme) contract manages service's subscription - its availability, expiration, auto renewal. +- [VaraTube Subscription](https://github.com/gear-foundation/dapps-varatube#readme) contract manages service's subscription - its availability, expiration, auto renewal. ## Source code -The source code of the VaraTube smart contract including its testing as well as JS frontend web application example is available on [GitHub](https://github.com/gear-dapps/varatube). They can be used as is or modified to suit your own scenarios. +The source code of the VaraTube smart contract including its testing as well as JS frontend web application example is available on [GitHub](https://github.com/gear-foundation/dapps-varatube). They can be used as is or modified to suit your own scenarios. For more details about testing smart contracts written on Gear, refer to the [Program Testing](/docs/developing-contracts/testing) article. diff --git a/docs/getting-started-in-5-minutes.md b/docs/getting-started-in-5-minutes.md index dc4ecb8f8..8d3c850d7 100644 --- a/docs/getting-started-in-5-minutes.md +++ b/docs/getting-started-in-5-minutes.md @@ -104,7 +104,7 @@ This guide provides a general overview of running smart contracts on the network [dependencies] # highlight-next-line - gstd = { git = "https://github.com/gear-tech/gear.git", branch = "testnet" } + gstd = { git = "https://github.com/gear-tech/gear.git", rev = "946ac47" } ``` 6. Replace the default contents of `lib.rs` in the `counter` folder with the code for our first smart-contract. diff --git a/i18n/zh-cn/docusaurus-plugin-content-docs/current/developing-contracts/testing.md b/i18n/zh-cn/docusaurus-plugin-content-docs/current/developing-contracts/testing.md index 1523d2bbb..7ebdcced4 100644 --- a/i18n/zh-cn/docusaurus-plugin-content-docs/current/developing-contracts/testing.md +++ b/i18n/zh-cn/docusaurus-plugin-content-docs/current/developing-contracts/testing.md @@ -65,13 +65,13 @@ authors = ["Your Name"] edition = "2021" [dependencies] -gstd = { git = "https://github.com/gear-tech/gear.git", branch = "stable" } +gstd = { git = "https://github.com/gear-tech/gear.git", rev = "946ac47" } [build-dependencies] -gear-wasm-builder = { git = "https://github.com/gear-tech/gear.git", branch = "stable" } +gear-wasm-builder = { git = "https://github.com/gear-tech/gear.git", rev = "946ac47" } [dev-dependencies] -gtest = { git = "https://github.com/gear-tech/gear.git", branch = "stable" } +gtest = { git = "https://github.com/gear-tech/gear.git", rev = "946ac47" } ``` ## `gtest` 的能力 diff --git a/i18n/zh-cn/docusaurus-plugin-content-docs/current/examples/DAO.md b/i18n/zh-cn/docusaurus-plugin-content-docs/current/examples/DAO.md index 0ef4b1074..d3d161c58 100644 --- a/i18n/zh-cn/docusaurus-plugin-content-docs/current/examples/DAO.md +++ b/i18n/zh-cn/docusaurus-plugin-content-docs/current/examples/DAO.md @@ -253,7 +253,7 @@ extern "C" fn meta_state() -> *mut [i32; 2] { ## 用户界面 -一个 [即用型应用](https://dao.gear-tech.io/)实例提供了一个与[DAO](https://github.com/gear-dapps/dao-light)和[GFT](https://github.com/gear-dapps/fungible-token)智能合约互动的用户界面。 +一个 [即用型应用](https://dao.gear-tech.io/)实例提供了一个与[DAO](https://github.com/gear-foundation/dapps-dao-light)和[GFT](https://github.com/gear-foundation/dapps-fungible-token)智能合约互动的用户界面。 Gear 同质化代币可以创建基于实用代币的 DAO,详情请看[本文](gft-20.md)。 @@ -294,8 +294,8 @@ yarn run start ## 源码 -DAO 智能合约的例子的源代码和其测试的实例源码在 [GitHub](https://github.com/gear-dapps/dao-light)。 +DAO 智能合约的例子的源代码和其测试的实例源码在 [GitHub](https://github.com/gear-foundation/dapps-dao-light)。 -DAO 扩展版可以管理、会员提案和委托投票,源码在 [https://github.com/gear-dapps/dao-app](https://github.com/gear-dapps/dao-app)。 +DAO 扩展版可以管理、会员提案和委托投票,源码在 [https://github.com/gear-foundation/dapps-dao-app](https://github.com/gear-foundation/dapps-dao-app)。 更多关于在 Gear 上测试智能合约的细节,请参考这篇文章:[应用测试](https://wiki.gear-tech.io/zh-cn/developing-contracts/testing/)。 diff --git a/i18n/zh-cn/docusaurus-plugin-content-docs/current/examples/concert.md b/i18n/zh-cn/docusaurus-plugin-content-docs/current/examples/concert.md index 585a4460c..a7b5a519f 100644 --- a/i18n/zh-cn/docusaurus-plugin-content-docs/current/examples/concert.md +++ b/i18n/zh-cn/docusaurus-plugin-content-docs/current/examples/concert.md @@ -101,8 +101,8 @@ pub enum ConcertAction { ## 结论 -Concert 的源代码和其测试的实例源码在 GitHub 上:[`concert/src/lib.rs`](https://github.com/gear-dapps/concert/blob/master/src/lib.rs)。 +Concert 的源代码和其测试的实例源码在 GitHub 上:[`concert/src/lib.rs`](https://github.com/gear-foundation/dapps-concert/blob/master/src/lib.rs)。 -同样可以找到基于 `gtest` 实现的智能合约测试范例:[`concert/tests/concert_tests.rs`](https://github.com/gear-dapps/concert/blob/master/tests/concert_tests.rs)。 +同样可以找到基于 `gtest` 实现的智能合约测试范例:[`concert/tests/concert_tests.rs`](https://github.com/gear-foundation/dapps-concert/blob/master/tests/concert_tests.rs)。 更多关于在 Gear 上测试智能合约的细节,请参考这篇文章:[应用测试](/developing-contracts/testing)。 diff --git a/i18n/zh-cn/docusaurus-plugin-content-docs/current/examples/crowdsale.md b/i18n/zh-cn/docusaurus-plugin-content-docs/current/examples/crowdsale.md index 616e689d6..20600e5e8 100644 --- a/i18n/zh-cn/docusaurus-plugin-content-docs/current/examples/crowdsale.md +++ b/i18n/zh-cn/docusaurus-plugin-content-docs/current/examples/crowdsale.md @@ -12,7 +12,7 @@ sidebar_position: 18 本文所描述的众筹智能合约实现的例子是在 Gear 上实现和发布的去中心化应用之一。这篇文章介绍了接口、数据结构、基本功能,并解释了它们的用途。代码可以直接使用,也可以根据自己的场景进行修改。任何人都可以轻松创建自己的众筹应用,并在 Gear 网络上运行。 购买代币的初始资金由 Gear 同质化代币合约决定 - [gFT](https://wiki.gear-tech.io/examples/gft-20)。 -合约源代码可在[GitHub](https://github.com/gear-dapps/crowdsale)上找到。 +合约源代码可在[GitHub](https://github.com/gear-foundation/dapps-crowdsale)上找到。 ## 界面 @@ -172,6 +172,6 @@ IcoEvent::SaleEnded ## 总结 -公开发售合约源码在 [Github](https://github.com/gear-dapps/crowdsale)。 +公开发售合约源码在 [Github](https://github.com/gear-foundation/dapps-crowdsale)。 更多关于在 Gear 上测试智能合约的细节,请参考这篇文章:[程序测试](/developing-contracts/testing.md)。 diff --git a/i18n/zh-cn/docusaurus-plugin-content-docs/current/examples/dutch-auction.md b/i18n/zh-cn/docusaurus-plugin-content-docs/current/examples/dutch-auction.md index 8aacbe0ff..a225be8e1 100644 --- a/i18n/zh-cn/docusaurus-plugin-content-docs/current/examples/dutch-auction.md +++ b/i18n/zh-cn/docusaurus-plugin-content-docs/current/examples/dutch-auction.md @@ -134,8 +134,8 @@ pub struct AuctionInfo { ## Source code -荷兰式拍卖的合约源代码可以在 [gear-dapps/dutch-auction](https://github.com/gear-dapps/dutch-auction) 找到。 +荷兰式拍卖的合约源代码可以在 [gear-foundation/dapps-dutch-auction](https://github.com/gear-foundation/dapps-dutch-auction) 找到。 -同样可以找到基于 gtest 实现的智能合约测试范例:[gear-dapps/dutch-auction/tree/master/tests](https://github.com/gear-dapps/dutch-auction/tree/master/tests)。 +同样可以找到基于 gtest 实现的智能合约测试范例:[gear-foundation/dapps-dutch-auction/tree/master/tests](https://github.com/gear-foundation/dapps-dutch-auction/tree/master/tests)。 更多关于在 Gear 的测试智能合约的细节,请参考这篇文章:[应用测试](https://wiki.gear-tech.io/zh-cn/developing-contracts/testing/)。 diff --git a/i18n/zh-cn/docusaurus-plugin-content-docs/current/examples/escrow.md b/i18n/zh-cn/docusaurus-plugin-content-docs/current/examples/escrow.md index fd8567eae..6ef389262 100644 --- a/i18n/zh-cn/docusaurus-plugin-content-docs/current/examples/escrow.md +++ b/i18n/zh-cn/docusaurus-plugin-content-docs/current/examples/escrow.md @@ -167,7 +167,7 @@ pub enum EscrowState { ## 用户界面 -一个[现成的应用](https://escrow.gear-tech.io/)实例提供了一个与[第三方担保](https://github.com/gear-dapps/dao-light)智能合约互动的用户界面。 +一个[现成的应用](https://escrow.gear-tech.io/)实例提供了一个与[第三方担保](https://github.com/gear-foundation/dapps-dao-light)智能合约互动的用户界面。 你也可以通过视频了解如何使用:**https://youtu.be/CD8j4epEY4E**. @@ -198,6 +198,6 @@ REACT_APP_NODE_ADDRESS ## 源码 -Escrow 的合约源码可以在 [GitHub](https://github.com/gear-dapps/escrow) 找到。 +Escrow 的合约源码可以在 [GitHub](https://github.com/gear-foundation/dapps-escrow) 找到。 更多关于在 Gear 的测试智能合约的细节,请参考这篇文章:[应用测试](/docs/developing-contracts/testing)。 diff --git a/i18n/zh-cn/docusaurus-plugin-content-docs/current/examples/feeds.md b/i18n/zh-cn/docusaurus-plugin-content-docs/current/examples/feeds.md index 7f9e2166c..2f8e1ca3b 100644 --- a/i18n/zh-cn/docusaurus-plugin-content-docs/current/examples/feeds.md +++ b/i18n/zh-cn/docusaurus-plugin-content-docs/current/examples/feeds.md @@ -49,6 +49,6 @@ sidebar_position: 6 Gear Feeds 是一个成熟的应用程序的例子,其核心逻辑是在 Gear 上通过智能合约实现的去中心化的应用程序。我们希望看到更多由 Gear Feeds 启发的令人兴奋的项目,以及我们的社区成员创造的最近的平台改进!:) -Router 与 Channel 的合约源代码可以在 [gear-dapps/feeds](https://github.com/gear-dapps/multitoken/tree/master/tests)找到。 +Router 与 Channel 的合约源代码可以在 [gear-foundation/dapps-feeds](https://github.com/gear-foundation/dapps-multitoken/tree/master/tests)找到。 -更多关于在 Gear 的测试智能合约的细节,请参考这篇文章:[应用测试](https://wiki.gear-tech.io/zh-cn/developing-contracts/testing/)。 \ No newline at end of file +更多关于在 Gear 的测试智能合约的细节,请参考这篇文章:[应用测试](https://wiki.gear-tech.io/zh-cn/developing-contracts/testing/)。 diff --git a/i18n/zh-cn/docusaurus-plugin-content-docs/current/examples/game-of-chance.md b/i18n/zh-cn/docusaurus-plugin-content-docs/current/examples/game-of-chance.md index 5f378b626..bbffdba20 100644 --- a/i18n/zh-cn/docusaurus-plugin-content-docs/current/examples/game-of-chance.md +++ b/i18n/zh-cn/docusaurus-plugin-content-docs/current/examples/game-of-chance.md @@ -7,7 +7,7 @@ sidebar_position: 9 ## 介绍 -任何人都可以轻松创建自己的游戏应用程序,并在 Gear Network 上运行它。为了做到这一点,Gear 创建了一个 Game-of-chance 智能合约的例子,可以在[GitHub](https://github.com/gear-dapps/game-of-chance)上找到。 +任何人都可以轻松创建自己的游戏应用程序,并在 Gear Network 上运行它。为了做到这一点,Gear 创建了一个 Game-of-chance 智能合约的例子,可以在[GitHub](https://github.com/gear-foundation/dapps-game-of-chance)上找到。 本文会介绍接口、数据结构、基本功能及其用途。你可以按直接使用,也可以根据自己的场景进行修改。 @@ -223,7 +223,7 @@ extern "C" fn meta_state() -> *mut [i32; 2] { ## 用户界面 -一个[即用型应用](https://lottery.gear-tech.io/)的例子提供了一个用户界面,与在 Gear Network 中运行的[游戏](https://github.com/gear-dapps/game-of-chance)智能合约进行互动。 +一个[即用型应用](https://lottery.gear-tech.io/)的例子提供了一个用户界面,与在 Gear Network 中运行的[游戏](https://github.com/gear-foundation/dapps-game-of-chance)智能合约进行互动。 本视频演示了如何配置和运行 Dapp,并介绍了用户交互流程:**https://youtu.be/35StUMjbdFc** @@ -261,14 +261,14 @@ npm start ## 总结 -本合约源代码可以在 GitHub 找到:[`game-of-chance/src/lib.rs`](https://github.com/gear-dapps/game-of-chance/blob/master/src/lib.rs)。 +本合约源代码可以在 GitHub 找到:[`game-of-chance/src/lib.rs`](https://github.com/gear-foundation/dapps-game-of-chance/blob/master/src/lib.rs)。 本合约的测试代码基于 gtest: -- [`simple_tests.rs`](https://github.com/gear-dapps/game-of-chance/blob/master/src/simple_tests.rs) +- [`simple_tests.rs`](https://github.com/gear-foundation/dapps-game-of-chance/blob/master/src/simple_tests.rs) -- [`panic_tests.rs`](https://github.com/gear-dapps/game-of-chance/blob/master/src/panic_tests.rs) +- [`panic_tests.rs`](https://github.com/gear-foundation/dapps-game-of-chance/blob/master/src/panic_tests.rs) -- [`token_tests.rs`](https://github.com/gear-dapps/game-of-chance/blob/master/src/token_tests.rs) +- [`token_tests.rs`](https://github.com/gear-foundation/dapps-game-of-chance/blob/master/src/token_tests.rs) 更多关于在 Gear 上测试智能合约的细节,请参考这篇文章:[应用测试](https://wiki.gear-tech.io/zh-cn/developing-contracts/testing/)。 diff --git a/i18n/zh-cn/docusaurus-plugin-content-docs/current/examples/gft-20.md b/i18n/zh-cn/docusaurus-plugin-content-docs/current/examples/gft-20.md index e98bee720..ca69eb538 100644 --- a/i18n/zh-cn/docusaurus-plugin-content-docs/current/examples/gft-20.md +++ b/i18n/zh-cn/docusaurus-plugin-content-docs/current/examples/gft-20.md @@ -128,8 +128,8 @@ pub struct TransferInput { ## 总结 -由 Gear 提供的智能合约源码在 Github 上可以找到:[fungible-token/src/lib.rs](https://github.com/gear-dapps/fungible-token/blob/master/src/lib.rs)。 +由 Gear 提供的智能合约源码在 Github 上可以找到:[fungible-token/src/lib.rs](https://github.com/gear-foundation/dapps-fungible-token/blob/master/src/lib.rs)。 -同样可以找到基于 `gtest` 实现的智能合约测试范例:[fungible-token/src/tests.rs](https://github.com/gear-dapps/fungible-token/blob/master/src/tests.rs)。 +同样可以找到基于 `gtest` 实现的智能合约测试范例:[fungible-token/src/tests.rs](https://github.com/gear-foundation/dapps-fungible-token/blob/master/src/tests.rs)。 -更多关于在 Gear 上测试智能合约的细节,请参考这篇文章:[程序测试](/developing-contracts/testing.md) 。 \ No newline at end of file +更多关于在 Gear 上测试智能合约的细节,请参考这篇文章:[程序测试](/developing-contracts/testing.md) 。 diff --git a/i18n/zh-cn/docusaurus-plugin-content-docs/current/examples/gmt-1155.md b/i18n/zh-cn/docusaurus-plugin-content-docs/current/examples/gmt-1155.md index 6c65bad47..ce6f96c35 100644 --- a/i18n/zh-cn/docusaurus-plugin-content-docs/current/examples/gmt-1155.md +++ b/i18n/zh-cn/docusaurus-plugin-content-docs/current/examples/gmt-1155.md @@ -11,7 +11,7 @@ sidebar_position: 5 这个想法很简单,可以创建一个智能合约接口,就可以代表和控制任何数量的同质化和非同质化的代币类型。这样一来,gMT 代币可以具有与 GFT 和 GNFT 代币相同的功能,甚至可以同时兼容两者。gMT 与 ERC-1155 是相似的。 -介绍了合约接口、数据结构、基本功能并解释了它们的用途。它可以按原样使用,也可以根据自己的情况进行修改。源代码可在[GitHub](https://github.com/gear-dapps/multitoken) 查看。 +介绍了合约接口、数据结构、基本功能并解释了它们的用途。它可以按原样使用,也可以根据自己的情况进行修改。源代码可在[GitHub](https://github.com/gear-foundation/dapps-multitoken) 查看。 ## 默认 multitoken 实现 @@ -27,13 +27,13 @@ sidebar_position: 5 - *balance(account)* - 是返回用户拥有的不同代币的 ID 和数量的函数; -gMT 合约的实现为 [gear-lib/multitoken](https://github.com/gear-dapps/gear-lib/tree/master/src/multitoken)。 +gMT 合约的实现为 [gear-lib/multitoken](https://github.com/gear-foundation/dapps-gear-lib/tree/master/src/multitoken)。 要使用默认实现需要在 *Cargo.toml* 配置: ```toml -gear-contract-libraries = { path = "https://github.com/gear-dapps/gear-lib" } -derive_traits = { path = "https://github.com/gear-dapps/gear-lib/tree/master/derive" } +gear-contract-libraries = { path = "https://github.com/gear-foundation/dapps-gear-lib" } +derive_traits = { path = "https://github.com/gear-foundation/dapps-gear-lib/tree/master/derive" } hashbrown = "0.13.1" ``` @@ -412,10 +412,10 @@ impl SimpleMTKCore for SimpleMTK { Gear 为 gMT 协议的核心功能提供了一个可重复使用的库。通过使用对象组合,该库可以在自定义的 gMT/MTK 合约实现中使用,减少可重复代码。 -由 Gear 提供的智能合约源码在 Github 上可以找到:[`gear-lib/src/multitoken`](https://github.com/gear-dapps/gear-lib/tree/master/src/multitoken)。 +由 Gear 提供的智能合约源码在 Github 上可以找到:[`gear-lib/src/multitoken`](https://github.com/gear-foundation/dapps-gear-lib/tree/master/src/multitoken)。 -关于 multitoken 源码在的 Github 上可以找到:[`multitoken/src`](https://github.com/gear-dapps/multitoken/tree/master/src)。 +关于 multitoken 源码在的 Github 上可以找到:[`multitoken/src`](https://github.com/gear-foundation/dapps-multitoken/tree/master/src)。 -同样可以找到基于 gtest 实现的智能合约测试范例:[`multitoken/tests`](https://github.com/gear-dapps/multitoken/tree/master/tests)。 +同样可以找到基于 gtest 实现的智能合约测试范例:[`multitoken/tests`](https://github.com/gear-foundation/dapps-multitoken/tree/master/tests)。 更多关于在 Gear 上测试智能合约的细节,请参考这篇文章:[程序测试](https://wiki.gear-tech.io/zh-cn/developing-contracts/testing/)。 diff --git a/i18n/zh-cn/docusaurus-plugin-content-docs/current/examples/gnft-721.md b/i18n/zh-cn/docusaurus-plugin-content-docs/current/examples/gnft-721.md index acf489341..65d937e59 100644 --- a/i18n/zh-cn/docusaurus-plugin-content-docs/current/examples/gnft-721.md +++ b/i18n/zh-cn/docusaurus-plugin-content-docs/current/examples/gnft-721.md @@ -23,13 +23,13 @@ sidebar_position: 4 - *burn(from, token_id)* - 是一个函数,用于从合约中删除带有 *token_id* 的代币。 -NFT 合约的实现为[gear-contract-libraries/non_fungible_token](https://github.com/gear-dapps/gear-lib/tree/master/src/non_fungible_token)。 +NFT 合约的实现为[gear-contract-libraries/non_fungible_token](https://github.com/gear-foundation/dapps-gear-lib/tree/master/src/non_fungible_token)。 要使用默认实现需要在 *Cargo.toml* 配置: ```toml -gear-lib = { git = "https://github.com/gear-dapps/gear-lib.git" } -gear-lib-derive = { git = "https://github.com/gear-dapps/gear-lib.git" } +gear-lib = { git = "https://github.com/gear-foundation/dapps-gear-lib.git" } +gear-lib-derive = { git = "https://github.com/gear-foundation/dapps-gear-lib.git" } hashbrown = "0.13.1" ``` @@ -201,10 +201,10 @@ extern "C" fn handle() { ## 总结 -Gear 提供了一个可重复使用的[库](https://github.com/gear-dapps/non-fungible-token/tree/master/non-fungible-token/src),具有 gNFT 协议的核心功能。通过使用对象组合,该库可以在自定义的 NFT 合约实现中使用,以减少重复代码。 +Gear 提供了一个可重复使用的[库](https://github.com/gear-foundation/dapps-non-fungible-token/tree/master/non-fungible-token/src),具有 gNFT 协议的核心功能。通过使用对象组合,该库可以在自定义的 NFT 合约实现中使用,以减少重复代码。 -Gear 提供的合约实例的源代码可在 GitHub 上找到 [nft-example/src](https://github.com/gear-dapps/non-fungible-token/tree/master/nft-example/src)。 +Gear 提供的合约实例的源代码可在 GitHub 上找到 [nft-example/src](https://github.com/gear-foundation/dapps-non-fungible-token/tree/master/nft-example/src)。 -也请看基于 `gtest` 的智能合约测试实现的例子:[nft-example/tests](https://github.com/gear-dapps/non-fungible-token/tree/master/nft-example/tests)。 +也请看基于 `gtest` 的智能合约测试实现的例子:[nft-example/tests](https://github.com/gear-foundation/dapps-non-fungible-token/tree/master/nft-example/tests)。 关于测试在 Gear 上编写的智能合约的更多细节,请参考这篇文章 [程序测试](/developing-contracts/testing.md)。 diff --git a/i18n/zh-cn/docusaurus-plugin-content-docs/current/examples/marketplace.md b/i18n/zh-cn/docusaurus-plugin-content-docs/current/examples/marketplace.md index 3fa56e7df..05aa04a33 100644 --- a/i18n/zh-cn/docusaurus-plugin-content-docs/current/examples/marketplace.md +++ b/i18n/zh-cn/docusaurus-plugin-content-docs/current/examples/marketplace.md @@ -10,8 +10,8 @@ sidebar_position: 14 NFT Marketplace 是一个合约,你可以用同质化代币交易非同质化代币。该合约还支持 NFT 拍卖,以及提供/接受 nft 的购买提议。 任何人都可以轻松创建自己的 NFT Marketplace 应用程序,并在 Gear 网络上运行它: -- [Gear NFT](https://github.com/gear-dapps/non-fungible-token/tree/master/nft). -- [NFT marketplace](https://github.com/gear-dapps/non-fungible-token/tree/master/nft-marketplace). +- [Gear NFT](https://github.com/gear-foundation/dapps-non-fungible-token/tree/master/nft). +- [NFT marketplace](https://github.com/gear-foundation/dapps-non-fungible-token/tree/master/nft-marketplace). 本文会介绍接口、数据结构、基本功能,并说明了它们的用途。它可以按原样使用,也可以根据您自己的场景进行修改。 @@ -293,7 +293,7 @@ Withdraw { ## 用户界面 -一个[即用型应用](https://marketplace.gear-tech.io/)的例子提供了一个用户界面,与在 Gear Network 中运行的[gNFT](ttps://github.com/gear-dapps/non-fungible-token/tree/master/nft)和[Marketplace](https://github.com/gear-dapps/non-fungible-token/tree/master/nft-marketplace)智能合约互动。 +一个[即用型应用](https://marketplace.gear-tech.io/)的例子提供了一个用户界面,与在 Gear Network 中运行的[gNFT](ttps://github.com/gear-foundation/dapps-non-fungible-token/tree/master/nft)和[Marketplace](https://github.com/gear-foundation/dapps-non-fungible-token/tree/master/nft-marketplace)智能合约互动。 - Gear Non-Fundible Token 合约可以创建 NFT 代币,证明数字资产的所有权,详情请查看[本文](/examples/gnft-721)。 - NFT Marketplace 是一个合约,你可以用同质化代币交易非同质化代币。该合约还支持 NFT 拍卖,以及提供/接受 nft 的购买提议。 @@ -346,7 +346,7 @@ npm start ## 源码 -合约源码在 [Gear-dapps](https://github.com/gear-dapps/non-fungible-token/tree/master/nft-marketplace)。 +合约源码在 [Gear-dapps](https://github.com/gear-foundation/dapps-non-fungible-token/tree/master/nft-marketplace)。 前端代码在 [Gear-tech/gear-js](https://github.com/gear-tech/gear-js/tree/master/apps/marketplace). diff --git a/i18n/zh-cn/docusaurus-plugin-content-docs/current/examples/monopoly.md b/i18n/zh-cn/docusaurus-plugin-content-docs/current/examples/monopoly.md index 740c5855b..a306e29fb 100644 --- a/i18n/zh-cn/docusaurus-plugin-content-docs/current/examples/monopoly.md +++ b/i18n/zh-cn/docusaurus-plugin-content-docs/current/examples/monopoly.md @@ -124,7 +124,7 @@ GameAction::StartRegistration ## 智能合约 ### Master 合约 -[Master 合约](https://github.com/gear-dapps/syndote/tree/master/syndote) 使用垄断卡信息(单元成本,特殊单元:监狱,彩票)进行初始化。正如已经提到的,它有足够的 gas 预留以以便自动游戏。在每个玩家的步骤之前,`Master` 合约会检查 gas 量,如果不够,它会向游戏管理员发送一条消息,请求再次预订 gas。 +[Master 合约](https://github.com/gear-foundation/dapps-syndote/tree/master/syndote) 使用垄断卡信息(单元成本,特殊单元:监狱,彩票)进行初始化。正如已经提到的,它有足够的 gas 预留以以便自动游戏。在每个玩家的步骤之前,`Master` 合约会检查 gas 量,如果不够,它会向游戏管理员发送一条消息,请求再次预订 gas。 **玩家注册**: @@ -157,7 +157,7 @@ struct PlayerInfo { **策略消息:** -[策略合约](https://github.com/gear-dapps/syndote/tree/master/player) 根据垄断场上的位置,发送策略信息。一个玩家可能处于以下位置之一: +[策略合约](https://github.com/gear-foundation/dapps-syndote/tree/master/player) 根据垄断场上的位置,发送策略信息。一个玩家可能处于以下位置之一: - 一个 cell 有自己的财产。一个玩家有一个权利: - 在单元格上添加一个齿轮。齿轮可以是 `青铜`、`银 `或 `金`; diff --git a/i18n/zh-cn/docusaurus-plugin-content-docs/current/examples/multisig-wallet.md b/i18n/zh-cn/docusaurus-plugin-content-docs/current/examples/multisig-wallet.md index 236b80e7e..5760bc94b 100644 --- a/i18n/zh-cn/docusaurus-plugin-content-docs/current/examples/multisig-wallet.md +++ b/i18n/zh-cn/docusaurus-plugin-content-docs/current/examples/multisig-wallet.md @@ -176,8 +176,8 @@ pub enum StateReply { ## 源码 -多签钱包的例子的源代码和其测试的实例源码在 [GitHub](https://github.com/gear-dapps/multisig-wallet)。 +多签钱包的例子的源代码和其测试的实例源码在 [GitHub](https://github.com/gear-foundation/dapps-multisig-wallet)。 -同样可以找到基于 `gtest` 实现的智能合约测试范例:[multisig-wallet/tests](https://github.com/gear-dapps/multisig-wallet/tree/master/tests)。 +同样可以找到基于 `gtest` 实现的智能合约测试范例:[multisig-wallet/tests](https://github.com/gear-foundation/dapps-multisig-wallet/tree/master/tests)。 更多关于在 Gear 上测试智能合约的细节,请参考这篇文章:[应用测试](/developing-contracts/testing)。 diff --git a/i18n/zh-cn/docusaurus-plugin-content-docs/current/examples/nft-pixelboard.md b/i18n/zh-cn/docusaurus-plugin-content-docs/current/examples/nft-pixelboard.md index c95f579df..ace54360e 100644 --- a/i18n/zh-cn/docusaurus-plugin-content-docs/current/examples/nft-pixelboard.md +++ b/i18n/zh-cn/docusaurus-plugin-content-docs/current/examples/nft-pixelboard.md @@ -247,6 +247,6 @@ pub enum NFTPixelboardStateQuery { ## 源码 -本合约代码实现已在 [GitHub](https://github.com/gear-dapps/nft-pixelboard)上开源。 +本合约代码实现已在 [GitHub](https://github.com/gear-foundation/dapps-nft-pixelboard)上开源。 更多关于在 Gear 上测试智能合约的细节,请参考这篇文章:[应用测试](https://wiki.gear-tech.io/zh-cn/developing-contracts/testing/)。 diff --git a/i18n/zh-cn/docusaurus-plugin-content-docs/current/examples/onchain-nft.md b/i18n/zh-cn/docusaurus-plugin-content-docs/current/examples/onchain-nft.md index 84ccf915c..b2a9b2aa3 100644 --- a/i18n/zh-cn/docusaurus-plugin-content-docs/current/examples/onchain-nft.md +++ b/i18n/zh-cn/docusaurus-plugin-content-docs/current/examples/onchain-nft.md @@ -13,7 +13,7 @@ NFT 智能合约的例子展示了当代币资产直接存储在链上的方法 但这里还介绍了另一种方法。你可以直接将 NFT 存储在链上,而不需要任何外部存储。这种方法可以帮助你在外部存储出现问题时不会丢失 NFT。 -本文介绍了合约接口、数据结构、基本功能并解释了它们的用途。它可以直接使用,也可以根据自己的情况进行修改。源代码可在[GitHub](https://github.com/gear-dapps/non-fungible-token/tree/master/on-chain-nft) 查看。 +本文介绍了合约接口、数据结构、基本功能并解释了它们的用途。它可以直接使用,也可以根据自己的情况进行修改。源代码可在[GitHub](https://github.com/gear-foundation/dapps-non-fungible-token/tree/master/on-chain-nft) 查看。 ## 方法 @@ -30,13 +30,13 @@ NFT 智能合约的例子展示了当代币资产直接存储在链上的方法 - *burn(from, token_id)* 用于从合同中移除带有所述*token_id*的令牌。 -NFT 合约的默认实现是在 Gear 库中提供的:[gear-lib/non_fungible_token](https://github.com/gear-dapps/gear-lib/tree/master/src/non_fungible_token)。 +NFT 合约的默认实现是在 Gear 库中提供的:[gear-lib/non_fungible_token](https://github.com/gear-foundation/dapps-gear-lib/tree/master/src/non_fungible_token)。 要使用默认的实现,请在 *Cargo.toml* 配置: ```toml -gear-lib = { git = "https://github.com/gear-dapps/gear-lib.git" } -gear-lib-derive = { git = "https://github.com/gear-dapps/gear-lib.git" } +gear-lib = { git = "https://github.com/gear-foundation/dapps-gear-lib.git" } +gear-lib-derive = { git = "https://github.com/gear-foundation/dapps-gear-lib.git" } hashbrown = "0.13.1" ``` @@ -261,10 +261,10 @@ extern "C" fn meta_state() -> *mut [i32; 2] { ## 总结 -Gear 为 gNFT 协议的核心功能提供了一个可重复使用的[库](https://github.com/gear-dapps/non-fungible-token/tree/master/nft/src)。通过使用对象组合,该库可以在自定义的 NFT 合约实现中使用,减少可重复代码。 +Gear 为 gNFT 协议的核心功能提供了一个可重复使用的[库](https://github.com/gear-foundation/dapps-non-fungible-token/tree/master/nft/src)。通过使用对象组合,该库可以在自定义的 NFT 合约实现中使用,减少可重复代码。 -本合约实现在 GitHub [on-chain-nft/src](https://github.com/gear-dapps/non-fungible-token/tree/master/on-chain-nft/src)上。 +本合约实现在 GitHub [on-chain-nft/src](https://github.com/gear-foundation/dapps-non-fungible-token/tree/master/on-chain-nft/src)上。 -同样可以找到基于 `gtest` 实现的智能合约测试范例:`gtest`: [on-chain-nft/tests](https://github.com/gear-dapps/non-fungible-token/tree/master/on-chain-nft/tests)。 +同样可以找到基于 `gtest` 实现的智能合约测试范例:`gtest`: [on-chain-nft/tests](https://github.com/gear-foundation/dapps-non-fungible-token/tree/master/on-chain-nft/tests)。 更多关于在 Gear 上测试智能合约的细节,请参考这篇文章:[应用测试](https://wiki.gear-tech.io/zh-cn/developing-contracts/testing/)。 diff --git a/i18n/zh-cn/docusaurus-plugin-content-docs/current/examples/ping.md b/i18n/zh-cn/docusaurus-plugin-content-docs/current/examples/ping.md index 4e1c2a2db..c0558767e 100644 --- a/i18n/zh-cn/docusaurus-plugin-content-docs/current/examples/ping.md +++ b/i18n/zh-cn/docusaurus-plugin-content-docs/current/examples/ping.md @@ -61,4 +61,4 @@ mod tests { 该程序只是将 `PONG` 发回向它发送 `PING`的原始发送者。 -GitHub 链接:https://github.com/gear-dapps/ping +GitHub 链接:https://github.com/gear-foundation/dapps-ping diff --git a/i18n/zh-cn/docusaurus-plugin-content-docs/current/examples/prerequisites.mdx b/i18n/zh-cn/docusaurus-plugin-content-docs/current/examples/prerequisites.mdx index f4fdf3dbd..e5093f102 100644 --- a/i18n/zh-cn/docusaurus-plugin-content-docs/current/examples/prerequisites.mdx +++ b/i18n/zh-cn/docusaurus-plugin-content-docs/current/examples/prerequisites.mdx @@ -45,7 +45,7 @@ cargo new gear-app --lib └── Cargo.toml // 合约配置文件 ``` -`Cargo.toml` 是 Rust 项目的 `manifest`,它包含了所有编译项目所需的元数据。按照 [examples/ping/Cargo.toml](https://github.com/gear-dapps/ping/blob/master/Cargo.toml) 来配置 `Cargo.toml`。你可以参考 [5 分钟入门教程](/getting-started-in-5-minutes.md) 了解更多细节。 +`Cargo.toml` 是 Rust 项目的 `manifest`,它包含了所有编译项目所需的元数据。按照 [examples/ping/Cargo.toml](https://github.com/gear-foundation/dapps-ping/blob/master/Cargo.toml) 来配置 `Cargo.toml`。你可以参考 [5 分钟入门教程](/getting-started-in-5-minutes.md) 了解更多细节。 ## 编译 Rust 合约 @@ -55,4 +55,4 @@ cargo new gear-app --lib RUSTFLAGS="-C link-args=--import-memory" cargo +nightly build --release --target=wasm32-unknown-unknown ``` -咱们的应用编译完成后,将生成最终文件 `target/wasm32-unknown-unknown/release/gear-app.wasm`。 \ No newline at end of file +咱们的应用编译完成后,将生成最终文件 `target/wasm32-unknown-unknown/release/gear-app.wasm`。 diff --git a/i18n/zh-cn/docusaurus-plugin-content-docs/current/examples/rmrk.md b/i18n/zh-cn/docusaurus-plugin-content-docs/current/examples/rmrk.md index 9ef39246e..0eda31d1f 100644 --- a/i18n/zh-cn/docusaurus-plugin-content-docs/current/examples/rmrk.md +++ b/i18n/zh-cn/docusaurus-plugin-content-docs/current/examples/rmrk.md @@ -16,7 +16,7 @@ RMRK legos 已经在 Gear 上实现: - 多资源 NFT: NFT 能够根据它被加载的环境而改变其输出。 -这篇文章解释了接口、数据结构、基本功能,并解释了它们的用途。源代码可在[GitHub](https://github.com/gear-dapps/RMRK)上找到。 +这篇文章解释了接口、数据结构、基本功能,并解释了它们的用途。源代码可在[GitHub](https://github.com/gear-foundation/dapps-RMRK)上找到。 ## 逻辑 ### 嵌套逻辑 @@ -561,6 +561,6 @@ SetPriority { ## 源码 -RMRK 的实现在 [GitHub](https://github.com/gear-dapps/RMRK)。 +RMRK 的实现在 [GitHub](https://github.com/gear-foundation/dapps-RMRK)。 更多关于在 Gear 上测试智能合约的细节,请参考这篇文章:[应用测试](https://wiki.gear-tech.io/zh-cn/developing-contracts/testing/)。 diff --git a/i18n/zh-cn/docusaurus-plugin-content-docs/current/examples/rock-paper-scissors.md b/i18n/zh-cn/docusaurus-plugin-content-docs/current/examples/rock-paper-scissors.md index b2f360f83..7b77b0165 100644 --- a/i18n/zh-cn/docusaurus-plugin-content-docs/current/examples/rock-paper-scissors.md +++ b/i18n/zh-cn/docusaurus-plugin-content-docs/current/examples/rock-paper-scissors.md @@ -13,7 +13,7 @@ sidebar_position: 19 一种流行的五种武器的扩展是“剪刀、石头、布、斯波克、蜥蜴”,由 Sam Kass 和 Karen Bryla 发明,在标准的三种选择中增加了“斯波克”和“蜥蜴”。“斯波克”的标志是《星际迷航》中的瓦肯礼节,而“蜥蜴”的标志是将手形成一个类似袜子木偶的嘴。斯波克砸碎了剪刀,蒸发了岩石;他被蜥蜴毒死了,被布证明了。蜥蜴毒死了斯波克,吃了布;它被石头压碎,被剪刀斩断。这个变体在 2005 年《伦敦时报》的一篇文章中被提及,后来成为 2008 年美国情景喜剧《生活大爆炸》一集的主题(作为岩石 - 剪刀 - 蜥蜴 - 斯波克)。 -任何人都可以轻松地创建自己的去中心化的游戏应用,并在 Gear 网络上运行。为此,我们做了一个“石头、剪刀、布、斯波克、蜥蜴”的游戏版本,供多个玩家使用,在几轮紧张的斗争中决定胜负。源代码可在 [GitHub](https://github.com/gear-dapps/rock-paper-scissors)上找到。这篇文章介绍了程序接口、数据结构、基本功能,并解释了它们的用途。你可以直接使用,也可以根据场景进行修改。 +任何人都可以轻松地创建自己的去中心化的游戏应用,并在 Gear 网络上运行。为此,我们做了一个“石头、剪刀、布、斯波克、蜥蜴”的游戏版本,供多个玩家使用,在几轮紧张的斗争中决定胜负。源代码可在 [GitHub](https://github.com/gear-foundation/dapps-rock-paper-scissors)上找到。这篇文章介绍了程序接口、数据结构、基本功能,并解释了它们的用途。你可以直接使用,也可以根据场景进行修改。 另:“石头、剪刀、布、斯波克、蜥蜴”在下文中简称为“新版猜拳游戏”。 @@ -172,6 +172,6 @@ pub enum StateReply { ## 源码 -“新版猜拳游戏”的源码在 [GitHub](https://github.com/gear-dapps/rock-paper-scissors)上。 +“新版猜拳游戏”的源码在 [GitHub](https://github.com/gear-foundation/dapps-rock-paper-scissors)上。 更多关于在 Gear 上测试智能合约的细节,请参考这篇文章:[应用测试](https://wiki.gear-tech.io/zh-cn/developing-contracts/testing/)。 diff --git a/i18n/zh-cn/docusaurus-plugin-content-docs/current/examples/staking.md b/i18n/zh-cn/docusaurus-plugin-content-docs/current/examples/staking.md index 542ec4435..c2bc922d1 100644 --- a/i18n/zh-cn/docusaurus-plugin-content-docs/current/examples/staking.md +++ b/i18n/zh-cn/docusaurus-plugin-content-docs/current/examples/staking.md @@ -10,7 +10,7 @@ sidebar_position: 17 Stacking 类似于银行存款,由于加密货币的简单存储而获得被动收益。 收入的百分比可能不同 —— 这完全取决于存款的期限。 -任何人都可以创建自己的 Staking 合约并在 Gear Network 上运行。Gear 创建了合约,在[GitHub](https://github.com/gear-dapps/staking)上查看。 +任何人都可以创建自己的 Staking 合约并在 Gear Network 上运行。Gear 创建了合约,在[GitHub](https://github.com/gear-foundation/dapps-staking)上查看。 本文解释了接口、数据结构、基本功能并解释了它们的用途。它可以直接使用或修改以适合自己的使用场景。 @@ -341,14 +341,14 @@ extern "C" fn meta_state() -> *mut [i32; 2] { ## 总结 -A source code of the contract example provided by Gear is available on GitHub: [`staking/src/lib.rs`](https://github.com/gear-dapps/staking/blob/master/src/lib.rs). +A source code of the contract example provided by Gear is available on GitHub: [`staking/src/lib.rs`](https://github.com/gear-foundation/dapps-staking/blob/master/src/lib.rs). -合约源码在 Github 上可以找到:[`staking/src/lib.rs`](https://github.com/gear-dapps/staking/blob/master/src/lib.rs)。 +合约源码在 Github 上可以找到:[`staking/src/lib.rs`](https://github.com/gear-foundation/dapps-staking/blob/master/src/lib.rs)。 本合约的测试代码基于 gtest: -- [`simple_test.rs`](https://github.com/gear-dapps/staking/blob/master/tests/simple_test.rs) +- [`simple_test.rs`](https://github.com/gear-foundation/dapps-staking/blob/master/tests/simple_test.rs) -- [`panic_test.rs`](https://github.com/gear-dapps/staking/blob/master/tests/panic_test.rs) +- [`panic_test.rs`](https://github.com/gear-foundation/dapps-staking/blob/master/tests/panic_test.rs) 更多关于在 Gear 上测试智能合约的细节,请参考这篇文章:[程序测试](/developing-contracts/testing.md) 。 diff --git a/i18n/zh-cn/docusaurus-plugin-content-docs/current/examples/supply-chain.md b/i18n/zh-cn/docusaurus-plugin-content-docs/current/examples/supply-chain.md index daf243581..5e3529323 100644 --- a/i18n/zh-cn/docusaurus-plugin-content-docs/current/examples/supply-chain.md +++ b/i18n/zh-cn/docusaurus-plugin-content-docs/current/examples/supply-chain.md @@ -326,6 +326,6 @@ enum SupplyChainEvent { ## 源码 -供应链的合约源代码可以在 [GitHub](https://github.com/gear-dapps/supply-chain) 找到。 +供应链的合约源代码可以在 [GitHub](https://github.com/gear-foundation/dapps-supply-chain) 找到。 更多关于在 Gear 的测试智能合约的细节,请参考这篇文章:[应用测试](https://wiki.gear-tech.io/zh-cn/developing-contracts/testing/)。 diff --git a/i18n/zh-cn/docusaurus-plugin-content-docs/current/getting-started-in-5-minutes.md b/i18n/zh-cn/docusaurus-plugin-content-docs/current/getting-started-in-5-minutes.md index eaa81f10a..31422c322 100644 --- a/i18n/zh-cn/docusaurus-plugin-content-docs/current/getting-started-in-5-minutes.md +++ b/i18n/zh-cn/docusaurus-plugin-content-docs/current/getting-started-in-5-minutes.md @@ -92,13 +92,13 @@ edition = "2021" license = "GPL-3.0" [dependencies] -gstd = { git = "https://github.com/gear-tech/gear.git", features = ["debug"], branch = "stable" } +gstd = { git = "https://github.com/gear-tech/gear.git", features = ["debug"], rev = "946ac47" } [build-dependencies] -gear-wasm-builder = { git = "https://github.com/gear-tech/gear.git", branch = "stable" } +gear-wasm-builder = { git = "https://github.com/gear-tech/gear.git", rev = "946ac47" } [dev-dependencies] -gtest = { git = "https://github.com/gear-tech/gear.git", branch = "stable" } +gtest = { git = "https://github.com/gear-tech/gear.git", rev = "946ac47" } ``` 5. 用我们的第一个智能合约的代码替换 `lib.rs`。在编辑器中打开 `src/lib.rs` 并粘贴以下代码: From 3f990163fc598e308c9ed0a42682bbfa46b9f6e3 Mon Sep 17 00:00:00 2001 From: Shamil <66209982+shamilsan@users.noreply.github.com> Date: Wed, 12 Jul 2023 11:44:00 +0300 Subject: [PATCH 2/6] chore: add reply deposit --- docs/developing-contracts/interactions-between-programs.md | 6 ++++-- docs/developing-contracts/system-signals.md | 3 ++- docs/examples/crowdsale.md | 1 + docs/examples/staking.md | 1 + .../developing-contracts/interactions-between-programs.md | 4 +++- .../current/examples/crowdsale.md | 1 + .../current/examples/staking.md | 1 + 7 files changed, 13 insertions(+), 4 deletions(-) diff --git a/docs/developing-contracts/interactions-between-programs.md b/docs/developing-contracts/interactions-between-programs.md index 30ccef393..35ef91c46 100644 --- a/docs/developing-contracts/interactions-between-programs.md +++ b/docs/developing-contracts/interactions-between-programs.md @@ -42,12 +42,14 @@ async fn main() { To send a message to a Gear program, use the `send_for_reply(program, payload, value)` function. In this function: - program - the address of the program to send the message for; - payload - the message to the program; -- value - the funds attached to the message. +- value - the funds attached to the message; +- reply_deposit - used to provide gas for future reply handling (skipped if zero). ```rust pub fn send_for_reply_as( program: ActorId, payload: E, - value: u128 + value: u128, + reply_deposit: u64 ) -> Result> ``` diff --git a/docs/developing-contracts/system-signals.md b/docs/developing-contracts/system-signals.md index 121b6e817..4db971aa2 100644 --- a/docs/developing-contracts/system-signals.md +++ b/docs/developing-contracts/system-signals.md @@ -26,9 +26,10 @@ If gas has been reserved but no system messages occur during the current executi It can be useful for a developer when writing communication between programs. Developer can define `my_handle_signal` function and implement some logic there. For example, `Program A` sent a message to `Program B`. `Program A` is waiting for a reply from `Program B` but `Program B` runs out of gas. The current execution will be interrupted, but the system will send a signal to `Program A` and indicates the message identifier during which the execution was interrupted. So, `Program A` sends a message and saves the message identifier: + ```rust exec::system_reserve_gas(2_000_000_000).expect("Error during system gas reservation"); -let result = msg::send_for_reply(address, payload, value); +let result = msg::send_for_reply(address, payload, value, reply_deposit); let (msg_id, msg_future) = if let Ok(msg_future) = result { (msg_future.waiting_reply_to, msg_future) diff --git a/docs/examples/crowdsale.md b/docs/examples/crowdsale.md index 029c61244..a4231d933 100644 --- a/docs/examples/crowdsale.md +++ b/docs/examples/crowdsale.md @@ -39,6 +39,7 @@ let _transfer_response = msg::send_for_reply_as::( program: ActorId, payload: E, - value: u128 + value: u128, + reply_deposit: u64 ) -> Result> ``` diff --git a/i18n/zh-cn/docusaurus-plugin-content-docs/current/examples/crowdsale.md b/i18n/zh-cn/docusaurus-plugin-content-docs/current/examples/crowdsale.md index 20600e5e8..f6e475871 100644 --- a/i18n/zh-cn/docusaurus-plugin-content-docs/current/examples/crowdsale.md +++ b/i18n/zh-cn/docusaurus-plugin-content-docs/current/examples/crowdsale.md @@ -45,6 +45,7 @@ let _transfer_response = msg::send_for_reply_as:: Date: Wed, 12 Jul 2023 12:14:48 +0300 Subject: [PATCH 3/6] chore: minor fixes --- docs/developing-contracts/metadata.md | 6 ++--- docs/examples/DAO.md | 3 +-- docs/examples/nft-marketplace/marketplace.md | 26 ++++++++++++++----- .../current/developing-contracts/metadata.md | 2 +- 4 files changed, 24 insertions(+), 13 deletions(-) diff --git a/docs/developing-contracts/metadata.md b/docs/developing-contracts/metadata.md index 128699495..6f3f44e0c 100644 --- a/docs/developing-contracts/metadata.md +++ b/docs/developing-contracts/metadata.md @@ -24,7 +24,7 @@ impl Metadata for ProgramMetadata { type Init = InOut; type Handle = InOut; type Others = InOut>; - type Reply = InOut>; + type Reply = String; type Signal = (); type State = Vec; } @@ -34,8 +34,8 @@ As we can see, metadata enables you to determine the expected data at the input/ - `Init` - describes incoming/outgoing types for `init()` function. - `Handle` - describes incoming/outgoing types for `handle()` function. -- `Others` - describes incoming/outgoing types for `main()` function in case of asyncronius interaction. -- `Reply` - describes incoming/outgoing types of message performed using the `handle_reply` function. +- `Others` - describes incoming/outgoing types for `main()` function in case of asyncronous interaction. +- `Reply` - describes an incoming type of message performed using the `handle_reply` function. - `Signal` - describes only the outgoing type from the program while processing the system signal. - `State` - describes the types for the queried State diff --git a/docs/examples/DAO.md b/docs/examples/DAO.md index a2f9efa23..f59eb7d42 100644 --- a/docs/examples/DAO.md +++ b/docs/examples/DAO.md @@ -80,8 +80,7 @@ where: `transactions` - the transaction history. -Parameters `approved_token_program_id`, `period_duration`, `grace_period_length` are set when initializing a contract. The contract is initialized -with the following struct: +Parameters `approved_token_program_id`, `period_duration`, `grace_period_length` are set when initializing a contract. The contract is initialized with the following struct: ```rust struct InitDao { diff --git a/docs/examples/nft-marketplace/marketplace.md b/docs/examples/nft-marketplace/marketplace.md index 94c196b32..146d64d18 100644 --- a/docs/examples/nft-marketplace/marketplace.md +++ b/docs/examples/nft-marketplace/marketplace.md @@ -119,13 +119,13 @@ pub struct Market { ``` - `admin_id` - an account who has the right to approve non-fungible-token and fungible-tokens contracts that can be used in the marketplace contract; - `treasury_id` - an account to which sales commission will be credited; -- `treasury_fee` - -commission percentage (from 1 to 5 percent) +- `treasury_fee` - commission percentage (from 1 to 5 percent) + The marketplace contract is initialized with the following fields; + - `items` - listed NFTs; - `approved_nft_contracts` - NFT contracts accounts that can be listed on the marketplace; -- `approved_ft_contracts` - -fungible token accounts for which it is possible to buy marketplace items; +- `approved_ft_contracts` - fungible token accounts for which it is possible to buy marketplace items; - `tx_id` - the id for tracking transactions in the fungible and non-fungible contracts (See the description of [fungible token](/examples/gft-20.md) and [non-fungible token](/examples/gnft-721.md)). @@ -177,8 +177,11 @@ pub enum MarketTx { }, } ``` + ### Listing NFTs, changing the price or stopping the sale. + To list NFT on the marketplace or modify the terms of sale send the following message: + ```rust /// Adds data on market item. /// If the item of that NFT does not exist on the marketplace then it will be listed. @@ -202,6 +205,7 @@ AddMarketData { } ``` ### NFT purchase. + To buy NFT send the following message: ```rust @@ -270,7 +274,7 @@ CreateAuction { }, ``` -To add bid to the current auction send the following message: +To add a bid to the current auction send the following message: ```rust /// Adds a bid to an ongoing auction. /// @@ -292,7 +296,8 @@ AddBid { }, ``` -If auction period is over then anyone can send message `SettleAuction` that will send the NFT to the winner and pay to the owner: +If the auction period is over then anyone can send a message `SettleAuction` that will send the NFT to the winner and pay to the owner: + ```rust /// Settles the auction. /// @@ -310,7 +315,9 @@ SettleAuction { ``` ### Offers. -To make offer on the marketplace item send the following message: + +To make an offer on the marketplace item send the following message: + ```rust /// Adds a price offer to the item. /// @@ -334,7 +341,9 @@ AddOffer { price: u128, }, ``` + The item owner can accept the offer: + ```rust /// Accepts an offer. /// @@ -356,6 +365,7 @@ AcceptOffer { price: Price, } ``` + The user who made the offer can also withdraw his tokens: ```rust @@ -383,6 +393,7 @@ Withdraw { The `market` contract interacts with `fungible` and `non-fungible` token contracts. Each transaction that changes the states of several contracts is stored in the state until it is completed. Every time a user interacts with an item, the marketplace contract checks for an pending transaction and, if there is one, asks the user to complete it, not allowing to start a new one. The idempotency of the token contracts allows to restart a transaction without duplicate changes which guarantees the state consistency of 3 contracts. ## Program metadata and state + Metadata interface description: ```rust @@ -397,6 +408,7 @@ impl Metadata for MarketMetadata { type State = Market; } ``` + To display the full contract state information, the `state()` function is used: ```rust diff --git a/i18n/zh-cn/docusaurus-plugin-content-docs/current/developing-contracts/metadata.md b/i18n/zh-cn/docusaurus-plugin-content-docs/current/developing-contracts/metadata.md index 928432ecb..eaa0bc071 100644 --- a/i18n/zh-cn/docusaurus-plugin-content-docs/current/developing-contracts/metadata.md +++ b/i18n/zh-cn/docusaurus-plugin-content-docs/current/developing-contracts/metadata.md @@ -24,7 +24,7 @@ impl Metadata for ProgramMetadata { type Init = InOut; type Handle = InOut; type Others = InOut>; - type Reply = InOut>; + type Reply = String; type Signal = (); type State = Vec; } From fd4a5d0cacab0af28ecc6eca8aba5fe847c4c940 Mon Sep 17 00:00:00 2001 From: Shamil <66209982+shamilsan@users.noreply.github.com> Date: Wed, 12 Jul 2023 12:16:27 +0300 Subject: [PATCH 4/6] chore: remove metahash --- docs/developing-contracts/metadata.md | 14 -------------- docs/examples/ping.md | 8 -------- .../current/developing-contracts/metadata.md | 14 -------------- 3 files changed, 36 deletions(-) diff --git a/docs/developing-contracts/metadata.md b/docs/developing-contracts/metadata.md index 6f3f44e0c..e242eba1d 100644 --- a/docs/developing-contracts/metadata.md +++ b/docs/developing-contracts/metadata.md @@ -59,17 +59,3 @@ As a result of the smart-contract compilation, a `meta.txt` file will be generat ``` 01000000000103000000010500000001090000000102000000010d000000010f0000000111000000000112000000a9094c00083064656d6f5f6d6574615f696f344d657373616765496e6974496e0000080118616d6f756e74040108753800012063757272656e6379080118537472696e6700000400000503000800000502000c083064656d6f5f6d6574615f696f384d657373616765496e69744f7574000008013465786368616e67655f72617465100138526573756c743c75382c2075383e00010c73756d04010875380000100418526573756c740804540104044501040108084f6b040004000000000c457272040004000001000014083064656d6f5f6d6574615f696f244d657373616765496e000004010869641801084964000018083064656d6f5f6d6574615f696f084964000008011c646563696d616c1c010c75363400010c68657820011c5665633c75383e00001c000005060020000002040024083064656d6f5f6d6574615f696f284d6573736167654f7574000004010c7265732801384f7074696f6e3c57616c6c65743e00002804184f7074696f6e040454012c0108104e6f6e6500000010536f6d6504002c00000100002c083064656d6f5f6d6574615f696f1857616c6c6574000008010869641801084964000118706572736f6e300118506572736f6e000030083064656d6f5f6d6574615f696f18506572736f6e000008011c7375726e616d65080118537472696e670001106e616d65080118537472696e6700003400000238003800000504003c083064656d6f5f6d6574615f696f384d6573736167654173796e63496e0000040114656d707479400108282900004000000400004404184f7074696f6e04045401040108104e6f6e6500000010536f6d650400040000010000480000022c00 ``` - -## Verify metadata - -To make it possible to verify metadata for a program, you can use the `metahash()` function. It allows verifying metadata on-chain. - -```rust -#[no_mangle] -// It returns the Hash of metadata. -// .metahash is generating automatically while you are using build.rs -extern "C" fn metahash() { - let metahash: [u8; 32] = include!("../.metahash"); - msg::reply(metahash, 0).expect("Failed to share metahash"); -} -``` diff --git a/docs/examples/ping.md b/docs/examples/ping.md index e30428a19..7330faa1e 100644 --- a/docs/examples/ping.md +++ b/docs/examples/ping.md @@ -76,14 +76,6 @@ extern "C" fn state() { ); } ``` -- `metahash()` function that returns the metadata hash: -```rust -#[no_mangle] -extern "C" fn metahash() { - reply(include!("../.metahash")) - .expect("Failed to encode or reply with `[u8; 32]` from `metahash()`"); -} -``` The `lib.rs` file in the `src` directory contains the following code: ``` diff --git a/i18n/zh-cn/docusaurus-plugin-content-docs/current/developing-contracts/metadata.md b/i18n/zh-cn/docusaurus-plugin-content-docs/current/developing-contracts/metadata.md index eaa0bc071..9083f0540 100644 --- a/i18n/zh-cn/docusaurus-plugin-content-docs/current/developing-contracts/metadata.md +++ b/i18n/zh-cn/docusaurus-plugin-content-docs/current/developing-contracts/metadata.md @@ -60,17 +60,3 @@ fn main() { ``` 01000000000103000000010500000001090000000102000000010d000000010f0000000111000000000112000000a9094c00083064656d6f5f6d6574615f696f344d657373616765496e6974496e0000080118616d6f756e74040108753800012063757272656e6379080118537472696e6700000400000503000800000502000c083064656d6f5f6d6574615f696f384d657373616765496e69744f7574000008013465786368616e67655f72617465100138526573756c743c75382c2075383e00010c73756d04010875380000100418526573756c740804540104044501040108084f6b040004000000000c457272040004000001000014083064656d6f5f6d6574615f696f244d657373616765496e000004010869641801084964000018083064656d6f5f6d6574615f696f084964000008011c646563696d616c1c010c75363400010c68657820011c5665633c75383e00001c000005060020000002040024083064656d6f5f6d6574615f696f284d6573736167654f7574000004010c7265732801384f7074696f6e3c57616c6c65743e00002804184f7074696f6e040454012c0108104e6f6e6500000010536f6d6504002c00000100002c083064656d6f5f6d6574615f696f1857616c6c6574000008010869641801084964000118706572736f6e300118506572736f6e000030083064656d6f5f6d6574615f696f18506572736f6e000008011c7375726e616d65080118537472696e670001106e616d65080118537472696e6700003400000238003800000504003c083064656d6f5f6d6574615f696f384d6573736167654173796e63496e0000040114656d707479400108282900004000000400004404184f7074696f6e04045401040108104e6f6e6500000010536f6d650400040000010000480000022c00 ``` - -## 验证元数据 - -为了验证程序的元数据,可以使用`metahash()`函数。它允许在链上验证元数据。 - -```rust -#[no_mangle] -// It returns the Hash of metadata. -// .metahash is generating automatically while you are using build.rs -extern "C" fn metahash() { - let metahash: [u8; 32] = include!("../.metahash"); - msg::reply(metahash, 0).expect("Failed to share metahash"); -} -``` From 15f6bcf23037d26d51bf665c02fa6ddb6e53dbcc Mon Sep 17 00:00:00 2001 From: Shamil <66209982+shamilsan@users.noreply.github.com> Date: Wed, 12 Jul 2023 12:31:05 +0300 Subject: [PATCH 5/6] chore: fix typo --- docs/developing-contracts/metadata.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/developing-contracts/metadata.md b/docs/developing-contracts/metadata.md index e242eba1d..9388e49c7 100644 --- a/docs/developing-contracts/metadata.md +++ b/docs/developing-contracts/metadata.md @@ -34,7 +34,7 @@ As we can see, metadata enables you to determine the expected data at the input/ - `Init` - describes incoming/outgoing types for `init()` function. - `Handle` - describes incoming/outgoing types for `handle()` function. -- `Others` - describes incoming/outgoing types for `main()` function in case of asyncronous interaction. +- `Others` - describes incoming/outgoing types for `main()` function in case of asynchronous interaction. - `Reply` - describes an incoming type of message performed using the `handle_reply` function. - `Signal` - describes only the outgoing type from the program while processing the system signal. - `State` - describes the types for the queried State From df18be7307807e86b5c5d319d7922d6a5765aa05 Mon Sep 17 00:00:00 2001 From: Shamil <66209982+shamilsan@users.noreply.github.com> Date: Wed, 12 Jul 2023 12:36:36 +0300 Subject: [PATCH 6/6] chore: minor fixes --- docs/examples/nft-marketplace/marketplace.md | 9 +++------ docs/examples/prerequisites.mdx | 8 ++++---- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/docs/examples/nft-marketplace/marketplace.md b/docs/examples/nft-marketplace/marketplace.md index 146d64d18..d064e9ff4 100644 --- a/docs/examples/nft-marketplace/marketplace.md +++ b/docs/examples/nft-marketplace/marketplace.md @@ -142,12 +142,9 @@ pub struct Item { ``` - `owner` - an item owner; - `ft_contract_id` - a contract of fungible tokens for which that item can be bought. If that field is `None` then the item is on sale for native Gear value; -- `price` - -the item price. `None` field means that the item is not on the sale; -- `auction` - -a field containing information on the current auction. `None` field means that there is no current auction on the item; -- `offers` - -purchase offers made on that item; +- `price` - the item price. `None` field means that the item is not on the sale; +- `auction` - a field containing information on the current auction. `None` field means that there is no current auction on the item; +- `offers` - purchase offers made on that item; - `tx` - a pending transaction on the item. `None` means that there are no pending transactions. `MarketTx` is an enum of possible transactions that can occur with NFT: diff --git a/docs/examples/prerequisites.mdx b/docs/examples/prerequisites.mdx index d2615c048..6c75b4d38 100644 --- a/docs/examples/prerequisites.mdx +++ b/docs/examples/prerequisites.mdx @@ -167,14 +167,14 @@ Our application should compile successfully and the final file `target/wasm32-un You can use a pre-configured Docker image to build and test your smart contract. The image contains all the necessary tools and dependencies for building and running smart contracts and JS applications. -The source code of the image is available on [GitHub](https://github.com/gear-foundation/dapps-gear-env). +The source code of the image is available on [GitHub](https://github.com/gear-foundation/gear-env). To use the image, you need to install Docker on your machine. You can find the installation instructions for your OS on the [Docker website](https://docs.docker.com/get-docker/). After installing Docker, you can pull the image from the Docker Hub: ```bash -docker pull ghcr.io/gear-foundation/dapps-gear-env:stable +docker pull ghcr.io/gear-foundation/gear-env:stable ``` To run the image, use the following command: @@ -184,14 +184,14 @@ To run the image, use the following command: ```bash -docker run --rm --name gear-env -itd ghcr.io/gear-foundation/dapps-gear-env:stable bash +docker run --rm --name gear-env -itd ghcr.io/gear-foundation/gear-env:stable bash ``` ```bash -docker run --rm --name gear-env --platform linux/amd64 -itd ghcr.io/gear-foundation/dapps-gear-env:stable bash +docker run --rm --name gear-env --platform linux/amd64 -itd ghcr.io/gear-foundation/gear-env:stable bash ```