From 4d413df8f9fe5645cd5374167856a830b0cf4852 Mon Sep 17 00:00:00 2001 From: Gregor G <75445744+sideninja@users.noreply.github.com> Date: Fri, 27 Jan 2023 16:40:43 +0100 Subject: [PATCH] Create makeFriends.cdc --- cadence/transactions/makeFriends.cdc | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 cadence/transactions/makeFriends.cdc diff --git a/cadence/transactions/makeFriends.cdc b/cadence/transactions/makeFriends.cdc new file mode 100644 index 0000000..e2bade0 --- /dev/null +++ b/cadence/transactions/makeFriends.cdc @@ -0,0 +1,19 @@ +// read more about Cadence transactions here https://developers.flow.com/cadence/language/transactions +import "Person" + +transaction { + let acc: AuthAccount + + prepare(signer: AuthAccount) { + self.acc = signer + } + + pre {} + + execute { + // save the resource to the storage, read more about it here https://developers.flow.com/cadence/language/accounts#account-storage + self.acc.save<@Person.Friendship>(<-Person.makeFriends(), to: StoragePath(identifier: "friendship")!) + } + + post {} +}