Skip to content

Commit 247337f

Browse files
committed
clean up unused variables and parameters
1 parent 3a27460 commit 247337f

24 files changed

Lines changed: 51 additions & 59 deletions

cadence/contracts/FlowYieldVaultsSchedulerRegistry.cdc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ access(all) contract FlowYieldVaultsSchedulerRegistry {
147147
access(account)
148148
fun setSupervisorCap(cap: Capability<auth(FlowTransactionScheduler.Execute) &{FlowTransactionScheduler.TransactionHandler}>) {
149149
let storedCapPath = /storage/FlowYieldVaultsSupervisorCapability
150-
let old = self.account.storage
150+
let _old = self.account.storage
151151
.load<Capability<auth(FlowTransactionScheduler.Execute) &{FlowTransactionScheduler.TransactionHandler}>>(
152152
from: storedCapPath
153153
)

cadence/contracts/FlowYieldVaultsSchedulerV1.cdc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ access(all) contract FlowYieldVaultsSchedulerV1 {
175175
/// "recurringInterval": UFix64 (for Supervisor self-rescheduling)
176176
/// "scanForStuck": Bool (default true - scan up to MAX_BATCH_SIZE least-recently-executed recurring scan participants for stuck ones)
177177
/// }
178-
access(FlowTransactionScheduler.Execute) fun executeTransaction(id: UInt64, data: AnyStruct?) {
178+
access(FlowTransactionScheduler.Execute) fun executeTransaction(id _: UInt64, data: AnyStruct?) {
179179
let cfg = data as? {String: AnyStruct} ?? {}
180180
let priorityRaw = cfg["priority"] as? UInt8 ?? FlowYieldVaultsSchedulerV1.DEFAULT_PRIORITY
181181
let executionEffort = cfg["executionEffort"] as? UInt64 ?? FlowYieldVaultsSchedulerV1.DEFAULT_EXECUTION_EFFORT

cadence/contracts/PMStrategiesV1.cdc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -828,11 +828,11 @@ access(all) contract PMStrategiesV1 {
828828
}
829829

830830
access(all) view fun getViews(): [Type] { return [] }
831-
access(all) fun resolveView(_ view: Type): AnyStruct? { return nil }
831+
access(all) fun resolveView(_ _view: Type): AnyStruct? { return nil }
832832

833833
/// Called by FlowTransactionScheduler when the timelock expires.
834834
/// No-ops gracefully if the pending redeem was already cleared.
835-
access(FlowTransactionScheduler.Execute) fun executeTransaction(id: UInt64, data: AnyStruct?) {
835+
access(FlowTransactionScheduler.Execute) fun executeTransaction(id _: UInt64, data: AnyStruct?) {
836836
let dataDict = data as? {String: AnyStruct}
837837
?? panic("PendingRedeemHandler: invalid data format")
838838
let yieldVaultID = dataDict["yieldVaultID"] as? UInt64

cadence/contracts/mocks/EVM.cdc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -803,7 +803,6 @@ contract EVM {
803803
}
804804

805805
// verify evm address matching
806-
var addr = coaRef!.address()
807806
for index, item in coaRef!.address().bytes {
808807
if item != evmAddress[index] {
809808
return ValidationResult(

cadence/contracts/mocks/FlowTransactionScheduler.cdc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ access(all) contract FlowTransactionScheduler {
138138
return []
139139
}
140140

141-
access(all) fun resolveView(_ view: Type): AnyStruct? {
141+
access(all) fun resolveView(_ _view: Type): AnyStruct? {
142142
return nil
143143
}
144144

cadence/contracts/mocks/FlowYieldVaultsClosedBeta_validate_beta_false.cdc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ access(all) contract FlowYieldVaultsClosedBeta {
117117

118118
// TEST-ONLY: Always invalid, regardless of address or reference.
119119
// Used to ensure beta-gated entrypoints actually call `validateBeta`.
120-
access(all) view fun validateBeta(_ addr: Address?, _ betaRef: auth(Beta) &BetaBadge): Bool {
120+
access(all) view fun validateBeta(_ _addr: Address?, _ _betaRef: auth(Beta) &BetaBadge): Bool {
121121
return false
122122
}
123123

cadence/contracts/mocks/MockStrategies.cdc

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -261,19 +261,19 @@ access(all) contract MockStrategies {
261261
}
262262

263263
/// Returns the Vault types which can be used to initialize a given Strategy
264-
access(all) view fun getSupportedInitializationVaults(forStrategy: Type): {Type: Bool} {
264+
access(all) view fun getSupportedInitializationVaults(forStrategy _: Type): {Type: Bool} {
265265
return { Type<@FlowToken.Vault>(): true }
266266
}
267267

268268
/// Returns the Vault types which can be deposited to a given Strategy instance if it was initialized with the
269269
/// provided Vault type
270-
access(all) view fun getSupportedInstanceVaults(forStrategy: Type, initializedWith: Type): {Type: Bool} {
270+
access(all) view fun getSupportedInstanceVaults(forStrategy _strategy: Type, initializedWith _type: Type): {Type: Bool} {
271271
return { Type<@FlowToken.Vault>(): true }
272272
}
273273

274274
/// Composes a Strategy of the given type with the provided funds
275275
access(all) fun createStrategy(
276-
_ type: Type,
276+
_ _type: Type,
277277
uniqueID: DeFiActions.UniqueIdentifier,
278278
withFunds: @{FungibleToken.Vault}
279279
): @{FlowYieldVaults.Strategy} {
@@ -497,8 +497,6 @@ access(all) contract MockStrategies {
497497
init() {
498498
self.IssuerStoragePath = StoragePath(identifier: "MockStrategiesComposerIssuer_\(self.account.address)")!
499499

500-
let initialCollateralType = Type<@FlowToken.Vault>()
501-
502500
let configs: {Type: {Type: {Type: {String: AnyStruct}}}} = {
503501
Type<@TracerStrategyComposer>(): {
504502
Type<@TracerStrategy>(): {}

cadence/contracts/mocks/MockStrategy.cdc

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import "FlowYieldVaults"
1313
access(all) contract MockStrategy {
1414

1515
access(all) let IssuerStoragePath : StoragePath
16-
16+
1717
access(all) struct Sink : DeFiActions.Sink {
1818
access(contract) var uniqueID: DeFiActions.UniqueIdentifier?
1919
init(_ id: DeFiActions.UniqueIdentifier?) {
@@ -25,7 +25,7 @@ access(all) contract MockStrategy {
2525
access(all) fun minimumCapacity(): UFix64 {
2626
return 0.0
2727
}
28-
access(all) fun depositCapacity(from: auth(FungibleToken.Withdraw) &{FungibleToken.Vault}) {
28+
access(all) fun depositCapacity(from _: auth(FungibleToken.Withdraw) &{FungibleToken.Vault}) {
2929
return
3030
}
3131
access(all) fun getComponentInfo(): DeFiActions.ComponentInfo {
@@ -53,7 +53,7 @@ access(all) contract MockStrategy {
5353
access(all) fun minimumAvailable(): UFix64 {
5454
return 0.0
5555
}
56-
access(FungibleToken.Withdraw) fun withdrawAvailable(maxAmount: UFix64): @{FungibleToken.Vault} {
56+
access(FungibleToken.Withdraw) fun withdrawAvailable(maxAmount _: UFix64): @{FungibleToken.Vault} {
5757
return <- DeFiActionsUtils.getEmptyVault(self.getSourceType())
5858
}
5959
access(all) fun getComponentInfo(): DeFiActions.ComponentInfo {
@@ -143,15 +143,15 @@ access(all) contract MockStrategy {
143143
access(all) view fun getComposedStrategyTypes(): {Type: Bool} {
144144
return { Type<@Strategy>(): true }
145145
}
146-
access(all) view fun getSupportedInitializationVaults(forStrategy: Type): {Type: Bool} {
146+
access(all) view fun getSupportedInitializationVaults(forStrategy _: Type): {Type: Bool} {
147147
return { Type<@FlowToken.Vault>(): true }
148148
}
149-
access(all) view fun getSupportedInstanceVaults(forStrategy: Type, initializedWith: Type): {Type: Bool} {
149+
access(all) view fun getSupportedInstanceVaults(forStrategy _strategy: Type, initializedWith _type: Type): {Type: Bool} {
150150
return { Type<@FlowToken.Vault>(): true }
151151
}
152152
access(all) fun createStrategy(
153-
_ type: Type,
154-
uniqueID: DeFiActions.UniqueIdentifier,
153+
_ _type: Type,
154+
uniqueID _: DeFiActions.UniqueIdentifier,
155155
withFunds: @{FungibleToken.Vault}
156156
): @{FlowYieldVaults.Strategy} {
157157
let id = DeFiActions.createUniqueIdentifier()

cadence/contracts/mocks/YieldToken.cdc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ access(all) contract YieldToken : FungibleToken {
2929
/// and store the returned Vault in their storage in order to allow their
3030
/// account to be able to receive deposits of this token type.
3131
///
32-
access(all) fun createEmptyVault(vaultType: Type): @YieldToken.Vault {
32+
access(all) fun createEmptyVault(vaultType _: Type): @YieldToken.Vault {
3333
return <- create Vault(balance: 0.0)
3434
}
3535

36-
access(all) view fun getContractViews(resourceType: Type?): [Type] {
36+
access(all) view fun getContractViews(resourceType _: Type?): [Type] {
3737
return [
3838
Type<FungibleTokenMetadataViews.FTView>(),
3939
Type<FungibleTokenMetadataViews.FTDisplay>(),
@@ -42,7 +42,7 @@ access(all) contract YieldToken : FungibleToken {
4242
]
4343
}
4444

45-
access(all) fun resolveContractView(resourceType: Type?, viewType: Type): AnyStruct? {
45+
access(all) fun resolveContractView(resourceType _: Type?, viewType: Type): AnyStruct? {
4646
switch viewType {
4747
case Type<FungibleTokenMetadataViews.FTView>():
4848
return FungibleTokenMetadataViews.FTView(

cadence/contracts/mocks/incrementfi/SwapPairTemplate.cdc

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ access(all) contract SwapPair: FungibleToken {
2828
access(all) var price0CumulativeLastScaled: UInt256
2929
access(all) var price1CumulativeLastScaled: UInt256
3030

31-
/// Transaction lock
31+
/// Transaction lock
3232
access(self) var lock: Bool
3333

3434
/// √(reserve0 * reserve1) for volatile pool, or √√[(r0^3 * r1 + r0 * r1^3) / 2] for stable pool, as of immediately after the most recent liquidity event
@@ -92,7 +92,7 @@ access(all) contract SwapPair: FungibleToken {
9292
/// SwapPair doesn't support MetadataViews api as this is not just a normal FT, and there could be multiple types of lpTokens
9393
/// for different SwapPairs, so it is stored in LpTokenCollection instead (not directly associated with a StoragePath).
9494
access(all) view fun getViews(): [Type] { return [] }
95-
access(all) fun resolveView(_ view: Type): AnyStruct? { return nil }
95+
access(all) fun resolveView(_ _view: Type): AnyStruct? { return nil }
9696

9797
/// withdraw
9898
///
@@ -166,8 +166,8 @@ access(all) contract SwapPair: FungibleToken {
166166
///
167167
/// SwapPair doesn't support MetadataViews api as this is not just a normal FT, and there could be multiple types of lpTokens
168168
/// for different SwapPairs, so it is stored in LpTokenCollection instead (not directly associated with a StoragePath).
169-
access(all) view fun getContractViews(resourceType: Type?): [Type] { return [] }
170-
access(all) fun resolveContractView(resourceType: Type?, viewType: Type): AnyStruct? { return nil }
169+
access(all) view fun getContractViews(resourceType _: Type?): [Type] { return [] }
170+
access(all) fun resolveContractView(resourceType _resourceType: Type?, viewType _viewType: Type): AnyStruct? { return nil }
171171

172172
/// createEmptyVault
173173
//
@@ -176,7 +176,7 @@ access(all) contract SwapPair: FungibleToken {
176176
/// and store the returned Vault in their storage in order to allow their
177177
/// account to be able to receive deposits of this token type.
178178
///
179-
access(all) fun createEmptyVault(vaultType: Type): @SwapPair.Vault {
179+
access(all) fun createEmptyVault(vaultType _: Type): @SwapPair.Vault {
180180
return <-create Vault(balance: 0.0)
181181
}
182182

@@ -191,7 +191,7 @@ access(all) contract SwapPair: FungibleToken {
191191
self.totalSupply = self.totalSupply + amount
192192
emit TokensMinted(amount: amount)
193193
return <- create Vault(balance: amount)
194-
}
194+
}
195195

196196
/// Burn lpTokens
197197
access(self) fun burnLpToken(from: @SwapPair.Vault) {
@@ -210,7 +210,7 @@ access(all) contract SwapPair: FungibleToken {
210210
msg: "SwapPair: added zero liquidity",
211211
err: SwapError.ErrorCode.ADD_ZERO_LIQUIDITY
212212
)
213-
(tokenAVault.isInstance(self.token0VaultType) && tokenBVault.isInstance(self.token1VaultType)) ||
213+
(tokenAVault.isInstance(self.token0VaultType) && tokenBVault.isInstance(self.token1VaultType)) ||
214214
(tokenBVault.isInstance(self.token0VaultType) && tokenAVault.isInstance(self.token1VaultType)):
215215
SwapError.ErrorEncode(
216216
msg: "SwapPair: added incompatible liquidity pair vaults",
@@ -533,7 +533,7 @@ self.lock = false
533533
self.price1CumulativeLastScaled = SwapConfig.overflowAddUInt256(
534534
self.price1CumulativeLastScaled,
535535
SwapConfig.UFix64ToScaledUInt256(price1) * timeElapsedScaled / SwapConfig.scaleFactor
536-
)
536+
)
537537
}
538538
self.blockTimestampLast = blockTimestamp
539539
}

0 commit comments

Comments
 (0)