@@ -865,7 +865,7 @@ access(all) contract FlowALPv0 {
865865 /// the target health, given pre-adjusted effective collateral and debt values.
866866 ///
867867 /// @param position The position reference.
868- /// @param initialBalanceSheet The position's current balance sheet
868+ /// @param initialBalanceSheet The position's current balance sheet
869869 /// @param targetHealth The minimum health to maintain after withdrawal.
870870 /// @return The maximum withdrawable amount of withdrawType.
871871 access (self ) fun computeAvailableWithdrawal (
@@ -971,7 +971,6 @@ access(all) contract FlowALPv0 {
971971
972972 // assign issuance & repayment connectors within the InternalPosition
973973 let iPos = self ._borrowPosition (pid : id )
974- let fundsType = funds .getType ()
975974 iPos .setDrawDownSink (issuanceSink )
976975 if repaymentSource ! = nil {
977976 iPos .setTopUpSource (repaymentSource )
@@ -987,12 +986,10 @@ access(all) contract FlowALPv0 {
987986
988987 // Create a capability to the Pool for the Position resource
989988 // The Pool is stored in the FlowALPv0 contract account
990- let poolCap = FlowALPv0 .account .capabilities .storage .issue <auth (FlowALPModels.EPosition ) &{FlowALPModels .PositionPool }>(
991- FlowALPv0 .PoolStoragePath
992- )
989+ let poolCap = FlowALPv0 .account .capabilities .storage
990+ .issue <auth (FlowALPModels.EPosition ) &{FlowALPModels .PositionPool }>(FlowALPv0 .PoolStoragePath )
993991
994992 // Create and return the Position resource
995-
996993 let position <- FlowALPPositionResources .createPosition (id : id , pool : poolCap )
997994
998995 self .unlockPosition (id )
@@ -1214,7 +1211,7 @@ access(all) contract FlowALPv0 {
12141211 withdrawType : type ,
12151212 withdrawAmount : amount
12161213 )
1217-
1214+
12181215 let pulledVault <- topUpSource .withdrawAvailable (maxAmount : targetHealthDeposit )
12191216 assert (pulledVault .getType () == purportedTopUpType , message : " topUpSource returned unexpected token type" )
12201217 self ._depositEffectsOnly (
@@ -1302,7 +1299,7 @@ access(all) contract FlowALPv0 {
13021299 /// Returns a mutable reference to the pool's configuration.
13031300 /// Use this to update config fields that don't require events or side effects.
13041301 access (FlowALPModels.EGovernance ) fun borrowConfig (): auth (FlowALPModels.EImplementation ) &{FlowALPModels .PoolConfig } {
1305- return &self .config as auth ( FlowALPModels.EImplementation ) &{ FlowALPModels . PoolConfig }
1302+ return &self .config
13061303 }
13071304
13081305 /// Pauses the pool, temporarily preventing further withdrawals, deposits, and liquidations
@@ -1508,7 +1505,7 @@ access(all) contract FlowALPv0 {
15081505
15091506 // Recalculate currentCreditRate for a given token to reflect the new stability rate
15101507 tsRef .updateInterestRates ()
1511-
1508+
15121509 FlowALPEvents .emitStabilityFeeRateUpdated (
15131510 poolUUID : self .uuid ,
15141511 tokenType : tokenType .identifier ,
@@ -1858,7 +1855,7 @@ access(all) contract FlowALPv0 {
18581855 }
18591856
18601857 if insuranceAmountUFix64 > reserveVault .balance {
1861- // do not collect the insurance fee if the reserve doesn't have enough tokens to cover the full amount
1858+ // do not collect the insurance fee if the reserve doesn't have enough tokens to cover the full amount
18621859 return nil
18631860 }
18641861
@@ -1914,11 +1911,11 @@ access(all) contract FlowALPv0 {
19141911 }
19151912
19161913 if stabilityAmountUFix64 > reserveVault .balance {
1917- // do not collect the stability fee if the reserve doesn't have enough tokens to cover the full amount
1914+ // do not collect the stability fee if the reserve doesn't have enough tokens to cover the full amount
19181915 return nil
19191916 }
19201917
1921- let stabilityVault <- reserveVault .withdraw (amount : stabilityAmountUFix64 )
1918+ let stabilityVault <- reserveVault .withdraw (amount : stabilityAmountUFix64 )
19221919 tokenState .setLastStabilityFeeCollectionTime (currentTime )
19231920 return <- stabilityVault
19241921 }
@@ -2135,7 +2132,7 @@ access(all) contract FlowALPv0 {
21352132 )
21362133 FlowALPv0 .account .storage .save (<- pool , to : FlowALPv0 .PoolStoragePath )
21372134 let cap = FlowALPv0 .account .capabilities .storage .issue <&Pool >(FlowALPv0 .PoolStoragePath )
2138- FlowALPv0 .account .capabilities .unpublish (FlowALPv0 .PoolPublicPath )
2135+ let _ = FlowALPv0 .account .capabilities .unpublish (FlowALPv0 .PoolPublicPath )
21392136 FlowALPv0 .account .capabilities .publish (cap , at : FlowALPv0 .PoolPublicPath )
21402137 }
21412138 }
@@ -2167,6 +2164,5 @@ access(all) contract FlowALPv0 {
21672164 <- create PoolFactory (),
21682165 to : self .PoolFactoryPath
21692166 )
2170- let factory = self .account .storage .borrow <&PoolFactory >(from : self .PoolFactoryPath )!
21712167 }
21722168}
0 commit comments