Skip to content

Commit

Permalink
Update deployment scripts, update destination function to view
Browse files Browse the repository at this point in the history
  • Loading branch information
jules committed Jan 20, 2025
1 parent 2507c3a commit d4eb35c
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 11 deletions.
2 changes: 1 addition & 1 deletion contracts/stakeAndBake/depositor/IDepositor.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
Expand Down
17 changes: 15 additions & 2 deletions scripts/deployments/stake-and-bake.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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,
Expand Down
15 changes: 8 additions & 7 deletions scripts/deployments/teller-depositor.ts
Original file line number Diff line number Diff line change
@@ -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',
Expand All @@ -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}`);
Expand Down

0 comments on commit d4eb35c

Please sign in to comment.