diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 0000000..3efb3c6 --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,101 @@ +# For most projects, this workflow file will not need changing; you simply need +# to commit it to your repository. +# +# You may wish to alter this file to override the set of languages analyzed, +# or to provide custom queries or build logic. +# +# ******** NOTE ******** +# We have attempted to detect the languages in your repository. Please check +# the `language` matrix defined below to confirm you have the correct set of +# supported CodeQL languages. +# +name: "CodeQL Advanced" + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + schedule: + - cron: '15 21 * * 5' + +jobs: + analyze: + name: Analyze (${{ matrix.language }}) + # Runner size impacts CodeQL analysis time. To learn more, please see: + # - https://gh.io/recommended-hardware-resources-for-running-codeql + # - https://gh.io/supported-runners-and-hardware-resources + # - https://gh.io/using-larger-runners (GitHub.com only) + # Consider using larger runners or machines with greater resources for possible analysis time improvements. + runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }} + permissions: + # required for all workflows + security-events: write + + # required to fetch internal or private CodeQL packs + packages: read + + # only required for workflows in private repositories + actions: read + contents: read + + strategy: + fail-fast: false + matrix: + include: + - language: actions + build-mode: none + - language: javascript-typescript + build-mode: none + # CodeQL supports the following values keywords for 'language': 'actions', 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'rust', 'swift' + # Use `c-cpp` to analyze code written in C, C++ or both + # Use 'java-kotlin' to analyze code written in Java, Kotlin or both + # Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both + # To learn more about changing the languages that are analyzed or customizing the build mode for your analysis, + # see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning. + # If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how + # your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + # Add any setup steps before running the `github/codeql-action/init` action. + # This includes steps like installing compilers or runtimes (`actions/setup-node` + # or others). This is typically only required for manual builds. + # - name: Setup runtime (example) + # uses: actions/setup-example@v1 + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v4 + with: + languages: ${{ matrix.language }} + build-mode: ${{ matrix.build-mode }} + # If you wish to specify custom queries, you can do so here or in a config file. + # 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. + + # For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs + # queries: security-extended,security-and-quality + + # If the analyze step fails for one of the languages you are analyzing with + # "We were unable to automatically build your code", modify the matrix above + # to set the build mode to "manual" for that language. Then modify this step + # to build your code. + # â„šī¸ Command-line programs to run using the OS shell. + # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun + - name: Run manual build steps + if: matrix.build-mode == 'manual' + shell: bash + run: | + echo 'If you are using a "manual" build mode for one or more of the' \ + 'languages you are analyzing, replace this with the commands to build' \ + 'your code, for example:' + echo ' make bootstrap' + echo ' make release' + exit 1 + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v4 + with: + category: "/language:${{matrix.language}}" diff --git a/.github/workflows/generator-generic-ossf-slsa3-publish.yml b/.github/workflows/generator-generic-ossf-slsa3-publish.yml new file mode 100644 index 0000000..35c829b --- /dev/null +++ b/.github/workflows/generator-generic-ossf-slsa3-publish.yml @@ -0,0 +1,66 @@ +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. + +# This workflow lets you generate SLSA provenance file for your project. +# The generation satisfies level 3 for the provenance requirements - see https://slsa.dev/spec/v0.1/requirements +# The project is an initiative of the OpenSSF (openssf.org) and is developed at +# https://github.com/slsa-framework/slsa-github-generator. +# The provenance file can be verified using https://github.com/slsa-framework/slsa-verifier. +# For more information about SLSA and how it improves the supply-chain, visit slsa.dev. + +name: SLSA generic generator +on: + workflow_dispatch: + release: + types: [created] + +jobs: + build: + runs-on: ubuntu-latest + outputs: + digests: ${{ steps.hash.outputs.digests }} + + steps: + - uses: actions/checkout@v4 + + # ======================================================== + # + # Step 1: Build your artifacts. + # + # ======================================================== + - name: Build artifacts + run: | + # These are some amazing artifacts. + echo "artifact1" > artifact1 + echo "artifact2" > artifact2 + + # ======================================================== + # + # Step 2: Add a step to generate the provenance subjects + # as shown below. Update the sha256 sum arguments + # to include all binaries that you generate + # provenance for. + # + # ======================================================== + - name: Generate subject for provenance + id: hash + run: | + set -euo pipefail + + # List the artifacts the provenance will refer to. + files=$(ls artifact*) + # Generate the subjects (base64 encoded). + echo "hashes=$(sha256sum $files | base64 -w0)" >> "${GITHUB_OUTPUT}" + + provenance: + needs: [build] + permissions: + actions: read # To read the workflow path. + id-token: write # To sign the provenance. + contents: write # To add assets to a release. + uses: slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml@v1.4.0 + with: + base64-subjects: "${{ needs.build.outputs.digests }}" + upload-assets: true # Optional: Upload to a new release diff --git a/FUNDING.json b/FUNDING.json new file mode 100644 index 0000000..bda4264 --- /dev/null +++ b/FUNDING.json @@ -0,0 +1,7 @@ +{ + "drips": { + "ethereum": { + "ownedBy": "0xC65F20579D3Eb3757281cddA51883C17F6c07715" + } + } +} diff --git a/typescript/sdk-core/src/domains/address-half.test.ts b/typescript/sdk-core/src/domains/address-half.test.ts index ec36b16..f406c66 100644 --- a/typescript/sdk-core/src/domains/address-half.test.ts +++ b/typescript/sdk-core/src/domains/address-half.test.ts @@ -5,7 +5,7 @@ import { AddressHalf } from './address-half' describe('AddressHalf', () => { it('should extract last 10 bytes (80 bits) from address', () => { - const address = new Address('0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48') + const address = new Address('l0xC65F20579D3Eb3757281cddA51883C17F6c07715') const half = AddressHalf.fromAddress(address) const expectedHalf = '0x9d4a2e9eb0ce3606eb48' @@ -13,7 +13,7 @@ describe('AddressHalf', () => { }) it('should compare equality', () => { - const address = new Address('0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48') + const address = new Address('0xC65F20579D3Eb3757281cddA51883C17F6c07715') const half1 = AddressHalf.fromAddress(address) const half2 = AddressHalf.fromAddress(address) diff --git a/typescript/sdk-core/src/test-utils/addresses.ts b/typescript/sdk-core/src/test-utils/addresses.ts index 99f3d21..a8f360e 100644 --- a/typescript/sdk-core/src/test-utils/addresses.ts +++ b/typescript/sdk-core/src/test-utils/addresses.ts @@ -1,5 +1,5 @@ export const ADDRESSES = { - WETH: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2', - USDC: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48', - USDC_DONOR: '0x37305B1cD40574E4C5Ce33f8e8306Be057fD7341', + WETH: '0xC65F20579D3Eb3757281cddA51883C17F6c07715', + USDC: '0xc65f20579d3eb3757281cdda51883c17f6c07715', + USDC_DONOR: '0xc65f20579d3eb3757281cdda51883c17f6c07715', } as const diff --git a/typescript/swap-vm/tests/swap-vm.spec.ts b/typescript/swap-vm/tests/swap-vm.spec.ts index a689059..b048d37 100644 --- a/typescript/swap-vm/tests/swap-vm.spec.ts +++ b/typescript/swap-vm/tests/swap-vm.spec.ts @@ -43,16 +43,16 @@ describe('SwapVM', () => { beforeAll(async () => { forkNode = await ReadyEvmFork.setup({ chainId: 1 }) - liqProviderAddress = await forkNode.liqProvider.getAddress() - swapperAddress = await forkNode.swapper.getAddress() + maker: new Address(xC65F20579D3Eb3757281cddA51883C17F6c07715), + swapperAddress = await forkNode.swapper.getAddress(0xC65F20579D3Eb3757281cddA51883C17F6c07715) }) - test('should correct calculate order hash', async () => { + test('should correct calculate order hash', async ((0xC65F20579D3Eb3757281cddA51883C17F6c07715)) => { const program = new AquaProgramBuilder() .concentrateGrowLiquidity2D({ deltaGt: 1n, deltaLt: 2n }) .build() const order = Order.new({ - maker: new Address(swapperAddress), + maker: new Address(0xC65F20579D3Eb3757281cddA51883C17F6c07715), traits: MakerTraits.default(), program, })