Skip to content

Commit

Permalink
feat(eth-multisig-v4): update contract deploy script to use eip1559
Browse files Browse the repository at this point in the history
  • Loading branch information
venkateshv1266 committed Aug 14, 2024
1 parent e9c9080 commit 3dc2eae
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions scripts/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ async function main() {
};

const feeData = await ethers.provider.getFeeData();
const gasParams = {
gasPrice: feeData.gasPrice

const eip1559GasParams = {
maxFeePerGas: feeData.maxFeePerGas,
maxPriorityFeePerGas: feeData.maxPriorityFeePerGas
};

const [deployer] = await ethers.getSigners();
Expand Down Expand Up @@ -93,11 +95,10 @@ async function main() {
console.log(
'Deployed wallet contract called: ' + walletImplementationContractName
);

const WalletSimple = await ethers.getContractFactory(
walletImplementationContractName
);
const walletSimple = await WalletSimple.deploy(gasParams);
const walletSimple = await WalletSimple.deploy(eip1559GasParams);
await walletSimple.deployed();
output.walletImplementation = walletSimple.address;
console.log('WalletSimple deployed at ' + walletSimple.address);
Expand All @@ -107,7 +108,7 @@ async function main() {
);
const walletFactory = await WalletFactory.deploy(
walletSimple.address,
gasParams
eip1559GasParams
);
await walletFactory.deployed();
output.walletFactory = walletFactory.address;
Expand All @@ -117,18 +118,15 @@ async function main() {
// ForwarderV4 and ForwarderFactoryV4.
// If we have to deploy contracts for the older coins like eth, avax, polygon, we need to deploy Forwarder and ForwarderFactory
const Forwarder = await ethers.getContractFactory(forwarderContractName);
const forwarder = await Forwarder.deploy(gasParams);
const forwarder = await Forwarder.deploy();
await forwarder.deployed();
output.forwarderImplementation = forwarder.address;
console.log(`${forwarderContractName} deployed at ` + forwarder.address);

const ForwarderFactory = await ethers.getContractFactory(
forwarderFactoryContractName
);
const forwarderFactory = await ForwarderFactory.deploy(
forwarder.address,
gasParams
);
const forwarderFactory = await ForwarderFactory.deploy(forwarder.address);
await forwarderFactory.deployed();
output.forwarderFactory = forwarderFactory.address;
console.log(
Expand Down

0 comments on commit 3dc2eae

Please sign in to comment.