@@ -320,6 +320,10 @@ access(all) contract TidalYield {
320320 }
321321 /// Creates a new Tide executing the specified Strategy with the provided funds
322322 access (all ) fun createTide (betaRef : auth (TidalYieldClosedBeta.Beta ) &TidalYieldClosedBeta.BetaBadge , strategyType : Type , withVault : @{FungibleToken .Vault }) {
323+ pre {
324+ TidalYieldClosedBeta .validateBeta (self .owner ?. address ! , betaRef ):
325+ " Invalid Beta Ref"
326+ }
323327 let balance = withVault .balance
324328 let type = withVault .getType ()
325329 let tide <-create Tide (strategyType : strategyType , withVault : <- withVault )
@@ -341,6 +345,9 @@ access(all) contract TidalYield {
341345 pre {
342346 self .tides [tide .uniqueID .id ] == nil :
343347 " Collision with Tide ID \( tide .uniqueID .id ) - a Tide with this ID already exists"
348+
349+ TidalYieldClosedBeta .validateBeta (self .owner ?. address ! , betaRef ):
350+ " Invalid Beta Ref"
344351 }
345352 emit AddedToManager (id : tide .uniqueID .id , owner : self .owner ?. address , managerUUID : self .uuid , tokenType : tide .getType ().identifier )
346353 self .tides [tide .uniqueID .id ] <- ! tide
@@ -350,6 +357,9 @@ access(all) contract TidalYield {
350357 pre {
351358 self .tides [id ] ! = nil :
352359 " No Tide with ID \( id ) found"
360+
361+ TidalYieldClosedBeta .validateBeta (self .owner ?. address ! , betaRef ):
362+ " Invalid Beta Ref"
353363 }
354364 let tide = (&self .tides [id ] as &Tide ? )!
355365 tide .deposit (from : <- from )
@@ -366,6 +376,9 @@ access(all) contract TidalYield {
366376 pre {
367377 self .tides [id ] ! = nil :
368378 " No Tide with ID \( id ) found"
379+
380+ TidalYieldClosedBeta .validateBeta (self .owner ?. address ! , betaRef ):
381+ " Invalid Beta Ref"
369382 }
370383 return <- self ._withdrawTide (id : id )!
371384 }
0 commit comments