Skip to content

Commit 6a32fb5

Browse files
feat: deploy V2 contracts on Avaxc
Ticket: COIN-1712
1 parent f40f4ae commit 6a32fb5

File tree

2 files changed

+19
-9
lines changed

2 files changed

+19
-9
lines changed

hardhat.config.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,7 @@ const config: HardhatUserConfig = {
9393
},
9494
avaxc: {
9595
url: 'https://api.avax.network/ext/bc/C/rpc',
96-
accounts: [
97-
`${PRIVATE_KEY_FOR_V1_WALLET_CONTRACT_DEPLOYMENT}`,
98-
`${PRIVATE_KEY_FOR_V4_CONTRACT_DEPLOYMENT_BACKUP}`
99-
]
96+
accounts: [`${MAINNET_PRIVATE_KEY_FOR_CONTRACT_DEPLOYMENT}`]
10097
}
10198
},
10299
gasReporter: {

scripts/deploy.ts

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,20 @@ async function main() {
1010
forwarderFactory: ''
1111
};
1212

13+
14+
const feeData = await ethers.provider.getFeeData();
15+
16+
const gasParams = {
17+
gasPrice: feeData.gasPrice!.mul('2'),
18+
gasLimit: 4500000
19+
};
20+
1321
const [deployer] = await ethers.getSigners();
1422

1523
let walletImplementationContractName = '';
1624
let walletFactoryContractName = 'WalletFactory';
1725
const chainId = await deployer.getChainId();
18-
switch (await deployer.getChainId()) {
26+
switch (chainId) {
1927
// https://chainlist.org/
2028
//eth
2129
case 1:
@@ -48,6 +56,11 @@ async function main() {
4856
case 11155420:
4957
walletImplementationContractName = 'OpethWalletSimple';
5058
break;
59+
//avaxc
60+
case 43114:
61+
//tavaxc
62+
case 43113:
63+
walletImplementationContractName = 'AvaxcWalletSimple';
5164
}
5265

5366
console.log(
@@ -57,27 +70,27 @@ async function main() {
5770
const WalletSimple = await ethers.getContractFactory(
5871
walletImplementationContractName
5972
);
60-
const walletSimple = await WalletSimple.deploy();
73+
const walletSimple = await WalletSimple.deploy(gasParams);
6174
await walletSimple.deployed();
6275
output.walletImplementation = walletSimple.address;
6376
console.log('WalletSimple deployed at ' + walletSimple.address);
6477

6578
const WalletFactory = await ethers.getContractFactory(
6679
walletFactoryContractName
6780
);
68-
const walletFactory = await WalletFactory.deploy(walletSimple.address);
81+
const walletFactory = await WalletFactory.deploy(walletSimple.address, gasParams);
6982
await walletFactory.deployed();
7083
output.walletFactory = walletFactory.address;
7184
console.log('WalletFactory deployed at ' + walletFactory.address);
7285

7386
const Forwarder = await ethers.getContractFactory('Forwarder');
74-
const forwarder = await Forwarder.deploy();
87+
const forwarder = await Forwarder.deploy(gasParams);
7588
await forwarder.deployed();
7689
output.forwarderImplementation = forwarder.address;
7790
console.log('Forwarder deployed at ' + forwarder.address);
7891

7992
const ForwarderFactory = await ethers.getContractFactory('ForwarderFactory');
80-
const forwarderFactory = await ForwarderFactory.deploy(forwarder.address);
93+
const forwarderFactory = await ForwarderFactory.deploy(forwarder.address, gasParams);
8194
await forwarderFactory.deployed();
8295
output.forwarderFactory = forwarderFactory.address;
8396
console.log('ForwarderFactory deployed at ' + forwarderFactory.address);

0 commit comments

Comments
 (0)