diff --git a/.babelrc b/.babelrc deleted file mode 100644 index 7dd5e9df..00000000 --- a/.babelrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "presets": ["@babel/preset-react"] -} diff --git a/.env.development b/.env.development new file mode 100644 index 00000000..0064bec5 --- /dev/null +++ b/.env.development @@ -0,0 +1,6 @@ +VITE_ENVIRONMENT=local +VITE_ENVIRONMENT_ID=8545 +VITE_NODE=http://127.0.0.1:8545 +VITE_GAS_PRICE=60000000 +VITE_BLOCK_EXPLORER=https://explorer.rsk.co +VITE_URL=http://localhost:3000/ diff --git a/.env.local b/.env.local deleted file mode 100644 index 1394a25c..00000000 --- a/.env.local +++ /dev/null @@ -1,6 +0,0 @@ -REACT_APP_ENVIRONMENT=local -REACT_APP_ENVIRONMENT_ID=8545 -REACT_APP_NODE=http://127.0.0.1:8545 -REACT_APP_GAS_PRICE=60000000 -REACT_APP_BLOCK_EXPLORER=https://explorer.rsk.co -REACT_APP_URL=http://localhost:3000/ diff --git a/.env.production b/.env.production index 2da32eda..36af067b 100644 --- a/.env.production +++ b/.env.production @@ -1,6 +1,6 @@ -REACT_APP_ENVIRONMENT=production -REACT_APP_ENVIRONMENT_ID=30 -REACT_APP_NODE=https://public-node.rsk.co -REACT_APP_GAS_PRICE=60000000 -REACT_APP_BLOCK_EXPLORER=https://explorer.rsk.co -REACT_APP_URL=https://manager.rns.rifos.org/ +VITE_ENVIRONMENT=production +VITE_ENVIRONMENT_ID=30 +VITE_NODE=https://public-node.rsk.co +VITE_GAS_PRICE=60000000 +VITE_BLOCK_EXPLORER=https://explorer.rsk.co +VITE_URL=https://manager.rns.rifos.org/ diff --git a/.env.test b/.env.test new file mode 100644 index 00000000..0609bead --- /dev/null +++ b/.env.test @@ -0,0 +1,6 @@ +VITE_ENVIRONMENT=testing +VITE_ENVIRONMENT_ID=8545 +VITE_NODE=http://127.0.0.1:8545 +VITE_GAS_PRICE=60000000 +VITE_BLOCK_EXPLORER=https://explorer.testnet.rsk.co +VITE_URL=/ diff --git a/.env.testnet b/.env.testnet index e09a9aa7..c0a44f2e 100644 --- a/.env.testnet +++ b/.env.testnet @@ -1,6 +1,6 @@ -REACT_APP_ENVIRONMENT=test -REACT_APP_ENVIRONMENT_ID=31 -REACT_APP_NODE=https://public-node.testnet.rsk.co -REACT_APP_GAS_PRICE=60000000 -REACT_APP_BLOCK_EXPLORER=https://explorer.testnet.rsk.co -REACT_APP_URL=https://testnet.manager.rns.rifos.org/ +VITE_ENVIRONMENT=test +VITE_ENVIRONMENT_ID=31 +VITE_NODE=https://public-node.testnet.rsk.co +VITE_GAS_PRICE=60000000 +VITE_BLOCK_EXPLORER=https://explorer.testnet.rsk.co +VITE_URL=https://testnet.manager.rns.rifos.org/ diff --git a/.eslintrc.js b/.eslintrc.js index 4983b2bc..cb574f91 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -16,7 +16,7 @@ module.exports = { ecmaFeatures: { jsx: true, }, - ecmaVersion: 2018, + ecmaVersion: 2020, sourceType: 'module', }, plugins: [ @@ -26,7 +26,7 @@ module.exports = { rules: { 'react/jsx-filename-extension': [1, { extensions: ['.js', '.jsx'] }], 'react/destructuring-assignment': 'warn', - 'react/require-default-props': 'warn', + 'react/require-default-props': ['warn', { functions: 'defaultArguments' }], 'import/no-cycle': 'off', 'jsx-a11y/label-has-associated-control': 'off', }, diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..3f5cafde --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,46 @@ +version: 2 +updates: + # Maintain dependencies for GitHub Actions + - package-ecosystem: github-actions + directory: / + schedule: + interval: weekly + # Wait at least 10 days after a new version is released before opening a PR + cooldown: + default-days: 5 + # one PR per week that groups BOTH minor + patch updates + groups: + actions-updates: + patterns: + - "*" + update-types: + - minor + - patch + + # Maintain dependencies for npm and yarn + - package-ecosystem: npm + directory: / + schedule: + interval: weekly + # Wait at least 10 days after a new version is released before opening a PR + cooldown: + default-days: 5 + semver-major-days: 30 + semver-minor-days: 7 + semver-patch-days: 3 + # one PR per week that groups BOTH minor + patch updates + groups: + production-dependencies: + dependency-type: "production" + patterns: + - "*" + update-types: + - minor + - patch + development-dependencies: + dependency-type: "development" + patterns: + - "*" + update-types: + - minor + - patch \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 777e449c..bde4f2e8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,12 +12,12 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - name: Use Node.js 20.x - uses: actions/setup-node@v1 + - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + - name: Use Node.js + uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e #v6.4.0 with: - node-version: 20.x - - run: yarn + node-version-file: '.nvmrc' + - run: yarn install --frozen-lockfile - run: npm run ganache & - run: yarn test - run: yarn lint diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 00000000..eeea83db --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,48 @@ +name: "CodeQL" + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + schedule: + - cron: "0 0 * * *" + +# Declare default permissions as read only. +permissions: read-all + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + permissions: + actions: read + contents: read + security-events: write + + strategy: + fail-fast: false + matrix: + language: [javascript] + + steps: + - name: Checkout + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + + - name: Before Index (java) + if: ${{ matrix.language == 'java' }} + run: ./configure.sh + + - name: Initialize CodeQL + uses: github/codeql-action/init@8aad20d150bbac5944a9f9d289da16a4b0d87c1e # v4.36.2 + with: + languages: ${{ matrix.language }} + queries: +security-and-quality + + - name: Autobuild + uses: github/codeql-action/autobuild@8aad20d150bbac5944a9f9d289da16a4b0d87c1e # v4.36.2 + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@8aad20d150bbac5944a9f9d289da16a4b0d87c1e # v4.36.2 + with: + category: "/language:${{ matrix.language }}" \ No newline at end of file diff --git a/.github/workflows/dependency-review.yml b/.github/workflows/dependency-review.yml new file mode 100644 index 00000000..94414cf7 --- /dev/null +++ b/.github/workflows/dependency-review.yml @@ -0,0 +1,29 @@ +# Dependency Review Action +# +# This Action will scan dependency manifest files that change as part of a Pull Request, +# surfacing known-vulnerable versions of the packages declared or updated in the PR. +# Once installed, if the workflow run is marked as required, +# PRs introducing known-vulnerable packages will be blocked from merging. +# +# Source repository: https://github.com/actions/dependency-review-action +name: 'Dependency Review' +on: [pull_request] + +# Declare default permissions as read only. +permissions: read-all + +jobs: + dependency-review: + runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: write + steps: + - name: 'Checkout Repository' + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + + - name: 'Dependency Review' + uses: actions/dependency-review-action@a1d282b36b6f3519aa1f3fc636f609c47dddb294 # v5.0.0 + with: + fail-on-severity: high + comment-summary-in-pr: true \ No newline at end of file diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 79cdd9d5..f79a4b99 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -15,23 +15,23 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - - name: Setup Node 20 - uses: actions/setup-node@v1 + - name: Setup Node + uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e #v6.4.0 with: - node-version: '20' + node-version-file: '.nvmrc' - name: Install dependencies - run: yarn + run: yarn install --frozen-lockfile - name: Build site run: | - export REACT_APP_GIT_HASH=${{ github.sha }} + export VITE_GIT_HASH=${{ github.sha }} yarn build:testnet - name: Configure AWS credentials - uses: aws-actions/configure-aws-credentials@v1 + uses: aws-actions/configure-aws-credentials@254c19bd240aabef8777f48595e9d2d7b972184b #v6.2.1 with: aws-access-key-id: ${{ secrets.TESTNET_AWS_ACCESS_KEY_ID }} aws-secret-access-key: ${{ secrets.TESTNET_AWS_SECRET_ACCESS_KEY }} @@ -55,23 +55,23 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - - name: Setup Node 20 - uses: actions/setup-node@v1 + - name: Setup Node + uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e #v6.4.0 with: - node-version: '20' + node-version-file: '.nvmrc' - name: Install dependencies - run: yarn + run: yarn install --frozen-lockfile - name: Build site run: | - export REACT_APP_GIT_HASH=${{ github.sha }} + export VITE_GIT_HASH=${{ github.sha }} yarn build:mainnet - name: Configure AWS credentials - uses: aws-actions/configure-aws-credentials@v1 + uses: aws-actions/configure-aws-credentials@254c19bd240aabef8777f48595e9d2d7b972184b #v6.2.1 with: aws-access-key-id: ${{ secrets.MAINNET_AWS_ACCESS_KEY_ID }} aws-secret-access-key: ${{ secrets.MAINNET_AWS_SECRET_ACCESS_KEY }} diff --git a/.github/workflows/gh-deploy.yml b/.github/workflows/gh-deploy.yml index c612fe1a..2f790f7a 100644 --- a/.github/workflows/gh-deploy.yml +++ b/.github/workflows/gh-deploy.yml @@ -18,23 +18,23 @@ jobs: steps: - name: Checkout 🛎️ - uses: actions/checkout@v2.3.1 # If you're using actions/checkout@v2 you must set persist-credentials to false in most cases for the deployment to work correctly. + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 # persist-credentials must be false in most cases for the deployment to work correctly. with: persist-credentials: false - - name: Setup Node 20 - uses: actions/setup-node@v1 + - name: Setup Node + uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e #v6.4.0 with: - node-version: '20' + node-version-file: '.nvmrc' - name: Install and Build for Testnet 🔧 # This example project is built using npm and outputs the result to the 'build' folder. Replace with the commands required to build your project, or remove this step entirely if your site is pre-built. run: | - yarn install --network-timeout 100000 || yarn install --network-timeout 100000 || yarn install --network-timeout 100000 - export REACT_APP_GIT_HASH=${{ github.sha }} + yarn install --frozen-lockfile --network-timeout 100000 || yarn install --frozen-lockfile --network-timeout 100000 || yarn install --frozen-lockfile --network-timeout 100000 + export VITE_GIT_HASH=${{ github.sha }} yarn build:ghpages - name: Deploy 🚀 - uses: JamesIves/github-pages-deploy-action@v4.6.8 + uses: JamesIves/github-pages-deploy-action@d92aa235d04922e8f08b40ce78cc5442fcfbfa2f #v4.8.0 with: BRANCH: gh-pages # The branch the action should deploy to. FOLDER: build # The folder the action should deploy. diff --git a/.github/workflows/qa-deploy.yml b/.github/workflows/qa-deploy.yml index 84d64bcf..c377515f 100644 --- a/.github/workflows/qa-deploy.yml +++ b/.github/workflows/qa-deploy.yml @@ -11,23 +11,23 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - - name: Setup Node 20 - uses: actions/setup-node@v1 + - name: Setup Node + uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e #v6.4.0 with: - node-version: '20' + node-version-file: '.nvmrc' - name: Install dependencies - run: yarn + run: yarn install --frozen-lockfile - name: Build site run: | - export REACT_APP_GIT_HASH=${{ github.sha }} + export VITE_GIT_HASH=${{ github.sha }} yarn build:mainnet - name: Configure AWS credentials - uses: aws-actions/configure-aws-credentials@v1 + uses: aws-actions/configure-aws-credentials@254c19bd240aabef8777f48595e9d2d7b972184b #v6.2.1 with: aws-access-key-id: ${{ secrets.QA_AWS_ACCESS_KEY_ID }} aws-secret-access-key: ${{ secrets.QA_AWS_SECRET_ACCESS_KEY }} diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 00000000..209e3ef4 --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +20 diff --git a/README.md b/README.md index 553984af..d6875938 100755 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ Requisites: -- [Node v12](https://nodejs.org/en/) +- [Node v20](https://nodejs.org/en/) (see `.nvmrc`) - [yarn](https://yarnpkg.com/) Install dependencies: diff --git a/babel.config.js b/babel.config.js deleted file mode 100644 index a959a259..00000000 --- a/babel.config.js +++ /dev/null @@ -1,13 +0,0 @@ -module.exports = { - presets: [ - ['@babel/preset-react', { targets: { node: 'current' } }], - [ - '@babel/preset-env', - { - targets: { - node: 'current', - }, - }, - ], - ], -}; diff --git a/public/index.html b/index.html old mode 100755 new mode 100644 similarity index 96% rename from public/index.html rename to index.html index 2cb9b23c..c913d441 --- a/public/index.html +++ b/index.html @@ -20,12 +20,12 @@ -