Skip to content

Commit

Permalink
Merge branch 'main' into m_develop_main
Browse files Browse the repository at this point in the history
  • Loading branch information
livingrockrises committed Nov 10, 2023
2 parents b55d847 + c9fce4c commit 5c9cb42
Show file tree
Hide file tree
Showing 67 changed files with 6,820 additions and 4,669 deletions.
6 changes: 6 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_modules
artifacts
cache
coverage
gasReporterOutput.json
**/typechain/
51 changes: 51 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
module.exports = {
env: {
browser: false,
es2021: true,
mocha: true,
node: true,
},
plugins: ["@typescript-eslint"],
extends: [
"standard",
"plugin:prettier/recommended",
"plugin:node/recommended",
"plugin:@typescript-eslint/recommended",
"plugin:security/recommended",
],
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaVersion: 2020, // Allows for the parsing of modern ECMAScript features
sourceType: "module", // Allows for the use of imports
},
rules: {
"node/no-unsupported-features/es-syntax": [
"error",
{ ignores: ["modules"] },
],
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"node/no-missing-import": [
"error",
{
allowModules: [],
resolvePaths: ["test"],
tryExtensions: [".js", ".json", ".node", ".ts"],
},
],
camelcase: [
"error",
{
allow: [".*__factory"],
},
],

"node/no-unsupported-features/es-syntax": "off"
// "@typescript-eslint/no-explicit-any": "error",
// quotes: ["error", "double"],
// "no-unused-vars": "error",
// "no-console": "error",
// "@typescript-eslint/no-unused-vars": "error",
// "@typescript-eslint/explicit-function-return-type": "error",
},
};
31 changes: 31 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
## SDK Version

<!-- Please specify the version of the SDK you are using. -->

## Description
<!-- Briefly describe the bug you are facing. -->

## Steps to Reproduce

1.
2.
3.
<!-- Add any other context or screenshots about the feature request here. -->

## Expected Behavior
<!-- Describe what you expected to happen. -->

## Actual Behavior
<!-- Describe what actually happened. Include any error tracebacks if possible. -->

## Possible Fix (optional)
<!-- If you have an idea on how to fix this, please share! -->

## Environment Details

- **Browser Version**:
- **Node.js Version**:
- **NPM/Yarn Version**:

## Additional Context
<!-- Add any other details or context about the bug here. -->
22 changes: 22 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
name: Feature Request
about: Propose an enhancement or new feature to improve the project
title: "Feature: <Your Feature>"
labels: feature-request, needs-review
assignees: ""
---

**Problem You're Facing**
<!-- Briefly describe the problem you're trying to solve or the limitation you've encountered. -->

**Proposed Solution**
<!-- What would you like to see happen? -->

**Alternatives Considered**
<!-- Any other solutions or features you've considered. -->

## Use Cases
<!-- Help us understand the broader context by providing some typical use cases where this feature would be helpful. -->

**Additional Info**
<!-- Provide any additional details, context, or screenshots about the feature request. -->
33 changes: 33 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Summary

<!-- Please provide a brief summary of the changes and the issue number this PR addresses. -->

Related Issue: # (issue number)

## Change Type

- [ ] Bug Fix
- [ ] Refactor
- [ ] New Feature
- [ ] Breaking Change
- [ ] Documentation Update
- [ ] Performance Improvement
- [ ] Other

# Checklist

- [ ] My code follows this project's style guidelines
- [ ] I've reviewed my own code
- [ ] I've added comments for any hard-to-understand areas
- [ ] I've updated the documentation if necessary
- [ ] My changes generate no new warnings
- [ ] I've added tests that prove my fix is effective or my feature works
- [ ] All unit tests pass locally with my changes
- [ ] Any dependent changes have been merged and published

# Additional Information
<!-- Any additional information or context about the PR. -->

# Branch Naming
<!-- Make sure your branch name follows the pattern: `features/`, `fixes/`, or `releases/`. -->
<!-- **Note**: The person creating the PR is responsible for merging and deleting the branch. Ensure the code has been tested, commented, linted, and documents updated if needed. -->
22 changes: 22 additions & 0 deletions .github/workflows/mark_stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Mark Inactive Issues and PRs

on:
schedule:
- cron: '0 0 * * *'

jobs:
stale:
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write

steps:
- uses: actions/stale@v5
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: "This issue has been inactive for 30 days. It will be closed due to inactivity. If this issue is still relevant, please comment to keep it open. Alternatively, you can create a new issue with updated information."
stale-pr-message: "This PR has been inactive for 30 days. If it's waiting for a review, please reach out to the team. Otherwise, please update the PR or it will be closed due to inactivity."
stale-issue-label: "inactive-issue"
stale-pr-label: "inactive-pr"
days-before-stale: 30
80 changes: 80 additions & 0 deletions .github/workflows/push_check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: Test workflow
on: push
jobs:
setup:
runs-on: ubuntu-latest
outputs:
cache-key: ${{ steps.cache-keys.outputs.cache-key }}
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Get cache key
id: cache-keys
run: echo "::set-output name=cache-key::$(echo ${{ runner.os }}-node-$(cat yarn.lock | sha256sum | cut -d' ' -f1))"

- name: Cache node modules
uses: actions/cache@v2
with:
path: |
**/node_modules
key: ${{ steps.cache-keys.outputs.cache-key }}

- name: Install dependencies
run: yarn install --frozen-lockfile

lint:
name: Lint sources
runs-on: ubuntu-latest
needs: setup
strategy:
matrix:
node-version: [18.x]
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Cache node modules
uses: actions/cache@v2
with:
path: |
**/node_modules
key: ${{ needs.setup.outputs.cache-key }}

- name: Lint sources
run: yarn lint:sol

unit_test:
name: Unit tests
runs-on: ubuntu-latest
needs: setup
strategy:
matrix:
node-version: [18.x]
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Cache node modules
uses: actions/cache@v2
with:
path: |
**/node_modules
key: ${{ needs.setup.outputs.cache-key }}

- name: Create a fake .secret file
run: echo "primary twist rack vendor diagram image used route theme frown either will" > .secret

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly

- name: Install foundry dependencies
run: forge install

- name: Build Typechain and Foundry
run: yarn build

- name: Run Forge and Hardhat Tests
run: yarn test
2 changes: 0 additions & 2 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

yarn lint
42 changes: 42 additions & 0 deletions .solhint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"extends": "solhint:recommended",
"rules": {
"compiler-version": ["error", "0.8.17"],
"func-visibility": ["warn", { "ignoreConstructors": true }],
"reentrancy": "error",
"state-visibility": "error",
"quotes": ["error", "double"],
"const-name-snakecase": "error",
"contract-name-camelcase": "error",
"event-name-camelcase": "error",
"func-name-mixedcase": "error",
"func-param-name-mixedcase": "error",
"modifier-name-mixedcase": "error",
"private-vars-leading-underscore": ["off", { "strict": true }],
"use-forbidden-name": "error",
"var-name-mixedcase": "error",
"imports-on-top": "error",
"ordering": "error",
"visibility-modifier-order": "error",
"code-complexity": ["error", 7],
"function-max-lines": ["error", 80],
"max-line-length": ["warn", 120],
"max-states-count": ["error", 15],
"no-empty-blocks": "error",
"no-unused-vars": "error",
"payable-fallback": "off",
"constructor-syntax": "error",
"explicit-types": "error",
"no-unused-import": "error",
"one-contract-per-file": "warn",
"not-rely-on-time": "off",
"reason-string": "warn",
"no-inline-assembly": "off",
"avoid-low-level-calls": "off",
"custom-errors": "off",
"no-complex-fallback": "off",
"no-global-import": "off",
"avoid-tx-origin": "off"
},
"plugins": ["prettier"]
}
6 changes: 6 additions & 0 deletions .solhintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_modules
artifacts
contracts/test
contracts/libs
contracts/token
contracts/references
Loading

0 comments on commit 5c9cb42

Please sign in to comment.