Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(protocol): remove hardhat dependency #15442

Merged
merged 7 commits into from
Jan 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/protocol.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:

- name: protocol - Unit Tests
working-directory: ./packages/protocol
run: pnpm clean && pnpm compile:hardhat && pnpm test
run: pnpm clean && pnpm test

- name: protocol - Generate Genesis
working-directory: ./packages/protocol
Expand Down
1 change: 0 additions & 1 deletion packages/protocol/.npmignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
hardhat.config.ts
scripts
test
16 changes: 8 additions & 8 deletions packages/protocol/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

This package contains rollup contracts on both L1 and L2, along with other assisting code. Taiko L2's chain ID is [167](https://github.com/ethereum-lists/chains/pull/1611).


## Compile

To compile smart contracts, run:

```sh
pnpm compile
```
Expand All @@ -14,15 +14,15 @@ If you run into `Error: Unknown version provided`, you should upgrade your found

## Deploy

Deploy TaikoL1 on hardhat network:
Deploy TaikoL1 on foundry network:

```sh
pnpm deploy:hardhat
pnpm deploy:foundry
```

## Test

Run test cases on hardhat network:
Run test cases on foundry network:

```sh
pnpm test
Expand All @@ -47,15 +47,15 @@ module.exports = {
// Account address and pre-mint ETH amount as key-value pairs.
seedAccounts: [
{ "0xDf08F82De32B8d460adbE8D72043E3a7e25A3B39": 1024 },
{ "0x79fcdef22feed20eddacbb2587640e45491b757f": 1024 }
{ "0x79fcdef22feed20eddacbb2587640e45491b757f": 1024 },
],
// L2 EIP-1559 baseFee calculation related fields.
param1559: {
"gasExcess": 1
gasExcess: 1,
},
// Option to pre-deploy an ERC-20 token.
predeployERC20: true
}
predeployERC20: true,
};
```

Next, run the generation script:
Expand Down
159 changes: 0 additions & 159 deletions packages/protocol/hardhat.config.ts

This file was deleted.

22 changes: 2 additions & 20 deletions packages/protocol/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,17 @@
"scripts": {
"buildMerkle": "ts-node ./utils/airdrop/buildMerkleTree.ts ./utils/airdrop/airdrop_db/example_claimList.json",
"clean": "rm -rf abis cache* && forge clean",
"compile": "forge build",
"compile:hardhat": "pnpm hardhat compile",
"compile": "forge build --build-info --extra-output storage-layout",
"deploy:foundry": "./script/download_solc.sh && ./script/test_deploy_on_l1.sh",
"eslint": "pnpm exec eslint --ignore-path .eslintignore --ext .js,.ts .",
"eslint:fix": "pnpm exec eslint --ignore-path .eslintignore --ext .js,.ts . --fix",
"export:abi": "pnpm hardhat clear-abi && pnpm hardhat export-abi",
"fmt:sol": "forge fmt",
"generate:genesis": "ts-node ./utils/generate_genesis/main.ts",
"lint:sol": "forge fmt && pnpm solhint 'contracts/**/*.sol' --fix",
"sizer": "pnpm hardhat size-contracts",
"snapshot": "forge snapshot --match-path 'test/**/*.t.sol'",
"test": "forge test -vvv --match-path test/*.t.sol",
"test:coverage": "mkdir -p coverage && forge coverage --report lcov && lcov --remove ./lcov.info -o ./coverage/lcov.info 'test/' 'script/' 'contracts/thirdparty/' && genhtml coverage/lcov.info --branch-coverage --output-dir coverage --ignore-errors category && open coverage/index.html",
"test:genesis": "pnpm compile && pnpm compile:hardhat && FOUNDRY_PROFILE=genesis ./genesis/generate_genesis.test.sh",
"test:genesis": "pnpm compile && FOUNDRY_PROFILE=genesis ./genesis/generate_genesis.test.sh",
"export:simconf": "forge test --match-test 'test_simulation' -vv > simulation/out/simconf_$(date +%s).txt"
},
"keywords": [
Expand All @@ -35,16 +32,7 @@
"author": "Taiko Labs",
"license": "MIT",
"devDependencies": {
"@defi-wonderland/smock": "^2.3.4",
"@foundry-rs/hardhat-forge": "^0.1.17",
"@nomicfoundation/hardhat-foundry": "^1.1.1",
"@nomicfoundation/hardhat-network-helpers": "^1.0.9",
"@nomiclabs/hardhat-ethers": "^2.2.3",
"@nomiclabs/hardhat-etherscan": "^3.1.7",
"@nomiclabs/hardhat-waffle": "^2.0.6",
"@openzeppelin/hardhat-upgrades": "^2.3.3",
"@typechain/ethers-v5": "^11.1.2",
"@typechain/hardhat": "^9.1.0",
"@types/chai": "^4.3.8",
"@types/glob": "^8.1.0",
"@types/mocha": "^10.0.2",
Expand All @@ -63,12 +51,6 @@
"eslint-plugin-promise": "^6.1.1",
"ethers": "^5.7.2",
"glob": "^10.3.10",
"hardhat": "^2.18.1",
"hardhat-abi-exporter": "^2.10.1",
"hardhat-contract-sizer": "^2.10.0",
"hardhat-docgen": "^1.3.0",
"hardhat-gas-reporter": "^1.0.9",
"hardhat-preprocessor": "^0.1.5",
"merkle-patricia-tree": "^4.2.4",
"prettier": "^3.0.3",
"rlp": "^3.0.0",
Expand Down
3 changes: 0 additions & 3 deletions packages/protocol/remappings.txt

This file was deleted.

12 changes: 0 additions & 12 deletions packages/protocol/tsconfig.json

This file was deleted.

5 changes: 1 addition & 4 deletions packages/protocol/utils/generate_genesis/erc20.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@ import { ethers } from "ethers";
import { Result } from "./interface";
const path = require("path");
const ARTIFACTS_PATH = path.join(__dirname, "../../out");
const {
computeStorageSlots,
getStorageLayout,
} = require("@defi-wonderland/smock/dist/src/utils");
const { computeStorageSlots, getStorageLayout } = require("./utils");

export const TOKEN_NAME = "RegularERC20";
export const TOKEN_SYMBOL = "RGL";
Expand Down
5 changes: 1 addition & 4 deletions packages/protocol/utils/generate_genesis/taikoL2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@ const path = require("path");
const { ethers } = require("ethers");
// eslint-disable-next-line node/no-extraneous-require
const linker = require("solc/linker");
const {
computeStorageSlots,
getStorageLayout,
} = require("@defi-wonderland/smock/dist/src/utils");
const { computeStorageSlots, getStorageLayout } = require("./utils");
const ARTIFACTS_PATH = path.join(__dirname, "../../out");

const IMPLEMENTATION_SLOT =
Expand Down
Loading