Skip to content

Commit

Permalink
add script to setup capabilities on minter account from locker account
Browse files Browse the repository at this point in the history
  • Loading branch information
fkenji committed Aug 20, 2024
1 parent b39c50b commit d83d8e8
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions transactions/scripts/setup_sharded_locker_room.cdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import TopShot from 0xTOPSHOTADDRESS
import TopShotShardedCollection from 0xSHARDEDADDRESS
import NonFungibleToken from 0xNFTADDRESS

/*
This transaction creates a capability on the minter account
that links it to the locker room account.
For example, on testnet:
minter account = 0x70dff4d1005824db
locker account = 0xd80d84b4b0a88782
*/


transaction() {

prepare(minter: auth(Storage, Capabilities) &Account, locker: auth(Storage, Capabilities) &Account) {

minter.storage.save(
locker.capabilities.storage.issue<auth(NonFungibleToken.Withdraw) &TopShotShardedCollection.ShardedCollection>(/storage/TopShotShardedCollection),
to: /storage/lockerTSShardedCollection2
)

minter.storage.save(
locker.capabilities.storage.issue<auth(NonFungibleToken.Withdraw) &TopShot.Collection>(/storage/MomentCollection),
to: /storage/lockerTSCollection2
)
}
}

0 comments on commit d83d8e8

Please sign in to comment.