Skip to content

Commit

Permalink
checking through
Browse files Browse the repository at this point in the history
  • Loading branch information
xthet committed Sep 4, 2023
1 parent 8f0f2ce commit fa7f0ee
Show file tree
Hide file tree
Showing 10 changed files with 642 additions and 574 deletions.
26 changes: 0 additions & 26 deletions .eslintrc

This file was deleted.

17 changes: 17 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended"
],
"rules": {
"react-hooks/exhaustive-deps": "off",
"space-infix-ops": ["warn", { "int32Hint": false }],
"@typescript-eslint/no-explicit-any": ["off"],
"@next/next/no-img-element": ["off"],
"@typescript-eslint/no-non-null-assertion": ["off"]
}
}
5 changes: 0 additions & 5 deletions .prettierrc.yml

This file was deleted.

107 changes: 56 additions & 51 deletions deploy/00-deploy-crowdFunder.ts
Original file line number Diff line number Diff line change
@@ -1,64 +1,69 @@
import { network, ethers } from "hardhat"
import { network } 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"

const deployCrowdFunder: 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
const deployCrowdFunder: 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 refunderLib = await deploy("RefunderLib", {
from: deployer,
args: [],
log: true,
waitConfirmations: waitBlockConfirmations
})
log("==========================")
const refunderLib = await deploy("RefunderLib", {
from: deployer,
args: [],
log: true,
waitConfirmations: waitBlockConfirmations,
})

const campaignFactory = await deploy("CampaignFactory", {
from: deployer,
args: [],
log: true,
libraries: {
RefunderLib: refunderLib.address
},
waitConfirmations: waitBlockConfirmations
})
const campaignFactory = await deploy("CampaignFactory", {
from: deployer,
args: [],
log: true,
libraries: {
RefunderLib: refunderLib.address,
},
waitConfirmations: waitBlockConfirmations,
})

const rewardFactory = await deploy("RewardFactory", {
from: deployer,
args: [],
log: true,
libraries: {
RefunderLib: refunderLib.address
},
waitConfirmations: waitBlockConfirmations
})
const rewardFactory = await deploy("RewardFactory", {
from: deployer,
args: [],
log: true,
libraries: {
RefunderLib: refunderLib.address,
},
waitConfirmations: waitBlockConfirmations,
})

const args:any[] = [campaignFactory.address, rewardFactory.address]
const crowdFunder = await deploy("CrowdFunder", {
from: deployer,
args: args,
log: true,
libraries: {
RefunderLib: refunderLib.address
},
waitConfirmations: waitBlockConfirmations
})
const args: any[] = [campaignFactory.address, rewardFactory.address]
const crowdFunder = await deploy("CrowdFunder", {
from: deployer,
args: args,
log: true,
libraries: {
RefunderLib: refunderLib.address,
},
waitConfirmations: waitBlockConfirmations,
})

if(!developmentChains.includes(network.name) && process.env.ETHERSCAN_API_KEY) {
log("Verifying...")
await verify(refunderLib.address, [])
await verify(campaignFactory.address, [])
await verify(rewardFactory.address, [])
await verify(crowdFunder.address, args)
}
log("==========================")
if (
!developmentChains.includes(network.name) &&
process.env.ETHERSCAN_API_KEY
) {
log("Verifying...")
await verify(refunderLib.address, [])
await verify(campaignFactory.address, [])
await verify(rewardFactory.address, [])
await verify(crowdFunder.address, args)
}
log("==========================")
}

export default deployCrowdFunder
deployCrowdFunder.tags = ["all", "crowdfunder"]
deployCrowdFunder.tags = ["all", "crowdfunder"]
32 changes: 16 additions & 16 deletions deployments/sepolia/CampaignFactory.json

Large diffs are not rendered by default.

34 changes: 17 additions & 17 deletions deployments/sepolia/CrowdFunder.json

Large diffs are not rendered by default.

30 changes: 15 additions & 15 deletions deployments/sepolia/RefunderLib.json

Large diffs are not rendered by default.

Large diffs are not rendered by default.

172 changes: 80 additions & 92 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,98 +10,86 @@ import "solidity-coverage"
import "hardhat-contract-sizer"
import { HardhatUserConfig } from "hardhat/config"


const config: HardhatUserConfig =
{
solidity: {
compilers: [
{
version: "0.8.11",
settings:{
optimizer: {
enabled: true,
runs: 200,
details: {
yul: false
}
}
}
},
{ version: "0.8.8" }, { version: "0.6.6" }, { version: "0.4.19" }, { version: "0.6.12" }, { version: "0.4.11" }
],
// settings:{
// "optimizer": {
// "enabled": true,
// "runs": 200,
// details: {
// yul: true,
// yulDetails: {
// stackAllocation: true,
// optimizerSteps: "dhfoDgvulfnTUtnIf"
// }
// }
// },
// "viaIR": true,
// },
},
contractSizer: {
alphaSort: true,
disambiguatePaths: false,
runOnCompile: false,
strict: true,
// only: [":ERC20$"],
unit: "kB"
},
defaultNetwork: "hardhat",
networks: {
hardhat: {
chainId: 31337,
allowUnlimitedContractSize: true
},
localhost: {
chainId: 31337,
allowUnlimitedContractSize: true
},
goerli:{
chainId: 5,
url: process.env.GOERLI_RPC_URL,
accounts: [process.env.FORMIC_PRIVATE_KEY!],
timeout: 1000000
},
fuji:{
chainId: 43113,
url: process.env.FUJI_RPC_URL,
accounts: [process.env.FORMIC_PRIVATE_KEY!],
timeout: 1000000
},
sepolia:{
chainId: 11155111,
url: process.env.SEPOLIA_RPC_URL,
accounts: [process.env.FORMIC_PRIVATE_KEY!],
timeout: 1000000
}
},
namedAccounts: {
deployer: {
default: 0,
},
donator: {
default: 1,
}
},
gasReporter: {
enabled: true,
outputFile: "gas-report.txt",
noColors: true,
currency: "USD",
coinmarketcap: process.env.MARKETCAP_API_KEY,
},
etherscan: {
apiKey: process.env.ETHERSCAN_API_KEY,
},
mocha: {
timeout: 100000000,
}
const config: HardhatUserConfig = {
solidity: {
compilers: [
{
version: "0.8.11",
settings: {
optimizer: {
enabled: true,
runs: 200,
details: {
yul: false,
},
},
},
},
{ version: "0.8.8" },
{ version: "0.6.6" },
{ version: "0.4.19" },
{ version: "0.6.12" },
{ version: "0.4.11" },
],
},
contractSizer: {
alphaSort: true,
disambiguatePaths: false,
runOnCompile: false,
strict: true,
// only: [":ERC20$"],
unit: "kB",
},
defaultNetwork: "hardhat",
networks: {
hardhat: {
chainId: 31337,
allowUnlimitedContractSize: true,
},
localhost: {
chainId: 31337,
allowUnlimitedContractSize: true,
},
goerli: {
chainId: 5,
url: process.env.GOERLI_RPC_URL,
accounts: [process.env.CHARLATAN_PRIVATE_KEY!],
timeout: 1000000,
},
fuji: {
chainId: 43113,
url: process.env.FUJI_RPC_URL,
accounts: [process.env.CHARLATAN_PRIVATE_KEY!],
timeout: 1000000,
},
sepolia: {
chainId: 11155111,
url: process.env.SEPOLIA_RPC_URL,
accounts: [process.env.CHARLATAN_PRIVATE_KEY!],
timeout: 1000000,
},
},
namedAccounts: {
deployer: {
default: 0,
},
donator: {
default: 1,
},
},
gasReporter: {
enabled: true,
outputFile: "gas-report.txt",
noColors: true,
currency: "USD",
coinmarketcap: process.env.MARKETCAP_API_KEY,
},
etherscan: {
apiKey: process.env.ETHERSCAN_API_KEY,
},
mocha: {
timeout: 100000000,
},
}

export default config
Loading

0 comments on commit fa7f0ee

Please sign in to comment.