-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmigration.js
27 lines (25 loc) · 1007 Bytes
/
migration.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
const { Wallet, ethers } = require("ethers");
const PriceFeedMockETHUSDJson = require("./artifacts/PriceFeedMockETHUSD.json");
async function main() {
const provider = new ethers.providers.JsonRpcProvider("http://localhost:8546");
var wallet = ethers.Wallet.fromMnemonic("cat hunt differ medal dutch guide farm fortune lesson episode post spin"); // Ganache Mnemonic
wallet = wallet.connect(provider);
//const { 1: otherWallet } = await ethers.getSigners();
const signer = await wallet.getAddress();
const PriceFeedDAIETH = new ethers.ContractFactory(
PriceFeedMockETHUSDJson.abi,
PriceFeedMockETHUSDJson.bytecode,
wallet
);
const priceFeedDAIETH = await PriceFeedDAIETH.deploy({
gasLimit : 400000
});
await PriceFeedDAIETH.deployed();
//console.log(priceFeedDAIETH.address, "ADDRESS of the contract");
}
main()
.then(() => process.exit(0))
.catch(error => {
console.error(error);
process.exit(1);
});