2021-10-03 14:02:56 +00:00
|
|
|
const hre = require("hardhat");
|
|
|
|
const { ethers } = hre;
|
|
|
|
const addresses = require("./constant/addresses");
|
2021-10-04 20:37:30 +00:00
|
|
|
const abis = require("../constant/abis");
|
2021-10-03 14:02:56 +00:00
|
|
|
|
2021-10-04 20:37:30 +00:00
|
|
|
const instaImplementations_m1 = require("../../deployements/mainnet/Implementation_m1.sol/InstaImplementationM1.json")
|
2021-10-03 14:02:56 +00:00
|
|
|
|
|
|
|
module.exports = async function (owner) {
|
|
|
|
const instaIndex = await ethers.getContractAt(abis.core.instaIndex, addresses.core.instaIndex)
|
|
|
|
|
|
|
|
const tx = await instaIndex.build(owner, 2, owner);
|
|
|
|
const receipt = await tx.wait()
|
|
|
|
const event = receipt.events.find(a => a.event === "LogAccountCreated")
|
|
|
|
return await ethers.getContractAt(instaImplementations_m1.abi, event.args.account)
|
|
|
|
};
|