From 989c011308a3c1c573350355b176139c5430e445 Mon Sep 17 00:00:00 2001 From: Maxim Evtush <154841002+maximevtush@users.noreply.github.com> Date: Thu, 13 Feb 2025 16:04:11 +0100 Subject: [PATCH 1/4] Update cross-calls.md --- docs/learn/tutorials/cross-calls/cross-calls.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/learn/tutorials/cross-calls/cross-calls.md b/docs/learn/tutorials/cross-calls/cross-calls.md index c50d791..e39bcc2 100644 --- a/docs/learn/tutorials/cross-calls/cross-calls.md +++ b/docs/learn/tutorials/cross-calls/cross-calls.md @@ -454,7 +454,7 @@ pub fn get_addresses(&self) -> Vec { } ``` -Same in `MainContract`. We will have `get_addesses_call`, `flip_delegate`, `get_delegate` and `get_addresses_delegate`. +Same in `MainContract`. We will have `get_addresses_call`, `flip_delegate`, `get_delegate` and `get_addresses_delegate`. Filename: main_contract/ From d18fbd3cd492356f6d1af155f1fe60fcac2f0e9a Mon Sep 17 00:00:00 2001 From: Maxim Evtush <154841002+maximevtush@users.noreply.github.com> Date: Thu, 13 Feb 2025 16:05:17 +0100 Subject: [PATCH 2/4] Update storage.md --- docs/learn/tutorials/dex/pair/storage.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/learn/tutorials/dex/pair/storage.md b/docs/learn/tutorials/dex/pair/storage.md index 2c2d856..4ae1a32 100644 --- a/docs/learn/tutorials/dex/pair/storage.md +++ b/docs/learn/tutorials/dex/pair/storage.md @@ -189,7 +189,7 @@ pub trait Pair { } ``` -Openbrush provides `#[openbrush::trait_definition]` that will make sure your trait (and its default implementation) will be generated in the contract. Also, you can create a wrapper around this trait so it can be used for cross-contract calls (so no need to import the contract as ink-as-dependancy). Import what is needed from Openbrush: +Openbrush provides `#[openbrush::trait_definition]` that will make sure your trait (and its default implementation) will be generated in the contract. Also, you can create a wrapper around this trait so it can be used for cross-contract calls (so no need to import the contract as ink-as-dependency). Import what is needed from Openbrush: ```rust use openbrush::traits::{ From 9fec628883565f357240d30220c9cbb91c904b39 Mon Sep 17 00:00:00 2001 From: Maxim Evtush <154841002+maximevtush@users.noreply.github.com> Date: Thu, 13 Feb 2025 16:05:48 +0100 Subject: [PATCH 3/4] Update create-pair.md --- docs/learn/tutorials/dex/factory/create-pair.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/learn/tutorials/dex/factory/create-pair.md b/docs/learn/tutorials/dex/factory/create-pair.md index cea005b..2064c11 100644 --- a/docs/learn/tutorials/dex/factory/create-pair.md +++ b/docs/learn/tutorials/dex/factory/create-pair.md @@ -10,7 +10,7 @@ If you are starting the tutorial from here, please check out this [branch](https We will implement the [createPair](https://github.com/Uniswap/v2-core/blob/ee547b17853e71ed4e0101ccfd52e70d5acded58/contracts/UniswapV2Factory.sol#L23) function of the Factory contract. In the *./logics/traits/factory.rs* file, add the **create_pair** function to the Factory trait, as well as the internal child function **_instantiate_pair** that will need to be implemented in the contract crate. -The reason why we need an internal **_instantiate_pair** function here is because the instantiate builder is not part of the `#[openbrush::wrapper]`, so we will need to use the one from ink! by importing the Pair contract as an `ink-as-dependancy`. +The reason why we need an internal **_instantiate_pair** function here is because the instantiate builder is not part of the `#[openbrush::wrapper]`, so we will need to use the one from ink! by importing the Pair contract as an `ink-as-dependency`. The **create_pair** message function returns the address of the instantiated Pair contract. The function that emits a create_pair event will also have to be implemented in the contract: ```rust From 8d17c7cc3b4f20b228bb4007e196392b67532036 Mon Sep 17 00:00:00 2001 From: Maxim Evtush <154841002+maximevtush@users.noreply.github.com> Date: Thu, 13 Feb 2025 16:06:21 +0100 Subject: [PATCH 4/4] Update file-structure.md --- docs/learn/tutorials/dex/structure/file-structure.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/learn/tutorials/dex/structure/file-structure.md b/docs/learn/tutorials/dex/structure/file-structure.md index 87bb394..a110e7e 100644 --- a/docs/learn/tutorials/dex/structure/file-structure.md +++ b/docs/learn/tutorials/dex/structure/file-structure.md @@ -36,7 +36,7 @@ Therefore, the only solution, in ink!, is to implement an omnibus contract with In order to organise the business logic into different files, OpenBrush uses [specialization](https://github.com/rust-lang/rfcs/pull/1210) that permits multiple `impl` blocks to be applied to the same type. With OpenBrush, you can define as many Trait and generic implementations as are needed, which allows you to split up your code to more easily implement it into your contract. Of course, specialization also allows you to override a default implementation (if the method or impl is specialized with the [`default`](https://github.com/rust-lang/rfcs/blob/master/text/1210-impl-specialization.md#the-default-keyword) keyword). -So you define a Trait and a generic implementation in a crate and within the contract you implement this Trait. If this impl block is empty `{}` specialization will implement the most specific implementation, which is the one you defined in the file. Every generic implementation in Openbrush (PSP22, PSP34, ..) uses the `default` keyword that makes these functions *overrideable*. +So you define a Trait and a generic implementation in a crate and within the contract you implement this Trait. If this impl block is empty `{}` specialization will implement the most specific implementation, which is the one you defined in the file. Every generic implementation in Openbrush (PSP22, PSP34, ..) uses the `default` keyword that makes these functions *overridable*. Define your Trait in a file: