Skip to content

Commit

Permalink
cmt944
Browse files Browse the repository at this point in the history
  • Loading branch information
xthet committed Jun 5, 2023
1 parent ce2f18c commit 99b58af
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 1 deletion.
2 changes: 1 addition & 1 deletion contracts/CrowdFunder.sol
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ contract CrowdFunder {

constructor (address _cmpFactory, address _rwdFactory){
i_rewardFactory = _rwdFactory;
i_cmpFactory = _cmpFactory;
i_cmpFactory = _cmpFactory;
}

function addUser(
Expand Down
43 changes: 43 additions & 0 deletions deploy/04-deploy-campaign.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import { network, ethers } from "hardhat"
import { DeployFunction } from "hardhat-deploy/dist/types"
import { HardhatRuntimeEnvironment } from "hardhat/types"
import { developmentChains } from "../helper-hardhat-config"
import verify from "../utils/verify"
import { BigNumber } from "ethers"

const deployCampaign: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
const { deployments, getNamedAccounts } = hre
const { deploy, log } = deployments
const { deployer } = await getNamedAccounts()
const chainId = network.config.chainId
const waitBlockConfirmations = chainId?.toString() == "31337" ? 1 : 5

log("==========================")
const args:any[] = [
"0x5FbDB2315678afecb367f032d93F642f64180aa3",
deployer,
"0x5FbDB2315678afecb367f032d93F642f64180ba3",
"Piratopia: Raiders of Pirate Bay",
"A P2E masterpiece on the AVAX chain",
"P2E",
"arcade games/adventure games/web3 gaming",
ethers.utils.parseEther("6.75"),
BigNumber.from("1296000"),
"ipfs://QmV9inF2YC5MFUHWwWaCBEVJzj9aGSKmpay7mPSJDjBC4w"
]
const campaign = await deploy("Campaign", {
from: deployer,
args: args,
log: true,
waitConfirmations: waitBlockConfirmations
})

if(!developmentChains.includes(network.name) && process.env.ETHERSCAN_API_KEY) {
log("Verifying...")
await verify(campaign.address, args)
}
log("==========================")
}

export default deployCampaign
deployCampaign.tags = ["all", "campaign"]

0 comments on commit 99b58af

Please sign in to comment.