Skip to content

Commit

Permalink
suggested factory name
Browse files Browse the repository at this point in the history
  • Loading branch information
aazhou1 committed Dec 21, 2024
1 parent 5fb98e8 commit 42e08f5
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion hardhat-scripts/deploy-strategy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down

0 comments on commit 42e08f5

Please sign in to comment.