generated from scaffold-eth/scaffold-eth-2
-
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.
Loogie and Loogie Auction Deploy Scripts
- Loading branch information
Showing
5 changed files
with
78 additions
and
79 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
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"]; |
This file was deleted.
Oops, something went wrong.
35 changes: 0 additions & 35 deletions
35
packages/hardhat/deploy/01_deploy_example_external_contract.ts
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -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"]; |
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 |
---|---|---|
@@ -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"]; |