From 673857e92dc843f0f003d8a6337220ed3b84e268 Mon Sep 17 00:00:00 2001 From: Artemka374 Date: Tue, 31 Jan 2023 15:28:31 +0200 Subject: [PATCH 01/14] update versions of ink and fix compilation of contracts --- Cargo.toml | 8 ++++---- README.md | 2 +- contracts/Cargo.toml | 6 +++--- contracts/src/governance/timelock_controller/mod.rs | 4 ++-- contracts/src/token/psp22/extensions/flashmint.rs | 7 ++++--- contracts/src/token/psp22/extensions/wrapper.rs | 6 ++++-- contracts/src/token/psp22/psp22.rs | 7 ++++--- contracts/src/token/psp22/utils/token_timelock.rs | 3 ++- contracts/src/token/psp34/psp34.rs | 7 ++++--- contracts/src/token/psp37/psp37.rs | 7 ++++--- contracts/src/upgradeability/diamond/diamond.rs | 4 ++-- contracts/src/upgradeability/proxy/mod.rs | 2 +- docs/docs/smart-contracts/example/contract.md | 4 ++-- docs/docs/smart-contracts/example/implementation.md | 4 ++-- docs/docs/smart-contracts/example/impls.md | 8 ++++---- docs/docs/smart-contracts/overview.md | 10 +++++----- docs/docs/smart-contracts/upgradeable.md | 4 ++-- example_project_structure/Cargo.toml | 4 ++-- example_project_structure/contracts/lending/Cargo.toml | 4 ++-- example_project_structure/contracts/loan/Cargo.toml | 4 ++-- example_project_structure/contracts/shares/Cargo.toml | 4 ++-- .../contracts/stable_coin/Cargo.toml | 4 ++-- example_project_structure/impls/lending/lending.rs | 8 ++++---- examples/access_control/Cargo.toml | 4 ++-- .../access_control_extensions/enumerable/Cargo.toml | 4 ++-- examples/alternatives/diamond/ink/Cargo.toml | 4 ++-- examples/alternatives/diamond/rust/Cargo.toml | 4 ++-- examples/diamond/Cargo.toml | 4 ++-- examples/diamond/diamond_caller/Cargo.toml | 4 ++-- examples/diamond/psp22_facet_v1/Cargo.toml | 4 ++-- examples/diamond/psp22_facet_v2/Cargo.toml | 4 ++-- examples/diamond/psp22_metadata_facet/Cargo.toml | 4 ++-- examples/ownable/Cargo.toml | 4 ++-- examples/pausable/Cargo.toml | 4 ++-- examples/payment_splitter/Cargo.toml | 4 ++-- examples/proxy/Cargo.toml | 4 ++-- examples/proxy/psp22_metadata_upgradeable/Cargo.toml | 4 ++-- examples/proxy/psp22_upgradeable/Cargo.toml | 4 ++-- examples/psp22/Cargo.toml | 4 ++-- examples/psp22_extensions/burnable/Cargo.toml | 4 ++-- examples/psp22_extensions/capped/Cargo.toml | 4 ++-- examples/psp22_extensions/flashmint/Cargo.toml | 4 ++-- examples/psp22_extensions/metadata/Cargo.toml | 4 ++-- examples/psp22_extensions/mintable/Cargo.toml | 4 ++-- examples/psp22_extensions/pausable/Cargo.toml | 4 ++-- examples/psp22_extensions/wrapper/Cargo.toml | 4 ++-- examples/psp22_pallet/Cargo.toml | 4 ++-- examples/psp22_pallet_extensions/burnable/Cargo.toml | 4 ++-- examples/psp22_pallet_extensions/metadata/Cargo.toml | 4 ++-- examples/psp22_pallet_extensions/mintable/Cargo.toml | 4 ++-- examples/psp22_utils/token_timelock/Cargo.toml | 4 ++-- examples/psp34/Cargo.toml | 4 ++-- examples/psp34_extensions/burnable/Cargo.toml | 4 ++-- examples/psp34_extensions/enumerable/Cargo.toml | 4 ++-- examples/psp34_extensions/metadata/Cargo.toml | 4 ++-- examples/psp34_extensions/mintable/Cargo.toml | 4 ++-- examples/psp37/Cargo.toml | 4 ++-- examples/psp37_extensions/batch/Cargo.toml | 4 ++-- examples/psp37_extensions/burnable/Cargo.toml | 4 ++-- examples/psp37_extensions/enumerable/Cargo.toml | 4 ++-- examples/psp37_extensions/metadata/Cargo.toml | 4 ++-- examples/psp37_extensions/mintable/Cargo.toml | 4 ++-- examples/reentrancy_guard/Cargo.toml | 4 ++-- .../reentrancy_guard/contracts/flip_on_me/Cargo.toml | 4 ++-- examples/reentrancy_guard/contracts/flipper/Cargo.toml | 4 ++-- examples/timelock_controller/Cargo.toml | 4 ++-- lang/Cargo.toml | 6 +++--- lang/codegen/Cargo.toml | 2 +- lang/codegen/src/trait_definition.rs | 4 +++- lang/macro/Cargo.toml | 6 +++--- lang/macro/src/lib.rs | 2 +- lang/src/test_utils.rs | 2 +- mock/flash-borrower/Cargo.toml | 4 ++-- mock/psp22-receiver/Cargo.toml | 4 ++-- mock/psp34-receiver/Cargo.toml | 4 ++-- mock/psp37-receiver/Cargo.toml | 4 ++-- 76 files changed, 170 insertions(+), 161 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 63e451811..53136c276 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,7 +12,7 @@ exclude = [ [package] name = "openbrush" -version = "3.0.0-beta" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2018" @@ -27,12 +27,12 @@ categories = ["no-std", "embedded"] include = ["Cargo.toml", "src/**/*.rs"] [dependencies] -ink = { git = "https://github.com/paritytech/ink", rev = "4655a8b4413cb50cbc38d1b7c173ad426ab06cde", default-features = false} +ink = { version = "4.0.0-beta.1", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } -openbrush_contracts = { version = "~3.0.0-beta", path = "contracts", default-features = false } -openbrush_lang = { version = "~3.0.0-beta", path = "lang", default-features = false } +openbrush_contracts = { version = "~3.0.0-beta.1", path = "contracts", default-features = false } +openbrush_lang = { version = "~3.0.0-beta.1", path = "lang", default-features = false } [lib] name = "openbrush" diff --git a/README.md b/README.md index 7678d7a6d..9b589bbbc 100644 --- a/README.md +++ b/README.md @@ -201,7 +201,7 @@ You can run unit tests by `RUSTFLAGS="-D warnings" cargo +nightly test --workspa To run integration test you need to start the node with contract-pallet. - [Setup and start the node with contract-pallet](https://github.com/paritytech/substrate-contracts-node) -After you can run tests by `yarn run test` command. It will build all contracts required for integration tests and run them. +After you can run tests by `npm run test` command. It will build all contracts required for integration tests and run them. ## FAQ diff --git a/contracts/Cargo.toml b/contracts/Cargo.toml index f4a60bc6a..64e106e72 100644 --- a/contracts/Cargo.toml +++ b/contracts/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "openbrush_contracts" -version = "3.0.0-beta" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" @@ -15,11 +15,11 @@ categories = ["no-std", "embedded"] include = ["Cargo.toml", "src/**/*.rs"] [dependencies] -ink = { git = "https://github.com/paritytech/ink", rev = "4655a8b4413cb50cbc38d1b7c173ad426ab06cde", default-features = false} +ink = { version = "4.0.0-beta.1", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } -openbrush = { version = "~3.0.0-beta", package = "openbrush_lang", path = "../lang", default-features = false } +openbrush = { version = "~3.0.0-beta.1", package = "openbrush_lang", path = "../lang", default-features = false } pallet-assets-chain-extension = { git = "https://github.com/727-ventures/pallet-assets-chain-extension", tag = "3.0.0-beta", default-features = false, features = ["ink-lang"] } diff --git a/contracts/src/governance/timelock_controller/mod.rs b/contracts/src/governance/timelock_controller/mod.rs index 6c9b501e5..b36feef00 100644 --- a/contracts/src/governance/timelock_controller/mod.rs +++ b/contracts/src/governance/timelock_controller/mod.rs @@ -453,13 +453,13 @@ where .exec_input(ExecutionInput::new(transaction.selector.into()).push_arg(CallInput(&transaction.input))) .returns::<()>() .call_flags(CallFlags::default().set_allow_reentry(true)) - .fire() + .try_invoke() .map_err(|_| TimelockControllerError::UnderlyingTransactionReverted); // Load the sate of the contract after the cross call. self.load(); - result?; + result?.unwrap(); self._emit_call_executed_event(id, i, transaction); Ok(()) } diff --git a/contracts/src/token/psp22/extensions/flashmint.rs b/contracts/src/token/psp22/extensions/flashmint.rs index 5793223a0..39a0558e3 100644 --- a/contracts/src/token/psp22/extensions/flashmint.rs +++ b/contracts/src/token/psp22/extensions/flashmint.rs @@ -111,11 +111,12 @@ impl> Internal for T { let builder = FlashBorrowerRef::on_flashloan_builder(&receiver_account, Self::env().caller(), token, amount, fee, data) .call_flags(CallFlags::default().set_allow_reentry(true)); - let result = match builder.fire() { - Ok(Ok(Ok(_))) => Ok(()), - Ok(Ok(Err(FlashBorrowerError::FlashloanRejected(message)))) => { + let result = match builder.try_invoke() { + Ok(Ok(Ok(Ok(_)))) => Ok(()), + Ok(Ok(Ok(Err(FlashBorrowerError::FlashloanRejected(message))))) => { Err(FlashLenderError::BorrowerRejected(message)) } + Ok(Ok(Err(ink::LangError::CouldNotReadInput))) => Ok(()), // Means unknown method Ok(Err(ink::LangError::CouldNotReadInput)) => Ok(()), // `NotCallable` means that the receiver is not a contract. diff --git a/contracts/src/token/psp22/extensions/wrapper.rs b/contracts/src/token/psp22/extensions/wrapper.rs index 5157456d4..a94a2e82a 100644 --- a/contracts/src/token/psp22/extensions/wrapper.rs +++ b/contracts/src/token/psp22/extensions/wrapper.rs @@ -94,7 +94,8 @@ impl + Storage> Internal for T { self._underlying() .transfer_from_builder(Self::env().caller(), Self::env().account_id(), amount, Vec::::new()) .call_flags(CallFlags::default().set_allow_reentry(true)) - .fire() + .try_invoke() + .unwrap() .unwrap() .unwrap() } @@ -103,7 +104,8 @@ impl + Storage> Internal for T { self._underlying() .transfer_builder(account, amount, Vec::::new()) .call_flags(CallFlags::default().set_allow_reentry(true)) - .fire() + .try_invoke() + .unwrap() .unwrap() .unwrap() } diff --git a/contracts/src/token/psp22/psp22.rs b/contracts/src/token/psp22/psp22.rs index 2c1d9fe00..e83d22ffe 100644 --- a/contracts/src/token/psp22/psp22.rs +++ b/contracts/src/token/psp22/psp22.rs @@ -183,10 +183,11 @@ impl> Internal for T { data.clone(), ) .call_flags(CallFlags::default().set_allow_reentry(true)); - let result = match builder.fire() { - Ok(Ok(Ok(_))) => Ok(()), - Ok(Ok(Err(e))) => Err(e.into()), + let result = match builder.try_invoke() { + Ok(Ok(Ok(Ok(_)))) => Ok(()), + Ok(Ok(Ok(Err(e)))) => Err(e.into()), // Means unknown method + Ok(Ok(Err(ink::LangError::CouldNotReadInput))) => Ok(()), Ok(Err(ink::LangError::CouldNotReadInput)) => Ok(()), // `NotCallable` means that the receiver is not a contract. Err(ink::env::Error::NotCallable) => Ok(()), diff --git a/contracts/src/token/psp22/utils/token_timelock.rs b/contracts/src/token/psp22/utils/token_timelock.rs index f4a6697d4..ce04180bb 100644 --- a/contracts/src/token/psp22/utils/token_timelock.rs +++ b/contracts/src/token/psp22/utils/token_timelock.rs @@ -105,7 +105,8 @@ impl> Internal for T { self._token() .transfer_builder(beneficairy, amount, Vec::::new()) .call_flags(CallFlags::default().set_allow_reentry(true)) - .fire() + .try_invoke() + .unwrap() .unwrap() .unwrap()?; Ok(()) diff --git a/contracts/src/token/psp34/psp34.rs b/contracts/src/token/psp34/psp34.rs index 762c02d54..11987bdbb 100644 --- a/contracts/src/token/psp34/psp34.rs +++ b/contracts/src/token/psp34/psp34.rs @@ -232,10 +232,11 @@ where let builder = PSP34ReceiverRef::before_received_builder(to, operator.clone(), from.clone(), id.clone(), data.clone()) .call_flags(CallFlags::default().set_allow_reentry(true)); - let b = builder.fire(); + let b = builder.try_invoke(); let result = match b { - Ok(Ok(Ok(_))) => Ok(()), - Ok(Ok(Err(e))) => Err(e.into()), + Ok(Ok(Ok(Ok(_)))) => Ok(()), + Ok(Ok(Ok(Err(e)))) => Err(e.into()), + Ok(Ok(Err(ink::LangError::CouldNotReadInput))) => Ok(()), // Means unknown method Ok(Err(ink::LangError::CouldNotReadInput)) => Ok(()), // `NotCallable` means that the receiver is not a contract. diff --git a/contracts/src/token/psp37/psp37.rs b/contracts/src/token/psp37/psp37.rs index 8a4983741..89520a9d5 100644 --- a/contracts/src/token/psp37/psp37.rs +++ b/contracts/src/token/psp37/psp37.rs @@ -396,12 +396,13 @@ where data.clone(), ) .call_flags(CallFlags::default().set_allow_reentry(true)); - let result = match builder.fire() { - Ok(Ok(Ok(_))) => Ok(()), - Ok(Ok(Err(e))) => Err(e.into()), + let result = match builder.try_invoke() { + Ok(Ok(Ok(Ok(_)))) => Ok(()), + Ok(Ok(Ok(Err(e)))) => Err(e.into()), // `NotCallable` means that the receiver is not a contract. Err(ink::env::Error::NotCallable) => Ok(()), // Means unknown method + Ok(Ok(Err(ink::LangError::CouldNotReadInput))) => Ok(()), Ok(Err(ink::LangError::CouldNotReadInput)) => Ok(()), _ => { Err(PSP37Error::SafeTransferCheckFailed(String::from( diff --git a/contracts/src/upgradeability/diamond/diamond.rs b/contracts/src/upgradeability/diamond/diamond.rs index 1b60c99d1..883788b26 100644 --- a/contracts/src/upgradeability/diamond/diamond.rs +++ b/contracts/src/upgradeability/diamond/diamond.rs @@ -190,7 +190,7 @@ where // marked delegated call as "tail", to end the execution of the contract. .set_tail_call(true), ) - .fire() + .try_invoke() .unwrap_or_else(|err| panic!("delegate call to {:?} failed due to {:?}", delegate_code, err)); unreachable!("the _fallback call will never return since `tail_call` was set"); } @@ -204,7 +204,7 @@ where // marked delegated call as "tail", to end the execution of the contract. .set_tail_call(true)) .returns::<()>() - .fire() + .try_invoke() .unwrap_or_else(|err| panic!("init call failed due to {:?}", err)); unreachable!("the _init_call call will never return since `tail_call` was set"); } diff --git a/contracts/src/upgradeability/proxy/mod.rs b/contracts/src/upgradeability/proxy/mod.rs index 008bfb057..32f764089 100644 --- a/contracts/src/upgradeability/proxy/mod.rs +++ b/contracts/src/upgradeability/proxy/mod.rs @@ -92,7 +92,7 @@ impl> Internal for T { // marked delegated call as "tail", to end the execution of the contract. .set_tail_call(true), ) - .fire() + .try_invoke() .unwrap_or_else(|err| { panic!( "delegate call to {:?} failed due to {:?}", diff --git a/docs/docs/smart-contracts/example/contract.md b/docs/docs/smart-contracts/example/contract.md index b49248dc6..bdaaca921 100644 --- a/docs/docs/smart-contracts/example/contract.md +++ b/docs/docs/smart-contracts/example/contract.md @@ -16,7 +16,7 @@ implementation of `Lending` and `LendingPermissioned` traits defined in the `len ```toml [package] name = "lending_contract" -version = "3.0.0-beta" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" @@ -29,7 +29,7 @@ scale-info = { version = "2.3", default-features = false, features = ["derive"], shares_contract = { path = "../shares", default-features = false, features = ["ink-as-dependency"] } loan_contract = { path = "../loan", default-features = false, features = ["ink-as-dependency"] } lending_project = { path = "../..", default-features = false } -openbrush = { version = "~3.0.0-beta", default-features = false, features = ["pausable", "access_control"] } +openbrush = { version = "~3.0.0-beta.1", default-features = false, features = ["pausable", "access_control"] } [lib] name = "lending_contract" diff --git a/docs/docs/smart-contracts/example/implementation.md b/docs/docs/smart-contracts/example/implementation.md index 0482a13cd..b3437f5c0 100644 --- a/docs/docs/smart-contracts/example/implementation.md +++ b/docs/docs/smart-contracts/example/implementation.md @@ -137,7 +137,7 @@ default fn lend_assets(&mut self, asset_address: AccountId, amount: Balance) -> // transfer the assets from user to the contract| PSP22Ref::transfer_from_builder(&asset_address, lender, contract, amount, Vec::::new()) .call_flags(ink::env::CallFlags::default().set_allow_reentry(true)) - .fire() + .try_invoke() .unwrap()?; // if no assets were deposited yet we will mint the same amount of shares as deposited `amount` let new_shares = if total_asset == 0 { @@ -228,7 +228,7 @@ default fn borrow_assets( // we will transfer the collateral to the contract PSP22Ref::transfer_from_builder(&collateral_address, borrower, contract, amount, Vec::::new()) .call_flags(ink::env::CallFlags::default().set_allow_reentry(true)) - .fire() + .try_invoke() .unwrap()?; // create loan info let loan_info = LoanInfo { diff --git a/docs/docs/smart-contracts/example/impls.md b/docs/docs/smart-contracts/example/impls.md index 111b93b3b..14147c3f4 100644 --- a/docs/docs/smart-contracts/example/impls.md +++ b/docs/docs/smart-contracts/example/impls.md @@ -594,7 +594,7 @@ impl + Storage> Lending for T { // transfer the assets from user to the contract| PSP22Ref::transfer_from_builder(&asset_address, lender, contract, amount, Vec::::new()) .call_flags(ink::env::CallFlags::default().set_allow_reentry(true)) - .fire() + .try_invoke() .unwrap()?; // if no assets were deposited yet we will mint the same amount of shares as deposited `amount` let new_shares = if total_asset == 0 { @@ -650,7 +650,7 @@ impl + Storage> Lending for T { // we will transfer the collateral to the contract PSP22Ref::transfer_from_builder(&collateral_address, borrower, contract, amount, Vec::::new()) .call_flags(ink::env::CallFlags::default().set_allow_reentry(true)) - .fire() + .try_invoke() .unwrap()?; // create loan info let loan_info = LoanInfo { @@ -704,7 +704,7 @@ impl + Storage> Lending for T { if repay_amount >= to_repay { PSP22Ref::transfer_from_builder(&loan_info.borrow_token, initiator, contract, to_repay, Vec::::new()) .call_flags(ink::env::CallFlags::default().set_allow_reentry(true)) - .fire() + .try_invoke() .unwrap()?; PSP22Ref::transfer( &loan_info.collateral_token, @@ -723,7 +723,7 @@ impl + Storage> Lending for T { Vec::::new(), ) .call_flags(ink::env::CallFlags::default().set_allow_reentry(true)) - .fire() + .try_invoke() .unwrap()?; let to_return = (repay_amount * loan_info.collateral_amount) / to_repay; PSP22Ref::transfer(&loan_info.collateral_token, initiator, to_return, Vec::::new())?; diff --git a/docs/docs/smart-contracts/overview.md b/docs/docs/smart-contracts/overview.md index c6f7afd1f..01678fd5b 100644 --- a/docs/docs/smart-contracts/overview.md +++ b/docs/docs/smart-contracts/overview.md @@ -18,13 +18,13 @@ It doesn't contain [versioning](https://github.com/supercolony-net/openbrush-con ```toml [dependencies] # Import ink! -ink = { git = "https://github.com/paritytech/ink", rev = "4655a8b4413cb50cbc38d1b7c173ad426ab06cde", default-features = false} +ink = { version = "4.0.0-beta.1", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } # Brush dependency -openbrush = { git = "https://github.com/727-Ventures/openbrush-contracts", version = "~3.0.0-beta", default-features = false } +openbrush = { git = "https://github.com/727-Ventures/openbrush-contracts", version = "~3.0.0-beta.1", default-features = false } [features] default = ["std"] @@ -73,17 +73,17 @@ The name of the feature is the same as the name of the module. For example: To enable `psp22`: ```toml -openbrush = { git = "https://github.com/727-Ventures/openbrush-contracts", version = "~3.0.0-beta", default-features = false, features = ["psp22"] } +openbrush = { git = "https://github.com/727-Ventures/openbrush-contracts", version = "~3.0.0-beta.1", default-features = false, features = ["psp22"] } ``` To enable `ownable`: ```toml -openbrush = { git = "https://github.com/727-Ventures/openbrush-contracts", version = "~3.0.0-beta", default-features = false, features = ["ownable"] } +openbrush = { git = "https://github.com/727-Ventures/openbrush-contracts", version = "~3.0.0-beta.1", default-features = false, features = ["ownable"] } ``` To enable both: ```toml -openbrush = { git = "https://github.com/727-Ventures/openbrush-contracts", version = "~3.0.0-beta", default-features = false, features = ["psp22, ownable"] } +openbrush = { git = "https://github.com/727-Ventures/openbrush-contracts", version = "~3.0.0-beta.1", default-features = false, features = ["psp22, ownable"] } ``` After enabling the feature and importing the corresponding module, you need to embed the module diff --git a/docs/docs/smart-contracts/upgradeable.md b/docs/docs/smart-contracts/upgradeable.md index 35fb6ed6c..27458ca43 100644 --- a/docs/docs/smart-contracts/upgradeable.md +++ b/docs/docs/smart-contracts/upgradeable.md @@ -208,7 +208,7 @@ pub struct Data { ### Disclaimer -The following information describes `Proxy` and `Diamond` patterns of upgradeable storage, which currently don't work in ink! 4 due to `DelegateCall`, but we will leave it here for the future updates of this feature (and also for the OpenBrush versions before `3.0.0-beta`). +The following information describes `Proxy` and `Diamond` patterns of upgradeable storage, which currently don't work in ink! 4 due to `DelegateCall`, but we will leave it here for the future updates of this feature (and also for the OpenBrush versions before `3.0.0-beta.1`). Uploading your contract on the blockchain with `contract-pallet` has two phases: - Deploy - deploys source code to the blockchain. After deploying, the network uses the hash of the source code as an identifier for future instantiation of the contract. Now anyone can instantiate the contract by source code hash. @@ -546,7 +546,7 @@ pub mod facet_b { // It needs to allow reentrancy if it wants to execute itself. PSP22Ref::balance_of_builder(&address_of_current_contract, owner) .call_flags(ink::env::CallFlags::default().set_allow_reentry(true)) - .fire() + .try_invoke() .unwrap(); } diff --git a/example_project_structure/Cargo.toml b/example_project_structure/Cargo.toml index fd0833223..752731d8e 100644 --- a/example_project_structure/Cargo.toml +++ b/example_project_structure/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "lending_project" -version = "3.0.0-beta" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" [dependencies] -ink = { git = "https://github.com/paritytech/ink", rev = "4655a8b4413cb50cbc38d1b7c173ad426ab06cde", default-features = false} +ink = { version = "4.0.0-beta.1", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } diff --git a/example_project_structure/contracts/lending/Cargo.toml b/example_project_structure/contracts/lending/Cargo.toml index bc17a319d..0b34c4ae6 100644 --- a/example_project_structure/contracts/lending/Cargo.toml +++ b/example_project_structure/contracts/lending/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "lending_contract" -version = "3.0.0-beta" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" [dependencies] -ink = { git = "https://github.com/paritytech/ink", rev = "4655a8b4413cb50cbc38d1b7c173ad426ab06cde", default-features = false} +ink = { version = "4.0.0-beta.1", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } diff --git a/example_project_structure/contracts/loan/Cargo.toml b/example_project_structure/contracts/loan/Cargo.toml index 6eead1bfd..09125d879 100644 --- a/example_project_structure/contracts/loan/Cargo.toml +++ b/example_project_structure/contracts/loan/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "loan_contract" -version = "3.0.0-beta" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" [dependencies] -ink = { git = "https://github.com/paritytech/ink", rev = "4655a8b4413cb50cbc38d1b7c173ad426ab06cde", default-features = false} +ink = { version = "4.0.0-beta.1", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } diff --git a/example_project_structure/contracts/shares/Cargo.toml b/example_project_structure/contracts/shares/Cargo.toml index 38a840cae..e2fd030c0 100644 --- a/example_project_structure/contracts/shares/Cargo.toml +++ b/example_project_structure/contracts/shares/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "shares_contract" -version = "3.0.0-beta" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" [dependencies] -ink = { git = "https://github.com/paritytech/ink", rev = "4655a8b4413cb50cbc38d1b7c173ad426ab06cde", default-features = false} +ink = { version = "4.0.0-beta.1", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } diff --git a/example_project_structure/contracts/stable_coin/Cargo.toml b/example_project_structure/contracts/stable_coin/Cargo.toml index d635c1480..103d45c30 100644 --- a/example_project_structure/contracts/stable_coin/Cargo.toml +++ b/example_project_structure/contracts/stable_coin/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "stable_coin_contract" -version = "3.0.0-beta" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" [dependencies] -ink = { git = "https://github.com/paritytech/ink", rev = "4655a8b4413cb50cbc38d1b7c173ad426ab06cde", default-features = false} +ink = { version = "4.0.0-beta.1", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } diff --git a/example_project_structure/impls/lending/lending.rs b/example_project_structure/impls/lending/lending.rs index b9925a376..c8e2d95b5 100644 --- a/example_project_structure/impls/lending/lending.rs +++ b/example_project_structure/impls/lending/lending.rs @@ -117,7 +117,7 @@ impl + Storage> Lending for T { // transfer the assets from user to the contract| PSP22Ref::transfer_from_builder(&asset_address, lender, contract, amount, Vec::::new()) .call_flags(ink::env::CallFlags::default().set_allow_reentry(true)) - .fire() + .try_invoke() .unwrap() .unwrap()?; // if no assets were deposited yet we will mint the same amount of shares as deposited `amount` @@ -174,7 +174,7 @@ impl + Storage> Lending for T { // we will transfer the collateral to the contract PSP22Ref::transfer_from_builder(&collateral_address, borrower, contract, amount, Vec::::new()) .call_flags(ink::env::CallFlags::default().set_allow_reentry(true)) - .fire() + .try_invoke() .unwrap() .unwrap()?; // create loan info @@ -229,7 +229,7 @@ impl + Storage> Lending for T { if repay_amount >= to_repay { PSP22Ref::transfer_from_builder(&loan_info.borrow_token, initiator, contract, to_repay, Vec::::new()) .call_flags(ink::env::CallFlags::default().set_allow_reentry(true)) - .fire() + .try_invoke() .unwrap() .unwrap()?; PSP22Ref::transfer( @@ -249,7 +249,7 @@ impl + Storage> Lending for T { Vec::::new(), ) .call_flags(ink::env::CallFlags::default().set_allow_reentry(true)) - .fire() + .try_invoke() .unwrap() .unwrap()?; let to_return = (repay_amount * loan_info.collateral_amount) / to_repay; diff --git a/examples/access_control/Cargo.toml b/examples/access_control/Cargo.toml index bb796857c..05b889247 100644 --- a/examples/access_control/Cargo.toml +++ b/examples/access_control/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "my_access_control" -version = "3.0.0-beta" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" [dependencies] -ink = { git = "https://github.com/paritytech/ink", rev = "4655a8b4413cb50cbc38d1b7c173ad426ab06cde", default-features = false} +ink = { version = "4.0.0-beta.1", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } diff --git a/examples/access_control_extensions/enumerable/Cargo.toml b/examples/access_control_extensions/enumerable/Cargo.toml index 122dff142..b7719eba6 100644 --- a/examples/access_control_extensions/enumerable/Cargo.toml +++ b/examples/access_control_extensions/enumerable/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "my_access_control_enumerable" -version = "3.0.0-beta" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" [dependencies] -ink = { git = "https://github.com/paritytech/ink", rev = "4655a8b4413cb50cbc38d1b7c173ad426ab06cde", default-features = false} +ink = { version = "4.0.0-beta.1", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } diff --git a/examples/alternatives/diamond/ink/Cargo.toml b/examples/alternatives/diamond/ink/Cargo.toml index d273c238f..65ad79cea 100644 --- a/examples/alternatives/diamond/ink/Cargo.toml +++ b/examples/alternatives/diamond/ink/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "ink_diamond" -version = "3.0.0-beta" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" [dependencies] -ink = { git = "https://github.com/paritytech/ink", rev = "4655a8b4413cb50cbc38d1b7c173ad426ab06cde", default-features = false} +ink = { version = "4.0.0-beta.1", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } diff --git a/examples/alternatives/diamond/rust/Cargo.toml b/examples/alternatives/diamond/rust/Cargo.toml index ac5aeee4d..dbf11f386 100644 --- a/examples/alternatives/diamond/rust/Cargo.toml +++ b/examples/alternatives/diamond/rust/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "rust_diamond" -version = "3.0.0-beta" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" [dependencies] -ink = { git = "https://github.com/paritytech/ink", rev = "4655a8b4413cb50cbc38d1b7c173ad426ab06cde", default-features = false} +ink = { version = "4.0.0-beta.1", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } diff --git a/examples/diamond/Cargo.toml b/examples/diamond/Cargo.toml index 5033bfed4..1da06ef7c 100644 --- a/examples/diamond/Cargo.toml +++ b/examples/diamond/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "my_diamond" -version = "3.0.0-beta" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" [dependencies] -ink = { git = "https://github.com/paritytech/ink", rev = "4655a8b4413cb50cbc38d1b7c173ad426ab06cde", default-features = false} +ink = { version = "4.0.0-beta.1", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } diff --git a/examples/diamond/diamond_caller/Cargo.toml b/examples/diamond/diamond_caller/Cargo.toml index e509cc75a..ba1ca790a 100644 --- a/examples/diamond/diamond_caller/Cargo.toml +++ b/examples/diamond/diamond_caller/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "diamond_caller" -version = "3.0.0-beta" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" [dependencies] -ink = { git = "https://github.com/paritytech/ink", rev = "4655a8b4413cb50cbc38d1b7c173ad426ab06cde", default-features = false} +ink = { version = "4.0.0-beta.1", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } diff --git a/examples/diamond/psp22_facet_v1/Cargo.toml b/examples/diamond/psp22_facet_v1/Cargo.toml index 5661b119e..de802be81 100644 --- a/examples/diamond/psp22_facet_v1/Cargo.toml +++ b/examples/diamond/psp22_facet_v1/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "my_psp22_facet_v1" -version = "3.0.0-beta" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" [dependencies] -ink = { git = "https://github.com/paritytech/ink", rev = "4655a8b4413cb50cbc38d1b7c173ad426ab06cde", default-features = false} +ink = { version = "4.0.0-beta.1", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } diff --git a/examples/diamond/psp22_facet_v2/Cargo.toml b/examples/diamond/psp22_facet_v2/Cargo.toml index 36950b2f0..504e15524 100644 --- a/examples/diamond/psp22_facet_v2/Cargo.toml +++ b/examples/diamond/psp22_facet_v2/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "my_psp22_facet_v2" -version = "3.0.0-beta" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" [dependencies] -ink = { git = "https://github.com/paritytech/ink", rev = "4655a8b4413cb50cbc38d1b7c173ad426ab06cde", default-features = false} +ink = { version = "4.0.0-beta.1", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } diff --git a/examples/diamond/psp22_metadata_facet/Cargo.toml b/examples/diamond/psp22_metadata_facet/Cargo.toml index 42e5ef2f4..a4eac9d76 100644 --- a/examples/diamond/psp22_metadata_facet/Cargo.toml +++ b/examples/diamond/psp22_metadata_facet/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "my_psp22_metadata_facet" -version = "3.0.0-beta" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" [dependencies] -ink = { git = "https://github.com/paritytech/ink", rev = "4655a8b4413cb50cbc38d1b7c173ad426ab06cde", default-features = false} +ink = { version = "4.0.0-beta.1", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } diff --git a/examples/ownable/Cargo.toml b/examples/ownable/Cargo.toml index e1b2581a7..673bf1230 100644 --- a/examples/ownable/Cargo.toml +++ b/examples/ownable/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "my_ownable" -version = "3.0.0-beta" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" [dependencies] -ink = { git = "https://github.com/paritytech/ink", rev = "4655a8b4413cb50cbc38d1b7c173ad426ab06cde", default-features = false} +ink = { version = "4.0.0-beta.1", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } diff --git a/examples/pausable/Cargo.toml b/examples/pausable/Cargo.toml index 3caf2269e..9834f3c95 100644 --- a/examples/pausable/Cargo.toml +++ b/examples/pausable/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "my_pausable" -version = "3.0.0-beta" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" [dependencies] -ink = { git = "https://github.com/paritytech/ink", rev = "4655a8b4413cb50cbc38d1b7c173ad426ab06cde", default-features = false} +ink = { version = "4.0.0-beta.1", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } diff --git a/examples/payment_splitter/Cargo.toml b/examples/payment_splitter/Cargo.toml index 7055aeeaf..8b412a224 100644 --- a/examples/payment_splitter/Cargo.toml +++ b/examples/payment_splitter/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "my_payment_splitter" -version = "3.0.0-beta" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" [dependencies] -ink = { git = "https://github.com/paritytech/ink", rev = "4655a8b4413cb50cbc38d1b7c173ad426ab06cde", default-features = false} +ink = { version = "4.0.0-beta.1", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } diff --git a/examples/proxy/Cargo.toml b/examples/proxy/Cargo.toml index 33cc09792..890d8eef6 100644 --- a/examples/proxy/Cargo.toml +++ b/examples/proxy/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "my_proxy" -version = "3.0.0-beta" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" [dependencies] -ink = { git = "https://github.com/paritytech/ink", rev = "4655a8b4413cb50cbc38d1b7c173ad426ab06cde", default-features = false} +ink = { version = "4.0.0-beta.1", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } diff --git a/examples/proxy/psp22_metadata_upgradeable/Cargo.toml b/examples/proxy/psp22_metadata_upgradeable/Cargo.toml index 210406341..3ccfdafcf 100644 --- a/examples/proxy/psp22_metadata_upgradeable/Cargo.toml +++ b/examples/proxy/psp22_metadata_upgradeable/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "my_psp22_metadata_upgradeable" -version = "3.0.0-beta" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" [dependencies] -ink = { git = "https://github.com/paritytech/ink", rev = "4655a8b4413cb50cbc38d1b7c173ad426ab06cde", default-features = false} +ink = { version = "4.0.0-beta.1", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } diff --git a/examples/proxy/psp22_upgradeable/Cargo.toml b/examples/proxy/psp22_upgradeable/Cargo.toml index df86bbef9..a32f14b15 100644 --- a/examples/proxy/psp22_upgradeable/Cargo.toml +++ b/examples/proxy/psp22_upgradeable/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "my_psp22_upgradeable" -version = "3.0.0-beta" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" [dependencies] -ink = { git = "https://github.com/paritytech/ink", rev = "4655a8b4413cb50cbc38d1b7c173ad426ab06cde", default-features = false} +ink = { version = "4.0.0-beta.1", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } diff --git a/examples/psp22/Cargo.toml b/examples/psp22/Cargo.toml index 4de60d0cb..08a1ff36f 100644 --- a/examples/psp22/Cargo.toml +++ b/examples/psp22/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "my_psp22" -version = "3.0.0-beta" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" [dependencies] -ink = { git = "https://github.com/paritytech/ink", rev = "4655a8b4413cb50cbc38d1b7c173ad426ab06cde", default-features = false} +ink = { version = "4.0.0-beta.1", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } diff --git a/examples/psp22_extensions/burnable/Cargo.toml b/examples/psp22_extensions/burnable/Cargo.toml index c6610a8b9..9837fe7bd 100644 --- a/examples/psp22_extensions/burnable/Cargo.toml +++ b/examples/psp22_extensions/burnable/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "my_psp22_burnable" -version = "3.0.0-beta" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" [dependencies] -ink = { git = "https://github.com/paritytech/ink", rev = "4655a8b4413cb50cbc38d1b7c173ad426ab06cde", default-features = false} +ink = { version = "4.0.0-beta.1", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } diff --git a/examples/psp22_extensions/capped/Cargo.toml b/examples/psp22_extensions/capped/Cargo.toml index 4cabc6681..6e8824e98 100644 --- a/examples/psp22_extensions/capped/Cargo.toml +++ b/examples/psp22_extensions/capped/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "my_psp22_capped" -version = "3.0.0-beta" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" [dependencies] -ink = { git = "https://github.com/paritytech/ink", rev = "4655a8b4413cb50cbc38d1b7c173ad426ab06cde", default-features = false} +ink = { version = "4.0.0-beta.1", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } diff --git a/examples/psp22_extensions/flashmint/Cargo.toml b/examples/psp22_extensions/flashmint/Cargo.toml index 1e85ebd8f..c031d35d8 100644 --- a/examples/psp22_extensions/flashmint/Cargo.toml +++ b/examples/psp22_extensions/flashmint/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "my_psp22_flashmint" -version = "3.0.0-beta" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" [dependencies] -ink = { git = "https://github.com/paritytech/ink", rev = "4655a8b4413cb50cbc38d1b7c173ad426ab06cde", default-features = false} +ink = { version = "4.0.0-beta.1", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } diff --git a/examples/psp22_extensions/metadata/Cargo.toml b/examples/psp22_extensions/metadata/Cargo.toml index e5070c0e3..e545b6e53 100644 --- a/examples/psp22_extensions/metadata/Cargo.toml +++ b/examples/psp22_extensions/metadata/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "my_psp22_metadata" -version = "3.0.0-beta" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" [dependencies] -ink = { git = "https://github.com/paritytech/ink", rev = "4655a8b4413cb50cbc38d1b7c173ad426ab06cde", default-features = false} +ink = { version = "4.0.0-beta.1", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } diff --git a/examples/psp22_extensions/mintable/Cargo.toml b/examples/psp22_extensions/mintable/Cargo.toml index 71b9f3db1..0e15daca1 100644 --- a/examples/psp22_extensions/mintable/Cargo.toml +++ b/examples/psp22_extensions/mintable/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "my_psp22_mintable" -version = "3.0.0-beta" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" [dependencies] -ink = { git = "https://github.com/paritytech/ink", rev = "4655a8b4413cb50cbc38d1b7c173ad426ab06cde", default-features = false} +ink = { version = "4.0.0-beta.1", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } diff --git a/examples/psp22_extensions/pausable/Cargo.toml b/examples/psp22_extensions/pausable/Cargo.toml index 24fe99118..ac9a26cb7 100644 --- a/examples/psp22_extensions/pausable/Cargo.toml +++ b/examples/psp22_extensions/pausable/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "my_psp22_pausable" -version = "3.0.0-beta" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" [dependencies] -ink = { git = "https://github.com/paritytech/ink", rev = "4655a8b4413cb50cbc38d1b7c173ad426ab06cde", default-features = false} +ink = { version = "4.0.0-beta.1", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } diff --git a/examples/psp22_extensions/wrapper/Cargo.toml b/examples/psp22_extensions/wrapper/Cargo.toml index f71a1b925..76e3ac623 100644 --- a/examples/psp22_extensions/wrapper/Cargo.toml +++ b/examples/psp22_extensions/wrapper/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "my_psp22_wrapper" -version = "3.0.0-beta" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" [dependencies] -ink = { git = "https://github.com/paritytech/ink", rev = "4655a8b4413cb50cbc38d1b7c173ad426ab06cde", default-features = false} +ink = { version = "4.0.0-beta.1", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } diff --git a/examples/psp22_pallet/Cargo.toml b/examples/psp22_pallet/Cargo.toml index 3d6f642fb..b0e918b58 100644 --- a/examples/psp22_pallet/Cargo.toml +++ b/examples/psp22_pallet/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "my_psp22_pallet" -version = "3.0.0-beta" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" [dependencies] -ink = { git = "https://github.com/paritytech/ink", rev = "4655a8b4413cb50cbc38d1b7c173ad426ab06cde", default-features = false} +ink = { version = "4.0.0-beta.1", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } diff --git a/examples/psp22_pallet_extensions/burnable/Cargo.toml b/examples/psp22_pallet_extensions/burnable/Cargo.toml index 266ac58a8..787ae4c67 100644 --- a/examples/psp22_pallet_extensions/burnable/Cargo.toml +++ b/examples/psp22_pallet_extensions/burnable/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "my_psp22_pallet_burnable" -version = "3.0.0-beta" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" [dependencies] -ink = { git = "https://github.com/paritytech/ink", rev = "4655a8b4413cb50cbc38d1b7c173ad426ab06cde", default-features = false} +ink = { version = "4.0.0-beta.1", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } diff --git a/examples/psp22_pallet_extensions/metadata/Cargo.toml b/examples/psp22_pallet_extensions/metadata/Cargo.toml index 307184c18..22118ef09 100644 --- a/examples/psp22_pallet_extensions/metadata/Cargo.toml +++ b/examples/psp22_pallet_extensions/metadata/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "my_psp22_pallet_metadata" -version = "3.0.0-beta" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" [dependencies] -ink = { git = "https://github.com/paritytech/ink", rev = "4655a8b4413cb50cbc38d1b7c173ad426ab06cde", default-features = false} +ink = { version = "4.0.0-beta.1", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } diff --git a/examples/psp22_pallet_extensions/mintable/Cargo.toml b/examples/psp22_pallet_extensions/mintable/Cargo.toml index edb3abdbe..4d4e3b6f8 100644 --- a/examples/psp22_pallet_extensions/mintable/Cargo.toml +++ b/examples/psp22_pallet_extensions/mintable/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "my_psp22_pallet_mintable" -version = "3.0.0-beta" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" [dependencies] -ink = { git = "https://github.com/paritytech/ink", rev = "4655a8b4413cb50cbc38d1b7c173ad426ab06cde", default-features = false} +ink = { version = "4.0.0-beta.1", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } diff --git a/examples/psp22_utils/token_timelock/Cargo.toml b/examples/psp22_utils/token_timelock/Cargo.toml index 4b8ed549b..48ac9a722 100644 --- a/examples/psp22_utils/token_timelock/Cargo.toml +++ b/examples/psp22_utils/token_timelock/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "my_psp22_token_timelock" -version = "3.0.0-beta" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" [dependencies] -ink = { git = "https://github.com/paritytech/ink", rev = "4655a8b4413cb50cbc38d1b7c173ad426ab06cde", default-features = false} +ink = { version = "4.0.0-beta.1", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } diff --git a/examples/psp34/Cargo.toml b/examples/psp34/Cargo.toml index 86f835741..23cb7eebe 100644 --- a/examples/psp34/Cargo.toml +++ b/examples/psp34/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "my_psp34" -version = "3.0.0-beta" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" [dependencies] -ink = { git = "https://github.com/paritytech/ink", rev = "4655a8b4413cb50cbc38d1b7c173ad426ab06cde", default-features = false} +ink = { version = "4.0.0-beta.1", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } diff --git a/examples/psp34_extensions/burnable/Cargo.toml b/examples/psp34_extensions/burnable/Cargo.toml index c23624aae..88723c33a 100644 --- a/examples/psp34_extensions/burnable/Cargo.toml +++ b/examples/psp34_extensions/burnable/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "my_psp34_burnable" -version = "3.0.0-beta" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" [dependencies] -ink = { git = "https://github.com/paritytech/ink", rev = "4655a8b4413cb50cbc38d1b7c173ad426ab06cde", default-features = false} +ink = { version = "4.0.0-beta.1", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } diff --git a/examples/psp34_extensions/enumerable/Cargo.toml b/examples/psp34_extensions/enumerable/Cargo.toml index ec3fc30b0..8e3731b8c 100644 --- a/examples/psp34_extensions/enumerable/Cargo.toml +++ b/examples/psp34_extensions/enumerable/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "my_psp34_enumerable" -version = "3.0.0-beta" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" [dependencies] -ink = { git = "https://github.com/paritytech/ink", rev = "4655a8b4413cb50cbc38d1b7c173ad426ab06cde", default-features = false} +ink = { version = "4.0.0-beta.1", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } diff --git a/examples/psp34_extensions/metadata/Cargo.toml b/examples/psp34_extensions/metadata/Cargo.toml index 7f78ea1ae..7ac928d85 100644 --- a/examples/psp34_extensions/metadata/Cargo.toml +++ b/examples/psp34_extensions/metadata/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "my_psp34_metadata" -version = "3.0.0-beta" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" [dependencies] -ink = { git = "https://github.com/paritytech/ink", rev = "4655a8b4413cb50cbc38d1b7c173ad426ab06cde", default-features = false} +ink = { version = "4.0.0-beta.1", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } diff --git a/examples/psp34_extensions/mintable/Cargo.toml b/examples/psp34_extensions/mintable/Cargo.toml index 20c595b4a..a5b922f5d 100644 --- a/examples/psp34_extensions/mintable/Cargo.toml +++ b/examples/psp34_extensions/mintable/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "my_psp34_mintable" -version = "3.0.0-beta" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" [dependencies] -ink = { git = "https://github.com/paritytech/ink", rev = "4655a8b4413cb50cbc38d1b7c173ad426ab06cde", default-features = false} +ink = { version = "4.0.0-beta.1", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } diff --git a/examples/psp37/Cargo.toml b/examples/psp37/Cargo.toml index e7c216070..5ba498477 100644 --- a/examples/psp37/Cargo.toml +++ b/examples/psp37/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "my_psp37" -version = "3.0.0-beta" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" [dependencies] -ink = { git = "https://github.com/paritytech/ink", rev = "4655a8b4413cb50cbc38d1b7c173ad426ab06cde", default-features = false} +ink = { version = "4.0.0-beta.1", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } diff --git a/examples/psp37_extensions/batch/Cargo.toml b/examples/psp37_extensions/batch/Cargo.toml index 4cedd1538..9f9cbed52 100644 --- a/examples/psp37_extensions/batch/Cargo.toml +++ b/examples/psp37_extensions/batch/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "my_psp37_batch" -version = "3.0.0-beta" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" [dependencies] -ink = { git = "https://github.com/paritytech/ink", rev = "4655a8b4413cb50cbc38d1b7c173ad426ab06cde", default-features = false} +ink = { version = "4.0.0-beta.1", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } diff --git a/examples/psp37_extensions/burnable/Cargo.toml b/examples/psp37_extensions/burnable/Cargo.toml index 8ed0d0baa..9873f9d25 100644 --- a/examples/psp37_extensions/burnable/Cargo.toml +++ b/examples/psp37_extensions/burnable/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "my_psp37_burnable" -version = "3.0.0-beta" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" [dependencies] -ink = { git = "https://github.com/paritytech/ink", rev = "4655a8b4413cb50cbc38d1b7c173ad426ab06cde", default-features = false} +ink = { version = "4.0.0-beta.1", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } diff --git a/examples/psp37_extensions/enumerable/Cargo.toml b/examples/psp37_extensions/enumerable/Cargo.toml index 1418cb69f..e60c2a253 100644 --- a/examples/psp37_extensions/enumerable/Cargo.toml +++ b/examples/psp37_extensions/enumerable/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "my_psp37_enumerable" -version = "3.0.0-beta" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" [dependencies] -ink = { git = "https://github.com/paritytech/ink", rev = "4655a8b4413cb50cbc38d1b7c173ad426ab06cde", default-features = false} +ink = { version = "4.0.0-beta.1", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } diff --git a/examples/psp37_extensions/metadata/Cargo.toml b/examples/psp37_extensions/metadata/Cargo.toml index 2cf943fdb..90bce147e 100644 --- a/examples/psp37_extensions/metadata/Cargo.toml +++ b/examples/psp37_extensions/metadata/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "my_psp37_metadata" -version = "3.0.0-beta" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" [dependencies] -ink = { git = "https://github.com/paritytech/ink", rev = "4655a8b4413cb50cbc38d1b7c173ad426ab06cde", default-features = false} +ink = { version = "4.0.0-beta.1", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } diff --git a/examples/psp37_extensions/mintable/Cargo.toml b/examples/psp37_extensions/mintable/Cargo.toml index 9f4883b1d..fe8d16f4b 100644 --- a/examples/psp37_extensions/mintable/Cargo.toml +++ b/examples/psp37_extensions/mintable/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "my_psp37_mintable" -version = "3.0.0-beta" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" [dependencies] -ink = { git = "https://github.com/paritytech/ink", rev = "4655a8b4413cb50cbc38d1b7c173ad426ab06cde", default-features = false} +ink = { version = "4.0.0-beta.1", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } diff --git a/examples/reentrancy_guard/Cargo.toml b/examples/reentrancy_guard/Cargo.toml index 7366aab2a..72281d970 100644 --- a/examples/reentrancy_guard/Cargo.toml +++ b/examples/reentrancy_guard/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "flipper" -version = "3.0.0-beta" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" [dependencies] -ink = { git = "https://github.com/paritytech/ink", rev = "4655a8b4413cb50cbc38d1b7c173ad426ab06cde", default-features = false} +ink = { version = "4.0.0-beta.1", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } diff --git a/examples/reentrancy_guard/contracts/flip_on_me/Cargo.toml b/examples/reentrancy_guard/contracts/flip_on_me/Cargo.toml index 241260d99..f346080f8 100644 --- a/examples/reentrancy_guard/contracts/flip_on_me/Cargo.toml +++ b/examples/reentrancy_guard/contracts/flip_on_me/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "flip_on_me" -version = "3.0.0-beta" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" [dependencies] -ink = { git = "https://github.com/paritytech/ink", rev = "4655a8b4413cb50cbc38d1b7c173ad426ab06cde", default-features = false} +ink = { version = "4.0.0-beta.1", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } diff --git a/examples/reentrancy_guard/contracts/flipper/Cargo.toml b/examples/reentrancy_guard/contracts/flipper/Cargo.toml index 50ca76433..9e523d3c9 100644 --- a/examples/reentrancy_guard/contracts/flipper/Cargo.toml +++ b/examples/reentrancy_guard/contracts/flipper/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "my_flipper_guard" -version = "3.0.0-beta" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" [dependencies] -ink = { git = "https://github.com/paritytech/ink", rev = "4655a8b4413cb50cbc38d1b7c173ad426ab06cde", default-features = false} +ink = { version = "4.0.0-beta.1", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } diff --git a/examples/timelock_controller/Cargo.toml b/examples/timelock_controller/Cargo.toml index d90660395..f621f4bb9 100644 --- a/examples/timelock_controller/Cargo.toml +++ b/examples/timelock_controller/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "my_timelock_controller" -version = "3.0.0-beta" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" [dependencies] -ink = { git = "https://github.com/paritytech/ink", rev = "4655a8b4413cb50cbc38d1b7c173ad426ab06cde", default-features = false} +ink = { version = "4.0.0-beta.1", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } diff --git a/lang/Cargo.toml b/lang/Cargo.toml index 6ccb800ba..41ecb7e3a 100644 --- a/lang/Cargo.toml +++ b/lang/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "openbrush_lang" -version = "3.0.0-beta" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" @@ -14,9 +14,9 @@ categories = ["no-std", "embedded"] include = ["Cargo.toml", "src/**/*.rs"] [dependencies] -openbrush_lang_macro = { version = "~3.0.0-beta", path = "macro", default-features = false } +openbrush_lang_macro = { version = "~3.0.0-beta.1", path = "macro", default-features = false } -ink = { git = "https://github.com/paritytech/ink", rev = "4655a8b4413cb50cbc38d1b7c173ad426ab06cde", default-features = false} +ink = { version = "4.0.0-beta.1", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"] } diff --git a/lang/codegen/Cargo.toml b/lang/codegen/Cargo.toml index 229b50958..6398f13c9 100644 --- a/lang/codegen/Cargo.toml +++ b/lang/codegen/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "openbrush_lang_codegen" -version = "3.0.0-beta" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" diff --git a/lang/codegen/src/trait_definition.rs b/lang/codegen/src/trait_definition.rs index 22e7c7f68..58f1b69b3 100644 --- a/lang/codegen/src/trait_definition.rs +++ b/lang/codegen/src/trait_definition.rs @@ -248,6 +248,7 @@ fn generate_wrapper(ink_trait: ItemTrait) -> proc_macro2::TokenStream { #[inline] fn #message_builder_ident( & self + #( , #input_bindings : #input_types )* ) -> ::ink::env::call::CallBuilder< ::ink::env::DefaultEnvironment, @@ -264,9 +265,10 @@ fn generate_wrapper(ink_trait: ItemTrait) -> proc_macro2::TokenStream { #( , #input_bindings : #input_types )* ) -> #output_ty { Self::#message_builder_ident(self #( , #input_bindings)*) - .fire() + .try_invoke() .unwrap_or_else(|err| ::core::panic!("{}: {:?}", #panic_str, err)) .unwrap_or_else(|err| ::core::panic!("Can't decode ::ink::LangErr: {:?}", err)) + .unwrap_or_else(|err| ::core::panic!("Can't decode ::ink::LangErr: {:?}", err)) } #[inline] diff --git a/lang/macro/Cargo.toml b/lang/macro/Cargo.toml index 465fa7782..fc6db722b 100644 --- a/lang/macro/Cargo.toml +++ b/lang/macro/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "openbrush_lang_macro" -version = "3.0.0-beta" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" @@ -14,13 +14,13 @@ categories = ["no-std", "embedded"] include = ["Cargo.toml", "src/**/*.rs"] [dependencies] -openbrush_lang_codegen = { version = "~3.0.0-beta", path = "../codegen", default-features = false } +openbrush_lang_codegen = { version = "~3.0.0-beta.1", path = "../codegen", default-features = false } syn = "1" proc-macro2 = "1" synstructure = "0.12" [dev-dependencies] -ink = { git = "https://github.com/paritytech/ink", rev = "4655a8b4413cb50cbc38d1b7c173ad426ab06cde", default-features = false} +ink = { version = "4.0.0-beta.1", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"] } diff --git a/lang/macro/src/lib.rs b/lang/macro/src/lib.rs index 4684abe8e..3eea7e0db 100644 --- a/lang/macro/src/lib.rs +++ b/lang/macro/src/lib.rs @@ -398,7 +398,7 @@ pub fn modifiers(_attrs: TokenStream, method: TokenStream) -> TokenStream { /// // Example how to get ink! call builder /// let to: AccountId = [0; 32].into(); /// let builder_for_foo: ::ink::env::call::CallBuilder<_, _, _, _> = Trait1and2Ref::foo_builder(&to); -/// let ink_result: Result = builder_for_foo.fire().unwrap(); +/// let ink_result: Result = builder_for_foo.try_invoke().unwrap(); /// } /// ``` #[proc_macro_attribute] diff --git a/lang/src/test_utils.rs b/lang/src/test_utils.rs index 96a9ceaf3..7081bd1a0 100644 --- a/lang/src/test_utils.rs +++ b/lang/src/test_utils.rs @@ -40,7 +40,7 @@ pub fn encoded_into_hash(entity: &T) -> Hash where T: scale::Encode, { - let mut result = Hash::clear(); + let mut result = Hash::CLEAR_HASH; let len_result = result.as_ref().len(); let encoded = entity.encode(); let len_encoded = encoded.len(); diff --git a/mock/flash-borrower/Cargo.toml b/mock/flash-borrower/Cargo.toml index 1c064fce0..5f2d67ce9 100644 --- a/mock/flash-borrower/Cargo.toml +++ b/mock/flash-borrower/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "flash_borrower" -version = "3.0.0-beta" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" [dependencies] -ink = { git = "https://github.com/paritytech/ink", rev = "4655a8b4413cb50cbc38d1b7c173ad426ab06cde", default-features = false} +ink = { version = "4.0.0-beta.1", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } diff --git a/mock/psp22-receiver/Cargo.toml b/mock/psp22-receiver/Cargo.toml index 819c3f660..9eca9d665 100644 --- a/mock/psp22-receiver/Cargo.toml +++ b/mock/psp22-receiver/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "psp22_receiver" -version = "3.0.0-beta" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" [dependencies] -ink = { git = "https://github.com/paritytech/ink", rev = "4655a8b4413cb50cbc38d1b7c173ad426ab06cde", default-features = false} +ink = { version = "4.0.0-beta.1", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } diff --git a/mock/psp34-receiver/Cargo.toml b/mock/psp34-receiver/Cargo.toml index a3bc1282a..fc64baf44 100644 --- a/mock/psp34-receiver/Cargo.toml +++ b/mock/psp34-receiver/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "psp34_receiver" -version = "3.0.0-beta" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" [dependencies] -ink = { git = "https://github.com/paritytech/ink", rev = "4655a8b4413cb50cbc38d1b7c173ad426ab06cde", default-features = false} +ink = { version = "4.0.0-beta.1", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } diff --git a/mock/psp37-receiver/Cargo.toml b/mock/psp37-receiver/Cargo.toml index 9458637b6..d736a7870 100644 --- a/mock/psp37-receiver/Cargo.toml +++ b/mock/psp37-receiver/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "psp37_receiver" -version = "3.0.0-beta" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" [dependencies] -ink = { git = "https://github.com/paritytech/ink", rev = "4655a8b4413cb50cbc38d1b7c173ad426ab06cde", default-features = false} +ink = { version = "4.0.0-beta.1", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } From d4410ee28b0973ba3e33f2dadbec2f3af2f171ed Mon Sep 17 00:00:00 2001 From: Artemka374 Date: Tue, 31 Jan 2023 15:34:20 +0200 Subject: [PATCH 02/14] fix tests --- lang/macro/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/macro/src/lib.rs b/lang/macro/src/lib.rs index 3eea7e0db..5d8ca9b42 100644 --- a/lang/macro/src/lib.rs +++ b/lang/macro/src/lib.rs @@ -398,7 +398,7 @@ pub fn modifiers(_attrs: TokenStream, method: TokenStream) -> TokenStream { /// // Example how to get ink! call builder /// let to: AccountId = [0; 32].into(); /// let builder_for_foo: ::ink::env::call::CallBuilder<_, _, _, _> = Trait1and2Ref::foo_builder(&to); -/// let ink_result: Result = builder_for_foo.try_invoke().unwrap(); +/// let ink_result: Result = builder_for_foo.try_invoke().unwrap().unwrap(); /// } /// ``` #[proc_macro_attribute] From 5b38f0a0e181d47ebb08f09a1be6a5458716fc71 Mon Sep 17 00:00:00 2001 From: Artemka374 Date: Tue, 31 Jan 2023 19:42:20 +0200 Subject: [PATCH 03/14] fix bugs in example project structure --- example_project_structure/contracts/lending/lib.rs | 6 ++---- example_project_structure/impls/lending/lending.rs | 4 ++++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/example_project_structure/contracts/lending/lib.rs b/example_project_structure/contracts/lending/lib.rs index 8d5218a73..921cadb0f 100644 --- a/example_project_structure/contracts/lending/lib.rs +++ b/example_project_structure/contracts/lending/lib.rs @@ -87,8 +87,7 @@ pub mod my_lending { .endowment(0) .code_hash(code_hash) .salt_bytes(&hash[..4]) - .instantiate() - .unwrap(); + .instantiate(); contract.to_account_id() } } @@ -107,8 +106,7 @@ pub mod my_lending { .endowment(0) .code_hash(loan_hash) .salt_bytes(&[0xDE, 0xAD, 0xBE, 0xEF]) - .instantiate() - .unwrap(); + .instantiate(); instance.lending.loan_account = nft.to_account_id(); instance diff --git a/example_project_structure/impls/lending/lending.rs b/example_project_structure/impls/lending/lending.rs index c8e2d95b5..9d9c643ab 100644 --- a/example_project_structure/impls/lending/lending.rs +++ b/example_project_structure/impls/lending/lending.rs @@ -119,6 +119,7 @@ impl + Storage> Lending for T { .call_flags(ink::env::CallFlags::default().set_allow_reentry(true)) .try_invoke() .unwrap() + .unwrap() .unwrap()?; // if no assets were deposited yet we will mint the same amount of shares as deposited `amount` let new_shares = if total_asset == 0 { @@ -176,6 +177,7 @@ impl + Storage> Lending for T { .call_flags(ink::env::CallFlags::default().set_allow_reentry(true)) .try_invoke() .unwrap() + .unwrap() .unwrap()?; // create loan info let loan_info = LoanInfo { @@ -231,6 +233,7 @@ impl + Storage> Lending for T { .call_flags(ink::env::CallFlags::default().set_allow_reentry(true)) .try_invoke() .unwrap() + .unwrap() .unwrap()?; PSP22Ref::transfer( &loan_info.collateral_token, @@ -251,6 +254,7 @@ impl + Storage> Lending for T { .call_flags(ink::env::CallFlags::default().set_allow_reentry(true)) .try_invoke() .unwrap() + .unwrap() .unwrap()?; let to_return = (repay_amount * loan_info.collateral_amount) / to_repay; PSP22Ref::transfer(&loan_info.collateral_token, initiator, to_return, Vec::::new())?; From 035a2c16f96d82b467cdda65b95252a548d4915d Mon Sep 17 00:00:00 2001 From: Artemka374 Date: Wed, 1 Feb 2023 11:55:16 +0200 Subject: [PATCH 04/14] update pallet-assets-chain-extension --- contracts/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts/Cargo.toml b/contracts/Cargo.toml index 64e106e72..ff253184b 100644 --- a/contracts/Cargo.toml +++ b/contracts/Cargo.toml @@ -21,7 +21,7 @@ scale-info = { version = "2.3", default-features = false, features = ["derive"], openbrush = { version = "~3.0.0-beta.1", package = "openbrush_lang", path = "../lang", default-features = false } -pallet-assets-chain-extension = { git = "https://github.com/727-ventures/pallet-assets-chain-extension", tag = "3.0.0-beta", default-features = false, features = ["ink-lang"] } +pallet-assets-chain-extension = { git = "https://github.com/727-ventures/pallet-assets-chain-extension", branch = "ink-4-beta", default-features = false, features = ["ink-lang"] } [lib] name = "openbrush_contracts" From 42b2e6863fcd229929b543f822c0c7c0c52f5aa7 Mon Sep 17 00:00:00 2001 From: Artemka374 Date: Wed, 1 Feb 2023 18:40:28 +0200 Subject: [PATCH 05/14] fix bugs --- contracts/src/token/psp22/extensions/flashmint.rs | 5 ++--- contracts/src/token/psp22/extensions/wrapper.rs | 2 -- contracts/src/token/psp22/psp22.rs | 5 ++--- contracts/src/token/psp22/utils/token_timelock.rs | 1 - contracts/src/token/psp34/psp34.rs | 5 ++--- contracts/src/token/psp37/psp37.rs | 5 ++--- example_project_structure/impls/lending/lending.rs | 4 ---- lang/codegen/src/trait_definition.rs | 11 +++-------- lang/macro/src/lib.rs | 2 +- 9 files changed, 12 insertions(+), 28 deletions(-) diff --git a/contracts/src/token/psp22/extensions/flashmint.rs b/contracts/src/token/psp22/extensions/flashmint.rs index 39a0558e3..ed7a6c62e 100644 --- a/contracts/src/token/psp22/extensions/flashmint.rs +++ b/contracts/src/token/psp22/extensions/flashmint.rs @@ -112,11 +112,10 @@ impl> Internal for T { FlashBorrowerRef::on_flashloan_builder(&receiver_account, Self::env().caller(), token, amount, fee, data) .call_flags(CallFlags::default().set_allow_reentry(true)); let result = match builder.try_invoke() { - Ok(Ok(Ok(Ok(_)))) => Ok(()), - Ok(Ok(Ok(Err(FlashBorrowerError::FlashloanRejected(message))))) => { + Ok(Ok(Ok(_))) => Ok(()), + Ok(Ok(Err(FlashBorrowerError::FlashloanRejected(message)))) => { Err(FlashLenderError::BorrowerRejected(message)) } - Ok(Ok(Err(ink::LangError::CouldNotReadInput))) => Ok(()), // Means unknown method Ok(Err(ink::LangError::CouldNotReadInput)) => Ok(()), // `NotCallable` means that the receiver is not a contract. diff --git a/contracts/src/token/psp22/extensions/wrapper.rs b/contracts/src/token/psp22/extensions/wrapper.rs index a94a2e82a..0b65c827d 100644 --- a/contracts/src/token/psp22/extensions/wrapper.rs +++ b/contracts/src/token/psp22/extensions/wrapper.rs @@ -97,7 +97,6 @@ impl + Storage> Internal for T { .try_invoke() .unwrap() .unwrap() - .unwrap() } default fn _withdraw(&mut self, account: AccountId, amount: Balance) -> Result<(), PSP22Error> { @@ -107,7 +106,6 @@ impl + Storage> Internal for T { .try_invoke() .unwrap() .unwrap() - .unwrap() } default fn _underlying_balance(&mut self) -> Balance { diff --git a/contracts/src/token/psp22/psp22.rs b/contracts/src/token/psp22/psp22.rs index e83d22ffe..dbd4b7919 100644 --- a/contracts/src/token/psp22/psp22.rs +++ b/contracts/src/token/psp22/psp22.rs @@ -184,10 +184,9 @@ impl> Internal for T { ) .call_flags(CallFlags::default().set_allow_reentry(true)); let result = match builder.try_invoke() { - Ok(Ok(Ok(Ok(_)))) => Ok(()), - Ok(Ok(Ok(Err(e)))) => Err(e.into()), + Ok(Ok(Ok(_))) => Ok(()), + Ok(Ok(Err(e))) => Err(e.into()), // Means unknown method - Ok(Ok(Err(ink::LangError::CouldNotReadInput))) => Ok(()), Ok(Err(ink::LangError::CouldNotReadInput)) => Ok(()), // `NotCallable` means that the receiver is not a contract. Err(ink::env::Error::NotCallable) => Ok(()), diff --git a/contracts/src/token/psp22/utils/token_timelock.rs b/contracts/src/token/psp22/utils/token_timelock.rs index ce04180bb..715445f30 100644 --- a/contracts/src/token/psp22/utils/token_timelock.rs +++ b/contracts/src/token/psp22/utils/token_timelock.rs @@ -107,7 +107,6 @@ impl> Internal for T { .call_flags(CallFlags::default().set_allow_reentry(true)) .try_invoke() .unwrap() - .unwrap() .unwrap()?; Ok(()) } diff --git a/contracts/src/token/psp34/psp34.rs b/contracts/src/token/psp34/psp34.rs index 11987bdbb..a65a5c17d 100644 --- a/contracts/src/token/psp34/psp34.rs +++ b/contracts/src/token/psp34/psp34.rs @@ -234,9 +234,8 @@ where .call_flags(CallFlags::default().set_allow_reentry(true)); let b = builder.try_invoke(); let result = match b { - Ok(Ok(Ok(Ok(_)))) => Ok(()), - Ok(Ok(Ok(Err(e)))) => Err(e.into()), - Ok(Ok(Err(ink::LangError::CouldNotReadInput))) => Ok(()), + Ok(Ok(Ok(_))) => Ok(()), + Ok(Ok(Err(e))) => Err(e.into()), // Means unknown method Ok(Err(ink::LangError::CouldNotReadInput)) => Ok(()), // `NotCallable` means that the receiver is not a contract. diff --git a/contracts/src/token/psp37/psp37.rs b/contracts/src/token/psp37/psp37.rs index 89520a9d5..6cd190164 100644 --- a/contracts/src/token/psp37/psp37.rs +++ b/contracts/src/token/psp37/psp37.rs @@ -397,12 +397,11 @@ where ) .call_flags(CallFlags::default().set_allow_reentry(true)); let result = match builder.try_invoke() { - Ok(Ok(Ok(Ok(_)))) => Ok(()), - Ok(Ok(Ok(Err(e)))) => Err(e.into()), + Ok(Ok(Ok(_))) => Ok(()), + Ok(Ok(Err(e))) => Err(e.into()), // `NotCallable` means that the receiver is not a contract. Err(ink::env::Error::NotCallable) => Ok(()), // Means unknown method - Ok(Ok(Err(ink::LangError::CouldNotReadInput))) => Ok(()), Ok(Err(ink::LangError::CouldNotReadInput)) => Ok(()), _ => { Err(PSP37Error::SafeTransferCheckFailed(String::from( diff --git a/example_project_structure/impls/lending/lending.rs b/example_project_structure/impls/lending/lending.rs index 9d9c643ab..c8e2d95b5 100644 --- a/example_project_structure/impls/lending/lending.rs +++ b/example_project_structure/impls/lending/lending.rs @@ -119,7 +119,6 @@ impl + Storage> Lending for T { .call_flags(ink::env::CallFlags::default().set_allow_reentry(true)) .try_invoke() .unwrap() - .unwrap() .unwrap()?; // if no assets were deposited yet we will mint the same amount of shares as deposited `amount` let new_shares = if total_asset == 0 { @@ -177,7 +176,6 @@ impl + Storage> Lending for T { .call_flags(ink::env::CallFlags::default().set_allow_reentry(true)) .try_invoke() .unwrap() - .unwrap() .unwrap()?; // create loan info let loan_info = LoanInfo { @@ -233,7 +231,6 @@ impl + Storage> Lending for T { .call_flags(ink::env::CallFlags::default().set_allow_reentry(true)) .try_invoke() .unwrap() - .unwrap() .unwrap()?; PSP22Ref::transfer( &loan_info.collateral_token, @@ -254,7 +251,6 @@ impl + Storage> Lending for T { .call_flags(ink::env::CallFlags::default().set_allow_reentry(true)) .try_invoke() .unwrap() - .unwrap() .unwrap()?; let to_return = (repay_amount * loan_info.collateral_amount) / to_repay; PSP22Ref::transfer(&loan_info.collateral_token, initiator, to_return, Vec::::new())?; diff --git a/lang/codegen/src/trait_definition.rs b/lang/codegen/src/trait_definition.rs index 58f1b69b3..815c8da49 100644 --- a/lang/codegen/src/trait_definition.rs +++ b/lang/codegen/src/trait_definition.rs @@ -191,10 +191,6 @@ fn generate_wrapper(ink_trait: ItemTrait) -> proc_macro2::TokenStream { syn::ReturnType::Type(_, return_type) => quote! { #return_type }, }; - let return_ty = quote! { - ::ink::MessageResult<#output_ty> - }; - let selector_string = format!("{}::{}", trait_ident, message_ident); let selector_bytes = ::ink_ir::Selector::compute(&selector_string.into_bytes()).hex_lits(); let input_bindings = method @@ -254,7 +250,7 @@ fn generate_wrapper(ink_trait: ItemTrait) -> proc_macro2::TokenStream { ::ink::env::DefaultEnvironment, ::ink::env::call::utils::Set< ::ink::env::call::Call< ::ink::env::DefaultEnvironment > >, ::ink::env::call::utils::Set< ::ink::env::call::ExecutionInput<#arg_list> >, - ::ink::env::call::utils::Set<::ink::env::call::utils::ReturnType<#return_ty>>, + ::ink::env::call::utils::Set<::ink::env::call::utils::ReturnType<#output_ty>>, >; }); @@ -268,7 +264,6 @@ fn generate_wrapper(ink_trait: ItemTrait) -> proc_macro2::TokenStream { .try_invoke() .unwrap_or_else(|err| ::core::panic!("{}: {:?}", #panic_str, err)) .unwrap_or_else(|err| ::core::panic!("Can't decode ::ink::LangErr: {:?}", err)) - .unwrap_or_else(|err| ::core::panic!("Can't decode ::ink::LangErr: {:?}", err)) } #[inline] @@ -279,7 +274,7 @@ fn generate_wrapper(ink_trait: ItemTrait) -> proc_macro2::TokenStream { ::ink::env::DefaultEnvironment, ::ink::env::call::utils::Set< ::ink::env::call::Call< ::ink::env::DefaultEnvironment > >, ::ink::env::call::utils::Set< ::ink::env::call::ExecutionInput<#arg_list> >, - ::ink::env::call::utils::Set<::ink::env::call::utils::ReturnType<#return_ty>>, + ::ink::env::call::utils::Set<::ink::env::call::utils::ReturnType<#output_ty>>, > { ::ink::env::call::build_call::<::ink::env::DefaultEnvironment>() .call_type( @@ -293,7 +288,7 @@ fn generate_wrapper(ink_trait: ItemTrait) -> proc_macro2::TokenStream { .push_arg(#input_bindings) )* ) - .returns::<#return_ty>() + .returns::<#output_ty>() } }); }); diff --git a/lang/macro/src/lib.rs b/lang/macro/src/lib.rs index 5d8ca9b42..3eea7e0db 100644 --- a/lang/macro/src/lib.rs +++ b/lang/macro/src/lib.rs @@ -398,7 +398,7 @@ pub fn modifiers(_attrs: TokenStream, method: TokenStream) -> TokenStream { /// // Example how to get ink! call builder /// let to: AccountId = [0; 32].into(); /// let builder_for_foo: ::ink::env::call::CallBuilder<_, _, _, _> = Trait1and2Ref::foo_builder(&to); -/// let ink_result: Result = builder_for_foo.try_invoke().unwrap().unwrap(); +/// let ink_result: Result = builder_for_foo.try_invoke().unwrap(); /// } /// ``` #[proc_macro_attribute] From 82c398668ef86c32aac00fbc8ba709257ef74926 Mon Sep 17 00:00:00 2001 From: Artemka374 Date: Thu, 2 Feb 2023 11:11:14 +0200 Subject: [PATCH 06/14] use npm instead of yarn in ci --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5be424330..895923e68 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -81,7 +81,7 @@ jobs: run: | chown -R root . chmod -R a+rwx . - yarn build:release + npm run build:release caching-artifacts: concurrency: group: caching-artifacts-${{ github.ref }} @@ -230,7 +230,7 @@ jobs: - name: Generate Typechain code run: - yarn build:release:no-compile + npm run build:release:no-compile - name: Run Test Mocha run: | From 141fa5d7fcef4c0d368e8f5533713bb329aef475 Mon Sep 17 00:00:00 2001 From: Artemka374 Date: Thu, 2 Feb 2023 14:16:52 +0200 Subject: [PATCH 07/14] update for ink 4.0.0-rc --- Cargo.toml | 8 +++---- contracts/Cargo.toml | 6 ++--- contracts/src/access/ownable/mod.rs | 11 ++++++++- .../src/governance/timelock_controller/mod.rs | 3 +-- .../src/token/psp22/extensions/wrapper.rs | 17 +++++++++----- .../src/token/psp22/utils/token_timelock.rs | 23 +++++++++++-------- .../src/traits/timelock_controller/mod.rs | 21 +++++++++++------ .../src/upgradeability/diamond/diamond.rs | 4 ++-- contracts/src/upgradeability/proxy/mod.rs | 2 +- docs/docs/smart-contracts/example/contract.md | 4 ++-- docs/docs/smart-contracts/overview.md | 10 ++++---- docs/docs/smart-contracts/upgradeable.md | 2 +- example_project_structure/Cargo.toml | 4 ++-- .../contracts/lending/Cargo.toml | 4 ++-- .../contracts/loan/Cargo.toml | 4 ++-- .../contracts/shares/Cargo.toml | 4 ++-- .../contracts/stable_coin/Cargo.toml | 4 ++-- examples/access_control/Cargo.toml | 4 ++-- .../enumerable/Cargo.toml | 4 ++-- examples/alternatives/diamond/ink/Cargo.toml | 4 ++-- examples/alternatives/diamond/rust/Cargo.toml | 4 ++-- examples/diamond/Cargo.toml | 4 ++-- examples/diamond/diamond_caller/Cargo.toml | 4 ++-- examples/diamond/psp22_facet_v1/Cargo.toml | 4 ++-- examples/diamond/psp22_facet_v2/Cargo.toml | 4 ++-- .../diamond/psp22_metadata_facet/Cargo.toml | 4 ++-- examples/ownable/Cargo.toml | 4 ++-- examples/pausable/Cargo.toml | 4 ++-- examples/payment_splitter/Cargo.toml | 4 ++-- examples/proxy/Cargo.toml | 4 ++-- .../psp22_metadata_upgradeable/Cargo.toml | 4 ++-- examples/proxy/psp22_upgradeable/Cargo.toml | 4 ++-- examples/psp22/Cargo.toml | 4 ++-- examples/psp22/lib.rs | 11 ++++++++- examples/psp22_extensions/burnable/Cargo.toml | 4 ++-- examples/psp22_extensions/capped/Cargo.toml | 4 ++-- .../psp22_extensions/flashmint/Cargo.toml | 4 ++-- examples/psp22_extensions/metadata/Cargo.toml | 4 ++-- examples/psp22_extensions/mintable/Cargo.toml | 4 ++-- examples/psp22_extensions/pausable/Cargo.toml | 4 ++-- examples/psp22_extensions/wrapper/Cargo.toml | 4 ++-- examples/psp22_pallet/Cargo.toml | 4 ++-- .../burnable/Cargo.toml | 4 ++-- .../metadata/Cargo.toml | 4 ++-- .../mintable/Cargo.toml | 4 ++-- .../psp22_utils/token_timelock/Cargo.toml | 4 ++-- examples/psp34/Cargo.toml | 4 ++-- examples/psp34_extensions/burnable/Cargo.toml | 4 ++-- .../psp34_extensions/enumerable/Cargo.toml | 4 ++-- examples/psp34_extensions/metadata/Cargo.toml | 4 ++-- examples/psp34_extensions/mintable/Cargo.toml | 4 ++-- examples/psp37/Cargo.toml | 4 ++-- examples/psp37_extensions/batch/Cargo.toml | 4 ++-- examples/psp37_extensions/burnable/Cargo.toml | 4 ++-- .../psp37_extensions/enumerable/Cargo.toml | 4 ++-- examples/psp37_extensions/metadata/Cargo.toml | 4 ++-- examples/psp37_extensions/mintable/Cargo.toml | 4 ++-- examples/reentrancy_guard/Cargo.toml | 4 ++-- .../contracts/flip_on_me/Cargo.toml | 4 ++-- .../contracts/flipper/Cargo.toml | 4 ++-- examples/timelock_controller/Cargo.toml | 4 ++-- lang/Cargo.toml | 6 ++--- lang/codegen/Cargo.toml | 2 +- lang/codegen/src/trait_definition.rs | 3 +-- lang/macro/Cargo.toml | 6 ++--- lang/macro/src/lib.rs | 21 +++++++++++++++-- mock/flash-borrower/Cargo.toml | 4 ++-- mock/psp22-receiver/Cargo.toml | 4 ++-- mock/psp34-receiver/Cargo.toml | 4 ++-- mock/psp37-receiver/Cargo.toml | 4 ++-- 70 files changed, 209 insertions(+), 159 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 53136c276..143cff8ea 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,7 +12,7 @@ exclude = [ [package] name = "openbrush" -version = "3.0.0-beta.1" +version = "3.0.0-rc" authors = ["Brushfam "] edition = "2018" @@ -27,12 +27,12 @@ categories = ["no-std", "embedded"] include = ["Cargo.toml", "src/**/*.rs"] [dependencies] -ink = { version = "4.0.0-beta.1", default-features = false} +ink = { version = "~4.0.0-rc", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } -openbrush_contracts = { version = "~3.0.0-beta.1", path = "contracts", default-features = false } -openbrush_lang = { version = "~3.0.0-beta.1", path = "lang", default-features = false } +openbrush_contracts = { version = "~3.0.0-rc", path = "contracts", default-features = false } +openbrush_lang = { version = "~3.0.0-rc", path = "lang", default-features = false } [lib] name = "openbrush" diff --git a/contracts/Cargo.toml b/contracts/Cargo.toml index ff253184b..f4f614d65 100644 --- a/contracts/Cargo.toml +++ b/contracts/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "openbrush_contracts" -version = "3.0.0-beta.1" +version = "3.0.0-rc" authors = ["Brushfam "] edition = "2021" @@ -15,11 +15,11 @@ categories = ["no-std", "embedded"] include = ["Cargo.toml", "src/**/*.rs"] [dependencies] -ink = { version = "4.0.0-beta.1", default-features = false} +ink = { version = "~4.0.0-rc", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } -openbrush = { version = "~3.0.0-beta.1", package = "openbrush_lang", path = "../lang", default-features = false } +openbrush = { version = "~3.0.0-rc", package = "openbrush_lang", path = "../lang", default-features = false } pallet-assets-chain-extension = { git = "https://github.com/727-ventures/pallet-assets-chain-extension", branch = "ink-4-beta", default-features = false, features = ["ink-lang"] } diff --git a/contracts/src/access/ownable/mod.rs b/contracts/src/access/ownable/mod.rs index c70fd12fd..79f02c1f1 100644 --- a/contracts/src/access/ownable/mod.rs +++ b/contracts/src/access/ownable/mod.rs @@ -37,13 +37,22 @@ pub use ownable::Internal as _; pub const STORAGE_KEY: u32 = openbrush::storage_unique_key!(Data); -#[derive(Default, Debug)] +#[derive(Debug)] #[openbrush::upgradeable_storage(STORAGE_KEY)] pub struct Data { pub owner: AccountId, pub _reserved: Option<()>, } +impl Default for Data { + fn default() -> Self { + Self { + owner: ZERO_ADDRESS.into(), + _reserved: Default::default(), + } + } +} + /// Throws if called by any account other than the owner. #[modifier_definition] pub fn only_owner(instance: &mut T, body: F) -> Result diff --git a/contracts/src/governance/timelock_controller/mod.rs b/contracts/src/governance/timelock_controller/mod.rs index b36feef00..7616efd77 100644 --- a/contracts/src/governance/timelock_controller/mod.rs +++ b/contracts/src/governance/timelock_controller/mod.rs @@ -445,8 +445,7 @@ where self.flush(); let result = build_call::() .call_type( - Call::new() - .callee(transaction.callee) + Call::new(transaction.callee) .gas_limit(transaction.gas_limit) .transferred_value(transaction.transferred_value), ) diff --git a/contracts/src/token/psp22/extensions/wrapper.rs b/contracts/src/token/psp22/extensions/wrapper.rs index 0b65c827d..c25011392 100644 --- a/contracts/src/token/psp22/extensions/wrapper.rs +++ b/contracts/src/token/psp22/extensions/wrapper.rs @@ -31,23 +31,28 @@ use ink::{ env::CallFlags, prelude::vec::Vec, }; -use openbrush::traits::{ - AccountId, - Balance, - Storage, -}; +use openbrush::traits::{AccountId, Balance, Storage, ZERO_ADDRESS}; pub use psp22::Internal as _; pub use wrapper::Internal as _; pub const STORAGE_KEY: u32 = openbrush::storage_unique_key!(Data); -#[derive(Default, Debug)] +#[derive(Debug)] #[openbrush::upgradeable_storage(STORAGE_KEY)] pub struct Data { pub underlying: AccountId, pub _reserved: Option<()>, } +impl Default for Data { + fn default() -> Self { + Self { + underlying: ZERO_ADDRESS.into(), + _reserved: Default::default(), + } + } +} + impl + Storage> PSP22Wrapper for T { default fn deposit_for(&mut self, account: AccountId, amount: Balance) -> Result<(), PSP22Error> { self._deposit(amount)?; diff --git a/contracts/src/token/psp22/utils/token_timelock.rs b/contracts/src/token/psp22/utils/token_timelock.rs index 715445f30..2e01a8ca9 100644 --- a/contracts/src/token/psp22/utils/token_timelock.rs +++ b/contracts/src/token/psp22/utils/token_timelock.rs @@ -32,18 +32,13 @@ use ink::{ env::CallFlags, prelude::vec::Vec, }; -use openbrush::traits::{ - AccountId, - Balance, - Storage, - Timestamp, -}; +use openbrush::traits::{AccountId, Balance, Storage, Timestamp, ZERO_ADDRESS}; pub use psp22::Internal as _; pub use token_timelock::Internal as _; pub const STORAGE_KEY: u32 = openbrush::storage_unique_key!(Data); -#[derive(Default, Debug)] +#[derive(Debug)] #[openbrush::upgradeable_storage(STORAGE_KEY)] pub struct Data { token: AccountId, @@ -51,6 +46,16 @@ pub struct Data { release_time: Timestamp, } +impl Default for Data { + fn default() -> Self { + Self { + token: ZERO_ADDRESS.into(), + beneficiary: ZERO_ADDRESS.into(), + release_time: Default::default(), + } + } +} + impl> PSP22TokenTimelock for T { /// Returns the token address default fn token(&self) -> AccountId { @@ -101,9 +106,9 @@ pub trait Internal { impl> Internal for T { default fn _withdraw(&mut self, amount: Balance) -> Result<(), PSP22TokenTimelockError> { - let beneficairy = self.beneficiary(); + let beneficiary = self.beneficiary(); self._token() - .transfer_builder(beneficairy, amount, Vec::::new()) + .transfer_builder(beneficiary, amount, Vec::::new()) .call_flags(CallFlags::default().set_allow_reentry(true)) .try_invoke() .unwrap() diff --git a/contracts/src/traits/timelock_controller/mod.rs b/contracts/src/traits/timelock_controller/mod.rs index f1722c2c1..41305473e 100644 --- a/contracts/src/traits/timelock_controller/mod.rs +++ b/contracts/src/traits/timelock_controller/mod.rs @@ -24,17 +24,12 @@ pub use crate::traits::{ errors::TimelockControllerError, }; use ink::prelude::vec::Vec; -use openbrush::traits::{ - AccountId, - Balance, - Hash, - Timestamp, -}; +use openbrush::traits::{AccountId, Balance, Hash, Timestamp, ZERO_ADDRESS}; pub type OperationId = Hash; /// A Transaction is what can be executed by `executor` -#[derive(Default, Debug, Clone, PartialEq, scale::Encode, scale::Decode)] +#[derive(Debug, Clone, PartialEq, scale::Encode, scale::Decode)] #[cfg_attr(feature = "std", derive(scale_info::TypeInfo))] pub struct Transaction { /// The `AccountId` of the contract that is called in this transaction. @@ -49,6 +44,18 @@ pub struct Transaction { pub gas_limit: u64, } +impl Default for Transaction { + fn default() -> Self { + Self { + callee: ZERO_ADDRESS.into(), + selector: Default::default(), + input: Default::default(), + transferred_value: Default::default(), + gas_limit: Default::default(), + } + } +} + /// TimelockController is AccessControl itself, so creating wrapper for both traits #[openbrush::wrapper] pub type TimelockControllerRef = dyn TimelockController + AccessControl; diff --git a/contracts/src/upgradeability/diamond/diamond.rs b/contracts/src/upgradeability/diamond/diamond.rs index 883788b26..3c2d7a1b1 100644 --- a/contracts/src/upgradeability/diamond/diamond.rs +++ b/contracts/src/upgradeability/diamond/diamond.rs @@ -180,7 +180,7 @@ where } ink::env::call::build_call::() - .call_type(DelegateCall::new().code_hash(delegate_code.unwrap())) + .call_type(DelegateCall::new(delegate_code.unwrap())) .call_flags( ink::env::CallFlags::default() // We don't plan to use the input data after the delegated call, so the @@ -197,7 +197,7 @@ where default fn _init_call(&self, call: InitCall) -> ! { ink::env::call::build_call::() - .call_type(DelegateCall::new().code_hash(call.hash)) + .call_type(DelegateCall::new(call.hash)) .exec_input(ExecutionInput::new(InkSelector::new(call.selector)).push_arg(call.input)) .call_flags(ink::env::CallFlags::default() // We don't plan to return back to that contract after execution, so we diff --git a/contracts/src/upgradeability/proxy/mod.rs b/contracts/src/upgradeability/proxy/mod.rs index 32f764089..442892b98 100644 --- a/contracts/src/upgradeability/proxy/mod.rs +++ b/contracts/src/upgradeability/proxy/mod.rs @@ -82,7 +82,7 @@ impl> Internal for T { default fn _fallback(&self) -> ! { ink::env::call::build_call::() - .call_type(DelegateCall::new().code_hash(self.data().forward_to.clone())) + .call_type(DelegateCall::new(self.data().forward_to.clone())) .call_flags( ink::env::CallFlags::default() // We don't plan to use the input data after the delegated call, so the diff --git a/docs/docs/smart-contracts/example/contract.md b/docs/docs/smart-contracts/example/contract.md index bdaaca921..fce02b107 100644 --- a/docs/docs/smart-contracts/example/contract.md +++ b/docs/docs/smart-contracts/example/contract.md @@ -16,7 +16,7 @@ implementation of `Lending` and `LendingPermissioned` traits defined in the `len ```toml [package] name = "lending_contract" -version = "3.0.0-beta.1" +version = "3.0.0-rc" authors = ["Brushfam "] edition = "2021" @@ -29,7 +29,7 @@ scale-info = { version = "2.3", default-features = false, features = ["derive"], shares_contract = { path = "../shares", default-features = false, features = ["ink-as-dependency"] } loan_contract = { path = "../loan", default-features = false, features = ["ink-as-dependency"] } lending_project = { path = "../..", default-features = false } -openbrush = { version = "~3.0.0-beta.1", default-features = false, features = ["pausable", "access_control"] } +openbrush = { version = "~3.0.0-rc", default-features = false, features = ["pausable", "access_control"] } [lib] name = "lending_contract" diff --git a/docs/docs/smart-contracts/overview.md b/docs/docs/smart-contracts/overview.md index 01678fd5b..4ad451a8a 100644 --- a/docs/docs/smart-contracts/overview.md +++ b/docs/docs/smart-contracts/overview.md @@ -18,13 +18,13 @@ It doesn't contain [versioning](https://github.com/supercolony-net/openbrush-con ```toml [dependencies] # Import ink! -ink = { version = "4.0.0-beta.1", default-features = false} +ink = { version = "~4.0.0-rc", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } # Brush dependency -openbrush = { git = "https://github.com/727-Ventures/openbrush-contracts", version = "~3.0.0-beta.1", default-features = false } +openbrush = { git = "https://github.com/727-Ventures/openbrush-contracts", version = "~3.0.0-rc", default-features = false } [features] default = ["std"] @@ -73,17 +73,17 @@ The name of the feature is the same as the name of the module. For example: To enable `psp22`: ```toml -openbrush = { git = "https://github.com/727-Ventures/openbrush-contracts", version = "~3.0.0-beta.1", default-features = false, features = ["psp22"] } +openbrush = { git = "https://github.com/727-Ventures/openbrush-contracts", version = "~3.0.0-rc", default-features = false, features = ["psp22"] } ``` To enable `ownable`: ```toml -openbrush = { git = "https://github.com/727-Ventures/openbrush-contracts", version = "~3.0.0-beta.1", default-features = false, features = ["ownable"] } +openbrush = { git = "https://github.com/727-Ventures/openbrush-contracts", version = "~3.0.0-rc", default-features = false, features = ["ownable"] } ``` To enable both: ```toml -openbrush = { git = "https://github.com/727-Ventures/openbrush-contracts", version = "~3.0.0-beta.1", default-features = false, features = ["psp22, ownable"] } +openbrush = { git = "https://github.com/727-Ventures/openbrush-contracts", version = "~3.0.0-rc", default-features = false, features = ["psp22, ownable"] } ``` After enabling the feature and importing the corresponding module, you need to embed the module diff --git a/docs/docs/smart-contracts/upgradeable.md b/docs/docs/smart-contracts/upgradeable.md index 27458ca43..aa7d7dc13 100644 --- a/docs/docs/smart-contracts/upgradeable.md +++ b/docs/docs/smart-contracts/upgradeable.md @@ -208,7 +208,7 @@ pub struct Data { ### Disclaimer -The following information describes `Proxy` and `Diamond` patterns of upgradeable storage, which currently don't work in ink! 4 due to `DelegateCall`, but we will leave it here for the future updates of this feature (and also for the OpenBrush versions before `3.0.0-beta.1`). +The following information describes `Proxy` and `Diamond` patterns of upgradeable storage, which currently don't work in ink! 4 due to `DelegateCall`, but we will leave it here for the future updates of this feature (and also for the OpenBrush versions before `3.0.0-rc`). Uploading your contract on the blockchain with `contract-pallet` has two phases: - Deploy - deploys source code to the blockchain. After deploying, the network uses the hash of the source code as an identifier for future instantiation of the contract. Now anyone can instantiate the contract by source code hash. diff --git a/example_project_structure/Cargo.toml b/example_project_structure/Cargo.toml index 752731d8e..7f1e211f5 100644 --- a/example_project_structure/Cargo.toml +++ b/example_project_structure/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "lending_project" -version = "3.0.0-beta.1" +version = "3.0.0-rc" authors = ["Brushfam "] edition = "2021" [dependencies] -ink = { version = "4.0.0-beta.1", default-features = false} +ink = { version = "~4.0.0-rc", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } diff --git a/example_project_structure/contracts/lending/Cargo.toml b/example_project_structure/contracts/lending/Cargo.toml index 0b34c4ae6..d67357587 100644 --- a/example_project_structure/contracts/lending/Cargo.toml +++ b/example_project_structure/contracts/lending/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "lending_contract" -version = "3.0.0-beta.1" +version = "3.0.0-rc" authors = ["Brushfam "] edition = "2021" [dependencies] -ink = { version = "4.0.0-beta.1", default-features = false} +ink = { version = "~4.0.0-rc", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } diff --git a/example_project_structure/contracts/loan/Cargo.toml b/example_project_structure/contracts/loan/Cargo.toml index 09125d879..e1d1d74b9 100644 --- a/example_project_structure/contracts/loan/Cargo.toml +++ b/example_project_structure/contracts/loan/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "loan_contract" -version = "3.0.0-beta.1" +version = "3.0.0-rc" authors = ["Brushfam "] edition = "2021" [dependencies] -ink = { version = "4.0.0-beta.1", default-features = false} +ink = { version = "~4.0.0-rc", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } diff --git a/example_project_structure/contracts/shares/Cargo.toml b/example_project_structure/contracts/shares/Cargo.toml index e2fd030c0..449e242b8 100644 --- a/example_project_structure/contracts/shares/Cargo.toml +++ b/example_project_structure/contracts/shares/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "shares_contract" -version = "3.0.0-beta.1" +version = "3.0.0-rc" authors = ["Brushfam "] edition = "2021" [dependencies] -ink = { version = "4.0.0-beta.1", default-features = false} +ink = { version = "~4.0.0-rc", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } diff --git a/example_project_structure/contracts/stable_coin/Cargo.toml b/example_project_structure/contracts/stable_coin/Cargo.toml index 103d45c30..f377a38ea 100644 --- a/example_project_structure/contracts/stable_coin/Cargo.toml +++ b/example_project_structure/contracts/stable_coin/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "stable_coin_contract" -version = "3.0.0-beta.1" +version = "3.0.0-rc" authors = ["Brushfam "] edition = "2021" [dependencies] -ink = { version = "4.0.0-beta.1", default-features = false} +ink = { version = "~4.0.0-rc", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } diff --git a/examples/access_control/Cargo.toml b/examples/access_control/Cargo.toml index 05b889247..f2b1787cc 100644 --- a/examples/access_control/Cargo.toml +++ b/examples/access_control/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "my_access_control" -version = "3.0.0-beta.1" +version = "3.0.0-rc" authors = ["Brushfam "] edition = "2021" [dependencies] -ink = { version = "4.0.0-beta.1", default-features = false} +ink = { version = "~4.0.0-rc", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } diff --git a/examples/access_control_extensions/enumerable/Cargo.toml b/examples/access_control_extensions/enumerable/Cargo.toml index b7719eba6..1c0ec2b50 100644 --- a/examples/access_control_extensions/enumerable/Cargo.toml +++ b/examples/access_control_extensions/enumerable/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "my_access_control_enumerable" -version = "3.0.0-beta.1" +version = "3.0.0-rc" authors = ["Brushfam "] edition = "2021" [dependencies] -ink = { version = "4.0.0-beta.1", default-features = false} +ink = { version = "~4.0.0-rc", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } diff --git a/examples/alternatives/diamond/ink/Cargo.toml b/examples/alternatives/diamond/ink/Cargo.toml index 65ad79cea..0bebed3bb 100644 --- a/examples/alternatives/diamond/ink/Cargo.toml +++ b/examples/alternatives/diamond/ink/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "ink_diamond" -version = "3.0.0-beta.1" +version = "3.0.0-rc" authors = ["Brushfam "] edition = "2021" [dependencies] -ink = { version = "4.0.0-beta.1", default-features = false} +ink = { version = "~4.0.0-rc", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } diff --git a/examples/alternatives/diamond/rust/Cargo.toml b/examples/alternatives/diamond/rust/Cargo.toml index dbf11f386..f5afc32a5 100644 --- a/examples/alternatives/diamond/rust/Cargo.toml +++ b/examples/alternatives/diamond/rust/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "rust_diamond" -version = "3.0.0-beta.1" +version = "3.0.0-rc" authors = ["Brushfam "] edition = "2021" [dependencies] -ink = { version = "4.0.0-beta.1", default-features = false} +ink = { version = "~4.0.0-rc", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } diff --git a/examples/diamond/Cargo.toml b/examples/diamond/Cargo.toml index 1da06ef7c..623368907 100644 --- a/examples/diamond/Cargo.toml +++ b/examples/diamond/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "my_diamond" -version = "3.0.0-beta.1" +version = "3.0.0-rc" authors = ["Brushfam "] edition = "2021" [dependencies] -ink = { version = "4.0.0-beta.1", default-features = false} +ink = { version = "~4.0.0-rc", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } diff --git a/examples/diamond/diamond_caller/Cargo.toml b/examples/diamond/diamond_caller/Cargo.toml index ba1ca790a..ba9405806 100644 --- a/examples/diamond/diamond_caller/Cargo.toml +++ b/examples/diamond/diamond_caller/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "diamond_caller" -version = "3.0.0-beta.1" +version = "3.0.0-rc" authors = ["Brushfam "] edition = "2021" [dependencies] -ink = { version = "4.0.0-beta.1", default-features = false} +ink = { version = "~4.0.0-rc", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } diff --git a/examples/diamond/psp22_facet_v1/Cargo.toml b/examples/diamond/psp22_facet_v1/Cargo.toml index de802be81..7c5dbc3bb 100644 --- a/examples/diamond/psp22_facet_v1/Cargo.toml +++ b/examples/diamond/psp22_facet_v1/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "my_psp22_facet_v1" -version = "3.0.0-beta.1" +version = "3.0.0-rc" authors = ["Brushfam "] edition = "2021" [dependencies] -ink = { version = "4.0.0-beta.1", default-features = false} +ink = { version = "~4.0.0-rc", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } diff --git a/examples/diamond/psp22_facet_v2/Cargo.toml b/examples/diamond/psp22_facet_v2/Cargo.toml index 504e15524..7af9aec1b 100644 --- a/examples/diamond/psp22_facet_v2/Cargo.toml +++ b/examples/diamond/psp22_facet_v2/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "my_psp22_facet_v2" -version = "3.0.0-beta.1" +version = "3.0.0-rc" authors = ["Brushfam "] edition = "2021" [dependencies] -ink = { version = "4.0.0-beta.1", default-features = false} +ink = { version = "~4.0.0-rc", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } diff --git a/examples/diamond/psp22_metadata_facet/Cargo.toml b/examples/diamond/psp22_metadata_facet/Cargo.toml index a4eac9d76..810e39b1a 100644 --- a/examples/diamond/psp22_metadata_facet/Cargo.toml +++ b/examples/diamond/psp22_metadata_facet/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "my_psp22_metadata_facet" -version = "3.0.0-beta.1" +version = "3.0.0-rc" authors = ["Brushfam "] edition = "2021" [dependencies] -ink = { version = "4.0.0-beta.1", default-features = false} +ink = { version = "~4.0.0-rc", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } diff --git a/examples/ownable/Cargo.toml b/examples/ownable/Cargo.toml index 673bf1230..d36c4469e 100644 --- a/examples/ownable/Cargo.toml +++ b/examples/ownable/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "my_ownable" -version = "3.0.0-beta.1" +version = "3.0.0-rc" authors = ["Brushfam "] edition = "2021" [dependencies] -ink = { version = "4.0.0-beta.1", default-features = false} +ink = { version = "~4.0.0-rc", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } diff --git a/examples/pausable/Cargo.toml b/examples/pausable/Cargo.toml index 9834f3c95..091060646 100644 --- a/examples/pausable/Cargo.toml +++ b/examples/pausable/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "my_pausable" -version = "3.0.0-beta.1" +version = "3.0.0-rc" authors = ["Brushfam "] edition = "2021" [dependencies] -ink = { version = "4.0.0-beta.1", default-features = false} +ink = { version = "~4.0.0-rc", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } diff --git a/examples/payment_splitter/Cargo.toml b/examples/payment_splitter/Cargo.toml index 8b412a224..9a4143c60 100644 --- a/examples/payment_splitter/Cargo.toml +++ b/examples/payment_splitter/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "my_payment_splitter" -version = "3.0.0-beta.1" +version = "3.0.0-rc" authors = ["Brushfam "] edition = "2021" [dependencies] -ink = { version = "4.0.0-beta.1", default-features = false} +ink = { version = "~4.0.0-rc", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } diff --git a/examples/proxy/Cargo.toml b/examples/proxy/Cargo.toml index 890d8eef6..66f0c98c9 100644 --- a/examples/proxy/Cargo.toml +++ b/examples/proxy/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "my_proxy" -version = "3.0.0-beta.1" +version = "3.0.0-rc" authors = ["Brushfam "] edition = "2021" [dependencies] -ink = { version = "4.0.0-beta.1", default-features = false} +ink = { version = "~4.0.0-rc", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } diff --git a/examples/proxy/psp22_metadata_upgradeable/Cargo.toml b/examples/proxy/psp22_metadata_upgradeable/Cargo.toml index 3ccfdafcf..ee9a0a414 100644 --- a/examples/proxy/psp22_metadata_upgradeable/Cargo.toml +++ b/examples/proxy/psp22_metadata_upgradeable/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "my_psp22_metadata_upgradeable" -version = "3.0.0-beta.1" +version = "3.0.0-rc" authors = ["Brushfam "] edition = "2021" [dependencies] -ink = { version = "4.0.0-beta.1", default-features = false} +ink = { version = "~4.0.0-rc", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } diff --git a/examples/proxy/psp22_upgradeable/Cargo.toml b/examples/proxy/psp22_upgradeable/Cargo.toml index a32f14b15..07d4a97a7 100644 --- a/examples/proxy/psp22_upgradeable/Cargo.toml +++ b/examples/proxy/psp22_upgradeable/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "my_psp22_upgradeable" -version = "3.0.0-beta.1" +version = "3.0.0-rc" authors = ["Brushfam "] edition = "2021" [dependencies] -ink = { version = "4.0.0-beta.1", default-features = false} +ink = { version = "~4.0.0-rc", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } diff --git a/examples/psp22/Cargo.toml b/examples/psp22/Cargo.toml index 08a1ff36f..ce514c2d3 100644 --- a/examples/psp22/Cargo.toml +++ b/examples/psp22/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "my_psp22" -version = "3.0.0-beta.1" +version = "3.0.0-rc" authors = ["Brushfam "] edition = "2021" [dependencies] -ink = { version = "4.0.0-beta.1", default-features = false} +ink = { version = "~4.0.0-rc", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } diff --git a/examples/psp22/lib.rs b/examples/psp22/lib.rs index dc6586393..3afa94dee 100644 --- a/examples/psp22/lib.rs +++ b/examples/psp22/lib.rs @@ -12,7 +12,7 @@ pub mod my_psp22 { }; #[ink(storage)] - #[derive(Default, Storage)] + #[derive(Storage)] pub struct Contract { #[storage_field] psp22: psp22::Data, @@ -20,6 +20,15 @@ pub mod my_psp22 { hated_account: AccountId, } + impl Default for Contract { + fn default() -> Self { + Self { + psp22: Default::default(), + hated_account: [0u8; 32].into(), + } + } + } + impl Transfer for Contract { // Let's override method to reject transactions to bad account fn _before_token_transfer( diff --git a/examples/psp22_extensions/burnable/Cargo.toml b/examples/psp22_extensions/burnable/Cargo.toml index 9837fe7bd..4ffa3e684 100644 --- a/examples/psp22_extensions/burnable/Cargo.toml +++ b/examples/psp22_extensions/burnable/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "my_psp22_burnable" -version = "3.0.0-beta.1" +version = "3.0.0-rc" authors = ["Brushfam "] edition = "2021" [dependencies] -ink = { version = "4.0.0-beta.1", default-features = false} +ink = { version = "~4.0.0-rc", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } diff --git a/examples/psp22_extensions/capped/Cargo.toml b/examples/psp22_extensions/capped/Cargo.toml index 6e8824e98..d8695d8fe 100644 --- a/examples/psp22_extensions/capped/Cargo.toml +++ b/examples/psp22_extensions/capped/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "my_psp22_capped" -version = "3.0.0-beta.1" +version = "3.0.0-rc" authors = ["Brushfam "] edition = "2021" [dependencies] -ink = { version = "4.0.0-beta.1", default-features = false} +ink = { version = "~4.0.0-rc", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } diff --git a/examples/psp22_extensions/flashmint/Cargo.toml b/examples/psp22_extensions/flashmint/Cargo.toml index c031d35d8..e6e7eac92 100644 --- a/examples/psp22_extensions/flashmint/Cargo.toml +++ b/examples/psp22_extensions/flashmint/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "my_psp22_flashmint" -version = "3.0.0-beta.1" +version = "3.0.0-rc" authors = ["Brushfam "] edition = "2021" [dependencies] -ink = { version = "4.0.0-beta.1", default-features = false} +ink = { version = "~4.0.0-rc", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } diff --git a/examples/psp22_extensions/metadata/Cargo.toml b/examples/psp22_extensions/metadata/Cargo.toml index e545b6e53..b59f7070b 100644 --- a/examples/psp22_extensions/metadata/Cargo.toml +++ b/examples/psp22_extensions/metadata/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "my_psp22_metadata" -version = "3.0.0-beta.1" +version = "3.0.0-rc" authors = ["Brushfam "] edition = "2021" [dependencies] -ink = { version = "4.0.0-beta.1", default-features = false} +ink = { version = "~4.0.0-rc", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } diff --git a/examples/psp22_extensions/mintable/Cargo.toml b/examples/psp22_extensions/mintable/Cargo.toml index 0e15daca1..ba7ebbf0c 100644 --- a/examples/psp22_extensions/mintable/Cargo.toml +++ b/examples/psp22_extensions/mintable/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "my_psp22_mintable" -version = "3.0.0-beta.1" +version = "3.0.0-rc" authors = ["Brushfam "] edition = "2021" [dependencies] -ink = { version = "4.0.0-beta.1", default-features = false} +ink = { version = "~4.0.0-rc", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } diff --git a/examples/psp22_extensions/pausable/Cargo.toml b/examples/psp22_extensions/pausable/Cargo.toml index ac9a26cb7..3ff850b1e 100644 --- a/examples/psp22_extensions/pausable/Cargo.toml +++ b/examples/psp22_extensions/pausable/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "my_psp22_pausable" -version = "3.0.0-beta.1" +version = "3.0.0-rc" authors = ["Brushfam "] edition = "2021" [dependencies] -ink = { version = "4.0.0-beta.1", default-features = false} +ink = { version = "~4.0.0-rc", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } diff --git a/examples/psp22_extensions/wrapper/Cargo.toml b/examples/psp22_extensions/wrapper/Cargo.toml index 76e3ac623..0ad409250 100644 --- a/examples/psp22_extensions/wrapper/Cargo.toml +++ b/examples/psp22_extensions/wrapper/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "my_psp22_wrapper" -version = "3.0.0-beta.1" +version = "3.0.0-rc" authors = ["Brushfam "] edition = "2021" [dependencies] -ink = { version = "4.0.0-beta.1", default-features = false} +ink = { version = "~4.0.0-rc", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } diff --git a/examples/psp22_pallet/Cargo.toml b/examples/psp22_pallet/Cargo.toml index b0e918b58..56d9d4c72 100644 --- a/examples/psp22_pallet/Cargo.toml +++ b/examples/psp22_pallet/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "my_psp22_pallet" -version = "3.0.0-beta.1" +version = "3.0.0-rc" authors = ["Brushfam "] edition = "2021" [dependencies] -ink = { version = "4.0.0-beta.1", default-features = false} +ink = { version = "~4.0.0-rc", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } diff --git a/examples/psp22_pallet_extensions/burnable/Cargo.toml b/examples/psp22_pallet_extensions/burnable/Cargo.toml index 787ae4c67..a0b54d2e2 100644 --- a/examples/psp22_pallet_extensions/burnable/Cargo.toml +++ b/examples/psp22_pallet_extensions/burnable/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "my_psp22_pallet_burnable" -version = "3.0.0-beta.1" +version = "3.0.0-rc" authors = ["Brushfam "] edition = "2021" [dependencies] -ink = { version = "4.0.0-beta.1", default-features = false} +ink = { version = "~4.0.0-rc", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } diff --git a/examples/psp22_pallet_extensions/metadata/Cargo.toml b/examples/psp22_pallet_extensions/metadata/Cargo.toml index 22118ef09..3cf7c57fa 100644 --- a/examples/psp22_pallet_extensions/metadata/Cargo.toml +++ b/examples/psp22_pallet_extensions/metadata/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "my_psp22_pallet_metadata" -version = "3.0.0-beta.1" +version = "3.0.0-rc" authors = ["Brushfam "] edition = "2021" [dependencies] -ink = { version = "4.0.0-beta.1", default-features = false} +ink = { version = "~4.0.0-rc", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } diff --git a/examples/psp22_pallet_extensions/mintable/Cargo.toml b/examples/psp22_pallet_extensions/mintable/Cargo.toml index 4d4e3b6f8..f966863a9 100644 --- a/examples/psp22_pallet_extensions/mintable/Cargo.toml +++ b/examples/psp22_pallet_extensions/mintable/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "my_psp22_pallet_mintable" -version = "3.0.0-beta.1" +version = "3.0.0-rc" authors = ["Brushfam "] edition = "2021" [dependencies] -ink = { version = "4.0.0-beta.1", default-features = false} +ink = { version = "~4.0.0-rc", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } diff --git a/examples/psp22_utils/token_timelock/Cargo.toml b/examples/psp22_utils/token_timelock/Cargo.toml index 48ac9a722..50dc00d71 100644 --- a/examples/psp22_utils/token_timelock/Cargo.toml +++ b/examples/psp22_utils/token_timelock/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "my_psp22_token_timelock" -version = "3.0.0-beta.1" +version = "3.0.0-rc" authors = ["Brushfam "] edition = "2021" [dependencies] -ink = { version = "4.0.0-beta.1", default-features = false} +ink = { version = "~4.0.0-rc", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } diff --git a/examples/psp34/Cargo.toml b/examples/psp34/Cargo.toml index 23cb7eebe..ed194acf9 100644 --- a/examples/psp34/Cargo.toml +++ b/examples/psp34/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "my_psp34" -version = "3.0.0-beta.1" +version = "3.0.0-rc" authors = ["Brushfam "] edition = "2021" [dependencies] -ink = { version = "4.0.0-beta.1", default-features = false} +ink = { version = "~4.0.0-rc", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } diff --git a/examples/psp34_extensions/burnable/Cargo.toml b/examples/psp34_extensions/burnable/Cargo.toml index 88723c33a..96a7ebced 100644 --- a/examples/psp34_extensions/burnable/Cargo.toml +++ b/examples/psp34_extensions/burnable/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "my_psp34_burnable" -version = "3.0.0-beta.1" +version = "3.0.0-rc" authors = ["Brushfam "] edition = "2021" [dependencies] -ink = { version = "4.0.0-beta.1", default-features = false} +ink = { version = "~4.0.0-rc", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } diff --git a/examples/psp34_extensions/enumerable/Cargo.toml b/examples/psp34_extensions/enumerable/Cargo.toml index 8e3731b8c..9c567b8db 100644 --- a/examples/psp34_extensions/enumerable/Cargo.toml +++ b/examples/psp34_extensions/enumerable/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "my_psp34_enumerable" -version = "3.0.0-beta.1" +version = "3.0.0-rc" authors = ["Brushfam "] edition = "2021" [dependencies] -ink = { version = "4.0.0-beta.1", default-features = false} +ink = { version = "~4.0.0-rc", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } diff --git a/examples/psp34_extensions/metadata/Cargo.toml b/examples/psp34_extensions/metadata/Cargo.toml index 7ac928d85..f7bea2610 100644 --- a/examples/psp34_extensions/metadata/Cargo.toml +++ b/examples/psp34_extensions/metadata/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "my_psp34_metadata" -version = "3.0.0-beta.1" +version = "3.0.0-rc" authors = ["Brushfam "] edition = "2021" [dependencies] -ink = { version = "4.0.0-beta.1", default-features = false} +ink = { version = "~4.0.0-rc", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } diff --git a/examples/psp34_extensions/mintable/Cargo.toml b/examples/psp34_extensions/mintable/Cargo.toml index a5b922f5d..22f007b79 100644 --- a/examples/psp34_extensions/mintable/Cargo.toml +++ b/examples/psp34_extensions/mintable/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "my_psp34_mintable" -version = "3.0.0-beta.1" +version = "3.0.0-rc" authors = ["Brushfam "] edition = "2021" [dependencies] -ink = { version = "4.0.0-beta.1", default-features = false} +ink = { version = "~4.0.0-rc", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } diff --git a/examples/psp37/Cargo.toml b/examples/psp37/Cargo.toml index 5ba498477..fc9bc7581 100644 --- a/examples/psp37/Cargo.toml +++ b/examples/psp37/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "my_psp37" -version = "3.0.0-beta.1" +version = "3.0.0-rc" authors = ["Brushfam "] edition = "2021" [dependencies] -ink = { version = "4.0.0-beta.1", default-features = false} +ink = { version = "~4.0.0-rc", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } diff --git a/examples/psp37_extensions/batch/Cargo.toml b/examples/psp37_extensions/batch/Cargo.toml index 9f9cbed52..cd3a792b4 100644 --- a/examples/psp37_extensions/batch/Cargo.toml +++ b/examples/psp37_extensions/batch/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "my_psp37_batch" -version = "3.0.0-beta.1" +version = "3.0.0-rc" authors = ["Brushfam "] edition = "2021" [dependencies] -ink = { version = "4.0.0-beta.1", default-features = false} +ink = { version = "~4.0.0-rc", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } diff --git a/examples/psp37_extensions/burnable/Cargo.toml b/examples/psp37_extensions/burnable/Cargo.toml index 9873f9d25..0e28d8702 100644 --- a/examples/psp37_extensions/burnable/Cargo.toml +++ b/examples/psp37_extensions/burnable/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "my_psp37_burnable" -version = "3.0.0-beta.1" +version = "3.0.0-rc" authors = ["Brushfam "] edition = "2021" [dependencies] -ink = { version = "4.0.0-beta.1", default-features = false} +ink = { version = "~4.0.0-rc", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } diff --git a/examples/psp37_extensions/enumerable/Cargo.toml b/examples/psp37_extensions/enumerable/Cargo.toml index e60c2a253..dd9e3e45b 100644 --- a/examples/psp37_extensions/enumerable/Cargo.toml +++ b/examples/psp37_extensions/enumerable/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "my_psp37_enumerable" -version = "3.0.0-beta.1" +version = "3.0.0-rc" authors = ["Brushfam "] edition = "2021" [dependencies] -ink = { version = "4.0.0-beta.1", default-features = false} +ink = { version = "~4.0.0-rc", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } diff --git a/examples/psp37_extensions/metadata/Cargo.toml b/examples/psp37_extensions/metadata/Cargo.toml index 90bce147e..afb20eaa8 100644 --- a/examples/psp37_extensions/metadata/Cargo.toml +++ b/examples/psp37_extensions/metadata/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "my_psp37_metadata" -version = "3.0.0-beta.1" +version = "3.0.0-rc" authors = ["Brushfam "] edition = "2021" [dependencies] -ink = { version = "4.0.0-beta.1", default-features = false} +ink = { version = "~4.0.0-rc", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } diff --git a/examples/psp37_extensions/mintable/Cargo.toml b/examples/psp37_extensions/mintable/Cargo.toml index fe8d16f4b..57e65b97b 100644 --- a/examples/psp37_extensions/mintable/Cargo.toml +++ b/examples/psp37_extensions/mintable/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "my_psp37_mintable" -version = "3.0.0-beta.1" +version = "3.0.0-rc" authors = ["Brushfam "] edition = "2021" [dependencies] -ink = { version = "4.0.0-beta.1", default-features = false} +ink = { version = "~4.0.0-rc", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } diff --git a/examples/reentrancy_guard/Cargo.toml b/examples/reentrancy_guard/Cargo.toml index 72281d970..d5dd6e3b1 100644 --- a/examples/reentrancy_guard/Cargo.toml +++ b/examples/reentrancy_guard/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "flipper" -version = "3.0.0-beta.1" +version = "3.0.0-rc" authors = ["Brushfam "] edition = "2021" [dependencies] -ink = { version = "4.0.0-beta.1", default-features = false} +ink = { version = "~4.0.0-rc", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } diff --git a/examples/reentrancy_guard/contracts/flip_on_me/Cargo.toml b/examples/reentrancy_guard/contracts/flip_on_me/Cargo.toml index f346080f8..3094598a5 100644 --- a/examples/reentrancy_guard/contracts/flip_on_me/Cargo.toml +++ b/examples/reentrancy_guard/contracts/flip_on_me/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "flip_on_me" -version = "3.0.0-beta.1" +version = "3.0.0-rc" authors = ["Brushfam "] edition = "2021" [dependencies] -ink = { version = "4.0.0-beta.1", default-features = false} +ink = { version = "~4.0.0-rc", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } diff --git a/examples/reentrancy_guard/contracts/flipper/Cargo.toml b/examples/reentrancy_guard/contracts/flipper/Cargo.toml index 9e523d3c9..6301073e4 100644 --- a/examples/reentrancy_guard/contracts/flipper/Cargo.toml +++ b/examples/reentrancy_guard/contracts/flipper/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "my_flipper_guard" -version = "3.0.0-beta.1" +version = "3.0.0-rc" authors = ["Brushfam "] edition = "2021" [dependencies] -ink = { version = "4.0.0-beta.1", default-features = false} +ink = { version = "~4.0.0-rc", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } diff --git a/examples/timelock_controller/Cargo.toml b/examples/timelock_controller/Cargo.toml index f621f4bb9..1c293f6b1 100644 --- a/examples/timelock_controller/Cargo.toml +++ b/examples/timelock_controller/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "my_timelock_controller" -version = "3.0.0-beta.1" +version = "3.0.0-rc" authors = ["Brushfam "] edition = "2021" [dependencies] -ink = { version = "4.0.0-beta.1", default-features = false} +ink = { version = "~4.0.0-rc", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } diff --git a/lang/Cargo.toml b/lang/Cargo.toml index 41ecb7e3a..18946c912 100644 --- a/lang/Cargo.toml +++ b/lang/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "openbrush_lang" -version = "3.0.0-beta.1" +version = "3.0.0-rc" authors = ["Brushfam "] edition = "2021" @@ -14,9 +14,9 @@ categories = ["no-std", "embedded"] include = ["Cargo.toml", "src/**/*.rs"] [dependencies] -openbrush_lang_macro = { version = "~3.0.0-beta.1", path = "macro", default-features = false } +openbrush_lang_macro = { version = "~3.0.0-rc", path = "macro", default-features = false } -ink = { version = "4.0.0-beta.1", default-features = false} +ink = { version = "~4.0.0-rc", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"] } diff --git a/lang/codegen/Cargo.toml b/lang/codegen/Cargo.toml index 6398f13c9..ab0df8a1d 100644 --- a/lang/codegen/Cargo.toml +++ b/lang/codegen/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "openbrush_lang_codegen" -version = "3.0.0-beta.1" +version = "3.0.0-rc" authors = ["Brushfam "] edition = "2021" diff --git a/lang/codegen/src/trait_definition.rs b/lang/codegen/src/trait_definition.rs index 815c8da49..e6f4bbfc0 100644 --- a/lang/codegen/src/trait_definition.rs +++ b/lang/codegen/src/trait_definition.rs @@ -278,8 +278,7 @@ fn generate_wrapper(ink_trait: ItemTrait) -> proc_macro2::TokenStream { > { ::ink::env::call::build_call::<::ink::env::DefaultEnvironment>() .call_type( - ::ink::env::call::Call::new() - .callee(self.clone())) + ::ink::env::call::Call::new(self.clone())) .exec_input( ::ink::env::call::ExecutionInput::new( ::ink::env::call::Selector::new([ #( #selector_bytes ),* ]) diff --git a/lang/macro/Cargo.toml b/lang/macro/Cargo.toml index fc6db722b..ab223cdc7 100644 --- a/lang/macro/Cargo.toml +++ b/lang/macro/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "openbrush_lang_macro" -version = "3.0.0-beta.1" +version = "3.0.0-rc" authors = ["Brushfam "] edition = "2021" @@ -14,13 +14,13 @@ categories = ["no-std", "embedded"] include = ["Cargo.toml", "src/**/*.rs"] [dependencies] -openbrush_lang_codegen = { version = "~3.0.0-beta.1", path = "../codegen", default-features = false } +openbrush_lang_codegen = { version = "~3.0.0-rc", path = "../codegen", default-features = false } syn = "1" proc-macro2 = "1" synstructure = "0.12" [dev-dependencies] -ink = { version = "4.0.0-beta.1", default-features = false} +ink = { version = "~4.0.0-rc", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"] } diff --git a/lang/macro/src/lib.rs b/lang/macro/src/lib.rs index 3eea7e0db..ba2ab2700 100644 --- a/lang/macro/src/lib.rs +++ b/lang/macro/src/lib.rs @@ -143,13 +143,22 @@ pub fn contract(_attrs: TokenStream, ink_module: TokenStream) -> TokenStream { /// } /// /// #[ink(storage)] -/// #[derive(Default, Storage)] +/// #[derive(Storage)] /// pub struct PSP22Struct { /// #[storage_field] /// example: Data, /// hated_account: AccountId, /// } /// +/// impl Default for PSP22Struct { +/// fn default() -> Self { +/// Self { +/// example: Data::default(), +/// hated_account: AccountId::from([0x0; 32]), +/// } +/// } +/// } +/// /// impl PSP22Example for PSP22Struct { /// // Let's override method to reject transactions to bad account /// fn _transfer_from_to(&mut self, from: AccountId, to: AccountId, amount: Balance) { @@ -310,12 +319,20 @@ pub fn modifier_definition(_attrs: TokenStream, _input: TokenStream) -> TokenStr /// #[openbrush::contract] /// mod example { /// #[ink(storage)] -/// #[derive(Default)] /// pub struct Contract { /// initialized: bool, /// owner: AccountId, /// } /// +/// impl Default for Contract { +/// fn default() -> Self { +/// Self { +/// initialized: false, +/// owner: [0u8; 32].into(), +/// } +/// } +/// } +/// /// #[openbrush::modifier_definition] /// fn once(instance: &mut Contract, body: impl FnOnce(&mut Contract)) { /// assert!(!instance.initialized, "Contract is already initialized"); diff --git a/mock/flash-borrower/Cargo.toml b/mock/flash-borrower/Cargo.toml index 5f2d67ce9..c50d7e440 100644 --- a/mock/flash-borrower/Cargo.toml +++ b/mock/flash-borrower/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "flash_borrower" -version = "3.0.0-beta.1" +version = "3.0.0-rc" authors = ["Brushfam "] edition = "2021" [dependencies] -ink = { version = "4.0.0-beta.1", default-features = false} +ink = { version = "~4.0.0-rc", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } diff --git a/mock/psp22-receiver/Cargo.toml b/mock/psp22-receiver/Cargo.toml index 9eca9d665..5bfb2ca2e 100644 --- a/mock/psp22-receiver/Cargo.toml +++ b/mock/psp22-receiver/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "psp22_receiver" -version = "3.0.0-beta.1" +version = "3.0.0-rc" authors = ["Brushfam "] edition = "2021" [dependencies] -ink = { version = "4.0.0-beta.1", default-features = false} +ink = { version = "~4.0.0-rc", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } diff --git a/mock/psp34-receiver/Cargo.toml b/mock/psp34-receiver/Cargo.toml index fc64baf44..2227055c8 100644 --- a/mock/psp34-receiver/Cargo.toml +++ b/mock/psp34-receiver/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "psp34_receiver" -version = "3.0.0-beta.1" +version = "3.0.0-rc" authors = ["Brushfam "] edition = "2021" [dependencies] -ink = { version = "4.0.0-beta.1", default-features = false} +ink = { version = "~4.0.0-rc", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } diff --git a/mock/psp37-receiver/Cargo.toml b/mock/psp37-receiver/Cargo.toml index d736a7870..3fc5d05c2 100644 --- a/mock/psp37-receiver/Cargo.toml +++ b/mock/psp37-receiver/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "psp37_receiver" -version = "3.0.0-beta.1" +version = "3.0.0-rc" authors = ["Brushfam "] edition = "2021" [dependencies] -ink = { version = "4.0.0-beta.1", default-features = false} +ink = { version = "~4.0.0-rc", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } From 03a122aa722c38d113b70b5aac43e3fc56a128b8 Mon Sep 17 00:00:00 2001 From: Artemka374 Date: Thu, 2 Feb 2023 14:21:49 +0200 Subject: [PATCH 08/14] apply rustfmt and fix lending --- contracts/src/token/psp22/extensions/wrapper.rs | 7 ++++++- .../src/token/psp22/utils/token_timelock.rs | 8 +++++++- contracts/src/traits/timelock_controller/mod.rs | 8 +++++++- example_project_structure/impls/lending/data.rs | 16 +++++++++++++++- example_project_structure/traits/loan.rs | 17 ++++++++++++++++- 5 files changed, 51 insertions(+), 5 deletions(-) diff --git a/contracts/src/token/psp22/extensions/wrapper.rs b/contracts/src/token/psp22/extensions/wrapper.rs index c25011392..2b2c329d1 100644 --- a/contracts/src/token/psp22/extensions/wrapper.rs +++ b/contracts/src/token/psp22/extensions/wrapper.rs @@ -31,7 +31,12 @@ use ink::{ env::CallFlags, prelude::vec::Vec, }; -use openbrush::traits::{AccountId, Balance, Storage, ZERO_ADDRESS}; +use openbrush::traits::{ + AccountId, + Balance, + Storage, + ZERO_ADDRESS, +}; pub use psp22::Internal as _; pub use wrapper::Internal as _; diff --git a/contracts/src/token/psp22/utils/token_timelock.rs b/contracts/src/token/psp22/utils/token_timelock.rs index 2e01a8ca9..b03f29970 100644 --- a/contracts/src/token/psp22/utils/token_timelock.rs +++ b/contracts/src/token/psp22/utils/token_timelock.rs @@ -32,7 +32,13 @@ use ink::{ env::CallFlags, prelude::vec::Vec, }; -use openbrush::traits::{AccountId, Balance, Storage, Timestamp, ZERO_ADDRESS}; +use openbrush::traits::{ + AccountId, + Balance, + Storage, + Timestamp, + ZERO_ADDRESS, +}; pub use psp22::Internal as _; pub use token_timelock::Internal as _; diff --git a/contracts/src/traits/timelock_controller/mod.rs b/contracts/src/traits/timelock_controller/mod.rs index 41305473e..958c0ec17 100644 --- a/contracts/src/traits/timelock_controller/mod.rs +++ b/contracts/src/traits/timelock_controller/mod.rs @@ -24,7 +24,13 @@ pub use crate::traits::{ errors::TimelockControllerError, }; use ink::prelude::vec::Vec; -use openbrush::traits::{AccountId, Balance, Hash, Timestamp, ZERO_ADDRESS}; +use openbrush::traits::{ + AccountId, + Balance, + Hash, + Timestamp, + ZERO_ADDRESS, +}; pub type OperationId = Hash; diff --git a/example_project_structure/impls/lending/data.rs b/example_project_structure/impls/lending/data.rs index 7c32a99ac..afd4e9636 100644 --- a/example_project_structure/impls/lending/data.rs +++ b/example_project_structure/impls/lending/data.rs @@ -17,7 +17,7 @@ use openbrush::traits::Storage; pub const STORAGE_KEY: u32 = openbrush::storage_unique_key!(Data); -#[derive(Default, Debug)] +#[derive(Debug)] #[openbrush::upgradeable_storage(STORAGE_KEY)] /// define the struct with the data that our smart contract will be using /// this will isolate the logic of our smart contract from its storage @@ -49,6 +49,20 @@ pub struct Data { pub loan_account: AccountId, } +impl Default for Data { + fn default() -> Self { + Self { + assets_lended: Default::default(), + asset_shares: Default::default(), + shares_asset: Default::default(), + collateral_accepted: Default::default(), + asset_price: Default::default(), + shares_contract_code_hash: Hash::default(), + loan_account: [0u8; 32].into(), + } + } +} + pub struct AssetPriceKey; impl<'a> TypeGuard<'a> for AssetPriceKey { diff --git a/example_project_structure/traits/loan.rs b/example_project_structure/traits/loan.rs index 466f2a3ec..a882fe3e2 100644 --- a/example_project_structure/traits/loan.rs +++ b/example_project_structure/traits/loan.rs @@ -16,7 +16,7 @@ use openbrush::{ #[cfg(feature = "std")] use ink::storage::traits::StorageLayout; -#[derive(Default, Debug, Clone, scale::Encode, scale::Decode)] +#[derive(Debug, Clone, scale::Encode, scale::Decode)] #[cfg_attr(feature = "std", derive(StorageLayout, scale_info::TypeInfo))] pub struct LoanInfo { pub borrower: AccountId, @@ -29,6 +29,21 @@ pub struct LoanInfo { pub liquidated: bool, } +impl Default for LoanInfo { + fn default() -> Self { + Self { + borrower: [0u8; 32].into(), + collateral_token: [0u8; 32].into(), + collateral_amount: Balance::default(), + borrow_token: [0u8; 32].into(), + borrow_amount: Balance::default(), + liquidation_price: Balance::default(), + timestamp: Timestamp::default(), + liquidated: false, + } + } +} + #[openbrush::wrapper] pub type LoanRef = dyn Loan + PSP34 + PSP34Metadata + Ownable; From a5ef5ac2ae41eec8aec4e103c8b629bb96b5ea91 Mon Sep 17 00:00:00 2001 From: Artemka374 Date: Thu, 2 Feb 2023 15:50:29 +0200 Subject: [PATCH 09/14] update typechain and polkadot.js versions --- package.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 3452ca59e..cd1af76f3 100644 --- a/package.json +++ b/package.json @@ -7,15 +7,15 @@ "@babel/plugin-transform-runtime": "^7.14.2", "@babel/preset-env": "^7.7.4", "@babel/register": "^7.7.4", - "@727-ventures/typechain-compiler": "^0.5.10", - "@727-ventures/typechain-types": "^0.0.21", + "@727-ventures/typechain-compiler": "^0.5.12", + "@727-ventures/typechain-types": "^0.0.22", "@types/chai": "^4.3.0", "@types/chai-as-promised": "^7.1.5", "@types/mocha": "^8.0.3", "@typescript-eslint/eslint-plugin": "^4.8.2", "@typescript-eslint/parser": "^4.8.2", - "@polkadot/api": "9.10.3", - "@polkadot/api-contract": "9.10.3", + "@polkadot/api": "9.13.4", + "@polkadot/api-contract": "9.13.4", "chai": "^4.3.6", "chai-as-promised": "^7.1.1", "deasync": "^0.1.28", From 8cecc5c325782ba995694f7354365b22dd4bcfe1 Mon Sep 17 00:00:00 2001 From: Artemka374 Date: Thu, 2 Feb 2023 16:40:13 +0200 Subject: [PATCH 10/14] update typechain-compiler version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index cd1af76f3..286fb4f8a 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "@babel/plugin-transform-runtime": "^7.14.2", "@babel/preset-env": "^7.7.4", "@babel/register": "^7.7.4", - "@727-ventures/typechain-compiler": "^0.5.12", + "@727-ventures/typechain-compiler": "^0.5.13", "@727-ventures/typechain-types": "^0.0.22", "@types/chai": "^4.3.0", "@types/chai-as-promised": "^7.1.5", From 8884f5e113648576683755e1fcf01d2bb3442bbf Mon Sep 17 00:00:00 2001 From: Artemka374 Date: Thu, 2 Feb 2023 17:09:39 +0200 Subject: [PATCH 11/14] use npm instead of yarn --- .github/workflows/ci.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 895923e68..796ebdb87 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -56,10 +56,10 @@ jobs: with: node-version: '16.x' - uses: actions/checkout@v3 - - name: Yarn install dependencies + - name: NPM install dependencies run: | - yarn - yarn add ts-node + npm i + npm i ts-node - name: Cache rust artifacts id: cache-rust-artifacts @@ -144,10 +144,10 @@ jobs: with: ref: main - - name: Yarn install dependencies for destination branch + - name: NPM install dependencies for destination branch run: | - yarn - yarn add ts-node + npm i + npm i ts-node - name: Cache rust artifacts for destination branch id: cache-rust-artifacts-destination @@ -162,7 +162,7 @@ jobs: run: | chown -R root . chmod -R a+rwx . - yarn build:release + npm run build:release - name: Find contract data destination branch id: find-data-destination @@ -216,10 +216,10 @@ jobs: with: node-version: '16.x' - uses: actions/checkout@v3 - - name: Yarn install dependencies + - name: NPM install dependencies run: | - yarn - yarn add ts-node + npm i + npm i ts-node - name: Cache contract artifacts id: cache-contract-artifacts @@ -240,13 +240,13 @@ jobs: do substrate-contracts-node --tmp --dev & P1=$!; set +e; - output=$(yarn test:mocha-single ./$test || true); + output=$(npm run test:mocha-single ./$test || true); set -e; if echo $output | grep -q 'For async tests and hooks, ensure "done()" is called'; then echo $output; has_timeout=true else - yarn test:mocha-single ./$test + npm run test:mocha-single ./$test has_timeout=false fi kill $P1; From f77995c2874e8b422006ec430f3afff9a47ad36e Mon Sep 17 00:00:00 2001 From: Artemka374 Date: Thu, 2 Feb 2023 17:41:36 +0200 Subject: [PATCH 12/14] rename version to 3.0.0-beta.1 --- Cargo.toml | 6 +++--- contracts/Cargo.toml | 4 ++-- docs/docs/smart-contracts/example/contract.md | 4 ++-- docs/docs/smart-contracts/overview.md | 8 ++++---- docs/docs/smart-contracts/upgradeable.md | 2 +- example_project_structure/Cargo.toml | 2 +- example_project_structure/contracts/lending/Cargo.toml | 2 +- example_project_structure/contracts/loan/Cargo.toml | 2 +- example_project_structure/contracts/shares/Cargo.toml | 2 +- .../contracts/stable_coin/Cargo.toml | 2 +- examples/access_control/Cargo.toml | 2 +- examples/access_control_extensions/enumerable/Cargo.toml | 2 +- examples/alternatives/diamond/ink/Cargo.toml | 2 +- examples/alternatives/diamond/rust/Cargo.toml | 2 +- examples/diamond/Cargo.toml | 2 +- examples/diamond/diamond_caller/Cargo.toml | 2 +- examples/diamond/psp22_facet_v1/Cargo.toml | 2 +- examples/diamond/psp22_facet_v2/Cargo.toml | 2 +- examples/diamond/psp22_metadata_facet/Cargo.toml | 2 +- examples/ownable/Cargo.toml | 2 +- examples/pausable/Cargo.toml | 2 +- examples/payment_splitter/Cargo.toml | 2 +- examples/proxy/Cargo.toml | 2 +- examples/proxy/psp22_metadata_upgradeable/Cargo.toml | 2 +- examples/proxy/psp22_upgradeable/Cargo.toml | 2 +- examples/psp22/Cargo.toml | 2 +- examples/psp22_extensions/burnable/Cargo.toml | 2 +- examples/psp22_extensions/capped/Cargo.toml | 2 +- examples/psp22_extensions/flashmint/Cargo.toml | 2 +- examples/psp22_extensions/metadata/Cargo.toml | 2 +- examples/psp22_extensions/mintable/Cargo.toml | 2 +- examples/psp22_extensions/pausable/Cargo.toml | 2 +- examples/psp22_extensions/wrapper/Cargo.toml | 2 +- examples/psp22_pallet/Cargo.toml | 2 +- examples/psp22_pallet_extensions/burnable/Cargo.toml | 2 +- examples/psp22_pallet_extensions/metadata/Cargo.toml | 2 +- examples/psp22_pallet_extensions/mintable/Cargo.toml | 2 +- examples/psp22_utils/token_timelock/Cargo.toml | 2 +- examples/psp34/Cargo.toml | 2 +- examples/psp34_extensions/burnable/Cargo.toml | 2 +- examples/psp34_extensions/enumerable/Cargo.toml | 2 +- examples/psp34_extensions/metadata/Cargo.toml | 2 +- examples/psp34_extensions/mintable/Cargo.toml | 2 +- examples/psp37/Cargo.toml | 2 +- examples/psp37_extensions/batch/Cargo.toml | 2 +- examples/psp37_extensions/burnable/Cargo.toml | 2 +- examples/psp37_extensions/enumerable/Cargo.toml | 2 +- examples/psp37_extensions/metadata/Cargo.toml | 2 +- examples/psp37_extensions/mintable/Cargo.toml | 2 +- examples/reentrancy_guard/Cargo.toml | 2 +- examples/reentrancy_guard/contracts/flip_on_me/Cargo.toml | 2 +- examples/reentrancy_guard/contracts/flipper/Cargo.toml | 2 +- examples/timelock_controller/Cargo.toml | 2 +- lang/Cargo.toml | 4 ++-- lang/codegen/Cargo.toml | 2 +- lang/macro/Cargo.toml | 4 ++-- mock/flash-borrower/Cargo.toml | 2 +- mock/psp22-receiver/Cargo.toml | 2 +- mock/psp34-receiver/Cargo.toml | 2 +- mock/psp37-receiver/Cargo.toml | 2 +- 60 files changed, 69 insertions(+), 69 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 143cff8ea..5806dc835 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,7 +12,7 @@ exclude = [ [package] name = "openbrush" -version = "3.0.0-rc" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2018" @@ -31,8 +31,8 @@ ink = { version = "~4.0.0-rc", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } -openbrush_contracts = { version = "~3.0.0-rc", path = "contracts", default-features = false } -openbrush_lang = { version = "~3.0.0-rc", path = "lang", default-features = false } +openbrush_contracts = { version = "~3.0.0-beta.1", path = "contracts", default-features = false } +openbrush_lang = { version = "~3.0.0-beta.1", path = "lang", default-features = false } [lib] name = "openbrush" diff --git a/contracts/Cargo.toml b/contracts/Cargo.toml index f4f614d65..143fd8a3c 100644 --- a/contracts/Cargo.toml +++ b/contracts/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "openbrush_contracts" -version = "3.0.0-rc" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" @@ -19,7 +19,7 @@ ink = { version = "~4.0.0-rc", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } -openbrush = { version = "~3.0.0-rc", package = "openbrush_lang", path = "../lang", default-features = false } +openbrush = { version = "~3.0.0-beta.1", package = "openbrush_lang", path = "../lang", default-features = false } pallet-assets-chain-extension = { git = "https://github.com/727-ventures/pallet-assets-chain-extension", branch = "ink-4-beta", default-features = false, features = ["ink-lang"] } diff --git a/docs/docs/smart-contracts/example/contract.md b/docs/docs/smart-contracts/example/contract.md index fce02b107..bdaaca921 100644 --- a/docs/docs/smart-contracts/example/contract.md +++ b/docs/docs/smart-contracts/example/contract.md @@ -16,7 +16,7 @@ implementation of `Lending` and `LendingPermissioned` traits defined in the `len ```toml [package] name = "lending_contract" -version = "3.0.0-rc" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" @@ -29,7 +29,7 @@ scale-info = { version = "2.3", default-features = false, features = ["derive"], shares_contract = { path = "../shares", default-features = false, features = ["ink-as-dependency"] } loan_contract = { path = "../loan", default-features = false, features = ["ink-as-dependency"] } lending_project = { path = "../..", default-features = false } -openbrush = { version = "~3.0.0-rc", default-features = false, features = ["pausable", "access_control"] } +openbrush = { version = "~3.0.0-beta.1", default-features = false, features = ["pausable", "access_control"] } [lib] name = "lending_contract" diff --git a/docs/docs/smart-contracts/overview.md b/docs/docs/smart-contracts/overview.md index 4ad451a8a..bc559341f 100644 --- a/docs/docs/smart-contracts/overview.md +++ b/docs/docs/smart-contracts/overview.md @@ -24,7 +24,7 @@ scale = { package = "parity-scale-codec", version = "3", default-features = fals scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } # Brush dependency -openbrush = { git = "https://github.com/727-Ventures/openbrush-contracts", version = "~3.0.0-rc", default-features = false } +openbrush = { git = "https://github.com/727-Ventures/openbrush-contracts", version = "~3.0.0-beta.1", default-features = false } [features] default = ["std"] @@ -73,17 +73,17 @@ The name of the feature is the same as the name of the module. For example: To enable `psp22`: ```toml -openbrush = { git = "https://github.com/727-Ventures/openbrush-contracts", version = "~3.0.0-rc", default-features = false, features = ["psp22"] } +openbrush = { git = "https://github.com/727-Ventures/openbrush-contracts", version = "~3.0.0-beta.1", default-features = false, features = ["psp22"] } ``` To enable `ownable`: ```toml -openbrush = { git = "https://github.com/727-Ventures/openbrush-contracts", version = "~3.0.0-rc", default-features = false, features = ["ownable"] } +openbrush = { git = "https://github.com/727-Ventures/openbrush-contracts", version = "~3.0.0-beta.1", default-features = false, features = ["ownable"] } ``` To enable both: ```toml -openbrush = { git = "https://github.com/727-Ventures/openbrush-contracts", version = "~3.0.0-rc", default-features = false, features = ["psp22, ownable"] } +openbrush = { git = "https://github.com/727-Ventures/openbrush-contracts", version = "~3.0.0-beta.1", default-features = false, features = ["psp22, ownable"] } ``` After enabling the feature and importing the corresponding module, you need to embed the module diff --git a/docs/docs/smart-contracts/upgradeable.md b/docs/docs/smart-contracts/upgradeable.md index aa7d7dc13..27458ca43 100644 --- a/docs/docs/smart-contracts/upgradeable.md +++ b/docs/docs/smart-contracts/upgradeable.md @@ -208,7 +208,7 @@ pub struct Data { ### Disclaimer -The following information describes `Proxy` and `Diamond` patterns of upgradeable storage, which currently don't work in ink! 4 due to `DelegateCall`, but we will leave it here for the future updates of this feature (and also for the OpenBrush versions before `3.0.0-rc`). +The following information describes `Proxy` and `Diamond` patterns of upgradeable storage, which currently don't work in ink! 4 due to `DelegateCall`, but we will leave it here for the future updates of this feature (and also for the OpenBrush versions before `3.0.0-beta.1`). Uploading your contract on the blockchain with `contract-pallet` has two phases: - Deploy - deploys source code to the blockchain. After deploying, the network uses the hash of the source code as an identifier for future instantiation of the contract. Now anyone can instantiate the contract by source code hash. diff --git a/example_project_structure/Cargo.toml b/example_project_structure/Cargo.toml index 7f1e211f5..6c49a529a 100644 --- a/example_project_structure/Cargo.toml +++ b/example_project_structure/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "lending_project" -version = "3.0.0-rc" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" diff --git a/example_project_structure/contracts/lending/Cargo.toml b/example_project_structure/contracts/lending/Cargo.toml index d67357587..9bec3f7f3 100644 --- a/example_project_structure/contracts/lending/Cargo.toml +++ b/example_project_structure/contracts/lending/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "lending_contract" -version = "3.0.0-rc" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" diff --git a/example_project_structure/contracts/loan/Cargo.toml b/example_project_structure/contracts/loan/Cargo.toml index e1d1d74b9..782819567 100644 --- a/example_project_structure/contracts/loan/Cargo.toml +++ b/example_project_structure/contracts/loan/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "loan_contract" -version = "3.0.0-rc" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" diff --git a/example_project_structure/contracts/shares/Cargo.toml b/example_project_structure/contracts/shares/Cargo.toml index 449e242b8..67f32f89b 100644 --- a/example_project_structure/contracts/shares/Cargo.toml +++ b/example_project_structure/contracts/shares/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "shares_contract" -version = "3.0.0-rc" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" diff --git a/example_project_structure/contracts/stable_coin/Cargo.toml b/example_project_structure/contracts/stable_coin/Cargo.toml index f377a38ea..069d7c386 100644 --- a/example_project_structure/contracts/stable_coin/Cargo.toml +++ b/example_project_structure/contracts/stable_coin/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "stable_coin_contract" -version = "3.0.0-rc" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" diff --git a/examples/access_control/Cargo.toml b/examples/access_control/Cargo.toml index f2b1787cc..e498a8970 100644 --- a/examples/access_control/Cargo.toml +++ b/examples/access_control/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "my_access_control" -version = "3.0.0-rc" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" diff --git a/examples/access_control_extensions/enumerable/Cargo.toml b/examples/access_control_extensions/enumerable/Cargo.toml index 1c0ec2b50..3a2fdb158 100644 --- a/examples/access_control_extensions/enumerable/Cargo.toml +++ b/examples/access_control_extensions/enumerable/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "my_access_control_enumerable" -version = "3.0.0-rc" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" diff --git a/examples/alternatives/diamond/ink/Cargo.toml b/examples/alternatives/diamond/ink/Cargo.toml index 0bebed3bb..f8bc2a34b 100644 --- a/examples/alternatives/diamond/ink/Cargo.toml +++ b/examples/alternatives/diamond/ink/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ink_diamond" -version = "3.0.0-rc" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" diff --git a/examples/alternatives/diamond/rust/Cargo.toml b/examples/alternatives/diamond/rust/Cargo.toml index f5afc32a5..116d68178 100644 --- a/examples/alternatives/diamond/rust/Cargo.toml +++ b/examples/alternatives/diamond/rust/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rust_diamond" -version = "3.0.0-rc" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" diff --git a/examples/diamond/Cargo.toml b/examples/diamond/Cargo.toml index 623368907..65a8803e8 100644 --- a/examples/diamond/Cargo.toml +++ b/examples/diamond/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "my_diamond" -version = "3.0.0-rc" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" diff --git a/examples/diamond/diamond_caller/Cargo.toml b/examples/diamond/diamond_caller/Cargo.toml index ba9405806..c2bcf5199 100644 --- a/examples/diamond/diamond_caller/Cargo.toml +++ b/examples/diamond/diamond_caller/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "diamond_caller" -version = "3.0.0-rc" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" diff --git a/examples/diamond/psp22_facet_v1/Cargo.toml b/examples/diamond/psp22_facet_v1/Cargo.toml index 7c5dbc3bb..3d1d6ea72 100644 --- a/examples/diamond/psp22_facet_v1/Cargo.toml +++ b/examples/diamond/psp22_facet_v1/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "my_psp22_facet_v1" -version = "3.0.0-rc" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" diff --git a/examples/diamond/psp22_facet_v2/Cargo.toml b/examples/diamond/psp22_facet_v2/Cargo.toml index 7af9aec1b..af2c41efe 100644 --- a/examples/diamond/psp22_facet_v2/Cargo.toml +++ b/examples/diamond/psp22_facet_v2/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "my_psp22_facet_v2" -version = "3.0.0-rc" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" diff --git a/examples/diamond/psp22_metadata_facet/Cargo.toml b/examples/diamond/psp22_metadata_facet/Cargo.toml index 810e39b1a..09182a6c3 100644 --- a/examples/diamond/psp22_metadata_facet/Cargo.toml +++ b/examples/diamond/psp22_metadata_facet/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "my_psp22_metadata_facet" -version = "3.0.0-rc" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" diff --git a/examples/ownable/Cargo.toml b/examples/ownable/Cargo.toml index d36c4469e..1d7b5764f 100644 --- a/examples/ownable/Cargo.toml +++ b/examples/ownable/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "my_ownable" -version = "3.0.0-rc" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" diff --git a/examples/pausable/Cargo.toml b/examples/pausable/Cargo.toml index 091060646..b0925582c 100644 --- a/examples/pausable/Cargo.toml +++ b/examples/pausable/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "my_pausable" -version = "3.0.0-rc" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" diff --git a/examples/payment_splitter/Cargo.toml b/examples/payment_splitter/Cargo.toml index 9a4143c60..a2ab5e976 100644 --- a/examples/payment_splitter/Cargo.toml +++ b/examples/payment_splitter/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "my_payment_splitter" -version = "3.0.0-rc" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" diff --git a/examples/proxy/Cargo.toml b/examples/proxy/Cargo.toml index 66f0c98c9..11802da56 100644 --- a/examples/proxy/Cargo.toml +++ b/examples/proxy/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "my_proxy" -version = "3.0.0-rc" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" diff --git a/examples/proxy/psp22_metadata_upgradeable/Cargo.toml b/examples/proxy/psp22_metadata_upgradeable/Cargo.toml index ee9a0a414..a2d0a8c69 100644 --- a/examples/proxy/psp22_metadata_upgradeable/Cargo.toml +++ b/examples/proxy/psp22_metadata_upgradeable/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "my_psp22_metadata_upgradeable" -version = "3.0.0-rc" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" diff --git a/examples/proxy/psp22_upgradeable/Cargo.toml b/examples/proxy/psp22_upgradeable/Cargo.toml index 07d4a97a7..7c8e114fe 100644 --- a/examples/proxy/psp22_upgradeable/Cargo.toml +++ b/examples/proxy/psp22_upgradeable/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "my_psp22_upgradeable" -version = "3.0.0-rc" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" diff --git a/examples/psp22/Cargo.toml b/examples/psp22/Cargo.toml index ce514c2d3..b444275c3 100644 --- a/examples/psp22/Cargo.toml +++ b/examples/psp22/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "my_psp22" -version = "3.0.0-rc" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" diff --git a/examples/psp22_extensions/burnable/Cargo.toml b/examples/psp22_extensions/burnable/Cargo.toml index 4ffa3e684..05cc9c6ad 100644 --- a/examples/psp22_extensions/burnable/Cargo.toml +++ b/examples/psp22_extensions/burnable/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "my_psp22_burnable" -version = "3.0.0-rc" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" diff --git a/examples/psp22_extensions/capped/Cargo.toml b/examples/psp22_extensions/capped/Cargo.toml index d8695d8fe..ed7f61d56 100644 --- a/examples/psp22_extensions/capped/Cargo.toml +++ b/examples/psp22_extensions/capped/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "my_psp22_capped" -version = "3.0.0-rc" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" diff --git a/examples/psp22_extensions/flashmint/Cargo.toml b/examples/psp22_extensions/flashmint/Cargo.toml index e6e7eac92..0d4b664b8 100644 --- a/examples/psp22_extensions/flashmint/Cargo.toml +++ b/examples/psp22_extensions/flashmint/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "my_psp22_flashmint" -version = "3.0.0-rc" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" diff --git a/examples/psp22_extensions/metadata/Cargo.toml b/examples/psp22_extensions/metadata/Cargo.toml index b59f7070b..4b7ea467b 100644 --- a/examples/psp22_extensions/metadata/Cargo.toml +++ b/examples/psp22_extensions/metadata/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "my_psp22_metadata" -version = "3.0.0-rc" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" diff --git a/examples/psp22_extensions/mintable/Cargo.toml b/examples/psp22_extensions/mintable/Cargo.toml index ba7ebbf0c..2dc7a0f5a 100644 --- a/examples/psp22_extensions/mintable/Cargo.toml +++ b/examples/psp22_extensions/mintable/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "my_psp22_mintable" -version = "3.0.0-rc" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" diff --git a/examples/psp22_extensions/pausable/Cargo.toml b/examples/psp22_extensions/pausable/Cargo.toml index 3ff850b1e..b15689945 100644 --- a/examples/psp22_extensions/pausable/Cargo.toml +++ b/examples/psp22_extensions/pausable/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "my_psp22_pausable" -version = "3.0.0-rc" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" diff --git a/examples/psp22_extensions/wrapper/Cargo.toml b/examples/psp22_extensions/wrapper/Cargo.toml index 0ad409250..7ef33e610 100644 --- a/examples/psp22_extensions/wrapper/Cargo.toml +++ b/examples/psp22_extensions/wrapper/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "my_psp22_wrapper" -version = "3.0.0-rc" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" diff --git a/examples/psp22_pallet/Cargo.toml b/examples/psp22_pallet/Cargo.toml index 56d9d4c72..6dfc682d7 100644 --- a/examples/psp22_pallet/Cargo.toml +++ b/examples/psp22_pallet/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "my_psp22_pallet" -version = "3.0.0-rc" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" diff --git a/examples/psp22_pallet_extensions/burnable/Cargo.toml b/examples/psp22_pallet_extensions/burnable/Cargo.toml index a0b54d2e2..95f615fc7 100644 --- a/examples/psp22_pallet_extensions/burnable/Cargo.toml +++ b/examples/psp22_pallet_extensions/burnable/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "my_psp22_pallet_burnable" -version = "3.0.0-rc" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" diff --git a/examples/psp22_pallet_extensions/metadata/Cargo.toml b/examples/psp22_pallet_extensions/metadata/Cargo.toml index 3cf7c57fa..d63c04593 100644 --- a/examples/psp22_pallet_extensions/metadata/Cargo.toml +++ b/examples/psp22_pallet_extensions/metadata/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "my_psp22_pallet_metadata" -version = "3.0.0-rc" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" diff --git a/examples/psp22_pallet_extensions/mintable/Cargo.toml b/examples/psp22_pallet_extensions/mintable/Cargo.toml index f966863a9..ee744c5ce 100644 --- a/examples/psp22_pallet_extensions/mintable/Cargo.toml +++ b/examples/psp22_pallet_extensions/mintable/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "my_psp22_pallet_mintable" -version = "3.0.0-rc" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" diff --git a/examples/psp22_utils/token_timelock/Cargo.toml b/examples/psp22_utils/token_timelock/Cargo.toml index 50dc00d71..6c237f372 100644 --- a/examples/psp22_utils/token_timelock/Cargo.toml +++ b/examples/psp22_utils/token_timelock/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "my_psp22_token_timelock" -version = "3.0.0-rc" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" diff --git a/examples/psp34/Cargo.toml b/examples/psp34/Cargo.toml index ed194acf9..ee17a8c43 100644 --- a/examples/psp34/Cargo.toml +++ b/examples/psp34/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "my_psp34" -version = "3.0.0-rc" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" diff --git a/examples/psp34_extensions/burnable/Cargo.toml b/examples/psp34_extensions/burnable/Cargo.toml index 96a7ebced..f810d0e85 100644 --- a/examples/psp34_extensions/burnable/Cargo.toml +++ b/examples/psp34_extensions/burnable/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "my_psp34_burnable" -version = "3.0.0-rc" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" diff --git a/examples/psp34_extensions/enumerable/Cargo.toml b/examples/psp34_extensions/enumerable/Cargo.toml index 9c567b8db..739238967 100644 --- a/examples/psp34_extensions/enumerable/Cargo.toml +++ b/examples/psp34_extensions/enumerable/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "my_psp34_enumerable" -version = "3.0.0-rc" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" diff --git a/examples/psp34_extensions/metadata/Cargo.toml b/examples/psp34_extensions/metadata/Cargo.toml index f7bea2610..7589d1d81 100644 --- a/examples/psp34_extensions/metadata/Cargo.toml +++ b/examples/psp34_extensions/metadata/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "my_psp34_metadata" -version = "3.0.0-rc" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" diff --git a/examples/psp34_extensions/mintable/Cargo.toml b/examples/psp34_extensions/mintable/Cargo.toml index 22f007b79..4e245343e 100644 --- a/examples/psp34_extensions/mintable/Cargo.toml +++ b/examples/psp34_extensions/mintable/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "my_psp34_mintable" -version = "3.0.0-rc" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" diff --git a/examples/psp37/Cargo.toml b/examples/psp37/Cargo.toml index fc9bc7581..7fe9680e2 100644 --- a/examples/psp37/Cargo.toml +++ b/examples/psp37/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "my_psp37" -version = "3.0.0-rc" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" diff --git a/examples/psp37_extensions/batch/Cargo.toml b/examples/psp37_extensions/batch/Cargo.toml index cd3a792b4..3ac50a068 100644 --- a/examples/psp37_extensions/batch/Cargo.toml +++ b/examples/psp37_extensions/batch/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "my_psp37_batch" -version = "3.0.0-rc" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" diff --git a/examples/psp37_extensions/burnable/Cargo.toml b/examples/psp37_extensions/burnable/Cargo.toml index 0e28d8702..d78b9c95f 100644 --- a/examples/psp37_extensions/burnable/Cargo.toml +++ b/examples/psp37_extensions/burnable/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "my_psp37_burnable" -version = "3.0.0-rc" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" diff --git a/examples/psp37_extensions/enumerable/Cargo.toml b/examples/psp37_extensions/enumerable/Cargo.toml index dd9e3e45b..ce7183158 100644 --- a/examples/psp37_extensions/enumerable/Cargo.toml +++ b/examples/psp37_extensions/enumerable/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "my_psp37_enumerable" -version = "3.0.0-rc" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" diff --git a/examples/psp37_extensions/metadata/Cargo.toml b/examples/psp37_extensions/metadata/Cargo.toml index afb20eaa8..5356c54a1 100644 --- a/examples/psp37_extensions/metadata/Cargo.toml +++ b/examples/psp37_extensions/metadata/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "my_psp37_metadata" -version = "3.0.0-rc" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" diff --git a/examples/psp37_extensions/mintable/Cargo.toml b/examples/psp37_extensions/mintable/Cargo.toml index 57e65b97b..012921244 100644 --- a/examples/psp37_extensions/mintable/Cargo.toml +++ b/examples/psp37_extensions/mintable/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "my_psp37_mintable" -version = "3.0.0-rc" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" diff --git a/examples/reentrancy_guard/Cargo.toml b/examples/reentrancy_guard/Cargo.toml index d5dd6e3b1..0b4768f1b 100644 --- a/examples/reentrancy_guard/Cargo.toml +++ b/examples/reentrancy_guard/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "flipper" -version = "3.0.0-rc" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" diff --git a/examples/reentrancy_guard/contracts/flip_on_me/Cargo.toml b/examples/reentrancy_guard/contracts/flip_on_me/Cargo.toml index 3094598a5..b5ecab257 100644 --- a/examples/reentrancy_guard/contracts/flip_on_me/Cargo.toml +++ b/examples/reentrancy_guard/contracts/flip_on_me/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "flip_on_me" -version = "3.0.0-rc" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" diff --git a/examples/reentrancy_guard/contracts/flipper/Cargo.toml b/examples/reentrancy_guard/contracts/flipper/Cargo.toml index 6301073e4..7e556aa06 100644 --- a/examples/reentrancy_guard/contracts/flipper/Cargo.toml +++ b/examples/reentrancy_guard/contracts/flipper/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "my_flipper_guard" -version = "3.0.0-rc" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" diff --git a/examples/timelock_controller/Cargo.toml b/examples/timelock_controller/Cargo.toml index 1c293f6b1..5c5139333 100644 --- a/examples/timelock_controller/Cargo.toml +++ b/examples/timelock_controller/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "my_timelock_controller" -version = "3.0.0-rc" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" diff --git a/lang/Cargo.toml b/lang/Cargo.toml index 18946c912..39c92e7d0 100644 --- a/lang/Cargo.toml +++ b/lang/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "openbrush_lang" -version = "3.0.0-rc" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" @@ -14,7 +14,7 @@ categories = ["no-std", "embedded"] include = ["Cargo.toml", "src/**/*.rs"] [dependencies] -openbrush_lang_macro = { version = "~3.0.0-rc", path = "macro", default-features = false } +openbrush_lang_macro = { version = "~3.0.0-beta.1", path = "macro", default-features = false } ink = { version = "~4.0.0-rc", default-features = false} scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } diff --git a/lang/codegen/Cargo.toml b/lang/codegen/Cargo.toml index ab0df8a1d..6398f13c9 100644 --- a/lang/codegen/Cargo.toml +++ b/lang/codegen/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "openbrush_lang_codegen" -version = "3.0.0-rc" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" diff --git a/lang/macro/Cargo.toml b/lang/macro/Cargo.toml index ab223cdc7..7dd0697f7 100644 --- a/lang/macro/Cargo.toml +++ b/lang/macro/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "openbrush_lang_macro" -version = "3.0.0-rc" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" @@ -14,7 +14,7 @@ categories = ["no-std", "embedded"] include = ["Cargo.toml", "src/**/*.rs"] [dependencies] -openbrush_lang_codegen = { version = "~3.0.0-rc", path = "../codegen", default-features = false } +openbrush_lang_codegen = { version = "~3.0.0-beta.1", path = "../codegen", default-features = false } syn = "1" proc-macro2 = "1" synstructure = "0.12" diff --git a/mock/flash-borrower/Cargo.toml b/mock/flash-borrower/Cargo.toml index c50d7e440..de8b9ba05 100644 --- a/mock/flash-borrower/Cargo.toml +++ b/mock/flash-borrower/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "flash_borrower" -version = "3.0.0-rc" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" diff --git a/mock/psp22-receiver/Cargo.toml b/mock/psp22-receiver/Cargo.toml index 5bfb2ca2e..ac5faa9ab 100644 --- a/mock/psp22-receiver/Cargo.toml +++ b/mock/psp22-receiver/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "psp22_receiver" -version = "3.0.0-rc" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" diff --git a/mock/psp34-receiver/Cargo.toml b/mock/psp34-receiver/Cargo.toml index 2227055c8..80401b0bd 100644 --- a/mock/psp34-receiver/Cargo.toml +++ b/mock/psp34-receiver/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "psp34_receiver" -version = "3.0.0-rc" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" diff --git a/mock/psp37-receiver/Cargo.toml b/mock/psp37-receiver/Cargo.toml index 3fc5d05c2..90dd34abe 100644 --- a/mock/psp37-receiver/Cargo.toml +++ b/mock/psp37-receiver/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "psp37_receiver" -version = "3.0.0-rc" +version = "3.0.0-beta.1" authors = ["Brushfam "] edition = "2021" From f209379377c1d99b20e2a6e637c502e921fd221e Mon Sep 17 00:00:00 2001 From: Artemka374 Date: Thu, 2 Feb 2023 18:10:52 +0200 Subject: [PATCH 13/14] apply suggestions --- contracts/src/traits/timelock_controller/mod.rs | 5 +---- contracts/src/upgradeability/diamond/diamond.rs | 4 ++-- contracts/src/upgradeability/proxy/mod.rs | 3 ++- example_project_structure/impls/lending/data.rs | 7 +------ example_project_structure/traits/loan.rs | 6 +----- examples/psp22/lib.rs | 14 ++++---------- lang/codegen/src/trait_definition.rs | 1 - 7 files changed, 11 insertions(+), 29 deletions(-) diff --git a/contracts/src/traits/timelock_controller/mod.rs b/contracts/src/traits/timelock_controller/mod.rs index 958c0ec17..6ca457d81 100644 --- a/contracts/src/traits/timelock_controller/mod.rs +++ b/contracts/src/traits/timelock_controller/mod.rs @@ -54,10 +54,7 @@ impl Default for Transaction { fn default() -> Self { Self { callee: ZERO_ADDRESS.into(), - selector: Default::default(), - input: Default::default(), - transferred_value: Default::default(), - gas_limit: Default::default(), + ..Default::default() } } } diff --git a/contracts/src/upgradeability/diamond/diamond.rs b/contracts/src/upgradeability/diamond/diamond.rs index 3c2d7a1b1..2992d8a4a 100644 --- a/contracts/src/upgradeability/diamond/diamond.rs +++ b/contracts/src/upgradeability/diamond/diamond.rs @@ -180,7 +180,7 @@ where } ink::env::call::build_call::() - .call_type(DelegateCall::new(delegate_code.unwrap())) + .delegate(delegate_code.unwrap()) .call_flags( ink::env::CallFlags::default() // We don't plan to use the input data after the delegated call, so the @@ -197,7 +197,7 @@ where default fn _init_call(&self, call: InitCall) -> ! { ink::env::call::build_call::() - .call_type(DelegateCall::new(call.hash)) + .delegate(call.hash) .exec_input(ExecutionInput::new(InkSelector::new(call.selector)).push_arg(call.input)) .call_flags(ink::env::CallFlags::default() // We don't plan to return back to that contract after execution, so we diff --git a/contracts/src/upgradeability/proxy/mod.rs b/contracts/src/upgradeability/proxy/mod.rs index 442892b98..4012a9884 100644 --- a/contracts/src/upgradeability/proxy/mod.rs +++ b/contracts/src/upgradeability/proxy/mod.rs @@ -39,6 +39,7 @@ use openbrush::{ traits::{ Hash, Storage, + StorageAsRef, }, }; @@ -82,7 +83,7 @@ impl> Internal for T { default fn _fallback(&self) -> ! { ink::env::call::build_call::() - .call_type(DelegateCall::new(self.data().forward_to.clone())) + .delegate(self.data().forward_to.clone()) .call_flags( ink::env::CallFlags::default() // We don't plan to use the input data after the delegated call, so the diff --git a/example_project_structure/impls/lending/data.rs b/example_project_structure/impls/lending/data.rs index afd4e9636..4c666f51e 100644 --- a/example_project_structure/impls/lending/data.rs +++ b/example_project_structure/impls/lending/data.rs @@ -52,13 +52,8 @@ pub struct Data { impl Default for Data { fn default() -> Self { Self { - assets_lended: Default::default(), - asset_shares: Default::default(), - shares_asset: Default::default(), - collateral_accepted: Default::default(), - asset_price: Default::default(), - shares_contract_code_hash: Hash::default(), loan_account: [0u8; 32].into(), + ..Default::default() } } } diff --git a/example_project_structure/traits/loan.rs b/example_project_structure/traits/loan.rs index a882fe3e2..51ee13b63 100644 --- a/example_project_structure/traits/loan.rs +++ b/example_project_structure/traits/loan.rs @@ -34,12 +34,8 @@ impl Default for LoanInfo { Self { borrower: [0u8; 32].into(), collateral_token: [0u8; 32].into(), - collateral_amount: Balance::default(), borrow_token: [0u8; 32].into(), - borrow_amount: Balance::default(), - liquidation_price: Balance::default(), - timestamp: Timestamp::default(), - liquidated: false, + ..Defalt::default() } } } diff --git a/examples/psp22/lib.rs b/examples/psp22/lib.rs index 3afa94dee..a9f63b7ec 100644 --- a/examples/psp22/lib.rs +++ b/examples/psp22/lib.rs @@ -20,15 +20,6 @@ pub mod my_psp22 { hated_account: AccountId, } - impl Default for Contract { - fn default() -> Self { - Self { - psp22: Default::default(), - hated_account: [0u8; 32].into(), - } - } - } - impl Transfer for Contract { // Let's override method to reject transactions to bad account fn _before_token_transfer( @@ -49,7 +40,10 @@ pub mod my_psp22 { impl Contract { #[ink(constructor)] pub fn new(total_supply: Balance) -> Self { - let mut instance = Self::default(); + let mut instance = Self { + psp22: Default::default(), + hated_account: [0u8; 32].into(), + }; instance ._mint_to(Self::env().caller(), total_supply) diff --git a/lang/codegen/src/trait_definition.rs b/lang/codegen/src/trait_definition.rs index e6f4bbfc0..b8885e6b0 100644 --- a/lang/codegen/src/trait_definition.rs +++ b/lang/codegen/src/trait_definition.rs @@ -244,7 +244,6 @@ fn generate_wrapper(ink_trait: ItemTrait) -> proc_macro2::TokenStream { #[inline] fn #message_builder_ident( & self - #( , #input_bindings : #input_types )* ) -> ::ink::env::call::CallBuilder< ::ink::env::DefaultEnvironment, From 425f1f3b7679c2363dc2bc3eb09a506465adbc2a Mon Sep 17 00:00:00 2001 From: Artemka374 Date: Thu, 2 Feb 2023 18:57:12 +0200 Subject: [PATCH 14/14] fix bugs --- contracts/src/traits/timelock_controller/mod.rs | 5 ++++- contracts/src/upgradeability/diamond/diamond.rs | 1 - contracts/src/upgradeability/proxy/mod.rs | 2 -- example_project_structure/impls/lending/data.rs | 7 ++++++- example_project_structure/traits/loan.rs | 6 +++++- 5 files changed, 15 insertions(+), 6 deletions(-) diff --git a/contracts/src/traits/timelock_controller/mod.rs b/contracts/src/traits/timelock_controller/mod.rs index 6ca457d81..958c0ec17 100644 --- a/contracts/src/traits/timelock_controller/mod.rs +++ b/contracts/src/traits/timelock_controller/mod.rs @@ -54,7 +54,10 @@ impl Default for Transaction { fn default() -> Self { Self { callee: ZERO_ADDRESS.into(), - ..Default::default() + selector: Default::default(), + input: Default::default(), + transferred_value: Default::default(), + gas_limit: Default::default(), } } } diff --git a/contracts/src/upgradeability/diamond/diamond.rs b/contracts/src/upgradeability/diamond/diamond.rs index 2992d8a4a..ef772e40b 100644 --- a/contracts/src/upgradeability/diamond/diamond.rs +++ b/contracts/src/upgradeability/diamond/diamond.rs @@ -35,7 +35,6 @@ pub use ownable::Internal as _; use ink::{ env::call::{ - DelegateCall, ExecutionInput, Selector as InkSelector, }, diff --git a/contracts/src/upgradeability/proxy/mod.rs b/contracts/src/upgradeability/proxy/mod.rs index 4012a9884..edeeb0be5 100644 --- a/contracts/src/upgradeability/proxy/mod.rs +++ b/contracts/src/upgradeability/proxy/mod.rs @@ -33,13 +33,11 @@ pub use crate::{ pub use ownable::Internal as _; pub use proxy::Internal as _; -use ink::env::call::DelegateCall; use openbrush::{ modifiers, traits::{ Hash, Storage, - StorageAsRef, }, }; diff --git a/example_project_structure/impls/lending/data.rs b/example_project_structure/impls/lending/data.rs index 4c666f51e..afd4e9636 100644 --- a/example_project_structure/impls/lending/data.rs +++ b/example_project_structure/impls/lending/data.rs @@ -52,8 +52,13 @@ pub struct Data { impl Default for Data { fn default() -> Self { Self { + assets_lended: Default::default(), + asset_shares: Default::default(), + shares_asset: Default::default(), + collateral_accepted: Default::default(), + asset_price: Default::default(), + shares_contract_code_hash: Hash::default(), loan_account: [0u8; 32].into(), - ..Default::default() } } } diff --git a/example_project_structure/traits/loan.rs b/example_project_structure/traits/loan.rs index 51ee13b63..a882fe3e2 100644 --- a/example_project_structure/traits/loan.rs +++ b/example_project_structure/traits/loan.rs @@ -34,8 +34,12 @@ impl Default for LoanInfo { Self { borrower: [0u8; 32].into(), collateral_token: [0u8; 32].into(), + collateral_amount: Balance::default(), borrow_token: [0u8; 32].into(), - ..Defalt::default() + borrow_amount: Balance::default(), + liquidation_price: Balance::default(), + timestamp: Timestamp::default(), + liquidated: false, } } }