Skip to content

Commit

Permalink
Merge pull request #84 from nayms/dev
Browse files Browse the repository at this point in the history
Next MAINNET upgrade
  • Loading branch information
amarinkovic authored Dec 11, 2023
2 parents 010fd43 + af09204 commit 03385a0
Show file tree
Hide file tree
Showing 168 changed files with 7,310 additions and 7,955 deletions.
11 changes: 9 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
export LOCAL_RPC_URL=
export ETH_MAINNET_RPC_URL=
export ETH_GOERLI_RPC_URL=
export ETH_SEPOLIA_RPC_URL=
export BASE_GOERLI_RPC_URL=
export ETH_GOERLI_RPC_URL=
export ETHERSCAN_API_KEY=
export NAYMS_SALT=
export OWNER_ACCOUNT_KEY=
export SYSTEM_ADMIN_1=
export BOOL_FORK_TEST=
export TESTS_FORK_UPGRADE_DIAMOND=
export TESTS_FORK_DIAMOND_ADDRESS_1=
export TESTS_FORK_DIAMOND_ADDRESS_11155111=
export TESTS_FORK_DIAMOND_ADDRESS_31337=
export TESTS_FORK_DIAMOND_ADDRESS_84531=
export FORK_BLOCK_1=
export FORK_BLOCK_11155111=
export FORK_BLOCK_31337=
export FORK_BLOCK_31337=
export FORK_BLOCK_84531=
14 changes: 0 additions & 14 deletions .env.proposal

This file was deleted.

37 changes: 18 additions & 19 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
module.exports = {
env: {
browser: false,
es2021: true,
mocha: true,
node: true,
},
extends: [
"standard",
"plugin:prettier/recommended",
"plugin:node/recommended",
],
parserOptions: {
ecmaVersion: 12,
},
overrides: [
{
files: ["hardhat.config.js"],
globals: { task: true },
env: {
browser: false,
es2021: true,
mocha: true,
node: true,
},
],
eslint: {
runtime: "node"
},
extends: ["standard", "plugin:prettier/recommended", "plugin:node/recommended"],
parserOptions: {
ecmaVersion: 12,
},
overrides: [
{
files: ["hardhat.config.js"],
globals: { task: true },
},
],
};
8 changes: 4 additions & 4 deletions .gas-snapshot
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@ T02UserTest:testGetUserIdFromAddress() (gas: 13111)
T02UserTest:testSetEntityFailsIfNotSysAdmin() (gas: 17858)
T02UserTest:testSetNonExistingEntity() (gas: 21330)
T03NaymsOwnershipTest:testFuzz_TransferOwnership(address,address,address) (runs: 256, μ: 115399, ~: 115399)
T03NaymsOwnershipTest:testTransferOwernship() (gas: 80801)
T03NaymsOwnershipTest:testTransferOwernshipFailsIfNewOwnerIsSysAdmin() (gas: 63812)
T03NaymsOwnershipTest:testTransferOwernshipFailsIfNewOwnerIsSysManager() (gas: 102978)
T03NaymsOwnershipTest:testTransferOwernshipFailsIfNotSysAdmin() (gas: 17824)
T03NaymsOwnershipTest:testTransferOwnership() (gas: 80801)
T03NaymsOwnershipTest:testTransferOwnershipFailsIfNewOwnerIsSysAdmin() (gas: 63812)
T03NaymsOwnershipTest:testTransferOwnershipFailsIfNewOwnerIsSysManager() (gas: 102978)
T03NaymsOwnershipTest:testTransferOwnershipFailsIfNotSysAdmin() (gas: 17824)
T03SystemFacetTest:testD03CreateEntity() (gas: 18686)
T03SystemFacetTest:testGetObjectMeta() (gas: 250099)
T03SystemFacetTest:testIsObject() (gas: 239012)
Expand Down
3 changes: 3 additions & 0 deletions .gemforge/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*.json
*.sol
*.log
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:

- uses: actions/setup-node@v3
with:
node-version: "16"
node-version: 20
cache: "yarn"
registry-url: "https://registry.npmjs.org"
scope: "@nayms"
Expand Down
20 changes: 14 additions & 6 deletions .github/workflows/npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ jobs:

- uses: actions/setup-node@v3
with:
node-version: "16.x"
node-version: 20
registry-url: "https://registry.npmjs.org"
always-auth: true

- name: Install solc
run: svm install 0.7.6 && svm install 0.8.17 && svm use 0.8.17
run: svm install 0.7.6 && svm install 0.8.20 && svm use 0.8.20

- name: Fix ownership
run: git config --global --add safe.directory /__w/contracts-v3/contracts-v3
Expand All @@ -41,14 +41,22 @@ jobs:

- name: Install Node dependencies
run: yarn

- name: Prepare build
run: make prep-build
- name: Drop-in Test Wallet
run: echo "test test test test test test test test test test test junk" > ./nayms_mnemonic.txt

- name: Build solidity contracts
run: make build
env:
ETH_MAINNET_RPC_URL: ${{ secrets.ETH_MAINNET_RPC_URL }}
ETH_SEPOLIA_RPC_URL: ${{ secrets.ETH_SEPOLIA_RPC_URL }}
ETH_GOERLI_RPC_URL: ${{ secrets.ETH_GOERLI_RPC_URL }}
BASE_GOERLI_RPC_URL: ${{ secrets.BASE_GOERLI_RPC_URL }}

- name: Filter ABI
run: make filter-abi

- name: Publish to NPM
run: npm publish
run: rm src/generated/.gitignore && npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}
10 changes: 5 additions & 5 deletions .github/workflows/solstat.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: solstat
on:
push:
branches:
- main
pull_request:
# push:
# branches:
# - main
# pull_request:
workflow_dispatch: {}
workflow_call:

Expand All @@ -26,7 +26,7 @@ jobs:
submodules: recursive

- name: Make solstat report
run: solstat --path ./src/diamonds/nayms/
run: solstat --path ./src/

- name: Publish solstat report
run: cat solstat_report.md >> $GITHUB_STEP_SUMMARY
52 changes: 21 additions & 31 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,13 @@ jobs:
with:
submodules: recursive

- uses: actions/setup-node@v3
with:
node-version: 20
cache: "yarn"

- name: Install solc
run: svm install 0.7.6 && svm install 0.8.17 && svm use 0.8.17
run: svm install 0.7.6 && svm install 0.8.20 && svm use 0.8.20

- name: Fix ownership
run: git config --global --add safe.directory /__w/contracts-v3/contracts-v3
Expand All @@ -36,18 +41,26 @@ jobs:
- name: Install Node dependencies
run: yarn

- name: Prepare build
run: make prep-build
- name: Drop-in Test Wallet
run: echo "test test test test test test test test test test test junk" > ./nayms_mnemonic.txt && echo "test test test test test test test test test test test junk" > ./nayms_mnemonic_mainnet.txt

- name: Build solidity contracts
run: make build
env:
ETH_MAINNET_RPC_URL: ${{ secrets.ETH_MAINNET_RPC_URL }}
ETH_SEPOLIA_RPC_URL: ${{ secrets.ETH_SEPOLIA_RPC_URL }}
ETH_GOERLI_RPC_URL: ${{ secrets.ETH_GOERLI_RPC_URL }}
BASE_MAINNET_RPC_URL: ${{ secrets.BASE_MAINNET_RPC_URL }}
BASE_GOERLI_RPC_URL: ${{ secrets.BASE_GOERLI_RPC_URL }}

- name: Tests - local
run: make test
env:
ETH_MAINNET_RPC_URL: ${{ secrets.ETH_MAINNET_RPC_URL }}
ETH_SEPOLIA_RPC_URL: ${{ secrets.ETH_SEPOLIA_RPC_URL }}
ETH_GOERLI_RPC_URL: ${{ secrets.ETH_GOERLI_RPC_URL }}
run: make test
BASE_MAINNET_RPC_URL: ${{ secrets.BASE_MAINNET_RPC_URL }}
BASE_GOERLI_RPC_URL: ${{ secrets.BASE_GOERLI_RPC_URL }}

- name: Coverage report
env:
Expand All @@ -61,35 +74,12 @@ jobs:
path-to-lcov: "./lcov-filtered.info"

- name: Slither Static Analyser
uses: crytic/[email protected]
id: slither
with:
sarif: results.sarif
target: src/diamonds/nayms
slither-args: --exclude solc-version,assembly-usage,naming-convention,low-level-calls --ignore-compile
continue-on-error: true
env:
SOLC_VERSION: 0.8.20
run: make slither

- name: Upload Slither SARIF file
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: ${{ steps.slither.outputs.sarif }}

# - name: Generate upgrade hashes
# env:
# ETH_MAINNET_RPC_URL: ${{ secrets.ETH_MAINNET_RPC_URL }}
# ETH_GOERLI_RPC_URL: ${{ secrets.ETH_GOERLI_RPC_URL }}
# ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY }}
# run: |
# make upgrade-hash-mainnet
# make upgrade-hash-goerli
# make upgrade-hash-sepolia

# echo "### Upgrade hash" >> $GITHUB_STEP_SUMMARY
# echo " - mainnet \`$(jq --raw-output '.returns.upgradeHash.value' broadcast/SmartDeploy.s.sol/1/dry-run/hash-latest.json || echo "Not Available")\`" >> $GITHUB_STEP_SUMMARY
# echo "> $(jq --raw-output '.returns.cut.value' broadcast/SmartDeploy.s.sol/1/dry-run/hash-latest.json || echo "Not Available")" >> $GITHUB_STEP_SUMMARY

# echo " - goerli \`$(jq --raw-output '.returns.upgradeHash.value' broadcast/SmartDeploy.s.sol/5/dry-run/hash-latest.json || echo "Not Available")\`" >> $GITHUB_STEP_SUMMARY
# echo "> $(jq --raw-output '.returns.cut.value' broadcast/SmartDeploy.s.sol/5/dry-run/hash-latest.json || echo "Not Available")" >> $GITHUB_STEP_SUMMARY

# echo " - sepolia \`$(jq --raw-output '.returns.upgradeHash.value' broadcast/SmartDeploy.s.sol/11155111/dry-run/hash-latest.json || echo "Not Available")\`" >> $GITHUB_STEP_SUMMARY
# echo "> $(jq --raw-output '.returns.cut.value' broadcast/SmartDeploy.s.sol/11155111/dry-run/hash-latest.json || echo "Not Available") >> $GITHUB_STEP_SUMMARY
sarif_file: results.sarif
59 changes: 0 additions & 59 deletions .github/workflows/upgrade-goerli-diamond.yml

This file was deleted.

9 changes: 6 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ anvil*.json

# yarn v1, node
node_modules
yarn-*.log

# Hardhat files
cache
Expand All @@ -34,6 +35,7 @@ facetsdeployed.txt
.vscode/slither-results.json

.history
.DS_Store

bin/
.idea/.gitignore
Expand All @@ -42,6 +44,7 @@ bin/
.idea/modules.xml
.idea/runConfigurations.xml
.idea/vcs.xml
.metals

broadcast/**/31337/*

Expand All @@ -53,8 +56,8 @@ broadcast/**/dry-run
# coverage report
cov-html

# macOS
.DS_Store
# Gemforge
# gemforge.deployments.json

# Generated files
script/deployment/S03UpgradeDiamond.s.sol
script/deployment/S03UpgradeDiamond.s.sol
14 changes: 11 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,20 @@
[submodule "lib/solidity-lib"]
path = lib/solidity-lib
url = https://github.com/uniswap/solidity-lib
[submodule "lib/ozv4"]
path = lib/ozv4
url = https://github.com/openzeppelin/openzeppelin-contracts
[submodule "lib/v3-periphery-foundry"]
path = lib/v3-periphery-foundry
url = https://github.com/gakonst/v3-periphery-foundry
[submodule "lib/solidity-stringutils"]
path = lib/solidity-stringutils
url = https://github.com/arachnid/solidity-stringutils
[submodule "lib/oz"]
path = lib/oz
url = https://github.com/openzeppelin/openzeppelin-contracts
branch = merge/release-v5.0
[submodule "lib/diamond-2-hardhat"]
path = lib/diamond-2-hardhat
url = https://github.com/gemstation/diamond-2-hardhat
branch = gemforge-2
[submodule "lib/solady"]
path = lib/solady
url = https://github.com/Vectorized/solady
Loading

0 comments on commit 03385a0

Please sign in to comment.