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

use latest tags #26

Closed
wants to merge 19 commits into from
Closed
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
25 changes: 23 additions & 2 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '18.15.0'
node-version: 20.9.0

- name: Restore cache
id: restore-cache
Expand All @@ -35,5 +35,26 @@ jobs:
- name: compile contracts
run: npx hardhat compile

- name: deployment and testing
- name: Run tests
run: npx hardhat test
env:
ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY }}
CMC_API_KEY: ${{ secrets.CMC_API_KEY }}

- name: Check if gasReport.md exists
id: check_gas_report
run: |
if [ -f gasReport.md ]; then
echo "exists=true" >> $GITHUB_ENV
else
echo "exists=false" >> $GITHUB_ENV
fi

- name: Comment on pull request
if: github.event_name == 'pull_request' && env.exists == 'true'
uses: thollander/actions-comment-pull-request@v2
with:
filePath: gasReport.md
comment_tag: 'gas_report'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ typechain-types
coverage
coverage.json
contracts
.env
.env
gasReport.md
33 changes: 19 additions & 14 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
import "@nomicfoundation/hardhat-toolbox"
import { HardhatUserConfig } from "hardhat/config";
import 'hardhat-gas-reporter';
import '@typechain/hardhat';
import 'solidity-coverage';
import '@nomicfoundation/hardhat-network-helpers';
import '@nomicfoundation/hardhat-chai-matchers';
import "@truffle/dashboard-hardhat-plugin"
import "hardhat-gas-reporter"
import { HardhatUserConfig } from "hardhat/config"
import "solidity-coverage"

const config: HardhatUserConfig = {
defaultNetwork: "hardhat",
solidity: {
version: "0.8.19",
version: "0.8.24",
settings: {
evmVersion: "byzantium",
evmVersion: "istanbul",
optimizer: {
enabled: true,
runs: 200,
Expand All @@ -19,6 +21,7 @@ const config: HardhatUserConfig = {
networks: {
hardhat: {
blockGasLimit: 130_000_000,
allowUnlimitedContractSize: true,
},
ropsten: {
url: "https://ropsten.infura.io/v3/your-infura-project-id",
Expand Down Expand Up @@ -64,16 +67,18 @@ const config: HardhatUserConfig = {
},
gasReporter: {
enabled: true,
showTimeSpent: true,
showMethodSig: true,
currency: "USD",
token: "BNB",
gasPriceApi:
"https://api.bscscan.com/api?module=proxy&action=eth_gasPrice&apikey=" + process.env.BSCSCAN_API_KEY,
coinmarketcap: process.env.CMC_API_KEY || "",
currency: 'USD',
token: 'ETH',
gasPriceApi: 'https://api.etherscan.io/api?module=proxy&action=eth_gasPrice&apikey=' + process.env.ETHERSCAN_API_KEY,
coinmarketcap: process.env.CMC_API_KEY || '',
noColors: true,
outputFile: "gas-report.txt",
},
reportFormat: "markdown",
outputFile: "gasReport.md",
forceTerminalOutput: true,
L1: "ethereum",
forceTerminalOutputFormat: "terminal"
},
}

export default config
Loading
Loading