Skip to content

Commit

Permalink
chore: Fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
alainncls committed Mar 13, 2024
1 parent 1880ff2 commit bf27469
Show file tree
Hide file tree
Showing 17 changed files with 384 additions and 139 deletions.
13 changes: 0 additions & 13 deletions governance/.prettierrc.yml

This file was deleted.

6 changes: 3 additions & 3 deletions governance/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ npx hardhat help
npx hardhat test
REPORT_GAS=true npx hardhat test
npx hardhat node
npx hardhat run scripts/deploy.js
npx hardhat run scripts/deploy.ts

npx hardhat run scripts/deployProxy.js --network arbitrum_one
npx hardhat run scripts/deployProxy.ts --network arbitrum_one
npx hardhat verify --network arbitrum_one [PROXY_ADDRESS]
npx hardhat run scripts/upgrade.js --network arbitrum_one
npx hardhat run scripts/upgrade.ts --network arbitrum_one
```
36 changes: 0 additions & 36 deletions governance/hardhat.config.js

This file was deleted.

47 changes: 47 additions & 0 deletions governance/hardhat.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import { HardhatUserConfig } from "hardhat/config";
import "@nomicfoundation/hardhat-toolbox";
import "@nomicfoundation/hardhat-foundry";
import "@openzeppelin/hardhat-upgrades";
import dotenv from "dotenv";

dotenv.config({ path: "./.env" });

const { PRIVATE_KEY, LINEASCAN_API_KEY, ARBITRUM_MAINNET_PRIVATE_KEY, ARBITRUM_API_KEY } = process.env;

const config: HardhatUserConfig = {
solidity: {
compilers: [
{
version: "0.8.20",
},
],
},
networks: {
linea_testnet: {
url: `https://rpc.goerli.linea.build/`,
accounts: [PRIVATE_KEY ?? ""],
},
arbitrum_one: {
url: "https://arb1.arbitrum.io/rpc",
accounts: [ARBITRUM_MAINNET_PRIVATE_KEY ?? ""],
},
},
etherscan: {
apiKey: {
linea_testnet: LINEASCAN_API_KEY ?? "",
arbitrumOne: ARBITRUM_API_KEY ?? "",
},
customChains: [
{
network: "linea_testnet",
chainId: 59140,
urls: {
apiURL: "https://api-testnet.lineascan.build/api",
browserURL: "https://goerli.lineascan.build/address",
},
},
],
},
};

export default config;
7 changes: 7 additions & 0 deletions governance/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/** @type {import("jest").Config} */
const config = {
preset: "ts-jest",
testEnvironment: "node",
};

module.exports = config;
29 changes: 18 additions & 11 deletions governance/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,32 @@
"name": "votingnft",
"version": "1.0.0",
"description": "",
"license": "ISC",
"author": "",
"main": "index.js",
"scripts": {
"lint": "eslint .",
"prepare": "husky install",
"prettier:check": "prettier --check \"**/*.{json,yml,md,sol,js}\"",
"prettier:write": "prettier --write \"**/*.{json,yml,md,sol,js}\""
},
"author": "",
"license": "ISC",
"devDependencies": {
"@nomicfoundation/hardhat-toolbox": "^4.0.0",
"@openzeppelin/hardhat-upgrades": "^3.0.0",
"dotenv": "^16.3.1",
"hardhat": "^2.19.2",
"prettier": "^3.1.1",
"prettier-plugin-solidity": "^1.2.0"
},
"dependencies": {
"@openzeppelin/contracts": "^5.0.1",
"@openzeppelin/contracts-upgradeable": "^5.0.2"
"@openzeppelin/contracts-upgradeable": "^5.0.2",
"@types/node": "^20.9.0"
},
"devDependencies": {
"@nomicfoundation/hardhat-ethers": "^3.0.4",
"@nomicfoundation/hardhat-toolbox": "^3.0.0",
"@openzeppelin/hardhat-upgrades": "^2.3.3",
"@types/jest": "^29.5.8",
"@types/node": "^20.9.0",
"babel-jest": "^29.7.0",
"dotenv": "^16.3.1",
"ethers": "^6.8.1",
"hardhat": "^2.19.0",
"jest": "^29.7.0",
"ts-jest": "^29.1.1",
"ts-node": "^10.9.1"
}
}
25 changes: 0 additions & 25 deletions governance/scripts/deploy.js

This file was deleted.

21 changes: 21 additions & 0 deletions governance/scripts/deploy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { ethers } from "hardhat";
import dotenv from "dotenv";

dotenv.config({ path: "../.env" });

const { CONTRACT_OWNER } = process.env;

async function main() {
const veraxVotingNFT = await ethers.deployContract("VeraxVotingNFT", [CONTRACT_OWNER]);

await veraxVotingNFT.waitForDeployment();

console.log(`Deployed contract at ${veraxVotingNFT.target}`);
}

// We recommend this pattern to be able to use async/await everywhere
// and properly handle errors.
main().catch((error) => {
console.error(error);
process.exitCode = 1;
});
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
const { ethers, upgrades } = require("hardhat");
require("dotenv").config();
import { ethers, upgrades } from "hardhat";
import dotenv from "dotenv";

dotenv.config({ path: "../.env" });

const { CONTRACT_OWNER } = process.env;

Expand All @@ -10,4 +12,9 @@ async function main() {
console.log("Voting NFT deployed to:", await proxy.getAddress());
}

main();
// We recommend this pattern to be able to use async/await everywhere
// and properly handle errors.
main().catch((error) => {
console.error(error);
process.exitCode = 1;
});
17 changes: 0 additions & 17 deletions governance/scripts/upgrade.js

This file was deleted.

19 changes: 19 additions & 0 deletions governance/scripts/upgrade.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { ethers, upgrades } from "hardhat";
import dotenv from "dotenv";

dotenv.config({ path: "../.env" });

const { PROXY_ADDRESS } = process.env;

async function main() {
const VeraxVotingNFT = await ethers.getContractFactory("VeraxVotingNFT");
await upgrades.upgradeProxy(PROXY_ADDRESS ?? "", VeraxVotingNFT);
console.log("upgrade completed");
}

// We recommend this pattern to be able to use async/await everywhere
// and properly handle errors.
main().catch((error) => {
console.error(error);
process.exitCode = 1;
});
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
const { expect } = require("chai");
const { ethers } = require("hardhat");
import { expect } from "chai";
import { ethers, upgrades } from "hardhat";
import { HardhatEthersSigner } from "@nomicfoundation/hardhat-ethers/signers";
import type { Contract } from "ethers";

describe("VeraxVotingNFT", function () {
let owner;
let addr1;
let addr2;
let addrs;
let addr1: HardhatEthersSigner;
let addr2: HardhatEthersSigner;

let veraxVotingNFT;
let veraxVotingNFT: Contract;

beforeEach(async function () {
[owner, addr1, addr2, ...addrs] = await ethers.getSigners();
[owner, addr1, addr2] = await ethers.getSigners();
const VeraxVotingNFT = await ethers.getContractFactory("VeraxVotingNFT");

veraxVotingNFT = await upgrades.deployProxy(VeraxVotingNFT, [owner.address]);
Expand Down
4 changes: 4 additions & 0 deletions governance/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"extends": "../tsconfig.json",
"include": ["**/*.ts"]
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
"scripts": {
"lint": "eslint .",
"prepare": "husky install",
"prettier:check": "prettier --check \"**/*.{json,md,svg,yml,sol,js,ts,graphql}\"",
"prettier:write": "prettier --write \"**/*.{json,md,svg,yml,sol,js,ts,graphql}\""
"prettier:check": "prettier --check \"**/*.{json,md,svg,yml,sol,js,jsx,ts,tsx,graphql}\"",
"prettier:write": "prettier --write \"**/*.{json,md,svg,yml,sol,js,jsx,ts,jsx,graphql}\""
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^6.10.0",
Expand Down
Loading

0 comments on commit bf27469

Please sign in to comment.