From d4eb35c69ad0348e0b9f128fcf85e78b662e59f4 Mon Sep 17 00:00:00 2001 From: Jules de Smit Date: Mon, 20 Jan 2025 12:19:51 +0400 Subject: [PATCH] Update deployment scripts, update destination function to view --- contracts/stakeAndBake/depositor/IDepositor.sol | 2 +- .../TellerWithMultiAssetSupportDepositor.sol | 2 +- scripts/deployments/stake-and-bake.ts | 17 +++++++++++++++-- scripts/deployments/teller-depositor.ts | 15 ++++++++------- 4 files changed, 25 insertions(+), 11 deletions(-) diff --git a/contracts/stakeAndBake/depositor/IDepositor.sol b/contracts/stakeAndBake/depositor/IDepositor.sol index 24ab64c..765feb0 100644 --- a/contracts/stakeAndBake/depositor/IDepositor.sol +++ b/contracts/stakeAndBake/depositor/IDepositor.sol @@ -24,5 +24,5 @@ interface IDepositor { /** * @notice Retrieves the final vault address. Used for granting `permit` to the right address. */ - function destination() external returns (address); + function destination() external view returns (address); } diff --git a/contracts/stakeAndBake/depositor/TellerWithMultiAssetSupportDepositor.sol b/contracts/stakeAndBake/depositor/TellerWithMultiAssetSupportDepositor.sol index 049d524..727ec8a 100644 --- a/contracts/stakeAndBake/depositor/TellerWithMultiAssetSupportDepositor.sol +++ b/contracts/stakeAndBake/depositor/TellerWithMultiAssetSupportDepositor.sol @@ -76,7 +76,7 @@ contract TellerWithMultiAssetSupportDepositor is IDepositor, ReentrancyGuard { /** * @notice Retrieves the final vault address. Used for granting allowance to the right address. */ - function destination() public returns (address) { + function destination() public view returns (address) { return ITeller(teller).vault(); } } diff --git a/scripts/deployments/stake-and-bake.ts b/scripts/deployments/stake-and-bake.ts index 309f240..fd6fab3 100644 --- a/scripts/deployments/stake-and-bake.ts +++ b/scripts/deployments/stake-and-bake.ts @@ -11,6 +11,10 @@ task('deploy-stake-and-bake', 'Deploys the StakeAndBake contract') .addParam('ledgerNetwork', 'The network name of ledger', 'mainnet') .addParam('lbtc', 'The address of the LBTC contract') .addParam('admin', 'The owner of the proxy') + .addParam('operator', 'The operator of the StakeAndBake contract') + .addParam('fee', 'The starting fee setting') + .addParam('claimer', 'The claimer of the StakeAndBake contract') + .addParam('pauser', 'The pauser of the StakeAndBake contract') .addParam( 'proxyFactoryAddr', 'The ProxyFactory address', @@ -19,11 +23,20 @@ task('deploy-stake-and-bake', 'Deploys the StakeAndBake contract') .setAction(async (taskArgs, hre, network) => { const { ethers } = hre; - const { ledgerNetwork, lbtc, admin, proxyFactoryAddr } = taskArgs; + const { + ledgerNetwork, + lbtc, + admin, + operator, + fee, + claimer, + pauser, + proxyFactoryAddr, + } = taskArgs; await create3( 'StakeAndBake', - [lbtc, admin], + [lbtc, admin, operator, fee, claimer, pauser], proxyFactoryAddr, ledgerNetwork, admin, diff --git a/scripts/deployments/teller-depositor.ts b/scripts/deployments/teller-depositor.ts index 28c8f63..da61a24 100644 --- a/scripts/deployments/teller-depositor.ts +++ b/scripts/deployments/teller-depositor.ts @@ -1,18 +1,22 @@ import { task } from 'hardhat/config'; import { create3 } from '../helpers/create3Deployment'; import { sleep } from '../helpers'; +import { verify } from '../helpers'; task( 'deploy-teller-depositor', 'Deploys the TellerWithMultiAssetSupportDepositor contract' ) .addParam('ledgerNetwork', 'The network name of ledger', 'mainnet') + .addParam('teller', 'The address of the vault') + .addParam('lbtc', 'The address of the LBTC contract') + .addParam('stakeAndBake', 'The address of the StakeAndBake contract') .setAction(async (taskArgs, hre, network) => { const { ethers } = hre; - const { ledgerNetwork } = taskArgs; + const { ledgerNetwork, teller, lbtc, stakeAndBake } = taskArgs; - const args = []; + const args = [teller, lbtc, stakeAndBake]; const adapter = await hre.ethers.deployContract( 'TellerWithMultiAssetSupportDepositor', @@ -25,11 +29,8 @@ task( await sleep(12_000); try { - await run('verify:verify', { - address: await adapter.getAddress(), - contract: - 'contracts/stakeAndBake/depositor/TellerWithMultiAssetSupportDepositor.sol:TellerWithMultiAssetSupportDepositor', - args, + await verify(hre.run, await adapter.getAddress(), { + constructorArguments: [teller, lbtc, stakeAndBake], }); } catch (e) { console.error(`Verification failed: ${e}`);