-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
347 additions
and
198 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,87 +1,98 @@ | ||
import { ethers } from "hardhat"; | ||
import { AIMeFactoryV4, AIMePowerLauncher, AIMePowerLauncherSepolia, AIMeCreator } from "../../typechain"; | ||
|
||
const NonfungiblePositionManager = "0x03a520b32C04BF3bEEf7BEb72E919cf822Ed34f1"; // on base | ||
const SwapRouterAddress = "0x2626664c2603336E57B271c5C0b26F421741e481"; // swap router2 on base | ||
|
||
async function deployAIMeContractsAll() { | ||
const contractFactory = await ethers.getContractFactory("AIMeFactoryV4"); | ||
const instance = await contractFactory.deploy(); | ||
await instance.deployed(); | ||
// power launcher | ||
const powerLauncherAddress = await deployAIMePowerLauncher(); | ||
|
||
console.log("AIMeFactory V4 contract deployed to", instance.address); | ||
// aime factory | ||
const factoryAddress = await deployAIMeFactory(); | ||
|
||
const powerLauncherContractFactory = await ethers.getContractFactory( | ||
"AIMePowerLauncher" | ||
// manager | ||
const managerAddress = await deployAIMeManager(); | ||
|
||
const aimeManagerContractFactory = await ethers.getContractFactory( | ||
"AIMeManager" | ||
); | ||
const powerLauncher = await powerLauncherContractFactory.deploy(); | ||
await powerLauncher.deployed(); | ||
const managerContract = aimeManagerContractFactory.attach(managerAddress); | ||
|
||
console.log("powerLauncher contract deployed to", powerLauncher.address); | ||
const tx1 = await managerContract.updateAIMeFactory(factoryAddress); | ||
await tx1.wait(); | ||
|
||
const aimeCreatorContractFactory = await ethers.getContractFactory( | ||
"AIMeCreator" | ||
const tx2 = await managerContract.updateAIMePowerLauncher( | ||
powerLauncherAddress | ||
); | ||
const aimeCreator = await aimeCreatorContractFactory.deploy(); | ||
await aimeCreator.deployed(); | ||
await tx2.wait(); | ||
|
||
console.log("aimeCreator contract deployed to", aimeCreator.address); | ||
console.log("Power launcher and fatory updated in manager contract"); | ||
} | ||
|
||
async function deployAIMeFactoryV4() { | ||
const contractFactory = await ethers.getContractFactory("AIMeFactoryV4"); | ||
const instance = await contractFactory.deploy(); | ||
await instance.deployed(); | ||
// async function deployAIMeFactoryV4() { | ||
// const contractFactory = await ethers.getContractFactory("AIMeFactoryV4"); | ||
// const instance = await contractFactory.deploy(); | ||
// await instance.deployed(); | ||
|
||
console.log("AIMeFactory V4 contract deployed to", instance.address); | ||
} | ||
// console.log("AIMeFactory V4 contract deployed to", instance.address); | ||
// } | ||
|
||
async function deployAIMeFactoryBeta() { | ||
const contractFactory = await ethers.getContractFactory("AIMeFactoryBeta"); | ||
const instance = await contractFactory.deploy(); | ||
await instance.deployed(); | ||
// async function deployAIMeFactoryBeta() { | ||
// const contractFactory = await ethers.getContractFactory("AIMeFactoryBeta"); | ||
// const instance = await contractFactory.deploy(); | ||
// await instance.deployed(); | ||
|
||
console.log("AIMeFactory [Beta] contract deployed to", instance.address); | ||
} | ||
// console.log("AIMeFactory [Beta] contract deployed to", instance.address); | ||
// } | ||
|
||
async function deployAIMeFactory() { | ||
const contractFactory = await ethers.getContractFactory("AIMeFactory"); | ||
const instance = await contractFactory.deploy(); | ||
await instance.deployed(); | ||
|
||
console.log("AIMeFactory contract deployed to", instance.address); | ||
return instance.address; | ||
} | ||
|
||
async function deployAIMePowerLauncher() { | ||
const powerLauncherContractFactory = await ethers.getContractFactory( | ||
"AIMePowerLauncher" | ||
); | ||
const powerLauncher = await powerLauncherContractFactory.deploy(); | ||
const powerLauncher = await powerLauncherContractFactory.deploy( | ||
NonfungiblePositionManager, | ||
SwapRouterAddress | ||
); | ||
await powerLauncher.deployed(); | ||
|
||
console.log("powerLauncher contract deployed to", powerLauncher.address); | ||
return powerLauncher.address; | ||
} | ||
|
||
async function deployAIMePowerLauncherSepolia() { | ||
const powerLauncherContractFactory = await ethers.getContractFactory( | ||
"AIMePowerLauncherSepolia" | ||
); | ||
const powerLauncher = await powerLauncherContractFactory.deploy(); | ||
await powerLauncher.deployed(); | ||
// async function deployAIMePowerLauncherSepolia() { | ||
// const powerLauncherContractFactory = await ethers.getContractFactory( | ||
// "AIMePowerLauncherSepolia" | ||
// ); | ||
// const powerLauncher = await powerLauncherContractFactory.deploy(); | ||
// await powerLauncher.deployed(); | ||
|
||
console.log("powerLauncher sepolia contract deployed to", powerLauncher.address); | ||
} | ||
// console.log("powerLauncher sepolia contract deployed to", powerLauncher.address); | ||
// } | ||
|
||
async function deployAIMeCreator() { | ||
const aimeCreatorContractFactory = await ethers.getContractFactory( | ||
"AIMeCreator" | ||
async function deployAIMeManager() { | ||
const aimeManagerContractFactory = await ethers.getContractFactory( | ||
"AIMeManager" | ||
); | ||
const aimeCreator = await aimeCreatorContractFactory.deploy(); | ||
await aimeCreator.deployed(); | ||
const aimeManager = await aimeManagerContractFactory.deploy(); | ||
await aimeManager.deployed(); | ||
|
||
console.log("aimeCreator contract deployed to", aimeCreator.address); | ||
console.log("aimeManager contract deployed to", aimeManager.address); | ||
return aimeManager.address; | ||
} | ||
|
||
// We recommend this pattern to be able to use async/await everywhere | ||
// and properly handle errors. | ||
deployAIMeFactory().catch((error) => { | ||
deployAIMeContractsAll().catch((error) => { | ||
console.error(error); | ||
process.exitCode = 1; | ||
}); |
Oops, something went wrong.