github.com/DapperCollectives/CAST/backend@v0.0.0-20230921221157-1350c8be7c96/main/cadence/float/scripts/owns_specific_float.cdc (about)

     1  import FLOAT from 0x2d4c3caffbeab845
     2  
     3  pub fun main(account: Address, eventId: UInt64): Bool {
     4    let floatCollection = getAccount(account).getCapability(FLOAT.FLOATCollectionPublicPath)
     5                          .borrow<&FLOAT.Collection{FLOAT.CollectionPublic}>()
     6                          ?? panic("Could not borrow the Collection from the account.")
     7    
     8    return floatCollection.ownedIdsFromEvent(eventId: eventId).length > 0
     9  }