I’ve been following the tutorials on the proposal accept pattern. I want to implement a situation with my smart contract where a person
can create a guild
that has multiple members.
So I setup the following template
template Guild with
guildname: Text
creator: Party
member: [Party]
where
signatory creator
ensure length member >= 5 && DA.List.unique member
template Individual with
person: Party
name: Text
guild: Guild
where
signatory person
controller person can
CreateGuild : ContractId Guild
do
create guild
and then the following script to test.
-- RUN_GUILD_TEST SCRIPT
guildtest = do
martin <- allocateParty "Martin"
rita <- allocateParty "Rita"
john <- allocateParty "John"
michael <- allocateParty "Michael"
sam <- allocateParty "Sam"
james <- allocateparty "James"
let
guild = Guild with
guildname = "Ahi"
creator = martin
member = [rita, john, michael, sam, james]
guildCid <- submit martin do
createCmd Individual
with
person = martin
name: "Martin"
guild: Guild
submit martin do
exerciseCmd individualCid CreateGuild
pure()
I’m getting a parser error on the line that starts with “guildCid”.
(obligatory screenshot)
I’m not sure what I am doing wrong?
Martin should have the authorisation to create this contract. And I am calling the Guild contract ID. I don’t believe this is an indentation error.
Unless I am setting up this pattern the wrong way round?
A person
can form a guild
. I don’t want the guild to form the person.
Some guidance please?