Skip to content

Commit 4d413df

Browse files
authored
Create makeFriends.cdc
1 parent fb45dfc commit 4d413df

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

cadence/transactions/makeFriends.cdc

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// read more about Cadence transactions here https://developers.flow.com/cadence/language/transactions
2+
import "Person"
3+
4+
transaction {
5+
let acc: AuthAccount
6+
7+
prepare(signer: AuthAccount) {
8+
self.acc = signer
9+
}
10+
11+
pre {}
12+
13+
execute {
14+
// save the resource to the storage, read more about it here https://developers.flow.com/cadence/language/accounts#account-storage
15+
self.acc.save<@Person.Friendship>(<-Person.makeFriends(), to: StoragePath(identifier: "friendship")!)
16+
}
17+
18+
post {}
19+
}

0 commit comments

Comments
 (0)