IBC

Sylvia doesn't generate any IBC related code, but you can define your own IBC entry points like you would in the case of a regular CosmWasm contract.

You can define the logic inside the contract and call the method from the entry point.

pub struct IbcContract;
 
#[contract]
impl IbcContract {
    pub fn new() -> Self {
        Self
    }
 
    #[sv::msg(instantiate)]
    fn instantiate(&self, _ctx: InstantiateCtx) -> StdResult<Response> {
        Ok(Response::new())
    }
 
    pub fn ibc_channel_open(
        &self,
        deps: DepsMut,
        env: Env,
        msg: IbcChannelOpenMsg,
    ) -> StdResult<IbcChannelOpenResponse> {
        // Your logic here
        Ok(Default::default())
    }
}
 
#[cfg_attr(not(feature = "library"), entry_point)]
pub fn ibc_channel_open(
    deps: DepsMut,
    env: Env,
    msg: IbcChannelOpenMsg,
) -> StdResult<IbcChannelOpenResponse> {
    IbcContract::new().ibc_channel_open(deps, env, msg)
}

You can also define a trait for the IBC methods and implement it on the contract.

#[cfg_attr(not(feature = "library"), entry_point)]
pub fn ibc_channel_open(
    deps: DepsMut,
    env: Env,
    msg: IbcChannelOpenMsg,
) -> StdResult<IbcChannelOpenResponse> {
    IbcContract::new().ibc_channel_open(deps, env, msg)
}
 
pub struct IbcContract;
 
pub trait Ibc {
    fn ibc_channel_open(
        &self,
        deps: DepsMut,
        env: Env,
        msg: IbcChannelOpenMsg,
    ) -> StdResult<IbcChannelOpenResponse>;
}
 
impl Ibc for IbcContract {
    fn ibc_channel_open(
        &self,
        deps: DepsMut,
        env: Env,
        msg: IbcChannelOpenMsg,
    ) -> StdResult<IbcChannelOpenResponse> {
        // Your logic here
        Ok(Default::default())
    }
}
 
#[contract]
impl IbcContract {
    pub fn new() -> Self {
        Self
    }
 
    #[sv::msg(instantiate)]
    fn instantiate(&self, _ctx: InstantiateCtx) -> StdResult<Response> {
        Ok(Response::new())
    }
}

Remember not to use the interface attribute for this trait. Sylvia does not handle IBC entry points, and there is no point in generating helpers around them.