From c6ca55b2986363927604e93086ebc111af989ef6 Mon Sep 17 00:00:00 2001 From: xgreenx Date: Fri, 27 May 2022 19:49:17 +0200 Subject: [PATCH 01/10] Refactored brush_lang to be ready for publishing in crate.io --- Cargo.toml | 7 +-- {utils/brush_derive => brush_lang}/.gitignore | 0 {utils/brush_lang => brush_lang}/Cargo.toml | 13 ++-- .../codegen}/.gitignore | 0 brush_lang/codegen/Cargo.toml | 30 ++++++++++ .../codegen}/contract.rs | 11 ++-- .../codegen}/internal.rs | 4 +- brush_lang/codegen/lib.rs | 31 ++++++++++ .../codegen}/metadata.rs | 4 +- .../codegen}/modifier_definition.rs | 8 +-- .../codegen}/modifiers.rs | 11 ++-- .../codegen}/storage.rs | 28 ++++----- .../codegen}/trait_definition.rs | 8 +-- .../codegen}/wrapper.rs | 8 +-- .../lib.rs => brush_lang/derive.rs | 2 - {utils/brush_lang => brush_lang}/lib.rs | 8 +-- .../macro}/.gitignore | 0 .../macro}/Cargo.toml | 22 +++---- .../proc_macros => brush_lang/macro}/lib.rs | 31 +++++----- .../brush_lang => brush_lang/macro}/macros.rs | 0 brush_lang/macros.rs | 60 +++++++++++++++++++ .../lib.rs => brush_lang/test_utils.rs | 2 - {utils/brush_lang => brush_lang}/traits.rs | 2 - contracts/Cargo.toml | 4 +- contracts/derive/Cargo.toml | 4 +- contracts/derive/lib.rs | 2 +- docs/docs/smart-contracts/PSP1155/psp1155.md | 2 +- .../PSP22/Extensions/capped.md | 2 +- .../PSP22/Extensions/pausable.md | 2 +- .../PSP22/Extensions/wrapper.md | 2 +- .../PSP22/Utils/token-timelock.md | 2 +- docs/docs/smart-contracts/PSP22/psp22.md | 2 +- .../PSP34/Extensions/metadata.md | 2 +- docs/docs/smart-contracts/PSP34/psp34.md | 2 +- docs/docs/smart-contracts/access-control.md | 2 +- docs/docs/smart-contracts/diamond.md | 2 +- docs/docs/smart-contracts/example/data.md | 2 +- docs/docs/smart-contracts/overview.md | 2 +- docs/docs/smart-contracts/ownable.md | 2 +- docs/docs/smart-contracts/pausable.md | 2 +- docs/docs/smart-contracts/payment-splitter.md | 2 +- docs/docs/smart-contracts/proxy.md | 2 +- docs/docs/smart-contracts/reentrancy-guard.md | 2 +- .../smart-contracts/timelock-controller.md | 2 +- example_project_structure/Cargo.toml | 2 +- .../contracts/lending/Cargo.toml | 2 +- .../contracts/loan/Cargo.toml | 2 +- .../contracts/shares/Cargo.toml | 2 +- .../contracts/stable_coin/Cargo.toml | 2 +- example_project_structure/derive/Cargo.toml | 6 +- example_project_structure/derive/lib.rs | 2 +- examples/access_control/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 +- .../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 +- .../psp22_metadata_upgradeable/Cargo.toml | 2 +- examples/proxy/psp22_upgradeable/Cargo.toml | 2 +- examples/psp1155/Cargo.toml | 2 +- .../psp1155_extensions/burnable/Cargo.toml | 2 +- .../psp1155_extensions/metadata/Cargo.toml | 2 +- .../psp1155_extensions/mintable/Cargo.toml | 2 +- examples/psp22/Cargo.toml | 2 +- examples/psp22_extensions/burnable/Cargo.toml | 2 +- examples/psp22_extensions/capped/Cargo.toml | 2 +- .../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 +- .../psp22_utils/token_timelock/Cargo.toml | 2 +- examples/psp34/Cargo.toml | 2 +- examples/psp34_extensions/burnable/Cargo.toml | 2 +- .../psp34_extensions/enumerable/Cargo.toml | 2 +- examples/psp34_extensions/metadata/Cargo.toml | 2 +- examples/psp34_extensions/mintable/Cargo.toml | 2 +- examples/reentrancy_guard/Cargo.toml | 2 +- .../contracts/flip_on_me/Cargo.toml | 2 +- .../contracts/flipper/Cargo.toml | 2 +- examples/timelock_controller/Cargo.toml | 2 +- mock/flash-borrower/Cargo.toml | 2 +- mock/psp1155-receiver/Cargo.toml | 2 +- mock/psp22-receiver/Cargo.toml | 2 +- mock/psp34-receiver/Cargo.toml | 2 +- utils/brush_derive/Cargo.toml | 16 ----- utils/brush_lang/test_utils/Cargo.toml | 28 --------- 91 files changed, 270 insertions(+), 204 deletions(-) rename {utils/brush_derive => brush_lang}/.gitignore (100%) rename {utils/brush_lang => brush_lang}/Cargo.toml (61%) rename {utils/brush_lang => brush_lang/codegen}/.gitignore (100%) create mode 100644 brush_lang/codegen/Cargo.toml rename {utils/brush_lang/proc_macros => brush_lang/codegen}/contract.rs (93%) rename {utils/brush_lang/proc_macros => brush_lang/codegen}/internal.rs (98%) create mode 100644 brush_lang/codegen/lib.rs rename {utils/brush_lang/proc_macros => brush_lang/codegen}/metadata.rs (97%) rename {utils/brush_lang/proc_macros => brush_lang/codegen}/modifier_definition.rs (97%) rename {utils/brush_lang/proc_macros => brush_lang/codegen}/modifiers.rs (95%) rename {utils/brush_lang/proc_macros => brush_lang/codegen}/storage.rs (92%) rename {utils/brush_lang/proc_macros => brush_lang/codegen}/trait_definition.rs (98%) rename {utils/brush_lang/proc_macros => brush_lang/codegen}/wrapper.rs (94%) rename utils/brush_derive/lib.rs => brush_lang/derive.rs (98%) rename {utils/brush_lang => brush_lang}/lib.rs (89%) rename {utils/brush_lang/proc_macros => brush_lang/macro}/.gitignore (100%) rename {utils/brush_lang/proc_macros => brush_lang/macro}/Cargo.toml (69%) rename {utils/brush_lang/proc_macros => brush_lang/macro}/lib.rs (97%) rename {utils/brush_lang => brush_lang/macro}/macros.rs (100%) create mode 100644 brush_lang/macros.rs rename utils/brush_lang/test_utils/lib.rs => brush_lang/test_utils.rs (98%) rename {utils/brush_lang => brush_lang}/traits.rs (98%) delete mode 100644 utils/brush_derive/Cargo.toml delete mode 100644 utils/brush_lang/test_utils/Cargo.toml diff --git a/Cargo.toml b/Cargo.toml index 237e6b711..6e2e32d3a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,8 +1,7 @@ [workspace] members = [ "contracts", - "utils/brush_lang", - "utils/brush_derive", + "brush_lang", ] exclude = [ @@ -13,13 +12,13 @@ exclude = [ [package] name = "brush" -version = "1.7.1" +version = "1.8.0" authors = ["Supercolony "] edition = "2018" [dependencies] contracts = { path = "./contracts", default-features = false } -brush_lang = { path = "./utils/brush_lang", default-features = false } +brush_lang = { path = "./brush_lang", default-features = false } [lib] name = "brush" diff --git a/utils/brush_derive/.gitignore b/brush_lang/.gitignore similarity index 100% rename from utils/brush_derive/.gitignore rename to brush_lang/.gitignore diff --git a/utils/brush_lang/Cargo.toml b/brush_lang/Cargo.toml similarity index 61% rename from utils/brush_lang/Cargo.toml rename to brush_lang/Cargo.toml index 47dff4c2a..96f4e6d95 100644 --- a/utils/brush_lang/Cargo.toml +++ b/brush_lang/Cargo.toml @@ -1,16 +1,19 @@ [package] name = "brush_lang" -version = "1.7.1" +version = "1.8.0" authors = ["Supercolony "] edition = "2021" [dependencies] +brush_lang_macro = { version = "1.8.0", path = "macro", default-features = false } + ink_env = { version = "3.2.0", default-features = false } ink_lang = { version = "3.2.0", default-features = false } ink_primitives = { version = "3.2.0", default-features = false } ink_storage = { version = "3.2.0", default-features = false } -proc_macros = { path = "proc_macros" } -test_utils = { path = "test_utils", default-features = false } + +scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } +scale-info = { version = "2", default-features = false, features = ["derive"] } [lib] name = "brush_lang" @@ -22,9 +25,11 @@ crate-type = [ [features] default = ["std"] std = [ + "brush_lang_macro/std", "ink_env/std", "ink_lang/std", "ink_primitives/std", "ink_storage/std", - "test_utils/std", + "scale/std", + "scale-info/std", ] \ No newline at end of file diff --git a/utils/brush_lang/.gitignore b/brush_lang/codegen/.gitignore similarity index 100% rename from utils/brush_lang/.gitignore rename to brush_lang/codegen/.gitignore diff --git a/brush_lang/codegen/Cargo.toml b/brush_lang/codegen/Cargo.toml new file mode 100644 index 000000000..d34b36a87 --- /dev/null +++ b/brush_lang/codegen/Cargo.toml @@ -0,0 +1,30 @@ +[package] +name = "brush_lang_codegen" +version = "1.8.0" +authors = ["Supercolony "] +edition = "2021" + +[dependencies] +syn = { version = "1", features = ["parsing", "full", "visit", "extra-traits"] } +quote = "1" +proc-macro2 = "1" +serde_json = "1.0.64" +fs2 = "0.4.3" +serde = { version = "1.0", features = ["derive"] } +cargo_metadata = "0.13.1" +unwrap = "1.2.1" +blake2 = "0.9" +heck = "0.3.1" +ink_lang_ir = { version = "3.2.0", default-features = false } +synstructure = "0.12" + +[lib] +name = "brush_lang_codegen" +path = "lib.rs" +crate-type = [ + "rlib", +] + +[features] +default = ["std"] +std = [] \ No newline at end of file diff --git a/utils/brush_lang/proc_macros/contract.rs b/brush_lang/codegen/contract.rs similarity index 93% rename from utils/brush_lang/proc_macros/contract.rs rename to brush_lang/codegen/contract.rs index 3979dfd0e..29aaf37a6 100644 --- a/utils/brush_lang/proc_macros/contract.rs +++ b/brush_lang/codegen/contract.rs @@ -25,20 +25,19 @@ use crate::{ metadata::LockedTrait, trait_definition, }; -use proc_macro::TokenStream; -use proc_macro2::TokenStream as TokenStream2; +use proc_macro2::TokenStream; use quote::{ quote, ToTokens, }; use syn::Item; -pub(crate) fn generate(_attrs: TokenStream, ink_module: TokenStream) -> TokenStream { +pub fn generate(_attrs: TokenStream, ink_module: TokenStream) -> TokenStream { if internal::skip() { return (quote! {}).into() } - let input: TokenStream2 = ink_module.into(); - let attrs: TokenStream2 = _attrs.into(); + let input: TokenStream = ink_module.into(); + let attrs: TokenStream = _attrs.into(); let mut module = syn::parse2::(input.clone()).expect("Can't parse contract module"); let (braces, mut items) = match module.content { Some((brace, items)) => (brace, items), @@ -72,7 +71,7 @@ fn consume_traits(items: Vec) -> Vec { if is_attr(&item_trait.attrs, "trait_definition") { item_trait.attrs = remove_attr(&item_trait.attrs, "trait_definition"); - let stream: TokenStream2 = + let stream: TokenStream = trait_definition::generate(TokenStream::new(), item_trait.to_token_stream().into()).into(); let mod_item = syn::parse2::(quote! { mod jora { diff --git a/utils/brush_lang/proc_macros/internal.rs b/brush_lang/codegen/internal.rs similarity index 98% rename from utils/brush_lang/proc_macros/internal.rs rename to brush_lang/codegen/internal.rs index 25c217a2b..d7797d64c 100644 --- a/utils/brush_lang/proc_macros/internal.rs +++ b/brush_lang/codegen/internal.rs @@ -23,7 +23,7 @@ extern crate proc_macro; use crate::metadata::TraitDefinition; use heck::CamelCase as _; -use proc_macro2::TokenStream as TokenStream2; +use proc_macro2::TokenStream; use quote::{ format_ident, quote, @@ -304,7 +304,7 @@ pub(crate) fn extract_attr(attrs: &mut Vec, ident: &str) -> Vec< } #[inline] -pub(crate) fn new_attribute(attr_stream: TokenStream2) -> syn::Attribute { +pub(crate) fn new_attribute(attr_stream: TokenStream) -> syn::Attribute { syn::parse2::(attr_stream).unwrap().attr()[0].clone() } diff --git a/brush_lang/codegen/lib.rs b/brush_lang/codegen/lib.rs new file mode 100644 index 000000000..6139eedcc --- /dev/null +++ b/brush_lang/codegen/lib.rs @@ -0,0 +1,31 @@ +// Copyright (c) 2012-2022 Supercolony +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the"Software"), +// to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +#![feature(drain_filter)] + +pub mod contract; +pub mod internal; +pub mod metadata; +pub mod modifier_definition; +pub mod modifiers; +pub mod storage; +pub mod trait_definition; +pub mod wrapper; diff --git a/utils/brush_lang/proc_macros/metadata.rs b/brush_lang/codegen/metadata.rs similarity index 97% rename from utils/brush_lang/proc_macros/metadata.rs rename to brush_lang/codegen/metadata.rs index 073f0b888..2a39cb0a0 100644 --- a/utils/brush_lang/proc_macros/metadata.rs +++ b/brush_lang/codegen/metadata.rs @@ -21,7 +21,7 @@ use cargo_metadata::camino::Utf8PathBuf; use fs2::FileExt; -use proc_macro2::TokenStream as TokenStream2; +use proc_macro2::TokenStream; use quote::ToTokens; use serde_json; use std::{ @@ -79,7 +79,7 @@ impl LockedTrait { let reader = BufReader::new(&file); let token_string: String = serde_json::from_reader(reader).unwrap_or_default(); - let stream = TokenStream2::from_str(token_string.as_str()).unwrap_or_default(); + let stream = TokenStream::from_str(token_string.as_str()).unwrap_or_default(); let trait_item = syn::parse2::(stream).map_or(None, |item| Some(item)); let trait_definition; diff --git a/utils/brush_lang/proc_macros/modifier_definition.rs b/brush_lang/codegen/modifier_definition.rs similarity index 97% rename from utils/brush_lang/proc_macros/modifier_definition.rs rename to brush_lang/codegen/modifier_definition.rs index 32351057d..63d993398 100644 --- a/utils/brush_lang/proc_macros/modifier_definition.rs +++ b/brush_lang/codegen/modifier_definition.rs @@ -19,20 +19,20 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -use proc_macro::TokenStream; +use proc_macro2::TokenStream; use quote::{ quote, quote_spanned, ToTokens, }; use syn::{ - parse_macro_input, + parse2, spanned::Spanned, ItemFn, }; -pub(crate) fn generate(_: TokenStream, _input: TokenStream) -> TokenStream { - let fn_item = parse_macro_input!(_input as ItemFn); +pub fn generate(_: TokenStream, _input: TokenStream) -> TokenStream { + let fn_item: ItemFn = parse2(_input).unwrap(); if fn_item.sig.inputs.len() < 2 { return (quote_spanned! { diff --git a/utils/brush_lang/proc_macros/modifiers.rs b/brush_lang/codegen/modifiers.rs similarity index 95% rename from utils/brush_lang/proc_macros/modifiers.rs rename to brush_lang/codegen/modifiers.rs index ea547b402..65c34216e 100644 --- a/utils/brush_lang/proc_macros/modifiers.rs +++ b/brush_lang/codegen/modifiers.rs @@ -24,9 +24,8 @@ use crate::internal::{ NestedMeta, BRUSH_PREFIX, }; -use proc_macro::TokenStream; use proc_macro2::{ - TokenStream as TokenStream2, + TokenStream, TokenTree, }; use quote::{ @@ -36,15 +35,15 @@ use quote::{ ToTokens, }; use syn::{ - parse_macro_input, + parse2, spanned::Spanned, ImplItemMethod, }; const INSTANCE: &'static str = "__brush_instance_modifier"; -pub(crate) fn generate(_attrs: TokenStream, _input: TokenStream) -> TokenStream { - let modifiers = parse_macro_input!(_attrs as AttributeArgs); +pub fn generate(_attrs: TokenStream, _input: TokenStream) -> TokenStream { + let modifiers: AttributeArgs = parse2(_attrs).unwrap(); let mut impl_item = syn::parse2::(_input.into()).expect("Can't parse input of `modifiers` macro like a method."); @@ -143,7 +142,7 @@ fn replace_self(block: syn::Block) -> syn::Block { syn::parse2::(recursive_replace_self(block.to_token_stream())).expect("Recursion was successful") } -fn recursive_replace_self(token_stream: TokenStream2) -> TokenStream2 { +fn recursive_replace_self(token_stream: TokenStream) -> TokenStream { token_stream .into_iter() .map(|token| { diff --git a/utils/brush_lang/proc_macros/storage.rs b/brush_lang/codegen/storage.rs similarity index 92% rename from utils/brush_lang/proc_macros/storage.rs rename to brush_lang/codegen/storage.rs index 2344851b6..6e0e5e088 100644 --- a/utils/brush_lang/proc_macros/storage.rs +++ b/brush_lang/codegen/storage.rs @@ -19,7 +19,7 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -use proc_macro2::TokenStream as TokenStream2; +use proc_macro2::TokenStream; use quote::{ quote, ToTokens, @@ -36,7 +36,7 @@ use quote::{ /// ```no_compile /// max(a, b) = [a, b][(a < b) as usize] /// ``` -fn max_n(args: &[TokenStream2]) -> TokenStream2 { +fn max_n(args: &[TokenStream]) -> TokenStream { match args.split_first() { Some((head, rest)) => { let rest = max_n(rest); @@ -49,7 +49,7 @@ fn max_n(args: &[TokenStream2]) -> TokenStream2 { } /// Generates the tokens for the `SpreadLayout` footprint of some type. -fn footprint(s: &synstructure::Structure) -> TokenStream2 { +fn footprint(s: &synstructure::Structure) -> TokenStream { let variant_footprints = s .variants() .iter() @@ -69,7 +69,7 @@ fn footprint(s: &synstructure::Structure) -> TokenStream2 { } /// Generates the tokens for the `SpreadLayout` `REQUIRES_DEEP_CLEAN_UP` constant for the given structure. -fn requires_deep_clean_up(s: &synstructure::Structure) -> TokenStream2 { +fn requires_deep_clean_up(s: &synstructure::Structure) -> TokenStream { s.variants() .iter() .map(|variant| { @@ -89,7 +89,7 @@ fn requires_deep_clean_up(s: &synstructure::Structure) -> TokenStream2 { } /// `SpreadLayout` derive implementation for `struct` types. -fn spread_layout_struct_derive(storage_key: &TokenStream2, s: &synstructure::Structure) -> TokenStream2 { +fn spread_layout_struct_derive(storage_key: &TokenStream, s: &synstructure::Structure) -> TokenStream { assert!(s.variants().len() == 1, "can only operate on structs"); let footprint_body = footprint(s); let requires_deep_clean_up_body = requires_deep_clean_up(s); @@ -148,7 +148,7 @@ fn spread_layout_struct_derive(storage_key: &TokenStream2, s: &synstructure::Str } /// `SpreadLayout` derive implementation for `enum` types. -fn spread_layout_enum_derive(storage_key: &TokenStream2, s: &synstructure::Structure) -> TokenStream2 { +fn spread_layout_enum_derive(storage_key: &TokenStream, s: &synstructure::Structure) -> TokenStream { assert!( !s.variants().is_empty(), "encountered invalid empty enum type deriving SpreadLayout trait" @@ -244,7 +244,7 @@ fn spread_layout_enum_derive(storage_key: &TokenStream2, s: &synstructure::Struc } /// Derives `ink_storage`'s `SpreadAllocate` trait for the given type. -pub fn spread_allocate_derive(storage_key: &TokenStream2, mut s: synstructure::Structure) -> TokenStream2 { +pub fn spread_allocate_derive(storage_key: &TokenStream, mut s: synstructure::Structure) -> TokenStream { s.bind_with(|_| synstructure::BindStyle::Move) .add_bounds(synstructure::AddBounds::Generics) .underscore_const(true); @@ -260,7 +260,7 @@ pub fn spread_allocate_derive(storage_key: &TokenStream2, mut s: synstructure::S } /// Derives `ink_storage`'s `SpreadAllocate` trait for the given `struct`. -fn derive_struct(storage_key: &TokenStream2, s: synstructure::Structure) -> TokenStream2 { +fn derive_struct(storage_key: &TokenStream, s: synstructure::Structure) -> TokenStream { assert!(s.variants().len() == 1, "can only operate on structs"); let variant = &s.variants()[0]; let allocate_body = variant.construct(|field, _index| { @@ -282,7 +282,7 @@ fn derive_struct(storage_key: &TokenStream2, s: synstructure::Structure) -> Toke }) } -pub fn spread_layout_derive(storage_key: &TokenStream2, mut s: synstructure::Structure) -> TokenStream2 { +pub fn spread_layout_derive(storage_key: &TokenStream, mut s: synstructure::Structure) -> TokenStream { s.bind_with(|_| synstructure::BindStyle::Move) .add_bounds(synstructure::AddBounds::None) .underscore_const(true); @@ -295,7 +295,7 @@ pub fn spread_layout_derive(storage_key: &TokenStream2, mut s: synstructure::Str } } -fn field_layout<'a>(variant: &'a synstructure::VariantInfo) -> impl Iterator + 'a { +fn field_layout<'a>(variant: &'a synstructure::VariantInfo) -> impl Iterator + 'a { variant.ast().fields.iter().map(|field| { let ident = match field.ident.as_ref() { Some(ident) => { @@ -314,7 +314,7 @@ fn field_layout<'a>(variant: &'a synstructure::VariantInfo) -> impl Iterator TokenStream2 { +fn storage_layout_struct(storage_key: &TokenStream, s: &synstructure::Structure) -> TokenStream { assert!(matches!(s.ast().data, syn::Data::Struct(_)), "s must be a struct item"); assert!(s.variants().len() == 1, "structs must have at most one variant"); let variant: &synstructure::VariantInfo = &s.variants()[0]; @@ -335,7 +335,7 @@ fn storage_layout_struct(storage_key: &TokenStream2, s: &synstructure::Structure }) } -fn storage_layout_enum(storage_key: &TokenStream2, s: &synstructure::Structure) -> TokenStream2 { +fn storage_layout_enum(storage_key: &TokenStream, s: &synstructure::Structure) -> TokenStream { assert!(matches!(s.ast().data, syn::Data::Enum(_)), "s must be an enum item"); let variant_layouts = s.variants().iter().enumerate().map(|(n, variant)| { let discriminant = variant @@ -379,7 +379,7 @@ fn storage_layout_enum(storage_key: &TokenStream2, s: &synstructure::Structure) }) } -pub fn storage_layout_derive(storage_key: &TokenStream2, mut s: synstructure::Structure) -> TokenStream2 { +pub fn storage_layout_derive(storage_key: &TokenStream, mut s: synstructure::Structure) -> TokenStream { s.bind_with(|_| synstructure::BindStyle::Move) .add_bounds(synstructure::AddBounds::Generics) .underscore_const(true); @@ -390,7 +390,7 @@ pub fn storage_layout_derive(storage_key: &TokenStream2, mut s: synstructure::St } } -pub fn storage(attrs: TokenStream2, s: synstructure::Structure) -> TokenStream2 { +pub fn storage(attrs: TokenStream, s: synstructure::Structure) -> TokenStream { let storage_key = attrs; let spread_layout = spread_layout_derive(&storage_key, s.clone()); diff --git a/utils/brush_lang/proc_macros/trait_definition.rs b/brush_lang/codegen/trait_definition.rs similarity index 98% rename from utils/brush_lang/proc_macros/trait_definition.rs rename to brush_lang/codegen/trait_definition.rs index eba45df96..06e455aeb 100644 --- a/utils/brush_lang/proc_macros/trait_definition.rs +++ b/brush_lang/codegen/trait_definition.rs @@ -31,7 +31,7 @@ use crate::{ }, }; use heck::CamelCase as _; -use proc_macro::TokenStream; +use proc_macro2::TokenStream; use quote::{ format_ident, quote, @@ -39,16 +39,16 @@ use quote::{ }; use std::collections::HashMap; use syn::{ - parse_macro_input, + parse2, ItemTrait, }; -pub(crate) fn generate(_attrs: TokenStream, _input: TokenStream) -> TokenStream { +pub fn generate(_attrs: TokenStream, _input: TokenStream) -> TokenStream { if crate::internal::skip() { return (quote! {}).into() } let attrs: proc_macro2::TokenStream = _attrs.into(); - let mut trait_item = parse_macro_input!(_input as ItemTrait); + let mut trait_item: ItemTrait = parse2(_input).unwrap(); let trait_without_ink_attrs; let ink_code; diff --git a/utils/brush_lang/proc_macros/wrapper.rs b/brush_lang/codegen/wrapper.rs similarity index 94% rename from utils/brush_lang/proc_macros/wrapper.rs rename to brush_lang/codegen/wrapper.rs index 93056d469..d261a1828 100644 --- a/utils/brush_lang/proc_macros/wrapper.rs +++ b/brush_lang/codegen/wrapper.rs @@ -19,18 +19,18 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -use proc_macro::TokenStream; +use proc_macro2::TokenStream; use quote::{ format_ident, quote, }; -use syn::parse_macro_input; +use syn::parse2; -pub(crate) fn generate(_: TokenStream, input: TokenStream) -> TokenStream { +pub fn generate(_: TokenStream, input: TokenStream) -> TokenStream { if crate::internal::skip() { return (quote! {}).into() } - let mut type_item = parse_macro_input!(input as syn::ItemType); + let mut type_item: syn::ItemType = parse2(input).unwrap(); if let syn::Type::TraitObject(traits) = &mut *type_item.ty { traits.bounds.iter_mut().for_each(|ty| { if let syn::TypeParamBound::Trait(t) = ty { diff --git a/utils/brush_derive/lib.rs b/brush_lang/derive.rs similarity index 98% rename from utils/brush_derive/lib.rs rename to brush_lang/derive.rs index 1894e58b4..c484eeb9b 100644 --- a/utils/brush_derive/lib.rs +++ b/brush_lang/derive.rs @@ -19,8 +19,6 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#![cfg_attr(not(feature = "std"), no_std)] - /// This `macro_rule` generates a procedural derive macro for storage trait. /// /// The first argument is the name of the procedural function. diff --git a/utils/brush_lang/lib.rs b/brush_lang/lib.rs similarity index 89% rename from utils/brush_lang/lib.rs rename to brush_lang/lib.rs index de56d635f..613fd95e1 100644 --- a/utils/brush_lang/lib.rs +++ b/brush_lang/lib.rs @@ -21,11 +21,12 @@ #![cfg_attr(not(feature = "std"), no_std)] -pub mod macros; +pub mod derive; +mod macros; +pub mod test_utils; pub mod traits; -// Each proc macro here is doing some kind of dark magic, be careful, you can summon the devil =) -pub use proc_macros::{ +pub use brush_lang_macro::{ contract, modifier_definition, modifiers, @@ -33,4 +34,3 @@ pub use proc_macros::{ trait_definition, wrapper, }; -pub use test_utils; diff --git a/utils/brush_lang/proc_macros/.gitignore b/brush_lang/macro/.gitignore similarity index 100% rename from utils/brush_lang/proc_macros/.gitignore rename to brush_lang/macro/.gitignore diff --git a/utils/brush_lang/proc_macros/Cargo.toml b/brush_lang/macro/Cargo.toml similarity index 69% rename from utils/brush_lang/proc_macros/Cargo.toml rename to brush_lang/macro/Cargo.toml index 2cf4368d4..b3a1ae463 100644 --- a/utils/brush_lang/proc_macros/Cargo.toml +++ b/brush_lang/macro/Cargo.toml @@ -1,21 +1,13 @@ [package] -name = "proc_macros" -version = "1.7.1" +name = "brush_lang_macro" +version = "1.8.0" authors = ["Supercolony "] edition = "2021" [dependencies] -syn = { version = "1", features = ["parsing", "full", "visit", "extra-traits"] } -quote = "1" +brush_lang_codegen = { version = "1.8.0", path = "../codegen", default-features = false } +syn = "1" proc-macro2 = "1" -serde_json = "1.0.64" -fs2 = "0.4.3" -serde = { version = "1.0", features = ["derive"] } -cargo_metadata = "0.13.1" -unwrap = "1.2.1" -blake2 = "0.9" -heck = "0.3.1" -ink_lang_ir = { version = "3.2.0", default-features = false } synstructure = "0.12" [dev-dependencies] @@ -32,10 +24,12 @@ scale-info = { version = "2", default-features = false, features = ["derive"] } brush = { package = "brush_lang", path = "..", default-features = false } [lib] -name = "proc_macros" +name = "brush_lang_macro" path = "lib.rs" proc-macro = true [features] default = ["std"] -std = [] \ No newline at end of file +std = [ + "brush_lang_codegen/std", +] \ No newline at end of file diff --git a/utils/brush_lang/proc_macros/lib.rs b/brush_lang/macro/lib.rs similarity index 97% rename from utils/brush_lang/proc_macros/lib.rs rename to brush_lang/macro/lib.rs index 8b574e701..e946709e6 100644 --- a/utils/brush_lang/proc_macros/lib.rs +++ b/brush_lang/macro/lib.rs @@ -19,20 +19,19 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#![feature(drain_filter)] -extern crate proc_macro; - -mod contract; -mod internal; -mod metadata; -mod modifier_definition; -mod modifiers; -mod storage; -mod trait_definition; -mod wrapper; +#![cfg_attr(not(feature = "std"), no_std)] use proc_macro::TokenStream; +use brush_lang_codegen::{ + contract, + modifier_definition, + modifiers, + storage, + trait_definition, + wrapper, +}; + /// Entry point for use brush's macros in ink! smart contracts. /// /// # Description @@ -43,7 +42,7 @@ use proc_macro::TokenStream; /// This macro consumes impl section for traits defined with [`#[brush::trait_definition]`](`macro@crate::trait_definition`). #[proc_macro_attribute] pub fn contract(_attrs: TokenStream, ink_module: TokenStream) -> TokenStream { - contract::generate(_attrs, ink_module) + contract::generate(_attrs.into(), ink_module.into()).into() } /// Defines extensible trait in the scope of brush::contract. @@ -194,7 +193,7 @@ pub fn contract(_attrs: TokenStream, ink_module: TokenStream) -> TokenStream { /// ``` #[proc_macro_attribute] pub fn trait_definition(_attrs: TokenStream, _input: TokenStream) -> TokenStream { - trait_definition::generate(_attrs, _input) + trait_definition::generate(_attrs.into(), _input.into()).into() } /// This macro only checks that some free-standing function satisfies a set of rules. @@ -225,7 +224,7 @@ pub fn trait_definition(_attrs: TokenStream, _input: TokenStream) -> TokenStream /// ``` #[proc_macro_attribute] pub fn modifier_definition(_attrs: TokenStream, _input: TokenStream) -> TokenStream { - modifier_definition::generate(_attrs, _input) + modifier_definition::generate(_attrs.into(), _input.into()).into() } /// Macro calls every modifier function by passing self and the code of function's body. @@ -358,7 +357,7 @@ pub fn modifier_definition(_attrs: TokenStream, _input: TokenStream) -> TokenStr /// ``` #[proc_macro_attribute] pub fn modifiers(_attrs: TokenStream, method: TokenStream) -> TokenStream { - modifiers::generate(_attrs, method) + modifiers::generate(_attrs.into(), method.into()).into() } /// This macro allows you to define a wrapper type for traits defined via @@ -422,7 +421,7 @@ pub fn modifiers(_attrs: TokenStream, method: TokenStream) -> TokenStream { /// ``` #[proc_macro_attribute] pub fn wrapper(attrs: TokenStream, input: TokenStream) -> TokenStream { - wrapper::generate(attrs, input) + wrapper::generate(attrs.into(), input.into()).into() } synstructure::decl_attribute!( diff --git a/utils/brush_lang/macros.rs b/brush_lang/macro/macros.rs similarity index 100% rename from utils/brush_lang/macros.rs rename to brush_lang/macro/macros.rs diff --git a/brush_lang/macros.rs b/brush_lang/macros.rs new file mode 100644 index 000000000..065a6ced9 --- /dev/null +++ b/brush_lang/macros.rs @@ -0,0 +1,60 @@ +// Copyright (c) 2012-2022 Supercolony +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the"Software"), +// to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +/// This `macro_rule` defines the storage trait. +/// +/// The first argument is the name of the storage trait. +/// The second argument is the type of storage data, which will be returned by this trait. +/// +/// An example of the usage of this macro can be found in any contract implemented by this library. +/// For example [OwnableStorage](ownable::OwnableStorage). +#[macro_export] +macro_rules! declare_storage_trait { + ($trait_name:ident,$data_ty:ty) => { + pub trait $trait_name: ::brush::traits::InkStorage { + fn get(&self) -> &$data_ty; + fn get_mut(&mut self) -> &mut $data_ty; + } + }; +} + +/// This `macro_rule` manually generates implementation for storage trait. +/// You can use this macro to generate the implementation for the storage trait +/// if you don't want to use derive macro, or if it is not created. +/// +/// The first argument is the name of the storage trait. +/// The second argument is the name of the struct, for which you are creating the impl section. +/// The third argument is the name of the field, which will be returned by the trait's implementation. +/// The fourth argument is the type of storage data, which will be returned. +#[macro_export] +macro_rules! impl_storage_trait { + ($trait_name:ident,$struct_name:ident,$field:ident,$data_ty:ty) => { + impl $trait_name for $struct_name { + fn get(&self) -> &$data_ty { + &self.$field + } + + fn get_mut(&mut self) -> &mut $data_ty { + &mut self.$field + } + } + }; +} diff --git a/utils/brush_lang/test_utils/lib.rs b/brush_lang/test_utils.rs similarity index 98% rename from utils/brush_lang/test_utils/lib.rs rename to brush_lang/test_utils.rs index 1498b6dc9..bbcc8049d 100644 --- a/utils/brush_lang/test_utils/lib.rs +++ b/brush_lang/test_utils.rs @@ -19,8 +19,6 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -#![cfg_attr(not(feature = "std"), no_std)] - use ink_env::{ hash::{ Blake2x256, diff --git a/utils/brush_lang/traits.rs b/brush_lang/traits.rs similarity index 98% rename from utils/brush_lang/traits.rs rename to brush_lang/traits.rs index b66cfd214..7aba40000 100644 --- a/utils/brush_lang/traits.rs +++ b/brush_lang/traits.rs @@ -33,7 +33,6 @@ pub type BlockNumber = ::BlockNumber; pub type ChainExtension = ::ChainExtension; pub type EnvAccess = ::ink_lang::EnvAccess<'static, DefaultEnvironment>; -#[crate::trait_definition] pub trait InkStorage: Sized { fn env() -> EnvAccess { Default::default() @@ -55,7 +54,6 @@ impl AccountIdExt for AccountId { } /// This trait is automatically implemented for storage. -#[crate::trait_definition] pub trait Flush: ::ink_storage::traits::SpreadLayout + InkStorage { /// Method flushes the current state of `Self` into storage. /// ink! recursively calculate a key of each field. diff --git a/contracts/Cargo.toml b/contracts/Cargo.toml index 18a24c39d..56a3253e4 100644 --- a/contracts/Cargo.toml +++ b/contracts/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "contracts" -version = "1.7.1" +version = "1.8.0" authors = ["Supercolony "] edition = "2021" @@ -16,7 +16,7 @@ scale = { package = "parity-scale-codec", version = "3", default-features = fals scale-info = { version = "2", default-features = false, features = ["derive"], optional = true } derive = { path = "./derive" } -brush = { package = "brush_lang", path = "../utils/brush_lang", default-features = false } +brush = { package = "brush_lang", path = "../brush_lang", default-features = false } [lib] name = "contracts" diff --git a/contracts/derive/Cargo.toml b/contracts/derive/Cargo.toml index 602394bcb..718ee40af 100644 --- a/contracts/derive/Cargo.toml +++ b/contracts/derive/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "derive" -version = "1.7.1" +version = "1.8.0" authors = ["Supercolony "] edition = "2021" @@ -8,7 +8,7 @@ edition = "2021" syn = { version = "1.0" } quote = "1.0" proc-macro2 = "1" -brush_derive = { path = "../../utils/brush_derive" } +brush_lang = { path = "../../brush_lang" } [lib] name = "derive" diff --git a/contracts/derive/lib.rs b/contracts/derive/lib.rs index fba840f42..21feb4f9b 100644 --- a/contracts/derive/lib.rs +++ b/contracts/derive/lib.rs @@ -23,7 +23,7 @@ extern crate proc_macro; #[allow(unused_imports)] -use brush_derive::declare_derive_storage_trait; +use brush_lang::declare_derive_storage_trait; // PSP22 #[cfg(feature = "psp22")] diff --git a/docs/docs/smart-contracts/PSP1155/psp1155.md b/docs/docs/smart-contracts/PSP1155/psp1155.md index 5513b04f3..9da3753ca 100644 --- a/docs/docs/smart-contracts/PSP1155/psp1155.md +++ b/docs/docs/smart-contracts/PSP1155/psp1155.md @@ -11,7 +11,7 @@ Include `brush` as dependency in the cargo file or you can use [default `Cargo.t After you need to enable default implementation of PSP1155 via `brush` feature. ```toml -brush = { tag = "v1.7.1", git = "https://github.com/Supercolony-net/openbrush-contracts", default-features = false, features = ["psp1155"] } +brush = { version = "1.8.0", default-features = false, features = ["psp1155"] } ``` ## Step 2: Add imports and enable unstable feature diff --git a/docs/docs/smart-contracts/PSP22/Extensions/capped.md b/docs/docs/smart-contracts/PSP22/Extensions/capped.md index 418717567..9bdff9288 100644 --- a/docs/docs/smart-contracts/PSP22/Extensions/capped.md +++ b/docs/docs/smart-contracts/PSP22/Extensions/capped.md @@ -11,7 +11,7 @@ Include `brush` as dependency in the cargo file or you can use [default `Cargo.t After you need to enable default implementation of PSP22 via `brush` features. ```toml -brush = { tag = "v1.7.1", git = "https://github.com/Supercolony-net/openbrush-contracts", default-features = false, features = ["psp22"] } +brush = { version = "1.8.0", default-features = false, features = ["psp22"] } ``` ## Step 2: Add imports and enable unstable feature diff --git a/docs/docs/smart-contracts/PSP22/Extensions/pausable.md b/docs/docs/smart-contracts/PSP22/Extensions/pausable.md index b19d582e9..3d400522f 100644 --- a/docs/docs/smart-contracts/PSP22/Extensions/pausable.md +++ b/docs/docs/smart-contracts/PSP22/Extensions/pausable.md @@ -11,7 +11,7 @@ Include `brush` as dependency in the cargo file or you can use [default `Cargo.t After you need to enable default implementation of PSP22 and Pausable via `brush` features. ```toml -brush = { tag = "v1.7.1", git = "https://github.com/Supercolony-net/openbrush-contracts", default-features = false, features = ["psp22", "pausable"] } +brush = { version = "1.8.0", default-features = false, features = ["psp22", "pausable"] } ``` ## Step 2: Add imports and enable unstable feature diff --git a/docs/docs/smart-contracts/PSP22/Extensions/wrapper.md b/docs/docs/smart-contracts/PSP22/Extensions/wrapper.md index 69daaf112..89f30ce80 100644 --- a/docs/docs/smart-contracts/PSP22/Extensions/wrapper.md +++ b/docs/docs/smart-contracts/PSP22/Extensions/wrapper.md @@ -11,7 +11,7 @@ Include `brush` as dependency in the cargo file or you can use [default `Cargo.t After you need to enable default implementation of PSP22 via `brush` features. ```toml -brush = { tag = "v1.7.1", git = "https://github.com/Supercolony-net/openbrush-contracts", default-features = false, features = ["psp22"] } +brush = { version = "1.8.0", default-features = false, features = ["psp22"] } ``` ## Step 2: Add imports and enable unstable feature diff --git a/docs/docs/smart-contracts/PSP22/Utils/token-timelock.md b/docs/docs/smart-contracts/PSP22/Utils/token-timelock.md index d46c824ef..77e7b835a 100644 --- a/docs/docs/smart-contracts/PSP22/Utils/token-timelock.md +++ b/docs/docs/smart-contracts/PSP22/Utils/token-timelock.md @@ -11,7 +11,7 @@ Include `brush` as dependency in the cargo file or you can use [default `Cargo.t After you need to enable default implementation of PSP22 via `brush` features. ```toml -brush = { tag = "v1.7.1", git = "https://github.com/Supercolony-net/openbrush-contracts", default-features = false, features = ["psp22"] } +brush = { version = "1.8.0", default-features = false, features = ["psp22"] } ``` ## Step 2: Add imports and enable unstable feature diff --git a/docs/docs/smart-contracts/PSP22/psp22.md b/docs/docs/smart-contracts/PSP22/psp22.md index 48b00fa99..015755f76 100644 --- a/docs/docs/smart-contracts/PSP22/psp22.md +++ b/docs/docs/smart-contracts/PSP22/psp22.md @@ -11,7 +11,7 @@ Include `brush` as dependency in the cargo file or you can use [default `Cargo.t After you need to enable default implementation of PSP22 via `brush` features. ```toml -brush = { tag = "v1.7.1", git = "https://github.com/Supercolony-net/openbrush-contracts", default-features = false, features = ["psp22"] } +brush = { version = "1.8.0", default-features = false, features = ["psp22"] } ``` ## Step 2: Add imports and enable unstable feature diff --git a/docs/docs/smart-contracts/PSP34/Extensions/metadata.md b/docs/docs/smart-contracts/PSP34/Extensions/metadata.md index 986455538..246b4af1c 100644 --- a/docs/docs/smart-contracts/PSP34/Extensions/metadata.md +++ b/docs/docs/smart-contracts/PSP34/Extensions/metadata.md @@ -11,7 +11,7 @@ Include `brush` as dependency in the cargo file or you can use [default `Cargo.t After you need to enable default implementation of PSP34 via `brush` features. ```toml -brush = { tag = "v1.7.1", git = "https://github.com/Supercolony-net/openbrush-contracts", default-features = false, features = ["psp34"] } +brush = { version = "1.8.0", default-features = false, features = ["psp34"] } ``` ## Step 2: Add imports and enable unstable feature diff --git a/docs/docs/smart-contracts/PSP34/psp34.md b/docs/docs/smart-contracts/PSP34/psp34.md index 30f94601d..ff625d788 100644 --- a/docs/docs/smart-contracts/PSP34/psp34.md +++ b/docs/docs/smart-contracts/PSP34/psp34.md @@ -11,7 +11,7 @@ Include `brush` as dependency in the cargo file or you can use [default `Cargo.t After you need to enable default implementation of PSP34 via `brush` features. ```toml -brush = { tag = "v1.7.1", git = "https://github.com/Supercolony-net/openbrush-contracts", default-features = false, features = ["psp34"] } +brush = { version = "1.8.0", default-features = false, features = ["psp34"] } ``` ## Step 2: Add imports and enable unstable feature diff --git a/docs/docs/smart-contracts/access-control.md b/docs/docs/smart-contracts/access-control.md index 0d2fcaef2..853e5bd95 100644 --- a/docs/docs/smart-contracts/access-control.md +++ b/docs/docs/smart-contracts/access-control.md @@ -11,7 +11,7 @@ Include `brush` as dependency in the cargo file or you can use [default `Cargo.t After you need to enable default implementation of Access Control via `brush` features. ```toml -brush = { tag = "v1.7.1", git = "https://github.com/Supercolony-net/openbrush-contracts", default-features = false, features = ["access_control"] } +brush = { version = "1.8.0", default-features = false, features = ["access_control"] } ``` ## Step 2: Add imports and enable unstable feature diff --git a/docs/docs/smart-contracts/diamond.md b/docs/docs/smart-contracts/diamond.md index d587bd384..3045ddee1 100644 --- a/docs/docs/smart-contracts/diamond.md +++ b/docs/docs/smart-contracts/diamond.md @@ -11,7 +11,7 @@ Include `brush` as dependency in the cargo file or you can use [default `Cargo.t After you need to enable default implementation of Diamond Standard via `brush` features. ```toml -brush = { tag = "v1.7.1", git = "https://github.com/Supercolony-net/openbrush-contracts", default-features = false, features = ["diamond"] } +brush = { version = "1.8.0", default-features = false, features = ["diamond"] } ``` ## Step 2: Add imports and enable unstable feature diff --git a/docs/docs/smart-contracts/example/data.md b/docs/docs/smart-contracts/example/data.md index 4c5b871f8..9a17fa536 100644 --- a/docs/docs/smart-contracts/example/data.md +++ b/docs/docs/smart-contracts/example/data.md @@ -142,7 +142,7 @@ In the `Cargo.toml` of the derive folder you need to import `brush_derive` depen syn = { version = "1.0" } quote = "1.0" proc-macro2 = "1" -brush_derive = { tag = "v1.2.0", git = "https://github.com/Supercolony-net/openbrush-contracts"} +brush = { version = "1.8.0", default-features = false } [lib] name = "point_derive" diff --git a/docs/docs/smart-contracts/overview.md b/docs/docs/smart-contracts/overview.md index 850a09dcd..df59d5a67 100644 --- a/docs/docs/smart-contracts/overview.md +++ b/docs/docs/smart-contracts/overview.md @@ -23,7 +23,7 @@ scale = { package = "parity-scale-codec", version = "3", default-features = fals scale-info = { version = "2", default-features = false, features = ["derive"], optional = true } # Brush dependency -brush = { tag = "v1.7.1", git = "https://github.com/Supercolony-net/openbrush-contracts", default-features = false } +brush = { version = "1.8.0", default-features = false } [features] default = ["std"] diff --git a/docs/docs/smart-contracts/ownable.md b/docs/docs/smart-contracts/ownable.md index 5cbe636d2..387e3c0cf 100644 --- a/docs/docs/smart-contracts/ownable.md +++ b/docs/docs/smart-contracts/ownable.md @@ -11,7 +11,7 @@ Include `brush` as dependency in the cargo file or you can use [default `Cargo.t After you need to enable default implementation of Ownable via `brush` features. ```toml -brush = { tag = "v1.7.1", git = "https://github.com/Supercolony-net/openbrush-contracts", default-features = false, features = ["ownable"] } +brush = { version = "1.8.0", default-features = false, features = ["ownable"] } ``` ## Step 2: Add imports and enable unstable feature diff --git a/docs/docs/smart-contracts/pausable.md b/docs/docs/smart-contracts/pausable.md index c33c23a4b..a68eb2cf2 100644 --- a/docs/docs/smart-contracts/pausable.md +++ b/docs/docs/smart-contracts/pausable.md @@ -12,7 +12,7 @@ Include `brush` as dependency in the cargo file or you can use [default `Cargo.t After you need to enable default implementation of Pausable via `brush` features. ```toml -brush = { tag = "v1.7.1", git = "https://github.com/Supercolony-net/openbrush-contracts", default-features = false, features = ["pausable"] } +brush = { version = "1.8.0", default-features = false, features = ["pausable"] } ``` ## Step 2: Add imports and enable unstable feature diff --git a/docs/docs/smart-contracts/payment-splitter.md b/docs/docs/smart-contracts/payment-splitter.md index 55f8ebc9b..450d3eace 100644 --- a/docs/docs/smart-contracts/payment-splitter.md +++ b/docs/docs/smart-contracts/payment-splitter.md @@ -12,7 +12,7 @@ Include `brush` as dependency in the cargo file or you can use [default `Cargo.t After you need to enable default implementation of Payment Splitter via `brush` features. ```toml -brush = { tag = "v1.7.1", git = "https://github.com/Supercolony-net/openbrush-contracts", default-features = false, features = ["payment_splitter"] } +brush = { version = "1.8.0", default-features = false, features = ["payment_splitter"] } # payment-splitter uses dividing inside, so your version of rust can require you to disable check overflow. [profile.dev] diff --git a/docs/docs/smart-contracts/proxy.md b/docs/docs/smart-contracts/proxy.md index 96f45551d..9eac6eae3 100644 --- a/docs/docs/smart-contracts/proxy.md +++ b/docs/docs/smart-contracts/proxy.md @@ -11,7 +11,7 @@ Include `brush` as dependency in the cargo file or you can use [default `Cargo.t After you need to enable default implementation of Proxy via `brush` features. ```toml -brush = { tag = "v1.7.1", git = "https://github.com/Supercolony-net/openbrush-contracts", default-features = false, features = ["proxy"] } +brush = { version = "1.8.0", default-features = false, features = ["proxy"] } ``` ## Step 2: Add imports and enable unstable feature diff --git a/docs/docs/smart-contracts/reentrancy-guard.md b/docs/docs/smart-contracts/reentrancy-guard.md index 2c41cb1cc..dc1f1c6e1 100644 --- a/docs/docs/smart-contracts/reentrancy-guard.md +++ b/docs/docs/smart-contracts/reentrancy-guard.md @@ -20,7 +20,7 @@ Include `brush` as dependency in the cargo file or you can use [default `Cargo.t After you need to enable default implementation of Reentrancy Guard via `brush` features. ```toml -brush = { tag = "v1.7.1", git = "https://github.com/Supercolony-net/openbrush-contracts", default-features = false, features = ["reentrancy_guard"] } +brush = { version = "1.8.0", default-features = false, features = ["reentrancy_guard"] } ``` ### Step 2: Add imports diff --git a/docs/docs/smart-contracts/timelock-controller.md b/docs/docs/smart-contracts/timelock-controller.md index 08afc39c7..e94f80bb9 100644 --- a/docs/docs/smart-contracts/timelock-controller.md +++ b/docs/docs/smart-contracts/timelock-controller.md @@ -12,7 +12,7 @@ Include `brush` as dependency in the cargo file or you can use [default `Cargo.t After you need to enable default implementation of Timelock Controller via `brush` features. ```toml -brush = { tag = "v1.7.1", git = "https://github.com/Supercolony-net/openbrush-contracts", default-features = false, features = ["timelock_controller"] } +brush = { version = "1.8.0", default-features = false, features = ["timelock_controller"] } ``` ## Step 2: Add imports and enable unstable feature diff --git a/example_project_structure/Cargo.toml b/example_project_structure/Cargo.toml index 39439f7e6..adf4721d6 100644 --- a/example_project_structure/Cargo.toml +++ b/example_project_structure/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "lending_project" -version = "1.7.1" +version = "1.8.0" authors = ["Supercolony "] edition = "2021" diff --git a/example_project_structure/contracts/lending/Cargo.toml b/example_project_structure/contracts/lending/Cargo.toml index 32453862b..e29c592fc 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 = "1.7.1" +version = "1.8.0" authors = ["Supercolony "] edition = "2021" diff --git a/example_project_structure/contracts/loan/Cargo.toml b/example_project_structure/contracts/loan/Cargo.toml index eadaebf4c..9e7963335 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 = "1.7.1" +version = "1.8.0" authors = ["Supercolony "] edition = "2021" diff --git a/example_project_structure/contracts/shares/Cargo.toml b/example_project_structure/contracts/shares/Cargo.toml index 432b9f7c7..b6a7014bc 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 = "1.7.1" +version = "1.8.0" authors = ["Supercolony "] edition = "2021" diff --git a/example_project_structure/contracts/stable_coin/Cargo.toml b/example_project_structure/contracts/stable_coin/Cargo.toml index 8c374a706..9c7438445 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 = "1.7.1" +version = "1.8.0" authors = ["Supercolony "] edition = "2021" diff --git a/example_project_structure/derive/Cargo.toml b/example_project_structure/derive/Cargo.toml index f5eaef7bd..62f3be749 100644 --- a/example_project_structure/derive/Cargo.toml +++ b/example_project_structure/derive/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "lending_project_derive" -version = "1.7.1" +version = "1.8.0" authors = ["Supercolony "] edition = "2021" @@ -10,9 +10,9 @@ quote = "1.0" proc-macro2 = "1" # In you code you can import `brush_derive` with the next line -#brush_derive = { tag = "v1.2.0", git = "https://github.com/Supercolony-net/openbrush-contracts", default-features = false } +#brush = { version = "1.8.0", default-features = false } -brush_derive = { path = "../../utils/brush_derive" } +brush = { package = "brush_lang", path = "../../brush_lang" } [lib] name = "lending_project_derive" diff --git a/example_project_structure/derive/lib.rs b/example_project_structure/derive/lib.rs index 0aa28280e..e09d4e843 100644 --- a/example_project_structure/derive/lib.rs +++ b/example_project_structure/derive/lib.rs @@ -2,6 +2,6 @@ extern crate proc_macro; -use brush_derive::declare_derive_storage_trait; +use brush::declare_derive_storage_trait; declare_derive_storage_trait!(derive_lending_storage, LendingStorage, LendingStorageField); diff --git a/examples/access_control/Cargo.toml b/examples/access_control/Cargo.toml index bf2b77249..1ff008c15 100644 --- a/examples/access_control/Cargo.toml +++ b/examples/access_control/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "my_access_control" -version = "1.7.1" +version = "1.8.0" authors = ["Supercolony "] edition = "2021" diff --git a/examples/diamond/Cargo.toml b/examples/diamond/Cargo.toml index 5b5e961e6..0c1615947 100644 --- a/examples/diamond/Cargo.toml +++ b/examples/diamond/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "my_diamond" -version = "1.7.1" +version = "1.8.0" authors = ["Supercolony "] edition = "2021" diff --git a/examples/diamond/diamond_caller/Cargo.toml b/examples/diamond/diamond_caller/Cargo.toml index 82267393e..9a8611572 100644 --- a/examples/diamond/diamond_caller/Cargo.toml +++ b/examples/diamond/diamond_caller/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "diamond_caller" -version = "1.7.1" +version = "1.8.0" authors = ["Supercolony "] edition = "2021" diff --git a/examples/diamond/psp22_facet_v1/Cargo.toml b/examples/diamond/psp22_facet_v1/Cargo.toml index f61ed2cb5..b0c9ac25a 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 = "1.7.1" +version = "1.8.0" authors = ["Supercolony "] edition = "2021" diff --git a/examples/diamond/psp22_facet_v2/Cargo.toml b/examples/diamond/psp22_facet_v2/Cargo.toml index 2aa9d9dbb..dd65a1c28 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 = "1.7.1" +version = "1.8.0" authors = ["Supercolony "] edition = "2021" diff --git a/examples/diamond/psp22_metadata_facet/Cargo.toml b/examples/diamond/psp22_metadata_facet/Cargo.toml index 283d8b85c..ddb700ea2 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 = "1.7.1" +version = "1.8.0" authors = ["Supercolony "] edition = "2021" diff --git a/examples/ownable/Cargo.toml b/examples/ownable/Cargo.toml index b47241fa9..c08968b6f 100644 --- a/examples/ownable/Cargo.toml +++ b/examples/ownable/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "my_ownable" -version = "1.7.1" +version = "1.8.0" authors = ["Supercolony "] edition = "2021" diff --git a/examples/pausable/Cargo.toml b/examples/pausable/Cargo.toml index 010ac9ddf..3bc9a54e7 100644 --- a/examples/pausable/Cargo.toml +++ b/examples/pausable/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "my_pausable" -version = "1.7.1" +version = "1.8.0" authors = ["Supercolony "] edition = "2021" diff --git a/examples/payment_splitter/Cargo.toml b/examples/payment_splitter/Cargo.toml index 441ea15ac..68740360e 100644 --- a/examples/payment_splitter/Cargo.toml +++ b/examples/payment_splitter/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "my_payment_splitter" -version = "1.7.1" +version = "1.8.0" authors = ["Supercolony "] edition = "2021" diff --git a/examples/proxy/Cargo.toml b/examples/proxy/Cargo.toml index 0d74c98fa..f921f235b 100644 --- a/examples/proxy/Cargo.toml +++ b/examples/proxy/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "my_proxy" -version = "1.7.1" +version = "1.8.0" authors = ["Supercolony "] edition = "2021" diff --git a/examples/proxy/psp22_metadata_upgradeable/Cargo.toml b/examples/proxy/psp22_metadata_upgradeable/Cargo.toml index 87ac871d9..45b81f7c0 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 = "1.7.1" +version = "1.8.0" authors = ["Supercolony "] edition = "2021" diff --git a/examples/proxy/psp22_upgradeable/Cargo.toml b/examples/proxy/psp22_upgradeable/Cargo.toml index b45d71a51..1190ab8c5 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 = "1.7.1" +version = "1.8.0" authors = ["Supercolony "] edition = "2021" diff --git a/examples/psp1155/Cargo.toml b/examples/psp1155/Cargo.toml index 2bed7e488..a228ef363 100644 --- a/examples/psp1155/Cargo.toml +++ b/examples/psp1155/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "my_psp1155" -version = "1.7.1" +version = "1.8.0" authors = ["Supercolony "] edition = "2021" diff --git a/examples/psp1155_extensions/burnable/Cargo.toml b/examples/psp1155_extensions/burnable/Cargo.toml index d3bdd1a85..0a8d89f87 100644 --- a/examples/psp1155_extensions/burnable/Cargo.toml +++ b/examples/psp1155_extensions/burnable/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "my_psp1155_burnable" -version = "1.7.1" +version = "1.8.0" authors = ["Supercolony "] edition = "2021" diff --git a/examples/psp1155_extensions/metadata/Cargo.toml b/examples/psp1155_extensions/metadata/Cargo.toml index fbb7e42f8..d7f137adc 100644 --- a/examples/psp1155_extensions/metadata/Cargo.toml +++ b/examples/psp1155_extensions/metadata/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "my_psp1155_metadata" -version = "1.7.1" +version = "1.8.0" authors = ["Supercolony "] edition = "2021" diff --git a/examples/psp1155_extensions/mintable/Cargo.toml b/examples/psp1155_extensions/mintable/Cargo.toml index a141902bb..0b113cd5b 100644 --- a/examples/psp1155_extensions/mintable/Cargo.toml +++ b/examples/psp1155_extensions/mintable/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "my_psp1155_mintable" -version = "1.7.1" +version = "1.8.0" authors = ["Supercolony "] edition = "2021" diff --git a/examples/psp22/Cargo.toml b/examples/psp22/Cargo.toml index 249104907..d4272375f 100644 --- a/examples/psp22/Cargo.toml +++ b/examples/psp22/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "my_psp22" -version = "1.7.1" +version = "1.8.0" authors = ["Supercolony "] edition = "2021" diff --git a/examples/psp22_extensions/burnable/Cargo.toml b/examples/psp22_extensions/burnable/Cargo.toml index 192992a05..b713491fe 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 = "1.7.1" +version = "1.8.0" authors = ["Supercolony "] edition = "2021" diff --git a/examples/psp22_extensions/capped/Cargo.toml b/examples/psp22_extensions/capped/Cargo.toml index 17d66da4c..80ce06442 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 = "1.7.1" +version = "1.8.0" authors = ["Supercolony "] edition = "2021" diff --git a/examples/psp22_extensions/flashmint/Cargo.toml b/examples/psp22_extensions/flashmint/Cargo.toml index 20e12ac95..b7926288a 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 = "1.7.1" +version = "1.8.0" authors = ["Supercolony "] edition = "2021" diff --git a/examples/psp22_extensions/metadata/Cargo.toml b/examples/psp22_extensions/metadata/Cargo.toml index cd6adf7f0..dcd184b77 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 = "1.7.1" +version = "1.8.0" authors = ["Supercolony "] edition = "2021" diff --git a/examples/psp22_extensions/mintable/Cargo.toml b/examples/psp22_extensions/mintable/Cargo.toml index 88fb500e9..f6af964b0 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 = "1.7.1" +version = "1.8.0" authors = ["Supercolony "] edition = "2021" diff --git a/examples/psp22_extensions/pausable/Cargo.toml b/examples/psp22_extensions/pausable/Cargo.toml index 5a7feab04..ea5331170 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 = "1.7.1" +version = "1.8.0" authors = ["Supercolony "] edition = "2021" diff --git a/examples/psp22_extensions/wrapper/Cargo.toml b/examples/psp22_extensions/wrapper/Cargo.toml index f034eb263..5e531416c 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 = "1.7.1" +version = "1.8.0" authors = ["Supercolony "] edition = "2021" diff --git a/examples/psp22_utils/token_timelock/Cargo.toml b/examples/psp22_utils/token_timelock/Cargo.toml index 6805ba305..9cc40754e 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 = "1.7.1" +version = "1.8.0" authors = ["Supercolony "] edition = "2021" diff --git a/examples/psp34/Cargo.toml b/examples/psp34/Cargo.toml index b50922dfe..a0990f133 100644 --- a/examples/psp34/Cargo.toml +++ b/examples/psp34/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "my_psp34" -version = "1.7.1" +version = "1.8.0" authors = ["Supercolony "] edition = "2021" diff --git a/examples/psp34_extensions/burnable/Cargo.toml b/examples/psp34_extensions/burnable/Cargo.toml index 3c245ef6e..6051aba8a 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 = "1.7.1" +version = "1.8.0" authors = ["Supercolony "] edition = "2021" diff --git a/examples/psp34_extensions/enumerable/Cargo.toml b/examples/psp34_extensions/enumerable/Cargo.toml index 4d83546c7..06f551a06 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 = "1.7.1" +version = "1.8.0" authors = ["Supercolony "] edition = "2021" diff --git a/examples/psp34_extensions/metadata/Cargo.toml b/examples/psp34_extensions/metadata/Cargo.toml index 9e7cd8a9e..96528d83f 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 = "1.7.1" +version = "1.8.0" authors = ["Supercolony "] edition = "2021" diff --git a/examples/psp34_extensions/mintable/Cargo.toml b/examples/psp34_extensions/mintable/Cargo.toml index 949719567..7d4f48636 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 = "1.7.1" +version = "1.8.0" authors = ["Supercolony "] edition = "2021" diff --git a/examples/reentrancy_guard/Cargo.toml b/examples/reentrancy_guard/Cargo.toml index 8ae770c6d..e94676216 100644 --- a/examples/reentrancy_guard/Cargo.toml +++ b/examples/reentrancy_guard/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "flipper" -version = "1.7.1" +version = "1.8.0" authors = ["Supercolony "] 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 0dc69d600..bea7ae099 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 = "1.7.1" +version = "1.8.0" authors = ["Supercolony "] edition = "2021" diff --git a/examples/reentrancy_guard/contracts/flipper/Cargo.toml b/examples/reentrancy_guard/contracts/flipper/Cargo.toml index 2e0cafc6a..5e00919d1 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 = "1.7.1" +version = "1.8.0" authors = ["Supercolony "] edition = "2021" diff --git a/examples/timelock_controller/Cargo.toml b/examples/timelock_controller/Cargo.toml index f1059d397..ecec40a09 100644 --- a/examples/timelock_controller/Cargo.toml +++ b/examples/timelock_controller/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "my_timelock_controller" -version = "1.7.1" +version = "1.8.0" authors = ["Supercolony "] edition = "2021" diff --git a/mock/flash-borrower/Cargo.toml b/mock/flash-borrower/Cargo.toml index 832546ba6..4c64baea5 100644 --- a/mock/flash-borrower/Cargo.toml +++ b/mock/flash-borrower/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "flash_borrower" -version = "1.7.1" +version = "1.8.0" authors = ["Supercolony "] edition = "2021" diff --git a/mock/psp1155-receiver/Cargo.toml b/mock/psp1155-receiver/Cargo.toml index e3ab8177d..fe9898944 100644 --- a/mock/psp1155-receiver/Cargo.toml +++ b/mock/psp1155-receiver/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "psp1155_receiver" -version = "1.7.1" +version = "1.8.0" authors = ["Supercolony "] edition = "2021" diff --git a/mock/psp22-receiver/Cargo.toml b/mock/psp22-receiver/Cargo.toml index b5081cfba..4d06fefcf 100644 --- a/mock/psp22-receiver/Cargo.toml +++ b/mock/psp22-receiver/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "psp22_receiver" -version = "1.7.1" +version = "1.8.0" authors = ["Supercolony "] edition = "2021" diff --git a/mock/psp34-receiver/Cargo.toml b/mock/psp34-receiver/Cargo.toml index f08765332..64f420298 100644 --- a/mock/psp34-receiver/Cargo.toml +++ b/mock/psp34-receiver/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "psp34_receiver" -version = "1.7.1" +version = "1.8.0" authors = ["Supercolony "] edition = "2021" diff --git a/utils/brush_derive/Cargo.toml b/utils/brush_derive/Cargo.toml deleted file mode 100644 index 8546c4f10..000000000 --- a/utils/brush_derive/Cargo.toml +++ /dev/null @@ -1,16 +0,0 @@ -[package] -name = "brush_derive" -version = "1.7.1" -authors = ["Supercolony "] -edition = "2021" - -[lib] -name = "brush_derive" -path = "lib.rs" -crate-type = [ - "rlib", -] - -[features] -default = ["std"] -std = [] \ No newline at end of file diff --git a/utils/brush_lang/test_utils/Cargo.toml b/utils/brush_lang/test_utils/Cargo.toml deleted file mode 100644 index 80f9168b7..000000000 --- a/utils/brush_lang/test_utils/Cargo.toml +++ /dev/null @@ -1,28 +0,0 @@ -[package] -name = "test_utils" -version = "0.1.0" -edition = "2021" - -[dependencies] - -ink_env = { version = "3.2.0", default-features = false } - -scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } -scale-info = { version = "2", default-features = false, features = ["derive"], optional = true } - -[lib] -name = "test_utils" -path = "lib.rs" -crate-type = [ - "rlib", -] - -[features] -default = ["std"] -std = [ - "ink_env/std", - "scale/std", - "scale-info/std", -] - - From 40b2ec592f88089bfc0096ca6223cdb051936657 Mon Sep 17 00:00:00 2001 From: xgreenx Date: Fri, 27 May 2022 21:25:46 +0200 Subject: [PATCH 02/10] Test each separatly --- .github/workflows/ci.yml | 9 +++++---- contracts/Cargo.toml | 4 ++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 77b850e90..abd88a9f9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -47,7 +47,8 @@ jobs: yarn build:release - name: Run Test Mocha run: | - substrate-contracts-node --tmp --dev & P1=$! - yarn test:mocha & P2=$! - wait $P2 - kill $P1 + for test in tests/**/*.ts; do + substrate-contracts-node --tmp --dev & P1=$!; + mocha --require @babel/register --require ts-node/register --recursive ./$test --extension ".ts" --exit --timeout 20000; + kill $P1; + done diff --git a/contracts/Cargo.toml b/contracts/Cargo.toml index 56a3253e4..35ebfd0b2 100644 --- a/contracts/Cargo.toml +++ b/contracts/Cargo.toml @@ -15,8 +15,8 @@ ink_prelude = { version = "3.2.0", default-features = false } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2", default-features = false, features = ["derive"], optional = true } -derive = { path = "./derive" } -brush = { package = "brush_lang", path = "../brush_lang", default-features = false } +derive = { version = "1.8.0", path = "./derive" } +brush = { version = "1.8.0", package = "brush_lang", path = "../brush_lang", default-features = false } [lib] name = "contracts" From d3a4e92343771058f94a86641d2510202a184acd Mon Sep 17 00:00:00 2001 From: xgreenx Date: Fri, 27 May 2022 21:56:01 +0200 Subject: [PATCH 03/10] Change usage of call --- .github/workflows/ci.yml | 2 +- package.json | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index abd88a9f9..29ab89473 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -49,6 +49,6 @@ jobs: run: | for test in tests/**/*.ts; do substrate-contracts-node --tmp --dev & P1=$!; - mocha --require @babel/register --require ts-node/register --recursive ./$test --extension ".ts" --exit --timeout 20000; + yarn test:mocha-single ./$test; kill $P1; done diff --git a/package.json b/package.json index 02cd3bb08..8fdbe3e50 100644 --- a/package.json +++ b/package.json @@ -29,6 +29,7 @@ "build": "npx redspot compile", "test:redspot": "npx redspot test", "test:mocha": "mocha --require @babel/register --require ts-node/register --recursive ./tests --extension \".ts\" --exit --timeout 20000", + "test:mocha-single": "mocha --require @babel/register --require ts-node/register --extension \".ts\" --exit --timeout 20000", "test": "yarn build:release && yarn test:mocha" } } From a1be6d34ad8529cec2ba136829dbaa8796816d35 Mon Sep 17 00:00:00 2001 From: xgreenx Date: Fri, 27 May 2022 22:30:16 +0200 Subject: [PATCH 04/10] Added description --- Cargo.toml | 4 ++-- brush_lang/codegen/Cargo.toml | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 6e2e32d3a..a1f8c1e1f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,8 +17,8 @@ authors = ["Supercolony "] edition = "2018" [dependencies] -contracts = { path = "./contracts", default-features = false } -brush_lang = { path = "./brush_lang", default-features = false } +contracts = { version = "1.8.0", path = "./contracts", default-features = false } +brush_lang = { version = "1.8.0", path = "./brush_lang", default-features = false } [lib] name = "brush" diff --git a/brush_lang/codegen/Cargo.toml b/brush_lang/codegen/Cargo.toml index d34b36a87..c9585356c 100644 --- a/brush_lang/codegen/Cargo.toml +++ b/brush_lang/codegen/Cargo.toml @@ -4,6 +4,15 @@ version = "1.8.0" authors = ["Supercolony "] edition = "2021" +license = "MIT" +repository = "https://github.com/Supercolony-net/openbrush-contracts" +documentation = "https://docs.openbrush.io" +homepage = "https://supercolony.net" +description = "Brush codegeneration with new features for the ink!." +keywords = ["wasm", "supercolony", "webassembly", "blockchain", "edsl", "library", "ink"] +categories = ["no-std", "embedded"] +include = ["Cargo.toml", "./**/*.rs"] + [dependencies] syn = { version = "1", features = ["parsing", "full", "visit", "extra-traits"] } quote = "1" From e6ca8e8e9648e2717f91758307e250c735429c2f Mon Sep 17 00:00:00 2001 From: xgreenx Date: Sat, 28 May 2022 00:46:24 +0200 Subject: [PATCH 05/10] Rename everything from `brush` to `openbrush` --- Cargo.toml | 46 ++++++---- README.md | 12 +-- brush_lang/macros.rs | 60 ------------- contracts/Cargo.toml | 22 +++-- contracts/README.md | 4 +- contracts/derive/Cargo.toml | 15 +++- contracts/derive/lib.rs | 2 +- .../{ => src}/access/access_control/mod.rs | 10 +-- contracts/{ => src}/access/mod.rs | 0 contracts/{ => src}/access/ownable/mod.rs | 8 +- contracts/{ => src}/finance/mod.rs | 0 .../{ => src}/finance/payment_splitter/mod.rs | 12 +-- contracts/{ => src}/governance/mod.rs | 0 .../governance/timelock_controller/mod.rs | 28 +++--- contracts/{ => src}/lib.rs | 0 contracts/{ => src}/security/mod.rs | 0 contracts/{ => src}/security/pausable/mod.rs | 8 +- .../security/reentrancy_guard/mod.rs | 10 +-- contracts/{ => src}/token/mod.rs | 0 .../token/psp1155/extensions/burnable.rs | 4 +- .../token/psp1155/extensions/metadata.rs | 6 +- .../token/psp1155/extensions/mintable.rs | 4 +- contracts/{ => src}/token/psp1155/mod.rs | 0 contracts/{ => src}/token/psp1155/psp1155.rs | 22 ++--- .../token/psp22/extensions/burnable.rs | 2 +- .../token/psp22/extensions/flashmint.rs | 10 +-- .../token/psp22/extensions/metadata.rs | 6 +- .../token/psp22/extensions/mintable.rs | 2 +- .../token/psp22/extensions/wrapper.rs | 12 +-- contracts/{ => src}/token/psp22/mod.rs | 0 contracts/{ => src}/token/psp22/psp22.rs | 22 ++--- .../token/psp22/utils/token_timelock.rs | 10 +-- .../token/psp34/extensions/burnable.rs | 2 +- .../token/psp34/extensions/enumerable.rs | 12 +-- .../token/psp34/extensions/metadata.rs | 6 +- .../token/psp34/extensions/mintable.rs | 2 +- contracts/{ => src}/token/psp34/mod.rs | 0 contracts/{ => src}/token/psp34/psp34.rs | 20 ++--- .../{ => src}/traits/access_control/mod.rs | 6 +- contracts/{ => src}/traits/diamond/diamond.rs | 6 +- .../diamond/extensions/diamond_loupe.rs | 6 +- contracts/{ => src}/traits/diamond/mod.rs | 0 .../{ => src}/traits/errors/access_control.rs | 0 contracts/{ => src}/traits/errors/diamond.rs | 2 +- .../{ => src}/traits/errors/flashloan.rs | 0 contracts/{ => src}/traits/errors/mod.rs | 0 contracts/{ => src}/traits/errors/ownable.rs | 0 contracts/{ => src}/traits/errors/pausable.rs | 0 .../traits/errors/payment_splitter.rs | 0 contracts/{ => src}/traits/errors/psp1155.rs | 0 contracts/{ => src}/traits/errors/psp22.rs | 0 contracts/{ => src}/traits/errors/psp34.rs | 0 .../traits/errors/reentrancy_guard.rs | 0 .../traits/errors/timelock_controller.rs | 0 contracts/{ => src}/traits/flashloan/mod.rs | 12 +-- contracts/{ => src}/traits/mod.rs | 0 contracts/{ => src}/traits/ownable/mod.rs | 6 +- contracts/{ => src}/traits/pausable/mod.rs | 4 +- .../{ => src}/traits/payment_splitter/mod.rs | 6 +- contracts/{ => src}/traits/proxy/mod.rs | 6 +- .../traits/psp1155/extensions/burnable.rs | 8 +- .../traits/psp1155/extensions/metadata.rs | 4 +- .../traits/psp1155/extensions/mintable.rs | 8 +- contracts/{ => src}/traits/psp1155/mod.rs | 0 contracts/{ => src}/traits/psp1155/psp1155.rs | 12 +-- .../traits/psp22/extensions/burnable.rs | 6 +- .../traits/psp22/extensions/metadata.rs | 4 +- .../traits/psp22/extensions/mintable.rs | 6 +- .../traits/psp22/extensions/wrapper.rs | 6 +- contracts/{ => src}/traits/psp22/mod.rs | 0 contracts/{ => src}/traits/psp22/psp22.rs | 12 +-- .../traits/psp22/utils/token_timelock.rs | 6 +- .../traits/psp34/extensions/burnable.rs | 6 +- .../traits/psp34/extensions/enumerable.rs | 6 +- .../traits/psp34/extensions/metadata.rs | 4 +- .../traits/psp34/extensions/mintable.rs | 6 +- contracts/{ => src}/traits/psp34/mod.rs | 0 contracts/{ => src}/traits/psp34/psp34.rs | 16 ++-- .../traits/timelock_controller/mod.rs | 8 +- .../upgradability/diamond/diamond.rs | 20 ++--- .../diamond/extensions/diamond_loupe.rs | 10 +-- .../{ => src}/upgradability/diamond/mod.rs | 0 contracts/{ => src}/upgradability/mod.rs | 0 .../{ => src}/upgradability/proxy/mod.rs | 8 +- .../PSP1155/Extensions/burnable.md | 4 +- .../PSP1155/Extensions/metadata.md | 6 +- .../PSP1155/Extensions/mintable.md | 4 +- docs/docs/smart-contracts/PSP1155/psp1155.md | 12 +-- .../PSP22/Extensions/burnable.md | 4 +- .../PSP22/Extensions/capped.md | 12 +-- .../PSP22/Extensions/flashmint.md | 4 +- .../PSP22/Extensions/metadata.md | 6 +- .../PSP22/Extensions/mintable.md | 4 +- .../PSP22/Extensions/pausable.md | 12 +-- .../PSP22/Extensions/wrapper.md | 12 +-- .../PSP22/Utils/token-timelock.md | 12 +-- docs/docs/smart-contracts/PSP22/psp22.md | 12 +-- .../PSP34/Extensions/burnable.md | 4 +- .../PSP34/Extensions/metadata.md | 12 +-- .../PSP34/Extensions/mintable.md | 4 +- docs/docs/smart-contracts/PSP34/psp34.md | 12 +-- docs/docs/smart-contracts/access-control.md | 16 ++-- docs/docs/smart-contracts/diamond.md | 12 +-- docs/docs/smart-contracts/example/contract.md | 4 +- docs/docs/smart-contracts/example/data.md | 16 ++-- docs/docs/smart-contracts/example/impls.md | 18 ++-- docs/docs/smart-contracts/example/loan.md | 14 +-- docs/docs/smart-contracts/example/psp22.md | 12 +-- .../smart-contracts/example/setup_project.md | 2 +- docs/docs/smart-contracts/example/shares.md | 12 +-- docs/docs/smart-contracts/overview.md | 6 +- docs/docs/smart-contracts/ownable.md | 16 ++-- docs/docs/smart-contracts/pausable.md | 18 ++-- docs/docs/smart-contracts/payment-splitter.md | 12 +-- docs/docs/smart-contracts/proxy.md | 12 +-- docs/docs/smart-contracts/reentrancy-guard.md | 16 ++-- .../smart-contracts/timelock-controller.md | 12 +-- example_project_structure/Cargo.toml | 4 +- .../contracts/lending/Cargo.toml | 4 +- .../contracts/lending/lib.rs | 10 +-- .../contracts/loan/Cargo.toml | 4 +- .../contracts/loan/lib.rs | 12 +-- .../contracts/shares/Cargo.toml | 4 +- .../contracts/shares/lib.rs | 10 +-- .../contracts/stable_coin/Cargo.toml | 4 +- .../contracts/stable_coin/lib.rs | 6 +- example_project_structure/derive/Cargo.toml | 6 +- example_project_structure/derive/lib.rs | 2 +- .../impls/lending/data.rs | 16 ++-- .../impls/lending/lending.rs | 4 +- .../impls/lending/lending_permissioned.rs | 2 +- example_project_structure/traits/lending.rs | 12 +-- example_project_structure/traits/loan.rs | 14 +-- example_project_structure/traits/shares.rs | 6 +- .../traits/stable_coin.rs | 6 +- examples/access_control/Cargo.toml | 4 +- examples/access_control/lib.rs | 6 +- examples/diamond/Cargo.toml | 4 +- examples/diamond/diamond_caller/Cargo.toml | 4 +- examples/diamond/diamond_caller/lib.rs | 4 +- examples/diamond/lib.rs | 4 +- examples/diamond/psp22_facet_v1/Cargo.toml | 4 +- examples/diamond/psp22_facet_v1/lib.rs | 6 +- examples/diamond/psp22_facet_v2/Cargo.toml | 4 +- examples/diamond/psp22_facet_v2/lib.rs | 10 +-- .../diamond/psp22_metadata_facet/Cargo.toml | 4 +- examples/diamond/psp22_metadata_facet/lib.rs | 6 +- examples/ownable/Cargo.toml | 4 +- examples/ownable/lib.rs | 8 +- examples/pausable/Cargo.toml | 4 +- examples/pausable/lib.rs | 6 +- examples/payment_splitter/Cargo.toml | 4 +- examples/payment_splitter/lib.rs | 4 +- examples/proxy/Cargo.toml | 4 +- examples/proxy/lib.rs | 6 +- .../psp22_metadata_upgradeable/Cargo.toml | 4 +- .../proxy/psp22_metadata_upgradeable/lib.rs | 8 +- examples/proxy/psp22_upgradeable/Cargo.toml | 4 +- examples/proxy/psp22_upgradeable/lib.rs | 6 +- examples/psp1155/Cargo.toml | 4 +- examples/psp1155/lib.rs | 4 +- .../psp1155_extensions/burnable/Cargo.toml | 4 +- examples/psp1155_extensions/burnable/lib.rs | 4 +- .../psp1155_extensions/metadata/Cargo.toml | 4 +- examples/psp1155_extensions/metadata/lib.rs | 4 +- .../psp1155_extensions/mintable/Cargo.toml | 4 +- examples/psp1155_extensions/mintable/lib.rs | 4 +- examples/psp22/Cargo.toml | 4 +- examples/psp22/lib.rs | 4 +- examples/psp22_extensions/burnable/Cargo.toml | 4 +- examples/psp22_extensions/burnable/lib.rs | 4 +- examples/psp22_extensions/capped/Cargo.toml | 4 +- examples/psp22_extensions/capped/lib.rs | 4 +- .../psp22_extensions/flashmint/Cargo.toml | 4 +- examples/psp22_extensions/flashmint/lib.rs | 4 +- examples/psp22_extensions/metadata/Cargo.toml | 4 +- examples/psp22_extensions/metadata/lib.rs | 4 +- examples/psp22_extensions/mintable/Cargo.toml | 4 +- examples/psp22_extensions/mintable/lib.rs | 4 +- examples/psp22_extensions/pausable/Cargo.toml | 4 +- examples/psp22_extensions/pausable/lib.rs | 4 +- examples/psp22_extensions/wrapper/Cargo.toml | 4 +- examples/psp22_extensions/wrapper/lib.rs | 4 +- .../psp22_utils/token_timelock/Cargo.toml | 4 +- examples/psp22_utils/token_timelock/lib.rs | 4 +- examples/psp34/Cargo.toml | 4 +- examples/psp34/lib.rs | 4 +- examples/psp34_extensions/burnable/Cargo.toml | 4 +- examples/psp34_extensions/burnable/lib.rs | 4 +- .../psp34_extensions/enumerable/Cargo.toml | 4 +- examples/psp34_extensions/enumerable/lib.rs | 8 +- examples/psp34_extensions/metadata/Cargo.toml | 4 +- examples/psp34_extensions/metadata/lib.rs | 4 +- examples/psp34_extensions/mintable/Cargo.toml | 4 +- examples/psp34_extensions/mintable/lib.rs | 4 +- examples/reentrancy_guard/Cargo.toml | 4 +- .../contracts/flip_on_me/Cargo.toml | 4 +- .../contracts/flip_on_me/lib.rs | 2 +- .../contracts/flipper/Cargo.toml | 4 +- .../reentrancy_guard/contracts/flipper/lib.rs | 2 +- .../reentrancy_guard/traits/flip_on_me.rs | 8 +- examples/reentrancy_guard/traits/flipper.rs | 10 +-- examples/timelock_controller/Cargo.toml | 4 +- examples/timelock_controller/lib.rs | 4 +- {brush_lang => lang}/.gitignore | 0 {brush_lang => lang}/Cargo.toml | 19 ++-- {brush_lang => lang}/codegen/.gitignore | 0 {brush_lang => lang}/codegen/Cargo.toml | 12 +-- .../codegen => lang/codegen/src}/contract.rs | 2 +- .../codegen => lang/codegen/src}/internal.rs | 2 +- .../codegen => lang/codegen/src}/lib.rs | 0 .../codegen => lang/codegen/src}/metadata.rs | 2 +- .../codegen/src}/modifier_definition.rs | 0 .../codegen => lang/codegen/src}/modifiers.rs | 2 +- .../codegen => lang/codegen/src}/storage.rs | 0 .../codegen/src}/trait_definition.rs | 4 +- .../codegen => lang/codegen/src}/wrapper.rs | 2 +- {brush_lang => lang}/macro/.gitignore | 0 {brush_lang => lang}/macro/Cargo.toml | 21 +++-- {brush_lang/macro => lang/macro/src}/lib.rs | 88 +++++++++---------- {brush_lang => lang/src}/derive.rs | 0 {brush_lang => lang/src}/lib.rs | 2 +- {brush_lang/macro => lang/src}/macros.rs | 2 +- {brush_lang => lang/src}/test_utils.rs | 0 {brush_lang => lang/src}/traits.rs | 0 lib.rs | 4 +- mock/flash-borrower/Cargo.toml | 4 +- mock/flash-borrower/lib.rs | 4 +- mock/psp1155-receiver/Cargo.toml | 4 +- mock/psp1155-receiver/lib.rs | 4 +- mock/psp22-receiver/Cargo.toml | 4 +- mock/psp22-receiver/lib.rs | 4 +- mock/psp34-receiver/Cargo.toml | 4 +- mock/psp34-receiver/lib.rs | 4 +- {contracts/tests => tests}/access_control.rs | 6 +- tests/{ => e2e}/access-control.tests.ts | 0 tests/{ => e2e}/constants.ts | 0 .../lending_contract.tests.ts | 0 tests/{ => e2e}/helpers.ts | 0 tests/{ => e2e}/ownable.tests.ts | 0 tests/{ => e2e}/pausable.tests.ts | 0 tests/{ => e2e}/payment-splitter.tests.ts | 0 .../psp1155/extensions/burnable.tests.ts | 0 .../psp1155/extensions/metadata.tests.ts | 0 .../psp1155/extensions/mintable.tests.ts | 0 tests/{ => e2e}/psp1155/psp1155.tests.ts | 0 .../psp22/extensions/burnable.tests.ts | 0 .../psp22/extensions/capped.tests.ts | 0 .../psp22/extensions/flashmint.tests.ts | 0 .../psp22/extensions/metadata.tests.ts | 0 .../psp22/extensions/mintable.tests.ts | 0 .../psp22/extensions/pausable.tests.ts | 0 tests/{ => e2e}/psp22/extensions/wrapper.ts | 0 tests/{ => e2e}/psp22/psp22.tests.ts | 0 .../psp22/utils/token_timelock.tests.ts | 0 .../psp34/extensions/burnable.tests.ts | 0 .../psp34/extensions/enumerable.tests.ts | 0 .../psp34/extensions/metadata.tests.ts | 0 .../psp34/extensions/mintable.tests.ts | 0 tests/{ => e2e}/psp34/psp34.tests.ts | 0 tests/{ => e2e}/reentrancy-guard.tests.ts | 0 tests/{ => e2e}/setup/chai.ts | 0 tests/{ => e2e}/timelock-controller.tests.ts | 0 .../upgradability/diamond_psp22.tests.ts | 0 .../upgradability/proxy_psp22.tests.ts | 0 {contracts/tests => tests}/ownable.rs | 6 +- {contracts/tests => tests}/pausable.rs | 8 +- .../tests => tests}/payment_splitter.rs | 6 +- {contracts/tests => tests}/proxy.rs | 6 +- {contracts/tests => tests}/psp1155.rs | 6 +- .../tests => tests}/psp1155_burnable.rs | 6 +- .../tests => tests}/psp1155_metadata.rs | 4 +- .../tests => tests}/psp1155_mintable.rs | 6 +- {contracts/tests => tests}/psp22.rs | 6 +- {contracts/tests => tests}/psp22_burnable.rs | 6 +- {contracts/tests => tests}/psp22_flashmint.rs | 6 +- {contracts/tests => tests}/psp22_metadata.rs | 4 +- {contracts/tests => tests}/psp22_mintable.rs | 6 +- .../tests => tests}/psp22_token_timelock.rs | 6 +- {contracts/tests => tests}/psp22_wrapper.rs | 6 +- {contracts/tests => tests}/psp34.rs | 6 +- {contracts/tests => tests}/psp34_burnable.rs | 6 +- .../tests => tests}/psp34_enumerable.rs | 6 +- {contracts/tests => tests}/psp34_metadata.rs | 4 +- {contracts/tests => tests}/psp34_mintable.rs | 6 +- .../tests => tests}/reentrancy_guard.rs | 8 +- .../tests => tests}/timelock_controller.rs | 6 +- 287 files changed, 838 insertions(+), 853 deletions(-) delete mode 100644 brush_lang/macros.rs rename contracts/{ => src}/access/access_control/mod.rs (97%) rename contracts/{ => src}/access/mod.rs (100%) rename contracts/{ => src}/access/ownable/mod.rs (96%) rename contracts/{ => src}/finance/mod.rs (100%) rename contracts/{ => src}/finance/payment_splitter/mod.rs (97%) rename contracts/{ => src}/governance/mod.rs (100%) rename contracts/{ => src}/governance/timelock_controller/mod.rs (99%) rename contracts/{ => src}/lib.rs (100%) rename contracts/{ => src}/security/mod.rs (100%) rename contracts/{ => src}/security/pausable/mod.rs (96%) rename contracts/{ => src}/security/reentrancy_guard/mod.rs (95%) rename contracts/{ => src}/token/mod.rs (100%) rename contracts/{ => src}/token/psp1155/extensions/burnable.rs (98%) rename contracts/{ => src}/token/psp1155/extensions/metadata.rs (90%) rename contracts/{ => src}/token/psp1155/extensions/mintable.rs (98%) rename contracts/{ => src}/token/psp1155/mod.rs (100%) rename contracts/{ => src}/token/psp1155/psp1155.rs (98%) rename contracts/{ => src}/token/psp22/extensions/burnable.rs (98%) rename contracts/{ => src}/token/psp22/extensions/flashmint.rs (99%) rename contracts/{ => src}/token/psp22/extensions/metadata.rs (91%) rename contracts/{ => src}/token/psp22/extensions/mintable.rs (98%) rename contracts/{ => src}/token/psp22/extensions/wrapper.rs (96%) rename contracts/{ => src}/token/psp22/mod.rs (100%) rename contracts/{ => src}/token/psp22/psp22.rs (98%) rename contracts/{ => src}/token/psp22/utils/token_timelock.rs (96%) rename contracts/{ => src}/token/psp34/extensions/burnable.rs (97%) rename contracts/{ => src}/token/psp34/extensions/enumerable.rs (96%) rename contracts/{ => src}/token/psp34/extensions/metadata.rs (92%) rename contracts/{ => src}/token/psp34/extensions/mintable.rs (97%) rename contracts/{ => src}/token/psp34/mod.rs (100%) rename contracts/{ => src}/token/psp34/psp34.rs (98%) rename contracts/{ => src}/traits/access_control/mod.rs (97%) rename contracts/{ => src}/traits/diamond/diamond.rs (97%) rename contracts/{ => src}/traits/diamond/extensions/diamond_loupe.rs (96%) rename contracts/{ => src}/traits/diamond/mod.rs (100%) rename contracts/{ => src}/traits/errors/access_control.rs (100%) rename contracts/{ => src}/traits/errors/diamond.rs (98%) rename contracts/{ => src}/traits/errors/flashloan.rs (100%) rename contracts/{ => src}/traits/errors/mod.rs (100%) rename contracts/{ => src}/traits/errors/ownable.rs (100%) rename contracts/{ => src}/traits/errors/pausable.rs (100%) rename contracts/{ => src}/traits/errors/payment_splitter.rs (100%) rename contracts/{ => src}/traits/errors/psp1155.rs (100%) rename contracts/{ => src}/traits/errors/psp22.rs (100%) rename contracts/{ => src}/traits/errors/psp34.rs (100%) rename contracts/{ => src}/traits/errors/reentrancy_guard.rs (100%) rename contracts/{ => src}/traits/errors/timelock_controller.rs (100%) rename contracts/{ => src}/traits/flashloan/mod.rs (96%) rename contracts/{ => src}/traits/mod.rs (100%) rename contracts/{ => src}/traits/ownable/mod.rs (96%) rename contracts/{ => src}/traits/pausable/mod.rs (96%) rename contracts/{ => src}/traits/payment_splitter/mod.rs (97%) rename contracts/{ => src}/traits/proxy/mod.rs (94%) rename contracts/{ => src}/traits/psp1155/extensions/burnable.rs (95%) rename contracts/{ => src}/traits/psp1155/extensions/metadata.rs (96%) rename contracts/{ => src}/traits/psp1155/extensions/mintable.rs (95%) rename contracts/{ => src}/traits/psp1155/mod.rs (100%) rename contracts/{ => src}/traits/psp1155/psp1155.rs (97%) rename contracts/{ => src}/traits/psp22/extensions/burnable.rs (95%) rename contracts/{ => src}/traits/psp22/extensions/metadata.rs (96%) rename contracts/{ => src}/traits/psp22/extensions/mintable.rs (95%) rename contracts/{ => src}/traits/psp22/extensions/wrapper.rs (96%) rename contracts/{ => src}/traits/psp22/mod.rs (100%) rename contracts/{ => src}/traits/psp22/psp22.rs (97%) rename contracts/{ => src}/traits/psp22/utils/token_timelock.rs (95%) rename contracts/{ => src}/traits/psp34/extensions/burnable.rs (94%) rename contracts/{ => src}/traits/psp34/extensions/enumerable.rs (95%) rename contracts/{ => src}/traits/psp34/extensions/metadata.rs (96%) rename contracts/{ => src}/traits/psp34/extensions/mintable.rs (94%) rename contracts/{ => src}/traits/psp34/mod.rs (100%) rename contracts/{ => src}/traits/psp34/psp34.rs (97%) rename contracts/{ => src}/traits/timelock_controller/mod.rs (98%) rename contracts/{ => src}/upgradability/diamond/diamond.rs (97%) rename contracts/{ => src}/upgradability/diamond/extensions/diamond_loupe.rs (96%) rename contracts/{ => src}/upgradability/diamond/mod.rs (100%) rename contracts/{ => src}/upgradability/mod.rs (100%) rename contracts/{ => src}/upgradability/proxy/mod.rs (94%) rename {brush_lang => lang}/.gitignore (100%) rename {brush_lang => lang}/Cargo.toml (56%) rename {brush_lang => lang}/codegen/.gitignore (100%) rename {brush_lang => lang}/codegen/Cargo.toml (73%) rename {brush_lang/codegen => lang/codegen/src}/contract.rs (97%) rename {brush_lang/codegen => lang/codegen/src}/internal.rs (99%) rename {brush_lang/codegen => lang/codegen/src}/lib.rs (100%) rename {brush_lang/codegen => lang/codegen/src}/metadata.rs (98%) rename {brush_lang/codegen => lang/codegen/src}/modifier_definition.rs (100%) rename {brush_lang/codegen => lang/codegen/src}/modifiers.rs (99%) rename {brush_lang/codegen => lang/codegen/src}/storage.rs (100%) rename {brush_lang/codegen => lang/codegen/src}/trait_definition.rs (98%) rename {brush_lang/codegen => lang/codegen/src}/wrapper.rs (98%) rename {brush_lang => lang}/macro/.gitignore (100%) rename {brush_lang => lang}/macro/Cargo.toml (55%) rename {brush_lang/macro => lang/macro/src}/lib.rs (86%) rename {brush_lang => lang/src}/derive.rs (100%) rename {brush_lang => lang/src}/lib.rs (97%) rename {brush_lang/macro => lang/src}/macros.rs (97%) rename {brush_lang => lang/src}/test_utils.rs (100%) rename {brush_lang => lang/src}/traits.rs (100%) rename {contracts/tests => tests}/access_control.rs (99%) rename tests/{ => e2e}/access-control.tests.ts (100%) rename tests/{ => e2e}/constants.ts (100%) rename tests/{ => e2e}/example_project_structure/lending_contract.tests.ts (100%) rename tests/{ => e2e}/helpers.ts (100%) rename tests/{ => e2e}/ownable.tests.ts (100%) rename tests/{ => e2e}/pausable.tests.ts (100%) rename tests/{ => e2e}/payment-splitter.tests.ts (100%) rename tests/{ => e2e}/psp1155/extensions/burnable.tests.ts (100%) rename tests/{ => e2e}/psp1155/extensions/metadata.tests.ts (100%) rename tests/{ => e2e}/psp1155/extensions/mintable.tests.ts (100%) rename tests/{ => e2e}/psp1155/psp1155.tests.ts (100%) rename tests/{ => e2e}/psp22/extensions/burnable.tests.ts (100%) rename tests/{ => e2e}/psp22/extensions/capped.tests.ts (100%) rename tests/{ => e2e}/psp22/extensions/flashmint.tests.ts (100%) rename tests/{ => e2e}/psp22/extensions/metadata.tests.ts (100%) rename tests/{ => e2e}/psp22/extensions/mintable.tests.ts (100%) rename tests/{ => e2e}/psp22/extensions/pausable.tests.ts (100%) rename tests/{ => e2e}/psp22/extensions/wrapper.ts (100%) rename tests/{ => e2e}/psp22/psp22.tests.ts (100%) rename tests/{ => e2e}/psp22/utils/token_timelock.tests.ts (100%) rename tests/{ => e2e}/psp34/extensions/burnable.tests.ts (100%) rename tests/{ => e2e}/psp34/extensions/enumerable.tests.ts (100%) rename tests/{ => e2e}/psp34/extensions/metadata.tests.ts (100%) rename tests/{ => e2e}/psp34/extensions/mintable.tests.ts (100%) rename tests/{ => e2e}/psp34/psp34.tests.ts (100%) rename tests/{ => e2e}/reentrancy-guard.tests.ts (100%) rename tests/{ => e2e}/setup/chai.ts (100%) rename tests/{ => e2e}/timelock-controller.tests.ts (100%) rename tests/{ => e2e}/upgradability/diamond_psp22.tests.ts (100%) rename tests/{ => e2e}/upgradability/proxy_psp22.tests.ts (100%) rename {contracts/tests => tests}/ownable.rs (98%) rename {contracts/tests => tests}/pausable.rs (97%) rename {contracts/tests => tests}/payment_splitter.rs (98%) rename {contracts/tests => tests}/proxy.rs (98%) rename {contracts/tests => tests}/psp1155.rs (99%) rename {contracts/tests => tests}/psp1155_burnable.rs (97%) rename {contracts/tests => tests}/psp1155_metadata.rs (95%) rename {contracts/tests => tests}/psp1155_mintable.rs (97%) rename {contracts/tests => tests}/psp22.rs (99%) rename {contracts/tests => tests}/psp22_burnable.rs (98%) rename {contracts/tests => tests}/psp22_flashmint.rs (97%) rename {contracts/tests => tests}/psp22_metadata.rs (96%) rename {contracts/tests => tests}/psp22_mintable.rs (98%) rename {contracts/tests => tests}/psp22_token_timelock.rs (97%) rename {contracts/tests => tests}/psp22_wrapper.rs (97%) rename {contracts/tests => tests}/psp34.rs (99%) rename {contracts/tests => tests}/psp34_burnable.rs (97%) rename {contracts/tests => tests}/psp34_enumerable.rs (98%) rename {contracts/tests => tests}/psp34_metadata.rs (96%) rename {contracts/tests => tests}/psp34_mintable.rs (98%) rename {contracts/tests => tests}/reentrancy_guard.rs (93%) rename {contracts/tests => tests}/timelock_controller.rs (99%) diff --git a/Cargo.toml b/Cargo.toml index a1f8c1e1f..a3f93b6ec 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [workspace] members = [ "contracts", - "brush_lang", + "lang", ] exclude = [ @@ -11,17 +11,27 @@ exclude = [ ] [package] -name = "brush" +name = "openbrush" version = "1.8.0" authors = ["Supercolony "] edition = "2018" +license = "MIT" +readme = "README.md" +repository = "https://github.com/Supercolony-net/openbrush-contracts" +documentation = "https://docs.openbrush.io" +homepage = "https://supercolony.net" +description = "OpenBrush library for smart contract development on ink!." +keywords = ["wasm", "supercolony", "smart-contracts", "blockchain", "ink"] +categories = ["no-std", "embedded"] +include = ["Cargo.toml", "lib.rs"] + [dependencies] -contracts = { version = "1.8.0", path = "./contracts", default-features = false } -brush_lang = { version = "1.8.0", path = "./brush_lang", default-features = false } +openbrush_contracts = { version = "1.8.0", path = "contracts", default-features = false } +openbrush_lang = { version = "1.8.0", path = "lang", default-features = false } [lib] -name = "brush" +name = "openbrush" path = "lib.rs" crate-type = [ "rlib", @@ -30,20 +40,20 @@ crate-type = [ [features] default = ["std"] std = [ - "contracts/std", - "brush_lang/std", + "openbrush_contracts/std", + "openbrush_lang/std", ] -psp22 = ["contracts/psp22"] -psp34 = ["contracts/psp34"] -psp1155 = ["contracts/psp1155"] -ownable = ["contracts/ownable"] -access_control = ["contracts/access_control"] -payment_splitter = ["contracts/payment_splitter"] -reentrancy_guard = ["contracts/reentrancy_guard"] -pausable = ["contracts/pausable"] -timelock_controller = ["contracts/timelock_controller"] -proxy = ["contracts/proxy"] -diamond = ["contracts/diamond"] +psp22 = ["openbrush_contracts/psp22"] +psp34 = ["openbrush_contracts/psp34"] +psp1155 = ["openbrush_contracts/psp1155"] +ownable = ["openbrush_contracts/ownable"] +access_control = ["openbrush_contracts/access_control"] +payment_splitter = ["openbrush_contracts/payment_splitter"] +reentrancy_guard = ["openbrush_contracts/reentrancy_guard"] +pausable = ["openbrush_contracts/pausable"] +timelock_controller = ["openbrush_contracts/timelock_controller"] +proxy = ["openbrush_contracts/proxy"] +diamond = ["openbrush_contracts/diamond"] [profile.release] panic = "abort" diff --git a/README.md b/README.md index 42a589feb..df208ca94 100644 --- a/README.md +++ b/README.md @@ -53,18 +53,18 @@ to call methods of that trait from some contract in the network (do a cross contract call). ```rust -#[brush::trait_definition] +#[openbrush::trait_definition] pub trait Trait1 { #[ink(message)] fn foo(&mut self) -> bool; } -#[brush::wrapper] +#[openbrush::wrapper] type Trait1Ref = dyn Trait1; { // It should be `AccountId` of some contract in the network - let callee: brush::traits::AccountId = [1; 32].into(); + let callee: openbrush::traits::AccountId = [1; 32].into(); // This code will execute a cross contract call to `callee` contract let result_of_foo: bool = Trait1Ref::foo(&callee); } @@ -110,8 +110,8 @@ All contracts are upgradable by default. It will be refactored after [Storage re ------- Release 0.2.0 - [x] Remove the boilerplate to make the internal implementation external. -- - [x] Implement `brush::contract` macro to consume all brush's stuff before ink!. -- - [x] Implement `brush::trait_definition` which stores definition of trait and allow to use it in `brush::contract` macro. +- - [x] Implement `openbrush::contract` macro to consume all openbrush's stuff before ink!. +- - [x] Implement `openbrush::trait_definition` which stores definition of trait and allow to use it in `openbrush::contract` macro. - - [x] Implement `impl_trait!` macro which reuse internal implementation in external impl section. - [x] Refactor examples and tests with new macros. - [x] Decide how to handle errors and implement it in library (Decided to use `panic!` and `assert!`). @@ -188,7 +188,7 @@ After you can run tests by `yarn run test` command. It will build all contracts ## History behind - [OpenZeppelin in ink!](https://medium.com/supercolony/ink-has-most-of-the-features-required-for-usage-however-the-usability-of-ink-is-low-95f4bc974e22) -- [Openbrush was born](https://supercolony.medium.com/openbrush-an-early-alpha-of-our-openzeppelin-library-for-ink-a0c3f4f9432) +- [Openopenbrush was born](https://supercolony.medium.com/openbrush-an-early-alpha-of-our-openzeppelin-library-for-ink-a0c3f4f9432) ## FAQ diff --git a/brush_lang/macros.rs b/brush_lang/macros.rs deleted file mode 100644 index 065a6ced9..000000000 --- a/brush_lang/macros.rs +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) 2012-2022 Supercolony -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the"Software"), -// to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -/// This `macro_rule` defines the storage trait. -/// -/// The first argument is the name of the storage trait. -/// The second argument is the type of storage data, which will be returned by this trait. -/// -/// An example of the usage of this macro can be found in any contract implemented by this library. -/// For example [OwnableStorage](ownable::OwnableStorage). -#[macro_export] -macro_rules! declare_storage_trait { - ($trait_name:ident,$data_ty:ty) => { - pub trait $trait_name: ::brush::traits::InkStorage { - fn get(&self) -> &$data_ty; - fn get_mut(&mut self) -> &mut $data_ty; - } - }; -} - -/// This `macro_rule` manually generates implementation for storage trait. -/// You can use this macro to generate the implementation for the storage trait -/// if you don't want to use derive macro, or if it is not created. -/// -/// The first argument is the name of the storage trait. -/// The second argument is the name of the struct, for which you are creating the impl section. -/// The third argument is the name of the field, which will be returned by the trait's implementation. -/// The fourth argument is the type of storage data, which will be returned. -#[macro_export] -macro_rules! impl_storage_trait { - ($trait_name:ident,$struct_name:ident,$field:ident,$data_ty:ty) => { - impl $trait_name for $struct_name { - fn get(&self) -> &$data_ty { - &self.$field - } - - fn get_mut(&mut self) -> &mut $data_ty { - &mut self.$field - } - } - }; -} diff --git a/contracts/Cargo.toml b/contracts/Cargo.toml index 35ebfd0b2..94ea291c2 100644 --- a/contracts/Cargo.toml +++ b/contracts/Cargo.toml @@ -1,9 +1,19 @@ [package] -name = "contracts" +name = "openbrush_contracts" version = "1.8.0" authors = ["Supercolony "] edition = "2021" +license = "MIT" +readme = "README.md" +repository = "https://github.com/Supercolony-net/openbrush-contracts" +documentation = "https://docs.openbrush.io" +homepage = "https://supercolony.net" +description = "Reusable implementations of contracts and traits for interaction with them." +keywords = ["wasm", "supercolony", "smart-contracts", "blockchain", "ink"] +categories = ["no-std", "embedded"] +include = ["Cargo.toml", "src/**/*.rs"] + [dependencies] ink_primitives = { version = "3.2.0", default-features = false } ink_metadata = { version = "3.2.0", default-features = false, features = ["derive"], optional = true } @@ -15,12 +25,12 @@ ink_prelude = { version = "3.2.0", default-features = false } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2", default-features = false, features = ["derive"], optional = true } -derive = { version = "1.8.0", path = "./derive" } -brush = { version = "1.8.0", package = "brush_lang", path = "../brush_lang", default-features = false } +derive = { package = "openbrush_contracts_derive", version = "1.8.0", path = "derive" } +openbrush = { version = "1.8.0", package = "openbrush_lang", path = "../lang", default-features = false } [lib] -name = "contracts" -path = "lib.rs" +name = "openbrush_contracts" +path = "src/lib.rs" crate-type = [ "rlib", ] @@ -35,7 +45,7 @@ std = [ "scale/std", "scale-info/std", - "brush/std", + "openbrush/std", ] psp22 = [ "derive/psp22", diff --git a/contracts/README.md b/contracts/README.md index 574696e8f..fc60d52a9 100644 --- a/contracts/README.md +++ b/contracts/README.md @@ -1,9 +1,9 @@ ## Overview -`traits` contains definitions of traits(interfaces) for the popular contracts. +[`traits`](src/traits) contains definitions of traits(interfaces) for the popular contracts. Anyone can import the trait and use it to do cross-contract calls without knowing the implementation of the contract. This folder contains the implementation of popular contracts. -Anyone can re-use the implementation after importing the `brush` crate, enabling +Anyone can re-use the implementation after importing the `openbrush` crate, enabling the desired feature(s) of the contract, and implementing all required traits. diff --git a/contracts/derive/Cargo.toml b/contracts/derive/Cargo.toml index 718ee40af..12b3dcccf 100644 --- a/contracts/derive/Cargo.toml +++ b/contracts/derive/Cargo.toml @@ -1,17 +1,26 @@ [package] -name = "derive" +name = "openbrush_contracts_derive" version = "1.8.0" authors = ["Supercolony "] edition = "2021" +license = "MIT" +repository = "https://github.com/Supercolony-net/openbrush-contracts" +documentation = "https://docs.openbrush.io" +homepage = "https://supercolony.net" +description = "Derives for storage data of each contract in the openbrush." +keywords = ["wasm", "supercolony", "smart-contracts", "blockchain", "ink"] +categories = ["no-std", "embedded"] +include = ["Cargo.toml", "lib.rs"] + [dependencies] syn = { version = "1.0" } quote = "1.0" proc-macro2 = "1" -brush_lang = { path = "../../brush_lang" } +openbrush = { package = "openbrush_lang", version = "1.8.0", path = "../../lang" } [lib] -name = "derive" +name = "openbrush_contracts_derive" path = "lib.rs" proc-macro = true diff --git a/contracts/derive/lib.rs b/contracts/derive/lib.rs index 21feb4f9b..613273bca 100644 --- a/contracts/derive/lib.rs +++ b/contracts/derive/lib.rs @@ -23,7 +23,7 @@ extern crate proc_macro; #[allow(unused_imports)] -use brush_lang::declare_derive_storage_trait; +use openbrush::declare_derive_storage_trait; // PSP22 #[cfg(feature = "psp22")] diff --git a/contracts/access/access_control/mod.rs b/contracts/src/access/access_control/mod.rs similarity index 97% rename from contracts/access/access_control/mod.rs rename to contracts/src/access/access_control/mod.rs index 6867b7b52..32df45821 100644 --- a/contracts/access/access_control/mod.rs +++ b/contracts/src/access/access_control/mod.rs @@ -20,19 +20,19 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. pub use crate::traits::access_control::*; -use brush::{ +pub use derive::AccessControlStorage; +use ink_storage::Mapping; +use openbrush::{ declare_storage_trait, modifier_definition, modifiers, traits::AccountId, }; -pub use derive::AccessControlStorage; -use ink_storage::Mapping; -pub const STORAGE_KEY: [u8; 32] = ink_lang::blake2x256!("brush::AccessControlData"); +pub const STORAGE_KEY: [u8; 32] = ink_lang::blake2x256!("openbrush::AccessControlData"); #[derive(Default, Debug)] -#[brush::storage(STORAGE_KEY)] +#[openbrush::storage(STORAGE_KEY)] pub struct AccessControlData { pub admin_roles: Mapping, pub members: Mapping<(RoleType, AccountId), ()>, diff --git a/contracts/access/mod.rs b/contracts/src/access/mod.rs similarity index 100% rename from contracts/access/mod.rs rename to contracts/src/access/mod.rs diff --git a/contracts/access/ownable/mod.rs b/contracts/src/access/ownable/mod.rs similarity index 96% rename from contracts/access/ownable/mod.rs rename to contracts/src/access/ownable/mod.rs index e2224a989..f5566cb2f 100644 --- a/contracts/access/ownable/mod.rs +++ b/contracts/src/access/ownable/mod.rs @@ -20,7 +20,8 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. pub use crate::traits::ownable::*; -use brush::{ +pub use derive::OwnableStorage; +use openbrush::{ declare_storage_trait, modifier_definition, modifiers, @@ -30,12 +31,11 @@ use brush::{ ZERO_ADDRESS, }, }; -pub use derive::OwnableStorage; -pub const STORAGE_KEY: [u8; 32] = ink_lang::blake2x256!("brush::OwnableData"); +pub const STORAGE_KEY: [u8; 32] = ink_lang::blake2x256!("openbrush::OwnableData"); #[derive(Default, Debug)] -#[brush::storage(STORAGE_KEY)] +#[openbrush::storage(STORAGE_KEY)] pub struct OwnableData { pub owner: AccountId, pub _reserved: Option<()>, diff --git a/contracts/finance/mod.rs b/contracts/src/finance/mod.rs similarity index 100% rename from contracts/finance/mod.rs rename to contracts/src/finance/mod.rs diff --git a/contracts/finance/payment_splitter/mod.rs b/contracts/src/finance/payment_splitter/mod.rs similarity index 97% rename from contracts/finance/payment_splitter/mod.rs rename to contracts/src/finance/payment_splitter/mod.rs index a164bb622..1c2252ad1 100644 --- a/contracts/finance/payment_splitter/mod.rs +++ b/contracts/src/finance/payment_splitter/mod.rs @@ -20,7 +20,10 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. pub use crate::traits::payment_splitter::*; -use brush::{ +pub use derive::PaymentSplitterStorage; +use ink_prelude::vec::Vec; +use ink_storage::Mapping; +use openbrush::{ declare_storage_trait, traits::{ AccountId, @@ -29,14 +32,11 @@ use brush::{ ZERO_ADDRESS, }, }; -pub use derive::PaymentSplitterStorage; -use ink_prelude::vec::Vec; -use ink_storage::Mapping; -pub const STORAGE_KEY: [u8; 32] = ink_lang::blake2x256!("brush::PaymentSplitterData"); +pub const STORAGE_KEY: [u8; 32] = ink_lang::blake2x256!("openbrush::PaymentSplitterData"); #[derive(Default, Debug)] -#[brush::storage(STORAGE_KEY)] +#[openbrush::storage(STORAGE_KEY)] pub struct PaymentSplitterData { pub total_shares: Balance, pub total_released: Balance, diff --git a/contracts/governance/mod.rs b/contracts/src/governance/mod.rs similarity index 100% rename from contracts/governance/mod.rs rename to contracts/src/governance/mod.rs diff --git a/contracts/governance/timelock_controller/mod.rs b/contracts/src/governance/timelock_controller/mod.rs similarity index 99% rename from contracts/governance/timelock_controller/mod.rs rename to contracts/src/governance/timelock_controller/mod.rs index 3cf784dc9..4fceb5214 100644 --- a/contracts/governance/timelock_controller/mod.rs +++ b/contracts/src/governance/timelock_controller/mod.rs @@ -23,18 +23,6 @@ pub use crate::{ access_control::*, traits::timelock_controller::*, }; -use brush::{ - declare_storage_trait, - modifier_definition, - modifiers, - traits::{ - AccountId, - Flush, - Hash, - Timestamp, - ZERO_ADDRESS, - }, -}; use core::convert::TryFrom; pub use derive::TimelockControllerStorage; use ink_env::{ @@ -52,12 +40,24 @@ use ink_prelude::{ vec::Vec, }; use ink_storage::Mapping; +use openbrush::{ + declare_storage_trait, + modifier_definition, + modifiers, + traits::{ + AccountId, + Flush, + Hash, + Timestamp, + ZERO_ADDRESS, + }, +}; use scale::Encode; -pub const STORAGE_KEY: [u8; 32] = ink_lang::blake2x256!("brush::TimelockControllerData"); +pub const STORAGE_KEY: [u8; 32] = ink_lang::blake2x256!("openbrush::TimelockControllerData"); #[derive(Default, Debug)] -#[brush::storage(STORAGE_KEY)] +#[openbrush::storage(STORAGE_KEY)] pub struct TimelockControllerData { pub access_control: AccessControlData, pub min_delay: Timestamp, diff --git a/contracts/lib.rs b/contracts/src/lib.rs similarity index 100% rename from contracts/lib.rs rename to contracts/src/lib.rs diff --git a/contracts/security/mod.rs b/contracts/src/security/mod.rs similarity index 100% rename from contracts/security/mod.rs rename to contracts/src/security/mod.rs diff --git a/contracts/security/pausable/mod.rs b/contracts/src/security/pausable/mod.rs similarity index 96% rename from contracts/security/pausable/mod.rs rename to contracts/src/security/pausable/mod.rs index 18bc5c0e8..17750e3ca 100644 --- a/contracts/security/pausable/mod.rs +++ b/contracts/src/security/pausable/mod.rs @@ -20,18 +20,18 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. pub use crate::traits::pausable::*; -use brush::{ +pub use derive::PausableStorage; +use openbrush::{ declare_storage_trait, modifier_definition, modifiers, traits::AccountId, }; -pub use derive::PausableStorage; -pub const STORAGE_KEY: [u8; 32] = ink_lang::blake2x256!("brush::PausableData"); +pub const STORAGE_KEY: [u8; 32] = ink_lang::blake2x256!("openbrush::PausableData"); #[derive(Default, Debug)] -#[brush::storage(STORAGE_KEY)] +#[openbrush::storage(STORAGE_KEY)] pub struct PausableData { pub paused: bool, pub _reserved: Option<()>, diff --git a/contracts/security/reentrancy_guard/mod.rs b/contracts/src/security/reentrancy_guard/mod.rs similarity index 95% rename from contracts/security/reentrancy_guard/mod.rs rename to contracts/src/security/reentrancy_guard/mod.rs index dd473cdc3..692d22018 100644 --- a/contracts/security/reentrancy_guard/mod.rs +++ b/contracts/src/security/reentrancy_guard/mod.rs @@ -20,17 +20,17 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. pub use crate::traits::errors::ReentrancyGuardError; -use brush::{ +pub use derive::ReentrancyGuardStorage; +use ink_storage::traits::push_spread_root; +use openbrush::{ declare_storage_trait, modifier_definition, }; -pub use derive::ReentrancyGuardStorage; -use ink_storage::traits::push_spread_root; -pub const STORAGE_KEY: [u8; 32] = ink_lang::blake2x256!("brush::ReentrancyGuardData"); +pub const STORAGE_KEY: [u8; 32] = ink_lang::blake2x256!("openbrush::ReentrancyGuardData"); #[derive(Default, Debug)] -#[brush::storage(STORAGE_KEY)] +#[openbrush::storage(STORAGE_KEY)] pub struct ReentrancyGuardData { pub status: u8, pub _reserved: Option<()>, diff --git a/contracts/token/mod.rs b/contracts/src/token/mod.rs similarity index 100% rename from contracts/token/mod.rs rename to contracts/src/token/mod.rs diff --git a/contracts/token/psp1155/extensions/burnable.rs b/contracts/src/token/psp1155/extensions/burnable.rs similarity index 98% rename from contracts/token/psp1155/extensions/burnable.rs rename to contracts/src/token/psp1155/extensions/burnable.rs index 500359aee..a4e1d08d0 100644 --- a/contracts/token/psp1155/extensions/burnable.rs +++ b/contracts/src/token/psp1155/extensions/burnable.rs @@ -23,12 +23,12 @@ pub use crate::{ psp1155::*, traits::psp1155::extensions::burnable::*, }; -use brush::traits::{ +use ink_prelude::vec::Vec; +use openbrush::traits::{ AccountId, Balance, InkStorage, }; -use ink_prelude::vec::Vec; impl PSP1155Burnable for T { default fn burn(&mut self, from: AccountId, ids_amounts: Vec<(Id, Balance)>) -> Result<(), PSP1155Error> { diff --git a/contracts/token/psp1155/extensions/metadata.rs b/contracts/src/token/psp1155/extensions/metadata.rs similarity index 90% rename from contracts/token/psp1155/extensions/metadata.rs rename to contracts/src/token/psp1155/extensions/metadata.rs index 99dc3aadc..881cc82f8 100644 --- a/contracts/token/psp1155/extensions/metadata.rs +++ b/contracts/src/token/psp1155/extensions/metadata.rs @@ -23,14 +23,14 @@ pub use crate::{ psp1155::*, traits::psp1155::extensions::metadata::*, }; -use brush::declare_storage_trait; pub use derive::PSP1155MetadataStorage; use ink_prelude::string::String; +use openbrush::declare_storage_trait; -pub const STORAGE_KEY: [u8; 32] = ink_lang::blake2x256!("brush::PSP1155MetadataData"); +pub const STORAGE_KEY: [u8; 32] = ink_lang::blake2x256!("openbrush::PSP1155MetadataData"); #[derive(Default, Debug)] -#[brush::storage(STORAGE_KEY)] +#[openbrush::storage(STORAGE_KEY)] pub struct PSP1155MetadataData { pub uri: Option, pub _reserved: Option<()>, diff --git a/contracts/token/psp1155/extensions/mintable.rs b/contracts/src/token/psp1155/extensions/mintable.rs similarity index 98% rename from contracts/token/psp1155/extensions/mintable.rs rename to contracts/src/token/psp1155/extensions/mintable.rs index 43bf60f44..01667b1c2 100644 --- a/contracts/token/psp1155/extensions/mintable.rs +++ b/contracts/src/token/psp1155/extensions/mintable.rs @@ -23,12 +23,12 @@ pub use crate::{ psp1155::*, traits::psp1155::extensions::mintable::*, }; -use brush::traits::{ +use ink_prelude::vec::Vec; +use openbrush::traits::{ AccountId, Balance, InkStorage, }; -use ink_prelude::vec::Vec; impl PSP1155Mintable for T { default fn mint(&mut self, to: AccountId, ids_amounts: Vec<(Id, Balance)>) -> Result<(), PSP1155Error> { diff --git a/contracts/token/psp1155/mod.rs b/contracts/src/token/psp1155/mod.rs similarity index 100% rename from contracts/token/psp1155/mod.rs rename to contracts/src/token/psp1155/mod.rs diff --git a/contracts/token/psp1155/psp1155.rs b/contracts/src/token/psp1155/psp1155.rs similarity index 98% rename from contracts/token/psp1155/psp1155.rs rename to contracts/src/token/psp1155/psp1155.rs index 7d415dcfe..6f46d4792 100644 --- a/contracts/token/psp1155/psp1155.rs +++ b/contracts/src/token/psp1155/psp1155.rs @@ -20,15 +20,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. pub use crate::traits::psp1155::*; -use brush::{ - declare_storage_trait, - traits::{ - AccountId, - AccountIdExt, - Balance, - Flush, - }, -}; use core::result::Result; pub use derive::PSP1155Storage; use ink_env::{ @@ -41,11 +32,20 @@ use ink_prelude::{ vec::Vec, }; use ink_storage::Mapping; +use openbrush::{ + declare_storage_trait, + traits::{ + AccountId, + AccountIdExt, + Balance, + Flush, + }, +}; -pub const STORAGE_KEY: [u8; 32] = ink_lang::blake2x256!("brush::PSP1155Data"); +pub const STORAGE_KEY: [u8; 32] = ink_lang::blake2x256!("openbrush::PSP1155Data"); #[derive(Default, Debug)] -#[brush::storage(STORAGE_KEY)] +#[openbrush::storage(STORAGE_KEY)] pub struct PSP1155Data { pub balances: Mapping<(Id, AccountId), Balance>, pub operator_approval: Mapping<(AccountId, AccountId), bool>, diff --git a/contracts/token/psp22/extensions/burnable.rs b/contracts/src/token/psp22/extensions/burnable.rs similarity index 98% rename from contracts/token/psp22/extensions/burnable.rs rename to contracts/src/token/psp22/extensions/burnable.rs index 1de2de166..076a0fa06 100644 --- a/contracts/token/psp22/extensions/burnable.rs +++ b/contracts/src/token/psp22/extensions/burnable.rs @@ -23,7 +23,7 @@ pub use crate::{ psp22::*, traits::psp22::extensions::burnable::*, }; -use brush::traits::{ +use openbrush::traits::{ AccountId, Balance, InkStorage, diff --git a/contracts/token/psp22/extensions/flashmint.rs b/contracts/src/token/psp22/extensions/flashmint.rs similarity index 99% rename from contracts/token/psp22/extensions/flashmint.rs rename to contracts/src/token/psp22/extensions/flashmint.rs index 060af6f8c..4e0019e5e 100644 --- a/contracts/token/psp22/extensions/flashmint.rs +++ b/contracts/src/token/psp22/extensions/flashmint.rs @@ -23,11 +23,6 @@ pub use crate::{ psp22::*, traits::flashloan::*, }; -use brush::traits::{ - AccountId, - Balance, - Flush, -}; use ink_env::{ CallFlags, Error as EnvError, @@ -36,6 +31,11 @@ use ink_prelude::{ string::String, vec::Vec, }; +use openbrush::traits::{ + AccountId, + Balance, + Flush, +}; impl FlashLender for T { default fn max_flashloan(&mut self, token: AccountId) -> Balance { diff --git a/contracts/token/psp22/extensions/metadata.rs b/contracts/src/token/psp22/extensions/metadata.rs similarity index 91% rename from contracts/token/psp22/extensions/metadata.rs rename to contracts/src/token/psp22/extensions/metadata.rs index c85d3c1f7..c5827a4c1 100644 --- a/contracts/token/psp22/extensions/metadata.rs +++ b/contracts/src/token/psp22/extensions/metadata.rs @@ -23,14 +23,14 @@ pub use crate::{ psp22::*, traits::psp22::extensions::metadata::*, }; -use brush::declare_storage_trait; pub use derive::PSP22MetadataStorage; use ink_prelude::string::String; +use openbrush::declare_storage_trait; -pub const STORAGE_KEY: [u8; 32] = ink_lang::blake2x256!("brush::PSP22MetadataData"); +pub const STORAGE_KEY: [u8; 32] = ink_lang::blake2x256!("openbrush::PSP22MetadataData"); #[derive(Default, Debug)] -#[brush::storage(STORAGE_KEY)] +#[openbrush::storage(STORAGE_KEY)] pub struct PSP22MetadataData { pub name: Option, pub symbol: Option, diff --git a/contracts/token/psp22/extensions/mintable.rs b/contracts/src/token/psp22/extensions/mintable.rs similarity index 98% rename from contracts/token/psp22/extensions/mintable.rs rename to contracts/src/token/psp22/extensions/mintable.rs index aeb2ebfbb..284a73f0e 100644 --- a/contracts/token/psp22/extensions/mintable.rs +++ b/contracts/src/token/psp22/extensions/mintable.rs @@ -23,7 +23,7 @@ pub use crate::{ psp22::*, traits::psp22::extensions::mintable::*, }; -use brush::traits::{ +use openbrush::traits::{ AccountId, Balance, }; diff --git a/contracts/token/psp22/extensions/wrapper.rs b/contracts/src/token/psp22/extensions/wrapper.rs similarity index 96% rename from contracts/token/psp22/extensions/wrapper.rs rename to contracts/src/token/psp22/extensions/wrapper.rs index 741223642..cf8d13db4 100644 --- a/contracts/token/psp22/extensions/wrapper.rs +++ b/contracts/src/token/psp22/extensions/wrapper.rs @@ -23,21 +23,21 @@ pub use crate::{ psp22::*, traits::psp22::extensions::wrapper::*, }; -use brush::{ +pub use derive::PSP22WrapperStorage; +use ink_env::CallFlags; +use ink_prelude::vec::Vec; +use openbrush::{ declare_storage_trait, traits::{ AccountId, Balance, }, }; -pub use derive::PSP22WrapperStorage; -use ink_env::CallFlags; -use ink_prelude::vec::Vec; -pub const STORAGE_KEY: [u8; 32] = ink_lang::blake2x256!("brush::PSP22WrapperData"); +pub const STORAGE_KEY: [u8; 32] = ink_lang::blake2x256!("openbrush::PSP22WrapperData"); #[derive(Default, Debug)] -#[brush::storage(STORAGE_KEY)] +#[openbrush::storage(STORAGE_KEY)] pub struct PSP22WrapperData { pub underlying: AccountId, pub _reserved: Option<()>, diff --git a/contracts/token/psp22/mod.rs b/contracts/src/token/psp22/mod.rs similarity index 100% rename from contracts/token/psp22/mod.rs rename to contracts/src/token/psp22/mod.rs diff --git a/contracts/token/psp22/psp22.rs b/contracts/src/token/psp22/psp22.rs similarity index 98% rename from contracts/token/psp22/psp22.rs rename to contracts/src/token/psp22/psp22.rs index 39cb53d57..e5282b9b4 100644 --- a/contracts/token/psp22/psp22.rs +++ b/contracts/src/token/psp22/psp22.rs @@ -26,15 +26,6 @@ pub use crate::traits::{ }, psp22::*, }; -use brush::{ - declare_storage_trait, - traits::{ - AccountId, - AccountIdExt, - Balance, - Flush, - }, -}; pub use derive::{ PSP22MetadataStorage, PSP22Storage, @@ -48,11 +39,20 @@ use ink_prelude::{ vec::Vec, }; use ink_storage::Mapping; +use openbrush::{ + declare_storage_trait, + traits::{ + AccountId, + AccountIdExt, + Balance, + Flush, + }, +}; -pub const STORAGE_KEY: [u8; 32] = ink_lang::blake2x256!("brush::PSP22Data"); +pub const STORAGE_KEY: [u8; 32] = ink_lang::blake2x256!("openbrush::PSP22Data"); #[derive(Default, Debug)] -#[brush::storage(STORAGE_KEY)] +#[openbrush::storage(STORAGE_KEY)] pub struct PSP22Data { pub supply: Balance, pub balances: Mapping, diff --git a/contracts/token/psp22/utils/token_timelock.rs b/contracts/src/token/psp22/utils/token_timelock.rs similarity index 96% rename from contracts/token/psp22/utils/token_timelock.rs rename to contracts/src/token/psp22/utils/token_timelock.rs index 04225bbb7..690d4c96d 100644 --- a/contracts/token/psp22/utils/token_timelock.rs +++ b/contracts/src/token/psp22/utils/token_timelock.rs @@ -24,7 +24,9 @@ pub use crate::traits::psp22::utils::token_timelock::*; use ink_env::CallFlags; pub use crate::traits::psp22::PSP22Ref; -use brush::{ +pub use derive::PSP22TokenTimelockStorage; +use ink_prelude::vec::Vec; +use openbrush::{ declare_storage_trait, traits::{ AccountId, @@ -32,13 +34,11 @@ use brush::{ Timestamp, }, }; -pub use derive::PSP22TokenTimelockStorage; -use ink_prelude::vec::Vec; -pub const STORAGE_KEY: [u8; 32] = ink_lang::blake2x256!("brush::PSP22TokenTimelockData"); +pub const STORAGE_KEY: [u8; 32] = ink_lang::blake2x256!("openbrush::PSP22TokenTimelockData"); #[derive(Default, Debug)] -#[brush::storage(STORAGE_KEY)] +#[openbrush::storage(STORAGE_KEY)] pub struct PSP22TokenTimelockData { token: AccountId, beneficiary: AccountId, diff --git a/contracts/token/psp34/extensions/burnable.rs b/contracts/src/token/psp34/extensions/burnable.rs similarity index 97% rename from contracts/token/psp34/extensions/burnable.rs rename to contracts/src/token/psp34/extensions/burnable.rs index 7aeec8385..afef70342 100644 --- a/contracts/token/psp34/extensions/burnable.rs +++ b/contracts/src/token/psp34/extensions/burnable.rs @@ -23,7 +23,7 @@ pub use crate::{ psp34::*, traits::psp34::extensions::burnable::*, }; -use brush::traits::AccountId; +use openbrush::traits::AccountId; impl PSP34Burnable for T { default fn burn(&mut self, account: AccountId, id: Id) -> Result<(), PSP34Error> { diff --git a/contracts/token/psp34/extensions/enumerable.rs b/contracts/src/token/psp34/extensions/enumerable.rs similarity index 96% rename from contracts/token/psp34/extensions/enumerable.rs rename to contracts/src/token/psp34/extensions/enumerable.rs index 4a6ddf50f..767134c04 100644 --- a/contracts/token/psp34/extensions/enumerable.rs +++ b/contracts/src/token/psp34/extensions/enumerable.rs @@ -23,23 +23,23 @@ pub use crate::{ psp34::*, traits::psp34::extensions::enumerable::*, }; -use brush::traits::{ +pub use derive::PSP34EnumerableStorage; +use ink_storage::Mapping; +use openbrush::traits::{ AccountId, Flush, }; -pub use derive::PSP34EnumerableStorage; -use ink_storage::Mapping; -pub const STORAGE_KEY: [u8; 32] = ink_lang::blake2x256!("brush::PSP34EnumerableData"); +pub const STORAGE_KEY: [u8; 32] = ink_lang::blake2x256!("openbrush::PSP34EnumerableData"); #[derive(Default, Debug)] -#[brush::storage(STORAGE_KEY)] +#[openbrush::storage(STORAGE_KEY)] pub struct PSP34EnumerableData { pub enumerable: EnumerableMapping, pub _reserved: Option<()>, } -pub trait PSP34EnumerableStorage: PSP34Storage + ::brush::traits::InkStorage { +pub trait PSP34EnumerableStorage: PSP34Storage + ::openbrush::traits::InkStorage { fn get(&self) -> &PSP34EnumerableData; fn get_mut(&mut self) -> &mut PSP34EnumerableData; } diff --git a/contracts/token/psp34/extensions/metadata.rs b/contracts/src/token/psp34/extensions/metadata.rs similarity index 92% rename from contracts/token/psp34/extensions/metadata.rs rename to contracts/src/token/psp34/extensions/metadata.rs index c77ee3907..69f2766ec 100644 --- a/contracts/token/psp34/extensions/metadata.rs +++ b/contracts/src/token/psp34/extensions/metadata.rs @@ -23,18 +23,18 @@ pub use crate::{ psp34::*, traits::psp34::extensions::metadata::*, }; -use brush::declare_storage_trait; pub use derive::{ PSP34MetadataStorage, PSP34Storage, }; use ink_prelude::vec::Vec; use ink_storage::Mapping; +use openbrush::declare_storage_trait; -pub const STORAGE_KEY: [u8; 32] = ink_lang::blake2x256!("brush::PSP32MetadataData"); +pub const STORAGE_KEY: [u8; 32] = ink_lang::blake2x256!("openbrush::PSP32MetadataData"); #[derive(Default, Debug)] -#[brush::storage(STORAGE_KEY)] +#[openbrush::storage(STORAGE_KEY)] pub struct PSP34MetadataData { pub attributes: Mapping<(Id, Vec), Vec>, pub _reserved: Option<()>, diff --git a/contracts/token/psp34/extensions/mintable.rs b/contracts/src/token/psp34/extensions/mintable.rs similarity index 97% rename from contracts/token/psp34/extensions/mintable.rs rename to contracts/src/token/psp34/extensions/mintable.rs index 4ba46d91d..1b093f3a7 100644 --- a/contracts/token/psp34/extensions/mintable.rs +++ b/contracts/src/token/psp34/extensions/mintable.rs @@ -23,7 +23,7 @@ pub use crate::{ psp34::*, traits::psp34::extensions::mintable::*, }; -use brush::traits::AccountId; +use openbrush::traits::AccountId; impl PSP34Mintable for T { default fn mint(&mut self, account: AccountId, id: Id) -> Result<(), PSP34Error> { diff --git a/contracts/token/psp34/mod.rs b/contracts/src/token/psp34/mod.rs similarity index 100% rename from contracts/token/psp34/mod.rs rename to contracts/src/token/psp34/mod.rs diff --git a/contracts/token/psp34/psp34.rs b/contracts/src/token/psp34/psp34.rs similarity index 98% rename from contracts/token/psp34/psp34.rs rename to contracts/src/token/psp34/psp34.rs index 44b73adbc..364ec0042 100644 --- a/contracts/token/psp34/psp34.rs +++ b/contracts/src/token/psp34/psp34.rs @@ -20,13 +20,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. pub use crate::traits::psp34::*; -use brush::{ - declare_storage_trait, - traits::{ - AccountId, - Flush, - }, -}; pub use derive::PSP34Storage; use ink_env::{ CallFlags, @@ -37,16 +30,23 @@ use ink_prelude::{ vec::Vec, }; use ink_storage::Mapping; +use openbrush::{ + declare_storage_trait, + traits::{ + AccountId, + Flush, + }, +}; -use brush::traits::Balance; +use openbrush::traits::Balance; type Owner = AccountId; type Operator = AccountId; -pub const STORAGE_KEY: [u8; 32] = ink_lang::blake2x256!("brush::PSP34Data"); +pub const STORAGE_KEY: [u8; 32] = ink_lang::blake2x256!("openbrush::PSP34Data"); #[derive(Default, Debug)] -#[brush::storage(STORAGE_KEY)] +#[openbrush::storage(STORAGE_KEY)] pub struct PSP34Data { pub token_owner: Mapping, pub owned_tokens_count: Mapping, diff --git a/contracts/traits/access_control/mod.rs b/contracts/src/traits/access_control/mod.rs similarity index 97% rename from contracts/traits/access_control/mod.rs rename to contracts/src/traits/access_control/mod.rs index 0e46676d5..fd933f401 100644 --- a/contracts/traits/access_control/mod.rs +++ b/contracts/src/traits/access_control/mod.rs @@ -20,11 +20,11 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. pub use crate::traits::errors::AccessControlError; -use brush::traits::AccountId; +use openbrush::traits::AccountId; pub type RoleType = u32; -#[brush::wrapper] +#[openbrush::wrapper] pub type AccessControlRef = dyn AccessControl; /// Contract module that allows children to implement role-based access @@ -34,7 +34,7 @@ pub type AccessControlRef = dyn AccessControl; /// Roles can be granted and revoked dynamically via the `grant_role` and /// `revoke_role`. functions. Each role has an associated admin role, and only /// accounts that have a role's admin role can call `grant_role` and `revoke_role`. -#[brush::trait_definition] +#[openbrush::trait_definition] pub trait AccessControl { /// Returns `true` if `account` has been granted `role`. #[ink(message)] diff --git a/contracts/traits/diamond/diamond.rs b/contracts/src/traits/diamond/diamond.rs similarity index 97% rename from contracts/traits/diamond/diamond.rs rename to contracts/src/traits/diamond/diamond.rs index 2c243d420..25f5cb913 100644 --- a/contracts/traits/diamond/diamond.rs +++ b/contracts/src/traits/diamond/diamond.rs @@ -26,10 +26,10 @@ pub use crate::traits::{ }, ownable::*, }; -use brush::traits::Hash; use ink_prelude::vec::Vec; +use openbrush::traits::Hash; -#[brush::wrapper] +#[openbrush::wrapper] pub type DiamondRef = dyn Diamond; pub type Selector = [u8; 4]; @@ -57,7 +57,7 @@ pub struct InitCall { } /// Trait to be implemented in the contract which holds the diamond storage -#[brush::trait_definition] +#[openbrush::trait_definition] pub trait Diamond { /// This function is used to add, replace and remove facets from the diamond /// diff --git a/contracts/traits/diamond/extensions/diamond_loupe.rs b/contracts/src/traits/diamond/extensions/diamond_loupe.rs similarity index 96% rename from contracts/traits/diamond/extensions/diamond_loupe.rs rename to contracts/src/traits/diamond/extensions/diamond_loupe.rs index a9c5be4d1..b4e8aa010 100644 --- a/contracts/traits/diamond/extensions/diamond_loupe.rs +++ b/contracts/src/traits/diamond/extensions/diamond_loupe.rs @@ -20,14 +20,14 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. pub use crate::traits::diamond::*; -use brush::traits::Hash; use ink_prelude::vec::Vec; +use openbrush::traits::Hash; -#[brush::wrapper] +#[openbrush::wrapper] pub type DiamondLoupeRef = dyn DiamondLoupe; /// Trait which implements functions of Diamond Loupe to lookup the functionality of the diamond contract -#[brush::trait_definition] +#[openbrush::trait_definition] pub trait DiamondLoupe { /// Returns code hashes of all registered facets along with their registered function selectors #[ink(message)] diff --git a/contracts/traits/diamond/mod.rs b/contracts/src/traits/diamond/mod.rs similarity index 100% rename from contracts/traits/diamond/mod.rs rename to contracts/src/traits/diamond/mod.rs diff --git a/contracts/traits/errors/access_control.rs b/contracts/src/traits/errors/access_control.rs similarity index 100% rename from contracts/traits/errors/access_control.rs rename to contracts/src/traits/errors/access_control.rs diff --git a/contracts/traits/errors/diamond.rs b/contracts/src/traits/errors/diamond.rs similarity index 98% rename from contracts/traits/errors/diamond.rs rename to contracts/src/traits/errors/diamond.rs index 6af1db87d..0f6bdd18c 100644 --- a/contracts/traits/errors/diamond.rs +++ b/contracts/src/traits/errors/diamond.rs @@ -20,7 +20,7 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. use super::OwnableError; -use brush::traits::Hash; +use openbrush::traits::Hash; /// The Diamond error type. Contract will throw one of this errors. #[derive(Debug, PartialEq, Eq, scale::Encode, scale::Decode)] diff --git a/contracts/traits/errors/flashloan.rs b/contracts/src/traits/errors/flashloan.rs similarity index 100% rename from contracts/traits/errors/flashloan.rs rename to contracts/src/traits/errors/flashloan.rs diff --git a/contracts/traits/errors/mod.rs b/contracts/src/traits/errors/mod.rs similarity index 100% rename from contracts/traits/errors/mod.rs rename to contracts/src/traits/errors/mod.rs diff --git a/contracts/traits/errors/ownable.rs b/contracts/src/traits/errors/ownable.rs similarity index 100% rename from contracts/traits/errors/ownable.rs rename to contracts/src/traits/errors/ownable.rs diff --git a/contracts/traits/errors/pausable.rs b/contracts/src/traits/errors/pausable.rs similarity index 100% rename from contracts/traits/errors/pausable.rs rename to contracts/src/traits/errors/pausable.rs diff --git a/contracts/traits/errors/payment_splitter.rs b/contracts/src/traits/errors/payment_splitter.rs similarity index 100% rename from contracts/traits/errors/payment_splitter.rs rename to contracts/src/traits/errors/payment_splitter.rs diff --git a/contracts/traits/errors/psp1155.rs b/contracts/src/traits/errors/psp1155.rs similarity index 100% rename from contracts/traits/errors/psp1155.rs rename to contracts/src/traits/errors/psp1155.rs diff --git a/contracts/traits/errors/psp22.rs b/contracts/src/traits/errors/psp22.rs similarity index 100% rename from contracts/traits/errors/psp22.rs rename to contracts/src/traits/errors/psp22.rs diff --git a/contracts/traits/errors/psp34.rs b/contracts/src/traits/errors/psp34.rs similarity index 100% rename from contracts/traits/errors/psp34.rs rename to contracts/src/traits/errors/psp34.rs diff --git a/contracts/traits/errors/reentrancy_guard.rs b/contracts/src/traits/errors/reentrancy_guard.rs similarity index 100% rename from contracts/traits/errors/reentrancy_guard.rs rename to contracts/src/traits/errors/reentrancy_guard.rs diff --git a/contracts/traits/errors/timelock_controller.rs b/contracts/src/traits/errors/timelock_controller.rs similarity index 100% rename from contracts/traits/errors/timelock_controller.rs rename to contracts/src/traits/errors/timelock_controller.rs diff --git a/contracts/traits/flashloan/mod.rs b/contracts/src/traits/flashloan/mod.rs similarity index 96% rename from contracts/traits/flashloan/mod.rs rename to contracts/src/traits/flashloan/mod.rs index 662970d43..0883fb024 100644 --- a/contracts/traits/flashloan/mod.rs +++ b/contracts/src/traits/flashloan/mod.rs @@ -23,18 +23,18 @@ pub use crate::traits::errors::{ FlashBorrowerError, FlashLenderError, }; -use brush::traits::{ +use ink_prelude::vec::Vec; +use openbrush::traits::{ AccountId, Balance, }; -use ink_prelude::vec::Vec; -#[brush::wrapper] +#[openbrush::wrapper] pub type FlashLenderRef = dyn FlashLender; /// TODO remove eip link /// Flash Lender implementation as proposed in https://eips.ethereum.org/EIPS/eip-3156) -#[brush::trait_definition] +#[openbrush::trait_definition] pub trait FlashLender { /// Call this function in `max_flashloan` function in `impl` block of FlashLender /// Maximum amount of `token` available to mint @@ -66,12 +66,12 @@ pub trait FlashLender { ) -> Result<(), FlashLenderError>; } -#[brush::wrapper] +#[openbrush::wrapper] pub type FlashBorrowerRef = dyn FlashBorrower; /// TODO remove eip link /// Flash Borrower implementation as proposed in https://eips.ethereum.org/EIPS/eip-3156) -#[brush::trait_definition] +#[openbrush::trait_definition] pub trait FlashBorrower { #[ink(message)] fn on_flashloan( diff --git a/contracts/traits/mod.rs b/contracts/src/traits/mod.rs similarity index 100% rename from contracts/traits/mod.rs rename to contracts/src/traits/mod.rs diff --git a/contracts/traits/ownable/mod.rs b/contracts/src/traits/ownable/mod.rs similarity index 96% rename from contracts/traits/ownable/mod.rs rename to contracts/src/traits/ownable/mod.rs index 5371bc169..bcb0a9a4b 100644 --- a/contracts/traits/ownable/mod.rs +++ b/contracts/src/traits/ownable/mod.rs @@ -20,15 +20,15 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. pub use crate::traits::errors::OwnableError; -use brush::traits::AccountId; +use openbrush::traits::AccountId; -#[brush::wrapper] +#[openbrush::wrapper] pub type OwnableRef = dyn Ownable; /// Contract module which provides a basic access control mechanism, where /// there is an account (an owner) that can be granted exclusive access to /// specific functions. -#[brush::trait_definition] +#[openbrush::trait_definition] pub trait Ownable { /// Returns the address of the current owner. #[ink(message)] diff --git a/contracts/traits/pausable/mod.rs b/contracts/src/traits/pausable/mod.rs similarity index 96% rename from contracts/traits/pausable/mod.rs rename to contracts/src/traits/pausable/mod.rs index 5dac9982e..0d1f7d490 100644 --- a/contracts/traits/pausable/mod.rs +++ b/contracts/src/traits/pausable/mod.rs @@ -21,12 +21,12 @@ pub use crate::traits::errors::PausableError; -#[brush::wrapper] +#[openbrush::wrapper] pub type PausableRef = dyn Pausable; /// Contract trait, which allows children to implement an emergency stop /// mechanism that an authorized account can trigger. -#[brush::trait_definition] +#[openbrush::trait_definition] pub trait Pausable { /// Returns true if the contract is paused, and false otherwise. #[ink(message)] diff --git a/contracts/traits/payment_splitter/mod.rs b/contracts/src/traits/payment_splitter/mod.rs similarity index 97% rename from contracts/traits/payment_splitter/mod.rs rename to contracts/src/traits/payment_splitter/mod.rs index 7b686338e..63b2a6903 100644 --- a/contracts/traits/payment_splitter/mod.rs +++ b/contracts/src/traits/payment_splitter/mod.rs @@ -20,12 +20,12 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. pub use crate::traits::errors::PaymentSplitterError; -use brush::traits::{ +use openbrush::traits::{ AccountId, Balance, }; -#[brush::wrapper] +#[openbrush::wrapper] pub type PaymentSplitterRef = dyn PaymentSplitter; /// This contract allows splitting native token payments among a group of accounts. The sender does not need to be aware @@ -39,7 +39,7 @@ pub type PaymentSplitterRef = dyn PaymentSplitter; /// accounts but kept in this contract, and the actual transfer is triggered as a separate step by calling the `release` /// function. // TODO: Support payments in PSP22 -#[brush::trait_definition] +#[openbrush::trait_definition] pub trait PaymentSplitter { /// Getter for the total shares held by payees. #[ink(message)] diff --git a/contracts/traits/proxy/mod.rs b/contracts/src/traits/proxy/mod.rs similarity index 94% rename from contracts/traits/proxy/mod.rs rename to contracts/src/traits/proxy/mod.rs index 5bcaafaaf..2dcb689dd 100644 --- a/contracts/traits/proxy/mod.rs +++ b/contracts/src/traits/proxy/mod.rs @@ -23,12 +23,12 @@ pub use crate::traits::{ errors::OwnableError, ownable::*, }; -use brush::traits::Hash; +use openbrush::traits::Hash; -#[brush::wrapper] +#[openbrush::wrapper] pub type ProxyRef = dyn Proxy + Ownable; -#[brush::trait_definition] +#[openbrush::trait_definition] pub trait Proxy: Ownable { #[ink(message)] fn get_delegate_code(&self) -> Hash; diff --git a/contracts/traits/psp1155/extensions/burnable.rs b/contracts/src/traits/psp1155/extensions/burnable.rs similarity index 95% rename from contracts/traits/psp1155/extensions/burnable.rs rename to contracts/src/traits/psp1155/extensions/burnable.rs index 593039faf..f9b4143ef 100644 --- a/contracts/traits/psp1155/extensions/burnable.rs +++ b/contracts/src/traits/psp1155/extensions/burnable.rs @@ -22,16 +22,16 @@ /// Extension of [`PSP1155`] that allows token holders to destroy their tokens use crate::traits::psp1155::Id; use crate::traits::psp1155::PSP1155Error; -use brush::traits::{ +use ink_prelude::vec::Vec; +use openbrush::traits::{ AccountId, Balance, }; -use ink_prelude::vec::Vec; -#[brush::wrapper] +#[openbrush::wrapper] pub type PSP1155BurnableRef = dyn PSP1155Burnable; -#[brush::trait_definition] +#[openbrush::trait_definition] pub trait PSP1155Burnable { /// Destroys `amount` tokens of token type `id` from `from` /// diff --git a/contracts/traits/psp1155/extensions/metadata.rs b/contracts/src/traits/psp1155/extensions/metadata.rs similarity index 96% rename from contracts/traits/psp1155/extensions/metadata.rs rename to contracts/src/traits/psp1155/extensions/metadata.rs index de68f30c1..920d95b19 100644 --- a/contracts/traits/psp1155/extensions/metadata.rs +++ b/contracts/src/traits/psp1155/extensions/metadata.rs @@ -23,10 +23,10 @@ pub use crate::traits::psp1155::Id; use ink_prelude::string::String; -#[brush::wrapper] +#[openbrush::wrapper] pub type PSP1155MetadataRef = dyn PSP1155Metadata; -#[brush::trait_definition] +#[openbrush::trait_definition] pub trait PSP1155Metadata { /// Returns the uri for token type of id. #[ink(message)] diff --git a/contracts/traits/psp1155/extensions/mintable.rs b/contracts/src/traits/psp1155/extensions/mintable.rs similarity index 95% rename from contracts/traits/psp1155/extensions/mintable.rs rename to contracts/src/traits/psp1155/extensions/mintable.rs index 8cfff53ed..dd52d39f6 100644 --- a/contracts/traits/psp1155/extensions/mintable.rs +++ b/contracts/src/traits/psp1155/extensions/mintable.rs @@ -22,16 +22,16 @@ /// Extension of [`PSP1155`] that allows minting of new tokens use crate::traits::psp1155::Id; use crate::traits::psp1155::PSP1155Error; -use brush::traits::{ +use ink_prelude::vec::Vec; +use openbrush::traits::{ AccountId, Balance, }; -use ink_prelude::vec::Vec; -#[brush::wrapper] +#[openbrush::wrapper] pub type PSP1155MintableRef = dyn PSP1155Mintable; -#[brush::trait_definition] +#[openbrush::trait_definition] pub trait PSP1155Mintable { /// Mints `amount` tokens of token type `id` to `to` /// diff --git a/contracts/traits/psp1155/mod.rs b/contracts/src/traits/psp1155/mod.rs similarity index 100% rename from contracts/traits/psp1155/mod.rs rename to contracts/src/traits/psp1155/mod.rs diff --git a/contracts/traits/psp1155/psp1155.rs b/contracts/src/traits/psp1155/psp1155.rs similarity index 97% rename from contracts/traits/psp1155/psp1155.rs rename to contracts/src/traits/psp1155/psp1155.rs index c97a6c276..1841a24fb 100644 --- a/contracts/traits/psp1155/psp1155.rs +++ b/contracts/src/traits/psp1155/psp1155.rs @@ -23,21 +23,21 @@ pub use crate::traits::errors::{ PSP1155Error, PSP1155ReceiverError, }; -use brush::traits::{ +use ink_prelude::vec::Vec; +use openbrush::traits::{ AccountId, Balance, }; -use ink_prelude::vec::Vec; pub type Id = [u8; 32]; -#[brush::wrapper] +#[openbrush::wrapper] pub type PSP1155Ref = dyn PSP1155; /// Contract module which provides a basic implementation of multiple token types. /// A single deployed contract may include any combination of fungible tokens, /// non-fungible tokens or other configurations (e.g. semi-fungible tokens). -#[brush::trait_definition] +#[openbrush::trait_definition] pub trait PSP1155 { /// Returns the amount of tokens of token type `id` owned by `account`. #[ink(message)] @@ -97,13 +97,13 @@ pub trait PSP1155 { ) -> Result<(), PSP1155Error>; } -#[brush::wrapper] +#[openbrush::wrapper] pub type PSP1155ReceiverRef = dyn PSP1155Receiver; /// PSP1155Receiver is a trait for any contract that wants to support safe transfers from a PSP1155 /// multi token smart contract to avoid unexpected tokens in the balance of contract. /// This method is called before a transfer to ensure the recipient of the tokens acknowledges the receipt. -#[brush::trait_definition] +#[openbrush::trait_definition] pub trait PSP1155Receiver { /// Ensures that the smart contract allows reception of PSP1155 token(s). /// Returns `Ok(())` if the contract allows the reception of the token(s) and Error `TransferRejected(String))` otherwise. diff --git a/contracts/traits/psp22/extensions/burnable.rs b/contracts/src/traits/psp22/extensions/burnable.rs similarity index 95% rename from contracts/traits/psp22/extensions/burnable.rs rename to contracts/src/traits/psp22/extensions/burnable.rs index f87fd46bc..b42b28758 100644 --- a/contracts/traits/psp22/extensions/burnable.rs +++ b/contracts/src/traits/psp22/extensions/burnable.rs @@ -22,15 +22,15 @@ /// Extension of [`PSP22`] that allows token holders to destroy both their own /// tokens and those that they have an allowance for. pub use crate::traits::errors::PSP22Error; -use brush::traits::{ +use openbrush::traits::{ AccountId, Balance, }; -#[brush::wrapper] +#[openbrush::wrapper] pub type PSP22BurnableRef = dyn PSP22Burnable; -#[brush::trait_definition] +#[openbrush::trait_definition] pub trait PSP22Burnable { /// Destroys `amount` tokens from `account`, deducting from the caller's /// allowance. diff --git a/contracts/traits/psp22/extensions/metadata.rs b/contracts/src/traits/psp22/extensions/metadata.rs similarity index 96% rename from contracts/traits/psp22/extensions/metadata.rs rename to contracts/src/traits/psp22/extensions/metadata.rs index 8ada9774e..afb0eea3f 100644 --- a/contracts/traits/psp22/extensions/metadata.rs +++ b/contracts/src/traits/psp22/extensions/metadata.rs @@ -21,11 +21,11 @@ use ink_prelude::string::String; -#[brush::wrapper] +#[openbrush::wrapper] pub type PSP22MetadataRef = dyn PSP22Metadata; /// Trait that contains metadata -#[brush::trait_definition] +#[openbrush::trait_definition] pub trait PSP22Metadata { /// Returns the token name. #[ink(message)] diff --git a/contracts/traits/psp22/extensions/mintable.rs b/contracts/src/traits/psp22/extensions/mintable.rs similarity index 95% rename from contracts/traits/psp22/extensions/mintable.rs rename to contracts/src/traits/psp22/extensions/mintable.rs index db42e36ae..34c272f23 100644 --- a/contracts/traits/psp22/extensions/mintable.rs +++ b/contracts/src/traits/psp22/extensions/mintable.rs @@ -22,15 +22,15 @@ /// Extension of [`PSP22`] that allows create `amount` tokens /// and assigns them to `account`, increasing the total supply pub use crate::traits::errors::PSP22Error; -use brush::traits::{ +use openbrush::traits::{ AccountId, Balance, }; -#[brush::wrapper] +#[openbrush::wrapper] pub type PSP22MintableRef = dyn PSP22Mintable; -#[brush::trait_definition] +#[openbrush::trait_definition] pub trait PSP22Mintable { /// Minting `amount` tokens to the account. /// diff --git a/contracts/traits/psp22/extensions/wrapper.rs b/contracts/src/traits/psp22/extensions/wrapper.rs similarity index 96% rename from contracts/traits/psp22/extensions/wrapper.rs rename to contracts/src/traits/psp22/extensions/wrapper.rs index 642cdc8d9..c49261154 100644 --- a/contracts/traits/psp22/extensions/wrapper.rs +++ b/contracts/src/traits/psp22/extensions/wrapper.rs @@ -23,17 +23,17 @@ pub use crate::traits::errors::PSP22Error; pub use crate::traits::psp22::*; -use brush::traits::{ +use openbrush::traits::{ AccountId, Balance, }; /// The idea of PSP22Wrapper is that it is PSP22 by itself. /// Wrapper only adds 2 additional methods for depositing and withdrawing. -#[brush::wrapper] +#[openbrush::wrapper] pub type PSP22WrapperRef = dyn PSP22Wrapper + PSP22; -#[brush::trait_definition] +#[openbrush::trait_definition] pub trait PSP22Wrapper: PSP22 { /// Allow a user to deposit `amount` of underlying tokens and mint `amount` of the wrapped tokens to `account` #[ink(message)] diff --git a/contracts/traits/psp22/mod.rs b/contracts/src/traits/psp22/mod.rs similarity index 100% rename from contracts/traits/psp22/mod.rs rename to contracts/src/traits/psp22/mod.rs diff --git a/contracts/traits/psp22/psp22.rs b/contracts/src/traits/psp22/psp22.rs similarity index 97% rename from contracts/traits/psp22/psp22.rs rename to contracts/src/traits/psp22/psp22.rs index 9b40b5f14..bc10fedfb 100644 --- a/contracts/traits/psp22/psp22.rs +++ b/contracts/src/traits/psp22/psp22.rs @@ -23,17 +23,17 @@ pub use crate::traits::errors::{ PSP22Error, PSP22ReceiverError, }; -use brush::traits::{ +use ink_prelude::vec::Vec; +use openbrush::traits::{ AccountId, Balance, }; -use ink_prelude::vec::Vec; -#[brush::wrapper] +#[openbrush::wrapper] pub type PSP22Ref = dyn PSP22; /// Trait implemented by all PSP-20 respecting smart traits. -#[brush::trait_definition] +#[openbrush::trait_definition] pub trait PSP22 { /// Returns the total token supply. #[ink(message)] @@ -138,13 +138,13 @@ pub trait PSP22 { fn decrease_allowance(&mut self, spender: AccountId, delta_value: Balance) -> Result<(), PSP22Error>; } -#[brush::wrapper] +#[openbrush::wrapper] pub type PSP22ReceiverRef = dyn PSP22Receiver; /// PSP22Receiver is a trait for any contract that wants to support safe transfers from a PSP22 /// token smart contract to avoid unexpected tokens in the balance of contract. /// This method is called before a transfer to ensure the recipient of the tokens acknowledges the receipt. -#[brush::trait_definition] +#[openbrush::trait_definition] pub trait PSP22Receiver { /// Ensures that the smart contract allows reception of PSP22 token(s). /// Returns `Ok(())` if the contract allows the reception of the token(s) and Error `TransferRejected(String))` otherwise. diff --git a/contracts/traits/psp22/utils/token_timelock.rs b/contracts/src/traits/psp22/utils/token_timelock.rs similarity index 95% rename from contracts/traits/psp22/utils/token_timelock.rs rename to contracts/src/traits/psp22/utils/token_timelock.rs index 4570fcaae..5ac819771 100644 --- a/contracts/traits/psp22/utils/token_timelock.rs +++ b/contracts/src/traits/psp22/utils/token_timelock.rs @@ -20,15 +20,15 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. pub use crate::traits::errors::PSP22TokenTimelockError; -use brush::traits::{ +use openbrush::traits::{ AccountId, Timestamp, }; -#[brush::wrapper] +#[openbrush::wrapper] pub type PSP22TokenTimelockRef = dyn PSP22TokenTimelock; -#[brush::trait_definition] +#[openbrush::trait_definition] pub trait PSP22TokenTimelock { /// Returns the token address #[ink(message)] diff --git a/contracts/traits/psp34/extensions/burnable.rs b/contracts/src/traits/psp34/extensions/burnable.rs similarity index 94% rename from contracts/traits/psp34/extensions/burnable.rs rename to contracts/src/traits/psp34/extensions/burnable.rs index 2576ae639..3c3d880aa 100644 --- a/contracts/traits/psp34/extensions/burnable.rs +++ b/contracts/src/traits/psp34/extensions/burnable.rs @@ -22,12 +22,12 @@ /// Extension of [`PSP34`] that allows token holders to destroy their tokens pub use crate::traits::errors::PSP34Error; pub use crate::traits::psp34::Id; -use brush::traits::AccountId; +use openbrush::traits::AccountId; -#[brush::wrapper] +#[openbrush::wrapper] pub type PSP34BurnableRef = dyn PSP34Burnable; -#[brush::trait_definition] +#[openbrush::trait_definition] pub trait PSP34Burnable { /// Destroys token with id equal to `id` from `account` /// diff --git a/contracts/traits/psp34/extensions/enumerable.rs b/contracts/src/traits/psp34/extensions/enumerable.rs similarity index 95% rename from contracts/traits/psp34/extensions/enumerable.rs rename to contracts/src/traits/psp34/extensions/enumerable.rs index bc122fba4..408f241b0 100644 --- a/contracts/traits/psp34/extensions/enumerable.rs +++ b/contracts/src/traits/psp34/extensions/enumerable.rs @@ -22,12 +22,12 @@ /// Extension of [`PSP34`] that adds enumerability of all the token ids in the contract as well /// as all token ids owned by each account. pub use crate::traits::psp34::*; -use brush::traits::AccountId; +use openbrush::traits::AccountId; -#[brush::wrapper] +#[openbrush::wrapper] pub type PSP34EnumerableRef = dyn PSP34Enumerable + PSP34; -#[brush::trait_definition] +#[openbrush::trait_definition] pub trait PSP34Enumerable: PSP34 { /// Returns a token `Id` owned by `owner` at a given `index` of its token list. /// Use along with `balance_of` to enumerate all of ``owner``'s tokens. diff --git a/contracts/traits/psp34/extensions/metadata.rs b/contracts/src/traits/psp34/extensions/metadata.rs similarity index 96% rename from contracts/traits/psp34/extensions/metadata.rs rename to contracts/src/traits/psp34/extensions/metadata.rs index fcff1182f..23c08f6be 100644 --- a/contracts/traits/psp34/extensions/metadata.rs +++ b/contracts/src/traits/psp34/extensions/metadata.rs @@ -24,10 +24,10 @@ pub use crate::traits::errors::PSP34Error; pub use crate::traits::psp34::Id; use ink_prelude::vec::Vec; -#[brush::wrapper] +#[openbrush::wrapper] pub type PSP34MetadataRef = dyn PSP34Metadata; -#[brush::trait_definition] +#[openbrush::trait_definition] pub trait PSP34Metadata { /// Returns the attribute of `id` for the given `key`. /// diff --git a/contracts/traits/psp34/extensions/mintable.rs b/contracts/src/traits/psp34/extensions/mintable.rs similarity index 94% rename from contracts/traits/psp34/extensions/mintable.rs rename to contracts/src/traits/psp34/extensions/mintable.rs index d1805159b..a3e6e4276 100644 --- a/contracts/traits/psp34/extensions/mintable.rs +++ b/contracts/src/traits/psp34/extensions/mintable.rs @@ -22,12 +22,12 @@ /// Extension of [`PSP34`] that exposes the mint function pub use crate::traits::errors::PSP34Error; pub use crate::traits::psp34::Id; -use brush::traits::AccountId; +use openbrush::traits::AccountId; -#[brush::wrapper] +#[openbrush::wrapper] pub type PSP34MintableRef = dyn PSP34Mintable; -#[brush::trait_definition] +#[openbrush::trait_definition] pub trait PSP34Mintable { /// Mints a new token with `id`. /// diff --git a/contracts/traits/psp34/mod.rs b/contracts/src/traits/psp34/mod.rs similarity index 100% rename from contracts/traits/psp34/mod.rs rename to contracts/src/traits/psp34/mod.rs diff --git a/contracts/traits/psp34/psp34.rs b/contracts/src/traits/psp34/psp34.rs similarity index 97% rename from contracts/traits/psp34/psp34.rs rename to contracts/src/traits/psp34/psp34.rs index ad3327bb9..f0db9a06e 100644 --- a/contracts/traits/psp34/psp34.rs +++ b/contracts/src/traits/psp34/psp34.rs @@ -23,10 +23,6 @@ pub use crate::traits::errors::{ PSP34Error, PSP34ReceiverError, }; -use brush::traits::{ - AccountId, - Balance, -}; use ink_prelude::vec::Vec; use ink_primitives::Key; #[cfg(feature = "std")] @@ -39,6 +35,10 @@ use ink_storage::traits::{ SpreadAllocate, SpreadLayout, }; +use openbrush::traits::{ + AccountId, + Balance, +}; /// `Id` represents the identifier of the NFT. `Id::U8(1)` and `Id::U16(1)` are two different identifiers. #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Clone, scale::Encode, scale::Decode, SpreadLayout, PackedLayout)] @@ -63,11 +63,11 @@ impl PackedAllocate for Id { fn allocate_packed(&mut self, _at: &Key) {} } -#[brush::wrapper] +#[openbrush::wrapper] pub type PSP34Ref = dyn PSP34; /// Contract module which provides a basic implementation of non fungible token. -#[brush::trait_definition] +#[openbrush::trait_definition] pub trait PSP34 { /// Returns the collection `Id` of the NFT token. /// @@ -122,13 +122,13 @@ pub trait PSP34 { fn total_supply(&self) -> Balance; } -#[brush::wrapper] +#[openbrush::wrapper] pub type PSP34ReceiverRef = dyn PSP34Receiver; /// PSP34Receiver is a trait for any contract that wants to support safe transfers from a PSP34 /// token smart contract to avoid unexpected tokens in the balance of contract. /// This method is called before a transfer to ensure the recipient of the tokens acknowledges the receipt. -#[brush::trait_definition] +#[openbrush::trait_definition] pub trait PSP34Receiver { /// Ensures that the smart contract allows reception of PSP34 token(s). /// Returns `Ok(())` if the contract allows the reception of the token(s) and Error `TransferRejected(String))` otherwise. diff --git a/contracts/traits/timelock_controller/mod.rs b/contracts/src/traits/timelock_controller/mod.rs similarity index 98% rename from contracts/traits/timelock_controller/mod.rs rename to contracts/src/traits/timelock_controller/mod.rs index 7e9fb656d..feabf782a 100644 --- a/contracts/traits/timelock_controller/mod.rs +++ b/contracts/src/traits/timelock_controller/mod.rs @@ -23,13 +23,13 @@ pub use crate::traits::{ access_control::*, errors::TimelockControllerError, }; -use brush::traits::{ +use ink_prelude::vec::Vec; +use openbrush::traits::{ AccountId, Balance, Hash, Timestamp, }; -use ink_prelude::vec::Vec; pub type OperationId = Hash; @@ -50,7 +50,7 @@ pub struct Transaction { } /// TimelockController is AccessControl itself, so creating wrapper for both traits -#[brush::wrapper] +#[openbrush::wrapper] pub type TimelockControllerRef = dyn TimelockController + AccessControl; /// Contract module which acts as a time-locked controller. When set as the @@ -64,7 +64,7 @@ pub type TimelockControllerRef = dyn TimelockController + AccessControl; /// is in charge of proposing (resp executing) operations. A common use case is /// to position this `TimelockController` as the owner of a smart contract, with /// a multisig or a DAO as the sole proposer. -#[brush::trait_definition] +#[openbrush::trait_definition] pub trait TimelockController: AccessControl { /// Returns whether an id correspond to a registered operation. This /// includes both Pending, Ready and Done operations. diff --git a/contracts/upgradability/diamond/diamond.rs b/contracts/src/upgradability/diamond/diamond.rs similarity index 97% rename from contracts/upgradability/diamond/diamond.rs rename to contracts/src/upgradability/diamond/diamond.rs index 67e01d9d4..0587d0b48 100644 --- a/contracts/upgradability/diamond/diamond.rs +++ b/contracts/src/upgradability/diamond/diamond.rs @@ -23,13 +23,6 @@ pub use crate::{ ownable::*, traits::diamond::*, }; -use brush::{ - modifiers, - traits::{ - Flush, - Hash, - }, -}; use ink_env::{ call::{ DelegateCall, @@ -40,14 +33,21 @@ use ink_env::{ }; use ink_prelude::vec::Vec; use ink_storage::Mapping; +use openbrush::{ + modifiers, + traits::{ + Flush, + Hash, + }, +}; pub use derive::DiamondStorage; -pub const STORAGE_KEY: [u8; 32] = ink_lang::blake2x256!("brush::DiamondData"); +pub const STORAGE_KEY: [u8; 32] = ink_lang::blake2x256!("openbrush::DiamondData"); // TODO: Add support of Erc165 #[derive(Default, Debug)] -#[brush::storage(STORAGE_KEY)] +#[openbrush::storage(STORAGE_KEY)] pub struct DiamondData { pub ownable: OwnableData, // selector mapped to its facet @@ -56,7 +56,7 @@ pub struct DiamondData { pub hash_to_selectors: Mapping>, } -pub trait DiamondStorage: OwnableStorage + ::brush::traits::InkStorage { +pub trait DiamondStorage: OwnableStorage + ::openbrush::traits::InkStorage { fn get(&self) -> &DiamondData; fn get_mut(&mut self) -> &mut DiamondData; } diff --git a/contracts/upgradability/diamond/extensions/diamond_loupe.rs b/contracts/src/upgradability/diamond/extensions/diamond_loupe.rs similarity index 96% rename from contracts/upgradability/diamond/extensions/diamond_loupe.rs rename to contracts/src/upgradability/diamond/extensions/diamond_loupe.rs index c7a456f6f..e68047e4c 100644 --- a/contracts/upgradability/diamond/extensions/diamond_loupe.rs +++ b/contracts/src/upgradability/diamond/extensions/diamond_loupe.rs @@ -24,19 +24,19 @@ pub use crate::{ diamond::*, traits::diamond::extensions::diamond_loupe::*, }; -use brush::{ +use ink_prelude::vec::Vec; +use ink_storage::Mapping; +use openbrush::{ declare_storage_trait, traits::Hash, }; -use ink_prelude::vec::Vec; -use ink_storage::Mapping; pub use derive::DiamondLoupeStorage; -pub const STORAGE_KEY: [u8; 32] = ink_lang::blake2x256!("brush::DiamondLoupeData"); +pub const STORAGE_KEY: [u8; 32] = ink_lang::blake2x256!("openbrush::DiamondLoupeData"); #[derive(Default, Debug)] -#[brush::storage(STORAGE_KEY)] +#[openbrush::storage(STORAGE_KEY)] pub struct DiamondLoupeData { // number of registered code hashes pub code_hashes: u16, diff --git a/contracts/upgradability/diamond/mod.rs b/contracts/src/upgradability/diamond/mod.rs similarity index 100% rename from contracts/upgradability/diamond/mod.rs rename to contracts/src/upgradability/diamond/mod.rs diff --git a/contracts/upgradability/mod.rs b/contracts/src/upgradability/mod.rs similarity index 100% rename from contracts/upgradability/mod.rs rename to contracts/src/upgradability/mod.rs diff --git a/contracts/upgradability/proxy/mod.rs b/contracts/src/upgradability/proxy/mod.rs similarity index 94% rename from contracts/upgradability/proxy/mod.rs rename to contracts/src/upgradability/proxy/mod.rs index 6d6246e33..b95f2d754 100644 --- a/contracts/upgradability/proxy/mod.rs +++ b/contracts/src/upgradability/proxy/mod.rs @@ -23,7 +23,7 @@ pub use crate::{ ownable::*, traits::proxy::*, }; -use brush::{ +use openbrush::{ modifiers, traits::Hash, }; @@ -31,16 +31,16 @@ use brush::{ pub use derive::ProxyStorage; use ink_env::call::DelegateCall; -pub const STORAGE_KEY: [u8; 32] = ink_lang::blake2x256!("brush::ProxyData"); +pub const STORAGE_KEY: [u8; 32] = ink_lang::blake2x256!("openbrush::ProxyData"); #[derive(Default, Debug)] -#[brush::storage(STORAGE_KEY)] +#[openbrush::storage(STORAGE_KEY)] pub struct ProxyData { pub ownable: OwnableData, pub forward_to: Hash, } -pub trait ProxyStorage: OwnableStorage + ::brush::traits::InkStorage { +pub trait ProxyStorage: OwnableStorage + ::openbrush::traits::InkStorage { fn get(&self) -> &ProxyData; fn get_mut(&mut self) -> &mut ProxyData; } diff --git a/docs/docs/smart-contracts/PSP1155/Extensions/burnable.md b/docs/docs/smart-contracts/PSP1155/Extensions/burnable.md index b9d6f65bd..3725ed18f 100644 --- a/docs/docs/smart-contracts/PSP1155/Extensions/burnable.md +++ b/docs/docs/smart-contracts/PSP1155/Extensions/burnable.md @@ -7,10 +7,10 @@ This example shows how you can reuse the implementation of [PSP1155](https://git ## How to use this extension -For your smart contract to use this extension, you only need to implement the `PSP1155Burnable` trait in your `PSP1155` smart contract. Add import for `brush::contracts::psp1155::extensions::burnable::*`, inherit the implementation for `PSP1155Burnable` trait, where you can also customize (override) the original functions from `PSP1155Burnable`. +For your smart contract to use this extension, you only need to implement the `PSP1155Burnable` trait in your `PSP1155` smart contract. Add import for `openbrush::contracts::psp1155::extensions::burnable::*`, inherit the implementation for `PSP1155Burnable` trait, where you can also customize (override) the original functions from `PSP1155Burnable`. ```rust -use brush::contracts::psp1155::extensions::burnable::*; +use openbrush::contracts::psp1155::extensions::burnable::*; impl PSP1155Burnable for MyPSP1155 {} ``` diff --git a/docs/docs/smart-contracts/PSP1155/Extensions/metadata.md b/docs/docs/smart-contracts/PSP1155/Extensions/metadata.md index 1ee3f31b1..902e7a959 100644 --- a/docs/docs/smart-contracts/PSP1155/Extensions/metadata.md +++ b/docs/docs/smart-contracts/PSP1155/Extensions/metadata.md @@ -7,15 +7,15 @@ This example shows how you can reuse the implementation of [PSP1155](https://git ## Step 1: Add imports and enable unstable feature -Import **everything** from `brush::contracts::psp1155::extensions::metadata`. +Import **everything** from `openbrush::contracts::psp1155::extensions::metadata`. ```rust #![cfg_attr(not(feature = "std"), no_std)] #![feature(min_specialization)] -#[brush::contract] +#[openbrush::contract] pub mod my_psp1155 { - use brush::contracts::psp1155::extensions::metadata::*; + use openbrush::contracts::psp1155::extensions::metadata::*; use ink_prelude::string::String; use ink_storage::traits::SpreadAllocate; ... diff --git a/docs/docs/smart-contracts/PSP1155/Extensions/mintable.md b/docs/docs/smart-contracts/PSP1155/Extensions/mintable.md index cf1b60f89..fb8f920f9 100644 --- a/docs/docs/smart-contracts/PSP1155/Extensions/mintable.md +++ b/docs/docs/smart-contracts/PSP1155/Extensions/mintable.md @@ -7,10 +7,10 @@ This example shows how you can reuse the implementation of [PSP1155](https://git ## How to use this extension -For your smart contract to use this extension, you only need to implement the `PSP1155Mintable` trait in your `PSP1155` smart contract. Add import for `brush::contracts::psp1155::extensions::mintable::*`, inherit the implementation for `PSP1155Mintable` trait, where you can also customize (override) the original functions from `PSP1155Mintable`. +For your smart contract to use this extension, you only need to implement the `PSP1155Mintable` trait in your `PSP1155` smart contract. Add import for `openbrush::contracts::psp1155::extensions::mintable::*`, inherit the implementation for `PSP1155Mintable` trait, where you can also customize (override) the original functions from `PSP1155Mintable`. ```rust -use brush::contracts::psp1155::extensions::mintable::*; +use openbrush::contracts::psp1155::extensions::mintable::*; impl PSP1155Mintable for MyPSP1155 {} ``` diff --git a/docs/docs/smart-contracts/PSP1155/psp1155.md b/docs/docs/smart-contracts/PSP1155/psp1155.md index 9da3753ca..1f2977316 100644 --- a/docs/docs/smart-contracts/PSP1155/psp1155.md +++ b/docs/docs/smart-contracts/PSP1155/psp1155.md @@ -7,24 +7,24 @@ This example shows how you can reuse the implementation of [PSP1155](https://git ## Step 1: Include dependencies -Include `brush` as dependency in the cargo file or you can use [default `Cargo.toml`](/smart-contracts/overview#the-default-toml-of-your-project-with-openbrush) template. -After you need to enable default implementation of PSP1155 via `brush` feature. +Include `openbrush` as dependency in the cargo file or you can use [default `Cargo.toml`](/smart-contracts/overview#the-default-toml-of-your-project-with-openbrush) template. +After you need to enable default implementation of PSP1155 via `openbrush` feature. ```toml -brush = { version = "1.8.0", default-features = false, features = ["psp1155"] } +openbrush = { version = "1.8.0", default-features = false, features = ["psp1155"] } ``` ## Step 2: Add imports and enable unstable feature -Use `brush::contract` macro instead of `ink::contract`. Import **everything** from `brush::contracts::psp1155`. +Use `openbrush::contract` macro instead of `ink::contract`. Import **everything** from `openbrush::contracts::psp1155`. ```rust #![cfg_attr(not(feature = "std"), no_std)] #![feature(min_specialization)] -#[brush::contract] +#[openbrush::contract] pub mod my_psp1155 { - use brush::contracts::psp1155::*; + use openbrush::contracts::psp1155::*; use ink_prelude::{ string::String, vec, diff --git a/docs/docs/smart-contracts/PSP22/Extensions/burnable.md b/docs/docs/smart-contracts/PSP22/Extensions/burnable.md index d34d35353..bfc350916 100644 --- a/docs/docs/smart-contracts/PSP22/Extensions/burnable.md +++ b/docs/docs/smart-contracts/PSP22/Extensions/burnable.md @@ -8,10 +8,10 @@ This example shows how you can reuse the implementation of ## How to use this extension -For your smart contract to use this extension, you only need to implement the `PSP22Burnable` trait in your `PSP22` smart contract. Add import for `brush::contracts::psp22::extensions::burnable::*`, inherit the implementation for `PSP22Burnable` trait, where you can also customize (override) the original functions from `PSP22Burnable`. +For your smart contract to use this extension, you only need to implement the `PSP22Burnable` trait in your `PSP22` smart contract. Add import for `openbrush::contracts::psp22::extensions::burnable::*`, inherit the implementation for `PSP22Burnable` trait, where you can also customize (override) the original functions from `PSP22Burnable`. ```rust -use brush::contracts::psp22::extensions::burnable::*; +use openbrush::contracts::psp22::extensions::burnable::*; impl PSP22Burnable for MyPSP22 {} ``` diff --git a/docs/docs/smart-contracts/PSP22/Extensions/capped.md b/docs/docs/smart-contracts/PSP22/Extensions/capped.md index 9bdff9288..30b9342e1 100644 --- a/docs/docs/smart-contracts/PSP22/Extensions/capped.md +++ b/docs/docs/smart-contracts/PSP22/Extensions/capped.md @@ -7,24 +7,24 @@ This example shows how you can implement a [PSP22](https://github.com/Supercolon ## Step 1: Include dependencies -Include `brush` as dependency in the cargo file or you can use [default `Cargo.toml`](/smart-contracts/overview#the-default-toml-of-your-project-with-openbrush) template. -After you need to enable default implementation of PSP22 via `brush` features. +Include `openbrush` as dependency in the cargo file or you can use [default `Cargo.toml`](/smart-contracts/overview#the-default-toml-of-your-project-with-openbrush) template. +After you need to enable default implementation of PSP22 via `openbrush` features. ```toml -brush = { version = "1.8.0", default-features = false, features = ["psp22"] } +openbrush = { version = "1.8.0", default-features = false, features = ["psp22"] } ``` ## Step 2: Add imports and enable unstable feature -Use `brush::contract` macro instead of `ink::contract`. Import **everything** from `brush::contracts::psp22`. +Use `openbrush::contract` macro instead of `ink::contract`. Import **everything** from `openbrush::contracts::psp22`. ```rust #![cfg_attr(not(feature = "std"), no_std)] #![feature(min_specialization)] -#[brush::contract] +#[openbrush::contract] pub mod my_psp22_capped { - use brush::contracts::psp22::*; + use openbrush::contracts::psp22::*; use ink_prelude::string::String; use ink_storage::traits::SpreadAllocate; ... diff --git a/docs/docs/smart-contracts/PSP22/Extensions/flashmint.md b/docs/docs/smart-contracts/PSP22/Extensions/flashmint.md index cacba56a6..a01bf291d 100644 --- a/docs/docs/smart-contracts/PSP22/Extensions/flashmint.md +++ b/docs/docs/smart-contracts/PSP22/Extensions/flashmint.md @@ -7,10 +7,10 @@ This example shows how you can reuse the implementation of [PSP22](https://githu ## 1. Implement the FlashMint extension -For your smart contract to use this extension, you need to implement the `PSP22FlashMint` trait in your `PSP22` smart contract. Import everything from `brush::contracts::psp22::extensions::flashmint::*` and inherit the implementation for `PSP22FlashMint` trait. You can also customize (override) the original functions from `PSP22FlashMint`. +For your smart contract to use this extension, you need to implement the `PSP22FlashMint` trait in your `PSP22` smart contract. Import everything from `openbrush::contracts::psp22::extensions::flashmint::*` and inherit the implementation for `PSP22FlashMint` trait. You can also customize (override) the original functions from `PSP22FlashMint`. ```rust -use brush::contracts::psp22::extensions::flashmint::*; +use openbrush::contracts::psp22::extensions::flashmint::*; impl FlashLender for MyPSP22FlashMint {} ``` diff --git a/docs/docs/smart-contracts/PSP22/Extensions/metadata.md b/docs/docs/smart-contracts/PSP22/Extensions/metadata.md index 68fac270f..6e704b28f 100644 --- a/docs/docs/smart-contracts/PSP22/Extensions/metadata.md +++ b/docs/docs/smart-contracts/PSP22/Extensions/metadata.md @@ -7,15 +7,15 @@ This example shows how you can reuse the implementation of [PSP22](https://githu ## Step 1: Add imports and enable unstable feature -Use `brush::contract` macro instead of `ink::contract`. Import **everything** from `brush::contracts::psp22::extensions::metadata`. +Use `openbrush::contract` macro instead of `ink::contract`. Import **everything** from `openbrush::contracts::psp22::extensions::metadata`. ```rust #![cfg_attr(not(feature = "std"), no_std)] #![feature(min_specialization)] -#[brush::contract] +#[openbrush::contract] pub mod my_psp22 { - use brush::contracts::psp22::extensions::metadata::*; + use openbrush::contracts::psp22::extensions::metadata::*; use ink_prelude::string::String; use ink_storage::traits::SpreadAllocate; ``` diff --git a/docs/docs/smart-contracts/PSP22/Extensions/mintable.md b/docs/docs/smart-contracts/PSP22/Extensions/mintable.md index aa39bbeb6..2c9eaa2fd 100644 --- a/docs/docs/smart-contracts/PSP22/Extensions/mintable.md +++ b/docs/docs/smart-contracts/PSP22/Extensions/mintable.md @@ -8,10 +8,10 @@ This example shows how you can reuse the implementation of ## How to use this extension -For your smart contract to use this extension, you only need to implement the `PSP22Mintable` trait in your `PSP22` smart contract. Add import for `brush::contracts::psp22::extensions::mintable::*`, inherit the implementation for `PSP22Mintable` trait, where you can also customize (override) the original functions from `PSP22Mintable`. +For your smart contract to use this extension, you only need to implement the `PSP22Mintable` trait in your `PSP22` smart contract. Add import for `openbrush::contracts::psp22::extensions::mintable::*`, inherit the implementation for `PSP22Mintable` trait, where you can also customize (override) the original functions from `PSP22Mintable`. ```rust -use brush::contracts::psp22::extensions::mintable::*; +use openbrush::contracts::psp22::extensions::mintable::*; impl PSP22Mintable for MyPSP22 {} ``` diff --git a/docs/docs/smart-contracts/PSP22/Extensions/pausable.md b/docs/docs/smart-contracts/PSP22/Extensions/pausable.md index 3d400522f..700fd4278 100644 --- a/docs/docs/smart-contracts/PSP22/Extensions/pausable.md +++ b/docs/docs/smart-contracts/PSP22/Extensions/pausable.md @@ -7,24 +7,24 @@ This example shows how you can implement a [PSP22](https://github.com/Supercolon ## Step 1: Include dependencies -Include `brush` as dependency in the cargo file or you can use [default `Cargo.toml`](/smart-contracts/overview#the-default-toml-of-your-project-with-openbrush) template. -After you need to enable default implementation of PSP22 and Pausable via `brush` features. +Include `openbrush` as dependency in the cargo file or you can use [default `Cargo.toml`](/smart-contracts/overview#the-default-toml-of-your-project-with-openbrush) template. +After you need to enable default implementation of PSP22 and Pausable via `openbrush` features. ```toml -brush = { version = "1.8.0", default-features = false, features = ["psp22", "pausable"] } +openbrush = { version = "1.8.0", default-features = false, features = ["psp22", "pausable"] } ``` ## Step 2: Add imports and enable unstable feature -Use `brush::contract` macro instead of `ink::contract`. Import **everything** from `brush::contracts::psp22` and `brush::contracts::pausable`. +Use `openbrush::contract` macro instead of `ink::contract`. Import **everything** from `openbrush::contracts::psp22` and `openbrush::contracts::pausable`. ```rust #![cfg_attr(not(feature = "std"), no_std)] #![feature(min_specialization)] -#[brush::contract] +#[openbrush::contract] pub mod my_psp22_pausable { - use brush::{ + use openbrush::{ contracts::{ pausable::*, psp22::*, diff --git a/docs/docs/smart-contracts/PSP22/Extensions/wrapper.md b/docs/docs/smart-contracts/PSP22/Extensions/wrapper.md index 89f30ce80..75f078092 100644 --- a/docs/docs/smart-contracts/PSP22/Extensions/wrapper.md +++ b/docs/docs/smart-contracts/PSP22/Extensions/wrapper.md @@ -7,24 +7,24 @@ This example shows how you can reuse the implementation of [PSP22](https://githu ## Step 1: Include dependencies -Include `brush` as dependency in the cargo file or you can use [default `Cargo.toml`](/smart-contracts/overview#the-default-toml-of-your-project-with-openbrush) template. -After you need to enable default implementation of PSP22 via `brush` features. +Include `openbrush` as dependency in the cargo file or you can use [default `Cargo.toml`](/smart-contracts/overview#the-default-toml-of-your-project-with-openbrush) template. +After you need to enable default implementation of PSP22 via `openbrush` features. ```toml -brush = { version = "1.8.0", default-features = false, features = ["psp22"] } +openbrush = { version = "1.8.0", default-features = false, features = ["psp22"] } ``` ## Step 2: Add imports and enable unstable feature -Use `brush::contract` macro instead of `ink::contract`. Import **everything** from `brush::contracts::psp22::extensions::wrapper`. +Use `openbrush::contract` macro instead of `ink::contract`. Import **everything** from `openbrush::contracts::psp22::extensions::wrapper`. ```rust #![cfg_attr(not(feature = "std"), no_std)] #![feature(min_specialization)] -#[brush::contract] +#[openbrush::contract] pub mod my_psp22_wrapper { - use brush::contracts::psp22::extensions::wrapper::*; + use openbrush::contracts::psp22::extensions::wrapper::*; use ink_storage::traits::SpreadAllocate; ... ``` diff --git a/docs/docs/smart-contracts/PSP22/Utils/token-timelock.md b/docs/docs/smart-contracts/PSP22/Utils/token-timelock.md index 77e7b835a..550f883cd 100644 --- a/docs/docs/smart-contracts/PSP22/Utils/token-timelock.md +++ b/docs/docs/smart-contracts/PSP22/Utils/token-timelock.md @@ -7,24 +7,24 @@ This example shows how you can reuse the implementation of [PSP22 Token Timelock ## Step 1: Include dependencies -Include `brush` as dependency in the cargo file or you can use [default `Cargo.toml`](/smart-contracts/overview#the-default-toml-of-your-project-with-openbrush) template. -After you need to enable default implementation of PSP22 via `brush` features. +Include `openbrush` as dependency in the cargo file or you can use [default `Cargo.toml`](/smart-contracts/overview#the-default-toml-of-your-project-with-openbrush) template. +After you need to enable default implementation of PSP22 via `openbrush` features. ```toml -brush = { version = "1.8.0", default-features = false, features = ["psp22"] } +openbrush = { version = "1.8.0", default-features = false, features = ["psp22"] } ``` ## Step 2: Add imports and enable unstable feature -Use `brush::contract` macro instead of `ink::contract`. Import **everything** from `brush::contracts::psp22::utils::token_timelock`. +Use `openbrush::contract` macro instead of `ink::contract`. Import **everything** from `openbrush::contracts::psp22::utils::token_timelock`. ```rust #![cfg_attr(not(feature = "std"), no_std)] #![feature(min_specialization)] -#[brush::contract] +#[openbrush::contract] pub mod my_psp22_token_timelock { - use brush::contracts::psp22::utils::token_timelock::*; + use openbrush::contracts::psp22::utils::token_timelock::*; use ink_storage::traits::SpreadAllocate; ... ``` diff --git a/docs/docs/smart-contracts/PSP22/psp22.md b/docs/docs/smart-contracts/PSP22/psp22.md index 015755f76..e92cd7081 100644 --- a/docs/docs/smart-contracts/PSP22/psp22.md +++ b/docs/docs/smart-contracts/PSP22/psp22.md @@ -7,24 +7,24 @@ This example shows how you can reuse the implementation of [PSP22](https://githu ## Step 1: Include dependencies -Include `brush` as dependency in the cargo file or you can use [default `Cargo.toml`](/smart-contracts/overview#the-default-toml-of-your-project-with-openbrush) template. -After you need to enable default implementation of PSP22 via `brush` features. +Include `openbrush` as dependency in the cargo file or you can use [default `Cargo.toml`](/smart-contracts/overview#the-default-toml-of-your-project-with-openbrush) template. +After you need to enable default implementation of PSP22 via `openbrush` features. ```toml -brush = { version = "1.8.0", default-features = false, features = ["psp22"] } +openbrush = { version = "1.8.0", default-features = false, features = ["psp22"] } ``` ## Step 2: Add imports and enable unstable feature -Use `brush::contract` macro instead of `ink::contract`. Import **everything** from `brush::contracts::psp22`. +Use `openbrush::contract` macro instead of `ink::contract`. Import **everything** from `openbrush::contracts::psp22`. ```rust #![cfg_attr(not(feature = "std"), no_std)] #![feature(min_specialization)] -#[brush::contract] +#[openbrush::contract] pub mod my_psp22 { - use brush::contracts::psp22::*; + use openbrush::contracts::psp22::*; use ink_prelude::string::String; use ink_storage::traits::SpreadAllocate; ... diff --git a/docs/docs/smart-contracts/PSP34/Extensions/burnable.md b/docs/docs/smart-contracts/PSP34/Extensions/burnable.md index d564582df..a35d87b1b 100644 --- a/docs/docs/smart-contracts/PSP34/Extensions/burnable.md +++ b/docs/docs/smart-contracts/PSP34/Extensions/burnable.md @@ -7,10 +7,10 @@ This example shows how you can reuse the implementation of [PSP34](https://githu ## How to use this extension -For your smart contract to use this extension, you only need to implement the `PSP34Burnable` trait in your `PSP34` smart contract. Add import for `brush::contracts::psp34::extensions::burnable::*`, inherit the implementation for `PSP34Burnable` trait, where you can also customize (override) the original functions from `PSP34Burnable`. +For your smart contract to use this extension, you only need to implement the `PSP34Burnable` trait in your `PSP34` smart contract. Add import for `openbrush::contracts::psp34::extensions::burnable::*`, inherit the implementation for `PSP34Burnable` trait, where you can also customize (override) the original functions from `PSP34Burnable`. ```rust -use brush::contracts::psp34::extensions::burnable::*; +use openbrush::contracts::psp34::extensions::burnable::*; impl PSP34Burnable for MyPSP34 {} ``` diff --git a/docs/docs/smart-contracts/PSP34/Extensions/metadata.md b/docs/docs/smart-contracts/PSP34/Extensions/metadata.md index 246b4af1c..5bd568539 100644 --- a/docs/docs/smart-contracts/PSP34/Extensions/metadata.md +++ b/docs/docs/smart-contracts/PSP34/Extensions/metadata.md @@ -7,24 +7,24 @@ This example shows how you can reuse the implementation of [PSP34](https://githu ## Step 1: Include dependencies -Include `brush` as dependency in the cargo file or you can use [default `Cargo.toml`](/smart-contracts/overview#the-default-toml-of-your-project-with-openbrush) template. -After you need to enable default implementation of PSP34 via `brush` features. +Include `openbrush` as dependency in the cargo file or you can use [default `Cargo.toml`](/smart-contracts/overview#the-default-toml-of-your-project-with-openbrush) template. +After you need to enable default implementation of PSP34 via `openbrush` features. ```toml -brush = { version = "1.8.0", default-features = false, features = ["psp34"] } +openbrush = { version = "1.8.0", default-features = false, features = ["psp34"] } ``` ## Step 2: Add imports and enable unstable feature -Use `brush::contract` macro instead of `ink::contract`. Import **everything** from `brush::contracts::psp34::extensions::metadata`. +Use `openbrush::contract` macro instead of `ink::contract`. Import **everything** from `openbrush::contracts::psp34::extensions::metadata`. ```rust #![cfg_attr(not(feature = "std"), no_std)] #![feature(min_specialization)] -#[brush::contract] +#[openbrush::contract] pub mod my_psp34_metadata { - use brush::contracts::psp34::extensions::metadata::*; + use openbrush::contracts::psp34::extensions::metadata::*; use ink_prelude::string::String; use ink_storage::traits::SpreadAllocate; ... diff --git a/docs/docs/smart-contracts/PSP34/Extensions/mintable.md b/docs/docs/smart-contracts/PSP34/Extensions/mintable.md index bf9e17573..091fd5fbd 100644 --- a/docs/docs/smart-contracts/PSP34/Extensions/mintable.md +++ b/docs/docs/smart-contracts/PSP34/Extensions/mintable.md @@ -7,10 +7,10 @@ This example shows how you can reuse the implementation of [PSP34](https://githu ## How to use this extension -For your smart contract to use this extension, you only need to implement the `PSP34Mintable` trait in your `PSP34` smart contract. Add import for `brush::contracts::psp34::extensions::mintable::*`, inherit the implementation for `PSP34Mintable` trait, where you can also customize (override) the original functions from `PSP34Mintable`. +For your smart contract to use this extension, you only need to implement the `PSP34Mintable` trait in your `PSP34` smart contract. Add import for `openbrush::contracts::psp34::extensions::mintable::*`, inherit the implementation for `PSP34Mintable` trait, where you can also customize (override) the original functions from `PSP34Mintable`. ```rust -use brush::contracts::psp34::extensions::mintable::*; +use openbrush::contracts::psp34::extensions::mintable::*; impl PSP34Mintable for MyPSP34 {} ``` diff --git a/docs/docs/smart-contracts/PSP34/psp34.md b/docs/docs/smart-contracts/PSP34/psp34.md index ff625d788..3c4b05446 100644 --- a/docs/docs/smart-contracts/PSP34/psp34.md +++ b/docs/docs/smart-contracts/PSP34/psp34.md @@ -7,24 +7,24 @@ This example shows how you can reuse the implementation of [PSP34](https://githu ## Step 1: Include dependencies -Include `brush` as dependency in the cargo file or you can use [default `Cargo.toml`](/smart-contracts/overview#the-default-toml-of-your-project-with-openbrush) template. -After you need to enable default implementation of PSP34 via `brush` features. +Include `openbrush` as dependency in the cargo file or you can use [default `Cargo.toml`](/smart-contracts/overview#the-default-toml-of-your-project-with-openbrush) template. +After you need to enable default implementation of PSP34 via `openbrush` features. ```toml -brush = { version = "1.8.0", default-features = false, features = ["psp34"] } +openbrush = { version = "1.8.0", default-features = false, features = ["psp34"] } ``` ## Step 2: Add imports and enable unstable feature -Use `brush::contract` macro instead of `ink::contract`. Import **everything** from `brush::contracts::psp34`. +Use `openbrush::contract` macro instead of `ink::contract`. Import **everything** from `openbrush::contracts::psp34`. ```rust #![cfg_attr(not(feature = "std"), no_std)] #![feature(min_specialization)] -#[brush::contract] +#[openbrush::contract] pub mod my_psp34 { - use brush::contracts::psp34::*; + use openbrush::contracts::psp34::*; use ink_storage::traits::SpreadAllocate; ``` diff --git a/docs/docs/smart-contracts/access-control.md b/docs/docs/smart-contracts/access-control.md index 853e5bd95..70f041ed8 100644 --- a/docs/docs/smart-contracts/access-control.md +++ b/docs/docs/smart-contracts/access-control.md @@ -7,24 +7,24 @@ This example shows how you can use the implementation of [access-control](https: ## Step 1: Include dependencies -Include `brush` as dependency in the cargo file or you can use [default `Cargo.toml`](/smart-contracts/overview#the-default-toml-of-your-project-with-openbrush) template. -After you need to enable default implementation of Access Control via `brush` features. +Include `openbrush` as dependency in the cargo file or you can use [default `Cargo.toml`](/smart-contracts/overview#the-default-toml-of-your-project-with-openbrush) template. +After you need to enable default implementation of Access Control via `openbrush` features. ```toml -brush = { version = "1.8.0", default-features = false, features = ["access_control"] } +openbrush = { version = "1.8.0", default-features = false, features = ["access_control"] } ``` ## Step 2: Add imports and enable unstable feature -Use `brush::contract` macro instead of `ink::contract`. Import **everything** from `brush::contracts::access_control`. +Use `openbrush::contract` macro instead of `ink::contract`. Import **everything** from `openbrush::contracts::access_control`. ```rust #![cfg_attr(not(feature = "std"), no_std)] #![feature(min_specialization)] -#[brush::contract] +#[openbrush::contract] pub mod my_access_control { - use brush::{ + use openbrush::{ contracts::access_control::*, modifiers, }; @@ -75,9 +75,9 @@ Customize it by adding access control logic. We will add a `restricted_function` #![cfg_attr(not(feature = "std"), no_std)] #![feature(min_specialization)] -#[brush::contract] +#[openbrush::contract] pub mod my_access_control { - use brush::{ + use openbrush::{ contracts::access_control::*, modifiers, }; diff --git a/docs/docs/smart-contracts/diamond.md b/docs/docs/smart-contracts/diamond.md index 3045ddee1..f9da4ba9b 100644 --- a/docs/docs/smart-contracts/diamond.md +++ b/docs/docs/smart-contracts/diamond.md @@ -7,24 +7,24 @@ This example shows how you can use the implementation of [diamond standard](http ## Step 1: Include dependencies -Include `brush` as dependency in the cargo file or you can use [default `Cargo.toml`](/smart-contracts/overview#the-default-toml-of-your-project-with-openbrush) template. -After you need to enable default implementation of Diamond Standard via `brush` features. +Include `openbrush` as dependency in the cargo file or you can use [default `Cargo.toml`](/smart-contracts/overview#the-default-toml-of-your-project-with-openbrush) template. +After you need to enable default implementation of Diamond Standard via `openbrush` features. ```toml -brush = { version = "1.8.0", default-features = false, features = ["diamond"] } +openbrush = { version = "1.8.0", default-features = false, features = ["diamond"] } ``` ## Step 2: Add imports and enable unstable feature -Use `brush::contract` macro instead of `ink::contract`. Import **everything** from `brush::contracts::ownable` and `brush::contracts::diamond` +Use `openbrush::contract` macro instead of `ink::contract`. Import **everything** from `openbrush::contracts::ownable` and `openbrush::contracts::diamond` ```rust #![cfg_attr(not(feature = "std"), no_std)] #![feature(min_specialization)] -#[brush::contract] +#[openbrush::contract] pub mod my_diamond { - use brush::{ + use openbrush::{ contracts::{ ownable::*, diamond::*, diff --git a/docs/docs/smart-contracts/example/contract.md b/docs/docs/smart-contracts/example/contract.md index 60e4729fc..59f1af462 100644 --- a/docs/docs/smart-contracts/example/contract.md +++ b/docs/docs/smart-contracts/example/contract.md @@ -35,7 +35,7 @@ scale-info = { version = "2", default-features = false, features = ["derive"], o 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 } -brush = { path = "../../..", default-features = false, features = ["psp22", "psp34", "pausable", "access_control"] } +openbrush = { path = "../../..", default-features = false, features = ["psp22", "psp34", "pausable", "access_control"] } [lib] name = "lending_contract" @@ -60,7 +60,7 @@ std = [ # These dependencies "loan_contract/std", "shares_contract/std", - "brush/std", + "openbrush/std", ] ink-as-dependency = [] diff --git a/docs/docs/smart-contracts/example/data.md b/docs/docs/smart-contracts/example/data.md index 9a17fa536..8cdb66892 100644 --- a/docs/docs/smart-contracts/example/data.md +++ b/docs/docs/smart-contracts/example/data.md @@ -103,22 +103,22 @@ impl Point for PointContract {} ## Macros from OpenBrush Some macros from OpenBrush allows to remove boilerplate code and simplify the development: -- [`declare_storage_trait!`](https://github.com/Supercolony-net/openbrush-contracts/blob/main/utils/brush_lang/macros.rs#L9) +- [`declare_storage_trait!`](https://github.com/Supercolony-net/openbrush-contracts/blob/main/utils/lang/macros.rs#L9) macro define the storage like described in the [Storage trait](/smart-contracts/example/data#storage-trait) ```rust -use brush::declare_storage_trait; +use openbrush::declare_storage_trait; declare_storage_trait!(PointStorage, PointData); ``` -- [`impl_storage_trait!`](https://github.com/Supercolony-net/openbrush-contracts/blob/main/utils/brush_lang/macros.rs#L27) +- [`impl_storage_trait!`](https://github.com/Supercolony-net/openbrush-contracts/blob/main/utils/lang/macros.rs#L27) macro implements the storage trait for the contract and return the field from that contract of the data type ```rust -use brush::impl_storage_trait; +use openbrush::impl_storage_trait; impl_storage_trait!(PointStorage, PointContract, point, PointData); ``` - Also, if you are familiar with [derive](https://doc.rust-lang.org/rust-by-example/trait/derive.html) macro: You can create a derive macro for your storage trait by yourself with -[`declare_derive_storage_trait!`](https://github.com/Supercolony-net/openbrush-contracts/blob/main/utils/brush_derive/lib.rs#L11) +[`declare_derive_storage_trait!`](https://github.com/Supercolony-net/openbrush-contracts/blob/main/lang/src/derive.rs) from OpenBrush. To define a derive macro you need a separate directory(let's call it `derive`). This directory contains the standard stuff of a Cargo folder - `.gitignore`, `Cargo.toml`, and the `lib.rs` file, @@ -130,19 +130,19 @@ look like this: extern crate proc_macro; -use brush_derive::declare_derive_storage_trait; +use openbrush::declare_derive_storage_trait; declare_derive_storage_trait!(derive_point_storage, PointStorage, PointStorageField); ``` -In the `Cargo.toml` of the derive folder you need to import `brush_derive` dependencies: +In the `Cargo.toml` of the derive folder you need to import `openbrush` dependencies: ```toml [dependencies] syn = { version = "1.0" } quote = "1.0" proc-macro2 = "1" -brush = { version = "1.8.0", default-features = false } +openbrush = { version = "1.8.0", default-features = false } [lib] name = "point_derive" diff --git a/docs/docs/smart-contracts/example/impls.md b/docs/docs/smart-contracts/example/impls.md index 974081bcd..833af0d82 100644 --- a/docs/docs/smart-contracts/example/impls.md +++ b/docs/docs/smart-contracts/example/impls.md @@ -24,7 +24,7 @@ We plan that `LendingContract` also will implement `AccessControl` and `Pausable That wrapper describes all methods available in the `LendingContract`. ```rust -use brush::{ +use openbrush::{ contracts::traits::{ access_control::*, pausable::*, @@ -41,13 +41,13 @@ use brush::{ }; /// Combination of all traits of the contract to simplify calls to the contract -#[brush::wrapper] +#[openbrush::wrapper] pub type LendingContractRef = dyn Lending + LendingPermissioned + AccessControl + Pausable; -#[brush::wrapper] +#[openbrush::wrapper] pub type LendingRef = dyn Lending; -#[brush::trait_definition] +#[openbrush::trait_definition] pub trait Lending { /// This function will return the total amount of assets available to borrow /// along with amount of the same asset borrowed @@ -141,10 +141,10 @@ pub trait Lending { fn liquidate_loan(&mut self, loan_id: Id) -> Result<(), LendingError>; } -#[brush::wrapper] +#[openbrush::wrapper] pub type LendingPermissionedRef = dyn LendingPermissioned; -#[brush::trait_definition] +#[openbrush::trait_definition] pub trait LendingPermissioned { /// This function will allow an asset to be accepted by the contract /// It will also create the contracts for the shares token and lended reserves token @@ -189,7 +189,7 @@ it will be enough for us. We will store prices info in our data struct. // importing everything publicly from traits allows you to import every stuff related to lending // by one import pub use crate::traits::lending::*; -use brush::{ +use openbrush::{ declare_storage_trait, traits::{ AccountId, @@ -354,7 +354,7 @@ by `LendingStorage`, `AccessControlStorage`, `PausableStorage`, `LendingPermissi That allows us to use methods from these traits and define the implementation. ```rust pub use super::data::*; -use brush::{ +use openbrush::{ contracts::{ access_control::*, pausable::PausableStorage, @@ -485,7 +485,7 @@ use crate::traits::{ }, shares::SharesRef, }; -use brush::{ +use openbrush::{ contracts::{ pausable::*, traits::{ diff --git a/docs/docs/smart-contracts/example/loan.md b/docs/docs/smart-contracts/example/loan.md index 9050bf992..3578ebe37 100644 --- a/docs/docs/smart-contracts/example/loan.md +++ b/docs/docs/smart-contracts/example/loan.md @@ -33,7 +33,7 @@ so it is defined in the `traits` instead of the body of the contract). `LoanRef` can be used by other developers to do a cross contract call to `LoanContract`. ```rust -use brush::{ +use openbrush::{ contracts::traits::{ ownable::*, psp34::{ @@ -68,10 +68,10 @@ pub struct LoanInfo { pub liquidated: bool, } -#[brush::wrapper] +#[openbrush::wrapper] pub type LoanRef = dyn Loan + PSP34 + PSP34Metadata + Ownable; -#[brush::trait_definition] +#[openbrush::trait_definition] pub trait Loan: PSP34 + PSP34Metadata + Ownable { /// This function initalizes data of a loan and mint token inside it #[ink(message)] @@ -112,21 +112,21 @@ the `"rlib"` crate type to have the ability to import the `LoanContract` as a de ## Implement the contract We want a basic [PSP-34](/smart-contracts/PSP34/psp34) token with metadata and ownable extensions, -so we will add these to our contract. We will add a `brush::contract` macro to our contract and add some imports: +so we will add these to our contract. We will add a `openbrush::contract` macro to our contract and add some imports: ```rust #![cfg_attr(not(feature = "std"), no_std)] #![feature(min_specialization)] /// This contract will represent the loan of a user -#[brush::contract] +#[openbrush::contract] pub mod loan { - use brush::contracts::{ + use openbrush::contracts::{ ownable::*, psp34::extensions::metadata::*, }; - use brush::modifiers; + use openbrush::modifiers; use ink_prelude::{ string::String, diff --git a/docs/docs/smart-contracts/example/psp22.md b/docs/docs/smart-contracts/example/psp22.md index 4f0a601d2..8dbe5f34b 100644 --- a/docs/docs/smart-contracts/example/psp22.md +++ b/docs/docs/smart-contracts/example/psp22.md @@ -20,15 +20,15 @@ we will implement that trait to be sure that all super traits are also implement `StableCoinRef` can be used by other developers to do a cross contract call to `StableCoinContract`. ```rust -use brush::contracts::traits::psp22::{ +use openbrush::contracts::traits::psp22::{ extensions::metadata::*, *, }; -#[brush::wrapper] +#[openbrush::wrapper] pub type StableCoinRef = dyn PSP22 + PSP22Metadata; -#[brush::trait_definition] +#[openbrush::trait_definition] pub trait StableCoin: PSP22 + PSP22Metadata {} ``` @@ -43,7 +43,7 @@ it here to keep it simple. We want a basic [PSP-22](/smart-contracts/PSP22/psp22) token with metadata, so we will add the [PSP-22 Metadata](/smart-contracts/PSP22/extensions/metadata) -extension to our contract. We will add a `brush::contract` macro to our contract +extension to our contract. We will add a `openbrush::contract` macro to our contract and add some imports: ```rust @@ -51,9 +51,9 @@ and add some imports: #![feature(min_specialization)] /// This is a simple `PSP-22` which will be used as a stable coin and a collateral token in our lending contract -#[brush::contract] +#[openbrush::contract] pub mod token { - use brush::contracts::psp22::extensions::metadata::*; + use openbrush::contracts::psp22::extensions::metadata::*; use ink_prelude::string::String; use lending_project::traits::stable_coin::*; use ink_storage::traits::SpreadAllocate; diff --git a/docs/docs/smart-contracts/example/setup_project.md b/docs/docs/smart-contracts/example/setup_project.md index 63371bbf7..d520ae201 100644 --- a/docs/docs/smart-contracts/example/setup_project.md +++ b/docs/docs/smart-contracts/example/setup_project.md @@ -20,7 +20,7 @@ If the contract contains several simple functions, better to implement them in the body of the contract. But if the contract contains a lot of logic and methods, better to move(and maybe split on parts) the implementation to that directory. Better to store the implementation of one contract in its own directory and not mix it with others. -- `derive` - is optional directory. OpenBrush provides the [macro](https://github.com/Supercolony-net/openbrush-contracts/blob/main/utils/brush_derive/lib.rs#L11) +- `derive` - is optional directory. OpenBrush provides the [macro](https://github.com/Supercolony-net/openbrush-contracts/blob/main/lang/src/derive.rs) to define a procedure derive macro of the storage trait. That derive can be used to implement the storage trait for the data structure in two lines(more details about it later). diff --git a/docs/docs/smart-contracts/example/shares.md b/docs/docs/smart-contracts/example/shares.md index e190405bb..ee5636ed0 100644 --- a/docs/docs/smart-contracts/example/shares.md +++ b/docs/docs/smart-contracts/example/shares.md @@ -18,7 +18,7 @@ In the implementation of the contract, we will implement that trait to be sure t `SharesRef` can be used by other developers to do a cross contract call to `SharesContract`. ```rust -use brush::contracts::traits::{ +use openbrush::contracts::traits::{ ownable::*, psp22::{ extensions::{ @@ -30,10 +30,10 @@ use brush::contracts::traits::{ }, }; -#[brush::wrapper] +#[openbrush::wrapper] pub type SharesRef = dyn PSP22 + PSP22Mintable + PSP22Burnable + PSP22Metadata + Ownable; -#[brush::trait_definition] +#[openbrush::trait_definition] pub trait Shares: PSP22 + PSP22Mintable + PSP22Burnable + PSP22Metadata + Ownable {} ``` @@ -60,9 +60,9 @@ we also need these imports: /// This contract will be used to represent the shares of a user /// and other instance of this contract will be used to represent /// the amount of borrowed tokens -#[brush::contract] +#[openbrush::contract] pub mod shares { - use brush::contracts::{ + use openbrush::contracts::{ ownable::*, psp22::extensions::{ burnable::*, @@ -71,7 +71,7 @@ pub mod shares { }, }; - use brush::modifiers; + use openbrush::modifiers; use ink_lang::codegen::Env; diff --git a/docs/docs/smart-contracts/overview.md b/docs/docs/smart-contracts/overview.md index df59d5a67..b140a63c7 100644 --- a/docs/docs/smart-contracts/overview.md +++ b/docs/docs/smart-contracts/overview.md @@ -23,7 +23,7 @@ scale = { package = "parity-scale-codec", version = "3", default-features = fals scale-info = { version = "2", default-features = false, features = ["derive"], optional = true } # Brush dependency -brush = { version = "1.8.0", default-features = false } +openbrush = { version = "1.8.0", default-features = false } [features] default = ["std"] @@ -39,14 +39,14 @@ std = [ "scale-info/std", # Brush dependency - "brush/std", + "openbrush/std", ] ink-as-dependency = [] ``` To avoid unexpected compilation errors better to always import all ink! crates. -By default, the `brush` crate provides [macros](https://github.com/Supercolony-net/openbrush-contracts/blob/main/utils/brush_lang/proc_macros/lib.rs) +By default, the `openbrush` crate provides [macros](https://github.com/Supercolony-net/openbrush-contracts/blob/main/lang/proc_macros/lib.rs) for simplification of the development and [traits](https://github.com/Supercolony-net/openbrush-contracts/tree/main/contracts/traits) of contracts(you can implement them by yourself, and you can use them for a cross-contract calls). diff --git a/docs/docs/smart-contracts/ownable.md b/docs/docs/smart-contracts/ownable.md index 387e3c0cf..cf778a14e 100644 --- a/docs/docs/smart-contracts/ownable.md +++ b/docs/docs/smart-contracts/ownable.md @@ -7,24 +7,24 @@ This example shows how you can use the implementation of [ownable](https://githu ## Step 1: Include dependencies -Include `brush` as dependency in the cargo file or you can use [default `Cargo.toml`](/smart-contracts/overview#the-default-toml-of-your-project-with-openbrush) template. -After you need to enable default implementation of Ownable via `brush` features. +Include `openbrush` as dependency in the cargo file or you can use [default `Cargo.toml`](/smart-contracts/overview#the-default-toml-of-your-project-with-openbrush) template. +After you need to enable default implementation of Ownable via `openbrush` features. ```toml -brush = { version = "1.8.0", default-features = false, features = ["ownable"] } +openbrush = { version = "1.8.0", default-features = false, features = ["ownable"] } ``` ## Step 2: Add imports and enable unstable feature -Use `brush::contract` macro instead of `ink::contract`. Import **everything** from `brush::contracts::ownable`. +Use `openbrush::contract` macro instead of `ink::contract`. Import **everything** from `openbrush::contracts::ownable`. ```rust #![cfg_attr(not(feature = "std"), no_std)] #![feature(min_specialization)] -#[brush::contract] +#[openbrush::contract] pub mod my_ownable { - use brush::{ + use openbrush::{ contracts::ownable::*, modifiers, }; @@ -77,9 +77,9 @@ Customize it by adding ownable logic. We will add a `owner_function` to `MyOwnab #![cfg_attr(not(feature = "std"), no_std)] #![feature(min_specialization)] -#[brush::contract] +#[openbrush::contract] pub mod my_ownable { - use brush::{ + use openbrush::{ contracts::ownable::*, modifiers, }; diff --git a/docs/docs/smart-contracts/pausable.md b/docs/docs/smart-contracts/pausable.md index a68eb2cf2..fa3f46fe6 100644 --- a/docs/docs/smart-contracts/pausable.md +++ b/docs/docs/smart-contracts/pausable.md @@ -8,24 +8,24 @@ This example shows how you can reuse the implementation of ## Step 1: Include dependencies -Include `brush` as dependency in the cargo file or you can use [default `Cargo.toml`](/smart-contracts/overview#the-default-toml-of-your-project-with-openbrush) template. -After you need to enable default implementation of Pausable via `brush` features. +Include `openbrush` as dependency in the cargo file or you can use [default `Cargo.toml`](/smart-contracts/overview#the-default-toml-of-your-project-with-openbrush) template. +After you need to enable default implementation of Pausable via `openbrush` features. ```toml -brush = { version = "1.8.0", default-features = false, features = ["pausable"] } +openbrush = { version = "1.8.0", default-features = false, features = ["pausable"] } ``` ## Step 2: Add imports and enable unstable feature -Use `brush::contract` macro instead of `ink::contract`. Import **everything** from `brush::contracts::pausable`. +Use `openbrush::contract` macro instead of `ink::contract`. Import **everything** from `openbrush::contracts::pausable`. ```rust #![cfg_attr(not(feature = "std"), no_std)] #![feature(min_specialization)] -#[brush::contract] +#[openbrush::contract] pub mod my_pausable { - use brush::contracts::pausable::*; + use openbrush::contracts::pausable::*; use ink_storage::traits::SpreadAllocate; ... ``` @@ -76,9 +76,9 @@ Customize it by adding flipper logic. We will implement `flip` method marked wit #![cfg_attr(not(feature = "std"), no_std)] #![feature(min_specialization)] -#[brush::contract] +#[openbrush::contract] pub mod my_pausable { - use brush::contracts::pausable::*; + use openbrush::contracts::pausable::*; use ink_storage::traits::SpreadAllocate; #[ink(storage)] @@ -96,7 +96,7 @@ pub mod my_pausable { } #[ink(message)] - #[brush::modifiers(when_not_paused)] + #[openbrush::modifiers(when_not_paused)] pub fn flip(&mut self) -> Result<(), PausableError> { self.flipped = !self.flipped; Ok(()) diff --git a/docs/docs/smart-contracts/payment-splitter.md b/docs/docs/smart-contracts/payment-splitter.md index 450d3eace..3ec004a29 100644 --- a/docs/docs/smart-contracts/payment-splitter.md +++ b/docs/docs/smart-contracts/payment-splitter.md @@ -8,11 +8,11 @@ This example shows how you can reuse the implementation of ## Step 1: Include dependencies -Include `brush` as dependency in the cargo file or you can use [default `Cargo.toml`](/smart-contracts/overview#the-default-toml-of-your-project-with-openbrush) template. -After you need to enable default implementation of Payment Splitter via `brush` features. +Include `openbrush` as dependency in the cargo file or you can use [default `Cargo.toml`](/smart-contracts/overview#the-default-toml-of-your-project-with-openbrush) template. +After you need to enable default implementation of Payment Splitter via `openbrush` features. ```toml -brush = { version = "1.8.0", default-features = false, features = ["payment_splitter"] } +openbrush = { version = "1.8.0", default-features = false, features = ["payment_splitter"] } # payment-splitter uses dividing inside, so your version of rust can require you to disable check overflow. [profile.dev] @@ -20,15 +20,15 @@ brush = { version = "1.8.0", default-features = false, features = ["payment_spli ## Step 2: Add imports and enable unstable feature -Use `brush::contract` macro instead of `ink::contract`. Import **everything** from `brush::contracts::payment_splitter`. +Use `openbrush::contract` macro instead of `ink::contract`. Import **everything** from `openbrush::contracts::payment_splitter`. ```rust #![cfg_attr(not(feature = "std"), no_std)] #![feature(min_specialization)] -#[brush::contract] +#[openbrush::contract] pub mod my_payment_splitter { - use brush::contracts::payment_splitter::*; + use openbrush::contracts::payment_splitter::*; use ink_prelude::vec::Vec; use ink_storage::traits::SpreadAllocate; ``` diff --git a/docs/docs/smart-contracts/proxy.md b/docs/docs/smart-contracts/proxy.md index 9eac6eae3..ae5891e1f 100644 --- a/docs/docs/smart-contracts/proxy.md +++ b/docs/docs/smart-contracts/proxy.md @@ -7,24 +7,24 @@ This example shows how you can use the implementation of [proxy](https://github. ## Step 1: Include dependencies -Include `brush` as dependency in the cargo file or you can use [default `Cargo.toml`](/smart-contracts/overview#the-default-toml-of-your-project-with-openbrush) template. -After you need to enable default implementation of Proxy via `brush` features. +Include `openbrush` as dependency in the cargo file or you can use [default `Cargo.toml`](/smart-contracts/overview#the-default-toml-of-your-project-with-openbrush) template. +After you need to enable default implementation of Proxy via `openbrush` features. ```toml -brush = { version = "1.8.0", default-features = false, features = ["proxy"] } +openbrush = { version = "1.8.0", default-features = false, features = ["proxy"] } ``` ## Step 2: Add imports and enable unstable feature -Use `brush::contract` macro instead of `ink::contract`. Import **everything** from `brush::contracts::ownable` and `brush::contracts::proxy` +Use `openbrush::contract` macro instead of `ink::contract`. Import **everything** from `openbrush::contracts::ownable` and `openbrush::contracts::proxy` ```rust #![cfg_attr(not(feature = "std"), no_std)] #![feature(min_specialization)] -#[brush::contract] +#[openbrush::contract] pub mod my_proxy { - use brush::{ + use openbrush::{ contracts::{ ownable::*, proxy::*, diff --git a/docs/docs/smart-contracts/reentrancy-guard.md b/docs/docs/smart-contracts/reentrancy-guard.md index dc1f1c6e1..916fde6d7 100644 --- a/docs/docs/smart-contracts/reentrancy-guard.md +++ b/docs/docs/smart-contracts/reentrancy-guard.md @@ -16,24 +16,24 @@ modifier to prevent reentrancy into certain functions. In this example we will c ### Step 1: Include dependencies -Include `brush` as dependency in the cargo file or you can use [default `Cargo.toml`](/smart-contracts/overview#the-default-toml-of-your-project-with-openbrush) template. -After you need to enable default implementation of Reentrancy Guard via `brush` features. +Include `openbrush` as dependency in the cargo file or you can use [default `Cargo.toml`](/smart-contracts/overview#the-default-toml-of-your-project-with-openbrush) template. +After you need to enable default implementation of Reentrancy Guard via `openbrush` features. ```toml -brush = { version = "1.8.0", default-features = false, features = ["reentrancy_guard"] } +openbrush = { version = "1.8.0", default-features = false, features = ["reentrancy_guard"] } ``` ### Step 2: Add imports -To declare the contract, you need to use `brush::contract` macro instead of `ink::contract`. Import **everything** -from `brush::contracts::reentrancy_guard`. +To declare the contract, you need to use `openbrush::contract` macro instead of `ink::contract`. Import **everything** +from `openbrush::contracts::reentrancy_guard`. ```rust #![cfg_attr(not(feature = "std"), no_std)] -#[brush::contract] +#[openbrush::contract] pub mod my_flipper_guard { - use brush::{ + use openbrush::{ contracts::reentrancy_guard::*, modifiers, }; @@ -77,7 +77,7 @@ impl MyFlipper { } #[ink(message)] - #[brush::modifiers(non_reentrant)] + #[openbrush::modifiers(non_reentrant)] pub fn flip(&mut self) { self.value = !self.value; } diff --git a/docs/docs/smart-contracts/timelock-controller.md b/docs/docs/smart-contracts/timelock-controller.md index e94f80bb9..de990206c 100644 --- a/docs/docs/smart-contracts/timelock-controller.md +++ b/docs/docs/smart-contracts/timelock-controller.md @@ -8,24 +8,24 @@ This example shows how you can reuse the implementation of ## Step 1: Include dependencies -Include `brush` as dependency in the cargo file or you can use [default `Cargo.toml`](/smart-contracts/overview#the-default-toml-of-your-project-with-openbrush) template. -After you need to enable default implementation of Timelock Controller via `brush` features. +Include `openbrush` as dependency in the cargo file or you can use [default `Cargo.toml`](/smart-contracts/overview#the-default-toml-of-your-project-with-openbrush) template. +After you need to enable default implementation of Timelock Controller via `openbrush` features. ```toml -brush = { version = "1.8.0", default-features = false, features = ["timelock_controller"] } +openbrush = { version = "1.8.0", default-features = false, features = ["timelock_controller"] } ``` ## Step 2: Add imports and enable unstable feature -Use `brush::contract` macro instead of `ink::contract`. Import **everything** from `brush::contracts::psp22::utils::token_timelock`. +Use `openbrush::contract` macro instead of `ink::contract`. Import **everything** from `openbrush::contracts::psp22::utils::token_timelock`. ```rust #![cfg_attr(not(feature = "std"), no_std)] #![feature(min_specialization)] -#[brush::contract] +#[openbrush::contract] pub mod my_psp22_token_timelock { - use brush::contracts::psp22::utils::token_timelock::*; + use openbrush::contracts::psp22::utils::token_timelock::*; use ink_storage::traits::SpreadAllocate; ``` diff --git a/example_project_structure/Cargo.toml b/example_project_structure/Cargo.toml index adf4721d6..88b291ba6 100644 --- a/example_project_structure/Cargo.toml +++ b/example_project_structure/Cargo.toml @@ -17,7 +17,7 @@ scale-info = { version = "2", default-features = false, features = ["derive"], o # These dependencies lending_project_derive = { path = "derive" } -brush = { path = "..", default-features = false, features = ["psp22", "psp34", "ownable", "pausable", "access_control"] } +openbrush = { path = "..", default-features = false, features = ["psp22", "psp34", "ownable", "pausable", "access_control"] } [lib] name = "lending_project" @@ -40,7 +40,7 @@ std = [ "scale-info/std", # These dependencies - "brush/std", + "openbrush/std", ] [profile.dev] diff --git a/example_project_structure/contracts/lending/Cargo.toml b/example_project_structure/contracts/lending/Cargo.toml index e29c592fc..e31bb1224 100644 --- a/example_project_structure/contracts/lending/Cargo.toml +++ b/example_project_structure/contracts/lending/Cargo.toml @@ -19,7 +19,7 @@ scale-info = { version = "2", default-features = false, features = ["derive"], o 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 } -brush = { path = "../../..", default-features = false, features = ["pausable", "access_control"] } +openbrush = { path = "../../..", default-features = false, features = ["pausable", "access_control"] } [lib] name = "lending_contract" @@ -44,7 +44,7 @@ std = [ # These dependencies "loan_contract/std", "shares_contract/std", - "brush/std", + "openbrush/std", ] ink-as-dependency = [] diff --git a/example_project_structure/contracts/lending/lib.rs b/example_project_structure/contracts/lending/lib.rs index b7ff499b4..24316abdb 100644 --- a/example_project_structure/contracts/lending/lib.rs +++ b/example_project_structure/contracts/lending/lib.rs @@ -35,17 +35,17 @@ /// 8. Pause the contract /// Users with the manager role can pause the contract. If the contract is paused, no borrowing or lending can be performed /// Users can still repay their loans, liquidate loans or withdraw their deposits -#[brush::contract] +#[openbrush::contract] pub mod lending { - use brush::contracts::{ - access_control::*, - pausable::*, - }; use ink_lang::ToAccountId; use ink_prelude::string::String; use ink_storage::traits::SpreadAllocate; use lending_project::impls::lending::*; use loan_contract::loan::LoanContractRef; + use openbrush::contracts::{ + access_control::*, + pausable::*, + }; use shares_contract::shares::SharesContractRef; #[ink(storage)] diff --git a/example_project_structure/contracts/loan/Cargo.toml b/example_project_structure/contracts/loan/Cargo.toml index 9e7963335..0ae0340fe 100644 --- a/example_project_structure/contracts/loan/Cargo.toml +++ b/example_project_structure/contracts/loan/Cargo.toml @@ -17,7 +17,7 @@ scale-info = { version = "2", default-features = false, features = ["derive"], o # These dependencies lending_project = { path = "../..", default-features = false } -brush = { path = "../../..", default-features = false, features = ["ownable", "psp34"] } +openbrush = { path = "../../..", default-features = false, features = ["ownable", "psp34"] } [lib] name = "loan_contract" @@ -42,7 +42,7 @@ std = [ # These dependencies "lending_project/std", - "brush/std", + "openbrush/std", ] ink-as-dependency = [] diff --git a/example_project_structure/contracts/loan/lib.rs b/example_project_structure/contracts/loan/lib.rs index dbd2d3acc..437ea06f2 100644 --- a/example_project_structure/contracts/loan/lib.rs +++ b/example_project_structure/contracts/loan/lib.rs @@ -2,18 +2,18 @@ #![feature(min_specialization)] /// This contract will represent the loan of a user -#[brush::contract] +#[openbrush::contract] pub mod loan { - use brush::contracts::{ - ownable::*, - psp34::extensions::metadata::*, - }; use ink_storage::{ traits::SpreadAllocate, Mapping, }; + use openbrush::contracts::{ + ownable::*, + psp34::extensions::metadata::*, + }; - use brush::modifiers; + use openbrush::modifiers; use ink_prelude::{ string::String, diff --git a/example_project_structure/contracts/shares/Cargo.toml b/example_project_structure/contracts/shares/Cargo.toml index b6a7014bc..6d0ad2e39 100644 --- a/example_project_structure/contracts/shares/Cargo.toml +++ b/example_project_structure/contracts/shares/Cargo.toml @@ -17,7 +17,7 @@ scale-info = { version = "2", default-features = false, features = ["derive"], o # These dependencies lending_project = { path = "../..", default-features = false } -brush = { path = "../../..", default-features = false, features = ["ownable", "psp22"] } +openbrush = { path = "../../..", default-features = false, features = ["ownable", "psp22"] } [lib] name = "shares_contract" @@ -42,7 +42,7 @@ std = [ # These dependencies "lending_project/std", - "brush/std", + "openbrush/std", ] ink-as-dependency = [] diff --git a/example_project_structure/contracts/shares/lib.rs b/example_project_structure/contracts/shares/lib.rs index d98310207..ace547c08 100644 --- a/example_project_structure/contracts/shares/lib.rs +++ b/example_project_structure/contracts/shares/lib.rs @@ -4,9 +4,12 @@ /// This contract will be used to represent the shares of a user /// and other instance of this contract will be used to represent /// the amount of borrowed tokens -#[brush::contract] +#[openbrush::contract] pub mod shares { - use brush::{ + use ink_prelude::string::String; + use ink_storage::traits::SpreadAllocate; + use lending_project::traits::shares::*; + use openbrush::{ contracts::{ ownable::*, psp22::extensions::{ @@ -17,9 +20,6 @@ pub mod shares { }, modifiers, }; - use ink_prelude::string::String; - use ink_storage::traits::SpreadAllocate; - use lending_project::traits::shares::*; /// Define the storage for PSP22 data, Metadata data and Ownable data #[ink(storage)] diff --git a/example_project_structure/contracts/stable_coin/Cargo.toml b/example_project_structure/contracts/stable_coin/Cargo.toml index 9c7438445..9ada0fef1 100644 --- a/example_project_structure/contracts/stable_coin/Cargo.toml +++ b/example_project_structure/contracts/stable_coin/Cargo.toml @@ -17,7 +17,7 @@ scale-info = { version = "2", default-features = false, features = ["derive"], o # These dependencies lending_project = { path = "../..", default-features = false } -brush = { path = "../../..", default-features = false, features = ["psp22"] } +openbrush = { path = "../../..", default-features = false, features = ["psp22"] } [lib] name = "stable_coin_contract" @@ -41,7 +41,7 @@ std = [ # These dependencies "lending_project/std", - "brush/std", + "openbrush/std", ] ink-as-dependency = [] diff --git a/example_project_structure/contracts/stable_coin/lib.rs b/example_project_structure/contracts/stable_coin/lib.rs index 31fc2702a..c45303f2b 100644 --- a/example_project_structure/contracts/stable_coin/lib.rs +++ b/example_project_structure/contracts/stable_coin/lib.rs @@ -2,12 +2,12 @@ #![feature(min_specialization)] /// This is a simple `PSP-22` which will be used as a stable coin and a collateral token in our lending contract -#[brush::contract] +#[openbrush::contract] pub mod token { - use brush::contracts::psp22::extensions::metadata::*; use ink_prelude::string::String; - use lending_project::traits::stable_coin::*; use ink_storage::traits::SpreadAllocate; + use lending_project::traits::stable_coin::*; + use openbrush::contracts::psp22::extensions::metadata::*; /// Define the storage for PSP22 data and Metadata data #[ink(storage)] diff --git a/example_project_structure/derive/Cargo.toml b/example_project_structure/derive/Cargo.toml index 62f3be749..954da817c 100644 --- a/example_project_structure/derive/Cargo.toml +++ b/example_project_structure/derive/Cargo.toml @@ -9,10 +9,10 @@ syn = { version = "1.0" } quote = "1.0" proc-macro2 = "1" -# In you code you can import `brush_derive` with the next line -#brush = { version = "1.8.0", default-features = false } +# In you code you can import `openbrush_derive` with the next line +#openbrush = { version = "1.8.0", default-features = false } -brush = { package = "brush_lang", path = "../../brush_lang" } +openbrush = { package = "openbrush_lang", path = "../../lang" } [lib] name = "lending_project_derive" diff --git a/example_project_structure/derive/lib.rs b/example_project_structure/derive/lib.rs index e09d4e843..d09e5e5d2 100644 --- a/example_project_structure/derive/lib.rs +++ b/example_project_structure/derive/lib.rs @@ -2,6 +2,6 @@ extern crate proc_macro; -use brush::declare_derive_storage_trait; +use openbrush::declare_derive_storage_trait; declare_derive_storage_trait!(derive_lending_storage, LendingStorage, LendingStorageField); diff --git a/example_project_structure/impls/lending/data.rs b/example_project_structure/impls/lending/data.rs index 8841fb5ef..e7976c366 100644 --- a/example_project_structure/impls/lending/data.rs +++ b/example_project_structure/impls/lending/data.rs @@ -1,7 +1,14 @@ // importing everything publicly from traits allows you to import every stuff related to lending // by one import pub use crate::traits::lending::*; -use brush::{ +use ink_storage::{ + traits::{ + SpreadAllocate, + SpreadLayout, + }, + Mapping, +}; +use openbrush::{ declare_storage_trait, traits::{ AccountId, @@ -11,13 +18,6 @@ use brush::{ ZERO_ADDRESS, }, }; -use ink_storage::{ - traits::{ - SpreadAllocate, - SpreadLayout, - }, - Mapping, -}; // it is public because when you will import the trait you also will import the derive for the trait pub use lending_project_derive::LendingStorage; diff --git a/example_project_structure/impls/lending/lending.rs b/example_project_structure/impls/lending/lending.rs index 3111fa1b9..4587c6233 100644 --- a/example_project_structure/impls/lending/lending.rs +++ b/example_project_structure/impls/lending/lending.rs @@ -9,7 +9,8 @@ use crate::traits::{ }, shares::SharesRef, }; -use brush::{ +use ink_prelude::vec::Vec; +use openbrush::{ contracts::{ pausable::*, traits::{ @@ -26,7 +27,6 @@ use brush::{ ZERO_ADDRESS, }, }; -use ink_prelude::vec::Vec; pub const YEAR: Timestamp = 60 * 60 * 24 * 365; diff --git a/example_project_structure/impls/lending/lending_permissioned.rs b/example_project_structure/impls/lending/lending_permissioned.rs index 26b019807..55a874e5f 100644 --- a/example_project_structure/impls/lending/lending_permissioned.rs +++ b/example_project_structure/impls/lending/lending_permissioned.rs @@ -1,5 +1,5 @@ pub use super::data::*; -use brush::{ +use openbrush::{ contracts::{ access_control::*, pausable::PausableStorage, diff --git a/example_project_structure/traits/lending.rs b/example_project_structure/traits/lending.rs index aa14234c8..3aca0d9a6 100644 --- a/example_project_structure/traits/lending.rs +++ b/example_project_structure/traits/lending.rs @@ -1,4 +1,4 @@ -use brush::{ +use openbrush::{ contracts::traits::{ access_control::*, pausable::*, @@ -15,13 +15,13 @@ use brush::{ }; /// Combination of all traits of the contract to simplify calls to the contract -#[brush::wrapper] +#[openbrush::wrapper] pub type LendingContractRef = dyn Lending + LendingPermissioned + AccessControl + Pausable; -#[brush::wrapper] +#[openbrush::wrapper] pub type LendingRef = dyn Lending; -#[brush::trait_definition] +#[openbrush::trait_definition] pub trait Lending { /// This function will return the total amount of assets available to borrow /// along with amount of the same asset borrowed @@ -115,10 +115,10 @@ pub trait Lending { fn liquidate_loan(&mut self, loan_id: Id) -> Result<(), LendingError>; } -#[brush::wrapper] +#[openbrush::wrapper] pub type LendingPermissionedRef = dyn LendingPermissioned; -#[brush::trait_definition] +#[openbrush::trait_definition] pub trait LendingPermissioned { /// This function will allow an asset to be accepted by the contract /// It will also create the contracts for the shares token and lended reserves token diff --git a/example_project_structure/traits/loan.rs b/example_project_structure/traits/loan.rs index d8ffbe8f3..346e09952 100644 --- a/example_project_structure/traits/loan.rs +++ b/example_project_structure/traits/loan.rs @@ -1,4 +1,8 @@ -use brush::{ +use ink_storage::traits::{ + PackedLayout, + SpreadLayout, +}; +use openbrush::{ contracts::traits::{ ownable::*, psp34::{ @@ -12,10 +16,6 @@ use brush::{ Timestamp, }, }; -use ink_storage::traits::{ - PackedLayout, - SpreadLayout, -}; #[cfg(feature = "std")] use ink_storage::traits::StorageLayout; @@ -33,10 +33,10 @@ pub struct LoanInfo { pub liquidated: bool, } -#[brush::wrapper] +#[openbrush::wrapper] pub type LoanRef = dyn Loan + PSP34 + PSP34Metadata + Ownable; -#[brush::trait_definition] +#[openbrush::trait_definition] pub trait Loan: PSP34 + PSP34Metadata + Ownable { /// This function initalizes data of a loan and mint token inside it #[ink(message)] diff --git a/example_project_structure/traits/shares.rs b/example_project_structure/traits/shares.rs index d5ad804e7..ca1821581 100644 --- a/example_project_structure/traits/shares.rs +++ b/example_project_structure/traits/shares.rs @@ -1,4 +1,4 @@ -use brush::contracts::traits::{ +use openbrush::contracts::traits::{ ownable::*, psp22::{ extensions::{ @@ -10,8 +10,8 @@ use brush::contracts::traits::{ }, }; -#[brush::wrapper] +#[openbrush::wrapper] pub type SharesRef = dyn PSP22 + PSP22Mintable + PSP22Burnable + PSP22Metadata + Ownable; -#[brush::trait_definition] +#[openbrush::trait_definition] pub trait Shares: PSP22 + PSP22Mintable + PSP22Burnable + PSP22Metadata + Ownable {} diff --git a/example_project_structure/traits/stable_coin.rs b/example_project_structure/traits/stable_coin.rs index c6007d311..316ce8db0 100644 --- a/example_project_structure/traits/stable_coin.rs +++ b/example_project_structure/traits/stable_coin.rs @@ -1,10 +1,10 @@ -use brush::contracts::traits::psp22::{ +use openbrush::contracts::traits::psp22::{ extensions::metadata::*, *, }; -#[brush::wrapper] +#[openbrush::wrapper] pub type StableCoinRef = dyn PSP22 + PSP22Metadata; -#[brush::trait_definition] +#[openbrush::trait_definition] pub trait StableCoin: PSP22 + PSP22Metadata {} diff --git a/examples/access_control/Cargo.toml b/examples/access_control/Cargo.toml index 1ff008c15..c67f2a1c7 100644 --- a/examples/access_control/Cargo.toml +++ b/examples/access_control/Cargo.toml @@ -16,7 +16,7 @@ scale = { package = "parity-scale-codec", version = "3", default-features = fals scale-info = { version = "2", default-features = false, features = ["derive"], optional = true } # These dependencies -brush = { path = "../..", default-features = false, features = ["access_control", "psp34"] } +openbrush = { path = "../..", default-features = false, features = ["access_control", "psp34"] } [lib] name = "my_access_control" @@ -39,7 +39,7 @@ std = [ "scale-info/std", # These dependencies - "brush/std", + "openbrush/std", ] ink-as-dependency = [] diff --git a/examples/access_control/lib.rs b/examples/access_control/lib.rs index 6609d24c9..2712f98a2 100644 --- a/examples/access_control/lib.rs +++ b/examples/access_control/lib.rs @@ -1,9 +1,10 @@ #![cfg_attr(not(feature = "std"), no_std)] #![feature(min_specialization)] -#[brush::contract] +#[openbrush::contract] pub mod my_access_control { - use brush::{ + use ink_storage::traits::SpreadAllocate; + use openbrush::{ contracts::{ access_control::*, psp34::extensions::{ @@ -13,7 +14,6 @@ pub mod my_access_control { }, modifiers, }; - use ink_storage::traits::SpreadAllocate; #[ink(storage)] #[derive(Default, SpreadAllocate, PSP34Storage, AccessControlStorage)] diff --git a/examples/diamond/Cargo.toml b/examples/diamond/Cargo.toml index 0c1615947..ebec20dba 100644 --- a/examples/diamond/Cargo.toml +++ b/examples/diamond/Cargo.toml @@ -16,7 +16,7 @@ scale = { package = "parity-scale-codec", version = "3", default-features = fals scale-info = { version = "2", default-features = false, features = ["derive"], optional = true } # These dependencies -brush = { path = "../..", default-features = false, features = ["diamond"] } +openbrush = { path = "../..", default-features = false, features = ["diamond"] } [lib] name = "my_diamond" @@ -39,7 +39,7 @@ std = [ "scale-info/std", # These dependencies - "brush/std", + "openbrush/std", ] ink-as-dependency = [] diff --git a/examples/diamond/diamond_caller/Cargo.toml b/examples/diamond/diamond_caller/Cargo.toml index 9a8611572..6a4774cf5 100644 --- a/examples/diamond/diamond_caller/Cargo.toml +++ b/examples/diamond/diamond_caller/Cargo.toml @@ -16,7 +16,7 @@ scale = { package = "parity-scale-codec", version = "3", default-features = fals scale-info = { version = "2", default-features = false, features = ["derive"], optional = true } # These dependencies -brush = { path = "../../..", default-features = false, features = ["psp22"] } +openbrush = { path = "../../..", default-features = false, features = ["psp22"] } [lib] name = "diamond_caller" @@ -40,6 +40,6 @@ std = [ "scale-info/std", # These dependencies - "brush/std", + "openbrush/std", ] ink-as-dependency = [] diff --git a/examples/diamond/diamond_caller/lib.rs b/examples/diamond/diamond_caller/lib.rs index 05f2b6c8c..5c2b12543 100644 --- a/examples/diamond/diamond_caller/lib.rs +++ b/examples/diamond/diamond_caller/lib.rs @@ -1,11 +1,11 @@ #![cfg_attr(not(feature = "std"), no_std)] #![feature(min_specialization)] -#[brush::contract] +#[openbrush::contract] pub mod diamond_caller { - use brush::contracts::psp22::*; use ink_prelude::vec::Vec; use ink_storage::traits::SpreadAllocate; + use openbrush::contracts::psp22::*; #[ink(storage)] #[derive(Default, SpreadAllocate)] diff --git a/examples/diamond/lib.rs b/examples/diamond/lib.rs index 45618762f..64c4d3796 100644 --- a/examples/diamond/lib.rs +++ b/examples/diamond/lib.rs @@ -1,10 +1,10 @@ #![cfg_attr(not(feature = "std"), no_std)] #![feature(min_specialization)] -#[brush::contract] +#[openbrush::contract] pub mod diamond { - use brush::contracts::diamond::extensions::diamond_loupe::*; use ink_storage::traits::SpreadAllocate; + use openbrush::contracts::diamond::extensions::diamond_loupe::*; #[ink(storage)] #[derive(Default, SpreadAllocate, DiamondStorage, DiamondLoupeStorage)] diff --git a/examples/diamond/psp22_facet_v1/Cargo.toml b/examples/diamond/psp22_facet_v1/Cargo.toml index b0c9ac25a..87c54febf 100644 --- a/examples/diamond/psp22_facet_v1/Cargo.toml +++ b/examples/diamond/psp22_facet_v1/Cargo.toml @@ -16,7 +16,7 @@ scale = { package = "parity-scale-codec", version = "3", default-features = fals scale-info = { version = "2", default-features = false, features = ["derive"], optional = true } # These dependencies -brush = { path = "../../..", default-features = false, features = ["psp22", "ownable"] } +openbrush = { path = "../../..", default-features = false, features = ["psp22", "ownable"] } [lib] name = "my_psp22_facet_v1" @@ -40,6 +40,6 @@ std = [ "scale-info/std", # These dependencies - "brush/std", + "openbrush/std", ] ink-as-dependency = [] diff --git a/examples/diamond/psp22_facet_v1/lib.rs b/examples/diamond/psp22_facet_v1/lib.rs index 2d791d590..ade3b63ed 100644 --- a/examples/diamond/psp22_facet_v1/lib.rs +++ b/examples/diamond/psp22_facet_v1/lib.rs @@ -1,16 +1,16 @@ #![cfg_attr(not(feature = "std"), no_std)] #![feature(min_specialization)] -#[brush::contract] +#[openbrush::contract] pub mod my_psp22_facet_v1 { - use brush::{ + use ink_storage::traits::SpreadAllocate; + use openbrush::{ contracts::{ ownable::*, psp22::*, }, modifiers, }; - use ink_storage::traits::SpreadAllocate; #[ink(storage)] #[derive(Default, SpreadAllocate, PSP22Storage, OwnableStorage)] diff --git a/examples/diamond/psp22_facet_v2/Cargo.toml b/examples/diamond/psp22_facet_v2/Cargo.toml index dd65a1c28..46ca71803 100644 --- a/examples/diamond/psp22_facet_v2/Cargo.toml +++ b/examples/diamond/psp22_facet_v2/Cargo.toml @@ -16,7 +16,7 @@ scale = { package = "parity-scale-codec", version = "3", default-features = fals scale-info = { version = "2", default-features = false, features = ["derive"], optional = true } # These dependencies -brush = { path = "../../..", default-features = false, features = ["psp22", "ownable"] } +openbrush = { path = "../../..", default-features = false, features = ["psp22", "ownable"] } [lib] name = "my_psp22_facet_v2" @@ -40,7 +40,7 @@ std = [ "scale-info/std", # These dependencies - "brush/std", + "openbrush/std", ] ink-as-dependency = [] diff --git a/examples/diamond/psp22_facet_v2/lib.rs b/examples/diamond/psp22_facet_v2/lib.rs index 2f7d07983..649fce36b 100644 --- a/examples/diamond/psp22_facet_v2/lib.rs +++ b/examples/diamond/psp22_facet_v2/lib.rs @@ -1,18 +1,18 @@ #![cfg_attr(not(feature = "std"), no_std)] #![feature(min_specialization)] -#[brush::contract] +#[openbrush::contract] pub mod my_psp22_facet_v2 { - use brush::{ + use ink_lang::codegen::Env; + use ink_prelude::vec::Vec; + use ink_storage::traits::SpreadAllocate; + use openbrush::{ contracts::{ ownable::*, psp22::*, }, traits::ZERO_ADDRESS, }; - use ink_lang::codegen::Env; - use ink_prelude::vec::Vec; - use ink_storage::traits::SpreadAllocate; #[ink(storage)] #[derive(Default, SpreadAllocate, PSP22Storage, OwnableStorage)] diff --git a/examples/diamond/psp22_metadata_facet/Cargo.toml b/examples/diamond/psp22_metadata_facet/Cargo.toml index ddb700ea2..75fbc638a 100644 --- a/examples/diamond/psp22_metadata_facet/Cargo.toml +++ b/examples/diamond/psp22_metadata_facet/Cargo.toml @@ -16,7 +16,7 @@ scale = { package = "parity-scale-codec", version = "3", default-features = fals scale-info = { version = "2", default-features = false, features = ["derive"], optional = true } # These dependencies -brush = { path = "../../..", default-features = false, features = ["psp22", "ownable"] } +openbrush = { path = "../../..", default-features = false, features = ["psp22", "ownable"] } [lib] name = "my_psp22_metadata_facet" @@ -40,6 +40,6 @@ std = [ "scale-info/std", # These dependencies - "brush/std", + "openbrush/std", ] ink-as-dependency = [] diff --git a/examples/diamond/psp22_metadata_facet/lib.rs b/examples/diamond/psp22_metadata_facet/lib.rs index a26731169..0536471ad 100644 --- a/examples/diamond/psp22_metadata_facet/lib.rs +++ b/examples/diamond/psp22_metadata_facet/lib.rs @@ -1,16 +1,16 @@ #![cfg_attr(not(feature = "std"), no_std)] #![feature(min_specialization)] -#[brush::contract] +#[openbrush::contract] pub mod my_psp22_metadata_facet { - use brush::{ + use ink_prelude::string::String; + use openbrush::{ contracts::{ ownable::*, psp22::extensions::metadata::*, }, modifiers, }; - use ink_prelude::string::String; use ink_storage::traits::SpreadAllocate; diff --git a/examples/ownable/Cargo.toml b/examples/ownable/Cargo.toml index c08968b6f..807498f4a 100644 --- a/examples/ownable/Cargo.toml +++ b/examples/ownable/Cargo.toml @@ -16,7 +16,7 @@ scale = { package = "parity-scale-codec", version = "3", default-features = fals scale-info = { version = "2", default-features = false, features = ["derive"], optional = true } # These dependencies -brush = { path = "../..", default-features = false, features = ["ownable", "psp1155"] } +openbrush = { path = "../..", default-features = false, features = ["ownable", "psp1155"] } [lib] name = "my_ownable" @@ -39,7 +39,7 @@ std = [ "scale-info/std", # These dependencies - "brush/std", + "openbrush/std", ] ink-as-dependency = [] diff --git a/examples/ownable/lib.rs b/examples/ownable/lib.rs index c9e5452c5..8a569b335 100644 --- a/examples/ownable/lib.rs +++ b/examples/ownable/lib.rs @@ -1,9 +1,11 @@ #![cfg_attr(not(feature = "std"), no_std)] #![feature(min_specialization)] -#[brush::contract] +#[openbrush::contract] pub mod ownable { - use brush::{ + use ink_prelude::vec::Vec; + use ink_storage::traits::SpreadAllocate; + use openbrush::{ contracts::{ ownable::*, psp1155::extensions::{ @@ -13,8 +15,6 @@ pub mod ownable { }, modifiers, }; - use ink_prelude::vec::Vec; - use ink_storage::traits::SpreadAllocate; #[ink(storage)] #[derive(Default, SpreadAllocate, PSP1155Storage, OwnableStorage)] diff --git a/examples/pausable/Cargo.toml b/examples/pausable/Cargo.toml index 3bc9a54e7..7b1d72793 100644 --- a/examples/pausable/Cargo.toml +++ b/examples/pausable/Cargo.toml @@ -16,7 +16,7 @@ scale = { package = "parity-scale-codec", version = "3", default-features = fals scale-info = { version = "2", default-features = false, features = ["derive"], optional = true } # These dependencies -brush = { path = "../..", default-features = false, features = ["pausable"] } +openbrush = { path = "../..", default-features = false, features = ["pausable"] } [lib] name = "my_pausable" @@ -39,7 +39,7 @@ std = [ "scale-info/std", # These dependencies - "brush/std", + "openbrush/std", ] ink-as-dependency = [] diff --git a/examples/pausable/lib.rs b/examples/pausable/lib.rs index 020bc391a..15f1d1a9c 100644 --- a/examples/pausable/lib.rs +++ b/examples/pausable/lib.rs @@ -1,10 +1,10 @@ #![cfg_attr(not(feature = "std"), no_std)] #![feature(min_specialization)] -#[brush::contract] +#[openbrush::contract] pub mod my_pausable { - use brush::contracts::pausable::*; use ink_storage::traits::SpreadAllocate; + use openbrush::contracts::pausable::*; #[ink(storage)] #[derive(Default, SpreadAllocate, PausableStorage)] @@ -21,7 +21,7 @@ pub mod my_pausable { } #[ink(message)] - #[brush::modifiers(when_not_paused)] + #[openbrush::modifiers(when_not_paused)] pub fn flip(&mut self) -> Result<(), PausableError> { self.flipped = !self.flipped; Ok(()) diff --git a/examples/payment_splitter/Cargo.toml b/examples/payment_splitter/Cargo.toml index 68740360e..8b9e1159c 100644 --- a/examples/payment_splitter/Cargo.toml +++ b/examples/payment_splitter/Cargo.toml @@ -16,7 +16,7 @@ scale = { package = "parity-scale-codec", version = "3", default-features = fals scale-info = { version = "2", default-features = false, features = ["derive"], optional = true } # These dependencies -brush = { path = "../..", default-features = false, features = ["payment_splitter"] } +openbrush = { path = "../..", default-features = false, features = ["payment_splitter"] } [lib] name = "my_payment_splitter" @@ -39,7 +39,7 @@ std = [ "scale-info/std", # These dependencies - "brush/std", + "openbrush/std", ] ink-as-dependency = [] diff --git a/examples/payment_splitter/lib.rs b/examples/payment_splitter/lib.rs index 7c9010193..116af2f45 100644 --- a/examples/payment_splitter/lib.rs +++ b/examples/payment_splitter/lib.rs @@ -1,11 +1,11 @@ #![cfg_attr(not(feature = "std"), no_std)] #![feature(min_specialization)] -#[brush::contract] +#[openbrush::contract] pub mod my_payment_splitter { - use brush::contracts::payment_splitter::*; use ink_prelude::vec::Vec; use ink_storage::traits::SpreadAllocate; + use openbrush::contracts::payment_splitter::*; #[ink(storage)] #[derive(Default, SpreadAllocate, PaymentSplitterStorage)] diff --git a/examples/proxy/Cargo.toml b/examples/proxy/Cargo.toml index f921f235b..378026384 100644 --- a/examples/proxy/Cargo.toml +++ b/examples/proxy/Cargo.toml @@ -16,7 +16,7 @@ scale = { package = "parity-scale-codec", version = "3", default-features = fals scale-info = { version = "2", default-features = false, features = ["derive"], optional = true } # These dependencies -brush = { path = "../..", default-features = false, features = ["proxy"] } +openbrush = { path = "../..", default-features = false, features = ["proxy"] } [lib] name = "my_proxy" @@ -39,7 +39,7 @@ std = [ "scale-info/std", # These dependencies - "brush/std", + "openbrush/std", ] ink-as-dependency = [] diff --git a/examples/proxy/lib.rs b/examples/proxy/lib.rs index 3f5af9e40..576aade47 100644 --- a/examples/proxy/lib.rs +++ b/examples/proxy/lib.rs @@ -1,13 +1,13 @@ #![cfg_attr(not(feature = "std"), no_std)] #![feature(min_specialization)] -#[brush::contract] +#[openbrush::contract] pub mod proxy { - use brush::contracts::{ + use ink_storage::traits::SpreadAllocate; + use openbrush::contracts::{ ownable::*, proxy::*, }; - use ink_storage::traits::SpreadAllocate; #[ink(storage)] #[derive(Default, SpreadAllocate, ProxyStorage)] diff --git a/examples/proxy/psp22_metadata_upgradeable/Cargo.toml b/examples/proxy/psp22_metadata_upgradeable/Cargo.toml index 45b81f7c0..d9dd4baf9 100644 --- a/examples/proxy/psp22_metadata_upgradeable/Cargo.toml +++ b/examples/proxy/psp22_metadata_upgradeable/Cargo.toml @@ -16,7 +16,7 @@ scale = { package = "parity-scale-codec", version = "3", default-features = fals scale-info = { version = "2", default-features = false, features = ["derive"], optional = true } # These dependencies -brush = { path = "../../..", default-features = false, features = ["psp22", "ownable"] } +openbrush = { path = "../../..", default-features = false, features = ["psp22", "ownable"] } [lib] name = "my_psp22_metadata_upgradeable" @@ -40,7 +40,7 @@ std = [ "scale-info/std", # These dependencies - "brush/std", + "openbrush/std", ] ink-as-dependency = [] diff --git a/examples/proxy/psp22_metadata_upgradeable/lib.rs b/examples/proxy/psp22_metadata_upgradeable/lib.rs index 6e348709f..3df481dcb 100644 --- a/examples/proxy/psp22_metadata_upgradeable/lib.rs +++ b/examples/proxy/psp22_metadata_upgradeable/lib.rs @@ -1,17 +1,17 @@ #![cfg_attr(not(feature = "std"), no_std)] #![feature(min_specialization)] -#[brush::contract] +#[openbrush::contract] pub mod my_psp22 { - use brush::{ + use ink_prelude::string::String; + use ink_storage::traits::SpreadAllocate; + use openbrush::{ contracts::{ ownable::*, psp22::extensions::metadata::*, }, modifiers, }; - use ink_prelude::string::String; - use ink_storage::traits::SpreadAllocate; #[ink(storage)] #[derive(Default, SpreadAllocate, PSP22Storage, PSP22MetadataStorage, OwnableStorage)] diff --git a/examples/proxy/psp22_upgradeable/Cargo.toml b/examples/proxy/psp22_upgradeable/Cargo.toml index 1190ab8c5..9319dc45b 100644 --- a/examples/proxy/psp22_upgradeable/Cargo.toml +++ b/examples/proxy/psp22_upgradeable/Cargo.toml @@ -16,7 +16,7 @@ scale = { package = "parity-scale-codec", version = "3", default-features = fals scale-info = { version = "2", default-features = false, features = ["derive"], optional = true } # These dependencies -brush = { path = "../../..", default-features = false, features = ["psp22", "ownable"] } +openbrush = { path = "../../..", default-features = false, features = ["psp22", "ownable"] } [lib] name = "my_psp22_upgradeable" @@ -40,7 +40,7 @@ std = [ "scale-info/std", # These dependencies - "brush/std", + "openbrush/std", ] ink-as-dependency = [] diff --git a/examples/proxy/psp22_upgradeable/lib.rs b/examples/proxy/psp22_upgradeable/lib.rs index 798364144..67b6c02c6 100644 --- a/examples/proxy/psp22_upgradeable/lib.rs +++ b/examples/proxy/psp22_upgradeable/lib.rs @@ -1,16 +1,16 @@ #![cfg_attr(not(feature = "std"), no_std)] #![feature(min_specialization)] -#[brush::contract] +#[openbrush::contract] pub mod my_psp22_upgradeable { - use brush::{ + use ink_storage::traits::SpreadAllocate; + use openbrush::{ contracts::{ ownable::*, psp22::*, }, modifiers, }; - use ink_storage::traits::SpreadAllocate; #[ink(storage)] #[derive(Default, SpreadAllocate, PSP22Storage, OwnableStorage)] diff --git a/examples/psp1155/Cargo.toml b/examples/psp1155/Cargo.toml index a228ef363..92761a685 100644 --- a/examples/psp1155/Cargo.toml +++ b/examples/psp1155/Cargo.toml @@ -16,7 +16,7 @@ scale = { package = "parity-scale-codec", version = "3", default-features = fals scale-info = { version = "2", default-features = false, features = ["derive"], optional = true } # These dependencies -brush = { path = "../..", default-features = false, features = ["psp1155"] } +openbrush = { path = "../..", default-features = false, features = ["psp1155"] } [lib] name = "my_psp1155" @@ -40,7 +40,7 @@ std = [ "scale-info/std", # These dependencies - "brush/std", + "openbrush/std", ] ink-as-dependency = [] diff --git a/examples/psp1155/lib.rs b/examples/psp1155/lib.rs index 7f3fb05b5..a790498c5 100644 --- a/examples/psp1155/lib.rs +++ b/examples/psp1155/lib.rs @@ -1,9 +1,8 @@ #![cfg_attr(not(feature = "std"), no_std)] #![feature(min_specialization)] -#[brush::contract] +#[openbrush::contract] pub mod my_psp1155 { - use brush::contracts::psp1155::*; use ink_prelude::{ string::String, vec, @@ -12,6 +11,7 @@ pub mod my_psp1155 { traits::SpreadAllocate, Mapping, }; + use openbrush::contracts::psp1155::*; #[derive(Default, SpreadAllocate, PSP1155Storage)] #[ink(storage)] diff --git a/examples/psp1155_extensions/burnable/Cargo.toml b/examples/psp1155_extensions/burnable/Cargo.toml index 0a8d89f87..b451553a6 100644 --- a/examples/psp1155_extensions/burnable/Cargo.toml +++ b/examples/psp1155_extensions/burnable/Cargo.toml @@ -16,7 +16,7 @@ scale = { package = "parity-scale-codec", version = "3", default-features = fals scale-info = { version = "2", default-features = false, features = ["derive"], optional = true } # These dependencies -brush = { path = "../../..", default-features = false, features = ["psp1155"] } +openbrush = { path = "../../..", default-features = false, features = ["psp1155"] } [lib] name = "my_psp1155_burnable" @@ -40,7 +40,7 @@ std = [ "scale-info/std", # These dependencies - "brush/std", + "openbrush/std", ] ink-as-dependency = [] diff --git a/examples/psp1155_extensions/burnable/lib.rs b/examples/psp1155_extensions/burnable/lib.rs index 57811499e..c854041be 100644 --- a/examples/psp1155_extensions/burnable/lib.rs +++ b/examples/psp1155_extensions/burnable/lib.rs @@ -1,11 +1,11 @@ #![cfg_attr(not(feature = "std"), no_std)] #![feature(min_specialization)] -#[brush::contract] +#[openbrush::contract] pub mod my_psp1155 { - use brush::contracts::psp1155::extensions::burnable::*; use ink_prelude::vec; use ink_storage::traits::SpreadAllocate; + use openbrush::contracts::psp1155::extensions::burnable::*; #[derive(Default, SpreadAllocate, PSP1155Storage)] #[ink(storage)] diff --git a/examples/psp1155_extensions/metadata/Cargo.toml b/examples/psp1155_extensions/metadata/Cargo.toml index d7f137adc..bb3cb33f9 100644 --- a/examples/psp1155_extensions/metadata/Cargo.toml +++ b/examples/psp1155_extensions/metadata/Cargo.toml @@ -16,7 +16,7 @@ scale = { package = "parity-scale-codec", version = "3", default-features = fals scale-info = { version = "2", default-features = false, features = ["derive"], optional = true } # These dependencies -brush = { path = "../../..", default-features = false, features = ["psp1155"] } +openbrush = { path = "../../..", default-features = false, features = ["psp1155"] } [lib] name = "my_psp1155_metadata" @@ -40,7 +40,7 @@ std = [ "scale-info/std", # These dependencies - "brush/std", + "openbrush/std", ] ink-as-dependency = [] diff --git a/examples/psp1155_extensions/metadata/lib.rs b/examples/psp1155_extensions/metadata/lib.rs index 9a3f6751b..c1a3e9703 100644 --- a/examples/psp1155_extensions/metadata/lib.rs +++ b/examples/psp1155_extensions/metadata/lib.rs @@ -1,11 +1,11 @@ #![cfg_attr(not(feature = "std"), no_std)] #![feature(min_specialization)] -#[brush::contract] +#[openbrush::contract] pub mod my_psp1155 { - use brush::contracts::psp1155::extensions::metadata::*; use ink_prelude::string::String; use ink_storage::traits::SpreadAllocate; + use openbrush::contracts::psp1155::extensions::metadata::*; #[derive(Default, SpreadAllocate, PSP1155Storage, PSP1155MetadataStorage)] #[ink(storage)] diff --git a/examples/psp1155_extensions/mintable/Cargo.toml b/examples/psp1155_extensions/mintable/Cargo.toml index 0b113cd5b..0e7dec657 100644 --- a/examples/psp1155_extensions/mintable/Cargo.toml +++ b/examples/psp1155_extensions/mintable/Cargo.toml @@ -16,7 +16,7 @@ scale = { package = "parity-scale-codec", version = "3", default-features = fals scale-info = { version = "2", default-features = false, features = ["derive"], optional = true } # These dependencies -brush = { path = "../../..", default-features = false, features = ["psp1155"] } +openbrush = { path = "../../..", default-features = false, features = ["psp1155"] } [lib] name = "my_psp1155_mintable" @@ -40,7 +40,7 @@ std = [ "scale-info/std", # These dependencies - "brush/std", + "openbrush/std", ] ink-as-dependency = [] diff --git a/examples/psp1155_extensions/mintable/lib.rs b/examples/psp1155_extensions/mintable/lib.rs index 2c3b301e4..7cfbeb780 100644 --- a/examples/psp1155_extensions/mintable/lib.rs +++ b/examples/psp1155_extensions/mintable/lib.rs @@ -1,10 +1,10 @@ #![cfg_attr(not(feature = "std"), no_std)] #![feature(min_specialization)] -#[brush::contract] +#[openbrush::contract] pub mod my_psp1155 { - use brush::contracts::psp1155::extensions::mintable::*; use ink_storage::traits::SpreadAllocate; + use openbrush::contracts::psp1155::extensions::mintable::*; #[derive(Default, SpreadAllocate, PSP1155Storage)] #[ink(storage)] diff --git a/examples/psp22/Cargo.toml b/examples/psp22/Cargo.toml index d4272375f..81f2540dd 100644 --- a/examples/psp22/Cargo.toml +++ b/examples/psp22/Cargo.toml @@ -16,7 +16,7 @@ scale = { package = "parity-scale-codec", version = "3", default-features = fals scale-info = { version = "2", default-features = false, features = ["derive"], optional = true } # These dependencies -brush = { path = "../..", default-features = false, features = ["psp22"] } +openbrush = { path = "../..", default-features = false, features = ["psp22"] } [lib] name = "my_psp22" @@ -40,7 +40,7 @@ std = [ "scale-info/std", # These dependencies - "brush/std", + "openbrush/std", ] ink-as-dependency = [] diff --git a/examples/psp22/lib.rs b/examples/psp22/lib.rs index 905d17ac6..98c0941c3 100644 --- a/examples/psp22/lib.rs +++ b/examples/psp22/lib.rs @@ -1,11 +1,11 @@ #![cfg_attr(not(feature = "std"), no_std)] #![feature(min_specialization)] -#[brush::contract] +#[openbrush::contract] pub mod my_psp22 { - use brush::contracts::psp22::*; use ink_prelude::string::String; use ink_storage::traits::SpreadAllocate; + use openbrush::contracts::psp22::*; #[ink(storage)] #[derive(Default, SpreadAllocate, PSP22Storage)] diff --git a/examples/psp22_extensions/burnable/Cargo.toml b/examples/psp22_extensions/burnable/Cargo.toml index b713491fe..d9e4af933 100644 --- a/examples/psp22_extensions/burnable/Cargo.toml +++ b/examples/psp22_extensions/burnable/Cargo.toml @@ -16,7 +16,7 @@ scale = { package = "parity-scale-codec", version = "3", default-features = fals scale-info = { version = "2", default-features = false, features = ["derive"], optional = true } # These dependencies -brush = { path = "../../..", default-features = false, features = ["psp22"] } +openbrush = { path = "../../..", default-features = false, features = ["psp22"] } [lib] name = "my_psp22_burnable" @@ -40,7 +40,7 @@ std = [ "scale-info/std", # These dependencies - "brush/std", + "openbrush/std", ] ink-as-dependency = [] diff --git a/examples/psp22_extensions/burnable/lib.rs b/examples/psp22_extensions/burnable/lib.rs index e593b0eb8..4b4007c6b 100644 --- a/examples/psp22_extensions/burnable/lib.rs +++ b/examples/psp22_extensions/burnable/lib.rs @@ -1,11 +1,11 @@ #![cfg_attr(not(feature = "std"), no_std)] #![feature(min_specialization)] -#[brush::contract] +#[openbrush::contract] pub mod my_psp22_burnable { - use brush::contracts::psp22::extensions::burnable::*; use ink_prelude::vec::Vec; use ink_storage::traits::SpreadAllocate; + use openbrush::contracts::psp22::extensions::burnable::*; #[ink(storage)] #[derive(Default, SpreadAllocate, PSP22Storage)] diff --git a/examples/psp22_extensions/capped/Cargo.toml b/examples/psp22_extensions/capped/Cargo.toml index 80ce06442..dabc75919 100644 --- a/examples/psp22_extensions/capped/Cargo.toml +++ b/examples/psp22_extensions/capped/Cargo.toml @@ -16,7 +16,7 @@ scale = { package = "parity-scale-codec", version = "3", default-features = fals scale-info = { version = "2", default-features = false, features = ["derive"], optional = true } # These dependencies -brush = { path = "../../..", default-features = false, features = ["psp22"] } +openbrush = { path = "../../..", default-features = false, features = ["psp22"] } [lib] name = "my_psp22_capped" @@ -40,7 +40,7 @@ std = [ "scale-info/std", # These dependencies - "brush/std", + "openbrush/std", ] ink-as-dependency = [] diff --git a/examples/psp22_extensions/capped/lib.rs b/examples/psp22_extensions/capped/lib.rs index 97152d983..f2ea223a6 100644 --- a/examples/psp22_extensions/capped/lib.rs +++ b/examples/psp22_extensions/capped/lib.rs @@ -1,9 +1,9 @@ #![cfg_attr(not(feature = "std"), no_std)] #![feature(min_specialization)] -#[brush::contract] +#[openbrush::contract] pub mod my_psp22_capped { - use brush::contracts::psp22::*; + use openbrush::contracts::psp22::*; use ink_prelude::string::String; use ink_storage::traits::SpreadAllocate; diff --git a/examples/psp22_extensions/flashmint/Cargo.toml b/examples/psp22_extensions/flashmint/Cargo.toml index b7926288a..25f6300da 100644 --- a/examples/psp22_extensions/flashmint/Cargo.toml +++ b/examples/psp22_extensions/flashmint/Cargo.toml @@ -16,7 +16,7 @@ scale = { package = "parity-scale-codec", version = "3", default-features = fals scale-info = { version = "2", default-features = false, features = ["derive"], optional = true } # These dependencies] -brush = { path = "../../..", default-features = false, features = ["psp22"] } +openbrush = { path = "../../..", default-features = false, features = ["psp22"] } [lib] name = "my_psp22_flashmint" @@ -40,7 +40,7 @@ std = [ "scale-info/std", # These dependencies - "brush/std", + "openbrush/std", ] ink-as-dependency = [] diff --git a/examples/psp22_extensions/flashmint/lib.rs b/examples/psp22_extensions/flashmint/lib.rs index d1c3eba7c..70ba4e792 100644 --- a/examples/psp22_extensions/flashmint/lib.rs +++ b/examples/psp22_extensions/flashmint/lib.rs @@ -1,10 +1,10 @@ #![cfg_attr(not(feature = "std"), no_std)] #![feature(min_specialization)] -#[brush::contract] +#[openbrush::contract] pub mod my_psp22_flashmint { - use brush::contracts::psp22::extensions::flashmint::*; use ink_storage::traits::SpreadAllocate; + use openbrush::contracts::psp22::extensions::flashmint::*; #[ink(storage)] #[derive(Default, SpreadAllocate, PSP22Storage)] diff --git a/examples/psp22_extensions/metadata/Cargo.toml b/examples/psp22_extensions/metadata/Cargo.toml index dcd184b77..e0877e60c 100644 --- a/examples/psp22_extensions/metadata/Cargo.toml +++ b/examples/psp22_extensions/metadata/Cargo.toml @@ -16,7 +16,7 @@ scale = { package = "parity-scale-codec", version = "3", default-features = fals scale-info = { version = "2", default-features = false, features = ["derive"], optional = true } # These dependencies -brush = { path = "../../..", default-features = false, features = ["psp22"] } +openbrush = { path = "../../..", default-features = false, features = ["psp22"] } [lib] name = "my_psp22_metadata" @@ -40,7 +40,7 @@ std = [ "scale-info/std", # These dependencies - "brush/std", + "openbrush/std", ] ink-as-dependency = [] diff --git a/examples/psp22_extensions/metadata/lib.rs b/examples/psp22_extensions/metadata/lib.rs index 9e0ede667..e93c6b134 100644 --- a/examples/psp22_extensions/metadata/lib.rs +++ b/examples/psp22_extensions/metadata/lib.rs @@ -1,9 +1,9 @@ #![cfg_attr(not(feature = "std"), no_std)] #![feature(min_specialization)] -#[brush::contract] +#[openbrush::contract] pub mod my_psp22 { - use brush::contracts::psp22::extensions::metadata::*; + use openbrush::contracts::psp22::extensions::metadata::*; use ink_prelude::string::String; use ink_storage::traits::SpreadAllocate; diff --git a/examples/psp22_extensions/mintable/Cargo.toml b/examples/psp22_extensions/mintable/Cargo.toml index f6af964b0..cb78fd7ad 100644 --- a/examples/psp22_extensions/mintable/Cargo.toml +++ b/examples/psp22_extensions/mintable/Cargo.toml @@ -16,7 +16,7 @@ scale = { package = "parity-scale-codec", version = "3", default-features = fals scale-info = { version = "2", default-features = false, features = ["derive"], optional = true } # These dependencies -brush = { path = "../../..", default-features = false, features = ["psp22"] } +openbrush = { path = "../../..", default-features = false, features = ["psp22"] } [lib] name = "my_psp22_mintable" @@ -40,7 +40,7 @@ std = [ "scale-info/std", # These dependencies - "brush/std", + "openbrush/std", ] ink-as-dependency = [] diff --git a/examples/psp22_extensions/mintable/lib.rs b/examples/psp22_extensions/mintable/lib.rs index 1a3c74c74..47aed4ae6 100644 --- a/examples/psp22_extensions/mintable/lib.rs +++ b/examples/psp22_extensions/mintable/lib.rs @@ -1,10 +1,10 @@ #![cfg_attr(not(feature = "std"), no_std)] #![feature(min_specialization)] -#[brush::contract] +#[openbrush::contract] pub mod my_psp22_mintable { - use brush::contracts::psp22::extensions::mintable::*; use ink_storage::traits::SpreadAllocate; + use openbrush::contracts::psp22::extensions::mintable::*; #[ink(storage)] #[derive(Default, SpreadAllocate, PSP22Storage)] diff --git a/examples/psp22_extensions/pausable/Cargo.toml b/examples/psp22_extensions/pausable/Cargo.toml index ea5331170..0c4c0f4ba 100644 --- a/examples/psp22_extensions/pausable/Cargo.toml +++ b/examples/psp22_extensions/pausable/Cargo.toml @@ -16,7 +16,7 @@ scale = { package = "parity-scale-codec", version = "3", default-features = fals scale-info = { version = "2", default-features = false, features = ["derive"], optional = true } # These dependencies -brush = { path = "../../..", default-features = false, features = ["psp22", "pausable"] } +openbrush = { path = "../../..", default-features = false, features = ["psp22", "pausable"] } [lib] name = "my_psp22_pausable" @@ -40,7 +40,7 @@ std = [ "scale-info/std", # These dependencies - "brush/std", + "openbrush/std", ] ink-as-dependency = [] diff --git a/examples/psp22_extensions/pausable/lib.rs b/examples/psp22_extensions/pausable/lib.rs index f44579f68..00f7aac18 100644 --- a/examples/psp22_extensions/pausable/lib.rs +++ b/examples/psp22_extensions/pausable/lib.rs @@ -1,9 +1,9 @@ #![cfg_attr(not(feature = "std"), no_std)] #![feature(min_specialization)] -#[brush::contract] +#[openbrush::contract] pub mod my_psp22_pausable { - use brush::{ + use openbrush::{ contracts::{ pausable::*, psp22::*, diff --git a/examples/psp22_extensions/wrapper/Cargo.toml b/examples/psp22_extensions/wrapper/Cargo.toml index 5e531416c..b96a4e22b 100644 --- a/examples/psp22_extensions/wrapper/Cargo.toml +++ b/examples/psp22_extensions/wrapper/Cargo.toml @@ -16,7 +16,7 @@ scale = { package = "parity-scale-codec", version = "3", default-features = fals scale-info = { version = "2", default-features = false, features = ["derive"], optional = true } # These dependencies -brush = { path = "../../..", default-features = false, features = ["psp22"] } +openbrush = { path = "../../..", default-features = false, features = ["psp22"] } [lib] name = "my_psp22_wrapper" @@ -40,7 +40,7 @@ std = [ "scale-info/std", # These dependencies - "brush/std", + "openbrush/std", ] ink-as-dependency = [] diff --git a/examples/psp22_extensions/wrapper/lib.rs b/examples/psp22_extensions/wrapper/lib.rs index b53566a5d..d03b734e4 100644 --- a/examples/psp22_extensions/wrapper/lib.rs +++ b/examples/psp22_extensions/wrapper/lib.rs @@ -1,10 +1,10 @@ #![cfg_attr(not(feature = "std"), no_std)] #![feature(min_specialization)] -#[brush::contract] +#[openbrush::contract] pub mod my_psp22_wrapper { - use brush::contracts::psp22::extensions::wrapper::*; use ink_storage::traits::SpreadAllocate; + use openbrush::contracts::psp22::extensions::wrapper::*; #[ink(storage)] #[derive(Default, SpreadAllocate, PSP22WrapperStorage, PSP22Storage)] diff --git a/examples/psp22_utils/token_timelock/Cargo.toml b/examples/psp22_utils/token_timelock/Cargo.toml index 9cc40754e..469954b21 100644 --- a/examples/psp22_utils/token_timelock/Cargo.toml +++ b/examples/psp22_utils/token_timelock/Cargo.toml @@ -16,7 +16,7 @@ scale = { package = "parity-scale-codec", version = "3", default-features = fals scale-info = { version = "2", default-features = false, features = ["derive"], optional = true } # These dependencies -brush = { path = "../../..", default-features = false, features = ["psp22"] } +openbrush = { path = "../../..", default-features = false, features = ["psp22"] } [lib] name = "my_psp22_token_timelock" @@ -40,7 +40,7 @@ std = [ "scale-info/std", # These dependencies - "brush/std", + "openbrush/std", ] ink-as-dependency = [] diff --git a/examples/psp22_utils/token_timelock/lib.rs b/examples/psp22_utils/token_timelock/lib.rs index bbe4f891c..9503f7d4c 100644 --- a/examples/psp22_utils/token_timelock/lib.rs +++ b/examples/psp22_utils/token_timelock/lib.rs @@ -1,10 +1,10 @@ #![cfg_attr(not(feature = "std"), no_std)] #![feature(min_specialization)] -#[brush::contract] +#[openbrush::contract] pub mod my_psp22_token_timelock { - use brush::contracts::psp22::utils::token_timelock::*; use ink_storage::traits::SpreadAllocate; + use openbrush::contracts::psp22::utils::token_timelock::*; #[ink(storage)] #[derive(Default, SpreadAllocate, PSP22TokenTimelockStorage)] diff --git a/examples/psp34/Cargo.toml b/examples/psp34/Cargo.toml index a0990f133..519534a2c 100644 --- a/examples/psp34/Cargo.toml +++ b/examples/psp34/Cargo.toml @@ -16,7 +16,7 @@ scale = { package = "parity-scale-codec", version = "3", default-features = fals scale-info = { version = "2", default-features = false, features = ["derive"], optional = true } # These dependencies -brush = { path = "../..", default-features = false, features = ["psp34"] } +openbrush = { path = "../..", default-features = false, features = ["psp34"] } [lib] name = "my_psp34" @@ -40,7 +40,7 @@ std = [ "scale-info/std", # These dependencies - "brush/std", + "openbrush/std", ] ink-as-dependency = [] diff --git a/examples/psp34/lib.rs b/examples/psp34/lib.rs index 578d318a5..1863e3870 100644 --- a/examples/psp34/lib.rs +++ b/examples/psp34/lib.rs @@ -1,10 +1,10 @@ #![cfg_attr(not(feature = "std"), no_std)] #![feature(min_specialization)] -#[brush::contract] +#[openbrush::contract] pub mod my_psp34 { - use brush::contracts::psp34::*; use ink_storage::traits::SpreadAllocate; + use openbrush::contracts::psp34::*; #[ink(storage)] #[derive(Default, SpreadAllocate, PSP34Storage)] diff --git a/examples/psp34_extensions/burnable/Cargo.toml b/examples/psp34_extensions/burnable/Cargo.toml index 6051aba8a..29de32b3d 100644 --- a/examples/psp34_extensions/burnable/Cargo.toml +++ b/examples/psp34_extensions/burnable/Cargo.toml @@ -16,7 +16,7 @@ scale = { package = "parity-scale-codec", version = "3", default-features = fals scale-info = { version = "2", default-features = false, features = ["derive"], optional = true } # These dependencies -brush = { path = "../../..", default-features = false, features = ["psp34"] } +openbrush = { path = "../../..", default-features = false, features = ["psp34"] } [lib] name = "my_psp34_burnable" @@ -40,7 +40,7 @@ std = [ "scale-info/std", # These dependencies - "brush/std", + "openbrush/std", ] ink-as-dependency = [] diff --git a/examples/psp34_extensions/burnable/lib.rs b/examples/psp34_extensions/burnable/lib.rs index a563a9357..d9c5c1b55 100644 --- a/examples/psp34_extensions/burnable/lib.rs +++ b/examples/psp34_extensions/burnable/lib.rs @@ -1,10 +1,10 @@ #![cfg_attr(not(feature = "std"), no_std)] #![feature(min_specialization)] -#[brush::contract] +#[openbrush::contract] pub mod my_psp34_burnable { - use brush::contracts::psp34::extensions::burnable::*; use ink_storage::traits::SpreadAllocate; + use openbrush::contracts::psp34::extensions::burnable::*; #[derive(Default, SpreadAllocate, PSP34Storage)] #[ink(storage)] diff --git a/examples/psp34_extensions/enumerable/Cargo.toml b/examples/psp34_extensions/enumerable/Cargo.toml index 06f551a06..733e5a8ee 100644 --- a/examples/psp34_extensions/enumerable/Cargo.toml +++ b/examples/psp34_extensions/enumerable/Cargo.toml @@ -16,7 +16,7 @@ scale = { package = "parity-scale-codec", version = "3", default-features = fals scale-info = { version = "2", default-features = false, features = ["derive"], optional = true } # These dependencies -brush = { path = "../../..", default-features = false, features = ["psp34"] } +openbrush = { path = "../../..", default-features = false, features = ["psp34"] } [lib] name = "my_psp34_enumerable" @@ -40,7 +40,7 @@ std = [ "scale-info/std", # These dependencies - "brush/std", + "openbrush/std", ] ink-as-dependency = [] diff --git a/examples/psp34_extensions/enumerable/lib.rs b/examples/psp34_extensions/enumerable/lib.rs index 7f4a70dcc..81749303c 100644 --- a/examples/psp34_extensions/enumerable/lib.rs +++ b/examples/psp34_extensions/enumerable/lib.rs @@ -1,14 +1,14 @@ #![cfg_attr(not(feature = "std"), no_std)] #![feature(min_specialization)] -#[brush::contract] +#[openbrush::contract] pub mod my_psp34_enumerable { - use brush::contracts::psp34::extensions::{ + use ink_storage::traits::SpreadAllocate; + use openbrush::contracts::psp34::extensions::{ burnable::*, enumerable::*, mintable::*, }; - use ink_storage::traits::SpreadAllocate; #[derive(Default, SpreadAllocate, PSP34Storage, PSP34EnumerableStorage)] #[ink(storage)] @@ -27,8 +27,6 @@ pub mod my_psp34_enumerable { impl PSP34Enumerable for MyPSP34 {} - - impl MyPSP34 { #[ink(constructor)] pub fn new() -> Self { diff --git a/examples/psp34_extensions/metadata/Cargo.toml b/examples/psp34_extensions/metadata/Cargo.toml index 96528d83f..b6b8fb2c6 100644 --- a/examples/psp34_extensions/metadata/Cargo.toml +++ b/examples/psp34_extensions/metadata/Cargo.toml @@ -16,7 +16,7 @@ scale = { package = "parity-scale-codec", version = "3", default-features = fals scale-info = { version = "2", default-features = false, features = ["derive"], optional = true } # These dependencies -brush = { path = "../../..", default-features = false, features = ["psp34"] } +openbrush = { path = "../../..", default-features = false, features = ["psp34"] } [lib] name = "my_psp34_metadata" @@ -40,7 +40,7 @@ std = [ "scale-info/std", # These dependencies - "brush/std", + "openbrush/std", ] ink-as-dependency = [] diff --git a/examples/psp34_extensions/metadata/lib.rs b/examples/psp34_extensions/metadata/lib.rs index 3549e77ab..416fa1557 100644 --- a/examples/psp34_extensions/metadata/lib.rs +++ b/examples/psp34_extensions/metadata/lib.rs @@ -1,9 +1,9 @@ #![cfg_attr(not(feature = "std"), no_std)] #![feature(min_specialization)] -#[brush::contract] +#[openbrush::contract] pub mod my_psp34_metadata { - use brush::contracts::psp34::extensions::metadata::*; + use openbrush::contracts::psp34::extensions::metadata::*; use ink_prelude::{ string::String, vec::Vec, diff --git a/examples/psp34_extensions/mintable/Cargo.toml b/examples/psp34_extensions/mintable/Cargo.toml index 7d4f48636..b2b150feb 100644 --- a/examples/psp34_extensions/mintable/Cargo.toml +++ b/examples/psp34_extensions/mintable/Cargo.toml @@ -16,7 +16,7 @@ scale = { package = "parity-scale-codec", version = "3", default-features = fals scale-info = { version = "2", default-features = false, features = ["derive"], optional = true } # These dependencies -brush = { path = "../../..", default-features = false, features = ["psp34"] } +openbrush = { path = "../../..", default-features = false, features = ["psp34"] } [lib] name = "my_psp34_mintable" @@ -40,7 +40,7 @@ std = [ "scale-info/std", # These dependencies - "brush/std", + "openbrush/std", ] ink-as-dependency = [] diff --git a/examples/psp34_extensions/mintable/lib.rs b/examples/psp34_extensions/mintable/lib.rs index b46b5d61b..269fcd0ce 100644 --- a/examples/psp34_extensions/mintable/lib.rs +++ b/examples/psp34_extensions/mintable/lib.rs @@ -1,9 +1,9 @@ #![cfg_attr(not(feature = "std"), no_std)] #![feature(min_specialization)] -#[brush::contract] +#[openbrush::contract] pub mod my_psp34_mintable { - use brush::contracts::psp34::extensions::mintable::*; + use openbrush::contracts::psp34::extensions::mintable::*; use ink_storage::traits::SpreadAllocate; #[derive(Default, SpreadAllocate, PSP34Storage)] diff --git a/examples/reentrancy_guard/Cargo.toml b/examples/reentrancy_guard/Cargo.toml index e94676216..75633d1bb 100644 --- a/examples/reentrancy_guard/Cargo.toml +++ b/examples/reentrancy_guard/Cargo.toml @@ -16,7 +16,7 @@ scale = { package = "parity-scale-codec", version = "3", default-features = fals scale-info = { version = "2", default-features = false, features = ["derive"], optional = true } # These dependencies -brush = { path = "../..", default-features = false, features = ["reentrancy_guard"] } +openbrush = { path = "../..", default-features = false, features = ["reentrancy_guard"] } [lib] name = "flipper" @@ -40,7 +40,7 @@ std = [ "scale-info/std", # These dependencies - "brush/std", + "openbrush/std", ] ink-as-dependency = [] diff --git a/examples/reentrancy_guard/contracts/flip_on_me/Cargo.toml b/examples/reentrancy_guard/contracts/flip_on_me/Cargo.toml index bea7ae099..347cf5bac 100644 --- a/examples/reentrancy_guard/contracts/flip_on_me/Cargo.toml +++ b/examples/reentrancy_guard/contracts/flip_on_me/Cargo.toml @@ -16,7 +16,7 @@ scale = { package = "parity-scale-codec", version = "3", default-features = fals scale-info = { version = "2", default-features = false, features = ["derive"], optional = true } flipper = { path = "../..", default-features = false } -brush = { path = "../../../..", default-features = false } +openbrush = { path = "../../../..", default-features = false } [lib] name = "flip_on_me" @@ -40,7 +40,7 @@ std = [ "scale-info/std", "flipper/std", - "brush/std", + "openbrush/std", ] ink-as-dependency = [] diff --git a/examples/reentrancy_guard/contracts/flip_on_me/lib.rs b/examples/reentrancy_guard/contracts/flip_on_me/lib.rs index 5f4d8588a..7813ba80c 100644 --- a/examples/reentrancy_guard/contracts/flip_on_me/lib.rs +++ b/examples/reentrancy_guard/contracts/flip_on_me/lib.rs @@ -1,6 +1,6 @@ #![cfg_attr(not(feature = "std"), no_std)] -#[brush::contract] +#[openbrush::contract] pub mod flip_on_me { use flipper::traits::flip_on_me::*; use ink_storage::traits::SpreadAllocate; diff --git a/examples/reentrancy_guard/contracts/flipper/Cargo.toml b/examples/reentrancy_guard/contracts/flipper/Cargo.toml index 5e00919d1..78d67edbd 100644 --- a/examples/reentrancy_guard/contracts/flipper/Cargo.toml +++ b/examples/reentrancy_guard/contracts/flipper/Cargo.toml @@ -17,7 +17,7 @@ scale-info = { version = "2", default-features = false, features = ["derive"], o # These dependencies flipper = { path = "../..", default-features = false } -brush = { path = "../../../..", default-features = false } +openbrush = { path = "../../../..", default-features = false } [lib] name = "my_flipper_guard" @@ -42,7 +42,7 @@ std = [ # These dependencies "flipper/std", - "brush/std", + "openbrush/std", ] ink-as-dependency = [] diff --git a/examples/reentrancy_guard/contracts/flipper/lib.rs b/examples/reentrancy_guard/contracts/flipper/lib.rs index 4523c9408..02b311797 100644 --- a/examples/reentrancy_guard/contracts/flipper/lib.rs +++ b/examples/reentrancy_guard/contracts/flipper/lib.rs @@ -1,6 +1,6 @@ #![cfg_attr(not(feature = "std"), no_std)] -#[brush::contract] +#[openbrush::contract] pub mod my_flipper_guard { use flipper::traits::flipper::*; use ink_storage::traits::SpreadAllocate; diff --git a/examples/reentrancy_guard/traits/flip_on_me.rs b/examples/reentrancy_guard/traits/flip_on_me.rs index 80ee93087..a2652fb92 100644 --- a/examples/reentrancy_guard/traits/flip_on_me.rs +++ b/examples/reentrancy_guard/traits/flip_on_me.rs @@ -1,13 +1,13 @@ -pub use brush::contracts::reentrancy_guard::*; -use brush::traits::{ +pub use openbrush::contracts::reentrancy_guard::*; +use openbrush::traits::{ AccountId, InkStorage, }; -#[brush::wrapper] +#[openbrush::wrapper] pub type FlipOnMeRef = dyn FlipOnMe; -#[brush::trait_definition] +#[openbrush::trait_definition] pub trait FlipOnMe: InkStorage { #[ink(message)] fn flip_on_me(&mut self) -> Result<(), ReentrancyGuardError> { diff --git a/examples/reentrancy_guard/traits/flipper.rs b/examples/reentrancy_guard/traits/flipper.rs index 6771ece39..5a8a398c3 100644 --- a/examples/reentrancy_guard/traits/flipper.rs +++ b/examples/reentrancy_guard/traits/flipper.rs @@ -1,5 +1,5 @@ -pub use brush::contracts::reentrancy_guard::*; -use brush::{ +pub use openbrush::contracts::reentrancy_guard::*; +use openbrush::{ modifiers, traits::AccountId, }; @@ -9,10 +9,10 @@ pub trait FlipperStorage { fn value_mut(&mut self) -> &mut bool; } -#[brush::wrapper] +#[openbrush::wrapper] pub type FlipperRef = dyn Flipper; -#[brush::trait_definition] +#[openbrush::trait_definition] pub trait Flipper: FlipperStorage + ReentrancyGuardStorage { #[ink(message)] fn get_value(&self) -> bool { @@ -20,7 +20,7 @@ pub trait Flipper: FlipperStorage + ReentrancyGuardStorage { } #[ink(message)] - #[brush::modifiers(non_reentrant)] + #[openbrush::modifiers(non_reentrant)] fn flip(&mut self) -> Result<(), ReentrancyGuardError> { *self.value_mut() = !self.value().clone(); Ok(()) diff --git a/examples/timelock_controller/Cargo.toml b/examples/timelock_controller/Cargo.toml index ecec40a09..b3eef410b 100644 --- a/examples/timelock_controller/Cargo.toml +++ b/examples/timelock_controller/Cargo.toml @@ -16,7 +16,7 @@ scale = { package = "parity-scale-codec", version = "3", default-features = fals scale-info = { version = "2", default-features = false, features = ["derive"], optional = true } # These dependencies -brush = { path = "../..", default-features = false, features = ["timelock_controller"] } +openbrush = { path = "../..", default-features = false, features = ["timelock_controller"] } [lib] name = "my_timelock_controller" @@ -39,7 +39,7 @@ std = [ "scale-info/std", # These dependencies - "brush/std", + "openbrush/std", ] ink-as-dependency = [] diff --git a/examples/timelock_controller/lib.rs b/examples/timelock_controller/lib.rs index 8ab986be6..7960df9ed 100644 --- a/examples/timelock_controller/lib.rs +++ b/examples/timelock_controller/lib.rs @@ -1,11 +1,11 @@ #![cfg_attr(not(feature = "std"), no_std)] #![feature(min_specialization)] -#[brush::contract] +#[openbrush::contract] pub mod my_timelock_controller { - use brush::contracts::timelock_controller::*; use ink_prelude::vec::Vec; use ink_storage::traits::SpreadAllocate; + use openbrush::contracts::timelock_controller::*; #[ink(storage)] #[derive(Default, SpreadAllocate, TimelockControllerStorage)] diff --git a/brush_lang/.gitignore b/lang/.gitignore similarity index 100% rename from brush_lang/.gitignore rename to lang/.gitignore diff --git a/brush_lang/Cargo.toml b/lang/Cargo.toml similarity index 56% rename from brush_lang/Cargo.toml rename to lang/Cargo.toml index 96f4e6d95..18103c598 100644 --- a/brush_lang/Cargo.toml +++ b/lang/Cargo.toml @@ -1,11 +1,20 @@ [package] -name = "brush_lang" +name = "openbrush_lang" version = "1.8.0" authors = ["Supercolony "] edition = "2021" +license = "MIT" +repository = "https://github.com/Supercolony-net/openbrush-contracts" +documentation = "https://docs.openbrush.io" +homepage = "https://supercolony.net" +description = "Aggregator of all openbrush functionality and utils." +keywords = ["wasm", "supercolony", "smart-contracts", "blockchain", "ink"] +categories = ["no-std", "embedded"] +include = ["Cargo.toml", "src/**/*.rs"] + [dependencies] -brush_lang_macro = { version = "1.8.0", path = "macro", default-features = false } +openbrush_lang_macro = { version = "1.8.0", path = "macro", default-features = false } ink_env = { version = "3.2.0", default-features = false } ink_lang = { version = "3.2.0", default-features = false } @@ -16,8 +25,8 @@ scale = { package = "parity-scale-codec", version = "3", default-features = fals scale-info = { version = "2", default-features = false, features = ["derive"] } [lib] -name = "brush_lang" -path = "lib.rs" +name = "openbrush_lang" +path = "src/lib.rs" crate-type = [ "rlib", ] @@ -25,7 +34,7 @@ crate-type = [ [features] default = ["std"] std = [ - "brush_lang_macro/std", + "openbrush_lang_macro/std", "ink_env/std", "ink_lang/std", "ink_primitives/std", diff --git a/brush_lang/codegen/.gitignore b/lang/codegen/.gitignore similarity index 100% rename from brush_lang/codegen/.gitignore rename to lang/codegen/.gitignore diff --git a/brush_lang/codegen/Cargo.toml b/lang/codegen/Cargo.toml similarity index 73% rename from brush_lang/codegen/Cargo.toml rename to lang/codegen/Cargo.toml index c9585356c..f20af36f4 100644 --- a/brush_lang/codegen/Cargo.toml +++ b/lang/codegen/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "brush_lang_codegen" +name = "openbrush_lang_codegen" version = "1.8.0" authors = ["Supercolony "] edition = "2021" @@ -8,10 +8,10 @@ license = "MIT" repository = "https://github.com/Supercolony-net/openbrush-contracts" documentation = "https://docs.openbrush.io" homepage = "https://supercolony.net" -description = "Brush codegeneration with new features for the ink!." -keywords = ["wasm", "supercolony", "webassembly", "blockchain", "edsl", "library", "ink"] +description = "OpenBrush codegeneration for macros in `openbrush_lang_macro`." +keywords = ["wasm", "supercolony", "smart-contracts", "blockchain", "ink"] categories = ["no-std", "embedded"] -include = ["Cargo.toml", "./**/*.rs"] +include = ["Cargo.toml", "src/**/*.rs"] [dependencies] syn = { version = "1", features = ["parsing", "full", "visit", "extra-traits"] } @@ -28,8 +28,8 @@ ink_lang_ir = { version = "3.2.0", default-features = false } synstructure = "0.12" [lib] -name = "brush_lang_codegen" -path = "lib.rs" +name = "openbrush_lang_codegen" +path = "src/lib.rs" crate-type = [ "rlib", ] diff --git a/brush_lang/codegen/contract.rs b/lang/codegen/src/contract.rs similarity index 97% rename from brush_lang/codegen/contract.rs rename to lang/codegen/src/contract.rs index 29aaf37a6..62bd4d216 100644 --- a/brush_lang/codegen/contract.rs +++ b/lang/codegen/src/contract.rs @@ -44,7 +44,7 @@ pub fn generate(_attrs: TokenStream, ink_module: TokenStream) -> TokenStream { None => { panic!( "{}", - "out-of-line brush modules are not supported, use `#[brush::contract] mod name {{ ... }}`", + "out-of-line openbrush modules are not supported, use `#[openbrush::contract] mod name {{ ... }}`", ) } }; diff --git a/brush_lang/codegen/internal.rs b/lang/codegen/src/internal.rs similarity index 99% rename from brush_lang/codegen/internal.rs rename to lang/codegen/src/internal.rs index d7797d64c..bfe4a50c6 100644 --- a/brush_lang/codegen/internal.rs +++ b/lang/codegen/src/internal.rs @@ -39,7 +39,7 @@ use syn::{ ItemImpl, }; -pub(crate) const BRUSH_PREFIX: &'static str = "__brush"; +pub(crate) const BRUSH_PREFIX: &'static str = "__openbrush"; pub(crate) struct MetaList { pub path: syn::Path, diff --git a/brush_lang/codegen/lib.rs b/lang/codegen/src/lib.rs similarity index 100% rename from brush_lang/codegen/lib.rs rename to lang/codegen/src/lib.rs diff --git a/brush_lang/codegen/metadata.rs b/lang/codegen/src/metadata.rs similarity index 98% rename from brush_lang/codegen/metadata.rs rename to lang/codegen/src/metadata.rs index 2a39cb0a0..884a08feb 100644 --- a/brush_lang/codegen/metadata.rs +++ b/lang/codegen/src/metadata.rs @@ -43,7 +43,7 @@ use syn::{ TraitItem, }; -const TEMP_FOLDER: &'static str = "__brush_metadata_folder"; +const TEMP_FOLDER: &'static str = "__openbrush_metadata_folder"; pub(crate) struct TraitDefinition(ItemTrait); diff --git a/brush_lang/codegen/modifier_definition.rs b/lang/codegen/src/modifier_definition.rs similarity index 100% rename from brush_lang/codegen/modifier_definition.rs rename to lang/codegen/src/modifier_definition.rs diff --git a/brush_lang/codegen/modifiers.rs b/lang/codegen/src/modifiers.rs similarity index 99% rename from brush_lang/codegen/modifiers.rs rename to lang/codegen/src/modifiers.rs index 65c34216e..bc8c36ab3 100644 --- a/brush_lang/codegen/modifiers.rs +++ b/lang/codegen/src/modifiers.rs @@ -40,7 +40,7 @@ use syn::{ ImplItemMethod, }; -const INSTANCE: &'static str = "__brush_instance_modifier"; +const INSTANCE: &'static str = "__openbrush_instance_modifier"; pub fn generate(_attrs: TokenStream, _input: TokenStream) -> TokenStream { let modifiers: AttributeArgs = parse2(_attrs).unwrap(); diff --git a/brush_lang/codegen/storage.rs b/lang/codegen/src/storage.rs similarity index 100% rename from brush_lang/codegen/storage.rs rename to lang/codegen/src/storage.rs diff --git a/brush_lang/codegen/trait_definition.rs b/lang/codegen/src/trait_definition.rs similarity index 98% rename from brush_lang/codegen/trait_definition.rs rename to lang/codegen/src/trait_definition.rs index 06e455aeb..807372dd8 100644 --- a/brush_lang/codegen/trait_definition.rs +++ b/lang/codegen/src/trait_definition.rs @@ -205,7 +205,7 @@ fn generate_wrapper(ink_trait: ItemTrait) -> proc_macro2::TokenStream { } }) .enumerate() - .map(|(n, _)| format_ident!("__brush_binding_{}", n)) + .map(|(n, _)| format_ident!("__openbrush_binding_{}", n)) .collect::>(); let input_types = method .sig @@ -297,7 +297,7 @@ fn generate_wrapper(ink_trait: ItemTrait) -> proc_macro2::TokenStream { #( #def_messages )* } - impl #trait_wrapper_ident for ::brush::traits::AccountId { + impl #trait_wrapper_ident for ::openbrush::traits::AccountId { #( #impl_messages )* } } diff --git a/brush_lang/codegen/wrapper.rs b/lang/codegen/src/wrapper.rs similarity index 98% rename from brush_lang/codegen/wrapper.rs rename to lang/codegen/src/wrapper.rs index d261a1828..f604b872d 100644 --- a/brush_lang/codegen/wrapper.rs +++ b/lang/codegen/src/wrapper.rs @@ -74,7 +74,7 @@ pub fn generate(_: TokenStream, input: TokenStream) -> TokenStream { union_trait = quote! { pub trait #union_ident : #bounds {} - impl #union_ident for ::brush::traits::AccountId {} + impl #union_ident for ::openbrush::traits::AccountId {} } } diff --git a/brush_lang/macro/.gitignore b/lang/macro/.gitignore similarity index 100% rename from brush_lang/macro/.gitignore rename to lang/macro/.gitignore diff --git a/brush_lang/macro/Cargo.toml b/lang/macro/Cargo.toml similarity index 55% rename from brush_lang/macro/Cargo.toml rename to lang/macro/Cargo.toml index b3a1ae463..753db518f 100644 --- a/brush_lang/macro/Cargo.toml +++ b/lang/macro/Cargo.toml @@ -1,11 +1,20 @@ [package] -name = "brush_lang_macro" +name = "openbrush_lang_macro" version = "1.8.0" authors = ["Supercolony "] edition = "2021" +license = "MIT" +repository = "https://github.com/Supercolony-net/openbrush-contracts" +documentation = "https://docs.openbrush.io" +homepage = "https://supercolony.net" +description = "OpenBrush macros to extend functionality of the ink!." +keywords = ["wasm", "supercolony", "smart-contracts", "blockchain", "ink"] +categories = ["no-std", "embedded"] +include = ["Cargo.toml", "src/**/*.rs"] + [dependencies] -brush_lang_codegen = { version = "1.8.0", path = "../codegen", default-features = false } +openbrush_lang_codegen = { version = "1.8.0", path = "../codegen", default-features = false } syn = "1" proc-macro2 = "1" synstructure = "0.12" @@ -21,15 +30,15 @@ ink_prelude = { version = "3.2.0", default-features = false } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2", default-features = false, features = ["derive"] } -brush = { package = "brush_lang", path = "..", default-features = false } +openbrush = { package = "openbrush_lang", path = "..", default-features = false } [lib] -name = "brush_lang_macro" -path = "lib.rs" +name = "openbrush_lang_macro" +path = "src/lib.rs" proc-macro = true [features] default = ["std"] std = [ - "brush_lang_codegen/std", + "openbrush_lang_codegen/std", ] \ No newline at end of file diff --git a/brush_lang/macro/lib.rs b/lang/macro/src/lib.rs similarity index 86% rename from brush_lang/macro/lib.rs rename to lang/macro/src/lib.rs index e946709e6..8148d8928 100644 --- a/brush_lang/macro/lib.rs +++ b/lang/macro/src/lib.rs @@ -23,7 +23,7 @@ use proc_macro::TokenStream; -use brush_lang_codegen::{ +use openbrush_lang_codegen::{ contract, modifier_definition, modifiers, @@ -32,27 +32,27 @@ use brush_lang_codegen::{ wrapper, }; -/// Entry point for use brush's macros in ink! smart contracts. +/// Entry point for use openbrush's macros in ink! smart contracts. /// /// # Description /// -/// The macro consumes brush's macros to simplify the usage of the library. +/// The macro consumes openbrush's macros to simplify the usage of the library. /// After consumption, it pastes ink! code and then ink!'s macros will be processed. /// -/// This macro consumes impl section for traits defined with [`#[brush::trait_definition]`](`macro@crate::trait_definition`). +/// This macro consumes impl section for traits defined with [`#[openbrush::trait_definition]`](`macro@crate::trait_definition`). #[proc_macro_attribute] pub fn contract(_attrs: TokenStream, ink_module: TokenStream) -> TokenStream { contract::generate(_attrs.into(), ink_module.into()).into() } -/// Defines extensible trait in the scope of brush::contract. +/// Defines extensible trait in the scope of openbrush::contract. /// It is a common rust trait, so you can use any features of rust inside of this trait. /// If this trait contains some methods marked with `#[ink(message)]` or `#[ink(constructor)]` attributes, /// this macro will extract these attributes and will put them into a separate trait /// (the separate trait only is used to call methods from the original trait), but the macro will not touch methods. /// /// This macro stores definition of the trait in a temporary file during build process. -/// Based on this definition [`#[brush::contract]`](`macro@crate::contract`) +/// Based on this definition [`#[openbrush::contract]`](`macro@crate::contract`) /// will generate implementation of additional traits. /// /// ** Note ** The name of the trait defined via this macro must be unique for the whole project. @@ -63,20 +63,20 @@ pub fn contract(_attrs: TokenStream, ink_module: TokenStream) -> TokenStream { /// ``` /// mod doc { /// use ink_prelude::collections::BTreeMap; -/// use brush::traits::{AccountId, Balance, InkStorage}; +/// use openbrush::traits::{AccountId, Balance, InkStorage}; /// /// #[derive(Default, Debug)] /// pub struct Data { /// pub balances: BTreeMap, /// } /// -/// #[brush::trait_definition] +/// #[openbrush::trait_definition] /// pub trait PSP22Storage: InkStorage { /// fn get(&self) -> &Data; /// fn get_mut(&mut self) -> &mut Data; /// } /// -/// #[brush::trait_definition] +/// #[openbrush::trait_definition] /// pub trait PSP22: PSP22Storage { /// /// Returns the account Balance for the specified `owner`. /// #[ink(message)] @@ -106,10 +106,10 @@ pub fn contract(_attrs: TokenStream, ink_module: TokenStream) -> TokenStream { /// It uses storage trait from above. /// /// ``` -/// #[brush::contract] +/// #[openbrush::contract] /// mod base_psp22 { /// use ink_prelude::collections::BTreeMap; -/// use brush::traits::InkStorage; +/// use openbrush::traits::InkStorage; /// use ink_storage::traits::StorageLayout; /// use ink_storage::traits::SpreadLayout; /// @@ -121,13 +121,13 @@ pub fn contract(_attrs: TokenStream, ink_module: TokenStream) -> TokenStream { /// pub allowances: BTreeMap<(AccountId, AccountId), Balance>, /// } /// -/// #[brush::trait_definition] +/// #[openbrush::trait_definition] /// pub trait PSP22ExampleStorage: InkStorage { /// fn get(&self) -> &Data; /// fn get_mut(&mut self) -> &mut Data; /// } /// -/// #[brush::trait_definition] +/// #[openbrush::trait_definition] /// pub trait PSP22Example: PSP22ExampleStorage { /// /// Returns the account Balance for the specified `owner`. /// #[ink(message)] @@ -215,7 +215,7 @@ pub fn trait_definition(_attrs: TokenStream, _input: TokenStream) -> TokenStream /// initialized: bool, /// } /// -/// #[brush::modifier_definition] +/// #[openbrush::modifier_definition] /// fn once(instance: &mut Contract, body: BodyFn, _example_data1: u8, _example_data2: u8) { /// assert!(!instance.initialized, "Contract is already initialized"); /// body(instance); @@ -241,7 +241,7 @@ pub fn modifier_definition(_attrs: TokenStream, _input: TokenStream) -> TokenStr /// /// Let's define next modifiers. /// ``` -/// #[brush::modifier_definition] +/// #[openbrush::modifier_definition] /// fn A(instance: &T, body: impl FnOnce(&T) -> &'static str) -> &'static str { /// println!("A before"); /// let result = body(instance); @@ -249,7 +249,7 @@ pub fn modifier_definition(_attrs: TokenStream, _input: TokenStream) -> TokenStr /// result /// } /// -/// #[brush::modifier_definition] +/// #[openbrush::modifier_definition] /// fn B &'static str>(instance: &T, body: F, data1: u8, data2: u8) -> &'static str { /// println!("B before {} {}", data1, data2); /// let result = body(instance); @@ -257,7 +257,7 @@ pub fn modifier_definition(_attrs: TokenStream, _input: TokenStream) -> TokenStr /// result /// } /// -/// #[brush::modifier_definition] +/// #[openbrush::modifier_definition] /// fn C(instance: &T, body: F) -> &'static str /// where F: FnOnce(&T) -> &'static str /// { @@ -270,7 +270,7 @@ pub fn modifier_definition(_attrs: TokenStream, _input: TokenStream) -> TokenStr /// struct Contract {} /// /// impl Contract { -/// #[brush::modifiers(A, B(_data, 13), C)] +/// #[openbrush::modifiers(A, B(_data, 13), C)] /// fn main_logic(&self, _data: u8) -> &'static str { /// return "Return value"; /// } @@ -278,7 +278,7 @@ pub fn modifier_definition(_attrs: TokenStream, _input: TokenStream) -> TokenStr /// ``` /// The code above will be expanded into: /// ``` -/// #[brush::modifier_definition] +/// #[openbrush::modifier_definition] /// fn A(instance: &T, body: impl FnOnce(&T) -> &'static str) -> &'static str { /// println!("A before"); /// let result = body(instance); @@ -286,7 +286,7 @@ pub fn modifier_definition(_attrs: TokenStream, _input: TokenStream) -> TokenStr /// result /// } /// -/// #[brush::modifier_definition] +/// #[openbrush::modifier_definition] /// fn B &'static str>(instance: &T, body: F, data1: u8, data2: u8) -> &'static str { /// println!("B before {} {}", data1, data2); /// let result = body(instance); @@ -294,7 +294,7 @@ pub fn modifier_definition(_attrs: TokenStream, _input: TokenStream) -> TokenStr /// result /// } /// -/// #[brush::modifier_definition] +/// #[openbrush::modifier_definition] /// fn C(instance: &T, body: F) -> &'static str /// where F: FnOnce(&T) -> &'static str /// { @@ -308,16 +308,16 @@ pub fn modifier_definition(_attrs: TokenStream, _input: TokenStream) -> TokenStr /// /// impl Contract { /// fn main_logic(&self, _data: u8) -> &'static str { -/// let mut __brush_body_2 = |__brush_instance_modifier: &Self| { -/// let __brush_cloned_0 = _data.clone(); -/// let __brush_cloned_1 = 13.clone(); -/// let mut __brush_body_1 = |__brush_instance_modifier: &Self| { -/// let mut __brush_body_0 = |__brush_instance_modifier: &Self| return "Return value";; -/// C(__brush_instance_modifier, __brush_body_0) +/// let mut __openbrush_body_2 = |__openbrush_instance_modifier: &Self| { +/// let __openbrush_cloned_0 = _data.clone(); +/// let __openbrush_cloned_1 = 13.clone(); +/// let mut __openbrush_body_1 = |__openbrush_instance_modifier: &Self| { +/// let mut __openbrush_body_0 = |__openbrush_instance_modifier: &Self| return "Return value";; +/// C(__openbrush_instance_modifier, __openbrush_body_0) /// }; -/// B(__brush_instance_modifier, __brush_body_1, __brush_cloned_0, __brush_cloned_1) +/// B(__openbrush_instance_modifier, __openbrush_body_1, __openbrush_cloned_0, __openbrush_cloned_1) /// }; -/// A(self, __brush_body_2) +/// A(self, __openbrush_body_2) /// } /// } /// ``` @@ -325,7 +325,7 @@ pub fn modifier_definition(_attrs: TokenStream, _input: TokenStream) -> TokenStr /// # Example: Usage /// /// ``` -/// #[brush::contract] +/// #[openbrush::contract] /// mod example { /// #[ink(storage)] /// #[derive(Default)] @@ -334,7 +334,7 @@ pub fn modifier_definition(_attrs: TokenStream, _input: TokenStream) -> TokenStr /// owner: AccountId, /// } /// -/// #[brush::modifier_definition] +/// #[openbrush::modifier_definition] /// fn once(instance: &mut Contract, body: impl FnOnce(&mut Contract)) { /// assert!(!instance.initialized, "Contract is already initialized"); /// body(instance); @@ -348,7 +348,7 @@ pub fn modifier_definition(_attrs: TokenStream, _input: TokenStream) -> TokenStr /// } /// /// #[ink(message)] -/// #[brush::modifiers(once)] +/// #[openbrush::modifiers(once)] /// pub fn init(&mut self, owner: AccountId) { /// self.owner = owner; /// } @@ -361,12 +361,12 @@ pub fn modifiers(_attrs: TokenStream, method: TokenStream) -> TokenStream { } /// This macro allows you to define a wrapper type for traits defined via -/// [`#[brush::trait_definition]`](`macro@crate::trait_definition`). +/// [`#[openbrush::trait_definition]`](`macro@crate::trait_definition`). /// It is a wrapper for `AccountId` that knows how to do cross-contract calls to another contract. /// /// To define a wrapper you need to use the follow construction: /// `type TraitName = dyn Trait_1 + Trait_2 ... + Trait_n`, where `Trait_i` contains ink! messages -/// and defined via [`#[brush::trait_definition]`](`macro@crate::trait_definition`). +/// and defined via [`#[openbrush::trait_definition]`](`macro@crate::trait_definition`). /// If `Trait_i` doesn't contain ink! messages, then you don't need to create a wrapper for that trait, /// because the wrapped methods are created only for ink! messages. Otherwise, you will get an error like /// @@ -382,26 +382,26 @@ pub fn modifiers(_attrs: TokenStream, method: TokenStream) -> TokenStream { /// /// ```should_panic /// { -/// use brush::traits::AccountId; +/// use openbrush::traits::AccountId; /// -/// #[brush::trait_definition] +/// #[openbrush::trait_definition] /// pub trait Trait1 { /// #[ink(message)] /// fn foo(&mut self) -> bool; /// } /// -/// #[brush::wrapper] +/// #[openbrush::wrapper] /// type Trait1Ref = dyn Trait1; /// -/// #[brush::trait_definition] +/// #[openbrush::trait_definition] /// pub trait Trait2 { /// #[ink(message)] -/// fn bar(&mut self, callee: brush::traits::AccountId) { +/// fn bar(&mut self, callee: openbrush::traits::AccountId) { /// let foo_bool = Trait1Ref::foo(&callee); /// } /// } /// -/// #[brush::wrapper] +/// #[openbrush::wrapper] /// type Trait1and2Ref = dyn Trait1 + Trait2; /// /// // Example of explicit call @@ -435,18 +435,18 @@ synstructure::decl_attribute!( /// # Example: /// ``` /// { - /// use brush::traits::AccountId; - /// pub const STORAGE_KEY: [u8; 32] = ink_lang::blake2x256!("brush::OwnableData"); + /// use openbrush::traits::AccountId; + /// pub const STORAGE_KEY: [u8; 32] = ink_lang::blake2x256!("openbrush::OwnableData"); /// /// #[derive(Default, Debug)] - /// #[brush::storage(STORAGE_KEY)] + /// #[openbrush::storage(STORAGE_KEY)] /// pub struct OwnableData { /// pub owner: AccountId, /// pub _reserved: Option<()>, /// } /// /// #[derive(Default, Debug)] - /// #[brush::storage(ink_lang::blake2x256!("brush::ProxyData"))] + /// #[openbrush::storage(ink_lang::blake2x256!("openbrush::ProxyData"))] /// pub struct ProxyData { /// pub forward: AccountId, /// pub _reserved: Option<()>, diff --git a/brush_lang/derive.rs b/lang/src/derive.rs similarity index 100% rename from brush_lang/derive.rs rename to lang/src/derive.rs diff --git a/brush_lang/lib.rs b/lang/src/lib.rs similarity index 97% rename from brush_lang/lib.rs rename to lang/src/lib.rs index 613fd95e1..0f44d3e57 100644 --- a/brush_lang/lib.rs +++ b/lang/src/lib.rs @@ -26,7 +26,7 @@ mod macros; pub mod test_utils; pub mod traits; -pub use brush_lang_macro::{ +pub use openbrush_lang_macro::{ contract, modifier_definition, modifiers, diff --git a/brush_lang/macro/macros.rs b/lang/src/macros.rs similarity index 97% rename from brush_lang/macro/macros.rs rename to lang/src/macros.rs index 065a6ced9..3d290928e 100644 --- a/brush_lang/macro/macros.rs +++ b/lang/src/macros.rs @@ -29,7 +29,7 @@ #[macro_export] macro_rules! declare_storage_trait { ($trait_name:ident,$data_ty:ty) => { - pub trait $trait_name: ::brush::traits::InkStorage { + pub trait $trait_name: ::openbrush::traits::InkStorage { fn get(&self) -> &$data_ty; fn get_mut(&mut self) -> &mut $data_ty; } diff --git a/brush_lang/test_utils.rs b/lang/src/test_utils.rs similarity index 100% rename from brush_lang/test_utils.rs rename to lang/src/test_utils.rs diff --git a/brush_lang/traits.rs b/lang/src/traits.rs similarity index 100% rename from brush_lang/traits.rs rename to lang/src/traits.rs diff --git a/lib.rs b/lib.rs index 0ccc0453e..1bbd7d9ef 100644 --- a/lib.rs +++ b/lib.rs @@ -21,5 +21,5 @@ #![cfg_attr(not(feature = "std"), no_std)] -pub use brush_lang::*; -pub use contracts; +pub use openbrush_lang::*; +pub use openbrush_contracts as contract; diff --git a/mock/flash-borrower/Cargo.toml b/mock/flash-borrower/Cargo.toml index 4c64baea5..22e7ff93b 100644 --- a/mock/flash-borrower/Cargo.toml +++ b/mock/flash-borrower/Cargo.toml @@ -16,7 +16,7 @@ scale = { package = "parity-scale-codec", version = "3", default-features = fals scale-info = { version = "2", default-features = false, features = ["derive"], optional = true } # These dependencies -brush = { path = "../..", default-features = false, features = ["psp22"] } +openbrush = { path = "../..", default-features = false, features = ["psp22"] } [lib] name = "flash_borrower" @@ -37,7 +37,7 @@ std = [ "scale/std", "scale-info", "scale-info/std", - "brush/std", + "openbrush/std", ] ink-as-dependency = [] diff --git a/mock/flash-borrower/lib.rs b/mock/flash-borrower/lib.rs index fd6d2bc85..ae65643c8 100644 --- a/mock/flash-borrower/lib.rs +++ b/mock/flash-borrower/lib.rs @@ -1,13 +1,13 @@ #![cfg_attr(not(feature = "std"), no_std)] -#[brush::contract] +#[openbrush::contract] pub mod flash_borrower { - use brush::contracts::psp22::extensions::flashmint::*; use ink_lang::codegen::Env; use ink_prelude::{ string::String, vec::Vec, }; + use openbrush::contracts::psp22::extensions::flashmint::*; #[ink(storage)] pub struct FlashBorrowerStruct {} diff --git a/mock/psp1155-receiver/Cargo.toml b/mock/psp1155-receiver/Cargo.toml index fe9898944..2ff34c7eb 100644 --- a/mock/psp1155-receiver/Cargo.toml +++ b/mock/psp1155-receiver/Cargo.toml @@ -16,7 +16,7 @@ scale = { package = "parity-scale-codec", version = "3", default-features = fals scale-info = { version = "2", default-features = false, features = ["derive"], optional = true } # These dependencies -brush = { path = "../..", default-features = false, features = ["psp1155"] } +openbrush = { path = "../..", default-features = false, features = ["psp1155"] } [lib] name = "psp1155_receiver" @@ -37,7 +37,7 @@ std = [ "scale/std", "scale-info", "scale-info/std", - "brush/std", + "openbrush/std", ] ink-as-dependency = [] diff --git a/mock/psp1155-receiver/lib.rs b/mock/psp1155-receiver/lib.rs index 98034e373..277e7bcf4 100644 --- a/mock/psp1155-receiver/lib.rs +++ b/mock/psp1155-receiver/lib.rs @@ -1,8 +1,8 @@ #![cfg_attr(not(feature = "std"), no_std)] -#[brush::contract] +#[openbrush::contract] pub mod erc1155_receiver { - use brush::contracts::traits::psp1155::*; + use openbrush::contracts::traits::psp1155::*; use ink_prelude::{ string::String, vec::Vec, diff --git a/mock/psp22-receiver/Cargo.toml b/mock/psp22-receiver/Cargo.toml index 4d06fefcf..72c52ce01 100644 --- a/mock/psp22-receiver/Cargo.toml +++ b/mock/psp22-receiver/Cargo.toml @@ -16,7 +16,7 @@ scale = { package = "parity-scale-codec", version = "3", default-features = fals scale-info = { version = "2", default-features = false, features = ["derive"], optional = true } # These dependencies -brush = { path = "../..", default-features = false, features = ["psp22"] } +openbrush = { path = "../..", default-features = false, features = ["psp22"] } [lib] name = "psp22_receiver" @@ -37,7 +37,7 @@ std = [ "scale/std", "scale-info", "scale-info/std", - "brush/std", + "openbrush/std", ] ink-as-dependency = [] diff --git a/mock/psp22-receiver/lib.rs b/mock/psp22-receiver/lib.rs index dc2d84490..fcd74705b 100644 --- a/mock/psp22-receiver/lib.rs +++ b/mock/psp22-receiver/lib.rs @@ -1,12 +1,12 @@ #![cfg_attr(not(feature = "std"), no_std)] -#[brush::contract] +#[openbrush::contract] pub mod erc20_receiver { - use brush::contracts::traits::psp22::*; use ink_prelude::{ string::String, vec::Vec, }; + use openbrush::contracts::traits::psp22::*; #[ink(storage)] pub struct PSP22ReceiverStruct { diff --git a/mock/psp34-receiver/Cargo.toml b/mock/psp34-receiver/Cargo.toml index 64f420298..5b730668a 100644 --- a/mock/psp34-receiver/Cargo.toml +++ b/mock/psp34-receiver/Cargo.toml @@ -16,7 +16,7 @@ scale = { package = "parity-scale-codec", version = "3", default-features = fals scale-info = { version = "2", default-features = false, features = ["derive"], optional = true } # These dependencies -brush = { path = "../..", default-features = false, features = ["psp34"] } +openbrush = { path = "../..", default-features = false, features = ["psp34"] } [lib] name = "psp34_receiver" @@ -37,7 +37,7 @@ std = [ "scale/std", "scale-info", "scale-info/std", - "brush/std", + "openbrush/std", ] ink-as-dependency = [] diff --git a/mock/psp34-receiver/lib.rs b/mock/psp34-receiver/lib.rs index f15e95559..20387ed1f 100644 --- a/mock/psp34-receiver/lib.rs +++ b/mock/psp34-receiver/lib.rs @@ -1,8 +1,8 @@ #![cfg_attr(not(feature = "std"), no_std)] -#[brush::contract] +#[openbrush::contract] pub mod erc721_receiver { - use brush::contracts::traits::psp34::*; + use openbrush::contracts::traits::psp34::*; use ink_prelude::{ string::String, vec::Vec, diff --git a/contracts/tests/access_control.rs b/tests/access_control.rs similarity index 99% rename from contracts/tests/access_control.rs rename to tests/access_control.rs index 743804f4f..ad9c02d35 100644 --- a/contracts/tests/access_control.rs +++ b/tests/access_control.rs @@ -21,14 +21,14 @@ #![feature(min_specialization)] #[cfg(feature = "access_control")] -#[brush::contract] +#[openbrush::contract] mod access_control { use ::ink_env::DefaultEnvironment; - use brush::test_utils::{ + use openbrush::test_utils::{ accounts, change_caller, }; - use contracts::access_control::*; + use openbrush::contracts::access_control::*; use ink_env::test::DefaultAccounts; use ink_lang as ink; diff --git a/tests/access-control.tests.ts b/tests/e2e/access-control.tests.ts similarity index 100% rename from tests/access-control.tests.ts rename to tests/e2e/access-control.tests.ts diff --git a/tests/constants.ts b/tests/e2e/constants.ts similarity index 100% rename from tests/constants.ts rename to tests/e2e/constants.ts diff --git a/tests/example_project_structure/lending_contract.tests.ts b/tests/e2e/example_project_structure/lending_contract.tests.ts similarity index 100% rename from tests/example_project_structure/lending_contract.tests.ts rename to tests/e2e/example_project_structure/lending_contract.tests.ts diff --git a/tests/helpers.ts b/tests/e2e/helpers.ts similarity index 100% rename from tests/helpers.ts rename to tests/e2e/helpers.ts diff --git a/tests/ownable.tests.ts b/tests/e2e/ownable.tests.ts similarity index 100% rename from tests/ownable.tests.ts rename to tests/e2e/ownable.tests.ts diff --git a/tests/pausable.tests.ts b/tests/e2e/pausable.tests.ts similarity index 100% rename from tests/pausable.tests.ts rename to tests/e2e/pausable.tests.ts diff --git a/tests/payment-splitter.tests.ts b/tests/e2e/payment-splitter.tests.ts similarity index 100% rename from tests/payment-splitter.tests.ts rename to tests/e2e/payment-splitter.tests.ts diff --git a/tests/psp1155/extensions/burnable.tests.ts b/tests/e2e/psp1155/extensions/burnable.tests.ts similarity index 100% rename from tests/psp1155/extensions/burnable.tests.ts rename to tests/e2e/psp1155/extensions/burnable.tests.ts diff --git a/tests/psp1155/extensions/metadata.tests.ts b/tests/e2e/psp1155/extensions/metadata.tests.ts similarity index 100% rename from tests/psp1155/extensions/metadata.tests.ts rename to tests/e2e/psp1155/extensions/metadata.tests.ts diff --git a/tests/psp1155/extensions/mintable.tests.ts b/tests/e2e/psp1155/extensions/mintable.tests.ts similarity index 100% rename from tests/psp1155/extensions/mintable.tests.ts rename to tests/e2e/psp1155/extensions/mintable.tests.ts diff --git a/tests/psp1155/psp1155.tests.ts b/tests/e2e/psp1155/psp1155.tests.ts similarity index 100% rename from tests/psp1155/psp1155.tests.ts rename to tests/e2e/psp1155/psp1155.tests.ts diff --git a/tests/psp22/extensions/burnable.tests.ts b/tests/e2e/psp22/extensions/burnable.tests.ts similarity index 100% rename from tests/psp22/extensions/burnable.tests.ts rename to tests/e2e/psp22/extensions/burnable.tests.ts diff --git a/tests/psp22/extensions/capped.tests.ts b/tests/e2e/psp22/extensions/capped.tests.ts similarity index 100% rename from tests/psp22/extensions/capped.tests.ts rename to tests/e2e/psp22/extensions/capped.tests.ts diff --git a/tests/psp22/extensions/flashmint.tests.ts b/tests/e2e/psp22/extensions/flashmint.tests.ts similarity index 100% rename from tests/psp22/extensions/flashmint.tests.ts rename to tests/e2e/psp22/extensions/flashmint.tests.ts diff --git a/tests/psp22/extensions/metadata.tests.ts b/tests/e2e/psp22/extensions/metadata.tests.ts similarity index 100% rename from tests/psp22/extensions/metadata.tests.ts rename to tests/e2e/psp22/extensions/metadata.tests.ts diff --git a/tests/psp22/extensions/mintable.tests.ts b/tests/e2e/psp22/extensions/mintable.tests.ts similarity index 100% rename from tests/psp22/extensions/mintable.tests.ts rename to tests/e2e/psp22/extensions/mintable.tests.ts diff --git a/tests/psp22/extensions/pausable.tests.ts b/tests/e2e/psp22/extensions/pausable.tests.ts similarity index 100% rename from tests/psp22/extensions/pausable.tests.ts rename to tests/e2e/psp22/extensions/pausable.tests.ts diff --git a/tests/psp22/extensions/wrapper.ts b/tests/e2e/psp22/extensions/wrapper.ts similarity index 100% rename from tests/psp22/extensions/wrapper.ts rename to tests/e2e/psp22/extensions/wrapper.ts diff --git a/tests/psp22/psp22.tests.ts b/tests/e2e/psp22/psp22.tests.ts similarity index 100% rename from tests/psp22/psp22.tests.ts rename to tests/e2e/psp22/psp22.tests.ts diff --git a/tests/psp22/utils/token_timelock.tests.ts b/tests/e2e/psp22/utils/token_timelock.tests.ts similarity index 100% rename from tests/psp22/utils/token_timelock.tests.ts rename to tests/e2e/psp22/utils/token_timelock.tests.ts diff --git a/tests/psp34/extensions/burnable.tests.ts b/tests/e2e/psp34/extensions/burnable.tests.ts similarity index 100% rename from tests/psp34/extensions/burnable.tests.ts rename to tests/e2e/psp34/extensions/burnable.tests.ts diff --git a/tests/psp34/extensions/enumerable.tests.ts b/tests/e2e/psp34/extensions/enumerable.tests.ts similarity index 100% rename from tests/psp34/extensions/enumerable.tests.ts rename to tests/e2e/psp34/extensions/enumerable.tests.ts diff --git a/tests/psp34/extensions/metadata.tests.ts b/tests/e2e/psp34/extensions/metadata.tests.ts similarity index 100% rename from tests/psp34/extensions/metadata.tests.ts rename to tests/e2e/psp34/extensions/metadata.tests.ts diff --git a/tests/psp34/extensions/mintable.tests.ts b/tests/e2e/psp34/extensions/mintable.tests.ts similarity index 100% rename from tests/psp34/extensions/mintable.tests.ts rename to tests/e2e/psp34/extensions/mintable.tests.ts diff --git a/tests/psp34/psp34.tests.ts b/tests/e2e/psp34/psp34.tests.ts similarity index 100% rename from tests/psp34/psp34.tests.ts rename to tests/e2e/psp34/psp34.tests.ts diff --git a/tests/reentrancy-guard.tests.ts b/tests/e2e/reentrancy-guard.tests.ts similarity index 100% rename from tests/reentrancy-guard.tests.ts rename to tests/e2e/reentrancy-guard.tests.ts diff --git a/tests/setup/chai.ts b/tests/e2e/setup/chai.ts similarity index 100% rename from tests/setup/chai.ts rename to tests/e2e/setup/chai.ts diff --git a/tests/timelock-controller.tests.ts b/tests/e2e/timelock-controller.tests.ts similarity index 100% rename from tests/timelock-controller.tests.ts rename to tests/e2e/timelock-controller.tests.ts diff --git a/tests/upgradability/diamond_psp22.tests.ts b/tests/e2e/upgradability/diamond_psp22.tests.ts similarity index 100% rename from tests/upgradability/diamond_psp22.tests.ts rename to tests/e2e/upgradability/diamond_psp22.tests.ts diff --git a/tests/upgradability/proxy_psp22.tests.ts b/tests/e2e/upgradability/proxy_psp22.tests.ts similarity index 100% rename from tests/upgradability/proxy_psp22.tests.ts rename to tests/e2e/upgradability/proxy_psp22.tests.ts diff --git a/contracts/tests/ownable.rs b/tests/ownable.rs similarity index 98% rename from contracts/tests/ownable.rs rename to tests/ownable.rs index d9a5b2590..740c75bdc 100644 --- a/contracts/tests/ownable.rs +++ b/tests/ownable.rs @@ -21,13 +21,13 @@ #![feature(min_specialization)] #[cfg(feature = "ownable")] -#[brush::contract] +#[openbrush::contract] mod ownable { - use brush::{ + use openbrush::{ test_utils::change_caller, traits::AccountIdExt, }; - use contracts::ownable::*; + use openbrush::contracts::ownable::*; use ink::codegen::{ EmitEvent, Env, diff --git a/contracts/tests/pausable.rs b/tests/pausable.rs similarity index 97% rename from contracts/tests/pausable.rs rename to tests/pausable.rs index 861584f1b..44bfd2070 100644 --- a/contracts/tests/pausable.rs +++ b/tests/pausable.rs @@ -21,11 +21,11 @@ #![feature(min_specialization)] #[cfg(feature = "pausable")] -#[brush::contract] +#[openbrush::contract] mod pausable { use ::ink_env::DefaultEnvironment; - use brush::test_utils::accounts; - use contracts::pausable::*; + use openbrush::test_utils::accounts; + use openbrush::contracts::pausable::*; use ink_env::test::DefaultAccounts; use ink_lang as ink; @@ -61,7 +61,7 @@ mod pausable { } #[ink(message)] - #[brush::modifiers(when_paused)] + #[openbrush::modifiers(when_paused)] pub fn flip(&mut self) -> Result { let previous = self.flipped; self.flipped = !previous; diff --git a/contracts/tests/payment_splitter.rs b/tests/payment_splitter.rs similarity index 98% rename from contracts/tests/payment_splitter.rs rename to tests/payment_splitter.rs index a0319de04..f323fd554 100644 --- a/contracts/tests/payment_splitter.rs +++ b/tests/payment_splitter.rs @@ -21,10 +21,10 @@ #![feature(min_specialization)] #[cfg(feature = "payment_splitter")] -#[brush::contract] +#[openbrush::contract] mod payment_splitter { - use brush::test_utils::accounts; - use contracts::payment_splitter::*; + use openbrush::test_utils::accounts; + use openbrush::contracts::payment_splitter::*; use ink_lang as ink; use ink_storage::traits::SpreadAllocate; diff --git a/contracts/tests/proxy.rs b/tests/proxy.rs similarity index 98% rename from contracts/tests/proxy.rs rename to tests/proxy.rs index f8ad842b8..791f69aa9 100644 --- a/contracts/tests/proxy.rs +++ b/tests/proxy.rs @@ -21,10 +21,10 @@ #![feature(min_specialization)] #[cfg(feature = "proxy")] -#[brush::contract] +#[openbrush::contract] mod proxy { - use brush::test_utils::change_caller; - use contracts::{ + use openbrush::test_utils::change_caller; + use openbrush::contracts::{ ownable::*, proxy::*, }; diff --git a/contracts/tests/psp1155.rs b/tests/psp1155.rs similarity index 99% rename from contracts/tests/psp1155.rs rename to tests/psp1155.rs index 0afa1059b..1448b08d2 100644 --- a/contracts/tests/psp1155.rs +++ b/tests/psp1155.rs @@ -21,13 +21,13 @@ #![feature(min_specialization)] #[cfg(feature = "psp1155")] -#[brush::contract] +#[openbrush::contract] mod psp1155 { - use brush::test_utils::{ + use openbrush::test_utils::{ accounts, change_caller, }; - use contracts::psp1155::*; + use openbrush::contracts::psp1155::*; use ink::codegen::{ EmitEvent, Env, diff --git a/contracts/tests/psp1155_burnable.rs b/tests/psp1155_burnable.rs similarity index 97% rename from contracts/tests/psp1155_burnable.rs rename to tests/psp1155_burnable.rs index 73e554a68..5e069038d 100644 --- a/contracts/tests/psp1155_burnable.rs +++ b/tests/psp1155_burnable.rs @@ -21,10 +21,10 @@ #![feature(min_specialization)] #[cfg(feature = "psp1155")] -#[brush::contract] +#[openbrush::contract] mod psp1155_burnable { - use brush::test_utils::accounts; - use contracts::psp1155::extensions::burnable::*; + use openbrush::test_utils::accounts; + use openbrush::contracts::psp1155::extensions::burnable::*; use ink_lang as ink; #[derive(Default, PSP1155Storage)] diff --git a/contracts/tests/psp1155_metadata.rs b/tests/psp1155_metadata.rs similarity index 95% rename from contracts/tests/psp1155_metadata.rs rename to tests/psp1155_metadata.rs index 1a0c48837..c3a6691cc 100644 --- a/contracts/tests/psp1155_metadata.rs +++ b/tests/psp1155_metadata.rs @@ -21,9 +21,9 @@ #![feature(min_specialization)] #[cfg(feature = "psp1155")] -#[brush::contract] +#[openbrush::contract] mod psp1155_metadata { - use contracts::psp1155::extensions::metadata::*; + use openbrush::contracts::psp1155::extensions::metadata::*; use ink_lang as ink; #[derive(Default, PSP1155Storage, PSP1155MetadataStorage)] diff --git a/contracts/tests/psp1155_mintable.rs b/tests/psp1155_mintable.rs similarity index 97% rename from contracts/tests/psp1155_mintable.rs rename to tests/psp1155_mintable.rs index 23737953c..cf2a19451 100644 --- a/contracts/tests/psp1155_mintable.rs +++ b/tests/psp1155_mintable.rs @@ -21,10 +21,10 @@ #![feature(min_specialization)] #[cfg(feature = "psp1155")] -#[brush::contract] +#[openbrush::contract] mod psp1155_mintable { - use brush::test_utils::accounts; - use contracts::psp1155::extensions::mintable::*; + use openbrush::test_utils::accounts; + use openbrush::contracts::psp1155::extensions::mintable::*; use ink_lang as ink; #[derive(Default, PSP1155Storage)] diff --git a/contracts/tests/psp22.rs b/tests/psp22.rs similarity index 99% rename from contracts/tests/psp22.rs rename to tests/psp22.rs index 35757e702..3c3c22793 100644 --- a/contracts/tests/psp22.rs +++ b/tests/psp22.rs @@ -21,10 +21,10 @@ #![feature(min_specialization)] #[cfg(feature = "psp22")] -#[brush::contract] +#[openbrush::contract] mod psp22 { - use brush::test_utils::*; - use contracts::psp22::*; + use openbrush::test_utils::*; + use openbrush::contracts::psp22::*; use ink::codegen::{ EmitEvent, Env, diff --git a/contracts/tests/psp22_burnable.rs b/tests/psp22_burnable.rs similarity index 98% rename from contracts/tests/psp22_burnable.rs rename to tests/psp22_burnable.rs index 0d7cbda2d..39605ad50 100644 --- a/contracts/tests/psp22_burnable.rs +++ b/tests/psp22_burnable.rs @@ -21,10 +21,10 @@ #![feature(min_specialization)] #[cfg(feature = "psp22")] -#[brush::contract] +#[openbrush::contract] mod psp22_burnable { - use brush::test_utils::*; - use contracts::psp22::extensions::burnable::*; + use openbrush::test_utils::*; + use openbrush::contracts::psp22::extensions::burnable::*; use ink::codegen::{ EmitEvent, Env, diff --git a/contracts/tests/psp22_flashmint.rs b/tests/psp22_flashmint.rs similarity index 97% rename from contracts/tests/psp22_flashmint.rs rename to tests/psp22_flashmint.rs index 39be59aeb..2ca80dd55 100644 --- a/contracts/tests/psp22_flashmint.rs +++ b/tests/psp22_flashmint.rs @@ -21,10 +21,10 @@ #![feature(min_specialization)] #[cfg(feature = "psp22")] -#[brush::contract] +#[openbrush::contract] mod psp22_flashmint { - use brush::test_utils::accounts; - use contracts::psp22::extensions::flashmint::*; + use openbrush::test_utils::accounts; + use openbrush::contracts::psp22::extensions::flashmint::*; use ink_lang as ink; use ink_lang::codegen::Env; diff --git a/contracts/tests/psp22_metadata.rs b/tests/psp22_metadata.rs similarity index 96% rename from contracts/tests/psp22_metadata.rs rename to tests/psp22_metadata.rs index a21b3121e..641fd0438 100644 --- a/contracts/tests/psp22_metadata.rs +++ b/tests/psp22_metadata.rs @@ -21,10 +21,10 @@ #![feature(min_specialization)] #[cfg(feature = "psp22")] -#[brush::contract] +#[openbrush::contract] mod psp22_metadata { /// Imports all the definitions from the outer scope so we can use them here. - use contracts::psp22::extensions::metadata::*; + use openbrush::contracts::psp22::extensions::metadata::*; use ink_lang as ink; /// A simple PSP-20 contract. diff --git a/contracts/tests/psp22_mintable.rs b/tests/psp22_mintable.rs similarity index 98% rename from contracts/tests/psp22_mintable.rs rename to tests/psp22_mintable.rs index 1fadb9000..4cbe75e19 100644 --- a/contracts/tests/psp22_mintable.rs +++ b/tests/psp22_mintable.rs @@ -21,10 +21,10 @@ #![feature(min_specialization)] #[cfg(feature = "psp22")] -#[brush::contract] +#[openbrush::contract] mod psp22_mintable { - use brush::test_utils::*; - use contracts::psp22::extensions::mintable::*; + use openbrush::test_utils::*; + use openbrush::contracts::psp22::extensions::mintable::*; use ink::codegen::{ EmitEvent, Env, diff --git a/contracts/tests/psp22_token_timelock.rs b/tests/psp22_token_timelock.rs similarity index 97% rename from contracts/tests/psp22_token_timelock.rs rename to tests/psp22_token_timelock.rs index 245cb50a9..b8b389dc5 100644 --- a/contracts/tests/psp22_token_timelock.rs +++ b/tests/psp22_token_timelock.rs @@ -21,10 +21,10 @@ #![feature(min_specialization)] #[cfg(feature = "psp22")] -#[brush::contract] +#[openbrush::contract] mod psp22_timelock { - use brush::test_utils::accounts; - use contracts::psp22::utils::token_timelock::*; + use openbrush::test_utils::accounts; + use openbrush::contracts::psp22::utils::token_timelock::*; use ink_lang as ink; #[ink(storage)] diff --git a/contracts/tests/psp22_wrapper.rs b/tests/psp22_wrapper.rs similarity index 97% rename from contracts/tests/psp22_wrapper.rs rename to tests/psp22_wrapper.rs index 1e54fcd43..329216787 100644 --- a/contracts/tests/psp22_wrapper.rs +++ b/tests/psp22_wrapper.rs @@ -21,10 +21,10 @@ #![feature(min_specialization)] #[cfg(feature = "psp22")] -#[brush::contract] +#[openbrush::contract] mod psp22_wrapper { - use brush::test_utils::accounts; - use contracts::psp22::extensions::wrapper::*; + use openbrush::test_utils::accounts; + use openbrush::contracts::psp22::extensions::wrapper::*; use ink_lang as ink; #[ink(storage)] diff --git a/contracts/tests/psp34.rs b/tests/psp34.rs similarity index 99% rename from contracts/tests/psp34.rs rename to tests/psp34.rs index b028ef4d2..c858c2874 100644 --- a/contracts/tests/psp34.rs +++ b/tests/psp34.rs @@ -21,13 +21,13 @@ #![feature(min_specialization)] #[cfg(feature = "psp34")] -#[brush::contract] +#[openbrush::contract] mod psp34 { - use brush::test_utils::{ + use openbrush::test_utils::{ accounts, change_caller, }; - use contracts::psp34::*; + use openbrush::contracts::psp34::*; use ink::codegen::{ EmitEvent, Env, diff --git a/contracts/tests/psp34_burnable.rs b/tests/psp34_burnable.rs similarity index 97% rename from contracts/tests/psp34_burnable.rs rename to tests/psp34_burnable.rs index 2c31d81c5..214ecdcd2 100644 --- a/contracts/tests/psp34_burnable.rs +++ b/tests/psp34_burnable.rs @@ -21,10 +21,10 @@ #![feature(min_specialization)] #[cfg(feature = "psp34")] -#[brush::contract] +#[openbrush::contract] mod psp34_burnable { - use brush::test_utils::accounts; - use contracts::psp34::extensions::burnable::*; + use openbrush::test_utils::accounts; + use openbrush::contracts::psp34::extensions::burnable::*; use ink_lang as ink; #[derive(Default, PSP34Storage)] diff --git a/contracts/tests/psp34_enumerable.rs b/tests/psp34_enumerable.rs similarity index 98% rename from contracts/tests/psp34_enumerable.rs rename to tests/psp34_enumerable.rs index 37d65973b..dc742b429 100644 --- a/contracts/tests/psp34_enumerable.rs +++ b/tests/psp34_enumerable.rs @@ -21,13 +21,13 @@ #![feature(min_specialization)] #[cfg(feature = "psp34")] -#[brush::contract] +#[openbrush::contract] mod psp34_enumerable { - use brush::test_utils::{ + use openbrush::test_utils::{ accounts, change_caller, }; - use contracts::psp34::{ + use openbrush::contracts::psp34::{ extensions::{ burnable::*, enumerable::*, diff --git a/contracts/tests/psp34_metadata.rs b/tests/psp34_metadata.rs similarity index 96% rename from contracts/tests/psp34_metadata.rs rename to tests/psp34_metadata.rs index 64180f2e0..95c787d9b 100644 --- a/contracts/tests/psp34_metadata.rs +++ b/tests/psp34_metadata.rs @@ -21,9 +21,9 @@ #![feature(min_specialization)] #[cfg(feature = "psp34")] -#[brush::contract] +#[openbrush::contract] mod psp34_metadata { - use contracts::psp34::extensions::metadata::*; + use openbrush::contracts::psp34::extensions::metadata::*; use ink_lang as ink; use ink_prelude::string::String; diff --git a/contracts/tests/psp34_mintable.rs b/tests/psp34_mintable.rs similarity index 98% rename from contracts/tests/psp34_mintable.rs rename to tests/psp34_mintable.rs index c8e24ff3f..2bec853be 100644 --- a/contracts/tests/psp34_mintable.rs +++ b/tests/psp34_mintable.rs @@ -21,10 +21,10 @@ #![feature(min_specialization)] #[cfg(feature = "psp34")] -#[brush::contract] +#[openbrush::contract] mod psp34_mintable { - use brush::test_utils::accounts; - use contracts::psp34::{ + use openbrush::test_utils::accounts; + use openbrush::contracts::psp34::{ extensions::mintable::*, Id, }; diff --git a/contracts/tests/reentrancy_guard.rs b/tests/reentrancy_guard.rs similarity index 93% rename from contracts/tests/reentrancy_guard.rs rename to tests/reentrancy_guard.rs index bf44fe6e8..0201a84df 100644 --- a/contracts/tests/reentrancy_guard.rs +++ b/tests/reentrancy_guard.rs @@ -21,9 +21,9 @@ #![feature(min_specialization)] #[cfg(feature = "reentrancy_guard")] -#[brush::contract] +#[openbrush::contract] mod reentrancy_guard { - use contracts::reentrancy_guard::*; + use openbrush::contracts::reentrancy_guard::*; use ink_lang as ink; #[ink(storage)] @@ -41,7 +41,7 @@ mod reentrancy_guard { } #[ink(message)] - #[brush::modifiers(non_reentrant)] + #[openbrush::modifiers(non_reentrant)] pub fn flip(&mut self) -> Result { let previous = self.flipped; self.flipped = !previous; @@ -50,7 +50,7 @@ mod reentrancy_guard { } #[ink(message)] - #[brush::modifiers(non_reentrant)] + #[openbrush::modifiers(non_reentrant)] pub fn call_flip_after_lock(&mut self) -> Result { self.flip() } diff --git a/contracts/tests/timelock_controller.rs b/tests/timelock_controller.rs similarity index 99% rename from contracts/tests/timelock_controller.rs rename to tests/timelock_controller.rs index 1e1f6fa04..a4f710bdf 100644 --- a/contracts/tests/timelock_controller.rs +++ b/tests/timelock_controller.rs @@ -21,14 +21,14 @@ #![feature(min_specialization)] #[cfg(feature = "timelock_controller")] -#[brush::contract] +#[openbrush::contract] mod timelock_controller { use ::ink_env::DefaultEnvironment; - use brush::test_utils::{ + use openbrush::test_utils::{ accounts, change_caller, }; - use contracts::timelock_controller::*; + use openbrush::contracts::timelock_controller::*; use ink_env::test::DefaultAccounts; use ink_lang as ink; From bd686fb032deb3e6fdfeb542b14826c0f316334b Mon Sep 17 00:00:00 2001 From: xgreenx Date: Sat, 28 May 2022 02:11:31 +0200 Subject: [PATCH 06/10] cargo fmt --all fixed tests --- Cargo.toml | 21 +++++++++++++++++++-- README.md | 2 +- publish.sh | 11 +++++++++++ lib.rs => src/lib.rs | 2 +- tests/access_control.rs | 12 +++++++----- tests/ownable.rs | 10 +++++----- tests/pausable.rs | 6 ++++-- tests/payment_splitter.rs | 6 ++++-- tests/proxy.rs | 13 ++++++++----- tests/psp1155.rs | 12 +++++++----- tests/psp1155_burnable.rs | 6 ++++-- tests/psp1155_metadata.rs | 2 +- tests/psp1155_mintable.rs | 6 ++++-- tests/psp22.rs | 6 ++++-- tests/psp22_burnable.rs | 6 ++++-- tests/psp22_flashmint.rs | 6 ++++-- tests/psp22_metadata.rs | 2 +- tests/psp22_mintable.rs | 6 ++++-- tests/psp22_token_timelock.rs | 6 ++++-- tests/psp22_wrapper.rs | 6 ++++-- tests/psp34.rs | 12 +++++++----- tests/psp34_burnable.rs | 6 ++++-- tests/psp34_enumerable.rs | 26 ++++++++++++++------------ tests/psp34_metadata.rs | 2 +- tests/psp34_mintable.rs | 12 +++++++----- tests/reentrancy_guard.rs | 2 +- tests/timelock_controller.rs | 12 +++++++----- 27 files changed, 142 insertions(+), 77 deletions(-) create mode 100755 publish.sh rename lib.rs => src/lib.rs (96%) diff --git a/Cargo.toml b/Cargo.toml index a3f93b6ec..d81a9b9e8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,15 +24,25 @@ homepage = "https://supercolony.net" description = "OpenBrush library for smart contract development on ink!." keywords = ["wasm", "supercolony", "smart-contracts", "blockchain", "ink"] categories = ["no-std", "embedded"] -include = ["Cargo.toml", "lib.rs"] +include = ["Cargo.toml", "src/**/*.rs"] [dependencies] +ink_primitives = { version = "3.2.0", default-features = false } +ink_metadata = { version = "3.2.0", default-features = false, features = ["derive"], optional = true } +ink_env = { version = "3.2.0", default-features = false } +ink_storage = { version = "3.2.0", default-features = false } +ink_lang = { version = "3.2.0", default-features = false } +ink_prelude = { version = "3.2.0", default-features = false } + +scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } +scale-info = { version = "2", default-features = false, features = ["derive"], optional = true } + openbrush_contracts = { version = "1.8.0", path = "contracts", default-features = false } openbrush_lang = { version = "1.8.0", path = "lang", default-features = false } [lib] name = "openbrush" -path = "lib.rs" +path = "src/lib.rs" crate-type = [ "rlib", ] @@ -40,6 +50,13 @@ crate-type = [ [features] default = ["std"] std = [ + "ink_metadata/std", + "ink_env/std", + "ink_storage/std", + "ink_primitives/std", + "scale/std", + "scale-info/std", + "openbrush_contracts/std", "openbrush_lang/std", ] diff --git a/README.md b/README.md index df208ca94..a6411c8a2 100644 --- a/README.md +++ b/README.md @@ -202,4 +202,4 @@ After that, we plan to do an audit. ## License -OpenBrush is released under the [MIT License](LICENSE). +OpenBrush is released under the [MIT License](LICENSE). \ No newline at end of file diff --git a/publish.sh b/publish.sh new file mode 100755 index 000000000..142a3b640 --- /dev/null +++ b/publish.sh @@ -0,0 +1,11 @@ +cargo publish --package openbrush_lang_codegen --keep-going +sleep 5 +cargo publish --package openbrush_lang_macro --keep-going +sleep 5 +cargo publish --package openbrush_lang --keep-going +sleep 5 +cargo publish --package openbrush_contracts_derive --keep-going +sleep 5 +cargo publish --package openbrush_contracts --keep-going +sleep 5 +cargo publish --package openbrush --keep-going \ No newline at end of file diff --git a/lib.rs b/src/lib.rs similarity index 96% rename from lib.rs rename to src/lib.rs index 1bbd7d9ef..463a7a6cf 100644 --- a/lib.rs +++ b/src/lib.rs @@ -21,5 +21,5 @@ #![cfg_attr(not(feature = "std"), no_std)] +pub use openbrush_contracts as contracts; pub use openbrush_lang::*; -pub use openbrush_contracts as contract; diff --git a/tests/access_control.rs b/tests/access_control.rs index ad9c02d35..d788fff12 100644 --- a/tests/access_control.rs +++ b/tests/access_control.rs @@ -24,13 +24,15 @@ #[openbrush::contract] mod access_control { use ::ink_env::DefaultEnvironment; - use openbrush::test_utils::{ - accounts, - change_caller, - }; - use openbrush::contracts::access_control::*; use ink_env::test::DefaultAccounts; use ink_lang as ink; + use openbrush::{ + contracts::access_control::*, + test_utils::{ + accounts, + change_caller, + }, + }; use ink::codegen::{ EmitEvent, diff --git a/tests/ownable.rs b/tests/ownable.rs index 740c75bdc..d525ff86a 100644 --- a/tests/ownable.rs +++ b/tests/ownable.rs @@ -23,16 +23,16 @@ #[cfg(feature = "ownable")] #[openbrush::contract] mod ownable { - use openbrush::{ - test_utils::change_caller, - traits::AccountIdExt, - }; - use openbrush::contracts::ownable::*; use ink::codegen::{ EmitEvent, Env, }; use ink_lang as ink; + use openbrush::{ + contracts::ownable::*, + test_utils::change_caller, + traits::AccountIdExt, + }; #[ink(event)] pub struct OwnershipTransferred { diff --git a/tests/pausable.rs b/tests/pausable.rs index 44bfd2070..2ff76b8b1 100644 --- a/tests/pausable.rs +++ b/tests/pausable.rs @@ -24,10 +24,12 @@ #[openbrush::contract] mod pausable { use ::ink_env::DefaultEnvironment; - use openbrush::test_utils::accounts; - use openbrush::contracts::pausable::*; use ink_env::test::DefaultAccounts; use ink_lang as ink; + use openbrush::{ + contracts::pausable::*, + test_utils::accounts, + }; use ink::codegen::{ EmitEvent, diff --git a/tests/payment_splitter.rs b/tests/payment_splitter.rs index f323fd554..722bd6bb1 100644 --- a/tests/payment_splitter.rs +++ b/tests/payment_splitter.rs @@ -23,10 +23,12 @@ #[cfg(feature = "payment_splitter")] #[openbrush::contract] mod payment_splitter { - use openbrush::test_utils::accounts; - use openbrush::contracts::payment_splitter::*; use ink_lang as ink; use ink_storage::traits::SpreadAllocate; + use openbrush::{ + contracts::payment_splitter::*, + test_utils::accounts, + }; use ink::codegen::{ EmitEvent, diff --git a/tests/proxy.rs b/tests/proxy.rs index 791f69aa9..078ee6c11 100644 --- a/tests/proxy.rs +++ b/tests/proxy.rs @@ -23,16 +23,19 @@ #[cfg(feature = "proxy")] #[openbrush::contract] mod proxy { - use openbrush::test_utils::change_caller; - use openbrush::contracts::{ - ownable::*, - proxy::*, - }; + use core::convert::TryFrom; use ink::codegen::{ EmitEvent, Env, }; use ink_lang as ink; + use openbrush::{ + contracts::{ + ownable::*, + proxy::*, + }, + test_utils::change_caller, + }; #[ink(event)] pub struct CodeHashChanged { diff --git a/tests/psp1155.rs b/tests/psp1155.rs index 1448b08d2..35ed3c5c2 100644 --- a/tests/psp1155.rs +++ b/tests/psp1155.rs @@ -23,17 +23,19 @@ #[cfg(feature = "psp1155")] #[openbrush::contract] mod psp1155 { - use openbrush::test_utils::{ - accounts, - change_caller, - }; - use openbrush::contracts::psp1155::*; use ink::codegen::{ EmitEvent, Env, }; use ink_lang as ink; use ink_storage::traits::SpreadAllocate; + use openbrush::{ + contracts::psp1155::*, + test_utils::{ + accounts, + change_caller, + }, + }; #[ink(event)] pub struct TransferSingle { diff --git a/tests/psp1155_burnable.rs b/tests/psp1155_burnable.rs index 5e069038d..51f4a6204 100644 --- a/tests/psp1155_burnable.rs +++ b/tests/psp1155_burnable.rs @@ -23,9 +23,11 @@ #[cfg(feature = "psp1155")] #[openbrush::contract] mod psp1155_burnable { - use openbrush::test_utils::accounts; - use openbrush::contracts::psp1155::extensions::burnable::*; use ink_lang as ink; + use openbrush::{ + contracts::psp1155::extensions::burnable::*, + test_utils::accounts, + }; #[derive(Default, PSP1155Storage)] #[ink(storage)] diff --git a/tests/psp1155_metadata.rs b/tests/psp1155_metadata.rs index c3a6691cc..2ea595dd8 100644 --- a/tests/psp1155_metadata.rs +++ b/tests/psp1155_metadata.rs @@ -23,8 +23,8 @@ #[cfg(feature = "psp1155")] #[openbrush::contract] mod psp1155_metadata { - use openbrush::contracts::psp1155::extensions::metadata::*; use ink_lang as ink; + use openbrush::contracts::psp1155::extensions::metadata::*; #[derive(Default, PSP1155Storage, PSP1155MetadataStorage)] #[ink(storage)] diff --git a/tests/psp1155_mintable.rs b/tests/psp1155_mintable.rs index cf2a19451..3fe8ab01d 100644 --- a/tests/psp1155_mintable.rs +++ b/tests/psp1155_mintable.rs @@ -23,9 +23,11 @@ #[cfg(feature = "psp1155")] #[openbrush::contract] mod psp1155_mintable { - use openbrush::test_utils::accounts; - use openbrush::contracts::psp1155::extensions::mintable::*; use ink_lang as ink; + use openbrush::{ + contracts::psp1155::extensions::mintable::*, + test_utils::accounts, + }; #[derive(Default, PSP1155Storage)] #[ink(storage)] diff --git a/tests/psp22.rs b/tests/psp22.rs index 3c3c22793..486389175 100644 --- a/tests/psp22.rs +++ b/tests/psp22.rs @@ -23,13 +23,15 @@ #[cfg(feature = "psp22")] #[openbrush::contract] mod psp22 { - use openbrush::test_utils::*; - use openbrush::contracts::psp22::*; use ink::codegen::{ EmitEvent, Env, }; use ink_lang as ink; + use openbrush::{ + contracts::psp22::*, + test_utils::*, + }; use std::panic; /// Event emitted when a token transfer occurs. diff --git a/tests/psp22_burnable.rs b/tests/psp22_burnable.rs index 39605ad50..8a40bb0bf 100644 --- a/tests/psp22_burnable.rs +++ b/tests/psp22_burnable.rs @@ -23,13 +23,15 @@ #[cfg(feature = "psp22")] #[openbrush::contract] mod psp22_burnable { - use openbrush::test_utils::*; - use openbrush::contracts::psp22::extensions::burnable::*; use ink::codegen::{ EmitEvent, Env, }; use ink_lang as ink; + use openbrush::{ + contracts::psp22::extensions::burnable::*, + test_utils::*, + }; /// Event emitted when a token transfer occurs. #[ink(event)] diff --git a/tests/psp22_flashmint.rs b/tests/psp22_flashmint.rs index 2ca80dd55..4eed1121e 100644 --- a/tests/psp22_flashmint.rs +++ b/tests/psp22_flashmint.rs @@ -23,10 +23,12 @@ #[cfg(feature = "psp22")] #[openbrush::contract] mod psp22_flashmint { - use openbrush::test_utils::accounts; - use openbrush::contracts::psp22::extensions::flashmint::*; use ink_lang as ink; use ink_lang::codegen::Env; + use openbrush::{ + contracts::psp22::extensions::flashmint::*, + test_utils::accounts, + }; #[ink(storage)] #[derive(Default, PSP22Storage)] diff --git a/tests/psp22_metadata.rs b/tests/psp22_metadata.rs index 641fd0438..29ebf164e 100644 --- a/tests/psp22_metadata.rs +++ b/tests/psp22_metadata.rs @@ -23,9 +23,9 @@ #[cfg(feature = "psp22")] #[openbrush::contract] mod psp22_metadata { + use ink_lang as ink; /// Imports all the definitions from the outer scope so we can use them here. use openbrush::contracts::psp22::extensions::metadata::*; - use ink_lang as ink; /// A simple PSP-20 contract. #[ink(storage)] diff --git a/tests/psp22_mintable.rs b/tests/psp22_mintable.rs index 4cbe75e19..73b2e787b 100644 --- a/tests/psp22_mintable.rs +++ b/tests/psp22_mintable.rs @@ -23,13 +23,15 @@ #[cfg(feature = "psp22")] #[openbrush::contract] mod psp22_mintable { - use openbrush::test_utils::*; - use openbrush::contracts::psp22::extensions::mintable::*; use ink::codegen::{ EmitEvent, Env, }; use ink_lang as ink; + use openbrush::{ + contracts::psp22::extensions::mintable::*, + test_utils::*, + }; /// Event emitted when a token transfer occurs. #[ink(event)] diff --git a/tests/psp22_token_timelock.rs b/tests/psp22_token_timelock.rs index b8b389dc5..9212fcfe2 100644 --- a/tests/psp22_token_timelock.rs +++ b/tests/psp22_token_timelock.rs @@ -23,9 +23,11 @@ #[cfg(feature = "psp22")] #[openbrush::contract] mod psp22_timelock { - use openbrush::test_utils::accounts; - use openbrush::contracts::psp22::utils::token_timelock::*; use ink_lang as ink; + use openbrush::{ + contracts::psp22::utils::token_timelock::*, + test_utils::accounts, + }; #[ink(storage)] #[derive(Default, PSP22TokenTimelockStorage)] diff --git a/tests/psp22_wrapper.rs b/tests/psp22_wrapper.rs index 329216787..988e577de 100644 --- a/tests/psp22_wrapper.rs +++ b/tests/psp22_wrapper.rs @@ -23,9 +23,11 @@ #[cfg(feature = "psp22")] #[openbrush::contract] mod psp22_wrapper { - use openbrush::test_utils::accounts; - use openbrush::contracts::psp22::extensions::wrapper::*; use ink_lang as ink; + use openbrush::{ + contracts::psp22::extensions::wrapper::*, + test_utils::accounts, + }; #[ink(storage)] #[derive(Default, PSP22Storage, PSP22WrapperStorage)] diff --git a/tests/psp34.rs b/tests/psp34.rs index c858c2874..4786c7f30 100644 --- a/tests/psp34.rs +++ b/tests/psp34.rs @@ -23,11 +23,6 @@ #[cfg(feature = "psp34")] #[openbrush::contract] mod psp34 { - use openbrush::test_utils::{ - accounts, - change_caller, - }; - use openbrush::contracts::psp34::*; use ink::codegen::{ EmitEvent, Env, @@ -35,6 +30,13 @@ mod psp34 { use ink_env::DefaultEnvironment; use ink_lang as ink; use ink_storage::traits::SpreadAllocate; + use openbrush::{ + contracts::psp34::*, + test_utils::{ + accounts, + change_caller, + }, + }; /// Event emitted when a token transfer occurs. #[ink(event)] diff --git a/tests/psp34_burnable.rs b/tests/psp34_burnable.rs index 214ecdcd2..945f51756 100644 --- a/tests/psp34_burnable.rs +++ b/tests/psp34_burnable.rs @@ -23,9 +23,11 @@ #[cfg(feature = "psp34")] #[openbrush::contract] mod psp34_burnable { - use openbrush::test_utils::accounts; - use openbrush::contracts::psp34::extensions::burnable::*; use ink_lang as ink; + use openbrush::{ + contracts::psp34::extensions::burnable::*, + test_utils::accounts, + }; #[derive(Default, PSP34Storage)] #[ink(storage)] diff --git a/tests/psp34_enumerable.rs b/tests/psp34_enumerable.rs index dc742b429..2597f1836 100644 --- a/tests/psp34_enumerable.rs +++ b/tests/psp34_enumerable.rs @@ -23,20 +23,22 @@ #[cfg(feature = "psp34")] #[openbrush::contract] mod psp34_enumerable { - use openbrush::test_utils::{ - accounts, - change_caller, - }; - use openbrush::contracts::psp34::{ - extensions::{ - burnable::*, - enumerable::*, - mintable::*, - }, - Id, - }; use ink_lang as ink; use ink_storage::traits::SpreadAllocate; + use openbrush::{ + contracts::psp34::{ + extensions::{ + burnable::*, + enumerable::*, + mintable::*, + }, + Id, + }, + test_utils::{ + accounts, + change_caller, + }, + }; #[derive(Default, SpreadAllocate, PSP34Storage, PSP34EnumerableStorage)] #[ink(storage)] diff --git a/tests/psp34_metadata.rs b/tests/psp34_metadata.rs index 95c787d9b..7f0cde461 100644 --- a/tests/psp34_metadata.rs +++ b/tests/psp34_metadata.rs @@ -23,9 +23,9 @@ #[cfg(feature = "psp34")] #[openbrush::contract] mod psp34_metadata { - use openbrush::contracts::psp34::extensions::metadata::*; use ink_lang as ink; use ink_prelude::string::String; + use openbrush::contracts::psp34::extensions::metadata::*; #[derive(Default, PSP34Storage, PSP34MetadataStorage)] #[ink(storage)] diff --git a/tests/psp34_mintable.rs b/tests/psp34_mintable.rs index 2bec853be..7a37836bc 100644 --- a/tests/psp34_mintable.rs +++ b/tests/psp34_mintable.rs @@ -23,12 +23,14 @@ #[cfg(feature = "psp34")] #[openbrush::contract] mod psp34_mintable { - use openbrush::test_utils::accounts; - use openbrush::contracts::psp34::{ - extensions::mintable::*, - Id, - }; use ink_lang as ink; + use openbrush::{ + contracts::psp34::{ + extensions::mintable::*, + Id, + }, + test_utils::accounts, + }; #[derive(Default, PSP34Storage)] #[ink(storage)] diff --git a/tests/reentrancy_guard.rs b/tests/reentrancy_guard.rs index 0201a84df..28f20b14f 100644 --- a/tests/reentrancy_guard.rs +++ b/tests/reentrancy_guard.rs @@ -23,8 +23,8 @@ #[cfg(feature = "reentrancy_guard")] #[openbrush::contract] mod reentrancy_guard { - use openbrush::contracts::reentrancy_guard::*; use ink_lang as ink; + use openbrush::contracts::reentrancy_guard::*; #[ink(storage)] #[derive(Default, ReentrancyGuardStorage)] diff --git a/tests/timelock_controller.rs b/tests/timelock_controller.rs index a4f710bdf..4ead97f12 100644 --- a/tests/timelock_controller.rs +++ b/tests/timelock_controller.rs @@ -24,13 +24,15 @@ #[openbrush::contract] mod timelock_controller { use ::ink_env::DefaultEnvironment; - use openbrush::test_utils::{ - accounts, - change_caller, - }; - use openbrush::contracts::timelock_controller::*; use ink_env::test::DefaultAccounts; use ink_lang as ink; + use openbrush::{ + contracts::timelock_controller::*, + test_utils::{ + accounts, + change_caller, + }, + }; use ink::codegen::{ EmitEvent, From 0c4028973310828fa393957931c3de23ac1c211a Mon Sep 17 00:00:00 2001 From: xgreenx Date: Sat, 28 May 2022 02:53:10 +0200 Subject: [PATCH 07/10] Fixed broken links after refactoring. Updated the framework for docs --- .../PSP1155/Extensions/burnable.md | 6 ++--- .../PSP1155/Extensions/metadata.md | 6 ++--- .../PSP1155/Extensions/mintable.md | 6 ++--- docs/docs/smart-contracts/PSP1155/psp1155.md | 4 +-- .../PSP22/Extensions/burnable.md | 6 ++--- .../PSP22/Extensions/capped.md | 6 ++--- .../PSP22/Extensions/flashmint.md | 6 ++--- .../PSP22/Extensions/metadata.md | 6 ++--- .../PSP22/Extensions/mintable.md | 6 ++--- .../PSP22/Extensions/pausable.md | 6 ++--- .../PSP22/Extensions/wrapper.md | 6 ++--- .../PSP22/Utils/token-timelock.md | 6 ++--- docs/docs/smart-contracts/PSP22/psp22.md | 4 +-- .../PSP34/Extensions/burnable.md | 6 ++--- .../PSP34/Extensions/metadata.md | 6 ++--- .../PSP34/Extensions/mintable.md | 6 ++--- docs/docs/smart-contracts/PSP34/psp34.md | 4 +-- docs/docs/smart-contracts/access-control.md | 4 +-- docs/docs/smart-contracts/diamond.md | 4 +-- docs/docs/smart-contracts/example/data.md | 4 +-- docs/docs/smart-contracts/example/impls.md | 6 ++--- docs/docs/smart-contracts/example/loan.md | 6 ++--- docs/docs/smart-contracts/example/overview.md | 6 ++--- docs/docs/smart-contracts/example/psp22.md | 12 ++++----- docs/docs/smart-contracts/example/shares.md | 4 +-- docs/docs/smart-contracts/overview.md | 26 +++++++++---------- docs/docs/smart-contracts/ownable.md | 4 +-- docs/docs/smart-contracts/pausable.md | 4 +-- docs/docs/smart-contracts/payment-splitter.md | 4 +-- docs/docs/smart-contracts/proxy.md | 4 +-- docs/docs/smart-contracts/reentrancy-guard.md | 4 +-- .../smart-contracts/timelock-controller.md | 4 +-- docs/package.json | 10 +++---- 33 files changed, 101 insertions(+), 101 deletions(-) diff --git a/docs/docs/smart-contracts/PSP1155/Extensions/burnable.md b/docs/docs/smart-contracts/PSP1155/Extensions/burnable.md index 3725ed18f..06fbf6aa6 100644 --- a/docs/docs/smart-contracts/PSP1155/Extensions/burnable.md +++ b/docs/docs/smart-contracts/PSP1155/Extensions/burnable.md @@ -3,7 +3,7 @@ sidebar_position: 3 title: PSP1155 Burnable --- -This example shows how you can reuse the implementation of [PSP1155](https://github.com/Supercolony-net/openbrush-contracts/tree/main/contracts/token/psp1155) token with [PSP1155Burnable](https://github.com/Supercolony-net/openbrush-contracts/tree/main/contracts/token/psp1155/src/extensions/burnable.rs) extension. +This example shows how you can reuse the implementation of [PSP1155](https://github.com/Supercolony-net/openbrush-contracts/tree/master/contracts/src/token/psp1155) token with [PSP1155Burnable](https://github.com/Supercolony-net/openbrush-contracts/tree/master/contracts/src/token/psp1155/src/extensions/burnable.rs) extension. ## How to use this extension @@ -16,6 +16,6 @@ impl PSP1155Burnable for MyPSP1155 {} ``` And that's it! Your `PSP1155` is now extended by the `PSP1155Burnable` extension and ready to use its functions! -You can check an example of the usage of [PSP1155 Burnable](https://github.com/Supercolony-net/openbrush-contracts/tree/main/examples/psp1155_extensions/burnable). +You can check an example of the usage of [PSP1155 Burnable](https://github.com/Supercolony-net/openbrush-contracts/tree/master/examples/psp1155_extensions/burnable). -You can also check the documentation for the basic implementation of [PSP1155](/smart-contracts/PSP1155/psp1155). \ No newline at end of file +You can also check the documentation for the basic implementation of [PSP1155](/smart-contracts/PSP1155). \ No newline at end of file diff --git a/docs/docs/smart-contracts/PSP1155/Extensions/metadata.md b/docs/docs/smart-contracts/PSP1155/Extensions/metadata.md index 902e7a959..dcbb64db2 100644 --- a/docs/docs/smart-contracts/PSP1155/Extensions/metadata.md +++ b/docs/docs/smart-contracts/PSP1155/Extensions/metadata.md @@ -3,7 +3,7 @@ sidebar_position: 1 title: PSP1155 Metadata --- -This example shows how you can reuse the implementation of [PSP1155](https://github.com/Supercolony-net/openbrush-contracts/tree/main/contracts/token/psp1155) token with [PSP1155Metadata](https://github.com/Supercolony-net/openbrush-contracts/tree/main/contracts/token/psp1155/src/extensions/metadata.rs) extension. +This example shows how you can reuse the implementation of [PSP1155](https://github.com/Supercolony-net/openbrush-contracts/tree/master/contracts/src/token/psp1155) token with [PSP1155Metadata](https://github.com/Supercolony-net/openbrush-contracts/tree/master/contracts/src/token/psp1155/src/extensions/metadata.rs) extension. ## Step 1: Add imports and enable unstable feature @@ -61,6 +61,6 @@ impl MyPSP1155 { } } ``` -You can check an example of the usage of [PSP1155 Metadata](https://github.com/Supercolony-net/openbrush-contracts/tree/main/examples/psp1155_extensions/metadata). +You can check an example of the usage of [PSP1155 Metadata](https://github.com/Supercolony-net/openbrush-contracts/tree/master/examples/psp1155_extensions/metadata). -You can also check the documentation for the basic implementation of [PSP1155](/smart-contracts/PSP1155/psp1155). +You can also check the documentation for the basic implementation of [PSP1155](/smart-contracts/PSP1155). diff --git a/docs/docs/smart-contracts/PSP1155/Extensions/mintable.md b/docs/docs/smart-contracts/PSP1155/Extensions/mintable.md index fb8f920f9..79e3a2bbf 100644 --- a/docs/docs/smart-contracts/PSP1155/Extensions/mintable.md +++ b/docs/docs/smart-contracts/PSP1155/Extensions/mintable.md @@ -3,7 +3,7 @@ sidebar_position: 2 title: PSP1155 Mintable --- -This example shows how you can reuse the implementation of [PSP1155](https://github.com/Supercolony-net/openbrush-contracts/tree/main/contracts/token/psp1155) token with [PSP1155Mintable](https://github.com/Supercolony-net/openbrush-contracts/tree/main/contracts/token/psp1155/src/extensions/mintable.rs) extension. +This example shows how you can reuse the implementation of [PSP1155](https://github.com/Supercolony-net/openbrush-contracts/tree/master/contracts/src/token/psp1155) token with [PSP1155Mintable](https://github.com/Supercolony-net/openbrush-contracts/tree/master/contracts/src/token/psp1155/src/extensions/mintable.rs) extension. ## How to use this extension @@ -16,6 +16,6 @@ impl PSP1155Mintable for MyPSP1155 {} ``` And that's it! Your `PSP1155` is now extended by the `PSP1155Mintable` extension and ready to use its functions! -You can check an example of the usage of [PSP1155 Mintable](https://github.com/Supercolony-net/openbrush-contracts/tree/main/examples/psp1155_extensions/mintable). +You can check an example of the usage of [PSP1155 Mintable](https://github.com/Supercolony-net/openbrush-contracts/tree/master/examples/psp1155_extensions/mintable). -You can also check the documentation for the basic implementation of [PSP1155](/smart-contracts/PSP1155/psp1155). +You can also check the documentation for the basic implementation of [PSP1155](/smart-contracts/PSP1155). diff --git a/docs/docs/smart-contracts/PSP1155/psp1155.md b/docs/docs/smart-contracts/PSP1155/psp1155.md index 1f2977316..71221491a 100644 --- a/docs/docs/smart-contracts/PSP1155/psp1155.md +++ b/docs/docs/smart-contracts/PSP1155/psp1155.md @@ -3,7 +3,7 @@ sidebar_position: 1 title: PSP1155 --- -This example shows how you can reuse the implementation of [PSP1155](https://github.com/Supercolony-net/openbrush-contracts/tree/main/contracts/token/psp1155) token. Also, this example shows how you can customize the logic, for example, to track the number of token types with `unique_ids`, adding a new token type with the `add_type` function. +This example shows how you can reuse the implementation of [PSP1155](https://github.com/Supercolony-net/openbrush-contracts/tree/master/contracts/src/token/psp1155) token. Also, this example shows how you can customize the logic, for example, to track the number of token types with `unique_ids`, adding a new token type with the `add_type` function. ## Step 1: Include dependencies @@ -108,7 +108,7 @@ impl MyPSP1155 { } } ``` -You can check an example of the usage of [PSP1155](https://github.com/Supercolony-net/openbrush-contracts/tree/main/examples/psp1155). +You can check an example of the usage of [PSP1155](https://github.com/Supercolony-net/openbrush-contracts/tree/master/examples/psp1155). Also you can use extensions for PSP1155 token: diff --git a/docs/docs/smart-contracts/PSP22/Extensions/burnable.md b/docs/docs/smart-contracts/PSP22/Extensions/burnable.md index bfc350916..cf08cc330 100644 --- a/docs/docs/smart-contracts/PSP22/Extensions/burnable.md +++ b/docs/docs/smart-contracts/PSP22/Extensions/burnable.md @@ -4,7 +4,7 @@ title: PSP22 Burnable --- This example shows how you can reuse the implementation of -[PSP22](https://github.com/Supercolony-net/openbrush-contracts/tree/main/contracts/token/psp22) token with [PSP22Burnable](https://github.com/Supercolony-net/openbrush-contracts/tree/main/contracts/token/psp22/src/extensions/burnable.rs) extension. +[PSP22](https://github.com/Supercolony-net/openbrush-contracts/tree/master/contracts/src/token/psp22) token with [PSP22Burnable](https://github.com/Supercolony-net/openbrush-contracts/tree/master/contracts/src/token/psp22/src/extensions/burnable.rs) extension. ## How to use this extension @@ -17,6 +17,6 @@ impl PSP22Burnable for MyPSP22 {} ``` And that's it! Your `PSP22` is now extended by the `PSP22Burnable` extension and ready to use its functions! -You can check an example of the usage of [PSP22 Burnable](https://github.com/Supercolony-net/openbrush-contracts/tree/main/examples/psp22_extensions/burnable). +You can check an example of the usage of [PSP22 Burnable](https://github.com/Supercolony-net/openbrush-contracts/tree/master/examples/psp22_extensions/burnable). -You can also check the documentation for the basic implementation of [PSP22](/smart-contracts/PSP22/psp22). \ No newline at end of file +You can also check the documentation for the basic implementation of [PSP22](/smart-contracts/PSP22). \ No newline at end of file diff --git a/docs/docs/smart-contracts/PSP22/Extensions/capped.md b/docs/docs/smart-contracts/PSP22/Extensions/capped.md index 30b9342e1..33de308cc 100644 --- a/docs/docs/smart-contracts/PSP22/Extensions/capped.md +++ b/docs/docs/smart-contracts/PSP22/Extensions/capped.md @@ -3,7 +3,7 @@ sidebar_position: 7 title: PSP22 Capped --- -This example shows how you can implement a [PSP22](https://github.com/Supercolony-net/openbrush-contracts/tree/main/contracts/token/psp22) contract with a supply cap, analogue to [ERC20Capped](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/extensions/ERC20Capped.sol). +This example shows how you can implement a [PSP22](https://github.com/Supercolony-net/openbrush-contracts/tree/master/contracts/src/token/psp22) contract with a supply cap, analogue to [ERC20Capped](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/extensions/ERC20Capped.sol). ## Step 1: Include dependencies @@ -94,6 +94,6 @@ impl MyPSP22Capped { } ``` -You can check an implementation example of [PSP22 Capped](https://github.com/Supercolony-net/openbrush-contracts/tree/main/examples/psp22_extensions/capped). +You can check an implementation example of [PSP22 Capped](https://github.com/Supercolony-net/openbrush-contracts/tree/master/examples/psp22_extensions/capped). -You can also check the documentation for the basic implementation of [PSP22](/smart-contracts/PSP22/psp22). +You can also check the documentation for the basic implementation of [PSP22](/smart-contracts/PSP22). diff --git a/docs/docs/smart-contracts/PSP22/Extensions/flashmint.md b/docs/docs/smart-contracts/PSP22/Extensions/flashmint.md index a01bf291d..e35840e3a 100644 --- a/docs/docs/smart-contracts/PSP22/Extensions/flashmint.md +++ b/docs/docs/smart-contracts/PSP22/Extensions/flashmint.md @@ -3,7 +3,7 @@ sidebar_position: 5 title: PSP22 FlashMint --- -This example shows how you can reuse the implementation of [PSP22](https://github.com/Supercolony-net/openbrush-contracts/tree/main/contracts/token/psp22) token with [PSP22FlashMint](https://github.com/Supercolony-net/openbrush-contracts/tree/main/contracts/token/psp22/extensions/flashmint.rs) extension, which allows the user to perform a flash loan on the token by minting the borrowed amount and then burning it along with fees for the loan. +This example shows how you can reuse the implementation of [PSP22](https://github.com/Supercolony-net/openbrush-contracts/tree/master/contracts/src/token/psp22) token with [PSP22FlashMint](https://github.com/Supercolony-net/openbrush-contracts/tree/master/contracts/src/token/psp22/extensions/flashmint.rs) extension, which allows the user to perform a flash loan on the token by minting the borrowed amount and then burning it along with fees for the loan. ## 1. Implement the FlashMint extension @@ -16,6 +16,6 @@ impl FlashLender for MyPSP22FlashMint {} ``` And that's it! Your `PSP22` is now extended by the `PSP22FlashMint` extension and ready to use its functions! -You can check the full example of the implementation of this extension [here](https://github.com/Supercolony-net/openbrush-contracts/tree/main/examples/psp22_extensions/flashmint). +You can check the full example of the implementation of this extension [here](https://github.com/Supercolony-net/openbrush-contracts/tree/master/examples/psp22_extensions/flashmint). -You can also check the documentation for the basic implementation of [PSP22](/smart-contracts/PSP22/psp22). \ No newline at end of file +You can also check the documentation for the basic implementation of [PSP22](/smart-contracts/PSP22). \ No newline at end of file diff --git a/docs/docs/smart-contracts/PSP22/Extensions/metadata.md b/docs/docs/smart-contracts/PSP22/Extensions/metadata.md index 6e704b28f..cb4d7175d 100644 --- a/docs/docs/smart-contracts/PSP22/Extensions/metadata.md +++ b/docs/docs/smart-contracts/PSP22/Extensions/metadata.md @@ -3,7 +3,7 @@ sidebar_position: 1 title: PSP22 Metadata --- -This example shows how you can reuse the implementation of [PSP22](https://github.com/Supercolony-net/openbrush-contracts/tree/main/contracts/token/psp22) token with the [PSP22Metadata](https://github.com/Supercolony-net/openbrush-contracts/tree/main/contracts/token/psp22/src/extensions/metadata.rs) extension. +This example shows how you can reuse the implementation of [PSP22](https://github.com/Supercolony-net/openbrush-contracts/tree/master/contracts/src/token/psp22) token with the [PSP22Metadata](https://github.com/Supercolony-net/openbrush-contracts/tree/master/contracts/src/token/psp22/src/extensions/metadata.rs) extension. ## Step 1: Add imports and enable unstable feature @@ -67,6 +67,6 @@ impl MyPSP22 { } ``` -You can check an example of the usage of [PSP22 Metadata](https://github.com/Supercolony-net/openbrush-contracts/tree/main/examples/psp22_extensions/metadata). +You can check an example of the usage of [PSP22 Metadata](https://github.com/Supercolony-net/openbrush-contracts/tree/master/examples/psp22_extensions/metadata). -You can also check the documentation for the basic implementation of [PSP22](/smart-contracts/PSP22/psp22). +You can also check the documentation for the basic implementation of [PSP22](/smart-contracts/PSP22). diff --git a/docs/docs/smart-contracts/PSP22/Extensions/mintable.md b/docs/docs/smart-contracts/PSP22/Extensions/mintable.md index 2c9eaa2fd..610470e7c 100644 --- a/docs/docs/smart-contracts/PSP22/Extensions/mintable.md +++ b/docs/docs/smart-contracts/PSP22/Extensions/mintable.md @@ -4,7 +4,7 @@ title: PSP22 Mintable --- This example shows how you can reuse the implementation of -[PSP22](https://github.com/Supercolony-net/openbrush-contracts/tree/main/contracts/token/psp22) token with [PSP22Mintable](https://github.com/Supercolony-net/openbrush-contracts/tree/main/contracts/token/psp22/src/extensions/mintable.rs) extension. +[PSP22](https://github.com/Supercolony-net/openbrush-contracts/tree/master/contracts/src/token/psp22) token with [PSP22Mintable](https://github.com/Supercolony-net/openbrush-contracts/tree/master/contracts/src/token/psp22/src/extensions/mintable.rs) extension. ## How to use this extension @@ -16,8 +16,8 @@ use openbrush::contracts::psp22::extensions::mintable::*; impl PSP22Mintable for MyPSP22 {} ``` -You can check an example of the usage of [PSP22 Mintable](https://github.com/Supercolony-net/openbrush-contracts/tree/main/examples/psp22_extensions/mintable). +You can check an example of the usage of [PSP22 Mintable](https://github.com/Supercolony-net/openbrush-contracts/tree/master/examples/psp22_extensions/mintable). And that's it! Your `PSP22` is now extended by the `PSP22Mintable` extension and ready to use its functions! -You can also check the documentation for the basic implementation of [PSP22](/smart-contracts/PSP22/psp22). \ No newline at end of file +You can also check the documentation for the basic implementation of [PSP22](/smart-contracts/PSP22). \ No newline at end of file diff --git a/docs/docs/smart-contracts/PSP22/Extensions/pausable.md b/docs/docs/smart-contracts/PSP22/Extensions/pausable.md index 700fd4278..ddac74a30 100644 --- a/docs/docs/smart-contracts/PSP22/Extensions/pausable.md +++ b/docs/docs/smart-contracts/PSP22/Extensions/pausable.md @@ -3,7 +3,7 @@ sidebar_position: 6 title: PSP22 Pausable --- -This example shows how you can implement a [PSP22](https://github.com/Supercolony-net/openbrush-contracts/tree/main/contracts/token/psp22) contract with a [Pausable](https://github.com/Supercolony-net/openbrush-contracts/tree/main/contracts/security/pausable) extension. See an example of [PSP22Pausable](https://github.com/Supercolony-net/openbrush-contracts/tree/main/examples/psp22_extensions/pausable) implementation. +This example shows how you can implement a [PSP22](https://github.com/Supercolony-net/openbrush-contracts/tree/master/contracts/src/token/psp22) contract with a [Pausable](https://github.com/Supercolony-net/openbrush-contracts/tree/master/contracts/src/security/pausable) extension. See an example of [PSP22Pausable](https://github.com/Supercolony-net/openbrush-contracts/tree/master/examples/psp22_extensions/pausable) implementation. ## Step 1: Include dependencies @@ -98,6 +98,6 @@ impl MyPSP22Pausable { } ``` -You can check an implementation example of [PSP22 Pausable](https://github.com/Supercolony-net/openbrush-contracts/tree/main/examples/psp22_extensions/pausable). +You can check an implementation example of [PSP22 Pausable](https://github.com/Supercolony-net/openbrush-contracts/tree/master/examples/psp22_extensions/pausable). -You can also check the documentation for the basic implementation of [PSP22](/smart-contracts/PSP22/psp22). +You can also check the documentation for the basic implementation of [PSP22](/smart-contracts/PSP22). diff --git a/docs/docs/smart-contracts/PSP22/Extensions/wrapper.md b/docs/docs/smart-contracts/PSP22/Extensions/wrapper.md index 75f078092..2c55e9e18 100644 --- a/docs/docs/smart-contracts/PSP22/Extensions/wrapper.md +++ b/docs/docs/smart-contracts/PSP22/Extensions/wrapper.md @@ -3,7 +3,7 @@ sidebar_position: 4 title: PSP22 Wrapper --- -This example shows how you can reuse the implementation of [PSP22](https://github.com/Supercolony-net/openbrush-contracts/tree/main/contracts/token/psp22) token with [PSP22 Wrapper](https://github.com/Supercolony-net/openbrush-contracts/tree/main/contracts/token/psp22/extensions/wrapper.rs) extension, which allows you to wrap your `PSP22` token in a `PSP22Wrapper` token which can be used for example for governance. +This example shows how you can reuse the implementation of [PSP22](https://github.com/Supercolony-net/openbrush-contracts/tree/master/contracts/src/token/psp22) token with [PSP22 Wrapper](https://github.com/Supercolony-net/openbrush-contracts/tree/master/contracts/src/token/psp22/extensions/wrapper.rs) extension, which allows you to wrap your `PSP22` token in a `PSP22Wrapper` token which can be used for example for governance. ## Step 1: Include dependencies @@ -69,6 +69,6 @@ impl MyPSP22 { } ``` -You can check an example of the usage of [PSP22 Wrapper](https://github.com/Supercolony-net/openbrush-contracts/tree/main/examples/psp22_extensions/wrapper). +You can check an example of the usage of [PSP22 Wrapper](https://github.com/Supercolony-net/openbrush-contracts/tree/master/examples/psp22_extensions/wrapper). -You can also check the documentation for the basic implementation of [PSP22](/smart-contracts/PSP22/psp22). \ No newline at end of file +You can also check the documentation for the basic implementation of [PSP22](/smart-contracts/PSP22). \ No newline at end of file diff --git a/docs/docs/smart-contracts/PSP22/Utils/token-timelock.md b/docs/docs/smart-contracts/PSP22/Utils/token-timelock.md index 550f883cd..b1d2f5b8e 100644 --- a/docs/docs/smart-contracts/PSP22/Utils/token-timelock.md +++ b/docs/docs/smart-contracts/PSP22/Utils/token-timelock.md @@ -3,7 +3,7 @@ sidebar_position: 1 title: PSP22 Token Timelock --- -This example shows how you can reuse the implementation of [PSP22 Token Timelock](https://github.com/Supercolony-net/openbrush-contracts/tree/main/contracts/token/psp22/src/utils/token_timelock.rs) utility for [PSP22](https://github.com/Supercolony-net/openbrush-contracts/tree/main/contracts/token/psp22). This contract will lock user's `PSP22` tokens until the time specified, when they can withdraw them. +This example shows how you can reuse the implementation of [PSP22 Token Timelock](https://github.com/Supercolony-net/openbrush-contracts/tree/master/contracts/src/token/psp22/src/utils/token_timelock.rs) utility for [PSP22](https://github.com/Supercolony-net/openbrush-contracts/tree/master/contracts/src/token/psp22). This contract will lock user's `PSP22` tokens until the time specified, when they can withdraw them. ## Step 1: Include dependencies @@ -65,6 +65,6 @@ impl MyPSP22TokenTimelock { } ``` -You can check an example of the usage of [PSP22 Token Timelock](https://github.com/Supercolony-net/openbrush-contracts/tree/main/examples/psp22_utils/token_timelock). +You can check an example of the usage of [PSP22 Token Timelock](https://github.com/Supercolony-net/openbrush-contracts/tree/master/examples/psp22_utils/token_timelock). -You can also check the documentation for the basic implementation of [PSP22](/smart-contracts/PSP22/psp22). \ No newline at end of file +You can also check the documentation for the basic implementation of [PSP22](/smart-contracts/PSP22). \ No newline at end of file diff --git a/docs/docs/smart-contracts/PSP22/psp22.md b/docs/docs/smart-contracts/PSP22/psp22.md index e92cd7081..09afbbd61 100644 --- a/docs/docs/smart-contracts/PSP22/psp22.md +++ b/docs/docs/smart-contracts/PSP22/psp22.md @@ -3,7 +3,7 @@ sidebar_position: 1 title: PSP22 --- -This example shows how you can reuse the implementation of [PSP22](https://github.com/Supercolony-net/openbrush-contracts/tree/main/contracts/token/psp22) token. Also, this example shows how you can customize the logic, for example, to reject transferring tokens to `hated_account`. +This example shows how you can reuse the implementation of [PSP22](https://github.com/Supercolony-net/openbrush-contracts/tree/master/contracts/src/token/psp22) token. Also, this example shows how you can customize the logic, for example, to reject transferring tokens to `hated_account`. ## Step 1: Include dependencies @@ -122,7 +122,7 @@ impl MyPSP22 { } ``` -You can check an example of the usage of [PSP22](https://github.com/Supercolony-net/openbrush-contracts/tree/main/examples/psp22). +You can check an example of the usage of [PSP22](https://github.com/Supercolony-net/openbrush-contracts/tree/master/examples/psp22). Also you can use extensions for PSP22 token: diff --git a/docs/docs/smart-contracts/PSP34/Extensions/burnable.md b/docs/docs/smart-contracts/PSP34/Extensions/burnable.md index a35d87b1b..d1e1a1eae 100644 --- a/docs/docs/smart-contracts/PSP34/Extensions/burnable.md +++ b/docs/docs/smart-contracts/PSP34/Extensions/burnable.md @@ -3,7 +3,7 @@ sidebar_position: 3 title: PSP34 Burnable --- -This example shows how you can reuse the implementation of [PSP34](https://github.com/Supercolony-net/openbrush-contracts/tree/main/contracts/token/psp34) token with [PSP34Burnable](https://github.com/Supercolony-net/openbrush-contracts/tree/main/contracts/token/psp34/src/extensions/burnable.rs) extension. +This example shows how you can reuse the implementation of [PSP34](https://github.com/Supercolony-net/openbrush-contracts/tree/master/contracts/src/token/psp34) token with [PSP34Burnable](https://github.com/Supercolony-net/openbrush-contracts/tree/master/contracts/src/token/psp34/src/extensions/burnable.rs) extension. ## How to use this extension @@ -16,6 +16,6 @@ impl PSP34Burnable for MyPSP34 {} ``` And that's it! Your `PSP34` is now extended by the `PSP34Burnable` extension and ready to use its functions! -You can check an example of the usage of [PSP34 Burnable](https://github.com/Supercolony-net/openbrush-contracts/tree/main/examples/psp34_extensions/burnable). +You can check an example of the usage of [PSP34 Burnable](https://github.com/Supercolony-net/openbrush-contracts/tree/master/examples/psp34_extensions/burnable). -You can also check the documentation for the basic implementation of [PSP34](/smart-contracts/PSP34/psp34). +You can also check the documentation for the basic implementation of [PSP34](/smart-contracts/PSP34). diff --git a/docs/docs/smart-contracts/PSP34/Extensions/metadata.md b/docs/docs/smart-contracts/PSP34/Extensions/metadata.md index 5bd568539..1fdabb2a5 100644 --- a/docs/docs/smart-contracts/PSP34/Extensions/metadata.md +++ b/docs/docs/smart-contracts/PSP34/Extensions/metadata.md @@ -3,7 +3,7 @@ sidebar_position: 1 title: PSP34 Metadata --- -This example shows how you can reuse the implementation of [PSP34](https://github.com/Supercolony-net/openbrush-contracts/tree/main/contracts/token/psp34) token with [PSP34Metadata](https://github.com/Supercolony-net/openbrush-contracts/tree/main/contracts/token/psp34/src/extensions/metadata.rs) extension. +This example shows how you can reuse the implementation of [PSP34](https://github.com/Supercolony-net/openbrush-contracts/tree/master/contracts/src/token/psp34) token with [PSP34Metadata](https://github.com/Supercolony-net/openbrush-contracts/tree/master/contracts/src/token/psp34/src/extensions/metadata.rs) extension. ## Step 1: Include dependencies @@ -73,6 +73,6 @@ impl MyPSP34 { } ``` -You can check an example of the usage of [PSP34 Metadata](https://github.com/Supercolony-net/openbrush-contracts/tree/main/examples/psp34_extensions/metadata). +You can check an example of the usage of [PSP34 Metadata](https://github.com/Supercolony-net/openbrush-contracts/tree/master/examples/psp34_extensions/metadata). -You can also check the documentation for the basic implementation of [PSP34](/smart-contracts/PSP34/psp34). +You can also check the documentation for the basic implementation of [PSP34](/smart-contracts/PSP34). diff --git a/docs/docs/smart-contracts/PSP34/Extensions/mintable.md b/docs/docs/smart-contracts/PSP34/Extensions/mintable.md index 091fd5fbd..79599601f 100644 --- a/docs/docs/smart-contracts/PSP34/Extensions/mintable.md +++ b/docs/docs/smart-contracts/PSP34/Extensions/mintable.md @@ -3,7 +3,7 @@ sidebar_position: 2 title: PSP34 Mintable --- -This example shows how you can reuse the implementation of [PSP34](https://github.com/Supercolony-net/openbrush-contracts/tree/main/contracts/token/psp34) token with [PSP34Mintable](https://github.com/Supercolony-net/openbrush-contracts/tree/main/contracts/token/psp34/src/extensions/mintable.rs) extension. +This example shows how you can reuse the implementation of [PSP34](https://github.com/Supercolony-net/openbrush-contracts/tree/master/contracts/src/token/psp34) token with [PSP34Mintable](https://github.com/Supercolony-net/openbrush-contracts/tree/master/contracts/src/token/psp34/src/extensions/mintable.rs) extension. ## How to use this extension @@ -16,6 +16,6 @@ impl PSP34Mintable for MyPSP34 {} ``` And that's it! Your `PSP34` is now extended by the `PSP34Mintable` extension and ready to use its functions! -You can check an example of the usage of [PSP34 Mintable](https://github.com/Supercolony-net/openbrush-contracts/tree/main/examples/psp34_extensions/mintable). +You can check an example of the usage of [PSP34 Mintable](https://github.com/Supercolony-net/openbrush-contracts/tree/master/examples/psp34_extensions/mintable). -You can also check the documentation for the basic implementation of [PSP34](/smart-contracts/PSP34/psp34). +You can also check the documentation for the basic implementation of [PSP34](/smart-contracts/PSP34). diff --git a/docs/docs/smart-contracts/PSP34/psp34.md b/docs/docs/smart-contracts/PSP34/psp34.md index 3c4b05446..f69d0dc4c 100644 --- a/docs/docs/smart-contracts/PSP34/psp34.md +++ b/docs/docs/smart-contracts/PSP34/psp34.md @@ -3,7 +3,7 @@ sidebar_position: 1 title: PSP34 --- -This example shows how you can reuse the implementation of [PSP34](https://github.com/Supercolony-net/openbrush-contracts/tree/main/contracts/token/psp34) token. Also, this example shows how you can customize the logic, for example, to track the number of tokens minted with `next_id`, increasing it with each new token minted, securing a unique id for each token. +This example shows how you can reuse the implementation of [PSP34](https://github.com/Supercolony-net/openbrush-contracts/tree/master/contracts/src/token/psp34) token. Also, this example shows how you can customize the logic, for example, to track the number of tokens minted with `next_id`, increasing it with each new token minted, securing a unique id for each token. ## Step 1: Include dependencies @@ -93,7 +93,7 @@ impl MyPSP34 { } ``` -You can check an example of the usage of [PSP34](https://github.com/Supercolony-net/openbrush-contracts/tree/main/examples/psp34). +You can check an example of the usage of [PSP34](https://github.com/Supercolony-net/openbrush-contracts/tree/master/examples/psp34). Also you can use extensions for psp34 token: [PSP34Metadata](/smart-contracts/PSP34/extensions/metadata): metadata for PSP34. diff --git a/docs/docs/smart-contracts/access-control.md b/docs/docs/smart-contracts/access-control.md index 70f041ed8..f5e85a3a5 100644 --- a/docs/docs/smart-contracts/access-control.md +++ b/docs/docs/smart-contracts/access-control.md @@ -3,7 +3,7 @@ sidebar_position: 2 title: Access Control --- -This example shows how you can use the implementation of [access-control](https://github.com/Supercolony-net/openbrush-contracts/tree/main/contracts/access/access_control) to provide rights for usage of specific smart contract functions. +This example shows how you can use the implementation of [access-control](https://github.com/Supercolony-net/openbrush-contracts/tree/master/contracts/src/access/access_control) to provide rights for usage of specific smart contract functions. ## Step 1: Include dependencies @@ -118,4 +118,4 @@ pub mod my_access_control { } ``` -You can check an example of the usage of [Access Control](https://github.com/Supercolony-net/openbrush-contracts/tree/main/examples/access_control). \ No newline at end of file +You can check an example of the usage of [Access Control](https://github.com/Supercolony-net/openbrush-contracts/tree/master/examples/access_control). \ No newline at end of file diff --git a/docs/docs/smart-contracts/diamond.md b/docs/docs/smart-contracts/diamond.md index f9da4ba9b..a10e42860 100644 --- a/docs/docs/smart-contracts/diamond.md +++ b/docs/docs/smart-contracts/diamond.md @@ -3,7 +3,7 @@ sidebar_position: 4 title: Diamond Standard --- -This example shows how you can use the implementation of [diamond standard](https://github.com/Supercolony-net/openbrush-contracts/tree/main/contracts/upgradability/diamond) to implement diamond standard pattern for upgradeable and unlimited contracts. +This example shows how you can use the implementation of [diamond standard](https://github.com/Supercolony-net/openbrush-contracts/tree/master/contracts/src/upgradability/diamond) to implement diamond standard pattern for upgradeable and unlimited contracts. ## Step 1: Include dependencies @@ -91,4 +91,4 @@ You can add more basic functionality for your diamond contract by adding functio When you create a new contract (facet), which you want to make delegate calls from your diamond contract to, you will call the `diamond_cut` function on your diamond contract, with the code hash of your new facet and the selectors of all the functions from this facet you want to use. The diamond will register them and anytime you call this function on your diamond contract, it will make the delegate call to the facet the function belongs to. You can add, remove or replace these functions anytime with the `diamond_cut` function, some of the limitations are, that you can not add functions with the same selectors, when replacing functions, the new function needs to be from a different contract, then currently in use, and when removing functions, the function needs to be registered in the diamond contract. -You can check an example of the usage of [Diamond](https://github.com/Supercolony-net/openbrush-contracts/tree/main/examples/diamond). +You can check an example of the usage of [Diamond](https://github.com/Supercolony-net/openbrush-contracts/tree/master/examples/diamond). diff --git a/docs/docs/smart-contracts/example/data.md b/docs/docs/smart-contracts/example/data.md index 8cdb66892..100f31ede 100644 --- a/docs/docs/smart-contracts/example/data.md +++ b/docs/docs/smart-contracts/example/data.md @@ -103,13 +103,13 @@ impl Point for PointContract {} ## Macros from OpenBrush Some macros from OpenBrush allows to remove boilerplate code and simplify the development: -- [`declare_storage_trait!`](https://github.com/Supercolony-net/openbrush-contracts/blob/main/utils/lang/macros.rs#L9) +- [`declare_storage_trait!`](https://github.com/Supercolony-net/openbrush-contracts/blob/main/lang/macro/src/lib.rs) macro define the storage like described in the [Storage trait](/smart-contracts/example/data#storage-trait) ```rust use openbrush::declare_storage_trait; declare_storage_trait!(PointStorage, PointData); ``` -- [`impl_storage_trait!`](https://github.com/Supercolony-net/openbrush-contracts/blob/main/utils/lang/macros.rs#L27) +- [`impl_storage_trait!`](https://github.com/Supercolony-net/openbrush-contracts/blob/main/lang/macro/src/lib.rs) macro implements the storage trait for the contract and return the field from that contract of the data type ```rust use openbrush::impl_storage_trait; diff --git a/docs/docs/smart-contracts/example/impls.md b/docs/docs/smart-contracts/example/impls.md index 833af0d82..0f6213474 100644 --- a/docs/docs/smart-contracts/example/impls.md +++ b/docs/docs/smart-contracts/example/impls.md @@ -312,7 +312,7 @@ Derive macro for `LendingStorage` is created by the [description](/smart-contrac The all methods in `LendingPermissioned` are restricted and requires `#[modifiers(only_role(MANAGER))]`. That means that only accounts with `MANAGER` role can execute these methods. -Usage of `only_role` modifier from [access_control](https://github.com/Supercolony-net/openbrush-contracts/blob/main/contracts/access/access_control/mod.rs#L30) +Usage of `only_role` modifier from [access_control](https://github.com/Supercolony-net/openbrush-contracts/blob/main/contracts/src/access/access_control/mod.rs#L30) requires that the contract should implement `AccessControlStorage`. For that we also require the same restriction on the generic type. @@ -320,7 +320,7 @@ In the implementation of `LendingPermissioned`, we want to use methods from `Lending`. For that, the set of restrictions for generic in the `Lending` implementation should be a subset(<=) of restrictions for generic in the `LendingPermissioned` implementation. The `Lending` implementation requires `LendingStorage` and `PausableStorage` to use `when_paused` -modifier from [pausable](https://github.com/Supercolony-net/openbrush-contracts/blob/main/contracts/security/pausable/mod.rs#L24). +modifier from [pausable](https://github.com/Supercolony-net/openbrush-contracts/blob/main/contracts/src/security/pausable/mod.rs#L24). So we should have the same restriction in our generic implementation. In the logic of the trait `LendingPermissioned` we need to instantiate @@ -471,7 +471,7 @@ fn set_collateral_accepted(instance: &mut T, asset_address: A The same logic is used during definition of the implementation for `Lending` trait. The `PausableStorage` restriction is required to use `when_paused`, `when_not_paused` modifiers -from [pausable](https://github.com/Supercolony-net/openbrush-contracts/blob/main/contracts/security/pausable/mod.rs#L24). +from [pausable](https://github.com/Supercolony-net/openbrush-contracts/blob/main/contracts/src/security/pausable/mod.rs#L24). ```rust // importing everything publicly from traits allows you to import every stuff related to lending diff --git a/docs/docs/smart-contracts/example/loan.md b/docs/docs/smart-contracts/example/loan.md index 3578ebe37..c52dc4d64 100644 --- a/docs/docs/smart-contracts/example/loan.md +++ b/docs/docs/smart-contracts/example/loan.md @@ -3,7 +3,7 @@ sidebar_position: 5 title: Loan contract --- -In our project we will also implement [PSP-34](/smart-contracts/PSP34/psp34) +In our project we will also implement [PSP-34](/smart-contracts/PSP34) token. This token will represent a loan of a user who borrowed some assets. Upon borrowing assets the contract will mint an NFT to them, which will hold the information about their loan, namely the user who borrowed the assets, @@ -103,7 +103,7 @@ pub trait Loan: PSP34 + PSP34Metadata + Ownable { ## Add dependencies -In addition to the dependencies imported in the [PSP-34](/smart-contracts/PSP34/psp34) +In addition to the dependencies imported in the [PSP-34](/smart-contracts/PSP34) documentation, we will also add the `ownable` dependency the same way as in the [ownable](/smart-contracts/ownable) documentation. We will be using `LoanContract` as a dependency in our lending contract to instantiate it. So we need to also add @@ -111,7 +111,7 @@ the `"rlib"` crate type to have the ability to import the `LoanContract` as a de ## Implement the contract -We want a basic [PSP-34](/smart-contracts/PSP34/psp34) token with metadata and ownable extensions, +We want a basic [PSP-34](/smart-contracts/PSP34) token with metadata and ownable extensions, so we will add these to our contract. We will add a `openbrush::contract` macro to our contract and add some imports: ```rust diff --git a/docs/docs/smart-contracts/example/overview.md b/docs/docs/smart-contracts/example/overview.md index 4cc0f0b65..ec5444bb3 100644 --- a/docs/docs/smart-contracts/example/overview.md +++ b/docs/docs/smart-contracts/example/overview.md @@ -5,15 +5,15 @@ title: Overview This example will show you how you can reuse OpenBrush smart contracts and macros in your project to ease the development process. We will also pay attention to the project structure to keep the maintenance and future development of the project simple. -We will be implementing a simple lending protocol, in which users can lend [PSP-22](/smart-contracts/PSP22/psp22) tokens, borrow them against a collateral token, repay their loans with interest, and of course withdraw the deposited assets. We will create a [PSP-22](/smart-contracts/PSP22/psp22) implementation which will be used for a stable coin and a collateral token, another [PSP-22](/smart-contracts/PSP22/psp22) token which will represent the shares of assets in the contract, [PSP-34](/smart-contracts/PSP34/psp34) token which will represent the loans and the lending contract itself. The simple [PSP-22](/smart-contracts/PSP22/psp22) token implementation will be created just for this example and to test the contract's functions. The contract will have the following features: +We will be implementing a simple lending protocol, in which users can lend [PSP-22](/smart-contracts/PSP22) tokens, borrow them against a collateral token, repay their loans with interest, and of course withdraw the deposited assets. We will create a [PSP-22](/smart-contracts/PSP22) implementation which will be used for a stable coin and a collateral token, another [PSP-22](/smart-contracts/PSP22) token which will represent the shares of assets in the contract, [PSP-34](/smart-contracts/PSP34) token which will represent the loans and the lending contract itself. The simple [PSP-22](/smart-contracts/PSP22) token implementation will be created just for this example and to test the contract's functions. The contract will have the following features: ## Lending of assets accepted by the smart contract -Users can lend [PSP-22](/smart-contracts/PSP22/psp22) tokens, which are accepted by the contract. The allowance of lending specific tokens is decided in the smart contract by the accounts which have the Manager role. Upon lending the user gets a [PSP-22](/smart-contracts/PSP22/psp22) token representing their share of the asset pool. +Users can lend [PSP-22](/smart-contracts/PSP22) tokens, which are accepted by the contract. The allowance of lending specific tokens is decided in the smart contract by the accounts which have the Manager role. Upon lending the user gets a [PSP-22](/smart-contracts/PSP22) token representing their share of the asset pool. ## Borrowing of assets by depositing accepted assets as collateral -Users can borrow [PSP-22](/smart-contracts/PSP22/psp22) tokens, which are available in the contract. To borrow an asset, the user has to deposit an accepted [PSP-22](/smart-contracts/PSP22/psp22) token as collateral. The allowance of specific tokens being used as collateral is decided in the smart contract by the accounts which have the Manager role. The value of the borrowed assets can be equal at most to 70% of the value of the deposited collateral. If the value of the deposited collateral drops to or below 75% of the original value, the loan can be liquidated. Upon borrowing the assets user gets a [PSP-34](/smart-contracts/PSP34/psp34) token representing info about their loan (how much assets were borrowed, when did they borrow, what asset was borrowed, what asset was used as collateral, amount of collateral asset deposited, the liquidation price of the loan and if it was liquidated or not). This NFT token can be then used to repay the loan and get the collateral back. +Users can borrow [PSP-22](/smart-contracts/PSP22) tokens, which are available in the contract. To borrow an asset, the user has to deposit an accepted [PSP-22](/smart-contracts/PSP22) token as collateral. The allowance of specific tokens being used as collateral is decided in the smart contract by the accounts which have the Manager role. The value of the borrowed assets can be equal at most to 70% of the value of the deposited collateral. If the value of the deposited collateral drops to or below 75% of the original value, the loan can be liquidated. Upon borrowing the assets user gets a [PSP-34](/smart-contracts/PSP34) token representing info about their loan (how much assets were borrowed, when did they borrow, what asset was borrowed, what asset was used as collateral, amount of collateral asset deposited, the liquidation price of the loan and if it was liquidated or not). This NFT token can be then used to repay the loan and get the collateral back. ## Repaying the loan diff --git a/docs/docs/smart-contracts/example/psp22.md b/docs/docs/smart-contracts/example/psp22.md index 8dbe5f34b..442679aa4 100644 --- a/docs/docs/smart-contracts/example/psp22.md +++ b/docs/docs/smart-contracts/example/psp22.md @@ -3,11 +3,11 @@ sidebar_position: 3 title: Implement PSP-22 contract --- -First, we will cover the implementation of [PSP-22](/smart-contracts/PSP22/psp22) +First, we will cover the implementation of [PSP-22](/smart-contracts/PSP22) token used by our smart contract, which will represent the stable coin that we will be -lending and another [PSP-22](/smart-contracts/PSP22/psp22) token which we will be +lending and another [PSP-22](/smart-contracts/PSP22) token which we will be using as collateral. These are used just to test our example, you will not be creating -an actual [PSP-22](/smart-contracts/PSP22/psp22) implementation of stable coin or collateral +an actual [PSP-22](/smart-contracts/PSP22) implementation of stable coin or collateral token in your lending protocol, but this will also showcase how to implement a basic implementation of a fungible token with OpenBrush. @@ -34,14 +34,14 @@ pub trait StableCoin: PSP22 + PSP22Metadata {} ## Add dependencies -First we will add the dependencies used in our [PSP-22](/smart-contracts/PSP22/psp22) +First we will add the dependencies used in our [PSP-22](/smart-contracts/PSP22) contract to the `Cargo.toml` file. You will import the same dependencies as in -the [PSP-22](/smart-contracts/PSP22/psp22) documentation, so we will not show +the [PSP-22](/smart-contracts/PSP22) documentation, so we will not show it here to keep it simple. ## Implement the contract -We want a basic [PSP-22](/smart-contracts/PSP22/psp22) token with metadata, +We want a basic [PSP-22](/smart-contracts/PSP22) token with metadata, so we will add the [PSP-22 Metadata](/smart-contracts/PSP22/extensions/metadata) extension to our contract. We will add a `openbrush::contract` macro to our contract and add some imports: diff --git a/docs/docs/smart-contracts/example/shares.md b/docs/docs/smart-contracts/example/shares.md index ee5636ed0..b36cdeb66 100644 --- a/docs/docs/smart-contracts/example/shares.md +++ b/docs/docs/smart-contracts/example/shares.md @@ -3,7 +3,7 @@ sidebar_position: 4 title: Shares contract --- -Similarly, we will implement another [PSP-22](/smart-contracts/PSP22/psp22) token +Similarly, we will implement another [PSP-22](/smart-contracts/PSP22) token which will represent the ownership of assets available by the smart contract to be lent. In this token, we will need [PSP-22 Metadata](/smart-contracts/PSP22/extensions/metadata) and we will also need to mint and burn this token. We only want our contract(lending contract) to @@ -39,7 +39,7 @@ pub trait Shares: PSP22 + PSP22Mintable + PSP22Burnable + PSP22Metadata + Ownabl ## Add dependencies -In addition to the dependencies imported in the [PSP-22](/smart-contracts/PSP22/psp22) +In addition to the dependencies imported in the [PSP-22](/smart-contracts/PSP22) documentation, we will also add the `ownable` dependency the same way as in the [ownable](/smart-contracts/ownable) documentation. We will be using `SharesContract` as a dependency in our lending contract to instantiate it. So we need to also add diff --git a/docs/docs/smart-contracts/overview.md b/docs/docs/smart-contracts/overview.md index b140a63c7..b5641788e 100644 --- a/docs/docs/smart-contracts/overview.md +++ b/docs/docs/smart-contracts/overview.md @@ -46,8 +46,8 @@ ink-as-dependency = [] To avoid unexpected compilation errors better to always import all ink! crates. -By default, the `openbrush` crate provides [macros](https://github.com/Supercolony-net/openbrush-contracts/blob/main/lang/proc_macros/lib.rs) -for simplification of the development and [traits](https://github.com/Supercolony-net/openbrush-contracts/tree/main/contracts/traits) of +By default, the `openbrush` crate provides [macros](https://github.com/Supercolony-net/openbrush-contracts/blob/main/lang/macro/lib.rs) +for simplification of the development and [traits](https://github.com/Supercolony-net/openbrush-contracts/tree/master/contracts/src/traits) of contracts(you can implement them by yourself, and you can use them for a cross-contract calls). The OpenBrush also provides the default implementation of traits that can be enabled via crate features. @@ -64,7 +64,7 @@ You can enable it by adding `#![feature(min_specialization)]` at the top of your Also, that doc contains links to the examples of how to reuse and customize the default implementation of traits. * [PSP22](PSP22/psp22.md) is an example of how you can reuse the implementation of - [psp22](https://github.com/Supercolony-net/openbrush-contracts/tree/main/contracts/token/psp22). You also can find examples of how to reuse extensions. + [psp22](https://github.com/Supercolony-net/openbrush-contracts/tree/master/contracts/src/token/psp22). You also can find examples of how to reuse extensions. * [PSP22Metadata](PSP22/Extensions/metadata.md): metadata for PSP22. * [PSP22Mintable](PSP22/Extensions/mintable.md): creation of new tokens. * [PSP22Burnable](PSP22/Extensions/burnable.md): destruction of own tokens. @@ -74,30 +74,30 @@ Also, that doc contains links to the examples of how to reuse and customize the * [PSP22Capped](PSP22/Extensions/capped.md): extension which adds a cap for total supply of PSP22 tokens. * [PSP22TokenTimelock](PSP22/Utils/token-timelock.md): Utility which allows token holders to lock their tokens for a specified amount of time. * [PSP34](PSP34/psp34.md) is an example of how you can reuse the implementation of - [psp34](https://github.com/Supercolony-net/openbrush-contracts/tree/main/contracts/token/psp34). You also can find examples of how to reuse extensions. + [psp34](https://github.com/Supercolony-net/openbrush-contracts/tree/master/contracts/src/token/psp34). You also can find examples of how to reuse extensions. * [PSP34Metadata](PSP34/Extensions/metadata.md): metadata for PSP34. * [PSP34Mintable](PSP34/Extensions/mintable.md): creation of new tokens. * [PSP34Burnable](PSP34/Extensions/burnable.md): destruction of own tokens. * [PSP1155](PSP1155/psp1155.md) is an example of how you can reuse the implementation of - [psp1155](https://github.com/Supercolony-net/openbrush-contracts/tree/main/contracts/token/psp1155). You also can find examples of how to reuse extensions. + [psp1155](https://github.com/Supercolony-net/openbrush-contracts/tree/master/contracts/src/token/psp1155). You also can find examples of how to reuse extensions. * [PSP1155Metadata](PSP1155/Extensions/metadata.md): metadata for PSP1155. * [PSP1155Mintable](PSP1155/Extensions/mintable.md): creation of new tokens. * [PSP1155Burnable](PSP1155/Extensions/burnable.md): destruction of own tokens. * [Access Control](access-control.md) shows how you can use the implementation of - [access-control](https://github.com/Supercolony-net/openbrush-contracts/tree/main/contracts/access/access_control) and - [psp34](https://github.com/Supercolony-net/openbrush-contracts/tree/main/contracts/token/psp34) together to provide rights to mint and burn NFT tokens. + [access-control](https://github.com/Supercolony-net/openbrush-contracts/tree/master/contracts/src/access/access_control) and + [psp34](https://github.com/Supercolony-net/openbrush-contracts/tree/master/contracts/src/token/psp34) together to provide rights to mint and burn NFT tokens. * [Ownable](ownable.md) shows how you can use the implementation of - [ownable](https://github.com/Supercolony-net/openbrush-contracts/tree/main/contracts/access/ownable) and - [psp1155](https://github.com/Supercolony-net/openbrush-contracts/tree/main/contracts/token/psp1155) together to provide rights to mint and burn tokens. + [ownable](https://github.com/Supercolony-net/openbrush-contracts/tree/master/contracts/src/access/ownable) and + [psp1155](https://github.com/Supercolony-net/openbrush-contracts/tree/master/contracts/src/token/psp1155) together to provide rights to mint and burn tokens. * [ReentrancyGuard](reentrancy-guard.md) shows how you can use the implementation of - [non_reentrant](https://github.com/Supercolony-net/openbrush-contracts/tree/main/contracts/security/reentrancy_guard) + [non_reentrant](https://github.com/Supercolony-net/openbrush-contracts/tree/master/contracts/src/security/reentrancy_guard) modifier to prevent reentrancy during certain functions. * [Pausable](pausable.md) shows how you can use the implementation of - [pausable](https://github.com/Supercolony-net/openbrush-contracts/tree/main/contracts/security/pausable) + [pausable](https://github.com/Supercolony-net/openbrush-contracts/tree/master/contracts/src/security/pausable) contract and modifiers. * [TimelockController](timelock-controller.md) shows how you can use the implementation of - [timelock-controller](https://github.com/Supercolony-net/openbrush-contracts/tree/main/contracts/governance/timelock_controller) + [timelock-controller](https://github.com/Supercolony-net/openbrush-contracts/tree/master/contracts/src/governance/timelock_controller) to execute a transaction with some delay via governance. * [PaymentSplitter](payment-splitter.md) shows how you can use the implementation of - [payment-splitter](https://github.com/Supercolony-net/openbrush-contracts/tree/main/contracts/finance/payment_splitter) + [payment-splitter](https://github.com/Supercolony-net/openbrush-contracts/tree/master/contracts/src/finance/payment_splitter) to split received native tokens between participants of the contract. \ No newline at end of file diff --git a/docs/docs/smart-contracts/ownable.md b/docs/docs/smart-contracts/ownable.md index cf778a14e..bfff96660 100644 --- a/docs/docs/smart-contracts/ownable.md +++ b/docs/docs/smart-contracts/ownable.md @@ -3,7 +3,7 @@ sidebar_position: 3 title: Ownable --- -This example shows how you can use the implementation of [ownable](https://github.com/Supercolony-net/openbrush-contracts/tree/main/contracts/access/ownable) to provide `only owner` rights for contract's functions. +This example shows how you can use the implementation of [ownable](https://github.com/Supercolony-net/openbrush-contracts/tree/master/contracts/src/access/ownable) to provide `only owner` rights for contract's functions. ## Step 1: Include dependencies @@ -115,4 +115,4 @@ pub mod my_ownable { ``` -You can check an example of the usage of [Ownable](https://github.com/Supercolony-net/openbrush-contracts/tree/main/examples/ownable). +You can check an example of the usage of [Ownable](https://github.com/Supercolony-net/openbrush-contracts/tree/master/examples/ownable). diff --git a/docs/docs/smart-contracts/pausable.md b/docs/docs/smart-contracts/pausable.md index fa3f46fe6..04fb81f38 100644 --- a/docs/docs/smart-contracts/pausable.md +++ b/docs/docs/smart-contracts/pausable.md @@ -4,7 +4,7 @@ title: Pausable --- This example shows how you can reuse the implementation of -[pausable](https://github.com/Supercolony-net/openbrush-contracts/tree/main/contracts/security/pausable) in `Flipper` contract to `flip` only if the contract is not paused. +[pausable](https://github.com/Supercolony-net/openbrush-contracts/tree/master/contracts/src/security/pausable) in `Flipper` contract to `flip` only if the contract is not paused. ## Step 1: Include dependencies @@ -117,4 +117,4 @@ pub mod my_pausable { } ``` -You can check an example of the usage of [Pausable](https://github.com/Supercolony-net/openbrush-contracts/tree/main/examples/pausable). +You can check an example of the usage of [Pausable](https://github.com/Supercolony-net/openbrush-contracts/tree/master/examples/pausable). diff --git a/docs/docs/smart-contracts/payment-splitter.md b/docs/docs/smart-contracts/payment-splitter.md index 3ec004a29..ac5e6db43 100644 --- a/docs/docs/smart-contracts/payment-splitter.md +++ b/docs/docs/smart-contracts/payment-splitter.md @@ -4,7 +4,7 @@ title: Payment Splitter --- This example shows how you can reuse the implementation of -[payment-splitter](https://github.com/Supercolony-net/openbrush-contracts/tree/main/contracts/finance/payment_splitter). +[payment-splitter](https://github.com/Supercolony-net/openbrush-contracts/tree/master/contracts/src/finance/payment_splitter). ## Step 1: Include dependencies @@ -72,7 +72,7 @@ impl SplitterStruct { } ``` -You can check an example of the usage of [PaymentSplitter](https://github.com/Supercolony-net/openbrush-contracts/tree/main/examples/payment_splitter). +You can check an example of the usage of [PaymentSplitter](https://github.com/Supercolony-net/openbrush-contracts/tree/master/examples/payment_splitter). ## Step 6 (Optional): Customize your contract diff --git a/docs/docs/smart-contracts/proxy.md b/docs/docs/smart-contracts/proxy.md index ae5891e1f..bb0ebb61b 100644 --- a/docs/docs/smart-contracts/proxy.md +++ b/docs/docs/smart-contracts/proxy.md @@ -3,7 +3,7 @@ sidebar_position: 3 title: Proxy --- -This example shows how you can use the implementation of [proxy](https://github.com/Supercolony-net/openbrush-contracts/tree/main/contracts/upgradability/proxy) to to implement proxy pattern for upgradeable contracts. +This example shows how you can use the implementation of [proxy](https://github.com/Supercolony-net/openbrush-contracts/tree/master/contracts/src/upgradability/proxy) to to implement proxy pattern for upgradeable contracts. ## Step 1: Include dependencies @@ -102,4 +102,4 @@ impl ProxyContract { Generally, proxy doesn't need other functionality, but if you need something you can customize it by adding proxy logic. We will add a `proxy_function` to `ProxyContract` implemenation. -You can check an example of the usage of [Proxy](https://github.com/Supercolony-net/openbrush-contracts/tree/main/examples/proxy). +You can check an example of the usage of [Proxy](https://github.com/Supercolony-net/openbrush-contracts/tree/master/examples/proxy). diff --git a/docs/docs/smart-contracts/reentrancy-guard.md b/docs/docs/smart-contracts/reentrancy-guard.md index 916fde6d7..e7c987218 100644 --- a/docs/docs/smart-contracts/reentrancy-guard.md +++ b/docs/docs/smart-contracts/reentrancy-guard.md @@ -3,7 +3,7 @@ sidebar_position: 5 title: Reentrancy Guard --- -This example shows how you can use the [non_reentrant](https://github.com/Supercolony-net/openbrush-contracts/tree/main/contracts/security/reentrancy_guard) +This example shows how you can use the [non_reentrant](https://github.com/Supercolony-net/openbrush-contracts/tree/master/contracts/src/security/reentrancy_guard) modifier to prevent reentrancy into certain functions. In this example we will create two contracts: - `my_flipper_guard` - this contract is the simple version of [flipper](https://github.com/paritytech/ink/tree/master/examples/flipper), @@ -205,7 +205,7 @@ std = [ ] ``` -You can check an example of the usage of [ReentrancyGuard](https://github.com/Supercolony-net/openbrush-contracts/tree/main/examples/reentrancy_guard). +You can check an example of the usage of [ReentrancyGuard](https://github.com/Supercolony-net/openbrush-contracts/tree/master/examples/reentrancy_guard). ## Testing diff --git a/docs/docs/smart-contracts/timelock-controller.md b/docs/docs/smart-contracts/timelock-controller.md index de990206c..69bf128f1 100644 --- a/docs/docs/smart-contracts/timelock-controller.md +++ b/docs/docs/smart-contracts/timelock-controller.md @@ -4,7 +4,7 @@ title: Timelock Controller --- This example shows how you can reuse the implementation of -[timelock-controller](https://github.com/Supercolony-net/openbrush-contracts/tree/main/contracts/governance/timelock_controller). +[timelock-controller](https://github.com/Supercolony-net/openbrush-contracts/tree/master/contracts/src/governance/timelock_controller). ## Step 1: Include dependencies @@ -75,4 +75,4 @@ impl TimelockStruct { } ``` -You can check an example of the usage of [TimelockController](https://github.com/Supercolony-net/openbrush-contracts/tree/main/examples/timelock_controller). \ No newline at end of file +You can check an example of the usage of [TimelockController](https://github.com/Supercolony-net/openbrush-contracts/tree/master/examples/timelock_controller). \ No newline at end of file diff --git a/docs/package.json b/docs/package.json index 2ee9c7253..e92467968 100644 --- a/docs/package.json +++ b/docs/package.json @@ -1,6 +1,6 @@ { "name": "openbrush", - "version": "0.0.0", + "version": "1.8.0", "private": true, "scripts": { "docusaurus": "docusaurus", @@ -15,9 +15,9 @@ "typecheck": "tsc" }, "dependencies": { - "@docusaurus/core": "2.0.0-beta.5", - "@docusaurus/preset-classic": "2.0.0-beta.5", - "@docusaurus/theme-search-algolia": "^2.0.0-beta.5", + "@docusaurus/core": "2.0.0-beta.21", + "@docusaurus/preset-classic": "2.0.0-beta.21", + "@docusaurus/theme-search-algolia": "^2.0.0-beta.21", "@mdx-js/react": "^1.6.21", "@svgr/webpack": "^5.5.0", "clsx": "^1.1.1", @@ -30,7 +30,7 @@ "url-loader": "^4.1.1" }, "devDependencies": { - "@docusaurus/module-type-aliases": "2.0.0-beta.5", + "@docusaurus/module-type-aliases": "2.0.0-beta.21", "@tsconfig/docusaurus": "^1.0.3", "@types/react": "^17.0.14", "@types/react-helmet": "^6.1.2", From f39125f39a0ffe4959595b28086465bff4234405 Mon Sep 17 00:00:00 2001 From: xgreenx Date: Sat, 28 May 2022 02:57:37 +0200 Subject: [PATCH 08/10] Use new version of the node for docs --- .github/workflows/github_pages.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/github_pages.yml b/.github/workflows/github_pages.yml index e34847a17..0659b0772 100644 --- a/.github/workflows/github_pages.yml +++ b/.github/workflows/github_pages.yml @@ -17,6 +17,7 @@ jobs: node-version: '12.x' - name: Test Build run: | + n v16.15.0 cd docs if [ -e yarn.lock ]; then yarn install --frozen-lockfile @@ -42,6 +43,7 @@ jobs: USE_SSH: true GIT_USER: git run: | + n v16.15.0 cd docs git config --global user.email "actions@github.com" git config --global user.name "gh-actions" From b5a14b4ecf1fc935536d7a8d9774f29329223881 Mon Sep 17 00:00:00 2001 From: xgreenx Date: Sat, 28 May 2022 03:00:41 +0200 Subject: [PATCH 09/10] Use new version of the node for docs --- .github/workflows/github_pages.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/github_pages.yml b/.github/workflows/github_pages.yml index 0659b0772..e5b42fa60 100644 --- a/.github/workflows/github_pages.yml +++ b/.github/workflows/github_pages.yml @@ -14,10 +14,9 @@ jobs: - uses: actions/checkout@v1 - uses: actions/setup-node@v1 with: - node-version: '12.x' + node-version: '16.x' - name: Test Build run: | - n v16.15.0 cd docs if [ -e yarn.lock ]; then yarn install --frozen-lockfile @@ -34,7 +33,7 @@ jobs: - uses: actions/checkout@v1 - uses: actions/setup-node@v1 with: - node-version: '12.x' + node-version: '16.x' - uses: webfactory/ssh-agent@v0.5.0 with: ssh-private-key: ${{ secrets.GH_PAGES_DEPLOY }} @@ -43,7 +42,6 @@ jobs: USE_SSH: true GIT_USER: git run: | - n v16.15.0 cd docs git config --global user.email "actions@github.com" git config --global user.name "gh-actions" From cbdc74ae6f20a84e8c3ae675d2fe577ffddc4046 Mon Sep 17 00:00:00 2001 From: xgreenx Date: Sat, 28 May 2022 13:33:05 +0200 Subject: [PATCH 10/10] Hardcode the version --- Cargo.toml | 16 ++++++++-------- contracts/Cargo.toml | 14 +++++++------- docs/docs/smart-contracts/PSP1155/psp1155.md | 2 +- .../smart-contracts/PSP22/Extensions/capped.md | 2 +- .../smart-contracts/PSP22/Extensions/pausable.md | 2 +- .../smart-contracts/PSP22/Extensions/wrapper.md | 2 +- .../PSP22/Utils/token-timelock.md | 2 +- docs/docs/smart-contracts/PSP22/psp22.md | 2 +- .../smart-contracts/PSP34/Extensions/metadata.md | 2 +- docs/docs/smart-contracts/PSP34/psp34.md | 2 +- docs/docs/smart-contracts/access-control.md | 2 +- docs/docs/smart-contracts/diamond.md | 2 +- docs/docs/smart-contracts/example/contract.md | 12 ++++++------ docs/docs/smart-contracts/example/data.md | 2 +- docs/docs/smart-contracts/overview.md | 14 +++++++------- docs/docs/smart-contracts/ownable.md | 2 +- docs/docs/smart-contracts/pausable.md | 2 +- docs/docs/smart-contracts/payment-splitter.md | 2 +- docs/docs/smart-contracts/proxy.md | 2 +- docs/docs/smart-contracts/reentrancy-guard.md | 14 +++++++------- docs/docs/smart-contracts/timelock-controller.md | 2 +- example_project_structure/Cargo.toml | 12 ++++++------ .../contracts/lending/Cargo.toml | 12 ++++++------ .../contracts/loan/Cargo.toml | 12 ++++++------ .../contracts/shares/Cargo.toml | 12 ++++++------ .../contracts/stable_coin/Cargo.toml | 12 ++++++------ example_project_structure/derive/Cargo.toml | 2 +- examples/access_control/Cargo.toml | 12 ++++++------ examples/diamond/Cargo.toml | 12 ++++++------ examples/diamond/diamond_caller/Cargo.toml | 12 ++++++------ examples/diamond/psp22_facet_v1/Cargo.toml | 12 ++++++------ examples/diamond/psp22_facet_v2/Cargo.toml | 12 ++++++------ examples/diamond/psp22_metadata_facet/Cargo.toml | 12 ++++++------ examples/ownable/Cargo.toml | 12 ++++++------ examples/pausable/Cargo.toml | 12 ++++++------ examples/payment_splitter/Cargo.toml | 12 ++++++------ examples/proxy/Cargo.toml | 12 ++++++------ .../proxy/psp22_metadata_upgradeable/Cargo.toml | 12 ++++++------ examples/proxy/psp22_upgradeable/Cargo.toml | 12 ++++++------ examples/psp1155/Cargo.toml | 12 ++++++------ examples/psp1155_extensions/burnable/Cargo.toml | 12 ++++++------ examples/psp1155_extensions/metadata/Cargo.toml | 12 ++++++------ examples/psp1155_extensions/mintable/Cargo.toml | 12 ++++++------ examples/psp22/Cargo.toml | 12 ++++++------ examples/psp22_extensions/burnable/Cargo.toml | 12 ++++++------ examples/psp22_extensions/capped/Cargo.toml | 12 ++++++------ examples/psp22_extensions/flashmint/Cargo.toml | 12 ++++++------ examples/psp22_extensions/metadata/Cargo.toml | 12 ++++++------ examples/psp22_extensions/mintable/Cargo.toml | 12 ++++++------ examples/psp22_extensions/pausable/Cargo.toml | 12 ++++++------ examples/psp22_extensions/wrapper/Cargo.toml | 12 ++++++------ examples/psp22_utils/token_timelock/Cargo.toml | 12 ++++++------ examples/psp34/Cargo.toml | 12 ++++++------ examples/psp34_extensions/burnable/Cargo.toml | 12 ++++++------ examples/psp34_extensions/enumerable/Cargo.toml | 12 ++++++------ examples/psp34_extensions/metadata/Cargo.toml | 12 ++++++------ examples/psp34_extensions/mintable/Cargo.toml | 12 ++++++------ examples/reentrancy_guard/Cargo.toml | 12 ++++++------ .../contracts/flip_on_me/Cargo.toml | 12 ++++++------ .../contracts/flipper/Cargo.toml | 12 ++++++------ examples/timelock_controller/Cargo.toml | 12 ++++++------ lang/Cargo.toml | 10 +++++----- lang/codegen/Cargo.toml | 2 +- lang/macro/Cargo.toml | 14 +++++++------- mock/flash-borrower/Cargo.toml | 12 ++++++------ mock/psp1155-receiver/Cargo.toml | 12 ++++++------ mock/psp22-receiver/Cargo.toml | 12 ++++++------ mock/psp34-receiver/Cargo.toml | 12 ++++++------ 68 files changed, 323 insertions(+), 323 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index d81a9b9e8..2703292ca 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -27,18 +27,18 @@ categories = ["no-std", "embedded"] include = ["Cargo.toml", "src/**/*.rs"] [dependencies] -ink_primitives = { version = "3.2.0", default-features = false } -ink_metadata = { version = "3.2.0", default-features = false, features = ["derive"], optional = true } -ink_env = { version = "3.2.0", default-features = false } -ink_storage = { version = "3.2.0", default-features = false } -ink_lang = { version = "3.2.0", default-features = false } -ink_prelude = { version = "3.2.0", default-features = false } +ink_primitives = { version = "~3.2.0", default-features = false } +ink_metadata = { version = "~3.2.0", default-features = false, features = ["derive"], optional = true } +ink_env = { version = "~3.2.0", default-features = false } +ink_storage = { version = "~3.2.0", default-features = false } +ink_lang = { version = "~3.2.0", default-features = false } +ink_prelude = { version = "~3.2.0", default-features = false } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2", default-features = false, features = ["derive"], optional = true } -openbrush_contracts = { version = "1.8.0", path = "contracts", default-features = false } -openbrush_lang = { version = "1.8.0", path = "lang", default-features = false } +openbrush_contracts = { version = "~1.8.0", path = "contracts", default-features = false } +openbrush_lang = { version = "~1.8.0", path = "lang", default-features = false } [lib] name = "openbrush" diff --git a/contracts/Cargo.toml b/contracts/Cargo.toml index 94ea291c2..e3a67a4b6 100644 --- a/contracts/Cargo.toml +++ b/contracts/Cargo.toml @@ -15,18 +15,18 @@ categories = ["no-std", "embedded"] include = ["Cargo.toml", "src/**/*.rs"] [dependencies] -ink_primitives = { version = "3.2.0", default-features = false } -ink_metadata = { version = "3.2.0", default-features = false, features = ["derive"], optional = true } -ink_env = { version = "3.2.0", default-features = false } -ink_storage = { version = "3.2.0", default-features = false } -ink_lang = { version = "3.2.0", default-features = false } -ink_prelude = { version = "3.2.0", default-features = false } +ink_primitives = { version = "~3.2.0", default-features = false } +ink_metadata = { version = "~3.2.0", default-features = false, features = ["derive"], optional = true } +ink_env = { version = "~3.2.0", default-features = false } +ink_storage = { version = "~3.2.0", default-features = false } +ink_lang = { version = "~3.2.0", default-features = false } +ink_prelude = { version = "~3.2.0", default-features = false } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2", default-features = false, features = ["derive"], optional = true } derive = { package = "openbrush_contracts_derive", version = "1.8.0", path = "derive" } -openbrush = { version = "1.8.0", package = "openbrush_lang", path = "../lang", default-features = false } +openbrush = { version = "~1.8.0", package = "openbrush_lang", path = "../lang", default-features = false } [lib] name = "openbrush_contracts" diff --git a/docs/docs/smart-contracts/PSP1155/psp1155.md b/docs/docs/smart-contracts/PSP1155/psp1155.md index 71221491a..59a968740 100644 --- a/docs/docs/smart-contracts/PSP1155/psp1155.md +++ b/docs/docs/smart-contracts/PSP1155/psp1155.md @@ -11,7 +11,7 @@ Include `openbrush` as dependency in the cargo file or you can use [default `Car After you need to enable default implementation of PSP1155 via `openbrush` feature. ```toml -openbrush = { version = "1.8.0", default-features = false, features = ["psp1155"] } +openbrush = { version = "~1.8.0", default-features = false, features = ["psp1155"] } ``` ## Step 2: Add imports and enable unstable feature diff --git a/docs/docs/smart-contracts/PSP22/Extensions/capped.md b/docs/docs/smart-contracts/PSP22/Extensions/capped.md index 33de308cc..67bc2b057 100644 --- a/docs/docs/smart-contracts/PSP22/Extensions/capped.md +++ b/docs/docs/smart-contracts/PSP22/Extensions/capped.md @@ -11,7 +11,7 @@ Include `openbrush` as dependency in the cargo file or you can use [default `Car After you need to enable default implementation of PSP22 via `openbrush` features. ```toml -openbrush = { version = "1.8.0", default-features = false, features = ["psp22"] } +openbrush = { version = "~1.8.0", default-features = false, features = ["psp22"] } ``` ## Step 2: Add imports and enable unstable feature diff --git a/docs/docs/smart-contracts/PSP22/Extensions/pausable.md b/docs/docs/smart-contracts/PSP22/Extensions/pausable.md index ddac74a30..714970c2c 100644 --- a/docs/docs/smart-contracts/PSP22/Extensions/pausable.md +++ b/docs/docs/smart-contracts/PSP22/Extensions/pausable.md @@ -11,7 +11,7 @@ Include `openbrush` as dependency in the cargo file or you can use [default `Car After you need to enable default implementation of PSP22 and Pausable via `openbrush` features. ```toml -openbrush = { version = "1.8.0", default-features = false, features = ["psp22", "pausable"] } +openbrush = { version = "~1.8.0", default-features = false, features = ["psp22", "pausable"] } ``` ## Step 2: Add imports and enable unstable feature diff --git a/docs/docs/smart-contracts/PSP22/Extensions/wrapper.md b/docs/docs/smart-contracts/PSP22/Extensions/wrapper.md index 2c55e9e18..5e028b851 100644 --- a/docs/docs/smart-contracts/PSP22/Extensions/wrapper.md +++ b/docs/docs/smart-contracts/PSP22/Extensions/wrapper.md @@ -11,7 +11,7 @@ Include `openbrush` as dependency in the cargo file or you can use [default `Car After you need to enable default implementation of PSP22 via `openbrush` features. ```toml -openbrush = { version = "1.8.0", default-features = false, features = ["psp22"] } +openbrush = { version = "~1.8.0", default-features = false, features = ["psp22"] } ``` ## Step 2: Add imports and enable unstable feature diff --git a/docs/docs/smart-contracts/PSP22/Utils/token-timelock.md b/docs/docs/smart-contracts/PSP22/Utils/token-timelock.md index b1d2f5b8e..791bf5afe 100644 --- a/docs/docs/smart-contracts/PSP22/Utils/token-timelock.md +++ b/docs/docs/smart-contracts/PSP22/Utils/token-timelock.md @@ -11,7 +11,7 @@ Include `openbrush` as dependency in the cargo file or you can use [default `Car After you need to enable default implementation of PSP22 via `openbrush` features. ```toml -openbrush = { version = "1.8.0", default-features = false, features = ["psp22"] } +openbrush = { version = "~1.8.0", default-features = false, features = ["psp22"] } ``` ## Step 2: Add imports and enable unstable feature diff --git a/docs/docs/smart-contracts/PSP22/psp22.md b/docs/docs/smart-contracts/PSP22/psp22.md index 09afbbd61..2a3a3710a 100644 --- a/docs/docs/smart-contracts/PSP22/psp22.md +++ b/docs/docs/smart-contracts/PSP22/psp22.md @@ -11,7 +11,7 @@ Include `openbrush` as dependency in the cargo file or you can use [default `Car After you need to enable default implementation of PSP22 via `openbrush` features. ```toml -openbrush = { version = "1.8.0", default-features = false, features = ["psp22"] } +openbrush = { version = "~1.8.0", default-features = false, features = ["psp22"] } ``` ## Step 2: Add imports and enable unstable feature diff --git a/docs/docs/smart-contracts/PSP34/Extensions/metadata.md b/docs/docs/smart-contracts/PSP34/Extensions/metadata.md index 1fdabb2a5..9af5bb38f 100644 --- a/docs/docs/smart-contracts/PSP34/Extensions/metadata.md +++ b/docs/docs/smart-contracts/PSP34/Extensions/metadata.md @@ -11,7 +11,7 @@ Include `openbrush` as dependency in the cargo file or you can use [default `Car After you need to enable default implementation of PSP34 via `openbrush` features. ```toml -openbrush = { version = "1.8.0", default-features = false, features = ["psp34"] } +openbrush = { version = "~1.8.0", default-features = false, features = ["psp34"] } ``` ## Step 2: Add imports and enable unstable feature diff --git a/docs/docs/smart-contracts/PSP34/psp34.md b/docs/docs/smart-contracts/PSP34/psp34.md index f69d0dc4c..bc37da77a 100644 --- a/docs/docs/smart-contracts/PSP34/psp34.md +++ b/docs/docs/smart-contracts/PSP34/psp34.md @@ -11,7 +11,7 @@ Include `openbrush` as dependency in the cargo file or you can use [default `Car After you need to enable default implementation of PSP34 via `openbrush` features. ```toml -openbrush = { version = "1.8.0", default-features = false, features = ["psp34"] } +openbrush = { version = "~1.8.0", default-features = false, features = ["psp34"] } ``` ## Step 2: Add imports and enable unstable feature diff --git a/docs/docs/smart-contracts/access-control.md b/docs/docs/smart-contracts/access-control.md index f5e85a3a5..46cfac765 100644 --- a/docs/docs/smart-contracts/access-control.md +++ b/docs/docs/smart-contracts/access-control.md @@ -11,7 +11,7 @@ Include `openbrush` as dependency in the cargo file or you can use [default `Car After you need to enable default implementation of Access Control via `openbrush` features. ```toml -openbrush = { version = "1.8.0", default-features = false, features = ["access_control"] } +openbrush = { version = "~1.8.0", default-features = false, features = ["access_control"] } ``` ## Step 2: Add imports and enable unstable feature diff --git a/docs/docs/smart-contracts/diamond.md b/docs/docs/smart-contracts/diamond.md index a10e42860..03b454b6d 100644 --- a/docs/docs/smart-contracts/diamond.md +++ b/docs/docs/smart-contracts/diamond.md @@ -11,7 +11,7 @@ Include `openbrush` as dependency in the cargo file or you can use [default `Car After you need to enable default implementation of Diamond Standard via `openbrush` features. ```toml -openbrush = { version = "1.8.0", default-features = false, features = ["diamond"] } +openbrush = { version = "~1.8.0", default-features = false, features = ["diamond"] } ``` ## Step 2: Add imports and enable unstable feature diff --git a/docs/docs/smart-contracts/example/contract.md b/docs/docs/smart-contracts/example/contract.md index 59f1af462..4a6fe704f 100644 --- a/docs/docs/smart-contracts/example/contract.md +++ b/docs/docs/smart-contracts/example/contract.md @@ -21,12 +21,12 @@ authors = ["Supercolony "] edition = "2021" [dependencies] -ink_primitives = { version = "3.2.0", default-features = false } -ink_metadata = { version = "3.2.0", default-features = false, features = ["derive"], optional = true } -ink_env = { version = "3.2.0", default-features = false } -ink_storage = { version = "3.2.0", default-features = false } -ink_lang = { version = "3.2.0", default-features = false } -ink_prelude = { version = "3.2.0", default-features = false } +ink_primitives = { version = "~3.2.0", default-features = false } +ink_metadata = { version = "~3.2.0", default-features = false, features = ["derive"], optional = true } +ink_env = { version = "~3.2.0", default-features = false } +ink_storage = { version = "~3.2.0", default-features = false } +ink_lang = { version = "~3.2.0", default-features = false } +ink_prelude = { version = "~3.2.0", default-features = false } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2", default-features = false, features = ["derive"], optional = true } diff --git a/docs/docs/smart-contracts/example/data.md b/docs/docs/smart-contracts/example/data.md index 100f31ede..f0f34e909 100644 --- a/docs/docs/smart-contracts/example/data.md +++ b/docs/docs/smart-contracts/example/data.md @@ -142,7 +142,7 @@ In the `Cargo.toml` of the derive folder you need to import `openbrush` dependen syn = { version = "1.0" } quote = "1.0" proc-macro2 = "1" -openbrush = { version = "1.8.0", default-features = false } +openbrush = { version = "~1.8.0", default-features = false } [lib] name = "point_derive" diff --git a/docs/docs/smart-contracts/overview.md b/docs/docs/smart-contracts/overview.md index b5641788e..21051a7d6 100644 --- a/docs/docs/smart-contracts/overview.md +++ b/docs/docs/smart-contracts/overview.md @@ -12,18 +12,18 @@ So you should use the same version of the ink! across your project. ```toml [dependencies] # Import of all ink! crates -ink_primitives = { version = "3.2.0", default-features = false } -ink_metadata = { version = "3.2.0", default-features = false, features = ["derive"], optional = true } -ink_env = { version = "3.2.0", default-features = false } -ink_storage = { version = "3.2.0", default-features = false } -ink_lang = { version = "3.2.0", default-features = false } -ink_prelude = { version = "3.2.0", default-features = false } +ink_primitives = { version = "~3.2.0", default-features = false } +ink_metadata = { version = "~3.2.0", default-features = false, features = ["derive"], optional = true } +ink_env = { version = "~3.2.0", default-features = false } +ink_storage = { version = "~3.2.0", default-features = false } +ink_lang = { version = "~3.2.0", default-features = false } +ink_prelude = { version = "~3.2.0", default-features = false } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2", default-features = false, features = ["derive"], optional = true } # Brush dependency -openbrush = { version = "1.8.0", default-features = false } +openbrush = { version = "~1.8.0", default-features = false } [features] default = ["std"] diff --git a/docs/docs/smart-contracts/ownable.md b/docs/docs/smart-contracts/ownable.md index bfff96660..ca1885b20 100644 --- a/docs/docs/smart-contracts/ownable.md +++ b/docs/docs/smart-contracts/ownable.md @@ -11,7 +11,7 @@ Include `openbrush` as dependency in the cargo file or you can use [default `Car After you need to enable default implementation of Ownable via `openbrush` features. ```toml -openbrush = { version = "1.8.0", default-features = false, features = ["ownable"] } +openbrush = { version = "~1.8.0", default-features = false, features = ["ownable"] } ``` ## Step 2: Add imports and enable unstable feature diff --git a/docs/docs/smart-contracts/pausable.md b/docs/docs/smart-contracts/pausable.md index 04fb81f38..a5d7072d2 100644 --- a/docs/docs/smart-contracts/pausable.md +++ b/docs/docs/smart-contracts/pausable.md @@ -12,7 +12,7 @@ Include `openbrush` as dependency in the cargo file or you can use [default `Car After you need to enable default implementation of Pausable via `openbrush` features. ```toml -openbrush = { version = "1.8.0", default-features = false, features = ["pausable"] } +openbrush = { version = "~1.8.0", default-features = false, features = ["pausable"] } ``` ## Step 2: Add imports and enable unstable feature diff --git a/docs/docs/smart-contracts/payment-splitter.md b/docs/docs/smart-contracts/payment-splitter.md index ac5e6db43..e51d82a9b 100644 --- a/docs/docs/smart-contracts/payment-splitter.md +++ b/docs/docs/smart-contracts/payment-splitter.md @@ -12,7 +12,7 @@ Include `openbrush` as dependency in the cargo file or you can use [default `Car After you need to enable default implementation of Payment Splitter via `openbrush` features. ```toml -openbrush = { version = "1.8.0", default-features = false, features = ["payment_splitter"] } +openbrush = { version = "~1.8.0", default-features = false, features = ["payment_splitter"] } # payment-splitter uses dividing inside, so your version of rust can require you to disable check overflow. [profile.dev] diff --git a/docs/docs/smart-contracts/proxy.md b/docs/docs/smart-contracts/proxy.md index bb0ebb61b..050770dbd 100644 --- a/docs/docs/smart-contracts/proxy.md +++ b/docs/docs/smart-contracts/proxy.md @@ -11,7 +11,7 @@ Include `openbrush` as dependency in the cargo file or you can use [default `Car After you need to enable default implementation of Proxy via `openbrush` features. ```toml -openbrush = { version = "1.8.0", default-features = false, features = ["proxy"] } +openbrush = { version = "~1.8.0", default-features = false, features = ["proxy"] } ``` ## Step 2: Add imports and enable unstable feature diff --git a/docs/docs/smart-contracts/reentrancy-guard.md b/docs/docs/smart-contracts/reentrancy-guard.md index e7c987218..4516b383d 100644 --- a/docs/docs/smart-contracts/reentrancy-guard.md +++ b/docs/docs/smart-contracts/reentrancy-guard.md @@ -20,7 +20,7 @@ Include `openbrush` as dependency in the cargo file or you can use [default `Car After you need to enable default implementation of Reentrancy Guard via `openbrush` features. ```toml -openbrush = { version = "1.8.0", default-features = false, features = ["reentrancy_guard"] } +openbrush = { version = "~1.8.0", default-features = false, features = ["reentrancy_guard"] } ``` ### Step 2: Add imports @@ -174,12 +174,12 @@ To do a cross-contract call to `MyFlipper` you need to import the `MyFlipper` co ```toml [dependencies] -ink_primitives = { version = "3.2.0", default-features = false } -ink_metadata = { version = "3.2.0", default-features = false, features = ["derive"], optional = true } -ink_env = { version = "3.2.0", default-features = false } -ink_storage = { version = "3.2.0", default-features = false } -ink_lang = { version = "3.2.0", default-features = false } -ink_prelude = { version = "3.2.0", default-features = false } +ink_primitives = { version = "~3.2.0", default-features = false } +ink_metadata = { version = "~3.2.0", default-features = false, features = ["derive"], optional = true } +ink_env = { version = "~3.2.0", default-features = false } +ink_storage = { version = "~3.2.0", default-features = false } +ink_lang = { version = "~3.2.0", default-features = false } +ink_prelude = { version = "~3.2.0", default-features = false } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2", default-features = false, features = ["derive"], optional = true } diff --git a/docs/docs/smart-contracts/timelock-controller.md b/docs/docs/smart-contracts/timelock-controller.md index 69bf128f1..fed5b9536 100644 --- a/docs/docs/smart-contracts/timelock-controller.md +++ b/docs/docs/smart-contracts/timelock-controller.md @@ -12,7 +12,7 @@ Include `openbrush` as dependency in the cargo file or you can use [default `Car After you need to enable default implementation of Timelock Controller via `openbrush` features. ```toml -openbrush = { version = "1.8.0", default-features = false, features = ["timelock_controller"] } +openbrush = { version = "~1.8.0", default-features = false, features = ["timelock_controller"] } ``` ## Step 2: Add imports and enable unstable feature diff --git a/example_project_structure/Cargo.toml b/example_project_structure/Cargo.toml index 88b291ba6..87517edcf 100644 --- a/example_project_structure/Cargo.toml +++ b/example_project_structure/Cargo.toml @@ -5,12 +5,12 @@ authors = ["Supercolony "] edition = "2021" [dependencies] -ink_primitives = { version = "3.2.0", default-features = false } -ink_metadata = { version = "3.2.0", default-features = false, features = ["derive"], optional = true } -ink_env = { version = "3.2.0", default-features = false } -ink_storage = { version = "3.2.0", default-features = false } -ink_lang = { version = "3.2.0", default-features = false } -ink_prelude = { version = "3.2.0", default-features = false } +ink_primitives = { version = "~3.2.0", default-features = false } +ink_metadata = { version = "~3.2.0", default-features = false, features = ["derive"], optional = true } +ink_env = { version = "~3.2.0", default-features = false } +ink_storage = { version = "~3.2.0", default-features = false } +ink_lang = { version = "~3.2.0", default-features = false } +ink_prelude = { version = "~3.2.0", default-features = false } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2", default-features = false, features = ["derive"], optional = true } diff --git a/example_project_structure/contracts/loan/Cargo.toml b/example_project_structure/contracts/loan/Cargo.toml index 0ae0340fe..d83661ed7 100644 --- a/example_project_structure/contracts/loan/Cargo.toml +++ b/example_project_structure/contracts/loan/Cargo.toml @@ -5,12 +5,12 @@ authors = ["Supercolony "] edition = "2021" [dependencies] -ink_primitives = { version = "3.2.0", default-features = false } -ink_metadata = { version = "3.2.0", default-features = false, features = ["derive"], optional = true } -ink_env = { version = "3.2.0", default-features = false } -ink_storage = { version = "3.2.0", default-features = false } -ink_lang = { version = "3.2.0", default-features = false } -ink_prelude = { version = "3.2.0", default-features = false } +ink_primitives = { version = "~3.2.0", default-features = false } +ink_metadata = { version = "~3.2.0", default-features = false, features = ["derive"], optional = true } +ink_env = { version = "~3.2.0", default-features = false } +ink_storage = { version = "~3.2.0", default-features = false } +ink_lang = { version = "~3.2.0", default-features = false } +ink_prelude = { version = "~3.2.0", default-features = false } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2", default-features = false, features = ["derive"], optional = true } diff --git a/example_project_structure/contracts/shares/Cargo.toml b/example_project_structure/contracts/shares/Cargo.toml index 6d0ad2e39..dfa964be6 100644 --- a/example_project_structure/contracts/shares/Cargo.toml +++ b/example_project_structure/contracts/shares/Cargo.toml @@ -5,12 +5,12 @@ authors = ["Supercolony "] edition = "2021" [dependencies] -ink_primitives = { version = "3.2.0", default-features = false } -ink_metadata = { version = "3.2.0", default-features = false, features = ["derive"], optional = true } -ink_env = { version = "3.2.0", default-features = false } -ink_storage = { version = "3.2.0", default-features = false } -ink_lang = { version = "3.2.0", default-features = false } -ink_prelude = { version = "3.2.0", default-features = false } +ink_primitives = { version = "~3.2.0", default-features = false } +ink_metadata = { version = "~3.2.0", default-features = false, features = ["derive"], optional = true } +ink_env = { version = "~3.2.0", default-features = false } +ink_storage = { version = "~3.2.0", default-features = false } +ink_lang = { version = "~3.2.0", default-features = false } +ink_prelude = { version = "~3.2.0", default-features = false } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2", default-features = false, features = ["derive"], optional = true } diff --git a/example_project_structure/contracts/stable_coin/Cargo.toml b/example_project_structure/contracts/stable_coin/Cargo.toml index 9ada0fef1..45cd095c4 100644 --- a/example_project_structure/contracts/stable_coin/Cargo.toml +++ b/example_project_structure/contracts/stable_coin/Cargo.toml @@ -5,12 +5,12 @@ authors = ["Supercolony "] edition = "2021" [dependencies] -ink_primitives = { version = "3.2.0", default-features = false } -ink_metadata = { version = "3.2.0", default-features = false, features = ["derive"], optional = true } -ink_env = { version = "3.2.0", default-features = false } -ink_storage = { version = "3.2.0", default-features = false } -ink_lang = { version = "3.2.0", default-features = false } -ink_prelude = { version = "3.2.0", default-features = false } +ink_primitives = { version = "~3.2.0", default-features = false } +ink_metadata = { version = "~3.2.0", default-features = false, features = ["derive"], optional = true } +ink_env = { version = "~3.2.0", default-features = false } +ink_storage = { version = "~3.2.0", default-features = false } +ink_lang = { version = "~3.2.0", default-features = false } +ink_prelude = { version = "~3.2.0", default-features = false } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2", default-features = false, features = ["derive"], optional = true } diff --git a/example_project_structure/derive/Cargo.toml b/example_project_structure/derive/Cargo.toml index 954da817c..870b702c2 100644 --- a/example_project_structure/derive/Cargo.toml +++ b/example_project_structure/derive/Cargo.toml @@ -10,7 +10,7 @@ quote = "1.0" proc-macro2 = "1" # In you code you can import `openbrush_derive` with the next line -#openbrush = { version = "1.8.0", default-features = false } +#openbrush = { version = "~1.8.0", default-features = false } openbrush = { package = "openbrush_lang", path = "../../lang" } diff --git a/examples/access_control/Cargo.toml b/examples/access_control/Cargo.toml index c67f2a1c7..3da7d52a3 100644 --- a/examples/access_control/Cargo.toml +++ b/examples/access_control/Cargo.toml @@ -5,12 +5,12 @@ authors = ["Supercolony "] edition = "2021" [dependencies] -ink_primitives = { version = "3.2.0", default-features = false } -ink_metadata = { version = "3.2.0", default-features = false, features = ["derive"], optional = true } -ink_env = { version = "3.2.0", default-features = false } -ink_storage = { version = "3.2.0", default-features = false } -ink_lang = { version = "3.2.0", default-features = false } -ink_prelude = { version = "3.2.0", default-features = false } +ink_primitives = { version = "~3.2.0", default-features = false } +ink_metadata = { version = "~3.2.0", default-features = false, features = ["derive"], optional = true } +ink_env = { version = "~3.2.0", default-features = false } +ink_storage = { version = "~3.2.0", default-features = false } +ink_lang = { version = "~3.2.0", default-features = false } +ink_prelude = { version = "~3.2.0", default-features = false } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2", default-features = false, features = ["derive"], optional = true } diff --git a/examples/diamond/Cargo.toml b/examples/diamond/Cargo.toml index ebec20dba..634ab4120 100644 --- a/examples/diamond/Cargo.toml +++ b/examples/diamond/Cargo.toml @@ -5,12 +5,12 @@ authors = ["Supercolony "] edition = "2021" [dependencies] -ink_primitives = { version = "3.2.0", default-features = false } -ink_metadata = { version = "3.2.0", default-features = false, features = ["derive"], optional = true } -ink_env = { version = "3.2.0", default-features = false } -ink_storage = { version = "3.2.0", default-features = false } -ink_lang = { version = "3.2.0", default-features = false } -ink_prelude = { version = "3.2.0", default-features = false } +ink_primitives = { version = "~3.2.0", default-features = false } +ink_metadata = { version = "~3.2.0", default-features = false, features = ["derive"], optional = true } +ink_env = { version = "~3.2.0", default-features = false } +ink_storage = { version = "~3.2.0", default-features = false } +ink_lang = { version = "~3.2.0", default-features = false } +ink_prelude = { version = "~3.2.0", default-features = false } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2", default-features = false, features = ["derive"], optional = true } diff --git a/examples/diamond/diamond_caller/Cargo.toml b/examples/diamond/diamond_caller/Cargo.toml index 6a4774cf5..c6d86adbb 100644 --- a/examples/diamond/diamond_caller/Cargo.toml +++ b/examples/diamond/diamond_caller/Cargo.toml @@ -5,12 +5,12 @@ authors = ["Supercolony "] edition = "2021" [dependencies] -ink_primitives = { version = "3.2.0", default-features = false } -ink_metadata = { version = "3.2.0", default-features = false, features = ["derive"], optional = true } -ink_env = { version = "3.2.0", default-features = false } -ink_storage = { version = "3.2.0", default-features = false } -ink_lang = { version = "3.2.0", default-features = false } -ink_prelude = { version = "3.2.0", default-features = false } +ink_primitives = { version = "~3.2.0", default-features = false } +ink_metadata = { version = "~3.2.0", default-features = false, features = ["derive"], optional = true } +ink_env = { version = "~3.2.0", default-features = false } +ink_storage = { version = "~3.2.0", default-features = false } +ink_lang = { version = "~3.2.0", default-features = false } +ink_prelude = { version = "~3.2.0", default-features = false } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2", default-features = false, features = ["derive"], optional = true } diff --git a/examples/diamond/psp22_facet_v1/Cargo.toml b/examples/diamond/psp22_facet_v1/Cargo.toml index 87c54febf..577fc2a5a 100644 --- a/examples/diamond/psp22_facet_v1/Cargo.toml +++ b/examples/diamond/psp22_facet_v1/Cargo.toml @@ -5,12 +5,12 @@ authors = ["Supercolony "] edition = "2021" [dependencies] -ink_primitives = { version = "3.2.0", default-features = false } -ink_metadata = { version = "3.2.0", default-features = false, features = ["derive"], optional = true } -ink_env = { version = "3.2.0", default-features = false } -ink_storage = { version = "3.2.0", default-features = false } -ink_lang = { version = "3.2.0", default-features = false } -ink_prelude = { version = "3.2.0", default-features = false } +ink_primitives = { version = "~3.2.0", default-features = false } +ink_metadata = { version = "~3.2.0", default-features = false, features = ["derive"], optional = true } +ink_env = { version = "~3.2.0", default-features = false } +ink_storage = { version = "~3.2.0", default-features = false } +ink_lang = { version = "~3.2.0", default-features = false } +ink_prelude = { version = "~3.2.0", default-features = false } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2", default-features = false, features = ["derive"], optional = true } diff --git a/examples/diamond/psp22_facet_v2/Cargo.toml b/examples/diamond/psp22_facet_v2/Cargo.toml index 46ca71803..c8f02cbae 100644 --- a/examples/diamond/psp22_facet_v2/Cargo.toml +++ b/examples/diamond/psp22_facet_v2/Cargo.toml @@ -5,12 +5,12 @@ authors = ["Supercolony "] edition = "2021" [dependencies] -ink_primitives = { version = "3.2.0", default-features = false } -ink_metadata = { version = "3.2.0", default-features = false, features = ["derive"], optional = true } -ink_env = { version = "3.2.0", default-features = false } -ink_storage = { version = "3.2.0", default-features = false } -ink_lang = { version = "3.2.0", default-features = false } -ink_prelude = { version = "3.2.0", default-features = false } +ink_primitives = { version = "~3.2.0", default-features = false } +ink_metadata = { version = "~3.2.0", default-features = false, features = ["derive"], optional = true } +ink_env = { version = "~3.2.0", default-features = false } +ink_storage = { version = "~3.2.0", default-features = false } +ink_lang = { version = "~3.2.0", default-features = false } +ink_prelude = { version = "~3.2.0", default-features = false } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2", default-features = false, features = ["derive"], optional = true } diff --git a/examples/diamond/psp22_metadata_facet/Cargo.toml b/examples/diamond/psp22_metadata_facet/Cargo.toml index 75fbc638a..d124f7a33 100644 --- a/examples/diamond/psp22_metadata_facet/Cargo.toml +++ b/examples/diamond/psp22_metadata_facet/Cargo.toml @@ -5,12 +5,12 @@ authors = ["Supercolony "] edition = "2021" [dependencies] -ink_primitives = { version = "3.2.0", default-features = false } -ink_metadata = { version = "3.2.0", default-features = false, features = ["derive"], optional = true } -ink_env = { version = "3.2.0", default-features = false } -ink_storage = { version = "3.2.0", default-features = false } -ink_lang = { version = "3.2.0", default-features = false } -ink_prelude = { version = "3.2.0", default-features = false } +ink_primitives = { version = "~3.2.0", default-features = false } +ink_metadata = { version = "~3.2.0", default-features = false, features = ["derive"], optional = true } +ink_env = { version = "~3.2.0", default-features = false } +ink_storage = { version = "~3.2.0", default-features = false } +ink_lang = { version = "~3.2.0", default-features = false } +ink_prelude = { version = "~3.2.0", default-features = false } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2", default-features = false, features = ["derive"], optional = true } diff --git a/examples/ownable/Cargo.toml b/examples/ownable/Cargo.toml index 807498f4a..ee47e25b2 100644 --- a/examples/ownable/Cargo.toml +++ b/examples/ownable/Cargo.toml @@ -5,12 +5,12 @@ authors = ["Supercolony "] edition = "2021" [dependencies] -ink_primitives = { version = "3.2.0", default-features = false } -ink_metadata = { version = "3.2.0", default-features = false, features = ["derive"], optional = true } -ink_env = { version = "3.2.0", default-features = false } -ink_storage = { version = "3.2.0", default-features = false } -ink_lang = { version = "3.2.0", default-features = false } -ink_prelude = { version = "3.2.0", default-features = false } +ink_primitives = { version = "~3.2.0", default-features = false } +ink_metadata = { version = "~3.2.0", default-features = false, features = ["derive"], optional = true } +ink_env = { version = "~3.2.0", default-features = false } +ink_storage = { version = "~3.2.0", default-features = false } +ink_lang = { version = "~3.2.0", default-features = false } +ink_prelude = { version = "~3.2.0", default-features = false } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2", default-features = false, features = ["derive"], optional = true } diff --git a/examples/pausable/Cargo.toml b/examples/pausable/Cargo.toml index 7b1d72793..8e4eb9093 100644 --- a/examples/pausable/Cargo.toml +++ b/examples/pausable/Cargo.toml @@ -5,12 +5,12 @@ authors = ["Supercolony "] edition = "2021" [dependencies] -ink_primitives = { version = "3.2.0", default-features = false } -ink_metadata = { version = "3.2.0", default-features = false, features = ["derive"], optional = true } -ink_env = { version = "3.2.0", default-features = false } -ink_storage = { version = "3.2.0", default-features = false } -ink_lang = { version = "3.2.0", default-features = false } -ink_prelude = { version = "3.2.0", default-features = false } +ink_primitives = { version = "~3.2.0", default-features = false } +ink_metadata = { version = "~3.2.0", default-features = false, features = ["derive"], optional = true } +ink_env = { version = "~3.2.0", default-features = false } +ink_storage = { version = "~3.2.0", default-features = false } +ink_lang = { version = "~3.2.0", default-features = false } +ink_prelude = { version = "~3.2.0", default-features = false } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2", default-features = false, features = ["derive"], optional = true } diff --git a/examples/payment_splitter/Cargo.toml b/examples/payment_splitter/Cargo.toml index 8b9e1159c..a0f0d556d 100644 --- a/examples/payment_splitter/Cargo.toml +++ b/examples/payment_splitter/Cargo.toml @@ -5,12 +5,12 @@ authors = ["Supercolony "] edition = "2021" [dependencies] -ink_primitives = { version = "3.2.0", default-features = false } -ink_metadata = { version = "3.2.0", default-features = false, features = ["derive"], optional = true } -ink_env = { version = "3.2.0", default-features = false } -ink_storage = { version = "3.2.0", default-features = false } -ink_lang = { version = "3.2.0", default-features = false } -ink_prelude = { version = "3.2.0", default-features = false } +ink_primitives = { version = "~3.2.0", default-features = false } +ink_metadata = { version = "~3.2.0", default-features = false, features = ["derive"], optional = true } +ink_env = { version = "~3.2.0", default-features = false } +ink_storage = { version = "~3.2.0", default-features = false } +ink_lang = { version = "~3.2.0", default-features = false } +ink_prelude = { version = "~3.2.0", default-features = false } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2", default-features = false, features = ["derive"], optional = true } diff --git a/examples/proxy/Cargo.toml b/examples/proxy/Cargo.toml index 378026384..7588d6ef2 100644 --- a/examples/proxy/Cargo.toml +++ b/examples/proxy/Cargo.toml @@ -5,12 +5,12 @@ authors = ["Supercolony "] edition = "2021" [dependencies] -ink_primitives = { version = "3.2.0", default-features = false } -ink_metadata = { version = "3.2.0", default-features = false, features = ["derive"], optional = true } -ink_env = { version = "3.2.0", default-features = false } -ink_storage = { version = "3.2.0", default-features = false } -ink_lang = { version = "3.2.0", default-features = false } -ink_prelude = { version = "3.2.0", default-features = false } +ink_primitives = { version = "~3.2.0", default-features = false } +ink_metadata = { version = "~3.2.0", default-features = false, features = ["derive"], optional = true } +ink_env = { version = "~3.2.0", default-features = false } +ink_storage = { version = "~3.2.0", default-features = false } +ink_lang = { version = "~3.2.0", default-features = false } +ink_prelude = { version = "~3.2.0", default-features = false } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2", default-features = false, features = ["derive"], optional = true } diff --git a/examples/proxy/psp22_metadata_upgradeable/Cargo.toml b/examples/proxy/psp22_metadata_upgradeable/Cargo.toml index d9dd4baf9..0b9d98cb6 100644 --- a/examples/proxy/psp22_metadata_upgradeable/Cargo.toml +++ b/examples/proxy/psp22_metadata_upgradeable/Cargo.toml @@ -5,12 +5,12 @@ authors = ["Supercolony "] edition = "2021" [dependencies] -ink_primitives = { version = "3.2.0", default-features = false } -ink_metadata = { version = "3.2.0", default-features = false, features = ["derive"], optional = true } -ink_env = { version = "3.2.0", default-features = false } -ink_storage = { version = "3.2.0", default-features = false } -ink_lang = { version = "3.2.0", default-features = false } -ink_prelude = { version = "3.2.0", default-features = false } +ink_primitives = { version = "~3.2.0", default-features = false } +ink_metadata = { version = "~3.2.0", default-features = false, features = ["derive"], optional = true } +ink_env = { version = "~3.2.0", default-features = false } +ink_storage = { version = "~3.2.0", default-features = false } +ink_lang = { version = "~3.2.0", default-features = false } +ink_prelude = { version = "~3.2.0", default-features = false } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2", default-features = false, features = ["derive"], optional = true } diff --git a/examples/proxy/psp22_upgradeable/Cargo.toml b/examples/proxy/psp22_upgradeable/Cargo.toml index 9319dc45b..ddf340de5 100644 --- a/examples/proxy/psp22_upgradeable/Cargo.toml +++ b/examples/proxy/psp22_upgradeable/Cargo.toml @@ -5,12 +5,12 @@ authors = ["Supercolony "] edition = "2021" [dependencies] -ink_primitives = { version = "3.2.0", default-features = false } -ink_metadata = { version = "3.2.0", default-features = false, features = ["derive"], optional = true } -ink_env = { version = "3.2.0", default-features = false } -ink_storage = { version = "3.2.0", default-features = false } -ink_lang = { version = "3.2.0", default-features = false } -ink_prelude = { version = "3.2.0", default-features = false } +ink_primitives = { version = "~3.2.0", default-features = false } +ink_metadata = { version = "~3.2.0", default-features = false, features = ["derive"], optional = true } +ink_env = { version = "~3.2.0", default-features = false } +ink_storage = { version = "~3.2.0", default-features = false } +ink_lang = { version = "~3.2.0", default-features = false } +ink_prelude = { version = "~3.2.0", default-features = false } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2", default-features = false, features = ["derive"], optional = true } diff --git a/examples/psp1155/Cargo.toml b/examples/psp1155/Cargo.toml index 92761a685..25595a978 100644 --- a/examples/psp1155/Cargo.toml +++ b/examples/psp1155/Cargo.toml @@ -5,12 +5,12 @@ authors = ["Supercolony "] edition = "2021" [dependencies] -ink_primitives = { version = "3.2.0", default-features = false } -ink_metadata = { version = "3.2.0", default-features = false, features = ["derive"], optional = true } -ink_env = { version = "3.2.0", default-features = false } -ink_storage = { version = "3.2.0", default-features = false } -ink_lang = { version = "3.2.0", default-features = false } -ink_prelude = { version = "3.2.0", default-features = false } +ink_primitives = { version = "~3.2.0", default-features = false } +ink_metadata = { version = "~3.2.0", default-features = false, features = ["derive"], optional = true } +ink_env = { version = "~3.2.0", default-features = false } +ink_storage = { version = "~3.2.0", default-features = false } +ink_lang = { version = "~3.2.0", default-features = false } +ink_prelude = { version = "~3.2.0", default-features = false } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2", default-features = false, features = ["derive"], optional = true } diff --git a/examples/psp1155_extensions/burnable/Cargo.toml b/examples/psp1155_extensions/burnable/Cargo.toml index b451553a6..5d38eac72 100644 --- a/examples/psp1155_extensions/burnable/Cargo.toml +++ b/examples/psp1155_extensions/burnable/Cargo.toml @@ -5,12 +5,12 @@ authors = ["Supercolony "] edition = "2021" [dependencies] -ink_primitives = { version = "3.2.0", default-features = false } -ink_metadata = { version = "3.2.0", default-features = false, features = ["derive"], optional = true } -ink_env = { version = "3.2.0", default-features = false } -ink_storage = { version = "3.2.0", default-features = false } -ink_lang = { version = "3.2.0", default-features = false } -ink_prelude = { version = "3.2.0", default-features = false } +ink_primitives = { version = "~3.2.0", default-features = false } +ink_metadata = { version = "~3.2.0", default-features = false, features = ["derive"], optional = true } +ink_env = { version = "~3.2.0", default-features = false } +ink_storage = { version = "~3.2.0", default-features = false } +ink_lang = { version = "~3.2.0", default-features = false } +ink_prelude = { version = "~3.2.0", default-features = false } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2", default-features = false, features = ["derive"], optional = true } diff --git a/examples/psp1155_extensions/metadata/Cargo.toml b/examples/psp1155_extensions/metadata/Cargo.toml index bb3cb33f9..a0440d089 100644 --- a/examples/psp1155_extensions/metadata/Cargo.toml +++ b/examples/psp1155_extensions/metadata/Cargo.toml @@ -5,12 +5,12 @@ authors = ["Supercolony "] edition = "2021" [dependencies] -ink_primitives = { version = "3.2.0", default-features = false } -ink_metadata = { version = "3.2.0", default-features = false, features = ["derive"], optional = true } -ink_env = { version = "3.2.0", default-features = false } -ink_storage = { version = "3.2.0", default-features = false } -ink_lang = { version = "3.2.0", default-features = false } -ink_prelude = { version = "3.2.0", default-features = false } +ink_primitives = { version = "~3.2.0", default-features = false } +ink_metadata = { version = "~3.2.0", default-features = false, features = ["derive"], optional = true } +ink_env = { version = "~3.2.0", default-features = false } +ink_storage = { version = "~3.2.0", default-features = false } +ink_lang = { version = "~3.2.0", default-features = false } +ink_prelude = { version = "~3.2.0", default-features = false } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2", default-features = false, features = ["derive"], optional = true } diff --git a/examples/psp1155_extensions/mintable/Cargo.toml b/examples/psp1155_extensions/mintable/Cargo.toml index 0e7dec657..a960b4e75 100644 --- a/examples/psp1155_extensions/mintable/Cargo.toml +++ b/examples/psp1155_extensions/mintable/Cargo.toml @@ -5,12 +5,12 @@ authors = ["Supercolony "] edition = "2021" [dependencies] -ink_primitives = { version = "3.2.0", default-features = false } -ink_metadata = { version = "3.2.0", default-features = false, features = ["derive"], optional = true } -ink_env = { version = "3.2.0", default-features = false } -ink_storage = { version = "3.2.0", default-features = false } -ink_lang = { version = "3.2.0", default-features = false } -ink_prelude = { version = "3.2.0", default-features = false } +ink_primitives = { version = "~3.2.0", default-features = false } +ink_metadata = { version = "~3.2.0", default-features = false, features = ["derive"], optional = true } +ink_env = { version = "~3.2.0", default-features = false } +ink_storage = { version = "~3.2.0", default-features = false } +ink_lang = { version = "~3.2.0", default-features = false } +ink_prelude = { version = "~3.2.0", default-features = false } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2", default-features = false, features = ["derive"], optional = true } diff --git a/examples/psp22/Cargo.toml b/examples/psp22/Cargo.toml index 81f2540dd..07b2d2300 100644 --- a/examples/psp22/Cargo.toml +++ b/examples/psp22/Cargo.toml @@ -5,12 +5,12 @@ authors = ["Supercolony "] edition = "2021" [dependencies] -ink_primitives = { version = "3.2.0", default-features = false } -ink_metadata = { version = "3.2.0", default-features = false, features = ["derive"], optional = true } -ink_env = { version = "3.2.0", default-features = false } -ink_storage = { version = "3.2.0", default-features = false } -ink_lang = { version = "3.2.0", default-features = false } -ink_prelude = { version = "3.2.0", default-features = false } +ink_primitives = { version = "~3.2.0", default-features = false } +ink_metadata = { version = "~3.2.0", default-features = false, features = ["derive"], optional = true } +ink_env = { version = "~3.2.0", default-features = false } +ink_storage = { version = "~3.2.0", default-features = false } +ink_lang = { version = "~3.2.0", default-features = false } +ink_prelude = { version = "~3.2.0", default-features = false } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2", default-features = false, features = ["derive"], optional = true } diff --git a/examples/psp22_extensions/burnable/Cargo.toml b/examples/psp22_extensions/burnable/Cargo.toml index d9e4af933..fe0db3d94 100644 --- a/examples/psp22_extensions/burnable/Cargo.toml +++ b/examples/psp22_extensions/burnable/Cargo.toml @@ -5,12 +5,12 @@ authors = ["Supercolony "] edition = "2021" [dependencies] -ink_primitives = { version = "3.2.0", default-features = false } -ink_metadata = { version = "3.2.0", default-features = false, features = ["derive"], optional = true } -ink_env = { version = "3.2.0", default-features = false } -ink_storage = { version = "3.2.0", default-features = false } -ink_lang = { version = "3.2.0", default-features = false } -ink_prelude = { version = "3.2.0", default-features = false } +ink_primitives = { version = "~3.2.0", default-features = false } +ink_metadata = { version = "~3.2.0", default-features = false, features = ["derive"], optional = true } +ink_env = { version = "~3.2.0", default-features = false } +ink_storage = { version = "~3.2.0", default-features = false } +ink_lang = { version = "~3.2.0", default-features = false } +ink_prelude = { version = "~3.2.0", default-features = false } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2", default-features = false, features = ["derive"], optional = true } diff --git a/examples/psp22_extensions/capped/Cargo.toml b/examples/psp22_extensions/capped/Cargo.toml index dabc75919..9bfb02a93 100644 --- a/examples/psp22_extensions/capped/Cargo.toml +++ b/examples/psp22_extensions/capped/Cargo.toml @@ -5,12 +5,12 @@ authors = ["Supercolony "] edition = "2021" [dependencies] -ink_primitives = { version = "3.2.0", default-features = false } -ink_metadata = { version = "3.2.0", default-features = false, features = ["derive"], optional = true } -ink_env = { version = "3.2.0", default-features = false } -ink_storage = { version = "3.2.0", default-features = false } -ink_lang = { version = "3.2.0", default-features = false } -ink_prelude = { version = "3.2.0", default-features = false } +ink_primitives = { version = "~3.2.0", default-features = false } +ink_metadata = { version = "~3.2.0", default-features = false, features = ["derive"], optional = true } +ink_env = { version = "~3.2.0", default-features = false } +ink_storage = { version = "~3.2.0", default-features = false } +ink_lang = { version = "~3.2.0", default-features = false } +ink_prelude = { version = "~3.2.0", default-features = false } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2", default-features = false, features = ["derive"], optional = true } diff --git a/examples/psp22_extensions/flashmint/Cargo.toml b/examples/psp22_extensions/flashmint/Cargo.toml index 25f6300da..d7bc11639 100644 --- a/examples/psp22_extensions/flashmint/Cargo.toml +++ b/examples/psp22_extensions/flashmint/Cargo.toml @@ -5,12 +5,12 @@ authors = ["Supercolony "] edition = "2021" [dependencies] -ink_primitives = { version = "3.2.0", default-features = false } -ink_metadata = { version = "3.2.0", default-features = false, features = ["derive"], optional = true } -ink_env = { version = "3.2.0", default-features = false } -ink_storage = { version = "3.2.0", default-features = false } -ink_lang = { version = "3.2.0", default-features = false } -ink_prelude = { version = "3.2.0", default-features = false } +ink_primitives = { version = "~3.2.0", default-features = false } +ink_metadata = { version = "~3.2.0", default-features = false, features = ["derive"], optional = true } +ink_env = { version = "~3.2.0", default-features = false } +ink_storage = { version = "~3.2.0", default-features = false } +ink_lang = { version = "~3.2.0", default-features = false } +ink_prelude = { version = "~3.2.0", default-features = false } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2", default-features = false, features = ["derive"], optional = true } diff --git a/examples/psp22_extensions/metadata/Cargo.toml b/examples/psp22_extensions/metadata/Cargo.toml index e0877e60c..407ee3eb3 100644 --- a/examples/psp22_extensions/metadata/Cargo.toml +++ b/examples/psp22_extensions/metadata/Cargo.toml @@ -5,12 +5,12 @@ authors = ["Supercolony "] edition = "2021" [dependencies] -ink_primitives = { version = "3.2.0", default-features = false } -ink_metadata = { version = "3.2.0", default-features = false, features = ["derive"], optional = true } -ink_env = { version = "3.2.0", default-features = false } -ink_storage = { version = "3.2.0", default-features = false } -ink_lang = { version = "3.2.0", default-features = false } -ink_prelude = { version = "3.2.0", default-features = false } +ink_primitives = { version = "~3.2.0", default-features = false } +ink_metadata = { version = "~3.2.0", default-features = false, features = ["derive"], optional = true } +ink_env = { version = "~3.2.0", default-features = false } +ink_storage = { version = "~3.2.0", default-features = false } +ink_lang = { version = "~3.2.0", default-features = false } +ink_prelude = { version = "~3.2.0", default-features = false } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2", default-features = false, features = ["derive"], optional = true } diff --git a/examples/psp22_extensions/mintable/Cargo.toml b/examples/psp22_extensions/mintable/Cargo.toml index cb78fd7ad..4446df844 100644 --- a/examples/psp22_extensions/mintable/Cargo.toml +++ b/examples/psp22_extensions/mintable/Cargo.toml @@ -5,12 +5,12 @@ authors = ["Supercolony "] edition = "2021" [dependencies] -ink_primitives = { version = "3.2.0", default-features = false } -ink_metadata = { version = "3.2.0", default-features = false, features = ["derive"], optional = true } -ink_env = { version = "3.2.0", default-features = false } -ink_storage = { version = "3.2.0", default-features = false } -ink_lang = { version = "3.2.0", default-features = false } -ink_prelude = { version = "3.2.0", default-features = false } +ink_primitives = { version = "~3.2.0", default-features = false } +ink_metadata = { version = "~3.2.0", default-features = false, features = ["derive"], optional = true } +ink_env = { version = "~3.2.0", default-features = false } +ink_storage = { version = "~3.2.0", default-features = false } +ink_lang = { version = "~3.2.0", default-features = false } +ink_prelude = { version = "~3.2.0", default-features = false } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2", default-features = false, features = ["derive"], optional = true } diff --git a/examples/psp22_extensions/pausable/Cargo.toml b/examples/psp22_extensions/pausable/Cargo.toml index 0c4c0f4ba..976987277 100644 --- a/examples/psp22_extensions/pausable/Cargo.toml +++ b/examples/psp22_extensions/pausable/Cargo.toml @@ -5,12 +5,12 @@ authors = ["Supercolony "] edition = "2021" [dependencies] -ink_primitives = { version = "3.2.0", default-features = false } -ink_metadata = { version = "3.2.0", default-features = false, features = ["derive"], optional = true } -ink_env = { version = "3.2.0", default-features = false } -ink_storage = { version = "3.2.0", default-features = false } -ink_lang = { version = "3.2.0", default-features = false } -ink_prelude = { version = "3.2.0", default-features = false } +ink_primitives = { version = "~3.2.0", default-features = false } +ink_metadata = { version = "~3.2.0", default-features = false, features = ["derive"], optional = true } +ink_env = { version = "~3.2.0", default-features = false } +ink_storage = { version = "~3.2.0", default-features = false } +ink_lang = { version = "~3.2.0", default-features = false } +ink_prelude = { version = "~3.2.0", default-features = false } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2", default-features = false, features = ["derive"], optional = true } diff --git a/examples/psp22_extensions/wrapper/Cargo.toml b/examples/psp22_extensions/wrapper/Cargo.toml index b96a4e22b..ebf8af403 100644 --- a/examples/psp22_extensions/wrapper/Cargo.toml +++ b/examples/psp22_extensions/wrapper/Cargo.toml @@ -5,12 +5,12 @@ authors = ["Supercolony "] edition = "2021" [dependencies] -ink_primitives = { version = "3.2.0", default-features = false } -ink_metadata = { version = "3.2.0", default-features = false, features = ["derive"], optional = true } -ink_env = { version = "3.2.0", default-features = false } -ink_storage = { version = "3.2.0", default-features = false } -ink_lang = { version = "3.2.0", default-features = false } -ink_prelude = { version = "3.2.0", default-features = false } +ink_primitives = { version = "~3.2.0", default-features = false } +ink_metadata = { version = "~3.2.0", default-features = false, features = ["derive"], optional = true } +ink_env = { version = "~3.2.0", default-features = false } +ink_storage = { version = "~3.2.0", default-features = false } +ink_lang = { version = "~3.2.0", default-features = false } +ink_prelude = { version = "~3.2.0", default-features = false } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2", default-features = false, features = ["derive"], optional = true } diff --git a/examples/psp22_utils/token_timelock/Cargo.toml b/examples/psp22_utils/token_timelock/Cargo.toml index 469954b21..4bcff6860 100644 --- a/examples/psp22_utils/token_timelock/Cargo.toml +++ b/examples/psp22_utils/token_timelock/Cargo.toml @@ -5,12 +5,12 @@ authors = ["Supercolony "] edition = "2021" [dependencies] -ink_primitives = { version = "3.2.0", default-features = false } -ink_metadata = { version = "3.2.0", default-features = false, features = ["derive"], optional = true } -ink_env = { version = "3.2.0", default-features = false } -ink_storage = { version = "3.2.0", default-features = false } -ink_lang = { version = "3.2.0", default-features = false } -ink_prelude = { version = "3.2.0", default-features = false } +ink_primitives = { version = "~3.2.0", default-features = false } +ink_metadata = { version = "~3.2.0", default-features = false, features = ["derive"], optional = true } +ink_env = { version = "~3.2.0", default-features = false } +ink_storage = { version = "~3.2.0", default-features = false } +ink_lang = { version = "~3.2.0", default-features = false } +ink_prelude = { version = "~3.2.0", default-features = false } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2", default-features = false, features = ["derive"], optional = true } diff --git a/examples/psp34/Cargo.toml b/examples/psp34/Cargo.toml index 519534a2c..1ff02e6c4 100644 --- a/examples/psp34/Cargo.toml +++ b/examples/psp34/Cargo.toml @@ -5,12 +5,12 @@ authors = ["Supercolony "] edition = "2021" [dependencies] -ink_primitives = { version = "3.2.0", default-features = false } -ink_metadata = { version = "3.2.0", default-features = false, features = ["derive"], optional = true } -ink_env = { version = "3.2.0", default-features = false } -ink_storage = { version = "3.2.0", default-features = false } -ink_lang = { version = "3.2.0", default-features = false } -ink_prelude = { version = "3.2.0", default-features = false } +ink_primitives = { version = "~3.2.0", default-features = false } +ink_metadata = { version = "~3.2.0", default-features = false, features = ["derive"], optional = true } +ink_env = { version = "~3.2.0", default-features = false } +ink_storage = { version = "~3.2.0", default-features = false } +ink_lang = { version = "~3.2.0", default-features = false } +ink_prelude = { version = "~3.2.0", default-features = false } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2", default-features = false, features = ["derive"], optional = true } diff --git a/examples/psp34_extensions/burnable/Cargo.toml b/examples/psp34_extensions/burnable/Cargo.toml index 29de32b3d..483493783 100644 --- a/examples/psp34_extensions/burnable/Cargo.toml +++ b/examples/psp34_extensions/burnable/Cargo.toml @@ -5,12 +5,12 @@ authors = ["Supercolony "] edition = "2021" [dependencies] -ink_primitives = { version = "3.2.0", default-features = false } -ink_metadata = { version = "3.2.0", default-features = false, features = ["derive"], optional = true } -ink_env = { version = "3.2.0", default-features = false } -ink_storage = { version = "3.2.0", default-features = false } -ink_lang = { version = "3.2.0", default-features = false } -ink_prelude = { version = "3.2.0", default-features = false } +ink_primitives = { version = "~3.2.0", default-features = false } +ink_metadata = { version = "~3.2.0", default-features = false, features = ["derive"], optional = true } +ink_env = { version = "~3.2.0", default-features = false } +ink_storage = { version = "~3.2.0", default-features = false } +ink_lang = { version = "~3.2.0", default-features = false } +ink_prelude = { version = "~3.2.0", default-features = false } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2", default-features = false, features = ["derive"], optional = true } diff --git a/examples/psp34_extensions/enumerable/Cargo.toml b/examples/psp34_extensions/enumerable/Cargo.toml index 733e5a8ee..10512a8f0 100644 --- a/examples/psp34_extensions/enumerable/Cargo.toml +++ b/examples/psp34_extensions/enumerable/Cargo.toml @@ -5,12 +5,12 @@ authors = ["Supercolony "] edition = "2021" [dependencies] -ink_primitives = { version = "3.2.0", default-features = false } -ink_metadata = { version = "3.2.0", default-features = false, features = ["derive"], optional = true } -ink_env = { version = "3.2.0", default-features = false } -ink_storage = { version = "3.2.0", default-features = false } -ink_lang = { version = "3.2.0", default-features = false } -ink_prelude = { version = "3.2.0", default-features = false } +ink_primitives = { version = "~3.2.0", default-features = false } +ink_metadata = { version = "~3.2.0", default-features = false, features = ["derive"], optional = true } +ink_env = { version = "~3.2.0", default-features = false } +ink_storage = { version = "~3.2.0", default-features = false } +ink_lang = { version = "~3.2.0", default-features = false } +ink_prelude = { version = "~3.2.0", default-features = false } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2", default-features = false, features = ["derive"], optional = true } diff --git a/examples/psp34_extensions/metadata/Cargo.toml b/examples/psp34_extensions/metadata/Cargo.toml index b6b8fb2c6..284e19fea 100644 --- a/examples/psp34_extensions/metadata/Cargo.toml +++ b/examples/psp34_extensions/metadata/Cargo.toml @@ -5,12 +5,12 @@ authors = ["Supercolony "] edition = "2021" [dependencies] -ink_primitives = { version = "3.2.0", default-features = false } -ink_metadata = { version = "3.2.0", default-features = false, features = ["derive"], optional = true } -ink_env = { version = "3.2.0", default-features = false } -ink_storage = { version = "3.2.0", default-features = false } -ink_lang = { version = "3.2.0", default-features = false } -ink_prelude = { version = "3.2.0", default-features = false } +ink_primitives = { version = "~3.2.0", default-features = false } +ink_metadata = { version = "~3.2.0", default-features = false, features = ["derive"], optional = true } +ink_env = { version = "~3.2.0", default-features = false } +ink_storage = { version = "~3.2.0", default-features = false } +ink_lang = { version = "~3.2.0", default-features = false } +ink_prelude = { version = "~3.2.0", default-features = false } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2", default-features = false, features = ["derive"], optional = true } diff --git a/examples/psp34_extensions/mintable/Cargo.toml b/examples/psp34_extensions/mintable/Cargo.toml index b2b150feb..72c5bff8e 100644 --- a/examples/psp34_extensions/mintable/Cargo.toml +++ b/examples/psp34_extensions/mintable/Cargo.toml @@ -5,12 +5,12 @@ authors = ["Supercolony "] edition = "2021" [dependencies] -ink_primitives = { version = "3.2.0", default-features = false } -ink_metadata = { version = "3.2.0", default-features = false, features = ["derive"], optional = true } -ink_env = { version = "3.2.0", default-features = false } -ink_storage = { version = "3.2.0", default-features = false } -ink_lang = { version = "3.2.0", default-features = false } -ink_prelude = { version = "3.2.0", default-features = false } +ink_primitives = { version = "~3.2.0", default-features = false } +ink_metadata = { version = "~3.2.0", default-features = false, features = ["derive"], optional = true } +ink_env = { version = "~3.2.0", default-features = false } +ink_storage = { version = "~3.2.0", default-features = false } +ink_lang = { version = "~3.2.0", default-features = false } +ink_prelude = { version = "~3.2.0", default-features = false } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2", default-features = false, features = ["derive"], optional = true } diff --git a/examples/reentrancy_guard/Cargo.toml b/examples/reentrancy_guard/Cargo.toml index 75633d1bb..be9c939c4 100644 --- a/examples/reentrancy_guard/Cargo.toml +++ b/examples/reentrancy_guard/Cargo.toml @@ -5,12 +5,12 @@ authors = ["Supercolony "] edition = "2021" [dependencies] -ink_primitives = { version = "3.2.0", default-features = false } -ink_metadata = { version = "3.2.0", default-features = false, features = ["derive"], optional = true } -ink_env = { version = "3.2.0", default-features = false } -ink_storage = { version = "3.2.0", default-features = false } -ink_lang = { version = "3.2.0", default-features = false } -ink_prelude = { version = "3.2.0", default-features = false } +ink_primitives = { version = "~3.2.0", default-features = false } +ink_metadata = { version = "~3.2.0", default-features = false, features = ["derive"], optional = true } +ink_env = { version = "~3.2.0", default-features = false } +ink_storage = { version = "~3.2.0", default-features = false } +ink_lang = { version = "~3.2.0", default-features = false } +ink_prelude = { version = "~3.2.0", default-features = false } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2", default-features = false, features = ["derive"], optional = true } diff --git a/examples/reentrancy_guard/contracts/flip_on_me/Cargo.toml b/examples/reentrancy_guard/contracts/flip_on_me/Cargo.toml index 347cf5bac..2d8f2c1c9 100644 --- a/examples/reentrancy_guard/contracts/flip_on_me/Cargo.toml +++ b/examples/reentrancy_guard/contracts/flip_on_me/Cargo.toml @@ -5,12 +5,12 @@ authors = ["Supercolony "] edition = "2021" [dependencies] -ink_primitives = { version = "3.2.0", default-features = false } -ink_metadata = { version = "3.2.0", default-features = false, features = ["derive"], optional = true } -ink_env = { version = "3.2.0", default-features = false } -ink_storage = { version = "3.2.0", default-features = false } -ink_lang = { version = "3.2.0", default-features = false } -ink_prelude = { version = "3.2.0", default-features = false } +ink_primitives = { version = "~3.2.0", default-features = false } +ink_metadata = { version = "~3.2.0", default-features = false, features = ["derive"], optional = true } +ink_env = { version = "~3.2.0", default-features = false } +ink_storage = { version = "~3.2.0", default-features = false } +ink_lang = { version = "~3.2.0", default-features = false } +ink_prelude = { version = "~3.2.0", default-features = false } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2", default-features = false, features = ["derive"], optional = true } diff --git a/examples/reentrancy_guard/contracts/flipper/Cargo.toml b/examples/reentrancy_guard/contracts/flipper/Cargo.toml index 78d67edbd..fe3ee3328 100644 --- a/examples/reentrancy_guard/contracts/flipper/Cargo.toml +++ b/examples/reentrancy_guard/contracts/flipper/Cargo.toml @@ -5,12 +5,12 @@ authors = ["Supercolony "] edition = "2021" [dependencies] -ink_primitives = { version = "3.2.0", default-features = false } -ink_metadata = { version = "3.2.0", default-features = false, features = ["derive"], optional = true } -ink_env = { version = "3.2.0", default-features = false } -ink_storage = { version = "3.2.0", default-features = false } -ink_lang = { version = "3.2.0", default-features = false } -ink_prelude = { version = "3.2.0", default-features = false } +ink_primitives = { version = "~3.2.0", default-features = false } +ink_metadata = { version = "~3.2.0", default-features = false, features = ["derive"], optional = true } +ink_env = { version = "~3.2.0", default-features = false } +ink_storage = { version = "~3.2.0", default-features = false } +ink_lang = { version = "~3.2.0", default-features = false } +ink_prelude = { version = "~3.2.0", default-features = false } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2", default-features = false, features = ["derive"], optional = true } diff --git a/examples/timelock_controller/Cargo.toml b/examples/timelock_controller/Cargo.toml index b3eef410b..d7a326375 100644 --- a/examples/timelock_controller/Cargo.toml +++ b/examples/timelock_controller/Cargo.toml @@ -5,12 +5,12 @@ authors = ["Supercolony "] edition = "2021" [dependencies] -ink_primitives = { version = "3.2.0", default-features = false } -ink_metadata = { version = "3.2.0", default-features = false, features = ["derive"], optional = true } -ink_env = { version = "3.2.0", default-features = false } -ink_storage = { version = "3.2.0", default-features = false } -ink_lang = { version = "3.2.0", default-features = false } -ink_prelude = { version = "3.2.0", default-features = false } +ink_primitives = { version = "~3.2.0", default-features = false } +ink_metadata = { version = "~3.2.0", default-features = false, features = ["derive"], optional = true } +ink_env = { version = "~3.2.0", default-features = false } +ink_storage = { version = "~3.2.0", default-features = false } +ink_lang = { version = "~3.2.0", default-features = false } +ink_prelude = { version = "~3.2.0", default-features = false } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2", default-features = false, features = ["derive"], optional = true } diff --git a/lang/Cargo.toml b/lang/Cargo.toml index 18103c598..ea2c43907 100644 --- a/lang/Cargo.toml +++ b/lang/Cargo.toml @@ -14,12 +14,12 @@ categories = ["no-std", "embedded"] include = ["Cargo.toml", "src/**/*.rs"] [dependencies] -openbrush_lang_macro = { version = "1.8.0", path = "macro", default-features = false } +openbrush_lang_macro = { version = "~1.8.0", path = "macro", default-features = false } -ink_env = { version = "3.2.0", default-features = false } -ink_lang = { version = "3.2.0", default-features = false } -ink_primitives = { version = "3.2.0", default-features = false } -ink_storage = { version = "3.2.0", default-features = false } +ink_env = { version = "~3.2.0", default-features = false } +ink_lang = { version = "~3.2.0", default-features = false } +ink_primitives = { version = "~3.2.0", default-features = false } +ink_storage = { version = "~3.2.0", default-features = false } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2", default-features = false, features = ["derive"] } diff --git a/lang/codegen/Cargo.toml b/lang/codegen/Cargo.toml index f20af36f4..b0878bd78 100644 --- a/lang/codegen/Cargo.toml +++ b/lang/codegen/Cargo.toml @@ -24,7 +24,7 @@ cargo_metadata = "0.13.1" unwrap = "1.2.1" blake2 = "0.9" heck = "0.3.1" -ink_lang_ir = { version = "3.2.0", default-features = false } +ink_lang_ir = { version = "~3.2.0", default-features = false } synstructure = "0.12" [lib] diff --git a/lang/macro/Cargo.toml b/lang/macro/Cargo.toml index 753db518f..4de4e00df 100644 --- a/lang/macro/Cargo.toml +++ b/lang/macro/Cargo.toml @@ -14,18 +14,18 @@ categories = ["no-std", "embedded"] include = ["Cargo.toml", "src/**/*.rs"] [dependencies] -openbrush_lang_codegen = { version = "1.8.0", path = "../codegen", default-features = false } +openbrush_lang_codegen = { version = "~1.8.0", path = "../codegen", default-features = false } syn = "1" proc-macro2 = "1" synstructure = "0.12" [dev-dependencies] -ink_primitives = { version = "3.2.0", default-features = false } -ink_metadata = { version = "3.2.0", default-features = false, features = ["derive"] } -ink_env = { version = "3.2.0", default-features = false } -ink_lang = { version = "3.2.0", default-features = false } -ink_storage = { version = "3.2.0", default-features = false } -ink_prelude = { version = "3.2.0", default-features = false } +ink_primitives = { version = "~3.2.0", default-features = false } +ink_metadata = { version = "~3.2.0", default-features = false, features = ["derive"] } +ink_env = { version = "~3.2.0", default-features = false } +ink_lang = { version = "~3.2.0", default-features = false } +ink_storage = { version = "~3.2.0", default-features = false } +ink_prelude = { version = "~3.2.0", default-features = false } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2", default-features = false, features = ["derive"] } diff --git a/mock/flash-borrower/Cargo.toml b/mock/flash-borrower/Cargo.toml index 22e7ff93b..274e2e982 100644 --- a/mock/flash-borrower/Cargo.toml +++ b/mock/flash-borrower/Cargo.toml @@ -5,12 +5,12 @@ authors = ["Supercolony "] edition = "2021" [dependencies] -ink_primitives = { version = "3.2.0", default-features = false } -ink_metadata = { version = "3.2.0", default-features = false, features = ["derive"], optional = true } -ink_env = { version = "3.2.0", default-features = false } -ink_storage = { version = "3.2.0", default-features = false } -ink_lang = { version = "3.2.0", default-features = false } -ink_prelude = { version = "3.2.0", default-features = false } +ink_primitives = { version = "~3.2.0", default-features = false } +ink_metadata = { version = "~3.2.0", default-features = false, features = ["derive"], optional = true } +ink_env = { version = "~3.2.0", default-features = false } +ink_storage = { version = "~3.2.0", default-features = false } +ink_lang = { version = "~3.2.0", default-features = false } +ink_prelude = { version = "~3.2.0", default-features = false } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2", default-features = false, features = ["derive"], optional = true } diff --git a/mock/psp1155-receiver/Cargo.toml b/mock/psp1155-receiver/Cargo.toml index 2ff34c7eb..76af1b77e 100644 --- a/mock/psp1155-receiver/Cargo.toml +++ b/mock/psp1155-receiver/Cargo.toml @@ -5,12 +5,12 @@ authors = ["Supercolony "] edition = "2021" [dependencies] -ink_primitives = { version = "3.2.0", default-features = false } -ink_metadata = { version = "3.2.0", default-features = false, features = ["derive"], optional = true } -ink_env = { version = "3.2.0", default-features = false } -ink_storage = { version = "3.2.0", default-features = false } -ink_lang = { version = "3.2.0", default-features = false } -ink_prelude = { version = "3.2.0", default-features = false } +ink_primitives = { version = "~3.2.0", default-features = false } +ink_metadata = { version = "~3.2.0", default-features = false, features = ["derive"], optional = true } +ink_env = { version = "~3.2.0", default-features = false } +ink_storage = { version = "~3.2.0", default-features = false } +ink_lang = { version = "~3.2.0", default-features = false } +ink_prelude = { version = "~3.2.0", default-features = false } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2", default-features = false, features = ["derive"], optional = true } diff --git a/mock/psp22-receiver/Cargo.toml b/mock/psp22-receiver/Cargo.toml index 72c52ce01..8cfcd1159 100644 --- a/mock/psp22-receiver/Cargo.toml +++ b/mock/psp22-receiver/Cargo.toml @@ -5,12 +5,12 @@ authors = ["Supercolony "] edition = "2021" [dependencies] -ink_primitives = { version = "3.2.0", default-features = false } -ink_metadata = { version = "3.2.0", default-features = false, features = ["derive"], optional = true } -ink_env = { version = "3.2.0", default-features = false } -ink_storage = { version = "3.2.0", default-features = false } -ink_lang = { version = "3.2.0", default-features = false } -ink_prelude = { version = "3.2.0", default-features = false } +ink_primitives = { version = "~3.2.0", default-features = false } +ink_metadata = { version = "~3.2.0", default-features = false, features = ["derive"], optional = true } +ink_env = { version = "~3.2.0", default-features = false } +ink_storage = { version = "~3.2.0", default-features = false } +ink_lang = { version = "~3.2.0", default-features = false } +ink_prelude = { version = "~3.2.0", default-features = false } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2", default-features = false, features = ["derive"], optional = true } diff --git a/mock/psp34-receiver/Cargo.toml b/mock/psp34-receiver/Cargo.toml index 5b730668a..9979005bc 100644 --- a/mock/psp34-receiver/Cargo.toml +++ b/mock/psp34-receiver/Cargo.toml @@ -5,12 +5,12 @@ authors = ["Supercolony "] edition = "2021" [dependencies] -ink_primitives = { version = "3.2.0", default-features = false } -ink_metadata = { version = "3.2.0", default-features = false, features = ["derive"], optional = true } -ink_env = { version = "3.2.0", default-features = false } -ink_storage = { version = "3.2.0", default-features = false } -ink_lang = { version = "3.2.0", default-features = false } -ink_prelude = { version = "3.2.0", default-features = false } +ink_primitives = { version = "~3.2.0", default-features = false } +ink_metadata = { version = "~3.2.0", default-features = false, features = ["derive"], optional = true } +ink_env = { version = "~3.2.0", default-features = false } +ink_storage = { version = "~3.2.0", default-features = false } +ink_lang = { version = "~3.2.0", default-features = false } +ink_prelude = { version = "~3.2.0", default-features = false } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2", default-features = false, features = ["derive"], optional = true }