Skip to content

Commit

Permalink
Merge pull request #162 from BitGo/coin-1108-base-eip1559
Browse files Browse the repository at this point in the history
feat(eth-multisig-v4): update contract deploy script to use eip1559
  • Loading branch information
venkateshv1266 authored Aug 14, 2024
2 parents 6d711c8 + 3dc2eae commit e68040b
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 @@ -98,11 +100,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 @@ -112,7 +113,7 @@ async function main() {
);
const walletFactory = await WalletFactory.deploy(
walletSimple.address,
gasParams
eip1559GasParams
);
await walletFactory.deployed();
output.walletFactory = walletFactory.address;
Expand All @@ -122,18 +123,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 e68040b

Please sign in to comment.