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 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
Empty file.
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

24 changes: 23 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,31 @@
/node_modules
node_modules/
node_modules

/build
build/
/artifacts
# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

/cache
.cache/
*.cache
.yarn/cache
cache/

.env
.env*.local

coverage.json
/coverage
/gasEstimate
/.VSCoderCounter
/.VSCoderCounter


.pnpm-store/
.vscode/
pnpm-lock.yaml

3 changes: 3 additions & 0 deletions .ssh/known_hosts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
github.com ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOMqqnkVzrm0SdG6UOoqKLsabgH5C9okWi0dh2l9GKJl
github.com ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBEmKSENjQEezOmxkZMy7opKgwFB9nkt5YRrYMjNuG5N87uRgg6CLrbo5wAdT/y6v0mKV0U2w0WZ2YB/++Tpockg=
github.com ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCj7ndNxQowgcQnjshcLrqPEiiphnt+VTTvDP6mHBL9j1aNUkY4Ue1gvwnGLVlOhGeYrnZaMgRK6+PKCUXaDbC7qtbW8gIkhL7aGCsOr/C56SJMy/BCZfxd1nWzAOxSDPgVsmerOBYfNqltV9/hWCqBywINIR+5dIg6JTJ72pcEpEjcYgXkE2YEFXV1JHnsKgbLWNlhScqb2UmyRkQyytRLtL+38TGxkxCflmO+5Z8CSSNY7GidjMIZ7Q4zMjA2n1nGrlTDkzwDCsw+wqFPGQA179cnfGWOWRVruj16z6XyvxvjJwbz0wQZ75XK5tKSb7FNyeIEs4TT4jk+S4dhPeAUC5y+bDYirYgM4GC7uEnztnZyaVWQ7B381AK4Qdrwt51ZqExKbQpTUNn+EjqoTwvqNj4kqx5QUCI0ThS/YkOxJCXmPUWZbhjpCg56i+2aB6CmK2JGhn57K5mj0MNdBXA4/WnwH6XoPWJzK5Nyu2zB3nAZp+S5hpQs+p1vN1/wsjk=
Empty file.
24 changes: 24 additions & 0 deletions compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
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:cached
- vscode-server:/home/appuser/.vscode-server
- ~/.gitconfig:/home/appuser/.gitconfig:ro
environment:
- HOME=/workspace
- SHELL=/bin/bash
working_dir: /workspace
command: ["/bin/bash"]

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;
49 changes: 49 additions & 0 deletions local.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
FROM node:20.11.1-bookworm-slim

ARG UID=1001
ARG GID=1001

RUN apt-get update && apt-get upgrade -y && \
apt-get install -y \
curl \
wget \
git \
sudo \
locales && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

# 日本語ロケールの設定
RUN localedef -f UTF-8 -i ja_JP ja_JP.UTF-8
ENV LANG=ja_JP.UTF-8 \
LANGUAGE=ja_JP:ja \
LC_ALL=ja_JP.UTF-8

# 非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

# sudoの設定
RUN echo "appuser ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/appuser

USER appuser
WORKDIR /workspace

# pnpmのインストール
RUN curl -fsSL https://get.pnpm.io/install.sh | bash -
ENV PATH="/home/appuser/.local/share/pnpm:$PATH"

# foundryのインストール
RUN curl -L https://foundry.paradigm.xyz | bash
ENV PATH="/home/appuser/.foundry/bin:$PATH"
RUN foundryup

# VS Code Server用のディレクトリ作成
RUN mkdir -p /home/appuser/.vscode-server

# シェル設定の追加
RUN echo "export LANG=ja_JP.UTF-8" >> /home/appuser/.bashrc
RUN echo "cd /workspace" >> /home/appuser/.bashrc

# デバッグ用:ユーザー情報の表示
RUN id && echo $PATH
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