I need to design a custom token which will receive many parameters, more than 10, that's why I want to use a struct as parameter, besides simple parameters. This results in the following initialize method, simplified just for testing, but will have more parameters in the end.
pub fn initialize(
e: Env,
admin: Address,
decimal: u32,
name: String,
symbol: String,
token_props: ConfigProps
)
where the struct is the following one:
#[derive(Clone)]
#[contracttype]
pub struct ConfigProps {
pub _is_mintable: bool,
pub _is_burnable: bool,
}
I try to call the initialize method, after I deploy the contract, using this command, passing the struct as JSON:
stellar contract invoke `
--id ID
--source-account alice
--network testnet--
initialize--admin alice
--decimal 7--name test-token
--symbol "symbol" `
--token_props ‘{"_is_mintable":false,"_is_burnable":true}’
and I get the following error. thread 'main' panicked at ...
not yet implemented: Not implemented for UdtStructV0(
ScSpecUdtStructV0 {
doc: StringM(),
lib: StringM(),
name: StringM(ConfigProps),
fields: VecM(
[
ScSpecUdtStructFieldV0 {
doc: StringM(),
name: StringM(is_burnable),
type: Bool,
},
ScSpecUdtStructFieldV0 {
doc: StringM(),
name: StringM(is_mintable),
type: Bool,
},
....
Can you help me solve this? or is there another way in which I can pass parameters and structs in my function calls ? Is this issue present when calling from Javscript?