diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 2d5fee78c7..f03d6586dc 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,4 +1,5 @@ # CODEOWNERS: https://help.github.com/articles/about-codeowners/ # Primary (global) repo maintainers -* @evmos/core-engineering + + * @evmos/core-engineering diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 89783cb127..460c7d731e 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -40,6 +40,15 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v3 + - uses: technote-space/get-diff-action@v6.1.1 + with: + PATTERNS: | + **/**.sol + **/**.go + **/**.ts + **/**.js + go.mod + go.sum # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL @@ -50,11 +59,14 @@ jobs: # By default, queries listed here will override any specified in a config file. # Prefix the list here with "+" to use these queries and those in the config file. # queries: ./path/to/local/query, your-org/your-repo/queries@main - + queries: crypto-com/cosmos-sdk-codeql@main,security-and-quality + if: env.GIT_DIFF # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # If this step fails, then you should remove it and run the build manually (see below) + - name: Autobuild uses: github/codeql-action/autobuild@v2 + if: env.GIT_DIFF # ℹī¸ Command-line programs to run using the OS shell. # 📚 https://git.io/JvXDl @@ -69,3 +81,4 @@ jobs: - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v2 + if: env.GIT_DIFF diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 5032112a2e..e413b673c9 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -13,6 +13,7 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 10 steps: + # Required: setup-go, for all versions v3.0.0+ of golangci-lint - uses: actions/setup-go@v3 with: go-version: 1.19 @@ -23,9 +24,10 @@ jobs: **/**.go go.mod go.sum - - uses: golangci/golangci-lint-action@v3 + - uses: golangci/golangci-lint-action@v3.3.0 with: - version: v1.48.0 + # Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version. + version: v1.46.2 args: --timeout 10m github-token: ${{ secrets.github_token }} # Check only if there are differences in the source code @@ -42,7 +44,11 @@ jobs: docs/**/*.md x/**/*.md README.md - - uses: articulate/actions-markdownlint@v1.1.0 + - uses: nosborn/github-action-markdown-cli@v3.2.0 + with: + files: . + config_file: .markdownlint.yml + ignore_path: .markdownlintignore # Check only if there are differences in the source code if: env.GIT_DIFF python-lint: @@ -70,7 +76,12 @@ jobs: - uses: cachix/cachix-action@v12 with: name: ethermint + - uses: technote-space/get-diff-action@v6.1.1 + with: + PATTERNS: | + **/**.py - name: run gomod2nix run: | nix run -f ./nix gomod2nix git diff --no-ext-diff --exit-code + if: env.GIT_DIFF diff --git a/.github/workflows/markdown-links.yml b/.github/workflows/markdown-links.yml new file mode 100644 index 0000000000..1d50faaa5d --- /dev/null +++ b/.github/workflows/markdown-links.yml @@ -0,0 +1,29 @@ +name: Check Markdown links +on: + pull_request: + paths: + - '**.md' + push: + branches: + - main + paths: + - '**.md' + +jobs: + markdown-link-check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: technote-space/get-diff-action@v6.1.1 + id: git_diff + with: + PATTERNS: | + **/**.md + - uses: gaurav-nelson/github-action-markdown-link-check@master + with: + folder-path: "docs" + check-modified-files-only: "yes" + use-quiet-mode: "yes" + base-branch: "main" + config-file: "mlc_config.json" + if: env.GIT_DIFF diff --git a/.github/workflows/security.yml b/.github/workflows/security.yml index be3ba2f7d6..b32d6ff085 100644 --- a/.github/workflows/security.yml +++ b/.github/workflows/security.yml @@ -7,6 +7,9 @@ on: jobs: Gosec: + permissions: + security-events: write + runs-on: ubuntu-latest env: GO111MODULE: on @@ -21,10 +24,10 @@ jobs: go.mod go.sum - name: Run Gosec Security Scanner - uses: informalsystems/gosec@master + uses: cosmos/gosec@master with: # we let the report trigger content trigger a failure using the GitHub Security features. - args: '-no-fail -fmt sarif -out results.sarif ./...' + args: "-no-fail -fmt sarif -out results.sarif ./..." if: "env.GIT_DIFF_FILTERED != ''" - name: Upload SARIF file uses: github/codeql-action/upload-sarif@v2 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f4cac262a9..0ea9b5439c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -26,6 +26,7 @@ jobs: - uses: technote-space/get-diff-action@v6.1.1 with: PATTERNS: | + **/**.sol **/**.go go.mod go.sum diff --git a/.gitignore b/.gitignore index fa7bb0ceba..eb745f7e2b 100644 --- a/.gitignore +++ b/.gitignore @@ -35,10 +35,14 @@ keyring_test_cosmos ./**/node_modules ./**/dist secret.yml +artifacts/* +tmp-swagger-gen +github.com/ # vue/ # Local docker volume mappings localnet-setup +.testnets # Testing coverage.txt @@ -56,6 +60,7 @@ vagrant # IDE .idea/ *.iml +*.code-workspace # Graphviz dependency-graph.png @@ -70,8 +75,8 @@ dependency-graph.png *.abi # Node.js -tests/**/node_modules/* -tests-solidity/**/node_modules/* +**/node_modules -# Nix -/result \ No newline at end of file + +# OpenZeppelin contracts +contracts/@openzeppelin/* diff --git a/.markdownlintignore b/.markdownlintignore index 1725ceb118..f3a830d7c1 100644 --- a/.markdownlintignore +++ b/.markdownlintignore @@ -1,3 +1,3 @@ CHANGELOG.md -docs/protocol/proto-docs.md +docs/api/proto-docs.md docs/node_modules diff --git a/.mergify.yml b/.mergify.yml index eb3ceeeef9..a544927762 100644 --- a/.mergify.yml +++ b/.mergify.yml @@ -23,19 +23,19 @@ pull_request_rules: backport: branches: - main - - name: backport patches to v0.17.x branch + - name: backport patches to v0.20.x branch conditions: - base=main - - label=backport/0.17.x + - label=backport/0.20.x actions: backport: branches: - - release/v0.17.x - - name: backport patches to v0.16.x branch + - release/v0.20.x + - name: backport patches to v0.19.x branch conditions: - base=main - - label=backport/0.16.x + - label=backport/0.19.x actions: backport: branches: - - release/v0.16.x + - release/v0.19.x diff --git a/.solhint.json b/.solhint.json new file mode 100644 index 0000000000..d7c3de9895 --- /dev/null +++ b/.solhint.json @@ -0,0 +1,3 @@ +{ + "extends": "solhint:default" +} diff --git a/.yamllint b/.yamllint new file mode 100644 index 0000000000..e53fd3d147 --- /dev/null +++ b/.yamllint @@ -0,0 +1,31 @@ +--- + +yaml-files: + - '*.yaml' + - '*.yml' + - '.yamllint' + +rules: + braces: enable + brackets: enable + colons: enable + commas: enable + comments: + level: warning + comments-indentation: disable + document-end: disable + document-start: disable + empty-lines: disable + empty-values: disable + float-values: disable + hyphens: enable + indentation: enable + key-duplicates: enable + key-ordering: disable + line-length: disable + new-line-at-end-of-file: enable + new-lines: enable + octal-values: disable + quoted-strings: disable + trailing-spaces: disable + truthy: disable \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 82feeed48b..5be884533d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -6,7 +6,6 @@ - [Pull Request Templates](#pull-request-templates) - [Requesting Reviews](#requesting-reviews) - [Reviewing Pull Requests](#reviewing-pull-requests) - - [Updating Documentation](#updating-documentation) - [Forking](#forking) - [Dependencies](#dependencies) - [Protobuf](#protobuf) diff --git a/gometalinter.json b/gometalinter.json new file mode 100644 index 0000000000..78a33ed7b4 --- /dev/null +++ b/gometalinter.json @@ -0,0 +1,16 @@ +{ + "Linters": { + "vet": "go tool vet -composites=false :PATH:LINE:MESSAGE" + }, + "Enable": [ + "golint", + "vet", + "ineffassign", + "unparam", + "unconvert", + "misspell" + ], + "Deadline": "500s", + "Vendor": true, + "Cyclo": 11 +} \ No newline at end of file diff --git a/mlc_config.json b/mlc_config.json new file mode 100644 index 0000000000..7b442ec3de --- /dev/null +++ b/mlc_config.json @@ -0,0 +1,5 @@ +{ + "retryOn429": true, + "retryCount": 3, + "fallbackRetryDelay": "20s" +} \ No newline at end of file diff --git a/starport.yml b/starport.yml deleted file mode 100644 index 4d3cd1b0f5..0000000000 --- a/starport.yml +++ /dev/null @@ -1,45 +0,0 @@ -accounts: - - name: alice - coins: ["100000000uatom", "100000000000000000000aphoton"] - - name: bob - coins: ["5000000000000aphoton"] - - name: faucet - coins: ["1000000000000000000000000000aphoton"] -validator: - name: alice - staked: "100000000000000000000aphoton" -faucet: - port: 4500 - name: "faucet" - coins: ["1000000000000000000000000000aphoton"] - coins_max: ["100000000aphoton"] -build: - binary: "ethermintd" -init: - home: "$HOME/.ethermintd" - app: - api: - enable: true - json-rpc: - address: "0.0.0.0:8545" # change the JSON-RPC address and port - ws-address: "0.0.0.0:8546" # change the JSON-RPC websocket address and port -genesis: - chain_id: "ethermint_9000-1" - app_state: - staking: - params: - bond_denom: "aphoton" - mint: - params: - mint_denom: "aphoton" - crisis: - constant_fee: - denom: "aphoton" - gov: - deposit_params: - min_deposit: - - amount: "10000000" - denom: "aphoton" - evm: - params: - evm_denom: "aphoton"