Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: updating the deploy script to be able to deploy remaining contracts. #188

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 23 additions & 20 deletions scripts/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,19 @@ async function main() {
const [deployer] = await ethers.getSigners();
const txCount = await deployer.getTransactionCount();

if (txCount === 1 || txCount === 3) {
throw Error('Cannot deploy contracts, please update the script');
}
// if (txCount === 1 || txCount === 3) {
// throw Error('Cannot deploy contracts, please update the script');
// }
//
// if (txCount === 0) {
// deployWalletContracts = true;
// deployForwarderContracts = true;
// } else if (txCount === 2) {
// deployForwarderContracts = true;
// }

if (txCount === 0) {
deployWalletContracts = true;
deployForwarderContracts = true;
} else if (txCount === 2) {
deployForwarderContracts = true;
}
deployWalletContracts = true;
deployForwarderContracts = true;

let walletImplementationContractName = '';
let walletFactoryContractName = 'WalletFactory';
Expand Down Expand Up @@ -148,19 +151,19 @@ async function main() {
console.log(
'Deploying wallet contract called: ' + walletImplementationContractName
);
const WalletSimple = await ethers.getContractFactory(
walletImplementationContractName
);
const walletSimple = await WalletSimple.deploy(eip1559GasParams);
await walletSimple.deployed();
output.walletImplementation = walletSimple.address;
console.log('WalletSimple deployed at ' + walletSimple.address);
// const WalletSimple = await ethers.getContractFactory(
// walletImplementationContractName
// );
// const walletSimple = await WalletSimple.deploy(eip1559GasParams);
// await walletSimple.deployed();
// output.walletImplementation = walletSimple.address;
// console.log('WalletSimple deployed at ' + walletSimple.address);

const WalletFactory = await ethers.getContractFactory(
walletFactoryContractName
);
const walletFactory = await WalletFactory.deploy(
walletSimple.address,
'0x944FEF03Af368414F29dC31a72061B8D64F568d2',
eip1559GasParams
);
await walletFactory.deployed();
Expand All @@ -172,19 +175,19 @@ async function main() {
await new Promise((r) => setTimeout(r, 1000 * 300));

// We have to wait for a minimum of 10 block confirmations before we can call the etherscan api to verify
await walletSimple.deployTransaction.wait(10);
//await walletSimple.deployTransaction.wait(10);
await walletFactory.deployTransaction.wait(10);

console.log('Done waiting, verifying wallet contracts');

await verifyContract(
walletImplementationContractName,
walletSimple.address,
'0x944FEF03Af368414F29dC31a72061B8D64F568d2',
[],
contractPath
);
await verifyContract('WalletFactory', walletFactory.address, [
walletSimple.address
'0x944FEF03Af368414F29dC31a72061B8D64F568d2'
]);

console.log('Wallet Contracts verified');
Expand Down
Loading