@prb/effect-evm 1.0.0-beta.2 → 1.0.0-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/abi/erc165.js.map +1 -1
- package/dist/abi/erc20-no-output.js.map +1 -1
- package/dist/abi/erc20.js.map +1 -1
- package/dist/abi/erc721.js.map +1 -1
- package/dist/abi/index.js.map +1 -1
- package/dist/balance/index.js.map +1 -1
- package/dist/balance/service.js.map +1 -1
- package/dist/balance/service.test.integration.js.map +1 -1
- package/dist/balance/utils.js.map +1 -1
- package/dist/block/errors.js.map +1 -1
- package/dist/block/index.js.map +1 -1
- package/dist/block/service.js.map +1 -1
- package/dist/block/service.test.integration.js.map +1 -1
- package/dist/constants/index.js.map +1 -1
- package/dist/contract/cross-chain-reader.js.map +1 -1
- package/dist/contract/index.js.map +1 -1
- package/dist/contract/pipeline/index.js.map +1 -1
- package/dist/contract/pipeline/internal/core.js.map +1 -1
- package/dist/contract/pipeline/internal/helpers.js.map +1 -1
- package/dist/contract/pipeline/internal/nonce.js.map +1 -1
- package/dist/contract/pipeline/internal/prepare.js.map +1 -1
- package/dist/contract/pipeline/internal/receipt.js.map +1 -1
- package/dist/contract/pipeline/live.js.map +1 -1
- package/dist/contract/pipeline/service.js.map +1 -1
- package/dist/contract/pipeline/types.js.map +1 -1
- package/dist/contract/pipeline/write-and-track.js.map +1 -1
- package/dist/contract/pipeline/write-and-wait.js.map +1 -1
- package/dist/contract/pipeline.js.map +1 -1
- package/dist/contract/reader.js.map +1 -1
- package/dist/contract/typed-contract.js.map +1 -1
- package/dist/contract/writer.js.map +1 -1
- package/dist/core/clients/index.js.map +1 -1
- package/dist/core/clients/public-client.js.map +1 -1
- package/dist/core/clients/wallet-client.js.map +1 -1
- package/dist/core/errors/client.js.map +1 -1
- package/dist/core/errors/contract.js.map +1 -1
- package/dist/core/errors/erc20.js.map +1 -1
- package/dist/core/errors/event.js.map +1 -1
- package/dist/core/errors/index.js.map +1 -1
- package/dist/core/errors/predicates.js.map +1 -1
- package/dist/core/errors/transaction.js.map +1 -1
- package/dist/core/errors/viem-mapper.js.map +1 -1
- package/dist/core/index.js.map +1 -1
- package/dist/deploy/errors.js.map +1 -1
- package/dist/deploy/index.js.map +1 -1
- package/dist/deploy/service.js.map +1 -1
- package/dist/eip7702/erc7579.js.map +1 -1
- package/dist/eip7702/errors.js.map +1 -1
- package/dist/eip7702/index.js.map +1 -1
- package/dist/eip7702/service.js.map +1 -1
- package/dist/ens/ens.d.ts.map +1 -1
- package/dist/ens/ens.js +6 -6
- package/dist/ens/ens.js.map +1 -1
- package/dist/ens/errors.js.map +1 -1
- package/dist/ens/index.js.map +1 -1
- package/dist/erc20/allowance/core.js.map +1 -1
- package/dist/erc20/allowance/index.js.map +1 -1
- package/dist/erc20/allowance/no-output.js.map +1 -1
- package/dist/erc20/allowance/types.js.map +1 -1
- package/dist/erc20/index.js.map +1 -1
- package/dist/erc20/metadata.js.map +1 -1
- package/dist/erc721/errors.js.map +1 -1
- package/dist/erc721/helpers.js.map +1 -1
- package/dist/erc721/index.js.map +1 -1
- package/dist/erc721/metadata.js.map +1 -1
- package/dist/erc721/service.js.map +1 -1
- package/dist/events/backfill.js.map +1 -1
- package/dist/events/backfill.test.integration.js.map +1 -1
- package/dist/events/cursor.js.map +1 -1
- package/dist/events/decoder.js.map +1 -1
- package/dist/events/index.js.map +1 -1
- package/dist/events/reliable-stream-simple.test.integration.js.map +1 -1
- package/dist/events/reliable-stream.js.map +1 -1
- package/dist/events/reliable-stream.test.integration.js.map +1 -1
- package/dist/events/stream.js.map +1 -1
- package/dist/events/stream.test.integration.js.map +1 -1
- package/dist/gas/errors.js.map +1 -1
- package/dist/gas/estimator.js.map +1 -1
- package/dist/gas/index.js.map +1 -1
- package/dist/gas/service.js.map +1 -1
- package/dist/gas/service.test.integration.js.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/integrations/react-hooks/convenience/index.js.map +1 -1
- package/dist/integrations/react-hooks/internal/error.js.map +1 -1
- package/dist/integrations/react-hooks/internal/is-dev.js.map +1 -1
- package/dist/integrations/react-hooks/internal/runtime.js.map +1 -1
- package/dist/integrations/react-hooks/internal/scoped-run.js.map +1 -1
- package/dist/integrations/react-hooks/internal/stable.js.map +1 -1
- package/dist/integrations/react-hooks/primitives/use-effect-memo-factory.js.map +1 -1
- package/dist/integrations/react-hooks/primitives/use-effect.js.map +1 -1
- package/dist/integrations/react-hooks/primitives/use-fork-effect.js.map +1 -1
- package/dist/integrations/react-hooks/primitives/use-stream.js.map +1 -1
- package/dist/integrations/react-hooks/primitives.js.map +1 -1
- package/dist/integrations/react-hooks/provider.js.map +1 -1
- package/dist/integrations/react-hooks/wagmi/index.js.map +1 -1
- package/dist/integrations/react-hooks/wallet-provider-ref.js.map +1 -1
- package/dist/integrations/wagmi/index.js.map +1 -1
- package/dist/integrations/wagmi/layers.js.map +1 -1
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/numbers.js.map +1 -1
- package/dist/internal/schedule.js.map +1 -1
- package/dist/internal/stream-adapters.js.map +1 -1
- package/dist/internal/viem-effect.js.map +1 -1
- package/dist/nonce/index.js.map +1 -1
- package/dist/nonce/manager.js.map +1 -1
- package/dist/nonce/service.js.map +1 -1
- package/dist/nonce/service.test.integration.js.map +1 -1
- package/dist/platform/browser/cursor-store/index.js.map +1 -1
- package/dist/platform/browser/cursor-store/local-storage.js.map +1 -1
- package/dist/platform/browser/index.js.map +1 -1
- package/dist/platform/browser/layers.js.map +1 -1
- package/dist/platform/browser/storage/errors.js.map +1 -1
- package/dist/platform/browser/storage/index.js.map +1 -1
- package/dist/platform/browser/storage/local-storage.js.map +1 -1
- package/dist/platform/browser/tx-persistence/index.js.map +1 -1
- package/dist/platform/browser/tx-persistence/persistence.js.map +1 -1
- package/dist/platform/browser/tx-store/errors.js.map +1 -1
- package/dist/platform/browser/tx-store/index.js.map +1 -1
- package/dist/platform/browser/tx-store/local-storage.js.map +1 -1
- package/dist/platform/browser/tx-store/store.js.map +1 -1
- package/dist/platform/browser/tx-store/types.js.map +1 -1
- package/dist/presets/index.js.map +1 -1
- package/dist/presets/layers.js.map +1 -1
- package/dist/presets/transports.js.map +1 -1
- package/dist/query/chain-head.js.map +1 -1
- package/dist/query/client.js.map +1 -1
- package/dist/query/client.test.integration.js.map +1 -1
- package/dist/query/contract-query.js.map +1 -1
- package/dist/query/contract-query.test.integration.js.map +1 -1
- package/dist/query/index.js.map +1 -1
- package/dist/query/multicall-batcher.js.map +1 -1
- package/dist/react-hooks/index.d.ts +3 -1
- package/dist/react-hooks/index.d.ts.map +1 -1
- package/dist/react-hooks/index.js +3 -1
- package/dist/react-hooks/index.js.map +1 -1
- package/dist/react-hooks/safe-origins.d.ts +8 -0
- package/dist/react-hooks/safe-origins.d.ts.map +1 -0
- package/dist/react-hooks/safe-origins.js +124 -0
- package/dist/react-hooks/safe-origins.js.map +1 -0
- package/dist/react-hooks/use-is-host-safe-multisig.d.ts +2 -0
- package/dist/react-hooks/use-is-host-safe-multisig.d.ts.map +1 -0
- package/dist/react-hooks/use-is-host-safe-multisig.js +16 -0
- package/dist/react-hooks/use-is-host-safe-multisig.js.map +1 -0
- package/dist/react-hooks/use-is-wallet-safe-multisig.d.ts +2 -0
- package/dist/react-hooks/use-is-wallet-safe-multisig.d.ts.map +1 -0
- package/dist/react-hooks/use-is-wallet-safe-multisig.js +24 -0
- package/dist/react-hooks/use-is-wallet-safe-multisig.js.map +1 -0
- package/dist/react-hooks/use-safe-context.d.ts.map +1 -1
- package/dist/react-hooks/use-safe-context.js.map +1 -1
- package/dist/react-hooks/wagmi/index.js.map +1 -1
- package/dist/rpc/cache.js.map +1 -1
- package/dist/rpc/circuit-breaker.js.map +1 -1
- package/dist/rpc/dedup.js.map +1 -1
- package/dist/rpc/index.js.map +1 -1
- package/dist/rpc/retry.js.map +1 -1
- package/dist/rpc/routemesh.js.map +1 -1
- package/dist/safe/adapter.js.map +1 -1
- package/dist/safe/detection.js.map +1 -1
- package/dist/safe/detection.test.integration.js.map +1 -1
- package/dist/safe/errors.js.map +1 -1
- package/dist/safe/index.js.map +1 -1
- package/dist/safe/live.js.map +1 -1
- package/dist/safe/service.js.map +1 -1
- package/dist/safe/service.test.integration.js.map +1 -1
- package/dist/safe/simulation/abis.d.ts.map +1 -1
- package/dist/safe/simulation/abis.js.map +1 -1
- package/dist/safe/simulation/addresses.d.ts.map +1 -1
- package/dist/safe/simulation/addresses.js +40 -26
- package/dist/safe/simulation/addresses.js.map +1 -1
- package/dist/safe/simulation/encoding.js.map +1 -1
- package/dist/safe/simulation/errors.js.map +1 -1
- package/dist/safe/simulation/index.js.map +1 -1
- package/dist/safe/simulation/internal/calldata/calldata.d.ts +5 -0
- package/dist/safe/simulation/internal/calldata/calldata.d.ts.map +1 -0
- package/dist/safe/simulation/internal/calldata/calldata.js +17 -0
- package/dist/safe/simulation/internal/calldata/calldata.js.map +1 -0
- package/dist/safe/simulation/internal/calldata/index.d.ts +2 -0
- package/dist/safe/simulation/internal/calldata/index.d.ts.map +1 -0
- package/dist/safe/simulation/internal/calldata/index.js +2 -0
- package/dist/safe/simulation/internal/calldata/index.js.map +1 -0
- package/dist/safe/simulation/internal/contracts/contracts.d.ts +5 -0
- package/dist/safe/simulation/internal/contracts/contracts.d.ts.map +1 -0
- package/dist/safe/simulation/internal/contracts/contracts.js +25 -0
- package/dist/safe/simulation/internal/contracts/contracts.js.map +1 -0
- package/dist/safe/simulation/internal/contracts/index.d.ts +2 -0
- package/dist/safe/simulation/internal/contracts/index.d.ts.map +1 -0
- package/dist/safe/simulation/internal/contracts/index.js +2 -0
- package/dist/safe/simulation/internal/contracts/index.js.map +1 -0
- package/dist/safe/simulation/internal/evaluation/evaluation.d.ts +6 -0
- package/dist/safe/simulation/internal/evaluation/evaluation.d.ts.map +1 -0
- package/dist/safe/simulation/internal/evaluation/evaluation.js +20 -0
- package/dist/safe/simulation/internal/evaluation/evaluation.js.map +1 -0
- package/dist/safe/simulation/internal/evaluation/index.d.ts +2 -0
- package/dist/safe/simulation/internal/evaluation/index.d.ts.map +1 -0
- package/dist/safe/simulation/internal/evaluation/index.js +2 -0
- package/dist/safe/simulation/internal/evaluation/index.js.map +1 -0
- package/dist/safe/simulation/internal/execution/execution.d.ts +9 -0
- package/dist/safe/simulation/internal/execution/execution.d.ts.map +1 -0
- package/dist/safe/simulation/internal/execution/execution.js +65 -0
- package/dist/safe/simulation/internal/execution/execution.js.map +1 -0
- package/dist/safe/simulation/internal/execution/index.d.ts +2 -0
- package/dist/safe/simulation/internal/execution/index.d.ts.map +1 -0
- package/dist/safe/simulation/internal/execution/index.js +2 -0
- package/dist/safe/simulation/internal/execution/index.js.map +1 -0
- package/dist/safe/simulation/internal/limits/index.d.ts +2 -0
- package/dist/safe/simulation/internal/limits/index.d.ts.map +1 -0
- package/dist/safe/simulation/internal/limits/index.js +2 -0
- package/dist/safe/simulation/internal/limits/index.js.map +1 -0
- package/dist/safe/simulation/internal/limits/limits.d.ts +5 -0
- package/dist/safe/simulation/internal/limits/limits.d.ts.map +1 -0
- package/dist/safe/simulation/internal/limits/limits.js +18 -0
- package/dist/safe/simulation/internal/limits/limits.js.map +1 -0
- package/dist/safe/simulation/internal/types/index.d.ts +2 -0
- package/dist/safe/simulation/internal/types/index.d.ts.map +1 -0
- package/dist/safe/simulation/internal/types/index.js +2 -0
- package/dist/safe/simulation/internal/types/index.js.map +1 -0
- package/dist/safe/simulation/internal/types/types.d.ts +11 -0
- package/dist/safe/simulation/internal/types/types.d.ts.map +1 -0
- package/dist/safe/simulation/internal/types/types.js +2 -0
- package/dist/safe/simulation/internal/types/types.js.map +1 -0
- package/dist/safe/simulation/internal/validation/index.d.ts +2 -0
- package/dist/safe/simulation/internal/validation/index.d.ts.map +1 -0
- package/dist/safe/simulation/internal/validation/index.js +2 -0
- package/dist/safe/simulation/internal/validation/index.js.map +1 -0
- package/dist/safe/simulation/internal/validation/validation.d.ts +5 -0
- package/dist/safe/simulation/internal/validation/validation.d.ts.map +1 -0
- package/dist/safe/simulation/internal/validation/validation.js +27 -0
- package/dist/safe/simulation/internal/validation/validation.js.map +1 -0
- package/dist/safe/simulation/service.d.ts +1 -1
- package/dist/safe/simulation/service.d.ts.map +1 -1
- package/dist/safe/simulation/service.js +12 -127
- package/dist/safe/simulation/service.js.map +1 -1
- package/dist/safe/simulation/types.js.map +1 -1
- package/dist/safe/types.js.map +1 -1
- package/dist/signature/errors.js.map +1 -1
- package/dist/signature/index.js.map +1 -1
- package/dist/signature/service.js.map +1 -1
- package/dist/signature/service.test.integration.js.map +1 -1
- package/dist/signature/utils.js.map +1 -1
- package/dist/simulation/errors.js.map +1 -1
- package/dist/simulation/index.js.map +1 -1
- package/dist/simulation/service.js.map +1 -1
- package/dist/simulation/tenderly.js.map +1 -1
- package/dist/simulation/tenderly.test.integration.js.map +1 -1
- package/dist/simulation/types.js.map +1 -1
- package/dist/subscriptions/block-subscription.js.map +1 -1
- package/dist/subscriptions/errors.js.map +1 -1
- package/dist/subscriptions/index.js.map +1 -1
- package/dist/subscriptions/log-subscription.js.map +1 -1
- package/dist/subscriptions/pending-tx.js.map +1 -1
- package/dist/subscriptions/service.js.map +1 -1
- package/dist/telemetry/index.js.map +1 -1
- package/dist/telemetry/logger.js.map +1 -1
- package/dist/telemetry/tracer.js.map +1 -1
- package/dist/testing-kit/_fixtures/addresses.js.map +1 -1
- package/dist/testing-kit/_fixtures/receipts.js.map +1 -1
- package/dist/testing-kit/helpers.js.map +1 -1
- package/dist/testing-kit/index.js.map +1 -1
- package/dist/testing-kit/mock-balance-service.js.map +1 -1
- package/dist/testing-kit/mock-block-service.js.map +1 -1
- package/dist/testing-kit/mock-cross-chain-reader.js.map +1 -1
- package/dist/testing-kit/mock-deploy-service.js.map +1 -1
- package/dist/testing-kit/mock-erc721-service.js.map +1 -1
- package/dist/testing-kit/mock-gas-service.js.map +1 -1
- package/dist/testing-kit/mock-nonce-service.js.map +1 -1
- package/dist/testing-kit/mock-public-client.js.map +1 -1
- package/dist/testing-kit/mock-signature-service.js.map +1 -1
- package/dist/testing-kit/mock-simulation-service.js.map +1 -1
- package/dist/testing-kit/mock-subscription-service.js.map +1 -1
- package/dist/testing-kit/mock-transfer-service.js.map +1 -1
- package/dist/testing-kit/mock-wallet-client.js.map +1 -1
- package/dist/testing-kit/mock-wallet-provider.js.map +1 -1
- package/dist/testing-kit/test-layer.js.map +1 -1
- package/dist/transfer/index.js.map +1 -1
- package/dist/transfer/service.js.map +1 -1
- package/dist/tx/fees.js.map +1 -1
- package/dist/tx/index.js.map +1 -1
- package/dist/tx/manager.js.map +1 -1
- package/dist/tx/manager.test.integration.js.map +1 -1
- package/dist/tx/policy.js.map +1 -1
- package/dist/tx/replacement.js.map +1 -1
- package/dist/tx/tracker.js.map +1 -1
- package/dist/types/abi.js.map +1 -1
- package/dist/types/index.js.map +1 -1
- package/dist/types/params.js.map +1 -1
- package/dist/types/tx-overrides.js.map +1 -1
- package/dist/wagmi/index.js.map +1 -1
- package/dist/wagmi/layers.js.map +1 -1
- package/dist/wallet/errors.js.map +1 -1
- package/dist/wallet/index.js.map +1 -1
- package/dist/wallet/lifecycle.js.map +1 -1
- package/dist/wallet/operations.js.map +1 -1
- package/dist/wallet/provider-ref.js.map +1 -1
- package/dist/wallet/service.js.map +1 -1
- package/dist/wallet/types.js.map +1 -1
- package/package.json +22 -10
- package/dist/react-hooks/use-is-safe-multisig.d.ts +0 -2
- package/dist/react-hooks/use-is-safe-multisig.d.ts.map +0 -1
- package/dist/react-hooks/use-is-safe-multisig.js +0 -44
- package/dist/react-hooks/use-is-safe-multisig.js.map +0 -1
package/dist/safe/service.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.js","sourceRoot":"","sources":["../../src/safe/service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AA4EjC,MAAM,OAAO,eAAgB,SAAQ,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,EAG7D;CAAG"}
|
|
1
|
+
{"version":3,"file":"service.js","sourceRoot":"","sources":["../../src/safe/service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AA4EjC,MAAM,OAAO,eAAgB,SAAQ,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,EAG7D;CAAG","sourcesContent":["import type { Effect, Option } from \"effect\";\nimport { Context } from \"effect\";\nimport type { Hash, Hex } from \"viem\";\nimport type {\n ClientNotFoundError,\n ReceiptTimeoutError,\n TransactionFailedError,\n} from \"@/src/core/errors/index.js\";\nimport type {\n OffchainSignatureTimeoutError,\n SafeInfoUnavailableError,\n SafeSettingsError,\n SafeTxExecutionTimeoutError,\n SafeTxLookupError,\n SafeTxSubmissionError,\n SignTypedDataError,\n} from \"./errors.js\";\nimport type {\n EIP712TypedData,\n OffchainSignaturePolicy,\n OffchainSignatureResult,\n SafeInfo,\n SafeTransaction,\n SafeTxResult,\n SafeTxSubmission,\n SafeWaitPolicy,\n SignTypedDataResult,\n} from \"./types.js\";\n\nexport type SafeAppsServiceShape = {\n /** Get Safe info (cached after first call) */\n readonly getInfo: () => Effect.Effect<SafeInfo, SafeInfoUnavailableError>;\n\n /** Send transactions to Safe for execution */\n readonly sendTransactions: (\n txs: readonly SafeTransaction[],\n params?: { safeTxGas?: number }\n ) => Effect.Effect<SafeTxSubmission, SafeTxSubmissionError>;\n\n /** Get Safe transaction details by safeTxHash */\n readonly getTransaction: (\n safeTxHash: Hash\n ) => Effect.Effect<{ txHash: Option.Option<Hash>; status: string }, SafeTxLookupError>;\n\n /** Wait for Safe tx to execute and return receipt */\n readonly waitForTransactionReceipt: (\n safeTxHash: Hash,\n policy?: SafeWaitPolicy\n ) => Effect.Effect<\n SafeTxResult,\n | SafeTxExecutionTimeoutError\n | SafeTxLookupError\n | TransactionFailedError\n | ReceiptTimeoutError\n | ClientNotFoundError\n >;\n\n /** Sign typed data (returns discriminated union based on Safe settings) */\n readonly signTypedData: (\n typedData: EIP712TypedData\n ) => Effect.Effect<SignTypedDataResult, SignTypedDataError>;\n\n /** Get off-chain signature (returns Option.none if not yet available) */\n readonly getOffchainSignature: (\n messageHash: Hex\n ) => Effect.Effect<Option.Option<Hex>, SafeTxLookupError>;\n\n /** Poll for off-chain signature until available or timeout */\n readonly pollOffchainSignature: (\n messageHash: Hex,\n policy?: OffchainSignaturePolicy\n ) => Effect.Effect<OffchainSignatureResult, OffchainSignatureTimeoutError | SafeTxLookupError>;\n\n /** Enable off-chain signing mode */\n readonly enableOffchainSigning: () => Effect.Effect<void, SafeSettingsError>;\n};\n\nexport class SafeAppsService extends Context.Tag(\"ew3/SafeApps\")<\n SafeAppsService,\n SafeAppsServiceShape\n>() {}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.test.integration.js","sourceRoot":"","sources":["../../src/safe/service.test.integration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAE/C,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AACvF,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAI/C,MAAM,iBAAiB,GAAG,YAAY,CAAC;AACvC,MAAM,iBAAiB,GACrB,oEAA4E,CAAC;AAC/E,MAAM,iBAAiB,GACrB,oEAA2E,CAAC;AAC9E,MAAM,cAAc,GAAG,aAAoB,CAAC;AAE5C,MAAM,YAAY,GAAuB;IACvC,SAAS,EAAE,SAAS;IACpB,WAAW,EAAE,IAAI;IACjB,eAAe,EAAE,IAAI;IACrB,iBAAiB,EAAE,UAAU;IAC7B,iBAAiB,EAAE,EAAE;IACrB,IAAI,EAAE,QAAQ;IACd,OAAO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AAC,yBAAyB,EAAE,GAAG,EAAE,CACxC,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;YAClB,MAAM,OAAO,GAAG,KAAK,CAAC,CAAC,eAAe,CAAC;YACvC,KAAK,CAAC,CAAC,OAAO,CAAC,qBAAqB,EAAE,CAAC;QAEzC,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,uBAAuB,CAAC,EAAE,CAAC,CAAC,CAAC,CACrD,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { describe, expect, it } from \"@effect/vitest\";\nimport { Effect, Layer, Option } from \"effect\";\nimport type { Hash, Hex, TransactionReceipt } from \"viem\";\nimport { MIN_TX_GAS } from \"@/src/constants/index.js\";\nimport { TEST_ADDRESS, TEST_CHAIN_ID, TEST_TX_HASH } from \"@/src/testing-kit/index.js\";\nimport { SafeAppsService } from \"./service.js\";\nimport type { SafeInfo } from \"./types.js\";\n\n// Test fixtures\nconst TEST_SAFE_ADDRESS = TEST_ADDRESS;\nconst TEST_SAFE_TX_HASH =\n \"0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef\" as Hash;\nconst TEST_MESSAGE_HASH =\n \"0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890\" as Hex;\nconst TEST_SIGNATURE = \"0xsignature\" as Hex;\n\nconst TEST_RECEIPT: TransactionReceipt = {\n blockHash: \"0xblock\",\n blockNumber: 123n,\n contractAddress: null,\n cumulativeGasUsed: MIN_TX_GAS,\n effectiveGasPrice: 1n,\n from: \"0xfrom\",\n gasUsed: MIN_TX_GAS,\n logs: [],\n logsBloom: \"0x\",\n status: \"success\",\n to: \"0xto\",\n transactionHash: TEST_TX_HASH,\n transactionIndex: 0,\n type: \"0x2\",\n};\n\n// Mock SafeAppsService for testing without actual SDK\nconst makeMockSafeAppsService = (config: {\n getInfoResult?: SafeInfo;\n sendTxResult?: { safeTxHash: Hash };\n getTxResult?: { txHash: Option.Option<Hash>; status: string };\n signTypedDataResult?:\n | { _tag: \"Offchain\"; messageHash: Hex }\n | { _tag: \"Onchain\"; safeTxHash: Hash };\n offchainSignature?: Option.Option<Hex>;\n}) => {\n const defaultInfo: SafeInfo = {\n chainId: TEST_CHAIN_ID,\n safeAddress: TEST_SAFE_ADDRESS,\n };\n\n return Layer.succeed(\n SafeAppsService,\n SafeAppsService.of({\n enableOffchainSigning: () => Effect.void,\n getInfo: () => Effect.succeed(config.getInfoResult ?? defaultInfo),\n getOffchainSignature: () => Effect.succeed(config.offchainSignature ?? Option.none()),\n getTransaction: () =>\n Effect.succeed(\n config.getTxResult ?? {\n status: \"AWAITING_EXECUTION\",\n txHash: Option.some(TEST_TX_HASH),\n }\n ),\n pollOffchainSignature: (messageHash) =>\n Effect.succeed({ messageHash, signature: TEST_SIGNATURE }),\n sendTransactions: () =>\n Effect.succeed({\n chainId: TEST_CHAIN_ID,\n safeAddress: TEST_SAFE_ADDRESS,\n safeTxHash: config.sendTxResult?.safeTxHash ?? TEST_SAFE_TX_HASH,\n }),\n signTypedData: () =>\n Effect.succeed(\n config.signTypedDataResult ?? {\n _tag: \"Onchain\" as const,\n safeTxHash: TEST_SAFE_TX_HASH,\n }\n ),\n waitForTransactionReceipt: (safeTxHash) =>\n Effect.succeed({\n chainId: TEST_CHAIN_ID,\n onchainHash: TEST_TX_HASH,\n receipt: TEST_RECEIPT,\n safeAddress: TEST_SAFE_ADDRESS,\n safeTxHash,\n }),\n })\n );\n};\n\ndescribe(\"SafeAppsService\", () => {\n describe(\"getInfo\", () => {\n it.effect(\"returns Safe info with address and chainId\", () =>\n Effect.gen(function* () {\n const service = yield* SafeAppsService;\n const info = yield* service.getInfo();\n\n expect(info.safeAddress).toBe(TEST_SAFE_ADDRESS);\n expect(info.chainId).toBe(TEST_CHAIN_ID);\n }).pipe(Effect.provide(makeMockSafeAppsService({})))\n );\n });\n\n describe(\"sendTransactions\", () => {\n it.effect(\"returns safeTxHash with safeAddress and chainId\", () =>\n Effect.gen(function* () {\n const service = yield* SafeAppsService;\n const result = yield* service.sendTransactions([\n { data: \"0x\", to: TEST_ADDRESS, value: 0n },\n ]);\n\n expect(result.safeTxHash).toBe(TEST_SAFE_TX_HASH);\n expect(result.safeAddress).toBe(TEST_SAFE_ADDRESS);\n expect(result.chainId).toBe(TEST_CHAIN_ID);\n }).pipe(Effect.provide(makeMockSafeAppsService({})))\n );\n });\n\n describe(\"getTransaction\", () => {\n it.effect(\"returns txHash as Option when executed\", () =>\n Effect.gen(function* () {\n const service = yield* SafeAppsService;\n const result = yield* service.getTransaction(TEST_SAFE_TX_HASH);\n\n expect(Option.isSome(result.txHash)).toBe(true);\n if (Option.isSome(result.txHash)) {\n expect(result.txHash.value).toBe(TEST_TX_HASH);\n }\n }).pipe(Effect.provide(makeMockSafeAppsService({})))\n );\n\n it.effect(\"returns Option.none when not yet executed\", () =>\n Effect.gen(function* () {\n const service = yield* SafeAppsService;\n const result = yield* service.getTransaction(TEST_SAFE_TX_HASH);\n\n expect(Option.isNone(result.txHash)).toBe(true);\n expect(result.status).toBe(\"AWAITING_CONFIRMATIONS\");\n }).pipe(\n Effect.provide(\n makeMockSafeAppsService({\n getTxResult: {\n status: \"AWAITING_CONFIRMATIONS\",\n txHash: Option.none(),\n },\n })\n )\n )\n );\n });\n\n describe(\"waitForTransactionReceipt\", () => {\n it.effect(\"returns SafeTxResult with receipt\", () =>\n Effect.gen(function* () {\n const service = yield* SafeAppsService;\n const result = yield* service.waitForTransactionReceipt(TEST_SAFE_TX_HASH);\n\n expect(result.safeTxHash).toBe(TEST_SAFE_TX_HASH);\n expect(result.onchainHash).toBe(TEST_TX_HASH);\n expect(result.receipt.status).toBe(\"success\");\n expect(result.safeAddress).toBe(TEST_SAFE_ADDRESS);\n expect(result.chainId).toBe(TEST_CHAIN_ID);\n }).pipe(Effect.provide(makeMockSafeAppsService({})))\n );\n });\n\n describe(\"signTypedData\", () => {\n it.effect(\"returns Onchain variant for on-chain signing\", () =>\n Effect.gen(function* () {\n const service = yield* SafeAppsService;\n const result = yield* service.signTypedData({\n domain: { chainId: 1, name: \"Test\" },\n message: { value: \"test\" },\n types: { Test: [{ name: \"value\", type: \"string\" }] },\n });\n\n expect(result._tag).toBe(\"Onchain\");\n if (result._tag === \"Onchain\") {\n expect(result.safeTxHash).toBe(TEST_SAFE_TX_HASH);\n }\n }).pipe(Effect.provide(makeMockSafeAppsService({})))\n );\n\n it.effect(\"returns Offchain variant for off-chain signing\", () =>\n Effect.gen(function* () {\n const service = yield* SafeAppsService;\n const result = yield* service.signTypedData({\n domain: { chainId: 1, name: \"Test\" },\n message: { value: \"test\" },\n types: { Test: [{ name: \"value\", type: \"string\" }] },\n });\n\n expect(result._tag).toBe(\"Offchain\");\n if (result._tag === \"Offchain\") {\n expect(result.messageHash).toBe(TEST_MESSAGE_HASH);\n }\n }).pipe(\n Effect.provide(\n makeMockSafeAppsService({\n signTypedDataResult: {\n _tag: \"Offchain\",\n messageHash: TEST_MESSAGE_HASH,\n },\n })\n )\n )\n );\n });\n\n describe(\"getOffchainSignature\", () => {\n it.effect(\"returns Option.none when signature not yet available\", () =>\n Effect.gen(function* () {\n const service = yield* SafeAppsService;\n const result = yield* service.getOffchainSignature(TEST_MESSAGE_HASH);\n\n expect(Option.isNone(result)).toBe(true);\n }).pipe(Effect.provide(makeMockSafeAppsService({})))\n );\n\n it.effect(\"returns Option.some when signature available\", () =>\n Effect.gen(function* () {\n const service = yield* SafeAppsService;\n const result = yield* service.getOffchainSignature(TEST_MESSAGE_HASH);\n\n expect(Option.isSome(result)).toBe(true);\n if (Option.isSome(result)) {\n expect(result.value).toBe(TEST_SIGNATURE);\n }\n }).pipe(\n Effect.provide(\n makeMockSafeAppsService({\n offchainSignature: Option.some(TEST_SIGNATURE),\n })\n )\n )\n );\n });\n\n describe(\"pollOffchainSignature\", () => {\n it.effect(\"returns signature when available\", () =>\n Effect.gen(function* () {\n const service = yield* SafeAppsService;\n const result = yield* service.pollOffchainSignature(TEST_MESSAGE_HASH);\n\n expect(result.messageHash).toBe(TEST_MESSAGE_HASH);\n expect(result.signature).toBe(TEST_SIGNATURE);\n }).pipe(Effect.provide(makeMockSafeAppsService({})))\n );\n });\n\n describe(\"enableOffchainSigning\", () => {\n it.effect(\"completes without error\", () =>\n Effect.gen(function* () {\n const service = yield* SafeAppsService;\n yield* service.enableOffchainSigning();\n // Success if no error thrown\n }).pipe(Effect.provide(makeMockSafeAppsService({})))\n );\n });\n});\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"abis.d.ts","sourceRoot":"","sources":["../../../src/safe/simulation/abis.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"abis.d.ts","sourceRoot":"","sources":["../../../src/safe/simulation/abis.ts"],"names":[],"mappings":"AAkEA,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAIX,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"abis.js","sourceRoot":"","sources":["../../../src/safe/simulation/abis.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"abis.js","sourceRoot":"","sources":["../../../src/safe/simulation/abis.ts"],"names":[],"mappings":"AAQA,MAAM,WAAW,GAAG;IAClB;QACE,MAAM,EAAE,EAAE;QACV,IAAI,EAAE,WAAW;QACjB,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,EAAE;gBACR,IAAI,EAAE,WAAW;aAClB;SACF;QACD,eAAe,EAAE,MAAM;QACvB,IAAI,EAAE,UAAU;KACjB;IACD;QACE,MAAM,EAAE;YACN,EAAE,YAAY,EAAE,SAAS,EAAE,IAAI,EAAE,gBAAgB,EAAE,IAAI,EAAE,SAAS,EAAE;YACpE,EAAE,YAAY,EAAE,OAAO,EAAE,IAAI,EAAE,iBAAiB,EAAE,IAAI,EAAE,OAAO,EAAE;SAClE;QACD,IAAI,EAAE,mB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AC","sourcesContent":["/**\n * Safe multisig ABIs for gas simulation and multi-send operations.\n *\n * @see https://github.com/safe-global/safe-deployments\n * @see https://github.com/safe-global/safe-core-sdk/issues/1182\n * @see https://ethereum.stackexchange.com/q/168410/24693\n */\n\nconst multisigAbi = [\n {\n inputs: [],\n name: \"getOwners\",\n outputs: [\n {\n name: \"\",\n type: \"address[]\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n { internalType: \"address\", name: \"targetContract\", type: \"address\" },\n { internalType: \"bytes\", name: \"calldataPayload\", type: \"bytes\" },\n ],\n name: \"simulateAndRevert\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n] as const;\n\nconst multiSendAbi = [\n {\n inputs: [{ internalType: \"bytes\", name: \"transactions\", type: \"bytes\" }],\n name: \"multiSend\",\n outputs: [],\n stateMutability: \"payable\",\n type: \"function\",\n },\n] as const;\n\nconst simulateAccessorAbi = [\n {\n inputs: [\n { internalType: \"address\", name: \"to\", type: \"address\" },\n { internalType: \"uint256\", name: \"value\", type: \"uint256\" },\n { internalType: \"bytes\", name: \"data\", type: \"bytes\" },\n {\n internalType: \"enum Enum.Operation\",\n name: \"operation\",\n type: \"uint8\",\n },\n ],\n name: \"simulate\",\n outputs: [\n { internalType: \"uint256\", name: \"estimate\", type: \"uint256\" },\n { internalType: \"bool\", name: \"success\", type: \"bool\" },\n { internalType: \"bytes\", name: \"returnData\", type: \"bytes\" },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n] as const;\n\nexport const safeAbis = {\n multiSend: multiSendAbi,\n multisig: multisigAbi,\n simulateAccessor: simulateAccessorAbi,\n} as const;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addresses.d.ts","sourceRoot":"","sources":["../../../src/safe/simulation/addresses.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"addresses.d.ts","sourceRoot":"","sources":["../../../src/safe/simulation/addresses.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAwEpC,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAmBxE;AAOD,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAmB/E"}
|
|
@@ -1,40 +1,54 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
import { abstract, arbitrum, avalanche, base, baseSepolia, berachain, blast, bsc, gnosis, lightlinkPhoenix, linea, mainnet, mode, monad, morph, optimism, polygon, scroll, sei, sepolia, sonic, unichainSepolia, xdc, zksync, } from "viem/chains";
|
|
2
|
+
const SAFE_MULTI_SEND_CHAIN_IDS = [
|
|
3
|
+
abstract.id,
|
|
4
|
+
arbitrum.id,
|
|
5
|
+
avalanche.id,
|
|
6
|
+
base.id,
|
|
7
|
+
baseSepolia.id,
|
|
8
|
+
berachain.id,
|
|
9
|
+
blast.id,
|
|
10
|
+
bsc.id,
|
|
11
|
+
gnosis.id,
|
|
12
|
+
lightlinkPhoenix.id,
|
|
13
|
+
linea.id,
|
|
14
|
+
mainnet.id,
|
|
15
|
+
mode.id,
|
|
16
|
+
monad.id,
|
|
17
|
+
morph.id,
|
|
18
|
+
optimism.id,
|
|
19
|
+
polygon.id,
|
|
20
|
+
scroll.id,
|
|
21
|
+
sei.id,
|
|
22
|
+
sepolia.id,
|
|
23
|
+
sonic.id,
|
|
24
|
+
unichainSepolia.id,
|
|
25
|
+
xdc.id,
|
|
26
|
+
zksync.id,
|
|
15
27
|
];
|
|
28
|
+
const ZK_ROLLUP_CHAIN_IDS = [abstract.id, zksync.id];
|
|
29
|
+
const CUSTOM_DEPLOYMENT_CHAIN_IDS = [lightlinkPhoenix.id, xdc.id];
|
|
16
30
|
export function getMultiSendAddress(chainId) {
|
|
31
|
+
if (!SAFE_MULTI_SEND_CHAIN_IDS.includes(chainId)) {
|
|
32
|
+
return undefined;
|
|
33
|
+
}
|
|
17
34
|
if (ZK_ROLLUP_CHAIN_IDS.includes(chainId)) {
|
|
18
|
-
return "
|
|
35
|
+
return "0xf220D3b4DFb23C4ade8C88E526C1353AbAcbC38F";
|
|
19
36
|
}
|
|
20
37
|
if (CUSTOM_DEPLOYMENT_CHAIN_IDS.includes(chainId)) {
|
|
21
|
-
return "
|
|
22
|
-
}
|
|
23
|
-
if (UNSUPPORTED_CHAIN_IDS.includes(chainId)) {
|
|
24
|
-
return undefined;
|
|
38
|
+
return "0x40A2aCCbd92BCA938b02010E17A5b8929b49130D";
|
|
25
39
|
}
|
|
26
|
-
return "
|
|
40
|
+
return "0x9641d764fc13c8B624c04430C7356C1C7C8102e2";
|
|
27
41
|
}
|
|
28
42
|
export function getSimulateAccessorAddress(chainId) {
|
|
43
|
+
if (!SAFE_MULTI_SEND_CHAIN_IDS.includes(chainId)) {
|
|
44
|
+
return undefined;
|
|
45
|
+
}
|
|
29
46
|
if (ZK_ROLLUP_CHAIN_IDS.includes(chainId)) {
|
|
30
|
-
return "
|
|
47
|
+
return "0x4191E2e12E8BC5002424CE0c51f9947b02675a44";
|
|
31
48
|
}
|
|
32
49
|
if (CUSTOM_DEPLOYMENT_CHAIN_IDS.includes(chainId)) {
|
|
33
|
-
return "
|
|
34
|
-
}
|
|
35
|
-
if (UNSUPPORTED_CHAIN_IDS.includes(chainId)) {
|
|
36
|
-
return undefined;
|
|
50
|
+
return "0x59AD6735bCd8152B84860Cb256dD9e96b85F69Da";
|
|
37
51
|
}
|
|
38
|
-
return "
|
|
52
|
+
return "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199";
|
|
39
53
|
}
|
|
40
54
|
//# sourceMappingURL=addresses.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addresses.js","sourceRoot":"","sources":["../../../src/safe/simulation/addresses.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"addresses.js","sourceRoot":"","sources":["../../../src/safe/simulation/addresses.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,IAAI,EACJ,WAAW,EACX,SAAS,EACT,KAAK,EACL,GAAG,EACH,MAAM,EACN,gBAAgB,EAChB,KAAK,EACL,OAAO,EACP,IAAI,EACJ,KAAK,EACL,KAAK,EACL,QAAQ,EACR,OAAO,EACP,MAAM,EACN,GAAG,EACH,OAAO,EACP,KAAK,EACL,eAAe,EACf,GAAG,EACH,MAAM,GACP,MAAM,aAAa,CAAC;AAQrB,MAAM,yBAAyB,GAAG;IAChC,QAAQ,CAAC,EAAE;IACX,QAAQ,CAAC,EAAE;IACX,SAAS,CAAC,EAAE;IACZ,IAAI,CAAC,EAAE;IACP,WAAW,CAAC,EAAE;IACd,SAAS,CAAC,EAAE;IACZ,KAAK,CAAC,EAAE;IACR,GAAG,CAAC,EAAE;IACN,MAAM,CAAC,EAAE;IACT,gBAAgB,CAAC,EAAE;IACnB,KAAK,CAAC,EAAE;IACR,OAAO,CAAC,EAAE;IACV,IAAI,CAAC,EAAE;IACP,KAAK,CAAC,EAAE;IACR,KAAK,CAAC,EAAE;IACR,QAAQ,CAAC,EAAE;IACX,OAAO,CAAC,EAAE;IACV,MAAM,CAAC,EAAE;IACT,GAAG,CAAC,EAAE;IACN,OAAO,CAAC,EAAE;IACV,KAAK,CAAC,EAAE;IACR,eAAe,CAAC,EAAE;IAClB,GAAG,CAAC,EAAE;IACN,MAAM,CAAC,EAAE;CACD,CAAC;AAGX,MAAM,mBAAmB,GAAG,CAAC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC,EAAE,CAAU,CAAC;AAG9D,MAAM,2BAA2B,GAAG,CAAC,gBAAgB,CAAC,EAAE,EAAE,GAAG,CAAC,EAAE,CAAU,CAAC;AAO3E,MAAM,UAAU,mBAAmB,CAAC,OAAe;IACjD,IAAI,CAAC,yBAAyB,CAAC,QAAQ,CAAC,OAAqD,CAAC,EAAE,CAAC;QAC/F,OAAO,SAAS,CAAC;IACnB,CAAC;IAGD,IAAI,mBAAmB,CAAC,QAAQ,CAAC,OAA+C,CAAC,EAAE,CAAC;QAClF,OAAO,4CAA4C,CAAC;IACtD,CAAC;IAGD,IACE,2BAA2B,CAAC,QAAQ,CAAC,OAAuD,CAAC,EAC7F,CAAC;QACD,OAAO,4CAA4C,CAAC;IACtD,CAAC;IAGD,OAAO,4CAA4C,CAAC;AACtD,CAAC;AAOD,MAAM,UAAU,0BAA0B,CAAC,OAAe;IACxD,IAAI,CAAC,yBAAyB,CAAC,QAAQ,CAAC,OAAqD,CAAC,EAAE,CAAC;QAC/F,OAAO,SAAS,CAAC;IACnB,CAAC;IAGD,IAAI,mBAAmB,CAAC,QAAQ,CAAC,OAA+C,CAAC,EAAE,CAAC;QAClF,OAAO,4CAA4C,CAAC;IACtD,CAAC;IAGD,IACE,2BAA2B,CAAC,QAAQ,CAAC,OAAuD,CAAC,EAC7F,CAAC;QACD,OAAO,4CAA4C,CAAC;IACtD,CAAC;IAGD,OAAO,4CAA4C,CAAC;AACtD,CAAC","sourcesContent":["/**\n * Safe contract addresses for gas simulation and multi-send operations.\n *\n * @see https://github.com/safe-global/safe-deployments/blob/main/src/assets/v1.4.1/multi_send_call_only.json\n * @see https://github.com/safe-global/safe-deployments/blob/main/src/assets/v1.4.1/simulate_tx_accessor.json\n */\nimport type { Address } from \"viem\";\nimport {\n abstract,\n arbitrum,\n avalanche,\n base,\n baseSepolia,\n berachain,\n blast,\n bsc,\n gnosis,\n lightlinkPhoenix,\n linea,\n mainnet,\n mode,\n monad,\n morph,\n optimism,\n polygon,\n scroll,\n sei,\n sepolia,\n sonic,\n unichainSepolia,\n xdc,\n zksync,\n} from \"viem/chains\";\n\n/**\n * Chain IDs for address resolution.\n * These are defined as constants for clarity and maintainability.\n */\n\n/** Chains where Safe MultiSend is available (sourced from old-ui) */\nconst SAFE_MULTI_SEND_CHAIN_IDS = [\n abstract.id,\n arbitrum.id,\n avalanche.id,\n base.id,\n baseSepolia.id,\n berachain.id,\n blast.id,\n bsc.id,\n gnosis.id,\n lightlinkPhoenix.id,\n linea.id,\n mainnet.id,\n mode.id,\n monad.id,\n morph.id,\n optimism.id,\n polygon.id,\n scroll.id,\n sei.id,\n sepolia.id,\n sonic.id,\n unichainSepolia.id,\n xdc.id,\n zksync.id,\n] as const;\n\n/** ZK rollups with custom Safe deployments */\nconst ZK_ROLLUP_CHAIN_IDS = [abstract.id, zksync.id] as const;\n\n/** Chains with custom (non-canonical) Safe deployments */\nconst CUSTOM_DEPLOYMENT_CHAIN_IDS = [lightlinkPhoenix.id, xdc.id] as const;\n\n/**\n * Get the MultiSend contract address for a given chain.\n *\n * Returns undefined for chains where Safe is not deployed.\n */\nexport function getMultiSendAddress(chainId: number): Address | undefined {\n if (!SAFE_MULTI_SEND_CHAIN_IDS.includes(chainId as (typeof SAFE_MULTI_SEND_CHAIN_IDS)[number])) {\n return undefined;\n }\n\n // ZK rollups with custom deployments (Abstract, ZKsync)\n if (ZK_ROLLUP_CHAIN_IDS.includes(chainId as (typeof ZK_ROLLUP_CHAIN_IDS)[number])) {\n return \"0xf220D3b4DFb23C4ade8C88E526C1353AbAcbC38F\";\n }\n\n // Chains with custom deployments (Lightlink, XDC)\n if (\n CUSTOM_DEPLOYMENT_CHAIN_IDS.includes(chainId as (typeof CUSTOM_DEPLOYMENT_CHAIN_IDS)[number])\n ) {\n return \"0x40A2aCCbd92BCA938b02010E17A5b8929b49130D\";\n }\n\n // Canonical deployment for all other chains\n return \"0x9641d764fc13c8B624c04430C7356C1C7C8102e2\";\n}\n\n/**\n * Get the SimulateAccessor contract address for a given chain.\n *\n * Returns undefined for chains where Safe is not deployed.\n */\nexport function getSimulateAccessorAddress(chainId: number): Address | undefined {\n if (!SAFE_MULTI_SEND_CHAIN_IDS.includes(chainId as (typeof SAFE_MULTI_SEND_CHAIN_IDS)[number])) {\n return undefined;\n }\n\n // ZK rollups with custom deployments (Abstract, ZKsync)\n if (ZK_ROLLUP_CHAIN_IDS.includes(chainId as (typeof ZK_ROLLUP_CHAIN_IDS)[number])) {\n return \"0x4191E2e12E8BC5002424CE0c51f9947b02675a44\";\n }\n\n // Chains with custom deployments (Lightlink, XDC)\n if (\n CUSTOM_DEPLOYMENT_CHAIN_IDS.includes(chainId as (typeof CUSTOM_DEPLOYMENT_CHAIN_IDS)[number])\n ) {\n return \"0x59AD6735bCd8152B84860Cb256dD9e96b85F69Da\";\n }\n\n // Canonical deployment for all other chains\n return \"0x3d4BA2E0884aa488718476ca2FB8Efc291A46199\";\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"encoding.js","sourceRoot":"","sources":["../../../src/safe/simulation/encoding.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,MAAM,CAAC;AAC7E,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AA6BrC,MAAM,UAAU,yBAAyB,CAAC,EAAuB;IAC/D,MAAM,OAAO,GAAG,YAAY,CAC1B,CAAC,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,CAAC,EACnD,CAAC,EAAE,CAAC,SAAS,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,CAC3E,CAAC;IACF,OAAO,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAC1B,CAAC;AAQD,MAAM,UAAU,eAAe,CAAC,YAAyC;IAC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ACvB,IAAI,EAAE,CAAC,UAAU,CAAC;QAClB,YAAY,EAAE,WAAW;KAC1B,CAAC,CAAC;AACL,CAAC;AAeD,MAAM,UAAU,oBAAoB,CAAC,UAAkB;IAOrD,MAAM,SAAS,GAAG,GAAG,CAAC;IACtB,IAAI,UAAU,CAAC,MAAM,GAAG,SAAS,EAAE,CAAC;QAClC,MAAM,IAAI,KAAK,CACb,qEAAqE,SAAS,gBAAgB,CAAC,SAAS,GAAG,CAAC,CAAC,GAAG,CAAC,gBAAgB,UAAU,CAAC,MAAM,gBAAgB,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,SAAS,CACpN,CAAC;IACJ,CAAC;IAED,MAAM,iBAAiB,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IAE9D,MAAM,OAAO,GAAG,mBAAmB,CACjC;QACE,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,EAAE;QACrC,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE;KAClC,EACD,KAAK,iBAAiB,EAAS,CAChC,CAAC;IAEF,OAAO;QACL,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC;QACf,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;KACpB,CAAC;AACJ,CAAC","sourcesContent":["/**\n * Encoding utilities for Safe multisig batch transactions.\n *\n * Based on Safe's multiSend encoding scheme and simulation data decoding.\n * @see https://github.com/safe-global/safe-smart-account/blob/c4859f4/contracts/common/StorageAccessible.sol#L32-L43\n * @see https://github.com/safe-global/safe-core-sdk/blob/4f4a0f6/packages/protocol-kit/src/utils/transactions/gas.ts#L353-L358\n */\nimport type { Address, Hex } from \"viem\";\nimport { decodeAbiParameters, encodeFunctionData, encodePacked } from \"viem\";\nimport { safeAbis } from \"./abis.js\";\nimport type { SafeSimulationTransaction } from \"./types.js\";\n\n/** Internal transaction format for Safe multiSend encoding */\ntype InternalTransaction = {\n data: Hex;\n operation: 0 | 1;\n to: Address;\n value: bigint;\n};\n\n/**\n * Encode a single transaction for Safe's multiSend batch execution.\n *\n * Packs transaction data into Safe's internal transaction format using tight encoding:\n * - `operation` (uint8): 0 for CALL, 1 for DELEGATECALL\n * - `to` (address): Target contract address\n * - `value` (uint256): ETH value to send\n * - `dataLength` (uint256): Byte length of calldata\n * - `data` (bytes): ABI-encoded function call\n *\n * The encoding follows Safe's multiSend contract specification where multiple transactions\n * are concatenated into a single bytes payload.\n *\n * @param tx - Transaction to encode\n * @returns Hex-encoded transaction bytes without 0x prefix (for concatenation with other transactions)\n *\n * @see https://github.com/safe-global/safe-smart-account/blob/c4859f4/contracts/common/StorageAccessible.sol#L32-L43\n */\nexport function encodeInternalTransaction(tx: InternalTransaction): string {\n const encoded = encodePacked(\n [\"uint8\", \"address\", \"uint256\", \"uint256\", \"bytes\"],\n [tx.operation, tx.to, tx.value, BigInt((tx.data.length - 2) / 2), tx.data]\n );\n return encoded.slice(2); // Remove 0x prefix for concatenation\n}\n\n/**\n * Encode multiple transactions for Safe multiSend.\n *\n * @param transactions - Array of transactions to encode\n * @returns Encoded calldata for multiSend function\n */\nexport function encodeMultiSend(transactions: SafeSimulationTransaction[]): Hex {\n const internals = transactions.map((tx) => ({\n data: tx.data,\n operation: tx.operation ?? 0,\n to: tx.to,\n value: tx.value,\n }));\n\n const packedData = `0x${internals.map(encodeInternalTransaction).join(\"\")}` as Hex;\n\n return encodeFunctionData({\n abi: safeAbis.multiSend,\n args: [packedData],\n functionName: \"multiSend\",\n });\n}\n\n/**\n * Decode simulation revert data to extract gas estimate and success flag.\n *\n * Safe uses a custom encoding scheme for the revert data. The gas limit is the 3rd EVM word,\n * and success is the 4th one. Each word is 64 hex chars (32 bytes).\n *\n * IMPORTANT: This function may throw an error when the revert data is not due to a legitimate\n * response from `simulateAndRevert`.\n *\n * @param revertData - The revert data from simulateAndRevert call\n * @returns Gas estimate and success flag\n * @throws Error if revert data is too short to contain valid gas and success data\n */\nexport function decodeSimulationData(revertData: string): {\n gas: bigint;\n success: boolean;\n} {\n // Gas estimate is at EVM word 3, success at word 4\n // Each word is 64 hex chars (32 bytes)\n // Total required: 0x prefix (2) + 128 chars (4 words) + 128 chars (2 words for gas and success) = 258 chars\n const minLength = 258;\n if (revertData.length < minLength) {\n throw new Error(\n `Invalid simulation data: revert data too short. Expected at least ${minLength} characters (${(minLength - 2) / 2} bytes), got ${revertData.length} characters (${Math.max(0, (revertData.length - 2) / 2)} bytes)`\n );\n }\n\n const gasAndSuccessData = revertData.slice(2).slice(128, 256);\n\n const decoded = decodeAbiParameters(\n [\n { name: \"estimate\", type: \"uint256\" },\n { name: \"success\", type: \"bool\" },\n ],\n `0x${gasAndSuccessData}` as Hex\n );\n\n return {\n gas: decoded[0],\n success: decoded[1],\n };\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../src/safe/simulation/errors.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGhC,MAAM,OAAO,qBAAsB,SAAQ,MAAM,CAAC,WAAW,EAAyB,CACpF,uBAAuB,EACvB;IACE,aAAa,EAAE,MAAM,CAAC,MAAM;IAC5B,YAAY,EAAE,MAAM,CAAC,MAAM;IAC3B,OAAO,EAAE,MAAM,CAAC,MAAM;IACtB,SAAS,EAAE,MAAM,CAAC,MAAM;CACzB,CACF;CAAG;AAGJ,MAAM,OAAO,yBAA0B,SAAQ,MAAM,CAAC,WAAW,EAA6B,CAC5F,2BAA2B,EAC3B;IACE,KAAK,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC;IACtC,OAAO,EAAE,MAAM,CAAC,MAAM;CACvB,CACF;CAAG;AAGJ,MAAM,OAAO,6BAA8B,SAAQ,MAAM,CAAC,W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IACE,KAAK,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC;IACtC,OAAO,EAAE,MAAM,CAAC,MAAM;CACvB,CACF;CAAG;AAGJ,MAAM,OAAO,6BAA8B,SAAQ,MAAM,CAAC,WAAW,EAAiC,CACpG,+BAA+B,EAC/B;IACE,OAAO,EAAE,MAAM,CAAC,MAAM;IACtB,OAAO,EAAE,MAAM,CAAC,MAAM;IACtB,eAAe,EAAE,MAAM,CAAC,OAAO,CAAC,WAAW,EAAE,kBAAkB,CAAC;CACjE,CACF;CAAG;AAGJ,MAAM,OAAO,4BAA6B,SAAQ,MAAM,CAAC,WAAW,EAAgC,CAClG,8BAA8B,EAC9B;IACE,UAAU,EAAE,MAAM,CAAC,MAAM;IACzB,OAAO,EAAE,MAAM,CAAC,MAAM;IACtB,OAAO,EAAE,MAAM,CAAC,MAAM;CACvB,CACF;CAAG;AAGJ,MAAM,OAAO,qBAAsB,SAAQ,MAAM,CAAC,WAAW,EAAyB,CACpF,uBAAuB,EACvB;IACE,KAAK,EAAE,MAAM,CAAC,OAAO;IACrB,OAAO,EAAE,MAAM,CAAC,MAAM;IACtB,UAAU,EAAE,MAAM,CAAC,MAAM;CAC1B,CACF;CAAG;AAGJ,MAAM,OAAO,wBAAyB,SAAQ,MAAM,CAAC,WAAW,EAA4B,CAC1F,0BAA0B,EAC1B;IACE,OAAO,EAAE,MAAM,CAAC,MAAM;IACtB,KAAK,EAAE,MAAM,CAAC,MAAM;CACrB,CACF;CAAG","sourcesContent":["/**\n * Tagged errors for Safe multisig gas simulation operations.\n *\n * These errors use Effect-TS Schema.TaggedError pattern for type-safe error handling.\n */\nimport { Schema } from \"effect\";\n\n/** Gas consumption exceeds block gas limit threshold */\nexport class GasLimitOverflowError extends Schema.TaggedError<GasLimitOverflowError>()(\n \"GasLimitOverflowError\",\n {\n blockGasLimit: Schema.BigInt,\n estimatedGas: Schema.BigInt,\n message: Schema.String,\n threshold: Schema.BigInt,\n }\n) {}\n\n/** Safe simulation failed */\nexport class SafeSimulationFailedError extends Schema.TaggedError<SafeSimulationFailedError>()(\n \"SafeSimulationFailedError\",\n {\n cause: Schema.optional(Schema.Unknown),\n message: Schema.String,\n }\n) {}\n\n/** Safe contracts not deployed on this chain */\nexport class SafeContractsNotDeployedError extends Schema.TaggedError<SafeContractsNotDeployedError>()(\n \"SafeContractsNotDeployedError\",\n {\n chainId: Schema.Number,\n message: Schema.String,\n missingContract: Schema.Literal(\"multiSend\", \"simulateAccessor\"),\n }\n) {}\n\n/** Transaction size too large */\nexport class TransactionSizeTooLargeError extends Schema.TaggedError<TransactionSizeTooLargeError>()(\n \"TransactionSizeTooLargeError\",\n {\n actualSize: Schema.Number,\n maxSize: Schema.Number,\n message: Schema.String,\n }\n) {}\n\n/** Simulation revert data decode failed */\nexport class SimulationDecodeError extends Schema.TaggedError<SimulationDecodeError>()(\n \"SimulationDecodeError\",\n {\n cause: Schema.Unknown,\n message: Schema.String,\n revertData: Schema.String,\n }\n) {}\n\n/** Invalid gas threshold percent */\nexport class InvalidGasThresholdError extends Schema.TaggedError<InvalidGasThresholdError>()(\n \"InvalidGasThresholdError\",\n {\n message: Schema.String,\n value: Schema.Number,\n }\n) {}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/safe/simulation/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAErC,OAAO,EACL,mBAAmB,EACnB,0BAA0B,GAC3B,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AACtE,OAAO,EACL,qBAAqB,EACrB,wBAAwB,EACxB,6BAA6B,EAC7B,yBAAyB,EACzB,qBAAqB,EACrB,4BAA4B,GAC7B,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,qBAAqB,EACrB,yBAAyB,GAE1B,MAAM,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/safe/simulation/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAErC,OAAO,EACL,mBAAmB,EACnB,0BAA0B,GAC3B,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AACtE,OAAO,EACL,qBAAqB,EACrB,wBAAwB,EACxB,6BAA6B,EAC7B,yBAAyB,EACzB,qBAAqB,EACrB,4BAA4B,GAC7B,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,qBAAqB,EACrB,yBAAyB,GAE1B,MAAM,cAAc,CAAC","sourcesContent":["// Errors\n\n// ABIs (for advanced usage)\nexport { safeAbis } from \"./abis.js\";\n// Address utilities\nexport {\n getMultiSendAddress,\n getSimulateAccessorAddress,\n} from \"./addresses.js\";\n// Encoding utilities\nexport { decodeSimulationData, encodeMultiSend } from \"./encoding.js\";\nexport {\n GasLimitOverflowError,\n InvalidGasThresholdError,\n SafeContractsNotDeployedError,\n SafeSimulationFailedError,\n SimulationDecodeError,\n TransactionSizeTooLargeError,\n} from \"./errors.js\";\n// Service\nexport {\n SafeSimulationService,\n SafeSimulationServiceLive,\n type SafeSimulationServiceShape,\n} from \"./service.js\";\n// Types\nexport type {\n SafeOperation,\n SafeSimulateBatchParams,\n SafeSimulationResult,\n SafeSimulationTransaction,\n} from \"./types.js\";\n"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Hex } from "viem";
|
|
2
|
+
import type { SafeSimulateBatchParams } from "../../types.js";
|
|
3
|
+
import type { SafeContracts } from "../types/index.js";
|
|
4
|
+
export declare function buildSafeCalldata(contracts: SafeContracts, transactions: SafeSimulateBatchParams["transactions"]): Hex;
|
|
5
|
+
//# sourceMappingURL=calldata.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calldata.d.ts","sourceRoot":"","sources":["../../../../../src/safe/simulation/internal/calldata/calldata.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAIhC,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAC9D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAKvD,wBAAgB,iBAAiB,CAC/B,SAAS,EAAE,aAAa,EACxB,YAAY,EAAE,uBAAuB,CAAC,cAAc,CAAC,GACpD,GAAG,CAcL"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { encodeFunctionData } from "viem";
|
|
2
|
+
import { safeAbis } from "../../abis.js";
|
|
3
|
+
import { encodeMultiSend } from "../../encoding.js";
|
|
4
|
+
export function buildSafeCalldata(contracts, transactions) {
|
|
5
|
+
const multiSendCalldata = encodeMultiSend(transactions);
|
|
6
|
+
const simulateAccessorCalldata = encodeFunctionData({
|
|
7
|
+
abi: safeAbis.simulateAccessor,
|
|
8
|
+
args: [contracts.multiSendAddr, 0n, multiSendCalldata, 1],
|
|
9
|
+
functionName: "simulate",
|
|
10
|
+
});
|
|
11
|
+
return encodeFunctionData({
|
|
12
|
+
abi: safeAbis.multisig,
|
|
13
|
+
args: [contracts.simulateAccessorAddr, simulateAccessorCalldata],
|
|
14
|
+
functionName: "simulateAndRevert",
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=calldata.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calldata.js","sourceRoot":"","sources":["../../../../../src/safe/simulation/internal/calldata/calldata.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,kBAAkB,EAAE,MAAM,MAAM,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAOpD,MAAM,UAAU,iBAAiB,CAC/B,SAAwB,EACxB,YAAqD;IAErD,MAAM,iBAAiB,GAAG,eAAe,CAAC,YAAY,CAAC,CAAC;IAExD,MAAM,wBAAwB,GAAG,kBAAkB,CAAC;QAClD,GAAG,EAAE,QAAQ,CAAC,gBAAgB;QAC9B,IAAI,EAAE,CAAC,SAAS,CAAC,aAAa,EAAE,EAAE,EAAE,iBAAiB,EAAE,CAAC,CAAC;QACzD,YAAY,EAAE,UAAU;KACzB,CAAC,CAAC;IAEH,OAAO,kBAAkB,CAAC;QACxB,GAAG,EAAE,QAAQ,CAAC,QAAQ;QACtB,IAAI,EAAE,CAAC,SAAS,CAAC,oBAAoB,EAAE,wBAAwB,CAAC;QAChE,YAAY,EAAE,mBAAmB;KAClC,CAAC,CAAC;AACL,CAAC","sourcesContent":["/**\n * Calldata construction utilities for Safe simulation.\n */\nimport type { Hex } from \"viem\";\nimport { encodeFunctionData } from \"viem\";\nimport { safeAbis } from \"../../abis.js\";\nimport { encodeMultiSend } from \"../../encoding.js\";\nimport type { SafeSimulateBatchParams } from \"../../types.js\";\nimport type { SafeContracts } from \"../types/index.js\";\n\n/**\n * Build the final simulateAndRevert calldata for Safe.\n */\nexport function buildSafeCalldata(\n contracts: SafeContracts,\n transactions: SafeSimulateBatchParams[\"transactions\"]\n): Hex {\n const multiSendCalldata = encodeMultiSend(transactions);\n\n const simulateAccessorCalldata = encodeFunctionData({\n abi: safeAbis.simulateAccessor,\n args: [contracts.multiSendAddr, 0n, multiSendCalldata, 1], // 1 = DelegateCall\n functionName: \"simulate\",\n });\n\n return encodeFunctionData({\n abi: safeAbis.multisig,\n args: [contracts.simulateAccessorAddr, simulateAccessorCalldata],\n functionName: \"simulateAndRevert\",\n });\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/safe/simulation/internal/calldata/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/safe/simulation/internal/calldata/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC","sourcesContent":["export { buildSafeCalldata } from \"./calldata.js\";\n"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Effect } from "effect";
|
|
2
|
+
import { SafeContractsNotDeployedError } from "../../errors.js";
|
|
3
|
+
import type { SafeContracts } from "../types/index.js";
|
|
4
|
+
export declare function resolveSafeContracts(chainId: number): Effect.Effect<SafeContracts, SafeContractsNotDeployedError>;
|
|
5
|
+
//# sourceMappingURL=contracts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../../../../../src/safe/simulation/internal/contracts/contracts.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,EAAE,6BAA6B,EAAE,MAAM,iBAAiB,CAAC;AAChE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAKvD,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,MAAM,GACd,MAAM,CAAC,MAAM,CAAC,aAAa,EAAE,6BAA6B,CAAC,CA2B7D"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Effect } from "effect";
|
|
2
|
+
import { getMultiSendAddress, getSimulateAccessorAddress } from "../../addresses.js";
|
|
3
|
+
import { SafeContractsNotDeployedError } from "../../errors.js";
|
|
4
|
+
export function resolveSafeContracts(chainId) {
|
|
5
|
+
return Effect.gen(function* () {
|
|
6
|
+
const multiSendAddr = getMultiSendAddress(chainId);
|
|
7
|
+
const simulateAccessorAddr = getSimulateAccessorAddress(chainId);
|
|
8
|
+
if (!multiSendAddr) {
|
|
9
|
+
return yield* Effect.fail(new SafeContractsNotDeployedError({
|
|
10
|
+
chainId,
|
|
11
|
+
message: "MultiSend contract not deployed on this chain",
|
|
12
|
+
missingContract: "multiSend",
|
|
13
|
+
}));
|
|
14
|
+
}
|
|
15
|
+
if (!simulateAccessorAddr) {
|
|
16
|
+
return yield* Effect.fail(new SafeContractsNotDeployedError({
|
|
17
|
+
chainId,
|
|
18
|
+
message: "SimulateAccessor contract not deployed on this chain",
|
|
19
|
+
missingContract: "simulateAccessor",
|
|
20
|
+
}));
|
|
21
|
+
}
|
|
22
|
+
return { multiSendAddr, simulateAccessorAddr };
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=contracts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contracts.js","sourceRoot":"","sources":["../../../../../src/safe/simulation/internal/contracts/contracts.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,mBAAmB,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;AACrF,OAAO,EAAE,6BAA6B,EAAE,MAAM,iBAAiB,CAAC;AAMhE,MAAM,UAAU,oBAAoB,CAClC,OAAe;IAEf,OAAO,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;QACzB,MAAM,aAAa,GAAG,mBAAmB,CAAC,OAAO,CAAC,CAAC;QACnD,MAAM,oBAAoB,GAAG,0BAA0B,CAAC,OAAO,CAAC,CAAC;QAEjE,IAAI,CAAC,aAAa,EAAE,CAAC;YACnB,OAAO,KAAK,CAAC,CAAC,MAAM,CAAC,IAAI,CACvB,IAAI,6BAA6B,CAAC;gBAChC,OAAO;gBACP,OAAO,EAAE,+CAA+C;gBACxD,eAAe,EAAE,WAAW;aAC7B,CAAC,CACH,CAAC;QACJ,CAAC;QAED,IAAI,CAAC,oBAAoB,EAAE,CAAC;YAC1B,OAAO,KAAK,CAAC,CAAC,MAAM,CAAC,IAAI,CACvB,IAAI,6BAA6B,CAAC;gBAChC,OAAO;gBACP,OAAO,EAAE,sDAAsD;gBAC/D,eAAe,EAAE,kBAAkB;aACpC,CAAC,CACH,CAAC;QACJ,CAAC;QAED,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAE,CAAC;IACjD,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["/**\n * Resolve contract addresses needed to construct Safe simulation calldata.\n */\nimport { Effect } from \"effect\";\nimport { getMultiSendAddress, getSimulateAccessorAddress } from \"../../addresses.js\";\nimport { SafeContractsNotDeployedError } from \"../../errors.js\";\nimport type { SafeContracts } from \"../types/index.js\";\n\n/**\n * Resolve the Safe helper contract addresses for the chain.\n */\nexport function resolveSafeContracts(\n chainId: number\n): Effect.Effect<SafeContracts, SafeContractsNotDeployedError> {\n return Effect.gen(function* () {\n const multiSendAddr = getMultiSendAddress(chainId);\n const simulateAccessorAddr = getSimulateAccessorAddress(chainId);\n\n if (!multiSendAddr) {\n return yield* Effect.fail(\n new SafeContractsNotDeployedError({\n chainId,\n message: \"MultiSend contract not deployed on this chain\",\n missingContract: \"multiSend\",\n })\n );\n }\n\n if (!simulateAccessorAddr) {\n return yield* Effect.fail(\n new SafeContractsNotDeployedError({\n chainId,\n message: \"SimulateAccessor contract not deployed on this chain\",\n missingContract: \"simulateAccessor\",\n })\n );\n }\n\n return { multiSendAddr, simulateAccessorAddr };\n });\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/safe/simulation/internal/contracts/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/safe/simulation/internal/contracts/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC","sourcesContent":["export { resolveSafeContracts } from \"./contracts.js\";\n"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Effect } from "effect";
|
|
2
|
+
import { GasLimitOverflowError, SafeSimulationFailedError } from "../../errors.js";
|
|
3
|
+
import type { SafeSimulationResult } from "../../types.js";
|
|
4
|
+
import type { LatestBlock, SimulationDecoded } from "../types/index.js";
|
|
5
|
+
export declare function evaluateSimulationResult(result: SimulationDecoded, block: LatestBlock, gasThresholdPercent?: number): Effect.Effect<SafeSimulationResult, GasLimitOverflowError | SafeSimulationFailedError>;
|
|
6
|
+
//# sourceMappingURL=evaluation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"evaluation.d.ts","sourceRoot":"","sources":["../../../../../src/safe/simulation/internal/evaluation/evaluation.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,qBAAqB,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAC;AACnF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAKxE,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,iBAAiB,EACzB,KAAK,EAAE,WAAW,EAClB,mBAAmB,CAAC,EAAE,MAAM,GAC3B,MAAM,CAAC,MAAM,CAAC,oBAAoB,EAAE,qBAAqB,GAAG,yBAAyB,CAAC,CAwBxF"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Effect } from "effect";
|
|
2
|
+
import { GasLimitOverflowError, SafeSimulationFailedError } from "../../errors.js";
|
|
3
|
+
export function evaluateSimulationResult(result, block, gasThresholdPercent) {
|
|
4
|
+
const threshold = (block.gasLimit * BigInt(gasThresholdPercent ?? 95)) / 100n;
|
|
5
|
+
if (result.success && result.gas > threshold) {
|
|
6
|
+
return Effect.fail(new GasLimitOverflowError({
|
|
7
|
+
blockGasLimit: block.gasLimit,
|
|
8
|
+
estimatedGas: result.gas,
|
|
9
|
+
message: "Gas consumption exceeds threshold of block gas limit. Try splitting into smaller batches.",
|
|
10
|
+
threshold,
|
|
11
|
+
}));
|
|
12
|
+
}
|
|
13
|
+
if (!result.success) {
|
|
14
|
+
return Effect.fail(new SafeSimulationFailedError({
|
|
15
|
+
message: "Transaction simulation failed - the transaction would revert",
|
|
16
|
+
}));
|
|
17
|
+
}
|
|
18
|
+
return Effect.succeed({ estimatedGas: result.gas, success: true });
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=evaluation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"evaluation.js","sourceRoot":"","sources":["../../../../../src/safe/simulation/internal/evaluation/evaluation.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,qBAAqB,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAC;AAOnF,MAAM,UAAU,wBAAwB,CACtC,MAAyB,EACzB,KAAkB,EAClB,mBAA4B;IAE5B,MAAM,SAAS,GAAG,CAAC,KAAK,CAAC,QAAQ,GAAG,MAAM,CAAC,mBAAmB,IAAI,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC;IAE9E,IAAI,MAAM,CAAC,OAAO,IAAI,MAAM,CAAC,GAAG,GAAG,SAAS,EAAE,CAAC;QAC7C,OAAO,MAAM,CAAC,IAAI,CAChB,IAAI,qBAAqB,CAAC;YACxB,aAAa,EAAE,KAAK,CAAC,QAAQ;YAC7B,YAAY,EAAE,MAAM,CAAC,GAAG;YACxB,OAAO,EACL,2FAA2F;YAC7F,SAAS;SACV,CAAC,CACH,CAAC;IACJ,CAAC;IAED,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QACpB,OAAO,MAAM,CAAC,IAAI,CAChB,IAAI,yBAAyB,CAAC;YAC5B,OAAO,EAAE,8DAA8D;SACxE,CAAC,CACH,CAAC;IACJ,CAAC;IAED,OAAO,MAAM,CAAC,OAAO,CAAC,EAAE,YAAY,EAAE,MAAM,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;AACrE,CAAC","sourcesContent":["/**\n * Final evaluation of simulation outcomes against policy thresholds.\n */\nimport { Effect } from \"effect\";\nimport { GasLimitOverflowError, SafeSimulationFailedError } from \"../../errors.js\";\nimport type { SafeSimulationResult } from \"../../types.js\";\nimport type { LatestBlock, SimulationDecoded } from \"../types/index.js\";\n\n/**\n * Apply success and gas threshold checks to the decoded result.\n */\nexport function evaluateSimulationResult(\n result: SimulationDecoded,\n block: LatestBlock,\n gasThresholdPercent?: number\n): Effect.Effect<SafeSimulationResult, GasLimitOverflowError | SafeSimulationFailedError> {\n const threshold = (block.gasLimit * BigInt(gasThresholdPercent ?? 95)) / 100n;\n\n if (result.success && result.gas > threshold) {\n return Effect.fail(\n new GasLimitOverflowError({\n blockGasLimit: block.gasLimit,\n estimatedGas: result.gas,\n message:\n \"Gas consumption exceeds threshold of block gas limit. Try splitting into smaller batches.\",\n threshold,\n })\n );\n }\n\n if (!result.success) {\n return Effect.fail(\n new SafeSimulationFailedError({\n message: \"Transaction simulation failed - the transaction would revert\",\n })\n );\n }\n\n return Effect.succeed({ estimatedGas: result.gas, success: true });\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/safe/simulation/internal/evaluation/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/safe/simulation/internal/evaluation/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC","sourcesContent":["export { evaluateSimulationResult } from \"./evaluation.js\";\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Effect } from "effect";
|
|
2
|
+
import type { Address, Hex, PublicClient } from "viem";
|
|
3
|
+
import { SafeSimulationFailedError, SimulationDecodeError } from "../../errors.js";
|
|
4
|
+
import type { LatestBlock, SimulationDecoded } from "../types/index.js";
|
|
5
|
+
export declare function extractRevertData(error: unknown): string | undefined;
|
|
6
|
+
export declare function callSimulateAndExtractRevertData(client: PublicClient, safeAddress: Address, safeCalldata: Hex): Promise<string>;
|
|
7
|
+
export declare function simulateAndDecode(client: PublicClient, safeAddress: Address, safeCalldata: Hex): Effect.Effect<SimulationDecoded, SafeSimulationFailedError | SimulationDecodeError>;
|
|
8
|
+
export declare function fetchLatestBlock(client: PublicClient): Effect.Effect<LatestBlock, SafeSimulationFailedError>;
|
|
9
|
+
//# sourceMappingURL=execution.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execution.d.ts","sourceRoot":"","sources":["../../../../../src/safe/simulation/internal/execution/execution.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,MAAM,CAAC;AAGvD,OAAO,EAAE,yBAAyB,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AACnF,OAAO,KAAK,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAKxE,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAiBpE;AAKD,wBAAsB,gCAAgC,CACpD,MAAM,EAAE,YAAY,EACpB,WAAW,EAAE,OAAO,EACpB,YAAY,EAAE,GAAG,GAChB,OAAO,CAAC,MAAM,CAAC,CAejB;AAKD,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,YAAY,EACpB,WAAW,EAAE,OAAO,EACpB,YAAY,EAAE,GAAG,GAChB,MAAM,CAAC,MAAM,CAAC,iBAAiB,EAAE,yBAAyB,GAAG,qBAAqB,CAAC,CAqBrF;AAKD,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,YAAY,GACnB,MAAM,CAAC,MAAM,CAAC,WAAW,EAAE,yBAAyB,CAAC,CASvD"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { Effect } from "effect";
|
|
2
|
+
import { BaseError as CoreError } from "viem";
|
|
3
|
+
import { decodeSimulationData } from "../../encoding.js";
|
|
4
|
+
import { SafeSimulationFailedError, SimulationDecodeError } from "../../errors.js";
|
|
5
|
+
export function extractRevertData(error) {
|
|
6
|
+
if (!(error instanceof CoreError)) {
|
|
7
|
+
return undefined;
|
|
8
|
+
}
|
|
9
|
+
const revertError = error.walk((err) => {
|
|
10
|
+
const typedErr = err;
|
|
11
|
+
return typeof typedErr.data === "string";
|
|
12
|
+
});
|
|
13
|
+
if (!revertError) {
|
|
14
|
+
return undefined;
|
|
15
|
+
}
|
|
16
|
+
const typedErr = revertError;
|
|
17
|
+
const extractedData = typedErr.data;
|
|
18
|
+
return typeof extractedData === "string" ? extractedData : undefined;
|
|
19
|
+
}
|
|
20
|
+
export async function callSimulateAndExtractRevertData(client, safeAddress, safeCalldata) {
|
|
21
|
+
try {
|
|
22
|
+
await client.call({
|
|
23
|
+
account: safeAddress,
|
|
24
|
+
data: safeCalldata,
|
|
25
|
+
to: safeAddress,
|
|
26
|
+
});
|
|
27
|
+
throw new Error("simulateAndRevert did not revert");
|
|
28
|
+
}
|
|
29
|
+
catch (error) {
|
|
30
|
+
const revertData = extractRevertData(error);
|
|
31
|
+
if (revertData) {
|
|
32
|
+
return revertData;
|
|
33
|
+
}
|
|
34
|
+
throw error;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
export function simulateAndDecode(client, safeAddress, safeCalldata) {
|
|
38
|
+
return Effect.gen(function* () {
|
|
39
|
+
const revertData = yield* Effect.tryPromise({
|
|
40
|
+
catch: (error) => new SafeSimulationFailedError({
|
|
41
|
+
cause: error,
|
|
42
|
+
message: "Network error or unexpected behavior during simulation",
|
|
43
|
+
}),
|
|
44
|
+
try: () => callSimulateAndExtractRevertData(client, safeAddress, safeCalldata),
|
|
45
|
+
});
|
|
46
|
+
return yield* Effect.try({
|
|
47
|
+
catch: (error) => new SimulationDecodeError({
|
|
48
|
+
cause: error,
|
|
49
|
+
message: "Failed to decode simulation revert data - unexpected format",
|
|
50
|
+
revertData,
|
|
51
|
+
}),
|
|
52
|
+
try: () => decodeSimulationData(revertData),
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
export function fetchLatestBlock(client) {
|
|
57
|
+
return Effect.tryPromise({
|
|
58
|
+
catch: (e) => new SafeSimulationFailedError({
|
|
59
|
+
cause: e,
|
|
60
|
+
message: `Failed to fetch block: ${e}`,
|
|
61
|
+
}),
|
|
62
|
+
try: () => client.getBlock({ blockTag: "latest" }),
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=execution.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execution.js","sourceRoot":"","sources":["../../../../../src/safe/simulation/internal/execution/execution.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,EAAE,SAAS,IAAI,SAAS,EAAE,MAAM,MAAM,CAAC;AAC9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,yBAAyB,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAMnF,MAAM,UAAU,iBAAiB,CAAC,KAAc;IAC9C,IAAI,CAAC,CAAC,KAAK,YAAY,SAAS,CAAC,EAAE,CAAC;QAClC,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,MAAM,WAAW,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE;QACrC,MAAM,QAAQ,GAAG,GAAyC,CAAC;QAC3D,OAAO,OAAO,QAAQ,CAAC,I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AK,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC;YACvB,KAAK,EAAE,CAAC,KAAK,EAAE,EAAE,CACf,IAAI,qBAAqB,CAAC;gBACxB,KAAK,EAAE,KAAK;gBACZ,OAAO,EAAE,6DAA6D;gBACtE,UAAU;aACX,CAAC;YACJ,GAAG,EAAE,GAAG,EAAE,CAAC,oBAAoB,CAAC,UAAU,CAAC;SAC5C,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC;AAKD,MAAM,UAAU,gBAAgB,CAC9B,MAAoB;IAEpB,OAAO,MAAM,CAAC,UAAU,CAAC;QACvB,KAAK,EAAE,CAAC,CAAC,EAAE,EAAE,CACX,IAAI,yBAAyB,CAAC;YAC5B,KAAK,EAAE,CAAC;YACR,OAAO,EAAE,0BAA0B,CAAC,EAAE;SACvC,CAAC;QACJ,GAAG,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC;KACnD,CAAC,CAAC;AACL,CAAC","sourcesContent":["/**\n * On-chain execution and decoding helpers for Safe simulation.\n */\nimport { Effect } from \"effect\";\nimport type { Address, Hex, PublicClient } from \"viem\";\nimport { BaseError as CoreError } from \"viem\";\nimport { decodeSimulationData } from \"../../encoding.js\";\nimport { SafeSimulationFailedError, SimulationDecodeError } from \"../../errors.js\";\nimport type { LatestBlock, SimulationDecoded } from \"../types/index.js\";\n\n/**\n * Extract revert data from a viem CoreError tree, if present.\n */\nexport function extractRevertData(error: unknown): string | undefined {\n if (!(error instanceof CoreError)) {\n return undefined;\n }\n\n const revertError = error.walk((err) => {\n const typedErr = err as unknown as Record<string, unknown>;\n return typeof typedErr.data === \"string\";\n });\n\n if (!revertError) {\n return undefined;\n }\n\n const typedErr = revertError as unknown as Record<string, unknown>;\n const extractedData = typedErr.data;\n return typeof extractedData === \"string\" ? extractedData : undefined;\n}\n\n/**\n * Execute simulateAndRevert and return the revert data payload.\n */\nexport async function callSimulateAndExtractRevertData(\n client: PublicClient,\n safeAddress: Address,\n safeCalldata: Hex\n): Promise<string> {\n try {\n await client.call({\n account: safeAddress,\n data: safeCalldata,\n to: safeAddress,\n });\n throw new Error(\"simulateAndRevert did not revert\");\n } catch (error: unknown) {\n const revertData = extractRevertData(error);\n if (revertData) {\n return revertData;\n }\n throw error;\n }\n}\n\n/**\n * Run the on-chain call and decode the revert payload into a gas estimate.\n */\nexport function simulateAndDecode(\n client: PublicClient,\n safeAddress: Address,\n safeCalldata: Hex\n): Effect.Effect<SimulationDecoded, SafeSimulationFailedError | SimulationDecodeError> {\n return Effect.gen(function* () {\n const revertData = yield* Effect.tryPromise({\n catch: (error) =>\n new SafeSimulationFailedError({\n cause: error,\n message: \"Network error or unexpected behavior during simulation\",\n }),\n try: () => callSimulateAndExtractRevertData(client, safeAddress, safeCalldata),\n });\n\n return yield* Effect.try({\n catch: (error) =>\n new SimulationDecodeError({\n cause: error,\n message: \"Failed to decode simulation revert data - unexpected format\",\n revertData,\n }),\n try: () => decodeSimulationData(revertData),\n });\n });\n}\n\n/**\n * Fetch the latest block to derive the gas threshold.\n */\nexport function fetchLatestBlock(\n client: PublicClient\n): Effect.Effect<LatestBlock, SafeSimulationFailedError> {\n return Effect.tryPromise({\n catch: (e) =>\n new SafeSimulationFailedError({\n cause: e,\n message: `Failed to fetch block: ${e}`,\n }),\n try: () => client.getBlock({ blockTag: \"latest\" }),\n });\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/safe/simulation/internal/execution/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gCAAgC,EAChC,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/safe/simulation/internal/execution/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gCAAgC,EAChC,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,gBAAgB,CAAC","sourcesContent":["export {\n callSimulateAndExtractRevertData,\n extractRevertData,\n fetchLatestBlock,\n simulateAndDecode,\n} from \"./execution.js\";\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/safe/simulation/internal/limits/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/safe/simulation/internal/limits/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC","sourcesContent":["export { enforceTxSizeLimit } from \"./limits.js\";\n"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Effect } from "effect";
|
|
2
|
+
import type { Hex } from "viem";
|
|
3
|
+
import { TransactionSizeTooLargeError } from "../../errors.js";
|
|
4
|
+
export declare function enforceTxSizeLimit(safeCalldata: Hex, txSizeLimit?: number): Effect.Effect<void, TransactionSizeTooLargeError>;
|
|
5
|
+
//# sourceMappingURL=limits.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"limits.d.ts","sourceRoot":"","sources":["../../../../../src/safe/simulation/internal/limits/limits.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAChC,OAAO,EAAE,4BAA4B,EAAE,MAAM,iBAAiB,CAAC;AAK/D,wBAAgB,kBAAkB,CAChC,YAAY,EAAE,GAAG,EACjB,WAAW,CAAC,EAAE,MAAM,GACnB,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,4BAA4B,CAAC,CAiBnD"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Effect } from "effect";
|
|
2
|
+
import { TransactionSizeTooLargeError } from "../../errors.js";
|
|
3
|
+
export function enforceTxSizeLimit(safeCalldata, txSizeLimit) {
|
|
4
|
+
if (!txSizeLimit) {
|
|
5
|
+
return Effect.void;
|
|
6
|
+
}
|
|
7
|
+
return Effect.gen(function* () {
|
|
8
|
+
const sizeInBytes = (safeCalldata.length - 2) / 2;
|
|
9
|
+
if (sizeInBytes > txSizeLimit) {
|
|
10
|
+
return yield* Effect.fail(new TransactionSizeTooLargeError({
|
|
11
|
+
actualSize: sizeInBytes,
|
|
12
|
+
maxSize: txSizeLimit,
|
|
13
|
+
message: `Transaction size (${sizeInBytes} bytes) exceeds chain limit (${txSizeLimit} bytes). Try splitting into smaller batches.`,
|
|
14
|
+
}));
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=limits.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"limits.js","sourceRoot":"","sources":["../../../../../src/safe/simulation/internal/limits/limits.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,EAAE,4BAA4B,EAAE,MAAM,iBAAiB,CAAC;AAK/D,MAAM,UAAU,kBAAkB,CAChC,YAAiB,EACjB,WAAoB;IAEpB,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,OAAO,MAAM,CAAC,IAAI,CAAC;IACrB,CAAC;IAED,OAAO,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;QACzB,MAAM,WAAW,GAAG,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;QAClD,IAAI,WAAW,GAAG,WAAW,EAAE,CAAC;YAC9B,OAAO,KAAK,CAAC,CAAC,MAAM,CAAC,IAAI,CACvB,IAAI,4BAA4B,CAAC;gBAC/B,UAAU,EAAE,WAAW;gBACvB,OAAO,EAAE,WAAW;gBACpB,OAAO,EAAE,qBAAqB,WAAW,gCAAgC,WAAW,8CAA8C;aACnI,CAAC,CACH,CAAC;QACJ,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["/**\n * Size limit enforcement for Safe simulation calldata.\n */\nimport { Effect } from \"effect\";\nimport type { Hex } from \"viem\";\nimport { TransactionSizeTooLargeError } from \"../../errors.js\";\n\n/**\n * Enforce chain-specific transaction size constraints (if provided).\n */\nexport function enforceTxSizeLimit(\n safeCalldata: Hex,\n txSizeLimit?: number\n): Effect.Effect<void, TransactionSizeTooLargeError> {\n if (!txSizeLimit) {\n return Effect.void;\n }\n\n return Effect.gen(function* () {\n const sizeInBytes = (safeCalldata.length - 2) / 2;\n if (sizeInBytes > txSizeLimit) {\n return yield* Effect.fail(\n new TransactionSizeTooLargeError({\n actualSize: sizeInBytes,\n maxSize: txSizeLimit,\n message: `Transaction size (${sizeInBytes} bytes) exceeds chain limit (${txSizeLimit} bytes). Try splitting into smaller batches.`,\n })\n );\n }\n });\n}\n"]}
|