TransactionSEALED
╲!╲╳○□●╱~╳%╲@╳?◆?#□^█●╳◆░▪▒^▪▫◆%%??&□!■╲□▒╳○●!◇?$▓!▪*^□!╲?@$#!~○
Transaction ID
Execution Fee
0.00002874 FLOWTransaction Summary
Contract Call
Called NonFungibleToken, MetadataViews, FlowToken +7 more
Script Arguments
Copy:
0nftIdUInt64
48378513167968
Cadence Script
1// Third Party Imports
2import NonFungibleToken from 0x1d7e57aa55817448
3import MetadataViews from 0x1d7e57aa55817448
4import FlowToken from 0x1654653399040a61
5// Fixes imports
6import Fixes from 0xd2abb5dbf5e08666
7import FRC20Indexer from 0xd2abb5dbf5e08666
8import FRC20FTShared from 0xd2abb5dbf5e08666
9import FRC20AccountsPool from 0xd2abb5dbf5e08666
10import FRC20SemiNFT from 0xd2abb5dbf5e08666
11import FRC20Staking from 0xd2abb5dbf5e08666
12import FRC20StakingManager from 0xd2abb5dbf5e08666
13
14transaction(
15 nftId: UInt64,
16) {
17 let semiNFTColCap: Capability<auth(NonFungibleToken.Withdraw, NonFungibleToken.Update) &FRC20SemiNFT.Collection>
18
19 prepare(acct: auth(Storage, Capabilities) &Account) {
20
21 /** ------------- Start -- FRC20 Semi NFT Collection Initialization ------------ */
22 // ensure resource
23 if acct.storage.borrow<&AnyResource>(from: FRC20SemiNFT.CollectionStoragePath) == nil {
24 acct.storage.save(<- FRC20SemiNFT.createEmptyCollection(nftType: Type<@FRC20SemiNFT.NFT>()), to: FRC20SemiNFT.CollectionStoragePath)
25 }
26
27 // link to public capability
28 if acct
29 .capabilities.get<&FRC20SemiNFT.Collection>(FRC20SemiNFT.CollectionPublicPath)
30 .borrow() == nil {
31 acct.capabilities.unpublish(FRC20SemiNFT.CollectionPublicPath)
32 acct.capabilities.publish(
33 acct.capabilities.storage.issue<&FRC20SemiNFT.Collection>(
34 FRC20SemiNFT.CollectionStoragePath
35 ),
36 at: FRC20SemiNFT.CollectionPublicPath
37 )
38 }
39 /** ------------- End ---------------------------------------------------------- */
40
41 self.semiNFTColCap = acct.capabilities.storage
42 .issue<auth(NonFungibleToken.Withdraw, NonFungibleToken.Update) &FRC20SemiNFT.Collection>(FRC20SemiNFT.CollectionStoragePath)
43
44 /** ------------- Start -- FRC20 Delegator General Initialization ------------- */
45 if acct.storage.borrow<&AnyResource>(from: FRC20Staking.DelegatorStoragePath) == nil {
46 acct.storage.save(<- FRC20Staking.createDelegator(self.semiNFTColCap), to: FRC20Staking.DelegatorStoragePath)
47 }
48
49 if acct
50 .capabilities.get<&FRC20Staking.Delegator>(FRC20Staking.DelegatorPublicPath)
51 .borrow() == nil {
52 acct.capabilities.unpublish(FRC20Staking.DelegatorPublicPath)
53 acct.capabilities.publish(
54 acct.capabilities.storage.issue<&FRC20Staking.Delegator>(
55 FRC20Staking.DelegatorStoragePath
56 ),
57 at: FRC20Staking.DelegatorPublicPath
58 )
59 }
60 /** ------------- End ---------------------------------------------------------- */
61 }
62
63 execute {
64 FRC20StakingManager.unstake(self.semiNFTColCap, nftId: nftId)
65 log("Unstaking Done.")
66 }
67}