Repository: paritytech/ink
Pull request #513 (2020-10-08 15:27:15)

Rename EnvTypes -> Env (and many other renamings)
Best to review commit by commit.


Patch:
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 098133cb22..fc85e4fda0 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -17,7 +17,7 @@ variables:
   CARGO_INCREMENTAL:               0
   CARGO_HOME:                      "/ci-cache/${CI_PROJECT_NAME}/cargo/${CI_JOB_NAME}"
   CARGO_TARGET_DIR:                "/ci-cache/${CI_PROJECT_NAME}/targets/${CI_COMMIT_REF_NAME}/${CI_JOB_NAME}"
-  ALL_CRATES:                      "env storage storage/derive alloc prelude primitives lang lang/macro lang/ir"
+  ALL_CRATES:                      "env storage storage/derive allocator prelude primitives lang lang/macro lang/ir"
 
 workflow:
   rules:
diff --git a/Cargo.toml b/Cargo.toml
index 176aa66d39..554092d4a5 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,7 +1,7 @@
 [workspace]
 members = [
     "crates/metadata",
-    "crates/alloc",
+    "crates/allocator",
     "crates/lang",
     "crates/lang/macro",
     "crates/lang/ir",
diff --git a/crates/alloc/Cargo.toml b/crates/allocator/Cargo.toml
similarity index 96%
rename from crates/alloc/Cargo.toml
rename to crates/allocator/Cargo.toml
index 5cc19cd857..4d686d20cf 100644
--- a/crates/alloc/Cargo.toml
+++ b/crates/allocator/Cargo.toml
@@ -1,5 +1,5 @@
 [package]
-name = "ink_alloc"
+name = "ink_allocator"
 version = "3.0.0"
 authors = ["Parity Technologies <admin@parity.io>"]
 edition = "2018"
diff --git a/crates/alloc/LICENSE b/crates/allocator/LICENSE
similarity index 100%
rename from crates/alloc/LICENSE
rename to crates/allocator/LICENSE
diff --git a/crates/alloc/README.md b/crates/allocator/README.md
similarity index 100%
rename from crates/alloc/README.md
rename to crates/allocator/README.md
diff --git a/crates/alloc/src/handlers.rs b/crates/allocator/src/handlers.rs
similarity index 100%
rename from crates/alloc/src/handlers.rs
rename to crates/allocator/src/handlers.rs
diff --git a/crates/alloc/src/lib.rs b/crates/allocator/src/lib.rs
similarity index 100%
rename from crates/alloc/src/lib.rs
rename to crates/allocator/src/lib.rs
diff --git a/crates/env/Cargo.toml b/crates/env/Cargo.toml
index 80ef9d56ec..3c18d53a0a 100644
--- a/crates/env/Cargo.toml
+++ b/crates/env/Cargo.toml
@@ -16,14 +16,14 @@ include = ["Cargo.toml", "src/**/*.rs", "README.md", "LICENSE"]
 
 [dependencies]
 ink_metadata = { version = "3.0.0", path = "../metadata/", default-features = false, features = ["derive"], optional = true }
-ink_alloc = { version = "3.0.0", path = "../alloc/", default-features = false }
+ink_allocator = { version = "3.0.0", path = "../allocator/", default-features = false }
 ink_primitives = { version = "3.0.0", path = "../primitives/", default-features = false }
 ink_prelude = { version = "3.0.0", path = "../prelude/", default-features = false }
 
 scale = { package = "parity-scale-codec", version = "1.3", default-features = false, features = ["derive", "full"] }
 derive_more = { version = "0.99", default-features = false, features = ["from", "display"] }
 num-traits = { version = "0.2", default-features = false, features = ["i128"] }
-cfg-if = "0.1"
+cfg-if = "1.0"
 paste = "1.0"
 arrayref = "0.3"
 static_assertions = "1.1"
@@ -46,7 +46,7 @@ default = ["std"]
 std = [
     "ink_metadata",
     "ink_metadata/std",
-    "ink_alloc/std",
+    "ink_allocator/std",
     "ink_prelude/std",
     "ink_primitives/std",
     "scale/std",
diff --git a/crates/env/src/api.rs b/crates/env/src/api.rs
index bef2df5777..5ac2f3f369 100644
--- a/crates/env/src/api.rs
+++ b/crates/env/src/api.rs
@@ -16,9 +16,9 @@
 
 use crate::{
     backend::{
-        Env,
+        EnvBackend,
         ReturnFlags,
-        TypedEnv,
+        TypedEnvBackend,
     },
     call::{
         utils::ReturnType,
@@ -34,7 +34,7 @@ use crate::{
         HashOutput,
     },
     topics::Topics,
-    EnvTypes,
+    Environment,
     Result,
 };
 use ink_primitives::Key;
@@ -46,9 +46,11 @@ use ink_primitives::Key;
 /// If the returned caller cannot be properly decoded.
 pub fn caller<T>() -> Result<T::AccountId>
 where
-    T: EnvTypes,
+    T: Environment,
 {
-    <EnvInstance as OnInstance>::on_instance(|instance| TypedEnv::caller::<T>(instance))
+    <EnvInstance as OnInstance>::on_instance(|instance| {
+        TypedEnvBackend::caller::<T>(instance)
+    })
 }
 
 /// Returns the transferred balance for the contract execution.
@@ -58,10 +60,10 @@ where
 /// If the returned value cannot be properly decoded.
 pub fn transferred_balance<T>() -> Result<T::Balance>
 where
-    T: EnvTypes,
+    T: Environment,
 {
     <EnvInstance as OnInstance>::on_instance(|instance| {
-        TypedEnv::transferred_balance::<T>(instance)
+        TypedEnvBackend::transferred_balance::<T>(instance)
     })
 }
 
@@ -72,10 +74,10 @@ where
 /// If the returned value cannot be properly decoded.
 pub fn weight_to_fee<T>(gas: u64) -> Result<T::Balance>
 where
-    T: EnvTypes,
+    T: Environment,
 {
     <EnvInstance as OnInstance>::on_instance(|instance| {
-        TypedEnv::weight_to_fee::<T>(instance, gas)
+        TypedEnvBackend::weight_to_fee::<T>(instance, gas)
     })
 }
 
@@ -86,9 +88,11 @@ where
 /// If the returned value cannot be properly decoded.
 pub fn gas_left<T>() -> Result<T::Balance>
 where
-    T: EnvTypes,
+    T: Environment,
 {
-    <EnvInstance as OnInstance>::on_instance(|instance| TypedEnv::gas_left::<T>(instance))
+    <EnvInstance as OnInstance>::on_instance(|instance| {
+        TypedEnvBackend::gas_left::<T>(instance)
+    })
 }
 
 /// Returns the current block timestamp.
@@ -98,10 +102,10 @@ where
 /// If the returned value cannot be properly decoded.
 pub fn block_timestamp<T>() -> Result<T::Timestamp>
 where
-    T: EnvTypes,
+    T: Environment,
 {
     <EnvInstance as OnInstance>::on_instance(|instance| {
-        TypedEnv::block_timestamp::<T>(instance)
+        TypedEnvBackend::block_timestamp::<T>(instance)
     })
 }
 
@@ -116,10 +120,10 @@ where
 /// If the returned value cannot be properly decoded.
 pub fn account_id<T>() -> Result<T::AccountId>
 where
-    T: EnvTypes,
+    T: Environment,
 {
     <EnvInstance as OnInstance>::on_instance(|instance| {
-        TypedEnv::account_id::<T>(instance)
+        TypedEnvBackend::account_id::<T>(instance)
     })
 }
 
@@ -130,9 +134,11 @@ where
 /// If the returned value cannot be properly decoded.
 pub fn balance<T>() -> Result<T::Balance>
 where
-    T: EnvTypes,
+    T: Environment,
 {
-    <EnvInstance as OnInstance>::on_instance(|instance| TypedEnv::balance::<T>(instance))
+    <EnvInstance as OnInstance>::on_instance(|instance| {
+        TypedEnvBackend::balance::<T>(instance)
+    })
 }
 
 /// Returns the current rent allowance for the executed contract.
@@ -142,10 +148,10 @@ where
 /// If the returned value cannot be properly decoded.
 pub fn rent_allowance<T>() -> Result<T::Balance>
 where
-    T: EnvTypes,
+    T: Environment,
 {
     <EnvInstance as OnInstance>::on_instance(|instance| {
-        TypedEnv::rent_allowance::<T>(instance)
+        TypedEnvBackend::rent_allowance::<T>(instance)
     })
 }
 
@@ -156,10 +162,10 @@ where
 /// If the returned value cannot be properly decoded.
 pub fn block_number<T>() -> Result<T::BlockNumber>
 where
-    T: EnvTypes,
+    T: Environment,
 {
     <EnvInstance as OnInstance>::on_instance(|instance| {
-        TypedEnv::block_number::<T>(instance)
+        TypedEnvBackend::block_number::<T>(instance)
     })
 }
 
@@ -170,10 +176,10 @@ where
 /// If the returned value cannot be properly decoded.
 pub fn minimum_balance<T>() -> Result<T::Balance>
 where
-    T: EnvTypes,
+    T: Environment,
 {
     <EnvInstance as OnInstance>::on_instance(|instance| {
-        TypedEnv::minimum_balance::<T>(instance)
+        TypedEnvBackend::minimum_balance::<T>(instance)
     })
 }
 
@@ -184,31 +190,31 @@ where
 /// If the returned value cannot be properly decoded.
 pub fn tombstone_deposit<T>() -> Result<T::Balance>
 where
-    T: EnvTypes,
+    T: Environment,
 {
     <EnvInstance as OnInstance>::on_instance(|instance| {
-        TypedEnv::tombstone_deposit::<T>(instance)
+        TypedEnvBackend::tombstone_deposit::<T>(instance)
     })
 }
 
 /// Emits an event with the given event data.
 pub fn emit_event<T, Event>(event: Event)
 where
-    T: EnvTypes,
+    T: Environment,
     Event: Topics + scale::Encode,
 {
     <EnvInstance as OnInstance>::on_instance(|instance| {
-        TypedEnv::emit_event::<T, Event>(instance, event)
+        TypedEnvBackend::emit_event::<T, Event>(instance, event)
     })
 }
 
 /// Sets the rent allowance of the executed contract to the new value.
 pub fn set_rent_allowance<T>(new_value: T::Balance)
 where
-    T: EnvTypes,
+    T: Environment,
 {
     <EnvInstance as OnInstance>::on_instance(|instance| {
-        TypedEnv::set_rent_allowance::<T>(instance, new_value)
+        TypedEnvBackend::set_rent_allowance::<T>(instance, new_value)
     })
 }
 
@@ -222,7 +228,7 @@ where
     V: scale::Encode,
 {
     <EnvInstance as OnInstance>::on_instance(|instance| {
-        Env::set_contract_storage::<V>(instance, key, value)
+        EnvBackend::set_contract_storage::<V>(instance, key, value)
     })
 }
 
@@ -236,14 +242,14 @@ where
     R: scale::Decode,
 {
     <EnvInstance as OnInstance>::on_instance(|instance| {
-        Env::get_contract_storage::<R>(instance, key)
+        EnvBackend::get_contract_storage::<R>(instance, key)
     })
 }
 
 /// Clears the contract's storage key entry.
 pub fn clear_contract_storage(key: &Key) {
     <EnvInstance as OnInstance>::on_instance(|instance| {
-        Env::clear_contract_storage(instance, key)
+        EnvBackend::clear_contract_storage(instance, key)
     })
 }
 
@@ -266,11 +272,11 @@ pub fn clear_contract_storage(key: &Key) {
 /// - If the called contract ran out of gas upon execution.
 pub fn invoke_contract<T, Args>(params: &CallParams<T, Args, ()>) -> Result<()>
 where
-    T: EnvTypes,
+    T: Environment,
     Args: scale::Encode,
 {
     <EnvInstance as OnInstance>::on_instance(|instance| {
-        TypedEnv::invoke_contract::<T, Args>(instance, params)
+        TypedEnvBackend::invoke_contract::<T, Args>(instance, params)
     })
 }
 
@@ -292,12 +298,12 @@ where
 /// - If the returned value failed to decode properly.
 pub fn eval_contract<T, Args, R>(params: &CallParams<T, Args, ReturnType<R>>) -> Result<R>
 where
-    T: EnvTypes,
+    T: Environment,
     Args: scale::Encode,
     R: scale::Decode,
 {
     <EnvInstance as OnInstance>::on_instance(|instance| {
-        TypedEnv::eval_contract::<T, Args, R>(instance, params)
+        TypedEnvBackend::eval_contract::<T, Args, R>(instance, params)
     })
 }
 
@@ -320,11 +326,11 @@ pub fn instantiate_contract<T, Args, C>(
     params: &CreateParams<T, Args, C>,
 ) -> Result<T::AccountId>
 where
-    T: EnvTypes,
+    T: Environment,
     Args: scale::Encode,
 {
     <EnvInstance as OnInstance>::on_instance(|instance| {
-        TypedEnv::instantiate_contract::<T, Args, C>(instance, params)
+        TypedEnvBackend::instantiate_contract::<T, Args, C>(instance, params)
     })
 }
 
@@ -376,10 +382,10 @@ pub fn restore_contract<T>(
     rent_allowance: T::Balance,
     filtered_keys: &[Key],
 ) where
-    T: EnvTypes,
+    T: Environment,
 {
     <EnvInstance as OnInstance>::on_instance(|instance| {
-        TypedEnv::restore_contract::<T>(
+        TypedEnvBackend::restore_contract::<T>(
             instance,
             account_id,
             code_hash,
@@ -401,10 +407,10 @@ pub fn restore_contract<T>(
 /// which is considered fatal and results in a trap + rollback.
 pub fn terminate_contract<T>(beneficiary: T::AccountId) -> !
 where
-    T: EnvTypes,
+    T: Environment,
 {
     <EnvInstance as OnInstance>::on_instance(|instance| {
-        TypedEnv::terminate_contract::<T>(instance, beneficiary)
+        TypedEnvBackend::terminate_contract::<T>(instance, beneficiary)
     })
 }
 
@@ -421,10 +427,10 @@ where
 /// If the contract doesn't have sufficient funds.
 pub fn transfer<T>(destination: T::AccountId, value: T::Balance) -> Result<()>
 where
-    T: EnvTypes,
+    T: Environment,
 {
     <EnvInstance as OnInstance>::on_instance(|instance| {
-        TypedEnv::transfer::<T>(instance, destination, value)
+        TypedEnvBackend::transfer::<T>(instance, destination, value)
     })
 }
 
@@ -445,7 +451,7 @@ where
     O: scale::Codec + 'static,
 {
     <EnvInstance as OnInstance>::on_instance(|instance| {
-        Env::call_chain_extension(instance, func_id, input)
+        EnvBackend::call_chain_extension(instance, func_id, input)
     })
 }
 
@@ -476,7 +482,9 @@ pub fn decode_input<T>() -> Result<T>
 where
     T: scale::Decode,
 {
-    <EnvInstance as OnInstance>::on_instance(|instance| Env::decode_input::<T>(instance))
+    <EnvInstance as OnInstance>::on_instance(|instance| {
+        EnvBackend::decode_input::<T>(instance)
+    })
 }
 
 /// Returns the value back to the caller of the executed contract.
@@ -489,7 +497,7 @@ where
     R: scale::Encode,
 {
     <EnvInstance as OnInstance>::on_instance(|instance| {
-        Env::return_value::<R>(instance, return_flags, return_value)
+        EnvBackend::return_value::<R>(instance, return_flags, return_value)
     })
 }
 
@@ -505,16 +513,18 @@ where
 /// If the returned value cannot be properly decoded.
 pub fn random<T>(subject: &[u8]) -> Result<T::Hash>
 where
-    T: EnvTypes,
+    T: Environment,
 {
     <EnvInstance as OnInstance>::on_instance(|instance| {
-        TypedEnv::random::<T>(instance, subject)
+        TypedEnvBackend::random::<T>(instance, subject)
     })
 }
 
 /// Prints the given contents to the environmental log.
 pub fn debug_println(content: &str) {
-    <EnvInstance as OnInstance>::on_instance(|instance| Env::println(instance, content))
+    <EnvInstance as OnInstance>::on_instance(|instance| {
+        EnvBackend::println(instance, content)
+    })
 }
 
 /// Conducts the crypto hash of the given input and stores the result in `output`.
diff --git a/crates/env/src/backend.rs b/crates/env/src/backend.rs
index d4ceaa93a1..c013b8c859 100644
--- a/crates/env/src/backend.rs
+++ b/crates/env/src/backend.rs
@@ -23,7 +23,7 @@ use crate::{
         HashOutput,
     },
     topics::Topics,
-    EnvTypes,
+    Environment,
     Result,
 };
 use ink_primitives::Key;
@@ -55,8 +55,8 @@ impl ReturnFlags {
     }
 }
 
-/// Environmental contract functionality that does not require `EnvTypes`.
-pub trait Env {
+/// Environmental contract functionality that does not require `Environment`.
+pub trait EnvBackend {
     /// Writes the value to the contract storage under the given key.
     fn set_contract_storage<V>(&mut self, key: &Key, value: &V)
     where
@@ -146,83 +146,83 @@ pub trait Env {
 }
 
 /// Environmental contract functionality.
-pub trait TypedEnv: Env {
+pub trait TypedEnvBackend: EnvBackend {
     /// Returns the address of the caller of the executed contract.
     ///
     /// # Note
     ///
     /// For more details visit: [`ink_env::caller`]
-    fn caller<T: EnvTypes>(&mut self) -> Result<T::AccountId>;
+    fn caller<T: Environment>(&mut self) -> Result<T::AccountId>;
 
     /// Returns the transferred balance for the contract execution.
     ///
     /// # Note
     ///
     /// For more details visit: [`ink_env::transferred_balance`]
-    fn transferred_balance<T: EnvTypes>(&mut self) -> Result<T::Balance>;
+    fn transferred_balance<T: Environment>(&mut self) -> Result<T::Balance>;
 
     /// Returns the price for the specified amount of gas.
     ///
     /// # Note
     ///
     /// For more details visit: [`ink_env::gas_price`]
-    fn weight_to_fee<T: EnvTypes>(&mut self, gas: u64) -> Result<T::Balance>;
+    fn weight_to_fee<T: Environment>(&mut self, gas: u64) -> Result<T::Balance>;
 
     /// Returns the amount of gas left for the contract execution.
     ///
     /// # Note
     ///
     /// For more details visit: [`ink_env::gas_left`]
-    fn gas_left<T: EnvTypes>(&mut self) -> Result<T::Balance>;
+    fn gas_left<T: Environment>(&mut self) -> Result<T::Balance>;
 
     /// Returns the timestamp of the current block.
     ///
     /// # Note
     ///
     /// For more details visit: [`ink_env::block_timestamp`]
-    fn block_timestamp<T: EnvTypes>(&mut self) -> Result<T::Timestamp>;
+    fn block_timestamp<T: Environment>(&mut self) -> Result<T::Timestamp>;
 
     /// Returns the address of the executed contract.
     ///
     /// # Note
     ///
     /// For more details visit: [`ink_env::account_id`]
-    fn account_id<T: EnvTypes>(&mut self) -> Result<T::AccountId>;
+    fn account_id<T: Environment>(&mut self) -> Result<T::AccountId>;
 
     /// Returns the balance of the executed contract.
     ///
     /// # Note
     ///
     /// For more details visit: [`ink_env::balance`]
-    fn balance<T: EnvTypes>(&mut self) -> Result<T::Balance>;
+    fn balance<T: Environment>(&mut self) -> Result<T::Balance>;
 
     /// Returns the current rent allowance for the executed contract.
     ///
     /// # Note
     ///
     /// For more details visit: [`ink_env::rent_allowance`]
-    fn rent_allowance<T: EnvTypes>(&mut self) -> Result<T::Balance>;
+    fn rent_allowance<T: Environment>(&mut self) -> Result<T::Balance>;
 
     /// Returns the current block number.
     ///
     /// # Note
     ///
     /// For more details visit: [`ink_env::block_number`]
-    fn block_number<T: EnvTypes>(&mut self) -> Result<T::BlockNumber>;
+    fn block_number<T: Environment>(&mut self) -> Result<T::BlockNumber>;
 
     /// Returns the minimum balance of the contracts chain.
     ///
     /// # Note
     ///
     /// For more details visit: [`ink_env::minimum_balance`]
-    fn minimum_balance<T: EnvTypes>(&mut self) -> Result<T::Balance>;
+    fn minimum_balance<T: Environment>(&mut self) -> Result<T::Balance>;
 
     /// Returns the tombstone deposit of the contract chain.
     ///
     /// # Note
     ///
     /// For more details visit: [`ink_env::tombstone_deposit`]
-    fn tombstone_deposit<T: EnvTypes>(&mut self) -> Result<T::Balance>;
+    fn tombstone_deposit<T: Environment>(&mut self) -> Result<T::Balance>;
 
     /// Emits an event with the given event data.
     ///
@@ -231,7 +231,7 @@ pub trait TypedEnv: Env {
     /// For more details visit: [`ink_env::emit_event`]
     fn emit_event<T, Event>(&mut self, event: Event)
     where
-        T: EnvTypes,
+        T: Environment,
         Event: Topics + scale::Encode;
 
     /// Sets the rent allowance of the executed contract to the new value.
@@ -241,7 +241,7 @@ pub trait TypedEnv: Env {
     /// For more details visit: [`ink_env::set_rent_allowance`]
     fn set_rent_allowance<T>(&mut self, new_value: T::Balance)
     where
-        T: EnvTypes;
+        T: Environment;
 
     /// Invokes a contract message.
     ///
@@ -253,7 +253,7 @@ pub trait TypedEnv: Env {
         call_data: &CallParams<T, Args, ()>,
     ) -> Result<()>
     where
-        T: EnvTypes,
+        T: Environment,
         Args: scale::Encode;
 
     /// Evaluates a contract message and returns its result.
@@ -266,7 +266,7 @@ pub trait TypedEnv: Env {
         call_data: &CallParams<T, Args, ReturnType<R>>,
     ) -> Result<R>
     where
-        T: EnvTypes,
+        T: Environment,
         Args: scale::Encode,
         R: scale::Decode;
 
@@ -280,7 +280,7 @@ pub trait TypedEnv: Env {
         params: &CreateParams<T, Args, C>,
     ) -> Result<T::AccountId>
     where
-        T: EnvTypes,
+        T: Environment,
         Args: scale::Encode;
 
     /// Restores a smart contract tombstone.
@@ -295,7 +295,7 @@ pub trait TypedEnv: Env {
         rent_allowance: T::Balance,
         filtered_keys: &[Key],
     ) where
-        T: EnvTypes;
+        T: Environment;
 
     /// Terminates a smart contract.
     ///
@@ -304,7 +304,7 @@ pub trait TypedEnv: Env {
     /// For more details visit: [`ink_env::terminate_contract`]
     fn terminate_contract<T>(&mut self, beneficiary: T::AccountId) -> !
     where
-        T: EnvTypes;
+        T: Environment;
 
     /// Transfers value from the contract to the destination account ID.
     ///
@@ -313,7 +313,7 @@ pub trait TypedEnv: Env {
     /// For more details visit: [`ink_env::transfer`]
     fn transfer<T>(&mut self, destination: T::AccountId, value: T::Balance) -> Result<()>
     where
-        T: EnvTypes;
+        T: Environment;
 
     /// Returns a random hash seed.
     ///
@@ -322,5 +322,5 @@ pub trait TypedEnv: Env {
     /// For more details visit: [`ink_env::random`]
     fn random<T>(&mut self, subject: &[u8]) -> Result<T::Hash>
     where
-        T: EnvTypes;
+        T: Environment;
 }
diff --git a/crates/env/src/call/call_builder.rs b/crates/env/src/call/call_builder.rs
index 21ac00b8cd..8b4ff770d2 100644
--- a/crates/env/src/call/call_builder.rs
+++ b/crates/env/src/call/call_builder.rs
@@ -23,8 +23,8 @@ use crate::{
         },
         ExecutionInput,
     },
-    EnvError,
-    EnvTypes,
+    Environment,
+    Error,
 };
 use core::marker::PhantomData;
 
@@ -32,7 +32,7 @@ use core::marker::PhantomData;
 #[derive(Debug)]
 pub struct CallParams<E, Args, R>
 where
-    E: EnvTypes,
+    E: Environment,
 {
     /// The account ID of the to-be-called smart contract.
     callee: E::AccountId,
@@ -54,7 +54,7 @@ where
 )]
 impl<E, Args, R> CallParams<E, Args, R>
 where
-    E: EnvTypes,
+    E: Environment,
 {
     /// Returns the account ID of the called contract instance.
     #[inline]
@@ -83,7 +83,7 @@ where
 
 impl<E, Args> CallParams<E, Args, ()>
 where
-    E: EnvTypes,
+    E: Environment,
     Args: scale::Encode,
 {
     /// Invokes the contract with the given built-up call parameters.
@@ -92,14 +92,14 @@ where
     ///
     /// Prefer [`invoke`](`Self::invoke`) over [`eval`](`Self::eval`) if the
     /// called contract message does not return anything because it is more efficient.
-    pub fn invoke(&self) -> Result<(), crate::EnvError> {
+    pub fn invoke(&self) -> Result<(), crate::Error> {
         crate::invoke_contract(self)
     }
 }
 
 impl<E, Args, R> CallParams<E, Args, ReturnType<R>>
 where
-    E: EnvTypes,
+    E: Environment,
     Args: scale::Encode,
     R: scale::Decode,
 {
@@ -111,7 +111,7 @@ where
     ///
     /// Prefer [`invoke`](`Self::invoke`) over [`eval`](`Self::eval`) if the
     /// called contract message does not return anything because it is more efficient.
-    pub fn eval(&self) -> Result<R, crate::EnvError> {
+    pub fn eval(&self) -> Result<R, crate::Error> {
         crate::eval_contract(self)
     }
 }
@@ -139,12 +139,12 @@ where
 ///
 /// ```should_panic
 /// # use ::ink_env::{
-/// #     EnvTypes,
-/// #     DefaultEnvTypes,
+/// #     Environment,
+/// #     DefaultEnvironment,
 /// #     call::{build_call, Selector, ExecutionInput}
 /// # };
-/// # type AccountId = <DefaultEnvTypes as EnvTypes>::AccountId;
-/// build_call::<DefaultEnvTypes>()
+/// # type AccountId = <DefaultEnvironment as Environment>::AccountId;
+/// build_call::<DefaultEnvironment>()
 ///     .callee(AccountId::from([0x42; 32]))
 ///     .gas_limit(5000)
 ///     .transferred_value(10)
@@ -174,12 +174,12 @@ where
 ///
 /// ```should_panic
 /// # use ::ink_env::{
-/// #     EnvTypes,
-/// #     DefaultEnvTypes,
+/// #     Environment,
+/// #     DefaultEnvironment,
 /// #     call::{build_call, Selector, ExecutionInput, utils::ReturnType},
 /// # };
-/// # type AccountId = <DefaultEnvTypes as EnvTypes>::AccountId;
-/// let my_return_value: i32 = build_call::<DefaultEnvTypes>()
+/// # type AccountId = <DefaultEnvironment as Environment>::AccountId;
+/// let my_return_value: i32 = build_call::<DefaultEnvironment>()
 ///     .callee(AccountId::from([0x42; 32]))
 ///     .gas_limit(5000)
 ///     .transferred_value(10)
@@ -203,7 +203,7 @@ pub fn build_call<E>() -> CallBuilder<
     Unset<ReturnType<()>>,
 >
 where
-    E: EnvTypes,
+    E: Environment,
 {
     CallBuilder {
         env_types: Default::default(),
@@ -218,7 +218,7 @@ where
 /// Builds up a cross contract call.
 pub struct CallBuilder<E, Callee, GasLimit, TransferredValue, Args, RetType>
 where
-    E: EnvTypes,
+    E: Environment,
 {
     env_types: PhantomData<fn() -> E>,
     /// The current parameters that have been built up so far.
@@ -232,7 +232,7 @@ where
 impl<E, GasLimit, TransferredValue, Args, RetType>
     CallBuilder<E, Unset<E::AccountId>, GasLimit, TransferredValue, Args, RetType>
 where
-    E: EnvTypes,
+    E: Environment,
 {
     /// Sets the called smart contract instance account ID to the given value.
     #[inline]
@@ -255,7 +255,7 @@ where
 impl<E, Callee, TransferredValue, Args, RetType>
     CallBuilder<E, Callee, Unset<u64>, TransferredValue, Args, RetType>
 where
-    E: EnvTypes,
+    E: Environment,
 {
     /// Sets the maximumly allowed gas costs for the call.
     #[inline]
@@ -277,7 +277,7 @@ where
 impl<E, Callee, GasLimit, Args, RetType>
     CallBuilder<E, Callee, GasLimit, Unset<E::Balance>, Args, RetType>
 where
-    E: EnvTypes,
+    E: Environment,
 {
     /// Sets the value transferred upon the execution of the call.
     #[inline]
@@ -310,7 +310,7 @@ impl<T> IndicateReturnType for ReturnType<T> {}
 impl<E, Callee, GasLimit, TransferredValue, Args>
     CallBuilder<E, Callee, GasLimit, TransferredValue, Args, Unset<ReturnType<()>>>
 where
-    E: EnvTypes,
+    E: Environment,
 {
     /// Sets the type of the returned value upon the execution of the call.
     ///
@@ -347,7 +347,7 @@ impl<E, Callee, GasLimit, TransferredValue, RetType>
         RetType,
     >
 where
-    E: EnvTypes,
+    E: Environment,
 {
     /// Sets the execution input to the given value.
     pub fn exec_input<Args>(
@@ -382,7 +382,7 @@ impl<E, GasLimit, TransferredValue, Args, RetType>
         Set<RetType>,
     >
 where
-    E: EnvTypes,
+    E: Environment,
     GasLimit: Unwrap<Output = u64>,
     TransferredValue: Unwrap<Output = E::Balance>,
 {
@@ -410,13 +410,13 @@ impl<E, GasLimit, TransferredValue, Args>
         Set<()>,
     >
 where
-    E: EnvTypes,
+    E: Environment,
     GasLimit: Unwrap<Output = u64>,
     Args: scale::Encode,
     TransferredValue: Unwrap<Output = E::Balance>,
 {
     /// Invokes the cross-chain function call.
-    pub fn fire(self) -> Result<(), EnvError> {
+    pub fn fire(self) -> Result<(), Error> {
         self.params().invoke()
     }
 }
@@ -431,14 +431,14 @@ impl<E, GasLimit, TransferredValue, Args, R>
         Set<ReturnType<R>>,
     >
 where
-    E: EnvTypes,
+    E: Environment,
     GasLimit: Unwrap<Output = u64>,
     Args: scale::Encode,
     R: scale::Decode,
     TransferredValue: Unwrap<Output = E::Balance>,
 {
     /// Invokes the cross-chain function call and returns the result.
-    pub fn fire(self) -> Result<R, EnvError> {
+    pub fn fire(self) -> Result<R, Error> {
         self.params().eval()
     }
 }
diff --git a/crates/env/src/call/create_builder.rs b/crates/env/src/call/create_builder.rs
index c7e08a84bd..edaeb2a085 100644
--- a/crates/env/src/call/create_builder.rs
+++ b/crates/env/src/call/create_builder.rs
@@ -23,8 +23,8 @@ use crate::{
         },
         ExecutionInput,
     },
-    EnvError,
-    EnvTypes,
+    Environment,
+    Error,
 };
 use core::marker::PhantomData;
 
@@ -36,17 +36,17 @@ use core::marker::PhantomData;
 /// in the generated code of `ink_lang`.
 pub trait FromAccountId<T>
 where
-    T: EnvTypes,
+    T: Environment,
 {
     /// Creates the contract instance from the account ID of the already instantiated contract.
-    fn from_account_id(account_id: <T as EnvTypes>::AccountId) -> Self;
+    fn from_account_id(account_id: <T as Environment>::AccountId) -> Self;
 }
 
 /// Builds up contract instantiations.
 #[derive(Debug)]
 pub struct CreateParams<E, Args, R>
 where
-    E: EnvTypes,
+    E: Environment,
 {
     /// The code hash of the created contract.
     code_hash: E::Hash,
@@ -68,7 +68,7 @@ where
 )]
 impl<E, Args, R> CreateParams<E, Args, R>
 where
-    E: EnvTypes,
+    E: Environment,
 {
     /// The code hash of the contract.
     #[inline]
@@ -97,13 +97,13 @@ where
 
 impl<E, Args, R> CreateParams<E, Args, R>
 where
-    E: EnvTypes,
+    E: Environment,
     Args: scale::Encode,
     R: FromAccountId<E>,
 {
     /// Instantiates the contract and returns its account ID back to the caller.
     #[inline]
-    pub fn instantiate(&self) -> Result<R, crate::EnvError> {
+    pub fn instantiate(&self) -> Result<R, crate::Error> {
         crate::instantiate_contract(self).map(FromAccountId::from_account_id)
     }
 }
@@ -111,7 +111,7 @@ where
 /// Builds up contract instantiations.
 pub struct CreateBuilder<E, CodeHash, GasLimit, Endowment, Args, R>
 where
-    E: EnvTypes,
+    E: Environment,
 {
     env_types: PhantomData<fn() -> E>,
     code_hash: CodeHash,
@@ -139,17 +139,17 @@ where
 ///
 /// ```should_panic
 /// # use ::ink_env::{
-/// #     EnvTypes,
-/// #     DefaultEnvTypes,
+/// #     Environment,
+/// #     DefaultEnvironment,
 /// #     call::{build_create, Selector, ExecutionInput, FromAccountId}
 /// # };
-/// # type Hash = <DefaultEnvTypes as EnvTypes>::Hash;
-/// # type AccountId = <DefaultEnvTypes as EnvTypes>::AccountId;
+/// # type Hash = <DefaultEnvironment as Environment>::Hash;
+/// # type AccountId = <DefaultEnvironment as Environment>::AccountId;
 /// # struct MyContract;
-/// # impl FromAccountId<DefaultEnvTypes> for MyContract {
+/// # impl FromAccountId<DefaultEnvironment> for MyContract {
 /// #     fn from_account_id(account_id: AccountId) -> Self { Self }
 /// # }
-/// let my_contract: MyContract = build_create::<DefaultEnvTypes, MyContract>()
+/// let my_contract: MyContract = build_create::<DefaultEnvironment, MyContract>()
 ///     .code_hash(Hash::from([0x42; 32]))
 ///     .gas_limit(4000)
 ///     .endowment(25)
@@ -177,7 +177,7 @@ pub fn build_create<E, R>() -> CreateBuilder<
     R,
 >
 where
-    E: EnvTypes,
+    E: Environment,
     R: FromAccountId<E>,
 {
     CreateBuilder {
@@ -193,7 +193,7 @@ where
 impl<E, GasLimit, Endowment, Args, R>
     CreateBuilder<E, Unset<E::Hash>, GasLimit, Endowment, Args, R>
 where
-    E: EnvTypes,
+    E: Environment,
 {
     /// Sets the used code hash for the contract instantiation.
     #[inline]
@@ -215,7 +215,7 @@ where
 impl<E, CodeHash, Endowment, Args, R>
     CreateBuilder<E, CodeHash, Unset<u64>, Endowment, Args, R>
 where
-    E: EnvTypes,
+    E: Environment,
 {
     /// Sets the maximum allowed gas costs for the contract instantiation.
     #[inline]
@@ -237,7 +237,7 @@ where
 impl<E, CodeHash, GasLimit, Args, R>
     CreateBuilder<E, CodeHash, GasLimit, Unset<E::Balance>, Args, R>
 where
-    E: EnvTypes,
+    E: Environment,
 {
     /// Sets the value transferred upon the execution of the call.
     #[inline]
@@ -266,7 +266,7 @@ impl<E, CodeHash, GasLimit, Endowment, R>
         R,
     >
 where
-    E: EnvTypes,
+    E: Environment,
 {
     /// Sets the value transferred upon the execution of the call.
     #[inline]
@@ -296,7 +296,7 @@ impl<E, GasLimit, Args, R>
         R,
     >
 where
-    E: EnvTypes,
+    E: Environment,
     GasLimit: Unwrap<Output = u64>,
 {
     /// Sets the value transferred upon the execution of the call.
@@ -322,14 +322,14 @@ impl<E, GasLimit, Args, R>
         R,
     >
 where
-    E: EnvTypes,
+    E: Environment,
     GasLimit: Unwrap<Output = u64>,
     Args: scale::Encode,
     R: FromAccountId<E>,
 {
     /// Instantiates the contract using the given instantiation parameters.
     #[inline]
-    pub fn instantiate(self) -> Result<R, EnvError> {
+    pub fn instantiate(self) -> Result<R, Error> {
         self.params().instantiate()
     }
 }
diff --git a/crates/env/src/engine/mod.rs b/crates/env/src/engine/mod.rs
index 96972d4e77..e2959578ca 100644
--- a/crates/env/src/engine/mod.rs
+++ b/crates/env/src/engine/mod.rs
@@ -13,12 +13,12 @@
 // limitations under the License.
 
 use crate::backend::{
-    Env,
-    TypedEnv,
+    EnvBackend,
+    TypedEnvBackend,
 };
 use cfg_if::cfg_if;
 
-pub trait OnInstance: Env + TypedEnv {
+pub trait OnInstance: EnvBackend + TypedEnvBackend {
     fn on_instance<F, R>(f: F) -> R
     where
         F: FnOnce(&mut Self) -> R;
diff --git a/crates/env/src/engine/off_chain/db/accounts.rs b/crates/env/src/engine/off_chain/db/accounts.rs
index 975bea2b2a..cc01273363 100644
--- a/crates/env/src/engine/off_chain/db/accounts.rs
+++ b/crates/env/src/engine/off_chain/db/accounts.rs
@@ -21,8 +21,8 @@ use super::{
     OffBalance,
 };
 use crate::{
-    EnvError,
-    EnvTypes,
+    Environment,
+    Error,
 };
 use core::cell::Cell;
 use derive_more::From;
@@ -39,9 +39,9 @@ pub enum AccountError {
     NoAccountForId(OffAccountId),
 }
 
-impl From<AccountError> for EnvError {
+impl From<AccountError> for Error {
     fn from(account_error: AccountError) -> Self {
-        EnvError::OffChain(OffChainError::Account(account_error))
+        Error::OffChain(OffChainError::Account(account_error))
     }
 }
 
@@ -49,7 +49,7 @@ impl AccountError {
     /// Creates a new error to indicate a missing account.
     pub fn no_account_for_id<T>(account_id: &T::AccountId) -> Self
     where
-        T: EnvTypes,
+        T: Environment,
     {
         Self::NoAccountForId(OffAccountId::new(account_id))
     }
@@ -86,7 +86,7 @@ impl AccountsDb {
     /// Returns the account at the given account ID or creates it.
     pub fn get_or_create_account<T>(&mut self, at: &T::AccountId) -> &mut Account
     where
-        T: EnvTypes,
+        T: Environment,
     {
         // Note: We cannot do a normal match for `Some(account)` here since
         //       the borrow-checker somehow cannot make sense of it according
@@ -105,7 +105,7 @@ impl AccountsDb {
     /// Returns the account for the given account ID if any.
     pub fn get_account<T>(&self, at: &T::AccountId) -> Option<&Account>
     where
-        T: EnvTypes,
+        T: Environment,
     {
         self.accounts.get(&OffAccountId::new(at))
     }
@@ -113,7 +113,7 @@ impl AccountsDb {
     /// Returns the account for the given account ID if any.
     pub fn get_account_mut<T>(&mut self, at: &T::AccountId) -> Option<&mut Account>
     where
-        T: EnvTypes,
+        T: Environment,
     {
         self.accounts.get_mut(&OffAccountId::new(at))
     }
@@ -134,7 +134,7 @@ impl AccountsDb {
         account_id: T::AccountId,
         initial_balance: T::Balance,
     ) where
-        T: EnvTypes,
+        T: Environment,
     {
         self.accounts.insert(
             OffAccountId::new(&account_id),
@@ -152,7 +152,7 @@ impl AccountsDb {
         initial_balance: T::Balance,
         rent_allowance: T::Balance,
     ) where
-        T: EnvTypes,
+        T: Environment,
     {
         self.accounts.insert(
             OffAccountId::new(&account_id),
@@ -176,7 +176,7 @@ impl Account {
     /// Returns the balance of the account.
     pub fn balance<T>(&self) -> Result<T::Balance>
     where
-        T: EnvTypes,
+        T: Environment,
     {
         self.balance.decode().map_err(Into::into)
     }
@@ -184,7 +184,7 @@ impl Account {
     /// Sets the balance of the account.
     pub fn set_balance<T>(&mut self, new_balance: T::Balance) -> Result<()>
     where
-        T: EnvTypes,
+        T: Environment,
     {
         self.balance.assign(&new_balance).map_err(Into::into)
     }
@@ -212,7 +212,7 @@ impl Account {
     /// Returns the rent allowance of the contract account or an error.
     pub fn rent_allowance<T>(&self) -> Result<T::Balance>
     where
-        T: EnvTypes,
+        T: Environment,
     {
         self.contract_or_err()
             .and_then(|contract| contract.rent_allowance.decode().map_err(Into::into))
@@ -221,7 +221,7 @@ impl Account {
     /// Sets the rent allowance for the contract account or returns an error.
     pub fn set_rent_allowance<T>(&mut self, new_rent_allowance: T::Balance) -> Result<()>
     where
-        T: EnvTypes,
+        T: Environment,
     {
         self.contract_or_err_mut().and_then(|contract| {
             contract
@@ -281,7 +281,7 @@ impl ContractAccount {
     /// Creates a new contract account with the given initial rent allowance.
     pub fn new<T>(rent_allowance: T::Balance) -> Self
     where
-        T: EnvTypes,
+        T: Environment,
     {
         Self {
             rent_allowance: OffBalance::new(&rent_allowance),
diff --git a/crates/env/src/engine/off_chain/db/block.rs b/crates/env/src/engine/off_chain/db/block.rs
index 88ee2b1bd5..eaadeabf57 100644
--- a/crates/env/src/engine/off_chain/db/block.rs
+++ b/crates/env/src/engine/off_chain/db/block.rs
@@ -21,7 +21,7 @@ use super::{
     OffHash,
     OffTimestamp,
 };
-use crate::EnvTypes;
+use crate::Environment;
 
 /// An emulated block in the chain.
 pub struct Block {
@@ -42,11 +42,11 @@ impl Block {
     /// Creates a new block for the given number and time stamp.
     pub fn new<T>(number: T::BlockNumber, timestamp: T::Timestamp) -> Self
     where
-        T: EnvTypes,
+        T: Environment,
     {
         use crate::Clear;
         use rand::Rng as _;
-        let mut entropy = <T as EnvTypes>::Hash::clear();
+        let mut entropy = <T as Environment>::Hash::clear();
         rand::thread_rng().fill(entropy.as_mut());
         Self {
             number: TypedEncoded::new(&number),
@@ -58,7 +58,7 @@ impl Block {
     /// Returns the block number.
     pub fn number<T>(&self) -> Result<T::BlockNumber>
     where
-        T: EnvTypes,
+        T: Environment,
     {
         self.number.decode().map_err(Into::into)
     }
@@ -66,7 +66,7 @@ impl Block {
     /// Returns the timestamp of the block.
     pub fn timestamp<T>(&self) -> Result<T::Timestamp>
     where
-        T: EnvTypes,
+        T: Environment,
     {
         self.timestamp.decode().map_err(Into::into)
     }
@@ -79,7 +79,7 @@ impl Block {
     /// in the off-chain environment.
     pub fn set_entropy<T>(&mut self, new_entropy: T::Hash) -> Result<()>
     where
-        T: EnvTypes,
+        T: Environment,
     {
         self.entropy.assign(&new_entropy).map_err(Into::into)
     }
@@ -99,7 +99,7 @@ impl Block {
     /// with the eventually repeated sequence of the subject buffer.
     pub fn random<T>(&self, subject: &[u8]) -> Result<T::Hash>
     where
-        T: EnvTypes,
+        T: Environment,
     {
         let mut entropy = self.entropy.clone();
         let entropy_bytes = entropy.encoded_bytes_mut()?;
diff --git a/crates/env/src/engine/off_chain/db/chain_spec.rs b/crates/env/src/engine/off_chain/db/chain_spec.rs
index 842eddd8ed..6bdda79bd9 100644
--- a/crates/env/src/engine/off_chain/db/chain_spec.rs
+++ b/crates/env/src/engine/off_chain/db/chain_spec.rs
@@ -17,7 +17,7 @@ use super::{
     OffBalance,
     OffTimestamp,
 };
-use crate::EnvTypes;
+use crate::Environment;
 
 /// The chain specification.
 pub struct ChainSpec {
@@ -53,8 +53,8 @@ impl ChainSpec {
     /// Default initialization for the off-chain specification.
     pub fn initialize_as_default<T>(&mut self) -> crate::Result<()>
     where
-        T: EnvTypes,
-        <T as EnvTypes>::AccountId: From<[u8; 32]>,
+        T: Environment,
+        <T as Environment>::AccountId: From<[u8; 32]>,
     {
         self.gas_price
             .try_initialize::<T::Balance>(&T::Balance::from(100u32))?;
@@ -70,7 +70,7 @@ impl ChainSpec {
     /// Returns the gas price for the chain.
     pub fn gas_price<T>(&self) -> Result<T::Balance>
     where
-        T: EnvTypes,
+        T: Environment,
     {
         self.gas_price.decode().map_err(Into::into)
     }
@@ -78,7 +78,7 @@ impl ChainSpec {
     /// Set the gas price for the chain.
     pub fn set_gas_price<T>(&mut self, gas_price: T::Balance)
     where
-        T: EnvTypes,
+        T: Environment,
     {
         self.gas_price = OffBalance::new(&gas_price)
     }
@@ -86,7 +86,7 @@ impl ChainSpec {
     /// Returns the minimum balance for an account on the chain.
     pub fn minimum_balance<T>(&self) -> Result<T::Balance>
     where
-        T: EnvTypes,
+        T: Environment,
     {
         self.minimum_balance.decode().map_err(Into::into)
     }
@@ -94,7 +94,7 @@ impl ChainSpec {
     /// Returns the tombstone deposit for the chain.
     pub fn tombstone_deposit<T>(&self) -> Result<T::Balance>
     where
-        T: EnvTypes,
+        T: Environment,
     {
         self.tombstone_deposit.decode().map_err(Into::into)
     }
@@ -102,7 +102,7 @@ impl ChainSpec {
     /// Returns the targeted block time for the chain.
     pub fn block_time<T>(&self) -> Result<T::Timestamp>
     where
-        T: EnvTypes,
+        T: Environment,
     {
         self.block_time.decode().map_err(Into::into)
     }
diff --git a/crates/env/src/engine/off_chain/db/events.rs b/crates/env/src/engine/off_chain/db/events.rs
index 0deda405c0..4f2d149d3f 100644
--- a/crates/env/src/engine/off_chain/db/events.rs
+++ b/crates/env/src/engine/off_chain/db/events.rs
@@ -24,7 +24,7 @@ use crate::{
         TopicsBuilderBackend,
     },
     Clear,
-    EnvTypes,
+    Environment,
 };
 
 #[derive(Default)]
@@ -34,7 +34,7 @@ pub struct TopicsBuilder {
 
 impl<E> TopicsBuilderBackend<E> for TopicsBuilder
 where
-    E: EnvTypes,
+    E: Environment,
 {
     type Output = Vec<OffHash>;
 
@@ -46,7 +46,7 @@ where
     {
         let encoded = topic_value.encode();
         let len_encoded = encoded.len();
-        let mut result = <E as EnvTypes>::Hash::clear();
+        let mut result = <E as Environment>::Hash::clear();
         let len_result = result.as_ref().len();
         if len_encoded <= len_result {
             result.as_mut()[..len_encoded].copy_from_slice(&encoded[..]);
@@ -78,7 +78,7 @@ impl EmittedEvent {
     /// Creates a new emitted event.
     pub fn new<T, E>(emitted_event: E) -> Self
     where
-        T: EnvTypes,
+        T: Environment,
         E: Topics + scale::Encode,
     {
         let topics = emitted_event.topics::<T, _>(TopicsBuilder::default().into());
@@ -110,7 +110,7 @@ impl EmittedEventsRecorder {
     /// Records a new emitted event.
     pub fn record<T, E>(&mut self, new_event: E)
     where
-        T: EnvTypes,
+        T: Environment,
         E: Topics + scale::Encode,
     {
         self.emitted_events
diff --git a/crates/env/src/engine/off_chain/db/exec_context.rs b/crates/env/src/engine/off_chain/db/exec_context.rs
index 635546a24f..1d9f244b8a 100644
--- a/crates/env/src/engine/off_chain/db/exec_context.rs
+++ b/crates/env/src/engine/off_chain/db/exec_context.rs
@@ -21,7 +21,7 @@ use super::{
     OffAccountId,
     OffBalance,
 };
-use crate::EnvTypes;
+use crate::Environment;
 use ink_prelude::vec::Vec;
 
 pub type Bytes = Vec<u8>;
@@ -52,7 +52,7 @@ impl ExecContext {
     /// Constructs a new execution context.
     pub fn build<T>() -> ExecContextBuilder<T>
     where
-        T: EnvTypes,
+        T: Environment,
     {
         ExecContextBuilder::new()
     }
@@ -60,7 +60,7 @@ impl ExecContext {
     /// Returns the caller.
     pub fn caller<T>(&self) -> Result<T::AccountId>
     where
-        T: EnvTypes,
+        T: Environment,
     {
         self.caller.decode().map_err(Into::into)
     }
@@ -68,7 +68,7 @@ impl ExecContext {
     /// Returns the callee.
     pub fn callee<T>(&self) -> Result<T::AccountId>
     where
-        T: EnvTypes,
+        T: Environment,
     {
         self.callee.decode().map_err(Into::into)
     }
@@ -76,7 +76,7 @@ impl ExecContext {
     /// Returns the transferred value.
     pub fn transferred_value<T>(&self) -> Result<T::Balance>
     where
-        T: EnvTypes,
+        T: Environment,
     {
         self.transferred_value.decode().map_err(Into::into)
     }
@@ -84,7 +84,7 @@ impl ExecContext {
     /// Returns the gas.
     pub fn gas<T>(&self) -> Result<T::Balance>
     where
-        T: EnvTypes,
+        T: Environment,
     {
         self.gas.decode().map_err(Into::into)
     }
@@ -113,7 +113,7 @@ impl ExecContext {
 /// Builder for execution contexts.
 pub struct ExecContextBuilder<T>
 where
-    T: EnvTypes,
+    T: Environment,
 {
     /// The caller of the newly created execution context.
     caller: Option<T::AccountId>,
@@ -129,7 +129,7 @@ where
 
 impl<T> ExecContextBuilder<T>
 where
-    T: EnvTypes,
+    T: Environment,
 {
     /// Constructs a new execution context builder.
     pub fn new() -> Self {
diff --git a/crates/env/src/engine/off_chain/impls.rs b/crates/env/src/engine/off_chain/impls.rs
index e590eeda38..c1a03ab868 100644
--- a/crates/env/src/engine/off_chain/impls.rs
+++ b/crates/env/src/engine/off_chain/impls.rs
@@ -32,12 +32,12 @@ use crate::{
         Sha2x256,
     },
     topics::Topics,
-    Env,
-    EnvError,
-    EnvTypes,
+    EnvBackend,
+    Environment,
+    Error,
     Result,
     ReturnFlags,
-    TypedEnv,
+    TypedEnvBackend,
 };
 use core::convert::TryInto;
 use ink_primitives::Key;
@@ -117,7 +117,7 @@ impl CryptoHash for Keccak256 {
     }
 }
 
-impl Env for EnvInstance {
+impl EnvBackend for EnvInstance {
     fn set_contract_storage<V>(&mut self, key: &Key, value: &V)
     where
         V: scale::Encode,
@@ -205,7 +205,7 @@ impl EnvInstance {
         value: T::Balance,
     ) -> Result<()>
     where
-        T: EnvTypes,
+        T: Environment,
     {
         let src_id = self.account_id::<T>()?;
         let src_value = self
@@ -214,7 +214,7 @@ impl EnvInstance {
             .expect("account of executed contract must exist")
             .balance::<T>()?;
         if src_value < value {
-            return Err(EnvError::TransferFailed)
+            return Err(Error::TransferFailed)
         }
         let dst_value = self
             .accounts
@@ -232,8 +232,8 @@ impl EnvInstance {
     }
 }
 
-impl TypedEnv for EnvInstance {
-    fn caller<T: EnvTypes>(&mut self) -> Result<T::AccountId> {
+impl TypedEnvBackend for EnvInstance {
+    fn caller<T: Environment>(&mut self) -> Result<T::AccountId> {
         self.exec_context()
             .expect("uninitialized execution context")
             .caller::<T>()
@@ -241,7 +241,7 @@ impl TypedEnv for EnvInstance {
             .map_err(Into::into)
     }
 
-    fn transferred_balance<T: EnvTypes>(&mut self) -> Result<T::Balance> {
+    fn transferred_balance<T: Environment>(&mut self) -> Result<T::Balance> {
         self.exec_context()
             .expect("uninitialized execution context")
             .transferred_value::<T>()
@@ -250,7 +250,7 @@ impl TypedEnv for EnvInstance {
     }
 
     /// Emulates gas price calculation
-    fn weight_to_fee<T: EnvTypes>(&mut self, gas: u64) -> Result<T::Balance> {
+    fn weight_to_fee<T: Environment>(&mut self, gas: u64) -> Result<T::Balance> {
         use crate::arithmetic::Saturating as _;
 
         let gas_price = self
@@ -262,7 +262,7 @@ impl TypedEnv for EnvInstance {
             .saturating_mul(gas.try_into().unwrap_or_else(|_| Bounded::max_value())))
     }
 
-    fn gas_left<T: EnvTypes>(&mut self) -> Result<T::Balance> {
+    fn gas_left<T: Environment>(&mut self) -> Result<T::Balance> {
         self.exec_context()
             .expect("uninitialized execution context")
             .gas::<T>()
@@ -270,7 +270,7 @@ impl TypedEnv for EnvInstance {
             .map_err(Into::into)
     }
 
-    fn block_timestamp<T: EnvTypes>(&mut self) -> Result<T::Timestamp> {
+    fn block_timestamp<T: Environment>(&mut self) -> Result<T::Timestamp> {
         self.current_block()
             .expect("uninitialized execution context")
             .timestamp::<T>()
@@ -278,7 +278,7 @@ impl TypedEnv for EnvInstance {
             .map_err(Into::into)
     }
 
-    fn account_id<T: EnvTypes>(&mut self) -> Result<T::AccountId> {
+    fn account_id<T: Environment>(&mut self) -> Result<T::AccountId> {
         self.exec_context()
             .expect("uninitialized execution context")
             .callee::<T>()
@@ -286,21 +286,21 @@ impl TypedEnv for EnvInstance {
             .map_err(Into::into)
     }
 
-    fn balance<T: EnvTypes>(&mut self) -> Result<T::Balance> {
+    fn balance<T: Environment>(&mut self) -> Result<T::Balance> {
         self.callee_account()
             .balance::<T>()
             .map_err(|_| scale::Error::from("could not decode callee balance"))
             .map_err(Into::into)
     }
 
-    fn rent_allowance<T: EnvTypes>(&mut self) -> Result<T::Balance> {
+    fn rent_allowance<T: Environment>(&mut self) -> Result<T::Balance> {
         self.callee_account()
             .rent_allowance::<T>()
             .map_err(|_| scale::Error::from("could not decode callee rent allowance"))
             .map_err(Into::into)
     }
 
-    fn block_number<T: EnvTypes>(&mut self) -> Result<T::BlockNumber> {
+    fn block_number<T: Environment>(&mut self) -> Result<T::BlockNumber> {
         self.current_block()
             .expect("uninitialized execution context")
             .number::<T>()
@@ -308,14 +308,14 @@ impl TypedEnv for EnvInstance {
             .map_err(Into::into)
     }
 
-    fn minimum_balance<T: EnvTypes>(&mut self) -> Result<T::Balance> {
+    fn minimum_balance<T: Environment>(&mut self) -> Result<T::Balance> {
         self.chain_spec
             .minimum_balance::<T>()
             .map_err(|_| scale::Error::from("could not decode minimum balance"))
             .map_err(Into::into)
     }
 
-    fn tombstone_deposit<T: EnvTypes>(&mut self) -> Result<T::Balance> {
+    fn tombstone_deposit<T: Environment>(&mut self) -> Result<T::Balance> {
         self.chain_spec
             .tombstone_deposit::<T>()
             .map_err(|_| scale::Error::from("could not decode tombstone deposit"))
@@ -324,7 +324,7 @@ impl TypedEnv for EnvInstance {
 
     fn emit_event<T, Event>(&mut self, new_event: Event)
     where
-        T: EnvTypes,
+        T: Environment,
         Event: Topics + scale::Encode,
     {
         self.emitted_events.record::<T, Event>(new_event)
@@ -332,7 +332,7 @@ impl TypedEnv for EnvInstance {
 
     fn set_rent_allowance<T>(&mut self, new_rent_allowance: T::Balance)
     where
-        T: EnvTypes,
+        T: Environment,
     {
         self.callee_account_mut()
             .set_rent_allowance::<T>(new_rent_allowance)
@@ -344,7 +344,7 @@ impl TypedEnv for EnvInstance {
         _call_params: &CallParams<T, Args, ()>,
     ) -> Result<()>
     where
-        T: EnvTypes,
+        T: Environment,
         Args: scale::Encode,
     {
         unimplemented!("off-chain environment does not support contract invokation")
@@ -355,7 +355,7 @@ impl TypedEnv for EnvInstance {
         _call_params: &CallParams<T, Args, ReturnType<R>>,
     ) -> Result<R>
     where
-        T: EnvTypes,
+        T: Environment,
         Args: scale::Encode,
         R: scale::Decode,
     {
@@ -367,7 +367,7 @@ impl TypedEnv for EnvInstance {
         _params: &CreateParams<T, Args, C>,
     ) -> Result<T::AccountId>
     where
-        T: EnvTypes,
+        T: Environment,
         Args: scale::Encode,
     {
         unimplemented!("off-chain environment does not support contract instantiation")
@@ -375,7 +375,7 @@ impl TypedEnv for EnvInstance {
 
     fn terminate_contract<T>(&mut self, _beneficiary: T::AccountId) -> !
     where
-        T: EnvTypes,
+        T: Environment,
     {
         unimplemented!("off-chain environment does not support contract termination")
     }
@@ -387,21 +387,21 @@ impl TypedEnv for EnvInstance {
         _rent_allowance: T::Balance,
         _filtered_keys: &[Key],
     ) where
-        T: EnvTypes,
+        T: Environment,
     {
         unimplemented!("off-chain environment does not support contract restoration")
     }
 
     fn transfer<T>(&mut self, destination: T::AccountId, value: T::Balance) -> Result<()>
     where
-        T: EnvTypes,
+        T: Environment,
     {
         self.transfer_impl::<T>(destination, value)
     }
 
     fn random<T>(&mut self, subject: &[u8]) -> Result<T::Hash>
     where
-        T: EnvTypes,
+        T: Environment,
     {
         self.current_block()
             .expect("uninitialized execution context")
diff --git a/crates/env/src/engine/off_chain/mod.rs b/crates/env/src/engine/off_chain/mod.rs
index a00fd849d6..1f2afaaf6e 100644
--- a/crates/env/src/engine/off_chain/mod.rs
+++ b/crates/env/src/engine/off_chain/mod.rs
@@ -56,7 +56,7 @@ use self::{
     },
 };
 use super::OnInstance;
-use crate::EnvTypes;
+use crate::Environment;
 use core::cell::RefCell;
 use derive_more::From;
 
@@ -118,8 +118,8 @@ impl EnvInstance {
     /// Either resets or initializes the off-chain environment to default values.
     pub fn initialize_or_reset_as_default<T>(&mut self) -> crate::Result<()>
     where
-        T: EnvTypes,
-        <T as EnvTypes>::AccountId: From<[u8; 32]>,
+        T: Environment,
+        <T as Environment>::AccountId: From<[u8; 32]>,
     {
         if self.is_initialized() {
             self.reset()
@@ -155,8 +155,8 @@ impl EnvInstance {
     /// for most use cases.
     pub fn initialize_as_default<T>(&mut self) -> crate::Result<()>
     where
-        T: EnvTypes,
-        <T as EnvTypes>::AccountId: From<[u8; 32]>,
+        T: Environment,
+        <T as Environment>::AccountId: From<[u8; 32]>,
     {
         use core::ops::Div as _;
         use num_traits::{
@@ -217,7 +217,7 @@ impl EnvInstance {
     /// Advances the chain by a single block.
     pub fn advance_block<T>(&mut self) -> crate::Result<()>
     where
-        T: EnvTypes,
+        T: Environment,
     {
         let new_block_number = T::BlockNumber::from(self.blocks.len() as u32);
         let new_timestamp = self.current_block()?.timestamp::<T>()?
diff --git a/crates/env/src/engine/off_chain/typed_encoded.rs b/crates/env/src/engine/off_chain/typed_encoded.rs
index 4ee10f095b..44a841598a 100644
--- a/crates/env/src/engine/off_chain/typed_encoded.rs
+++ b/crates/env/src/engine/off_chain/typed_encoded.rs
@@ -13,7 +13,7 @@
 // limitations under the License.
 
 use super::OffChainError;
-use crate::EnvError;
+use crate::Error;
 use core::{
     any::TypeId,
     cmp::Ordering,
@@ -42,7 +42,7 @@ pub struct TypedEncoded<T> {
     /// and will take over any given type upon the first typed interaction.
     /// - This is needed since instances of `TypedEncoded` are going to be used
     /// in static memory where it isn't possible to decide about the used types
-    /// given by `EnvTypes` at initialization.
+    /// given by `Environment` at initialization.
     type_id: Option<TypeId>,
     /// Classification marker.
     ///
@@ -88,9 +88,9 @@ pub enum TypedEncodedError {
     StillUninitialized,
 }
 
-impl From<TypedEncodedError> for EnvError {
+impl From<TypedEncodedError> for Error {
     fn from(typed_encoded_error: TypedEncodedError) -> Self {
-        EnvError::OffChain(OffChainError::TypedEncoded(typed_encoded_error))
+        Error::OffChain(OffChainError::TypedEncoded(typed_encoded_error))
     }
 }
 
diff --git a/crates/env/src/engine/on_chain/impls.rs b/crates/env/src/engine/on_chain/impls.rs
index 00b94c84b4..c57624338a 100644
--- a/crates/env/src/engine/on_chain/impls.rs
+++ b/crates/env/src/engine/on_chain/impls.rs
@@ -37,12 +37,12 @@ use crate::{
         TopicsBuilderBackend,
     },
     Clear,
-    Env,
-    EnvError,
-    EnvTypes,
+    EnvBackend,
+    Environment,
+    Error,
     Result,
     ReturnFlags,
-    TypedEnv,
+    TypedEnvBackend,
 };
 use ink_primitives::Key;
 
@@ -94,7 +94,7 @@ impl CryptoHash for Keccak256 {
     }
 }
 
-impl From<ext::Error> for EnvError {
+impl From<ext::Error> for Error {
     fn from(ext_error: ext::Error) -> Self {
         match ext_error {
             ext::Error::UnknownError => Self::UnknownError,
@@ -117,7 +117,7 @@ pub struct TopicsBuilder<'a, E> {
 
 impl<'a, E> From<ScopedBuffer<'a>> for TopicsBuilder<'a, E>
 where
-    E: EnvTypes,
+    E: Environment,
 {
     fn from(scoped_buffer: ScopedBuffer<'a>) -> Self {
         Self {
@@ -129,7 +129,7 @@ where
 
 impl<'a, E> TopicsBuilderBackend<E> for TopicsBuilder<'a, E>
 where
-    E: EnvTypes,
+    E: Environment,
 {
     type Output = (ScopedBuffer<'a>, &'a mut [u8]);
 
@@ -145,7 +145,7 @@ where
         let mut split = self.scoped_buffer.split();
         let encoded = split.take_encoded(topic_value);
         let len_encoded = encoded.len();
-        let mut result = <E as EnvTypes>::Hash::clear();
+        let mut result = <E as Environment>::Hash::clear();
         let len_result = result.as_ref().len();
         if len_encoded <= len_result {
             result.as_mut()[..len_encoded].copy_from_slice(encoded);
@@ -186,7 +186,7 @@ impl EnvInstance {
         params: &CallParams<T, Args, RetType>,
     ) -> Result<R>
     where
-        T: EnvTypes,
+        T: Environment,
         Args: scale::Encode,
         R: scale::Decode,
     {
@@ -208,7 +208,7 @@ impl EnvInstance {
     }
 }
 
-impl Env for EnvInstance {
+impl EnvBackend for EnvInstance {
     fn set_contract_storage<V>(&mut self, key: &Key, value: &V)
     where
         V: scale::Encode,
@@ -286,50 +286,50 @@ impl Env for EnvInstance {
     }
 }
 
-impl TypedEnv for EnvInstance {
-    fn caller<T: EnvTypes>(&mut self) -> Result<T::AccountId> {
+impl TypedEnvBackend for EnvInstance {
+    fn caller<T: Environment>(&mut self) -> Result<T::AccountId> {
         self.get_property::<T::AccountId>(ext::caller)
     }
 
-    fn transferred_balance<T: EnvTypes>(&mut self) -> Result<T::Balance> {
+    fn transferred_balance<T: Environment>(&mut self) -> Result<T::Balance> {
         self.get_property::<T::Balance>(ext::value_transferred)
     }
 
-    fn gas_left<T: EnvTypes>(&mut self) -> Result<T::Balance> {
+    fn gas_left<T: Environment>(&mut self) -> Result<T::Balance> {
         self.get_property::<T::Balance>(ext::gas_left)
     }
 
-    fn block_timestamp<T: EnvTypes>(&mut self) -> Result<T::Timestamp> {
+    fn block_timestamp<T: Environment>(&mut self) -> Result<T::Timestamp> {
         self.get_property::<T::Timestamp>(ext::now)
     }
 
-    fn account_id<T: EnvTypes>(&mut self) -> Result<T::AccountId> {
+    fn account_id<T: Environment>(&mut self) -> Result<T::AccountId> {
         self.get_property::<T::AccountId>(ext::address)
     }
 
-    fn balance<T: EnvTypes>(&mut self) -> Result<T::Balance> {
+    fn balance<T: Environment>(&mut self) -> Result<T::Balance> {
         self.get_property::<T::Balance>(ext::balance)
     }
 
-    fn rent_allowance<T: EnvTypes>(&mut self) -> Result<T::Balance> {
+    fn rent_allowance<T: Environment>(&mut self) -> Result<T::Balance> {
         self.get_property::<T::Balance>(ext::rent_allowance)
     }
 
-    fn block_number<T: EnvTypes>(&mut self) -> Result<T::BlockNumber> {
+    fn block_number<T: Environment>(&mut self) -> Result<T::BlockNumber> {
         self.get_property::<T::BlockNumber>(ext::block_number)
     }
 
-    fn minimum_balance<T: EnvTypes>(&mut self) -> Result<T::Balance> {
+    fn minimum_balance<T: Environment>(&mut self) -> Result<T::Balance> {
         self.get_property::<T::Balance>(ext::minimum_balance)
     }
 
-    fn tombstone_deposit<T: EnvTypes>(&mut self) -> Result<T::Balance> {
+    fn tombstone_deposit<T: Environment>(&mut self) -> Result<T::Balance> {
         self.get_property::<T::Balance>(ext::tombstone_deposit)
     }
 
     fn emit_event<T, Event>(&mut self, event: Event)
     where
-        T: EnvTypes,
+        T: Environment,
         Event: Topics + scale::Encode,
     {
         let (mut scope, enc_topics) =
@@ -340,7 +340,7 @@ impl TypedEnv for EnvInstance {
 
     fn set_rent_allowance<T>(&mut self, new_value: T::Balance)
     where
-        T: EnvTypes,
+        T: Environment,
     {
         let buffer = self.scoped_buffer().take_encoded(&new_value);
         ext::set_rent_allowance(&buffer[..])
@@ -351,7 +351,7 @@ impl TypedEnv for EnvInstance {
         call_params: &CallParams<T, Args, ()>,
     ) -> Result<()>
     where
-        T: EnvTypes,
+        T: Environment,
         Args: scale::Encode,
     {
         self.invoke_contract_impl(call_params)
@@ -362,7 +362,7 @@ impl TypedEnv for EnvInstance {
         call_params: &CallParams<T, Args, ReturnType<R>>,
     ) -> Result<R>
     where
-        T: EnvTypes,
+        T: Environment,
         Args: scale::Encode,
         R: scale::Decode,
     {
@@ -374,7 +374,7 @@ impl TypedEnv for EnvInstance {
         params: &CreateParams<T, Args, C>,
     ) -> Result<T::AccountId>
     where
-        T: EnvTypes,
+        T: Environment,
         Args: scale::Encode,
     {
         let mut scoped = self.scoped_buffer();
@@ -410,7 +410,7 @@ impl TypedEnv for EnvInstance {
         rent_allowance: T::Balance,
         filtered_keys: &[Key],
     ) where
-        T: EnvTypes,
+        T: Environment,
     {
         let mut scope = self.scoped_buffer();
         let enc_account_id = scope.take_encoded(&account_id);
@@ -426,7 +426,7 @@ impl TypedEnv for EnvInstance {
 
     fn terminate_contract<T>(&mut self, beneficiary: T::AccountId) -> !
     where
-        T: EnvTypes,
+        T: Environment,
     {
         let buffer = self.scoped_buffer().take_encoded(&beneficiary);
         ext::terminate(&buffer[..]);
@@ -434,7 +434,7 @@ impl TypedEnv for EnvInstance {
 
     fn transfer<T>(&mut self, destination: T::AccountId, value: T::Balance) -> Result<()>
     where
-        T: EnvTypes,
+        T: Environment,
     {
         let mut scope = self.scoped_buffer();
         let enc_destination = scope.take_encoded(&destination);
@@ -442,7 +442,7 @@ impl TypedEnv for EnvInstance {
         ext::transfer(enc_destination, enc_value).map_err(Into::into)
     }
 
-    fn weight_to_fee<T: EnvTypes>(&mut self, gas: u64) -> Result<T::Balance> {
+    fn weight_to_fee<T: Environment>(&mut self, gas: u64) -> Result<T::Balance> {
         let output = &mut self.scoped_buffer().take_rest();
         ext::weight_to_fee(gas, output);
         scale::Decode::decode(&mut &output[..]).map_err(Into::into)
@@ -450,7 +450,7 @@ impl TypedEnv for EnvInstance {
 
     fn random<T>(&mut self, subject: &[u8]) -> Result<T::Hash>
     where
-        T: EnvTypes,
+        T: Environment,
     {
         let mut scope = self.scoped_buffer();
         let enc_subject = scope.take_bytes(subject);
diff --git a/crates/env/src/error.rs b/crates/env/src/error.rs
index 2ec31e61f7..733c60abd8 100644
--- a/crates/env/src/error.rs
+++ b/crates/env/src/error.rs
@@ -19,7 +19,7 @@ use crate::engine::off_chain::OffChainError;
 
 /// Errors that can be encountered upon environmental interaction.
 #[derive(Debug, From, PartialEq, Eq)]
-pub enum EnvError {
+pub enum Error {
     /// Error upon decoding an encoded value.
     Decode(scale::Error),
     /// An error that can only occure in the off-chain environment.
@@ -49,4 +49,4 @@ pub enum EnvError {
 }
 
 /// A result of environmental operations.
-pub type Result<T> = core::result::Result<T, EnvError>;
+pub type Result<T> = core::result::Result<T, Error>;
diff --git a/crates/env/src/lib.rs b/crates/env/src/lib.rs
index fc666c860b..8ee8264833 100644
--- a/crates/env/src/lib.rs
+++ b/crates/env/src/lib.rs
@@ -57,7 +57,7 @@ fn panic(_info: &core::panic::PanicInfo) -> ! {
 // This extern crate definition is required since otherwise rustc
 // is not recognizing its allocator and panic handler definitions.
 #[cfg(not(feature = "std"))]
-extern crate ink_alloc;
+extern crate ink_allocator;
 
 mod api;
 mod arithmetic;
@@ -78,22 +78,22 @@ mod tests;
 pub use self::engine::off_chain::test_api as test;
 
 use self::backend::{
-    Env,
-    TypedEnv,
+    EnvBackend,
+    TypedEnvBackend,
 };
 pub use self::{
     api::*,
     backend::ReturnFlags,
     error::{
-        EnvError,
+        Error,
         Result,
     },
     topics::Topics,
     types::{
         AccountId,
         Clear,
-        DefaultEnvTypes,
-        EnvTypes,
+        DefaultEnvironment,
+        Environment,
         Hash,
     },
 };
diff --git a/crates/env/src/topics.rs b/crates/env/src/topics.rs
index 245c9681dc..90e5c96c05 100644
--- a/crates/env/src/topics.rs
+++ b/crates/env/src/topics.rs
@@ -14,7 +14,7 @@
 
 //! Docs
 
-use crate::EnvTypes;
+use crate::Environment;
 
 /// The concrete implementation that is guided by the topics builder.
 ///
@@ -22,7 +22,7 @@ use crate::EnvTypes;
 #[doc(hidden)]
 pub trait TopicsBuilderBackend<E>
 where
-    E: EnvTypes,
+    E: Environment,
 {
     /// The type of the serialized event topics.
     type Output;
@@ -51,7 +51,7 @@ pub struct TopicsBuilder<S, E, B> {
 
 impl<E, B> From<B> for TopicsBuilder<state::Uninit, E, B>
 where
-    E: EnvTypes,
+    E: Environment,
     B: TopicsBuilderBackend<E>,
 {
     fn from(backend: B) -> Self {
@@ -75,7 +75,7 @@ pub mod state {
 
 impl<E, B> TopicsBuilder<state::Uninit, E, B>
 where
-    E: EnvTypes,
+    E: Environment,
     B: TopicsBuilderBackend<E>,
 {
     /// Initializes the topics builder and informs it about how many topics it must expect to serialize.
@@ -95,7 +95,7 @@ where
 
 impl<E, S, B> TopicsBuilder<S, E, B>
 where
-    E: EnvTypes,
+    E: Environment,
     S: SomeRemainingTopics,
     B: TopicsBuilderBackend<E>,
 {
@@ -120,7 +120,7 @@ where
 
 impl<E, B> TopicsBuilder<state::NoRemainingTopics, E, B>
 where
-    E: EnvTypes,
+    E: Environment,
     B: TopicsBuilderBackend<E>,
 {
     /// Finalizes the topics builder.
@@ -198,6 +198,6 @@ pub trait Topics {
         builder: TopicsBuilder<state::Uninit, E, B>,
     ) -> <B as TopicsBuilderBackend<E>>::Output
     where
-        E: EnvTypes,
+        E: Environment,
         B: TopicsBuilderBackend<E>;
 }
diff --git a/crates/env/src/types.rs b/crates/env/src/types.rs
index 528ccf5fce..f03bcbd33b 100644
--- a/crates/env/src/types.rs
+++ b/crates/env/src/types.rs
@@ -17,19 +17,19 @@
 //! These are simple mirrored types from the default substrate FRAME configuration.
 //! Their interfaces and functionality might not be complete.
 //!
-//! Users are required to provide their own type definitions and `EnvTypes`
+//! Users are required to provide their own type definitions and `Environment`
 //! implementations in order to write ink! contracts for other chain configurations.
 //!
 //! # Note
 //!
-//! When authoring a contract, the concrete `EnvTypes` are available via aliases
+//! When authoring a contract, the concrete `Environment` are available via aliases
 //! generated by the `lang` macro. Therefore all functionality of the concrete
 //! types is accessible in the contract, not constrained by the required trait
 //! bounds.
 //!
 //! Outside of the contract and its tests (e.g. in the offchain environment), where
 //! there is no knowledge of the concrete types, the functionality is restricted to
-//! the trait bounds on the `EnvTypes` trait types.
+//! the trait bounds on the `Environment` trait types.
 
 use super::arithmetic::AtLeast32BitUnsigned;
 use core::{
@@ -45,7 +45,7 @@ use scale::{
 use scale_info::TypeInfo;
 
 /// The environmental types usable by contracts defined with ink!.
-pub trait EnvTypes {
+pub trait Environment {
     /// The maximum number of supported event topics provided by the runtime.
     ///
     /// The value must match the maximum number of supported event topics of the used runtime.
@@ -97,9 +97,9 @@ pub trait EnvTypes {
 /// The fundamental types of the default configuration.
 #[derive(Debug, Clone, PartialEq, Eq)]
 #[cfg_attr(feature = "std", derive(TypeInfo))]
-pub enum DefaultEnvTypes {}
+pub enum DefaultEnvironment {}
 
-impl EnvTypes for DefaultEnvTypes {
+impl Environment for DefaultEnvironment {
     const MAX_EVENT_TOPICS: usize = 4;
 
     type AccountId = AccountId;
diff --git a/crates/lang/codegen/src/generator/cross_calling.rs b/crates/lang/codegen/src/generator/cross_calling.rs
index 04152bb75d..7898b9fd3b 100644
--- a/crates/lang/codegen/src/generator/cross_calling.rs
+++ b/crates/lang/codegen/src/generator/cross_calling.rs
@@ -123,14 +123,14 @@ impl CrossCalling<'_> {
         quote! {
             #cfg
             const _: () = {
-                impl ::ink_env::call::FromAccountId<EnvTypes> for #ident {
+                impl ::ink_env::call::FromAccountId<Environment> for #ident {
                     #[inline]
                     fn from_account_id(account_id: AccountId) -> Self {
                         Self { account_id }
                     }
                 }
 
-                impl ::ink_lang::ToAccountId<EnvTypes> for #ident {
+                impl ::ink_lang::ToAccountId<Environment> for #ident {
                     #[inline]
                     fn to_account_id(&self) -> AccountId {
                         self.account_id
@@ -247,7 +247,7 @@ impl CrossCalling<'_> {
         quote_spanned!(span=>
             #[allow(clippy::type_complexity)]
             type #output_ident = ::ink_env::call::CallBuilder<
-                EnvTypes,
+                Environment,
                 ::ink_env::call::utils::Set<AccountId>,
                 ::ink_env::call::utils::Unset<u64>,
                 ::ink_env::call::utils::Unset<Balance>,
@@ -260,7 +260,7 @@ impl CrossCalling<'_> {
             #pub_tok fn #ident(
                 #receiver #(, #input_bindings : #input_types )*
             ) -> Self::#output_ident {
-                ::ink_env::call::build_call::<EnvTypes>()
+                ::ink_env::call::build_call::<Environment>()
                     .callee(::ink_lang::ToAccountId::to_account_id(self.contract))
                     .exec_input(
                         ::ink_env::call::ExecutionInput::new(
@@ -428,14 +428,14 @@ impl CrossCalling<'_> {
                 self,
                 #( #input_bindings : #input_types ),*
             ) -> ::ink_env::call::CallBuilder<
-                EnvTypes,
+                Environment,
                 ::ink_env::call::utils::Set<AccountId>,
                 ::ink_env::call::utils::Unset<u64>,
                 ::ink_env::call::utils::Unset<Balance>,
                 ::ink_env::call::utils::Set<::ink_env::call::ExecutionInput<#arg_list>>,
                 ::ink_env::call::utils::Set<#output_sig>,
             > {
-                ::ink_env::call::build_call::<EnvTypes>()
+                ::ink_env::call::build_call::<Environment>()
                     .callee(::ink_lang::ToAccountId::to_account_id(self.contract))
                     .exec_input(
                         ::ink_env::call::ExecutionInput::new(
@@ -616,7 +616,7 @@ impl CrossCalling<'_> {
         quote_spanned!(span =>
             #[allow(clippy::type_complexity)]
             type #output_ident = ::ink_env::call::CreateBuilder<
-                EnvTypes,
+                Environment,
                 ::ink_env::call::utils::Unset<Hash>,
                 ::ink_env::call::utils::Unset<u64>,
                 ::ink_env::call::utils::Unset<Balance>,
@@ -629,7 +629,7 @@ impl CrossCalling<'_> {
             fn #ident(
                 #( #input_bindings : #input_types ),*
             ) -> Self::#output_ident {
-                ::ink_env::call::build_create::<EnvTypes, Self>()
+                ::ink_env::call::build_create::<Environment, Self>()
                     .exec_input(
                         ::ink_env::call::ExecutionInput::new(
                             ::ink_env::call::Selector::new([ #( #composed_selector ),* ])
@@ -719,14 +719,14 @@ impl CrossCalling<'_> {
             pub fn #ident(
                 #( #input_bindings : #input_types ),*
             ) -> ::ink_env::call::CreateBuilder<
-                EnvTypes,
+                Environment,
                 ::ink_env::call::utils::Unset<Hash>,
                 ::ink_env::call::utils::Unset<u64>,
                 ::ink_env::call::utils::Unset<Balance>,
                 ::ink_env::call::utils::Set<::ink_env::call::ExecutionInput<#arg_list>>,
                 Self,
             > {
-                ::ink_env::call::build_create::<EnvTypes, Self>()
+                ::ink_env::call::build_create::<Environment, Self>()
                     .exec_input(
                         ::ink_env::call::ExecutionInput::new(
                             ::ink_env::call::Selector::new([ #( #composed_selector ),* ])
diff --git a/crates/lang/codegen/src/generator/env.rs b/crates/lang/codegen/src/generator/env.rs
index db17325063..eefe63a570 100644
--- a/crates/lang/codegen/src/generator/env.rs
+++ b/crates/lang/codegen/src/generator/env.rs
@@ -32,13 +32,13 @@ impl GenerateCode for Env<'_> {
                 type Env = #env_types;
             }
 
-            type EnvTypes = <#storage_ident as ::ink_lang::ContractEnv>::Env;
+            type Environment = <#storage_ident as ::ink_lang::ContractEnv>::Env;
 
-            type AccountId = <<#storage_ident as ::ink_lang::ContractEnv>::Env as ::ink_env::EnvTypes>::AccountId;
-            type Balance = <<#storage_ident as ::ink_lang::ContractEnv>::Env as ::ink_env::EnvTypes>::Balance;
-            type Hash = <<#storage_ident as ::ink_lang::ContractEnv>::Env as ::ink_env::EnvTypes>::Hash;
-            type Timestamp = <<#storage_ident as ::ink_lang::ContractEnv>::Env as ::ink_env::EnvTypes>::Timestamp;
-            type BlockNumber = <<#storage_ident as ::ink_lang::ContractEnv>::Env as ::ink_env::EnvTypes>::BlockNumber;
+            type AccountId = <<#storage_ident as ::ink_lang::ContractEnv>::Env as ::ink_env::Environment>::AccountId;
+            type Balance = <<#storage_ident as ::ink_lang::ContractEnv>::Env as ::ink_env::Environment>::Balance;
+            type Hash = <<#storage_ident as ::ink_lang::ContractEnv>::Env as ::ink_env::Environment>::Hash;
+            type Timestamp = <<#storage_ident as ::ink_lang::ContractEnv>::Env as ::ink_env::Environment>::Timestamp;
+            type BlockNumber = <<#storage_ident as ::ink_lang::ContractEnv>::Env as ::ink_env::Environment>::BlockNumber;
         }
     }
 }
diff --git a/crates/lang/codegen/src/generator/events.rs b/crates/lang/codegen/src/generator/events.rs
index 9daf5bfd13..62e62954eb 100644
--- a/crates/lang/codegen/src/generator/events.rs
+++ b/crates/lang/codegen/src/generator/events.rs
@@ -71,13 +71,13 @@ impl<'a> Events<'a> {
         quote! {
             const _: () = {
                 #no_cross_calling_cfg
-                impl<'a> ::ink_lang::EmitEvent<#storage_ident> for ::ink_lang::EnvAccess<'a, EnvTypes> {
+                impl<'a> ::ink_lang::EmitEvent<#storage_ident> for ::ink_lang::EnvAccess<'a, Environment> {
                     fn emit_event<E>(self, event: E)
                     where
                         E: Into<<#storage_ident as ::ink_lang::BaseEvent>::Type>,
                     {
                         ::ink_env::emit_event::<
-                            EnvTypes,
+                            Environment,
                             <#storage_ident as ::ink_lang::BaseEvent>::Type
                         >(event.into());
                     }
@@ -141,7 +141,7 @@ impl<'a> Events<'a> {
                         builder: ::ink_env::topics::TopicsBuilder<::ink_env::topics::state::Uninit, E, B>,
                     ) -> <B as ::ink_env::topics::TopicsBuilderBackend<E>>::Output
                     where
-                        E: ::ink_env::EnvTypes,
+                        E: ::ink_env::Environment,
                         B: ::ink_env::topics::TopicsBuilderBackend<E>,
                     {
                         match self {
@@ -186,7 +186,7 @@ impl<'a> Events<'a> {
 
                 #[allow(non_upper_case_globals)]
                 const __ink_MAX_EVENT_TOPICS: usize = <
-                    <#storage_ident as ::ink_lang::ContractEnv>::Env as ::ink_env::EnvTypes
+                    <#storage_ident as ::ink_lang::ContractEnv>::Env as ::ink_env::Environment
                 >::MAX_EVENT_TOPICS;
 
                 fn __ink_ensure_max_event_topics<T>(_: T)
@@ -265,7 +265,7 @@ impl<'a> Events<'a> {
                             builder: ::ink_env::topics::TopicsBuilder<::ink_env::topics::state::Uninit, E, B>,
                         ) -> <B as ::ink_env::topics::TopicsBuilderBackend<E>>::Output
                         where
-                            E: ::ink_env::EnvTypes,
+                            E: ::ink_env::Environment,
                             B: ::ink_env::topics::TopicsBuilderBackend<E>,
                         {
                             builder
diff --git a/crates/lang/ir/src/ast/attr_args.rs b/crates/lang/ir/src/ast/attr_args.rs
index c20c5848e9..aa8a4ecf04 100644
--- a/crates/lang/ir/src/ast/attr_args.rs
+++ b/crates/lang/ir/src/ast/attr_args.rs
@@ -29,8 +29,8 @@ use syn::{
 
 /// The attribute arguments for the configuration of an ink! smart contract.
 ///
-/// These are the segments `env_types = ::my::env_types::EnvTypes` and `compile_as_dependency = true`
-/// in `#[ink::contract(env_types = ::my::env_types::EnvTypes, compile_as_dependency = true`.
+/// These are the segments `env_types = ::my::env_types::Environment` and `compile_as_dependency = true`
+/// in `#[ink::contract(env_types = ::my::env_types::Environment, compile_as_dependency = true`.
 #[derive(Debug, PartialEq, Eq)]
 pub struct AttributeArgs {
     args: Punctuated<MetaNameValue, Token![,]>,
diff --git a/crates/lang/ir/src/ir/config.rs b/crates/lang/ir/src/ir/config.rs
index 4e01519805..7ac860fe87 100644
--- a/crates/lang/ir/src/ir/config.rs
+++ b/crates/lang/ir/src/ir/config.rs
@@ -34,10 +34,10 @@ pub struct Config {
     as_dependency: Option<bool>,
     /// The environmental types definition.
     ///
-    /// This must be a type that implements `ink_env::EnvTypes` and can
+    /// This must be a type that implements `ink_env::Environment` and can
     /// be used to change the underlying environmental types of an ink! smart
     /// contract.
-    env_types: Option<EnvTypes>,
+    env_types: Option<Environment>,
 }
 
 /// Return an error to notify about duplicate ink! config arguments.
@@ -64,7 +64,7 @@ impl TryFrom<ast::AttributeArgs> for Config {
     fn try_from(args: ast::AttributeArgs) -> Result<Self, Self::Error> {
         let mut dynamic_storage_allocator: Option<(bool, ast::MetaNameValue)> = None;
         let mut as_dependency: Option<(bool, ast::MetaNameValue)> = None;
-        let mut env_types: Option<(EnvTypes, ast::MetaNameValue)> = None;
+        let mut env_types: Option<(Environment, ast::MetaNameValue)> = None;
         for arg in args.into_iter() {
             if arg.name.is_ident("dynamic_storage_allocator") {
                 if let Some((_, ast)) = dynamic_storage_allocator {
@@ -99,7 +99,7 @@ impl TryFrom<ast::AttributeArgs> for Config {
                     return Err(duplicate_config_err(ast, arg, "env_types"))
                 }
                 if let ast::PathOrLit::Path(path) = &arg.value {
-                    env_types = Some((EnvTypes { path: path.clone() }, arg))
+                    env_types = Some((Environment { path: path.clone() }, arg))
                 } else {
                     return Err(format_err_spanned!(
                         arg,
@@ -130,7 +130,7 @@ impl Config {
             .as_ref()
             .map(|env_types| &env_types.path)
             .cloned()
-            .unwrap_or(EnvTypes::default().path)
+            .unwrap_or(Environment::default().path)
     }
 
     /// Returns `true` if the dynamic storage allocator facilities are enabled
@@ -153,15 +153,15 @@ impl Config {
 
 /// The environmental types definition.
 #[derive(Debug, Clone, PartialEq, Eq)]
-pub struct EnvTypes {
+pub struct Environment {
     /// The underlying Rust type.
     pub path: syn::Path,
 }
 
-impl Default for EnvTypes {
+impl Default for Environment {
     fn default() -> Self {
         Self {
-            path: syn::parse_quote! { ::ink_env::DefaultEnvTypes },
+            path: syn::parse_quote! { ::ink_env::DefaultEnvironment },
         }
     }
 }
@@ -243,7 +243,7 @@ mod tests {
             Ok(Config {
                 dynamic_storage_allocator: None,
                 as_dependency: None,
-                env_types: Some(EnvTypes {
+                env_types: Some(Environment {
                     path: syn::parse_quote! { ::my::env::Types },
                 }),
             }),
diff --git a/crates/lang/ir/src/ir/contract.rs b/crates/lang/ir/src/ir/contract.rs
index 1889d7f39e..c2a58cf1c0 100644
--- a/crates/lang/ir/src/ir/contract.rs
+++ b/crates/lang/ir/src/ir/contract.rs
@@ -98,7 +98,7 @@ impl Contract {
     /// macro annotation itself within the `(config)` part. The available fields
     /// are the following:
     ///
-    /// - `types`: To specify `EnvTypes` different from the default environment
+    /// - `types`: To specify `Environment` different from the default environment
     ///            types.
     /// - `storage-alloc`: If `true` enables the dynamic storage allocator
     ///                    facilities and code generation of the ink! smart
diff --git a/crates/lang/macro/src/lib.rs b/crates/lang/macro/src/lib.rs
index 86e96085cc..785248e7f2 100644
--- a/crates/lang/macro/src/lib.rs
+++ b/crates/lang/macro/src/lib.rs
@@ -126,23 +126,23 @@ use proc_macro::TokenStream;
 ///
 ///     **Default value:** Depends on the crate feature propagation of `Cargo.toml`.
 ///
-/// - `env: impl EnvTypes`
+/// - `env: impl Environment`
 ///
 ///     Tells the ink! code generator which environment to use for the ink! smart contract.
-///     The environment must implement the `EnvTypes` (defined in `ink_env`) trait and provides
+///     The environment must implement the `Environment` (defined in `ink_env`) trait and provides
 ///     all the necessary fundamental type definitions for `Balance`, `AccountId` etc.
 ///
-///     When using a custom `EnvTypes` implementation for a smart contract all types
+///     When using a custom `Environment` implementation for a smart contract all types
 ///     that it exposes to the ink! smart contract and the mirrored types used in the runtime
 ///     must be aligned with respect to SCALE encoding and semantics.
 ///
 ///     **Usage Example:**
 ///
-///     Given a custom `EnvTypes` implementation:
+///     Given a custom `Environment` implementation:
 ///     ```
-///     pub struct MyEnvTypes;
+///     pub struct MyEnvironment;
 ///
-///     impl ink_env::EnvTypes for MyEnvTypes {
+///     impl ink_env::Environment for MyEnvironment {
 ///         const MAX_EVENT_TOPICS: usize = 3;
 ///         type AccountId = u64;
 ///         type Balance = u128;
@@ -151,15 +151,15 @@ use proc_macro::TokenStream;
 ///         type BlockNumber = u32;
 ///     }
 ///     ```
-///     A user might implement their ink! smart contract using the above custom `EnvTypes`
+///     A user might implement their ink! smart contract using the above custom `Environment`
 ///     implementation as demonstrated below:
 ///     ```
 ///     # use ink_lang as ink;
-///     #[ink::contract(env_types = MyEnvTypes)]
+///     #[ink::contract(env_types = MyEnvironment)]
 ///     mod my_contract {
-///         # pub struct MyEnvTypes;
+///         # pub struct MyEnvironment;
 ///         #
-///         # impl ink_env::EnvTypes for MyEnvTypes {
+///         # impl ink_env::Environment for MyEnvironment {
 ///         #     const MAX_EVENT_TOPICS: usize = 3;
 ///         #     type AccountId = u64;
 ///         #     type Balance = u128;
@@ -180,7 +180,7 @@ use proc_macro::TokenStream;
 ///     }
 ///     ```
 ///
-///     **Default value:** `DefaultEnvTypes` defined in `ink_env` crate.
+///     **Default value:** `DefaultEnvironment` defined in `ink_env` crate.
 ///
 /// ## Anaylsis
 ///
@@ -377,8 +377,8 @@ use proc_macro::TokenStream;
 ///
 /// For example it is possible to query the current call's caller via:
 /// ```
-/// # ink_env::test::run_test::<ink_env::DefaultEnvTypes, _>(|_| {
-/// let caller = ink_env::caller::<ink_env::DefaultEnvTypes>();
+/// # ink_env::test::run_test::<ink_env::DefaultEnvironment, _>(|_| {
+/// let caller = ink_env::caller::<ink_env::DefaultEnvironment>();
 /// # let _caller = caller;
 /// # Ok(())
 /// # }).unwrap();
@@ -521,7 +521,7 @@ pub fn contract(attr: TokenStream, item: TokenStream) -> TokenStream {
 ///
 /// ```
 /// use ink_lang as ink;
-/// # type Balance = <ink_env::DefaultEnvTypes as ink_env::EnvTypes>::Balance;
+/// # type Balance = <ink_env::DefaultEnvironment as ink_env::Environment>::Balance;
 ///
 /// #[ink::trait_definition]
 /// pub trait Erc20 {
@@ -620,7 +620,7 @@ pub fn trait_definition(attr: TokenStream, item: TokenStream) -> TokenStream {
 ///     // Conventional unit test that returns some Result.
 ///     // The test code can make use of operator-`?`.
 ///     #[ink::test]
-///     fn test2() -> Result<(), ink_env::EnvError> {
+///     fn test2() -> Result<(), ink_env::Error> {
 ///         // test code that returns a Rust Result type
 ///     }
 /// }
diff --git a/crates/lang/src/cross_calling.rs b/crates/lang/src/cross_calling.rs
index 1b2799b81f..36479a1500 100644
--- a/crates/lang/src/cross_calling.rs
+++ b/crates/lang/src/cross_calling.rs
@@ -12,7 +12,7 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-use ink_env::EnvTypes;
+use ink_env::Environment;
 
 /// The type that can never be returned because it is not possible to craft an instance of it.
 #[doc(hidden)]
@@ -49,8 +49,8 @@ pub trait ForwardCallMut {
 /// Allows them to return their underlying account identifier.
 pub trait ToAccountId<T>
 where
-    T: EnvTypes,
+    T: Environment,
 {
     /// Returns the underlying account identifier of the instantiated contract.
-    fn to_account_id(&self) -> <T as EnvTypes>::AccountId;
+    fn to_account_id(&self) -> <T as Environment>::AccountId;
 }
diff --git a/crates/lang/src/dispatcher.rs b/crates/lang/src/dispatcher.rs
index b9eefade42..c496d7477e 100644
--- a/crates/lang/src/dispatcher.rs
+++ b/crates/lang/src/dispatcher.rs
@@ -25,7 +25,7 @@ use core::{
     mem::ManuallyDrop,
 };
 use ink_env::{
-    EnvTypes,
+    Environment,
     ReturnFlags,
 };
 use ink_primitives::Key;
@@ -105,7 +105,7 @@ pub fn execute_message<E, M, F>(
     f: F,
 ) -> Result<()>
 where
-    E: EnvTypes,
+    E: Environment,
     M: MessageRef,
     F: FnOnce(&<M as FnState>::State) -> <M as FnOutput>::Output,
 {
@@ -139,11 +139,11 @@ where
 #[doc(hidden)]
 pub fn deny_payment<E>() -> Result<()>
 where
-    E: EnvTypes,
+    E: Environment,
 {
     let transferred = ink_env::transferred_balance::<E>()
         .expect("encountered error while querying transferred balance");
-    if transferred != <E as EnvTypes>::Balance::from(0u32) {
+    if transferred != <E as Environment>::Balance::from(0u32) {
         return Err(DispatchError::PaidUnpayableMessage)
     }
     Ok(())
@@ -163,7 +163,7 @@ pub fn execute_message_mut<E, M, F>(
     f: F,
 ) -> Result<()>
 where
-    E: EnvTypes,
+    E: Environment,
     M: MessageMut,
     F: FnOnce(&mut <M as FnState>::State) -> <M as FnOutput>::Output,
 {
diff --git a/crates/lang/src/env_access.rs b/crates/lang/src/env_access.rs
index 983dfb5113..33e76df182 100644
--- a/crates/lang/src/env_access.rs
+++ b/crates/lang/src/env_access.rs
@@ -23,7 +23,7 @@ use ink_env::{
         CryptoHash,
         HashOutput,
     },
-    EnvTypes,
+    Environment,
     Result,
 };
 use ink_primitives::Key;
@@ -31,7 +31,7 @@ use ink_primitives::Key;
 /// The environment of the compiled ink! smart contract.
 pub trait ContractEnv {
     /// The environment type.
-    type Env: ::ink_env::EnvTypes;
+    type Env: ::ink_env::Environment;
 }
 
 /// Simplifies interaction with the host environment via `self`.
@@ -91,7 +91,7 @@ impl<'a, E> core::fmt::Debug for EnvAccess<'a, E> {
 
 impl<'a, T> EnvAccess<'a, T>
 where
-    T: EnvTypes,
+    T: Environment,
 {
     /// Returns the address of the caller of the executed contract.
     ///
diff --git a/crates/lang/src/traits.rs b/crates/lang/src/traits.rs
index b35dcd7ec3..a4feec6c74 100644
--- a/crates/lang/src/traits.rs
+++ b/crates/lang/src/traits.rs
@@ -22,7 +22,7 @@ use ink_env::{
         ExecutionInput,
         Selector,
     },
-    EnvTypes,
+    Environment,
 };
 use ink_storage::traits::SpreadLayout;
 
@@ -47,7 +47,7 @@ impl<T, E, Callee, GasCost, TransferredValue, Args> ImpliesReturn<T>
         Set<ReturnType<T>>,
     >
 where
-    E: EnvTypes,
+    E: Environment,
 {
 }
 
@@ -61,7 +61,7 @@ impl<E, Callee, GasCost, TransferredValue, Args> ImpliesReturn<()>
         Set<()>,
     >
 where
-    E: EnvTypes,
+    E: Environment,
 {
 }
 
diff --git a/crates/metadata/src/layout/mod.rs b/crates/metadata/src/layout/mod.rs
index 522f308075..aa106b488c 100644
--- a/crates/metadata/src/layout/mod.rs
+++ b/crates/metadata/src/layout/mod.rs
@@ -319,6 +319,7 @@ pub enum CryptoHasher {
     serialize = "F::Type: Serialize, F::String: Serialize",
     deserialize = "F::Type: DeserializeOwned, F::String: DeserializeOwned"
 ))]
+#[serde(rename_all = "camelCase")]
 pub struct ArrayLayout<F: Form = MetaForm> {
     /// The offset key of the array layout.
     ///
@@ -522,6 +523,7 @@ impl Discriminant {
     serialize = "F::Type: Serialize, F::String: Serialize",
     deserialize = "F::Type: DeserializeOwned, F::String: DeserializeOwned"
 ))]
+#[serde(rename_all = "camelCase")]
 pub struct EnumLayout<F: Form = MetaForm> {
     /// The key where the discriminant is stored to dispatch the variants.
     dispatch_key: LayoutKey,
diff --git a/crates/prelude/Cargo.toml b/crates/prelude/Cargo.toml
index ee244abdcd..ffbb0f8503 100644
--- a/crates/prelude/Cargo.toml
+++ b/crates/prelude/Cargo.toml
@@ -22,7 +22,7 @@ name = "ink_prelude"
 path = "lib.rs"
 
 [dependencies]
-cfg-if = "0.1"
+cfg-if = "1.0"
 
 [features]
 default = ["std"]
diff --git a/crates/storage/Cargo.toml b/crates/storage/Cargo.toml
index 508cef66d8..35dc7c6e0e 100644
--- a/crates/storage/Cargo.toml
+++ b/crates/storage/Cargo.toml
@@ -24,7 +24,7 @@ ink_prelude = { version = "3.0.0", path = "../prelude/", default-features = fals
 scale = { package = "parity-scale-codec", version = "1.3", default-features = false, features = ["derive", "full"] }
 derive_more = { version = "0.99", default-features = false, features = ["from", "display"] }
 scale-info = { version = "0.4", default-features = false, features = ["derive"], optional = true }
-cfg-if = "0.1"
+cfg-if = "1.0"
 array-init = "0.1"
 generic-array = "0.14.1"
 
diff --git a/crates/storage/benches/bench_bitstash.rs b/crates/storage/benches/bench_bitstash.rs
index 3d81f7d96a..a659ccb43e 100644
--- a/crates/storage/benches/bench_bitstash.rs
+++ b/crates/storage/benches/bench_bitstash.rs
@@ -112,7 +112,7 @@ mod empty_cache {
 /// into the contract storage. We then load the stash from storage lazily in each
 /// benchmark iteration.
 fn bench_empty_cache(c: &mut Criterion) {
-    let _ = ink_env::test::run_test::<ink_env::DefaultEnvTypes, _>(|_| {
+    let _ = ink_env::test::run_test::<ink_env::DefaultEnvironment, _>(|_| {
         let mut group = c.benchmark_group("Bench: empty cache");
         group
             .bench_function("fill_bitstash", |b| b.iter(|| empty_cache::fill_bitstash()));
diff --git a/crates/storage/benches/bench_hashmap.rs b/crates/storage/benches/bench_hashmap.rs
index e66780ba18..462435b7a8 100644
--- a/crates/storage/benches/bench_hashmap.rs
+++ b/crates/storage/benches/bench_hashmap.rs
@@ -147,7 +147,7 @@ macro_rules! gen_tests_for_backend {
         }
 
         fn bench_remove_populated_cache(c: &mut Criterion) {
-            let _ = ink_env::test::run_test::<ink_env::DefaultEnvTypes, _>(|_| {
+            let _ = ink_env::test::run_test::<ink_env::DefaultEnvironment, _>(|_| {
                 let mut group = c.benchmark_group(
                     format!("{} Compare: `remove` and `remove_entry_api` (populated cache)", stringify!($backend))
                 );
@@ -172,7 +172,7 @@ macro_rules! gen_tests_for_backend {
         }
 
         fn bench_insert_empty_cache(c: &mut Criterion) {
-            let _ = ink_env::test::run_test::<ink_env::DefaultEnvTypes, _>(|_| {
+            let _ = ink_env::test::run_test::<ink_env::DefaultEnvironment, _>(|_| {
                 let mut group = c.benchmark_group(
                     format!("{} Compare: `insert_and_inc` and `insert_and_inc_entry_api` (empty cache)", stringify!($backend))
                 );
@@ -203,7 +203,7 @@ macro_rules! gen_tests_for_backend {
         }
 
         fn bench_remove_empty_cache(c: &mut Criterion) {
-            let _ = ink_env::test::run_test::<ink_env::DefaultEnvTypes, _>(|_| {
+            let _ = ink_env::test::run_test::<ink_env::DefaultEnvironment, _>(|_| {
                 let mut group =
                     c.benchmark_group(format!("{} Compare: `remove` and `remove_entry_api` (empty cache)", stringify!($backend)));
                 group.bench_function("remove", |b| {
diff --git a/crates/storage/benches/bench_lazy.rs b/crates/storage/benches/bench_lazy.rs
index 611d9a3430..40b38c6a13 100644
--- a/crates/storage/benches/bench_lazy.rs
+++ b/crates/storage/benches/bench_lazy.rs
@@ -82,7 +82,7 @@ mod empty_cache {
 }
 
 fn bench_set_empty_cache(c: &mut Criterion) {
-    let _ = ink_env::test::run_test::<ink_env::DefaultEnvTypes, _>(|_| {
+    let _ = ink_env::test::run_test::<ink_env::DefaultEnvironment, _>(|_| {
         let mut group = c.benchmark_group("Compare: `set` and `deref_mut` (empty cache)");
         group.bench_function(BenchmarkId::new("set", 0), |b| {
             b.iter(|| empty_cache::set())
diff --git a/crates/storage/benches/bench_stash.rs b/crates/storage/benches/bench_stash.rs
index ec3d289b4c..b3ed760f23 100644
--- a/crates/storage/benches/bench_stash.rs
+++ b/crates/storage/benches/bench_stash.rs
@@ -119,7 +119,7 @@ mod empty_cache {
 /// into the contract storage. We then load the stash from storage lazily in each
 /// benchmark iteration.
 fn bench_remove_occupied_empty_cache(c: &mut Criterion) {
-    let _ = ink_env::test::run_test::<ink_env::DefaultEnvTypes, _>(|_| {
+    let _ = ink_env::test::run_test::<ink_env::DefaultEnvironment, _>(|_| {
         let mut group = c.benchmark_group(
             "Compare: `remove_occupied_all` and `take_all` (empty cache)",
         );
diff --git a/crates/storage/benches/bench_vec.rs b/crates/storage/benches/bench_vec.rs
index f4d878fb6a..fd943347f0 100644
--- a/crates/storage/benches/bench_vec.rs
+++ b/crates/storage/benches/bench_vec.rs
@@ -165,7 +165,7 @@ mod empty_cache {
 /// into the contract storage. We then load the vec from storage lazily in each
 /// benchmark iteration.
 fn bench_clear_empty_cache(c: &mut Criterion) {
-    let _ = ink_env::test::run_test::<ink_env::DefaultEnvTypes, _>(|_| {
+    let _ = ink_env::test::run_test::<ink_env::DefaultEnvironment, _>(|_| {
         let mut group = c.benchmark_group("Compare: `clear` and `pop_all` (empty cache)");
         group.bench_function("clear", |b| b.iter(|| empty_cache::clear()));
         group.bench_function("pop_all", |b| b.iter(|| empty_cache::pop_all()));
@@ -179,7 +179,7 @@ fn bench_clear_empty_cache(c: &mut Criterion) {
 /// into the contract storage. We then load the vec from storage lazily in each
 /// benchmark iteration.
 fn bench_put_empty_cache(c: &mut Criterion) {
-    let _ = ink_env::test::run_test::<ink_env::DefaultEnvTypes, _>(|_| {
+    let _ = ink_env::test::run_test::<ink_env::DefaultEnvironment, _>(|_| {
         let mut group = c.benchmark_group("Compare: `set` and `get_mut` (empty cache)");
         group.bench_function("set", |b| b.iter(|| empty_cache::set()));
         group.bench_function("get_mut", |b| b.iter(|| empty_cache::get_mut()));
diff --git a/crates/storage/src/lazy/lazy_array.rs b/crates/storage/src/lazy/lazy_array.rs
index 12238381c1..e5dea0d434 100644
--- a/crates/storage/src/lazy/lazy_array.rs
+++ b/crates/storage/src/lazy/lazy_array.rs
@@ -860,7 +860,7 @@ mod tests {
 
     #[test]
     fn spread_layout_works() -> ink_env::Result<()> {
-        ink_env::test::run_test::<ink_env::DefaultEnvTypes, _>(|_| {
+        ink_env::test::run_test::<ink_env::DefaultEnvironment, _>(|_| {
             let mut larray = <LazyArray<u8, U4>>::new();
             let nothing_changed = &[
                 (0, StorageEntry::new(Some(b'A'), EntryState::Mutated)),
diff --git a/crates/storage/src/lazy/lazy_cell.rs b/crates/storage/src/lazy/lazy_cell.rs
index a98514306d..ec42e4f3fe 100644
--- a/crates/storage/src/lazy/lazy_cell.rs
+++ b/crates/storage/src/lazy/lazy_cell.rs
@@ -393,7 +393,7 @@ mod tests {
 
     #[test]
     fn lazy_get_works() -> ink_env::Result<()> {
-        run_test::<ink_env::DefaultEnvTypes, _>(|_| {
+        run_test::<ink_env::DefaultEnvironment, _>(|_| {
             let cell = <LazyCell<u8>>::lazy(Key::from([0x42; 32]));
             let value = cell.get();
             // We do the normally unreachable check in order to have an easier
@@ -413,7 +413,7 @@ mod tests {
 
     #[test]
     fn spread_layout_works() -> ink_env::Result<()> {
-        run_test::<ink_env::DefaultEnvTypes, _>(|_| {
+        run_test::<ink_env::DefaultEnvironment, _>(|_| {
             let cell_a0 = <LazyCell<u8>>::new(Some(b'A'));
             assert_eq!(cell_a0.get(), Some(&b'A'));
             // Push `cell_a0` to the contract storage.
@@ -458,7 +458,7 @@ mod tests {
 
     #[test]
     fn lazy_set_works() -> ink_env::Result<()> {
-        run_test::<ink_env::DefaultEnvTypes, _>(|_| {
+        run_test::<ink_env::DefaultEnvironment, _>(|_| {
             let mut cell = <LazyCell<u8>>::lazy(Key::from([0x42; 32]));
             let value = cell.get();
             assert_eq!(value, None);
@@ -471,7 +471,7 @@ mod tests {
 
     #[test]
     fn lazy_set_works_with_spread_layout_push_pull() -> ink_env::Result<()> {
-        run_test::<ink_env::DefaultEnvTypes, _>(|_| {
+        run_test::<ink_env::DefaultEnvironment, _>(|_| {
             type MaybeValue = Option<u8>;
 
             // Initialize a LazyCell with None and push it to `k`
diff --git a/crates/storage/src/lazy/lazy_hmap.rs b/crates/storage/src/lazy/lazy_hmap.rs
index 49a009b0f8..e01d343caf 100644
--- a/crates/storage/src/lazy/lazy_hmap.rs
+++ b/crates/storage/src/lazy/lazy_hmap.rs
@@ -1272,7 +1272,7 @@ mod tests {
 
     #[test]
     fn spread_layout_works() -> ink_env::Result<()> {
-        ink_env::test::run_test::<ink_env::DefaultEnvTypes, _>(|_| {
+        ink_env::test::run_test::<ink_env::DefaultEnvironment, _>(|_| {
             let mut hmap = new_hmap();
             let nothing_changed = &[
                 (1, StorageEntry::new(Some(b'A'), EntryState::Mutated)),
diff --git a/crates/storage/src/lazy/lazy_imap.rs b/crates/storage/src/lazy/lazy_imap.rs
index 6e0e5ca276..90e6b41206 100644
--- a/crates/storage/src/lazy/lazy_imap.rs
+++ b/crates/storage/src/lazy/lazy_imap.rs
@@ -699,7 +699,7 @@ mod tests {
 
     #[test]
     fn spread_layout_works() -> ink_env::Result<()> {
-        ink_env::test::run_test::<ink_env::DefaultEnvTypes, _>(|_| {
+        ink_env::test::run_test::<ink_env::DefaultEnvironment, _>(|_| {
             let mut imap = <LazyIndexMap<u8>>::new();
             let nothing_changed = &[
                 (1, StorageEntry::new(Some(b'A'), EntryState::Mutated)),
diff --git a/crates/storage/src/memory.rs b/crates/storage/src/memory.rs
index f660c50e95..22cec01edc 100644
--- a/crates/storage/src/memory.rs
+++ b/crates/storage/src/memory.rs
@@ -263,9 +263,9 @@ mod tests {
 
     fn run_test<F>(f: F)
     where
-        F: FnOnce(DefaultAccounts<ink_env::DefaultEnvTypes>),
+        F: FnOnce(DefaultAccounts<ink_env::DefaultEnvironment>),
     {
-        ink_env::test::run_test::<ink_env::DefaultEnvTypes, _>(|default_accounts| {
+        ink_env::test::run_test::<ink_env::DefaultEnvironment, _>(|default_accounts| {
             f(default_accounts);
             Ok(())
         })
diff --git a/crates/storage/src/pack.rs b/crates/storage/src/pack.rs
index 8b72447863..e49d2fc356 100644
--- a/crates/storage/src/pack.rs
+++ b/crates/storage/src/pack.rs
@@ -367,9 +367,9 @@ mod tests {
 
     fn run_test<F>(f: F)
     where
-        F: FnOnce(DefaultAccounts<ink_env::DefaultEnvTypes>),
+        F: FnOnce(DefaultAccounts<ink_env::DefaultEnvironment>),
     {
-        ink_env::test::run_test::<ink_env::DefaultEnvTypes, _>(|default_accounts| {
+        ink_env::test::run_test::<ink_env::DefaultEnvironment, _>(|default_accounts| {
             f(default_accounts);
             Ok(())
         })
diff --git a/crates/storage/src/traits/impls/prims.rs b/crates/storage/src/traits/impls/prims.rs
index f7c7bc3f1f..dc61f411dc 100644
--- a/crates/storage/src/traits/impls/prims.rs
+++ b/crates/storage/src/traits/impls/prims.rs
@@ -248,7 +248,7 @@ mod tests {
     where
         F: FnOnce(),
     {
-        ink_env::test::run_test::<ink_env::DefaultEnvTypes, _>(|_| {
+        ink_env::test::run_test::<ink_env::DefaultEnvironment, _>(|_| {
             f();
             Ok(())
         })
diff --git a/examples/dns/lib.rs b/examples/dns/lib.rs
index ab8345bd36..7bd6f79fb7 100644
--- a/examples/dns/lib.rs
+++ b/examples/dns/lib.rs
@@ -187,14 +187,14 @@ mod dns {
         const DEFAULT_ENDOWMENT: Balance = 1_000_000;
         const DEFAULT_GAS_LIMIT: Balance = 1_000_000;
 
-        fn default_accounts() -> ink_env::test::DefaultAccounts<ink_env::DefaultEnvTypes>
-        {
-            ink_env::test::default_accounts::<ink_env::DefaultEnvTypes>()
+        fn default_accounts(
+        ) -> ink_env::test::DefaultAccounts<ink_env::DefaultEnvironment> {
+            ink_env::test::default_accounts::<ink_env::DefaultEnvironment>()
                 .expect("off-chain environment should have been initialized already")
         }
 
         fn set_next_caller(caller: AccountId) {
-            ink_env::test::push_execution_context::<ink_env::DefaultEnvTypes>(
+            ink_env::test::push_execution_context::<ink_env::DefaultEnvironment>(
                 caller,
                 AccountId::from(DEFAULT_CALLEE_HASH),
                 DEFAULT_ENDOWMENT,
diff --git a/examples/erc20/lib.rs b/examples/erc20/lib.rs
index 4361903f2c..27d1fbd0bb 100644
--- a/examples/erc20/lib.rs
+++ b/examples/erc20/lib.rs
@@ -269,8 +269,9 @@ mod erc20 {
                 Some(AccountId::from([0x01; 32])),
                 100,
             );
-            let accounts = ink_env::test::default_accounts::<ink_env::DefaultEnvTypes>()
-                .expect("Cannot get accounts");
+            let accounts =
+                ink_env::test::default_accounts::<ink_env::DefaultEnvironment>()
+                    .expect("Cannot get accounts");
             // Alice owns all the tokens on deployment
             assert_eq!(erc20.balance_of(accounts.alice), 100);
             // Bob does not owns tokens
@@ -282,8 +283,9 @@ mod erc20 {
             // Constructor works.
             let mut erc20 = Erc20::new(100);
             // Transfer event triggered during initial construction.
-            let accounts = ink_env::test::default_accounts::<ink_env::DefaultEnvTypes>()
-                .expect("Cannot get accounts");
+            let accounts =
+                ink_env::test::default_accounts::<ink_env::DefaultEnvironment>()
+                    .expect("Cannot get accounts");
 
             assert_eq!(erc20.balance_of(accounts.bob), 0);
             // Alice transfers 10 tokens to Bob.
@@ -313,12 +315,13 @@ mod erc20 {
         fn invalid_transfer_should_fail() {
             // Constructor works.
             let mut erc20 = Erc20::new(100);
-            let accounts = ink_env::test::default_accounts::<ink_env::DefaultEnvTypes>()
-                .expect("Cannot get accounts");
+            let accounts =
+                ink_env::test::default_accounts::<ink_env::DefaultEnvironment>()
+                    .expect("Cannot get accounts");
 
             assert_eq!(erc20.balance_of(accounts.bob), 0);
             // Get contract address.
-            let callee = ink_env::account_id::<ink_env::DefaultEnvTypes>()
+            let callee = ink_env::account_id::<ink_env::DefaultEnvironment>()
                 .unwrap_or([0x0; 32].into());
             // Create call
             let mut data =
@@ -326,7 +329,7 @@ mod erc20 {
             data.push_arg(&accounts.bob);
             // Push the new execution context to set Bob as caller
             assert_eq!(
-                ink_env::test::push_execution_context::<ink_env::DefaultEnvTypes>(
+                ink_env::test::push_execution_context::<ink_env::DefaultEnvironment>(
                     accounts.bob,
                     callee,
                     1000000,
@@ -359,8 +362,9 @@ mod erc20 {
             // Constructor works.
             let mut erc20 = Erc20::new(100);
             // Transfer event triggered during initial construction.
-            let accounts = ink_env::test::default_accounts::<ink_env::DefaultEnvTypes>()
-                .expect("Cannot get accounts");
+            let accounts =
+                ink_env::test::default_accounts::<ink_env::DefaultEnvironment>()
+                    .expect("Cannot get accounts");
 
             // Bob fails to transfer tokens owned by Alice.
             assert_eq!(erc20.transfer_from(accounts.alice, accounts.eve, 10), false);
@@ -371,7 +375,7 @@ mod erc20 {
             assert_eq!(ink_env::test::recorded_events().count(), 2);
 
             // Get contract address.
-            let callee = ink_env::account_id::<ink_env::DefaultEnvTypes>()
+            let callee = ink_env::account_id::<ink_env::DefaultEnvironment>()
                 .unwrap_or([0x0; 32].into());
             // Create call.
             let mut data =
@@ -379,7 +383,7 @@ mod erc20 {
             data.push_arg(&accounts.bob);
             // Push the new execution context to set Bob as caller.
             assert_eq!(
-                ink_env::test::push_execution_context::<ink_env::DefaultEnvTypes>(
+                ink_env::test::push_execution_context::<ink_env::DefaultEnvironment>(
                     accounts.bob,
                     callee,
                     1000000,
diff --git a/examples/erc721/lib.rs b/examples/erc721/lib.rs
index d7d34504a0..42197ed3d0 100644
--- a/examples/erc721/lib.rs
+++ b/examples/erc721/lib.rs
@@ -449,8 +449,9 @@ mod erc721 {
 
         #[ink::test]
         fn mint_works() {
-            let accounts = ink_env::test::default_accounts::<ink_env::DefaultEnvTypes>()
-                .expect("Cannot get accounts");
+            let accounts =
+                ink_env::test::default_accounts::<ink_env::DefaultEnvironment>()
+                    .expect("Cannot get accounts");
             // Create a new contract instance.
             let mut erc721 = Erc721::new();
             // Token 1 does not exists.
@@ -465,8 +466,9 @@ mod erc721 {
 
         #[ink::test]
         fn mint_existing_should_fail() {
-            let accounts = ink_env::test::default_accounts::<ink_env::DefaultEnvTypes>()
-                .expect("Cannot get accounts");
+            let accounts =
+                ink_env::test::default_accounts::<ink_env::DefaultEnvironment>()
+                    .expect("Cannot get accounts");
             // Create a new contract instance.
             let mut erc721 = Erc721::new();
             // Create token Id 1.
@@ -484,8 +486,9 @@ mod erc721 {
 
         #[ink::test]
         fn transfer_works() {
-            let accounts = ink_env::test::default_accounts::<ink_env::DefaultEnvTypes>()
-                .expect("Cannot get accounts");
+            let accounts =
+                ink_env::test::default_accounts::<ink_env::DefaultEnvironment>()
+                    .expect("Cannot get accounts");
             // Create a new contract instance.
             let mut erc721 = Erc721::new();
             // Create token Id 1 for Alice
@@ -506,8 +509,9 @@ mod erc721 {
 
         #[ink::test]
         fn invalid_transfer_should_fail() {
-            let accounts = ink_env::test::default_accounts::<ink_env::DefaultEnvTypes>()
-                .expect("Cannot get accounts");
+            let accounts =
+                ink_env::test::default_accounts::<ink_env::DefaultEnvironment>()
+                    .expect("Cannot get accounts");
             // Create a new contract instance.
             let mut erc721 = Erc721::new();
             // Transfer token fails if it does not exists.
@@ -521,7 +525,7 @@ mod erc721 {
             // Token Id 2 is owned by Alice.
             assert_eq!(erc721.owner_of(2), Some(accounts.alice));
             // Get contract address
-            let callee = ink_env::account_id::<ink_env::DefaultEnvTypes>()
+            let callee = ink_env::account_id::<ink_env::DefaultEnvironment>()
                 .unwrap_or([0x0; 32].into());
             // Create call
             let mut data =
@@ -529,7 +533,7 @@ mod erc721 {
             data.push_arg(&accounts.bob);
             // Push the new execution context to set Bob as caller
             assert_eq!(
-                ink_env::test::push_execution_context::<ink_env::DefaultEnvTypes>(
+                ink_env::test::push_execution_context::<ink_env::DefaultEnvironment>(
                     accounts.bob,
                     callee,
                     1000000,
@@ -544,8 +548,9 @@ mod erc721 {
 
         #[ink::test]
         fn approved_transfer_works() {
-            let accounts = ink_env::test::default_accounts::<ink_env::DefaultEnvTypes>()
-                .expect("Cannot get accounts");
+            let accounts =
+                ink_env::test::default_accounts::<ink_env::DefaultEnvironment>()
+                    .expect("Cannot get accounts");
             // Create a new contract instance.
             let mut erc721 = Erc721::new();
             // Create token Id 1.
@@ -555,7 +560,7 @@ mod erc721 {
             // Approve token Id 1 transfer for Bob on behalf of Alice.
             assert_eq!(erc721.approve(accounts.bob, 1), Ok(()));
             // Get contract address.
-            let callee = ink_env::account_id::<ink_env::DefaultEnvTypes>()
+            let callee = ink_env::account_id::<ink_env::DefaultEnvironment>()
                 .unwrap_or([0x0; 32].into());
             // Create call
             let mut data =
@@ -563,7 +568,7 @@ mod erc721 {
             data.push_arg(&accounts.bob);
             // Push the new execution context to set Bob as caller
             assert_eq!(
-                ink_env::test::push_execution_context::<ink_env::DefaultEnvTypes>(
+                ink_env::test::push_execution_context::<ink_env::DefaultEnvironment>(
                     accounts.bob,
                     callee,
                     1000000,
@@ -589,8 +594,9 @@ mod erc721 {
 
         #[ink::test]
         fn approved_for_all_works() {
-            let accounts = ink_env::test::default_accounts::<ink_env::DefaultEnvTypes>()
-                .expect("Cannot get accounts");
+            let accounts =
+                ink_env::test::default_accounts::<ink_env::DefaultEnvironment>()
+                    .expect("Cannot get accounts");
             // Create a new contract instance.
             let mut erc721 = Erc721::new();
             // Create token Id 1.
@@ -607,7 +613,7 @@ mod erc721 {
                 true
             );
             // Get contract address.
-            let callee = ink_env::account_id::<ink_env::DefaultEnvTypes>()
+            let callee = ink_env::account_id::<ink_env::DefaultEnvironment>()
                 .unwrap_or([0x0; 32].into());
             // Create call
             let mut data =
@@ -615,7 +621,7 @@ mod erc721 {
             data.push_arg(&accounts.bob);
             // Push the new execution context to set Bob as caller
             assert_eq!(
-                ink_env::test::push_execution_context::<ink_env::DefaultEnvTypes>(
+                ink_env::test::push_execution_context::<ink_env::DefaultEnvironment>(
                     accounts.bob,
                     callee,
                     1000000,
@@ -655,8 +661,9 @@ mod erc721 {
 
         #[ink::test]
         fn not_approved_transfer_should_fail() {
-            let accounts = ink_env::test::default_accounts::<ink_env::DefaultEnvTypes>()
-                .expect("Cannot get accounts");
+            let accounts =
+                ink_env::test::default_accounts::<ink_env::DefaultEnvironment>()
+                    .expect("Cannot get accounts");
             // Create a new contract instance.
             let mut erc721 = Erc721::new();
             // Create token Id 1.
@@ -668,7 +675,7 @@ mod erc721 {
             // Eve does not owns tokens.
             assert_eq!(erc721.balance_of(accounts.eve), 0);
             // Get contract address.
-            let callee = ink_env::account_id::<ink_env::DefaultEnvTypes>()
+            let callee = ink_env::account_id::<ink_env::DefaultEnvironment>()
                 .unwrap_or([0x0; 32].into());
             // Create call
             let mut data =
@@ -676,7 +683,7 @@ mod erc721 {
             data.push_arg(&accounts.bob);
             // Push the new execution context to set Eve as caller
             assert_eq!(
-                ink_env::test::push_execution_context::<ink_env::DefaultEnvTypes>(
+                ink_env::test::push_execution_context::<ink_env::DefaultEnvironment>(
                     accounts.eve,
                     callee,
                     1000000,
@@ -700,8 +707,9 @@ mod erc721 {
 
         #[ink::test]
         fn burn_works() {
-            let accounts = ink_env::test::default_accounts::<ink_env::DefaultEnvTypes>()
-                .expect("Cannot get accounts");
+            let accounts =
+                ink_env::test::default_accounts::<ink_env::DefaultEnvironment>()
+                    .expect("Cannot get accounts");
             // Create a new contract instance.
             let mut erc721 = Erc721::new();
             // Create token Id 1 for Alice
@@ -728,8 +736,9 @@ mod erc721 {
 
         #[ink::test]
         fn burn_fails_not_owner() {
-            let accounts = ink_env::test::default_accounts::<ink_env::DefaultEnvTypes>()
-                .expect("Cannot get accounts");
+            let accounts =
+                ink_env::test::default_accounts::<ink_env::DefaultEnvironment>()
+                    .expect("Cannot get accounts");
             // Create a new contract instance.
             let mut erc721 = Erc721::new();
             // Create token Id 1 for Alice
@@ -740,9 +749,9 @@ mod erc721 {
         }
 
         fn set_sender(sender: AccountId) {
-            let callee = ink_env::account_id::<ink_env::DefaultEnvTypes>()
+            let callee = ink_env::account_id::<ink_env::DefaultEnvironment>()
                 .unwrap_or([0x0; 32].into());
-            test::push_execution_context::<EnvTypes>(
+            test::push_execution_context::<Environment>(
                 sender,
                 callee,
                 1000000,
diff --git a/examples/multisig_plain/lib.rs b/examples/multisig_plain/lib.rs
index cbce7484d3..f80a5243b5 100755
--- a/examples/multisig_plain/lib.rs
+++ b/examples/multisig_plain/lib.rs
@@ -292,7 +292,7 @@ mod multisig_plain {
         /// Since this message must be send by the wallet itself it has to be build as a
         /// `Transaction` and dispatched through `submit_transaction` + `invoke_transaction`:
         /// ```no_run
-        /// use ink_env::{DefaultEnvTypes as Env, AccountId, call::{CallParams, Selector}, test::CallData};
+        /// use ink_env::{DefaultEnvironment as Env, AccountId, call::{CallParams, Selector}, test::CallData};
         /// use multisig_plain::{Transaction, ConfirmationStatus};
         ///
         /// // address of an existing MultiSigPlain contract
@@ -659,7 +659,7 @@ mod multisig_plain {
             call,
             test,
         };
-        type Accounts = test::DefaultAccounts<EnvTypes>;
+        type Accounts = test::DefaultAccounts<Environment>;
         const WALLET: [u8; 32] = [7; 32];
 
         impl Transaction {
@@ -677,7 +677,7 @@ mod multisig_plain {
         }
 
         fn set_sender(sender: AccountId) {
-            test::push_execution_context::<EnvTypes>(
+            test::push_execution_context::<Environment>(
                 sender,
                 WALLET.into(),
                 1000000,


Test patch:
diff --git a/crates/env/src/engine/off_chain/test_api.rs b/crates/env/src/engine/off_chain/test_api.rs
index 1f7d124bc8..4626f6d483 100644
--- a/crates/env/src/engine/off_chain/test_api.rs
+++ b/crates/env/src/engine/off_chain/test_api.rs
@@ -28,7 +28,7 @@ use super::{
     OnInstance,
 };
 use crate::{
-    EnvTypes,
+    Environment,
     Result,
 };
 use ink_prelude::string::String;
@@ -48,7 +48,7 @@ pub fn push_execution_context<T>(
     endowment: T::Balance,
     call_data: CallData,
 ) where
-    T: EnvTypes,
+    T: Environment,
 {
     <EnvInstance as OnInstance>::on_instance(|instance| {
         instance.exec_context.push(
@@ -92,7 +92,7 @@ pub fn set_account_balance<T>(
     new_balance: T::Balance,
 ) -> Result<()>
 where
-    T: EnvTypes,
+    T: Environment,
 {
     <EnvInstance as OnInstance>::on_instance(|instance| {
         instance
@@ -118,7 +118,7 @@ where
 /// - If the underlying `account` type does not match.
 pub fn get_account_balance<T>(account_id: T::AccountId) -> Result<T::Balance>
 where
-    T: EnvTypes,
+    T: Environment,
 {
     <EnvInstance as OnInstance>::on_instance(|instance| {
         instance
@@ -142,7 +142,7 @@ pub fn set_contract_rent_allowance<T>(
     new_rent_allowance: T::Balance,
 ) -> Result<()>
 where
-    T: EnvTypes,
+    T: Environment,
 {
     <EnvInstance as OnInstance>::on_instance(|instance| {
         instance
@@ -167,7 +167,7 @@ where
 /// - If the returned rent allowance cannot be properly decoded.
 pub fn get_contract_rent_allowance<T>(account_id: T::AccountId) -> Result<T::Balance>
 where
-    T: EnvTypes,
+    T: Environment,
 {
     <EnvInstance as OnInstance>::on_instance(|instance| {
         instance
@@ -201,7 +201,7 @@ where
 /// This allows to control what [`crate::random`] returns.
 pub fn set_block_entropy<T>(entropy: T::Hash) -> Result<()>
 where
-    T: EnvTypes,
+    T: Environment,
 {
     <EnvInstance as OnInstance>::on_instance(|instance| {
         instance.current_block_mut()?.set_entropy::<T>(entropy)
@@ -255,7 +255,7 @@ pub fn recorded_events() -> impl Iterator<Item = EmittedEvent> {
 /// Advances the chain by a single block.
 pub fn advance_block<T>() -> Result<()>
 where
-    T: EnvTypes,
+    T: Environment,
 {
     <EnvInstance as OnInstance>::on_instance(|instance| instance.advance_block::<T>())
 }
@@ -263,7 +263,7 @@ where
 /// The default accounts.
 pub struct DefaultAccounts<T>
 where
-    T: EnvTypes,
+    T: Environment,
 {
     /// The predefined `ALICE` account holding substantial amounts of value.
     pub alice: T::AccountId,
@@ -283,8 +283,8 @@ where
 /// Alice, Bob, Charlie, Django, Eve and Frank.
 pub fn default_accounts<T>() -> Result<DefaultAccounts<T>>
 where
-    T: EnvTypes,
-    <T as EnvTypes>::AccountId: From<[u8; 32]>,
+    T: Environment,
+    <T as Environment>::AccountId: From<[u8; 32]>,
 {
     Ok(DefaultAccounts {
         alice: T::AccountId::from([0x01; 32]),
@@ -304,8 +304,8 @@ where
 /// uses cases.
 pub fn initialize_or_reset_as_default<T>() -> Result<()>
 where
-    T: EnvTypes,
-    <T as EnvTypes>::AccountId: From<[u8; 32]>,
+    T: Environment,
+    <T as Environment>::AccountId: From<[u8; 32]>,
 {
     <EnvInstance as OnInstance>::on_instance(|instance| {
         instance.initialize_or_reset_as_default::<T>()
@@ -316,9 +316,9 @@ where
 /// for the off-chain environment.
 pub fn run_test<T, F>(f: F) -> Result<()>
 where
-    T: EnvTypes,
+    T: Environment,
     F: FnOnce(DefaultAccounts<T>) -> Result<()>,
-    <T as EnvTypes>::AccountId: From<[u8; 32]>,
+    <T as Environment>::AccountId: From<[u8; 32]>,
 {
     initialize_or_reset_as_default::<T>()?;
     let default_accounts = default_accounts::<T>()?;
@@ -328,7 +328,7 @@ where
 /// Returns the total number of reads and writes of the contract's storage.
 pub fn get_contract_storage_rw<T>(account_id: &T::AccountId) -> Result<(usize, usize)>
 where
-    T: EnvTypes,
+    T: Environment,
 {
     <EnvInstance as OnInstance>::on_instance(|instance| {
         instance
diff --git a/crates/env/src/engine/off_chain/tests.rs b/crates/env/src/engine/off_chain/tests.rs
index 28e36fff2f..ff939a793c 100644
--- a/crates/env/src/engine/off_chain/tests.rs
+++ b/crates/env/src/engine/off_chain/tests.rs
@@ -17,7 +17,7 @@ use ink_primitives::Key;
 
 #[test]
 fn store_load_clear() -> Result<()> {
-    crate::test::run_test::<crate::DefaultEnvTypes, _>(|_| {
+    crate::test::run_test::<crate::DefaultEnvironment, _>(|_| {
         let key = Key::from([0x42; 32]);
         assert_eq!(crate::get_contract_storage::<()>(&key), Ok(None));
         crate::set_contract_storage(&key, &[0x05_u8; 5]);
@@ -33,7 +33,7 @@ fn store_load_clear() -> Result<()> {
 
 #[test]
 fn key_add() -> Result<()> {
-    crate::test::run_test::<crate::DefaultEnvTypes, _>(|_| {
+    crate::test::run_test::<crate::DefaultEnvironment, _>(|_| {
         let key00 = Key::from([0x0; 32]);
         let key05 = key00 + 05_u64; // -> 5
         let key10 = key00 + 10_u64; // -> 10         | same as key55
@@ -48,7 +48,7 @@ fn key_add() -> Result<()> {
 
 #[test]
 fn key_add_sub() -> Result<()> {
-    crate::test::run_test::<crate::DefaultEnvTypes, _>(|_| {
+    crate::test::run_test::<crate::DefaultEnvironment, _>(|_| {
         let key0a = Key::from([0x0; 32]);
         let key1a = key0a + 1337_u64;
         let key2a = key0a + 42_u64;
@@ -68,23 +68,23 @@ fn key_add_sub() -> Result<()> {
 
 #[test]
 fn gas_price() -> crate::Result<()> {
-    crate::test::run_test::<crate::DefaultEnvTypes, _>(|_| {
+    crate::test::run_test::<crate::DefaultEnvironment, _>(|_| {
         let gas_price = 2u32;
         crate::test::update_chain_spec(|chain_spec| {
-            chain_spec.set_gas_price::<crate::DefaultEnvTypes>(gas_price.into())
+            chain_spec.set_gas_price::<crate::DefaultEnvironment>(gas_price.into())
         })?;
 
         assert_eq!(
             2u128,
-            crate::weight_to_fee::<crate::DefaultEnvTypes>(1).unwrap()
+            crate::weight_to_fee::<crate::DefaultEnvironment>(1).unwrap()
         );
         assert_eq!(
             20u128,
-            crate::weight_to_fee::<crate::DefaultEnvTypes>(10).unwrap()
+            crate::weight_to_fee::<crate::DefaultEnvironment>(10).unwrap()
         );
         assert_eq!(
             6u128,
-            crate::weight_to_fee::<crate::DefaultEnvTypes>(3).unwrap()
+            crate::weight_to_fee::<crate::DefaultEnvironment>(3).unwrap()
         );
 
         Ok(())
diff --git a/crates/lang/codegen/src/generator/ink_test.rs b/crates/lang/codegen/src/generator/ink_test.rs
index f0ae484c53..ac7ef2f142 100644
--- a/crates/lang/codegen/src/generator/ink_test.rs
+++ b/crates/lang/codegen/src/generator/ink_test.rs
@@ -45,7 +45,7 @@ impl GenerateCode for InkTest<'_> {
                     #( #attrs )*
                     #[test]
                     #vis fn #fn_name( #fn_args ) {
-                        ::ink_env::test::run_test::<::ink_env::DefaultEnvTypes, _>(|_| {
+                        ::ink_env::test::run_test::<::ink_env::DefaultEnvironment, _>(|_| {
                             {
                                 let _: () = {
                                     #fn_block
@@ -62,7 +62,7 @@ impl GenerateCode for InkTest<'_> {
                     #( #attrs )*
                     #[test]
                     #vis fn #fn_name( #fn_args ) #rarrow #ret_type {
-                        ::ink_env::test::run_test::<::ink_env::DefaultEnvTypes, _>(|_| {
+                        ::ink_env::test::run_test::<::ink_env::DefaultEnvironment, _>(|_| {
                             #fn_block
                         })
                     }
diff --git a/crates/lang/macro/tests/compile_tests.rs b/crates/lang/macro/tests/compile_tests.rs
index e65e8a5153..44a9ebec7d 100644
--- a/crates/lang/macro/tests/compile_tests.rs
+++ b/crates/lang/macro/tests/compile_tests.rs
@@ -43,7 +43,7 @@ fn compile_tests() {
     t.compile_fail("tests/ui/fail/M-01-missing-message.rs");
     t.compile_fail("tests/ui/fail/M-02-message-missing-self-arg.rs");
     t.compile_fail("tests/ui/fail/M-03-message-returns-self.rs");
-    // t.compile_fail("tests/ui/fail/M-04-message-returns-non-codec.rs");
+    t.compile_fail("tests/ui/fail/M-04-message-returns-non-codec.rs");
     t.compile_fail("tests/ui/fail/M-10-method-unknown-ink-marker.rs");
 
     t.compile_fail("tests/ui/fail/S-01-missing-storage-struct.rs");
diff --git a/crates/metadata/src/layout/tests.rs b/crates/metadata/src/layout/tests.rs
index 6c0acdc730..b0b82a96f2 100644
--- a/crates/metadata/src/layout/tests.rs
+++ b/crates/metadata/src/layout/tests.rs
@@ -161,7 +161,7 @@ fn clike_enum_work() {
     let expected = serde_json::json! {
         {
             "enum": {
-                "dispatch_key": "0x\
+                "dispatchKey": "0x\
                     0000000000000000\
                     0000000000000000\
                     0000000000000000\
@@ -242,7 +242,7 @@ fn mixed_enum_work() {
     let expected = serde_json::json! {
         {
             "enum": {
-                "dispatch_key": "0x\
+                "dispatchKey": "0x\
                     0000000000000000\
                     0000000000000000\
                     0000000000000000\
diff --git a/crates/storage/src/alloc/boxed/tests.rs b/crates/storage/src/alloc/boxed/tests.rs
index 7f8ac6f0d4..207ee0c1d8 100644
--- a/crates/storage/src/alloc/boxed/tests.rs
+++ b/crates/storage/src/alloc/boxed/tests.rs
@@ -42,9 +42,9 @@ use ink_primitives::Key;
 
 fn run_test<F>(f: F)
 where
-    F: FnOnce(DefaultAccounts<ink_env::DefaultEnvTypes>),
+    F: FnOnce(DefaultAccounts<ink_env::DefaultEnvironment>),
 {
-    ink_env::test::run_test::<ink_env::DefaultEnvTypes, _>(|default_accounts| {
+    ink_env::test::run_test::<ink_env::DefaultEnvironment, _>(|default_accounts| {
         alloc::initialize(ContractPhase::Deploy);
         f(default_accounts);
         Ok(())
diff --git a/crates/storage/src/alloc/tests.rs b/crates/storage/src/alloc/tests.rs
index 26dfd40abc..187eea50ff 100644
--- a/crates/storage/src/alloc/tests.rs
+++ b/crates/storage/src/alloc/tests.rs
@@ -28,7 +28,7 @@ use crate::{
 };
 use ink_env::{
     test,
-    DefaultEnvTypes,
+    DefaultEnvironment,
 };
 use ink_primitives::Key;
 
@@ -37,7 +37,7 @@ where
     F: FnOnce(),
 {
     alloc::initialize(ContractPhase::Deploy);
-    test::run_test::<DefaultEnvTypes, _>(|_| {
+    test::run_test::<DefaultEnvironment, _>(|_| {
         f();
         Ok(())
     })
@@ -189,7 +189,7 @@ fn spread_clear_works() {
 
 #[test]
 fn test_call_setup_works() {
-    test::run_test::<DefaultEnvTypes, _>(|_| {
+    test::run_test::<DefaultEnvironment, _>(|_| {
         let mut allocator = DynamicAllocator::default();
         assert_eq!(allocator.alloc(), DynamicAllocation(0));
         assert_eq!(allocator.alloc(), DynamicAllocation(1));
diff --git a/crates/storage/src/collections/bitstash/fuzz_tests.rs b/crates/storage/src/collections/bitstash/fuzz_tests.rs
index 33153fe09a..4b6e423ad2 100644
--- a/crates/storage/src/collections/bitstash/fuzz_tests.rs
+++ b/crates/storage/src/collections/bitstash/fuzz_tests.rs
@@ -66,7 +66,7 @@ fn put_and_take(xs: Vec<i32>, additional_puts_each: u8) {
 
 #[quickcheck]
 fn repeated_puts_and_takes(xs: Vec<i32>, additional_puts_each: u8) {
-    ink_env::test::run_test::<ink_env::DefaultEnvTypes, _>(|_| {
+    ink_env::test::run_test::<ink_env::DefaultEnvironment, _>(|_| {
         put_and_take(xs, additional_puts_each);
         Ok(())
     })
diff --git a/crates/storage/src/collections/bitstash/tests.rs b/crates/storage/src/collections/bitstash/tests.rs
index ef26f707bf..8cb7e0dd53 100644
--- a/crates/storage/src/collections/bitstash/tests.rs
+++ b/crates/storage/src/collections/bitstash/tests.rs
@@ -126,7 +126,7 @@ fn take_refill_rev_works() {
 
 #[test]
 fn spread_layout_push_pull_works() {
-    ink_env::test::run_test::<ink_env::DefaultEnvTypes, _>(|_| {
+    ink_env::test::run_test::<ink_env::DefaultEnvironment, _>(|_| {
         let default = filled_bitstash();
         let root_key = Key::from([0x42; 32]);
         SpreadLayout::push_spread(&default, &mut KeyPtr::from(root_key));
@@ -140,7 +140,7 @@ fn spread_layout_push_pull_works() {
 #[test]
 #[should_panic(expected = "encountered empty storage cell")]
 fn spread_layout_clear_works() {
-    ink_env::test::run_test::<ink_env::DefaultEnvTypes, _>(|_| {
+    ink_env::test::run_test::<ink_env::DefaultEnvironment, _>(|_| {
         let default = filled_bitstash();
         // First push the instance to the contract storage.
         // Then load a valid instance, check it and clear its associated storage.
diff --git a/crates/storage/src/collections/bitvec/tests.rs b/crates/storage/src/collections/bitvec/tests.rs
index 16a436e323..56c2869504 100644
--- a/crates/storage/src/collections/bitvec/tests.rs
+++ b/crates/storage/src/collections/bitvec/tests.rs
@@ -178,7 +178,7 @@ fn pop_works() {
 
 #[test]
 fn spread_layout_push_pull_works() -> ink_env::Result<()> {
-    ink_env::test::run_test::<ink_env::DefaultEnvTypes, _>(|_| {
+    ink_env::test::run_test::<ink_env::DefaultEnvironment, _>(|_| {
         let bv1 = bitvec_600();
         let root_key = Key::from([0x42; 32]);
         SpreadLayout::push_spread(&bv1, &mut KeyPtr::from(root_key));
@@ -194,7 +194,7 @@ fn spread_layout_push_pull_works() -> ink_env::Result<()> {
 #[test]
 #[should_panic(expected = "encountered empty storage cell")]
 fn spread_layout_clear_works() {
-    ink_env::test::run_test::<ink_env::DefaultEnvTypes, _>(|_| {
+    ink_env::test::run_test::<ink_env::DefaultEnvironment, _>(|_| {
         let bv1 = bitvec_600();
         let root_key = Key::from([0x42; 32]);
         SpreadLayout::push_spread(&bv1, &mut KeyPtr::from(root_key));
diff --git a/crates/storage/src/collections/hashmap/fuzz_tests.rs b/crates/storage/src/collections/hashmap/fuzz_tests.rs
index ef26c18003..bb26ec8a94 100644
--- a/crates/storage/src/collections/hashmap/fuzz_tests.rs
+++ b/crates/storage/src/collections/hashmap/fuzz_tests.rs
@@ -70,7 +70,7 @@ fn insert_and_remove(xs: Vec<i32>, inserts_each: u8) {
 
 #[quickcheck]
 fn inserts_and_removes(xs: Vec<i32>, inserts_each: u8) {
-    ink_env::test::run_test::<ink_env::DefaultEnvTypes, _>(|_| {
+    ink_env::test::run_test::<ink_env::DefaultEnvironment, _>(|_| {
         insert_and_remove(xs, inserts_each);
         Ok(())
     })
@@ -81,7 +81,7 @@ fn inserts_and_removes(xs: Vec<i32>, inserts_each: u8) {
 /// and asserts that all non-`xth` elements are still in the map.
 #[quickcheck]
 fn removes(xs: Vec<i32>, xth: usize) {
-    ink_env::test::run_test::<ink_env::DefaultEnvTypes, _>(|_| {
+    ink_env::test::run_test::<ink_env::DefaultEnvironment, _>(|_| {
         // given
         let xs: Vec<i32> = xs.into_iter().unique().collect();
         let xth = xth.max(1);
diff --git a/crates/storage/src/collections/hashmap/tests.rs b/crates/storage/src/collections/hashmap/tests.rs
index 1a81e41d6f..542ae76e00 100644
--- a/crates/storage/src/collections/hashmap/tests.rs
+++ b/crates/storage/src/collections/hashmap/tests.rs
@@ -298,7 +298,7 @@ fn defrag_works() {
 
 #[test]
 fn spread_layout_push_pull_works() -> ink_env::Result<()> {
-    ink_env::test::run_test::<ink_env::DefaultEnvTypes, _>(|_| {
+    ink_env::test::run_test::<ink_env::DefaultEnvironment, _>(|_| {
         let hmap1 = [(b'A', 1), (b'B', 2), (b'C', 3), (b'D', 4)]
             .iter()
             .copied()
@@ -315,7 +315,7 @@ fn spread_layout_push_pull_works() -> ink_env::Result<()> {
 #[test]
 #[should_panic(expected = "storage entry was empty")]
 fn spread_layout_clear_works() {
-    ink_env::test::run_test::<ink_env::DefaultEnvTypes, _>(|_| {
+    ink_env::test::run_test::<ink_env::DefaultEnvironment, _>(|_| {
         let hmap1 = [(b'A', 1), (b'B', 2), (b'C', 3), (b'D', 4)]
             .iter()
             .copied()
diff --git a/crates/storage/src/collections/smallvec/tests.rs b/crates/storage/src/collections/smallvec/tests.rs
index 13e941a41b..64666d8f1e 100644
--- a/crates/storage/src/collections/smallvec/tests.rs
+++ b/crates/storage/src/collections/smallvec/tests.rs
@@ -361,7 +361,7 @@ fn swap_remove_drop_works() {
 
 #[test]
 fn spread_layout_push_pull_works() -> ink_env::Result<()> {
-    ink_env::test::run_test::<ink_env::DefaultEnvTypes, _>(|_| {
+    ink_env::test::run_test::<ink_env::DefaultEnvironment, _>(|_| {
         let vec1 = vec_from_slice(&[b'a', b'b', b'c', b'd']);
         let root_key = Key::from([0x42; 32]);
         SpreadLayout::push_spread(&vec1, &mut KeyPtr::from(root_key));
@@ -377,7 +377,7 @@ fn spread_layout_push_pull_works() -> ink_env::Result<()> {
 #[test]
 #[should_panic(expected = "encountered empty storage cell")]
 fn spread_layout_clear_works() {
-    ink_env::test::run_test::<ink_env::DefaultEnvTypes, _>(|_| {
+    ink_env::test::run_test::<ink_env::DefaultEnvironment, _>(|_| {
         let vec1 = vec_from_slice(&[b'a', b'b', b'c', b'd']);
         let root_key = Key::from([0x42; 32]);
         SpreadLayout::push_spread(&vec1, &mut KeyPtr::from(root_key));
diff --git a/crates/storage/src/collections/stash/tests.rs b/crates/storage/src/collections/stash/tests.rs
index 3b21357a5b..92e3aa6e8d 100644
--- a/crates/storage/src/collections/stash/tests.rs
+++ b/crates/storage/src/collections/stash/tests.rs
@@ -25,7 +25,7 @@ fn regression_stash_unreachable_minified() {
     // `approved_for_all_works` unit test. The fix was to adjust
     // `Stash::remove_vacant_entry` to update `header.last_vacant` if the
     // removed index was the last remaining vacant index in the stash.
-    ink_env::test::run_test::<ink_env::DefaultEnvTypes, _>(|_| {
+    ink_env::test::run_test::<ink_env::DefaultEnvironment, _>(|_| {
         let mut stash: StorageStash<u32> = StorageStash::new();
         stash.put(1);
         stash.put(2);
@@ -137,7 +137,7 @@ fn remove_out_of_bounds_works() {
 
 #[test]
 fn remove_works_with_spread_layout_push_pull() -> ink_env::Result<()> {
-    ink_env::test::run_test::<ink_env::DefaultEnvTypes, _>(|_| {
+    ink_env::test::run_test::<ink_env::DefaultEnvironment, _>(|_| {
         // First populate some storage Stash and writes that to the contract storage using pull_spread
         // and some known Key.
         let stash = [b'A', b'B', b'C']
@@ -715,7 +715,7 @@ fn take_rev_order_works() {
 
 #[test]
 fn spread_layout_push_pull_works() -> ink_env::Result<()> {
-    ink_env::test::run_test::<ink_env::DefaultEnvTypes, _>(|_| {
+    ink_env::test::run_test::<ink_env::DefaultEnvironment, _>(|_| {
         let stash1 = create_holey_stash();
         let root_key = Key::from([0x42; 32]);
         SpreadLayout::push_spread(&stash1, &mut KeyPtr::from(root_key));
@@ -731,7 +731,7 @@ fn spread_layout_push_pull_works() -> ink_env::Result<()> {
 #[test]
 #[should_panic(expected = "storage entry was empty")]
 fn spread_layout_clear_works() {
-    ink_env::test::run_test::<ink_env::DefaultEnvTypes, _>(|_| {
+    ink_env::test::run_test::<ink_env::DefaultEnvironment, _>(|_| {
         let stash1 = create_holey_stash();
         let root_key = Key::from([0x42; 32]);
         SpreadLayout::push_spread(&stash1, &mut KeyPtr::from(root_key));
diff --git a/crates/storage/src/collections/vec/tests.rs b/crates/storage/src/collections/vec/tests.rs
index f670a6c486..00d997d51d 100644
--- a/crates/storage/src/collections/vec/tests.rs
+++ b/crates/storage/src/collections/vec/tests.rs
@@ -359,7 +359,7 @@ fn swap_remove_drop_works() {
 
 #[test]
 fn spread_layout_push_pull_works() -> ink_env::Result<()> {
-    ink_env::test::run_test::<ink_env::DefaultEnvTypes, _>(|_| {
+    ink_env::test::run_test::<ink_env::DefaultEnvironment, _>(|_| {
         let vec1 = vec_from_slice(&[b'a', b'b', b'c', b'd']);
         let root_key = Key::from([0x42; 32]);
         SpreadLayout::push_spread(&vec1, &mut KeyPtr::from(root_key));
@@ -375,7 +375,7 @@ fn spread_layout_push_pull_works() -> ink_env::Result<()> {
 #[test]
 #[should_panic(expected = "encountered empty storage cell")]
 fn spread_layout_clear_works() {
-    ink_env::test::run_test::<ink_env::DefaultEnvTypes, _>(|_| {
+    ink_env::test::run_test::<ink_env::DefaultEnvironment, _>(|_| {
         let vec1 = vec_from_slice(&[b'a', b'b', b'c', b'd']);
         let root_key = Key::from([0x42; 32]);
         SpreadLayout::push_spread(&vec1, &mut KeyPtr::from(root_key));
@@ -395,7 +395,7 @@ fn spread_layout_clear_works() {
 
 #[test]
 fn set_works() {
-    ink_env::test::run_test::<ink_env::DefaultEnvTypes, _>(|_| {
+    ink_env::test::run_test::<ink_env::DefaultEnvironment, _>(|_| {
         let mut vec = vec_from_slice(&[b'a', b'b', b'c', b'd']);
         let _ = vec.set(0, b'x').unwrap();
         let expected = vec_from_slice(&[b'x', b'b', b'c', b'd']);
diff --git a/crates/storage/src/hashmap_entry_api_tests.rs b/crates/storage/src/hashmap_entry_api_tests.rs
index 6064ba3fde..e505866fe7 100644
--- a/crates/storage/src/hashmap_entry_api_tests.rs
+++ b/crates/storage/src/hashmap_entry_api_tests.rs
@@ -88,7 +88,7 @@ macro_rules! gen_tests_for_backend {
 
         #[test]
         fn mutations_work_with_push_pull() -> ink_env::Result<()> {
-            ink_env::test::run_test::<ink_env::DefaultEnvTypes, _>(|_| {
+            ink_env::test::run_test::<ink_env::DefaultEnvironment, _>(|_| {
                 // given
                 let hmap1 = prefilled_hmap();
                 assert_eq!(hmap1.get(&b'A'), Some(&13));
@@ -155,7 +155,7 @@ macro_rules! gen_tests_for_backend {
 
         #[test]
         fn insert_with_works_with_push_pull() -> ink_env::Result<()> {
-            ink_env::test::run_test::<ink_env::DefaultEnvTypes, _>(|_| {
+            ink_env::test::run_test::<ink_env::DefaultEnvironment, _>(|_| {
                 // given
                 let mut hmap1 = <$backend>::new();
                 let value = hmap1.entry(b'A').or_insert_with(|| 42);
@@ -223,7 +223,7 @@ macro_rules! gen_tests_for_backend {
 
         #[test]
         fn occupied_entry_api_works_with_push_pull() -> ink_env::Result<()> {
-            ink_env::test::run_test::<ink_env::DefaultEnvTypes, _>(|_| {
+            ink_env::test::run_test::<ink_env::DefaultEnvironment, _>(|_| {
                 // given
                 let mut hmap1 = prefilled_hmap();
                 assert_eq!(hmap1.get(&b'A'), Some(&13));
@@ -269,7 +269,7 @@ macro_rules! gen_tests_for_backend {
 
         #[test]
         fn vacant_api_works_with_push_pull() -> ink_env::Result<()> {
-            ink_env::test::run_test::<ink_env::DefaultEnvTypes, _>(|_| {
+            ink_env::test::run_test::<ink_env::DefaultEnvironment, _>(|_| {
                 // given
                 let mut hmap1 = <$backend>::new();
                 match hmap1.entry(b'A') {
@@ -292,7 +292,7 @@ macro_rules! gen_tests_for_backend {
 
         #[test]
         fn pulling_occupied_entry_must_succeed() -> ink_env::Result<()> {
-            ink_env::test::run_test::<ink_env::DefaultEnvTypes, _>(|_| {
+            ink_env::test::run_test::<ink_env::DefaultEnvironment, _>(|_| {
                 // given
                 let hmap1 = prefilled_hmap();
                 push_hmap(&hmap1);
@@ -313,7 +313,7 @@ macro_rules! gen_tests_for_backend {
 
         #[test]
         fn value_not_in_cache_but_in_storage_get_and_get_mut() -> ink_env::Result<()> {
-            ink_env::test::run_test::<ink_env::DefaultEnvTypes, _>(|_| {
+            ink_env::test::run_test::<ink_env::DefaultEnvironment, _>(|_| {
                 // given
                 let mut hmap2 = push_pull_prefilled_hmap();
 
@@ -332,7 +332,7 @@ macro_rules! gen_tests_for_backend {
 
         #[test]
         fn value_not_in_cache_but_in_storage_insert() -> ink_env::Result<()> {
-            ink_env::test::run_test::<ink_env::DefaultEnvTypes, _>(|_| {
+            ink_env::test::run_test::<ink_env::DefaultEnvironment, _>(|_| {
                 // given
                 let mut hmap2 = push_pull_prefilled_hmap();
 
@@ -351,7 +351,7 @@ macro_rules! gen_tests_for_backend {
 
         #[test]
         fn value_not_in_cache_but_in_storage_remove_entry() -> ink_env::Result<()> {
-            ink_env::test::run_test::<ink_env::DefaultEnvTypes, _>(|_| {
+            ink_env::test::run_test::<ink_env::DefaultEnvironment, _>(|_| {
                 // given
                 let mut hmap2 = push_pull_prefilled_hmap();
 
@@ -373,7 +373,7 @@ macro_rules! gen_tests_for_backend {
 
         #[test]
         fn value_not_in_cache_is_properly_flushed_after_insert() -> ink_env::Result<()> {
-            ink_env::test::run_test::<ink_env::DefaultEnvTypes, _>(|_| {
+            ink_env::test::run_test::<ink_env::DefaultEnvironment, _>(|_| {
                 // given
                 let mut hmap2 = push_pull_prefilled_hmap();
 
@@ -399,7 +399,7 @@ macro_rules! gen_tests_for_backend {
 
         #[test]
         fn value_not_in_cache_but_in_storage_into_mut() -> ink_env::Result<()> {
-            ink_env::test::run_test::<ink_env::DefaultEnvTypes, _>(|_| {
+            ink_env::test::run_test::<ink_env::DefaultEnvironment, _>(|_| {
                 // given
                 let mut hmap2 = push_pull_prefilled_hmap();