Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
434 commits
Select commit Hold shift + click to select a range
c7ecaf9
Update ScoreWeightController with addCurrency method
Jan 10, 2024
4c20162
Update path read in transferGovernance.ts
Jan 10, 2024
d9b7a75
Add network check to contract verification process
Jan 10, 2024
7c19dbe
Refactor condition check for non-localhost networks
Jan 10, 2024
1848877
Add upgrade and downgrade functions for v1.5
Jan 10, 2024
e0c1006
Add .chainId to localhost deployments
Jan 11, 2024
6e577d9
Update .gitignore to include localhost deployments
Jan 11, 2024
52f94f1
Refactor upgrade scripts to include error handling
Jan 11, 2024
d62ddff
Add newline at end of upgrade files and update FeePool.ts
Jan 11, 2024
e1d8732
Update openzeppelin hardhat-upgrades to v1.21.0
Jan 11, 2024
496cb64
Update FeePool tests for v2 upgrade and initialization
Jan 11, 2024
0543681
Update getProxy function call in deployFeePool
Jan 11, 2024
3dd393c
Refactor getProxy and getLinkedProxy functions in testUtil.ts
Jan 11, 2024
3bd9b42
Refactor upgrade functions to include libraries and options
Jan 11, 2024
364ecbf
code format
Jan 11, 2024
eb64473
Update FeePool proxy initialization and upgrade in tests
Jan 11, 2024
cef3da0
Ignore JSON files in scripts/events directory
Jan 12, 2024
a7443d3
Add README for events directory
Jan 12, 2024
e43dbc9
Add script to fetch and export Yamato events
Jan 12, 2024
9200204
Update formatting in events README.md
Jan 12, 2024
c99f7ec
Add script to extract and save event data
Jan 12, 2024
d51e7e7
Refactor event extraction and save function
Jan 12, 2024
878c136
Add getPledgeOutput function in extractAndSaveEvents.ts
Jan 16, 2024
c99dc14
Refactor error messages to use double quotes
Jan 16, 2024
24d3141
Update event extraction and save process
Jan 17, 2024
f282282
Replace BigInt with BigNumber in event args extraction
Jan 17, 2024
dfcec88
Add script to process and save extracted blockchain events
Jan 17, 2024
ba41ade
Refactor processExtractedEvents to a function
Jan 17, 2024
646502c
Add script to export block price data
Jan 17, 2024
29819c6
Refactor blockPriceDataExporter for readability
Jan 17, 2024
a74832b
Add ICR calculation and score to extracted events
Jan 17, 2024
abd5276
Refactor ethers import and usage in extractAndSaveEvents.ts
Jan 18, 2024
4a13537
Refactor code and add price data existence check
Jan 18, 2024
f5bd182
Add end event to all addresses at last block number
Jan 18, 2024
65ff708
Update ICR calculation and score in processExtractedEvents
Jan 18, 2024
21a7131
Rename processExtractedEvents to calculateEventScores
Jan 18, 2024
01ca9b4
Rename extractAndSaveEvents to processBlockchainEvents
Jan 18, 2024
490e5cb
Add README for scripts in Yamato protocol project
Jan 19, 2024
053fc60
Update @openzeppelin/hardhat-defender to version 1.9.0
Jan 19, 2024
4566f6b
Add function to deploy implementation contract
Jan 19, 2024
9842e43
Set network from environment variable in deployUtil
Jan 20, 2024
6324f63
Update upgradeUtil to use new implementation address
Jan 22, 2024
1b21db9
Add YamatoRepayer V3 deployment implementation
Jan 22, 2024
4669403
Add YamatoRedeemer deployment implementation
Jan 22, 2024
5b62a68
Add YamatoWithdrawer deploy implementation
Jan 22, 2024
960b999
Add YamatoSweeper V3 deployment implementation
Jan 22, 2024
3888812
Add YamatoDepositor V3 implementation deployment
Jan 22, 2024
7a0fb38
Add YamatoBorrower deployment implementation
Jan 22, 2024
208598c
Add PriorityRegistry deployment implementation
Jan 22, 2024
abe060e
Add Yamato V4 in deployImplContract function
Jan 22, 2024
61926af
Add CurrencyOS deployment implementation
Jan 22, 2024
5ef89f3
Add priceFeed deployment implementation
Jan 22, 2024
64a94f1
Add FeePoolV2 call data deployment script
Jan 22, 2024
d31db10
Add FeePool V2 contract deployment script
Jan 22, 2024
67c875a
Update YamatoRepayer to include PledgeLib in runUpgrade
Jan 22, 2024
47c37e9
Add new contracts and verification in deployUtil.ts
Jan 22, 2024
bd14fcf
Merge commit 'f0eb294909f9d95c60a7eabba6ca783842f0153b' into v1.5
Jan 24, 2024
79086f3
Update FeePoolV2 deployment to use dynamic timestamp
Jan 24, 2024
53e5ba0
Update deployImplContract parameter to false
Jan 24, 2024
bd0152c
Add implementation check for contract versions
Jan 24, 2024
b405fe0
Refactor code for improved readability and organization
Jan 24, 2024
c8d37f0
Add new deployment files for Sepolia module
Jan 24, 2024
a02789a
Update contractSizer to not run on compile
Jan 25, 2024
10828fe
Edit .openzeppelin file
Jan 25, 2024
05ee20b
Update contract addresses in sepolia deployments
Jan 25, 2024
0909dce
Update initializer functions and upgradeable package
Jan 31, 2024
fa358f0
Merge pull request #175 from DeFiGeek-Community/v1.5-openzeppelin-upg…
0xHaku Mar 4, 2024
e84d02d
Update mint functions to return minted amount
Mar 6, 2024
a863b8f
Add deployment script for YmtMinter contract
Mar 6, 2024
b64ac97
Refactor mintFor function for readability
Mar 6, 2024
356407a
Contract address updated.
Mar 19, 2024
eac27b5
code format
Mar 19, 2024
8c5b9af
Update 'addCurrency' to use 'ScoreRegistry' instead of 'CJPY'
Mar 21, 2024
eb1ffc1
Update claimV1RetroactiveRewards to return claim amount
Mar 21, 2024
def3412
Update TOKEN_CHECKPOINT_DEADLINE to 86400 seconds
Apr 3, 2024
e563489
Add unit tests for FeePoolV2 claim function
Apr 3, 2024
45bea16
Update v1.5 docs with latest contract versions
Apr 3, 2024
397dbde
Update contract list in v1.5 documentation
Apr 3, 2024
d2c6c56
Add v1.0 contract list to Yamato documentation
Apr 3, 2024
6057e2c
Update spacing in documentation files
Apr 3, 2024
0496b28
Update contract list in v1.0 and v1.5 docs
Apr 3, 2024
937e867
Update contract documentation for v1.0 and v1.5
Apr 3, 2024
03701e2
Replace genABI with hardhat time.latest function
Apr 18, 2024
88aae4d
Update FeePool addresses and add FeePoolV2CallData
Apr 18, 2024
8fbe2f5
Refactor calculation of claimable amount in YmtVesting
Apr 18, 2024
3d06a5f
add v1.5 english documents
0xHaku Apr 25, 2024
2a8d691
Merge branch 'v1.5' of github.com:DeFiGeek-Community/yamato into v1.5
Apr 26, 2024
c6b04d5
Refactor addCurrency method to addScore
Apr 26, 2024
6f595cd
Refactor addScore function calls and fix formula typo
Apr 26, 2024
9e16d3f
Add deposit permission controls to veYMT contract
Jul 16, 2024
773c620
Add toggleDepositForAllApproval tests in veYMT
Jul 16, 2024
bf0cfd9
Add tests for veYMT deposit approval toggle
Jul 16, 2024
1dbdc63
Remove .only from veYMT test descriptions
Jul 16, 2024
779b061
Refactor YmtMinter contract mint method order
Jul 16, 2024
f28a51c
Update increment operations to use pre-increment syntax
Jul 16, 2024
e7eb47d
Update copyright year to 2024 in all contracts
Jul 16, 2024
8e52924
Refactor for loop initialization in CurrencyOSV3.sol
Jul 17, 2024
b907f64
Remove unnecessary variable initializations in FeePoolV2
Jul 17, 2024
28a6b8e
Update loop initialization in ScoreRegistry.sol
Jul 17, 2024
d00834e
Remove unnecessary variable initializations in veYMT contract
Jul 17, 2024
5a8d5c1
Refactor for loop in YamatoV4 contract
Jul 17, 2024
e71b7f7
Refactor YMT.sol to remove redundant initialization
Jul 17, 2024
680d527
Remove unnecessary initial value for toMint variable
Jul 17, 2024
0b71ed4
Add SafeCast library and replace type casts
Jul 17, 2024
d7ed9a2
Add mappings for depositor permissions in veYMT contract
Jul 18, 2024
08d0053
Merge pull request #181 from DeFiGeek-Community/fix/info
naizo01 Jul 20, 2024
957037e
Merge pull request #182 from DeFiGeek-Community/fix/depositFor-allowance
naizo01 Jul 20, 2024
28d754c
Add bulk checkpoint and score limit update functions
Jul 23, 2024
be7079f
Add bulk operations to IScoreRegistry interface
Jul 23, 2024
bb48926
Refactor score checkpoint in YamatoRedeemerV5.sol
Jul 23, 2024
dcfb179
Refactor score registry and update in YamatoSweeperV3
Jul 23, 2024
3016094
Refactor toggleDepositForAllApproval calls in tests
Jul 23, 2024
757e5a6
Remove redundant assignment in ScoreRegistry
Jul 23, 2024
78d8ffd
Refactor condition check in ScoreRegistry contract
Jul 25, 2024
83a1ab1
Refactor bulkCheckpoint to accept pledge owners
Jul 25, 2024
e62d99a
Update bulkCheckpoint argument in Yamato contracts
Jul 25, 2024
6ed991d
Update bulkCheckpoint parameter to address array
Jul 25, 2024
c45fdeb
Refactor limit calculation into separate function
Jul 25, 2024
0d84cdf
Rename argument in bulkCheckpoint method
Jul 25, 2024
fb87f1c
Refactor variable names in ScoreRegistry contract
Jul 25, 2024
a618dce
Update hardhat-gas-reporter and enable it in config
Jul 29, 2024
2a268d3
Add fixture and mock functions for testing
Jul 29, 2024
6cc5c1e
Add account impersonation and event check helpers
Jul 29, 2024
516a969
Add versioning for contract interfaces and functions
Jul 29, 2024
7310069
Add helper methods to test ScoreRegistry contract
Jul 29, 2024
ae1fa30
Update ScoreRegistry to inherit from YamatoStore
Jul 29, 2024
41d1366
Add unit tests for ScoreRegistry checkpoint function
Jul 29, 2024
c25146a
Add unit tests for ScoreRegistry initialization
Jul 29, 2024
caf79aa
Add unit tests for ScoreRegistry.updateScoreLimit()
Jul 29, 2024
44d15ab
Add unit tests for ScoreRegistry.userCheckpoint()
Jul 29, 2024
b5e11c1
Refactor ScoreRegistry contract and tests
Jul 29, 2024
9ecfc80
Merge branch 'fix/gas-optimization' into v1.5
Aug 5, 2024
bfb7146
Add deployment scripts and update package.json dependencies
Aug 10, 2024
7a14581
add setting file
Aug 10, 2024
b042b7f
Add console log for deployment details in controllers
Aug 10, 2024
cd5ff30
Update tag in transferGovernance to V15
Aug 10, 2024
8ad1264
Add address utility for contract deployment
Aug 10, 2024
56d8812
Update deployment utility to handle versionless naming
Aug 10, 2024
d261d31
Update deployment instructions in doc/deploy/index.md
Aug 10, 2024
35c7dae
Add safeUtil.ts to create and propose transactions
Aug 10, 2024
f25d3a5
Move _import function to separate importUtil module
Aug 10, 2024
1352c27
Add v1.5 update scripts, remove old update script
Aug 10, 2024
0974691
Refactor deploy implementation files and error handling
Aug 10, 2024
dcc45f5
Add deployment scripts for multiple contracts
Aug 10, 2024
74ec128
Add upgrade modules for multiple contract versions
Aug 10, 2024
fc0f4b6
Add transaction creation for various contracts
Aug 10, 2024
fe59e18
Add implementation check for contract upgrades
Aug 10, 2024
41e3917
Add new upgrade scripts for Yamato modules
Aug 10, 2024
6c3071b
Add new modules to safeTxCreate upgrade script
Aug 10, 2024
c59a970
Update gas compensation calculation in YamatoSweeperV3
Aug 12, 2024
e1a40e5
Update gas compensation calculation in YamatoSweeperV3
Aug 12, 2024
c5d26d7
Add validation to skip null addresses in loops
Aug 16, 2024
623a609
Add test for Yamato contract's gas price calculation
Aug 16, 2024
d66e06a
Update mockPool to use contractVersion in tests
Aug 16, 2024
1cb0b36
Remove controller related code from veYMT contract
Aug 19, 2024
91a5c80
Refactor tests for gas price calculation and logging
Aug 20, 2024
72695cc
Merge pull request #184 from DeFiGeek-Community/fix/sweeper-fee-logic
naizo01 Aug 20, 2024
549e1ba
Merge branch 'v1.5' of github.com:DeFiGeek-Community/yamato into v1.5
Aug 20, 2024
bc96b0f
Update YMT contract to mint initial supply to provided address
Aug 21, 2024
c49b3a3
Update YMT contract deployment with owner address
Aug 21, 2024
69ec5df
Add multisig address to YMT deployment arguments
Aug 22, 2024
ba8a824
Replace hardcoded account address with ownerAddress variable
Aug 22, 2024
3dfa258
Add token distribution calculation script
Aug 26, 2024
6f34c01
Add score calculation to event processing script
Aug 26, 2024
2abf272
Add exclusion list to token distribution calculation
Aug 27, 2024
d0f563b
Remove CalculateTokenDistributions script
Aug 27, 2024
eef6977
Add token distribution calculation script
Aug 27, 2024
ba94d60
Update README with npx command and new script
Aug 28, 2024
cfe73b7
Add proposeSetVestingClaims script for transactions
Aug 28, 2024
ffb0633
Refactor code for readability and consistency
Aug 28, 2024
ff72f85
Add check for zero distributed tokens before push
Aug 29, 2024
163874c
Remove futureAdmin variable from veYMT contract
Aug 29, 2024
cffb309
Update YamatoRepayer to handle localhost transactions
Aug 29, 2024
b38c4ad
Add executeTransaction for localhost in upgradeTo.ts
Aug 29, 2024
951166d
Update YamatoWithdrawer to handle local transactions
Aug 29, 2024
9f55467
Update YamatoSweeper upgrade logic for local network
Aug 29, 2024
f51ca42
Add conditional execution in YamatoDepositor upgrade
Aug 29, 2024
e2f8173
Add conditional execution in YamatoBorrower upgrade script
Aug 29, 2024
5649c18
Add YmtMinter contract and set governance
Aug 30, 2024
1b8a677
Add network conditional for transaction execution
Aug 30, 2024
e909922
Add executeTransaction method for localhost network
Aug 30, 2024
ac50e59
Add conditional execution for upgradeTo method
Aug 30, 2024
58dd958
Add network condition for transaction execution
Aug 30, 2024
916f052
Fix import path in PriceFeed upgrade module
Aug 30, 2024
252e7a1
Fix incorrect import path in PriorityRegistry upgrade
Aug 30, 2024
6c83abc
Add network condition for transaction execution
Aug 30, 2024
f19d3a8
Add network condition for transaction execution
Aug 30, 2024
bdddcd9
Add conditional execution to setScoreRegistry function
Aug 30, 2024
b3867da
Add conditional execution for setVeYMT transaction
Aug 30, 2024
d516db5
Add directory creation in deployment path function
Aug 30, 2024
5635ccc
Add executeTransaction function in upgradeUtil.ts
Aug 30, 2024
05174df
Refactor async IIFE to named function in 190_check_impl.ts
Aug 30, 2024
cfd5e63
Add address verification and update governance acceptance
Aug 30, 2024
ea26e3c
Add local network handling for acceptGovernance
Aug 30, 2024
aab3544
Add localhost check to address registration test
Aug 30, 2024
e528dba
Remove unnecessary console logs in checkImplementation
Aug 31, 2024
378e423
Refactor address comparison log outputs
Aug 31, 2024
e155ade
Add script to verify governance addresses
Aug 31, 2024
3bf81ae
Refactor 090_check_impl to use main from mods
Aug 31, 2024
622bd12
Add error handling in setAddress check
Aug 31, 2024
f17a2f3
Add 092_check_governance.ts error handling
Aug 31, 2024
044fded
Add v1.5 local test for contract upgrades
Sep 1, 2024
9ce8bee
Add localhost check in v1.5-update-safePropose.ts
Sep 1, 2024
580f13e
Add script to convert JSON to CSV file
Sep 6, 2024
a979245
Add SIGNER_ADDRESS_PRIVATE_KEY to .env.sample
Sep 6, 2024
4564901
Update excluded addresses in token distribution calculation
Sep 6, 2024
2a30e9f
Update deployment commands in documentation
Oct 21, 2024
98dbb88
Add proposeSetVestingClaims script to README.md
Oct 21, 2024
b16825c
Update lastBlockNumber in processBlockchainEvents.ts
Oct 21, 2024
e24d0d6
Refactor scripts for better readability and consistency
Oct 21, 2024
f4be2c9
Fix veSupply calculation to handle negative bias values
naizo01 Feb 26, 2025
a449efc
Add utility scripts for local testing and contract interaction
naizo01 Feb 26, 2025
d960d8a
Simplify network deployment accounts configuration
naizo01 Feb 28, 2025
4bbd380
Update executeTransaction to use localhost admin private key and spec…
naizo01 Feb 28, 2025
3a879fc
Add CurrencyOS address configuration script for deployment
naizo01 Feb 28, 2025
61eadc0
Add network configuration support for Safe transaction script
naizo01 Mar 8, 2025
4499d5b
Enhance contract deployment and versioning support
naizo01 Mar 8, 2025
730ccb9
Update RPC URL configuration to use Alchemy URL across networks
naizo01 Mar 8, 2025
85776ae
Update deployment and upgrade commands in docs
naizo01 Apr 13, 2025
2e3e2f7
Comment out imports in safePropose, add safePropose2
naizo01 Apr 13, 2025
76558ae
Update timestamp calculation in FeePool upgrade script
naizo01 Apr 13, 2025
83ea29f
Add governance check for v1 contracts
naizo01 Apr 13, 2025
809421f
デプロイメントスクリプトを更新し、ローカルネットワーク用のタグを整理しました。また、`safePropose2`を追加しました。
naizo01 Apr 13, 2025
5dbb7b7
デプロイメントアドレスの読み込み時にコンソールログをコメントアウトしました。
naizo01 Apr 13, 2025
d1b3ec7
FeePoolのトランザクション提案を行う新しいモジュールを追加し、`safePropose2`にインポートしました。
naizo01 Apr 13, 2025
0e624a5
コードの整形を行い、コメントの位置を修正しました。また、いくつかのファイルで環境変数の取得方法を簡素化しました。
naizo01 Apr 13, 2025
5d24416
add priorityregistry consistency test
0xHaku Apr 18, 2025
8e308f7
add authorization check
0xHaku Apr 19, 2025
727e9c4
readContract関数のコントラクト名とメソッド名を更新し、ABI生成時にバージョンを追加しました。また、環境変数の取得をコメントア…
naizo01 Apr 19, 2025
96b294c
add mainnet simulate
0xHaku Apr 19, 2025
56be35b
価格更新機能を改善し、環境変数から秘密鍵を取得する処理を追加しました。また、トランザクションの実行を行うためのコントラクトインスタンスを生…
naizo01 Apr 19, 2025
7f4a80e
YmtMinterコントラクトに開始時間の設定機能を追加し、ミント開始前のチェックを実装しました。また、デプロイメントスクリプトを更新し、…
naizo01 Apr 19, 2025
246f7b0
ブロック番号を20632408から22301335に更新しました。
naizo01 Apr 19, 2025
e4ff1e3
advanceTime.tsの時間設定を変更し、100日と0時間に更新しました。また、スクリプトの実行方法に関するコメントを追加しました。
naizo01 Apr 19, 2025
133d2e9
Merge branch 'v1.5' of github.com:DeFiGeek-Community/yamato into v1.5
naizo01 Apr 20, 2025
6d0063e
YmtMinterコントラクトのミント開始前チェックを簡素化し、デプロイ設定に開始時間を追加しました。また、PriorityRegistr…
naizo01 Apr 20, 2025
1240f3f
環境変数にコミュニティマルチシグアドレスを追加し、デプロイスクリプトでの使用を更新しました。また、ガバナンスアドレスの検証ロジックを改善し…
naizo01 Apr 20, 2025
74c03d4
add mainnet deployments
0xHaku May 8, 2025
c89d25b
デプロイスクリプトでのログ出力を整形し、advanceTime.tsのコメントを整理しました。また、ガバナンスアドレスの検証ロジックを簡素…
naizo01 May 9, 2025
5f264f1
テストコード内のYmtMinterコントラクトのプロキシ取得時に、引数に0を追加しました。また、package.jsonのフォーマットを修…
naizo01 May 9, 2025
45715e8
テストコードのPriorityRegistryにおいて、mainnetプロパティのテストを修正し、describe.onlyをdescri…
naizo01 May 9, 2025
9f69443
新しいデプロイスクリプトlocal-deploy1.5.shを追加し、V1.5のデプロイ手順を実装しました。環境変数の設定を更新し、ガバナ…
naizo01 May 10, 2025
be93747
GitHub Actionsのフォーマッターとリンターのチェックワークフローを更新し、Node.jsのバージョンを14.xから20に変更し…
naizo01 May 10, 2025
edb9b43
GitHub ActionsのSlither分析ワークフローを更新し、使用するアクションのバージョンをv2からv5に、Node.jsのバー…
naizo01 May 10, 2025
7f54964
GitHub Actionsのユニットテストワークフローを更新し、使用するアクションのバージョンをv2からv4に変更しました。また、Nod…
naizo01 May 10, 2025
97a7cd5
イベントスコア計算ロジックを修正し、借入ゼロのケースに対する特別な処理を追加しました。また、トークン配分計算に最大借入額を追加し、CSV出…
naizo01 May 11, 2025
ec3b5b2
イベントデータを含む複数のJSONファイルを追加し、ブロック番号、トランザクションハッシュ、イベントタイプなどの詳細を記録しました。また、…
naizo01 May 11, 2025
7b1c0ae
コントラクトYMTのコンストラクタ内のトークン名を「Yamato」から「Yamato DAO Token」に変更しました。これにより、トー…
naizo01 May 11, 2025
3dfce7f
新しいアップグレードスクリプトv1.5-update-safePropose3.tsを追加し、複数のモジュールをインポートするメイン関数を…
naizo01 May 11, 2025
56d36ea
add mainnet redeployments
0xHaku May 27, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 4 additions & 1 deletion .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,7 @@ LOCAL_FACTORY_ADDERSS=0x5FbDB2315678afecb367f032d93F642f64180aa3
UUPS_PROXY_ADMIN_MULTISIG_ADDRESS=
YMT_CLI_MODE=
DEFENDER_TEAM_API_KEY=
DEFENDER_TEAM_API_SECRET_KEY=
DEFENDER_TEAM_API_SECRET_KEY=
NETWORK=
SIGNER_ADDRESS_PRIVATE_KEY=
COMMUNITY_MULTISIG_ADDRESS=
21 changes: 10 additions & 11 deletions .github/workflows/formatter-and-linter-check.yaml
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
name: Formatter and Linter check
on:
push:
branches:
- master
branches: [master]
pull_request:
branches:
- master
branches: [master]

jobs:
formatter-linter-check:
name: Formatter and Linter check
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 14.x
node-version: 20
registry-url: https://registry.npmjs.org
- uses: actions/cache@v2

- uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
Expand All @@ -40,8 +39,8 @@ jobs:
- name: Do check
run: npm run lint:check

- name: discord notification(if failure)
- name: discord notification (if failure)
if: failure()
uses: sarisia/actions-status-discord@v1
if: ${{ failure() }}
with:
webhook: ${{ secrets.DISCORD_WEBHOOK }}
68 changes: 38 additions & 30 deletions .github/workflows/slither-analyze.yaml
Original file line number Diff line number Diff line change
@@ -1,67 +1,75 @@
name: Slither Analyze
on:
push:
branches:
- turnOffUntilIssue76IsSolved
branches: [turnOffUntilIssue76IsSolved]
pull_request:
branches:
- turnOffUntilIssue76IsSolved
branches: [turnOffUntilIssue76IsSolved]

jobs:
unit-tests:
name: Slither Analyze
slither-analyze:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
# Git checkout
- uses: actions/checkout@v4

- uses: actions/setup-node@v2
# Node (for npm scripts)
- uses: actions/setup-node@v4
with:
node-version: 14.x
node-version: 20
registry-url: https://registry.npmjs.org
- uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
cache: "npm" # npm キャッシュを actions/cache の代わりに自動付与可

# 旧スタイルでキャッシュしたい場合はこちら
# - uses: actions/cache@v4
# with:
# path: ~/.npm
# key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
# restore-keys: |
# ${{ runner.os }}-node-

# npm install
- name: Install dependencies
env:
PRIVATE_KEY: ${{ secrets.CI_PRIVATE_KEY }}
run: |
mkdir -p ~/.ssh
echo "$PRIVATE_KEY" | tr -d '\r' > ~/.ssh/id_rsa
chmod 700 ~/.ssh/id_rsa
eval $(ssh-agent -s)
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_rsa
ssh-keyscan -H github.com >> ~/.ssh/known_hosts
npm ci

- uses: actions/setup-python@v2
# Python (for Slither)
- uses: actions/setup-python@v5
with:
python-version: "3.11"

# solc & Slither
- name: Install solc compiler
run: |
sudo add-apt-repository ppa:ethereum/ethereum
sudo add-apt-repository -y ppa:ethereum/ethereum
sudo apt-get update
sudo apt-get install solc

sudo apt-get install -y solc
- name: Install slither
run: sudo pip install slither-analyzer
run: pip install --upgrade slither-analyzer

# Run Slither
- name: Run slither analyze
run: |
npm run analyze || :
npm run analyze:resultRet
# exit $(npm run analyze:resultRet|tail -n1)
echo $(npm run analyze:resultRet|tail -n1) problems found
echo but I ignore them in this time.

env:
ALCHEMY_URL: ${{ secrets.ALCHEMY_URL }}
DEPLOYER_PRIVATE_KEY: ${{ secrets.DEPLOYER_PRIVATE_KEY }}
FOUNDATION_PRIVATE_KEY: ${{ secrets.FOUNDATION_PRIVATE_KEY }}
run: |
# Slither の結果を無視するなら `|| :` でも良い
npm run analyze || :
npm run analyze:resultRet
echo "$(npm run analyze:resultRet | tail -n1) problems found (ignored for now)"

- name: discord notification(if failure)
# Discord 通知
- name: discord notification (if failure)
if: failure()
uses: sarisia/actions-status-discord@v1
if: ${{ failure() }}
with:
webhook: ${{ secrets.DISCORD_WEBHOOK }}
38 changes: 19 additions & 19 deletions .github/workflows/unit-tests.yaml
Original file line number Diff line number Diff line change
@@ -1,58 +1,58 @@
name: Unit Tests
on:
push:
branches:
- master
branches: [master]
pull_request:
branches:
- master
branches: [master]

jobs:
unit-tests:
name: Unit Tests
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
# 1. ソース取得
- uses: actions/checkout@v4

# 2. Node セットアップ + npm キャッシュ
- uses: actions/setup-node@v4
with:
node-version: 14.x
node-version: 20 # Node 18 でも可
registry-url: https://registry.npmjs.org
- uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
cache: "npm" # ~/.npm を自動キャッシュ

# 3. 依存インストール
- name: Install dependencies
env:
PRIVATE_KEY: ${{ secrets.CI_PRIVATE_KEY }}
run: |
mkdir -p ~/.ssh
echo "$PRIVATE_KEY" | tr -d '\r' > ~/.ssh/id_rsa
chmod 700 ~/.ssh/id_rsa
eval $(ssh-agent -s)
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_rsa
ssh-keyscan -H github.com >> ~/.ssh/known_hosts
npm ci

# 4. コンパイル
- name: Compile
run: npm run compile
env:
ALCHEMY_URL: ${{ secrets.ALCHEMY_URL }}
DEPLOYER_PRIVATE_KEY: ${{ secrets.DEPLOYER_PRIVATE_KEY }}
FOUNDATION_PRIVATE_KEY: ${{ secrets.FOUNDATION_PRIVATE_KEY }}
run: npm run compile

# 5. ユニットテスト
- name: Run unit tests
run: "NODE_ENV=ci npm test"
env:
NODE_ENV: ci
ALCHEMY_URL: ${{ secrets.ALCHEMY_URL }}
DEPLOYER_PRIVATE_KEY: ${{ secrets.DEPLOYER_PRIVATE_KEY }}
FOUNDATION_PRIVATE_KEY: ${{ secrets.FOUNDATION_PRIVATE_KEY }}
run: npm test

- name: discord notification(if failure)
# 6. Discord 通知 (失敗時)
- name: discord notification (if failure)
if: failure()
uses: sarisia/actions-status-discord@v1
if: ${{ failure() }}
with:
webhook: ${{ secrets.DISCORD_WEBHOOK }}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ typechain/*
*.dbg.json
cache/**/*
!deployments/goerli/.chainId
deployments/localhost
!deployments/localhost/.chainId
deployments/localhost/*
typechain-types
abis
test/**/*.js
Expand Down
Loading