diff --git a/docs/developing-contracts/standards/grc20.md b/docs/developing-contracts/standards/vft.md similarity index 79% rename from docs/developing-contracts/standards/grc20.md rename to docs/developing-contracts/standards/vft.md index eae61a6d2..b20dd14af 100644 --- a/docs/developing-contracts/standards/grc20.md +++ b/docs/developing-contracts/standards/vft.md @@ -1,13 +1,13 @@ --- -sidebar_label: GRC-20 +sidebar_label: VFT sidebar_position: 1 --- -# Gear Fungible Token Standard (GRC-20) +# Vara Fungible Token Standard (VFT) -The Gear Fungible Token Standard provides a unified API for smart contracts to implement token functionalities. It encompasses critical operations like token transfer and approvals for third-party spending on the blockchain. Below, we detail the contract state, its interface, and key methods to facilitate these operations. +The Vara Fungible Token Standard provides a unified API for smart contracts to implement token functionalities. It encompasses critical operations like token transfer and approvals for third-party spending on the blockchain. Below, we detail the contract state, its interface, and key methods to facilitate these operations. -An example implementation of the GRC-20 standard is available on [GitHub](https://github.com/gear-foundation/standards/tree/master/gear-erc20). +An example implementation of the VFT standard is available on [GitHub](https://github.com/gear-foundation/standards/tree/master/vft). ## Functions @@ -36,7 +36,7 @@ An example implementation of the GRC-20 standard is available on [GitHub](https: ### `Approve` ```rust -pub fn approve(&mut self, spender: sails_rtl::ActorId, value: U256) -> bool +pub fn approve(&mut self, spender: ActorId, value: U256) -> bool ``` This function allows a designated spender (`spender`) to withdraw up to an `value` of tokens from your account, multiple times up to the amount limit. Resets allowance to `value` with a subsequent call. Returns a boolean value indicating whether the operation succeeded. @@ -45,8 +45,8 @@ Upon successful execution, triggers the event: ```rust Approval { - owner: sails_rtl::ActorId, - spender: sails_rtl::ActorId, + owner: ActorId, + spender: ActorId, value: U256, } ``` @@ -54,7 +54,7 @@ Approval { ### `Transfer` ```rust -pub fn transfer(&mut self, to: sails_rtl::ActorId, value: U256) -> bool +pub fn transfer(&mut self, to: ActorId, value: U256) -> bool ``` @@ -64,8 +64,8 @@ Upon successful execution generates the event: ```rust Transfer { - from: sails_rtl::ActorId, - to: sails_rtl::ActorId, + from: ActorId, + to: ActorId, value: U256, } ``` @@ -73,7 +73,7 @@ Transfer { ### `TransferFrom` ```rust -pub fn transfer_from(&mut self, from: sails_rtl::ActorId, to: sails_rtl::ActorId, value: U256) -> bool +pub fn transfer_from(&mut self, from: ActorId, to: ActorId, value: U256) -> bool ``` Transfers a specified `value` of tokens `from` one account `to` another, using the allowance mechanism. Value is then deducted from the caller’s allowance. Returns a boolean value indicating whether the operation succeeded. @@ -81,8 +81,8 @@ Upon successful execution generates the event: ```rust Transfer { - from: sails_rtl::ActorId, - to: sails_rtl::ActorId, + from: ActorId, + to: ActorId, value: U256, } ``` @@ -126,7 +126,7 @@ pub fn total_supply(&self) -> U256 Returns the token balance of the `owner` address. ```rust -pub fn balance_of(&self, owner: sails_rtl::ActorId) -> U256 +pub fn balance_of(&self, account: ActorId) -> U256 ``` ### `allowance` @@ -134,7 +134,7 @@ pub fn balance_of(&self, owner: sails_rtl::ActorId) -> U256 Returns the number of tokens the `spender` account is authorized to spend on behalf of the `owner`. ```rust -pub fn allowance(&self, owner: sails_rtl::ActorId, spender: sails_rtl::ActorId) -> U256 +pub fn allowance(&self, owner: ActorId, spender: ActorId) -> U256 ``` ## Contract Interface @@ -146,12 +146,12 @@ constructor { New : (name: str, symbol: str, decimals: u8); }; -service Erc20 { +service Vft { Approve : (spender: actor_id, value: u256) -> bool; Transfer : (to: actor_id, value: u256) -> bool; TransferFrom : (from: actor_id, to: actor_id, value: u256) -> bool; query Allowance : (owner: actor_id, spender: actor_id) -> u256; - query BalanceOf : (owner: actor_id) -> u256; + query BalanceOf : (account: actor_id) -> u256; query Decimals : () -> u8; query Name : () -> str; query Symbol : () -> str; diff --git a/docs/examples/DeFi/crowdsale.md b/docs/examples/DeFi/crowdsale.md index 22d143f8d..1f5e85f26 100644 --- a/docs/examples/DeFi/crowdsale.md +++ b/docs/examples/DeFi/crowdsale.md @@ -11,7 +11,7 @@ A public offering to help build brand-new cryptocurrency or other digital assets The example of a crowdsale program implementation described in this article is just one of many decentralized applications that can be implemented and launched on Gear. This article explains the programming interface, data structure, basic functions and their purposes. You can use it as-is or modify it to suit your scenarios. Anyone can easily create their crowdsale application and run it on a Gear-powered network. -The initial resources used to acquire tokens are determined by the Gear fungible tokens contract - [gFT](../Standards/gft-20). The program's source code is available on [GitHub](https://github.com/gear-foundation/dapps/tree/master/contracts/crowdsale). +The initial resources used to acquire tokens are determined by the Vara fungible tokens contract - [VFT](../Standards/vft). The program's source code is available on [GitHub](https://github.com/gear-foundation/dapps/tree/master/contracts/crowdsale). ## Interface ### Source files diff --git a/docs/examples/DeFi/dex.md b/docs/examples/DeFi/dex.md index 2206a943c..b5752135c 100644 --- a/docs/examples/DeFi/dex.md +++ b/docs/examples/DeFi/dex.md @@ -14,7 +14,7 @@ While transactions on a centralized exchange are recorded in that exchange's int DEXs are usually built on open-source code, meaning that anyone interested can see exactly how they work. This also means that developers can adapt existing code to create new competing projects, which is how Uniswap's code has been adapted by a whole host of DEXs with "swap" in their names, such as Sushiswap and Pancakeswap. -The exchange uses [Gear fungible tokens (GFT-20)](../Standards/gft-20) underneath for the tokens and [Gear-lib FT wrapper](https://github.com/gear-foundation/dapps/tree/master/contracts/gear-lib-old/src/fungible_token) for the pair to keep track of the liquidity. +The exchange uses [Vara fungible tokens (VFT)](../Standards/vft) underneath for the tokens and [Gear-lib FT wrapper](https://github.com/gear-foundation/dapps/tree/master/contracts/gear-lib-old/src/fungible_token) for the pair to keep track of the liquidity. ### Math As it was said all the prices are algorithmically calculated. Investors provide funds to the liquidity pools and price is calculated according to the amount of tokens in the reserves using the following formula:

diff --git a/docs/examples/DeFi/escrow.md b/docs/examples/DeFi/escrow.md index 23adef632..f60118944 100644 --- a/docs/examples/DeFi/escrow.md +++ b/docs/examples/DeFi/escrow.md @@ -6,7 +6,7 @@ sidebar_position: 2 ![escrow](../img/escrow.png) -An escrow is a special wallet to which certain assets (e.g., money or stocks) are deposited and stored until specific conditions are met. In terms of programs, an escrow is a wallet stored on a blockchain that, like a traditional escrow, can receive assets (e.g., cryptocurrency or fungible tokens, such as [Gear fungible tokens - gFT](../Standards/gft-20.md) in this example) from one user and, when certain conditions are met, send them to another. +An escrow is a special wallet to which certain assets (e.g., money or stocks) are deposited and stored until specific conditions are met. In terms of programs, an escrow is a wallet stored on a blockchain that, like a traditional escrow, can receive assets (e.g., cryptocurrency or fungible tokens, such as [Vara fungible tokens - VFT](../Standards/vft.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-foundation/dapps/tree/master/contracts/escrow) - dApp UI [Github](https://github.com/gear-foundation/dapps/tree/master/frontend/apps/escrow) diff --git a/docs/examples/Governance/DAO.md b/docs/examples/Governance/DAO.md index e4b3fd053..d916c0c30 100644 --- a/docs/examples/Governance/DAO.md +++ b/docs/examples/Governance/DAO.md @@ -39,7 +39,7 @@ struct Dao { ``` where: -`approved_token_program_id` - the reference to the token contract ([gFT20](../Standards/gft-20.md)) that users use as pledge to get the share in the DAO. +`approved_token_program_id` - the reference to the token contract ([VFT](../Standards/vft.md)) that users use as pledge to get the share in the DAO. `period_duration` - the smallest unit time interval for the DAO, in ms. @@ -225,7 +225,7 @@ ProcessProposal { [//]: # (A [Ready-to-Use application](https://dao.gear-tech.io/) example provides a user interface that interacts with [DAO](https://github.com/gear-foundation/dapps-dao-light) and [gFT](https://github.com/gear-foundation/dapps-fungible-token) programs.) [//]: # () -[//]: # (Gear Fundible Token enables creation of utility token DAO, check [this article](../Standards/gft-20) for details.) +[//]: # (Gear Fundible Token enables creation of utility token DAO, check [this article](../Standards/vft) for details.) [//]: # () [//]: # (This video demonstrates the entire configuration and user interaction workflow: **https://youtu.be/6lxr7eojADw**) diff --git a/docs/examples/Infra/supply-chain.md b/docs/examples/Infra/supply-chain.md index a4bbd0129..9a701eac0 100644 --- a/docs/examples/Infra/supply-chain.md +++ b/docs/examples/Infra/supply-chain.md @@ -82,7 +82,7 @@ yarn start * Each newly produced item gets the NFT (in Gear's context - [Gear non-fungible token (gNFT)](../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. * Anyone who knows an item's ID can get item info. -* Sale, purchase, delivery is made in [Gear fungible tokens (gFT)](../Standards/gft-20). +* Sale, purchase, delivery is made in [Vara fungible tokens (VFT)](../Standards/vft). Item info has the following struct: ```rust title="supply-chain/io/src/lib.rs" diff --git a/docs/examples/Infra/varatube.md b/docs/examples/Infra/varatube.md index 925f80ea9..b9c556782 100644 --- a/docs/examples/Infra/varatube.md +++ b/docs/examples/Infra/varatube.md @@ -34,7 +34,7 @@ The interface provides an option whether to enable or disable subscription auto- There is also an option to cancel the active subscription. The VaraTube consists of two programs: -- [Gear Fungible Token (gFT-20)](../Standards/gft-20) contract determines user and service balances required to purchase a subscription and approves Subscription program to get funds from user's balance. +- [Gear Fungible Token (VFT)](../Standards/vft) contract determines user and service balances required to purchase a subscription and approves Subscription program to get funds from user's balance. - [VaraTube Subscription](https://github.com/gear-foundation/dapps/tree/master/contracts/varatube) program manages service's subscription - its availability, expiration, auto renewal. ## How to run diff --git a/docs/examples/NFTs/nft-marketplace/marketplace.md b/docs/examples/NFTs/nft-marketplace/marketplace.md index 2091a5e85..61ae744c1 100644 --- a/docs/examples/NFTs/nft-marketplace/marketplace.md +++ b/docs/examples/NFTs/nft-marketplace/marketplace.md @@ -116,7 +116,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/gft-20.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/gnft-721.md)). The marketplace item has the following struct: diff --git a/docs/examples/Standards/gft-20.md b/docs/examples/Standards/vft.md similarity index 79% rename from docs/examples/Standards/gft-20.md rename to docs/examples/Standards/vft.md index 9290d68e3..b20dd14af 100644 --- a/docs/examples/Standards/gft-20.md +++ b/docs/examples/Standards/vft.md @@ -1,13 +1,13 @@ --- -sidebar_label: gFT (ERC-20) +sidebar_label: VFT sidebar_position: 1 --- -# Gear Fungible Token Standard (GRC-20) +# Vara Fungible Token Standard (VFT) -The Gear Fungible Token Standard provides a unified API for smart contracts to implement token functionalities. It encompasses critical operations like token transfer and approvals for third-party spending on the blockchain. Below, we detail the contract state, its interface, and key methods to facilitate these operations. +The Vara Fungible Token Standard provides a unified API for smart contracts to implement token functionalities. It encompasses critical operations like token transfer and approvals for third-party spending on the blockchain. Below, we detail the contract state, its interface, and key methods to facilitate these operations. -An example implementation of the GRC-20 standard is available on [GitHub](https://github.com/gear-foundation/standards/tree/master/gear-erc20). +An example implementation of the VFT standard is available on [GitHub](https://github.com/gear-foundation/standards/tree/master/vft). ## Functions @@ -36,7 +36,7 @@ An example implementation of the GRC-20 standard is available on [GitHub](https: ### `Approve` ```rust -pub fn approve(&mut self, spender: sails_rtl::ActorId, value: U256) -> bool +pub fn approve(&mut self, spender: ActorId, value: U256) -> bool ``` This function allows a designated spender (`spender`) to withdraw up to an `value` of tokens from your account, multiple times up to the amount limit. Resets allowance to `value` with a subsequent call. Returns a boolean value indicating whether the operation succeeded. @@ -45,8 +45,8 @@ Upon successful execution, triggers the event: ```rust Approval { - owner: sails_rtl::ActorId, - spender: sails_rtl::ActorId, + owner: ActorId, + spender: ActorId, value: U256, } ``` @@ -54,7 +54,7 @@ Approval { ### `Transfer` ```rust -pub fn transfer(&mut self, to: sails_rtl::ActorId, value: U256) -> bool +pub fn transfer(&mut self, to: ActorId, value: U256) -> bool ``` @@ -64,8 +64,8 @@ Upon successful execution generates the event: ```rust Transfer { - from: sails_rtl::ActorId, - to: sails_rtl::ActorId, + from: ActorId, + to: ActorId, value: U256, } ``` @@ -73,7 +73,7 @@ Transfer { ### `TransferFrom` ```rust -pub fn transfer_from(&mut self, from: sails_rtl::ActorId, to: sails_rtl::ActorId, value: U256) -> bool +pub fn transfer_from(&mut self, from: ActorId, to: ActorId, value: U256) -> bool ``` Transfers a specified `value` of tokens `from` one account `to` another, using the allowance mechanism. Value is then deducted from the caller’s allowance. Returns a boolean value indicating whether the operation succeeded. @@ -81,8 +81,8 @@ Upon successful execution generates the event: ```rust Transfer { - from: sails_rtl::ActorId, - to: sails_rtl::ActorId, + from: ActorId, + to: ActorId, value: U256, } ``` @@ -126,7 +126,7 @@ pub fn total_supply(&self) -> U256 Returns the token balance of the `owner` address. ```rust -pub fn balance_of(&self, owner: sails_rtl::ActorId) -> U256 +pub fn balance_of(&self, account: ActorId) -> U256 ``` ### `allowance` @@ -134,7 +134,7 @@ pub fn balance_of(&self, owner: sails_rtl::ActorId) -> U256 Returns the number of tokens the `spender` account is authorized to spend on behalf of the `owner`. ```rust -pub fn allowance(&self, owner: sails_rtl::ActorId, spender: sails_rtl::ActorId) -> U256 +pub fn allowance(&self, owner: ActorId, spender: ActorId) -> U256 ``` ## Contract Interface @@ -146,12 +146,12 @@ constructor { New : (name: str, symbol: str, decimals: u8); }; -service Erc20 { +service Vft { Approve : (spender: actor_id, value: u256) -> bool; Transfer : (to: actor_id, value: u256) -> bool; TransferFrom : (from: actor_id, to: actor_id, value: u256) -> bool; query Allowance : (owner: actor_id, spender: actor_id) -> u256; - query BalanceOf : (owner: actor_id) -> u256; + query BalanceOf : (account: actor_id) -> u256; query Decimals : () -> u8; query Name : () -> str; query Symbol : () -> str; 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 9eae66fd4..47966ef90 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,9 +253,9 @@ extern "C" fn meta_state() -> *mut [i32; 2] { ## 用户界面 -一个 [即用型应用](https://dao.gear-tech.io/)实例提供了一个与[DAO](https://github.com/gear-foundation/dapps-dao-light)和[GFT](https://github.com/gear-foundation/dapps-fungible-token)智能合约互动的用户界面。 +一个 [即用型应用](https://dao.gear-tech.io/)实例提供了一个与[DAO](https://github.com/gear-foundation/dapps-dao-light)和[VFT](https://github.com/gear-foundation/dapps-fungible-token)智能合约互动的用户界面。 -Gear 同质化代币可以创建基于实用代币的 DAO,详情请看[本文](../Standards/gft-20)。 +Gear 同质化代币可以创建基于实用代币的 DAO,详情请看[本文](../Standards/vft)。 这个视频演示了整体配置和用户互动工作流程。 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 aa7ab29da..d571a0dea 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 @@ -11,7 +11,7 @@ sidebar_position: 18 本文所描述的众筹智能合约实现的例子是在 Gear 上实现和发布的去中心化应用之一。这篇文章介绍了接口、数据结构、基本功能,并解释了它们的用途。代码可以直接使用,也可以根据自己的场景进行修改。任何人都可以轻松创建自己的众筹应用,并在 Gear 网络上运行。 -购买代币的初始资金由 Gear 同质化代币合约决定 - [gFT](https://wiki.gear-tech.io/examples/Standards/gft-20)。 +购买代币的初始资金由 Gear 同质化代币合约决定 - [gFT](https://wiki.gear-tech.io/examples/Standards/vft)。 合约源代码可在[GitHub](https://github.com/gear-foundation/dapps-crowdsale)上找到。 ## 界面 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 97aad75cc..5b4c7b29b 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 @@ -7,7 +7,7 @@ sidebar_position: 8 ## 介绍 -第三方担保是一个特殊钱包,某些资产 (如钱或股票) 存放在其中,直到某些条件得到满足。就智能合约而言,第三方担保是存储在区块链上的钱包,与常规担保一样,可以从一个用户那里接收一些资产 (例如加密资产或代币,在这个例子中,是像 [gFT](../Standards/gft-20)资产),并在满足特定条件时将它们发送给另一个用户。 +第三方担保是一个特殊钱包,某些资产 (如钱或股票) 存放在其中,直到某些条件得到满足。就智能合约而言,第三方担保是存储在区块链上的钱包,与常规担保一样,可以从一个用户那里接收一些资产 (例如加密资产或代币,在这个例子中,是像 [VFT](../Standards/vft)资产),并在满足特定条件时将它们发送给另一个用户。 本篇文章主要介绍智能合约的作用和代码逻辑。想获得更详细的技术描述,请参考[技术文档](https://dapps.gear.rs/escrow_io)和[源码](#source-code)。 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 9ee39c7fd..0a47cb1ff 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 @@ -13,7 +13,7 @@ sidebar_position: 10 * 每个新产生的项目会得到 NFT(在 Gear 的上下文中--[gNFT token](../Standards/gnft-721.md) 和 NFT 相关的 ID。然后,随着物品在供应链上的移动,物品的 NFT 在供应链程序、物品的生产商和未来的分销商、零售商和最终消费者之间转移。 * 任何知道物品 ID 的人都可以获取物品信息 -* 销售、购买、交付使用 [gFT 代币](../Standards/gft-20)。 +* 销售、购买、交付使用 [VFT 代币](../Standards/vft)。 ItemInfo 结构如下: diff --git a/redirects.json b/redirects.json index cfa57614a..ffa2f0066 100644 --- a/redirects.json +++ b/redirects.json @@ -108,8 +108,8 @@ "from": "/examples/ping" }, { - "to": "/docs/examples/Standards/gft-20", - "from": "/examples/gft-20" + "to": "/docs/examples/Standards/vft", + "from": "/examples/vft" }, { "to": "/docs/examples/Standards/gnft-721", @@ -252,11 +252,11 @@ "from": "/general/dao" }, { - "to": "/docs/examples/Standards/gft-20", + "to": "/docs/examples/Standards/vft", "from": "/examples/erc20" }, { - "to": "/docs/examples/Standards/gft-20", + "to": "/docs/examples/Standards/vft", "from": "/docs/examples/erc20" }, { @@ -264,8 +264,8 @@ "from": "/ping" }, { - "to": "/docs/examples/Standards/gft-20", - "from": "/gft-20" + "to": "/docs/examples/Standards/vft", + "from": "/vft" }, { "to": "/docs/examples/Standards/gnft-721", diff --git a/script_checking_code.js b/script_checking_code.js index e15a3261a..d68abb4e0 100755 --- a/script_checking_code.js +++ b/script_checking_code.js @@ -213,7 +213,7 @@ const filePaths = [ 'NFTs/nft-pixelboard.md', 'NFTs/onchain-nft.md', - // 'Standards/gft-20.md', + // 'Standards/vft.md', // 'Standards/gmt-1155.md', // 'Standards/gnft-721.md', // 'Standards/rmrk.md',