Skip to content

Commit

Permalink
Loogie and Loogie Auction Deploy Scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
ceeriil committed Mar 22, 2024
1 parent d8955ec commit 9016601
Show file tree
Hide file tree
Showing 5 changed files with 78 additions and 79 deletions.
25 changes: 25 additions & 0 deletions packages/hardhat/deploy/00_deploy_loogie.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { HardhatRuntimeEnvironment } from "hardhat/types";
import { DeployFunction } from "hardhat-deploy/types";
//import { Contract } from "ethers";

const deployLoogieNft: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
const { deployer } = await hre.getNamedAccounts();
const { deploy } = hre.deployments;

await deploy("Loogie", {
from: deployer,
args: [deployer],
log: true,
autoMine: true,
});

// Get the deployed contract to interact with it after deploying.
// const loogieContract = await hre.ethers.getContract<Contract>("Loogie", deployer);
//console.log("👋 Initial greeting:", await loogieContract.greeting());
};

export default deployLoogieNft;

// Tags are useful if you have multiple deploy files and only want to run one of them.
// e.g. yarn deploy --tags YourContract
deployLoogieNft.tags = ["LoogieNft"];
44 changes: 0 additions & 44 deletions packages/hardhat/deploy/00_deploy_your_contract.ts

This file was deleted.

35 changes: 0 additions & 35 deletions packages/hardhat/deploy/01_deploy_example_external_contract.ts

This file was deleted.

23 changes: 23 additions & 0 deletions packages/hardhat/deploy/01_deploy_mock_weth.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { HardhatRuntimeEnvironment } from "hardhat/types";
import { DeployFunction } from "hardhat-deploy/types";
//import { Contract } from "ethers";

const deployMockWeth: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
const { deployer } = await hre.getNamedAccounts();
const { deploy } = hre.deployments;

if (hre.network.config.chainId == 31337 || hre.network.name === "localhost") {
await deploy("WETH", {
from: deployer,
args: [],
log: true,
autoMine: true,
});
}
};

export default deployMockWeth;

// Tags are useful if you have multiple deploy files and only want to run one of them.
// e.g. yarn deploy --tags YourContract
deployMockWeth.tags = ["MockWeth"];
30 changes: 30 additions & 0 deletions packages/hardhat/deploy/02_deploy_loogie_auction.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { HardhatRuntimeEnvironment } from "hardhat/types";
import { DeployFunction } from "hardhat-deploy/types";
import { Contract } from "ethers";

const deployLoogieActionContract: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
const { deployer } = await hre.getNamedAccounts();
const { deploy } = hre.deployments;

const loogieContract = await hre.ethers.getContract<Contract>("Loogie", deployer);
const loogieNftAddress = await loogieContract.getAddress();

let weth = process.env.WETH;
if (hre.network.config.chainId == 31337 || hre.network.name === "localhost") {
const wethContract = await hre.ethers.getContract<Contract>("WETH", deployer);
weth = await wethContract.getAddress();
}

const [duration, hour, minBidIncrementPercentage] = [86400, 3600, 5];

await deploy("LoogieAuction", {
from: deployer,
args: [duration, hour, minBidIncrementPercentage, weth, loogieNftAddress],
log: true,
autoMine: true,
});
};

export default deployLoogieActionContract;

deployLoogieActionContract.tags = ["LoogieActionContract"];

0 comments on commit 9016601

Please sign in to comment.