Can I use mutable in an init function?

I want to add some more functionality to my init function which will require changing the state but the option ‘mutable’ gives an error.

/// Initialize contract instance with a no token types.
contract = “cis2_multi”,
parameter = “InitParams”,
event = “Cis2Event<ContractTokenId, ContractTokenAmount>”,
mutable – error is here

Am I doing this wrong or can init functions not have this option?

Not sure what you mean.

The init function gets a

    state_builder: &mut StateBuilder<S>,

by default and you are meant to use it to construct the new state, which should be returned.

The init function creates the initial state, so there is no mutable attribute for it.