Skip to content

Commit

Permalink
Upgrade vNFT (#131)
Browse files Browse the repository at this point in the history
  • Loading branch information
MedovTimur authored Aug 22, 2024
1 parent eb0c649 commit 2512fca
Show file tree
Hide file tree
Showing 11 changed files with 307 additions and 436 deletions.
2 changes: 1 addition & 1 deletion deprecated_dapps/supply-chain.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ yarn start

## Logic

* Each newly produced item gets the NFT (in Gear's context - [Vara non-fungible token (VNFT)](/docs/examples/Standards/gnft-721.md) and its ID equals an ID of the item. Then, as an item moves along a supply chain, an item's NFT transfers between a supply chain program, item's producer, and future distributor, retailer and end consumer.
* Each newly produced item gets the NFT in Gear's context - [Vara non-fungible token (VNFT)](/docs/examples/Standards/vnft.md) and its ID equals an ID of the item. Then, as an item moves along a supply chain, an item's NFT transfers between a supply chain program, item's producer, and future distributor, retailer and end consumer.
* Anyone who knows an item's ID can get item info.
* Sale, purchase, delivery is made in [Vara fungible tokens (VFT)](/docs/examples/Standards/vft.md).

Expand Down
2 changes: 1 addition & 1 deletion docs/api/api.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,4 @@ async function connect() {
connect().catch(console.error);
```

Refer to the [NFT Marketplace example](/docs/examples/NFTs/nft-marketplace/nft-application) for a demonstration of creating a React application that connects to an [NFT smart contract](/docs/examples/Standards/gnft-721) running on the blockchain.
Refer to the [NFT Marketplace example](/docs/examples/NFTs/nft-marketplace/nft-application) for a demonstration of creating a React application that connects to an [NFT smart contract](/docs/examples/Standards/vnft) running on the blockchain.
2 changes: 1 addition & 1 deletion docs/api/tooling/react-hooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ sidebar_label: React-hooks

Hooks allow functional components to have access to programs running on Vara network and significantly simplify the development of front-end applications.

For example, [NFT Marketplace example](/examples/NFTs/nft-marketplace/nft-application.md) demonstrates the creation of a React application that connects to an [NFT smart contract](/examples/Standards/gnft-721.md) running on the blockchain.
For example, [NFT Marketplace example](/examples/NFTs/nft-marketplace/nft-application.md) demonstrates the creation of a React application that connects to an [NFT smart contract](/examples/Standards/vnft.md) running on the blockchain.

## Installation

Expand Down
4 changes: 2 additions & 2 deletions docs/examples/DeFi/dutch-auction.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ sidebar_position: 3

A Dutch auction is one of several types of auctions for buying or selling goods. Most commonly, it refers to an auction in which the auctioneer begins with a high asking price in the case of selling and gradually lowers it until some participant accepts the price or it reaches a predetermined reserve price. A Dutch auction has also been referred to as a clock auction or open-outcry descending-price auction. This type of auction demonstrates the advantage of speed since a sale never requires more than one bid.

The auction uses [Vara non-fungible tokens (VFT)](/docs/examples/Standards/gnft-721.md) as tradable goods.
The auction uses [Vara non-fungible tokens (VFT)](/docs/examples/Standards/vnft.md) as tradable goods.

This article explains the programming interface, data structure, basic functions, and their respective purposes. The program can be used as-is or modified to suit specific scenarios. Anyone can easily create an application and run it on the Gear Network. The source code is available on [GitHub](https://github.com/gear-foundation/dapps/tree/master/contracts/dutch-auction).

Expand Down Expand Up @@ -144,4 +144,4 @@ The source code for this example of a Dutch Auction program and an implementatio

See also an example of the program testing implementation based on `gtest`: [gear-foundation/dapps/dutch-auction/tests](https://github.com/gear-foundation/dapps/tree/master/contracts/dutch-auction/tests).

For more details about testing programs written on Vara, refer to the [Program Testing](/docs/build/testing) article.
For more details about testing programs written on Vara, refer to the [Program Testing](/docs/build/testing) article.
6 changes: 3 additions & 3 deletions docs/examples/NFTs/dynamic-nft.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ sidebar_position: 3
# Gear Dynamic Non-Fungible Token

### Introduction
This is an extension of standard [Non-Fungible token](/docs/examples/Standards/gnft-721.md). 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/tree/master/contracts/dynamic-nft).
This is an extension of standard [Non-Fungible token](/docs/examples/Standards/vnft.md). 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/tree/master/contracts/dynamic-nft).

### Motivation

Expand All @@ -25,7 +25,7 @@ gear-lib = { git = "https://github.com/gear-foundation/dapps.git" }
gear-lib-derive = { git = "https://github.com/gear-foundation/dapps.git" }
```

Dynamic NFT contains regular [NFT](/docs/examples/Standards/gnft-721.md) and additional field `dynamic_data`:
Dynamic NFT contains regular [NFT](/docs/examples/Standards/vnft.md) and additional field `dynamic_data`:

```rust title="dynamic-nft/src/lib.rs"
#[derive(Debug, Default, NFTStateKeeper, NFTCore, NFTMetaState)]
Expand All @@ -40,7 +40,7 @@ pub struct DynamicNft {
pub dynamic_data: Vec<u8>,
}
```
In all other cases, everything also corresponds to the usual [non-fungible-token](/docs/examples/Standards/gnft-721.md) contract, except additional specific actions:
In all other cases, everything also corresponds to the usual [non-fungible-token](/docs/examples/Standards/vnft.md) contract, except additional specific actions:

```rust title="dynamic-nft/io/src/lib.rs"
pub enum NFTAction {
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/NFTs/nft-marketplace/marketplace.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ The marketplace program 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;
- `tx_id` - the id for tracking transactions in the fungible and non-fungible contracts (See the description of [fungible token](/examples/Standards/vft.md) and [non-fungible token](/examples/Standards/gnft-721.md)).
- `tx_id` - the id for tracking transactions in the fungible and non-fungible contracts (See the description of [fungible token](/examples/Standards/vft.md) and [non-fungible token](/examples/Standards/vnft.md)).


The marketplace item has the following struct:
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/NFTs/nft-marketplace/nft-application.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ sidebar_position: 2

# NFT frontend application

This article explains how to create a `React` application and connect it to an [NFT smart contract](/docs/examples/Standards/gnft-721.md) running in the blockchain.
This article explains how to create a `React` application and connect it to an [NFT smart contract](/docs/examples/Standards/vnft.md) running in the blockchain.

### Preparation

Expand Down
2 changes: 1 addition & 1 deletion docs/examples/NFTs/onchain-nft.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ sidebar_position: 2

## Introduction

This example of an NFT smart contract shows a method where token assets are stored on the blockchain itself. To learn about a common implementation of gNFT smart contracts, refer to [gNFT-721](/docs/examples/Standards/gnft-721.md).
This example of an NFT smart contract shows a method where token assets are stored on the blockchain itself. To learn about a common implementation of gNFT smart contracts, refer to [vNFT-721](/docs/examples/Standards/vnft.md).

When a user wants to transfer ownership of a specific token ID to another user, confirming ownership and assigning the token to a new owner is straightforward. Usually, NFT images (or other essential resources) are stored elsewhere, like on IPFS, with only the metadata stored in the contract. The metadata includes a name, an ID, and links to external resources where the images are stored.

Expand Down
6 changes: 3 additions & 3 deletions docs/examples/Standards/gnft-4907.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ The Vara Rentable Non-fungible Token Standard is the analogue of ERC-4907 on Eth

### Introduction

This is an extension of the standard [Non-Fungible Token (NFT)](gnft-721). It introduces an additional role (user) that can be granted to addresses, along with a predefined expiration time for this role. The user role grants permission to "use" the NFT, but it does not allow the ability to transfer it or set other users. The source code of the smart contract example is available on [GitHub](https://github.com/gear-foundation/dapps/tree/master/contracts/rentable-nft).
This is an extension of the standard [Vara Non-Fungible Token (vNFT)](vnft). It introduces an additional role (user) that can be granted to addresses, along with a predefined expiration time for this role. The user role grants permission to "use" the NFT, but it does not allow the ability to transfer it or set other users. The source code of the smart contract example is available on [GitHub](https://github.com/gear-foundation/dapps/tree/master/contracts/rentable-nft).

### Motivation

Expand All @@ -31,7 +31,7 @@ To use the default implementation it is necessary to include the packages into t
gear-lib = { git = "https://github.com/gear-foundation/dapps", tag = "0.3.3" }
```

Rentable NFT contains regular NFT (gnft-721) and additional field `users_info`:
Rentable NFT contains regular NFT and additional field `users_info`:

```rust title="rentable-nft/src/lib.rs"
pub struct Contract {
Expand All @@ -45,7 +45,7 @@ pub struct Contract {
pub users_info: HashMap<TokenId, UserInfo>,
}
```
In all other cases, everything also corresponds to the usual [non-fungible-token](gnft-721) contract, except additional specific actions:
In all other cases, everything also corresponds to the usual [non-fungible-token](vnft) contract, except additional specific actions:

```rust title="rentable-nft/io/src/lib.rs"
pub enum NFTAction {
Expand Down
Loading

0 comments on commit 2512fca

Please sign in to comment.