Repository: CosmWasm/sylvia
Pull request #320 (2024-03-05 13:08:13)

feat: Remove `#[contract(module=...)]` support

codecov[bot]: ## [Codecov](https://app.codecov.io/gh/CosmWasm/sylvia/pull/320?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=CosmWasm) Report
All modified and coverable lines are covered by tests :white_check_mark:
> :exclamation: No coverage uploaded for pull request base (`feat/contract_module_not_needed_in_mt@b294a36`). [Click here to learn what that means](https://docs.codecov.io/docs/error-reference?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=CosmWasm#section-missing-base-commit).


<details><summary>Additional details and impacted files</summary>


```diff
@@                           Coverage Diff                            @@
##             feat/contract_module_not_needed_in_mt     #320   +/-   ##
========================================================================
  Coverage                                         ?   85.44%           
========================================================================
  Files                                            ?       37           
  Lines                                            ?     2694           
  Branches                                         ?        0           
========================================================================
  Hits                                             ?     2302           
  Misses                                           ?      392           
  Partials                                         ?        0           
```



</details>

[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/CosmWasm/sylvia/pull/320?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=CosmWasm).   
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=CosmWasm).


Patch:
diff --git a/README.md b/README.md
index 5b77276..c16e4d7 100644
--- a/README.md
+++ b/README.md
@@ -426,16 +426,6 @@ but only one - the one with info about the trait being implemented.
 
 `Sylvia` works with multiple attributes. I will explain here how and when to use which of them.
 
-```rust
-#[contract(module=contract_module::inner_module)]
-impl Interface for MyContract {
-...
-}
-```
-
-`module` is meant to be used when implementing interface on the contract. Its purpose
-is to inform `sylvia` where is the contract defined. If the contract is implemented in the same
-scope this attribute can and should be omitted.
 
 ```rust
 #[entry_point]
@@ -906,7 +896,6 @@ we can either make the interface to work only with specified message type via
 pub trait SomeInterface {
 }
 
-#[contract(module=super)]
 impl SomeInterface for crate::MyContract {
 }
 ```
@@ -924,7 +913,6 @@ pub trait AssociatedInterface {
     type QueryC: CustomQuery;
 }
 
-#[contract(module=super)]
 impl AssociatedInterface for crate::MyContract {
     type Error = StdError;
     type ExecC = MyMsg;
@@ -1036,8 +1024,6 @@ Rust will force the user to specify the types of the associates during the imple
 We can either use some concrete types here or forward the generics defined on contract.
 
 ```rust
-#[contract(module = crate::contract)]
-#[sv::messages(generic as Generic)]
 impl<InstantiateParam, ExecParam, FieldType>
     Generic
     for crate::contract::GenericContract<
diff --git a/examples/contracts/custom/src/cw1.rs b/examples/contracts/custom/src/cw1.rs
index a8251c2..fcc9344 100644
--- a/examples/contracts/custom/src/cw1.rs
+++ b/examples/contracts/custom/src/cw1.rs
@@ -1,21 +1,16 @@
 use cosmwasm_std::{CosmosMsg, Response, StdError, StdResult};
 use cw1::{CanExecuteResp, Cw1};
-use sylvia::contract;
 use sylvia::types::{ExecCtx, QueryCtx};
 
 use crate::contract::CustomContract;
 
-#[contract(module=crate::contract)]
-#[sv::messages(cw1 as Cw1)]
 impl Cw1 for CustomContract {
     type Error = StdError;
 
-    #[sv::msg(exec)]
     fn execute(&self, _ctx: ExecCtx, _msgs: Vec<CosmosMsg>) -> StdResult<Response> {
         Ok(Response::new())
     }
 
-    #[sv::msg(query)]
     fn can_execute(
         &self,
         _ctx: QueryCtx,
diff --git a/examples/contracts/cw1-subkeys/src/cw1.rs b/examples/contracts/cw1-subkeys/src/cw1.rs
index 7ce96fd..850a5a2 100644
--- a/examples/contracts/cw1-subkeys/src/cw1.rs
+++ b/examples/contracts/cw1-subkeys/src/cw1.rs
@@ -1,17 +1,13 @@
 use cosmwasm_std::{ensure, Addr, Response, StdResult};
 use cw1::{CanExecuteResp, Cw1};
-use sylvia::contract;
 use sylvia::types::{ExecCtx, QueryCtx};
 
 use crate::contract::Cw1SubkeysContract;
 use crate::error::ContractError;
 
-#[contract(module=crate::contract)]
-#[sv::messages(cw1 as Cw1)]
 impl Cw1 for Cw1SubkeysContract<'_> {
     type Error = ContractError;
 
-    #[sv::msg(exec)]
     fn execute(
         &self,
         ctx: ExecCtx,
@@ -30,7 +26,6 @@ impl Cw1 for Cw1SubkeysContract<'_> {
         Ok(res)
     }
 
-    #[sv::msg(query)]
     fn can_execute(
         &self,
         ctx: QueryCtx,
diff --git a/examples/contracts/cw1-subkeys/src/whitelist.rs b/examples/contracts/cw1-subkeys/src/whitelist.rs
index 9fa62d8..7a67b93 100644
--- a/examples/contracts/cw1-subkeys/src/whitelist.rs
+++ b/examples/contracts/cw1-subkeys/src/whitelist.rs
@@ -1,5 +1,4 @@
 use cosmwasm_std::{Response, StdResult};
-use sylvia::contract;
 use sylvia::types::{ExecCtx, QueryCtx};
 use whitelist::responses::AdminListResponse;
 use whitelist::Whitelist;
@@ -7,24 +6,19 @@ use whitelist::Whitelist;
 use crate::contract::Cw1SubkeysContract;
 use crate::error::ContractError;
 
-#[contract(module=crate::contract)]
-#[sv::messages(whitelist as Whitelist)]
 impl Whitelist for Cw1SubkeysContract<'_> {
     type Error = ContractError;
 
-    #[sv::msg(exec)]
     fn freeze(&self, ctx: ExecCtx) -> Result<Response, Self::Error> {
         self.whitelist.freeze(ctx).map_err(From::from)
     }
 
-    #[sv::msg(exec)]
     fn update_admins(&self, ctx: ExecCtx, admins: Vec<String>) -> Result<Response, Self::Error> {
         self.whitelist
             .update_admins(ctx, admins)
             .map_err(From::from)
     }
 
-    #[sv::msg(query)]
     fn admin_list(&self, ctx: QueryCtx) -> StdResult<AdminListResponse> {
         self.whitelist.admin_list(ctx)
     }
diff --git a/examples/contracts/cw1-whitelist/src/cw1.rs b/examples/contracts/cw1-whitelist/src/cw1.rs
index b8f3a3a..4dd3b55 100644
--- a/examples/contracts/cw1-whitelist/src/cw1.rs
+++ b/examples/contracts/cw1-whitelist/src/cw1.rs
@@ -1,17 +1,13 @@
 use cosmwasm_std::{Addr, CosmosMsg, Response, StdResult};
 use cw1::{CanExecuteResp, Cw1};
-use sylvia::contract;
 use sylvia::types::{ExecCtx, QueryCtx};
 
 use crate::contract::Cw1WhitelistContract;
 use crate::error::ContractError;
 
-#[contract(module=crate::contract)]
-#[sv::messages(cw1 as Cw1)]
 impl Cw1 for Cw1WhitelistContract<'_> {
     type Error = ContractError;
 
-    #[sv::msg(exec)]
     fn execute(&self, ctx: ExecCtx, msgs: Vec<CosmosMsg>) -> Result<Response, ContractError> {
         if !self.is_admin(ctx.deps.as_ref(), &ctx.info.sender) {
             return Err(ContractError::Unauthorized);
@@ -23,7 +19,6 @@ impl Cw1 for Cw1WhitelistContract<'_> {
         Ok(resp)
     }
 
-    #[sv::msg(query)]
     fn can_execute(
         &self,
         ctx: QueryCtx,
diff --git a/examples/contracts/cw1-whitelist/src/whitelist.rs b/examples/contracts/cw1-whitelist/src/whitelist.rs
index 5080755..d96f549 100644
--- a/examples/contracts/cw1-whitelist/src/whitelist.rs
+++ b/examples/contracts/cw1-whitelist/src/whitelist.rs
@@ -1,5 +1,4 @@
 use cosmwasm_std::{Empty, Order, Response, StdResult};
-use sylvia::contract;
 use sylvia::types::{ExecCtx, QueryCtx};
 use whitelist::responses::AdminListResponse;
 use whitelist::Whitelist;
@@ -7,12 +6,9 @@ use whitelist::Whitelist;
 use crate::contract::Cw1WhitelistContract;
 use crate::error::ContractError;
 
-#[contract(module=crate::contract)]
-#[sv::messages(whitelist as Whitelist)]
 impl Whitelist for Cw1WhitelistContract<'_> {
     type Error = ContractError;
 
-    #[sv::msg(exec)]
     fn freeze(&self, ctx: ExecCtx) -> Result<Response, ContractError> {
         if !self.is_admin(ctx.deps.as_ref(), &ctx.info.sender) {
             return Err(ContractError::Unauthorized);
@@ -24,7 +20,6 @@ impl Whitelist for Cw1WhitelistContract<'_> {
         Ok(resp)
     }
 
-    #[sv::msg(exec)]
     fn update_admins(
         &self,
         ctx: ExecCtx,
@@ -84,7 +79,6 @@ impl Whitelist for Cw1WhitelistContract<'_> {
         Ok(resp)
     }
 
-    #[sv::msg(query)]
     fn admin_list(&self, ctx: QueryCtx) -> StdResult<AdminListResponse> {
         let admins: Result<_, _> = self
             .admins
diff --git a/examples/contracts/cw20-base/src/allowances.rs b/examples/contracts/cw20-base/src/allowances.rs
index be4c98d..80c1ab4 100644
--- a/examples/contracts/cw20-base/src/allowances.rs
+++ b/examples/contracts/cw20-base/src/allowances.rs
@@ -6,7 +6,6 @@ use cw20_allowances::responses::{
 use cw20_allowances::Cw20Allowances;
 use cw_storage_plus::{Bound, Bounder};
 use cw_utils::Expiration;
-use sylvia::contract;
 use sylvia::types::{ExecCtx, QueryCtx};
 
 use crate::contract::Cw20Base;
@@ -17,14 +16,11 @@ use crate::responses::Cw20ReceiveMsg;
 const MAX_LIMIT: u32 = 30;
 const DEFAULT_LIMIT: u32 = 10;
 
-#[contract(module=crate::contract)]
-#[sv::messages(cw20_allowances as Cw20Allowances)]
 impl Cw20Allowances for Cw20Base<'_> {
     type Error = ContractError;
 
     /// Allows spender to access an additional amount tokens from the owner's (env.sender) account.
     /// If expires is Some(), overwrites current allowance expiration with this one.
-    #[sv::msg(exec)]
     fn increase_allowance(
         &self,
         ctx: ExecCtx,
@@ -69,7 +65,6 @@ impl Cw20Allowances for Cw20Base<'_> {
 
     /// Lowers the spender's access of tokens from the owner's (env.sender) account by amount.
     /// If expires is Some(), overwrites current allowance expiration with this one.
-    #[sv::msg(exec)]
     fn decrease_allowance(
         &self,
         ctx: ExecCtx,
@@ -119,7 +114,6 @@ impl Cw20Allowances for Cw20Base<'_> {
 
     /// Transfers amount tokens from owner -> recipient
     /// if `env.sender` has sufficient pre-approval.
-    #[sv::msg(exec)]
     fn transfer_from(
         &self,
         ctx: ExecCtx,
@@ -176,7 +170,6 @@ impl Cw20Allowances for Cw20Base<'_> {
 
     /// Sends amount tokens from owner -> contract
     /// if `env.sender` has sufficient pre-approval.
-    #[sv::msg(exec)]
     fn send_from(
         &self,
         ctx: ExecCtx,
@@ -231,7 +224,6 @@ impl Cw20Allowances for Cw20Base<'_> {
     }
 
     /// Destroys amount of tokens forever
-    #[sv::msg(exec)]
     fn burn_from(
         &self,
         ctx: ExecCtx,
@@ -273,7 +265,6 @@ impl Cw20Allowances for Cw20Base<'_> {
     }
 
     /// Returns how much spender can use from owner account, 0 if unset.
-    #[sv::msg(query)]
     fn allowance(
         &self,
         ctx: QueryCtx,
@@ -290,7 +281,6 @@ impl Cw20Allowances for Cw20Base<'_> {
     }
 
     /// Returns all allowances this owner has approved. Supports pagination.
-    #[sv::msg(query)]
     fn all_allowances(
         &self,
         ctx: QueryCtx,
@@ -319,7 +309,6 @@ impl Cw20Allowances for Cw20Base<'_> {
     }
 
     /// Returns all allowances this spender has been granted. Supports pagination.
-    #[sv::msg(query)]
     fn all_spender_allowances(
         &self,
         ctx: QueryCtx,
@@ -349,7 +338,6 @@ impl Cw20Allowances for Cw20Base<'_> {
     }
 
     /// Returns all allowances this spender has been granted. Supports pagination.
-    #[sv::msg(query)]
     fn all_accounts(
         &self,
         ctx: QueryCtx,
diff --git a/examples/contracts/cw20-base/src/marketing.rs b/examples/contracts/cw20-base/src/marketing.rs
index b0b6880..845c1c2 100644
--- a/examples/contracts/cw20-base/src/marketing.rs
+++ b/examples/contracts/cw20-base/src/marketing.rs
@@ -4,15 +4,11 @@ use crate::validation::verify_logo;
 use cosmwasm_std::{Response, StdError, StdResult};
 use cw20_marketing::responses::{DownloadLogoResponse, LogoInfo, MarketingInfoResponse};
 use cw20_marketing::{Cw20Marketing, EmbeddedLogo, Logo};
-use sylvia::contract;
 use sylvia::types::{ExecCtx, QueryCtx};
 
-#[contract(module=crate::contract)]
-#[sv::messages(cw20_marketing as Cw20Marketing)]
 impl Cw20Marketing for Cw20Base<'_> {
     type Error = ContractError;
 
-    #[sv::msg(exec)]
     fn update_marketing(
         &self,
         ctx: ExecCtx,
@@ -69,7 +65,6 @@ impl Cw20Marketing for Cw20Base<'_> {
         Ok(res)
     }
 
-    #[sv::msg(exec)]
     fn upload_logo(&self, ctx: ExecCtx, logo: Logo) -> Result<Response, Self::Error> {
         let mut marketing_info = self
             .marketing_info
@@ -102,7 +97,6 @@ impl Cw20Marketing for Cw20Base<'_> {
         Ok(res)
     }
 
-    #[sv::msg(query)]
     fn marketing_info(&self, ctx: QueryCtx) -> StdResult<MarketingInfoResponse> {
         Ok(self
             .marketing_info
@@ -110,7 +104,6 @@ impl Cw20Marketing for Cw20Base<'_> {
             .unwrap_or_default())
     }
 
-    #[sv::msg(query)]
     fn download_logo(&self, ctx: QueryCtx) -> StdResult<DownloadLogoResponse> {
         let logo = self.logo.load(ctx.deps.storage)?;
         match logo {
diff --git a/examples/contracts/cw20-base/src/minting.rs b/examples/contracts/cw20-base/src/minting.rs
index f89fa0a..f13585c 100644
--- a/examples/contracts/cw20-base/src/minting.rs
+++ b/examples/contracts/cw20-base/src/minting.rs
@@ -3,15 +3,11 @@ use crate::error::ContractError;
 use cosmwasm_std::{Response, StdResult, Uint128};
 use cw20_minting::responses::MinterResponse;
 use cw20_minting::Cw20Minting;
-use sylvia::contract;
 use sylvia::types::{ExecCtx, QueryCtx};
 
-#[contract(module=crate::contract)]
-#[sv::messages(cw20_minting as Cw20Minting)]
 impl Cw20Minting for Cw20Base<'_> {
     type Error = ContractError;
 
-    #[sv::msg(exec)]
     fn mint(
         &self,
         ctx: ExecCtx,
@@ -61,7 +57,6 @@ impl Cw20Minting for Cw20Base<'_> {
         Ok(res)
     }
 
-    #[sv::msg(exec)]
     fn update_minter(
         &self,
         ctx: ExecCtx,
@@ -101,7 +96,6 @@ impl Cw20Minting for Cw20Base<'_> {
         Ok(resp)
     }
 
-    #[sv::msg(query)]
     fn minter(&self, ctx: QueryCtx) -> StdResult<Option<MinterResponse>> {
         let meta = self.token_info.load(ctx.deps.storage)?;
         let minter = match meta.mint {
diff --git a/examples/contracts/generic_contract/src/custom_and_generic.rs b/examples/contracts/generic_contract/src/custom_and_generic.rs
index 015a4dc..57da444 100644
--- a/examples/contracts/generic_contract/src/custom_and_generic.rs
+++ b/examples/contracts/generic_contract/src/custom_and_generic.rs
@@ -1,10 +1,7 @@
 use cosmwasm_std::{CosmosMsg, Response, StdError, StdResult};
 use custom_and_generic::CustomAndGeneric;
-use sylvia::contract;
 use sylvia::types::{ExecCtx, QueryCtx, SudoCtx, SvCustomMsg, SvCustomQuery};
 
-#[contract(module = crate::contract)]
-#[sv::messages(custom_and_generic as CustomAndGeneric)]
 impl<
         InstantiateT,
         Exec1T,
@@ -48,7 +45,6 @@ impl<
     type QueryC = SvCustomQuery;
     type RetT = SvCustomMsg;
 
-    #[sv::msg(exec)]
     fn custom_generic_execute_one(
         &self,
         _ctx: ExecCtx<Self::QueryC>,
@@ -58,7 +54,6 @@ impl<
         Ok(Response::new())
     }
 
-    #[sv::msg(exec)]
     fn custom_generic_execute_two(
         &self,
         _ctx: ExecCtx<Self::QueryC>,
@@ -68,7 +63,6 @@ impl<
         Ok(Response::new())
     }
 
-    #[sv::msg(query)]
     fn custom_generic_query_one(
         &self,
         _ctx: QueryCtx<Self::QueryC>,
@@ -78,7 +72,6 @@ impl<
         Ok(SvCustomMsg {})
     }
 
-    #[sv::msg(query)]
     fn custom_generic_query_two(
         &self,
         _ctx: QueryCtx<Self::QueryC>,
@@ -88,7 +81,6 @@ impl<
         Ok(SvCustomMsg {})
     }
 
-    #[sv::msg(sudo)]
     fn custom_generic_sudo_one(
         &self,
         _ctx: SudoCtx<Self::QueryC>,
@@ -98,7 +90,6 @@ impl<
         Ok(Response::new())
     }
 
-    #[sv::msg(sudo)]
     fn custom_generic_sudo_two(
         &self,
         _ctx: SudoCtx<Self::QueryC>,
diff --git a/examples/contracts/generic_contract/src/cw1.rs b/examples/contracts/generic_contract/src/cw1.rs
index 92486e7..b625038 100644
--- a/examples/contracts/generic_contract/src/cw1.rs
+++ b/examples/contracts/generic_contract/src/cw1.rs
@@ -1,10 +1,7 @@
 use cosmwasm_std::{CosmosMsg, Response, StdError, StdResult};
 use cw1::{CanExecuteResp, Cw1};
-use sylvia::contract;
 use sylvia::types::{ExecCtx, QueryCtx};
 
-#[contract(module = crate::contract)]
-#[sv::messages(cw1 as Cw1)]
 impl<
         InstantiateT,
         Exec1T,
@@ -36,12 +33,10 @@ impl<
 {
     type Error = StdError;
 
-    #[sv::msg(exec)]
     fn execute(&self, _ctx: ExecCtx, _msgs: Vec<CosmosMsg>) -> StdResult<Response> {
         Ok(Response::new())
     }
 
-    #[sv::msg(query)]
     fn can_execute(
         &self,
         _ctx: QueryCtx,
diff --git a/examples/contracts/generic_contract/src/generic.rs b/examples/contracts/generic_contract/src/generic.rs
index 0bb9d38..0605647 100644
--- a/examples/contracts/generic_contract/src/generic.rs
+++ b/examples/contracts/generic_contract/src/generic.rs
@@ -1,11 +1,8 @@
 use cosmwasm_std::{CosmosMsg, Response, StdError, StdResult};
 use generic::Generic;
 use serde::Deserialize;
-use sylvia::contract;
 use sylvia::types::{CustomMsg, ExecCtx, QueryCtx, SudoCtx, SvCustomMsg};
 
-#[contract(module = crate::contract)]
-#[sv::messages(generic as Generic)]
 impl<
         InstantiateT,
         Exec1T,
@@ -60,7 +57,6 @@ where
     type Sudo3T = SvCustomMsg;
     type RetT = SvCustomMsg;
 
-    #[sv::msg(exec)]
     fn generic_exec_one(
         &self,
         _ctx: ExecCtx,
@@ -70,7 +66,6 @@ where
         Ok(Response::new())
     }
 
-    #[sv::msg(exec)]
     fn generic_exec_two(
         &self,
         _ctx: ExecCtx,
@@ -80,7 +75,6 @@ where
         Ok(Response::new())
     }
 
-    #[sv::msg(query)]
     fn generic_query_one(
         &self,
         _ctx: QueryCtx,
@@ -90,7 +84,6 @@ where
         Ok(SvCustomMsg {})
     }
 
-    #[sv::msg(query)]
     fn generic_query_two(
         &self,
         _ctx: QueryCtx,
@@ -100,7 +93,6 @@ where
         Ok(SvCustomMsg {})
     }
 
-    #[sv::msg(sudo)]
     fn generic_sudo_one(
         &self,
         _ctx: SudoCtx,
@@ -110,7 +102,6 @@ where
         Ok(Response::new())
     }
 
-    #[sv::msg(sudo)]
     fn generic_sudo_two(
         &self,
         _ctx: SudoCtx,
diff --git a/examples/contracts/generic_iface_on_contract/src/custom_and_generic.rs b/examples/contracts/generic_iface_on_contract/src/custom_and_generic.rs
index 5407f74..caffc3d 100644
--- a/examples/contracts/generic_iface_on_contract/src/custom_and_generic.rs
+++ b/examples/contracts/generic_iface_on_contract/src/custom_and_generic.rs
@@ -1,10 +1,7 @@
 use cosmwasm_std::{CosmosMsg, Response, StdError, StdResult};
 use custom_and_generic::CustomAndGeneric;
-use sylvia::contract;
 use sylvia::types::{ExecCtx, QueryCtx, SudoCtx, SvCustomMsg, SvCustomQuery};
 
-#[contract(module = crate::contract)]
-#[sv::messages(custom_and_generic as CustomAndGeneric)]
 impl CustomAndGeneric for crate::contract::NonGenericContract {
     type Error = StdError;
     type Exec1T = SvCustomMsg;
@@ -20,7 +17,6 @@ impl CustomAndGeneric for crate::contract::NonGenericContract {
     type QueryC = SvCustomQuery;
     type RetT = SvCustomMsg;
 
-    #[sv::msg(exec)]
     fn custom_generic_execute_one(
         &self,
         _ctx: ExecCtx<Self::QueryC>,
@@ -30,7 +26,6 @@ impl CustomAndGeneric for crate::contract::NonGenericContract {
         Ok(Response::new())
     }
 
-    #[sv::msg(exec)]
     fn custom_generic_execute_two(
         &self,
         _ctx: ExecCtx<Self::QueryC>,
@@ -40,7 +35,6 @@ impl CustomAndGeneric for crate::contract::NonGenericContract {
         Ok(Response::new())
     }
 
-    #[sv::msg(query)]
     fn custom_generic_query_one(
         &self,
         _ctx: QueryCtx<Self::QueryC>,
@@ -50,7 +44,6 @@ impl CustomAndGeneric for crate::contract::NonGenericContract {
         Ok(SvCustomMsg {})
     }
 
-    #[sv::msg(query)]
     fn custom_generic_query_two(
         &self,
         _ctx: QueryCtx<Self::QueryC>,
@@ -60,7 +53,6 @@ impl CustomAndGeneric for crate::contract::NonGenericContract {
         Ok(SvCustomMsg {})
     }
 
-    #[sv::msg(sudo)]
     fn custom_generic_sudo_one(
         &self,
         _ctx: SudoCtx<Self::QueryC>,
@@ -70,7 +62,6 @@ impl CustomAndGeneric for crate::contract::NonGenericContract {
         Ok(Response::new())
     }
 
-    #[sv::msg(sudo)]
     fn custom_generic_sudo_two(
         &self,
         _ctx: SudoCtx<Self::QueryC>,
diff --git a/examples/contracts/generic_iface_on_contract/src/cw1.rs b/examples/contracts/generic_iface_on_contract/src/cw1.rs
index e5c12a2..a566f50 100644
--- a/examples/contracts/generic_iface_on_contract/src/cw1.rs
+++ b/examples/contracts/generic_iface_on_contract/src/cw1.rs
@@ -1,19 +1,14 @@
 use cosmwasm_std::{CosmosMsg, Response, StdError, StdResult};
 use cw1::{CanExecuteResp, Cw1};
-use sylvia::contract;
 use sylvia::types::{ExecCtx, QueryCtx};
 
-#[contract(module = crate::contract)]
-#[sv::messages(cw1 as Cw1)]
 impl Cw1 for crate::contract::NonGenericContract {
     type Error = StdError;
 
-    #[sv::msg(exec)]
     fn execute(&self, _ctx: ExecCtx, _msgs: Vec<CosmosMsg>) -> StdResult<Response> {
         Ok(Response::new())
     }
 
-    #[sv::msg(query)]
     fn can_execute(
         &self,
         _ctx: QueryCtx,
diff --git a/examples/contracts/generic_iface_on_contract/src/generic.rs b/examples/contracts/generic_iface_on_contract/src/generic.rs
index 6e7b0f2..20ff5eb 100644
--- a/examples/contracts/generic_iface_on_contract/src/generic.rs
+++ b/examples/contracts/generic_iface_on_contract/src/generic.rs
@@ -1,10 +1,7 @@
 use cosmwasm_std::{CosmosMsg, Response, StdError, StdResult};
 use generic::Generic;
-use sylvia::contract;
 use sylvia::types::{ExecCtx, QueryCtx, SudoCtx, SvCustomMsg};
 
-#[contract(module = crate::contract)]
-#[sv::messages(generic as Generic)]
 impl Generic for crate::contract::NonGenericContract {
     type Error = StdError;
     type Exec1T = SvCustomMsg;
@@ -18,7 +15,6 @@ impl Generic for crate::contract::NonGenericContract {
     type Sudo3T = SvCustomMsg;
     type RetT = SvCustomMsg;
 
-    #[sv::msg(exec)]
     fn generic_exec_one(
         &self,
         _ctx: ExecCtx,
@@ -28,7 +24,6 @@ impl Generic for crate::contract::NonGenericContract {
         Ok(Response::new())
     }
 
-    #[sv::msg(exec)]
     fn generic_exec_two(
         &self,
         _ctx: ExecCtx,
@@ -38,7 +33,6 @@ impl Generic for crate::contract::NonGenericContract {
         Ok(Response::new())
     }
 
-    #[sv::msg(query)]
     fn generic_query_one(
         &self,
         _ctx: QueryCtx,
@@ -48,7 +42,6 @@ impl Generic for crate::contract::NonGenericContract {
         Ok(SvCustomMsg {})
     }
 
-    #[sv::msg(query)]
     fn generic_query_two(
         &self,
         _ctx: QueryCtx,
@@ -58,7 +51,6 @@ impl Generic for crate::contract::NonGenericContract {
         Ok(SvCustomMsg {})
     }
 
-    #[sv::msg(sudo)]
     fn generic_sudo_one(
         &self,
         _ctx: SudoCtx,
@@ -68,7 +60,6 @@ impl Generic for crate::contract::NonGenericContract {
         Ok(Response::new())
     }
 
-    #[sv::msg(sudo)]
     fn generic_sudo_two(
         &self,
         _ctx: SudoCtx,
diff --git a/examples/contracts/generics_forwarded/src/custom_and_generic.rs b/examples/contracts/generics_forwarded/src/custom_and_generic.rs
index c55bf7f..17f85ea 100644
--- a/examples/contracts/generics_forwarded/src/custom_and_generic.rs
+++ b/examples/contracts/generics_forwarded/src/custom_and_generic.rs
@@ -1,11 +1,8 @@
 use cosmwasm_std::{CosmosMsg, Response, StdError, StdResult};
 use custom_and_generic::CustomAndGeneric;
 use serde::Deserialize;
-use sylvia::contract;
 use sylvia::types::{CustomMsg, CustomQuery, ExecCtx, QueryCtx, SudoCtx, SvCustomMsg};
 
-#[contract(module = crate::contract)]
-#[sv::messages(custom_and_generic as CustomAndGeneric)]
 impl<
         InstantiateT,
         Exec1T,
@@ -68,7 +65,6 @@ where
     type QueryC = CustomQueryT;
     type RetT = SvCustomMsg;
 
-    #[sv::msg(exec)]
     fn custom_generic_execute_one(
         &self,
         _ctx: ExecCtx<Self::QueryC>,
@@ -78,7 +74,6 @@ where
         Ok(Response::new())
     }
 
-    #[sv::msg(exec)]
     fn custom_generic_execute_two(
         &self,
         _ctx: ExecCtx<Self::QueryC>,
@@ -88,7 +83,6 @@ where
         Ok(Response::new())
     }
 
-    #[sv::msg(query)]
     fn custom_generic_query_one(
         &self,
         _ctx: QueryCtx<Self::QueryC>,
@@ -98,7 +92,6 @@ where
         Ok(SvCustomMsg {})
     }
 
-    #[sv::msg(query)]
     fn custom_generic_query_two(
         &self,
         _ctx: QueryCtx<Self::QueryC>,
@@ -108,7 +101,6 @@ where
         Ok(SvCustomMsg {})
     }
 
-    #[sv::msg(sudo)]
     fn custom_generic_sudo_one(
         &self,
         _ctx: SudoCtx<Self::QueryC>,
@@ -118,7 +110,6 @@ where
         Ok(Response::new())
     }
 
-    #[sv::msg(sudo)]
     fn custom_generic_sudo_two(
         &self,
         _ctx: SudoCtx<Self::QueryC>,
diff --git a/examples/contracts/generics_forwarded/src/cw1.rs b/examples/contracts/generics_forwarded/src/cw1.rs
index 432514a..d0cdc73 100644
--- a/examples/contracts/generics_forwarded/src/cw1.rs
+++ b/examples/contracts/generics_forwarded/src/cw1.rs
@@ -3,11 +3,8 @@ use cosmwasm_std::{CosmosMsg, CustomMsg, Response, StdError, StdResult};
 use cw1::{CanExecuteResp, Cw1};
 use serde::de::DeserializeOwned;
 use serde::Deserialize;
-use sylvia::contract;
 use sylvia::types::{CustomQuery, ExecCtx, QueryCtx};
 
-#[contract(module = crate::contract)]
-#[sv::messages(cw1 as Cw1)]
 impl<
         InstantiateT,
         Exec1T,
@@ -58,12 +55,10 @@ where
 {
     type Error = StdError;
 
-    #[sv::msg(exec)]
     fn execute(&self, _ctx: ExecCtx, _msgs: Vec<CosmosMsg>) -> StdResult<Response> {
         Ok(Response::new())
     }
 
-    #[sv::msg(query)]
     fn can_execute(
         &self,
         _ctx: QueryCtx,
diff --git a/examples/contracts/generics_forwarded/src/generic.rs b/examples/contracts/generics_forwarded/src/generic.rs
index 26a8d99..8535c38 100644
--- a/examples/contracts/generics_forwarded/src/generic.rs
+++ b/examples/contracts/generics_forwarded/src/generic.rs
@@ -1,11 +1,8 @@
 use cosmwasm_std::{CosmosMsg, Response, StdError, StdResult};
 use generic::Generic;
 use serde::Deserialize;
-use sylvia::contract;
 use sylvia::types::{CustomMsg, CustomQuery, ExecCtx, QueryCtx, SudoCtx, SvCustomMsg};
 
-#[contract(module = crate::contract)]
-#[sv::messages(generic as Generic)]
 impl<
         InstantiateT,
         Exec1T,
@@ -66,7 +63,6 @@ where
     type Sudo3T = Sudo3T;
     type RetT = SvCustomMsg;
 
-    #[sv::msg(exec)]
     fn generic_exec_one(
         &self,
         _ctx: ExecCtx,
@@ -76,7 +72,6 @@ where
         Ok(Response::new())
     }
 
-    #[sv::msg(exec)]
     fn generic_exec_two(
         &self,
         _ctx: ExecCtx,
@@ -86,7 +81,6 @@ where
         Ok(Response::new())
     }
 
-    #[sv::msg(query)]
     fn generic_query_one(
         &self,
         _ctx: QueryCtx,
@@ -96,7 +90,6 @@ where
         Ok(SvCustomMsg {})
     }
 
-    #[sv::msg(query)]
     fn generic_query_two(
         &self,
         _ctx: QueryCtx,
@@ -106,7 +99,6 @@ where
         Ok(SvCustomMsg {})
     }
 
-    #[sv::msg(sudo)]
     fn generic_sudo_one(
         &self,
         _ctx: SudoCtx,
@@ -116,7 +108,6 @@ where
         Ok(Response::new())
     }
 
-    #[sv::msg(sudo)]
     fn generic_sudo_two(
         &self,
         _ctx: SudoCtx,
diff --git a/sylvia-derive/src/parser/contract.rs b/sylvia-derive/src/parser/contract.rs
deleted file mode 100644
index ab2aec1..0000000
--- a/sylvia-derive/src/parser/contract.rs
+++ /dev/null
@@ -1,33 +0,0 @@
-use proc_macro_error::abort;
-use syn::parse::{Error, Nothing, Parse, ParseStream};
-use syn::{Ident, Path, Result, Token};
-
-/// Parsed arguments for `contract` macro
-pub struct ContractArgs {
-    /// Module in which contract impl block is defined.
-    /// Used only while implementing `Interface` on `Contract`.
-    pub module: Path,
-}
-
-impl Parse for ContractArgs {
-    fn parse(input: ParseStream) -> Result<Self> {
-        let maybe_module = input.parse().and_then(|attr: Ident| -> Result<Path> {
-            let _: Token![=] = input.parse()?;
-            if attr == "module" {
-                input.parse()
-            } else {
-                Err(Error::new(attr.span(), "Missing `module` attribute"))
-            }
-        });
-        let module: Path = match maybe_module {
-            Ok(module) => module,
-            Err(e) => abort!(
-                e.span(), "The module path needs to be provided `#[contract(module=path::to::contract)`.";
-                note = "Implementing interface on a contract requires to point the path to the contract structure.";
-                note = "Parsing error: {}", e
-            ),
-        };
-        let _: Nothing = input.parse()?;
-        Ok(ContractArgs { module })
-    }
-}
diff --git a/sylvia-derive/src/parser/mod.rs b/sylvia-derive/src/parser/mod.rs
index 6c31907..7b75811 100644
--- a/sylvia-derive/src/parser/mod.rs
+++ b/sylvia-derive/src/parser/mod.rs
@@ -1,5 +1,4 @@
 pub mod attributes;
-pub mod contract;
 pub mod entry_point;
 
 pub use attributes::{
diff --git a/sylvia-derive/src/strip_self_path.rs b/sylvia-derive/src/strip_self_path.rs
index b31ba5e..93657ce 100644
--- a/sylvia-derive/src/strip_self_path.rs
+++ b/sylvia-derive/src/strip_self_path.rs
@@ -1,6 +1,5 @@
 use syn::fold::Fold;
 use syn::Path;
-
 pub struct StripSelfPath;
 
 impl Fold for StripSelfPath {
diff --git a/sylvia/examples/basic.rs b/sylvia/examples/basic.rs
index 52f9683..6014fe9 100644
--- a/sylvia/examples/basic.rs
+++ b/sylvia/examples/basic.rs
@@ -66,16 +66,12 @@ mod impl_group {
     use anyhow::Error;
     use cosmwasm_std::Response;
     use sylvia::types::{ExecCtx, QueryCtx};
-    use sylvia_derive::contract;
 
     use crate::{GroupContract, MemberResp};
 
-    #[contract(module=crate)]
-    #[sv::messages(crate::group as Group)]
     impl crate::group::Group for GroupContract {
         type Error = Error;
 
-        #[sv::msg(exec)]
         fn update_admin(
             &self,
             _ctx: ExecCtx,
@@ -84,7 +80,6 @@ mod impl_group {
             todo!()
         }
 
-        #[sv::msg(exec)]
         fn update_members(
             &self,
             _ctx: ExecCtx,
@@ -94,7 +89,6 @@ mod impl_group {
             todo!()
         }
 
-        #[sv::msg(query)]
         fn member(&self, _ctx: QueryCtx, _addr: String) -> Result<MemberResp, Self::Error> {
             todo!()
         }


Test patch:
diff --git a/examples/contracts/cw20-base/src/multitest/receiver.rs b/examples/contracts/cw20-base/src/multitest/receiver.rs
index bdc828f..2729a22 100644
--- a/examples/contracts/cw20-base/src/multitest/receiver.rs
+++ b/examples/contracts/cw20-base/src/multitest/receiver.rs
@@ -19,15 +19,11 @@ pub trait Receiver {
 pub mod impl_receiver {
     use crate::multitest::receiver_contract::ReceiverContract;
     use cosmwasm_std::{Response, StdError};
-    use sylvia::contract;
     use sylvia::types::ExecCtx;
 
-    #[contract(module=crate::multitest::receiver_contract)]
-    #[sv::messages(crate::multitest::receiver as Receiver)]
     impl super::Receiver for ReceiverContract {
         type Error = StdError;
 
-        #[sv::msg(exec)]
         fn receive(
             &self,
             _ctx: ExecCtx,
diff --git a/sylvia/tests/custom_msg.rs b/sylvia/tests/custom_msg.rs
index 366e30e..7acc2d0 100644
--- a/sylvia/tests/custom_msg.rs
+++ b/sylvia/tests/custom_msg.rs
@@ -44,28 +44,22 @@ mod some_interface {
 
 mod impl_some_interface {
     use cosmwasm_std::{Response, StdError, StdResult};
-    use sylvia::contract;
     use sylvia::types::{ExecCtx, QueryCtx, SudoCtx};
 
     use crate::some_interface::SomeInterface;
     use crate::{MyMsg, SomeResponse};
 
-    #[contract(module=crate)]
-    #[sv::messages(crate::some_interface)]
     impl SomeInterface for crate::MyContract {
         type Error = StdError;
 
-        #[sv::msg(query)]
         fn interface_query(&self, _ctx: QueryCtx) -> StdResult<SomeResponse> {
             Ok(SomeResponse)
         }
 
-        #[sv::msg(exec)]
         fn interface_exec(&self, _ctx: ExecCtx) -> StdResult<Response<MyMsg>> {
             Ok(Response::default())
         }
 
-        #[sv::msg(sudo)]
         fn interface_sudo(&self, _ctx: SudoCtx) -> StdResult<Response<MyMsg>> {
             Ok(Response::new())
         }
@@ -99,26 +93,20 @@ mod impl_interface {
     use crate::interface::Interface;
     use crate::{MyMsg, OtherMsg};
     use cosmwasm_std::{Response, StdError, StdResult};
-    use sylvia::contract;
     use sylvia::types::{ExecCtx, QueryCtx, SudoCtx};
 
-    #[contract(module=crate)]
-    #[sv::messages(crate::interface)]
     impl Interface for crate::MyContract {
         type Error = StdError;
         type ExecC = OtherMsg;
 
-        #[sv::msg(exec)]
         fn exec(&self, _ctx: ExecCtx) -> StdResult<Response<MyMsg>> {
             Ok(Response::default())
         }
 
-        #[sv::msg(query)]
         fn query(&self, _ctx: QueryCtx) -> StdResult<Response<MyMsg>> {
             Ok(Response::new())
         }
 
-        #[sv::msg(sudo)]
         fn sudo(&self, _ctx: SudoCtx) -> StdResult<Response<MyMsg>> {
             Ok(Response::new())
         }
@@ -147,25 +135,19 @@ mod other_interface {
 mod impl_other_interface {
     use crate::other_interface::OtherInterface;
     use cosmwasm_std::{Response, StdError, StdResult};
-    use sylvia::contract;
     use sylvia::types::{ExecCtx, QueryCtx, SudoCtx};
 
-    #[contract(module=crate)]
-    #[sv::messages(crate::other_interface)]
     impl OtherInterface for crate::MyContract {
         type Error = StdError;
 
-        #[sv::msg(exec)]
         fn other_interface_exec(&self, _ctx: ExecCtx) -> StdResult<Response> {
             Ok(Response::default())
         }
 
-        #[sv::msg(sudo)]
         fn other_interface_sudo(&self, _ctx: SudoCtx) -> StdResult<Response> {
             Ok(Response::new())
         }
 
-        #[sv::msg(query)]
         fn other_interface_query(&self, _ctx: QueryCtx) -> StdResult<Response> {
             Ok(Response::new())
         }
@@ -197,26 +179,20 @@ mod impl_associated_interface {
     use crate::associated_interface::AssociatedInterface;
     use crate::{MyMsg, SomeResponse};
     use cosmwasm_std::{Response, StdError, StdResult};
-    use sylvia::contract;
     use sylvia::types::{ExecCtx, QueryCtx, SudoCtx};
 
-    #[contract(module=crate)]
-    #[sv::messages(crate::associated_interface)]
     impl AssociatedInterface for crate::MyContract {
         type Error = StdError;
         type ExecC = MyMsg;
 
-        #[sv::msg(exec)]
         fn associated_exec(&self, _ctx: ExecCtx) -> StdResult<Response<Self::ExecC>> {
             Ok(Response::default())
         }
 
-        #[sv::msg(sudo)]
         fn associated_sudo(&self, _ctx: SudoCtx) -> StdResult<Response<Self::ExecC>> {
             Ok(Response::default())
         }
 
-        #[sv::msg(query)]
         fn associated_query(&self, _ctx: QueryCtx) -> StdResult<SomeResponse> {
             Ok(SomeResponse {})
         }
diff --git a/sylvia/tests/custom_query.rs b/sylvia/tests/custom_query.rs
index 7805604..5fa6d65 100644
--- a/sylvia/tests/custom_query.rs
+++ b/sylvia/tests/custom_query.rs
@@ -45,27 +45,21 @@ mod interface {
 mod impl_interface {
     use cosmwasm_std::{Response, StdError, StdResult};
     use sylvia::types::{ExecCtx, QueryCtx, SudoCtx};
-    use sylvia_derive::contract;
 
     use crate::{MyQuery, OtherQuery, SomeResponse};
 
-    #[contract(module=crate)]
-    #[sv::messages(crate::interface)]
     impl crate::interface::Interface for crate::MyContract {
         type Error = StdError;
         type QueryC = OtherQuery;
 
-        #[sv::msg(query)]
         fn interface_query(&self, _ctx: QueryCtx<MyQuery>) -> StdResult<SomeResponse> {
             Ok(SomeResponse)
         }
 
-        #[sv::msg(exec)]
         fn interface_exec(&self, _ctx: ExecCtx<MyQuery>) -> StdResult<Response> {
             Ok(Response::default())
         }
 
-        #[sv::msg(sudo)]
         fn interface_sudo(&self, _ctx: SudoCtx<MyQuery>) -> StdResult<Response> {
             Ok(Response::default())
         }
@@ -98,26 +92,20 @@ mod some_interface {
 mod impl_some_interface {
     use cosmwasm_std::{Response, StdError, StdResult};
     use sylvia::types::{ExecCtx, QueryCtx, SudoCtx};
-    use sylvia_derive::contract;
 
     use crate::{MyQuery, SomeResponse};
 
-    #[contract(module=crate)]
-    #[sv::messages(crate::some_interface)]
     impl super::some_interface::SomeInterface for crate::MyContract {
         type Error = StdError;
 
-        #[sv::msg(query)]
         fn some_interface_query(&self, _ctx: QueryCtx<MyQuery>) -> StdResult<SomeResponse> {
             Ok(SomeResponse)
         }
 
-        #[sv::msg(exec)]
         fn some_interface_exec(&self, _ctx: ExecCtx<MyQuery>) -> StdResult<Response> {
             Ok(Response::default())
         }
 
-        #[sv::msg(sudo)]
         fn some_interface_sudo(&self, _ctx: SudoCtx<MyQuery>) -> StdResult<Response> {
             Ok(Response::default())
         }
@@ -152,25 +140,19 @@ mod impl_associated_type_interface {
     use crate::{MyQuery, SomeResponse};
     use cosmwasm_std::{Response, StdError, StdResult};
     use sylvia::types::{ExecCtx, QueryCtx, SudoCtx};
-    use sylvia_derive::contract;
 
-    #[contract(module=crate)]
-    #[sv::messages(crate::associated_type_interface)]
     impl AssociatedTypeInterface for crate::MyContract {
         type Error = StdError;
         type QueryC = MyQuery;
 
-        #[sv::msg(query)]
         fn associated_query(&self, _ctx: QueryCtx<Self::QueryC>) -> StdResult<SomeResponse> {
             Ok(SomeResponse)
         }
 
-        #[sv::msg(exec)]
         fn associated_exec(&self, _ctx: ExecCtx<Self::QueryC>) -> StdResult<Response> {
             Ok(Response::default())
         }
 
-        #[sv::msg(sudo)]
         fn associated_sudo(&self, _ctx: SudoCtx<Self::QueryC>) -> StdResult<Response> {
             Ok(Response::default())
         }
@@ -204,24 +186,18 @@ mod impl_default_query_interface {
     use crate::SomeResponse;
     use cosmwasm_std::{Response, StdError, StdResult};
     use sylvia::types::{ExecCtx, QueryCtx, SudoCtx};
-    use sylvia_derive::contract;
 
-    #[contract(module=crate)]
-    #[sv::messages(crate::default_query_interface)]
     impl DefaultQueryInterface for crate::MyContract {
         type Error = StdError;
 
-        #[sv::msg(query)]
         fn default_query(&self, _ctx: QueryCtx) -> StdResult<SomeResponse> {
             Ok(SomeResponse)
         }
 
-        #[sv::msg(exec)]
         fn default_exec(&self, _ctx: ExecCtx) -> StdResult<Response> {
             Ok(Response::default())
         }
 
-        #[sv::msg(sudo)]
         fn default_sudo(&self, _ctx: SudoCtx) -> StdResult<Response> {
             Ok(Response::default())
         }
diff --git a/sylvia/tests/dispatching.rs b/sylvia/tests/dispatching.rs
index 1624d2a..594ca89 100644
--- a/sylvia/tests/dispatching.rs
+++ b/sylvia/tests/dispatching.rs
@@ -60,12 +60,9 @@ mod impl_interface {
 
     use crate::{EmptyQueryResponse, QueryResponse};
 
-    #[sylvia::contract(module = crate::contract)]
-    #[sv::messages(crate::interface)]
     impl crate::interface::Interface for crate::contract::Contract {
         type Error = StdError;
 
-        #[sv::msg(exec)]
         fn no_args_execution(&self, ctx: ExecCtx) -> Result<Response, StdError> {
             self.execs
                 .update(ctx.deps.storage, |count| -> Result<u64, StdError> {
@@ -74,7 +71,6 @@ mod impl_interface {
             Ok(Response::new())
         }
 
-        #[sv::msg(exec)]
         fn argumented_execution(
             &self,
             ctx: ExecCtx,
@@ -92,13 +88,11 @@ mod impl_interface {
             Ok(Response::new())
         }
 
-        #[sv::msg(query)]
         fn no_args_query(&self, _: QueryCtx) -> Result<EmptyQueryResponse, StdError> {
             *self.queries.borrow_mut() += 1;
             Ok(dbg!(EmptyQueryResponse {}))
         }
 
-        #[sv::msg(query)]
         fn argumented_query(
             &self,
             ctx: QueryCtx,
@@ -108,7 +102,6 @@ mod impl_interface {
             Ok(self.data.load(ctx.deps.storage, user).unwrap())
         }
 
-        #[sv::msg(sudo)]
         fn no_args_sudo(&self, ctx: SudoCtx) -> Result<Response, Self::Error> {
             self.sudos
                 .update(ctx.deps.storage, |count| -> Result<u64, StdError> {
@@ -117,7 +110,6 @@ mod impl_interface {
             Ok(Response::new())
         }
 
-        #[sv::msg(sudo)]
         fn argumented_sudo(&self, ctx: SudoCtx, user: Addr) -> Result<Response, Self::Error> {
             self.sudos
                 .update(ctx.deps.storage, |count| -> Result<u64, StdError> {
diff --git a/sylvia/tests/querier.rs b/sylvia/tests/querier.rs
index 0fbc0e8..17d1dd5 100644
--- a/sylvia/tests/querier.rs
+++ b/sylvia/tests/querier.rs
@@ -42,27 +42,21 @@ pub mod impl_counter {
     use crate::counter::Counter;
     use crate::CountResponse;
     use cosmwasm_std::{Response, StdError, StdResult};
-    use sylvia::contract;
     use sylvia::types::{ExecCtx, QueryCtx};
 
-    #[contract(module=crate)]
-    #[sv::messages(crate::counter)]
     impl Counter for super::CounterContract<'_> {
         type Error = StdError;
 
-        #[sv::msg(query)]
         fn count(&self, ctx: QueryCtx) -> StdResult<CountResponse> {
             let count = self.count.load(ctx.deps.storage)?;
             Ok(CountResponse { count })
         }
 
-        #[sv::msg(exec)]
         fn set_count(&self, ctx: ExecCtx, new_count: u64) -> StdResult<Response> {
             self.count.save(ctx.deps.storage, &new_count)?;
             Ok(Response::new())
         }
 
-        #[sv::msg(exec)]
         fn copy_count(&self, ctx: ExecCtx) -> StdResult<Response> {
             let other_count = self
                 .remote
@@ -75,7 +69,6 @@ pub mod impl_counter {
             Ok(Response::new())
         }
 
-        #[sv::msg(exec)]
         fn decrease_by_count(&self, ctx: ExecCtx) -> StdResult<Response> {
             let remote = self.remote.load(ctx.deps.storage)?;
             let other_count = sylvia::types::BoundQuerier::<_, Self>::borrowed(