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

test token発行用ファイル追加 #7

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
14 changes: 14 additions & 0 deletions compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: '3'
services:

app:
build:
context: .
dockerfile: ./local.Dockerfile
tty: true
user: ${UID}:${GID} # ホストと同じユーザーで実行
ports:
- 8545:8545 # contract RPC
volumes:
- .:/root/project

74 changes: 40 additions & 34 deletions hardhat.config.js
Original file line number Diff line number Diff line change
@@ -1,38 +1,44 @@
/**
* @type import('hardhat/config').HardhatUserConfig
*/

require('@nomiclabs/hardhat-truffle5')
import { HardhatUserConfig } from "hardhat/config";
import "@nomicfoundation/hardhat-viem";
import '@nomiclabs/hardhat-truffle5';
// require("@nomiclabs/hardhat-waffle")
require('@openzeppelin/hardhat-upgrades')
require('hardhat-contract-sizer')
require('solidity-coverage')
require('dotenv').config()

module.exports = {
solidity: {
compilers: [{
version: '0.8.11',
settings: {
optimizer: {
enabled: true,
runs: 3000,
import '@openzeppelin/hardhat-upgrades';
import 'hardhat-contract-sizer';
import 'solidity-coverage';
import 'dotenv';

const config: HardhatUserConfig = {
solidity: {
compilers: [
{
version: '0.8.11',
settings: {
optimizer: {
enabled: true,
runs: 3000,
},
},
},
},
},
{
version: '0.4.24',
}
]},

networks: {
hardhat: {
chainId: 1337,
allowUnlimitedContractSize: false,
{
version: '0.4.24',
}
]
},
rinkeby: {
url: process.env.INFRA_API_KEY,
accounts: [process.env.PRIVATE_KEY],

networks: {
hardhat: {
chainId: 1337,
allowUnlimitedContractSize: false,
},

anvil: {
url: "http://127.0.0.1:8545",
chainId: 31337,
accounts: {
mnemonic: "test test test test test test test test test test test junk",
},
},
},
},
}
};

export default config;
18 changes: 18 additions & 0 deletions local.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM node:20.11.1-bookworm-slim

RUN apt update && apt upgrade -y
RUN apt install -y \
curl \
wget \
git

# bashで日本語が表示されるようにする
RUN apt install -y locales
RUN localedef -f UTF-8 -i ja_JP ja_JP
RUN echo "export LANG=ja_JP.UTF-8" >> ~/.bashrc
# pnpm
RUN wget -qO- https://get.pnpm.io/install.sh | ENV="$HOME/.bashrc" SHELL="$(which bash)" bash -
# foundry
RUN curl -L https://foundry.paradigm.xyz | bash
ENV PATH=/root/.foundry/bin:$PATH
RUN foundryup
37 changes: 19 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,33 +1,34 @@
{
"name": "jpycv2",
"name": "project",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"@openzeppelin/contracts": "^4.4.1",
"@openzeppelin/contracts-upgradeable": "^4.4.1",
"@openzeppelin/hardhat-upgrades": "^1.12.0",
"@openzeppelin/test-helpers": "^0.5.15",
"dotenv": "^10.0.0",
"eth-sig-util": "^3.0.1",
"ethereumjs-wallet": "^1.0.2",
"hardhat": "^2.7.0",
"solidity-coverage": "^0.7.17"
"@openzeppelin/contracts": "^5.0.2",
"@openzeppelin/test-helpers": "^0.5.16",
"chai": "^5.1.1",
"dotenv": "^16.4.5",
"hardhat-contract-sizer": "^2.10.0",
"solidity-coverage": "^0.8.13",
"viem": "^2.21.6"
},
"devDependencies": {
"@nomiclabs/hardhat-ethers": "^2.0.2",
"@nomiclabs/hardhat-truffle5": "^2.0.3",
"@nomiclabs/hardhat-waffle": "^2.0.1",
"@nomicfoundation/hardhat-network-helpers": "^1.0.11",
"@nomicfoundation/hardhat-viem": "^2.0.4",
"@nomiclabs/hardhat-truffle5": "^2.0.7",
"@nomiclabs/hardhat-web3": "^2.0.0",
"chai": "^4.3.4",
"ethereum-waffle": "^3.4.0",
"ethers": "^5.5.1",
"hardhat-contract-sizer": "^2.3.0",
"web3": "^1.6.1"
"@openzeppelin/hardhat-upgrades": "^3.2.1",
"@types/mocha": "^10.0.8",
"@types/node": "^22.5.4",
"hardhat": "^2.22.10",
"ts-node": "^10.9.2",
"web3": "^1.10.4"
}
}

14 changes: 14 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"compilerOptions": {
"target": "es2020",
"module": "commonjs",
"strict": true,
"esModuleInterop": true,
"outDir": "dist",
"resolveJsonModule": true,
"types": ["node", "mocha", "@nomicfoundation/hardhat-viem", "@nomicfoundation/hardhat-network-helpers"],
},
"include": ["./scripts", "./test"],
"files": ["./hardhat.config.ts"]
}