diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 000000000..ad53a8e49 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,26 @@ +# Use the latest 2.1 version of CircleCI pipeline process engine. +# See: https://circleci.com/docs/configuration-reference + +version: 2.1 +executors: + my-custom-executor: + docker: + - image: cimg/base:stable + auth: + # ensure you have first added these secrets + # visit app.circleci.com/settings/project/github/Dargon789/foundry/environment-variables + username: $DOCKER_HUB_USER + password: $DOCKER_HUB_PASSWORD +jobs: + web3-defi-game-project-: + + executor: my-custom-executor + steps: + - checkout + - run: | + # echo Hello, World! + +workflows: + my-custom-workflow: + jobs: + - web3-defi-game-project- diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 000000000..dd84ea782 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,38 @@ +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: '' +assignees: '' + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Desktop (please complete the following information):** + - OS: [e.g. iOS] + - Browser [e.g. chrome, safari] + - Version [e.g. 22] + +**Smartphone (please complete the following information):** + - Device: [e.g. iPhone6] + - OS: [e.g. iOS8.1] + - Browser [e.g. stock browser, safari] + - Version [e.g. 22] + +**Additional context** +Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/custom.md b/.github/ISSUE_TEMPLATE/custom.md new file mode 100644 index 000000000..48d5f81fa --- /dev/null +++ b/.github/ISSUE_TEMPLATE/custom.md @@ -0,0 +1,10 @@ +--- +name: Custom issue template +about: Describe this issue template's purpose here. +title: '' +labels: '' +assignees: '' + +--- + + diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 000000000..bbcbbe7d6 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,20 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: '' +labels: '' +assignees: '' + +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. diff --git a/.github/workflows/check-pr-title.yaml b/.github/workflows/check-pr-title.yaml index 229106ab6..384eff268 100644 --- a/.github/workflows/check-pr-title.yaml +++ b/.github/workflows/check-pr-title.yaml @@ -33,3 +33,4 @@ jobs: - uses: amannn/action-semantic-pull-request@db6e259b93f286e3416eef27aaae88935d16cf2e # v3.4.0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + diff --git a/.github/workflows/claude-pr-metadata-update.yml b/.github/workflows/claude-pr-metadata-update.yml index 59508c5d0..ec2475562 100644 --- a/.github/workflows/claude-pr-metadata-update.yml +++ b/.github/workflows/claude-pr-metadata-update.yml @@ -17,12 +17,14 @@ on: pull_request: types: [opened, synchronize, ready_for_review] +permissions: + contents: read + # Concurrency: Cancel in-flight runs for the same PR concurrency: group: pr-metadata-${{ github.event.pull_request.number }} cancel-in-progress: true -permissions: {} jobs: generate-pr-metadata: diff --git a/.github/workflows/google.yml b/.github/workflows/google.yml new file mode 100644 index 000000000..0b5c7d12f --- /dev/null +++ b/.github/workflows/google.yml @@ -0,0 +1,116 @@ +# This workflow will build a docker container, publish it to Google Container +# Registry, and deploy it to GKE when there is a push to the "main" +# branch. +# +# To configure this workflow: +# +# 1. Enable the following Google Cloud APIs: +# +# - Artifact Registry (artifactregistry.googleapis.com) +# - Google Kubernetes Engine (container.googleapis.com) +# - IAM Credentials API (iamcredentials.googleapis.com) +# +# You can learn more about enabling APIs at +# https://support.google.com/googleapi/answer/6158841. +# +# 2. Ensure that your repository contains the necessary configuration for your +# Google Kubernetes Engine cluster, including deployment.yml, +# kustomization.yml, service.yml, etc. +# +# 3. Create and configure a Workload Identity Provider for GitHub: +# https://github.com/google-github-actions/auth#preferred-direct-workload-identity-federation. +# +# Depending on how you authenticate, you will need to grant an IAM principal +# permissions on Google Cloud: +# +# - Artifact Registry Administrator (roles/artifactregistry.admin) +# - Kubernetes Engine Developer (roles/container.developer) +# +# You can learn more about setting IAM permissions at +# https://cloud.google.com/iam/docs/manage-access-other-resources +# +# 5. Change the values in the "env" block to match your values. + +name: 'Build and Deploy to GKE' + +on: + push: + branches: + - '"main"' + +env: + PROJECT_ID: 'my-project' # TODO: update to your Google Cloud project ID + GAR_LOCATION: 'us-central1' # TODO: update to your region + GKE_CLUSTER: 'cluster-1' # TODO: update to your cluster name + GKE_ZONE: 'us-central1-c' # TODO: update to your cluster zone + DEPLOYMENT_NAME: 'gke-test' # TODO: update to your deployment name + REPOSITORY: 'samples' # TODO: update to your Artifact Registry docker repository name + IMAGE: 'static-site' + WORKLOAD_IDENTITY_PROVIDER: 'projects/123456789/locations/global/workloadIdentityPools/my-pool/providers/my-provider' # TODO: update to your workload identity provider + +jobs: + setup-build-publish-deploy: + name: 'Setup, Build, Publish, and Deploy' + runs-on: 'ubuntu-latest' + environment: 'production' + + permissions: + contents: 'read' + id-token: 'write' + + steps: + - name: 'Checkout' + uses: 'actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332' # actions/checkout@v4 + + # Configure Workload Identity Federation and generate an access token. + # + # See https://github.com/google-github-actions/auth for more options, + # including authenticating via a JSON credentials file. + - id: 'auth' + name: 'Authenticate to Google Cloud' + uses: 'google-github-actions/auth@f112390a2df9932162083945e46d439060d66ec2' # google-github-actions/auth@v2 + with: + workload_identity_provider: '${{ env.WORKLOAD_IDENTITY_PROVIDER }}' + + # Authenticate Docker to Google Cloud Artifact Registry + - name: 'Docker Auth' + uses: 'docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567' # docker/login-action@v3 + with: + username: 'oauth2accesstoken' + password: '${{ steps.auth.outputs.auth_token }}' + registry: '${{ env.GAR_LOCATION }}-docker.pkg.dev' + + # Get the GKE credentials so we can deploy to the cluster + - name: 'Set up GKE credentials' + uses: 'google-github-actions/get-gke-credentials@6051de21ad50fbb1767bc93c11357a49082ad116' # google-github-actions/get-gke-credentials@v2 + with: + cluster_name: '${{ env.GKE_CLUSTER }}' + location: '${{ env.GKE_ZONE }}' + + # Build the Docker image + - name: 'Build and push Docker container' + run: |- + DOCKER_TAG="${GAR_LOCATION}-docker.pkg.dev/${PROJECT_ID}/${REPOSITORY}/${IMAGE}:${GITHUB_SHA}" + + docker build \ + --tag "${DOCKER_TAG}" \ + --build-arg GITHUB_SHA="${GITHUB_SHA}" \ + --build-arg GITHUB_REF="${GITHUB_REF}" \ + . + + docker push "${DOCKER_TAG}" + + # Set up kustomize + - name: 'Set up Kustomize' + run: |- + curl -sfLo kustomize https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize%2Fv5.4.3/kustomize_v5.4.3_linux_amd64.tar.gz + chmod u+x ./kustomize + + # Deploy the Docker image to the GKE cluster + - name: 'Deploy to GKE' + run: |- + # replacing the image name in the k8s template + ./kustomize edit set image LOCATION-docker.pkg.dev/PROJECT_ID/REPOSITORY/IMAGE:TAG=$GAR_LOCATION-docker.pkg.dev/$PROJECT_ID/$REPOSITORY/$IMAGE:$GITHUB_SHA + ./kustomize build . | kubectl apply -f - + kubectl rollout status deployment/$DEPLOYMENT_NAME + kubectl get services -o wide diff --git a/.github/workflows/jekyll-gh-pages.yml b/.github/workflows/jekyll-gh-pages.yml new file mode 100644 index 000000000..e31d81c58 --- /dev/null +++ b/.github/workflows/jekyll-gh-pages.yml @@ -0,0 +1,51 @@ +# Sample workflow for building and deploying a Jekyll site to GitHub Pages +name: Deploy Jekyll with GitHub Pages dependencies preinstalled + +on: + # Runs on pushes targeting the default branch + push: + branches: ["main"] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + +# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. +# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. +concurrency: + group: "pages" + cancel-in-progress: false + +jobs: + # Build job + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Setup Pages + uses: actions/configure-pages@v5 + - name: Build with Jekyll + uses: actions/jekyll-build-pages@v1 + with: + source: ./ + destination: ./_site + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + + # Deployment job + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/.vscode/settings.json b/.vscode/settings.json index 26f4214be..4e8c176cc 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -15,5 +15,8 @@ "./sdks/v3-sdk", ], "testing.openTesting": "neverOpen", - "testing.automaticallyOpenTestResults": "neverOpen" + "testing.automaticallyOpenTestResults": "neverOpen", + "githubPullRequests.ignoredPullRequestBranches": [ + "main" + ] } diff --git a/README.md b/README.md index b6cc703d2..c3951aef9 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,10 @@ A repository for many Uniswap SDK's. All SDK's can be found in `sdk/` and have more information in their individual README's. +## Web Analytics + +This repository has Vercel Web Analytics configured and ready for integration. See [`docs/VERCEL_ANALYTICS.md`](docs/VERCEL_ANALYTICS.md) for integration instructions when adding web applications to this monorepo. + ## Development Commands ```markdown diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 000000000..034e84803 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,21 @@ +# Security Policy + +## Supported Versions + +Use this section to tell people about which versions of your project are +currently being supported with security updates. + +| Version | Supported | +| ------- | ------------------ | +| 5.1.x | :white_check_mark: | +| 5.0.x | :x: | +| 4.0.x | :white_check_mark: | +| < 4.0 | :x: | + +## Reporting a Vulnerability + +Use this section to tell people how to report a vulnerability. + +Tell them where to go, how often they can expect to get an update on a +reported vulnerability, what to expect if the vulnerability is accepted or +declined, etc. diff --git a/bun.lock b/bun.lock index 68f6de3c8..41f9a8567 100644 --- a/bun.lock +++ b/bun.lock @@ -8,6 +8,7 @@ "@babel/runtime": "7.18.9", "@changesets/cli": "2.30.0", "@typescript-eslint/eslint-plugin": "^8.38.0", + "@vercel/analytics": "^2.0.1", "check-dependency-version-consistency": "^4.1.0", "danger": "11.2.6", "eslint": "^8.57.0", @@ -52,15 +53,10 @@ "ethers": "^5.7.0", "tiny-invariant": "^1.1.0", }, - "devDependencies": { - "prettier": "^2.4.1", - "tslib": "^2.3.0", - "typescript": "^4.3.3", - }, }, "sdks/router-sdk": { "name": "@uniswap/router-sdk", - "version": "2.7.2", + "version": "2.10.4", "dependencies": { "@ethersproject/abi": "^5.5.0", "@ethersproject/solidity": "^5.0.9", @@ -86,7 +82,7 @@ }, "sdks/sdk-core": { "name": "@uniswap/sdk-core", - "version": "7.12.2", + "version": "7.17.0", "dependencies": { "@ethersproject/address": "^5.0.2", "@ethersproject/bignumber": "^5.5.0", @@ -116,7 +112,7 @@ }, "sdks/smart-wallet-sdk": { "name": "@uniswap/smart-wallet-sdk", - "version": "2.5.1", + "version": "2.6.4", "dependencies": { "@uniswap/sdk-core": "workspace:~", "viem": "^2.23.5", @@ -155,7 +151,7 @@ }, "sdks/uniswapx-sdk": { "name": "@uniswap/uniswapx-sdk", - "version": "3.0.1", + "version": "3.0.7", "dependencies": { "@ethersproject/abi": "^5.5.0", "@ethersproject/bytes": "^5.7.0", @@ -195,11 +191,11 @@ "@typechain/hardhat": "^6.1.2", "@uniswap/sdk-core": "workspace:*", "dotenv": "^16.0.3", - "ethers": "^5.7.0", + "ethers": "^6.0.0", "typechain": "^8.1.0", }, "devDependencies": { - "@nomicfoundation/hardhat-chai-matchers": "1.0.6", + "@nomicfoundation/hardhat-chai-matchers": "2.0.1", "@nomicfoundation/hardhat-network-helpers": "^1.0.10", "@nomiclabs/hardhat-ethers": "^2.2.3", "@types/chai": "^4.3.3", @@ -213,7 +209,7 @@ }, "sdks/universal-router-sdk": { "name": "@uniswap/universal-router-sdk", - "version": "4.34.1", + "version": "5.6.0", "dependencies": { "@ethersproject/abi": "^5.5.0", "@ethersproject/abstract-signer": "^5.7.0", @@ -250,7 +246,7 @@ }, "sdks/v2-sdk": { "name": "@uniswap/v2-sdk", - "version": "4.19.2", + "version": "4.20.4", "dependencies": { "@ethersproject/address": "^5.0.2", "@ethersproject/bignumber": "^5.5.0", @@ -278,7 +274,7 @@ }, "sdks/v3-sdk": { "name": "@uniswap/v3-sdk", - "version": "3.29.2", + "version": "3.30.4", "dependencies": { "@ethersproject/abi": "^5.5.0", "@ethersproject/abstract-signer": "^5.7.0", @@ -310,7 +306,7 @@ }, "sdks/v4-sdk": { "name": "@uniswap/v4-sdk", - "version": "1.29.2", + "version": "2.2.2", "dependencies": { "@ethersproject/abi": "^5.5.0", "@ethersproject/abstract-signer": "^5.7.0", @@ -350,7 +346,7 @@ "eslint-config-prettier": "^9.1.0", }, "packages": { - "@adraffy/ens-normalize": ["@adraffy/ens-normalize@1.11.1", "", {}, "sha512-nhCBV3quEgesuf7c7KYfperqSS14T8bYuvJ8PcLJp6znkZpFc0AuW4qBtr8eKVyPPe/8RSr7sglCWPU5eaxwKQ=="], + "@adraffy/ens-normalize": ["@adraffy/ens-normalize@1.10.1", "", {}, "sha512-96Z2IP3mYmF1Xg2cDm8f1gWGf/HUVedQ3FMifV4kG/PQ4yEP51xDtRAEfhVNt5f/uzpNkZHwWQuUcu6D6K+Ekw=="], "@babel/code-frame": ["@babel/code-frame@7.29.0", "", { "dependencies": { "@babel/helper-validator-identifier": "^7.28.5", "js-tokens": "^4.0.0", "picocolors": "^1.1.1" } }, "sha512-9NhCeYjq9+3uxgdtp20LSiJXJvN0FeCtNGpJxuMFZ1Kv3cWUNb6DOhJwUvcVCzKGR66cw4njwM6hrJLqgOwbcw=="], @@ -752,7 +748,9 @@ "@nomicfoundation/edr-win32-x64-msvc": ["@nomicfoundation/edr-win32-x64-msvc@0.12.0-next.23", "", {}, "sha512-IfJZQJn7d/YyqhmguBIGoCKjE9dKjbu6V6iNEPApfwf5JyyjHYyyfkLU4rf7hygj57bfH4sl1jtQ6r8HnT62lw=="], - "@nomicfoundation/hardhat-chai-matchers": ["@nomicfoundation/hardhat-chai-matchers@1.0.6", "", { "dependencies": { "@ethersproject/abi": "^5.1.2", "@types/chai-as-promised": "^7.1.3", "chai-as-promised": "^7.1.1", "deep-eql": "^4.0.1", "ordinal": "^1.0.3" }, "peerDependencies": { "@nomiclabs/hardhat-ethers": "^2.0.0", "chai": "^4.2.0", "ethers": "^5.0.0", "hardhat": "^2.9.4" } }, "sha512-f5ZMNmabZeZegEfuxn/0kW+mm7+yV7VNDxLpMOMGXWFJ2l/Ct3QShujzDRF9cOkK9Ui/hbDeOWGZqyQALDXVCQ=="], + "@nomicfoundation/hardhat-chai-matchers": ["@nomicfoundation/hardhat-chai-matchers@2.0.1", "", { "dependencies": { "@types/chai-as-promised": "^7.1.3", "chai-as-promised": "^7.1.1", "deep-eql": "^4.0.1", "ordinal": "^1.0.3" }, "peerDependencies": { "@nomicfoundation/hardhat-ethers": "^3.0.0", "chai": "^4.2.0", "ethers": "^6.1.0", "hardhat": "^2.9.4" } }, "sha512-qWKndseO8IPt8HiVamgEAutcBOYtX7/O6NPfe7uMNWxY2ywWaiWjDcRFuYYqxrZOMyQZl6ZuiHxbaRNctTUgLw=="], + + "@nomicfoundation/hardhat-ethers": ["@nomicfoundation/hardhat-ethers@3.1.3", "", { "dependencies": { "debug": "^4.1.1", "lodash.isequal": "^4.5.0" }, "peerDependencies": { "ethers": "^6.14.0", "hardhat": "^2.28.0" } }, "sha512-208JcDeVIl+7Wu3MhFUUtiA8TJ7r2Rn3Wr+lSx9PfsDTKkbsAsWPY6N6wQ4mtzDv0/pB9nIbJhkjoHe1EsgNsA=="], "@nomicfoundation/hardhat-network-helpers": ["@nomicfoundation/hardhat-network-helpers@1.1.2", "", { "dependencies": { "ethereumjs-util": "^7.1.4" }, "peerDependencies": { "hardhat": "^2.26.0" } }, "sha512-p7HaUVDbLj7ikFivQVNhnfMHUBgiHYMwQWvGn9AriieuopGOELIrwj2KjyM2a6z70zai5YKO264Vwz+3UFJZPQ=="], @@ -940,6 +938,8 @@ "@uniswap/v4-sdk": ["@uniswap/v4-sdk@workspace:sdks/v4-sdk"], + "@vercel/analytics": ["@vercel/analytics@2.0.1", "", { "peerDependencies": { "@remix-run/react": "^2", "@sveltejs/kit": "^1 || ^2", "next": ">= 13", "nuxt": ">= 3", "react": "^18 || ^19 || ^19.0.0-rc", "svelte": ">= 4", "vue": "^3", "vue-router": "^4" }, "optionalPeers": ["@remix-run/react", "@sveltejs/kit", "next", "nuxt", "react", "svelte", "vue", "vue-router"] }, "sha512-MTQG6V9qQrt1tsDeF+2Uoo5aPjqbVPys1xvnIftXSJYG2SrwXRHnqEvVoYID7BTruDz4lCd2Z7rM1BdkUehk2g=="], + "JSONStream": ["JSONStream@1.3.5", "", { "dependencies": { "jsonparse": "^1.2.0", "through": ">=2.2.7 <3" }, "bin": { "JSONStream": "./bin.js" } }, "sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ=="], "abitype": ["abitype@1.2.3", "", { "peerDependencies": { "typescript": ">=5.0.4", "zod": "^3.22.0 || ^4.0.0" }, "optionalPeers": ["typescript", "zod"] }, "sha512-Ofer5QUnuUdTFsBRwARMoWKOH1ND5ehwYhJ3OJ/BQO+StkwQjHw0XyVh4vDttzHB7QOFhPHa/o413PJ82gU/Tg=="], @@ -954,7 +954,7 @@ "adm-zip": ["adm-zip@0.4.16", "", {}, "sha512-TFi4HBKSGfIKsK5YCkKaaFG2m4PEDyViZmEwof3MTIgzimHLto6muaHVpbrljdIvIrFZzEq/p4nafOeLcYegrg=="], - "aes-js": ["aes-js@3.0.0", "", {}, "sha512-H7wUZRn8WpTq9jocdxQ2c8x2sKo9ZVmzfRE13GiNJXfp7NcKYEdvl3vspKjXox6RIG2VtaRe4JFvxG4rqp2Zuw=="], + "aes-js": ["aes-js@4.0.0-beta.5", "", {}, "sha512-G965FqalsNyrPqgEGON7nIx1e/OVENSgiEIzyC63haUMuvNnwIgIjMs52hlTCKhkBny7A2ORNlfY9Zu+jmGk1Q=="], "agent-base": ["agent-base@6.0.2", "", { "dependencies": { "debug": "4" } }, "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ=="], @@ -1730,6 +1730,8 @@ "lodash.isboolean": ["lodash.isboolean@3.0.3", "", {}, "sha512-Bz5mupy2SVbPHURB98VAcw+aHh4vRV5IPNhILUCsOzRmsTmSQ17jIuqopAentWoehktxGd9e/hbIXq980/1QJg=="], + "lodash.isequal": ["lodash.isequal@4.5.0", "", {}, "sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ=="], + "lodash.isinteger": ["lodash.isinteger@4.0.4", "", {}, "sha512-DBwtEWN2caHQ9/imiNeEA5ys1JoRtRfY3d7V9wkqtbycnAmTvRRmbHKDV4a0EYc678/dia0jrte4tjYwVBaZUA=="], "lodash.isnumber": ["lodash.isnumber@3.0.3", "", {}, "sha512-QYqzpfwO3/CWf3XP+Z+tkQsfaLL/EnUlXWVkIk5FUPc4sBdTehEqZONuyRt2P67PXAk+NXmTBcc97zw9t1FQrw=="], @@ -2420,6 +2422,8 @@ "@ethersproject/json-wallets/@ethersproject/strings": ["@ethersproject/strings@5.8.0", "", { "dependencies": { "@ethersproject/bytes": "^5.8.0", "@ethersproject/constants": "^5.8.0", "@ethersproject/logger": "^5.8.0" } }, "sha512-qWEAk0MAvl0LszjdfnZ2uC8xbR2wdv4cDabyHiBh3Cldq/T8dPH3V4BbBsAYJUeonwD+8afVXld274Ls+Y1xXg=="], + "@ethersproject/json-wallets/aes-js": ["aes-js@3.0.0", "", {}, "sha512-H7wUZRn8WpTq9jocdxQ2c8x2sKo9ZVmzfRE13GiNJXfp7NcKYEdvl3vspKjXox6RIG2VtaRe4JFvxG4rqp2Zuw=="], + "@ethersproject/providers/@ethersproject/strings": ["@ethersproject/strings@5.8.0", "", { "dependencies": { "@ethersproject/bytes": "^5.8.0", "@ethersproject/constants": "^5.8.0", "@ethersproject/logger": "^5.8.0" } }, "sha512-qWEAk0MAvl0LszjdfnZ2uC8xbR2wdv4cDabyHiBh3Cldq/T8dPH3V4BbBsAYJUeonwD+8afVXld274Ls+Y1xXg=="], "@ethersproject/providers/ws": ["ws@8.18.0", "", { "peerDependencies": { "bufferutil": "^4.0.1", "utf-8-validate": ">=5.0.2" }, "optionalPeers": ["bufferutil", "utf-8-validate"] }, "sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw=="], @@ -2462,6 +2466,10 @@ "@nicolo-ribaudo/eslint-scope-5-internals/eslint-scope": ["eslint-scope@5.1.1", "", { "dependencies": { "esrecurse": "^4.3.0", "estraverse": "^4.1.1" } }, "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw=="], + "@nomicfoundation/hardhat-chai-matchers/ethers": ["ethers@6.16.0", "", { "dependencies": { "@adraffy/ens-normalize": "1.10.1", "@noble/curves": "1.2.0", "@noble/hashes": "1.3.2", "@types/node": "22.7.5", "aes-js": "4.0.0-beta.5", "tslib": "2.7.0", "ws": "8.17.1" } }, "sha512-U1wulmetNymijEhpSEQ7Ct/P/Jw9/e7R1j5XIbPRydgV2DjLVMsULDlNksq3RQnFgKoLlZf88ijYtWEXcPa07A=="], + + "@nomicfoundation/hardhat-ethers/ethers": ["ethers@6.16.0", "", { "dependencies": { "@adraffy/ens-normalize": "1.10.1", "@noble/curves": "1.2.0", "@noble/hashes": "1.3.2", "@types/node": "22.7.5", "aes-js": "4.0.0-beta.5", "tslib": "2.7.0", "ws": "8.17.1" } }, "sha512-U1wulmetNymijEhpSEQ7Ct/P/Jw9/e7R1j5XIbPRydgV2DjLVMsULDlNksq3RQnFgKoLlZf88ijYtWEXcPa07A=="], + "@octokit/endpoint/is-plain-object": ["is-plain-object@5.0.0", "", {}, "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q=="], "@octokit/request/is-plain-object": ["is-plain-object@5.0.0", "", {}, "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q=="], @@ -2492,8 +2500,6 @@ "@typescript-eslint/visitor-keys/eslint-visitor-keys": ["eslint-visitor-keys@5.0.1", "", {}, "sha512-tD40eHxA35h0PEIZNeIjkHoDR4YjjJp34biM0mDvplBe//mB+IHCqHDGV7pxF+7MklTvighcCPPZC7ynWyjdTA=="], - "@uniswap/permit2-sdk/typescript": ["typescript@4.9.5", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g=="], - "@uniswap/router-sdk/@typescript-eslint/parser": ["@typescript-eslint/parser@5.62.0", "", { "dependencies": { "@typescript-eslint/scope-manager": "5.62.0", "@typescript-eslint/types": "5.62.0", "@typescript-eslint/typescript-estree": "5.62.0", "debug": "^4.3.4" }, "peerDependencies": { "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" } }, "sha512-VlJEV0fOQ7BExOsHYAGrgbEiZoi8D+Bl2+f6V2RrXerRSylnp+ZBHmPvaIa8cz0Ajx7WO7Z5RqfgYg7ED1nRhA=="], "@uniswap/router-sdk/typescript": ["typescript@4.9.5", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g=="], @@ -2688,6 +2694,8 @@ "npm-run-all/cross-spawn": ["cross-spawn@6.0.6", "", { "dependencies": { "nice-try": "^1.0.4", "path-key": "^2.0.1", "semver": "^5.5.0", "shebang-command": "^1.2.0", "which": "^1.2.9" } }, "sha512-VqCUuhcd1iB+dsv8gxPttb5iZh/D0iubSP21g36KXdEuf6I5JiioesUVjpCdHV9MZRUfVFlvwtIUyPfxo5trtw=="], + "ox/@adraffy/ens-normalize": ["@adraffy/ens-normalize@1.11.1", "", {}, "sha512-nhCBV3quEgesuf7c7KYfperqSS14T8bYuvJ8PcLJp6znkZpFc0AuW4qBtr8eKVyPPe/8RSr7sglCWPU5eaxwKQ=="], + "p-filter/p-map": ["p-map@2.1.0", "", {}, "sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw=="], "p-locate/p-limit": ["p-limit@3.1.0", "", { "dependencies": { "yocto-queue": "^0.1.0" } }, "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ=="], @@ -2756,6 +2764,8 @@ "typedoc/glob": ["glob@7.1.7", "", { "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", "minimatch": "^3.0.4", "once": "^1.3.0", "path-is-absolute": "^1.0.0" } }, "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ=="], + "uniswapx-integration/ethers": ["ethers@6.16.0", "", { "dependencies": { "@adraffy/ens-normalize": "1.10.1", "@noble/curves": "1.2.0", "@noble/hashes": "1.3.2", "@types/node": "22.7.5", "aes-js": "4.0.0-beta.5", "tslib": "2.7.0", "ws": "8.17.1" } }, "sha512-U1wulmetNymijEhpSEQ7Ct/P/Jw9/e7R1j5XIbPRydgV2DjLVMsULDlNksq3RQnFgKoLlZf88ijYtWEXcPa07A=="], + "uri-js/punycode": ["punycode@2.3.1", "", {}, "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg=="], "util/inherits": ["inherits@2.0.3", "", {}, "sha512-x00IRNXNy63jwGkJmzPigoySHbaqpNuzKbBOmzK+g2OdZpQ9w+sxCN+VSB3ja7IAge2OP2qpfxTjeNcyjmW1uw=="], @@ -2786,6 +2796,26 @@ "@nicolo-ribaudo/eslint-scope-5-internals/eslint-scope/estraverse": ["estraverse@4.3.0", "", {}, "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw=="], + "@nomicfoundation/hardhat-chai-matchers/ethers/@noble/curves": ["@noble/curves@1.2.0", "", { "dependencies": { "@noble/hashes": "1.3.2" } }, "sha512-oYclrNgRaM9SsBUBVbb8M6DTV7ZHRTKugureoYEncY5c65HOmRzvSiTE3y5CYaPYJA/GVkrhXEoF0M3Ya9PMnw=="], + + "@nomicfoundation/hardhat-chai-matchers/ethers/@noble/hashes": ["@noble/hashes@1.3.2", "", {}, "sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ=="], + + "@nomicfoundation/hardhat-chai-matchers/ethers/@types/node": ["@types/node@22.7.5", "", { "dependencies": { "undici-types": "~6.19.2" } }, "sha512-jML7s2NAzMWc//QSJ1a3prpk78cOPchGvXJsC3C6R6PSMoooztvRVQEz89gmBTBY1SPMaqo5teB4uNHPdetShQ=="], + + "@nomicfoundation/hardhat-chai-matchers/ethers/tslib": ["tslib@2.7.0", "", {}, "sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA=="], + + "@nomicfoundation/hardhat-chai-matchers/ethers/ws": ["ws@8.17.1", "", { "peerDependencies": { "bufferutil": "^4.0.1", "utf-8-validate": ">=5.0.2" }, "optionalPeers": ["bufferutil", "utf-8-validate"] }, "sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ=="], + + "@nomicfoundation/hardhat-ethers/ethers/@noble/curves": ["@noble/curves@1.2.0", "", { "dependencies": { "@noble/hashes": "1.3.2" } }, "sha512-oYclrNgRaM9SsBUBVbb8M6DTV7ZHRTKugureoYEncY5c65HOmRzvSiTE3y5CYaPYJA/GVkrhXEoF0M3Ya9PMnw=="], + + "@nomicfoundation/hardhat-ethers/ethers/@noble/hashes": ["@noble/hashes@1.3.2", "", {}, "sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ=="], + + "@nomicfoundation/hardhat-ethers/ethers/@types/node": ["@types/node@22.7.5", "", { "dependencies": { "undici-types": "~6.19.2" } }, "sha512-jML7s2NAzMWc//QSJ1a3prpk78cOPchGvXJsC3C6R6PSMoooztvRVQEz89gmBTBY1SPMaqo5teB4uNHPdetShQ=="], + + "@nomicfoundation/hardhat-ethers/ethers/tslib": ["tslib@2.7.0", "", {}, "sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA=="], + + "@nomicfoundation/hardhat-ethers/ethers/ws": ["ws@8.17.1", "", { "peerDependencies": { "bufferutil": "^4.0.1", "utf-8-validate": ">=5.0.2" }, "optionalPeers": ["bufferutil", "utf-8-validate"] }, "sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ=="], + "@typechain/hardhat/fs-extra/jsonfile": ["jsonfile@6.2.0", "", { "dependencies": { "universalify": "^2.0.0" }, "optionalDependencies": { "graceful-fs": "^4.1.6" } }, "sha512-FGuPw30AdOIUTRMC2OMRtQV+jkVj2cfPqSeWXv1NEAJ1qZ5zb1X6z1mFhbfOB/iy3ssJCD+3KuZ8r8C3uVFlAg=="], "@typechain/hardhat/fs-extra/universalify": ["universalify@2.0.1", "", {}, "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw=="], @@ -2918,6 +2948,16 @@ "ts-command-line-args/chalk/supports-color": ["supports-color@7.2.0", "", { "dependencies": { "has-flag": "^4.0.0" } }, "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw=="], + "uniswapx-integration/ethers/@noble/curves": ["@noble/curves@1.2.0", "", { "dependencies": { "@noble/hashes": "1.3.2" } }, "sha512-oYclrNgRaM9SsBUBVbb8M6DTV7ZHRTKugureoYEncY5c65HOmRzvSiTE3y5CYaPYJA/GVkrhXEoF0M3Ya9PMnw=="], + + "uniswapx-integration/ethers/@noble/hashes": ["@noble/hashes@1.3.2", "", {}, "sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ=="], + + "uniswapx-integration/ethers/@types/node": ["@types/node@22.7.5", "", { "dependencies": { "undici-types": "~6.19.2" } }, "sha512-jML7s2NAzMWc//QSJ1a3prpk78cOPchGvXJsC3C6R6PSMoooztvRVQEz89gmBTBY1SPMaqo5teB4uNHPdetShQ=="], + + "uniswapx-integration/ethers/tslib": ["tslib@2.7.0", "", {}, "sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA=="], + + "uniswapx-integration/ethers/ws": ["ws@8.17.1", "", { "peerDependencies": { "bufferutil": "^4.0.1", "utf-8-validate": ">=5.0.2" }, "optionalPeers": ["bufferutil", "utf-8-validate"] }, "sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ=="], + "wrap-ansi/ansi-styles/color-convert": ["color-convert@2.0.1", "", { "dependencies": { "color-name": "~1.1.4" } }, "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ=="], "@ethereumjs/util/ethereum-cryptography/@scure/bip32/@scure/base": ["@scure/base@1.1.9", "", {}, "sha512-8YKhl8GHiNI/pU2VMaofa2Tor7PJRAjwQLBBuilkJ9L5+13yVbC7JO/wS7piioAvPSwR3JKM1IJ/u4xQzbcXKg=="], @@ -2926,6 +2966,10 @@ "@manypkg/find-root/find-up/locate-path/p-locate": ["p-locate@4.1.0", "", { "dependencies": { "p-limit": "^2.2.0" } }, "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A=="], + "@nomicfoundation/hardhat-chai-matchers/ethers/@types/node/undici-types": ["undici-types@6.19.8", "", {}, "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw=="], + + "@nomicfoundation/hardhat-ethers/ethers/@types/node/undici-types": ["undici-types@6.19.8", "", {}, "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw=="], + "@typescript-eslint/experimental-utils/@typescript-eslint/scope-manager/@typescript-eslint/visitor-keys/eslint-visitor-keys": ["eslint-visitor-keys@2.1.0", "", {}, "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw=="], "@typescript-eslint/experimental-utils/@typescript-eslint/typescript-estree/@typescript-eslint/visitor-keys/eslint-visitor-keys": ["eslint-visitor-keys@2.1.0", "", {}, "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw=="], @@ -3024,6 +3068,8 @@ "ts-command-line-args/chalk/supports-color/has-flag": ["has-flag@4.0.0", "", {}, "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ=="], + "uniswapx-integration/ethers/@types/node/undici-types": ["undici-types@6.19.8", "", {}, "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw=="], + "wrap-ansi/ansi-styles/color-convert/color-name": ["color-name@1.1.4", "", {}, "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="], "@uniswap/router-sdk/@typescript-eslint/parser/@typescript-eslint/typescript-estree/globby/ignore": ["ignore@5.3.2", "", {}, "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g=="], diff --git a/docs/VERCEL_ANALYTICS.md b/docs/VERCEL_ANALYTICS.md new file mode 100644 index 000000000..1fe5dce02 --- /dev/null +++ b/docs/VERCEL_ANALYTICS.md @@ -0,0 +1,112 @@ +# Vercel Web Analytics Integration + +This repository has `@vercel/analytics` installed and ready for integration with web applications. + +## Prerequisites + +1. Enable Analytics in your Vercel dashboard: + - Navigate to your project in the Vercel dashboard + - Click on Analytics in the sidebar + - Click "Enable" to activate Web Analytics + +## Integration Instructions + +### For Next.js Applications (App Router) + +If you add a Next.js application with the App Router to this monorepo: + +1. Import the Analytics component in your root layout file (e.g., `app/layout.tsx`): + +```typescript +import { Analytics } from '@vercel/analytics/next'; + +export default function RootLayout({ + children, +}: { + children: React.ReactNode; +}) { + return ( + + + {children} + + + + ); +} +``` + +### For Next.js Applications (Pages Router) + +If you add a Next.js application with the Pages Router: + +1. Add the Analytics component to your `_app.tsx` or `_app.js` file: + +```typescript +import { Analytics } from '@vercel/analytics/next'; +import type { AppProps } from 'next/app'; + +export default function App({ Component, pageProps }: AppProps) { + return ( + <> + + + + ); +} +``` + +### For React Applications + +If you add a standalone React application: + +```typescript +import { Analytics } from '@vercel/analytics/react'; + +function App() { + return ( + <> + {/* Your app content */} + + + ); +} +``` + +### For Static HTML Sites + +If you want to add analytics to a static HTML site (like Jekyll): + +1. Add the following script tag to your HTML files, typically before the closing `` tag: + +```html + + +``` + +## Verification + +After deploying your changes to Vercel: + +1. Open your deployed site in a browser +2. Open the browser's Developer Tools (Network tab) +3. Look for a Fetch/XHR request to `/_vercel/insights/view` +4. If you see this request, Web Analytics is working correctly + +## Local Development + +Web Analytics will only send data in production by default. During local development, the component will render but won't send tracking data. + +To test analytics in development mode (for debugging), you can use: + +```typescript + +``` + +## Documentation + +For more information, visit: +- [Vercel Web Analytics Documentation](https://vercel.com/docs/analytics) +- [Quickstart Guide](https://vercel.com/docs/analytics/quickstart) diff --git a/package.json b/package.json index 2d7520033..a990df1eb 100644 --- a/package.json +++ b/package.json @@ -5,11 +5,12 @@ "@babel/runtime": "7.18.9", "@changesets/cli": "2.30.0", "@typescript-eslint/eslint-plugin": "^8.38.0", + "@vercel/analytics": "^2.0.1", + "check-dependency-version-consistency": "^4.1.0", "danger": "11.2.6", "eslint": "^8.57.0", "eslint-plugin-prettier": "^3.4.1", "husky": "^8.0.3", - "check-dependency-version-consistency": "^4.1.0", "syncpack": "^8.5.14", "turbo": "1.10.16" }, diff --git a/sdks/permit2-sdk/package.json b/sdks/permit2-sdk/package.json index 3a4554463..46436db6a 100644 --- a/sdks/permit2-sdk/package.json +++ b/sdks/permit2-sdk/package.json @@ -42,11 +42,6 @@ "ethers": "^5.7.0", "tiny-invariant": "^1.1.0" }, - "devDependencies": { - "prettier": "^2.4.1", - "tslib": "^2.3.0", - "typescript": "^4.3.3" - }, "prettier": { "printWidth": 120, "semi": false, diff --git a/sdks/uniswapx-sdk/integration/package.json b/sdks/uniswapx-sdk/integration/package.json index 23be47542..51b424002 100644 --- a/sdks/uniswapx-sdk/integration/package.json +++ b/sdks/uniswapx-sdk/integration/package.json @@ -16,7 +16,7 @@ }, "author": "Uniswap", "devDependencies": { - "@nomicfoundation/hardhat-chai-matchers": "1.0.6", + "@nomicfoundation/hardhat-chai-matchers": "2.0.1", "@nomicfoundation/hardhat-network-helpers": "^1.0.10", "@nomiclabs/hardhat-ethers": "^2.2.3", "@types/chai": "^4.3.3", @@ -33,7 +33,7 @@ "@typechain/hardhat": "^6.1.2", "@uniswap/sdk-core": "workspace:*", "dotenv": "^16.0.3", - "ethers": "^5.7.0", + "ethers": "^6.0.0", "typechain": "^8.1.0" } } diff --git a/sdks/uniswapx-sdk/src/builder/HybridOrderBuilder.test.ts b/sdks/uniswapx-sdk/src/builder/HybridOrderBuilder.test.ts index 20567d919..8c341f610 100644 --- a/sdks/uniswapx-sdk/src/builder/HybridOrderBuilder.test.ts +++ b/sdks/uniswapx-sdk/src/builder/HybridOrderBuilder.test.ts @@ -127,9 +127,10 @@ describe("HybridOrderBuilder", () => { const deadline = Math.floor(Date.now() / 1000) + 1000; // Price curve: duration=10 blocks, scaling factor=1.1e18 const PRICE_CURVE_DURATION_SHIFT = 240; - const priceCurveElement = BigNumber.from(10) - .shl(PRICE_CURVE_DURATION_SHIFT) - .or(BASE_SCALING_FACTOR.mul(11).div(10)); + const priceCurveElement = BigNumber.from( + (BigInt(10) << BigInt(PRICE_CURVE_DURATION_SHIFT)) | + BigInt(BASE_SCALING_FACTOR.mul(11).div(10).toString()) + ); const order = builder .cosigner(constants.AddressZero) diff --git a/sdks/uniswapx-sdk/src/builder/HybridOrderBuilder.ts b/sdks/uniswapx-sdk/src/builder/HybridOrderBuilder.ts index c24dc02d4..50e8419fc 100644 --- a/sdks/uniswapx-sdk/src/builder/HybridOrderBuilder.ts +++ b/sdks/uniswapx-sdk/src/builder/HybridOrderBuilder.ts @@ -338,8 +338,8 @@ export class HybridOrderBuilder { private extractScalingFactor(curveElement: BigNumber): BigNumber { // Price curve element format: (duration << 240) | scalingFactor // Extract lower 240 bits for scaling factor - const mask = BigNumber.from(2).pow(240).sub(1); - return curveElement.and(mask); + const mask = (BigInt(1) << BigInt(240)) - BigInt(1); + return BigNumber.from(BigInt(curveElement.toString()) & mask); } private checkCosignedInvariants(): void { diff --git a/sdks/uniswapx-sdk/src/constants.test.ts b/sdks/uniswapx-sdk/src/constants.test.ts index dcf4fbe84..65e89f7be 100644 --- a/sdks/uniswapx-sdk/src/constants.test.ts +++ b/sdks/uniswapx-sdk/src/constants.test.ts @@ -38,7 +38,7 @@ describe("REACTOR_ADDRESS_MAPPING", () => { "Priority": "0x0000000000000000000000000000000000000000", "Relay": "0x0000000000000000000000000000000000000000", }, - "137": { + "137": Object { "Dutch": "0x6000da47483062A0D734Ba3dc7576Ce6A0B645C4", "Dutch_V2": "0x0000000000000000000000000000000000000000", "Dutch_V3": "0x00000000bAB6E234db8AD638B6A6395b7c499Bc4", @@ -96,4 +96,3 @@ describe("REACTOR_ADDRESS_MAPPING", () => { `); }); }); - diff --git a/sdks/uniswapx-sdk/src/contracts/index.ts b/sdks/uniswapx-sdk/src/contracts/index.ts index 485aed855..f12acaea7 100644 --- a/sdks/uniswapx-sdk/src/contracts/index.ts +++ b/sdks/uniswapx-sdk/src/contracts/index.ts @@ -5,20 +5,15 @@ export type { DSTokenInterface } from "./DSTokenInterface"; export type { ERC1967Proxy } from "./ERC1967Proxy"; export type { ExclusiveDutchOrderReactor } from "./ExclusiveDutchOrderReactor"; export type { ExclusiveFillerValidation } from "./ExclusiveFillerValidation"; -export type { HybridAuctionResolver } from "./HybridAuctionResolver"; export type { ISuperstateTokenV4 } from "./ISuperstateTokenV4"; export type { MockDSTokenInterface } from "./MockDSTokenInterface"; export type { MockERC20 } from "./MockERC20"; -export type { MockSuperstateTokenV4 } from "./MockSuperstateTokenV4"; export type { OrderQuoter } from "./OrderQuoter"; -export type { OrderQuoterV4 } from "./OrderQuoterV4"; export type { Permit2 } from "./Permit2"; export type { PriorityOrderReactor } from "./PriorityOrderReactor"; export type { Proxy } from "./Proxy"; -export type { Reactor } from "./Reactor"; export type { RelayOrderReactor } from "./RelayOrderReactor"; export type { SwapRouter02Executor } from "./SwapRouter02Executor"; -export type { TokenTransferHook } from "./TokenTransferHook"; export type { V2DutchOrderReactor } from "./V2DutchOrderReactor"; export type { V3DutchOrderReactor } from "./V3DutchOrderReactor"; export type { DeploylessMulticall2 } from "./DeploylessMulticall2"; @@ -29,20 +24,17 @@ export { DSTokenInterface__factory } from "./factories/DSTokenInterface__factory export { ERC1967Proxy__factory } from "./factories/ERC1967Proxy__factory"; export { ExclusiveDutchOrderReactor__factory } from "./factories/ExclusiveDutchOrderReactor__factory"; export { ExclusiveFillerValidation__factory } from "./factories/ExclusiveFillerValidation__factory"; -export { HybridAuctionResolver__factory } from "./factories/HybridAuctionResolver__factory"; export { ISuperstateTokenV4__factory } from "./factories/ISuperstateTokenV4__factory"; export { MockDSTokenInterface__factory } from "./factories/MockDSTokenInterface__factory"; export { MockERC20__factory } from "./factories/MockERC20__factory"; + export { MockSuperstateTokenV4__factory } from "./factories/MockSuperstateTokenV4__factory"; export { Multicall2__factory } from "./factories/Multicall2__factory"; export { OrderQuoter__factory } from "./factories/OrderQuoter__factory"; -export { OrderQuoterV4__factory } from "./factories/OrderQuoterV4__factory"; export { Permit2__factory } from "./factories/Permit2__factory"; export { PriorityOrderReactor__factory } from "./factories/PriorityOrderReactor__factory"; export { Proxy__factory } from "./factories/Proxy__factory"; -export { Reactor__factory } from "./factories/Reactor__factory"; export { RelayOrderReactor__factory } from "./factories/RelayOrderReactor__factory"; export { SwapRouter02Executor__factory } from "./factories/SwapRouter02Executor__factory"; -export { TokenTransferHook__factory } from "./factories/TokenTransferHook__factory"; export { V2DutchOrderReactor__factory } from "./factories/V2DutchOrderReactor__factory"; export { V3DutchOrderReactor__factory } from "./factories/V3DutchOrderReactor__factory"; diff --git a/sdks/uniswapx-sdk/src/order/v4/HybridOrder.ts b/sdks/uniswapx-sdk/src/order/v4/HybridOrder.ts index dc7b40895..48f5e3dd0 100644 --- a/sdks/uniswapx-sdk/src/order/v4/HybridOrder.ts +++ b/sdks/uniswapx-sdk/src/order/v4/HybridOrder.ts @@ -29,7 +29,7 @@ import { const ZERO_ADDRESS = ethers.constants.AddressZero; const WAD = ethers.constants.WeiPerEther; -const MAX_UINT_240 = BigNumber.from(1).shl(240).sub(1); +const MAX_UINT_240 = BigNumber.from((BigInt(1) << BigInt(240)) - BigInt(1)); const MAX_UINT_16 = 65535; // 2^16 - 1, max duration that fits in 16 bits const PRICE_CURVE_DURATION_SHIFT = 240; @@ -744,6 +744,13 @@ function applySupplementalPriceCurve( return priceCurve.map((value) => BigNumber.from(value)); } + if (supplemental.length > priceCurve.length) { + throw new HybridOrderPriceCurveError( + "Supplemental curve cannot be longer than base price curve" + ); + } + } + if (priceCurve.length === 0) { throw new HybridOrderPriceCurveError( "Supplemental curve provided without base curve" @@ -965,9 +972,9 @@ function encodePriceCurveElement( duration: number, scalingFactor: BigNumber ): BigNumber { - return BigNumber.from(duration) - .shl(PRICE_CURVE_DURATION_SHIFT) - .or(scalingFactor); + const durationBI = BigInt(duration) << BigInt(PRICE_CURVE_DURATION_SHIFT); + const scalingBI = BigInt(scalingFactor.toString()); + return BigNumber.from(durationBI | scalingBI); } function sharesScalingDirection(a: BigNumber, b: BigNumber): boolean { diff --git a/sdks/uniswapx-sdk/src/order/v4/hashing.ts b/sdks/uniswapx-sdk/src/order/v4/hashing.ts index 70b5aa51b..eec9dcf1f 100644 --- a/sdks/uniswapx-sdk/src/order/v4/hashing.ts +++ b/sdks/uniswapx-sdk/src/order/v4/hashing.ts @@ -293,12 +293,14 @@ const FEED_INFO_TYPE = const FEED_INFO_TYPE_HASH = ethers.utils.keccak256( ethers.utils.toUtf8Bytes(FEED_INFO_TYPE) ); - -/** - * EIP-712 type string for PrivateIntent - */ -const PRIVATE_INTENT_TYPE = - "PrivateIntent(uint256 totalAmount,uint256 exactFrequency," + +function hashFeedInfoArray(feeds: FeedInfo[]): string { + const hashes = feeds.map(hashFeedInfo); + if (hashes.length === 0) { + return ethers.utils.keccak256("0x"); + } + const types = new Array(hashes.length).fill("bytes32"); + return ethers.utils.keccak256(ethers.utils.solidityPack(types, hashes)); +} "uint256 numChunks,bytes32 salt,FeedInfo[] oracleFeeds)" + FEED_INFO_TYPE; diff --git a/sdks/uniswapx-sdk/src/utils/OrderQuoter.ts b/sdks/uniswapx-sdk/src/utils/OrderQuoter.ts index a41a505b2..e970c1ed4 100644 --- a/sdks/uniswapx-sdk/src/utils/OrderQuoter.ts +++ b/sdks/uniswapx-sdk/src/utils/OrderQuoter.ts @@ -269,7 +269,7 @@ export class UniswapXOrderQuoter // OrderValidation.ValidationFailed if (key === "0a0b0d79") { // V4 orders use hooks instead of additionalValidationData - if ("additionalValidationData" in orders[idx].order.info) { + if (orders[idx].order.info && "additionalValidationData" in orders[idx].order.info) { const fillerValidation = parseExclusiveFillerData( (orders[idx].order.info as LegacyOrderInfoTypes) .additionalValidationData diff --git a/sdks/universal-router-sdk/package.json b/sdks/universal-router-sdk/package.json index 332dfa3c2..120fe12ee 100644 --- a/sdks/universal-router-sdk/package.json +++ b/sdks/universal-router-sdk/package.json @@ -42,7 +42,7 @@ "dependencies": { "@ethersproject/abi": "^5.5.0", "@ethersproject/abstract-signer": "^5.7.0", - "@openzeppelin/contracts": "4.7.0", + "@openzeppelin/contracts": "4.9.6", "@uniswap/permit2-sdk": "workspace:*", "@uniswap/router-sdk": "workspace:*", "@uniswap/sdk-core": "workspace:*", diff --git a/sdks/universal-router-sdk/src/utils/constants.ts b/sdks/universal-router-sdk/src/utils/constants.ts index 9cf784f76..929c284f4 100644 --- a/sdks/universal-router-sdk/src/utils/constants.ts +++ b/sdks/universal-router-sdk/src/utils/constants.ts @@ -52,6 +52,10 @@ export const CHAIN_CONFIGS: { [key: number]: ChainConfig } = { address: '0xCb640A86855f1A828c27241bA364348de28abe66', creationBlock: 25195294, }, + [UniversalRouterVersion.V2_2_0]: { + address: '0xCb640A86855f1A828c27241bA364348de28abe66', + creationBlock: 25195294, + }, }, swapProxy: SWAP_PROXY_DEPLOY_ADDRESS, }, @@ -67,6 +71,10 @@ export const CHAIN_CONFIGS: { [key: number]: ChainConfig } = { address: '0x3fC91A3afd70395Cd496C647d5a6CC9D4B2b7FAD', creationBlock: 8940568, }, + [UniversalRouterVersion.V2_1]: { + address: '0x0000000000000000000000000000000000000000', + creationBlock: 1, + }, }, }, // sepolia @@ -81,9 +89,13 @@ export const CHAIN_CONFIGS: { [key: number]: ChainConfig } = { address: '0x3a9d48ab9751398bbfa63ad67599bb04e4bdf98b', // only update here and creation block below creationBlock: 7259601, }, - [UniversalRouterVersion.V2_1_1]: { - address: '0x8B844f885672f333Bc0042cB669255f93a4C1E6b', - creationBlock: 10470160, + [UniversalRouterVersion.V2_1]: { + address: '0x470FFC67b1feEEC31D16C46AC7545C98716a194c', + creationBlock: 9664766, + }, + [UniversalRouterVersion.V2_2_0]: { + address: '0xB0C89059d7190EDb17eFF19829cc009cEe923916', + creationBlock: 10941522, }, [UniversalRouterVersion.V2_2_0]: { address: '0xB0C89059d7190EDb17eFF19829cc009cEe923916', @@ -123,6 +135,10 @@ export const CHAIN_CONFIGS: { [key: number]: ChainConfig } = { address: '0x3fC91A3afd70395Cd496C647d5a6CC9D4B2b7FAD', creationBlock: 35176052, }, + [UniversalRouterVersion.V2_1]: { + address: '0x0000000000000000000000000000000000000000', + creationBlock: 1, + }, }, }, //optimism @@ -156,6 +172,10 @@ export const CHAIN_CONFIGS: { [key: number]: ChainConfig } = { address: '0x3fC91A3afd70395Cd496C647d5a6CC9D4B2b7FAD', creationBlock: 8887728, }, + [UniversalRouterVersion.V2_1]: { + address: '0x0000000000000000000000000000000000000000', + creationBlock: 1, + }, }, }, // arbitrum @@ -170,9 +190,9 @@ export const CHAIN_CONFIGS: { [key: number]: ChainConfig } = { address: '0xa51afafe0263b40edaef0df8781ea9aa03e381a3', creationBlock: 297842906, }, - [UniversalRouterVersion.V2_1_1]: { - address: '0x8B844f885672f333Bc0042cB669255f93a4C1E6b', - creationBlock: 442902181, + [UniversalRouterVersion.V2_1]: { + address: '0x96b2FD2F80e9428Daa65d859653117D453981AB4', + creationBlock: 402060097, }, }, swapProxy: SWAP_PROXY_DEPLOY_ADDRESS, @@ -189,6 +209,10 @@ export const CHAIN_CONFIGS: { [key: number]: ChainConfig } = { address: '0x3fC91A3afd70395Cd496C647d5a6CC9D4B2b7FAD', creationBlock: 18815277, }, + [UniversalRouterVersion.V2_1]: { + address: '0x0000000000000000000000000000000000000000', + creationBlock: 1, + }, }, }, // celo @@ -203,9 +227,9 @@ export const CHAIN_CONFIGS: { [key: number]: ChainConfig } = { address: '0xcb695bc5D3Aa22cAD1E6DF07801b061a05A0233A', creationBlock: 47387857, }, - [UniversalRouterVersion.V2_1_1]: { - address: '0x8B844f885672f333Bc0042cB669255f93a4C1E6b', - creationBlock: 61893766, + [UniversalRouterVersion.V2_1]: { + address: '0xBB8Ed9bF0BFF210652AE5f473a849F82e990DDf6', + creationBlock: 51696199, }, }, swapProxy: SWAP_PROXY_DEPLOY_ADDRESS, @@ -222,6 +246,10 @@ export const CHAIN_CONFIGS: { [key: number]: ChainConfig } = { address: '0x3fC91A3afd70395Cd496C647d5a6CC9D4B2b7FAD', creationBlock: 17566658, }, + [UniversalRouterVersion.V2_1]: { + address: '0x0000000000000000000000000000000000000000', + creationBlock: 1, + }, }, }, // binance smart chain @@ -236,9 +264,9 @@ export const CHAIN_CONFIGS: { [key: number]: ChainConfig } = { address: '0x1906c1d672b88cd1b9ac7593301ca990f94eae07', creationBlock: 45970616, }, - [UniversalRouterVersion.V2_1_1]: { - address: '0x8B844f885672f333Bc0042cB669255f93a4C1E6b', - creationBlock: 87208607, + [UniversalRouterVersion.V2_1]: { + address: '0x91BF3bfAEf8D771A74E1A8fE460b3EE646b2e588', + creationBlock: 68794488, }, }, swapProxy: SWAP_PROXY_DEPLOY_ADDRESS, @@ -255,9 +283,9 @@ export const CHAIN_CONFIGS: { [key: number]: ChainConfig } = { address: '0x94b75331ae8d42c1b61065089b7d48fe14aa73b7', creationBlock: 56195395, }, - [UniversalRouterVersion.V2_1_1]: { - address: '0x8B844f885672f333Bc0042cB669255f93a4C1E6b', - creationBlock: 80616324, + [UniversalRouterVersion.V2_1]: { + address: '0x0Cf1f86B331A03179646341D10A2A87515087221', + creationBlock: 72254439, }, }, swapProxy: SWAP_PROXY_DEPLOY_ADDRESS, @@ -274,6 +302,10 @@ export const CHAIN_CONFIGS: { [key: number]: ChainConfig } = { address: '0xd0872d928672ae2ff74bdb2f5130ac12229cafaf', creationBlock: 6915289, }, + [UniversalRouterVersion.V2_1]: { + address: '0x0000000000000000000000000000000000000000', + creationBlock: 1, + }, }, }, // base mainnet @@ -288,9 +320,9 @@ export const CHAIN_CONFIGS: { [key: number]: ChainConfig } = { address: '0x6ff5693b99212da76ad316178a184ab56d299b43', creationBlock: 25350999, }, - [UniversalRouterVersion.V2_1_1]: { - address: '0xfdf682f51fe81aa4898f0ae2163d8a55c127fbc7', - creationBlock: 43501203, + [UniversalRouterVersion.V2_1]: { + address: '0xf3a4f4094bd2c6c06ca2f61789d8727b8d1e7259', + creationBlock: 38404211, }, }, swapProxy: SWAP_PROXY_DEPLOY_ADDRESS, @@ -307,9 +339,9 @@ export const CHAIN_CONFIGS: { [key: number]: ChainConfig } = { address: '0xeabbcb3e8e415306207ef514f660a3f820025be3', creationBlock: 14377319, }, - [UniversalRouterVersion.V2_1_1]: { - address: '0x8B844f885672f333Bc0042cB669255f93a4C1E6b', - creationBlock: 32492192, + [UniversalRouterVersion.V2_1]: { + address: '0x77c0097c1acf6fd84878d3f7c0603e3f04e8bec7', + creationBlock: 27394047, }, }, swapProxy: SWAP_PROXY_DEPLOY_ADDRESS, @@ -345,6 +377,10 @@ export const CHAIN_CONFIGS: { [key: number]: ChainConfig } = { address: '0x28731BCC616B5f51dD52CF2e4dF0E78dD1136C06', creationBlock: 12640979, }, + [UniversalRouterVersion.V2_1]: { + address: '0x0000000000000000000000000000000000000000', + creationBlock: 1, + }, }, swapProxy: SWAP_PROXY_DEPLOY_ADDRESS, }, @@ -360,9 +396,9 @@ export const CHAIN_CONFIGS: { [key: number]: ChainConfig } = { address: '0x8ac7bee993bb44dab564ea4bc9ea67bf9eb5e743', creationBlock: 9111895, }, - [UniversalRouterVersion.V2_1_1]: { - address: '0x8B844f885672f333Bc0042cB669255f93a4C1E6b', - creationBlock: 27228771, + [UniversalRouterVersion.V2_1]: { + address: '0x03c4f6b55733cdf3caa07c01e5b83ddee3381f60', + creationBlock: 22131418, }, }, swapProxy: SWAP_PROXY_DEPLOY_ADDRESS, @@ -379,9 +415,9 @@ export const CHAIN_CONFIGS: { [key: number]: ChainConfig } = { address: '0xf70536b3bcc1bd1a972dc186a2cf84cc6da6be5d', creationBlock: 7100543, }, - [UniversalRouterVersion.V2_1_1]: { - address: '0x8B844f885672f333Bc0042cB669255f93a4C1E6b', - creationBlock: 46987997, + [UniversalRouterVersion.V2_1]: { + address: '0x7F9B8D606E0F35E5073ABf93695814530b28a37b', + creationBlock: 36746405, }, }, swapProxy: SWAP_PROXY_DEPLOY_ADDRESS, @@ -398,9 +434,9 @@ export const CHAIN_CONFIGS: { [key: number]: ChainConfig } = { address: '0xef740bf23acae26f6492b10de645d6b98dc8eaf3', creationBlock: 6819690, }, - [UniversalRouterVersion.V2_1_1]: { - address: '0xFdf682F51FE81Aa4898F0AE2163d8A55c127fbC7', - creationBlock: 43044663, + [UniversalRouterVersion.V2_1]: { + address: '0xe6039ae5b44f90d56c6b029354fb22999861a9a0', + creationBlock: 32850661, }, }, swapProxy: SWAP_PROXY_DEPLOY_ADDRESS, @@ -417,6 +453,10 @@ export const CHAIN_CONFIGS: { [key: number]: ChainConfig } = { address: '0x3ae6d8a282d67893e17aa70ebffb33ee5aa65893', creationBlock: 23678, }, + [UniversalRouterVersion.V2_1]: { + address: '0x0000000000000000000000000000000000000000', + creationBlock: 1, + }, }, swapProxy: SWAP_PROXY_DEPLOY_ADDRESS, }, @@ -432,9 +472,9 @@ export const CHAIN_CONFIGS: { [key: number]: ChainConfig } = { address: '0x492e6456d9528771018deb9e87ef7750ef184104', creationBlock: 20216585, }, - [UniversalRouterVersion.V2_1_1]: { - address: '0x8B844f885672f333Bc0042cB669255f93a4C1E6b', - creationBlock: 39035624, + [UniversalRouterVersion.V2_1]: { + address: '0x0000000000000000000000000000000000000000', + creationBlock: 1, }, }, swapProxy: SWAP_PROXY_DEPLOY_ADDRESS, @@ -451,9 +491,9 @@ export const CHAIN_CONFIGS: { [key: number]: ChainConfig } = { address: '0x0e2850543f69f678257266e0907ff9a58b3f13de', creationBlock: 3254782, }, - [UniversalRouterVersion.V2_1_1]: { - address: '0x8B844f885672f333Bc0042cB669255f93a4C1E6b', - creationBlock: 20352508, + [UniversalRouterVersion.V2_1]: { + address: '0xdb1d5986551c820bd0f3b1caca3e77ce03acb5ef', + creationBlock: 15232223, }, }, swapProxy: SWAP_PROXY_DEPLOY_ADDRESS, @@ -596,6 +636,5 @@ export const E_ETH_ADDRESS = '0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee' export const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000' export const MAX_UINT256 = BigNumber.from(2).pow(256).sub(1) export const MAX_UINT160 = BigNumber.from(2).pow(160).sub(1) - export const SENDER_AS_RECIPIENT = '0x0000000000000000000000000000000000000001' export const ROUTER_AS_RECIPIENT = '0x0000000000000000000000000000000000000002' diff --git a/sdks/v3-sdk/.gitignore b/sdks/v3-sdk/.gitignore index 705d1452b..37d70ad27 100644 --- a/sdks/v3-sdk/.gitignore +++ b/sdks/v3-sdk/.gitignore @@ -63,4 +63,7 @@ jspm_packages/ .yarn/unplugged .yarn/build-state.yml .yarn/install-state.gz -.pnp.* \ No newline at end of file +.pnp.* + +# JetBrain IDEs +.idea/ \ No newline at end of file diff --git a/sdks/v3-sdk/src/constants.ts b/sdks/v3-sdk/src/constants.ts index 9e2427287..ab72944df 100644 --- a/sdks/v3-sdk/src/constants.ts +++ b/sdks/v3-sdk/src/constants.ts @@ -1,5 +1,8 @@ import { ChainId } from '@uniswap/sdk-core' +/** + * @deprecated use V3_CORE_FACTORY_ADDRESSES[ChainId.MAINNET] from sdk-core instead + */ export const FACTORY_ADDRESS = '0x1F98431c8aD98523631AE4a59f267346ea31F984' export const ADDRESS_ZERO = '0x0000000000000000000000000000000000000000'