From 42e08f5f545068cefb4e9346f530175d9dd58c2a Mon Sep 17 00:00:00 2001 From: aazhou1 Date: Sat, 21 Dec 2024 00:04:34 -0800 Subject: [PATCH] suggested factory name --- hardhat-scripts/deploy-strategy.ts | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/hardhat-scripts/deploy-strategy.ts b/hardhat-scripts/deploy-strategy.ts index e0e4b4c..428b886 100644 --- a/hardhat-scripts/deploy-strategy.ts +++ b/hardhat-scripts/deploy-strategy.ts @@ -198,7 +198,31 @@ console.log("Hardhat found artifact:", { discountRateMarkup: params.discountRateMarkup.toString() } }); - const strategy = await connectedStrategy.deploy(strategyName!, strategySymbol!, params); + // Create a struct that exactly matches the constructor's tuple type + const deployParams = { + _name: strategyName, + _symbol: strategySymbol, + _params: { + asset: params.asset, + yearnVaultAddress: params.yearnVaultAddress, + discountRateAdapterAddress: params.discountRateAdapterAddress, + eventEmitter: params.eventEmitter, + deployer: params.deployer, + termController: params.termController, + repoTokenConcentrationLimit: params.repoTokenConcentrationLimit, + timeToMaturityThreshold: params.timeToMaturityThreshold, + newRequiredReserveRatio: params.newRequiredReserveRatio, + discountRateMarkup: params.discountRateMarkup + } + }; + + // Try deploying with the exact parameter names matching the ABI + const strategy = await connectedStrategy.deploy( + deployParams._name, + deployParams._symbol, + deployParams._params + ); + console.log(JSON.stringify(strategy)); await strategy.deployed();