Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions deliveries/openbrush-milestone_2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# 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:** [OpenBrush](https://github.com/w3f/Grants-Program/blob/master/applications/openbrush.md)
* **Milestone Number:** 2

The second milestone is a release [v1.0.0](https://github.com/Supercolony-net/openbrush-contracts/releases/tag/v1.0.0).

| Number | Deliverable | Link | Notes |
| ------------- | ------------- | ------------- |------------- |
| 0a. | License |MIT| The MIT license is used in the project. |
| 0b. | Documentation |[Macros](https://github.com/Supercolony-net/openbrush-contracts/blob/783406805c4ef86176d4a3500db6840c5b7f059a/utils/brush/proc_macros/lib.rs), [Examples and more general documentation](https://supercolony-net.github.io/openbrush-contracts/index.html)| All contracts have comments. The old documentation has been updated with new features introduced during this milestone. New features implemented via macro and contain the description in comments. |
| 0c. | Testing Guide |[Macros](https://github.com/Supercolony-net/openbrush-contracts/blob/783406805c4ef86176d4a3500db6840c5b7f059a/utils/brush/proc_macros/lib.rs), [Examples](https://github.com/Supercolony-net/openbrush-contracts/tree/783406805c4ef86176d4a3500db6840c5b7f059a/examples), [Integration tests](https://github.com/Supercolony-net/openbrush-contracts/tree/783406805c4ef86176d4a3500db6840c5b7f059a/tests)| Macros have been tested via rust documentation. The old examples have been updated according to new features(integration test for them without changes). |
| 1. | Remove boilerplate code |[`#[brush::contract]`](https://github.com/Supercolony-net/openbrush-contracts/blob/783406805c4ef86176d4a3500db6840c5b7f059a/utils/brush/proc_macros/lib.rs#L15), [`#[brush::trait_definition]`](https://github.com/Supercolony-net/openbrush-contracts/blob/783406805c4ef86176d4a3500db6840c5b7f059a/utils/brush/proc_macros/lib.rs#L173)| Combination of `#[brush::contract]` and `#[brush::trait_definition]` macros allow to avoid boilerplate code. Example of `PSP22` contract [with this feature](https://github.com/Supercolony-net/openbrush-contracts/blob/783406805c4ef86176d4a3500db6840c5b7f059a/examples/psp22/lib.rs#L20) and [without](https://github.com/Supercolony-net/openbrush-contracts/blob/20cd7a98f70f7a91d546baaa7cf032b6ba776e93/examples/erc20/lib.rs#L100). |
| 2. | Derive for storages |[Derive macro rule](https://github.com/Supercolony-net/openbrush-contracts/blob/783406805c4ef86176d4a3500db6840c5b7f059a/utils/brush_derive_macro/lib.rs#L11), [Helper macro rules](https://github.com/Supercolony-net/openbrush-contracts/blob/783406805c4ef86176d4a3500db6840c5b7f059a/utils/brush/macros.rs)| The library is using a clear and simple data model. If the user wants to reuse some trait from the library. He must derive corresponding storage(for [example](https://github.com/Supercolony-net/openbrush-contracts/blob/783406805c4ef86176d4a3500db6840c5b7f059a/examples/psp22/lib.rs#L10)). If the user wants to define his trait, he has to define some data struct(for [example](https://github.com/Supercolony-net/openbrush-contracts/blob/783406805c4ef86176d4a3500db6840c5b7f059a/contracts/token/psp22/traits.rs#L33)) and use `declare_storage_trait!` to declare a trait. The user also can easily create derive macro for his trait, by reusing `declare_derive_storage_trait!` macro rule(for [example](https://github.com/Supercolony-net/openbrush-contracts/tree/783406805c4ef86176d4a3500db6840c5b7f059a/contracts/token/psp22/derive)). |
| 3. | Support default implementation in external traits |[`#[brush::trait_definition]`](https://github.com/Supercolony-net/openbrush-contracts/blob/783406805c4ef86176d4a3500db6840c5b7f059a/utils/brush/proc_macros/lib.rs#L173)| The macro allows having methods in the trait with default implementation of method, default types, constants, and any other stuff from the rust(except generics in ink! messages). [Example how it looks like](https://github.com/Supercolony-net/openbrush-contracts/blob/783406805c4ef86176d4a3500db6840c5b7f059a/contracts/token/psp22/traits.rs#L70). |
| 4. | Support of modifiers |[`#[brush::modifier_definition]`](https://github.com/Supercolony-net/openbrush-contracts/blob/783406805c4ef86176d4a3500db6840c5b7f059a/utils/brush/proc_macros/lib.rs#L204), [`#[brush::modifiers]`](https://github.com/Supercolony-net/openbrush-contracts/blob/783406805c4ef86176d4a3500db6840c5b7f059a/utils/brush/proc_macros/lib.rs#L336)| `#[brush::modifier_definition]` validates that modifier has been declared right according to expected rules. `#[brush::modifiers]` applies modifiers to a function. |
| 5. | ReentrancyGuard |[Implementation](https://github.com/Supercolony-net/openbrush-contracts/tree/783406805c4ef86176d4a3500db6840c5b7f059a/contracts/security/reentrancy-guard), [Example](https://github.com/Supercolony-net/openbrush-contracts/tree/783406805c4ef86176d4a3500db6840c5b7f059a/examples/reentrancy-guard), [Integration test](https://github.com/Supercolony-net/openbrush-contracts/blob/783406805c4ef86176d4a3500db6840c5b7f059a/tests/reentrancy_guard.tests.ts)| Implemented [ReentrancyGuard](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/security/ReentrancyGuard.sol) from OpenZeppelin. Added example and tests. |
| 6a. | PaymentSplitter |[Implementation](https://github.com/Supercolony-net/openbrush-contracts/tree/783406805c4ef86176d4a3500db6840c5b7f059a/contracts/finance/payment-splitter), [Example](https://github.com/Supercolony-net/openbrush-contracts/tree/783406805c4ef86176d4a3500db6840c5b7f059a/examples/payment-splitter), [Integration test](https://github.com/Supercolony-net/openbrush-contracts/blob/783406805c4ef86176d4a3500db6840c5b7f059a/tests/payment-splitter.tests.ts)| Implemented [PaymentSplitter](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/finance/PaymentSplitter.sol) from OpenZeppelin. Added example and tests. |
| 6b. | TimelockController |[Implementation](https://github.com/Supercolony-net/openbrush-contracts/tree/783406805c4ef86176d4a3500db6840c5b7f059a/contracts/governance/timelock-controller), [Example](https://github.com/Supercolony-net/openbrush-contracts/tree/783406805c4ef86176d4a3500db6840c5b7f059a/examples/timelock-controller), [Integration test](https://github.com/Supercolony-net/openbrush-contracts/blob/783406805c4ef86176d4a3500db6840c5b7f059a/tests/timelock-controller.tests.ts)| Implemented [TimelockController](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/governance/TimelockController.sol) from OpenZeppelin. Added example and tests. |
| 6c. | Pausable |[Implementation](https://github.com/Supercolony-net/openbrush-contracts/tree/783406805c4ef86176d4a3500db6840c5b7f059a/contracts/security/pausable), [Example](https://github.com/Supercolony-net/openbrush-contracts/tree/783406805c4ef86176d4a3500db6840c5b7f059a/examples/pausable), [Integration test](https://github.com/Supercolony-net/openbrush-contracts/blob/783406805c4ef86176d4a3500db6840c5b7f059a/tests/pausable.tests.ts)| Implemented [Pausable](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/security/Pausable.sol) from OpenZeppelin. Added example and tests. |