From f9e6ac0b28ca23dc5ed986347850e03ab986ce14 Mon Sep 17 00:00:00 2001 From: Artemka374 Date: Fri, 5 May 2023 16:14:31 +0300 Subject: [PATCH 1/3] update version to 3.1.1 --- Cargo.toml | 6 +++--- contracts/Cargo.toml | 4 ++-- docs/docs/smart-contracts/example/contract.md | 4 ++-- docs/docs/smart-contracts/overview.md | 8 ++++---- example_project_structure/Cargo.toml | 2 +- example_project_structure/contracts/lending/Cargo.toml | 2 +- example_project_structure/contracts/loan/Cargo.toml | 2 +- example_project_structure/contracts/shares/Cargo.toml | 2 +- .../contracts/stable_coin/Cargo.toml | 2 +- examples/access_control/Cargo.toml | 2 +- examples/access_control_extensions/enumerable/Cargo.toml | 2 +- examples/alternatives/diamond/ink/Cargo.toml | 2 +- examples/alternatives/diamond/rust/Cargo.toml | 2 +- examples/diamond/Cargo.toml | 2 +- examples/diamond/diamond_caller/Cargo.toml | 2 +- examples/diamond/psp22_facet_v1/Cargo.toml | 2 +- examples/diamond/psp22_facet_v2/Cargo.toml | 2 +- examples/diamond/psp22_metadata_facet/Cargo.toml | 2 +- examples/ownable/Cargo.toml | 2 +- examples/pausable/Cargo.toml | 2 +- examples/payment_splitter/Cargo.toml | 2 +- examples/proxy/Cargo.toml | 2 +- examples/proxy/psp22_metadata_upgradeable/Cargo.toml | 2 +- examples/proxy/psp22_upgradeable/Cargo.toml | 2 +- examples/psp22/Cargo.toml | 2 +- examples/psp22_extensions/burnable/Cargo.toml | 2 +- examples/psp22_extensions/capped/Cargo.toml | 2 +- examples/psp22_extensions/flashmint/Cargo.toml | 2 +- examples/psp22_extensions/metadata/Cargo.toml | 2 +- examples/psp22_extensions/mintable/Cargo.toml | 2 +- examples/psp22_extensions/pausable/Cargo.toml | 2 +- examples/psp22_extensions/wrapper/Cargo.toml | 2 +- examples/psp22_pallet/Cargo.toml | 2 +- examples/psp22_pallet_extensions/burnable/Cargo.toml | 2 +- examples/psp22_pallet_extensions/metadata/Cargo.toml | 2 +- examples/psp22_pallet_extensions/mintable/Cargo.toml | 2 +- examples/psp22_utils/token_timelock/Cargo.toml | 2 +- examples/psp34/Cargo.toml | 2 +- examples/psp34_extensions/burnable/Cargo.toml | 2 +- examples/psp34_extensions/enumerable/Cargo.toml | 2 +- examples/psp34_extensions/metadata/Cargo.toml | 2 +- examples/psp34_extensions/mintable/Cargo.toml | 2 +- examples/psp37/Cargo.toml | 2 +- examples/psp37_extensions/batch/Cargo.toml | 2 +- examples/psp37_extensions/burnable/Cargo.toml | 2 +- examples/psp37_extensions/enumerable/Cargo.toml | 2 +- examples/psp37_extensions/metadata/Cargo.toml | 2 +- examples/psp37_extensions/mintable/Cargo.toml | 2 +- examples/reentrancy_guard/Cargo.toml | 2 +- examples/reentrancy_guard/contracts/flip_on_me/Cargo.toml | 2 +- examples/reentrancy_guard/contracts/flipper/Cargo.toml | 2 +- examples/test_helpers/Cargo.toml | 2 +- examples/timelock_controller/Cargo.toml | 2 +- lang/Cargo.toml | 4 ++-- lang/codegen/Cargo.toml | 2 +- lang/macro/Cargo.toml | 4 ++-- mock/flash-borrower/Cargo.toml | 2 +- 57 files changed, 66 insertions(+), 66 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index ef0547525..053236656 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,7 +12,7 @@ exclude = [ [package] name = "openbrush" -version = "3.0.0" +version = "3.1.1" authors = ["Brushfam "] edition = "2018" @@ -31,8 +31,8 @@ ink = { version = "4.1.0", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } -openbrush_contracts = { version = "~3.0.0", path = "contracts", default-features = false } -openbrush_lang = { version = "~3.0.0", path = "lang", default-features = false } +openbrush_contracts = { version = "~3.1.1", path = "contracts", default-features = false } +openbrush_lang = { version = "~3.1.1", path = "lang", default-features = false } [lib] name = "openbrush" diff --git a/contracts/Cargo.toml b/contracts/Cargo.toml index 074f72bcd..bceb40d05 100644 --- a/contracts/Cargo.toml +++ b/contracts/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "openbrush_contracts" -version = "3.0.0" +version = "3.1.1" authors = ["Brushfam "] edition = "2021" @@ -19,7 +19,7 @@ ink = { version = "4.1.0", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } -openbrush = { version = "~3.0.0", package = "openbrush_lang", path = "../lang", default-features = false } +openbrush = { version = "~3.1.1", package = "openbrush_lang", path = "../lang", default-features = false } pallet-assets-chain-extension = { git = "https://github.com/727-ventures/pallet-assets-chain-extension", branch = "polkadot-v0.9.37", default-features = false, features = ["ink-lang"] } diff --git a/docs/docs/smart-contracts/example/contract.md b/docs/docs/smart-contracts/example/contract.md index 6baddf838..319b7ce16 100644 --- a/docs/docs/smart-contracts/example/contract.md +++ b/docs/docs/smart-contracts/example/contract.md @@ -16,7 +16,7 @@ implementation of `Lending` and `LendingPermissioned` traits defined in the `len ```toml [package] name = "lending_contract" -version = "3.0.0" +version = "3.1.1" authors = ["Brushfam "] edition = "2021" @@ -29,7 +29,7 @@ scale-info = { version = "2.3", default-features = false, features = ["derive"], shares_contract = { path = "../shares", default-features = false, features = ["ink-as-dependency"] } loan_contract = { path = "../loan", default-features = false, features = ["ink-as-dependency"] } lending_project = { path = "../..", default-features = false } -openbrush = { version = "~3.0.0", default-features = false, features = ["pausable", "access_control"] } +openbrush = { version = "~3.1.1", default-features = false, features = ["pausable", "access_control"] } [lib] name = "lending_contract" diff --git a/docs/docs/smart-contracts/overview.md b/docs/docs/smart-contracts/overview.md index f5452e75b..81afff581 100644 --- a/docs/docs/smart-contracts/overview.md +++ b/docs/docs/smart-contracts/overview.md @@ -24,7 +24,7 @@ scale = { package = "parity-scale-codec", version = "3", default-features = fals scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } # Brush dependency -openbrush = { git = "https://github.com/727-Ventures/openbrush-contracts", version = "~3.0.0", default-features = false } +openbrush = { git = "https://github.com/727-Ventures/openbrush-contracts", version = "~3.1.1", default-features = false } [features] default = ["std"] @@ -73,17 +73,17 @@ The name of the feature is the same as the name of the module. For example: To enable `psp22`: ```toml -openbrush = { git = "https://github.com/727-Ventures/openbrush-contracts", version = "~3.0.0", default-features = false, features = ["psp22"] } +openbrush = { git = "https://github.com/727-Ventures/openbrush-contracts", version = "~3.1.1", default-features = false, features = ["psp22"] } ``` To enable `ownable`: ```toml -openbrush = { git = "https://github.com/727-Ventures/openbrush-contracts", version = "~3.0.0", default-features = false, features = ["ownable"] } +openbrush = { git = "https://github.com/727-Ventures/openbrush-contracts", version = "~3.1.1", default-features = false, features = ["ownable"] } ``` To enable both: ```toml -openbrush = { git = "https://github.com/727-Ventures/openbrush-contracts", version = "~3.0.0", default-features = false, features = ["psp22, ownable"] } +openbrush = { git = "https://github.com/727-Ventures/openbrush-contracts", version = "~3.1.1", default-features = false, features = ["psp22, ownable"] } ``` After enabling the feature and importing the corresponding module, you need to embed the module diff --git a/example_project_structure/Cargo.toml b/example_project_structure/Cargo.toml index d4ad7f5ec..3f8766f3b 100644 --- a/example_project_structure/Cargo.toml +++ b/example_project_structure/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "lending_project" -version = "3.0.0" +version = "3.1.1" authors = ["Brushfam "] edition = "2021" diff --git a/example_project_structure/contracts/lending/Cargo.toml b/example_project_structure/contracts/lending/Cargo.toml index 16d260323..eeecc73f1 100644 --- a/example_project_structure/contracts/lending/Cargo.toml +++ b/example_project_structure/contracts/lending/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "lending_contract" -version = "3.0.0" +version = "3.1.1" authors = ["Brushfam "] edition = "2021" diff --git a/example_project_structure/contracts/loan/Cargo.toml b/example_project_structure/contracts/loan/Cargo.toml index 81336ebac..a7ebe3fac 100644 --- a/example_project_structure/contracts/loan/Cargo.toml +++ b/example_project_structure/contracts/loan/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "loan_contract" -version = "3.0.0" +version = "3.1.1" authors = ["Brushfam "] edition = "2021" diff --git a/example_project_structure/contracts/shares/Cargo.toml b/example_project_structure/contracts/shares/Cargo.toml index 23bb7c3a8..e9edb026e 100644 --- a/example_project_structure/contracts/shares/Cargo.toml +++ b/example_project_structure/contracts/shares/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "shares_contract" -version = "3.0.0" +version = "3.1.1" authors = ["Brushfam "] edition = "2021" diff --git a/example_project_structure/contracts/stable_coin/Cargo.toml b/example_project_structure/contracts/stable_coin/Cargo.toml index 32a1a270f..6cc04e537 100644 --- a/example_project_structure/contracts/stable_coin/Cargo.toml +++ b/example_project_structure/contracts/stable_coin/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "stable_coin_contract" -version = "3.0.0" +version = "3.1.1" authors = ["Brushfam "] edition = "2021" diff --git a/examples/access_control/Cargo.toml b/examples/access_control/Cargo.toml index 877bd1f6a..e3d5d10dd 100644 --- a/examples/access_control/Cargo.toml +++ b/examples/access_control/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "my_access_control" -version = "3.0.0" +version = "3.1.1" authors = ["Brushfam "] edition = "2021" diff --git a/examples/access_control_extensions/enumerable/Cargo.toml b/examples/access_control_extensions/enumerable/Cargo.toml index 1631932cb..87afaf8ac 100644 --- a/examples/access_control_extensions/enumerable/Cargo.toml +++ b/examples/access_control_extensions/enumerable/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "my_access_control_enumerable" -version = "3.0.0" +version = "3.1.1" authors = ["Brushfam "] edition = "2021" diff --git a/examples/alternatives/diamond/ink/Cargo.toml b/examples/alternatives/diamond/ink/Cargo.toml index f23e0cc08..33fb21cee 100644 --- a/examples/alternatives/diamond/ink/Cargo.toml +++ b/examples/alternatives/diamond/ink/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ink_diamond" -version = "3.0.0-beta.1" +version = "3.1.1" authors = ["Brushfam "] edition = "2021" diff --git a/examples/alternatives/diamond/rust/Cargo.toml b/examples/alternatives/diamond/rust/Cargo.toml index 48faed4b7..723a7df27 100644 --- a/examples/alternatives/diamond/rust/Cargo.toml +++ b/examples/alternatives/diamond/rust/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rust_diamond" -version = "3.0.0" +version = "3.1.1" authors = ["Brushfam "] edition = "2021" diff --git a/examples/diamond/Cargo.toml b/examples/diamond/Cargo.toml index 79bef4489..3b49057cf 100644 --- a/examples/diamond/Cargo.toml +++ b/examples/diamond/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "my_diamond" -version = "3.0.0-beta.1" +version = "3.1.1" authors = ["Brushfam "] edition = "2021" diff --git a/examples/diamond/diamond_caller/Cargo.toml b/examples/diamond/diamond_caller/Cargo.toml index eff772f95..d730c22e0 100644 --- a/examples/diamond/diamond_caller/Cargo.toml +++ b/examples/diamond/diamond_caller/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "diamond_caller" -version = "3.0.0-beta.1" +version = "3.1.1" authors = ["Brushfam "] edition = "2021" diff --git a/examples/diamond/psp22_facet_v1/Cargo.toml b/examples/diamond/psp22_facet_v1/Cargo.toml index 97d11f44b..343b12ad2 100644 --- a/examples/diamond/psp22_facet_v1/Cargo.toml +++ b/examples/diamond/psp22_facet_v1/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "my_psp22_facet_v1" -version = "3.0.0-beta.1" +version = "3.1.1" authors = ["Brushfam "] edition = "2021" diff --git a/examples/diamond/psp22_facet_v2/Cargo.toml b/examples/diamond/psp22_facet_v2/Cargo.toml index 08b72befe..d6c25c5cf 100644 --- a/examples/diamond/psp22_facet_v2/Cargo.toml +++ b/examples/diamond/psp22_facet_v2/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "my_psp22_facet_v2" -version = "3.0.0-beta.1" +version = "3.1.1" authors = ["Brushfam "] edition = "2021" diff --git a/examples/diamond/psp22_metadata_facet/Cargo.toml b/examples/diamond/psp22_metadata_facet/Cargo.toml index 72df1df45..41fef1171 100644 --- a/examples/diamond/psp22_metadata_facet/Cargo.toml +++ b/examples/diamond/psp22_metadata_facet/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "my_psp22_metadata_facet" -version = "3.0.0-beta.1" +version = "3.1.1" authors = ["Brushfam "] edition = "2021" diff --git a/examples/ownable/Cargo.toml b/examples/ownable/Cargo.toml index 1da8f4578..33a920c00 100644 --- a/examples/ownable/Cargo.toml +++ b/examples/ownable/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "my_ownable" -version = "3.0.0-beta.1" +version = "3.1.1" authors = ["Brushfam "] edition = "2021" diff --git a/examples/pausable/Cargo.toml b/examples/pausable/Cargo.toml index f59588d56..e5a8808a6 100644 --- a/examples/pausable/Cargo.toml +++ b/examples/pausable/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "my_pausable" -version = "3.0.0-beta.1" +version = "3.1.1" authors = ["Brushfam "] edition = "2021" diff --git a/examples/payment_splitter/Cargo.toml b/examples/payment_splitter/Cargo.toml index d9dcba273..259f7d231 100644 --- a/examples/payment_splitter/Cargo.toml +++ b/examples/payment_splitter/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "my_payment_splitter" -version = "3.0.0-beta.1" +version = "3.1.1" authors = ["Brushfam "] edition = "2021" diff --git a/examples/proxy/Cargo.toml b/examples/proxy/Cargo.toml index 155fa422e..1e3ea5d46 100644 --- a/examples/proxy/Cargo.toml +++ b/examples/proxy/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "my_proxy" -version = "3.0.0" +version = "3.1.1" authors = ["Brushfam "] edition = "2021" diff --git a/examples/proxy/psp22_metadata_upgradeable/Cargo.toml b/examples/proxy/psp22_metadata_upgradeable/Cargo.toml index ecff9684f..9ba8b12af 100644 --- a/examples/proxy/psp22_metadata_upgradeable/Cargo.toml +++ b/examples/proxy/psp22_metadata_upgradeable/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "my_psp22_metadata_upgradeable" -version = "3.0.0" +version = "3.1.1" authors = ["Brushfam "] edition = "2021" diff --git a/examples/proxy/psp22_upgradeable/Cargo.toml b/examples/proxy/psp22_upgradeable/Cargo.toml index f123886fd..e1525b4a9 100644 --- a/examples/proxy/psp22_upgradeable/Cargo.toml +++ b/examples/proxy/psp22_upgradeable/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "my_psp22_upgradeable" -version = "3.0.0" +version = "3.1.1" authors = ["Brushfam "] edition = "2021" diff --git a/examples/psp22/Cargo.toml b/examples/psp22/Cargo.toml index b0743fc7a..07e687775 100644 --- a/examples/psp22/Cargo.toml +++ b/examples/psp22/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "my_psp22" -version = "3.0.0" +version = "3.1.1" authors = ["Brushfam "] edition = "2021" diff --git a/examples/psp22_extensions/burnable/Cargo.toml b/examples/psp22_extensions/burnable/Cargo.toml index ddefaa8fa..96219496a 100644 --- a/examples/psp22_extensions/burnable/Cargo.toml +++ b/examples/psp22_extensions/burnable/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "my_psp22_burnable" -version = "3.0.0" +version = "3.1.1" authors = ["Brushfam "] edition = "2021" diff --git a/examples/psp22_extensions/capped/Cargo.toml b/examples/psp22_extensions/capped/Cargo.toml index 9a07c0be4..f04926854 100644 --- a/examples/psp22_extensions/capped/Cargo.toml +++ b/examples/psp22_extensions/capped/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "my_psp22_capped" -version = "3.0.0-beta.1" +version = "3.1.1" authors = ["Brushfam "] edition = "2021" diff --git a/examples/psp22_extensions/flashmint/Cargo.toml b/examples/psp22_extensions/flashmint/Cargo.toml index 718dcbf00..df376e87a 100644 --- a/examples/psp22_extensions/flashmint/Cargo.toml +++ b/examples/psp22_extensions/flashmint/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "my_psp22_flashmint" -version = "3.0.0" +version = "3.1.1" authors = ["Brushfam "] edition = "2021" diff --git a/examples/psp22_extensions/metadata/Cargo.toml b/examples/psp22_extensions/metadata/Cargo.toml index a3f16f165..6865e17f6 100644 --- a/examples/psp22_extensions/metadata/Cargo.toml +++ b/examples/psp22_extensions/metadata/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "my_psp22_metadata" -version = "3.0.0" +version = "3.1.1" authors = ["Brushfam "] edition = "2021" diff --git a/examples/psp22_extensions/mintable/Cargo.toml b/examples/psp22_extensions/mintable/Cargo.toml index 35594455e..c972dd1d7 100644 --- a/examples/psp22_extensions/mintable/Cargo.toml +++ b/examples/psp22_extensions/mintable/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "my_psp22_mintable" -version = "3.0.0" +version = "3.1.1" authors = ["Brushfam "] edition = "2021" diff --git a/examples/psp22_extensions/pausable/Cargo.toml b/examples/psp22_extensions/pausable/Cargo.toml index 9d5998e3c..d64320b41 100644 --- a/examples/psp22_extensions/pausable/Cargo.toml +++ b/examples/psp22_extensions/pausable/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "my_psp22_pausable" -version = "3.0.0" +version = "3.1.1" authors = ["Brushfam "] edition = "2021" diff --git a/examples/psp22_extensions/wrapper/Cargo.toml b/examples/psp22_extensions/wrapper/Cargo.toml index 41d3eb0a5..e315719f1 100644 --- a/examples/psp22_extensions/wrapper/Cargo.toml +++ b/examples/psp22_extensions/wrapper/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "my_psp22_wrapper" -version = "3.0.0" +version = "3.1.1" authors = ["Brushfam "] edition = "2021" diff --git a/examples/psp22_pallet/Cargo.toml b/examples/psp22_pallet/Cargo.toml index b91254c31..9fb79b98a 100644 --- a/examples/psp22_pallet/Cargo.toml +++ b/examples/psp22_pallet/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "my_psp22_pallet" -version = "3.0.0" +version = "3.1.1" authors = ["Brushfam "] edition = "2021" diff --git a/examples/psp22_pallet_extensions/burnable/Cargo.toml b/examples/psp22_pallet_extensions/burnable/Cargo.toml index 05ab9a5a1..3113362c9 100644 --- a/examples/psp22_pallet_extensions/burnable/Cargo.toml +++ b/examples/psp22_pallet_extensions/burnable/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "my_psp22_pallet_burnable" -version = "3.0.0" +version = "3.1.1" authors = ["Brushfam "] edition = "2021" diff --git a/examples/psp22_pallet_extensions/metadata/Cargo.toml b/examples/psp22_pallet_extensions/metadata/Cargo.toml index 3ebd87b09..fbc896ff9 100644 --- a/examples/psp22_pallet_extensions/metadata/Cargo.toml +++ b/examples/psp22_pallet_extensions/metadata/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "my_psp22_pallet_metadata" -version = "3.0.0" +version = "3.1.1" authors = ["Brushfam "] edition = "2021" diff --git a/examples/psp22_pallet_extensions/mintable/Cargo.toml b/examples/psp22_pallet_extensions/mintable/Cargo.toml index f4e1e7f1b..31fbba91a 100644 --- a/examples/psp22_pallet_extensions/mintable/Cargo.toml +++ b/examples/psp22_pallet_extensions/mintable/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "my_psp22_pallet_mintable" -version = "3.0.0" +version = "3.1.1" authors = ["Brushfam "] edition = "2021" diff --git a/examples/psp22_utils/token_timelock/Cargo.toml b/examples/psp22_utils/token_timelock/Cargo.toml index 9175729e9..3c08c1197 100644 --- a/examples/psp22_utils/token_timelock/Cargo.toml +++ b/examples/psp22_utils/token_timelock/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "my_psp22_token_timelock" -version = "3.0.0-beta.1" +version = "3.1.1" authors = ["Brushfam "] edition = "2021" diff --git a/examples/psp34/Cargo.toml b/examples/psp34/Cargo.toml index 962ba7796..d5dfa51dd 100644 --- a/examples/psp34/Cargo.toml +++ b/examples/psp34/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "my_psp34" -version = "3.0.0" +version = "3.1.1" authors = ["Brushfam "] edition = "2021" diff --git a/examples/psp34_extensions/burnable/Cargo.toml b/examples/psp34_extensions/burnable/Cargo.toml index b3681d00b..eab98e0b0 100644 --- a/examples/psp34_extensions/burnable/Cargo.toml +++ b/examples/psp34_extensions/burnable/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "my_psp34_burnable" -version = "3.0.0" +version = "3.1.1" authors = ["Brushfam "] edition = "2021" diff --git a/examples/psp34_extensions/enumerable/Cargo.toml b/examples/psp34_extensions/enumerable/Cargo.toml index 81d04f9dc..92e44495d 100644 --- a/examples/psp34_extensions/enumerable/Cargo.toml +++ b/examples/psp34_extensions/enumerable/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "my_psp34_enumerable" -version = "3.0.0" +version = "3.1.1" authors = ["Brushfam "] edition = "2021" diff --git a/examples/psp34_extensions/metadata/Cargo.toml b/examples/psp34_extensions/metadata/Cargo.toml index 6266664cb..4815f44f0 100644 --- a/examples/psp34_extensions/metadata/Cargo.toml +++ b/examples/psp34_extensions/metadata/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "my_psp34_metadata" -version = "3.0.0" +version = "3.1.1" authors = ["Brushfam "] edition = "2021" diff --git a/examples/psp34_extensions/mintable/Cargo.toml b/examples/psp34_extensions/mintable/Cargo.toml index 21ac032fe..71a3a767a 100644 --- a/examples/psp34_extensions/mintable/Cargo.toml +++ b/examples/psp34_extensions/mintable/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "my_psp34_mintable" -version = "3.0.0" +version = "3.1.1" authors = ["Brushfam "] edition = "2021" diff --git a/examples/psp37/Cargo.toml b/examples/psp37/Cargo.toml index 4c87d6cc7..cd00c32d6 100644 --- a/examples/psp37/Cargo.toml +++ b/examples/psp37/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "my_psp37" -version = "3.0.0-beta.1" +version = "3.1.1" authors = ["Brushfam "] edition = "2021" diff --git a/examples/psp37_extensions/batch/Cargo.toml b/examples/psp37_extensions/batch/Cargo.toml index bd24d9c94..6f40b4a26 100644 --- a/examples/psp37_extensions/batch/Cargo.toml +++ b/examples/psp37_extensions/batch/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "my_psp37_batch" -version = "3.0.0" +version = "3.1.1" authors = ["Brushfam "] edition = "2021" diff --git a/examples/psp37_extensions/burnable/Cargo.toml b/examples/psp37_extensions/burnable/Cargo.toml index 1b984dae1..5a9ed272b 100644 --- a/examples/psp37_extensions/burnable/Cargo.toml +++ b/examples/psp37_extensions/burnable/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "my_psp37_burnable" -version = "3.0.0" +version = "3.1.1" authors = ["Brushfam "] edition = "2021" diff --git a/examples/psp37_extensions/enumerable/Cargo.toml b/examples/psp37_extensions/enumerable/Cargo.toml index c333462e9..d7dffe3d0 100644 --- a/examples/psp37_extensions/enumerable/Cargo.toml +++ b/examples/psp37_extensions/enumerable/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "my_psp37_enumerable" -version = "3.0.0" +version = "3.1.1" authors = ["Brushfam "] edition = "2021" diff --git a/examples/psp37_extensions/metadata/Cargo.toml b/examples/psp37_extensions/metadata/Cargo.toml index 9d273f002..2c0d30646 100644 --- a/examples/psp37_extensions/metadata/Cargo.toml +++ b/examples/psp37_extensions/metadata/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "my_psp37_metadata" -version = "3.0.0" +version = "3.1.1" authors = ["Brushfam "] edition = "2021" diff --git a/examples/psp37_extensions/mintable/Cargo.toml b/examples/psp37_extensions/mintable/Cargo.toml index 9cdaa5fc3..82d1f0749 100644 --- a/examples/psp37_extensions/mintable/Cargo.toml +++ b/examples/psp37_extensions/mintable/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "my_psp37_mintable" -version = "3.0.0" +version = "3.1.1" authors = ["Brushfam "] edition = "2021" diff --git a/examples/reentrancy_guard/Cargo.toml b/examples/reentrancy_guard/Cargo.toml index fd34f0901..5ee81ee49 100644 --- a/examples/reentrancy_guard/Cargo.toml +++ b/examples/reentrancy_guard/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "flipper" -version = "3.0.0" +version = "3.1.1" authors = ["Brushfam "] edition = "2021" diff --git a/examples/reentrancy_guard/contracts/flip_on_me/Cargo.toml b/examples/reentrancy_guard/contracts/flip_on_me/Cargo.toml index 4c4c50c29..ac71869ce 100644 --- a/examples/reentrancy_guard/contracts/flip_on_me/Cargo.toml +++ b/examples/reentrancy_guard/contracts/flip_on_me/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "flip_on_me" -version = "3.0.0" +version = "3.1.1" authors = ["Brushfam "] edition = "2021" diff --git a/examples/reentrancy_guard/contracts/flipper/Cargo.toml b/examples/reentrancy_guard/contracts/flipper/Cargo.toml index 2ae6f869a..88bc441ad 100644 --- a/examples/reentrancy_guard/contracts/flipper/Cargo.toml +++ b/examples/reentrancy_guard/contracts/flipper/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "my_flipper_guard" -version = "3.0.0" +version = "3.1.1" authors = ["Brushfam "] edition = "2021" diff --git a/examples/test_helpers/Cargo.toml b/examples/test_helpers/Cargo.toml index 646c56315..a274be885 100644 --- a/examples/test_helpers/Cargo.toml +++ b/examples/test_helpers/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "test_helpers" -version = "3.0.0" +version = "3.1.1" authors = ["Brushfam "] edition = "2021" diff --git a/examples/timelock_controller/Cargo.toml b/examples/timelock_controller/Cargo.toml index 976c82f1c..86167acee 100644 --- a/examples/timelock_controller/Cargo.toml +++ b/examples/timelock_controller/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "my_timelock_controller" -version = "3.0.0" +version = "3.1.1" authors = ["Brushfam "] edition = "2021" diff --git a/lang/Cargo.toml b/lang/Cargo.toml index 4b96d4966..a3250c0ca 100644 --- a/lang/Cargo.toml +++ b/lang/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "openbrush_lang" -version = "3.0.0" +version = "3.1.1" authors = ["Brushfam "] edition = "2021" @@ -14,7 +14,7 @@ categories = ["no-std", "embedded"] include = ["Cargo.toml", "src/**/*.rs"] [dependencies] -openbrush_lang_macro = { version = "~3.0.0", path = "macro", default-features = false } +openbrush_lang_macro = { version = "~3.1.1", path = "macro", default-features = false } ink = { version = "4.1.0", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } diff --git a/lang/codegen/Cargo.toml b/lang/codegen/Cargo.toml index 153df10b9..f00a2848f 100644 --- a/lang/codegen/Cargo.toml +++ b/lang/codegen/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "openbrush_lang_codegen" -version = "3.0.0" +version = "3.1.1" authors = ["Brushfam "] edition = "2021" diff --git a/lang/macro/Cargo.toml b/lang/macro/Cargo.toml index 5cd899564..2532b5e25 100644 --- a/lang/macro/Cargo.toml +++ b/lang/macro/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "openbrush_lang_macro" -version = "3.0.0" +version = "3.1.1" authors = ["Brushfam "] edition = "2021" @@ -14,7 +14,7 @@ categories = ["no-std", "embedded"] include = ["Cargo.toml", "src/**/*.rs"] [dependencies] -openbrush_lang_codegen = { version = "~3.0.0", path = "../codegen", default-features = false } +openbrush_lang_codegen = { version = "~3.1.1", path = "../codegen", default-features = false } syn = "1" proc-macro2 = "1" synstructure = "0.12" diff --git a/mock/flash-borrower/Cargo.toml b/mock/flash-borrower/Cargo.toml index cd62e6c3b..e191e5fc4 100644 --- a/mock/flash-borrower/Cargo.toml +++ b/mock/flash-borrower/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "flash_borrower" -version = "3.0.0" +version = "3.1.1" authors = ["Brushfam "] edition = "2021" From c937eddea4e7b02b7cc888a8149ebaf8dd200427 Mon Sep 17 00:00:00 2001 From: Artemka374 Date: Fri, 5 May 2023 16:26:51 +0300 Subject: [PATCH 2/3] delete mock folder, move flash-borrower to examples --- Cargo.toml | 1 - {mock => examples}/flash-borrower/Cargo.toml | 0 {mock => examples}/flash-borrower/lib.rs | 0 3 files changed, 1 deletion(-) rename {mock => examples}/flash-borrower/Cargo.toml (100%) rename {mock => examples}/flash-borrower/lib.rs (100%) diff --git a/Cargo.toml b/Cargo.toml index 053236656..847a6abb3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,7 +7,6 @@ members = [ exclude = [ "examples", "example_project_structure", - "mock" ] [package] diff --git a/mock/flash-borrower/Cargo.toml b/examples/flash-borrower/Cargo.toml similarity index 100% rename from mock/flash-borrower/Cargo.toml rename to examples/flash-borrower/Cargo.toml diff --git a/mock/flash-borrower/lib.rs b/examples/flash-borrower/lib.rs similarity index 100% rename from mock/flash-borrower/lib.rs rename to examples/flash-borrower/lib.rs From b2aa40aa76d7a453be4c357118f98159c33f4c28 Mon Sep 17 00:00:00 2001 From: Artemka374 Date: Fri, 5 May 2023 16:38:34 +0300 Subject: [PATCH 3/3] update docs --- docs/docs/smart-contracts/proxy.md | 1 + docs/docs/smart-contracts/upgradeable.md | 34 +++++++++++++----------- lang/macro/src/lib.rs | 2 -- 3 files changed, 19 insertions(+), 18 deletions(-) diff --git a/docs/docs/smart-contracts/proxy.md b/docs/docs/smart-contracts/proxy.md index acf4e2f10..b2d5c2bb1 100644 --- a/docs/docs/smart-contracts/proxy.md +++ b/docs/docs/smart-contracts/proxy.md @@ -8,6 +8,7 @@ This example shows how you can use the implementation of [proxy](https://github. ## Disclaimer Delegate calls [were marked](https://github.com/paritytech/ink/pull/1331#discussion_r953736863) as a possible attack vector in ink! Therefore the `Proxy` pattern will not work within OpenBrush until this is reimplemented in ink! 4. +You can use this tutorial for general understanding of `Proxy` pattern. ## Step 1: Import default implementation diff --git a/docs/docs/smart-contracts/upgradeable.md b/docs/docs/smart-contracts/upgradeable.md index 2c8f552f5..02ea2b569 100644 --- a/docs/docs/smart-contracts/upgradeable.md +++ b/docs/docs/smart-contracts/upgradeable.md @@ -13,7 +13,14 @@ Upgradeability allows experimenting and deploying the product at the early stage Decentralization can be achieved by providing the right to upgrade only to decentralized authority like governance, multisig, or another analog. -There is also a possibility of smart contract upgradeability via `Proxy` and `Diamond` patterns, but these use `DelegateCall`. Delegate calls [were marked](https://github.com/paritytech/ink/pull/1331#discussion_r953736863) as a possible attack vector in ink! Therefore the `Proxy` and `Diamond` patterns will not work within OpenBrush until this is reimplemented in ink! 4. +There is also a possibility of smart contract upgradeability via `Proxy` and `Diamond` patterns, but these use `DelegateCall`. +Right now contracts that use `DelegateCall` are not supported by OpenBrush due to latest ink! changes, for more information, please check the following issues: + +- https://github.com/paritytech/ink/pull/1331#discussion_r953736863 +- https://github.com/Brushfam/openbrush-contracts/issues/36 + +Our team is currently working on the new approach of working with `DelegateCall`. For now, we recommend using `Lazy` struct +for the upgradeable contracts. `Lazy` is a wrapper for a storage field, that allows you to set it to its definite storage key. ## Storage layout @@ -84,11 +91,12 @@ With this approach, you can order your units as you wish. You can add/remove/swa logic units and don't worry about storage layout because each logic unit will have its space in the blockchain's storage. If storage keys are unique, those spaces don't overlap. -OpenBrush provides [`openbrush::upgradeable_storage`](https://github.com/727-Ventures/openbrush-contracts/blob/main/lang/macro/src/lib.rs#L447) -attribute macro that implements all required traits with specified storage key(storage key is required input argument to macro). -Also, macro initializes the field with a default value if the field is not initialized before -(it can be actual during the upgrade because new fields are not initialized yet). -You can use that macro to define a logic unit. +OpenBrush provides [`openbrush::upgradeable_storage`](https://github.com/727-Ventures/openbrush-contracts/blob/main/lang/macro/src/lib.rs#L447) +attribute macro that implements some of the required traits with specified storage key(storage key is required input argument to macro). +This way, macro will define the storage key for this struct, but WILL NOT set this struct by it's storage key automatically. +So, you will need to perform such actions manually, or use `Lazy` wrapper. All of the `Lazy` and `Mapping` units that are defined inside of the type +will have their definite storage keys to prevent storage corruption, also it will implement traits to ease the work with storage, +like `Storage` to be accessible by using `.data()` method later. > **Note**: Each logic unit should have a unique storage key. The storage key should be used only once in the contract. @@ -393,6 +401,9 @@ of your contract, permission system, etc. ### The `Diamond` Standard +### Disclaimer +Right now, you can't use diamond standard in OpenBrush because of the problems with delegate calls. + Using `Diamond` Standard you can add support for several facets(logic layers) that can be upgraded. [This standard](https://eips.ethereum.org/EIPS/eip-2535) came from the ethereum network. It works in the same way in ink! but instead of the @@ -410,9 +421,6 @@ Each selector is unique and belongs only to one facet. So selectors of facets ca call to the smart contract to the corresponding facet (logic layer). `Diamond` contract has a function `diamond_cut` that allows registering each facet. -OpenBrush provides default implementation for `Diamond` standard on ink!. -For more details you can check [Diamond](diamond/diamond.md). - All suggestions above ideally describe how to develop an upgradeable contract with multi-logic layers and many logic units. So here we will describe how to write facets (logic layers) with OpenBrush. @@ -425,13 +433,7 @@ with storage. Each logic unit should have a unique storage key and be upgradeable (support initialization on demand, use storage key as an offset for all inner fields). It can be a struct with one or many fields (structs without fields are useless) or an enum with at least two -variants (an enum with one variant is a structure). You can define struct/enum with the -`openbrush::upgradeable_storage` macro and have an independent logic unit. You can -create several units and combine them into one contract. - -> **Note**: If your contract has at least one field that is not defined with the -`openbrush::upgradeable_storage`, it will fail during execution. Each field should be -upgradeable in the facet. +variants (an enum with one variant is a structure). As an example, we will define logic units for `PSP22` and `Ownable` facets. diff --git a/lang/macro/src/lib.rs b/lang/macro/src/lib.rs index ba2ab2700..891a902c4 100644 --- a/lang/macro/src/lib.rs +++ b/lang/macro/src/lib.rs @@ -426,8 +426,6 @@ pub fn wrapper(attrs: TokenStream, input: TokenStream) -> TokenStream { synstructure::decl_attribute!( [upgradeable_storage] => /// That macro implemented `OccupyStorage` - /// with a specified storage key instead of the default one (All data is stored under - /// the provided storage key). /// /// Also, that macro adds the code to initialize the structure if it wasn't initialized. /// That macro requires one input argument - the storage key. It can be any Rust code that returns