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 6 commits into
base: main
Choose a base branch
from
Open
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
18 changes: 16 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,2 +1,16 @@
INFRA_API_KEY=https://rinkeby.infura.io/v3/
PRIVATE_KEY=0xabc123
UID=1001
GID=1001
PRIVATE_KEY=
MINTER_ADDRESS=0x70997970C51812dc3A010C7d01b50e0d17dc79C8
MINTER_ADMIN_ADDRESS=0x70997970C51812dc3A010C7d01b50e0d17dc79C8
PAUSER_ADDRESS=0x70997970C51812dc3A010C7d01b50e0d17dc79C8
BLOCKLISTER_ADDRESS=0x70997970C51812dc3A010C7d01b50e0d17dc79C8
RESCUER_ADDRESS=0x70997970C51812dc3A010C7d01b50e0d17dc79C8
OWNER_ADDRESS=0x70997970C51812dc3A010C7d01b50e0d17dc79C8
TO_ADDRESS=0x70997970C51812dc3A010C7d01b50e0d17dc79C8
MINT_AMOUNT=1000000
TOKEN_NAME=TESTJPYC
TOKEN_SYMBOL=TJPYC
TOKEN_CURRENCY=TJPYC
TOKEN_DECIMALS=18

8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,10 @@
coverage.json
/coverage
/gasEstimate
/.VSCoderCounter
/.VSCoderCounter
build/
node_modules/
node_modules
.pnpm-store/
.vscode/
pnpm-lock.yaml
22 changes: 22 additions & 0 deletions compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
services:
app:
build:
context: .
dockerfile: ./local.Dockerfile
args:
UID: ${UID:-1001}
GID: ${GID:-1001}
tty: true
user: "${UID:-1001}:${GID:-1001}"
ports:
- 8545:8545 # contract RPC
volumes:
- .:/workspace
- vscode-server:/home/appuser/.vscode-server
environment:
- HOME=/home/appuser
- SHELL=/bin/bash
working_dir: /workspace

volumes:
vscode-server:
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;
51 changes: 51 additions & 0 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@

import { HardhatUserConfig } from "hardhat/config";
import "@nomicfoundation/hardhat-viem";
import '@nomiclabs/hardhat-truffle5';
// require("@nomiclabs/hardhat-waffle")
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,
},

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

mainnet: {
url: `https://eth-mainnet.g.alchemy.com/v2/Bee-BKs-NFFdtrZUEcjMoPQwqI08J0NS`,
chainId: 1,
accounts: process.env.PRIVATE_KEY !== undefined ? [process.env.PRIVATE_KEY] : [],
},
},
};

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

ARG UID=1001
ARG GID=1001

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

# bashで日本語が表示されるようにする
RUN apt install -y locales
RUN localedef -f UTF-8 -i ja_JP ja_JP
RUN echo "export LANG=ja_JP.UTF-8" >> /etc/bash.bashrc

# 非rootユーザーを作成
RUN groupadd -g $GID appuser || groupmod -g $GID $(getent group $GID | cut -d: -f1)
RUN useradd -m -u $UID -g $GID -s /bin/bash appuser || usermod -u $UID -g $GID appuser

USER appuser
WORKDIR /workspace
# 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=/home/appuser/.foundry/bin:$PATH
RUN foundryup

# 必要なディレクトリを作成し、権限を設定
RUN mkdir -p /home/appuser/.vscode-server && \
chown -R $UID:$GID /home/appuser && \
chmod -R 755 /home/appuser

RUN cat /etc/passwd
38 changes: 20 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,30 @@
"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",
"dotenv": "^16.4.5",
"ethers": "^6.1.0",
"hardhat-contract-sizer": "^2.10.0",
"solidity-coverage": "^0.8.13"
},
"devDependencies": {
"@nomiclabs/hardhat-ethers": "^2.0.2",
"@nomiclabs/hardhat-truffle5": "^2.0.3",
"@nomiclabs/hardhat-waffle": "^2.0.1",
"@nomicfoundation/hardhat-chai-matchers": "^2.0.7",
"@nomicfoundation/hardhat-ethers": "^3.0.0",
"@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.3.0",
"@types/mocha": "^10.0.8",
"@types/node": "^22.5.4",
"chai": "^4.5.0",
"hardhat": "^2.22.10",
"ts-node": "^10.9.2",
"viem": "^2.21.8",
"web3": "^1.10.4"
}
}
}
Loading