From 97778be49db7d45216dc93aa36335428ea068daa Mon Sep 17 00:00:00 2001 From: xgreenx Date: Tue, 26 Jul 2022 08:48:08 +0100 Subject: [PATCH 1/3] Added delivery report of first milestone of the third grant(6 milestone of the OpenBrush) --- .../openbrush_follow_up_2-milestone_1.md | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 deliveries/openbrush_follow_up_2-milestone_1.md diff --git a/deliveries/openbrush_follow_up_2-milestone_1.md b/deliveries/openbrush_follow_up_2-milestone_1.md new file mode 100644 index 000000000..44d055d22 --- /dev/null +++ b/deliveries/openbrush_follow_up_2-milestone_1.md @@ -0,0 +1,43 @@ +# Milestone Delivery :mailbox: + +**The [invoice form :pencil:](https://docs.google.com/forms/d/e/1FAIpQLSfmNYaoCgrxyhzgoKQ0ynQvnNRoTmgApz9NrMp-hd8mhIiO0A/viewform) has been filled out correctly for this milestone and the delivery is according to the official [milestone delivery guidelines](https://github.com/w3f/Grants-Program/blob/master/docs/milestone-deliverables-guidelines.md).** + +* **Application Document:** https://github.com/w3f/Grants-Program/pull/921 +* **Milestone Number:** 1 milestone of the grant and 6 milestone of the OpenBrush + +**Context** + +The milestone was related to upgradeable contracts on ink!. +To achieve that, we added host functions to `contract-pallet`, added support of +them to ink!, and implemented `Diamond` and `Proxy` patterns in OpenBrush. + +We added support for upgradable contracts in the OpenBrush release [`v1.5.0`](https://github.com/Supercolony-net/openbrush-contracts/releases/tag/v1.5.0). +Each release, we improve implementation, add extensions, fix bugs, and finally, +it is fully ready in release [`v2.2.0`](https://github.com/Supercolony-net/openbrush-contracts/releases/tag/v2.2.0). + +**Deliverables** + +| Number | Deliverable | Link | Notes | +|--------|------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| 0b. | Documentation | [Documentation about upgradeable contracts](https://docs.openbrush.io/smart-contracts/upgradeable) | The documentation describes how storage works in upgradeable contracts and contains suggestions on not corrupting the storage. OpenBrush provides primitives to develop upgradeable contracts, and documentation also includes examples of how to use them. | +| 1. | Implement `delegate_call` in contract-pallet | [Implementation in substrate](https://github.com/paritytech/substrate/pull/10617), [fix of the bug](https://github.com/paritytech/substrate/pull/11771) | Implemented `seal_delegate_call` works in the same way as [delegatecall](https://docs.soliditylang.org/en/v0.8.10/introduction-to-smart-contracts.html#delegatecall-callcode-and-libraries) in ethereum. It allows the execution of the foreign code in the context of the current contract. | +| 2. | Implement `set_code_hash` in contract-pallet | [Implementation in substrate](https://github.com/paritytech/substrate/pull/10690) | Implemented `set_code_hash` allows replacing the code of the current contract with another code. It is a new approach to simplify the deployment of upgradable contracts that follow the `Proxy` pattern and reduce gas consumption. | +| 3. | Import `delegate_call` in ink! and update `Proxy` example | [Implementation in ink!](https://github.com/paritytech/ink/pull/1133) | To have a more consistent API with common `seal_call`, we did refactoring of `CallBuilder` and related stuff to support delegate and common calls in user-friendly form. | +| 4. | Implement `Diamond` Standard in OpenBrush with ink! | [Initial implementation](https://github.com/Supercolony-net/openbrush-contracts/pull/93), [Refactored](https://github.com/Supercolony-net/openbrush-contracts/pull/137) | Initially, we implemented the `Diamond` standard as in [EIP](https://eips.ethereum.org/EIPS/eip-2535). But after, we refactored it to take less size and simplified API. With release `v2.2.0` it uses new storage and is ready for upcoming storage refactoring in ink!. | +| 5. | Implement `Diamond` Standard on raw Rust without ink! | [Rust implementation](https://github.com/Supercolony-net/openbrush-contracts/pull/153) | We implemented the same contractor ink and on rust. The rust version still uses ink! primitives but without ink! code generation. It takes less space for ~1.2 kb. We plan to use it as a base for upcoming optimization to ink!. | +| 6. | Create an upgradable analog of each contract in OpenBrush | [New macro](https://github.com/Supercolony-net/openbrush-contracts/blob/d6e29f05fd462e4e027de1f2f9177d594a5a0f05/lang/macro/src/lib.rs#L447), [Refactoring with new macro](https://github.com/Supercolony-net/openbrush-contracts/pull/137) | We introduced a new `openbrush::upgradeable_storage` macro to OpenBrush. Macro allows making any data type upgradable(more about it in the documentation). We annotated all data types provided by OpenBrush with that macro. All storages are logic units now and are upgradeable by default in OpenBrush. | +| 7a. | Marketing - Write down article about OpenBrush | [Article](https://medium.com/supercolony/deep-dive-into-openbrush-dc04d5cc7825) | The article describes features of Open Brush with use cases - "Deep dive into OpenBrush" | +| 7b. | Marketing - Create 2 educational video for OpenBrush | [First Video](https://www.youtube.com/watch?v=rlROrqbYPeE) [Second Video](https://www.youtube.com/watch?v=eo_cY8lVNes) | The first video is general overview what is OpenBrush and it describes available features. The second describes of how to write upgradeable contracts and what is it. | + +**Additional Information** + +We want to highlight that the last milestone in the second grant(3rd milestone of +grant two and 5th milestone of the OpenBrush) is not delivered yet. It depends on +ink! team and review process takes a lot of time. We planned to deliver milestone +six after milestone five but already been two months paste since the start of the +grant, and we also have new ideas for new grant that we want to start in parallel. +So we did [big refactoring](https://github.com/Supercolony-net/openbrush-contracts/pull/137) +in OpenBrush and prepared the code for upcoming [change](https://github.com/paritytech/ink/issues/1134). +The documentation on how to write upgradeable contracts is agnostic to calculating storage keys. + +Supercolony hopes that it is not a problem to deliver milestone six before milestone five=) From 9180cdfd95926f2e41375ef2c3d15d62803a18af Mon Sep 17 00:00:00 2001 From: xgreenx Date: Tue, 26 Jul 2022 09:06:36 +0100 Subject: [PATCH 2/3] Fix link to application --- deliveries/openbrush_follow_up_2-milestone_1.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deliveries/openbrush_follow_up_2-milestone_1.md b/deliveries/openbrush_follow_up_2-milestone_1.md index 44d055d22..8194bc64c 100644 --- a/deliveries/openbrush_follow_up_2-milestone_1.md +++ b/deliveries/openbrush_follow_up_2-milestone_1.md @@ -2,7 +2,7 @@ **The [invoice form :pencil:](https://docs.google.com/forms/d/e/1FAIpQLSfmNYaoCgrxyhzgoKQ0ynQvnNRoTmgApz9NrMp-hd8mhIiO0A/viewform) has been filled out correctly for this milestone and the delivery is according to the official [milestone delivery guidelines](https://github.com/w3f/Grants-Program/blob/master/docs/milestone-deliverables-guidelines.md).** -* **Application Document:** https://github.com/w3f/Grants-Program/pull/921 +* **Application Document:** https://github.com/w3f/Grants-Program/blob/master/applications/openbrush-follow-up-2.md * **Milestone Number:** 1 milestone of the grant and 6 milestone of the OpenBrush **Context** From 909c768080f720cb6557b83b1c6c8bbaf4225754 Mon Sep 17 00:00:00 2001 From: GreenBaneling | Supercolony Date: Wed, 27 Jul 2022 16:04:00 +0100 Subject: [PATCH 3/3] Update deliveries/openbrush_follow_up_2-milestone_1.md Co-authored-by: S E R A Y A --- deliveries/openbrush_follow_up_2-milestone_1.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deliveries/openbrush_follow_up_2-milestone_1.md b/deliveries/openbrush_follow_up_2-milestone_1.md index 8194bc64c..fb62ae16c 100644 --- a/deliveries/openbrush_follow_up_2-milestone_1.md +++ b/deliveries/openbrush_follow_up_2-milestone_1.md @@ -3,7 +3,7 @@ **The [invoice form :pencil:](https://docs.google.com/forms/d/e/1FAIpQLSfmNYaoCgrxyhzgoKQ0ynQvnNRoTmgApz9NrMp-hd8mhIiO0A/viewform) has been filled out correctly for this milestone and the delivery is according to the official [milestone delivery guidelines](https://github.com/w3f/Grants-Program/blob/master/docs/milestone-deliverables-guidelines.md).** * **Application Document:** https://github.com/w3f/Grants-Program/blob/master/applications/openbrush-follow-up-2.md -* **Milestone Number:** 1 milestone of the grant and 6 milestone of the OpenBrush +* **Milestone Number:** 6 **Context**