Skip to content

Commit

Permalink
Create makeFriends.cdc
Browse files Browse the repository at this point in the history
  • Loading branch information
sideninja authored Jan 27, 2023
1 parent fb45dfc commit 4d413df
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions cadence/transactions/makeFriends.cdc
Original file line number Diff line number Diff line change
@@ -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 {}
}

0 comments on commit 4d413df

Please sign in to comment.