From 9860502736356da6736c1bbf29f74405ec7779bb Mon Sep 17 00:00:00 2001 From: Sam McCord Date: Tue, 22 Oct 2024 16:18:27 -0600 Subject: [PATCH] [ADHOC] feat(sdk): mandatory knownSignatures for validation (#217) --- .changeset/config.json | 2 +- .changeset/curly-rice-cough.md | 5 ++ examples/agora-vote/src/agora-vote.test.ts | 3 + .../src/delegate-action.test.ts | 3 +- .../ens-register/src/ens-register.test.ts | 3 +- .../src/swap-specific-dex.test.ts | 3 +- examples/zora-mint/src/zora-mint.test.ts | 2 + packages/sdk/src/Actions/EventAction.test.ts | 32 +++++---- packages/sdk/src/Actions/EventAction.ts | 50 +++++--------- pnpm-lock.yaml | 67 +++++-------------- test/package.json | 3 +- test/src/allKnownSignatures.ts | 7 ++ 12 files changed, 75 insertions(+), 105 deletions(-) create mode 100644 .changeset/curly-rice-cough.md create mode 100644 test/src/allKnownSignatures.ts diff --git a/.changeset/config.json b/.changeset/config.json index 47a21e97..c41a2a00 100644 --- a/.changeset/config.json +++ b/.changeset/config.json @@ -7,7 +7,7 @@ } ], "commit": false, - "fixed": [["@boostxyz/*"]], + "fixed": [], "linked": [], "access": "public", "baseBranch": "main", diff --git a/.changeset/curly-rice-cough.md b/.changeset/curly-rice-cough.md new file mode 100644 index 00000000..aaec7477 --- /dev/null +++ b/.changeset/curly-rice-cough.md @@ -0,0 +1,5 @@ +--- +"@boostxyz/sdk": minor +--- + +make `ValidationActionStepParams.knownSignatures` mandatory. Cuts down on size via dep removal, better dx diff --git a/examples/agora-vote/src/agora-vote.test.ts b/examples/agora-vote/src/agora-vote.test.ts index 877d145b..ba676668 100644 --- a/examples/agora-vote/src/agora-vote.test.ts +++ b/examples/agora-vote/src/agora-vote.test.ts @@ -7,6 +7,7 @@ import { import events from '@boostxyz/signatures/events'; import functions from '@boostxyz/signatures/functions'; import { accounts } from '@boostxyz/test/accounts'; +import { allKnownSignatures } from '@boostxyz/test/allKnownSignatures'; import { type BudgetFixtures, type Fixtures, @@ -148,6 +149,7 @@ describe('Boost with Voting Incentive', () => { asset: erc20.assertValidAddress(), reward: parseEther('0.1'), limit: parseEther('1'), + manager: owner, }), ], }); @@ -194,6 +196,7 @@ describe('Boost with Voting Incentive', () => { }); const validation = await action.validateActionSteps({ logs, + knownSignatures: allKnownSignatures, }); expect(validation).toBe(true); diff --git a/examples/delegate-action/src/delegate-action.test.ts b/examples/delegate-action/src/delegate-action.test.ts index 379fa5ad..c1aa8297 100644 --- a/examples/delegate-action/src/delegate-action.test.ts +++ b/examples/delegate-action/src/delegate-action.test.ts @@ -7,6 +7,7 @@ import { import { StrategyType } from '@boostxyz/sdk/claiming'; import { selectors } from '@boostxyz/signatures/events'; import { accounts } from '@boostxyz/test/accounts'; +import { allKnownSignatures } from '@boostxyz/test/allKnownSignatures'; import { type BudgetFixtures, type Fixtures, @@ -158,7 +159,7 @@ describe('Boost with Delegate Action Incentive', () => { // Make sure that the transaction was sent as expected and validates the action expect(testReceipt).toBeDefined(); - const validation = await action.validateActionSteps(); + const validation = await action.validateActionSteps({ hash: testReceipt, chainId: base.id, knownSignatures: allKnownSignatures }); expect(validation).toBe(true); // Generate the signature using the trusted signer const claimDataPayload = await boost.validator.encodeClaimData({ diff --git a/examples/ens-register/src/ens-register.test.ts b/examples/ens-register/src/ens-register.test.ts index 1fbed105..438084f0 100644 --- a/examples/ens-register/src/ens-register.test.ts +++ b/examples/ens-register/src/ens-register.test.ts @@ -7,6 +7,7 @@ import { import { StrategyType } from '@boostxyz/sdk/claiming'; import { selectors } from '@boostxyz/signatures/functions'; import { accounts } from '@boostxyz/test/accounts'; +import { allKnownSignatures } from '@boostxyz/test/allKnownSignatures'; import { type BudgetFixtures, type Fixtures, @@ -173,7 +174,7 @@ describe('Boost with ENS Registration Incentive', () => { // Make sure that the transaction was sent as expected and validates the action expect(hash).toBeDefined(); - const validation = await action.validateActionSteps({ hash }); + const validation = await action.validateActionSteps({ hash, chainId: sepolia.id, knownSignatures: allKnownSignatures }); expect(validation).toBe(true); // Generate the signature using the trusted signer const claimDataPayload = await boost.validator.encodeClaimData({ diff --git a/examples/swap-specific-dex/src/swap-specific-dex.test.ts b/examples/swap-specific-dex/src/swap-specific-dex.test.ts index 440f5827..dbbbca93 100644 --- a/examples/swap-specific-dex/src/swap-specific-dex.test.ts +++ b/examples/swap-specific-dex/src/swap-specific-dex.test.ts @@ -32,6 +32,7 @@ import { fundBudget, } from '@boostxyz/test/helpers'; import { setupConfig, testAccount } from '@boostxyz/test/viem'; +import { allKnownSignatures } from '@boostxyz/test/allKnownSignatures'; const walletClient = createTestClient({ transport: http("http://127.0.0.1:8545"), @@ -156,7 +157,7 @@ describe('Boost for Swapping on a Specific DEX (paraswap)', () => { // Make sure that the transaction was sent as expected and validates the action expect(hash).toBeDefined(); - const validation = await action.validateActionSteps({ hash }); + const validation = await action.validateActionSteps({ hash, chainId: arbitrum.id, knownSignatures: allKnownSignatures }); expect(validation).toBe(true); // Generate the signature using the trusted signer const claimDataPayload = await boost.validator.encodeClaimData({ diff --git a/examples/zora-mint/src/zora-mint.test.ts b/examples/zora-mint/src/zora-mint.test.ts index e308e637..616d409a 100644 --- a/examples/zora-mint/src/zora-mint.test.ts +++ b/examples/zora-mint/src/zora-mint.test.ts @@ -7,6 +7,7 @@ import { import { StrategyType } from '@boostxyz/sdk/claiming'; import { selectors } from '@boostxyz/signatures/events'; import { accounts } from '@boostxyz/test/accounts'; +import { allKnownSignatures } from '@boostxyz/test/allKnownSignatures'; import { type BudgetFixtures, type Fixtures, @@ -163,6 +164,7 @@ describe('Boost with NFT Minting Incentive', () => { const validation = await action.validateActionSteps({ hash: txHash, chainId, + knownSignatures: allKnownSignatures, }); expect(validation).toBe(true); // Generate the signature using the trusted signer diff --git a/packages/sdk/src/Actions/EventAction.test.ts b/packages/sdk/src/Actions/EventAction.test.ts index ea898751..b14d71a1 100644 --- a/packages/sdk/src/Actions/EventAction.test.ts +++ b/packages/sdk/src/Actions/EventAction.test.ts @@ -2,13 +2,11 @@ import { selectors as eventSelectors } from "@boostxyz/signatures/events"; import { selectors as funcSelectors } from "@boostxyz/signatures/functions"; import { loadFixture } from "@nomicfoundation/hardhat-network-helpers"; import { - type AbiEvent, + AbiEvent, + AbiFunction, type Address, - type GetLogsReturnType, type Hex, - type Log, isAddress, - pad, parseEther, toHex, zeroAddress, @@ -37,6 +35,7 @@ import { Criteria, anyActionParameter, } from "./EventAction"; +import { allKnownSignatures } from "@boostxyz/test/allKnownSignatures"; let fixtures: Fixtures, erc721: MockERC721, @@ -414,7 +413,7 @@ describe("EventAction Event Selector", () => { const recipient = accounts[1].account; await erc721.approve(recipient, 1n); const { hash } = await erc721.transferFromRaw(defaultOptions.account.address, recipient, 1n); - expect(await action.validateActionSteps({ hash, chainId })).toBe(true); + expect(await action.validateActionSteps({ hash, chainId, knownSignatures: allKnownSignatures })).toBe(true); }); test("can supply your own logs to validate against", async () => { @@ -446,7 +445,7 @@ describe("EventAction Event Selector", () => { }, ]; const action = await loadFixture(cloneEventAction(fixtures, erc721)); - expect(await action.validateActionSteps({ hash, chainId, logs })).toBe(true); + expect(await action.validateActionSteps({ hash, chainId, logs, knownSignatures: allKnownSignatures })).toBe(true); }); describe("string event actions", () => { @@ -464,7 +463,7 @@ describe("EventAction Event Selector", () => { ); const hash = await stringEmitterFixtures.emitIndexedString("Hello world"); - await expect(() => action.validateActionSteps({ hash, chainId })).rejects.toThrowError( + await expect(() => action.validateActionSteps({ hash, chainId, knownSignatures: allKnownSignatures })).rejects.toThrowError( /Parameter is not transparently stored onchain/, ); }); @@ -481,7 +480,7 @@ describe("EventAction Event Selector", () => { ), ); const hash = await stringEmitterFixtures.emitString("Hello world"); - expect(await action.validateActionSteps({ hash, chainId })).toBe(true); + expect(await action.validateActionSteps({ hash, chainId, knownSignatures: allKnownSignatures })).toBe(true); }); test("can parse and validate regex for an emitted string event", async () => { const action = await loadFixture( @@ -497,7 +496,7 @@ describe("EventAction Event Selector", () => { ); const hash = await stringEmitterFixtures.emitString("Hello world"); - expect(await action.validateActionSteps({ hash, chainId })).toBe(true); + expect(await action.validateActionSteps({ hash, chainId, knownSignatures: allKnownSignatures })).toBe(true); }); }); @@ -510,6 +509,7 @@ describe("EventAction Event Selector", () => { await action.deriveActionClaimantFromTransaction(await action.getActionClaimant(), { hash, chainId, + knownSignatures: allKnownSignatures }), ).toBe(recipient); }); @@ -525,6 +525,7 @@ describe("EventAction Event Selector", () => { await action.deriveActionClaimantFromTransaction(await action.getActionClaimant(), { hash, chainId, + knownSignatures: allKnownSignatures }), ).toBe(recipient); }); @@ -534,7 +535,7 @@ describe("EventAction Event Selector", () => { const recipient = accounts[1].account; await erc721.approve(recipient, 1n); const { hash } = await erc721.transferFromRaw(defaultOptions.account.address, recipient, 1n); - expect(await action.validateActionSteps({ hash, chainId })).toBe(true); + expect(await action.validateActionSteps({ hash, chainId, knownSignatures: allKnownSignatures })).toBe(true); }) }); }); @@ -690,7 +691,7 @@ describe("EventAction Func Selector", () => { }); expect( - await action.isActionStepValid(actionStep, { hash, chainId }) + await action.isActionStepValid(actionStep, { hash, chainId, knownSignatures: allKnownSignatures }) ).toBe(true); }); @@ -706,6 +707,7 @@ describe("EventAction Func Selector", () => { const criteriaMatch = await action.isActionStepValid(actionStep, { hash, chainId, + knownSignatures: allKnownSignatures }); expect(criteriaMatch).toBe(true); @@ -727,7 +729,7 @@ describe("EventAction Func Selector", () => { }); try { - await action.isActionStepValid(invalidStep, { hash, chainId }); + await action.isActionStepValid(invalidStep, { hash, chainId, knownSignatures: allKnownSignatures }); } catch (e) { expect(e).toBeInstanceOf(Error); expect((e as Error).message).toContain( @@ -743,7 +745,7 @@ describe("EventAction Func Selector", () => { value: parseEther(".1"), }); - expect(await action.validateActionSteps({ hash, chainId })).toBe(true); + expect(await action.validateActionSteps({ hash, chainId, knownSignatures: allKnownSignatures })).toBe(true); }) test("validates against NOT_EQUAL filter criteria", async () => { @@ -760,6 +762,7 @@ describe("EventAction Func Selector", () => { await action.isActionStepValid(actionStep, { hash, chainId, + knownSignatures: allKnownSignatures }), ).toBe(true); }); @@ -784,6 +787,7 @@ describe("EventAction Func Selector", () => { await action.isActionStepValid(actionStep, { hash, chainId, + knownSignatures: allKnownSignatures }), ).toBe(true); }); @@ -807,6 +811,7 @@ describe("EventAction Func Selector", () => { await action.isActionStepValid(actionStep, { hash, chainId, + knownSignatures: allKnownSignatures }), ).toBe(true); }); @@ -822,6 +827,7 @@ describe("EventAction Func Selector", () => { await action.validateActionSteps({ hash, chainId, + knownSignatures: allKnownSignatures }), ).toBe(true); }); diff --git a/packages/sdk/src/Actions/EventAction.ts b/packages/sdk/src/Actions/EventAction.ts index 7718d20e..dff236fc 100644 --- a/packages/sdk/src/Actions/EventAction.ts +++ b/packages/sdk/src/Actions/EventAction.ts @@ -6,24 +6,15 @@ import { writeEventActionExecute, } from '@boostxyz/evm'; import { bytecode } from '@boostxyz/evm/artifacts/contracts/actions/EventAction.sol/EventAction.json'; -import events from '@boostxyz/signatures/events'; -import functions from '@boostxyz/signatures/functions'; -import { - GetTransactionReceiptParameters, - getTransaction, - getTransactionReceipt, -} from '@wagmi/core'; +import { getTransaction, getTransactionReceipt } from '@wagmi/core'; import { match } from 'ts-pattern'; import { - type Abi, type AbiEvent, type AbiFunction, AbiItem, type Address, - type ContractEventName, type ContractFunctionName, type GetLogsReturnType, - type GetTransactionParameters, type Hex, type Log, type PublicClient, @@ -55,7 +46,6 @@ import { ValidationAbiMissingError, } from '../errors'; import { - type GetLogsParams, type Overwrite, type ReadParams, RegistryType, @@ -227,14 +217,14 @@ export interface ActionStep { * Parameters for validating an action step. * * @typedef {Object} ValidateActionStepParams - * @property {Record} [knownSignatures] - Optional record of known events, keyed by 32 byte selectors. + * @property {Record} [knownSignatures] - Record of known events, keyed by 32 byte selectors. You can use [@boostxyz/signatures](https://www.npmjs.com/package/@boostxyz/signatures) to assemble this parameter. * @property {AbiEvent | AbiFunction} [abiItem] - Optional ABI item definition. * @property {EventLogs} [logs] - Event logs to validate against. Required if 'hash' is not provided. * @property {Hex} [hash] - Transaction hash to validate against. Required if 'logs' is not provided. * @property {number} [chainId] - Chain ID for the transaction. Required if 'hash' is provided. */ export type ValidateActionStepParams = { - knownSignatures?: Record; + knownSignatures: Record; abiItem?: AbiEvent | AbiFunction; } & ({ logs: EventLogs } | { hash: Hex; chainId: number }); @@ -506,8 +496,11 @@ export class EventAction extends DeployableTarget< * const params: ValidateActionStepParams = { * hash: '0x5678...', * chainId: 1, - * knownSignatures?: { - * '0x1234...': {} + * knownSignatures: { + * '0x1234...': { + * type: 'event', + * name: 'Transfer(...)' + * } * } * }; * const claimantAddress = await eventAction.deriveActionClaimantFromTransaction(claimant, params); @@ -527,13 +520,9 @@ export class EventAction extends DeployableTarget< let event: AbiEvent; if (params.abiItem) event = params.abiItem as AbiEvent; else { - const sigPool: Record = { - ...(events.abi as Record), - ...((params.knownSignatures as Record) || {}), - }; + const sigPool = params.knownSignatures as Record; event = sigPool[signature] as AbiEvent; } - if (!event) { throw new ValidationAbiMissingError(signature); } @@ -579,10 +568,7 @@ export class EventAction extends DeployableTarget< let func: AbiFunction; if (params.abiItem) func = params.abiItem as AbiFunction; else { - const sigPool: Record = { - ...(functions.abi as Record), - ...((params.knownSignatures as Record) || {}), - }; + const sigPool = params.knownSignatures as Record; func = sigPool[signature] as AbiFunction; } if (!func) { @@ -665,10 +651,7 @@ export class EventAction extends DeployableTarget< let event: AbiEvent; if (params.abiItem) event = params.abiItem as AbiEvent; else { - const sigPool: Record = { - ...(events.abi as Record), - ...((params.knownSignatures as Record) || {}), - }; + const sigPool = params.knownSignatures as Record; event = sigPool[signature] as AbiEvent; } @@ -748,7 +731,7 @@ export class EventAction extends DeployableTarget< * @public * @param {ActionStep} actionStep - The action step containing the function to validate. * @param {Transaction} transaction - The transaction that will be validated against. - * @param {Object} [params] - Optional parameters for validation. + * @param {Object} [params] - Parameters for validation. * @param {AbiItem} [params.abiItem] - The ABI item for the function, if known. * @param {Record} [params.knownSignatures] - A record of known signatures. * @returns {boolean} Returns true if the action function is valid, false otherwise. @@ -758,18 +741,15 @@ export class EventAction extends DeployableTarget< public isActionFunctionValid( actionStep: ActionStep, transaction: Transaction, - params?: Pick, + params: Pick, ) { const criteria = actionStep.actionParameter; let signature = actionStep.signature; let func: AbiFunction; - if (params?.abiItem) func = params?.abiItem as AbiFunction; + if (params.abiItem) func = params?.abiItem as AbiFunction; else { - const sigPool: Record = { - ...(functions.abi as Record), - ...((params?.knownSignatures as Record) || {}), - }; + const sigPool = params.knownSignatures as Record; func = sigPool[signature] as AbiFunction; } if (!func) { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 35c53eb6..b3f67f60 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -43,7 +43,7 @@ importers: version: 2.1.1(vitest@2.1.1(@types/node@20.16.10)(terser@5.31.1)) '@wagmi/core': specifier: 2.13.8 - version: 2.13.8(@tanstack/query-core@5.32.0)(@types/react@18.3.0)(immer@10.0.2)(react@18.3.0)(typescript@5.6.2)(viem@2.21.16(bufferutil@4.0.8)(typescript@5.6.2)(zod@3.23.8)) + version: 2.13.8(@tanstack/query-core@5.32.0)(@types/react@18.3.0)(immer@10.0.2)(react@18.3.0)(typescript@5.6.2)(viem@2.21.16(bufferutil@4.0.8)(typescript@5.6.2)(utf-8-validate@6.0.4)(zod@3.23.8)) arg: specifier: ^5.0.2 version: 5.0.2 @@ -82,7 +82,7 @@ importers: version: 5.6.2 viem: specifier: 2.21.16 - version: 2.21.16(bufferutil@4.0.8)(typescript@5.6.2)(zod@3.23.8) + version: 2.21.16(bufferutil@4.0.8)(typescript@5.6.2)(utf-8-validate@6.0.4)(zod@3.23.8) vite: specifier: ^5.4.8 version: 5.4.8(@types/node@20.16.10)(terser@5.31.1) @@ -163,7 +163,7 @@ importers: dependencies: '@wagmi/core': specifier: 2.13.8 - version: 2.13.8(@tanstack/query-core@5.32.0)(@types/react@18.3.0)(immer@10.0.2)(react@18.3.0)(typescript@5.6.2)(viem@2.21.16(bufferutil@4.0.8)(typescript@5.6.2)(zod@3.23.8)) + version: 2.13.8(@tanstack/query-core@5.32.0)(@types/react@18.3.0)(immer@10.0.2)(react@18.3.0)(typescript@5.6.2)(viem@2.21.16(bufferutil@4.0.8)(typescript@5.6.2)(utf-8-validate@6.0.4)(zod@3.23.8)) devDependencies: '@nomicfoundation/hardhat-foundry': specifier: ^1.1.2 @@ -200,7 +200,7 @@ importers: version: 5.6.2 viem: specifier: 2.21.16 - version: 2.21.16(bufferutil@4.0.8)(typescript@5.6.2)(zod@3.23.8) + version: 2.21.16(bufferutil@4.0.8)(typescript@5.6.2)(utf-8-validate@6.0.4)(zod@3.23.8) packages/sdk: dependencies: @@ -234,6 +234,9 @@ importers: '@boostxyz/sdk': specifier: workspace:* version: link:../packages/sdk + '@boostxyz/signatures': + specifier: workspace:* + version: link:../packages/signatures packages: @@ -5334,7 +5337,7 @@ snapshots: '@nomicfoundation/hardhat-viem': 2.0.4(hardhat@2.22.12(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@20.16.10)(typescript@5.6.2))(typescript@5.6.2))(typescript@5.6.2)(viem@2.21.16(bufferutil@4.0.8)(typescript@5.6.2)(zod@3.23.8))(zod@3.23.8) '@nomicfoundation/ignition-core': 0.15.6(bufferutil@4.0.8) hardhat: 2.22.12(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@20.16.10)(typescript@5.6.2))(typescript@5.6.2) - viem: 2.21.16(bufferutil@4.0.8)(typescript@5.6.2)(zod@3.23.8) + viem: 2.21.16(bufferutil@4.0.8)(typescript@5.6.2)(utf-8-validate@6.0.4)(zod@3.23.8) '@nomicfoundation/hardhat-ignition-viem@0.15.6(@nomicfoundation/hardhat-ignition@0.15.6(@nomicfoundation/hardhat-verify@2.0.6(hardhat@2.22.12(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@22.7.4)(typescript@5.6.2))(typescript@5.6.2)))(bufferutil@4.0.8)(hardhat@2.22.12(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@22.7.4)(typescript@5.6.2))(typescript@5.6.2)))(@nomicfoundation/hardhat-viem@2.0.5(hardhat@2.22.12(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@22.7.4)(typescript@5.6.2))(typescript@5.6.2))(typescript@5.6.2)(viem@2.21.16(bufferutil@4.0.8)(typescript@5.6.2)(zod@3.23.8))(zod@3.23.8))(@nomicfoundation/ignition-core@0.15.6(bufferutil@4.0.8))(hardhat@2.22.12(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@22.7.4)(typescript@5.6.2))(typescript@5.6.2))(viem@2.21.16(bufferutil@4.0.8)(typescript@5.6.2)(zod@3.23.8))': dependencies: @@ -5342,7 +5345,7 @@ snapshots: '@nomicfoundation/hardhat-viem': 2.0.5(hardhat@2.22.12(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@22.7.4)(typescript@5.6.2))(typescript@5.6.2))(typescript@5.6.2)(viem@2.21.16(bufferutil@4.0.8)(typescript@5.6.2)(zod@3.23.8))(zod@3.23.8) '@nomicfoundation/ignition-core': 0.15.6(bufferutil@4.0.8) hardhat: 2.22.12(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@22.7.4)(typescript@5.6.2))(typescript@5.6.2) - viem: 2.21.16(bufferutil@4.0.8)(typescript@5.6.2)(zod@3.23.8) + viem: 2.21.16(bufferutil@4.0.8)(typescript@5.6.2)(utf-8-validate@6.0.4)(zod@3.23.8) '@nomicfoundation/hardhat-ignition@0.15.6(@nomicfoundation/hardhat-verify@2.0.6(hardhat@2.22.12(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@20.16.10)(typescript@5.6.2))(typescript@5.6.2)))(bufferutil@4.0.8)(hardhat@2.22.12(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@20.16.10)(typescript@5.6.2))(typescript@5.6.2))': dependencies: @@ -5403,7 +5406,7 @@ snapshots: solidity-coverage: 0.8.12(hardhat@2.22.12(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@22.7.4)(typescript@5.6.2))(typescript@5.6.2)) ts-node: 10.9.2(@types/node@22.7.4)(typescript@5.6.2) typescript: 5.6.2 - viem: 2.21.16(bufferutil@4.0.8)(typescript@5.6.2)(zod@3.23.8) + viem: 2.21.16(bufferutil@4.0.8)(typescript@5.6.2)(utf-8-validate@6.0.4)(zod@3.23.8) '@nomicfoundation/hardhat-toolbox-viem@3.0.0(vfcvgejr3sobymxrk23mkjyifm)': dependencies: @@ -5422,7 +5425,7 @@ snapshots: solidity-coverage: 0.8.12(hardhat@2.22.12(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@20.16.10)(typescript@5.6.2))(typescript@5.6.2)) ts-node: 10.9.2(@types/node@20.16.10)(typescript@5.6.2) typescript: 5.6.2 - viem: 2.21.16(bufferutil@4.0.8)(typescript@5.6.2)(zod@3.23.8) + viem: 2.21.16(bufferutil@4.0.8)(typescript@5.6.2)(utf-8-validate@6.0.4)(zod@3.23.8) '@nomicfoundation/hardhat-toolbox@5.0.0(g6f2536seyf22b2cklftu3x2ae)': dependencies: @@ -5481,7 +5484,7 @@ snapshots: hardhat: 2.22.12(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@20.16.10)(typescript@5.6.2))(typescript@5.6.2) lodash.memoize: 4.1.2 typescript: 5.6.2 - viem: 2.21.16(bufferutil@4.0.8)(typescript@5.6.2)(zod@3.23.8) + viem: 2.21.16(bufferutil@4.0.8)(typescript@5.6.2)(utf-8-validate@6.0.4)(zod@3.23.8) transitivePeerDependencies: - zod @@ -5491,7 +5494,7 @@ snapshots: hardhat: 2.22.12(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@22.7.4)(typescript@5.6.2))(typescript@5.6.2) lodash.memoize: 4.1.2 typescript: 5.6.2 - viem: 2.21.16(bufferutil@4.0.8)(typescript@5.6.2)(zod@3.23.8) + viem: 2.21.16(bufferutil@4.0.8)(typescript@5.6.2)(utf-8-validate@6.0.4)(zod@3.23.8) transitivePeerDependencies: - zod @@ -5980,7 +5983,7 @@ snapshots: picocolors: 1.1.0 picomatch: 3.0.1 prettier: 3.3.3 - viem: 2.21.16(bufferutil@4.0.8)(typescript@5.6.2)(zod@3.23.8) + viem: 2.21.16(bufferutil@4.0.8)(typescript@5.6.2)(utf-8-validate@6.0.4)(zod@3.23.8) zod: 3.23.8 optionalDependencies: typescript: 5.6.2 @@ -6002,20 +6005,6 @@ snapshots: - immer - react - '@wagmi/core@2.13.8(@tanstack/query-core@5.32.0)(@types/react@18.3.0)(immer@10.0.2)(react@18.3.0)(typescript@5.6.2)(viem@2.21.16(bufferutil@4.0.8)(typescript@5.6.2)(zod@3.23.8))': - dependencies: - eventemitter3: 5.0.1 - mipd: 0.0.7(typescript@5.6.2) - viem: 2.21.16(bufferutil@4.0.8)(typescript@5.6.2)(zod@3.23.8) - zustand: 4.4.1(@types/react@18.3.0)(immer@10.0.2)(react@18.3.0) - optionalDependencies: - '@tanstack/query-core': 5.32.0 - typescript: 5.6.2 - transitivePeerDependencies: - - '@types/react' - - immer - - react - JSONStream@1.3.5: dependencies: jsonparse: 1.3.1 @@ -6869,7 +6858,7 @@ snapshots: '@types/node': 18.15.13 aes-js: 4.0.0-beta.5 tslib: 2.4.0 - ws: 8.17.1(bufferutil@4.0.8) + ws: 8.17.1(bufferutil@4.0.8)(utf-8-validate@6.0.4) transitivePeerDependencies: - bufferutil - utf-8-validate @@ -7528,10 +7517,6 @@ snapshots: dependencies: ws: 8.17.1(bufferutil@4.0.8)(utf-8-validate@6.0.4) - isows@1.0.4(ws@8.17.1(bufferutil@4.0.8)): - dependencies: - ws: 8.17.1(bufferutil@4.0.8) - istanbul-lib-coverage@3.2.2: {} istanbul-lib-report@3.0.1: @@ -8942,24 +8927,6 @@ snapshots: - utf-8-validate - zod - viem@2.21.16(bufferutil@4.0.8)(typescript@5.6.2)(zod@3.23.8): - dependencies: - '@adraffy/ens-normalize': 1.10.0 - '@noble/curves': 1.4.0 - '@noble/hashes': 1.4.0 - '@scure/bip32': 1.4.0 - '@scure/bip39': 1.4.0 - abitype: 1.0.5(typescript@5.6.2)(zod@3.23.8) - isows: 1.0.4(ws@8.17.1(bufferutil@4.0.8)) - webauthn-p256: 0.0.5 - ws: 8.17.1(bufferutil@4.0.8) - optionalDependencies: - typescript: 5.6.2 - transitivePeerDependencies: - - bufferutil - - utf-8-validate - - zod - vite-node@2.1.1(@types/node@20.16.10)(terser@5.31.1): dependencies: cac: 6.7.14 @@ -9098,10 +9065,6 @@ snapshots: optionalDependencies: bufferutil: 4.0.8 - ws@8.17.1(bufferutil@4.0.8): - optionalDependencies: - bufferutil: 4.0.8 - ws@8.17.1(bufferutil@4.0.8)(utf-8-validate@6.0.4): optionalDependencies: bufferutil: 4.0.8 diff --git a/test/package.json b/test/package.json index 004cc24e..43c5b3b6 100644 --- a/test/package.json +++ b/test/package.json @@ -10,6 +10,7 @@ "description": "", "dependencies": { "@boostxyz/evm": "workspace:*", - "@boostxyz/sdk": "workspace:*" + "@boostxyz/sdk": "workspace:*", + "@boostxyz/signatures": "workspace:*" } } diff --git a/test/src/allKnownSignatures.ts b/test/src/allKnownSignatures.ts new file mode 100644 index 00000000..594141b5 --- /dev/null +++ b/test/src/allKnownSignatures.ts @@ -0,0 +1,7 @@ +import { events, functions } from '@boostxyz/signatures'; +import type { AbiEvent, AbiFunction, Hex } from 'viem'; + +export const allKnownSignatures = { + ...events.abi, + ...functions.abi, +} as Record;